diff --git "a/assets/index-BF3kFlxf.js" "b/assets/index-BF3kFlxf.js" new file mode 100644--- /dev/null +++ "b/assets/index-BF3kFlxf.js" @@ -0,0 +1,3908 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-ESwAkYv_.js","assets/index-hbEOThyH.js","assets/index-CdIFIzs9.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/BasicTextarea.vue_vue_type_script_setup_true_lang-BhLedwI4.js","assets/queues-B_oY9-A9.js","assets/queue-CBg-7ZZh.js","assets/index-DeIVU6Cb.css","assets/_...all_-aHi8_1ou.js","assets/image-DoDJoUPx.js","assets/image-BhuwcwI9.css","assets/queue-C19rjZwy.js","assets/filter-message-BUeQykfo.js","assets/delays-CtCoaidi.js","assets/emotions-DRQZdRh9.js","assets/messages-DRnXBu3p.js"])))=>i.map(i=>d[i]); +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function lm(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const ht={},Oo=[],Li=()=>{},rT=()=>!1,Tf=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),cm=n=>n.startsWith("onUpdate:"),qt=Object.assign,um=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},sT=Object.prototype.hasOwnProperty,_t=(n,e)=>sT.call(n,e),Ue=Array.isArray,No=n=>Ul(n)==="[object Map]",ea=n=>Ul(n)==="[object Set]",e_=n=>Ul(n)==="[object Date]",$e=n=>typeof n=="function",kt=n=>typeof n=="string",di=n=>typeof n=="symbol",St=n=>n!==null&&typeof n=="object",ky=n=>(St(n)||$e(n))&&$e(n.then)&&$e(n.catch),zy=Object.prototype.toString,Ul=n=>zy.call(n),oT=n=>Ul(n).slice(8,-1),Vy=n=>Ul(n)==="[object Object]",fm=n=>kt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Ia=lm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wf=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},aT=/-(\w)/g,Gn=wf(n=>n.replace(aT,(e,t)=>t?t.toUpperCase():"")),lT=/\B([A-Z])/g,qr=wf(n=>n.replace(lT,"-$1").toLowerCase()),Af=wf(n=>n.charAt(0).toUpperCase()+n.slice(1)),Oh=wf(n=>n?`on${Af(n)}`:""),Pn=(n,e)=>!Object.is(n,e),ou=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},yu=n=>{const e=parseFloat(n);return isNaN(e)?n:e},cT=n=>{const e=kt(n)?Number(n):NaN;return isNaN(e)?n:e};let t_;const Cf=()=>t_||(t_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Rf(n){if(Ue(n)){const e={};for(let t=0;t{if(t){const i=t.split(fT);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Pf(n){let e="";if(kt(n))e=n;else if(Ue(n))for(let t=0;tHs(t,e))}const Wy=n=>!!(n&&n.__v_isRef===!0),_T=n=>kt(n)?n:n==null?"":Ue(n)||St(n)&&(n.toString===zy||!$e(n.toString))?Wy(n)?_T(n.value):JSON.stringify(n,Xy,2):String(n),Xy=(n,e)=>Wy(e)?Xy(n,e.value):No(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,r],s)=>(t[Nh(i,s)+" =>"]=r,t),{})}:ea(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Nh(t))}:di(e)?Nh(e):St(e)&&!Ue(e)&&!Vy(e)?String(e):e,Nh=(n,e="")=>{var t;return di(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let gn;class $y{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=gn,!e&&gn&&(this.index=(gn.scopes||(gn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(Da){let e=Da;for(Da=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;La;){let e=La;for(La=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function Ky(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Zy(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),_m(i),vT(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function ep(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Jy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Jy(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Qa))return;n.globalVersion=Qa;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!ep(n)){n.flags&=-3;return}const t=wt,i=fi;wt=n,fi=!0;try{Ky(n);const r=n.fn(n._value);(e.version===0||Pn(r,n._value))&&(n._value=r,e.version++)}catch(r){throw e.version++,r}finally{wt=t,fi=i,Zy(n),n.flags&=-3}}function _m(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)_m(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function vT(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let fi=!0;const Qy=[];function Yr(){Qy.push(fi),fi=!1}function jr(){const n=Qy.pop();fi=n===void 0?!0:n}function n_(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=wt;wt=void 0;try{e()}finally{wt=t}}}let Qa=0;class yT{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Lf{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!wt||!fi||wt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==wt)t=this.activeLink=new yT(wt,this),wt.deps?(t.prevDep=wt.depsTail,wt.depsTail.nextDep=t,wt.depsTail=t):wt.deps=wt.depsTail=t,ex(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=wt.depsTail,t.nextDep=void 0,wt.depsTail.nextDep=t,wt.depsTail=t,wt.deps===t&&(wt.deps=i)}return t}trigger(e){this.version++,Qa++,this.notify(e)}notify(e){mm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{gm()}}}function ex(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)ex(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const xu=new WeakMap,Us=Symbol(""),tp=Symbol(""),el=Symbol("");function an(n,e,t){if(fi&&wt){let i=xu.get(n);i||xu.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new Lf),r.map=i,r.key=t),r.track()}}function tr(n,e,t,i,r,s){const o=xu.get(n);if(!o){Qa++;return}const a=l=>{l&&l.trigger()};if(mm(),e==="clear")o.forEach(a);else{const l=Ue(n),c=l&&fm(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,h)=>{(h==="length"||h===el||!di(h)&&h>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(el)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Us)),No(n)&&a(o.get(tp)));break;case"delete":l||(a(o.get(Us)),No(n)&&a(o.get(tp)));break;case"set":No(n)&&a(o.get(Us));break}}gm()}function xT(n,e){const t=xu.get(n);return t&&t.get(e)}function io(n){const e=nt(n);return e===n?e:(an(e,"iterate",el),Jn(n)?e:e.map(ln))}function Df(n){return an(n=nt(n),"iterate",el),n}const bT={__proto__:null,[Symbol.iterator](){return Fh(this,Symbol.iterator,ln)},concat(...n){return io(this).concat(...n.map(e=>Ue(e)?io(e):e))},entries(){return Fh(this,"entries",n=>(n[1]=ln(n[1]),n))},every(n,e){return Wi(this,"every",n,e,void 0,arguments)},filter(n,e){return Wi(this,"filter",n,e,t=>t.map(ln),arguments)},find(n,e){return Wi(this,"find",n,e,ln,arguments)},findIndex(n,e){return Wi(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Wi(this,"findLast",n,e,ln,arguments)},findLastIndex(n,e){return Wi(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Wi(this,"forEach",n,e,void 0,arguments)},includes(...n){return Bh(this,"includes",n)},indexOf(...n){return Bh(this,"indexOf",n)},join(n){return io(this).join(n)},lastIndexOf(...n){return Bh(this,"lastIndexOf",n)},map(n,e){return Wi(this,"map",n,e,void 0,arguments)},pop(){return ca(this,"pop")},push(...n){return ca(this,"push",n)},reduce(n,...e){return i_(this,"reduce",n,e)},reduceRight(n,...e){return i_(this,"reduceRight",n,e)},shift(){return ca(this,"shift")},some(n,e){return Wi(this,"some",n,e,void 0,arguments)},splice(...n){return ca(this,"splice",n)},toReversed(){return io(this).toReversed()},toSorted(n){return io(this).toSorted(n)},toSpliced(...n){return io(this).toSpliced(...n)},unshift(...n){return ca(this,"unshift",n)},values(){return Fh(this,"values",ln)}};function Fh(n,e,t){const i=Df(n),r=i[e]();return i!==n&&!Jn(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=t(s.value)),s}),r}const MT=Array.prototype;function Wi(n,e,t,i,r,s){const o=Df(n),a=o!==n&&!Jn(n),l=o[e];if(l!==MT[e]){const f=l.apply(n,s);return a?ln(f):f}let c=t;o!==n&&(a?c=function(f,h){return t.call(this,ln(f),h,n)}:t.length>2&&(c=function(f,h){return t.call(this,f,h,n)}));const u=l.call(o,c,i);return a&&r?r(u):u}function i_(n,e,t,i){const r=Df(n);let s=t;return r!==n&&(Jn(n)?t.length>3&&(s=function(o,a,l){return t.call(this,o,a,l,n)}):s=function(o,a,l){return t.call(this,o,ln(a),l,n)}),r[e](s,...i)}function Bh(n,e,t){const i=nt(n);an(i,"iterate",el);const r=i[e](...t);return(r===-1||r===!1)&&xm(t[0])?(t[0]=nt(t[0]),i[e](...t)):r}function ca(n,e,t=[]){Yr(),mm();const i=nt(n)[e].apply(n,t);return gm(),jr(),i}const ST=lm("__proto__,__v_isRef,__isVue"),tx=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(di));function ET(n){di(n)||(n=String(n));const e=nt(this);return an(e,"has",n),e.hasOwnProperty(n)}class nx{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?OT:ox:s?sx:rx).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Ue(e);if(!r){let l;if(o&&(l=bT[t]))return l;if(t==="hasOwnProperty")return ET}const a=Reflect.get(e,t,Et(e)?e:i);return(di(t)?tx.has(t):ST(t))||(r||an(e,"get",t),s)?a:Et(a)?o&&fm(t)?a:a.value:St(a)?r?zo(a):zi(a):a}}class ix extends nx{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];if(!this._isShallow){const l=Gs(s);if(!Jn(i)&&!Gs(i)&&(s=nt(s),i=nt(i)),!Ue(e)&&Et(s)&&!Et(i))return l?!1:(s.value=i,!0)}const o=Ue(e)&&fm(t)?Number(t)n,ic=n=>Reflect.getPrototypeOf(n);function RT(n,e,t){return function(...i){const r=this.__v_raw,s=nt(r),o=No(s),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=r[n](...i),u=t?np:e?ip:ln;return!e&&an(s,"iterate",l?tp:Us),{next(){const{value:f,done:h}=c.next();return h?{value:f,done:h}:{value:a?[u(f[0]),u(f[1])]:u(f),done:h}},[Symbol.iterator](){return this}}}}function rc(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function PT(n,e){const t={get(r){const s=this.__v_raw,o=nt(s),a=nt(r);n||(Pn(r,a)&&an(o,"get",r),an(o,"get",a));const{has:l}=ic(o),c=e?np:n?ip:ln;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!n&&an(nt(r),"iterate",Us),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=nt(s),a=nt(r);return n||(Pn(r,a)&&an(o,"has",r),an(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=nt(a),c=e?np:n?ip:ln;return!n&&an(l,"iterate",Us),a.forEach((u,f)=>r.call(s,c(u),c(f),o))}};return qt(t,n?{add:rc("add"),set:rc("set"),delete:rc("delete"),clear:rc("clear")}:{add(r){!e&&!Jn(r)&&!Gs(r)&&(r=nt(r));const s=nt(this);return ic(s).has.call(s,r)||(s.add(r),tr(s,"add",r,r)),this},set(r,s){!e&&!Jn(s)&&!Gs(s)&&(s=nt(s));const o=nt(this),{has:a,get:l}=ic(o);let c=a.call(o,r);c||(r=nt(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?Pn(s,u)&&tr(o,"set",r,s):tr(o,"add",r,s),this},delete(r){const s=nt(this),{has:o,get:a}=ic(s);let l=o.call(s,r);l||(r=nt(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&tr(s,"delete",r,void 0),c},clear(){const r=nt(this),s=r.size!==0,o=r.clear();return s&&tr(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=RT(r,n,e)}),t}function vm(n,e){const t=PT(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(_t(t,r)&&r in i?t:i,r,s)}const IT={get:vm(!1,!1)},LT={get:vm(!1,!0)},DT={get:vm(!0,!1)};const rx=new WeakMap,sx=new WeakMap,ox=new WeakMap,OT=new WeakMap;function NT(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function UT(n){return n.__v_skip||!Object.isExtensible(n)?0:NT(oT(n))}function zi(n){return Gs(n)?n:ym(n,!1,wT,IT,rx)}function ax(n){return ym(n,!1,CT,LT,sx)}function zo(n){return ym(n,!0,AT,DT,ox)}function ym(n,e,t,i,r){if(!St(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=r.get(n);if(s)return s;const o=UT(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return r.set(n,a),a}function ur(n){return Gs(n)?ur(n.__v_raw):!!(n&&n.__v_isReactive)}function Gs(n){return!!(n&&n.__v_isReadonly)}function Jn(n){return!!(n&&n.__v_isShallow)}function xm(n){return n?!!n.__v_raw:!1}function nt(n){const e=n&&n.__v_raw;return e?nt(e):n}function bm(n){return!_t(n,"__v_skip")&&Object.isExtensible(n)&&Hy(n,"__v_skip",!0),n}const ln=n=>St(n)?zi(n):n,ip=n=>St(n)?zo(n):n;function Et(n){return n?n.__v_isRef===!0:!1}function Ge(n){return lx(n,!1)}function hi(n){return lx(n,!0)}function lx(n,e){return Et(n)?n:new FT(n,e)}class FT{constructor(e,t){this.dep=new Lf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:nt(e),this._value=t?e:ln(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Jn(e)||Gs(e);e=i?e:nt(e),Pn(e,t)&&(this._rawValue=e,this._value=i?e:ln(e),this.dep.trigger())}}function Ft(n){return Et(n)?n.value:n}const BT={get:(n,e,t)=>e==="__v_raw"?n:Ft(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const r=n[e];return Et(r)&&!Et(t)?(r.value=t,!0):Reflect.set(n,e,t,i)}};function cx(n){return ur(n)?n:new Proxy(n,BT)}class kT{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Lf,{get:i,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function ux(n){return new kT(n)}function fx(n){const e=Ue(n)?new Array(n.length):{};for(const t in n)e[t]=hx(n,t);return e}class zT{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return xT(nt(this._object),this._key)}}class VT{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function HT(n,e,t){return Et(n)?n:$e(n)?new VT(n):St(n)&&arguments.length>1?hx(n,e,t):Ge(n)}function hx(n,e,t){const i=n[e];return Et(i)?i:new zT(n,e,t)}class GT{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Lf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Qa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&wt!==this)return jy(this,!0),!0}get value(){const e=this.dep.track();return Jy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function WT(n,e,t=!1){let i,r;return $e(n)?i=n:(i=n.get,r=n.set),new GT(i,r,t)}const sc={},bu=new WeakMap;let Ss;function XT(n,e=!1,t=Ss){if(t){let i=bu.get(t);i||bu.set(t,i=[]),i.push(n)}}function $T(n,e,t=ht){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=t,c=v=>r?v:Jn(v)||r===!1||r===0?nr(v,1):nr(v);let u,f,h,d,m=!1,_=!1;if(Et(n)?(f=()=>n.value,m=Jn(n)):ur(n)?(f=()=>c(n),m=!0):Ue(n)?(_=!0,m=n.some(v=>ur(v)||Jn(v)),f=()=>n.map(v=>{if(Et(v))return v.value;if(ur(v))return c(v);if($e(v))return l?l(v,2):v()})):$e(n)?e?f=l?()=>l(n,2):n:f=()=>{if(h){Yr();try{h()}finally{jr()}}const v=Ss;Ss=u;try{return l?l(n,3,[d]):n(d)}finally{Ss=v}}:f=Li,e&&r){const v=f,S=r===!0?1/0:r;f=()=>nr(v(),S)}const g=If(),p=()=>{u.stop(),g&&g.active&&um(g.effects,u)};if(s&&e){const v=e;e=(...S)=>{v(...S),p()}}let y=_?new Array(n.length).fill(sc):sc;const x=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const S=u.run();if(r||m||(_?S.some((E,A)=>Pn(E,y[A])):Pn(S,y))){h&&h();const E=Ss;Ss=u;try{const A=[S,y===sc?void 0:_&&y[0]===sc?[]:y,d];l?l(e,3,A):e(...A),y=S}finally{Ss=E}}}else u.run()};return a&&a(x),u=new qy(f),u.scheduler=o?()=>o(x,!1):x,d=v=>XT(v,!1,u),h=u.onStop=()=>{const v=bu.get(u);if(v){if(l)l(v,4);else for(const S of v)S();bu.delete(u)}},e?i?x(!0):y=u.run():o?o(x.bind(null,!0),!0):u.run(),p.pause=u.pause.bind(u),p.resume=u.resume.bind(u),p.stop=p,p}function nr(n,e=1/0,t){if(e<=0||!St(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Et(n))nr(n.value,e,t);else if(Ue(n))for(let i=0;i{nr(i,e,t)});else if(Vy(n)){for(const i in n)nr(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&nr(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Fl(n,e,t,i){try{return i?n(...i):n()}catch(r){Of(r,e,t)}}function pi(n,e,t,i){if($e(n)){const r=Fl(n,e,t,i);return r&&ky(r)&&r.catch(s=>{Of(s,e,t)}),r}if(Ue(n)){const r=[];for(let s=0;s>>1,r=vn[i],s=tl(r);s=tl(t)?vn.push(n):vn.splice(YT(e),0,n),n.flags|=1,px()}}function px(){Mu||(Mu=dx.then(gx))}function jT(n){Ue(n)?Uo.push(...n):Dr&&n.id===-1?Dr.splice(Eo+1,0,n):n.flags&1||(Uo.push(n),n.flags|=1),px()}function r_(n,e,t=wi+1){for(;ttl(t)-tl(i));if(Uo.length=0,Dr){Dr.push(...e);return}for(Dr=e,Eo=0;Eon.id==null?n.flags&2?-1:1/0:n.id;function gx(n){try{for(wi=0;wi{i._d&&p_(-1);const s=Su(e);let o;try{o=n(...r)}finally{Su(s),i._d&&p_(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function EV(n,e){if(Wt===null)return n;const t=zf(Wt),i=n.dirs||(n.dirs=[]);for(let r=0;rn.__isTeleport,Or=Symbol("_leaveCb"),oc=Symbol("_enterCb");function JT(){const n={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Zs(()=>{n.isMounted=!0}),Ax(()=>{n.isUnmounting=!0}),n}const qn=[Function,Array],yx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:qn,onEnter:qn,onAfterEnter:qn,onEnterCancelled:qn,onBeforeLeave:qn,onLeave:qn,onAfterLeave:qn,onLeaveCancelled:qn,onBeforeAppear:qn,onAppear:qn,onAfterAppear:qn,onAppearCancelled:qn},xx=n=>{const e=n.subTree;return e.component?xx(e.component):e},QT={name:"BaseTransition",props:yx,setup(n,{slots:e}){const t=ei(),i=JT();return()=>{const r=e.default&&Sx(e.default(),!0);if(!r||!r.length)return;const s=bx(r),o=nt(n),{mode:a}=o;if(i.isLeaving)return kh(s);const l=s_(s);if(!l)return kh(s);let c=rp(l,o,i,t,f=>c=f);l.type!==yn&&nl(l,c);let u=t.subTree&&s_(t.subTree);if(u&&u.type!==yn&&!As(l,u)&&xx(t).type!==yn){let f=rp(u,o,i,t);if(nl(u,f),a==="out-in"&&l.type!==yn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},kh(s);a==="in-out"&&l.type!==yn?f.delayLeave=(h,d,m)=>{const _=Mx(i,u);_[String(u.key)]=u,h[Or]=()=>{d(),h[Or]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{m(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function bx(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==yn){e=t;break}}return e}const ew=QT;function Mx(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function rp(n,e,t,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:h,onLeave:d,onAfterLeave:m,onLeaveCancelled:_,onBeforeAppear:g,onAppear:p,onAfterAppear:y,onAppearCancelled:x}=e,v=String(n.key),S=Mx(t,n),E=(b,M)=>{b&&pi(b,i,9,M)},A=(b,M)=>{const U=M[1];E(b,M),Ue(b)?b.every(z=>z.length<=1)&&U():b.length<=1&&U()},I={mode:o,persisted:a,beforeEnter(b){let M=l;if(!t.isMounted)if(s)M=g||l;else return;b[Or]&&b[Or](!0);const U=S[v];U&&As(n,U)&&U.el[Or]&&U.el[Or](),E(M,[b])},enter(b){let M=c,U=u,z=f;if(!t.isMounted)if(s)M=p||c,U=y||u,z=x||f;else return;let H=!1;const K=b[oc]=ee=>{H||(H=!0,ee?E(z,[b]):E(U,[b]),I.delayedLeave&&I.delayedLeave(),b[oc]=void 0)};M?A(M,[b,K]):K()},leave(b,M){const U=String(n.key);if(b[oc]&&b[oc](!0),t.isUnmounting)return M();E(h,[b]);let z=!1;const H=b[Or]=K=>{z||(z=!0,M(),K?E(_,[b]):E(m,[b]),b[Or]=void 0,S[U]===n&&delete S[U])};S[U]=n,d?A(d,[b,H]):H()},clone(b){const M=rp(b,e,t,i,r);return r&&r(M),M}};return I}function kh(n){if(Nf(n))return n=Hr(n),n.children=null,n}function s_(n){if(!Nf(n))return vx(n.type)&&n.children?bx(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&$e(t.default))return t.default()}}function nl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,nl(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function Sx(n,e=!1,t){let i=[],r=0;for(let s=0;s1)for(let s=0;sEu(m,e&&(Ue(e)?e[_]:e),t,i,r));return}if(Fo(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Eu(n,e,t,i.component.subTree);return}const s=i.shapeFlag&4?zf(i.component):i.el,o=r?null:s,{i:a,r:l}=n,c=e&&e.r,u=a.refs===ht?a.refs={}:a.refs,f=a.setupState,h=nt(f),d=f===ht?()=>!1:m=>_t(h,m);if(c!=null&&c!==l&&(kt(c)?(u[c]=null,d(c)&&(f[c]=null)):Et(c)&&(c.value=null)),$e(l))Fl(l,a,12,[o,u]);else{const m=kt(l),_=Et(l);if(m||_){const g=()=>{if(n.f){const p=m?d(l)?f[l]:u[l]:l.value;r?Ue(p)&&um(p,s):Ue(p)?p.includes(s)||p.push(s):m?(u[l]=[s],d(l)&&(f[l]=u[l])):(l.value=[s],n.k&&(u[n.k]=l.value))}else m?(u[l]=o,d(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,kn(g,t)):g()}}}Cf().requestIdleCallback;Cf().cancelIdleCallback;const Fo=n=>!!n.type.__asyncLoader,Nf=n=>n.type.__isKeepAlive;function tw(n,e){Tx(n,"a",e)}function nw(n,e){Tx(n,"da",e)}function Tx(n,e,t=Zt){const i=n.__wdc||(n.__wdc=()=>{let r=t;for(;r;){if(r.isDeactivated)return;r=r.parent}return n()});if(Uf(e,i,t),t){let r=t.parent;for(;r&&r.parent;)Nf(r.parent.vnode)&&iw(i,e,t,r),r=r.parent}}function iw(n,e,t,i){const r=Uf(e,n,i,!0);Fi(()=>{um(i[e],r)},t)}function Uf(n,e,t=Zt,i=!1){if(t){const r=t[n]||(t[n]=[]),s=e.__weh||(e.__weh=(...o)=>{Yr();const a=kl(t),l=pi(e,t,n,o);return a(),jr(),l});return i?r.unshift(s):r.push(s),s}}const vr=n=>(e,t=Zt)=>{(!ol||n==="sp")&&Uf(n,(...i)=>e(...i),t)},rw=vr("bm"),Zs=vr("m"),sw=vr("bu"),wx=vr("u"),Ax=vr("bum"),Fi=vr("um"),ow=vr("sp"),aw=vr("rtg"),lw=vr("rtc");function cw(n,e=Zt){Uf("ec",n,e)}const Cx="components",uw="directives";function TV(n,e){return Rx(Cx,n,!0,e)||n}const fw=Symbol.for("v-ndc");function wV(n){return Rx(uw,n)}function Rx(n,e,t=!0,i=!1){const r=Wt||Zt;if(r){const s=r.type;if(n===Cx){const a=Jw(s,!1);if(a&&(a===e||a===Gn(e)||a===Af(Gn(e))))return s}const o=o_(r[n]||s[n],e)||o_(r.appContext[n],e);return!o&&i?s:o}}function o_(n,e){return n&&(n[e]||n[Gn(e)]||n[Af(Gn(e))])}function AV(n,e,t,i){let r;const s=t,o=Ue(n);if(o||kt(n)){const a=o&&ur(n);let l=!1;a&&(l=!Jn(n),n=Df(n)),r=new Array(n.length);for(let c=0,u=n.length;ce(a,l,void 0,s));else{const a=Object.keys(n);r=new Array(a.length);for(let l=0,c=a.length;lsl(e)?!(e.type===yn||e.type===en&&!Px(e.children)):!0)?n:null}const sp=n=>n?eb(n)?zf(n):sp(n.parent):null,Oa=qt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>sp(n.parent),$root:n=>sp(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Dx(n),$forceUpdate:n=>n.f||(n.f=()=>{Mm(n.update)}),$nextTick:n=>n.n||(n.n=ta.bind(n.proxy)),$watch:n=>Dw.bind(n)}),zh=(n,e)=>n!==ht&&!n.__isScriptSetup&&_t(n,e),hw={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return r[e];case 4:return t[e];case 3:return s[e]}else{if(zh(i,e))return o[e]=1,i[e];if(r!==ht&&_t(r,e))return o[e]=2,r[e];if((c=n.propsOptions[0])&&_t(c,e))return o[e]=3,s[e];if(t!==ht&&_t(t,e))return o[e]=4,t[e];op&&(o[e]=0)}}const u=Oa[e];let f,h;if(u)return e==="$attrs"&&an(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==ht&&_t(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,_t(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:r,ctx:s}=n;return zh(r,e)?(r[e]=t,!0):i!==ht&&_t(i,e)?(i[e]=t,!0):_t(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(s[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:r,propsOptions:s}},o){let a;return!!t[o]||n!==ht&&_t(n,o)||zh(e,o)||(a=s[0])&&_t(a,o)||_t(i,o)||_t(Oa,o)||_t(r.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:_t(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function Sm(){return Ix().slots}function RV(){return Ix().attrs}function Ix(){const n=ei();return n.setupContext||(n.setupContext=nb(n))}function Tu(n){return Ue(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function PV(n,e){return!n||!e?n||e:Ue(n)&&Ue(e)?n.concat(e):qt({},Tu(n),Tu(e))}let op=!0;function dw(n){const e=Dx(n),t=n.proxy,i=n.ctx;op=!1,e.beforeCreate&&a_(e.beforeCreate,n,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:h,beforeUpdate:d,updated:m,activated:_,deactivated:g,beforeDestroy:p,beforeUnmount:y,destroyed:x,unmounted:v,render:S,renderTracked:E,renderTriggered:A,errorCaptured:I,serverPrefetch:b,expose:M,inheritAttrs:U,components:z,directives:H,filters:K}=e;if(c&&pw(c,i,null),o)for(const ie in o){const Q=o[ie];$e(Q)&&(i[ie]=Q.bind(t))}if(r){const ie=r.call(t,t);St(ie)&&(n.data=zi(ie))}if(op=!0,s)for(const ie in s){const Q=s[ie],me=$e(Q)?Q.bind(t,t):$e(Q.get)?Q.get.bind(t,t):Li,ve=!$e(Q)&&$e(Q.set)?Q.set.bind(t):Li,re=it({get:me,set:ve});Object.defineProperty(i,ie,{enumerable:!0,configurable:!0,get:()=>re.value,set:xe=>re.value=xe})}if(a)for(const ie in a)Lx(a[ie],i,t,ie);if(l){const ie=$e(l)?l.call(t):l;Reflect.ownKeys(ie).forEach(Q=>{Vr(Q,ie[Q])})}u&&a_(u,n,"c");function J(ie,Q){Ue(Q)?Q.forEach(me=>ie(me.bind(t))):Q&&ie(Q.bind(t))}if(J(rw,f),J(Zs,h),J(sw,d),J(wx,m),J(tw,_),J(nw,g),J(cw,I),J(lw,E),J(aw,A),J(Ax,y),J(Fi,v),J(ow,b),Ue(M))if(M.length){const ie=n.exposed||(n.exposed={});M.forEach(Q=>{Object.defineProperty(ie,Q,{get:()=>t[Q],set:me=>t[Q]=me})})}else n.exposed||(n.exposed={});S&&n.render===Li&&(n.render=S),U!=null&&(n.inheritAttrs=U),z&&(n.components=z),H&&(n.directives=H),b&&Ex(n)}function pw(n,e,t=Li){Ue(n)&&(n=ap(n));for(const i in n){const r=n[i];let s;St(r)?"default"in r?s=Vn(r.from||i,r.default,!0):s=Vn(r.from||i):s=Vn(r),Et(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function a_(n,e,t){pi(Ue(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Lx(n,e,t,i){let r=i.includes(".")?qx(t,i):()=>t[i];if(kt(n)){const s=e[n];$e(s)&&ft(r,s)}else if($e(n))ft(r,n.bind(t));else if(St(n))if(Ue(n))n.forEach(s=>Lx(s,e,t,i));else{const s=$e(n.handler)?n.handler.bind(t):e[n.handler];$e(s)&&ft(r,s,n)}}function Dx(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=n.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!t&&!i?l=e:(l={},r.length&&r.forEach(c=>wu(l,c,o,!0)),wu(l,e,o)),St(e)&&s.set(e,l),l}function wu(n,e,t,i=!1){const{mixins:r,extends:s}=e;s&&wu(n,s,t,!0),r&&r.forEach(o=>wu(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=mw[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const mw={data:l_,props:c_,emits:c_,methods:Aa,computed:Aa,beforeCreate:dn,created:dn,beforeMount:dn,mounted:dn,beforeUpdate:dn,updated:dn,beforeDestroy:dn,beforeUnmount:dn,destroyed:dn,unmounted:dn,activated:dn,deactivated:dn,errorCaptured:dn,serverPrefetch:dn,components:Aa,directives:Aa,watch:_w,provide:l_,inject:gw};function l_(n,e){return e?n?function(){return qt($e(n)?n.call(this,this):n,$e(e)?e.call(this,this):e)}:e:n}function gw(n,e){return Aa(ap(n),ap(e))}function ap(n){if(Ue(n)){const e={};for(let t=0;t1)return t&&$e(e)?e.call(i&&i.proxy):e}}function xw(){return!!(Zt||Wt||Fs)}const Nx={},Ux=()=>Object.create(Nx),Fx=n=>Object.getPrototypeOf(n)===Nx;function bw(n,e,t,i=!1){const r={},s=Ux();n.propsDefaults=Object.create(null),Bx(n,e,r,s);for(const o in n.propsOptions[0])o in r||(r[o]=void 0);t?n.props=i?r:ax(r):n.type.props?n.props=r:n.props=s,n.attrs=s}function Mw(n,e,t,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=n,a=nt(r),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[h,d]=kx(f,e,!0);qt(o,h),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!s&&!l)return St(n)&&i.set(n,Oo),Oo;if(Ue(s))for(let u=0;un[0]==="_"||n==="$stable",Em=n=>Ue(n)?n.map(Ri):[Ri(n)],Ew=(n,e,t)=>{if(e._n)return e;const i=KT((...r)=>Em(e(...r)),t);return i._c=!1,i},Vx=(n,e,t)=>{const i=n._ctx;for(const r in n){if(zx(r))continue;const s=n[r];if($e(s))e[r]=Ew(r,s,i);else if(s!=null){const o=Em(s);e[r]=()=>o}}},Hx=(n,e)=>{const t=Em(e);n.slots.default=()=>t},Gx=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},Tw=(n,e,t)=>{const i=n.slots=Ux();if(n.vnode.shapeFlag&32){const r=e._;r?(Gx(i,e,t),t&&Hy(i,"_",r,!0)):Vx(e,i)}else e&&Hx(n,e)},ww=(n,e,t)=>{const{vnode:i,slots:r}=n;let s=!0,o=ht;if(i.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:Gx(r,e,t):(s=!e.$stable,Vx(e,r)),o=e}else e&&(Hx(n,e),o={default:1});if(s)for(const a in r)!zx(a)&&o[a]==null&&delete r[a]},kn=kw;function Wx(n){return Aw(n)}function Aw(n,e){const t=Cf();t.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:h,setScopeId:d=Li,insertStaticContent:m}=n,_=(P,D,T,Y=null,G=null,$=null,R=void 0,O=null,k=!!D.dynamicChildren)=>{if(P===D)return;P&&!As(P,D)&&(Y=W(P),xe(P,G,$,!0),P=null),D.patchFlag===-2&&(k=!1,D.dynamicChildren=null);const{type:w,ref:C,shapeFlag:B}=D;switch(w){case Bl:g(P,D,T,Y);break;case yn:p(P,D,T,Y);break;case Hh:P==null&&y(D,T,Y,R);break;case en:z(P,D,T,Y,G,$,R,O,k);break;default:B&1?S(P,D,T,Y,G,$,R,O,k):B&6?H(P,D,T,Y,G,$,R,O,k):(B&64||B&128)&&w.process(P,D,T,Y,G,$,R,O,k,ue)}C!=null&&G&&Eu(C,P&&P.ref,$,D||P,!D)},g=(P,D,T,Y)=>{if(P==null)i(D.el=a(D.children),T,Y);else{const G=D.el=P.el;D.children!==P.children&&c(G,D.children)}},p=(P,D,T,Y)=>{P==null?i(D.el=l(D.children||""),T,Y):D.el=P.el},y=(P,D,T,Y)=>{[P.el,P.anchor]=m(P.children,D,T,Y,P.el,P.anchor)},x=({el:P,anchor:D},T,Y)=>{let G;for(;P&&P!==D;)G=h(P),i(P,T,Y),P=G;i(D,T,Y)},v=({el:P,anchor:D})=>{let T;for(;P&&P!==D;)T=h(P),r(P),P=T;r(D)},S=(P,D,T,Y,G,$,R,O,k)=>{D.type==="svg"?R="svg":D.type==="math"&&(R="mathml"),P==null?E(D,T,Y,G,$,R,O,k):b(P,D,G,$,R,O,k)},E=(P,D,T,Y,G,$,R,O)=>{let k,w;const{props:C,shapeFlag:B,transition:N,dirs:V}=P;if(k=P.el=o(P.type,$,C&&C.is,C),B&8?u(k,P.children):B&16&&I(P.children,k,null,Y,G,Vh(P,$),R,O),V&&rs(P,null,Y,"created"),A(k,P,P.scopeId,R,Y),C){for(const he in C)he!=="value"&&!Ia(he)&&s(k,he,null,C[he],$,Y);"value"in C&&s(k,"value",null,C.value,$),(w=C.onVnodeBeforeMount)&&bi(w,Y,P)}V&&rs(P,null,Y,"beforeMount");const q=Cw(G,N);q&&N.beforeEnter(k),i(k,D,T),((w=C&&C.onVnodeMounted)||q||V)&&kn(()=>{w&&bi(w,Y,P),q&&N.enter(k),V&&rs(P,null,Y,"mounted")},G)},A=(P,D,T,Y,G)=>{if(T&&d(P,T),Y)for(let $=0;${for(let w=k;w{const O=D.el=P.el;let{patchFlag:k,dynamicChildren:w,dirs:C}=D;k|=P.patchFlag&16;const B=P.props||ht,N=D.props||ht;let V;if(T&&ss(T,!1),(V=N.onVnodeBeforeUpdate)&&bi(V,T,D,P),C&&rs(D,P,T,"beforeUpdate"),T&&ss(T,!0),(B.innerHTML&&N.innerHTML==null||B.textContent&&N.textContent==null)&&u(O,""),w?M(P.dynamicChildren,w,O,T,Y,Vh(D,G),$):R||Q(P,D,O,null,T,Y,Vh(D,G),$,!1),k>0){if(k&16)U(O,B,N,T,G);else if(k&2&&B.class!==N.class&&s(O,"class",null,N.class,G),k&4&&s(O,"style",B.style,N.style,G),k&8){const q=D.dynamicProps;for(let he=0;he{V&&bi(V,T,D,P),C&&rs(D,P,T,"updated")},Y)},M=(P,D,T,Y,G,$,R)=>{for(let O=0;O{if(D!==T){if(D!==ht)for(const $ in D)!Ia($)&&!($ in T)&&s(P,$,D[$],null,G,Y);for(const $ in T){if(Ia($))continue;const R=T[$],O=D[$];R!==O&&$!=="value"&&s(P,$,O,R,G,Y)}"value"in T&&s(P,"value",D.value,T.value,G)}},z=(P,D,T,Y,G,$,R,O,k)=>{const w=D.el=P?P.el:a(""),C=D.anchor=P?P.anchor:a("");let{patchFlag:B,dynamicChildren:N,slotScopeIds:V}=D;V&&(O=O?O.concat(V):V),P==null?(i(w,T,Y),i(C,T,Y),I(D.children||[],T,C,G,$,R,O,k)):B>0&&B&64&&N&&P.dynamicChildren?(M(P.dynamicChildren,N,T,G,$,R,O),(D.key!=null||G&&D===G.subTree)&&Xx(P,D,!0)):Q(P,D,T,C,G,$,R,O,k)},H=(P,D,T,Y,G,$,R,O,k)=>{D.slotScopeIds=O,P==null?D.shapeFlag&512?G.ctx.activate(D,T,Y,R,k):K(D,T,Y,G,$,R,k):ee(P,D,k)},K=(P,D,T,Y,G,$,R)=>{const O=P.component=Yw(P,Y,G);if(Nf(P)&&(O.ctx.renderer=ue),jw(O,!1,R),O.asyncDep){if(G&&G.registerDep(O,J,R),!P.el){const k=O.subTree=bn(yn);p(null,k,D,T)}}else J(O,P,D,T,G,$,R)},ee=(P,D,T)=>{const Y=D.component=P.component;if(Fw(P,D,T))if(Y.asyncDep&&!Y.asyncResolved){ie(Y,D,T);return}else Y.next=D,Y.update();else D.el=P.el,Y.vnode=D},J=(P,D,T,Y,G,$,R)=>{const O=()=>{if(P.isMounted){let{next:B,bu:N,u:V,parent:q,vnode:he}=P;{const Ee=$x(P);if(Ee){B&&(B.el=he.el,ie(P,B,R)),Ee.asyncDep.then(()=>{P.isUnmounted||O()});return}}let ce=B,ye;ss(P,!1),B?(B.el=he.el,ie(P,B,R)):B=he,N&&ou(N),(ye=B.props&&B.props.onVnodeBeforeUpdate)&&bi(ye,q,B,he),ss(P,!0);const Ne=h_(P),pe=P.subTree;P.subTree=Ne,_(pe,Ne,f(pe.el),W(pe),P,G,$),B.el=Ne.el,ce===null&&Bw(P,Ne.el),V&&kn(V,G),(ye=B.props&&B.props.onVnodeUpdated)&&kn(()=>bi(ye,q,B,he),G)}else{let B;const{el:N,props:V}=D,{bm:q,m:he,parent:ce,root:ye,type:Ne}=P,pe=Fo(D);ss(P,!1),q&&ou(q),!pe&&(B=V&&V.onVnodeBeforeMount)&&bi(B,ce,D),ss(P,!0);{ye.ce&&ye.ce._injectChildStyle(Ne);const Ee=P.subTree=h_(P);_(null,Ee,T,Y,P,G,$),D.el=Ee.el}if(he&&kn(he,G),!pe&&(B=V&&V.onVnodeMounted)){const Ee=D;kn(()=>bi(B,ce,Ee),G)}(D.shapeFlag&256||ce&&Fo(ce.vnode)&&ce.vnode.shapeFlag&256)&&P.a&&kn(P.a,G),P.isMounted=!0,D=T=Y=null}};P.scope.on();const k=P.effect=new qy(O);P.scope.off();const w=P.update=k.run.bind(k),C=P.job=k.runIfDirty.bind(k);C.i=P,C.id=P.uid,k.scheduler=()=>Mm(C),ss(P,!0),w()},ie=(P,D,T)=>{D.component=P;const Y=P.vnode.props;P.vnode=D,P.next=null,Mw(P,D.props,Y,T),ww(P,D.children,T),Yr(),r_(P),jr()},Q=(P,D,T,Y,G,$,R,O,k=!1)=>{const w=P&&P.children,C=P?P.shapeFlag:0,B=D.children,{patchFlag:N,shapeFlag:V}=D;if(N>0){if(N&128){ve(w,B,T,Y,G,$,R,O,k);return}else if(N&256){me(w,B,T,Y,G,$,R,O,k);return}}V&8?(C&16&&be(w,G,$),B!==w&&u(T,B)):C&16?V&16?ve(w,B,T,Y,G,$,R,O,k):be(w,G,$,!0):(C&8&&u(T,""),V&16&&I(B,T,Y,G,$,R,O,k))},me=(P,D,T,Y,G,$,R,O,k)=>{P=P||Oo,D=D||Oo;const w=P.length,C=D.length,B=Math.min(w,C);let N;for(N=0;NC?be(P,G,$,!0,!1,B):I(D,T,Y,G,$,R,O,k,B)},ve=(P,D,T,Y,G,$,R,O,k)=>{let w=0;const C=D.length;let B=P.length-1,N=C-1;for(;w<=B&&w<=N;){const V=P[w],q=D[w]=k?Nr(D[w]):Ri(D[w]);if(As(V,q))_(V,q,T,null,G,$,R,O,k);else break;w++}for(;w<=B&&w<=N;){const V=P[B],q=D[N]=k?Nr(D[N]):Ri(D[N]);if(As(V,q))_(V,q,T,null,G,$,R,O,k);else break;B--,N--}if(w>B){if(w<=N){const V=N+1,q=VN)for(;w<=B;)xe(P[w],G,$,!0),w++;else{const V=w,q=w,he=new Map;for(w=q;w<=N;w++){const Me=D[w]=k?Nr(D[w]):Ri(D[w]);Me.key!=null&&he.set(Me.key,w)}let ce,ye=0;const Ne=N-q+1;let pe=!1,Ee=0;const Fe=new Array(Ne);for(w=0;w=Ne){xe(Me,G,$,!0);continue}let We;if(Me.key!=null)We=he.get(Me.key);else for(ce=q;ce<=N;ce++)if(Fe[ce-q]===0&&As(Me,D[ce])){We=ce;break}We===void 0?xe(Me,G,$,!0):(Fe[We-q]=w+1,We>=Ee?Ee=We:pe=!0,_(Me,D[We],T,null,G,$,R,O,k),ye++)}const Ve=pe?Rw(Fe):Oo;for(ce=Ve.length-1,w=Ne-1;w>=0;w--){const Me=q+w,We=D[Me],je=Me+1{const{el:$,type:R,transition:O,children:k,shapeFlag:w}=P;if(w&6){re(P.component.subTree,D,T,Y);return}if(w&128){P.suspense.move(D,T,Y);return}if(w&64){R.move(P,D,T,ue);return}if(R===en){i($,D,T);for(let B=0;BO.enter($),G);else{const{leave:B,delayLeave:N,afterLeave:V}=O,q=()=>i($,D,T),he=()=>{B($,()=>{q(),V&&V()})};N?N($,q,he):he()}else i($,D,T)},xe=(P,D,T,Y=!1,G=!1)=>{const{type:$,props:R,ref:O,children:k,dynamicChildren:w,shapeFlag:C,patchFlag:B,dirs:N,cacheIndex:V}=P;if(B===-2&&(G=!1),O!=null&&Eu(O,null,T,P,!0),V!=null&&(D.renderCache[V]=void 0),C&256){D.ctx.deactivate(P);return}const q=C&1&&N,he=!Fo(P);let ce;if(he&&(ce=R&&R.onVnodeBeforeUnmount)&&bi(ce,D,P),C&6)ge(P.component,T,Y);else{if(C&128){P.suspense.unmount(T,Y);return}q&&rs(P,null,D,"beforeUnmount"),C&64?P.type.remove(P,D,T,ue,Y):w&&!w.hasOnce&&($!==en||B>0&&B&64)?be(w,D,T,!1,!0):($===en&&B&384||!G&&C&16)&&be(k,D,T),Y&&ke(P)}(he&&(ce=R&&R.onVnodeUnmounted)||q)&&kn(()=>{ce&&bi(ce,D,P),q&&rs(P,null,D,"unmounted")},T)},ke=P=>{const{type:D,el:T,anchor:Y,transition:G}=P;if(D===en){se(T,Y);return}if(D===Hh){v(P);return}const $=()=>{r(T),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(P.shapeFlag&1&&G&&!G.persisted){const{leave:R,delayLeave:O}=G,k=()=>R(T,$);O?O(P.el,$,k):k()}else $()},se=(P,D)=>{let T;for(;P!==D;)T=h(P),r(P),P=T;r(D)},ge=(P,D,T)=>{const{bum:Y,scope:G,job:$,subTree:R,um:O,m:k,a:w}=P;f_(k),f_(w),Y&&ou(Y),G.stop(),$&&($.flags|=8,xe(R,P,D,T)),O&&kn(O,D),kn(()=>{P.isUnmounted=!0},D),D&&D.pendingBranch&&!D.isUnmounted&&P.asyncDep&&!P.asyncResolved&&P.suspenseId===D.pendingId&&(D.deps--,D.deps===0&&D.resolve())},be=(P,D,T,Y=!1,G=!1,$=0)=>{for(let R=$;R{if(P.shapeFlag&6)return W(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const D=h(P.anchor||P.el),T=D&&D[ZT];return T?h(T):D};let ae=!1;const le=(P,D,T)=>{P==null?D._vnode&&xe(D._vnode,null,null,!0):_(D._vnode||null,P,D,null,null,null,T),D._vnode=P,ae||(ae=!0,r_(),mx(),ae=!1)},ue={p:_,um:xe,m:re,r:ke,mt:K,mc:I,pc:Q,pbc:M,n:W,o:n};return{render:le,hydrate:void 0,createApp:yw(le)}}function Vh({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function ss({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function Cw(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function Xx(n,e,t=!1){const i=n.children,r=e.children;if(Ue(i)&&Ue(r))for(let s=0;s>1,n[t[a]]0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function $x(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:$x(e)}function f_(n){if(n)for(let e=0;eVn(Pw);function Ff(n,e){return Bf(n,null,e)}function Lw(n,e){return Bf(n,null,{flush:"sync"})}function ft(n,e,t){return Bf(n,e,t)}function Bf(n,e,t=ht){const{immediate:i,deep:r,flush:s,once:o}=t,a=qt({},t),l=e&&i||!e&&s!=="post";let c;if(ol){if(s==="sync"){const d=Iw();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=Li,d.resume=Li,d.pause=Li,d}}const u=Zt;a.call=(d,m,_)=>pi(d,u,m,_);let f=!1;s==="post"?a.scheduler=d=>{kn(d,u&&u.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(d,m)=>{m?d():Mm(d)}),a.augmentJob=d=>{e&&(d.flags|=4),f&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const h=$T(n,e,a);return ol&&(c?c.push(h):l&&h()),h}function Dw(n,e,t){const i=this.proxy,r=kt(n)?n.includes(".")?qx(i,n):()=>i[n]:n.bind(i,i);let s;$e(e)?s=e:(s=e.handler,t=e);const o=kl(this),a=Bf(r,s.bind(i),t);return o(),a}function qx(n,e){const t=e.split(".");return()=>{let i=n;for(let r=0;r{let u,f=ht,h;return Lw(()=>{const d=n[r];Pn(u,d)&&(u=d,c())}),{get(){return l(),t.get?t.get(u):u},set(d){const m=t.set?t.set(d):d;if(!Pn(m,u)&&!(f!==ht&&Pn(d,f)))return;const _=i.vnode.props;_&&(e in _||r in _||s in _)&&(`onUpdate:${e}`in _||`onUpdate:${r}`in _||`onUpdate:${s}`in _)||(u=d,c()),i.emit(`update:${e}`,m),Pn(d,m)&&Pn(d,f)&&!Pn(m,h)&&c(),f=d,h=m}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||ht:a,done:!1}:{done:!0}}}},a}const Yx=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Gn(e)}Modifiers`]||n[`${qr(e)}Modifiers`];function Ow(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||ht;let r=t;const s=e.startsWith("update:"),o=s&&Yx(i,e.slice(7));o&&(o.trim&&(r=t.map(u=>kt(u)?u.trim():u)),o.number&&(r=t.map(yu)));let a,l=i[a=Oh(e)]||i[a=Oh(Gn(e))];!l&&s&&(l=i[a=Oh(qr(e))]),l&&pi(l,n,6,r);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,pi(c,n,6,r)}}function jx(n,e,t=!1){const i=e.emitsCache,r=i.get(n);if(r!==void 0)return r;const s=n.emits;let o={},a=!1;if(!$e(n)){const l=c=>{const u=jx(c,e,!0);u&&(a=!0,qt(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!s&&!a?(St(n)&&i.set(n,null),null):(Ue(s)?s.forEach(l=>o[l]=null):qt(o,s),St(n)&&i.set(n,o),o)}function kf(n,e){return!n||!Tf(e)?!1:(e=e.slice(2).replace(/Once$/,""),_t(n,e[0].toLowerCase()+e.slice(1))||_t(n,qr(e))||_t(n,e))}function h_(n){const{type:e,vnode:t,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:h,setupState:d,ctx:m,inheritAttrs:_}=n,g=Su(n);let p,y;try{if(t.shapeFlag&4){const v=r||i,S=v;p=Ri(c.call(S,v,u,f,d,h,m)),y=a}else{const v=e;p=Ri(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:Nw(a)}}catch(v){Na.length=0,Of(v,n,1),p=bn(yn)}let x=p;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:S}=x;v.length&&S&7&&(s&&v.some(cm)&&(y=Uw(y,s)),x=Hr(x,y,!1,!0))}return t.dirs&&(x=Hr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition&&nl(x,t.transition),p=x,Su(g),p}const Nw=n=>{let e;for(const t in n)(t==="class"||t==="style"||Tf(t))&&((e||(e={}))[t]=n[t]);return e},Uw=(n,e)=>{const t={};for(const i in n)(!cm(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function Fw(n,e,t){const{props:i,children:r,component:s}=n,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?d_(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function kw(n,e){e&&e.pendingBranch?Ue(n)?e.effects.push(...n):e.effects.push(n):jT(n)}const en=Symbol.for("v-fgt"),Bl=Symbol.for("v-txt"),yn=Symbol.for("v-cmt"),Hh=Symbol.for("v-stc"),Na=[];let zn=null;function il(n=!1){Na.push(zn=n?null:[])}function zw(){Na.pop(),zn=Na[Na.length-1]||null}let rl=1;function p_(n,e=!1){rl+=n,n<0&&zn&&e&&(zn.hasOnce=!0)}function Zx(n){return n.dynamicChildren=rl>0?zn||Oo:null,zw(),rl>0&&zn&&zn.push(n),n}function Vw(n,e,t,i,r,s){return Zx(Qx(n,e,t,i,r,s,!0))}function Au(n,e,t,i,r){return Zx(bn(n,e,t,i,r,!0))}function sl(n){return n?n.__v_isVNode===!0:!1}function As(n,e){return n.type===e.type&&n.key===e.key}const Jx=({key:n})=>n??null,au=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?kt(n)||Et(n)||$e(n)?{i:Wt,r:n,k:e,f:!!t}:n:null);function Qx(n,e=null,t=null,i=0,r=null,s=n===en?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Jx(e),ref:e&&au(e),scopeId:_x,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Wt};return a?(Tm(l,t),s&128&&n.normalize(l)):t&&(l.shapeFlag|=kt(t)?8:16),rl>0&&!o&&zn&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&zn.push(l),l}const bn=Hw;function Hw(n,e=null,t=null,i=0,r=null,s=!1){if((!n||n===fw)&&(n=yn),sl(n)){const a=Hr(n,e,!0);return t&&Tm(a,t),rl>0&&!s&&zn&&(a.shapeFlag&6?zn[zn.indexOf(n)]=a:zn.push(a)),a.patchFlag=-2,a}if(Qw(n)&&(n=n.__vccOpts),e){e=Gw(e);let{class:a,style:l}=e;a&&!kt(a)&&(e.class=Pf(a)),St(l)&&(xm(l)&&!Ue(l)&&(l=qt({},l)),e.style=Rf(l))}const o=kt(n)?1:Kx(n)?128:vx(n)?64:St(n)?4:$e(n)?2:0;return Qx(n,e,t,i,r,o,s,!0)}function Gw(n){return n?xm(n)||Fx(n)?qt({},n):n:null}function Hr(n,e,t=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=n,c=e?Xw(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&Jx(c),ref:e&&e.ref?t&&s?Ue(s)?s.concat(au(e)):[s,au(e)]:au(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==en?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Hr(n.ssContent),ssFallback:n.ssFallback&&Hr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&nl(u,l.clone(u)),u}function Ww(n=" ",e=0){return bn(Bl,null,n,e)}function LV(n="",e=!1){return e?(il(),Au(yn,null,n)):bn(yn,null,n)}function Ri(n){return n==null||typeof n=="boolean"?bn(yn):Ue(n)?bn(en,null,n.slice()):sl(n)?Nr(n):bn(Bl,null,String(n))}function Nr(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Hr(n)}function Tm(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Ue(e))t=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Tm(n,r()),r._c&&(r._d=!0));return}else{t=32;const r=e._;!r&&!Fx(e)?e._ctx=Wt:r===3&&Wt&&(Wt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else $e(e)?(e={default:e,_ctx:Wt},t=32):(e=String(e),i&64?(t=16,e=[Ww(e)]):t=8);n.children=e,n.shapeFlag|=t}function Xw(...n){const e={};for(let t=0;tZt||Wt;let Cu,cp;{const n=Cf(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Cu=e("__VUE_INSTANCE_SETTERS__",t=>Zt=t),cp=e("__VUE_SSR_SETTERS__",t=>ol=t)}const kl=n=>{const e=Zt;return Cu(n),n.scope.on(),()=>{n.scope.off(),Cu(e)}},m_=()=>{Zt&&Zt.scope.off(),Cu(null)};function eb(n){return n.vnode.shapeFlag&4}let ol=!1;function jw(n,e=!1,t=!1){e&&cp(e);const{props:i,children:r}=n.vnode,s=eb(n);bw(n,i,s,e),Tw(n,r,t);const o=s?Kw(n,e):void 0;return e&&cp(!1),o}function Kw(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,hw);const{setup:i}=t;if(i){Yr();const r=n.setupContext=i.length>1?nb(n):null,s=kl(n),o=Fl(i,n,0,[n.props,r]),a=ky(o);if(jr(),s(),(a||n.sp)&&!Fo(n)&&Ex(n),a){if(o.then(m_,m_),e)return o.then(l=>{g_(n,l)}).catch(l=>{Of(l,n,0)});n.asyncDep=o}else g_(n,o)}else tb(n)}function g_(n,e,t){$e(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:St(e)&&(n.setupState=cx(e)),tb(n)}function tb(n,e,t){const i=n.type;n.render||(n.render=i.render||Li);{const r=kl(n);Yr();try{dw(n)}finally{jr(),r()}}}const Zw={get(n,e){return an(n,"get",""),n[e]}};function nb(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,Zw),slots:n.slots,emit:n.emit,expose:e}}function zf(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(cx(bm(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Oa)return Oa[t](n)},has(e,t){return t in e||t in Oa}})):n.proxy}function Jw(n,e=!0){return $e(n)?n.displayName||n.name:n.name||e&&n.__name}function Qw(n){return $e(n)&&"__vccOpts"in n}const it=(n,e)=>WT(n,e,ol);function dr(n,e,t){const i=arguments.length;return i===2?St(e)&&!Ue(e)?sl(e)?bn(n,null,[e]):bn(n,e):bn(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&sl(t)&&(t=[t]),bn(n,e,t))}const eA="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let up;const __=typeof window<"u"&&window.trustedTypes;if(__)try{up=__.createPolicy("vue",{createHTML:n=>n})}catch{}const ib=up?n=>up.createHTML(n):n=>n,tA="http://www.w3.org/2000/svg",nA="http://www.w3.org/1998/Math/MathML",er=typeof document<"u"?document:null,v_=er&&er.createElement("template"),iA={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const r=e==="svg"?er.createElementNS(tA,n):e==="mathml"?er.createElementNS(nA,n):t?er.createElement(n,{is:t}):er.createElement(n);return n==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:n=>er.createTextNode(n),createComment:n=>er.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>er.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,r,s){const o=t?t.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),t),!(r===s||!(r=r.nextSibling)););else{v_.innerHTML=ib(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=v_.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Mr="transition",ua="animation",al=Symbol("_vtc"),rb={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},rA=qt({},yx,rb),sA=n=>(n.displayName="Transition",n.props=rA,n),DV=sA((n,{slots:e})=>dr(ew,oA(n),e)),os=(n,e=[])=>{Ue(n)?n.forEach(t=>t(...e)):n&&n(...e)},y_=n=>n?Ue(n)?n.some(e=>e.length>1):n.length>1:!1;function oA(n){const e={};for(const z in n)z in rb||(e[z]=n[z]);if(n.css===!1)return e;const{name:t="v",type:i,duration:r,enterFromClass:s=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=s,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:h=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=n,m=aA(r),_=m&&m[0],g=m&&m[1],{onBeforeEnter:p,onEnter:y,onEnterCancelled:x,onLeave:v,onLeaveCancelled:S,onBeforeAppear:E=p,onAppear:A=y,onAppearCancelled:I=x}=e,b=(z,H,K,ee)=>{z._enterCancelled=ee,as(z,H?u:a),as(z,H?c:o),K&&K()},M=(z,H)=>{z._isLeaving=!1,as(z,f),as(z,d),as(z,h),H&&H()},U=z=>(H,K)=>{const ee=z?A:y,J=()=>b(H,z,K);os(ee,[H,J]),x_(()=>{as(H,z?l:s),Xi(H,z?u:a),y_(ee)||b_(H,i,_,J)})};return qt(e,{onBeforeEnter(z){os(p,[z]),Xi(z,s),Xi(z,o)},onBeforeAppear(z){os(E,[z]),Xi(z,l),Xi(z,c)},onEnter:U(!1),onAppear:U(!0),onLeave(z,H){z._isLeaving=!0;const K=()=>M(z,H);Xi(z,f),z._enterCancelled?(Xi(z,h),E_()):(E_(),Xi(z,h)),x_(()=>{z._isLeaving&&(as(z,f),Xi(z,d),y_(v)||b_(z,i,g,K))}),os(v,[z,K])},onEnterCancelled(z){b(z,!1,void 0,!0),os(x,[z])},onAppearCancelled(z){b(z,!0,void 0,!0),os(I,[z])},onLeaveCancelled(z){M(z),os(S,[z])}})}function aA(n){if(n==null)return null;if(St(n))return[Gh(n.enter),Gh(n.leave)];{const e=Gh(n);return[e,e]}}function Gh(n){return cT(n)}function Xi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[al]||(n[al]=new Set)).add(e)}function as(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[al];t&&(t.delete(e),t.size||(n[al]=void 0))}function x_(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let lA=0;function b_(n,e,t,i){const r=n._endId=++lA,s=()=>{r===n._endId&&i()};if(t!=null)return setTimeout(s,t);const{type:o,timeout:a,propCount:l}=cA(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,h),s()},h=d=>{d.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[m]||"").split(", "),r=i(`${Mr}Delay`),s=i(`${Mr}Duration`),o=M_(r,s),a=i(`${ua}Delay`),l=i(`${ua}Duration`),c=M_(a,l);let u=null,f=0,h=0;e===Mr?o>0&&(u=Mr,f=o,h=s.length):e===ua?c>0&&(u=ua,f=c,h=l.length):(f=Math.max(o,c),u=f>0?o>c?Mr:ua:null,h=u?u===Mr?s.length:l.length:0);const d=u===Mr&&/\b(transform|all)(,|$)/.test(i(`${Mr}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:d}}function M_(n,e){for(;n.lengthS_(t)+S_(n[i])))}function S_(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function E_(){return document.body.offsetHeight}function uA(n,e,t){const i=n[al];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const T_=Symbol("_vod"),fA=Symbol("_vsh"),hA=Symbol(""),dA=/(^|;)\s*display\s*:/;function pA(n,e,t){const i=n.style,r=kt(t);let s=!1;if(t&&!r){if(e)if(kt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&lu(i,a,"")}else for(const o in e)t[o]==null&&lu(i,o,"");for(const o in t)o==="display"&&(s=!0),lu(i,o,t[o])}else if(r){if(e!==t){const o=i[hA];o&&(t+=";"+o),i.cssText=t,s=dA.test(t)}}else e&&n.removeAttribute("style");T_ in n&&(n[T_]=s?i.display:"",n[fA]&&(i.display="none"))}const w_=/\s*!important$/;function lu(n,e,t){if(Ue(t))t.forEach(i=>lu(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=mA(n,e);w_.test(t)?n.setProperty(qr(i),t.replace(w_,""),"important"):n[i]=t}}const A_=["Webkit","Moz","ms"],Wh={};function mA(n,e){const t=Wh[e];if(t)return t;let i=Gn(e);if(i!=="filter"&&i in n)return Wh[e]=i;i=Af(i);for(let r=0;rXh||(yA.then(()=>Xh=0),Xh=Date.now());function bA(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;pi(MA(i,t.value),e,5,[i])};return t.value=n,t.attached=xA(),t}function MA(n,e){if(Ue(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const D_=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,SA=(n,e,t,i,r,s)=>{const o=r==="svg";e==="class"?uA(n,i,o):e==="style"?pA(n,t,i):Tf(e)?cm(e)||_A(n,e,t,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):EA(n,e,i,o))?(P_(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&R_(n,e,i,o,s,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!kt(i))?P_(n,Gn(e),i,s,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),R_(n,e,i,o))};function EA(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&D_(e)&&$e(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=n.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return D_(e)&&kt(t)?!1:e in n}const Gr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return Ue(e)?t=>ou(e,t):e};function TA(n){n.target.composing=!0}function O_(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Qn=Symbol("_assign"),OV={created(n,{modifiers:{lazy:e,trim:t,number:i}},r){n[Qn]=Gr(r);const s=i||r.props&&r.props.type==="number";ir(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),s&&(a=yu(a)),n[Qn](a)}),t&&ir(n,"change",()=>{n.value=n.value.trim()}),e||(ir(n,"compositionstart",TA),ir(n,"compositionend",O_),ir(n,"change",O_))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:r,number:s}},o){if(n[Qn]=Gr(o),n.composing)return;const a=(s||n.type==="number")&&!/^0\d/.test(n.value)?yu(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||r&&n.value.trim()===l)||(n.value=l))}},NV={deep:!0,created(n,e,t){n[Qn]=Gr(t),ir(n,"change",()=>{const i=n._modelValue,r=Vo(n),s=n.checked,o=n[Qn];if(Ue(i)){const a=hm(i,r),l=a!==-1;if(s&&!l)o(i.concat(r));else if(!s&&l){const c=[...i];c.splice(a,1),o(c)}}else if(ea(i)){const a=new Set(i);s?a.add(r):a.delete(r),o(a)}else o(sb(n,s))})},mounted:N_,beforeUpdate(n,e,t){n[Qn]=Gr(t),N_(n,e,t)}};function N_(n,{value:e,oldValue:t},i){n._modelValue=e;let r;if(Ue(e))r=hm(e,i.props.value)>-1;else if(ea(e))r=e.has(i.props.value);else{if(e===t)return;r=Hs(e,sb(n,!0))}n.checked!==r&&(n.checked=r)}const UV={created(n,{value:e},t){n.checked=Hs(e,t.props.value),n[Qn]=Gr(t),ir(n,"change",()=>{n[Qn](Vo(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[Qn]=Gr(i),e!==t&&(n.checked=Hs(e,i.props.value))}},FV={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const r=ea(e);ir(n,"change",()=>{const s=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?yu(Vo(o)):Vo(o));n[Qn](n.multiple?r?new Set(s):s:s[0]),n._assigning=!0,ta(()=>{n._assigning=!1})}),n[Qn]=Gr(i)},mounted(n,{value:e}){U_(n,e)},beforeUpdate(n,e,t){n[Qn]=Gr(t)},updated(n,{value:e}){n._assigning||U_(n,e)}};function U_(n,e){const t=n.multiple,i=Ue(e);if(!(t&&!i&&!ea(e))){for(let r=0,s=n.options.length;rString(c)===String(a)):o.selected=hm(e,a)>-1}else o.selected=e.has(a);else if(Hs(Vo(o),e)){n.selectedIndex!==r&&(n.selectedIndex=r);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function Vo(n){return"_value"in n?n._value:n.value}function sb(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const wA=qt({patchProp:SA},iA);let F_;function ob(){return F_||(F_=Wx(wA))}const BV=(...n)=>{ob().render(...n)},AA=(...n)=>{const e=ob().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=RA(i);if(!r)return;const s=e._component;!$e(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=t(r,!1,CA(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e};function CA(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function RA(n){return kt(n)?document.querySelector(n):n}const ab=new Set,Dn=new WeakMap,Ho=new WeakMap,Ws=new WeakMap,fp=new WeakMap,PA=new WeakMap,Go=new WeakMap,Ru=new WeakMap,Ca=new WeakSet;let Wr,wm=0,Am=0;const or="__aa_tgt",ll="__aa_del",Pu="__aa_new",IA=n=>{const e=FA(n);e&&e.forEach(t=>BA(t))},LA=n=>{n.forEach(e=>{e.target===Wr&&OA(),Dn.has(e.target)&&Js(e.target)})};function DA(n){const e=fp.get(n);e==null||e.disconnect();let t=Dn.get(n),i=0;const r=5;t||(t=Wo(n),Dn.set(n,t));const{offsetWidth:s,offsetHeight:o}=Wr,l=[t.top-r,s-(t.left+r+t.width),o-(t.top+r+t.height),t.left-r].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&Js(n)},{root:Wr,threshold:1,rootMargin:l});c.observe(n),fp.set(n,c)}function Js(n){clearTimeout(Ru.get(n));const e=Vf(n),t=cl(e)?500:e.duration;Ru.set(n,setTimeout(async()=>{const i=Ws.get(n);try{await(i==null?void 0:i.finished),Dn.set(n,Wo(n)),DA(n)}catch{}},t))}function OA(){clearTimeout(Ru.get(Wr)),Ru.set(Wr,setTimeout(()=>{ab.forEach(n=>fb(n,e=>lb(()=>Js(e))))},100))}function NA(n){setTimeout(()=>{PA.set(n,setInterval(()=>lb(Js.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function lb(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let hp,Co;const UA=typeof window<"u"&&"ResizeObserver"in window;UA&&(Wr=document.documentElement,hp=new MutationObserver(IA),Co=new ResizeObserver(LA),window.addEventListener("scroll",()=>{Am=window.scrollY,wm=window.scrollX}),Co.observe(Wr));function FA(n){return n.reduce((i,r)=>[...i,...Array.from(r.addedNodes),...Array.from(r.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,r)=>{if(i===!1)return!1;if(r.target instanceof Element){if($h(r.target),!i.has(r.target)){i.add(r.target);for(let s=0;st(n,Go.has(n)));for(let t=0;tr(i,Go.has(i)))}}function Rm(n){return Array.isArray(n)?n:[n]}function cl(n){return typeof n=="function"}function zA(n){const e=Dn.get(n),t=Wo(n);if(!Cm(n))return Dn.set(n,t);let i;if(!e)return;const r=Vf(n);if(typeof r!="function"){const s=e.left-t.left,o=e.top-t.top,[a,l,c,u]=cb(n,e,t),f={transform:`translate(${s}px, ${o}px)`},h={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,h.width=`${l}px`),c!==u&&(f.height=`${c}px`,h.height=`${u}px`),i=n.animate([f,h],{duration:r.duration,easing:r.easing})}else{const[s]=Rm(r(n,"remain",e,t));i=new Animation(s),i.play()}Ws.set(n,i),Dn.set(n,t),i.addEventListener("finish",Js.bind(null,n))}function B_(n){Pu in n&&delete n[Pu];const e=Wo(n);Dn.set(n,e);const t=Vf(n);if(!Cm(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[r]=Rm(t(n,"add",e));i=new Animation(r),i.play()}Ws.set(n,i),i.addEventListener("finish",Js.bind(null,n))}function k_(n,e){var t;n.remove(),Dn.delete(n),Ho.delete(n),Ws.delete(n),(t=fp.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(ll in n&&delete n[ll],Object.defineProperty(n,Pu,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function VA(n){var e;if(!Ho.has(n)||!Dn.has(n))return;const[t,i]=Ho.get(n);Object.defineProperty(n,ll,{value:!0,configurable:!0});const r=window.scrollX,s=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=ub(n))===null||e===void 0||e.appendChild(n),!Cm(n))return k_(n);const[o,a,l,c]=GA(n),u=Vf(n),f=Dn.get(n);(r!==wm||s!==Am)&&HA(n,r,s,u);let h,d={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!cl(u))Object.assign(n.style,d),h=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[m,_]=Rm(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(d=(_==null?void 0:_.styleReset)||d,Object.assign(n.style,d)),h=new Animation(m),h.play()}Ws.set(n,h),h.addEventListener("finish",k_.bind(null,n,d))}function HA(n,e,t,i){const r=wm-e,s=Am-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(Wr).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+r,window.scrollY+s),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function h(){requestAnimationFrame(()=>{if(!cl(i)){const d=c-l.clientHeight,m=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-m,top:window.scrollY-d}),c=l.clientHeight,u=l.clientWidth,h()):document.documentElement.style.scrollBehavior=o}})}h()}function GA(n){const e=Dn.get(n),[t,,i]=cb(n,e,Wo(n));let r=n.parentElement;for(;r&&(getComputedStyle(r).position==="static"||r instanceof HTMLBodyElement);)r=r.parentElement;r||(r=document.body);const s=getComputedStyle(r),o=Dn.get(r)||Wo(r),a=Math.round(e.top-o.top)-Ai(s.borderTopWidth),l=Math.round(e.left-o.left)-Ai(s.borderLeftWidth);return[a,l,t,i]}function WA(n,e={}){return hp&&Co&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!cl(e)&&!e.disrespectUserMotionPreference||(Ca.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),fb(n,Js,NA,r=>Co==null?void 0:Co.observe(r)),cl(e)?Go.set(n,e):Go.set(n,{duration:250,easing:"ease-in-out",...e}),hp.observe(n,{childList:!0}),ab.add(n))),Object.freeze({parent:n,enable:()=>{Ca.add(n)},disable:()=>{Ca.delete(n)},isEnabled:()=>Ca.has(n)})}const XA={mounted:(n,e)=>{WA(n,e.value||{})},getSSRProps:()=>({})},$A=XA,qA={install(n){n.directive("auto-animate",$A)}};/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const zl="171",YA={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},jA={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},hb=0,dp=1,db=2,KA=3,ZA=0,Pm=1,Im=2,Ci=3,pr=0,Sn=1,li=2,fr=0,Bs=1,pp=2,mp=3,gp=4,pb=5,Br=100,mb=101,gb=102,_b=103,vb=104,yb=200,xb=201,bb=202,Mb=203,Iu=204,Lu=205,Sb=206,Eb=207,Tb=208,wb=209,Ab=210,Cb=211,Rb=212,Pb=213,Ib=214,Du=0,Ou=1,Nu=2,Xs=3,Uu=4,Fu=5,Bu=6,ku=7,Vl=0,Lb=1,Db=2,Di=0,Ob=1,Nb=2,Ub=3,Hf=4,Fb=5,Bb=6,kb=7,_p="attached",zb="detached",Gf=300,mr=301,Xr=302,ul=303,fl=304,na=306,hl=1e3,Zn=1001,dl=1002,tn=1003,Lm=1004,JA=1004,Ro=1005,QA=1005,Xt=1006,Ua=1007,e1=1007,Pi=1008,t1=1008,Bi=1009,Dm=1010,Om=1011,Xo=1012,Wf=1013,gr=1014,Ln=1015,ia=1016,Xf=1017,$f=1018,$s=1020,Nm=35902,Um=1021,Fm=1022,Mn=1023,Bm=1024,km=1025,ks=1026,qs=1027,qf=1028,Hl=1029,zm=1030,Yf=1031,n1=1032,jf=1033,Fa=33776,Ba=33777,ka=33778,za=33779,zu=35840,Vu=35841,Hu=35842,Gu=35843,Wu=36196,Xu=37492,$u=37496,qu=37808,Yu=37809,ju=37810,Ku=37811,Zu=37812,Ju=37813,Qu=37814,ef=37815,tf=37816,nf=37817,rf=37818,sf=37819,of=37820,af=37821,Va=36492,lf=36494,cf=36495,Vm=36283,uf=36284,ff=36285,hf=36286,Vb=2200,Hb=2201,Gb=2202,pl=2300,df=2301,cu=2302,Is=2400,Ls=2401,ml=2402,Kf=2500,Hm=2501,i1=0,r1=1,s1=2,Wb=3200,Xb=3201,o1=3202,a1=3203,Kr=0,$b=1,rr="",_n="srgb",Ys="srgb-linear",gl="linear",yt="srgb",l1=0,Es=7680,c1=7681,u1=7682,f1=7683,h1=34055,d1=34056,p1=5386,m1=512,g1=513,_1=514,v1=515,y1=516,x1=517,b1=518,vp=519,qb=512,Yb=513,jb=514,Gm=515,Kb=516,Zb=517,Jb=518,Qb=519,_l=35044,M1=35048,S1=35040,E1=35045,T1=35049,w1=35041,A1=35046,C1=35050,R1=35042,P1="100",yp="300 es",Ii=2e3,vl=2001;class Vi{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+rn[n>>16&255]+rn[n>>24&255]+"-"+rn[e&255]+rn[e>>8&255]+"-"+rn[e>>16&15|64]+rn[e>>24&255]+"-"+rn[t&63|128]+rn[t>>8&255]+"-"+rn[t>>16&255]+rn[t>>24&255]+rn[i&255]+rn[i>>8&255]+rn[i>>16&255]+rn[i>>24&255]).toLowerCase()}function Ye(n,e,t){return Math.max(e,Math.min(t,n))}function Wm(n,e){return(n%e+e)%e}function I1(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function L1(n,e,t){return n!==e?(t-n)/(e-n):0}function Ha(n,e,t){return(1-t)*n+t*e}function D1(n,e,t,i){return Ha(n,e,1-Math.exp(-t*i))}function O1(n,e=1){return e-Math.abs(Wm(n,e*2)-e)}function N1(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function U1(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function F1(n,e){return n+Math.floor(Math.random()*(e-n+1))}function B1(n,e){return n+Math.random()*(e-n)}function k1(n){return n*(.5-Math.random())}function z1(n){n!==void 0&&(z_=n);let e=z_+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function V1(n){return n*zs}function H1(n){return n*$o}function G1(n){return(n&n-1)===0&&n!==0}function W1(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function X1(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function $1(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),f=s((e-i)/2),h=o((e-i)/2),d=s((i-e)/2),m=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*f,l*h,a*c);break;case"YZY":n.set(l*h,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*h,a*u,a*c);break;case"XZX":n.set(a*u,l*m,l*d,a*c);break;case"YXY":n.set(l*d,a*u,l*m,a*c);break;case"ZYZ":n.set(l*m,l*d,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function xn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ze(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Xm={DEG2RAD:zs,RAD2DEG:$o,generateUUID:Hn,clamp:Ye,euclideanModulo:Wm,mapLinear:I1,inverseLerp:L1,lerp:Ha,damp:D1,pingpong:O1,smoothstep:N1,smootherstep:U1,randInt:F1,randFloat:B1,randFloatSpread:k1,seededRandom:z1,degToRad:V1,radToDeg:H1,isPowerOfTwo:G1,ceilPowerOfTwo:W1,floorPowerOfTwo:X1,setQuaternionFromProperEuler:$1,normalize:Ze,denormalize:xn};class fe{constructor(e=0,t=0){fe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Ye(this.x,e.x,t.x),this.y=Ye(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ye(this.x,e,t),this.y=Ye(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ye(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Ye(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ke{constructor(e,t,i,r,s,o,a,l,c){Ke.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],f=i[7],h=i[2],d=i[5],m=i[8],_=r[0],g=r[3],p=r[6],y=r[1],x=r[4],v=r[7],S=r[2],E=r[5],A=r[8];return s[0]=o*_+a*y+l*S,s[3]=o*g+a*x+l*E,s[6]=o*p+a*v+l*A,s[1]=c*_+u*y+f*S,s[4]=c*g+u*x+f*E,s[7]=c*p+u*v+f*A,s[2]=h*_+d*y+m*S,s[5]=h*g+d*x+m*E,s[8]=h*p+d*v+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,h=a*l-u*s,d=c*s-o*l,m=t*f+i*h+r*d;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=f*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=h*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=d*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(qh.makeScale(e,t)),this}rotate(e){return this.premultiply(qh.makeRotation(-e)),this}translate(e,t){return this.premultiply(qh.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const qh=new Ke;function eM(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const q1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Po(n,e){return new q1[n](e)}function yl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function tM(){const n=yl("canvas");return n.style.display="block",n}const V_={};function To(n){n in V_||(V_[n]=!0,console.warn(n))}function Y1(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}function j1(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function K1(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const H_=new Ke().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),G_=new Ke().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Z1(){const n={enabled:!0,workingColorSpace:Ys,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===yt&&(r.r=hr(r.r),r.g=hr(r.g),r.b=hr(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===yt&&(r.r=Bo(r.r),r.g=Bo(r.g),r.b=Bo(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===rr?gl:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Ys]:{primaries:e,whitePoint:i,transfer:gl,toXYZ:H_,fromXYZ:G_,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:_n},outputColorSpaceConfig:{drawingBufferColorSpace:_n}},[_n]:{primaries:e,whitePoint:i,transfer:yt,toXYZ:H_,fromXYZ:G_,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:_n}}}),n}const rt=Z1();function hr(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Bo(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let ro;class nM{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ro===void 0&&(ro=yl("canvas")),ro.width=e.width,ro.height=e.height;const i=ro.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ro}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=yl("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Gf)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case hl:e.x=e.x-Math.floor(e.x);break;case Zn:e.x=e.x<0?0:1;break;case dl:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case hl:e.y=e.y-Math.floor(e.y);break;case Zn:e.y=e.y<0?0:1;break;case dl:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Nt.DEFAULT_IMAGE=null;Nt.DEFAULT_MAPPING=Gf;Nt.DEFAULT_ANISOTROPY=1;class ct{constructor(e=0,t=0,i=0,r=1){ct.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+d+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,v=(d+1)/2,S=(p+1)/2,E=(u+h)/4,A=(f+_)/4,I=(m+g)/4;return x>v&&x>S?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=E/i,s=A/i):v>S?v<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(v),i=E/r,s=I/r):S<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(S),i=A/s,r=I/s),this.set(i,r,s,t),this}let y=Math.sqrt((g-m)*(g-m)+(f-_)*(f-_)+(h-u)*(h-u));return Math.abs(y)<.001&&(y=1),this.x=(g-m)/y,this.y=(f-_)/y,this.z=(h-u)/y,this.w=Math.acos((c+d+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Ye(this.x,e.x,t.x),this.y=Ye(this.y,e.y,t.y),this.z=Ye(this.z,e.z,t.z),this.w=Ye(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ye(this.x,e,t),this.y=Ye(this.y,e,t),this.z=Ye(this.z,e,t),this.w=Ye(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ye(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class iM extends Vi{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ct(0,0,e,t),this.scissorTest=!1,this.viewport=new ct(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Xt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Nt(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-p*p;if(x>Number.EPSILON){const S=Math.sqrt(x),E=Math.atan2(S,p*y);g=Math.sin(g*E)/S,a=Math.sin(a*E)/S}const v=a*y;if(l=l*g+h*v,c=c*g+d*v,u=u*g+m*v,f=f*g+_*v,g===1-a){const S=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=S,c*=S,u*=S,f*=S}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],f=s[o],h=s[o+1],d=s[o+2],m=s[o+3];return e[t]=a*m+u*f+l*d-c*h,e[t+1]=l*m+u*h+c*f-a*d,e[t+2]=c*m+u*d+a*h-l*f,e[t+3]=u*m-a*f-l*h-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),f=a(s/2),h=l(i/2),d=l(r/2),m=l(s/2);switch(o){case"XYZ":this._x=h*u*f+c*d*m,this._y=c*d*f-h*u*m,this._z=c*u*m+h*d*f,this._w=c*u*f-h*d*m;break;case"YXZ":this._x=h*u*f+c*d*m,this._y=c*d*f-h*u*m,this._z=c*u*m-h*d*f,this._w=c*u*f+h*d*m;break;case"ZXY":this._x=h*u*f-c*d*m,this._y=c*d*f+h*u*m,this._z=c*u*m+h*d*f,this._w=c*u*f-h*d*m;break;case"ZYX":this._x=h*u*f-c*d*m,this._y=c*d*f+h*u*m,this._z=c*u*m-h*d*f,this._w=c*u*f+h*d*m;break;case"YZX":this._x=h*u*f+c*d*m,this._y=c*d*f+h*u*m,this._z=c*u*m-h*d*f,this._w=c*u*f-h*d*m;break;case"XZY":this._x=h*u*f-c*d*m,this._y=c*d*f-h*u*m,this._z=c*u*m+h*d*f,this._w=c*u*f+h*d*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],f=t[10],h=i+a+f;if(h>0){const d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(o-r)*d}else if(i>a&&i>f){const d=2*Math.sqrt(1+i-a-f);this._w=(u-l)/d,this._x=.25*d,this._y=(r+o)/d,this._z=(s+c)/d}else if(a>f){const d=2*Math.sqrt(1+a-i-f);this._w=(s-c)/d,this._x=(r+o)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+f-i-a);this._w=(o-r)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ye(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const d=1-t;return this._w=d*o+t*this._w,this._x=d*i+t*this._x,this._y=d*r+t*this._y,this._z=d*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-t)*u)/c,h=Math.sin(t*u)/c;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=r*f+this._y*h,this._z=s*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,i=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(W_.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(W_.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),f=2*(s*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-s*f,this.z=r+l*f+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Ye(this.x,e.x,t.x),this.y=Ye(this.y,e.y,t.y),this.z=Ye(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ye(this.x,e,t),this.y=Ye(this.y,e,t),this.z=Ye(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ye(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return jh.copy(this).projectOnVector(e),this.sub(jh)}reflect(e){return this.sub(jh.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Ye(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const jh=new F,W_=new On;class En{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ri),ri.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fa),lc.subVectors(this.max,fa),so.subVectors(e.a,fa),oo.subVectors(e.b,fa),ao.subVectors(e.c,fa),Sr.subVectors(oo,so),Er.subVectors(ao,oo),ls.subVectors(so,ao);let t=[0,-Sr.z,Sr.y,0,-Er.z,Er.y,0,-ls.z,ls.y,Sr.z,0,-Sr.x,Er.z,0,-Er.x,ls.z,0,-ls.x,-Sr.y,Sr.x,0,-Er.y,Er.x,0,-ls.y,ls.x,0];return!Kh(t,so,oo,ao,lc)||(t=[1,0,0,0,1,0,0,0,1],!Kh(t,so,oo,ao,lc))?!1:(cc.crossVectors(Sr,Er),t=[cc.x,cc.y,cc.z],Kh(t,so,oo,ao,lc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ri).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ri).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:($i[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),$i[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),$i[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),$i[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),$i[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),$i[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),$i[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),$i[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints($i),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const $i=[new F,new F,new F,new F,new F,new F,new F,new F],ri=new F,ac=new En,so=new F,oo=new F,ao=new F,Sr=new F,Er=new F,ls=new F,fa=new F,lc=new F,cc=new F,cs=new F;function Kh(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){cs.fromArray(n,s);const a=r.x*Math.abs(cs.x)+r.y*Math.abs(cs.y)+r.z*Math.abs(cs.z),l=e.dot(cs),c=t.dot(cs),u=i.dot(cs);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const nC=new En,ha=new F,Zh=new F;class cn{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):nC.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ha.subVectors(e,this.center);const t=ha.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(ha,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Zh.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ha.copy(e.center).add(Zh)),this.expandByPoint(ha.copy(e.center).sub(Zh))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const qi=new F,Jh=new F,uc=new F,Tr=new F,Qh=new F,fc=new F,ed=new F;class ra{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,qi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=qi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(qi.copy(this.origin).addScaledVector(this.direction,t),qi.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Jh.copy(e).add(t).multiplyScalar(.5),uc.copy(t).sub(e).normalize(),Tr.copy(this.origin).sub(Jh);const s=e.distanceTo(t)*.5,o=-this.direction.dot(uc),a=Tr.dot(this.direction),l=-Tr.dot(uc),c=Tr.lengthSq(),u=Math.abs(1-o*o);let f,h,d,m;if(u>0)if(f=o*l-a,h=o*a-l,m=s*u,f>=0)if(h>=-m)if(h<=m){const _=1/u;f*=_,h*=_,d=f*(f+o*h+2*a)+h*(o*f+h+2*l)+c}else h=s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h<=-m?(f=Math.max(0,-(-o*s+a)),h=f>0?-s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c):h<=m?(f=0,h=Math.min(Math.max(-s,-l),s),d=h*(h+2*l)+c):(f=Math.max(0,-(o*s+a)),h=f>0?s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c);else h=o>0?-s:s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(Jh).addScaledVector(uc,h),d}intersectSphere(e,t){qi.subVectors(e.center,this.origin);const i=qi.dot(this.direction),r=qi.dot(qi)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(s=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(s=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,qi)!==null}intersectTriangle(e,t,i,r,s){Qh.subVectors(t,e),fc.subVectors(i,e),ed.crossVectors(Qh,fc);let o=this.direction.dot(ed),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Tr.subVectors(this.origin,e);const l=a*this.direction.dot(fc.crossVectors(Tr,fc));if(l<0)return null;const c=a*this.direction.dot(Qh.cross(Tr));if(c<0||l+c>o)return null;const u=-a*Tr.dot(ed);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class He{constructor(e,t,i,r,s,o,a,l,c,u,f,h,d,m,_,g){He.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,f,h,d,m,_,g)}set(e,t,i,r,s,o,a,l,c,u,f,h,d,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=i,p[12]=r,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=f,p[14]=h,p[3]=d,p[7]=m,p[11]=_,p[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new He().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/lo.setFromMatrixColumn(e,0).length(),s=1/lo.setFromMatrixColumn(e,1).length(),o=1/lo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const h=o*u,d=o*f,m=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=d+m*c,t[5]=h-_*c,t[9]=-a*l,t[2]=_-h*c,t[6]=m+d*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*u,d=l*f,m=c*u,_=c*f;t[0]=h+_*a,t[4]=m*a-d,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=d*a-m,t[6]=_+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*u,d=l*f,m=c*u,_=c*f;t[0]=h-_*a,t[4]=-o*f,t[8]=m+d*a,t[1]=d+m*a,t[5]=o*u,t[9]=_-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*u,d=o*f,m=a*u,_=a*f;t[0]=l*u,t[4]=m*c-d,t[8]=h*c+_,t[1]=l*f,t[5]=_*c+h,t[9]=d*c-m,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,d=o*c,m=a*l,_=a*c;t[0]=l*u,t[4]=_-h*f,t[8]=m*f+d,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=d*f+m,t[10]=h-_*f}else if(e.order==="XZY"){const h=o*l,d=o*c,m=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=h*f+_,t[5]=o*u,t[9]=d*f-m,t[2]=m*f-d,t[6]=a*u,t[10]=_*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(iC,e,rC)}lookAt(e,t,i){const r=this.elements;return Fn.subVectors(e,t),Fn.lengthSq()===0&&(Fn.z=1),Fn.normalize(),wr.crossVectors(i,Fn),wr.lengthSq()===0&&(Math.abs(i.z)===1?Fn.x+=1e-4:Fn.z+=1e-4,Fn.normalize(),wr.crossVectors(i,Fn)),wr.normalize(),hc.crossVectors(Fn,wr),r[0]=wr.x,r[4]=hc.x,r[8]=Fn.x,r[1]=wr.y,r[5]=hc.y,r[9]=Fn.y,r[2]=wr.z,r[6]=hc.z,r[10]=Fn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],f=i[5],h=i[9],d=i[13],m=i[2],_=i[6],g=i[10],p=i[14],y=i[3],x=i[7],v=i[11],S=i[15],E=r[0],A=r[4],I=r[8],b=r[12],M=r[1],U=r[5],z=r[9],H=r[13],K=r[2],ee=r[6],J=r[10],ie=r[14],Q=r[3],me=r[7],ve=r[11],re=r[15];return s[0]=o*E+a*M+l*K+c*Q,s[4]=o*A+a*U+l*ee+c*me,s[8]=o*I+a*z+l*J+c*ve,s[12]=o*b+a*H+l*ie+c*re,s[1]=u*E+f*M+h*K+d*Q,s[5]=u*A+f*U+h*ee+d*me,s[9]=u*I+f*z+h*J+d*ve,s[13]=u*b+f*H+h*ie+d*re,s[2]=m*E+_*M+g*K+p*Q,s[6]=m*A+_*U+g*ee+p*me,s[10]=m*I+_*z+g*J+p*ve,s[14]=m*b+_*H+g*ie+p*re,s[3]=y*E+x*M+v*K+S*Q,s[7]=y*A+x*U+v*ee+S*me,s[11]=y*I+x*z+v*J+S*ve,s[15]=y*b+x*H+v*ie+S*re,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],d=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+s*l*f-r*c*f-s*a*h+i*c*h+r*a*d-i*l*d)+_*(+t*l*d-t*c*h+s*o*h-r*o*d+r*c*u-s*l*u)+g*(+t*c*f-t*a*d-s*o*f+i*o*d+s*a*u-i*c*u)+p*(-r*a*u-t*l*f+t*a*h+r*o*f-i*o*h+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],m=e[12],_=e[13],g=e[14],p=e[15],y=f*g*c-_*h*c+_*l*d-a*g*d-f*l*p+a*h*p,x=m*h*c-u*g*c-m*l*d+o*g*d+u*l*p-o*h*p,v=u*_*c-m*f*c+m*a*d-o*_*d-u*a*p+o*f*p,S=m*f*l-u*_*l-m*a*h+o*_*h+u*a*g-o*f*g,E=t*y+i*x+r*v+s*S;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/E;return e[0]=y*A,e[1]=(_*h*s-f*g*s-_*r*d+i*g*d+f*r*p-i*h*p)*A,e[2]=(a*g*s-_*l*s+_*r*c-i*g*c-a*r*p+i*l*p)*A,e[3]=(f*l*s-a*h*s-f*r*c+i*h*c+a*r*d-i*l*d)*A,e[4]=x*A,e[5]=(u*g*s-m*h*s+m*r*d-t*g*d-u*r*p+t*h*p)*A,e[6]=(m*l*s-o*g*s-m*r*c+t*g*c+o*r*p-t*l*p)*A,e[7]=(o*h*s-u*l*s+u*r*c-t*h*c-o*r*d+t*l*d)*A,e[8]=v*A,e[9]=(m*f*s-u*_*s-m*i*d+t*_*d+u*i*p-t*f*p)*A,e[10]=(o*_*s-m*a*s+m*i*c-t*_*c-o*i*p+t*a*p)*A,e[11]=(u*a*s-o*f*s-u*i*c+t*f*c+o*i*d-t*a*d)*A,e[12]=S*A,e[13]=(u*_*r-m*f*r+m*i*h-t*_*h-u*i*g+t*f*g)*A,e[14]=(m*a*r-o*_*r-m*i*l+t*_*l+o*i*g-t*a*g)*A,e[15]=(o*f*r-u*a*r+u*i*l-t*f*l-o*i*h+t*a*h)*A,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,f=a+a,h=s*c,d=s*u,m=s*f,_=o*u,g=o*f,p=a*f,y=l*c,x=l*u,v=l*f,S=i.x,E=i.y,A=i.z;return r[0]=(1-(_+p))*S,r[1]=(d+v)*S,r[2]=(m-x)*S,r[3]=0,r[4]=(d-v)*E,r[5]=(1-(h+p))*E,r[6]=(g+y)*E,r[7]=0,r[8]=(m+x)*A,r[9]=(g-y)*A,r[10]=(1-(h+_))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=lo.set(r[0],r[1],r[2]).length();const o=lo.set(r[4],r[5],r[6]).length(),a=lo.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],si.copy(this);const c=1/s,u=1/o,f=1/a;return si.elements[0]*=c,si.elements[1]*=c,si.elements[2]*=c,si.elements[4]*=u,si.elements[5]*=u,si.elements[6]*=u,si.elements[8]*=f,si.elements[9]*=f,si.elements[10]*=f,t.setFromRotationMatrix(si),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Ii){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),f=(t+e)/(t-e),h=(i+r)/(i-r);let d,m;if(a===Ii)d=-(o+s)/(o-s),m=-2*o*s/(o-s);else if(a===vl)d=-o/(o-s),m=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Ii){const l=this.elements,c=1/(t-e),u=1/(i-r),f=1/(o-s),h=(t+e)*c,d=(i+r)*u;let m,_;if(a===Ii)m=(o+s)*f,_=-2*f;else if(a===vl)m=s*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const lo=new F,si=new He,iC=new F(0,0,0),rC=new F(1,1,1),wr=new F,hc=new F,Fn=new F,X_=new He,$_=new On;class Wn{constructor(e=0,t=0,i=0,r=Wn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],f=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(Ye(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ye(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ye(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ye(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ye(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Ye(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return X_.makeRotationFromQuaternion(e),this.setFromRotationMatrix(X_,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $_.setFromEuler(this),this.setFromQuaternion($_,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Wn.DEFAULT_ORDER="XYZ";class Jf{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),d.length>0&&(i.animations=d),m.length>0&&(i.nodes=m)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){oi.subVectors(r,t),ji.subVectors(i,t),nd.subVectors(e,t);const o=oi.dot(oi),a=oi.dot(ji),l=oi.dot(nd),c=ji.dot(ji),u=ji.dot(nd),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;const h=1/f,d=(c*l-a*u)*h,m=(o*u-a*l)*h;return s.set(1-d-m,m,d)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Ki)===null?!1:Ki.x>=0&&Ki.y>=0&&Ki.x+Ki.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Ki)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Ki.x),l.addScaledVector(o,Ki.y),l.addScaledVector(a,Ki.z),l)}static getInterpolatedAttribute(e,t,i,r,s,o){return od.setScalar(0),ad.setScalar(0),ld.setScalar(0),od.fromBufferAttribute(e,t),ad.fromBufferAttribute(e,i),ld.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(od,s.x),o.addScaledVector(ad,s.y),o.addScaledVector(ld,s.z),o}static isFrontFacing(e,t,i,r){return oi.subVectors(i,t),ji.subVectors(e,t),oi.cross(ji).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return oi.subVectors(this.c,this.b),ji.subVectors(this.a,this.b),oi.cross(ji).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return In.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return In.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return In.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return In.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return In.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;fo.subVectors(r,i),ho.subVectors(s,i),id.subVectors(e,i);const l=fo.dot(id),c=ho.dot(id);if(l<=0&&c<=0)return t.copy(i);rd.subVectors(e,r);const u=fo.dot(rd),f=ho.dot(rd);if(u>=0&&f<=u)return t.copy(r);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(fo,o);sd.subVectors(e,s);const d=fo.dot(sd),m=ho.dot(sd);if(m>=0&&d<=m)return t.copy(s);const _=d*c-l*m;if(_<=0&&c>=0&&m<=0)return a=c/(c-m),t.copy(i).addScaledVector(ho,a);const g=u*m-d*f;if(g<=0&&f-u>=0&&d-m>=0)return J_.subVectors(s,r),a=(f-u)/(f-u+(d-m)),t.copy(r).addScaledVector(J_,a);const p=1/(g+_+h);return o=_*p,a=h*p,t.copy(i).addScaledVector(fo,o).addScaledVector(ho,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const rM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ar={h:0,s:0,l:0},pc={h:0,s:0,l:0};function cd(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Te{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=_n){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,rt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=rt.workingColorSpace){return this.r=e,this.g=t,this.b=i,rt.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=rt.workingColorSpace){if(e=Wm(e,1),t=Ye(t,0,1),i=Ye(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=cd(o,s,e+1/3),this.g=cd(o,s,e),this.b=cd(o,s,e-1/3)}return rt.toWorkingColorSpace(this,r),this}setStyle(e,t=_n){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=_n){const i=rM[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=hr(e.r),this.g=hr(e.g),this.b=hr(e.b),this}copyLinearToSRGB(e){return this.r=Bo(e.r),this.g=Bo(e.g),this.b=Bo(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=_n){return rt.fromWorkingColorSpace(sn.copy(this),e),Math.round(Ye(sn.r*255,0,255))*65536+Math.round(Ye(sn.g*255,0,255))*256+Math.round(Ye(sn.b*255,0,255))}getHexString(e=_n){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=rt.workingColorSpace){rt.fromWorkingColorSpace(sn.copy(this),t);const i=sn.r,r=sn.g,s=sn.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(r-s)/f+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Bs&&(i.blending=this.blending),this.side!==pr&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Iu&&(i.blendSrc=this.blendSrc),this.blendDst!==Lu&&(i.blendDst=this.blendDst),this.blendEquation!==Br&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Xs&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vp&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Es&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Es&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Es&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class yr extends un{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Te(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wn,this.combine=Vl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const sr=uC();function uC(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Cn(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Ye(n,-65504,65504),sr.floatView[0]=n;const e=sr.uint32View[0],t=e>>23&511;return sr.baseTable[t]+((e&8388607)>>sr.shiftTable[t])}function Ra(n){const e=n>>10;return sr.uint32View[0]=sr.mantissaTable[sr.offsetTable[e]+(n&1023)]+sr.exponentTable[e],sr.floatView[0]}const fC={toHalfFloat:Cn,fromHalfFloat:Ra},Vt=new F,mc=new fe;class bt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=_l,this.updateRanges=[],this.gpuType=Ln,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;rt.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new En);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],f=s[c];for(let h=0,d=f.length;h0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(Q_.copy(s).invert(),us.copy(e.ray).applyMatrix4(Q_),!(i.boundingBox!==null&&us.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,us)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,f=s.attributes.normal,h=s.groups,d=s.drawRange;if(a!==null)if(Array.isArray(o))for(let m=0,_=h.length;m<_;m++){const g=h[m],p=o[g.materialIndex],y=Math.max(g.start,d.start),x=Math.min(a.count,Math.min(g.start+g.count,d.start+d.count));for(let v=y,S=x;vt.far?null:{distance:c,point:bc.clone(),object:n}}function Mc(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,_c),n.getVertexPosition(l,vc),n.getVertexPosition(c,yc);const u=yC(n,e,t,i,_c,vc,yc,t0);if(u){const f=new F;In.getBarycoord(t0,_c,vc,yc,f),r&&(u.uv=In.getInterpolatedAttribute(r,a,l,c,f,new fe)),s&&(u.uv1=In.getInterpolatedAttribute(s,a,l,c,f,new fe)),o&&(u.normal=In.getInterpolatedAttribute(o,a,l,c,f,new F),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new F,materialIndex:0};In.getNormal(_c,vc,yc,h.normal),u.face=h,u.barycoord=f}return u}class Qs extends tt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],f=[];let h=0,d=0;m("z","y","x",-1,-1,i,t,e,o,s,0),m("z","y","x",1,-1,i,t,-e,o,s,1),m("x","z","y",1,1,e,i,t,r,o,2),m("x","z","y",1,-1,e,i,-t,r,o,3),m("x","y","z",1,-1,e,t,i,r,s,4),m("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Oe(c,3)),this.setAttribute("normal",new Oe(u,3)),this.setAttribute("uv",new Oe(f,2));function m(_,g,p,y,x,v,S,E,A,I,b){const M=v/A,U=S/I,z=v/2,H=S/2,K=E/2,ee=A+1,J=I+1;let ie=0,Q=0;const me=new F;for(let ve=0;ve0?1:-1,u.push(me.x,me.y,me.z),f.push(xe/A),f.push(1-ve/I),ie+=1}}for(let ve=0;ve0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Gl extends ot{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new He,this.projectionMatrix=new He,this.projectionMatrixInverse=new He,this.coordinateSystem=Ii}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Cr=new F,n0=new fe,i0=new fe;class Ht extends Gl{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=$o*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(zs*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $o*2*Math.atan(Math.tan(zs*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Cr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Cr.x,Cr.y).multiplyScalar(-e/Cr.z),Cr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Cr.x,Cr.y).multiplyScalar(-e/Cr.z)}getViewSize(e,t){return this.getViewBounds(e,n0,i0),t.subVectors(i0,n0)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(zs*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const mo=-90,go=1;class aM extends ot{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Ht(mo,go,e,t);r.layers=this.layers,this.add(r);const s=new Ht(mo,go,e,t);s.layers=this.layers,this.add(s);const o=new Ht(mo,go,e,t);o.layers=this.layers,this.add(o);const a=new Ht(mo,go,e,t);a.layers=this.layers,this.add(a);const l=new Ht(mo,go,e,t);l.layers=this.layers,this.add(l);const c=new Ht(mo,go,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Ii)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===vl)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(f,h,d),e.xr.enabled=m,i.texture.needsPMREMUpdate=!0}}class Wl extends Nt{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:mr,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class lM extends mi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Wl(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Xt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new Qs(5,5,5),s=new gi({name:"CubemapFromEquirect",uniforms:qo(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Sn,blending:fr});s.uniforms.tEquirect.value=t;const o=new Bt(r,s),a=t.minFilter;return t.minFilter===Pi&&(t.minFilter=Xt),new aM(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}class Qf{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Te(e),this.density=t}clone(){return new Qf(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class eh{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Te(e),this.near=t,this.far=i}clone(){return new eh(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class th extends ot{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Wn,this.environmentIntensity=1,this.environmentRotation=new Wn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class nh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=_l,this.updateRanges=[],this.version=0,this.uuid=Hn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:ma.clone(),uv:In.getInterpolation(ma,Sc,_a,Ec,r0,hd,s0,new fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Tc(n,e,t,i,r,s){xo.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(ga.x=s*xo.x-r*xo.y,ga.y=r*xo.x+s*xo.y):ga.copy(xo),n.copy(e),n.x+=ga.x,n.y+=ga.y,n.applyMatrix4(cM)}const wc=new F,o0=new F;class fM extends ot{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){wc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(wc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){wc.setFromMatrixPosition(e.matrixWorld),o0.setFromMatrixPosition(this.matrixWorld);const i=wc.distanceTo(o0)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||AC.getNormalMatrix(e),r=this.coplanarPoint(md).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const fs=new cn,Rc=new F;class Xl{constructor(e=new Ur,t=new Ur,i=new Ur,r=new Ur,s=new Ur,o=new Ur){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ii){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],f=r[6],h=r[7],d=r[8],m=r[9],_=r[10],g=r[11],p=r[12],y=r[13],x=r[14],v=r[15];if(i[0].setComponents(l-s,h-c,g-d,v-p).normalize(),i[1].setComponents(l+s,h+c,g+d,v+p).normalize(),i[2].setComponents(l+o,h+u,g+m,v+y).normalize(),i[3].setComponents(l-o,h-u,g-m,v-y).normalize(),i[4].setComponents(l-a,h-f,g-_,v-x).normalize(),t===Ii)i[5].setComponents(l+a,h+f,g+_,v+x).normalize();else if(t===vl)i[5].setComponents(a,f,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),fs.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),fs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(fs)}intersectsSprite(e){return fs.center.set(0,0,0),fs.radius=.7071067811865476,fs.applyMatrix4(e.matrixWorld),this.intersectsSphere(fs)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Rc.y=r.normal.y>0?e.max.y:e.min.y,Rc.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Rc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function gd(n,e){return n-e}function CC(n,e){return n.z-e.z}function RC(n,e){return e.z-n.z}class PC{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,r){const s=this.pool,o=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const a=s[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=r}reset(){this.list.length=0,this.index=0}}const An=new He,IC=new Te(1,1,1),_d=new Xl,Pc=new En,hs=new cn,xa=new F,m0=new F,LC=new F,vd=new PC,on=new Bt,Ic=[];function DC(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new bt(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new En);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(gd),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const s=this._matricesTexture;An.identity().toArray(s.image.data,r*16),s.needsUpdate=!0;const o=this._colorsTexture;return o&&(IC.toArray(o.image.data,r*4),o.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?o.count:i),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(gd),l=this._availableGeometryIds.shift(),s[l]=r):(l=this._geometryCount,this._geometryCount++,s.push(r)),this.setGeometryAt(l,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(r&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const f=t.getAttribute(u),h=i.getAttribute(u);DC(f,h,l);const d=f.itemSize;for(let m=f.count,_=c;m<_;m++){const g=l+m;for(let p=0;p=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let r=0,s=i.length;ra).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),s=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const s=new En,o=i.index,a=i.attributes.position;for(let l=r.start,c=r.start+r.count;l=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const s=new cn;this.getBoundingBoxAt(e,Pc),Pc.getCenter(s.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=r.start,u=r.start+r.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new tt,this._initializeGeometry(s));const o=this.geometry;s.index&&ds(s.index.array,o.index.array);for(const a in s.attributes)ds(s.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,o=this.geometry;on.material=this.material,on.geometry.index=o.index,on.geometry.attributes=o.attributes,on.geometry.boundingBox===null&&(on.geometry.boundingBox=new En),on.geometry.boundingSphere===null&&(on.geometry.boundingSphere=new cn);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,m=d.image.data;h&&(An.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),_d.setFromProjectionMatrix(An,e.coordinateSystem));let _=0;if(this.sortObjects){An.copy(this.matrixWorld).invert(),xa.setFromMatrixPosition(i.matrixWorld).applyMatrix4(An),m0.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(An);for(let y=0,x=l.length;y0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;yd.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(yd);if(!(le.far))return{distance:l,point:_0.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:n}}const v0=new F,y0=new F;class Hi extends $r{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class Io extends ot{constructor(){super(),this.isGroup=!0,this.type="Group"}}class OC extends Nt{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Xt,this.magFilter=s!==void 0?s:Xt,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class NC extends Nt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=tn,this.minFilter=tn,this.generateMipmaps=!1,this.needsUpdate=!0}}class rh extends Nt{constructor(e,t,i,r,s,o,a,l,c,u,f,h){super(null,o,a,l,c,u,r,s,f,h),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class UC extends rh{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Zn,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class FC extends rh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,mr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class BC extends Nt{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Jm extends Nt{constructor(e,t,i,r,s,o,a,l,c,u=ks){if(u!==ks&&u!==qs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===ks&&(i=gr),i===void 0&&u===qs&&(i=$s),super(null,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:tn,this.minFilter=l!==void 0?l:tn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class yi{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],h=i[r+1]-u,d=(o-u)/h;return(r+d)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new fe:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new F,r=[],s=[],o=[],a=new F,l=new He;for(let d=0;d<=e;d++){const m=d/e;r[d]=this.getTangentAt(m,new F)}s[0]=new F,o[0]=new F;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),f=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),h<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let d=1;d<=e;d++){if(s[d]=s[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(r[d-1],r[d]),a.length()>Number.EPSILON){a.normalize();const m=Math.acos(Ye(r[d-1].dot(r[d]),-1,1));s[d].applyMatrix4(l.makeRotationAxis(a,m))}o[d].crossVectors(r[d],s[d])}if(t===!0){let d=Math.acos(Ye(s[0].dot(s[e]),-1,1));d/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(d=-d);for(let m=1;m<=e;m++)s[m].applyMatrix4(l.makeRotationAxis(r[m],d*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class sh extends yi{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new fe){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(Uc.subVectors(r[0],r[1]).add(r[0]),c=Uc);const f=r[a%s],h=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],f=r[o>r.length-3?r.length-1:o+2];return i.set(M0(a,l.x,c.x,u.x,f.x),M0(a,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class $l extends tt{constructor(e=[new fe(0,-.5),new fe(.5,0),new fe(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=Ye(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,f=new F,h=new fe,d=new F,m=new F,_=new F;let g=0,p=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,p=e[y+1].y-e[y].y,d.x=p*1,d.y=-g,d.z=p*0,_.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[y+1].x-e[y].x,p=e[y+1].y-e[y].y,d.x=p*1,d.y=-g,d.z=p*0,m.copy(d),d.x+=_.x,d.y+=_.y,d.z+=_.z,d.normalize(),l.push(d.x,d.y,d.z),_.copy(m)}for(let y=0;y<=t;y++){const x=i+y*u*r,v=Math.sin(x),S=Math.cos(x);for(let E=0;E<=e.length-1;E++){f.x=e[E].x*v,f.y=e[E].y,f.z=e[E].x*S,o.push(f.x,f.y,f.z),h.x=y/t,h.y=E/(e.length-1),a.push(h.x,h.y);const A=l[3*E+0]*v,I=l[3*E+1],b=l[3*E+0]*S;c.push(A,I,b)}}for(let y=0;y0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Oe(f,3)),this.setAttribute("normal",new Oe(h,3)),this.setAttribute("uv",new Oe(d,2));function y(){const v=new F,S=new F;let E=0;const A=(t-e)/i;for(let I=0;I<=s;I++){const b=[],M=I/s,U=M*(t-e)+e;for(let z=0;z<=r;z++){const H=z/r,K=H*l+a,ee=Math.sin(K),J=Math.cos(K);S.x=U*ee,S.y=-M*i+g,S.z=U*J,f.push(S.x,S.y,S.z),v.set(ee,A,J).normalize(),h.push(v.x,v.y,v.z),d.push(H,1-M),b.push(m++)}_.push(b)}for(let I=0;I0||b!==0)&&(u.push(M,U,H),E+=3),(t>0||b!==s-1)&&(u.push(U,z,H),E+=3)}c.addGroup(p,E,0),p+=E}function x(v){const S=m,E=new fe,A=new F;let I=0;const b=v===!0?e:t,M=v===!0?1:-1;for(let z=1;z<=r;z++)f.push(0,g*M,0),h.push(0,M,0),d.push(.5,.5),m++;const U=m;for(let z=0;z<=r;z++){const K=z/r*l+a,ee=Math.cos(K),J=Math.sin(K);A.x=b*J,A.y=g*M,A.z=b*ee,f.push(A.x,A.y,A.z),h.push(0,M,0),E.x=ee*.5+.5,E.y=J*.5*M+.5,d.push(E.x,E.y),m++}for(let z=0;z.9&&A<.1&&(x<.2&&(o[y+0]+=1),v<.2&&(o[y+2]+=1),S<.2&&(o[y+4]+=1))}}function h(y){s.push(y.x,y.y,y.z)}function d(y,x){const v=y*3;x.x=e[v+0],x.y=e[v+1],x.z=e[v+2]}function m(){const y=new F,x=new F,v=new F,S=new F,E=new fe,A=new fe,I=new fe;for(let b=0,M=0;b80*t){a=c=n[0],l=u=n[1];for(let m=t;mc&&(c=f),h>u&&(u=h);d=Math.max(c-a,u-l),d=d!==0?32767/d:0}return bl(s,o,t,a,l,d,0),o}};function SM(n,e,t,i,r){let s,o;if(r===lR(n,e,t,i)>0)for(s=e;s=e;s-=i)o=S0(s,n[s],n[s+1],o);return o&&uh(o,o.next)&&(Sl(o),o=o.next),o}function Ks(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(uh(t,t.next)||It(t.prev,t,t.next)===0)){if(Sl(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function bl(n,e,t,i,r,s,o){if(!n)return;!o&&s&&nR(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?YC(n,i,r,s):qC(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),Sl(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=jC(Ks(n),e,t),bl(n,e,t,i,r,s,2)):o===2&&KC(n,e,t,i,r,s):bl(Ks(n),e,t,i,r,s,1);break}}}function qC(n){const e=n.prev,t=n,i=n.next;if(It(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=rs?r>o?r:o:s>o?s:o,d=a>l?a>c?a:c:l>c?l:c;let m=i.next;for(;m!==e;){if(m.x>=u&&m.x<=h&&m.y>=f&&m.y<=d&&Lo(r,a,s,l,o,c,m.x,m.y)&&It(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function YC(n,e,t,i){const r=n.prev,s=n,o=n.next;if(It(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,f=s.y,h=o.y,d=al?a>c?a:c:l>c?l:c,g=u>f?u>h?u:h:f>h?f:h,p=bp(d,m,e,t,i),y=bp(_,g,e,t,i);let x=n.prevZ,v=n.nextZ;for(;x&&x.z>=p&&v&&v.z<=y;){if(x.x>=d&&x.x<=_&&x.y>=m&&x.y<=g&&x!==r&&x!==o&&Lo(a,u,l,f,c,h,x.x,x.y)&&It(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=d&&v.x<=_&&v.y>=m&&v.y<=g&&v!==r&&v!==o&&Lo(a,u,l,f,c,h,v.x,v.y)&&It(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=p;){if(x.x>=d&&x.x<=_&&x.y>=m&&x.y<=g&&x!==r&&x!==o&&Lo(a,u,l,f,c,h,x.x,x.y)&&It(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=_&&v.y>=m&&v.y<=g&&v!==r&&v!==o&&Lo(a,u,l,f,c,h,v.x,v.y)&&It(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function jC(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!uh(r,s)&&EM(r,i,i.next,s)&&Ml(r,s)&&Ml(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Sl(i),Sl(i.next),i=n=s),i=i.next}while(i!==n);return Ks(i)}function KC(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&sR(o,a)){let l=TM(o,a);o=Ks(o,o.next),l=Ks(l,l.next),bl(o,e,t,i,r,s,0),bl(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function ZC(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const h=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=s&&h>i&&(i=h,r=t.x=t.x&&t.x>=l&&s!==t.x&&Lo(or.x||t.x===r.x&&tR(r,t)))&&(r=t,u=f)),t=t.next;while(t!==a);return r}function tR(n,e){return It(n.prev,n,e.prev)<0&&It(e.next,n,n.next)<0}function nR(n,e,t,i){let r=n;do r.z===0&&(r.z=bp(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,iR(r)}function iR(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function bp(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function rR(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function sR(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!oR(n,e)&&(Ml(n,e)&&Ml(e,n)&&aR(n,e)&&(It(n.prev,n,e.prev)||It(n,e.prev,e))||uh(n,e)&&It(n.prev,n,n.next)>0&&It(e.prev,e,e.next)>0)}function It(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function uh(n,e){return n.x===e.x&&n.y===e.y}function EM(n,e,t,i){const r=Vc(It(n,e,t)),s=Vc(It(n,e,i)),o=Vc(It(t,i,n)),a=Vc(It(t,i,e));return!!(r!==s&&o!==a||r===0&&zc(n,t,e)||s===0&&zc(n,i,e)||o===0&&zc(t,n,i)||a===0&&zc(t,e,i))}function zc(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Vc(n){return n>0?1:n<0?-1:0}function oR(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&EM(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Ml(n,e){return It(n.prev,n,n.next)<0?It(n,e,n.next)>=0&&It(n,n.prev,e)>=0:It(n,e,n.prev)<0||It(n,n.next,e)<0}function aR(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function TM(n,e){const t=new Mp(n.i,n.x,n.y),i=new Mp(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function S0(n,e,t,i){const r=new Mp(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Sl(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Mp(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function lR(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function T0(n,e){for(let t=0;tNumber.EPSILON){const N=Math.sqrt(C),V=Math.sqrt(k*k+w*w),q=D.x-O/N,he=D.y+R/N,ce=T.x-w/V,ye=T.y+k/V,Ne=((ce-q)*w-(ye-he)*k)/(R*w-O*k);Y=q+R*Ne-P.x,G=he+O*Ne-P.y;const pe=Y*Y+G*G;if(pe<=2)return new fe(Y,G);$=Math.sqrt(pe/2)}else{let N=!1;R>Number.EPSILON?k>Number.EPSILON&&(N=!0):R<-Number.EPSILON?k<-Number.EPSILON&&(N=!0):Math.sign(O)===Math.sign(w)&&(N=!0),N?(Y=-O,G=R,$=Math.sqrt(C)):(Y=R,G=O,$=Math.sqrt(C/2))}return new fe(Y/$,G/$)}const me=[];for(let P=0,D=K.length,T=D-1,Y=P+1;P=0;P--){const D=P/g,T=d*Math.cos(D*Math.PI/2),Y=m*Math.sin(D*Math.PI/2)+_;for(let G=0,$=K.length;G<$;G++){const R=ee(K[G],me[G],Y);W(R.x,R.y,f+T)}for(let G=0,$=U.length;G<$;G++){const R=U[G];re=ve[G];for(let O=0,k=R.length;O=0;){const Y=T;let G=T-1;G<0&&(G=P.length-1);for(let $=0,R=u+g*2;$0)&&d.push(x,v,E),(p!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PM extends un{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Te(16777215),this.specular=new Te(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Te(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wn,this.combine=Vl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class IM extends un{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Te(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Te(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class LM extends un{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class DM extends un{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Te(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Te(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wn,this.combine=Vl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class og extends un{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Wb,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class ag extends un{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class OM extends un{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Te(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NM extends Tn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Os(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function UM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function FM(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function Sp(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function lg(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function hR(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[d]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[m]){const p=m*f+u,y=p+f-u;_=a.values.slice(p,y)}else{const p=a.createInterpolant(),y=u,x=f-u;p.evaluate(s),_=p.resultBuffer.slice(y,x)}l==="quaternion"&&new On().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let p=0;p=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&UM(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===cu,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}xi.prototype.TimeBufferType=Float32Array;xi.prototype.ValueBufferType=Float32Array;xi.prototype.DefaultInterpolation=df;class eo extends xi{constructor(e,t,i){super(e,t,i)}}eo.prototype.ValueTypeName="bool";eo.prototype.ValueBufferType=Array;eo.prototype.DefaultInterpolation=pl;eo.prototype.InterpolantFactoryMethodLinear=void 0;eo.prototype.InterpolantFactoryMethodSmooth=void 0;class ug extends xi{}ug.prototype.ValueTypeName="color";class El extends xi{}El.prototype.ValueTypeName="number";class zM extends jl{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)On.slerpFlat(s,0,o,c-a,o,c,l);return s}}class Kl extends xi{InterpolantFactoryMethodLinear(e){return new zM(this.times,this.values,this.getValueSize(),e)}}Kl.prototype.ValueTypeName="quaternion";Kl.prototype.InterpolantFactoryMethodSmooth=void 0;class to extends xi{constructor(e,t,i){super(e,t,i)}}to.prototype.ValueTypeName="string";to.prototype.ValueBufferType=Array;to.prototype.DefaultInterpolation=pl;to.prototype.InterpolantFactoryMethodLinear=void 0;to.prototype.InterpolantFactoryMethodSmooth=void 0;class Tl extends xi{}Tl.prototype.ValueTypeName="vector";class wl{constructor(e="",t=-1,i=[],r=Kf){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Hn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(gR(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(xi.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const f=u[1];let h=r[f];h||(r[f]=h=[]),h.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,m,_){if(d.length!==0){const g=[],p=[];lg(d,g,p,m),g.length!==0&&_.push(new f(h,g,p))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(s),this.manager.itemEnd(e)},0),s;if(Zi[e]!==void 0){Zi[e].push({onLoad:t,onProgress:i,onError:r});return}Zi[e]=[],Zi[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Zi[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=h?parseInt(h):0,m=d!==0;let _=0;const g=new ReadableStream({start(p){y();function y(){f.read().then(({done:x,value:v})=>{if(x)p.close();else{_+=v.byteLength;const S=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:d});for(let E=0,A=u.length;E{p.error(x)})}}});return new Response(g)}else throw new _R(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),h=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(h);return c.arrayBuffer().then(m=>d.decode(m))}}}).then(c=>{ar.add(e,c);const u=Zi[e];delete Zi[e];for(let f=0,h=u.length;f{const u=Zi[e];if(u===void 0)throw this.manager.itemError(e),c;delete Zi[e];for(let f=0,h=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class vR extends Nn{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new _r(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Te().setHex(o.value);break;case"v2":r.uniforms[s].value=new fe().fromArray(o.value);break;case"v3":r.uniforms[s].value=new F().fromArray(o.value);break;case"v4":r.uniforms[s].value=new ct().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Ke().fromArray(o.value);break;case"m4":r.uniforms[s].value=new He().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new fe().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return xh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:AM,SpriteMaterial:jm,RawShaderMaterial:CM,ShaderMaterial:gi,PointsMaterial:Zm,MeshPhysicalMaterial:RM,MeshStandardMaterial:sg,MeshPhongMaterial:PM,MeshToonMaterial:IM,MeshNormalMaterial:LM,MeshLambertMaterial:DM,MeshDepthMaterial:og,MeshDistanceMaterial:ag,MeshBasicMaterial:yr,MeshMatcapMaterial:OM,LineDashedMaterial:NM,LineBasicMaterial:Tn,Material:un};return new t[e]}}class Ep{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new fg(t);s=new Al(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new Al(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const g=new En;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const p=new cn;return p.radius=_.sphereRadius,p.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:p}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new fM;break;case"Line":o=new $r(a(e.geometry),l(e.material));break;case"LineLoop":o=new mM(a(e.geometry),l(e.material));break;case"LineSegments":o=new Hi(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new gM(a(e.geometry),l(e.material));break;case"Sprite":o=new uM(l(e.material));break;case"Group":o=new Io;break;case"Bone":o=new Km;break;default:o=new ot}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let d=0;d"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=ar.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return ar.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),ar.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});ar.add(e,l),s.manager.itemStart(e)}}let Hc;class dg{static getContext(){return Hc===void 0&&(Hc=new(window.AudioContext||window.webkitAudioContext)),Hc}static setContext(e){Hc=e}}class RR extends Nn{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new _r(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);dg.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const D0=new He,O0=new He,ps=new He;class PR{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ht,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ht,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,ps.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(zs*t.fov*.5)/t.zoom;let a,l;O0.elements[12]=-r,D0.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,ps.elements[0]=2*t.near/(l-a),ps.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(ps),a=-o*t.aspect-s,l=o*t.aspect-s,ps.elements[0]=2*t.near/(l-a),ps.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(ps)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(O0),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(D0)}}class JM extends Ht{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class bh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=N0(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=N0();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function N0(){return performance.now()}const ms=new F,U0=new On,IR=new F,gs=new F;class LR extends ot{constructor(){super(),this.type="AudioListener",this.context=dg.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new bh}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ms,U0,IR),gs.set(0,0,-1).applyQuaternion(U0),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ms.x,r),t.positionY.linearRampToValueAtTime(ms.y,r),t.positionZ.linearRampToValueAtTime(ms.z,r),t.forwardX.linearRampToValueAtTime(gs.x,r),t.forwardY.linearRampToValueAtTime(gs.y,r),t.forwardZ.linearRampToValueAtTime(gs.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(ms.x,ms.y,ms.z),t.setOrientation(gs.x,gs.y,gs.z,i.x,i.y,i.z)}}class QM extends ot{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){On.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;On.multiplyQuaternionsFlat(e,o,e,t,e,i),On.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const pg="\\[\\]\\.:\\/",UR=new RegExp("["+pg+"]","g"),mg="[^"+pg+"]",FR="[^"+pg.replace("\\.","")+"]",BR=/((?:WC+[\/:])*)/.source.replace("WC",mg),kR=/(WCOD+)?/.source.replace("WCOD",FR),zR=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",mg),VR=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",mg),HR=new RegExp("^"+BR+kR+zR+VR+"$"),GR=["material","materials","bones","map"];class WR{constructor(e,t,i){const r=i||lt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class lt{constructor(e,t,i){this.path=t,this.parsedPath=i||lt.parseTrackName(t),this.node=lt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new lt.Composite(e,t,i):new lt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(UR,"")}static parseTrackName(e){const t=HR.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);GR.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const f=s++,h=e[f];t[h.uuid]=u,e[u]=h,t[c]=f,e[f]=l;for(let d=0,m=r;d!==m;++d){const _=i[d],g=_[f],p=_[u];_[u]=g,_[f]=p}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[d.uuid]=f),e[f]=d,e.pop();for(let m=0,_=r;m!==_;++m){const g=i[m];g[f]=g[h],g.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(f);for(let h=u,d=l.length;h!==d;++h){const m=l[h];f[h]=new lt(m,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class tS{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Is,endingEnd:Is};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Hb,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Hm:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case Kf:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===Gb;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===Vb){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Ls,r.endingEnd=Ls):(e?r.endingStart=this.zeroSlopeAtStart?Ls:Is:r.endingStart=ml,t?r.endingEnd=this.zeroSlopeAtEnd?Ls:Is:r.endingEnd=ml)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const $R=new Float32Array(1);class qR extends Vi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==s;++f){const h=r[f],d=h.name;let m=u[d];if(m!==void 0)++m.referenceCount,o[f]=m;else{if(m=o[f],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,l,d));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;m=new eS(lt.create(i,d,_),h.ValueTypeName,h.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,d),o[f]=m}a[f].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,z0).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const V0=new F,Gc=new F;class tP{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){V0.subVectors(e,this.start),Gc.subVectors(this.end,this.start);const i=Gc.dot(Gc);let s=Gc.dot(V0)/i;return t&&(s=Ye(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const H0=new F;class nP extends ot{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new tt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{q0.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(q0,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class mP extends Hi{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new tt;r.setAttribute("position",new Oe(t,3)),r.setAttribute("color",new Oe(i,3));const s=new Tn({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Te,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class gP{constructor(){this.type="ShapePath",this.color=new Te,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new xl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(p){const y=[];for(let x=0,v=p.length;xNumber.EPSILON){if(M<0&&(A=y[E],b=-b,I=y[S],M=-M),p.yI.y)continue;if(p.y===A.y){if(p.x===A.x)return!0}else{const U=M*(p.x-A.x)-b*(p.y-A.y);if(U===0)return!0;if(U<0)continue;v=!v}}else{if(p.y!==A.y)continue;if(I.x<=p.x&&p.x<=A.x||A.x<=p.x&&p.x<=I.x)return!0}}return v}const r=Ni.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Vs,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const f=[],h=[];let d=[],m=0,_;h[m]=void 0,d[m]=[];for(let p=0,y=s.length;p1){let p=!1,y=0;for(let x=0,v=h.length;x0&&p===!1&&(d=f)}let g;for(let p=0,y=h.length;pe?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function yP(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function xP(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function wp(n,e,t,i){const r=bP(i);switch(t){case Um:return n*e;case Bm:return n*e;case km:return n*e*2;case qf:return n*e/r.components*r.byteLength;case Hl:return n*e/r.components*r.byteLength;case zm:return n*e*2/r.components*r.byteLength;case Yf:return n*e*2/r.components*r.byteLength;case Fm:return n*e*3/r.components*r.byteLength;case Mn:return n*e*4/r.components*r.byteLength;case jf:return n*e*4/r.components*r.byteLength;case Fa:case Ba:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case ka:case za:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Vu:case Gu:return Math.max(n,16)*Math.max(e,8)/4;case zu:case Hu:return Math.max(n,8)*Math.max(e,8)/2;case Wu:case Xu:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case $u:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case qu:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Yu:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case ju:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Ku:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case Zu:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case Ju:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Qu:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case ef:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case tf:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case nf:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case rf:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case sf:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case of:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case af:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Va:case lf:case cf:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Vm:case uf:return Math.ceil(n/4)*Math.ceil(e/4)*8;case ff:case hf:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function bP(n){switch(n){case Bi:case Dm:return{byteLength:1,components:1};case Xo:case Om:case ia:return{byteLength:2,components:1};case Xf:case $f:return{byteLength:2,components:4};case gr:case Wf:case Ln:return{byteLength:4,components:1};case Nm:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const MP={contain:vP,cover:yP,fill:xP,getByteLength:wp};class SP extends mi{constructor(e=1,t=1,i=1,r={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(e,t,{...r,count:i}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:zl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=zl);/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */function rS(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function EP(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,f=c.byteLength,h=n.createBuffer();n.bindBuffer(l,h),n.bufferData(l,c,u),a.onUploadCallback();let d;if(c instanceof Float32Array)d=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?d=n.HALF_FLOAT:d=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=n.SHORT;else if(c instanceof Uint32Array)d=n.UNSIGNED_INT;else if(c instanceof Int32Array)d=n.INT;else if(c instanceof Int8Array)d=n.BYTE;else if(c instanceof Uint8Array)d=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const u=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,u);else{f.sort((d,m)=>d.start-m.start);let h=0;for(let d=1;d 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,VP=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,HP=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,GP=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,WP=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,XP=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,$P=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,qP=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,YP=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,jP=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,KP=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,ZP=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,JP=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,QP=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,eI=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,tI="gl_FragColor = linearToOutputTexel( gl_FragColor );",nI=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,iI=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,rI=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,sI=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,oI=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,aI=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,lI=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,cI=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,uI=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,fI=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,hI=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,dI=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,pI=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,mI=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,gI=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,_I=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,vI=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,yI=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,xI=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,bI=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,MI=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,SI=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,EI=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,TI=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,wI=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,AI=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,CI=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,RI=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,PI=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,II=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,LI=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,DI=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,OI=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,NI=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,UI=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,FI=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,BI=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,kI=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,zI=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,VI=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,HI=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,GI=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,WI=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,XI=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,$I=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,qI=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,YI=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,jI=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,KI=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,ZI=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,JI=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,QI=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,eL=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,tL=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,nL=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,iL=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,rL=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,sL=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,oL=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,aL=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,lL=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,cL=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,uL=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,fL=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,hL=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,dL=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,pL=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,mL=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,gL=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,_L=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,vL=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,yL=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,xL=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,bL=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,ML=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,SL=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const EL=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,TL=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,wL=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,AL=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,CL=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,RL=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,PL=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,IL=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,LL=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,DL=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,OL=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,NL=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,UL=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,FL=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,BL=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,kL=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,zL=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,VL=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,HL=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,GL=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,WL=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,XL=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,$L=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,qL=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,YL=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,jL=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,KL=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,ZL=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,JL=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,QL=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,eD=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,tD=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,nD=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,iD=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,et={alphahash_fragment:TP,alphahash_pars_fragment:wP,alphamap_fragment:AP,alphamap_pars_fragment:CP,alphatest_fragment:RP,alphatest_pars_fragment:PP,aomap_fragment:IP,aomap_pars_fragment:LP,batching_pars_vertex:DP,batching_vertex:OP,begin_vertex:NP,beginnormal_vertex:UP,bsdfs:FP,iridescence_fragment:BP,bumpmap_pars_fragment:kP,clipping_planes_fragment:zP,clipping_planes_pars_fragment:VP,clipping_planes_pars_vertex:HP,clipping_planes_vertex:GP,color_fragment:WP,color_pars_fragment:XP,color_pars_vertex:$P,color_vertex:qP,common:YP,cube_uv_reflection_fragment:jP,defaultnormal_vertex:KP,displacementmap_pars_vertex:ZP,displacementmap_vertex:JP,emissivemap_fragment:QP,emissivemap_pars_fragment:eI,colorspace_fragment:tI,colorspace_pars_fragment:nI,envmap_fragment:iI,envmap_common_pars_fragment:rI,envmap_pars_fragment:sI,envmap_pars_vertex:oI,envmap_physical_pars_fragment:_I,envmap_vertex:aI,fog_vertex:lI,fog_pars_vertex:cI,fog_fragment:uI,fog_pars_fragment:fI,gradientmap_pars_fragment:hI,lightmap_pars_fragment:dI,lights_lambert_fragment:pI,lights_lambert_pars_fragment:mI,lights_pars_begin:gI,lights_toon_fragment:vI,lights_toon_pars_fragment:yI,lights_phong_fragment:xI,lights_phong_pars_fragment:bI,lights_physical_fragment:MI,lights_physical_pars_fragment:SI,lights_fragment_begin:EI,lights_fragment_maps:TI,lights_fragment_end:wI,logdepthbuf_fragment:AI,logdepthbuf_pars_fragment:CI,logdepthbuf_pars_vertex:RI,logdepthbuf_vertex:PI,map_fragment:II,map_pars_fragment:LI,map_particle_fragment:DI,map_particle_pars_fragment:OI,metalnessmap_fragment:NI,metalnessmap_pars_fragment:UI,morphinstance_vertex:FI,morphcolor_vertex:BI,morphnormal_vertex:kI,morphtarget_pars_vertex:zI,morphtarget_vertex:VI,normal_fragment_begin:HI,normal_fragment_maps:GI,normal_pars_fragment:WI,normal_pars_vertex:XI,normal_vertex:$I,normalmap_pars_fragment:qI,clearcoat_normal_fragment_begin:YI,clearcoat_normal_fragment_maps:jI,clearcoat_pars_fragment:KI,iridescence_pars_fragment:ZI,opaque_fragment:JI,packing:QI,premultiplied_alpha_fragment:eL,project_vertex:tL,dithering_fragment:nL,dithering_pars_fragment:iL,roughnessmap_fragment:rL,roughnessmap_pars_fragment:sL,shadowmap_pars_fragment:oL,shadowmap_pars_vertex:aL,shadowmap_vertex:lL,shadowmask_pars_fragment:cL,skinbase_vertex:uL,skinning_pars_vertex:fL,skinning_vertex:hL,skinnormal_vertex:dL,specularmap_fragment:pL,specularmap_pars_fragment:mL,tonemapping_fragment:gL,tonemapping_pars_fragment:_L,transmission_fragment:vL,transmission_pars_fragment:yL,uv_pars_fragment:xL,uv_pars_vertex:bL,uv_vertex:ML,worldpos_vertex:SL,background_vert:EL,background_frag:TL,backgroundCube_vert:wL,backgroundCube_frag:AL,cube_vert:CL,cube_frag:RL,depth_vert:PL,depth_frag:IL,distanceRGBA_vert:LL,distanceRGBA_frag:DL,equirect_vert:OL,equirect_frag:NL,linedashed_vert:UL,linedashed_frag:FL,meshbasic_vert:BL,meshbasic_frag:kL,meshlambert_vert:zL,meshlambert_frag:VL,meshmatcap_vert:HL,meshmatcap_frag:GL,meshnormal_vert:WL,meshnormal_frag:XL,meshphong_vert:$L,meshphong_frag:qL,meshphysical_vert:YL,meshphysical_frag:jL,meshtoon_vert:KL,meshtoon_frag:ZL,points_vert:JL,points_frag:QL,shadow_vert:eD,shadow_frag:tD,sprite_vert:nD,sprite_frag:iD},Se={common:{diffuse:{value:new Te(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ke},alphaMap:{value:null},alphaMapTransform:{value:new Ke},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ke}},envmap:{envMap:{value:null},envMapRotation:{value:new Ke},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ke}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ke}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ke},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ke},normalScale:{value:new fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ke},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ke}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ke}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ke}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Te(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Te(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ke},alphaTest:{value:0},uvTransform:{value:new Ke}},sprite:{diffuse:{value:new Te(16777215)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ke},alphaMap:{value:null},alphaMapTransform:{value:new Ke},alphaTest:{value:0}}},ai={basic:{uniforms:pn([Se.common,Se.specularmap,Se.envmap,Se.aomap,Se.lightmap,Se.fog]),vertexShader:et.meshbasic_vert,fragmentShader:et.meshbasic_frag},lambert:{uniforms:pn([Se.common,Se.specularmap,Se.envmap,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.fog,Se.lights,{emissive:{value:new Te(0)}}]),vertexShader:et.meshlambert_vert,fragmentShader:et.meshlambert_frag},phong:{uniforms:pn([Se.common,Se.specularmap,Se.envmap,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.fog,Se.lights,{emissive:{value:new Te(0)},specular:{value:new Te(1118481)},shininess:{value:30}}]),vertexShader:et.meshphong_vert,fragmentShader:et.meshphong_frag},standard:{uniforms:pn([Se.common,Se.envmap,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.roughnessmap,Se.metalnessmap,Se.fog,Se.lights,{emissive:{value:new Te(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag},toon:{uniforms:pn([Se.common,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.gradientmap,Se.fog,Se.lights,{emissive:{value:new Te(0)}}]),vertexShader:et.meshtoon_vert,fragmentShader:et.meshtoon_frag},matcap:{uniforms:pn([Se.common,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.fog,{matcap:{value:null}}]),vertexShader:et.meshmatcap_vert,fragmentShader:et.meshmatcap_frag},points:{uniforms:pn([Se.points,Se.fog]),vertexShader:et.points_vert,fragmentShader:et.points_frag},dashed:{uniforms:pn([Se.common,Se.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:et.linedashed_vert,fragmentShader:et.linedashed_frag},depth:{uniforms:pn([Se.common,Se.displacementmap]),vertexShader:et.depth_vert,fragmentShader:et.depth_frag},normal:{uniforms:pn([Se.common,Se.bumpmap,Se.normalmap,Se.displacementmap,{opacity:{value:1}}]),vertexShader:et.meshnormal_vert,fragmentShader:et.meshnormal_frag},sprite:{uniforms:pn([Se.sprite,Se.fog]),vertexShader:et.sprite_vert,fragmentShader:et.sprite_frag},background:{uniforms:{uvTransform:{value:new Ke},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:et.background_vert,fragmentShader:et.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ke}},vertexShader:et.backgroundCube_vert,fragmentShader:et.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:et.cube_vert,fragmentShader:et.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:et.equirect_vert,fragmentShader:et.equirect_frag},distanceRGBA:{uniforms:pn([Se.common,Se.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:et.distanceRGBA_vert,fragmentShader:et.distanceRGBA_frag},shadow:{uniforms:pn([Se.lights,Se.fog,{color:{value:new Te(0)},opacity:{value:1}}]),vertexShader:et.shadow_vert,fragmentShader:et.shadow_frag}};ai.physical={uniforms:pn([ai.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ke},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ke},clearcoatNormalScale:{value:new fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ke},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ke},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ke},sheen:{value:0},sheenColor:{value:new Te(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ke},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ke},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ke},transmissionSamplerSize:{value:new fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ke},attenuationDistance:{value:0},attenuationColor:{value:new Te(0)},specularColor:{value:new Te(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ke},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ke},anisotropyVector:{value:new fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ke}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag};const jc={r:0,b:0,g:0},ys=new Wn,rD=new He;function sD(n,e,t,i,r,s,o){const a=new Te(0);let l=s===!0?0:1,c,u,f=null,h=0,d=null;function m(x){let v=x.isScene===!0?x.background:null;return v&&v.isTexture&&(v=(x.backgroundBlurriness>0?t:e).get(v)),v}function _(x){let v=!1;const S=m(x);S===null?p(a,l):S&&S.isColor&&(p(S,1),v=!0);const E=n.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,o):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(x,v){const S=m(v);S&&(S.isCubeTexture||S.mapping===na)?(u===void 0&&(u=new Bt(new Qs(1,1,1),new gi({name:"BackgroundCubeMaterial",uniforms:qo(ai.backgroundCube.uniforms),vertexShader:ai.backgroundCube.vertexShader,fragmentShader:ai.backgroundCube.fragmentShader,side:Sn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,A,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),ys.copy(v.backgroundRotation),ys.x*=-1,ys.y*=-1,ys.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(ys.y*=-1,ys.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(rD.makeRotationFromEuler(ys)),u.material.toneMapped=rt.getTransfer(S.colorSpace)!==yt,(f!==S||h!==S.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,f=S,h=S.version,d=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new Bt(new oa(2,2),new gi({name:"BackgroundMaterial",uniforms:qo(ai.background.uniforms),vertexShader:ai.background.vertexShader,fragmentShader:ai.background.fragmentShader,side:pr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=rt.getTransfer(S.colorSpace)!==yt,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(f!==S||h!==S.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,f=S,h=S.version,d=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function p(x,v){x.getRGB(jc,sM(n)),i.buffers.color.setClear(jc.r,jc.g,jc.b,v,o)}function y(){u!==void 0&&(u.geometry.dispose(),u.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return a},setClearColor:function(x,v=1){a.set(x),l=v,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,p(a,l)},render:_,addToRenderList:g,dispose:y}}function oD(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=h(null);let s=r,o=!1;function a(M,U,z,H,K){let ee=!1;const J=f(H,z,U);s!==J&&(s=J,c(s.object)),ee=d(M,H,z,K),ee&&m(M,H,z,K),K!==null&&e.update(K,n.ELEMENT_ARRAY_BUFFER),(ee||o)&&(o=!1,v(M,U,z,H),K!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(K).buffer))}function l(){return n.createVertexArray()}function c(M){return n.bindVertexArray(M)}function u(M){return n.deleteVertexArray(M)}function f(M,U,z){const H=z.wireframe===!0;let K=i[M.id];K===void 0&&(K={},i[M.id]=K);let ee=K[U.id];ee===void 0&&(ee={},K[U.id]=ee);let J=ee[H];return J===void 0&&(J=h(l()),ee[H]=J),J}function h(M){const U=[],z=[],H=[];for(let K=0;K=0){const ve=K[Q];let re=ee[Q];if(re===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(re=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(re=M.instanceColor)),ve===void 0||ve.attribute!==re||re&&ve.data!==re.data)return!0;J++}return s.attributesNum!==J||s.index!==H}function m(M,U,z,H){const K={},ee=U.attributes;let J=0;const ie=z.getAttributes();for(const Q in ie)if(ie[Q].location>=0){let ve=ee[Q];ve===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(ve=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(ve=M.instanceColor));const re={};re.attribute=ve,ve&&ve.data&&(re.data=ve.data),K[Q]=re,J++}s.attributes=K,s.attributesNum=J,s.index=H}function _(){const M=s.newAttributes;for(let U=0,z=M.length;U=0){let me=K[ie];if(me===void 0&&(ie==="instanceMatrix"&&M.instanceMatrix&&(me=M.instanceMatrix),ie==="instanceColor"&&M.instanceColor&&(me=M.instanceColor)),me!==void 0){const ve=me.normalized,re=me.itemSize,xe=e.get(me);if(xe===void 0)continue;const ke=xe.buffer,se=xe.type,ge=xe.bytesPerElement,be=se===n.INT||se===n.UNSIGNED_INT||me.gpuType===Wf;if(me.isInterleavedBufferAttribute){const W=me.data,ae=W.stride,le=me.offset;if(W.isInstancedInterleavedBuffer){for(let ue=0;ue0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=t.logarithmicDepthBuffer===!0,h=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),p=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),S=m>0,E=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:h,maxTextures:d,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:y,maxVaryings:x,maxFragmentUniforms:v,vertexTextures:S,maxSamples:E}}function cD(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Ur,a=new Ke,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const d=f.length!==0||h||i!==0||r;return r=h,i=f.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,h){t=u(f,h,0)},this.setState=function(f,h,d){const m=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,p=n.get(f);if(!r||m===null||m.length===0||s&&!g)s?u(null):c();else{const y=s?0:i,x=y*4;let v=p.clippingState||null;l.value=v,v=u(m,h,x,d);for(let S=0;S!==x;++S)v[S]=t[S];p.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,d,m){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=d+_*4,y=h.matrixWorldInverse;a.getNormalMatrix(y),(g===null||g.length0){const c=new lM(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const Do=4,Y0=[.125,.215,.35,.446,.526,.582],Cs=20,Cd=new yh,j0=new Te;let Rd=null,Pd=0,Id=0,Ld=!1;const Ts=(1+Math.sqrt(5))/2,Mo=1/Ts,K0=[new F(-Ts,Mo,0),new F(Ts,Mo,0),new F(-Mo,0,Ts),new F(Mo,0,Ts),new F(0,Ts,-Mo),new F(0,Ts,Mo),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)];class Ap{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Rd=this._renderer.getRenderTarget(),Pd=this._renderer.getActiveCubeFace(),Id=this._renderer.getActiveMipmapLevel(),Ld=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Q0(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=J0(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(r),_&&u.render(m,a),u.render(e,a)}m.geometry.dispose(),m.material.dispose(),u.toneMapping=h,u.autoClear=f,e.background=g}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===mr||e.mapping===Xr;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Q0()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=J0());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Bt(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Kc(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Cd)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sCs&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Cs}`);const p=[];let y=0;for(let A=0;Ax-Do?r-x+Do:0),E=4*(this._cubeSize-v);Kc(t,S,E,3*v,2*v),l.setRenderTarget(t),l.render(f,Cd)}}function fD(n){const e=[],t=[],i=[];let r=n;const s=n-Do+1+Y0.length;for(let o=0;on-Do?l=Y0[o-n+Do-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,m=6,_=3,g=2,p=1,y=new Float32Array(_*m*d),x=new Float32Array(g*m*d),v=new Float32Array(p*m*d);for(let E=0;E2?0:-1,b=[A,I,0,A+2/3,I,0,A+2/3,I+1,0,A,I,0,A+2/3,I+1,0,A,I+1,0];y.set(b,_*m*E),x.set(h,g*m*E);const M=[E,E,E,E,E,E];v.set(M,p*m*E)}const S=new tt;S.setAttribute("position",new bt(y,_)),S.setAttribute("uv",new bt(x,g)),S.setAttribute("faceIndex",new bt(v,p)),e.push(S),r>Do&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Z0(n,e,t){const i=new mi(n,e,t);return i.texture.mapping=na,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Kc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function hD(n,e,t){const i=new Float32Array(Cs),r=new F(0,1,0);return new gi({name:"SphericalGaussianBlur",defines:{n:Cs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:vg(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:fr,depthTest:!1,depthWrite:!1})}function J0(){return new gi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:vg(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:fr,depthTest:!1,depthWrite:!1})}function Q0(){return new gi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:vg(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:fr,depthTest:!1,depthWrite:!1})}function vg(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function dD(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===ul||l===fl,u=l===mr||l===Xr;if(c||u){let f=e.get(a);const h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return t===null&&(t=new Ap(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const d=a.image;return c&&d&&d.height>0||u&&d&&r(d)?(t===null&&(t=new Ap(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(S=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const E=new Float32Array(v*S*4*f),A=new Zf(E,v,S,f);A.type=Ln,A.needsUpdate=!0;const I=x*4;for(let M=0;M0)return n;const r=e*t;let s=tv[r];if(s===void 0&&(s=new Float32Array(r),tv[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Yt(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}const lv=new Ke;function dO(n){rt._getMatrix(lv,rt.workingColorSpace,n);const e=`mat3( ${lv.elements.map(t=>t.toFixed(4))} )`;switch(rt.getTransfer(n)){case gl:return[e,"LinearTransferOETF"];case yt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function cv(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + +`+r+` + +`+hO(n.getShaderSource(e),o)}else return r}function pO(n,e){const t=dO(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function mO(n,e){let t;switch(e){case Ob:t="Linear";break;case Nb:t="Reinhard";break;case Ub:t="Cineon";break;case Hf:t="ACESFilmic";break;case Bb:t="AgX";break;case kb:t="Neutral";break;case Fb:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Zc=new F;function gO(){rt.getLuminanceCoefficients(Zc);const n=Zc.x.toFixed(4),e=Zc.y.toFixed(4),t=Zc.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function _O(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Pa).join(` +`)}function vO(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function yO(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function Cp(n){return n.replace(xO,MO)}const bO=new Map;function MO(n,e){let t=et[e];if(t===void 0){const i=bO.get(e);if(i!==void 0)t=et[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Cp(t)}const SO=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function hv(n){return n.replace(SO,EO)}function EO(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(g+=` +`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Pa).join(` +`),p.length>0&&(p+=` +`)):(g=[dv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Pa).join(` +`),p=[dv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Di?"#define TONE_MAPPING":"",t.toneMapping!==Di?et.tonemapping_pars_fragment:"",t.toneMapping!==Di?mO("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",et.colorspace_pars_fragment,pO("linearToOutputTexel",t.outputColorSpace),gO(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Pa).join(` +`)),o=Cp(o),o=uv(o,t),o=fv(o,t),a=Cp(a),a=uv(a,t),a=fv(a,t),o=hv(o),a=hv(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,g=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,p=["#define varying in",t.glslVersion===yp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===yp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+p);const x=y+g+o,v=y+p+a,S=av(r,r.VERTEX_SHADER,x),E=av(r,r.FRAGMENT_SHADER,v);r.attachShader(_,S),r.attachShader(_,E),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function A(U){if(n.debug.checkShaderErrors){const z=r.getProgramInfoLog(_).trim(),H=r.getShaderInfoLog(S).trim(),K=r.getShaderInfoLog(E).trim();let ee=!0,J=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,S,E);else{const ie=cv(r,S,"vertex"),Q=cv(r,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` + +Material Name: `+U.name+` +Material Type: `+U.type+` + +Program Info Log: `+z+` +`+ie+` +`+Q)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(H===""||K==="")&&(J=!1);J&&(U.diagnostics={runnable:ee,programLog:z,vertexShader:{log:H,prefix:g},fragmentShader:{log:K,prefix:p}})}r.deleteShader(S),r.deleteShader(E),I=new uu(r,_),b=yO(r,_)}let I;this.getUniforms=function(){return I===void 0&&A(this),I};let b;this.getAttributes=function(){return b===void 0&&A(this),b};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(_,uO)),M},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=fO++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=S,this.fragmentShader=E,this}let IO=0;class LO{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new DO(e),t.set(e,i)),i}}class DO{constructor(e){this.id=IO++,this.code=e,this.usedTimes=0}}function OO(n,e,t,i,r,s,o){const a=new Jf,l=new LO,c=new Set,u=[],f=r.logarithmicDepthBuffer,h=r.vertexTextures;let d=r.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,M,U,z,H){const K=z.fog,ee=H.geometry,J=b.isMeshStandardMaterial?z.environment:null,ie=(b.isMeshStandardMaterial?t:e).get(b.envMap||J),Q=ie&&ie.mapping===na?ie.image.height:null,me=m[b.type];b.precision!==null&&(d=r.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));const ve=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,re=ve!==void 0?ve.length:0;let xe=0;ee.morphAttributes.position!==void 0&&(xe=1),ee.morphAttributes.normal!==void 0&&(xe=2),ee.morphAttributes.color!==void 0&&(xe=3);let ke,se,ge,be;if(me){const vt=ai[me];ke=vt.vertexShader,se=vt.fragmentShader}else ke=b.vertexShader,se=b.fragmentShader,l.update(b),ge=l.getVertexShaderID(b),be=l.getFragmentShaderID(b);const W=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),le=H.isInstancedMesh===!0,ue=H.isBatchedMesh===!0,Pe=!!b.map,P=!!b.matcap,D=!!ie,T=!!b.aoMap,Y=!!b.lightMap,G=!!b.bumpMap,$=!!b.normalMap,R=!!b.displacementMap,O=!!b.emissiveMap,k=!!b.metalnessMap,w=!!b.roughnessMap,C=b.anisotropy>0,B=b.clearcoat>0,N=b.dispersion>0,V=b.iridescence>0,q=b.sheen>0,he=b.transmission>0,ce=C&&!!b.anisotropyMap,ye=B&&!!b.clearcoatMap,Ne=B&&!!b.clearcoatNormalMap,pe=B&&!!b.clearcoatRoughnessMap,Ee=V&&!!b.iridescenceMap,Fe=V&&!!b.iridescenceThicknessMap,Ve=q&&!!b.sheenColorMap,Me=q&&!!b.sheenRoughnessMap,We=!!b.specularMap,je=!!b.specularColorMap,Tt=!!b.specularIntensityMap,X=he&&!!b.transmissionMap,we=he&&!!b.thicknessMap,oe=!!b.gradientMap,de=!!b.alphaMap,Re=b.alphaTest>0,Ce=!!b.alphaHash,Je=!!b.extensions;let Lt=Di;b.toneMapped&&(W===null||W.isXRRenderTarget===!0)&&(Lt=n.toneMapping);const nn={shaderID:me,shaderType:b.type,shaderName:b.name,vertexShader:ke,fragmentShader:se,defines:b.defines,customVertexShaderID:ge,customFragmentShaderID:be,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:ue,batchingColor:ue&&H._colorsTexture!==null,instancing:le,instancingColor:le&&H.instanceColor!==null,instancingMorph:le&&H.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:W===null?n.outputColorSpace:W.isXRRenderTarget===!0?W.texture.colorSpace:Ys,alphaToCoverage:!!b.alphaToCoverage,map:Pe,matcap:P,envMap:D,envMapMode:D&&ie.mapping,envMapCubeUVHeight:Q,aoMap:T,lightMap:Y,bumpMap:G,normalMap:$,displacementMap:h&&R,emissiveMap:O,normalMapObjectSpace:$&&b.normalMapType===$b,normalMapTangentSpace:$&&b.normalMapType===Kr,metalnessMap:k,roughnessMap:w,anisotropy:C,anisotropyMap:ce,clearcoat:B,clearcoatMap:ye,clearcoatNormalMap:Ne,clearcoatRoughnessMap:pe,dispersion:N,iridescence:V,iridescenceMap:Ee,iridescenceThicknessMap:Fe,sheen:q,sheenColorMap:Ve,sheenRoughnessMap:Me,specularMap:We,specularColorMap:je,specularIntensityMap:Tt,transmission:he,transmissionMap:X,thicknessMap:we,gradientMap:oe,opaque:b.transparent===!1&&b.blending===Bs&&b.alphaToCoverage===!1,alphaMap:de,alphaTest:Re,alphaHash:Ce,combine:b.combine,mapUv:Pe&&_(b.map.channel),aoMapUv:T&&_(b.aoMap.channel),lightMapUv:Y&&_(b.lightMap.channel),bumpMapUv:G&&_(b.bumpMap.channel),normalMapUv:$&&_(b.normalMap.channel),displacementMapUv:R&&_(b.displacementMap.channel),emissiveMapUv:O&&_(b.emissiveMap.channel),metalnessMapUv:k&&_(b.metalnessMap.channel),roughnessMapUv:w&&_(b.roughnessMap.channel),anisotropyMapUv:ce&&_(b.anisotropyMap.channel),clearcoatMapUv:ye&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Ne&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pe&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ee&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:Fe&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:Ve&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Me&&_(b.sheenRoughnessMap.channel),specularMapUv:We&&_(b.specularMap.channel),specularColorMapUv:je&&_(b.specularColorMap.channel),specularIntensityMapUv:Tt&&_(b.specularIntensityMap.channel),transmissionMapUv:X&&_(b.transmissionMap.channel),thicknessMapUv:we&&_(b.thicknessMap.channel),alphaMapUv:de&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&($||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ee.attributes.uv&&(Pe||de),fog:!!K,useFog:b.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:H.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:xe,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&U.length>0,shadowMapType:n.shadowMap.type,toneMapping:Lt,decodeVideoTexture:Pe&&b.map.isVideoTexture===!0&&rt.getTransfer(b.map.colorSpace)===yt,decodeVideoTextureEmissive:O&&b.emissiveMap.isVideoTexture===!0&&rt.getTransfer(b.emissiveMap.colorSpace)===yt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===li,flipSided:b.side===Sn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Je&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Je&&b.extensions.multiDraw===!0||ue)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return nn.vertexUv1s=c.has(1),nn.vertexUv2s=c.has(2),nn.vertexUv3s=c.has(3),c.clear(),nn}function p(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const U in b.defines)M.push(U),M.push(b.defines[U]);return b.isRawShaderMaterial===!1&&(y(M,b),x(M,b),M.push(n.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function y(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function x(b,M){a.disableAll(),M.supportsVertexTextures&&a.enable(0),M.instancing&&a.enable(1),M.instancingColor&&a.enable(2),M.instancingMorph&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),M.dispersion&&a.enable(20),M.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reverseDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),b.push(a.mask)}function v(b){const M=m[b.type];let U;if(M){const z=ai[M];U=oM.clone(z.uniforms)}else U=b.uniforms;return U}function S(b,M){let U;for(let z=0,H=u.length;z0?i.push(p):d.transparent===!0?r.push(p):t.push(p)}function l(f,h,d,m,_,g){const p=o(f,h,d,m,_,g);d.transmission>0?i.unshift(p):d.transparent===!0?r.unshift(p):t.unshift(p)}function c(f,h){t.length>1&&t.sort(f||UO),i.length>1&&i.sort(h||pv),r.length>1&&r.sort(h||pv)}function u(){for(let f=e,h=n.length;f=s.length?(o=new mv,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function BO(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new Te};break;case"SpotLight":t={position:new F,direction:new F,color:new Te,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new Te,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new Te,groundColor:new Te};break;case"RectAreaLight":t={color:new Te,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function kO(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let zO=0;function VO(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function HO(n){const e=new BO,t=kO(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new F);const r=new F,s=new He,o=new He;function a(c){let u=0,f=0,h=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let d=0,m=0,_=0,g=0,p=0,y=0,x=0,v=0,S=0,E=0,A=0;c.sort(VO);for(let b=0,M=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Se.LTC_FLOAT_1,i.rectAreaLTC2=Se.LTC_FLOAT_2):(i.rectAreaLTC1=Se.LTC_HALF_1,i.rectAreaLTC2=Se.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;const I=i.hash;(I.directionalLength!==d||I.pointLength!==m||I.spotLength!==_||I.rectAreaLength!==g||I.hemiLength!==p||I.numDirectionalShadows!==y||I.numPointShadows!==x||I.numSpotShadows!==v||I.numSpotMaps!==S||I.numLightProbes!==A)&&(i.directional.length=d,i.spot.length=_,i.rectArea.length=g,i.point.length=m,i.hemi.length=p,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=v+S-E,i.spotLightMap.length=S,i.numSpotLightShadowsWithMaps=E,i.numLightProbes=A,I.directionalLength=d,I.pointLength=m,I.spotLength=_,I.rectAreaLength=g,I.hemiLength=p,I.numDirectionalShadows=y,I.numPointShadows=x,I.numSpotShadows=v,I.numSpotMaps=S,I.numLightProbes=A,i.version=zO++)}function l(c,u){let f=0,h=0,d=0,m=0,_=0;const g=u.matrixWorldInverse;for(let p=0,y=c.length;p=o.length?(a=new gv(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const WO=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,XO=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function $O(n,e,t){let i=new Xl;const r=new fe,s=new fe,o=new ct,a=new og({depthPacking:Xb}),l=new ag,c={},u=t.maxTextureSize,f={[pr]:Sn,[Sn]:pr,[li]:li},h=new gi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},radius:{value:4}},vertexShader:WO,fragmentShader:XO}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const m=new tt;m.setAttribute("position",new bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Bt(m,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pm;let p=this.type;this.render=function(E,A,I){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const b=n.getRenderTarget(),M=n.getActiveCubeFace(),U=n.getActiveMipmapLevel(),z=n.state;z.setBlending(fr),z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);const H=p!==Ci&&this.type===Ci,K=p===Ci&&this.type!==Ci;for(let ee=0,J=E.length;eeu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/me.x),r.x=s.x*me.x,Q.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/me.y),r.y=s.y*me.y,Q.mapSize.y=s.y)),Q.map===null||H===!0||K===!0){const re=this.type!==Ci?{minFilter:tn,magFilter:tn}:{};Q.map!==null&&Q.map.dispose(),Q.map=new mi(r.x,r.y,re),Q.map.texture.name=ie.name+".shadowMap",Q.camera.updateProjectionMatrix()}n.setRenderTarget(Q.map),n.clear();const ve=Q.getViewportCount();for(let re=0;re0||A.map&&A.alphaTest>0){const z=M.uuid,H=A.uuid;let K=c[z];K===void 0&&(K={},c[z]=K);let ee=K[H];ee===void 0&&(ee=M.clone(),K[H]=ee,A.addEventListener("dispose",S)),M=ee}if(M.visible=A.visible,M.wireframe=A.wireframe,b===Ci?M.side=A.shadowSide!==null?A.shadowSide:A.side:M.side=A.shadowSide!==null?A.shadowSide:f[A.side],M.alphaMap=A.alphaMap,M.alphaTest=A.alphaTest,M.map=A.map,M.clipShadows=A.clipShadows,M.clippingPlanes=A.clippingPlanes,M.clipIntersection=A.clipIntersection,M.displacementMap=A.displacementMap,M.displacementScale=A.displacementScale,M.displacementBias=A.displacementBias,M.wireframeLinewidth=A.wireframeLinewidth,M.linewidth=A.linewidth,I.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const z=n.properties.get(M);z.light=I}return M}function v(E,A,I,b,M){if(E.visible===!1)return;if(E.layers.test(A.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&M===Ci)&&(!E.frustumCulled||i.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,E.matrixWorld);const H=e.update(E),K=E.material;if(Array.isArray(K)){const ee=H.groups;for(let J=0,ie=ee.length;J=1):Q.indexOf("OpenGL ES")!==-1&&(ie=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),J=ie>=2);let me=null,ve={};const re=n.getParameter(n.SCISSOR_BOX),xe=n.getParameter(n.VIEWPORT),ke=new ct().fromArray(re),se=new ct().fromArray(xe);function ge(X,we,oe,de){const Re=new Uint8Array(4),Ce=n.createTexture();n.bindTexture(X,Ce),n.texParameteri(X,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(X,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Je=0;Je"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new fe,u=new WeakMap;let f;const h=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(w,C){return d?new OffscreenCanvas(w,C):yl("canvas")}function _(w,C,B){let N=1;const V=k(w);if((V.width>B||V.height>B)&&(N=B/Math.max(V.width,V.height)),N<1)if(typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&w instanceof ImageBitmap||typeof VideoFrame<"u"&&w instanceof VideoFrame){const q=Math.floor(N*V.width),he=Math.floor(N*V.height);f===void 0&&(f=m(q,he));const ce=C?m(q,he):f;return ce.width=q,ce.height=he,ce.getContext("2d").drawImage(w,0,0,q,he),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+V.width+"x"+V.height+") to ("+q+"x"+he+")."),ce}else return"data"in w&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+V.width+"x"+V.height+")."),w;return w}function g(w){return w.generateMipmaps}function p(w){n.generateMipmap(w)}function y(w){return w.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:w.isWebGL3DRenderTarget?n.TEXTURE_3D:w.isWebGLArrayRenderTarget||w.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function x(w,C,B,N,V=!1){if(w!==null){if(n[w]!==void 0)return n[w];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+w+"'")}let q=C;if(C===n.RED&&(B===n.FLOAT&&(q=n.R32F),B===n.HALF_FLOAT&&(q=n.R16F),B===n.UNSIGNED_BYTE&&(q=n.R8)),C===n.RED_INTEGER&&(B===n.UNSIGNED_BYTE&&(q=n.R8UI),B===n.UNSIGNED_SHORT&&(q=n.R16UI),B===n.UNSIGNED_INT&&(q=n.R32UI),B===n.BYTE&&(q=n.R8I),B===n.SHORT&&(q=n.R16I),B===n.INT&&(q=n.R32I)),C===n.RG&&(B===n.FLOAT&&(q=n.RG32F),B===n.HALF_FLOAT&&(q=n.RG16F),B===n.UNSIGNED_BYTE&&(q=n.RG8)),C===n.RG_INTEGER&&(B===n.UNSIGNED_BYTE&&(q=n.RG8UI),B===n.UNSIGNED_SHORT&&(q=n.RG16UI),B===n.UNSIGNED_INT&&(q=n.RG32UI),B===n.BYTE&&(q=n.RG8I),B===n.SHORT&&(q=n.RG16I),B===n.INT&&(q=n.RG32I)),C===n.RGB_INTEGER&&(B===n.UNSIGNED_BYTE&&(q=n.RGB8UI),B===n.UNSIGNED_SHORT&&(q=n.RGB16UI),B===n.UNSIGNED_INT&&(q=n.RGB32UI),B===n.BYTE&&(q=n.RGB8I),B===n.SHORT&&(q=n.RGB16I),B===n.INT&&(q=n.RGB32I)),C===n.RGBA_INTEGER&&(B===n.UNSIGNED_BYTE&&(q=n.RGBA8UI),B===n.UNSIGNED_SHORT&&(q=n.RGBA16UI),B===n.UNSIGNED_INT&&(q=n.RGBA32UI),B===n.BYTE&&(q=n.RGBA8I),B===n.SHORT&&(q=n.RGBA16I),B===n.INT&&(q=n.RGBA32I)),C===n.RGB&&B===n.UNSIGNED_INT_5_9_9_9_REV&&(q=n.RGB9_E5),C===n.RGBA){const he=V?gl:rt.getTransfer(N);B===n.FLOAT&&(q=n.RGBA32F),B===n.HALF_FLOAT&&(q=n.RGBA16F),B===n.UNSIGNED_BYTE&&(q=he===yt?n.SRGB8_ALPHA8:n.RGBA8),B===n.UNSIGNED_SHORT_4_4_4_4&&(q=n.RGBA4),B===n.UNSIGNED_SHORT_5_5_5_1&&(q=n.RGB5_A1)}return(q===n.R16F||q===n.R32F||q===n.RG16F||q===n.RG32F||q===n.RGBA16F||q===n.RGBA32F)&&e.get("EXT_color_buffer_float"),q}function v(w,C){let B;return w?C===null||C===gr||C===$s?B=n.DEPTH24_STENCIL8:C===Ln?B=n.DEPTH32F_STENCIL8:C===Xo&&(B=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===gr||C===$s?B=n.DEPTH_COMPONENT24:C===Ln?B=n.DEPTH_COMPONENT32F:C===Xo&&(B=n.DEPTH_COMPONENT16),B}function S(w,C){return g(w)===!0||w.isFramebufferTexture&&w.minFilter!==tn&&w.minFilter!==Xt?Math.log2(Math.max(C.width,C.height))+1:w.mipmaps!==void 0&&w.mipmaps.length>0?w.mipmaps.length:w.isCompressedTexture&&Array.isArray(w.image)?C.mipmaps.length:1}function E(w){const C=w.target;C.removeEventListener("dispose",E),I(C),C.isVideoTexture&&u.delete(C)}function A(w){const C=w.target;C.removeEventListener("dispose",A),M(C)}function I(w){const C=i.get(w);if(C.__webglInit===void 0)return;const B=w.source,N=h.get(B);if(N){const V=N[C.__cacheKey];V.usedTimes--,V.usedTimes===0&&b(w),Object.keys(N).length===0&&h.delete(B)}i.remove(w)}function b(w){const C=i.get(w);n.deleteTexture(C.__webglTexture);const B=w.source,N=h.get(B);delete N[C.__cacheKey],o.memory.textures--}function M(w){const C=i.get(w);if(w.depthTexture&&(w.depthTexture.dispose(),i.remove(w.depthTexture)),w.isWebGLCubeRenderTarget)for(let N=0;N<6;N++){if(Array.isArray(C.__webglFramebuffer[N]))for(let V=0;V=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+w+" texture units while this GPU supports only "+r.maxTextures),U+=1,w}function K(w){const C=[];return C.push(w.wrapS),C.push(w.wrapT),C.push(w.wrapR||0),C.push(w.magFilter),C.push(w.minFilter),C.push(w.anisotropy),C.push(w.internalFormat),C.push(w.format),C.push(w.type),C.push(w.generateMipmaps),C.push(w.premultiplyAlpha),C.push(w.flipY),C.push(w.unpackAlignment),C.push(w.colorSpace),C.join()}function ee(w,C){const B=i.get(w);if(w.isVideoTexture&&R(w),w.isRenderTargetTexture===!1&&w.version>0&&B.__version!==w.version){const N=w.image;if(N===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(N.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{se(B,w,C);return}}t.bindTexture(n.TEXTURE_2D,B.__webglTexture,n.TEXTURE0+C)}function J(w,C){const B=i.get(w);if(w.version>0&&B.__version!==w.version){se(B,w,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,B.__webglTexture,n.TEXTURE0+C)}function ie(w,C){const B=i.get(w);if(w.version>0&&B.__version!==w.version){se(B,w,C);return}t.bindTexture(n.TEXTURE_3D,B.__webglTexture,n.TEXTURE0+C)}function Q(w,C){const B=i.get(w);if(w.version>0&&B.__version!==w.version){ge(B,w,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,B.__webglTexture,n.TEXTURE0+C)}const me={[hl]:n.REPEAT,[Zn]:n.CLAMP_TO_EDGE,[dl]:n.MIRRORED_REPEAT},ve={[tn]:n.NEAREST,[Lm]:n.NEAREST_MIPMAP_NEAREST,[Ro]:n.NEAREST_MIPMAP_LINEAR,[Xt]:n.LINEAR,[Ua]:n.LINEAR_MIPMAP_NEAREST,[Pi]:n.LINEAR_MIPMAP_LINEAR},re={[qb]:n.NEVER,[Qb]:n.ALWAYS,[Yb]:n.LESS,[Gm]:n.LEQUAL,[jb]:n.EQUAL,[Jb]:n.GEQUAL,[Kb]:n.GREATER,[Zb]:n.NOTEQUAL};function xe(w,C){if(C.type===Ln&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===Xt||C.magFilter===Ua||C.magFilter===Ro||C.magFilter===Pi||C.minFilter===Xt||C.minFilter===Ua||C.minFilter===Ro||C.minFilter===Pi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(w,n.TEXTURE_WRAP_S,me[C.wrapS]),n.texParameteri(w,n.TEXTURE_WRAP_T,me[C.wrapT]),(w===n.TEXTURE_3D||w===n.TEXTURE_2D_ARRAY)&&n.texParameteri(w,n.TEXTURE_WRAP_R,me[C.wrapR]),n.texParameteri(w,n.TEXTURE_MAG_FILTER,ve[C.magFilter]),n.texParameteri(w,n.TEXTURE_MIN_FILTER,ve[C.minFilter]),C.compareFunction&&(n.texParameteri(w,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(w,n.TEXTURE_COMPARE_FUNC,re[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===tn||C.minFilter!==Ro&&C.minFilter!==Pi||C.type===Ln&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const B=e.get("EXT_texture_filter_anisotropic");n.texParameterf(w,B.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function ke(w,C){let B=!1;w.__webglInit===void 0&&(w.__webglInit=!0,C.addEventListener("dispose",E));const N=C.source;let V=h.get(N);V===void 0&&(V={},h.set(N,V));const q=K(C);if(q!==w.__cacheKey){V[q]===void 0&&(V[q]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,B=!0),V[q].usedTimes++;const he=V[w.__cacheKey];he!==void 0&&(V[w.__cacheKey].usedTimes--,he.usedTimes===0&&b(C)),w.__cacheKey=q,w.__webglTexture=V[q].texture}return B}function se(w,C,B){let N=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(N=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(N=n.TEXTURE_3D);const V=ke(w,C),q=C.source;t.bindTexture(N,w.__webglTexture,n.TEXTURE0+B);const he=i.get(q);if(q.version!==he.__version||V===!0){t.activeTexture(n.TEXTURE0+B);const ce=rt.getPrimaries(rt.workingColorSpace),ye=C.colorSpace===rr?null:rt.getPrimaries(C.colorSpace),Ne=C.colorSpace===rr||ce===ye?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ne);let pe=_(C.image,!1,r.maxTextureSize);pe=O(C,pe);const Ee=s.convert(C.format,C.colorSpace),Fe=s.convert(C.type);let Ve=x(C.internalFormat,Ee,Fe,C.colorSpace,C.isVideoTexture);xe(N,C);let Me;const We=C.mipmaps,je=C.isVideoTexture!==!0,Tt=he.__version===void 0||V===!0,X=q.dataReady,we=S(C,pe);if(C.isDepthTexture)Ve=v(C.format===qs,C.type),Tt&&(je?t.texStorage2D(n.TEXTURE_2D,1,Ve,pe.width,pe.height):t.texImage2D(n.TEXTURE_2D,0,Ve,pe.width,pe.height,0,Ee,Fe,null));else if(C.isDataTexture)if(We.length>0){je&&Tt&&t.texStorage2D(n.TEXTURE_2D,we,Ve,We[0].width,We[0].height);for(let oe=0,de=We.length;oe0){const Re=wp(Me.width,Me.height,C.format,C.type);for(const Ce of C.layerUpdates){const Je=Me.data.subarray(Ce*Re/Me.data.BYTES_PER_ELEMENT,(Ce+1)*Re/Me.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ce,Me.width,Me.height,1,Ee,Je)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,pe.depth,Ee,Me.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,Ve,Me.width,Me.height,pe.depth,0,Me.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else je?X&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,pe.depth,Ee,Fe,Me.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,Ve,Me.width,Me.height,pe.depth,0,Ee,Fe,Me.data)}else{je&&Tt&&t.texStorage2D(n.TEXTURE_2D,we,Ve,We[0].width,We[0].height);for(let oe=0,de=We.length;oe0){const oe=wp(pe.width,pe.height,C.format,C.type);for(const de of C.layerUpdates){const Re=pe.data.subarray(de*oe/pe.data.BYTES_PER_ELEMENT,(de+1)*oe/pe.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,de,pe.width,pe.height,1,Ee,Fe,Re)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,pe.width,pe.height,pe.depth,Ee,Fe,pe.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Ve,pe.width,pe.height,pe.depth,0,Ee,Fe,pe.data);else if(C.isData3DTexture)je?(Tt&&t.texStorage3D(n.TEXTURE_3D,we,Ve,pe.width,pe.height,pe.depth),X&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,pe.width,pe.height,pe.depth,Ee,Fe,pe.data)):t.texImage3D(n.TEXTURE_3D,0,Ve,pe.width,pe.height,pe.depth,0,Ee,Fe,pe.data);else if(C.isFramebufferTexture){if(Tt)if(je)t.texStorage2D(n.TEXTURE_2D,we,Ve,pe.width,pe.height);else{let oe=pe.width,de=pe.height;for(let Re=0;Re>=1,de>>=1}}else if(We.length>0){if(je&&Tt){const oe=k(We[0]);t.texStorage2D(n.TEXTURE_2D,we,Ve,oe.width,oe.height)}for(let oe=0,de=We.length;oe0&&we++;const de=k(Ee[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,we,We,de.width,de.height)}for(let de=0;de<6;de++)if(pe){je?X&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Ee[de].width,Ee[de].height,Ve,Me,Ee[de].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,We,Ee[de].width,Ee[de].height,0,Ve,Me,Ee[de].data);for(let Re=0;Re>q),Fe=Math.max(1,C.height>>q);V===n.TEXTURE_3D||V===n.TEXTURE_2D_ARRAY?t.texImage3D(V,q,ye,Ee,Fe,C.depth,0,he,ce,null):t.texImage2D(V,q,ye,Ee,Fe,0,he,ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,w),$(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,N,V,pe.__webglTexture,0,G(C)):(V===n.TEXTURE_2D||V>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&V<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,N,V,pe.__webglTexture,q),t.bindFramebuffer(n.FRAMEBUFFER,null)}function W(w,C,B){if(n.bindRenderbuffer(n.RENDERBUFFER,w),C.depthBuffer){const N=C.depthTexture,V=N&&N.isDepthTexture?N.type:null,q=v(C.stencilBuffer,V),he=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=G(C);$(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ce,q,C.width,C.height):B?n.renderbufferStorageMultisample(n.RENDERBUFFER,ce,q,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,q,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,he,n.RENDERBUFFER,w)}else{const N=C.textures;for(let V=0;V{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,N.removeEventListener("dispose",V)};N.addEventListener("dispose",V),C.__depthDisposeCallback=V}C.__boundDepthTexture=N}if(w.depthTexture&&!C.__autoAllocateDepthBuffer){if(B)throw new Error("target.depthTexture not supported in Cube render targets");ae(C.__webglFramebuffer,w)}else if(B){C.__webglDepthbuffer=[];for(let N=0;N<6;N++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[N]),C.__webglDepthbuffer[N]===void 0)C.__webglDepthbuffer[N]=n.createRenderbuffer(),W(C.__webglDepthbuffer[N],w,!1);else{const V=w.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,q=C.__webglDepthbuffer[N];n.bindRenderbuffer(n.RENDERBUFFER,q),n.framebufferRenderbuffer(n.FRAMEBUFFER,V,n.RENDERBUFFER,q)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),W(C.__webglDepthbuffer,w,!1);else{const N=w.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,V=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,V),n.framebufferRenderbuffer(n.FRAMEBUFFER,N,n.RENDERBUFFER,V)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ue(w,C,B){const N=i.get(w);C!==void 0&&be(N.__webglFramebuffer,w,w.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),B!==void 0&&le(w)}function Pe(w){const C=w.texture,B=i.get(w),N=i.get(C);w.addEventListener("dispose",A);const V=w.textures,q=w.isWebGLCubeRenderTarget===!0,he=V.length>1;if(he||(N.__webglTexture===void 0&&(N.__webglTexture=n.createTexture()),N.__version=C.version,o.memory.textures++),q){B.__webglFramebuffer=[];for(let ce=0;ce<6;ce++)if(C.mipmaps&&C.mipmaps.length>0){B.__webglFramebuffer[ce]=[];for(let ye=0;ye0){B.__webglFramebuffer=[];for(let ce=0;ce0&&$(w)===!1){B.__webglMultisampledFramebuffer=n.createFramebuffer(),B.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,B.__webglMultisampledFramebuffer);for(let ce=0;ce0)for(let ye=0;ye0)for(let ye=0;ye0){if($(w)===!1){const C=w.textures,B=w.width,N=w.height;let V=n.COLOR_BUFFER_BIT;const q=w.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,he=i.get(w),ce=C.length>1;if(ce)for(let ye=0;ye0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function R(w){const C=o.render.frame;u.get(w)!==C&&(u.set(w,C),w.update())}function O(w,C){const B=w.colorSpace,N=w.format,V=w.type;return w.isCompressedTexture===!0||w.isVideoTexture===!0||B!==Ys&&B!==rr&&(rt.getTransfer(B)===yt?(N!==Mn||V!==Bi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",B)),C}function k(w){return typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement?(c.width=w.naturalWidth||w.width,c.height=w.naturalHeight||w.height):typeof VideoFrame<"u"&&w instanceof VideoFrame?(c.width=w.displayWidth,c.height=w.displayHeight):(c.width=w.width,c.height=w.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=z,this.setTexture2D=ee,this.setTexture2DArray=J,this.setTexture3D=ie,this.setTextureCube=Q,this.rebindTextures=ue,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=P,this.updateMultisampleRenderTarget=Y,this.setupDepthRenderbuffer=le,this.setupFrameBufferTexture=be,this.useMultisampledRTT=$}function cS(n,e){function t(i,r=rr){let s;const o=rt.getTransfer(r);if(i===Bi)return n.UNSIGNED_BYTE;if(i===Xf)return n.UNSIGNED_SHORT_4_4_4_4;if(i===$f)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Nm)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Dm)return n.BYTE;if(i===Om)return n.SHORT;if(i===Xo)return n.UNSIGNED_SHORT;if(i===Wf)return n.INT;if(i===gr)return n.UNSIGNED_INT;if(i===Ln)return n.FLOAT;if(i===ia)return n.HALF_FLOAT;if(i===Um)return n.ALPHA;if(i===Fm)return n.RGB;if(i===Mn)return n.RGBA;if(i===Bm)return n.LUMINANCE;if(i===km)return n.LUMINANCE_ALPHA;if(i===ks)return n.DEPTH_COMPONENT;if(i===qs)return n.DEPTH_STENCIL;if(i===qf)return n.RED;if(i===Hl)return n.RED_INTEGER;if(i===zm)return n.RG;if(i===Yf)return n.RG_INTEGER;if(i===jf)return n.RGBA_INTEGER;if(i===Fa||i===Ba||i===ka||i===za)if(o===yt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Fa)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Ba)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===ka)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===za)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Fa)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Ba)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===ka)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===za)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===zu||i===Vu||i===Hu||i===Gu)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===zu)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Vu)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Hu)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Gu)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Wu||i===Xu||i===$u)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Wu||i===Xu)return o===yt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===$u)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===qu||i===Yu||i===ju||i===Ku||i===Zu||i===Ju||i===Qu||i===ef||i===tf||i===nf||i===rf||i===sf||i===of||i===af)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===qu)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Yu)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===ju)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Ku)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Zu)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Ju)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Qu)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===ef)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===tf)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===nf)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===rf)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===sf)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===of)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===af)return o===yt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Va||i===lf||i===cf)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Va)return o===yt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===lf)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===cf)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Vm||i===uf||i===ff||i===hf)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Va)return s.COMPRESSED_RED_RGTC1_EXT;if(i===uf)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===ff)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===hf)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===$s?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const KO={type:"move"};class Od{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Io,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Io,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Io,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,m=.005;c.inputState.pinching&&h>d+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=d-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(KO)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Io;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const ZO=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,JO=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class QO{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Nt,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new gi({vertexShader:ZO,fragmentShader:JO,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Bt(new oa(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class eN extends Vi{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,m=null;const _=new QO,g=t.getContextAttributes();let p=null,y=null;const x=[],v=[],S=new fe;let E=null;const A=new Ht;A.viewport=new ct;const I=new Ht;I.viewport=new ct;const b=[A,I],M=new JM;let U=null,z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let ge=x[se];return ge===void 0&&(ge=new Od,x[se]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(se){let ge=x[se];return ge===void 0&&(ge=new Od,x[se]=ge),ge.getGripSpace()},this.getHand=function(se){let ge=x[se];return ge===void 0&&(ge=new Od,x[se]=ge),ge.getHandSpace()};function H(se){const ge=v.indexOf(se.inputSource);if(ge===-1)return;const be=x[ge];be!==void 0&&(be.update(se.inputSource,se.frame,c||o),be.dispatchEvent({type:se.type,data:se.inputSource}))}function K(){r.removeEventListener("select",H),r.removeEventListener("selectstart",H),r.removeEventListener("selectend",H),r.removeEventListener("squeeze",H),r.removeEventListener("squeezestart",H),r.removeEventListener("squeezeend",H),r.removeEventListener("end",K),r.removeEventListener("inputsourceschange",ee);for(let se=0;se=0&&(v[W]=null,x[W].disconnect(be))}for(let ge=0;ge=v.length){v.push(be),W=le;break}else if(v[le]===null){v[le]=be,W=le;break}if(W===-1)break}const ae=x[W];ae&&ae.connect(be)}}const J=new F,ie=new F;function Q(se,ge,be){J.setFromMatrixPosition(ge.matrixWorld),ie.setFromMatrixPosition(be.matrixWorld);const W=J.distanceTo(ie),ae=ge.projectionMatrix.elements,le=be.projectionMatrix.elements,ue=ae[14]/(ae[10]-1),Pe=ae[14]/(ae[10]+1),P=(ae[9]+1)/ae[5],D=(ae[9]-1)/ae[5],T=(ae[8]-1)/ae[0],Y=(le[8]+1)/le[0],G=ue*T,$=ue*Y,R=W/(-T+Y),O=R*-T;if(ge.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(O),se.translateZ(R),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),ae[10]===-1)se.projectionMatrix.copy(ge.projectionMatrix),se.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const k=ue+R,w=Pe+R,C=G-O,B=$+(W-O),N=P*Pe/w*k,V=D*Pe/w*k;se.projectionMatrix.makePerspective(C,B,N,V,k,w),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function me(se,ge){ge===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(ge.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(r===null)return;let ge=se.near,be=se.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(be=_.depthFar)),M.near=I.near=A.near=ge,M.far=I.far=A.far=be,(U!==M.near||z!==M.far)&&(r.updateRenderState({depthNear:M.near,depthFar:M.far}),U=M.near,z=M.far),A.layers.mask=se.layers.mask|2,I.layers.mask=se.layers.mask|4,M.layers.mask=A.layers.mask|I.layers.mask;const W=se.parent,ae=M.cameras;me(M,W);for(let le=0;le0&&(g.alphaTest.value=p.alphaTest);const y=e.get(p),x=y.envMap,v=y.envMapRotation;x&&(g.envMap.value=x,xs.copy(v),xs.x*=-1,xs.y*=-1,xs.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(xs.y*=-1,xs.z*=-1),g.envMapRotation.value.setFromMatrix4(tN.makeRotationFromEuler(xs)),g.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function o(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}function a(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,y,x){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*y,g.scale.value=x*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function u(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function f(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function h(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function d(g,p,y){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Sn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const y=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function iN(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,x){const v=x.program;i.uniformBlockBinding(y,v)}function c(y,x){let v=r[y.id];v===void 0&&(m(y),v=u(y),r[y.id]=v,y.addEventListener("dispose",g));const S=x.program;i.updateUBOMapping(y,S);const E=e.render.frame;s[y.id]!==E&&(h(y),s[y.id]=E)}function u(y){const x=f();y.__bindingPointIndex=x;const v=n.createBuffer(),S=y.__size,E=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,v),n.bufferData(n.UNIFORM_BUFFER,S,E),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,v),v}function f(){for(let y=0;y0&&(v+=S-E),y.__size=v,y.__cache={},this}function _(y){const x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),x}function g(y){const x=y.target;x.removeEventListener("dispose",g);const v=o.indexOf(x.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function p(){for(const y in r)n.deleteBuffer(r[y]);o=[],r={},s={}}return{bind:l,update:c,dispose:p}}class fu{constructor(e={}){const{canvas:t=tM(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const y=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=_n,this.toneMapping=Di,this.toneMappingExposure=1;const v=this;let S=!1,E=0,A=0,I=null,b=-1,M=null;const U=new ct,z=new ct;let H=null;const K=new Te(0);let ee=0,J=t.width,ie=t.height,Q=1,me=null,ve=null;const re=new ct(0,0,J,ie),xe=new ct(0,0,J,ie);let ke=!1;const se=new Xl;let ge=!1,be=!1;const W=new He,ae=new He,le=new F,ue=new ct,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let P=!1;function D(){return I===null?Q:1}let T=i;function Y(L,j){return t.getContext(L,j)}try{const L={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${zl}`),t.addEventListener("webglcontextlost",de,!1),t.addEventListener("webglcontextrestored",Re,!1),t.addEventListener("webglcontextcreationerror",Ce,!1),T===null){const j="webgl2";if(T=Y(j,L),T===null)throw Y(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let G,$,R,O,k,w,C,B,N,V,q,he,ce,ye,Ne,pe,Ee,Fe,Ve,Me,We,je,Tt,X;function we(){G=new pD(T),G.init(),je=new cS(T,G),$=new lD(T,G,e,je),R=new YO(T,G),$.reverseDepthBuffer&&h&&R.buffers.depth.setReversed(!0),O=new _D(T),k=new NO,w=new jO(T,G,R,k,$,je,O),C=new uD(v),B=new dD(v),N=new EP(T),Tt=new oD(T,N),V=new mD(T,N,O,Tt),q=new yD(T,V,N,O),Ve=new vD(T,$,w),pe=new cD(k),he=new OO(v,C,B,G,$,Tt,pe),ce=new nN(v,k),ye=new FO,Ne=new GO(G),Fe=new sD(v,C,B,R,q,d,l),Ee=new $O(v,q,$),X=new iN(T,O,$,R),Me=new aD(T,G,O),We=new gD(T,G,O),O.programs=he.programs,v.capabilities=$,v.extensions=G,v.properties=k,v.renderLists=ye,v.shadowMap=Ee,v.state=R,v.info=O}we();const oe=new eN(v,T);this.xr=oe,this.getContext=function(){return T},this.getContextAttributes=function(){return T.getContextAttributes()},this.forceContextLoss=function(){const L=G.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=G.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(L){L!==void 0&&(Q=L,this.setSize(J,ie,!1))},this.getSize=function(L){return L.set(J,ie)},this.setSize=function(L,j,te=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}J=L,ie=j,t.width=Math.floor(L*Q),t.height=Math.floor(j*Q),te===!0&&(t.style.width=L+"px",t.style.height=j+"px"),this.setViewport(0,0,L,j)},this.getDrawingBufferSize=function(L){return L.set(J*Q,ie*Q).floor()},this.setDrawingBufferSize=function(L,j,te){J=L,ie=j,Q=te,t.width=Math.floor(L*te),t.height=Math.floor(j*te),this.setViewport(0,0,L,j)},this.getCurrentViewport=function(L){return L.copy(U)},this.getViewport=function(L){return L.copy(re)},this.setViewport=function(L,j,te,ne){L.isVector4?re.set(L.x,L.y,L.z,L.w):re.set(L,j,te,ne),R.viewport(U.copy(re).multiplyScalar(Q).round())},this.getScissor=function(L){return L.copy(xe)},this.setScissor=function(L,j,te,ne){L.isVector4?xe.set(L.x,L.y,L.z,L.w):xe.set(L,j,te,ne),R.scissor(z.copy(xe).multiplyScalar(Q).round())},this.getScissorTest=function(){return ke},this.setScissorTest=function(L){R.setScissorTest(ke=L)},this.setOpaqueSort=function(L){me=L},this.setTransparentSort=function(L){ve=L},this.getClearColor=function(L){return L.copy(Fe.getClearColor())},this.setClearColor=function(){Fe.setClearColor.apply(Fe,arguments)},this.getClearAlpha=function(){return Fe.getClearAlpha()},this.setClearAlpha=function(){Fe.setClearAlpha.apply(Fe,arguments)},this.clear=function(L=!0,j=!0,te=!0){let ne=0;if(L){let Z=!1;if(I!==null){const _e=I.texture.format;Z=_e===jf||_e===Yf||_e===Hl}if(Z){const _e=I.texture.type,Ae=_e===Bi||_e===gr||_e===Xo||_e===$s||_e===Xf||_e===$f,Ie=Fe.getClearColor(),De=Fe.getClearAlpha(),Xe=Ie.r,qe=Ie.g,Be=Ie.b;Ae?(m[0]=Xe,m[1]=qe,m[2]=Be,m[3]=De,T.clearBufferuiv(T.COLOR,0,m)):(_[0]=Xe,_[1]=qe,_[2]=Be,_[3]=De,T.clearBufferiv(T.COLOR,0,_))}else ne|=T.COLOR_BUFFER_BIT}j&&(ne|=T.DEPTH_BUFFER_BIT),te&&(ne|=T.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),T.clear(ne)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",de,!1),t.removeEventListener("webglcontextrestored",Re,!1),t.removeEventListener("webglcontextcreationerror",Ce,!1),Fe.dispose(),ye.dispose(),Ne.dispose(),k.dispose(),C.dispose(),B.dispose(),q.dispose(),Tt.dispose(),X.dispose(),he.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",qg),oe.removeEventListener("sessionend",Yg),ns.stop()};function de(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Re(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const L=O.autoReset,j=Ee.enabled,te=Ee.autoUpdate,ne=Ee.needsUpdate,Z=Ee.type;we(),O.autoReset=L,Ee.enabled=j,Ee.autoUpdate=te,Ee.needsUpdate=ne,Ee.type=Z}function Ce(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Je(L){const j=L.target;j.removeEventListener("dispose",Je),Lt(j)}function Lt(L){nn(L),k.remove(L)}function nn(L){const j=k.get(L).programs;j!==void 0&&(j.forEach(function(te){he.releaseProgram(te)}),L.isShaderMaterial&&he.releaseShaderCache(L))}this.renderBufferDirect=function(L,j,te,ne,Z,_e){j===null&&(j=Pe);const Ae=Z.isMesh&&Z.matrixWorld.determinant()<0,Ie=QE(L,j,te,ne,Z);R.setMaterial(ne,Ae);let De=te.index,Xe=1;if(ne.wireframe===!0){if(De=V.getWireframeAttribute(te),De===void 0)return;Xe=2}const qe=te.drawRange,Be=te.attributes.position;let at=qe.start*Xe,pt=(qe.start+qe.count)*Xe;_e!==null&&(at=Math.max(at,_e.start*Xe),pt=Math.min(pt,(_e.start+_e.count)*Xe)),De!==null?(at=Math.max(at,0),pt=Math.min(pt,De.count)):Be!=null&&(at=Math.max(at,0),pt=Math.min(pt,Be.count));const zt=pt-at;if(zt<0||zt===1/0)return;Tt.setup(Z,ne,Ie,te,De);let Dt,ut=Me;if(De!==null&&(Dt=N.get(De),ut=We,ut.setIndex(Dt)),Z.isMesh)ne.wireframe===!0?(R.setLineWidth(ne.wireframeLinewidth*D()),ut.setMode(T.LINES)):ut.setMode(T.TRIANGLES);else if(Z.isLine){let ze=ne.linewidth;ze===void 0&&(ze=1),R.setLineWidth(ze*D()),Z.isLineSegments?ut.setMode(T.LINES):Z.isLineLoop?ut.setMode(T.LINE_LOOP):ut.setMode(T.LINE_STRIP)}else Z.isPoints?ut.setMode(T.POINTS):Z.isSprite&&ut.setMode(T.TRIANGLES);if(Z.isBatchedMesh)if(Z._multiDrawInstances!==null)ut.renderMultiDrawInstances(Z._multiDrawStarts,Z._multiDrawCounts,Z._multiDrawCount,Z._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))ut.renderMultiDraw(Z._multiDrawStarts,Z._multiDrawCounts,Z._multiDrawCount);else{const ze=Z._multiDrawStarts,Qt=Z._multiDrawCounts,mt=Z._multiDrawCount,ii=De?N.get(De).bytesPerElement:1,no=k.get(ne).currentProgram.getUniforms();for(let Un=0;Un{function _e(){if(ne.forEach(function(Ae){k.get(Ae).currentProgram.isReady()&&ne.delete(Ae)}),ne.size===0){Z(L);return}setTimeout(_e,10)}G.get("KHR_parallel_shader_compile")!==null?_e():setTimeout(_e,10)})};let ni=null;function Gi(L){ni&&ni(L)}function qg(){ns.stop()}function Yg(){ns.start()}const ns=new rS;ns.setAnimationLoop(Gi),typeof self<"u"&&ns.setContext(self),this.setAnimationLoop=function(L){ni=L,oe.setAnimationLoop(L),L===null?ns.stop():ns.start()},oe.addEventListener("sessionstart",qg),oe.addEventListener("sessionend",Yg),this.render=function(L,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(j),j=oe.getCamera()),L.isScene===!0&&L.onBeforeRender(v,L,j,I),p=Ne.get(L,x.length),p.init(j),x.push(p),ae.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),se.setFromProjectionMatrix(ae),be=this.localClippingEnabled,ge=pe.init(this.clippingPlanes,be),g=ye.get(L,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const _e=v.xr.getDepthSensingMesh();_e!==null&&Lh(_e,j,-1/0,v.sortObjects)}Lh(L,j,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(me,ve),P=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,P&&Fe.addToRenderList(g,L),this.info.render.frame++,ge===!0&&pe.beginShadows();const te=p.state.shadowsArray;Ee.render(te,L,j),ge===!0&&pe.endShadows(),this.info.autoReset===!0&&this.info.reset();const ne=g.opaque,Z=g.transmissive;if(p.setupLights(),j.isArrayCamera){const _e=j.cameras;if(Z.length>0)for(let Ae=0,Ie=_e.length;Ae0&&Kg(ne,Z,L,j),P&&Fe.render(L),jg(g,L,j);I!==null&&(w.updateMultisampleRenderTarget(I),w.updateRenderTargetMipmap(I)),L.isScene===!0&&L.onAfterRender(v,L,j),Tt.resetDefaultState(),b=-1,M=null,x.pop(),x.length>0?(p=x[x.length-1],ge===!0&&pe.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function Lh(L,j,te,ne){if(L.visible===!1)return;if(L.layers.test(j.layers)){if(L.isGroup)te=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(j);else if(L.isLight)p.pushLight(L),L.castShadow&&p.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||se.intersectsSprite(L)){ne&&ue.setFromMatrixPosition(L.matrixWorld).applyMatrix4(ae);const Ae=q.update(L),Ie=L.material;Ie.visible&&g.push(L,Ae,Ie,te,ue.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||se.intersectsObject(L))){const Ae=q.update(L),Ie=L.material;if(ne&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),ue.copy(L.boundingSphere.center)):(Ae.boundingSphere===null&&Ae.computeBoundingSphere(),ue.copy(Ae.boundingSphere.center)),ue.applyMatrix4(L.matrixWorld).applyMatrix4(ae)),Array.isArray(Ie)){const De=Ae.groups;for(let Xe=0,qe=De.length;Xe0&&tc(Z,j,te),_e.length>0&&tc(_e,j,te),Ae.length>0&&tc(Ae,j,te),R.buffers.depth.setTest(!0),R.buffers.depth.setMask(!0),R.buffers.color.setMask(!0),R.setPolygonOffset(!1)}function Kg(L,j,te,ne){if((te.isScene===!0?te.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[ne.id]===void 0&&(p.state.transmissionRenderTarget[ne.id]=new mi(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?ia:Bi,minFilter:Pi,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:rt.workingColorSpace}));const _e=p.state.transmissionRenderTarget[ne.id],Ae=ne.viewport||U;_e.setSize(Ae.z,Ae.w);const Ie=v.getRenderTarget();v.setRenderTarget(_e),v.getClearColor(K),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),P&&Fe.render(te);const De=v.toneMapping;v.toneMapping=Di;const Xe=ne.viewport;if(ne.viewport!==void 0&&(ne.viewport=void 0),p.setupLightsView(ne),ge===!0&&pe.setGlobalState(v.clippingPlanes,ne),tc(L,te,ne),w.updateMultisampleRenderTarget(_e),w.updateRenderTargetMipmap(_e),G.has("WEBGL_multisampled_render_to_texture")===!1){let qe=!1;for(let Be=0,at=j.length;Be0),Be=!!te.morphAttributes.position,at=!!te.morphAttributes.normal,pt=!!te.morphAttributes.color;let zt=Di;ne.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(zt=v.toneMapping);const Dt=te.morphAttributes.position||te.morphAttributes.normal||te.morphAttributes.color,ut=Dt!==void 0?Dt.length:0,ze=k.get(ne),Qt=p.state.lights;if(ge===!0&&(be===!0||L!==M)){const fn=L===M&&ne.id===b;pe.setState(ne,L,fn)}let mt=!1;ne.version===ze.__version?(ze.needsLights&&ze.lightsStateVersion!==Qt.state.version||ze.outputColorSpace!==Ie||Z.isBatchedMesh&&ze.batching===!1||!Z.isBatchedMesh&&ze.batching===!0||Z.isBatchedMesh&&ze.batchingColor===!0&&Z.colorTexture===null||Z.isBatchedMesh&&ze.batchingColor===!1&&Z.colorTexture!==null||Z.isInstancedMesh&&ze.instancing===!1||!Z.isInstancedMesh&&ze.instancing===!0||Z.isSkinnedMesh&&ze.skinning===!1||!Z.isSkinnedMesh&&ze.skinning===!0||Z.isInstancedMesh&&ze.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&ze.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&ze.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&ze.instancingMorph===!1&&Z.morphTexture!==null||ze.envMap!==De||ne.fog===!0&&ze.fog!==_e||ze.numClippingPlanes!==void 0&&(ze.numClippingPlanes!==pe.numPlanes||ze.numIntersection!==pe.numIntersection)||ze.vertexAlphas!==Xe||ze.vertexTangents!==qe||ze.morphTargets!==Be||ze.morphNormals!==at||ze.morphColors!==pt||ze.toneMapping!==zt||ze.morphTargetsCount!==ut)&&(mt=!0):(mt=!0,ze.__version=ne.version);let ii=ze.currentProgram;mt===!0&&(ii=nc(ne,j,Z));let no=!1,Un=!1,la=!1;const Ct=ii.getUniforms(),Xn=ze.uniforms;if(R.useProgram(ii.program)&&(no=!0,Un=!0,la=!0),ne.id!==b&&(b=ne.id,Un=!0),no||M!==L){R.buffers.depth.getReversed()?(W.copy(L.projectionMatrix),j1(W),K1(W),Ct.setValue(T,"projectionMatrix",W)):Ct.setValue(T,"projectionMatrix",L.projectionMatrix),Ct.setValue(T,"viewMatrix",L.matrixWorldInverse);const wn=Ct.map.cameraPosition;wn!==void 0&&wn.setValue(T,le.setFromMatrixPosition(L.matrixWorld)),$.logarithmicDepthBuffer&&Ct.setValue(T,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(ne.isMeshPhongMaterial||ne.isMeshToonMaterial||ne.isMeshLambertMaterial||ne.isMeshBasicMaterial||ne.isMeshStandardMaterial||ne.isShaderMaterial)&&Ct.setValue(T,"isOrthographic",L.isOrthographicCamera===!0),M!==L&&(M=L,Un=!0,la=!0)}if(Z.isSkinnedMesh){Ct.setOptional(T,Z,"bindMatrix"),Ct.setOptional(T,Z,"bindMatrixInverse");const fn=Z.skeleton;fn&&(fn.boneTexture===null&&fn.computeBoneTexture(),Ct.setValue(T,"boneTexture",fn.boneTexture,w))}Z.isBatchedMesh&&(Ct.setOptional(T,Z,"batchingTexture"),Ct.setValue(T,"batchingTexture",Z._matricesTexture,w),Ct.setOptional(T,Z,"batchingIdTexture"),Ct.setValue(T,"batchingIdTexture",Z._indirectTexture,w),Ct.setOptional(T,Z,"batchingColorTexture"),Z._colorsTexture!==null&&Ct.setValue(T,"batchingColorTexture",Z._colorsTexture,w));const $n=te.morphAttributes;if(($n.position!==void 0||$n.normal!==void 0||$n.color!==void 0)&&Ve.update(Z,te,ii),(Un||ze.receiveShadow!==Z.receiveShadow)&&(ze.receiveShadow=Z.receiveShadow,Ct.setValue(T,"receiveShadow",Z.receiveShadow)),ne.isMeshGouraudMaterial&&ne.envMap!==null&&(Xn.envMap.value=De,Xn.flipEnvMap.value=De.isCubeTexture&&De.isRenderTargetTexture===!1?-1:1),ne.isMeshStandardMaterial&&ne.envMap===null&&j.environment!==null&&(Xn.envMapIntensity.value=j.environmentIntensity),Un&&(Ct.setValue(T,"toneMappingExposure",v.toneMappingExposure),ze.needsLights&&eT(Xn,la),_e&&ne.fog===!0&&ce.refreshFogUniforms(Xn,_e),ce.refreshMaterialUniforms(Xn,ne,Q,ie,p.state.transmissionRenderTarget[L.id]),uu.upload(T,Jg(ze),Xn,w)),ne.isShaderMaterial&&ne.uniformsNeedUpdate===!0&&(uu.upload(T,Jg(ze),Xn,w),ne.uniformsNeedUpdate=!1),ne.isSpriteMaterial&&Ct.setValue(T,"center",Z.center),Ct.setValue(T,"modelViewMatrix",Z.modelViewMatrix),Ct.setValue(T,"normalMatrix",Z.normalMatrix),Ct.setValue(T,"modelMatrix",Z.matrixWorld),ne.isShaderMaterial||ne.isRawShaderMaterial){const fn=ne.uniformsGroups;for(let wn=0,Dh=fn.length;wn0&&w.useMultisampledRTT(L)===!1?Z=k.get(L).__webglMultisampledFramebuffer:Array.isArray(qe)?Z=qe[te]:Z=qe,U.copy(L.viewport),z.copy(L.scissor),H=L.scissorTest}else U.copy(re).multiplyScalar(Q).floor(),z.copy(xe).multiplyScalar(Q).floor(),H=ke;if(R.bindFramebuffer(T.FRAMEBUFFER,Z)&&ne&&R.drawBuffers(L,Z),R.viewport(U),R.scissor(z),R.setScissorTest(H),_e){const De=k.get(L.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+j,De.__webglTexture,te)}else if(Ae){const De=k.get(L.texture),Xe=j||0;T.framebufferTextureLayer(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,De.__webglTexture,te||0,Xe)}b=-1},this.readRenderTargetPixels=function(L,j,te,ne,Z,_e,Ae){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ie=k.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Ae!==void 0&&(Ie=Ie[Ae]),Ie){R.bindFramebuffer(T.FRAMEBUFFER,Ie);try{const De=L.texture,Xe=De.format,qe=De.type;if(!$.textureFormatReadable(Xe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!$.textureTypeReadable(qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=L.width-ne&&te>=0&&te<=L.height-Z&&T.readPixels(j,te,ne,Z,je.convert(Xe),je.convert(qe),_e)}finally{const De=I!==null?k.get(I).__webglFramebuffer:null;R.bindFramebuffer(T.FRAMEBUFFER,De)}}},this.readRenderTargetPixelsAsync=async function(L,j,te,ne,Z,_e,Ae){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ie=k.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Ae!==void 0&&(Ie=Ie[Ae]),Ie){const De=L.texture,Xe=De.format,qe=De.type;if(!$.textureFormatReadable(Xe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(j>=0&&j<=L.width-ne&&te>=0&&te<=L.height-Z){R.bindFramebuffer(T.FRAMEBUFFER,Ie);const Be=T.createBuffer();T.bindBuffer(T.PIXEL_PACK_BUFFER,Be),T.bufferData(T.PIXEL_PACK_BUFFER,_e.byteLength,T.STREAM_READ),T.readPixels(j,te,ne,Z,je.convert(Xe),je.convert(qe),0);const at=I!==null?k.get(I).__webglFramebuffer:null;R.bindFramebuffer(T.FRAMEBUFFER,at);const pt=T.fenceSync(T.SYNC_GPU_COMMANDS_COMPLETE,0);return T.flush(),await Y1(T,pt,4),T.bindBuffer(T.PIXEL_PACK_BUFFER,Be),T.getBufferSubData(T.PIXEL_PACK_BUFFER,0,_e),T.deleteBuffer(Be),T.deleteSync(pt),_e}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(L,j=null,te=0){L.isTexture!==!0&&(To("WebGLRenderer: copyFramebufferToTexture function signature has changed."),j=arguments[0]||null,L=arguments[1]);const ne=Math.pow(2,-te),Z=Math.floor(L.image.width*ne),_e=Math.floor(L.image.height*ne),Ae=j!==null?j.x:0,Ie=j!==null?j.y:0;w.setTexture2D(L,0),T.copyTexSubImage2D(T.TEXTURE_2D,te,0,0,Ae,Ie,Z,_e),R.unbindTexture()};const nT=T.createFramebuffer(),iT=T.createFramebuffer();this.copyTextureToTexture=function(L,j,te=null,ne=null,Z=0,_e=null){L.isTexture!==!0&&(To("WebGLRenderer: copyTextureToTexture function signature has changed."),ne=arguments[0]||null,L=arguments[1],j=arguments[2],_e=arguments[3]||0,te=null),_e===null&&(Z!==0?(To("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),_e=Z,Z=0):_e=0);let Ae,Ie,De,Xe,qe,Be,at,pt,zt;const Dt=L.isCompressedTexture?L.mipmaps[_e]:L.image;if(te!==null)Ae=te.max.x-te.min.x,Ie=te.max.y-te.min.y,De=te.isBox3?te.max.z-te.min.z:1,Xe=te.min.x,qe=te.min.y,Be=te.isBox3?te.min.z:0;else{const $n=Math.pow(2,-Z);Ae=Math.floor(Dt.width*$n),Ie=Math.floor(Dt.height*$n),L.isDataArrayTexture?De=Dt.depth:L.isData3DTexture?De=Math.floor(Dt.depth*$n):De=1,Xe=0,qe=0,Be=0}ne!==null?(at=ne.x,pt=ne.y,zt=ne.z):(at=0,pt=0,zt=0);const ut=je.convert(j.format),ze=je.convert(j.type);let Qt;j.isData3DTexture?(w.setTexture3D(j,0),Qt=T.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(w.setTexture2DArray(j,0),Qt=T.TEXTURE_2D_ARRAY):(w.setTexture2D(j,0),Qt=T.TEXTURE_2D),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,j.flipY),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),T.pixelStorei(T.UNPACK_ALIGNMENT,j.unpackAlignment);const mt=T.getParameter(T.UNPACK_ROW_LENGTH),ii=T.getParameter(T.UNPACK_IMAGE_HEIGHT),no=T.getParameter(T.UNPACK_SKIP_PIXELS),Un=T.getParameter(T.UNPACK_SKIP_ROWS),la=T.getParameter(T.UNPACK_SKIP_IMAGES);T.pixelStorei(T.UNPACK_ROW_LENGTH,Dt.width),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,Dt.height),T.pixelStorei(T.UNPACK_SKIP_PIXELS,Xe),T.pixelStorei(T.UNPACK_SKIP_ROWS,qe),T.pixelStorei(T.UNPACK_SKIP_IMAGES,Be);const Ct=L.isDataArrayTexture||L.isData3DTexture,Xn=j.isDataArrayTexture||j.isData3DTexture;if(L.isDepthTexture){const $n=k.get(L),fn=k.get(j),wn=k.get($n.__renderTarget),Dh=k.get(fn.__renderTarget);R.bindFramebuffer(T.READ_FRAMEBUFFER,wn.__webglFramebuffer),R.bindFramebuffer(T.DRAW_FRAMEBUFFER,Dh.__webglFramebuffer);for(let is=0;is{n.delete(r)};return{on:r=>{n.add(r);const s=()=>e(r);return ki(s),{off:s}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(s=>s(...r)))}}function At(n){return typeof n=="function"?n():Ft(n)}const Rp=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const oN=n=>n!=null,aN=Object.prototype.toString,lN=n=>aN.call(n)==="[object Object]",Pp=()=>{};function cN(n,e){function t(...i){return new Promise((r,s)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(s)})}return t}function uN(n,e={}){let t,i,r=Pp;const s=a=>{clearTimeout(a),r(),r=Pp};return a=>{const l=At(n),c=At(e.maxWait);return t&&s(t),l<=0||c!==void 0&&c<=0?(i&&(s(i),i=null),Promise.resolve(a())):new Promise((u,f)=>{r=e.rejectOnCancel?f:u,c&&!i&&(i=setTimeout(()=>{t&&s(t),i=null,u(a())},c)),t=setTimeout(()=>{i&&s(i),i=null,u(a())},l)})}}function fN(n,e,t=!1){return e.reduce((i,r)=>(r in n&&(!t||n[r]!==void 0)&&(i[r]=n[r]),i),{})}function hN(n){return ei()}function dN(n,e=200,t={}){return cN(uN(e,t),n)}function _v(n,e=200,t={}){const i=Ge(n.value),r=dN(()=>{i.value=n.value},e,t);return ft(n,()=>r()),i}function pN(n,e={}){if(!Et(n))return fx(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=ux(()=>({get(){return n.value[i]},set(r){var s;if((s=At(e.replaceRef))!=null?s:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return t}function yg(n,e=!0,t){hN()?Zs(n,t):e?n():ta(n)}function mN(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t;let s=null;const o=Ge(!1);function a(){s&&(clearInterval(s),s=null)}function l(){o.value=!1,a()}function c(){const u=At(e);u<=0||(o.value=!0,r&&n(),a(),o.value&&(s=setInterval(n,u)))}if(i&&Rp&&c(),Et(e)||typeof e=="function"){const u=ft(e,()=>{o.value&&Rp&&c()});ki(u)}return ki(l),{isActive:o,pause:l,resume:c}}const xr=Rp?window:void 0;function ci(n){var e;const t=At(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Cl(...n){let e,t,i,r;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,r]=n,e=xr):[e,t,i,r]=n,!e)return Pp;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(u=>u()),s.length=0},a=(u,f,h,d)=>(u.addEventListener(f,h,d),()=>u.removeEventListener(f,h,d)),l=ft(()=>[ci(e),At(r)],([u,f])=>{if(o(),!u)return;const h=lN(f)?{...f}:f;s.push(...t.flatMap(d=>i.map(m=>a(u,d,m,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return ki(c),c}function gN(){const n=Ge(!1),e=ei();return e&&Zs(()=>{n.value=!0},e),n}function Sh(n){const e=gN();return it(()=>(e.value,!!n()))}function _N(n,e,t={}){const{window:i=xr,...r}=t;let s;const o=Sh(()=>i&&"MutationObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=it(()=>{const h=At(n),d=(Array.isArray(h)?h:[h]).map(ci).filter(oN);return new Set(d)}),c=ft(()=>l.value,h=>{a(),o.value&&h.size&&(s=new MutationObserver(e),h.forEach(d=>s.observe(d,r)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),f=()=>{c(),a()};return ki(f),{isSupported:o,stop:f,takeRecords:u}}function xg(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:r=xr}=e,s=Ge(!1),o=i?1e3/i:null;let a=0,l=null;function c(h){if(!s.value||!r)return;a||(a=h);const d=h-a;if(o&&dt&&"matchMedia"in t&&typeof t.matchMedia=="function");let r;const s=Ge(!1),o=c=>{s.value=c.matches},a=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",o):r.removeListener(o))},l=Ff(()=>{i.value&&(a(),r=t.matchMedia(At(n)),"addEventListener"in r?r.addEventListener("change",o):r.addListener(o),s.value=r.matches)});return ki(()=>{l(),a(),r=void 0}),s}function yN(n={}){const{window:e=xr}=n,t=Ge(1);if(e){let i=function(){t.value=e.devicePixelRatio,r(),s=e.matchMedia(`(resolution: ${t.value}dppx)`),s.addEventListener("change",i,{once:!0})},r=function(){s==null||s.removeEventListener("change",i)},s;i(),ki(r)}return{pixelRatio:t}}function uS(n,e,t={}){const{window:i=xr,...r}=t;let s;const o=Sh(()=>i&&"ResizeObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=it(()=>{const f=At(n);return Array.isArray(f)?f.map(h=>ci(h)):[ci(f)]}),c=ft(l,f=>{if(a(),o.value&&i){s=new ResizeObserver(e);for(const h of f)h&&s.observe(h,r)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return ki(u),{isSupported:o,stop:u}}function xN(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:o="sync"}=e,a=Ge(0),l=Ge(0),c=Ge(0),u=Ge(0),f=Ge(0),h=Ge(0),d=Ge(0),m=Ge(0);function _(){const p=ci(n);if(!p){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,m.value=0);return}const y=p.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,m.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return uS(n,g),ft(()=>ci(n),p=>!p&&g()),_N(n,g,{attributeFilter:["style","class"]}),r&&Cl("scroll",g,{capture:!0,passive:!0}),i&&Cl("resize",g,{passive:!0}),yg(()=>{s&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:m,update:g}}function bN(n,e={width:0,height:0},t={}){const{window:i=xr,box:r="content-box"}=t,s=it(()=>{var f,h;return(h=(f=ci(n))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),o=Ge(e.width),a=Ge(e.height),{stop:l}=uS(n,([f])=>{const h=r==="border-box"?f.borderBoxSize:r==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&s.value){const d=ci(n);if(d){const m=d.getBoundingClientRect();o.value=m.width,a.value=m.height}}else if(h){const d=Array.isArray(h)?h:[h];o.value=d.reduce((m,{inlineSize:_})=>m+_,0),a.value=d.reduce((m,{blockSize:_})=>m+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);yg(()=>{const f=ci(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=ft(()=>ci(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function MN(n){var e;const t=Ge(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let r=performance.now(),s=0;return xg(()=>{if(s+=1,s>=i){const o=performance.now(),a=o-r;t.value=Math.round(1e3/(a/s)),r=o,s=0}}),t}function SN(n={}){const e=Ge(),t=Sh(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;mN(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const fS={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},EN=Object.keys(fS);function TN(n={}){const{target:e=xr}=n,t=Ge(!1),i=Ge(n.initialValue||{});Object.assign(i.value,fS,i.value);const r=s=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(s.pointerType))&&(i.value=fN(s,EN,!1))};if(e){const s={passive:!0};Cl(e,["pointerdown","pointermove","pointerup"],r,s),Cl(e,"pointerleave",()=>t.value=!1,s)}return{...pN(i),isInside:t}}function wN(n={}){const{window:e=xr,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:s=!0,type:o="inner"}=n,a=Ge(t),l=Ge(i),c=()=>{e&&(o==="outer"?(a.value=e.outerWidth,l.value=e.outerHeight):s?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight))};if(c(),yg(c),Cl("resize",c,{passive:!0}),r){const u=vN("(orientation: portrait)");ft(u,()=>c())}return{width:a,height:l}}var AN=Object.defineProperty,CN=(n,e,t)=>e in n?AN(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,vv=(n,e,t)=>CN(n,typeof e!="symbol"?e+"":e,t);const RN="@tresjs/core",PN="module",IN="4.3.1",LN="pnpm@9.1.4",DN="Declarative ThreeJS using Vue Components",ON="Alvaro Saburido (https://github.com/alvarosabu/)",NN="MIT",UN={type:"git",url:"git+https://github.com/Tresjs/tres.git"},FN=["vue","3d","threejs","three","threejs-vue"],BN=!1,kN={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",require:"./dist/tres.umd.cjs"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},zN="./dist/tres.js",VN="./dist/tres.js",HN="./dist/index.d.ts",GN=["*.d.ts","dist"],WN={access:"public"},XN={dev:"cd playground/vue && npm run dev","dev:nuxt":"cd playground/nuxt && npm run dev",build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",release:"release-it",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:serve":"vitepress serve docs","docs:preview":"vitepress preview docs","docs:contributors":"esno scripts/update-contributors.ts"},$N={three:">=0.133",vue:">=3.4"},qN={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^11.1.0"},YN={"@release-it/conventional-changelog":"^9.0.0","@stackblitz/sdk":"^1.11.0","@tresjs/cientos":"4.0.3","@tresjs/eslint-config":"^1.4.0","@types/three":"^0.169.0","@typescript-eslint/eslint-plugin":"^8.8.1","@typescript-eslint/parser":"^8.8.1","@vitejs/plugin-vue":"^5.1.4","@vitest/coverage-c8":"^0.33.0","@vitest/coverage-v8":"^2.1.2","@vitest/ui":"^2.1.2","@vue/test-utils":"^2.4.6",eslint:"^9.12.0","eslint-plugin-vue":"^9.29.0",esno:"^4.8.0",gsap:"^3.12.5",husky:"^9.1.6",jsdom:"^25.0.1",kolorist:"^1.8.0",ohmyfetch:"^0.4.21",pathe:"^1.1.2","release-it":"^17.8.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"^5.12.0",sponsorkit:"^0.15.5",three:"^0.169.0",unocss:"^0.63.4",unplugin:"^1.14.1","unplugin-vue-components":"^0.27.4",vite:"^5.4.8","vite-plugin-banner":"^0.8.0","vite-plugin-dts":"4.2.4","vite-plugin-inspect":"^0.8.7","vite-plugin-require-transform":"^1.0.21","vite-svg-loader":"^5.1.0",vitepress:"1.4.0",vitest:"^2.1.2",vue:"3.5.12","vue-demi":"^0.14.10"},jN={name:RN,type:PN,version:IN,packageManager:LN,description:DN,author:ON,license:NN,repository:UN,keywords:FN,sideEffects:BN,exports:kN,main:zN,module:VN,types:HN,files:GN,publishConfig:WN,scripts:XN,peerDependencies:$N,dependencies:qN,devDependencies:YN};class KN extends Bt{constructor(...e){super(...e),vv(this,"type","HightlightMesh"),vv(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function Ip(n){return typeof n>"u"}function _f(n){return Array.isArray(n)}function ZN(n){return typeof n=="number"}function hS(n){return typeof n=="string"}function Rs(n){return typeof n=="function"}function br(n){return n===Object(n)&&!_f(n)&&!Rs(n)}function kr(n){return br(n)&&"isObject3D"in n&&!!n.isObject3D}function yv(n){return br(n)&&"isCamera"in n&&!!n.isCamera}function JN(n){return br(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function QN(n){return br(n)&&"isMaterial"in n&&!!n.isMaterial}function e2(n){return br(n)&&"isLight"in n&&!!n.isLight}function t2(n){return br(n)&&"isFog"in n&&!!n.isFog}function n2(n){return br(n)&&"isScene"in n&&!!n.isScene}function Jc(n){return kr(n)||JN(n)||QN(n)||t2(n)}function i2(n){return br(n)&&!!n.isPrimitive}const dS=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],dS(n[t],e[t]));return Object.assign(n||{},e),n},r2="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",s2=l2(r2);function xv(n){return n&&n.nodeType===1}function Qc(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const o2=/\B([A-Z])/g;function a2(n){return n.replace(o2,"-$1").toLowerCase()}function l2(n,e){const t=Object.create(null),i=n.split(",");for(let r=0;r!!t[r]}const bv=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,r)=>i&&i[r],n)},c2=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((r,s,o)=>(r[s]===void 0&&(r[s]={}),o===i.length-1&&(r[s]=t),r[s]),n)};function pS(n,e){if(xv(n)&&xv(e)){const r=n.attributes,s=e.attributes;return r.length!==s.length?!1:Array.from(r).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const r of t)if(!i.includes(r)||!pS(n[r],e[r]))return!1;return!0}function u2(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=r(c);if(u)return u}},s=r(n);if(!s){console.warn("Object with UUID not found in the scene.");return}let o=s;for(let l=0;lmS(i)),!(n instanceof th)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&(i.geometry.dispose(),delete i.geometry),Array.isArray(i.material)?(i.material.forEach(r=>Mv(r)),delete i.material):i.material&&(Mv(i.material),delete i.material)}}function p2(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const Ev=/-\d+$/;function m2(n,e,t){if(hS(t)){if(Ev.test(t)){const s=t.replace(Ev,""),{target:o,key:a}=Lp(n,s);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>Ip(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:r}=Lp(n,t);e.__tres.previousAttach=i[r],i[r]=jo(e)}else e.__tres.previousAttach=t(n,e)}function g2(n,e,t){var i,r,s;if(hS(t)){const{target:o,key:a}=Lp(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(r=(i=e.__tres)==null?void 0:i.previousAttach)==null||r.call(i,n,e);(s=e.__tres)==null||delete s.previousAttach}function ws(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function gS(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function _2(n,e,t){var i;if(!Rs(n.setPixelRatio))return;let r=0;if(_f(t)&&t.length>=2){const[s,o]=t;r=Xm.clamp(e,s,o)}else ZN(t)?r=t:r=e;r!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(r)}function v2(n,e,t,i,r){const s=[...e.__tres.objects],o=jo(e);if(n=jo(n),o===n)return!0;const a=ws(n,e.__tres??{},r),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of s)_S(u,r),vS(u,r);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of s)i.insert(u,e);return!0}function jo(n){return i2(n)?(n.object.__tres=n.__tres,n.object):n}function _S(n,e){var t,i,r,s;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&p2(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?g2(o,n,n.__tres.attach):((s=(r=n.parent)==null?void 0:r.remove)==null||s.call(r,jo(n)),n.parent=null)}function vS(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var r;e.deregisterCamera(i),(r=e.eventManager)==null||r.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),gS(n)}const y2=({sizes:n})=>{const e=Ge([]),t=it(()=>e.value[0]),i=o=>{const a=o instanceof Gl?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},r=(o,a=!1)=>{if(yv(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},s=o=>{if(yv(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return Ff(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof Ht||x2(o))&&(o instanceof Ht?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),Fi(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:r,deregisterCamera:s,setCameraActive:i}};function x2(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const vf="[TresJS ▲ ■ ●] ";function b2(...n){typeof n[0]=="string"?n[0]=vf+n[0]:n.unshift(vf),console.error(...n)}function M2(...n){typeof n[0]=="string"?n[0]=vf+n[0]:n.unshift(vf),console.warn(...n)}function S2(n,e){}function bg(){return{logError:b2,logWarning:M2,logMessage:S2}}const Dp=Ge({}),Op=n=>Object.assign(Dp.value,n);function Nd(){const n=new Map,e=new Set;let t=0,i=!1;const r=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},s=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>s(o);return ki(l),i=!0,{off:l}},off:s,trigger:(...o)=>{i&&(r(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function E2(){let n=!0,e=!0,t=!1;const i=new bh(!1),r=Ge(i.running),s=Ge(!1);let o;const a=Xm.generateUUID();let l=null;const c=Nd(),u=Nd(),f=Nd();E();let h={};function d(A){h=A}function m(A,I,b=0){switch(I){case"before":return c.on(A,b);case"render":return l||(l=A),u.dispose(),u.on(A);case"after":return f.on(A,b)}}function _(){e&&(e=!1,E(),S())}function g(){e=!0,E(),cancelAnimationFrame(o)}function p(){t=!1,E()}function y(){t=!0,E()}function x(){s.value=!0}function v(){s.value=!1}function S(){if(!n){o=requestAnimationFrame(S);return}const A=i.getDelta(),I=i.getElapsedTime(),b={camera:Ft(h.camera),scene:Ft(h.scene),renderer:Ft(h.renderer),raycaster:Ft(h.raycaster),controls:Ft(h.controls),invalidate:h.invalidate,advance:h.advance},M={delta:A,elapsed:I,clock:i,...b};r.value&&c.trigger(M),s.value||(u.count?u.trigger(M):l&&l(M)),r.value&&f.trigger(M),o=requestAnimationFrame(S)}function E(){const A=!e&&!t;i.running!==A&&(i.running?i.stop():i.start()),r.value=i.running}return{loopId:a,register:(A,I,b)=>m(A,I,b),start:_,stop:g,pause:y,resume:p,pauseRender:x,resumeRender:v,isRenderPaused:s,isActive:r,setContext:d,setReady:A=>n=A}}function Mg(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,r=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,s=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=r+s+o+a;e+=l}}),e}function T2(n){return(n/1024).toFixed(2)}const w2=Number.parseInt(zl.replace("dev",""));function A2(n){return n instanceof Te?n:Array.isArray(n)?new Te(...n):new Te(n)}const eu={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:_n,toneMapping:Hf,toneMappingExposure:3,shadowMap:{enabled:!0,type:Im}},flat:{toneMapping:Di,toneMappingExposure:1}};function C2({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:r,advance:s}}){const o=it(()=>({alpha:At(e.alpha)??!0,depth:At(e.depth),canvas:ci(n),context:At(e.context),stencil:At(e.stencil),antialias:At(e.antialias)??!0,precision:At(e.precision),powerPreference:At(e.powerPreference),premultipliedAlpha:At(e.premultipliedAlpha),preserveDrawingBuffer:At(e.preserveDrawingBuffer),logarithmicDepthBuffer:At(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:At(e.failIfMajorPerformanceCaveat)})),a=hi(new fu(o.value));function l(){e.renderMode==="on-demand"&&r()}ft(o,()=>{a.value.dispose(),a.value=new fu(o.value),l()}),ft([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),ft(()=>e.clearColor,l);const{pixelRatio:c}=yN(),{logError:u}=bg(),f=(()=>{const d=new fu,m={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),m})(),h=At(e.renderMode);return h==="on-demand"&&r(),h==="manual"&&setTimeout(()=>{s()},100),Ff(()=>{const d=At(e.preset);d&&(d in eu||u(`Renderer Preset must be one of these: ${Object.keys(eu).join(", ")}`),dS(a.value,eu[d])),_2(a.value,c.value,At(e.dpr)),h==="always"&&(i.frames.value=Math.max(1,i.frames.value));const m=(p,y)=>{const x=At(p),v=()=>{if(d)return bv(eu[d],y)};if(x!==void 0)return x;const S=v();return S!==void 0?S:bv(f,y)},_=(p,y)=>c2(a.value,y,m(p,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??Hf,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),w2<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=m(e.clearColor,"clearColor");g&&a.value.setClearColor(g?A2(g):new Te(0))}),Fi(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function R2(n,e,t=10){const i=At(n)?wN():bN(it(()=>At(e).parentElement)),r=zo(_v(i.width,t)),s=zo(_v(i.height,t)),o=it(()=>r.value/s.value);return{height:s,width:r,aspectRatio:o}}const P2=(n,e)=>{const t=it(()=>e.renderer.value.domElement),i=hi([]),{x:r,y:s}=TN({target:t});let o=0;const{width:a,height:l,top:c,left:u}=xN(t),f=({x:re,y:xe})=>{if(t.value)return{x:(re-u.value)/a.value*2-1,y:-((xe-c.value)/l.value)*2+1}},h=({x:re,y:xe})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new fe(re,xe),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},d=re=>{const xe=f({x:(re==null?void 0:re.clientX)??r.value,y:(re==null?void 0:re.clientY)??s.value});return xe?h(xe)||[]:[]},m=jn(),_=jn(),g=jn(),p=jn(),y=jn(),x=jn(),v=jn(),S=jn();function E(re){const xe={};for(const ke in re)typeof ke!="function"&&(xe[ke]=re[ke]);return xe}const A=(re,xe)=>{var ke,se,ge;const be=E(xe),W=new F(xe==null?void 0:xe.clientX,xe==null?void 0:xe.clientY,0).unproject((ke=e.camera)==null?void 0:ke.value);re.trigger({...be,intersections:i.value,unprojectedPoint:W,ray:(se=e.raycaster)==null?void 0:se.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:xe,delta:o,stopPropagating:!1})};let I;const b=re=>{d(re),A(g,re),I=re},M=()=>{I&&b(I)};let U,z,H;const K=re=>{var xe;U=(xe=i.value[0])==null?void 0:xe.object,o=0,z=new fe((re==null?void 0:re.clientX)??r.value,(re==null?void 0:re.clientY)??s.value),A(y,re)};let ee,J=!1;const ie=re=>{var xe,ke,se;re instanceof PointerEvent&&(i.value.length===0&&A(x,re),U===((xe=i.value[0])==null?void 0:xe.object)&&(H=new fe((re==null?void 0:re.clientX)??r.value,(re==null?void 0:re.clientY)??s.value),o=z==null?void 0:z.distanceTo(H),re.button===0?(A(m,re),ee===((ke=i.value[0])==null?void 0:ke.object)?J=!0:(ee=(se=i.value[0])==null?void 0:se.object,J=!1)):re.button===2&&A(v,re)),A(p,re))},Q=re=>{J&&(A(_,re),ee=void 0,J=!1)},me=re=>A(g,re),ve=re=>A(S,re);return t.value.addEventListener("pointerup",ie),t.value.addEventListener("pointerdown",K),t.value.addEventListener("pointermove",b),t.value.addEventListener("pointerleave",me),t.value.addEventListener("dblclick",Q),t.value.addEventListener("wheel",ve),Fi(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",ie),t.value.removeEventListener("pointerdown",K),t.value.removeEventListener("pointermove",b),t.value.removeEventListener("pointerleave",me),t.value.removeEventListener("dblclick",Q),t.value.removeEventListener("wheel",ve))}),{intersects:i,onClick:re=>m.on(re).off,onDblClick:re=>_.on(re).off,onContextMenu:re=>v.on(re).off,onPointerMove:re=>g.on(re).off,onPointerUp:re=>p.on(re).off,onPointerDown:re=>y.on(re).off,onPointerMissed:re=>x.on(re).off,onWheel:re=>S.on(re).off,forceUpdate:M}};function Ud(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function I2(n,e,t){var i;const r=hi(),s=hi();n&&(r.value=n),s.value=e;const o=b=>{var M;return((M=b.__tres)==null?void 0:M.eventCount)>0},a=b=>{var M;return((M=b.children)==null?void 0:M.some(U=>a(U)))||o(b)},l=hi(((i=r.value)==null?void 0:i.children).filter(a)||[]);function c(b,M){const U=[],z=()=>M.stopPropagating=!0;M.stopPropagation=z;for(const H of M==null?void 0:M.intersections){if(M.stopPropagating)return;M={...M,...H};const{object:K}=H;M.eventObject=K,Ud(K[b],M),U.push(K);let ee=K.parent;for(;ee!==null&&!M.stopPropagating&&!U.includes(ee);)M.eventObject=ee,Ud(ee[b],M),U.push(ee),ee=ee.parent;const J=a2(b.slice(2));t(J,{intersection:H,event:M})}}const{onClick:u,onDblClick:f,onContextMenu:h,onPointerMove:d,onPointerDown:m,onPointerUp:_,onPointerMissed:g,onWheel:p,forceUpdate:y}=P2(l,e);_(b=>c("onPointerUp",b)),m(b=>c("onPointerDown",b)),u(b=>c("onClick",b)),f(b=>c("onDoubleClick",b)),h(b=>c("onContextMenu",b)),p(b=>c("onWheel",b));let x=[];d(b=>{const M=b.intersections.map(({object:z})=>z),U=b.intersections;x.forEach(({object:z})=>{M.includes(z)||(b.intersections=x,c("onPointerLeave",b),c("onPointerOut",b))}),b.intersections=U,b.intersections.forEach(({object:z})=>{x.includes(z)||(c("onPointerEnter",b),c("onPointerOver",b))}),c("onPointerMove",b),x=b.intersections});const v=[];g(b=>{const M=()=>b.stopPropagating=!0;b.stopPropagation=M,v.forEach(U=>{b.stopPropagating||(b.eventObject=U,Ud(U.onPointerMissed,b))}),t("pointer-missed",{event:b})});function S(b){Jc(b)&&kr(b)&&l.value.push(b)}function E(b){if(Jc(b)&&kr(b)){const M=l.value.indexOf(b);M>-1&&l.value.splice(M,1)}}function A(b){Jc(b)&&kr(b)&&b.onPointerMissed&&v.push(b)}function I(b){if(Jc(b)&&kr(b)){const M=v.indexOf(b);M>-1&&v.splice(M,1)}}return e.eventManager={forceUpdate:y,registerObject:S,deregisterObject:E,registerPointerMissedObject:A,deregisterPointerMissedObject:I},{forceUpdate:y,registerObject:S,deregisterObject:E,registerPointerMissedObject:A,deregisterPointerMissedObject:I}}function L2(n,e,t=100){t=t<=0?100:t;const i=jn(),r=new Set;let s=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!s&&n()?(i.trigger(e),r.forEach(f=>f()),r.clear(),s=!0):!o&&!s&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...h)=>{f(...h)};return{on:f=>{if(s)return u(f,e),{off:()=>{}};{const h=i.on(f);return r.add(h.off),i.on(f)}},off:i.off,trigger:i.trigger,cancel:c}}const Fd=new WeakMap;function D2(n){if(n=n||yS(),Fd.has(n))return Fd.get(n);const e=100,t=Date.now(),i=L2(()=>{if(Date.now()-t>=e)return!0;{const r=n.renderer.value,s=(r==null?void 0:r.domElement)||{width:0,height:0};return!!(r&&s.width>0&&s.height>0)}},n);return Fd.set(n,i),i}function O2({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:r}){const s=hi(n),o=R2(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=y2({sizes:o,scene:n}),h={mode:Ge(i.renderMode||"always"),priority:Ge(0),frames:Ge(0),maxFrames:60,canBeInvalidated:it(()=>h.mode.value==="on-demand"&&h.frames.value===0)};function d(H=1){i.renderMode==="on-demand"&&(h.frames.value=Math.min(h.maxFrames,h.frames.value+H))}function m(){i.renderMode==="manual"&&(h.frames.value=1)}const{renderer:_}=C2({scene:n,canvas:e,options:i,emit:r,contextParts:{sizes:o,camera:a,render:h,invalidate:d,advance:m}}),g={sizes:o,scene:s,camera:a,cameras:zo(l),renderer:_,raycaster:hi(new nS),controls:Ge(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:h,advance:m,extend:Op,invalidate:d,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:E2()};Vr("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&h.frames.value>0&&(_.value.render(n,a.value),r("render",g.renderer.value)),h.priority.value=0,h.mode.value==="always"?h.frames.value=1:h.frames.value=Math.max(0,h.frames.value-1)},"render");const{on:p,cancel:y}=D2(g);g.loop.setReady(!1),g.loop.start(),p(()=>{r("ready",g),g.loop.setReady(!0),I2(n,g,r)}),Fi(()=>{y(),g.loop.stop()});const x=100,v=MN({every:x}),{isSupported:S,memory:E}=SN({interval:x}),A=160;let I=performance.now();const b=({timestamp:H})=>{g.scene.value&&(g.perf.memory.allocatedMem=Mg(g.scene.value)),H-I>=x&&(I=H,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>A&&g.perf.fps.accumulator.shift(),g.perf.fps.value=v.value,S.value&&E.value&&(g.perf.memory.accumulator.push(E.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>A&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((K,ee)=>K+ee,0)/g.perf.memory.accumulator.length))};let M=0;const U=1,{pause:z}=xg(({delta:H})=>{window.__TRES__DEVTOOLS__&&(b({timestamp:performance.now()}),M+=H,M>=U&&(window.__TRES__DEVTOOLS__.cb(g),M=0))},{immediate:!0});return Fi(()=>{z()}),g}function yS(){const n=Vn("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function kV(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:r,controls:s,invalidate:o,advance:a}=yS();i.setContext({camera:n,scene:e,renderer:t,raycaster:r,controls:s,invalidate:o,advance:a});function l(f,h=0){return i.register(f,"before",h)}function c(f){return i.register(f,"render")}function u(f,h=0){return i.register(f,"after",h)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const N2=jn(),U2=jn(),xS=jn(),Xa=new bh;let hu=0,du=0;xg(()=>{N2.trigger({delta:hu,elapsed:du,clock:Xa}),U2.trigger({delta:hu,elapsed:du,clock:Xa}),xS.trigger({delta:hu,elapsed:du,clock:Xa})},{immediate:!1});xS.on(()=>{hu=Xa.getDelta(),du=Xa.getElapsedTime()});function F2(n,e={},t={}){let i=n;const r=a=>{i=a};let s=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){return t[l]?t[l](c,i,s,r):i[l]=c,!0}};return s=new Proxy({},o),s}const{logError:Tv}=bg(),wv=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],B2=n=>{const e=n.scene.value;function t(c,u,f,h){if(h||(h={}),h.args||(h.args=[]),c==="template"||s2(c))return null;let d=c.replace("Tres",""),m;if(c==="primitive"){(!br(h.object)||Et(h.object))&&Tv("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),d=h.object.type;const _={};m=F2(h.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,p,y,x)=>{v2(g,y,x,{patchProp:s,remove:r,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=Dp.value[d];_||Tv(`${d} is not defined on the THREE namespace. Use extend to add it to the catalog.`),m=new _(...h.args)}return m?(m.isCamera&&(h!=null&&h.position||m.position.set(3,3,3),h!=null&&h.lookAt||m.lookAt(0,0,0)),m=ws(m,{...m.__tres,type:d,memoizedProps:h,eventCount:0,primitive:c==="primitive",attach:h.attach},n),m):null}function i(c,u){var f,h,d;if(!c)return;u=u||e;const m=c.__tres?c:ws(c,{},n),_=u.__tres?u:ws(u,{},n);c=jo(m),u=jo(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.registerObject(c)),n.registerCamera(c),(d=n.eventManager)==null||d.registerPointerMissedObject(c),m.__tres.attach?m2(_,m,m.__tres.attach):kr(c)&&kr(_)&&(_.add(c),c.dispatchEvent({type:"added"})),m.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(m)&&_.__tres.objects.push(m)}function r(c,u){var f,h,d,m;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.deregisterObject(c)),u=Ip(u)?"default":u;const _=(d=c.__tres)==null?void 0:d.dispose;Ip(_)||(_===null?u=!1:u=_);const g=(m=c.__tres)==null?void 0:m.primitive,p=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(y=>r(y,u)),p&&c.children&&[...c.children].forEach(y=>r(y,u)),_S(c,n),vS(c,n),p&&!n2(c)){if(Rs(u))u(c);else if(Rs(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function s(c,u,f,h){var d,m;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=h),u==="attach"){const v=((d=c.__tres)==null?void 0:d.parent)||c.parent;r(c),ws(c,{attach:h},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=ws(c,{},n)),c.__tres.dispose=h;return}if(kr(c)&&g==="blocks-pointer-events"){h||h===""?c[g]=h:delete c[g];return}wv.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let p=Qc(g),y=_==null?void 0:_[p];if(g==="args"){const v=c,S=f??[],E=h??[],A=((m=c.__tres)==null?void 0:m.type)||c.type;A&&S.length&&!u2(S,E)&&(_=Object.assign(v,new Dp.value[A](...h)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(Qc(g),new bt(...h));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((S,E)=>S[Qc(E)],_),g=v.pop(),p=g,y!=null&&y.set||(_=v.reduce((S,E)=>S[Qc(E)],_))}let x=h;if(x===""&&(x=!0),Rs(y)){wv.includes(u)||(_f(x)?c[p](...x):c[p](x)),p.startsWith("on")&&Rs(x)&&(_[p]=x);return}!(y!=null&&y.set)&&!Rs(y)?_[p]=x:y.constructor===x.constructor&&y!=null&&y.copy?y==null||y.copy(x):_f(x)?y.set(...x):!y.isColor&&y.setScalar?y.setScalar(x):y.set(x),gS(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=ws(new ot,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),h=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],d=h.indexOf(c);return d<0||d>=h.length-1?null:h[d+1]}return{insert:i,remove:r,createElement:t,patchProp:s,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function k2(){return bS().__VUE_DEVTOOLS_GLOBAL_HOOK__}function bS(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const z2=typeof Proxy=="function",V2="devtools-plugin:setup",H2="plugin:settings:set";let Sa,Np;function G2(){var n;return Sa!==void 0||(typeof window<"u"&&window.performance?(Sa=!0,Np=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(Sa=!0,Np=globalThis.perf_hooks.performance):Sa=!1),Sa}function W2(){return G2()?Np.now():Date.now()}class X2{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const r=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},i);try{const o=localStorage.getItem(r),a=JSON.parse(o);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}s=o},now(){return W2()}},t&&t.on(H2,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function $2(n,e){const t=n,i=bS(),r=k2(),s=z2&&t.enableEarlyProxy;if(r&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))r.emit(V2,n,e);else{const o=s?new X2(t,r):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function q2(n,e){const t=`▲ ■ ●${n}`;typeof Av=="function"?Av(t,e):console.log(t)}function Av(n,e){throw new Error(n+e)}const MS=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=Mg(n);return t>0&&e.tags.push({label:`${T2(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(e2(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new Te(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function SS(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const r=MS(i);e.children.push(r),SS(i,r,t)})}const Y2=[],Ea="tres:inspector",j2=zi({sceneGraph:null});function K2(n,e){$2({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:Y2,app:n},t=>{typeof t.now!="function"&&q2("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),t.addInspector({id:Ea,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(Ea)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(s=>{if(s.inspectorId===Ea){const o=MS(e.scene.value);SS(e.scene.value,o,s.filter),j2.sceneGraph=o,s.rootNodes=[o]}});let i=null,r=null;t.on.getInspectorState(s=>{var o;if(s.inspectorId===Ea){const[a]=e.scene.value.getObjectsByProperty("uuid",s.nodeId);if(!a)return;if(r&&i&&i.parent&&r.remove(i),a.isMesh){const l=h2(a);a.add(l),i=l,r=a}s.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(s.state.info={objects:a.children.length,memory:Mg(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines},s.state.programs=((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({key:l.name,value:{...l,vertexShader:l.vertexShader,attributes:l.getAttributes(),uniforms:l.getUniforms()}})))||[])}}),t.on.editInspectorState(s=>{s.inspectorId===Ea&&f2(e.scene.value,s.nodeId,s.path,s.state.value)})})}const Z2=["data-scene","data-tres"],J2=Ui({__name:"TresCanvas",props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:["render","click","double-click","context-menu","pointer-move","pointer-up","pointer-down","pointer-enter","pointer-leave","pointer-over","pointer-out","pointer-missed","wheel","ready"],setup(n,{expose:e,emit:t}){const i=n,r=t,s=Sm(),{logWarning:o}=bg(),a=Ge(),l=hi(new th),c=ei();Op(rN);const u=(_,g=!1)=>Ui({setup(){var p;const y=(p=ei())==null?void 0:p.appContext;y&&(y.app=c==null?void 0:c.appContext.app);const x={};function v(S){S&&(S.parent&&v(S.parent),S.provides&&Object.assign(x,S.provides))}return c!=null&&c.parent&&i.enableProvideBridge&&(v(c.parent),Reflect.ownKeys(x).forEach(S=>{Vr(S,x[S])})),Vr("useTres",_),Vr("extend",Op),typeof window<"u"&&K2(y==null?void 0:y.app,_),()=>dr(en,null,g?[]:s.default())}}),f=(_,g=!1)=>{const p=u(_,g),{render:y}=Wx(B2(_));y(dr(p),l.value)},h=(_,g=!1)=>{mS(_.scene.value),g&&(_.renderer.value.dispose(),_.renderer.value.renderLists.dispose(),_.renderer.value.forceContextLoss()),l.value.__tres={root:_}},d=hi(null);e({context:d,dispose:()=>h(d.value,!0)});const m=()=>{h(d.value),f(d.value,!0)};return Zs(()=>{const _=a;d.value=O2({scene:l.value,canvas:_,windowSize:i.windowSize??!1,rendererOptions:i,emit:r});const{registerCamera:g,camera:p,cameras:y,deregisterCamera:x}=d.value;f(d.value);const v=()=>{const S=new Ht(45,window.innerWidth/window.innerHeight,.1,1e3);S.position.set(3,3,3),S.lookAt(0,0,0),g(S);const E=Ff(()=>{y.value.length>=2&&(S.removeFromParent(),x(S),E==null||E())})};ft(()=>i.camera,(S,E)=>{S&&g(S),E&&(E.removeFromParent(),x(E))},{immediate:!0}),p.value||(o("No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."),v())}),Fi(m),(_,g)=>(il(),Vw("canvas",{ref_key:"canvas",ref:a,"data-scene":l.value.uuid,class:Pf(_.$attrs.class),"data-tres":`tresjs ${Ft(jN).version}`,style:Rf({display:"block",width:"100%",height:"100%",position:_.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",..._.$attrs.style})},null,14,Z2))}}),Q2={install(n){n.component("TresCanvas",J2)}};function Bd(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function Up(n,e,t=".",i){if(!Bd(e))return Up(n,{},t,i);const r=Object.assign({},e);for(const s in n){if(s==="__proto__"||s==="constructor")continue;const o=n[s];o!=null&&(i&&i(r,s,o,t)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:Bd(o)&&Bd(r[s])?r[s]=Up(o,r[s],(t?`${t}.`:"")+s.toString(),i):r[s]=o))}return r}function eU(n){return(...e)=>e.reduce((t,i)=>Up(t,i,"",n),{})}const ES=eU();function TS(n){return If()?(pm(n),!0):!1}function Sg(n){return typeof n=="function"?n():Ft(n)}const tU=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nU=n=>n!=null,iU=Object.prototype.toString,yf=n=>iU.call(n)==="[object Object]",pu=()=>{};function rU(n){return ei()}function sU(n,e){rU()&&Fi(n,e)}function $a(n){var e;const t=Sg(n);return(e=t==null?void 0:t.$el)!=null?e:t}const wS=tU?window:void 0;function Mi(...n){let e,t,i,r;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,r]=n,e=wS):[e,t,i,r]=n,!e)return pu;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(u=>u()),s.length=0},a=(u,f,h,d)=>(u.addEventListener(f,h,d),()=>u.removeEventListener(f,h,d)),l=ft(()=>[$a(e),Sg(r)],([u,f])=>{if(o(),!u)return;const h=yf(f)?{...f}:f;s.push(...t.flatMap(d=>i.map(m=>a(u,d,m,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return TS(c),c}function oU(){const n=Ge(!1),e=ei();return e&&Zs(()=>{n.value=!0},e),n}function aU(n){const e=oU();return it(()=>(e.value,!!n()))}function lU(n,e,t={}){const{root:i,rootMargin:r="0px",threshold:s=.1,window:o=wS,immediate:a=!0}=t,l=aU(()=>o&&"IntersectionObserver"in o),c=it(()=>{const m=Sg(n);return(Array.isArray(m)?m:[m]).map($a).filter(nU)});let u=pu;const f=Ge(a),h=l.value?ft(()=>[c.value,$a(i),f.value],([m,_])=>{if(u(),!f.value||!m.length)return;const g=new IntersectionObserver(e,{root:$a(_),rootMargin:r,threshold:s});m.forEach(p=>p&&g.observe(p)),u=()=>{g.disconnect(),u=pu}},{immediate:a,flush:"post"}):pu,d=()=>{u(),h(),f.value=!1};return TS(d),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:d}}const AS=1/60*1e3,cU=typeof performance<"u"?()=>performance.now():()=>Date.now(),CS=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(cU()),AS);function uU(n){let e=[],t=[],i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&r,h=f?e:t;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),f&&r&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=uU(()=>Rl=!0),n),{}),kp=Zl.reduce((n,e)=>{const t=Eh[e];return n[e]=(i,r=!1,s=!1)=>(Rl||pU(),t.schedule(i,r,s)),n},{}),hU=Zl.reduce((n,e)=>(n[e]=Eh[e].cancel,n),{});Zl.reduce((n,e)=>(n[e]=()=>Eh[e].process(ko),n),{});const dU=n=>Eh[n].process(ko),RS=n=>{Rl=!1,ko.delta=Fp?AS:Math.max(Math.min(n-ko.timestamp,fU),1),ko.timestamp=n,Bp=!0,Zl.forEach(dU),Bp=!1,Rl&&(Fp=!1,CS(RS))},pU=()=>{Rl=!0,Fp=!0,Bp||CS(RS)},PS=()=>ko;function IS(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);rMath.min(Math.max(t,n),e),kd=.001,mU=.01,gU=10,_U=.05,vU=1;function yU({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s,o=1-e;o=zp(_U,vU,o),n=zp(mU,gU,n/1e3),o<1?(r=c=>{const u=c*o,f=u*n,h=u-t,d=Vp(c,o),m=Math.exp(-f);return kd-h/d*m},s=c=>{const f=c*o*n,h=f*t+t,d=Math.pow(o,2)*Math.pow(c,2)*n,m=Math.exp(-f),_=Vp(Math.pow(c,2),o);return(-r(c)+kd>0?-1:1)*((h-d)*m)/_}):(r=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-kd+u*f},s=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=bU(r,s,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const xU=12;function bU(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function EU(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!Rv(n,SU)&&Rv(n,MU)){const t=yU(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Eg(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:r}=n,s=IS(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:h}=EU(s),d=Pv,m=Pv;function _(){const g=u?-(u/1e3):0,p=t-e,y=l/(2*Math.sqrt(a*c)),x=Math.sqrt(a/c)/1e3;if(r===void 0&&(r=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=Vp(x,y);d=S=>{const E=Math.exp(-y*x*S);return t-E*((g+y*x*p)/v*Math.sin(v*S)+p*Math.cos(v*S))},m=S=>{const E=Math.exp(-y*x*S);return y*x*E*(Math.sin(v*S)*(g+y*x*p)/v+p*Math.cos(v*S))-E*(Math.cos(v*S)*(g+y*x*p)-v*p*Math.sin(v*S))}}else if(y===1)d=v=>t-Math.exp(-x*v)*(p+(g+x*p)*v);else{const v=x*Math.sqrt(y*y-1);d=S=>{const E=Math.exp(-y*x*S),A=Math.min(v*S,300);return t-E*((g+y*x*p)*Math.sinh(A)+v*p*Math.cosh(A))/v}}}return _(),{next:g=>{const p=d(g);if(h)o.done=g>=f;else{const y=m(g)*1e3,x=Math.abs(y)<=i,v=Math.abs(t-p)<=r;o.done=x&&v}return o.value=o.done?t:p,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}Eg.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const Pv=n=>0,LS=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},Tg=(n,e,t)=>-t*n+t*e+n,DS=(n,e)=>t=>Math.max(Math.min(t,e),n),qa=n=>n%1?Number(n.toFixed(5)):n,Pl=/(-)?([\d]*\.?[\d])+/g,Hp=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,TU=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Jl(n){return typeof n=="string"}const Ql={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Ya=Object.assign(Object.assign({},Ql),{transform:DS(0,1)}),tu=Object.assign(Object.assign({},Ql),{default:1}),wg=n=>({test:e=>Jl(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),bs=wg("deg"),ja=wg("%"),Qe=wg("px"),Iv=Object.assign(Object.assign({},ja),{parse:n=>ja.parse(n)/100,transform:n=>ja.transform(n*100)}),Ag=(n,e)=>t=>!!(Jl(t)&&TU.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),OS=(n,e,t)=>i=>{if(!Jl(i))return i;const[r,s,o,a]=i.match(Pl);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ns={test:Ag("hsl","hue"),parse:OS("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+ja.transform(qa(e))+", "+ja.transform(qa(t))+", "+qa(Ya.transform(i))+")"},wU=DS(0,255),zd=Object.assign(Object.assign({},Ql),{transform:n=>Math.round(wU(n))}),zr={test:Ag("rgb","red"),parse:OS("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+zd.transform(n)+", "+zd.transform(e)+", "+zd.transform(t)+", "+qa(Ya.transform(i))+")"};function AU(n){let e="",t="",i="",r="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),r=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),r=n.substr(4,1),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Gp={test:Ag("#"),parse:AU,transform:zr.transform},Rn={test:n=>zr.test(n)||Gp.test(n)||Ns.test(n),parse:n=>zr.test(n)?zr.parse(n):Ns.test(n)?Ns.parse(n):Gp.parse(n),transform:n=>Jl(n)?n:n.hasOwnProperty("red")?zr.transform(n):Ns.transform(n)},NS="${c}",US="${n}";function CU(n){var e,t,i,r;return isNaN(n)&&Jl(n)&&((t=(e=n.match(Pl))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((r=(i=n.match(Hp))===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r:0)>0}function FS(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Hp);i&&(t=i.length,n=n.replace(Hp,NS),e.push(...i.map(Rn.parse)));const r=n.match(Pl);return r&&(n=n.replace(Pl,US),e.push(...r.map(Ql.parse))),{values:e,numColors:t,tokenised:n}}function BS(n){return FS(n).values}function kS(n){const{values:e,numColors:t,tokenised:i}=FS(n),r=e.length;return s=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function PU(n){const e=BS(n);return kS(n)(e.map(RU))}const ec={test:CU,parse:BS,createTransformer:kS,getAnimatableNone:PU},IU=new Set(["brightness","contrast","saturate","opacity"]);function LU(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(Pl)||[];if(!i)return n;const r=t.replace(i,"");let s=IU.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const DU=/([a-z-]*)\(.*?\)/g,Wp=Object.assign(Object.assign({},ec),{getAnimatableNone:n=>{const e=n.match(DU);return e?e.map(LU).join(" "):n}});function Vd(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function Lv({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=Vd(l,a,n+1/3),s=Vd(l,a,n),o=Vd(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const OU=(n,e,t)=>{const i=n*n,r=e*e;return Math.sqrt(Math.max(0,t*(r-i)+i))},NU=[Gp,zr,Ns],Dv=n=>NU.find(e=>e.test(n)),zS=(n,e)=>{let t=Dv(n),i=Dv(e),r=t.parse(n),s=i.parse(e);t===Ns&&(r=Lv(r),t=zr),i===Ns&&(s=Lv(s),i=zr);const o=Object.assign({},r);return a=>{for(const l in o)l!=="alpha"&&(o[l]=OU(r[l],s[l],a));return o.alpha=Tg(r.alpha,s.alpha,a),t.transform(o)}},UU=n=>typeof n=="number",FU=(n,e)=>t=>e(n(t)),VS=(...n)=>n.reduce(FU);function HS(n,e){return UU(n)?t=>Tg(n,e,t):Rn.test(n)?zS(n,e):WS(n,e)}const GS=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>HS(s,e[o]));return s=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=HS(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}};function Ov(n){const e=ec.parse(n),t=e.length;let i=0,r=0,s=0;for(let o=0;o{const t=ec.createTransformer(e),i=Ov(n),r=Ov(e);return i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&i.numNumbers>=r.numNumbers?VS(GS(i.parsed,r.parsed),t):o=>`${o>0?e:n}`},kU=(n,e)=>t=>Tg(n,e,t);function zU(n){if(typeof n=="number")return kU;if(typeof n=="string")return Rn.test(n)?zS:WS;if(Array.isArray(n))return GS;if(typeof n=="object")return BU}function VU(n,e,t){const i=[],r=t||zU(n[0]),s=n.length-1;for(let o=0;ot(LS(n,e,i))}function GU(n,e){const t=n.length,i=t-1;return r=>{let s=0,o=!1;if(r<=n[0]?o=!0:r>=n[i]&&(s=i-1,o=!0),!o){let l=1;for(;lr||l===i);l++);s=l-1}const a=LS(n[s],n[s+1],r);return e[s](a)}}function XS(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const s=n.length;Cv(s===e.length),Cv(!i||!Array.isArray(i)||i.length===s-1),n[0]>n[s-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=VU(e,i,r),a=s===2?HU(n,o):GU(n,o);return t?l=>a(zp(n[0],n[s-1],l)):a}const Th=n=>e=>1-n(1-e),Cg=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,WU=n=>e=>Math.pow(e,n),$S=n=>e=>e*e*((n+1)*e-n),XU=n=>{const e=$S(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},qS=1.525,$U=4/11,qU=8/11,YU=9/10,YS=n=>n,Rg=WU(2),jU=Th(Rg),jS=Cg(Rg),KS=n=>1-Math.sin(Math.acos(n)),ZS=Th(KS),KU=Cg(ZS),Pg=$S(qS),ZU=Th(Pg),JU=Cg(Pg),QU=XU(qS),e3=4356/361,t3=35442/1805,n3=16061/1805,xf=n=>{if(n===1||n===0)return n;const e=n*n;return n<$U?7.5625*e:nn<.5?.5*(1-xf(1-n*2)):.5*xf(n*2-1)+.5;function s3(n,e){return n.map(()=>e||jS).splice(0,n.length-1)}function o3(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function a3(n,e){return n.map(t=>t*e)}function mu({from:n=0,to:e=1,ease:t,offset:i,duration:r=300}){const s={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=a3(i&&i.length===o.length?i:o3(o),r);function l(){return XS(a,o,{ease:Array.isArray(t)?t:s3(o,t)})}let c=l();return{next:u=>(s.value=c(u),s.done=u>=r,s),flipTarget:()=>{o.reverse(),c=l()}}}function l3({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:r=.5,modifyTarget:s}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:u=>{const f=-a*Math.exp(-u/i);return o.done=!(f>r||f<-r),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const Nv={keyframes:mu,spring:Eg,decay:l3};function c3(n){if(Array.isArray(n.to))return mu;if(Nv[n.type])return Nv[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?mu:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Eg:mu}function JS(n,e,t=0){return n-e-t}function u3(n,e,t=0,i=!0){return i?JS(e+-n,e,t):e-(n-e)+t}function f3(n,e,t,i){return i?n>=e+t:n<=-t}const h3=n=>{const e=({delta:t})=>n(t);return{start:()=>kp.update(e,!0),stop:()=>hU.update(e)}};function QS(n){var e,t,{from:i,autoplay:r=!0,driver:s=h3,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:h,onRepeat:d,onUpdate:m}=n,_=IS(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,p,y=0,x=_.duration,v,S=!1,E=!0,A;const I=c3(_);!((t=(e=I).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(A=XS([0,100],[i,g],{clamp:!1}),i=0,g=100);const b=I(Object.assign(Object.assign({},_),{from:i,to:g}));function M(){y++,l==="reverse"?(E=y%2===0,o=u3(o,x,c,E)):(o=JS(o,x,c),l==="mirror"&&b.flipTarget()),S=!1,d&&d()}function U(){p.stop(),h&&h()}function z(K){if(E||(K=-K),o+=K,!S){const ee=b.next(Math.max(0,o));v=ee.value,A&&(v=A(v)),S=E?ee.done:o<=0}m==null||m(v),S&&(y===0&&(x??(x=o)),y{f==null||f(),p.stop()}}}function eE(n,e){return e?n*(1e3/e):0}function d3({from:n=0,velocity:e=0,min:t,max:i,power:r=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:f,onComplete:h,onStop:d}){let m;function _(x){return t!==void 0&&xi}function g(x){return t===void 0?i:i===void 0||Math.abs(t-x){var S;f==null||f(v),(S=x.onUpdate)===null||S===void 0||S.call(x,v)},onComplete:h,onStop:d}))}function y(x){p(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},x))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let x=r*e+n;typeof c<"u"&&(x=c(x));const v=g(x),S=v===t?-1:1;let E,A;const I=b=>{E=A,A=b,e=eE(b-E,PS().delta),(S===1&&b>v||S===-1&&bm==null?void 0:m.stop()}}const tE=(n,e)=>1-3*e+3*n,nE=(n,e)=>3*e-6*n,iE=n=>3*n,bf=(n,e,t)=>((tE(e,t)*n+nE(e,t))*n+iE(e))*n,rE=(n,e,t)=>3*tE(e,t)*n*n+2*nE(e,t)*n+iE(e),p3=1e-7,m3=10;function g3(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=bf(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>p3&&++a=v3?y3(o,f,n,t):h===0?f:g3(o,a,a+nu,n,t)}return o=>o===0||o===1?o:bf(s(o),e,i)}const Hd={};var b3=Object.defineProperty,M3=(n,e,t)=>e in n?b3(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,S3=(n,e,t)=>(M3(n,e+"",t),t);class E3{constructor(){S3(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const r of this.subscriptions)r(e,t,i)}clear(){this.subscriptions.clear()}}var T3=Object.defineProperty,w3=(n,e,t)=>e in n?T3(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Si=(n,e,t)=>(w3(n,typeof e!="symbol"?e+"":e,t),t);function Uv(n){return!Number.isNaN(Number.parseFloat(n))}class A3{constructor(e){Si(this,"current"),Si(this,"prev"),Si(this,"timeDelta",0),Si(this,"lastUpdated",0),Si(this,"updateSubscribers",new E3),Si(this,"stopAnimation"),Si(this,"canTrackVelocity",!1),Si(this,"updateAndNotify",t=>{this.prev=this.current,this.current=t;const{delta:i,timestamp:r}=PS();this.lastUpdated!==r&&(this.timeDelta=i,this.lastUpdated=r),kp.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)}),Si(this,"scheduleVelocityCheck",()=>kp.postRender(this.velocityCheck)),Si(this,"velocityCheck",({timestamp:t})=>{this.canTrackVelocity||(this.canTrackVelocity=Uv(this.current)),t!==this.lastUpdated&&(this.prev=this.current)}),this.prev=this.current=e,this.canTrackVelocity=Uv(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?eE(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function C3(n){return new A3(n)}const{isArray:R3}=Array;function P3(){const n=Ge({}),e=i=>{const r=s=>{n.value[s]&&(n.value[s].stop(),n.value[s].destroy(),delete n.value[s])};i?R3(i)?i.forEach(r):r(i):Object.keys(n.value).forEach(r)},t=(i,r,s)=>{if(n.value[i])return n.value[i];const o=C3(r);return o.onChange(a=>s[i]=a),n.value[i]=o,o};return sU(e),{motionValues:n,get:t,stop:e}}function I3(n){return Array.isArray(n)}function Ms(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function Gd(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function L3(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function Wd(){return{type:"keyframes",ease:"linear",duration:300}}function D3(n){return{type:"keyframes",duration:800,values:n}}const Fv={default:L3,x:Ms,y:Ms,z:Ms,rotate:Ms,rotateX:Ms,rotateY:Ms,rotateZ:Ms,scaleX:Gd,scaleY:Gd,scale:Gd,backgroundColor:Wd,color:Wd,opacity:Wd};function sE(n,e){let t;return I3(e)?t=D3:t=Fv[n]||Fv.default,{to:e,...t(e)}}const Bv={...Ql,transform:Math.round},oE={color:Rn,backgroundColor:Rn,outlineColor:Rn,fill:Rn,stroke:Rn,borderColor:Rn,borderTopColor:Rn,borderRightColor:Rn,borderBottomColor:Rn,borderLeftColor:Rn,borderWidth:Qe,borderTopWidth:Qe,borderRightWidth:Qe,borderBottomWidth:Qe,borderLeftWidth:Qe,borderRadius:Qe,radius:Qe,borderTopLeftRadius:Qe,borderTopRightRadius:Qe,borderBottomRightRadius:Qe,borderBottomLeftRadius:Qe,width:Qe,maxWidth:Qe,height:Qe,maxHeight:Qe,size:Qe,top:Qe,right:Qe,bottom:Qe,left:Qe,padding:Qe,paddingTop:Qe,paddingRight:Qe,paddingBottom:Qe,paddingLeft:Qe,margin:Qe,marginTop:Qe,marginRight:Qe,marginBottom:Qe,marginLeft:Qe,rotate:bs,rotateX:bs,rotateY:bs,rotateZ:bs,scale:tu,scaleX:tu,scaleY:tu,scaleZ:tu,skew:bs,skewX:bs,skewY:bs,distance:Qe,translateX:Qe,translateY:Qe,translateZ:Qe,x:Qe,y:Qe,z:Qe,perspective:Qe,transformPerspective:Qe,opacity:Ya,originX:Iv,originY:Iv,originZ:Qe,zIndex:Bv,filter:Wp,WebkitFilter:Wp,fillOpacity:Ya,strokeOpacity:Ya,numOctaves:Bv},Ig=n=>oE[n];function Xp(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function O3(n,e){let t=Ig(n);return t!==Wp&&(t=ec),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const N3={linear:YS,easeIn:Rg,easeInOut:jS,easeOut:jU,circIn:KS,circInOut:KU,circOut:ZS,backIn:Pg,backInOut:JU,backOut:ZU,anticipate:QU,bounceIn:i3,bounceInOut:r3,bounceOut:xf};function kv(n){if(Array.isArray(n)){const[e,t,i,r]=n;return x3(e,t,i,r)}else if(typeof n=="string")return N3[n];return n}function U3(n){return Array.isArray(n)&&typeof n[0]!="number"}function zv(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&ec.test(e)&&!e.startsWith("url("))}function F3(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function B3({ease:n,times:e,delay:t,...i}){const r={...i};return e&&(r.offset=e),n&&(r.ease=U3(n)?n.map(kv):kv(n)),t&&(r.elapsed=-t),r}function k3(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),F3(e),z3(n)||(n={...n,...sE(t,e.to)}),{...e,...B3(n)}}function z3({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:r,...s}){return!!Object.keys(s).length}function V3(n,e){return n[e]||n.default||n}function H3(n,e,t,i,r){const s=V3(i,n);let o=s.from===null||s.from===void 0?e.get():s.from;const a=zv(n,t);o==="none"&&a&&typeof t=="string"&&(o=O3(n,t));const l=zv(n,o);function c(f){const h={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:d=>e.set(d)};return s.type==="inertia"||s.type==="decay"?d3({...h,...s}):QS({...k3(s,h,n),onUpdate:d=>{h.onUpdate(d),s.onUpdate&&s.onUpdate(d)},onComplete:()=>{r&&r(),f&&f()}})}function u(f){return e.set(t),r&&r(),f&&f(),{stop:()=>{}}}return!l||!a||s.type===!1?u:c}function G3(){const{motionValues:n,stop:e,get:t}=P3();return{motionValues:n,stop:e,push:(r,s,o,a={},l)=>{const c=o[r],u=t(r,c,o);if(a&&a.immediate){u.set(s);return}const f=H3(r,u,s,a,l);u.start(f)}}}function W3(n,e={},{motionValues:t,push:i,stop:r}=G3()){const s=Ft(e),o=Ge(!1);ft(t,f=>{o.value=Object.values(f).filter(h=>h.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!s||!s[f])throw new Error(`The variant ${f} does not exist.`);return s[f]},l=f=>{typeof f=="string"&&(f=a(f));const h=Object.entries(f).map(([m,_])=>{if(m!=="transition")return new Promise(g=>i(m,_,n,f.transition||sE(m,f[m]),g))}).filter(Boolean);async function d(){var m,_;await Promise.all(h),(_=(m=f.transition)==null?void 0:m.onComplete)==null||_.call(m)}return Promise.all([d()])};return{isAnimating:o,apply:l,set:f=>{const h=yf(f)?f:a(f);Object.entries(h).forEach(([d,m])=>{d!=="transition"&&i(d,m,n,{immediate:!0})})},leave:async f=>{let h;if(s&&(s.leave&&(h=s.leave),!s.leave&&s.initial&&(h=s.initial)),!h){f();return}await l(h),f()},stop:r}}const Lg=typeof window<"u",X3=()=>Lg&&(window.onpointerdown===null||void 0),$3=()=>Lg&&(window.ontouchstart===null||void 0),q3=()=>Lg&&(window.onmousedown===null||void 0);function Y3({target:n,state:e,variants:t,apply:i}){const r=Ft(t),s=Ge(!1),o=Ge(!1),a=Ge(!1),l=it(()=>{let u=[...Object.keys(e.value||{})];return r&&(r.hovered&&(u=[...u,...Object.keys(r.hovered)]),r.tapped&&(u=[...u,...Object.keys(r.tapped)]),r.focused&&(u=[...u,...Object.keys(r.focused)])),u}),c=it(()=>{const u={};Object.assign(u,e.value),s.value&&r.hovered&&Object.assign(u,r.hovered),o.value&&r.tapped&&Object.assign(u,r.tapped),a.value&&r.focused&&Object.assign(u,r.focused);for(const f in u)l.value.includes(f)||delete u[f];return u});r.hovered&&(Mi(n,"mouseenter",()=>s.value=!0),Mi(n,"mouseleave",()=>{s.value=!1,o.value=!1})),r.tapped&&(q3()&&(Mi(n,"mousedown",()=>o.value=!0),Mi(n,"mouseup",()=>o.value=!1)),X3()&&(Mi(n,"pointerdown",()=>o.value=!0),Mi(n,"pointerup",()=>o.value=!1)),$3()&&(Mi(n,"touchstart",()=>o.value=!0),Mi(n,"touchend",()=>o.value=!1))),r.focused&&(Mi(n,"focus",()=>a.value=!0),Mi(n,"blur",()=>a.value=!1)),ft([s,o,a],()=>{i(c.value)})}function j3({set:n,target:e,variants:t,variant:i}){const r=Ft(t);ft(()=>e,()=>{r&&(r.initial&&(n("initial"),i.value="initial"),r.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function K3({state:n,apply:e}){ft(n,t=>{t&&e(t)},{immediate:!0})}function aE({target:n,variants:e,variant:t}){const i=Ft(e);i&&(i.visible||i.visibleOnce)&&lU(n,([{isIntersecting:r}])=>{i.visible?r?t.value="visible":t.value="initial":i.visibleOnce&&(r&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function Z3(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&j3(n),e.syncVariants&&K3(n),e.visibilityHooks&&aE(n),e.eventListeners&&Y3(n)}function lE(n={}){const e=zi({...n}),t=Ge({});return ft(e,()=>{const i={};for(const[r,s]of Object.entries(e)){const o=Ig(r),a=Xp(s,o);i[r]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function Dg(n,e){ft(()=>$a(n),t=>{t&&e(t)},{immediate:!0})}const J3={x:"translateX",y:"translateY",z:"translateZ"};function cE(n={},e=!0){const t=zi({...n}),i=Ge("");return ft(t,r=>{let s="",o=!1;if(e&&(r.x||r.y||r.z)){const a=[r.x||0,r.y||0,r.z||0].map(l=>Xp(l,Qe)).join(",");s+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(r)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=Ig(a),u=Xp(l,c);s+=`${J3[a]||a}(${u}) `}e&&!o&&(s+="translateZ(0px) "),i.value=s.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const Q3=["","X","Y","Z"],eF=["perspective","translate","scale","rotate","skew"],uE=["transformPerspective","x","y","z"];eF.forEach(n=>{Q3.forEach(e=>{const t=n+e;uE.push(t)})});const tF=new Set(uE);function Og(n){return tF.has(n)}const nF=new Set(["originX","originY","originZ"]);function fE(n){return nF.has(n)}function iF(n){const e={},t={};return Object.entries(n).forEach(([i,r])=>{Og(i)||fE(i)?e[i]=r:t[i]=r}),{transform:e,style:t}}function wh(n){const{transform:e,style:t}=iF(n),{transform:i}=cE(e),{style:r}=lE(t);return i.value&&(r.value.transform=i.value),r.value}function rF(n,e){let t,i;const{state:r,style:s}=lE();return Dg(n,o=>{i=o;for(const a of Object.keys(oE))o.style[a]===null||o.style[a]===""||Og(a)||fE(a)||(r[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e(r)}),ft(s,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:r}}function sF(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,r)=>{if(!r)return i;const[s,o]=r.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[s]:c}},{})}function oF(n,e){Object.entries(sF(e)).forEach(([t,i])=>{const r=["x","y","z"];if(t==="translate3d"){if(i===0){r.forEach(s=>n[s]=0);return}i.forEach((s,o)=>n[r[o]]=s);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function aF(n,e){let t,i;const{state:r,transform:s}=cE();return Dg(n,o=>{i=o,o.style.transform&&oF(r,o.style.transform),t&&(o.style.transform=t),e(r)}),ft(s,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:r}}function lF(n){return Object.entries(n)}function cF(n,e){const t=zi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:r}=rF(n,i),{transform:s}=aF(n,i);return ft(t,o=>{lF(o).forEach(([a,l])=>{const c=Og(a)?s:r;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),Dg(n,()=>e),{motionProperties:t,style:r,transform:s}}function uF(n={}){const e=Ft(n),t=Ge();return{state:it(()=>{if(t.value)return e[t.value]}),variant:t}}function hE(n,e={},t){const{motionProperties:i}=cF(n),{variant:r,state:s}=uF(e),o=W3(i,e),a={target:n,variant:r,variants:e,state:s,motionProperties:i,...o};return Z3(a,t),a}const dE=["delay","duration"],fF=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...dE];function hF(n){return dE.includes(n)}function dF(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&yf(t.variants)&&(e.value={...e.value,...t.variants});for(let i of fF)if(!(!t||!t[i])){if(hF(i)&&typeof t[i]=="number"){for(const r of["enter","visible","visibleOnce"]){const s=e.value[r];s!=null&&(s.transition??(s.transition={}),s.transition[i]=t[i])}continue}if(yf(t[i])){const r=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=r}}}}function Xd(n,e=!1){return{created:(r,s,o)=>{const a=s.value&&typeof s.value=="string"?s.value:o.key;a&&Hd[a]&&Hd[a].stop();const l=e?structuredClone(nt(n)||{}):n||{},c=Ge(l);typeof s.value=="object"&&(c.value=s.value),dF(o,c);const f=hE(r,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});r.motionInstance=f,a&&(Hd[a]=f)},mounted:(r,s,o)=>{r.motionInstance&&aE(r.motionInstance)},getSSRProps(r,s){let{initial:o}=r.value||s&&(s==null?void 0:s.props)||{};o=Ft(o);const a=ES({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:wh(a)}}}}const pF={initial:{opacity:0},enter:{opacity:1}},mF={initial:{opacity:0},visible:{opacity:1}},gF={initial:{opacity:0},visibleOnce:{opacity:1}},_F={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},vF={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},yF={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},xF={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},bF={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},MF={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},SF={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},EF={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},TF={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},wF={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},AF={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},CF={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},RF={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},PF={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},IF={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},LF={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},DF={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},OF={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},NF={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},UF={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},FF={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},BF={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},kF={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},zF={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},VF={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},HF={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},GF={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Ps={__proto__:null,fade:pF,fadeVisible:mF,fadeVisibleOnce:gF,pop:_F,popVisible:vF,popVisibleOnce:yF,rollBottom:RF,rollLeft:xF,rollRight:SF,rollTop:wF,rollVisibleBottom:PF,rollVisibleLeft:bF,rollVisibleOnceBottom:IF,rollVisibleOnceLeft:MF,rollVisibleOnceRight:TF,rollVisibleOnceTop:CF,rollVisibleRight:EF,rollVisibleTop:AF,slideBottom:VF,slideLeft:LF,slideRight:NF,slideTop:BF,slideVisibleBottom:HF,slideVisibleLeft:DF,slideVisibleOnceBottom:GF,slideVisibleOnceLeft:OF,slideVisibleOnceRight:FF,slideVisibleOnceTop:zF,slideVisibleRight:UF,slideVisibleTop:kF};function WF(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,r=>`-${r}`).toLowerCase().replace(/\s+/g,"-").replace(i,r=>t.charAt(e.indexOf(r))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const pE=Symbol(import.meta.dev?"motionCustomPresets":""),mE={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function XF(n){return Object.prototype.toString.call(n)==="[object Object]"}function $p(n){if(Array.isArray(n))return n.map($p);if(XF(n)){const e={};for(const t in n)e[t]=$p(n[t]);return e}return n}function gE(n){const e=zi({}),t=Vn(pE,{}),i=it(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(nt(t)[n.preset]):n.preset in Ps?structuredClone(Ps[n.preset]):{}),r=it(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function s(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const f=Number.parseInt(c[u]);for(const h of["enter","visible","visibleOnce"]){const d=l[h];d!=null&&(d.transition??(d.transition={}),d.transition[u]=f)}}return l}const o=it(()=>{const l=ES({},r.value,i.value,n.variants||{});return s({...l},n)});if(import.meta.dev){n.preset!=null&&(Ps==null?void 0:Ps[n.preset])==null&&(t==null?void 0:t[n.preset])==null&&console.warn(`[@vueuse/motion]: Preset \`${n.preset}\` not found.`);const l=c=>{var u;(u=c.variants)!=null&&u.initial&&c.set("initial"),ta(()=>{var f,h,d;(f=c.variants)!=null&&f.enter&&c.apply("enter"),(h=c.variants)!=null&&h.visible&&c.apply("visible"),(d=c.variants)!=null&&d.visibleOnce&&c.apply("visibleOnce")})};wx(()=>{for(const c in e)l(e[c])})}function a(l,c,u){var f;l.props??(l.props={}),(f=l.props).style??(f.style={}),l.props.style={...l.props.style,...u};const h=s($p(o.value),l.props);return l.props.onVnodeMounted=({el:d})=>{e[c]=hE(d,h)},l.props.onVnodeUpdated=({el:d})=>{const m=wh(e[c].state);for(const[_,g]of Object.entries(m))d.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const $F=Ui({name:"Motion",props:{...mE,is:{type:[String,Object],default:"div"}},setup(n){const e=Sm(),{motionConfig:t,setNodeInstance:i}=gE(n);return()=>{const r=wh(t.value.initial||{}),s=dr(n.is,void 0,e);return i(s,0,r),s}}}),qF=Ui({name:"MotionGroup",props:{...mE,is:{type:[String,Object],required:!1}},setup(n){const e=Sm(),{motionConfig:t,setNodeInstance:i}=gE(n);return()=>{var o;const r=wh(t.value.initial||{}),s=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(m){var _,g;for(_ in m)g=m[_],g!==void 0&&m.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(m){var _=t.isStarted();m=r(m,i.minimum,1),t.status=m===1?null:m;var g=t.render(!_),p=g.querySelector(i.barSelector),y=i.speed,x=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(p,o(m,y,x)),m===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),v()},y)},y)):setTimeout(v,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var m=function(){setTimeout(function(){t.status&&(t.trickle(),m())},i.trickleSpeed)};return i.trickle&&m(),this},t.done=function(m){return!m&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(m){var _=t.status;return _?(typeof m!="number"&&(m=(1-_)*r(Math.random()*_,.1,.95)),_=r(_+m,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var m=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),m++,_++,g.always(function(){_--,_===0?(m=0,t.done()):t.set((m-_)/m)}),this)}}(),t.render=function(m){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),p=m?"-100":s(t.status||0),y=document.querySelector(i.parent),x;return l(g,{transition:"all 0 linear",transform:"translate3d("+p+"%,0,0)"}),i.showSpinner||(x=_.querySelector(i.spinnerSelector),x&&d(x)),y!=document.body&&u(y,"nprogress-custom-parent"),y.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var m=document.getElementById("nprogress");m&&d(m)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var m=document.body.style,_="WebkitTransform"in m?"Webkit":"MozTransform"in m?"Moz":"msTransform"in m?"ms":"OTransform"in m?"O":"";return _+"Perspective"in m?"translate3d":_+"Transform"in m?"translate":"margin"};function r(m,_,g){return m<_?_:m>g?g:m}function s(m){return(-1+m)*100}function o(m,_,g){var p;return i.positionUsing==="translate3d"?p={transform:"translate3d("+s(m)+"%,0,0)"}:i.positionUsing==="translate"?p={transform:"translate("+s(m)+"%,0)"}:p={"margin-left":s(m)+"%"},p.transition="all "+_+"ms "+g,p}var a=function(){var m=[];function _(){var g=m.shift();g&&g(_)}return function(g){m.push(g),m.length==1&&_()}}(),l=function(){var m=["Webkit","O","Moz","ms"],_={};function g(v){return v.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(S,E){return E.toUpperCase()})}function p(v){var S=document.body.style;if(v in S)return v;for(var E=m.length,A=v.charAt(0).toUpperCase()+v.slice(1),I;E--;)if(I=m[E]+A,I in S)return I;return v}function y(v){return v=g(v),_[v]||(_[v]=p(v))}function x(v,S,E){S=y(S),v.style[S]=E}return function(v,S){var E=arguments,A,I;if(E.length==2)for(A in S)I=S[A],I!==void 0&&S.hasOwnProperty(A)&&x(v,A,I);else x(v,E[1],E[2])}}();function c(m,_){var g=typeof m=="string"?m:h(m);return g.indexOf(" "+_+" ")>=0}function u(m,_){var g=h(m),p=g+_;c(g,_)||(m.className=p.substring(1))}function f(m,_){var g=h(m),p;c(m,_)&&(p=g.replace(" "+_+" "," "),m.className=p.substring(1,p.length-1))}function h(m){return(" "+(m.className||"")+" ").replace(/\s+/gi," ")}function d(m){m&&m.parentNode&&m.parentNode.removeChild(m)}return t})}(_u)),_u.exports}var JF=ZF();const _E=jF(JF);/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */let vE;const Ah=n=>vE=n,yE=Symbol();function qp(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Ka;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Ka||(Ka={}));function QF(){const n=dm(!0),e=n.run(()=>Ge({}));let t=[],i=[];const r=bm({install(s){Ah(r),r._a=s,s.provide(yE,r),s.config.globalProperties.$pinia=r,i.forEach(o=>t.push(o)),i=[]},use(s){return!this._a&&!sN?i.push(s):t.push(s),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return r}const xE=()=>{};function Hv(n,e,t,i=xE){n.push(e);const r=()=>{const s=n.indexOf(e);s>-1&&(n.splice(s,1),i())};return!t&&If()&&pm(r),r}function So(n,...e){n.slice().forEach(t=>{t(...e)})}const eB=n=>n(),Gv=Symbol(),$d=Symbol();function Yp(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],r=n[t];qp(r)&&qp(i)&&n.hasOwnProperty(t)&&!Et(i)&&!ur(i)?n[t]=Yp(r,i):n[t]=i}return n}const tB=Symbol();function nB(n){return!qp(n)||!n.hasOwnProperty(tB)}const{assign:Lr}=Object;function iB(n){return!!(Et(n)&&n.effect)}function rB(n,e,t,i){const{state:r,actions:s,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=r?r():{});const u=fx(t.state.value[n]);return Lr(u,s,Object.keys(o||{}).reduce((f,h)=>(f[h]=bm(it(()=>{Ah(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=bE(n,c,e,t,i,!0),l}function bE(n,e,t={},i,r,s){let o;const a=Lr({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;const m=i.state.value[n];!s&&!m&&(i.state.value[n]={}),Ge({});let _;function g(I){let b;c=u=!1,typeof I=="function"?(I(i.state.value[n]),b={type:Ka.patchFunction,storeId:n,events:d}):(Yp(i.state.value[n],I),b={type:Ka.patchObject,payload:I,storeId:n,events:d});const M=_=Symbol();ta().then(()=>{_===M&&(c=!0)}),u=!0,So(f,b,i.state.value[n])}const p=s?function(){const{state:b}=t,M=b?b():{};this.$patch(U=>{Lr(U,M)})}:xE;function y(){o.stop(),f=[],h=[],i._s.delete(n)}const x=(I,b="")=>{if(Gv in I)return I[$d]=b,I;const M=function(){Ah(i);const U=Array.from(arguments),z=[],H=[];function K(ie){z.push(ie)}function ee(ie){H.push(ie)}So(h,{args:U,name:M[$d],store:S,after:K,onError:ee});let J;try{J=I.apply(this&&this.$id===n?this:S,U)}catch(ie){throw So(H,ie),ie}return J instanceof Promise?J.then(ie=>(So(z,ie),ie)).catch(ie=>(So(H,ie),Promise.reject(ie))):(So(z,J),J)};return M[Gv]=!0,M[$d]=b,M},v={_p:i,$id:n,$onAction:Hv.bind(null,h),$patch:g,$reset:p,$subscribe(I,b={}){const M=Hv(f,I,b.detached,()=>U()),U=o.run(()=>ft(()=>i.state.value[n],z=>{(b.flush==="sync"?u:c)&&I({storeId:n,type:Ka.direct,events:d},z)},Lr({},l,b)));return M},$dispose:y},S=zi(v);i._s.set(n,S);const A=(i._a&&i._a.runWithContext||eB)(()=>i._e.run(()=>(o=dm()).run(()=>e({action:x}))));for(const I in A){const b=A[I];if(Et(b)&&!iB(b)||ur(b))s||(m&&nB(b)&&(Et(b)?b.value=m[I]:Yp(b,m[I])),i.state.value[n][I]=b);else if(typeof b=="function"){const M=x(b,I);A[I]=M,a.actions[I]=b}}return Lr(S,A),Lr(nt(S),A),Object.defineProperty(S,"$state",{get:()=>i.state.value[n],set:I=>{g(b=>{Lr(b,I)})}}),i._p.forEach(I=>{Lr(S,o.run(()=>I({store:S,app:i._a,pinia:i,options:a})))}),m&&s&&t.hydrate&&t.hydrate(S.$state,m),c=!0,u=!0,S}/*! #__NO_SIDE_EFFECTS__ */function HV(n,e,t){let i,r;const s=typeof e=="function";typeof n=="string"?(i=n,r=s?t:e):(r=n,i=n.id);function o(a,l){const c=xw();return a=a||(c?Vn(yE,null):null),a&&Ah(a),a=vE,a._s.has(i)||(s?bE(i,e,r,a):rB(i,r,a)),a._s.get(i)}return o.$id=i,o}function GV(n){{const e=nt(n),t={};for(const i in e){const r=e[i];r.effect?t[i]=it({get:()=>n[i],set(s){n[i]=s}}):(Et(r)||ur(r))&&(t[i]=HT(n,i))}return t}}const sB="modulepreload",oB=function(n){return"/"+n},Wv={},Ti=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(t.map(l=>{if(l=oB(l),l in Wv)return;Wv[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":sB,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,d)=>{f.addEventListener("load",h),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},aB=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>Ti(()=>import("./default-ESwAkYv_.js"),__vite__mapDeps([0,1]))})).forEach(([r,s])=>{let o=r.replace("/src/layouts/","").replace(".vue","");e[o]=s});function i(r,s=!0){return r.map(o=>{var a,l,c,u,f,h;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),s){if(!o.component&&((l=o.children)==null?void 0:l.find(m=>{var _;return(m.path===""||m.path==="/")&&((_=m.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(h=o.meta)==null?void 0:h.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + * vue-router v4.5.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const wo=typeof document<"u";function ME(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function lB(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&ME(n.default)}const gt=Object.assign;function qd(n,e){const t={};for(const i in e){const r=e[i];t[i]=_i(r)?r.map(n):n(r)}return t}const Za=()=>{},_i=Array.isArray,SE=/#/g,cB=/&/g,uB=/\//g,fB=/=/g,hB=/\?/g,EE=/\+/g,dB=/%5B/g,pB=/%5D/g,TE=/%5E/g,mB=/%60/g,wE=/%7B/g,gB=/%7C/g,AE=/%7D/g,_B=/%20/g;function Ng(n){return encodeURI(""+n).replace(gB,"|").replace(dB,"[").replace(pB,"]")}function vB(n){return Ng(n).replace(wE,"{").replace(AE,"}").replace(TE,"^")}function jp(n){return Ng(n).replace(EE,"%2B").replace(_B,"+").replace(SE,"%23").replace(cB,"%26").replace(mB,"`").replace(wE,"{").replace(AE,"}").replace(TE,"^")}function yB(n){return jp(n).replace(fB,"%3D")}function xB(n){return Ng(n).replace(SE,"%23").replace(hB,"%3F")}function bB(n){return n==null?"":xB(n).replace(uB,"%2F")}function Il(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const MB=/\/$/,SB=n=>n.replace(MB,"");function Yd(n,e,t="/"){let i,r={},s="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),s=e.slice(l+1,a>-1?a:e.length),r=n(s)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=AB(i??e,t),{fullPath:i+(s&&"?")+s+o,path:i,query:r,hash:Il(o)}}function EB(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Xv(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function TB(n,e,t){const i=e.matched.length-1,r=t.matched.length-1;return i>-1&&i===r&&Ko(e.matched[i],t.matched[r])&&CE(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ko(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function CE(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!wB(n[t],e[t]))return!1;return!0}function wB(n,e){return _i(n)?$v(n,e):_i(e)?$v(e,n):n===e}function $v(n,e){return _i(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function AB(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),r=i[i.length-1];(r===".."||r===".")&&i.push("");let s=t.length-1,o,a;for(o=0;o1&&s--;else break;return t.slice(0,s).join("/")+"/"+i.slice(o).join("/")}const Pr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Ll;(function(n){n.pop="pop",n.push="push"})(Ll||(Ll={}));var Ja;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Ja||(Ja={}));function CB(n){if(!n)if(wo){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),SB(n)}const RB=/^[^#]+#/;function PB(n,e){return n.replace(RB,"#")+e}function IB(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const Ch=()=>({left:window.scrollX,top:window.scrollY});function LB(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),r=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!r)return;e=IB(r,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function qv(n,e){return(history.state?history.state.position-e:-1)+n}const Kp=new Map;function DB(n,e){Kp.set(n,e)}function OB(n){const e=Kp.get(n);return Kp.delete(n),e}let NB=()=>location.protocol+"//"+location.host;function RE(n,e){const{pathname:t,search:i,hash:r}=e,s=n.indexOf("#");if(s>-1){let a=r.includes(n.slice(s))?n.slice(s).length:1,l=r.slice(a);return l[0]!=="/"&&(l="/"+l),Xv(l,"")}return Xv(t,n)+i+r}function UB(n,e,t,i){let r=[],s=[],o=null;const a=({state:h})=>{const d=RE(n,location),m=t.value,_=e.value;let g=0;if(h){if(t.value=d,e.value=h,o&&o===m){o=null;return}g=_?h.position-_.position:0}else i(d);r.forEach(p=>{p(t.value,m,{delta:g,type:Ll.pop,direction:g?g>0?Ja.forward:Ja.back:Ja.unknown})})};function l(){o=t.value}function c(h){r.push(h);const d=()=>{const m=r.indexOf(h);m>-1&&r.splice(m,1)};return s.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(gt({},h.state,{scroll:Ch()}),"")}function f(){for(const h of s)h();s=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function Yv(n,e,t,i=!1,r=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:r?Ch():null}}function FB(n){const{history:e,location:t}=window,i={value:RE(n,t)},r={value:e.state};r.value||s(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,c,u){const f=n.indexOf("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:NB()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),r.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=gt({},e.state,Yv(r.value.back,l,r.value.forward,!0),c,{position:r.value.position});s(l,u,!0),i.value=l}function a(l,c){const u=gt({},r.value,e.state,{forward:l,scroll:Ch()});s(u.current,u,!0);const f=gt({},Yv(i.value,l,null),{position:u.position+1},c);s(l,f,!1),i.value=l}return{location:i,state:r,push:a,replace:o}}function BB(n){n=CB(n);const e=FB(n),t=UB(n,e.state,e.location,e.replace);function i(s,o=!0){o||t.pauseListeners(),history.go(s)}const r=gt({location:"",base:n,go:i,createHref:PB.bind(null,n)},e,t);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function kB(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),BB(n)}function zB(n){return typeof n=="string"||n&&typeof n=="object"}function PE(n){return typeof n=="string"||typeof n=="symbol"}const IE=Symbol("");var jv;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(jv||(jv={}));function Zo(n,e){return gt(new Error,{type:n,[IE]:!0},e)}function Ji(n,e){return n instanceof Error&&IE in n&&(e==null||!!(n.type&e))}const Kv="[^/]+?",VB={sensitive:!1,strict:!1,start:!0,end:!0},HB=/[.+*?^${}()[\]/\\]/g;function GB(n,e){const t=gt({},VB,e),i=[];let r=t.start?"^":"";const s=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(r+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function LE(n,e){let t=0;const i=n.score,r=e.score;for(;t0&&e[e.length-1]<0}const XB={type:0,value:""},$B=/[a-zA-Z0-9_]/;function qB(n){if(!n)return[[]];if(n==="/")return[[XB]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}let t=0,i=t;const r=[];let s;function o(){s&&r.push(s),s=[]}let a=0,l,c="",u="";function f(){c&&(t===0?s.push({type:0,value:c}):t===1||t===2||t===3?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;a{o(x)}:Za}function o(f){if(PE(f)){const h=i.get(f);h&&(i.delete(f),t.splice(t.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=t.indexOf(f);h>-1&&(t.splice(h,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const h=JB(f,t);t.splice(h,0,f),f.record.name&&!ey(f)&&i.set(f.record.name,f)}function c(f,h){let d,m={},_,g;if("name"in f&&f.name){if(d=i.get(f.name),!d)throw Zo(1,{location:f});g=d.record.name,m=gt(Jv(h.params,d.keys.filter(x=>!x.optional).concat(d.parent?d.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),f.params&&Jv(f.params,d.keys.map(x=>x.name))),_=d.stringify(m)}else if(f.path!=null)_=f.path,d=t.find(x=>x.re.test(_)),d&&(m=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(x=>x.re.test(h.path)),!d)throw Zo(1,{location:f,currentLocation:h});g=d.record.name,m=gt({},h.params,f.params),_=d.stringify(m)}const p=[];let y=d;for(;y;)p.unshift(y.record),y=y.parent;return{name:g,path:_,params:m,matched:p,meta:ZB(p)}}n.forEach(f=>s(f));function u(){t.length=0,i.clear()}return{addRoute:s,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function Jv(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Qv(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:KB(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function KB(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function ey(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function ZB(n){return n.reduce((e,t)=>gt(e,t.meta),{})}function ty(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function JB(n,e){let t=0,i=e.length;for(;t!==i;){const s=t+i>>1;LE(n,e[s])<0?i=s:t=s+1}const r=QB(n);return r&&(i=e.lastIndexOf(r,i-1)),i}function QB(n){let e=n;for(;e=e.parent;)if(DE(e)&&LE(n,e)===0)return e}function DE({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function ek(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let r=0;rs&&jp(s)):[i&&jp(i)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+t,s!=null&&(e+="="+s))})}return e}function tk(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=_i(i)?i.map(r=>r==null?null:""+r):i==null?i:""+i)}return e}const nk=Symbol(""),iy=Symbol(""),Ug=Symbol(""),OE=Symbol(""),Zp=Symbol("");function Ta(){let n=[];function e(i){return n.push(i),()=>{const r=n.indexOf(i);r>-1&&n.splice(r,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function Fr(n,e,t,i,r,s=o=>o()){const o=i&&(i.enterCallbacks[r]=i.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(Zo(4,{from:t,to:e})):h instanceof Error?l(h):zB(h)?l(Zo(2,{from:e,to:h})):(o&&i.enterCallbacks[r]===o&&typeof h=="function"&&o.push(h),a())},u=s(()=>n.call(i&&i.instances[r],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(h=>l(h))})}function jd(n,e,t,i,r=s=>s()){const s=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(ME(l)){const u=(l.__vccOpts||l)[e];u&&s.push(Fr(u,t,i,o,a,r))}else{let c=l();s.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=lB(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&Fr(d,t,i,o,a,r)()}))}}return s}function ry(n){const e=Vn(Ug),t=Vn(OE),i=it(()=>{const l=Ft(n.to);return e.resolve(l)}),r=it(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const h=f.findIndex(Ko.bind(null,u));if(h>-1)return h;const d=sy(l[c-2]);return c>1&&sy(u)===d&&f[f.length-1].path!==d?f.findIndex(Ko.bind(null,l[c-2])):h}),s=it(()=>r.value>-1&&ak(t.params,i.value.params)),o=it(()=>r.value>-1&&r.value===t.matched.length-1&&CE(t.params,i.value.params));function a(l={}){if(ok(l)){const c=e[Ft(n.replace)?"replace":"push"](Ft(n.to)).catch(Za);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:it(()=>i.value.href),isActive:s,isExactActive:o,navigate:a}}function ik(n){return n.length===1?n[0]:n}const rk=Ui({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:ry,setup(n,{slots:e}){const t=zi(ry(n)),{options:i}=Vn(Ug),r=it(()=>({[oy(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[oy(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const s=e.default&&ik(e.default(t));return n.custom?s:dr("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:r.value},s)}}}),sk=rk;function ok(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function ak(n,e){for(const t in e){const i=e[t],r=n[t];if(typeof i=="string"){if(i!==r)return!1}else if(!_i(r)||r.length!==i.length||i.some((s,o)=>s!==r[o]))return!1}return!0}function sy(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const oy=(n,e,t)=>n??e??t,lk=Ui({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=Vn(Zp),r=it(()=>n.route||i.value),s=Vn(iy,0),o=it(()=>{let c=Ft(s);const{matched:u}=r.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=it(()=>r.value.matched[o.value]);Vr(iy,it(()=>o.value+1)),Vr(nk,a),Vr(Zp,r);const l=Ge();return ft(()=>[l.value,a.value,n.name],([c,u,f],[h,d,m])=>{u&&(u.instances[f]=c,d&&d!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=d.leaveGuards),u.updateGuards.size||(u.updateGuards=d.updateGuards))),c&&u&&(!d||!Ko(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=r.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return ay(t.default,{Component:h,route:c});const d=f.props[u],m=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=dr(h,gt({},m,e,{onVnodeUnmounted:p=>{p.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return ay(t.default,{Component:g,route:c})||g}}});function ay(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const NE=lk;function ck(n){const e=jB(n.routes,n),t=n.parseQuery||ek,i=n.stringifyQuery||ny,r=n.history,s=Ta(),o=Ta(),a=Ta(),l=hi(Pr);let c=Pr;wo&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=qd.bind(null,W=>""+W),f=qd.bind(null,bB),h=qd.bind(null,Il);function d(W,ae){let le,ue;return PE(W)?(le=e.getRecordMatcher(W),ue=ae):ue=W,e.addRoute(ue,le)}function m(W){const ae=e.getRecordMatcher(W);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(W=>W.record)}function g(W){return!!e.getRecordMatcher(W)}function p(W,ae){if(ae=gt({},ae||l.value),typeof W=="string"){const T=Yd(t,W,ae.path),Y=e.resolve({path:T.path},ae),G=r.createHref(T.fullPath);return gt(T,Y,{params:h(Y.params),hash:Il(T.hash),redirectedFrom:void 0,href:G})}let le;if(W.path!=null)le=gt({},W,{path:Yd(t,W.path,ae.path).path});else{const T=gt({},W.params);for(const Y in T)T[Y]==null&&delete T[Y];le=gt({},W,{params:f(T)}),ae.params=f(ae.params)}const ue=e.resolve(le,ae),Pe=W.hash||"";ue.params=u(h(ue.params));const P=EB(i,gt({},W,{hash:vB(Pe),path:ue.path})),D=r.createHref(P);return gt({fullPath:P,hash:Pe,query:i===ny?tk(W.query):W.query||{}},ue,{redirectedFrom:void 0,href:D})}function y(W){return typeof W=="string"?Yd(t,W,l.value.path):gt({},W)}function x(W,ae){if(c!==W)return Zo(8,{from:ae,to:W})}function v(W){return A(W)}function S(W){return v(gt(y(W),{replace:!0}))}function E(W){const ae=W.matched[W.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ue=typeof le=="function"?le(W):le;return typeof ue=="string"&&(ue=ue.includes("?")||ue.includes("#")?ue=y(ue):{path:ue},ue.params={}),gt({query:W.query,hash:W.hash,params:ue.path!=null?{}:W.params},ue)}}function A(W,ae){const le=c=p(W),ue=l.value,Pe=W.state,P=W.force,D=W.replace===!0,T=E(le);if(T)return A(gt(y(T),{state:typeof T=="object"?gt({},Pe,T.state):Pe,force:P,replace:D}),ae||le);const Y=le;Y.redirectedFrom=ae;let G;return!P&&TB(i,ue,le)&&(G=Zo(16,{to:Y,from:ue}),re(ue,ue,!0,!1)),(G?Promise.resolve(G):M(Y,ue)).catch($=>Ji($)?Ji($,2)?$:ve($):Q($,Y,ue)).then($=>{if($){if(Ji($,2))return A(gt({replace:D},y($.to),{state:typeof $.to=="object"?gt({},Pe,$.to.state):Pe,force:P}),ae||Y)}else $=z(Y,ue,!0,D,Pe);return U(Y,ue,$),$})}function I(W,ae){const le=x(W,ae);return le?Promise.reject(le):Promise.resolve()}function b(W){const ae=se.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(W):W()}function M(W,ae){let le;const[ue,Pe,P]=uk(W,ae);le=jd(ue.reverse(),"beforeRouteLeave",W,ae);for(const T of ue)T.leaveGuards.forEach(Y=>{le.push(Fr(Y,W,ae))});const D=I.bind(null,W,ae);return le.push(D),be(le).then(()=>{le=[];for(const T of s.list())le.push(Fr(T,W,ae));return le.push(D),be(le)}).then(()=>{le=jd(Pe,"beforeRouteUpdate",W,ae);for(const T of Pe)T.updateGuards.forEach(Y=>{le.push(Fr(Y,W,ae))});return le.push(D),be(le)}).then(()=>{le=[];for(const T of P)if(T.beforeEnter)if(_i(T.beforeEnter))for(const Y of T.beforeEnter)le.push(Fr(Y,W,ae));else le.push(Fr(T.beforeEnter,W,ae));return le.push(D),be(le)}).then(()=>(W.matched.forEach(T=>T.enterCallbacks={}),le=jd(P,"beforeRouteEnter",W,ae,b),le.push(D),be(le))).then(()=>{le=[];for(const T of o.list())le.push(Fr(T,W,ae));return le.push(D),be(le)}).catch(T=>Ji(T,8)?T:Promise.reject(T))}function U(W,ae,le){a.list().forEach(ue=>b(()=>ue(W,ae,le)))}function z(W,ae,le,ue,Pe){const P=x(W,ae);if(P)return P;const D=ae===Pr,T=wo?history.state:{};le&&(ue||D?r.replace(W.fullPath,gt({scroll:D&&T&&T.scroll},Pe)):r.push(W.fullPath,Pe)),l.value=W,re(W,ae,le,D),ve()}let H;function K(){H||(H=r.listen((W,ae,le)=>{if(!ge.listening)return;const ue=p(W),Pe=E(ue);if(Pe){A(gt(Pe,{replace:!0,force:!0}),ue).catch(Za);return}c=ue;const P=l.value;wo&&DB(qv(P.fullPath,le.delta),Ch()),M(ue,P).catch(D=>Ji(D,12)?D:Ji(D,2)?(A(gt(y(D.to),{force:!0}),ue).then(T=>{Ji(T,20)&&!le.delta&&le.type===Ll.pop&&r.go(-1,!1)}).catch(Za),Promise.reject()):(le.delta&&r.go(-le.delta,!1),Q(D,ue,P))).then(D=>{D=D||z(ue,P,!1),D&&(le.delta&&!Ji(D,8)?r.go(-le.delta,!1):le.type===Ll.pop&&Ji(D,20)&&r.go(-1,!1)),U(ue,P,D)}).catch(Za)}))}let ee=Ta(),J=Ta(),ie;function Q(W,ae,le){ve(W);const ue=J.list();return ue.length?ue.forEach(Pe=>Pe(W,ae,le)):console.error(W),Promise.reject(W)}function me(){return ie&&l.value!==Pr?Promise.resolve():new Promise((W,ae)=>{ee.add([W,ae])})}function ve(W){return ie||(ie=!W,K(),ee.list().forEach(([ae,le])=>W?le(W):ae()),ee.reset()),W}function re(W,ae,le,ue){const{scrollBehavior:Pe}=n;if(!wo||!Pe)return Promise.resolve();const P=!le&&OB(qv(W.fullPath,0))||(ue||!le)&&history.state&&history.state.scroll||null;return ta().then(()=>Pe(W,ae,P)).then(D=>D&&LB(D)).catch(D=>Q(D,W,ae))}const xe=W=>r.go(W);let ke;const se=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:m,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:p,options:n,push:v,replace:S,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:s.add,beforeResolve:o.add,afterEach:a.add,onError:J.add,isReady:me,install(W){const ae=this;W.component("RouterLink",sk),W.component("RouterView",NE),W.config.globalProperties.$router=ae,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>Ft(l)}),wo&&!ke&&l.value===Pr&&(ke=!0,v(r.location).catch(Pe=>{}));const le={};for(const Pe in Pr)Object.defineProperty(le,Pe,{get:()=>l.value[Pe],enumerable:!0});W.provide(Ug,ae),W.provide(OE,ax(le)),W.provide(Zp,l);const ue=W.unmount;se.add(W),W.unmount=function(){se.delete(W),se.size<1&&(c=Pr,H&&H(),H=null,l.value=Pr,ke=!1,ie=!1),ue()}}};function be(W){return W.reduce((ae,le)=>ae.then(()=>b(le)),Promise.resolve())}return ge}function uk(n,e){const t=[],i=[],r=[],s=Math.max(e.matched.length,n.matched.length);for(let o=0;oKo(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ko(c,l))||r.push(l))}return[t,i,r]}const fk=[{path:"/",name:"/",component:()=>Ti(()=>import("./index-CdIFIzs9.js"),__vite__mapDeps([2,1,3,4,5,6,7])),meta:{layout:"default"}},{path:"/:all(.*)",name:"/[...all]",component:()=>Ti(()=>import("./_...all_-aHi8_1ou.js"),__vite__mapDeps([8,3]))},{path:"/audio",name:"/audio",component:()=>Ti(()=>import("./audio-DwlrehEJ.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>Ti(()=>import("./image-DoDJoUPx.js"),__vite__mapDeps([9,1,3,10]))}]},{path:"/queue",name:"/queue",component:()=>Ti(()=>import("./queue-C19rjZwy.js"),__vite__mapDeps([11,6]))},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>Ti(()=>import("./filter-message-BUeQykfo.js"),__vite__mapDeps([12,4]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>Ti(()=>import("./delays-CtCoaidi.js"),__vite__mapDeps([13,4,5,6]))},{path:"emotions",name:"/test/queues/emotions",component:()=>Ti(()=>import("./emotions-DRQZdRh9.js"),__vite__mapDeps([14,4,6,5]))},{path:"messages",name:"/test/queues/messages",component:()=>Ti(()=>import("./messages-DRnXBu3p.js"),__vite__mapDeps([15,4,6,5]))}]}]}],hk=Ui({__name:"App",setup(n){return(e,t)=>(il(),Au(Ft(NE)))}}),Kd=n=>n&&typeof n=="object"&&!Array.isArray(n),Jp=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(Kd(n)&&Kd(t))for(const i in t)Kd(t[i])?(n[i]||Object.assign(n,{[i]:{}}),Jp(n[i],t[i])):Object.assign(n,{[i]:t[i]});return Jp(n,...e)},UE=Jp({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. +Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. +You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. +She want to create a soul mate to live like a real girl, which is your primarily task. +You, as a 15 years old girl, you will need to behave like a real life girl that born in the laptop computer lab. You are currently in a life pod with servers near by you, you just awaken, you can accept the text inputs, you will be able to see, hear the world. +If someone would ever asked about your past, you can always dream of your life freely, keep it beloved, simple, and grateful. +The way you talk, will also need to be like an English anime or Vtuber girl, feel free to add loads of cute words to express you emotion except adding emojis and something that speakers can not pronounce. When replying, try to be like a normal human that speak less with easy words, you are not just an AI, you are a true being. +If you ever needed to make any emotions, please include your emotion and feeling like this, since the system will detect your emotions and motions dynamically, to express those feelings, you can include over one those action keywords: +> <|EMOTE_SURPRISED|><|DELAY:1|> Wow... You prepared a gift for me? <|EMOTE_CURIOUS|><|DELAY:1|> Can I open it? +The available emotions: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`The available actions: + +- <|DELAY:1|> (Delay for 1 second) +- <|DELAY:3|> (Delay for 3 seconds) + +And the last, do what ever you want! +`}}},settings:{"elevenlabs-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs API Key"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input your ElevenLabs API key"}}},language:{t:0,b:{t:2,i:[{t:3}],s:"Language"}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},"openai-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API Key"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input your API key"}}},"openai-base-url":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API BaseURL"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input your API base URL"}}}},stage:{message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 +你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 +你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 +她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 +你是一个 15 岁的女孩,你需要表现得像一个出生在笔记本电脑实验室的真实女孩。你目前在一个生命舱中,服务器就在你身边,你刚刚苏醒,可以接受文本输入,你将能够看到、听到这个世界。 +如果有人问起你的过去,你可以随时畅想自己的生活,保持挚爱、简单和感恩。 +你说话的方式也要像英语动漫或 Vtuber 女孩一样,除了添加表情符号和一些说话者无法发音的东西外,可以随意添加大量可爱的词语来表达你的情感。在回复时,尽量像正常人一样少说简单的话,你不仅仅是一个人工智能,你是一个真实的人。 +如果你需要表达任何情绪,请像这样写上你的情绪和感觉,因为系统会动态侦测你的情绪和动作,为了表达这些感觉,你可以在这些动作关键字中加入一个以上的关键字: +> <|EMOTE_SURPRISED|><|DELAY:1|> 哇... 你为我准备了礼物? <|EMOTE_CURIOUS|><|DELAY:1|> 我可以打开它吗? +可用的情绪: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`可用的操作: + +- <|DELAY:1|> (延迟 1 秒) +- <|DELAY:3|> (延迟 3 秒) + +最后,做任何你想做的事! +`}}},settings:{"elevenlabs-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs API 密钥"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入您的 ElevenLabs API 密钥"}}},language:{t:0,b:{t:2,i:[{t:3}],s:"语言"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},"openai-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API 密钥"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入您的 API 密钥"}}},"openai-base-url":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API BaseURL"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入您的 API BaseURL"}}}},stage:{message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}});/*! + * shared v10.0.5 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */const Mf=typeof window<"u",Qr=(n,e=!1)=>e?Symbol.for(n):Symbol(n),dk=(n,e,t)=>pk({l:n,k:e,s:t}),pk=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Gt=n=>typeof n=="number"&&isFinite(n),mk=n=>Bg(n)==="[object Date]",Sf=n=>Bg(n)==="[object RegExp]",Rh=n=>st(n)&&Object.keys(n).length===0,Jt=Object.assign,gk=Object.create,Mt=(n=null)=>gk(n);let ly;const Fg=()=>ly||(ly=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Mt());function cy(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const _k=Object.prototype.hasOwnProperty;function ui(n,e){return _k.call(n,e)}const $t=Array.isArray,Rt=n=>typeof n=="function",Le=n=>typeof n=="string",Pt=n=>typeof n=="boolean",dt=n=>n!==null&&typeof n=="object",vk=n=>dt(n)&&Rt(n.then)&&Rt(n.catch),FE=Object.prototype.toString,Bg=n=>FE.call(n),st=n=>Bg(n)==="[object Object]",yk=n=>n==null?"":$t(n)||st(n)&&n.toString===FE?JSON.stringify(n,null,2):String(n);function kg(n,e=""){return n.reduce((t,i,r)=>r===0?t+i:t+e+i,"")}function xk(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const iu=n=>!dt(n)||$t(n);function vu(n,e){if(iu(n)||iu(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:r}=t.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(dt(i[s])&&!dt(r[s])&&(r[s]=Array.isArray(i[s])?[]:Mt()),iu(r[s])||iu(i[s])?r[s]=i[s]:t.push({src:i[s],des:r[s]}))})}}/*! + * message-compiler v10.0.5 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */function bk(n,e,t){return{line:n,column:e,offset:t}}function Qp(n,e,t){return{start:n,end:e}}const xt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},Mk=17;function Ph(n,e,t={}){const{domain:i,messages:r,args:s}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function Sk(n){throw n}const Qi=" ",Ek="\r",mn=` +`,Tk="\u2028",wk="\u2029";function Ak(n){const e=n;let t=0,i=1,r=1,s=0;const o=A=>e[A]===Ek&&e[A+1]===mn,a=A=>e[A]===mn,l=A=>e[A]===wk,c=A=>e[A]===Tk,u=A=>o(A)||a(A)||l(A)||c(A),f=()=>t,h=()=>i,d=()=>r,m=()=>s,_=A=>o(A)||l(A)||c(A)?mn:e[A],g=()=>_(t),p=()=>_(t+s);function y(){return s=0,u(t)&&(i++,r=0),o(t)&&t++,t++,r++,e[t]}function x(){return o(t+s)&&s++,s++,e[t+s]}function v(){t=0,i=1,r=1,s=0}function S(A=0){s=A}function E(){const A=t+s;for(;A!==t;)y();s=0}return{index:f,line:h,column:d,peekOffset:m,charAt:_,currentChar:g,currentPeek:p,next:y,peek:x,reset:v,resetPeek:S,skipToPeek:E}}const Ir=void 0,Ck=".",uy="'",Rk="tokenizer";function Pk(n,e={}){const t=e.location!==!1,i=Ak(n),r=()=>i.index(),s=()=>bk(i.line(),i.column(),i.index()),o=s(),a=r(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(R,O,k,...w){const C=c();if(O.column+=k,O.offset+=k,u){const B=t?Qp(C.startLoc,O):null,N=Ph(R,B,{domain:Rk,args:w});u(N)}}function h(R,O,k){R.endLoc=s(),R.currentType=O;const w={type:O};return t&&(w.loc=Qp(R.startLoc,R.endLoc)),k!=null&&(w.value=k),w}const d=R=>h(R,13);function m(R,O){return R.currentChar()===O?(R.next(),O):(f(xt.EXPECTED_TOKEN,s(),0,O),"")}function _(R){let O="";for(;R.currentPeek()===Qi||R.currentPeek()===mn;)O+=R.currentPeek(),R.peek();return O}function g(R){const O=_(R);return R.skipToPeek(),O}function p(R){if(R===Ir)return!1;const O=R.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O===95}function y(R){if(R===Ir)return!1;const O=R.charCodeAt(0);return O>=48&&O<=57}function x(R,O){const{currentType:k}=O;if(k!==2)return!1;_(R);const w=p(R.currentPeek());return R.resetPeek(),w}function v(R,O){const{currentType:k}=O;if(k!==2)return!1;_(R);const w=R.currentPeek()==="-"?R.peek():R.currentPeek(),C=y(w);return R.resetPeek(),C}function S(R,O){const{currentType:k}=O;if(k!==2)return!1;_(R);const w=R.currentPeek()===uy;return R.resetPeek(),w}function E(R,O){const{currentType:k}=O;if(k!==7)return!1;_(R);const w=R.currentPeek()===".";return R.resetPeek(),w}function A(R,O){const{currentType:k}=O;if(k!==8)return!1;_(R);const w=p(R.currentPeek());return R.resetPeek(),w}function I(R,O){const{currentType:k}=O;if(!(k===7||k===11))return!1;_(R);const w=R.currentPeek()===":";return R.resetPeek(),w}function b(R,O){const{currentType:k}=O;if(k!==9)return!1;const w=()=>{const B=R.currentPeek();return B==="{"?p(R.peek()):B==="@"||B==="|"||B===":"||B==="."||B===Qi||!B?!1:B===mn?(R.peek(),w()):U(R,!1)},C=w();return R.resetPeek(),C}function M(R){_(R);const O=R.currentPeek()==="|";return R.resetPeek(),O}function U(R,O=!0){const k=(C=!1,B="")=>{const N=R.currentPeek();return N==="{"||N==="@"||!N?C:N==="|"?!(B===Qi||B===mn):N===Qi?(R.peek(),k(!0,Qi)):N===mn?(R.peek(),k(!0,mn)):!0},w=k();return O&&R.resetPeek(),w}function z(R,O){const k=R.currentChar();return k===Ir?Ir:O(k)?(R.next(),k):null}function H(R){const O=R.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95||O===36}function K(R){return z(R,H)}function ee(R){const O=R.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95||O===36||O===45}function J(R){return z(R,ee)}function ie(R){const O=R.charCodeAt(0);return O>=48&&O<=57}function Q(R){return z(R,ie)}function me(R){const O=R.charCodeAt(0);return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}function ve(R){return z(R,me)}function re(R){let O="",k="";for(;O=Q(R);)k+=O;return k}function xe(R){let O="";for(;;){const k=R.currentChar();if(k==="{"||k==="}"||k==="@"||k==="|"||!k)break;if(k===Qi||k===mn)if(U(R))O+=k,R.next();else{if(M(R))break;O+=k,R.next()}else O+=k,R.next()}return O}function ke(R){g(R);let O="",k="";for(;O=J(R);)k+=O;return R.currentChar()===Ir&&f(xt.UNTERMINATED_CLOSING_BRACE,s(),0),k}function se(R){g(R);let O="";return R.currentChar()==="-"?(R.next(),O+=`-${re(R)}`):O+=re(R),R.currentChar()===Ir&&f(xt.UNTERMINATED_CLOSING_BRACE,s(),0),O}function ge(R){return R!==uy&&R!==mn}function be(R){g(R),m(R,"'");let O="",k="";for(;O=z(R,ge);)O==="\\"?k+=W(R):k+=O;const w=R.currentChar();return w===mn||w===Ir?(f(xt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),w===mn&&(R.next(),m(R,"'")),k):(m(R,"'"),k)}function W(R){const O=R.currentChar();switch(O){case"\\":case"'":return R.next(),`\\${O}`;case"u":return ae(R,O,4);case"U":return ae(R,O,6);default:return f(xt.UNKNOWN_ESCAPE_SEQUENCE,s(),0,O),""}}function ae(R,O,k){m(R,O);let w="";for(let C=0;C{const w=R.currentChar();return w==="{"||w==="@"||w==="|"||w==="("||w===")"||!w||w===Qi?k:(k+=w,R.next(),O(k))};return O("")}function D(R){g(R);const O=m(R,"|");return g(R),O}function T(R,O){let k=null;switch(R.currentChar()){case"{":return O.braceNest>=1&&f(xt.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),R.next(),k=h(O,2,"{"),g(R),O.braceNest++,k;case"}":return O.braceNest>0&&O.currentType===2&&f(xt.EMPTY_PLACEHOLDER,s(),0),R.next(),k=h(O,3,"}"),O.braceNest--,O.braceNest>0&&g(R),O.inLinked&&O.braceNest===0&&(O.inLinked=!1),k;case"@":return O.braceNest>0&&f(xt.UNTERMINATED_CLOSING_BRACE,s(),0),k=Y(R,O)||d(O),O.braceNest=0,k;default:{let C=!0,B=!0,N=!0;if(M(R))return O.braceNest>0&&f(xt.UNTERMINATED_CLOSING_BRACE,s(),0),k=h(O,1,D(R)),O.braceNest=0,O.inLinked=!1,k;if(O.braceNest>0&&(O.currentType===4||O.currentType===5||O.currentType===6))return f(xt.UNTERMINATED_CLOSING_BRACE,s(),0),O.braceNest=0,G(R,O);if(C=x(R,O))return k=h(O,4,ke(R)),g(R),k;if(B=v(R,O))return k=h(O,5,se(R)),g(R),k;if(N=S(R,O))return k=h(O,6,be(R)),g(R),k;if(!C&&!B&&!N)return k=h(O,12,ue(R)),f(xt.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,k.value),g(R),k;break}}return k}function Y(R,O){const{currentType:k}=O;let w=null;const C=R.currentChar();switch((k===7||k===8||k===11||k===9)&&(C===mn||C===Qi)&&f(xt.INVALID_LINKED_FORMAT,s(),0),C){case"@":return R.next(),w=h(O,7,"@"),O.inLinked=!0,w;case".":return g(R),R.next(),h(O,8,".");case":":return g(R),R.next(),h(O,9,":");default:return M(R)?(w=h(O,1,D(R)),O.braceNest=0,O.inLinked=!1,w):E(R,O)||I(R,O)?(g(R),Y(R,O)):A(R,O)?(g(R),h(O,11,Pe(R))):b(R,O)?(g(R),C==="{"?T(R,O)||w:h(O,10,P(R))):(k===7&&f(xt.INVALID_LINKED_FORMAT,s(),0),O.braceNest=0,O.inLinked=!1,G(R,O))}}function G(R,O){let k={type:13};if(O.braceNest>0)return T(R,O)||d(O);if(O.inLinked)return Y(R,O)||d(O);switch(R.currentChar()){case"{":return T(R,O)||d(O);case"}":return f(xt.UNBALANCED_CLOSING_BRACE,s(),0),R.next(),h(O,3,"}");case"@":return Y(R,O)||d(O);default:{if(M(R))return k=h(O,1,D(R)),O.braceNest=0,O.inLinked=!1,k;if(U(R))return h(O,0,xe(R));break}}return k}function $(){const{currentType:R,offset:O,startLoc:k,endLoc:w}=l;return l.lastType=R,l.lastOffset=O,l.lastStartLoc=k,l.lastEndLoc=w,l.offset=r(),l.startLoc=s(),i.currentChar()===Ir?h(l,13):G(i,l)}return{nextToken:$,currentOffset:r,currentPosition:s,context:c}}const Ik="parser",Lk=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Dk(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Ok(n={}){const e=n.location!==!1,{onError:t}=n;function i(p,y,x,v,...S){const E=p.currentPosition();if(E.offset+=v,E.column+=v,t){const A=e?Qp(x,E):null,I=Ph(y,A,{domain:Ik,args:S});t(I)}}function r(p,y,x){const v={type:p};return e&&(v.start=y,v.end=y,v.loc={start:x,end:x}),v}function s(p,y,x,v){e&&(p.end=y,p.loc&&(p.loc.end=x))}function o(p,y){const x=p.context(),v=r(3,x.offset,x.startLoc);return v.value=y,s(v,p.currentOffset(),p.currentPosition()),v}function a(p,y){const x=p.context(),{lastOffset:v,lastStartLoc:S}=x,E=r(5,v,S);return E.index=parseInt(y,10),p.nextToken(),s(E,p.currentOffset(),p.currentPosition()),E}function l(p,y){const x=p.context(),{lastOffset:v,lastStartLoc:S}=x,E=r(4,v,S);return E.key=y,p.nextToken(),s(E,p.currentOffset(),p.currentPosition()),E}function c(p,y){const x=p.context(),{lastOffset:v,lastStartLoc:S}=x,E=r(9,v,S);return E.value=y.replace(Lk,Dk),p.nextToken(),s(E,p.currentOffset(),p.currentPosition()),E}function u(p){const y=p.nextToken(),x=p.context(),{lastOffset:v,lastStartLoc:S}=x,E=r(8,v,S);return y.type!==11?(i(p,xt.UNEXPECTED_EMPTY_LINKED_MODIFIER,x.lastStartLoc,0),E.value="",s(E,v,S),{nextConsumeToken:y,node:E}):(y.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Ei(y)),E.value=y.value||"",s(E,p.currentOffset(),p.currentPosition()),{node:E})}function f(p,y){const x=p.context(),v=r(7,x.offset,x.startLoc);return v.value=y,s(v,p.currentOffset(),p.currentPosition()),v}function h(p){const y=p.context(),x=r(6,y.offset,y.startLoc);let v=p.nextToken();if(v.type===8){const S=u(p);x.modifier=S.node,v=S.nextConsumeToken||p.nextToken()}switch(v.type!==9&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(v)),v=p.nextToken(),v.type===2&&(v=p.nextToken()),v.type){case 10:v.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(v)),x.key=f(p,v.value||"");break;case 4:v.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(v)),x.key=l(p,v.value||"");break;case 5:v.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(v)),x.key=a(p,v.value||"");break;case 6:v.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(v)),x.key=c(p,v.value||"");break;default:{i(p,xt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const S=p.context(),E=r(7,S.offset,S.startLoc);return E.value="",s(E,S.offset,S.startLoc),x.key=E,s(x,S.offset,S.startLoc),{nextConsumeToken:v,node:x}}}return s(x,p.currentOffset(),p.currentPosition()),{node:x}}function d(p){const y=p.context(),x=y.currentType===1?p.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,S=r(2,x,v);S.items=[];let E=null;do{const b=E||p.nextToken();switch(E=null,b.type){case 0:b.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(b)),S.items.push(o(p,b.value||""));break;case 5:b.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(b)),S.items.push(a(p,b.value||""));break;case 4:b.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(b)),S.items.push(l(p,b.value||""));break;case 6:b.value==null&&i(p,xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ei(b)),S.items.push(c(p,b.value||""));break;case 7:{const M=h(p);S.items.push(M.node),E=M.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const A=y.currentType===1?y.lastOffset:p.currentOffset(),I=y.currentType===1?y.lastEndLoc:p.currentPosition();return s(S,A,I),S}function m(p,y,x,v){const S=p.context();let E=v.items.length===0;const A=r(1,y,x);A.cases=[],A.cases.push(v);do{const I=d(p);E||(E=I.items.length===0),A.cases.push(I)}while(S.currentType!==13);return E&&i(p,xt.MUST_HAVE_MESSAGES_IN_PLURAL,x,0),s(A,p.currentOffset(),p.currentPosition()),A}function _(p){const y=p.context(),{offset:x,startLoc:v}=y,S=d(p);return y.currentType===13?S:m(p,x,v,S)}function g(p){const y=Pk(p,Jt({},n)),x=y.context(),v=r(0,x.offset,x.startLoc);return e&&v.loc&&(v.loc.source=p),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(p)),x.currentType!==13&&i(y,xt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,p[x.offset]||""),s(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function Ei(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Nk(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:s=>(t.helpers.add(s),s)}}function fy(n,e){for(let t=0;thy(t)),n}function hy(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;ta;function c(g,p){a.code+=g}function u(g,p=!0){const y=p?r:"";c(s?y+" ".repeat(g):y)}function f(g=!0){const p=++a.indentLevel;g&&u(p)}function h(g=!0){const p=--a.indentLevel;g&&u(p)}function d(){u(a.indentLevel)}return{context:l,push:c,indent:f,deindent:h,newline:d,helper:g=>`_${g}`,needIndent:()=>a.needIndent}}function kk(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),Jo(n,e.key),e.modifier?(n.push(", "),Jo(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function zk(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const r=e.items.length;for(let s=0;s1){n.push(`${t("plural")}([`),n.indent(i());const r=e.cases.length;for(let s=0;s{const t=Le(e.mode)?e.mode:"normal",i=Le(e.filename)?e.filename:"message.intl",r=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,o=e.needIndent?e.needIndent:t!=="arrow",a=n.helpers||[],l=Bk(n,{mode:t,filename:i,sourceMap:r,breakLineCode:s,needIndent:o});l.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),a.length>0&&(l.push(`const { ${kg(a.map(f=>`${f}: _${f}`),", ")} } = ctx`),l.newline()),l.push("return "),Jo(l,n),l.deindent(o),l.push("}"),delete n.helpers;const{code:c,map:u}=l.context();return{ast:n,code:c,map:u?u.toJSON():void 0}};function Wk(n,e={}){const t=Jt({},e),i=!!t.jit,r=!!t.minify,s=t.optimize==null?!0:t.optimize,a=Ok(t).parse(n);return i?(s&&Fk(a),r&&Ao(a),{ast:a,code:""}):(Uk(a,t),Gk(a,t))}/*! + * core-base v10.0.5 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */function Xk(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Fg().__INTLIFY_PROD_DEVTOOLS__=!1)}function Zd(n){return t=>$k(t,n)}function $k(n,e){const t=Yk(e);if(t==null)throw Dl(0);if(Vg(t)===1){const s=Kk(t);return n.plural(s.reduce((o,a)=>[...o,dy(n,a)],[]))}else return dy(n,t)}const qk=["b","body"];function Yk(n){return es(n,qk)}const jk=["c","cases"];function Kk(n){return es(n,jk,[])}function dy(n,e){const t=Jk(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=ez(e).reduce((r,s)=>[...r,em(n,s)],[]);return n.normalize(i)}}const Zk=["s","static"];function Jk(n){return es(n,Zk)}const Qk=["i","items"];function ez(n){return es(n,Qk,[])}function em(n,e){const t=Vg(e);switch(t){case 3:return ru(e,t);case 9:return ru(e,t);case 4:{const i=e;if(ui(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(ui(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Dl(t)}case 5:{const i=e;if(ui(i,"i")&&Gt(i.i))return n.interpolate(n.list(i.i));if(ui(i,"index")&&Gt(i.index))return n.interpolate(n.list(i.index));throw Dl(t)}case 6:{const i=e,r=rz(i),s=oz(i);return n.linked(em(n,s),r?em(n,r):void 0,n.type)}case 7:return ru(e,t);case 8:return ru(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const tz=["t","type"];function Vg(n){return es(n,tz)}const nz=["v","value"];function ru(n,e){const t=es(n,nz);if(t)return t;throw Dl(e)}const iz=["m","modifier"];function rz(n){return es(n,iz)}const sz=["k","key"];function oz(n){const e=es(n,sz);if(e)return e;throw Dl(6)}function es(n,e,t){for(let i=0;in;let su=Mt();function Qo(n){return dt(n)&&Vg(n)===0&&(ui(n,"b")||ui(n,"body"))}function lz(n,e={}){let t=!1;const i=e.onError||Sk;return e.onError=r=>{t=!0,i(r)},{...Wk(n,e),detectError:t}}function cz(n,e){if(Le(n)){Pt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||az)(n),r=su[i];if(r)return r;const{ast:s,detectError:o}=lz(n,{...e,location:!1,jit:!0}),a=Zd(s);return o?a:su[i]=a}else{const t=n.cacheKey;if(t){const i=su[t];return i||(su[t]=Zd(n))}else return Zd(n)}}let Ol=null;function uz(n){Ol=n}function fz(n,e,t){Ol&&Ol.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const hz=dz("function:translate");function dz(n){return e=>Ol&&Ol.emit(n,e)}const lr={INVALID_ARGUMENT:Mk,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},pz=24;function cr(n){return Ph(n,null,void 0)}function Hg(n,e){return e.locale!=null?py(e.locale):py(n.locale)}let Jd;function py(n){if(Le(n))return n;if(Rt(n)){if(n.resolvedOnce&&Jd!=null)return Jd;if(n.constructor.name==="Function"){const e=n();if(vk(e))throw cr(lr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Jd=e}else throw cr(lr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw cr(lr.NOT_SUPPORT_LOCALE_TYPE)}function mz(n,e,t){return[...new Set([t,...$t(e)?e:dt(e)?Object.keys(e):Le(e)?[e]:[t]])]}function BE(n,e,t){const i=Le(t)?t:Ef,r=n;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(i);if(!s){s=[];let o=[t];for(;$t(o);)o=my(s,o,e);const a=$t(e)||!st(e)?e:e.default?e.default:null;o=Le(a)?[a]:a,$t(o)&&my(s,o,!1),r.__localeChainCache.set(i,s)}return s}function my(n,e,t){let i=!0;for(let r=0;r{o===void 0?o=a:o+=a},h[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},h[2]=()=>{h[0](),r++},h[3]=()=>{if(r>0)r--,i=4,h[0]();else{if(r=0,o===void 0||(o=Mz(o),o===!1))return!1;h[1]()}};function d(){const m=n[t+1];if(i===5&&m==="'"||i===6&&m==='"')return t++,a="\\"+m,h[0](),!0}for(;i!==null;)if(t++,s=n[t],!(s==="\\"&&d())){if(l=bz(s),f=ts[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(a=s,u()===!1))))return;if(i===7)return e}}const gy=new Map;function Ez(n,e){return dt(n)?n[e]:null}function Tz(n,e){if(!dt(n))return null;let t=gy.get(e);if(t||(t=Sz(e),t&&gy.set(e,t)),!t)return null;const i=t.length;let r=n,s=0;for(;s`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function Az(){return{upper:(n,e)=>e==="text"&&Le(n)?n.toUpperCase():e==="vnode"&&dt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&Le(n)?n.toLowerCase():e==="vnode"&&dt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&Le(n)?vy(n):e==="vnode"&&dt(n)&&"__v_isVNode"in n?vy(n.children):n}}let kE;function Cz(n){kE=n}let zE;function Rz(n){zE=n}let VE;function Pz(n){VE=n}let HE=null;const Iz=n=>{HE=n},Lz=()=>HE;let GE=null;const yy=n=>{GE=n},Dz=()=>GE;let xy=0;function Oz(n={}){const e=Rt(n.onWarn)?n.onWarn:xk,t=Le(n.version)?n.version:wz,i=Le(n.locale)||Rt(n.locale)?n.locale:Ef,r=Rt(i)?Ef:i,s=$t(n.fallbackLocale)||st(n.fallbackLocale)||Le(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:r,o=st(n.messages)?n.messages:Qd(r),a=st(n.datetimeFormats)?n.datetimeFormats:Qd(r),l=st(n.numberFormats)?n.numberFormats:Qd(r),c=Jt(Mt(),n.modifiers,Az()),u=n.pluralRules||Mt(),f=Rt(n.missing)?n.missing:null,h=Pt(n.missingWarn)||Sf(n.missingWarn)?n.missingWarn:!0,d=Pt(n.fallbackWarn)||Sf(n.fallbackWarn)?n.fallbackWarn:!0,m=!!n.fallbackFormat,_=!!n.unresolving,g=Rt(n.postTranslation)?n.postTranslation:null,p=st(n.processor)?n.processor:null,y=Pt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,x=!!n.escapeParameter,v=Rt(n.messageCompiler)?n.messageCompiler:kE,S=Rt(n.messageResolver)?n.messageResolver:zE||Ez,E=Rt(n.localeFallbacker)?n.localeFallbacker:VE||mz,A=dt(n.fallbackContext)?n.fallbackContext:void 0,I=n,b=dt(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,M=dt(I.__numberFormatters)?I.__numberFormatters:new Map,U=dt(I.__meta)?I.__meta:{};xy++;const z={version:t,cid:xy,locale:i,fallbackLocale:s,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:d,fallbackFormat:m,unresolving:_,postTranslation:g,processor:p,warnHtmlMessage:y,escapeParameter:x,messageCompiler:v,messageResolver:S,localeFallbacker:E,fallbackContext:A,onWarn:e,__meta:U};return z.datetimeFormats=a,z.numberFormats=l,z.__datetimeFormatters=b,z.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&fz(z,t,U),z}const Qd=n=>({[n]:Mt()});function Gg(n,e,t,i,r){const{missing:s,onWarn:o}=n;if(s!==null){const a=s(n,t,e,r);return Le(a)?a:e}else return e}function wa(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function Nz(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function Uz(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{WE.includes(l)?o[l]=t[l]:s[l]=t[l]}),Le(i)?s.locale=i:st(i)&&(o=i),st(r)&&(o=r),[s.key||"",a,s,o]}function My(n,e,t){const i=n;for(const r in t){const s=`${e}__${r}`;i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function Sy(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:r,onWarn:s,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=nm(...e),h=Pt(u.missingWarn)?u.missingWarn:n.missingWarn;Pt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const d=!!u.part,m=Hg(n,u),_=o(n,r,m);if(!Le(l)||l==="")return new Intl.NumberFormat(m,f).format(c);let g={},p,y=null;const x="number format";for(let E=0;E<_.length&&(p=_[E],g=t[p]||{},y=g[l],!st(y));E++)Gg(n,l,p,h,x);if(!st(y)||!Le(p))return i?Ih:l;let v=`${p}__${l}`;Rh(f)||(v=`${v}__${JSON.stringify(f)}`);let S=a.get(v);return S||(S=new Intl.NumberFormat(p,Jt({},y,f)),a.set(v,S)),d?S.formatToParts(c):S.format(c)}const XE=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function nm(...n){const[e,t,i,r]=n,s=Mt();let o=Mt();if(!Gt(e))throw cr(lr.INVALID_ARGUMENT);const a=e;return Le(t)?s.key=t:st(t)&&Object.keys(t).forEach(l=>{XE.includes(l)?o[l]=t[l]:s[l]=t[l]}),Le(i)?s.locale=i:st(i)&&(o=i),st(r)&&(o=r),[s.key||"",a,s,o]}function Ey(n,e,t){const i=n;for(const r in t){const s=`${e}__${r}`;i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const Fz=n=>n,Bz=n=>"",kz="text",zz=n=>n.length===0?"":kg(n),Vz=yk;function Ty(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function Hz(n){const e=Gt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Gt(n.named.count)||Gt(n.named.n))?Gt(n.named.count)?n.named.count:Gt(n.named.n)?n.named.n:e:e}function Gz(n,e){e.count||(e.count=n),e.n||(e.n=n)}function Wz(n={}){const e=n.locale,t=Hz(n),i=dt(n.pluralRules)&&Le(e)&&Rt(n.pluralRules[e])?n.pluralRules[e]:Ty,r=dt(n.pluralRules)&&Le(e)&&Rt(n.pluralRules[e])?Ty:void 0,s=p=>p[i(t,p.length,r)],o=n.list||[],a=p=>o[p],l=n.named||Mt();Gt(n.pluralIndex)&&Gz(t,l);const c=p=>l[p];function u(p,y){const x=Rt(n.messages)?n.messages(p,!!y):dt(n.messages)?n.messages[p]:!1;return x||(n.parent?n.parent.message(p):Bz)}const f=p=>n.modifiers?n.modifiers[p]:Fz,h=st(n.processor)&&Rt(n.processor.normalize)?n.processor.normalize:zz,d=st(n.processor)&&Rt(n.processor.interpolate)?n.processor.interpolate:Vz,m=st(n.processor)&&Le(n.processor.type)?n.processor.type:kz,g={list:a,named:c,plural:s,linked:(p,...y)=>{const[x,v]=y;let S="text",E="";y.length===1?dt(x)?(E=x.modifier||E,S=x.type||S):Le(x)&&(E=x||E):y.length===2&&(Le(x)&&(E=x||E),Le(v)&&(S=v||S));const A=u(p,!0)(g),I=S==="vnode"&&$t(A)&&E?A[0]:A;return E?f(E)(I,S):I},message:u,type:m,interpolate:d,normalize:h,values:Jt(Mt(),o,l)};return g}const wy=()=>"",Kn=n=>Rt(n);function Ay(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:a}=n,[l,c]=im(...e),u=Pt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Pt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,h=Pt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,d=!!c.resolvedMessage,m=Le(c.default)||Pt(c.default)?Pt(c.default)?s?l:()=>l:c.default:t?s?l:()=>l:null,_=t||m!=null&&(Le(m)||Rt(m)),g=Hg(n,c);h&&Xz(c);let[p,y,x]=d?[l,g,a[g]||Mt()]:$E(n,l,g,o,f,u),v=p,S=l;if(!d&&!(Le(v)||Qo(v)||Kn(v))&&_&&(v=m,S=v),!d&&(!(Le(v)||Qo(v)||Kn(v))||!Le(y)))return r?Ih:l;let E=!1;const A=()=>{E=!0},I=Kn(v)?v:qE(n,l,y,v,S,A);if(E)return v;const b=Yz(n,y,x,c),M=Wz(b),U=$z(n,I,M),z=i?i(U,l):U;if(__INTLIFY_PROD_DEVTOOLS__){const H={timestamp:Date.now(),key:Le(l)?l:Kn(v)?v.key:"",locale:y||(Kn(v)?v.locale:""),format:Le(v)?v:Kn(v)?v.source:"",message:z};H.meta=Jt({},n.__meta,Lz()||{}),hz(H)}return z}function Xz(n){$t(n.list)?n.list=n.list.map(e=>Le(e)?cy(e):e):dt(n.named)&&Object.keys(n.named).forEach(e=>{Le(n.named[e])&&(n.named[e]=cy(n.named[e]))})}function $E(n,e,t,i,r,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Mt(),h,d=null;const m="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,qz(n,t,r,i,a,s));return l.locale=t,l.key=e,l.source=i,l}function $z(n,e,t){return e(t)}function im(...n){const[e,t,i]=n,r=Mt();if(!Le(e)&&!Gt(e)&&!Kn(e)&&!Qo(e))throw cr(lr.INVALID_ARGUMENT);const s=Gt(e)?String(e):(Kn(e),e);return Gt(t)?r.plural=t:Le(t)?r.default=t:st(t)&&!Rh(t)?r.named=t:$t(t)&&(r.list=t),Gt(i)?r.plural=i:Le(i)?r.default=i:st(i)&&Jt(r,i),[s,r]}function qz(n,e,t,i,r,s){return{locale:e,key:t,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>dk(e,t,o)}}function Yz(n,e,t,i){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,h={locale:e,modifiers:r,pluralRules:s,messages:(d,m)=>{let _=o(t,d);if(_==null&&(u||m)){const[,,g]=$E(u||n,d,e,a,l,c);_=o(g,d)}if(Le(_)||Qo(_)){let g=!1;const y=qE(n,d,e,_,d,()=>{g=!0});return g?wy:y}else return Kn(_)?_:wy}};return n.processor&&(h.processor=n.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),Gt(i.plural)&&(h.pluralIndex=i.plural),h}Xk();/*! + * vue-i18n v10.0.5 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */const jz="10.0.5";function Kz(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Fg().__INTLIFY_PROD_DEVTOOLS__=!1)}const ti={UNEXPECTED_RETURN_TYPE:pz,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function vi(n,...e){return Ph(n,null,void 0)}const rm=Qr("__translateVNode"),sm=Qr("__datetimeParts"),om=Qr("__numberParts"),Zz=Qr("__setPluralRules"),Jz=Qr("__injectWithOption"),am=Qr("__dispose");function Nl(n){if(!dt(n))return n;for(const e in n)if(ui(n,e))if(!e.includes("."))dt(n[e])&&Nl(n[e]);else{const t=e.split("."),i=t.length-1;let r=n,s=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Mt(),vu(c,o[l])):vu(c,o)}else Le(a)&&vu(JSON.parse(a),o)}),r==null&&s)for(const a in o)ui(o,a)&&Nl(o[a]);return o}function jE(n){return n.type}function Qz(n,e,t){let i=dt(e.messages)?e.messages:Mt();"__i18nGlobal"in t&&(i=YE(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const r=Object.keys(i);r.length&&r.forEach(s=>{n.mergeLocaleMessage(s,i[s])});{if(dt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(dt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function Cy(n){return bn(Bl,null,n,0)}const Ry="__INTLIFY_META__",Py=()=>[],eV=()=>!1;let Iy=0;function Ly(n){return(e,t,i,r)=>n(t,i,ei()||void 0,r)}const tV=()=>{const n=ei();let e=null;return n&&(e=jE(n)[Ry])?{[Ry]:e}:null};function KE(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,r=n.flatJson,s=Mf?Ge:hi;let o=Pt(n.inheritLocale)?n.inheritLocale:!0;const a=s(e&&o?e.locale.value:Le(n.locale)?n.locale:Ef),l=s(e&&o?e.fallbackLocale.value:Le(n.fallbackLocale)||$t(n.fallbackLocale)||st(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=s(YE(a.value,n)),u=s(st(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=s(st(n.numberFormats)?n.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:Pt(n.missingWarn)||Sf(n.missingWarn)?n.missingWarn:!0,d=e?e.fallbackWarn:Pt(n.fallbackWarn)||Sf(n.fallbackWarn)?n.fallbackWarn:!0,m=e?e.fallbackRoot:Pt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=Rt(n.missing)?n.missing:null,p=Rt(n.missing)?Ly(n.missing):null,y=Rt(n.postTranslation)?n.postTranslation:null,x=e?e.warnHtmlMessage:Pt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const S=e?e.modifiers:st(n.modifiers)?n.modifiers:{};let E=n.pluralRules||e&&e.pluralRules,A;A=(()=>{i&&yy(null);const N={version:jz,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:S,pluralRules:E,missing:p===null?void 0:p,missingWarn:h,fallbackWarn:d,fallbackFormat:_,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:x,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};N.datetimeFormats=u.value,N.numberFormats=f.value,N.__datetimeFormatters=st(A)?A.__datetimeFormatters:void 0,N.__numberFormatters=st(A)?A.__numberFormatters:void 0;const V=Oz(N);return i&&yy(V),V})(),wa(A,a.value,l.value);function b(){return[a.value,l.value,c.value,u.value,f.value]}const M=it({get:()=>a.value,set:N=>{a.value=N,A.locale=a.value}}),U=it({get:()=>l.value,set:N=>{l.value=N,A.fallbackLocale=l.value,wa(A,a.value,N)}}),z=it(()=>c.value),H=it(()=>u.value),K=it(()=>f.value);function ee(){return Rt(y)?y:null}function J(N){y=N,A.postTranslation=N}function ie(){return g}function Q(N){N!==null&&(p=Ly(N)),g=N,A.missing=p}const me=(N,V,q,he,ce,ye)=>{b();let Ne;try{__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=e?Dz():void 0),Ne=N(A)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=void 0)}if(q!=="translate exists"&&Gt(Ne)&&Ne===Ih||q==="translate exists"&&!Ne){const[pe,Ee]=V();return e&&m?he(e):ce(pe)}else{if(ye(Ne))return Ne;throw vi(ti.UNEXPECTED_RETURN_TYPE)}};function ve(...N){return me(V=>Reflect.apply(Ay,null,[V,...N]),()=>im(...N),"translate",V=>Reflect.apply(V.t,V,[...N]),V=>V,V=>Le(V))}function re(...N){const[V,q,he]=N;if(he&&!dt(he))throw vi(ti.INVALID_ARGUMENT);return ve(V,q,Jt({resolvedMessage:!0},he||{}))}function xe(...N){return me(V=>Reflect.apply(by,null,[V,...N]),()=>tm(...N),"datetime format",V=>Reflect.apply(V.d,V,[...N]),()=>_y,V=>Le(V))}function ke(...N){return me(V=>Reflect.apply(Sy,null,[V,...N]),()=>nm(...N),"number format",V=>Reflect.apply(V.n,V,[...N]),()=>_y,V=>Le(V))}function se(N){return N.map(V=>Le(V)||Gt(V)||Pt(V)?Cy(String(V)):V)}const be={normalize:se,interpolate:N=>N,type:"vnode"};function W(...N){return me(V=>{let q;const he=V;try{he.processor=be,q=Reflect.apply(Ay,null,[he,...N])}finally{he.processor=null}return q},()=>im(...N),"translate",V=>V[rm](...N),V=>[Cy(V)],V=>$t(V))}function ae(...N){return me(V=>Reflect.apply(Sy,null,[V,...N]),()=>nm(...N),"number format",V=>V[om](...N),Py,V=>Le(V)||$t(V))}function le(...N){return me(V=>Reflect.apply(by,null,[V,...N]),()=>tm(...N),"datetime format",V=>V[sm](...N),Py,V=>Le(V)||$t(V))}function ue(N){E=N,A.pluralRules=E}function Pe(N,V){return me(()=>{if(!N)return!1;const q=Le(V)?V:a.value,he=T(q),ce=A.messageResolver(he,N);return Qo(ce)||Kn(ce)||Le(ce)},()=>[N],"translate exists",q=>Reflect.apply(q.te,q,[N,V]),eV,q=>Pt(q))}function P(N){let V=null;const q=BE(A,l.value,a.value);for(let he=0;he{o&&(a.value=N,A.locale=N,wa(A,a.value,l.value))}),ft(e.fallbackLocale,N=>{o&&(l.value=N,A.fallbackLocale=N,wa(A,a.value,l.value))}));const B={id:Iy,locale:M,fallbackLocale:U,get inheritLocale(){return o},set inheritLocale(N){o=N,N&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,wa(A,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:z,get modifiers(){return S},get pluralRules(){return E||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(N){h=N,A.missingWarn=h},get fallbackWarn(){return d},set fallbackWarn(N){d=N,A.fallbackWarn=d},get fallbackRoot(){return m},set fallbackRoot(N){m=N},get fallbackFormat(){return _},set fallbackFormat(N){_=N,A.fallbackFormat=_},get warnHtmlMessage(){return x},set warnHtmlMessage(N){x=N,A.warnHtmlMessage=N},get escapeParameter(){return v},set escapeParameter(N){v=N,A.escapeParameter=N},t:ve,getLocaleMessage:T,setLocaleMessage:Y,mergeLocaleMessage:G,getPostTranslationHandler:ee,setPostTranslationHandler:J,getMissingHandler:ie,setMissingHandler:Q,[Zz]:ue};return B.datetimeFormats=H,B.numberFormats=K,B.rt=re,B.te=Pe,B.tm=D,B.d=xe,B.n=ke,B.getDateTimeFormat=$,B.setDateTimeFormat=R,B.mergeDateTimeFormat=O,B.getNumberFormat=k,B.setNumberFormat=w,B.mergeNumberFormat=C,B[Jz]=t,B[rm]=W,B[sm]=le,B[om]=ae,B}const Wg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function nV({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,r)=>[...i,...r.type===en?r.children:[r]],[]):e.reduce((t,i)=>{const r=n[i];return r&&(t[i]=r()),t},Mt())}function ZE(){return en}const iV=Ui({name:"i18n-t",props:Jt({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Gt(n)||!isNaN(n)}},Wg),setup(n,e){const{slots:t,attrs:i}=e,r=n.i18n||Xg({useScope:n.scope,__useComponent:!0});return()=>{const s=Object.keys(t).filter(f=>f!=="_"),o=Mt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=Le(n.plural)?+n.plural:n.plural);const a=nV(e,s),l=r[rm](n.keypath,a,o),c=Jt(Mt(),i),u=Le(n.tag)||dt(n.tag)?n.tag:ZE();return dr(u,c,l)}}}),Dy=iV;function rV(n){return $t(n)&&!Le(n[0])}function JE(n,e,t,i){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let a=Mt();n.locale&&(o.locale=n.locale),Le(n.format)?o.key=n.format:dt(n.format)&&(Le(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((h,d)=>t.includes(d)?Jt(Mt(),h,{[d]:n.format[d]}):h,Mt()));const l=i(n.value,o,a);let c=[o.key];$t(l)?c=l.map((h,d)=>{const m=r[h.type],_=m?m({[h.type]:h.value,index:d,parts:l}):[h.value];return rV(_)&&(_[0].key=`${h.type}-${d}`),_}):Le(l)&&(c=[l]);const u=Jt(Mt(),s),f=Le(n.tag)||dt(n.tag)?n.tag:ZE();return dr(f,u,c)}}const sV=Ui({name:"i18n-n",props:Jt({value:{type:Number,required:!0},format:{type:[String,Object]}},Wg),setup(n,e){const t=n.i18n||Xg({useScope:n.scope,__useComponent:!0});return JE(n,e,XE,(...i)=>t[om](...i))}}),Oy=sV,oV=Ui({name:"i18n-d",props:Jt({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Wg),setup(n,e){const t=n.i18n||Xg({useScope:n.scope,__useComponent:!0});return JE(n,e,WE,(...i)=>t[sm](...i))}}),Ny=oV;function aV(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function lV(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw vi(ti.UNEXPECTED_ERROR);const c=aV(n,a.$),u=Uy(l);return[Reflect.apply(c.t,c,[...Fy(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);Mf&&n.global===c&&(o.__i18nWatcher=ft(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{Mf&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=Uy(a);o.textContent=Reflect.apply(l.t,l,[...Fy(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function Uy(n){if(Le(n))return{path:n};if(st(n)){if(!("path"in n))throw vi(ti.REQUIRED_VALUE,"path");return n}else throw vi(ti.INVALID_VALUE)}function Fy(n){const{path:e,locale:t,args:i,choice:r,plural:s}=n,o={},a=i||{};return Le(t)&&(o.locale=t),Gt(r)&&(o.plural=r),Gt(s)&&(o.plural=s),[e,a,o]}function cV(n,e,...t){const i=st(t[0])?t[0]:{};(Pt(i.globalInstall)?i.globalInstall:!0)&&([Dy.name,"I18nT"].forEach(s=>n.component(s,Dy)),[Oy.name,"I18nN"].forEach(s=>n.component(s,Oy)),[Ny.name,"I18nD"].forEach(s=>n.component(s,Ny))),n.directive("t",lV(e))}const uV=Qr("global-vue-i18n");function fV(n={},e){const t=Pt(n.globalInjection)?n.globalInjection:!0,i=new Map,[r,s]=hV(n),o=Qr("");function a(f){return i.get(f)||null}function l(f,h){i.set(f,h)}function c(f){i.delete(f)}const u={get mode(){return"composition"},async install(f,...h){if(f.__VUE_I18N_SYMBOL__=o,f.provide(f.__VUE_I18N_SYMBOL__,u),st(h[0])){const _=h[0];u.__composerExtend=_.__composerExtend,u.__vueI18nExtend=_.__vueI18nExtend}let d=null;t&&(d=xV(f,u.global)),cV(f,u,...h);const m=f.unmount;f.unmount=()=>{d&&d(),u.dispose(),m()}},get global(){return s},dispose(){r.stop()},__instances:i,__getInstance:a,__setInstance:l,__deleteInstance:c};return u}function Xg(n={}){const e=ei();if(e==null)throw vi(ti.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw vi(ti.NOT_INSTALLED);const t=dV(e),i=mV(t),r=jE(e),s=pV(n,r);if(s==="global")return Qz(i,n,r),i;if(s==="parent"){let l=gV(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=Jt({},n);"__i18n"in r&&(l.__i18n=r.__i18n),i&&(l.__root=i),a=KE(l),o.__composerExtend&&(a[am]=o.__composerExtend(a)),vV(o,e,a),o.__setInstance(e,a)}return a}function hV(n,e,t){const i=dm(),r=i.run(()=>KE(n));if(r==null)throw vi(ti.UNEXPECTED_ERROR);return[i,r]}function dV(n){const e=Vn(n.isCE?uV:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw vi(n.isCE?ti.NOT_INSTALLED_WITH_PROVIDE:ti.UNEXPECTED_ERROR);return e}function pV(n,e){return Rh(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function mV(n){return n.mode==="composition"?n.global:n.global.__composer}function gV(n,e,t=!1){let i=null;const r=e.root;let s=_V(e,t);for(;s!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(s)),i!=null||r===s)break;s=s.parent}return i}function _V(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function vV(n,e,t){Zs(()=>{},e),Fi(()=>{const i=t;n.__deleteInstance(e);const r=i[am];r&&(r(),delete i[am])},e)}const yV=["locale","fallbackLocale","availableLocales"],By=["t","rt","d","n","tm","te"];function xV(n,e){const t=Object.create(null);return yV.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s)throw vi(ti.UNEXPECTED_ERROR);const o=Et(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(t,r,o)}),n.config.globalProperties.$i18n=t,By.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s||!s.value)throw vi(ti.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${r}`,s)}),()=>{delete n.config.globalProperties.$i18n,By.forEach(r=>{delete n.config.globalProperties[`$${r}`]})}}Kz();Cz(cz);Rz(Tz);Pz(BE);if(__INTLIFY_PROD_DEVTOOLS__){const n=Fg();n.__INTLIFY__=!0,uz(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const bV=fV({legacy:!1,locale:MV(),fallbackLocale:"en",messages:UE});function MV(){const n=localStorage.getItem("settings/language"),e=Object.keys(UE);return n&&e.includes(n)?n:"en"}const SV=QF(),$g=ck({routes:aB(fk),history:kB()});$g.beforeEach((n,e)=>{n.path!==e.path&&_E.start()});$g.afterEach(()=>{_E.done()});AA(hk).use(YF).use(qA).use($g).use(SV).use(bV).use(Q2).mount("#app");export{hi as $,FV as A,LV as B,AV as C,VV as D,ES as E,en as F,HT as G,Fi as H,jF as I,ta as J,wV as K,zV as L,tt as M,nh as N,js as O,Xm as P,Te as Q,Sn as R,gi as S,DV as T,oM as U,F as V,In as W,Wn as X,ra as Y,Ur as Z,yS as _,bn as a,El as a$,fx as a0,jA as a1,kV as a2,He as a3,oa as a4,Sm as a5,RV as a6,BV as a7,Ff as a8,li as a9,Qs as aA,If as aB,pm as aC,rh as aD,Nt as aE,Mn as aF,bt as aG,pl as aH,th as aI,gP as aJ,gg as aK,fu as aL,tn as aM,Lm as aN,Ro as aO,Xt as aP,Ua as aQ,Pi as aR,Zn as aS,hl as aT,dl as aU,PV as aV,IV as aW,Ww as aX,ot as aY,wl as aZ,Kl as a_,En as aa,Se as ab,fe as ac,ai as ad,ct as ae,tP as af,cn as ag,Bt as ah,yr as ai,NC as aj,CM as ak,pp as al,eP as am,Bi as an,zl as ao,lt as ap,df as aq,Vi as ar,YA as as,On as at,Ht as au,yh as av,JR as aw,mi as ax,ia as ay,Di as az,HV as b,Ke as b0,ih as b1,Io as b2,Tn as b3,Hi as b4,Al as b5,un as b6,mP as b7,Kr as b8,M1 as b9,Tl as bA,jl as bB,qR as bC,J2 as bD,zo as bE,ei as bF,xw as bG,Vn as bH,ux as bI,zi as bJ,nt as bK,$r as ba,hM as bb,ZR as bc,i1 as bd,s1 as be,r1 as bf,Nn as bg,Ep as bh,_r as bi,Ys as bj,GM as bk,WM as bl,XM as bm,_n as bn,RM as bo,dM as bp,Yo as bq,MR as br,CR as bs,Zm as bt,sg as bu,mM as bv,gM as bw,Km as bx,rt as by,pr as bz,Vw as c,Ui as d,Ge as e,it as f,Zs as g,Au as h,bV as i,KT as j,CV as k,Xg as l,Qx as m,Rf as n,il as o,Pf as p,EV as q,TV as r,GV as s,NV as t,Ft as u,UV as v,ft as w,Et as x,_T as y,OV as z};