@abi-software/scaffoldvuer 1.15.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * @license MIT
5
5
  **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Lo=()=>{},Rw=Object.prototype.hasOwnProperty,ep=(n,e)=>Rw.call(n,e),Nt=Array.isArray,Jt=n=>typeof n=="function",Bt=n=>typeof n=="string",Kt=n=>n!==null&&typeof n=="object",Fw=Object.prototype.toString,Pw=n=>Fw.call(n),Qc=n=>Pw(n).slice(8,-1),eu=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Iw=/-(\w)/g,Ow=eu(n=>n.replace(Iw,(e,t)=>t?t.toUpperCase():"")),Nw=/\B([A-Z])/g,Bw=eu(n=>n.replace(Nw,"-$1").toLowerCase()),Dw=eu(n=>n.charAt(0).toUpperCase()+n.slice(1));var tp=typeof global=="object"&&global&&global.Object===Object&&global,kw=typeof self=="object"&&self&&self.Object===Object&&self,Vn=tp||kw||Function("return this")(),zn=Vn.Symbol,np=Object.prototype,Vw=np.hasOwnProperty,zw=np.toString,Ro=zn?zn.toStringTag:void 0;function Uw(n){var e=Vw.call(n,Ro),t=n[Ro];try{n[Ro]=void 0;var i=!0}catch{}var r=zw.call(n);return i&&(e?n[Ro]=t:delete n[Ro]),r}var Gw=Object.prototype,Hw=Gw.toString;function Ww(n){return Hw.call(n)}var jw="[object Null]",$w="[object Undefined]",ip=zn?zn.toStringTag:void 0;function us(n){return n==null?n===void 0?$w:jw:ip&&ip in Object(n)?Uw(n):Ww(n)}function ds(n){return n!=null&&typeof n=="object"}var Zw="[object Symbol]";function Xa(n){return typeof n=="symbol"||ds(n)&&us(n)==Zw}function Xw(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t<i;)r[t]=e(n[t],t,n);return r}var Tn=Array.isArray,rp=zn?zn.prototype:void 0,sp=rp?rp.toString:void 0;function op(n){if(typeof n=="string")return n;if(Tn(n))return Xw(n,op)+"";if(Xa(n))return sp?sp.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}var Yw=/\s/;function Jw(n){for(var e=n.length;e--&&Yw.test(n.charAt(e)););return e}var Kw=/^\s+/;function qw(n){return n&&n.slice(0,Jw(n)+1).replace(Kw,"")}function Vi(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var ap=NaN,Qw=/^[-+]0x[0-9a-f]+$/i,eM=/^0b[01]+$/i,tM=/^0o[0-7]+$/i,nM=parseInt;function lp(n){if(typeof n=="number")return n;if(Xa(n))return ap;if(Vi(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Vi(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=qw(n);var t=eM.test(n);return t||tM.test(n)?nM(n.slice(2),t?2:8):Qw.test(n)?ap:+n}function cp(n){return n}var iM="[object AsyncFunction]",rM="[object Function]",sM="[object GeneratorFunction]",oM="[object Proxy]";function up(n){if(!Vi(n))return!1;var e=us(n);return e==rM||e==sM||e==iM||e==oM}var tu=Vn["__core-js_shared__"],dp=function(){var n=/[^.]+$/.exec(tu&&tu.keys&&tu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function aM(n){return!!dp&&dp in n}var lM=Function.prototype,cM=lM.toString;function Mr(n){if(n!=null){try{return cM.call(n)}catch{}try{return n+""}catch{}}return""}var uM=/[\\^$.*+?()[\]{}|]/g,dM=/^\[object .+?Constructor\]$/,hM=Function.prototype,fM=Object.prototype,pM=hM.toString,mM=fM.hasOwnProperty,gM=RegExp("^"+pM.call(mM).replace(uM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vM(n){if(!Vi(n)||aM(n))return!1;var e=up(n)?gM:dM;return e.test(Mr(n))}function yM(n,e){return n==null?void 0:n[e]}function Ar(n,e){var t=yM(n,e);return vM(t)?t:void 0}var nu=Ar(Vn,"WeakMap");function bM(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var xM=800,wM=16,MM=Date.now;function AM(n){var e=0,t=0;return function(){var i=MM(),r=wM-(i-t);if(t=i,r>0){if(++e>=xM)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function SM(n){return function(){return n}}var Ya=function(){try{var n=Ar(Object,"defineProperty");return n({},"",{}),n}catch{}}(),_M=Ya?function(n,e){return Ya(n,"toString",{configurable:!0,enumerable:!1,value:SM(e),writable:!0})}:cp,TM=AM(_M);function EM(n,e,t,i){n.length;for(var r=t+1;r--;)if(e(n[r],r,n))return r;return-1}var CM=9007199254740991,LM=/^(?:0|[1-9]\d*)$/;function iu(n,e){var t=typeof n;return e=e??CM,!!e&&(t=="number"||t!="symbol"&&LM.test(n))&&n>-1&&n%1==0&&n<e}function hp(n,e,t){e=="__proto__"&&Ya?Ya(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ru(n,e){return n===e||n!==n&&e!==e}var RM=Object.prototype,FM=RM.hasOwnProperty;function PM(n,e,t){var i=n[e];(!(FM.call(n,e)&&ru(i,t))||t===void 0&&!(e in n))&&hp(n,e,t)}var fp=Math.max;function IM(n,e,t){return e=fp(e===void 0?n.length-1:e,0),function(){for(var i=arguments,r=-1,s=fp(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=t(o),bM(n,this,l)}}var OM=9007199254740991;function su(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=OM}function NM(n){return n!=null&&su(n.length)&&!up(n)}var BM=Object.prototype;function DM(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||BM;return n===t}function kM(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var VM="[object Arguments]";function pp(n){return ds(n)&&us(n)==VM}var mp=Object.prototype,zM=mp.hasOwnProperty,UM=mp.propertyIsEnumerable,ou=pp(function(){return arguments}())?pp:function(n){return ds(n)&&zM.call(n,"callee")&&!UM.call(n,"callee")};function GM(){return!1}var gp=typeof Ot=="object"&&Ot&&!Ot.nodeType&&Ot,vp=gp&&typeof module=="object"&&module&&!module.nodeType&&module,HM=vp&&vp.exports===gp,yp=HM?Vn.Buffer:void 0,WM=yp?yp.isBuffer:void 0,au=WM||GM,jM="[object Arguments]",$M="[object Array]",ZM="[object Boolean]",XM="[object Date]",YM="[object Error]",JM="[object Function]",KM="[object Map]",qM="[object Number]",QM="[object Object]",e1="[object RegExp]",t1="[object Set]",n1="[object String]",i1="[object WeakMap]",r1="[object ArrayBuffer]",s1="[object DataView]",o1="[object Float32Array]",a1="[object Float64Array]",l1="[object Int8Array]",c1="[object Int16Array]",u1="[object Int32Array]",d1="[object Uint8Array]",h1="[object Uint8ClampedArray]",f1="[object Uint16Array]",p1="[object Uint32Array]",lt={};lt[o1]=lt[a1]=lt[l1]=lt[c1]=lt[u1]=lt[d1]=lt[h1]=lt[f1]=lt[p1]=!0,lt[jM]=lt[$M]=lt[r1]=lt[ZM]=lt[s1]=lt[XM]=lt[YM]=lt[JM]=lt[KM]=lt[qM]=lt[QM]=lt[e1]=lt[t1]=lt[n1]=lt[i1]=!1;function m1(n){return ds(n)&&su(n.length)&&!!lt[us(n)]}function g1(n){return function(e){return n(e)}}var bp=typeof Ot=="object"&&Ot&&!Ot.nodeType&&Ot,Fo=bp&&typeof module=="object"&&module&&!module.nodeType&&module,v1=Fo&&Fo.exports===bp,lu=v1&&tp.process,xp=function(){try{var n=Fo&&Fo.require&&Fo.require("util").types;return n||lu&&lu.binding&&lu.binding("util")}catch{}}(),wp=xp&&xp.isTypedArray,Mp=wp?g1(wp):m1,y1=Object.prototype,b1=y1.hasOwnProperty;function x1(n,e){var t=Tn(n),i=!t&&ou(n),r=!t&&!i&&au(n),s=!t&&!i&&!r&&Mp(n),o=t||i||r||s,l=o?kM(n.length,String):[],u=l.length;for(var c in n)b1.call(n,c)&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||iu(c,u)))&&l.push(c);return l}function w1(n,e){return function(t){return n(e(t))}}var M1=w1(Object.keys,Object),A1=Object.prototype,S1=A1.hasOwnProperty;function _1(n){if(!DM(n))return M1(n);var e=[];for(var t in Object(n))S1.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ap(n){return NM(n)?x1(n):_1(n)}var T1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,E1=/^\w*$/;function cu(n,e){if(Tn(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||Xa(n)?!0:E1.test(n)||!T1.test(n)||e!=null&&n in Object(e)}var Po=Ar(Object,"create");function C1(){this.__data__=Po?Po(null):{},this.size=0}function L1(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var R1="__lodash_hash_undefined__",F1=Object.prototype,P1=F1.hasOwnProperty;function I1(n){var e=this.__data__;if(Po){var t=e[n];return t===R1?void 0:t}return P1.call(e,n)?e[n]:void 0}var O1=Object.prototype,N1=O1.hasOwnProperty;function B1(n){var e=this.__data__;return Po?e[n]!==void 0:N1.call(e,n)}var D1="__lodash_hash_undefined__";function k1(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Po&&e===void 0?D1:e,this}function Sr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}Sr.prototype.clear=C1,Sr.prototype.delete=L1,Sr.prototype.get=I1,Sr.prototype.has=B1,Sr.prototype.set=k1;function V1(){this.__data__=[],this.size=0}function Ja(n,e){for(var t=n.length;t--;)if(ru(n[t][0],e))return t;return-1}var z1=Array.prototype,U1=z1.splice;function G1(n){var e=this.__data__,t=Ja(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():U1.call(e,t,1),--this.size,!0}function H1(n){var e=this.__data__,t=Ja(e,n);return t<0?void 0:e[t][1]}function W1(n){return Ja(this.__data__,n)>-1}function j1(n,e){var t=this.__data__,i=Ja(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function ui(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}ui.prototype.clear=V1,ui.prototype.delete=G1,ui.prototype.get=H1,ui.prototype.has=W1,ui.prototype.set=j1;var Io=Ar(Vn,"Map");function $1(){this.size=0,this.__data__={hash:new Sr,map:new(Io||ui),string:new Sr}}function Z1(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ka(n,e){var t=n.__data__;return Z1(e)?t[typeof e=="string"?"string":"hash"]:t.map}function X1(n){var e=Ka(this,n).delete(n);return this.size-=e?1:0,e}function Y1(n){return Ka(this,n).get(n)}function J1(n){return Ka(this,n).has(n)}function K1(n,e){var t=Ka(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function di(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}di.prototype.clear=$1,di.prototype.delete=X1,di.prototype.get=Y1,di.prototype.has=J1,di.prototype.set=K1;var q1="Expected a function";function uu(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(q1);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=t.cache;if(s.has(r))return s.get(r);var o=n.apply(this,i);return t.cache=s.set(r,o)||s,o};return t.cache=new(uu.Cache||di),t}uu.Cache=di;var Q1=500;function eA(n){var e=uu(n,function(i){return t.size===Q1&&t.clear(),i}),t=e.cache;return e}var tA=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nA=/\\(\\)?/g,iA=eA(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(tA,function(t,i,r,s){e.push(r?s.replace(nA,"$1"):i||t)}),e});function rA(n){return n==null?"":op(n)}function qa(n,e){return Tn(n)?n:cu(n,e)?[n]:iA(rA(n))}function Oo(n){if(typeof n=="string"||Xa(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function du(n,e){e=qa(e,n);for(var t=0,i=e.length;n!=null&&t<i;)n=n[Oo(e[t++])];return t&&t==i?n:void 0}function hi(n,e,t){var i=n==null?void 0:du(n,e);return i===void 0?t:i}function Sp(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var _p=zn?zn.isConcatSpreadable:void 0;function sA(n){return Tn(n)||ou(n)||!!(_p&&n&&n[_p])}function oA(n,e,t,i,r){var s=-1,o=n.length;for(t||(t=sA),r||(r=[]);++s<o;){var l=n[s];t(l)?Sp(r,l):r[r.length]=l}return r}function aA(n){var e=n==null?0:n.length;return e?oA(n):[]}function lA(n){return TM(IM(n,void 0,aA),n+"")}function Un(){if(!arguments.length)return[];var n=arguments[0];return Tn(n)?n:[n]}function cA(){this.__data__=new ui,this.size=0}function uA(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function dA(n){return this.__data__.get(n)}function hA(n){return this.__data__.has(n)}var fA=200;function pA(n,e){var t=this.__data__;if(t instanceof ui){var i=t.__data__;if(!Io||i.length<fA-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new di(i)}return t.set(n,e),this.size=t.size,this}function fi(n){var e=this.__data__=new ui(n);this.size=e.size}fi.prototype.clear=cA,fi.prototype.delete=uA,fi.prototype.get=dA,fi.prototype.has=hA,fi.prototype.set=pA;function mA(n,e){for(var t=-1,i=n==null?0:n.length,r=0,s=[];++t<i;){var o=n[t];e(o,t,n)&&(s[r++]=o)}return s}function gA(){return[]}var vA=Object.prototype,yA=vA.propertyIsEnumerable,Tp=Object.getOwnPropertySymbols,bA=Tp?function(n){return n==null?[]:(n=Object(n),mA(Tp(n),function(e){return yA.call(n,e)}))}:gA;function xA(n,e,t){var i=e(n);return Tn(n)?i:Sp(i,t(n))}function Ep(n){return xA(n,Ap,bA)}var hu=Ar(Vn,"DataView"),fu=Ar(Vn,"Promise"),pu=Ar(Vn,"Set"),Cp="[object Map]",wA="[object Object]",Lp="[object Promise]",Rp="[object Set]",Fp="[object WeakMap]",Pp="[object DataView]",MA=Mr(hu),AA=Mr(Io),SA=Mr(fu),_A=Mr(pu),TA=Mr(nu),zi=us;(hu&&zi(new hu(new ArrayBuffer(1)))!=Pp||Io&&zi(new Io)!=Cp||fu&&zi(fu.resolve())!=Lp||pu&&zi(new pu)!=Rp||nu&&zi(new nu)!=Fp)&&(zi=function(n){var e=us(n),t=e==wA?n.constructor:void 0,i=t?Mr(t):"";if(i)switch(i){case MA:return Pp;case AA:return Cp;case SA:return Lp;case _A:return Rp;case TA:return Fp}return e});var Ip=Vn.Uint8Array,EA="__lodash_hash_undefined__";function CA(n){return this.__data__.set(n,EA),this}function LA(n){return this.__data__.has(n)}function Qa(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new di;++e<t;)this.add(n[e])}Qa.prototype.add=Qa.prototype.push=CA,Qa.prototype.has=LA;function RA(n,e){for(var t=-1,i=n==null?0:n.length;++t<i;)if(e(n[t],t,n))return!0;return!1}function FA(n,e){return n.has(e)}var PA=1,IA=2;function Op(n,e,t,i,r,s){var o=t&PA,l=n.length,u=e.length;if(l!=u&&!(o&&u>l))return!1;var c=s.get(n),f=s.get(e);if(c&&f)return c==e&&f==n;var d=-1,p=!0,g=t&IA?new Qa:void 0;for(s.set(n,e),s.set(e,n);++d<l;){var m=n[d],h=e[d];if(i)var b=o?i(h,m,d,e,n,s):i(m,h,d,n,e,s);if(b!==void 0){if(b)continue;p=!1;break}if(g){if(!RA(e,function(y,v){if(!FA(g,v)&&(m===y||r(m,y,t,i,s)))return g.push(v)})){p=!1;break}}else if(!(m===h||r(m,h,t,i,s))){p=!1;break}}return s.delete(n),s.delete(e),p}function OA(n){var e=-1,t=Array(n.size);return n.forEach(function(i,r){t[++e]=[r,i]}),t}function NA(n){var e=-1,t=Array(n.size);return n.forEach(function(i){t[++e]=i}),t}var BA=1,DA=2,kA="[object Boolean]",VA="[object Date]",zA="[object Error]",UA="[object Map]",GA="[object Number]",HA="[object RegExp]",WA="[object Set]",jA="[object String]",$A="[object Symbol]",ZA="[object ArrayBuffer]",XA="[object DataView]",Np=zn?zn.prototype:void 0,mu=Np?Np.valueOf:void 0;function YA(n,e,t,i,r,s,o){switch(t){case XA:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case ZA:return!(n.byteLength!=e.byteLength||!s(new Ip(n),new Ip(e)));case kA:case VA:case GA:return ru(+n,+e);case zA:return n.name==e.name&&n.message==e.message;case HA:case jA:return n==e+"";case UA:var l=OA;case WA:var u=i&BA;if(l||(l=NA),n.size!=e.size&&!u)return!1;var c=o.get(n);if(c)return c==e;i|=DA,o.set(n,e);var f=Op(l(n),l(e),i,r,s,o);return o.delete(n),f;case $A:if(mu)return mu.call(n)==mu.call(e)}return!1}var JA=1,KA=Object.prototype,qA=KA.hasOwnProperty;function QA(n,e,t,i,r,s){var o=t&JA,l=Ep(n),u=l.length,c=Ep(e),f=c.length;if(u!=f&&!o)return!1;for(var d=u;d--;){var p=l[d];if(!(o?p in e:qA.call(e,p)))return!1}var g=s.get(n),m=s.get(e);if(g&&m)return g==e&&m==n;var h=!0;s.set(n,e),s.set(e,n);for(var b=o;++d<u;){p=l[d];var y=n[p],v=e[p];if(i)var M=o?i(v,y,p,e,n,s):i(y,v,p,n,e,s);if(!(M===void 0?y===v||r(y,v,t,i,s):M)){h=!1;break}b||(b=p=="constructor")}if(h&&!b){var A=n.constructor,_=e.constructor;A!=_&&"constructor"in n&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof _=="function"&&_ instanceof _)&&(h=!1)}return s.delete(n),s.delete(e),h}var eS=1,Bp="[object Arguments]",Dp="[object Array]",el="[object Object]",tS=Object.prototype,kp=tS.hasOwnProperty;function nS(n,e,t,i,r,s){var o=Tn(n),l=Tn(e),u=o?Dp:zi(n),c=l?Dp:zi(e);u=u==Bp?el:u,c=c==Bp?el:c;var f=u==el,d=c==el,p=u==c;if(p&&au(n)){if(!au(e))return!1;o=!0,f=!1}if(p&&!f)return s||(s=new fi),o||Mp(n)?Op(n,e,t,i,r,s):YA(n,e,u,t,i,r,s);if(!(t&eS)){var g=f&&kp.call(n,"__wrapped__"),m=d&&kp.call(e,"__wrapped__");if(g||m){var h=g?n.value():n,b=m?e.value():e;return s||(s=new fi),r(h,b,t,i,s)}}return p?(s||(s=new fi),QA(n,e,t,i,r,s)):!1}function tl(n,e,t,i,r){return n===e?!0:n==null||e==null||!ds(n)&&!ds(e)?n!==n&&e!==e:nS(n,e,t,i,tl,r)}var iS=1,rS=2;function sS(n,e,t,i){var r=t.length,s=r;if(n==null)return!s;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<s;){o=t[r];var l=o[0],u=n[l],c=o[1];if(o[2]){if(u===void 0&&!(l in n))return!1}else{var f=new fi,d;if(!(d===void 0?tl(c,u,iS|rS,i,f):d))return!1}}return!0}function Vp(n){return n===n&&!Vi(n)}function oS(n){for(var e=Ap(n),t=e.length;t--;){var i=e[t],r=n[i];e[t]=[i,r,Vp(r)]}return e}function zp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function aS(n){var e=oS(n);return e.length==1&&e[0][2]?zp(e[0][0],e[0][1]):function(t){return t===n||sS(t,n,e)}}function lS(n,e){return n!=null&&e in Object(n)}function cS(n,e,t){e=qa(e,n);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Oo(e[i]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++i!=r?s:(r=n==null?0:n.length,!!r&&su(r)&&iu(o,r)&&(Tn(n)||ou(n)))}function Up(n,e){return n!=null&&cS(n,e,lS)}var uS=1,dS=2;function hS(n,e){return cu(n)&&Vp(e)?zp(Oo(n),e):function(t){var i=hi(t,n);return i===void 0&&i===e?Up(t,n):tl(e,i,uS|dS)}}function fS(n){return function(e){return e==null?void 0:e[n]}}function pS(n){return function(e){return du(e,n)}}function mS(n){return cu(n)?fS(Oo(n)):pS(n)}function gS(n){return typeof n=="function"?n:n==null?cp:typeof n=="object"?Tn(n)?hS(n[0],n[1]):aS(n):mS(n)}var gu=function(){return Vn.Date.now()},vS="Expected a function",yS=Math.max,bS=Math.min;function vu(n,e,t){var i,r,s,o,l,u,c=0,f=!1,d=!1,p=!0;if(typeof n!="function")throw new TypeError(vS);e=lp(e)||0,Vi(t)&&(f=!!t.leading,d="maxWait"in t,s=d?yS(lp(t.maxWait)||0,e):s,p="trailing"in t?!!t.trailing:p);function g(w){var C=i,P=r;return i=r=void 0,c=w,o=n.apply(P,C),o}function m(w){return c=w,l=setTimeout(y,e),f?g(w):o}function h(w){var C=w-u,P=w-c,R=e-C;return d?bS(R,s-P):R}function b(w){var C=w-u,P=w-c;return u===void 0||C>=e||C<0||d&&P>=s}function y(){var w=gu();if(b(w))return v(w);l=setTimeout(y,h(w))}function v(w){return l=void 0,p&&i?g(w):(i=r=void 0,o)}function M(){l!==void 0&&clearTimeout(l),c=0,i=u=r=l=void 0}function A(){return l===void 0?o:v(gu())}function _(){var w=gu(),C=b(w);if(i=arguments,r=this,u=w,C){if(l===void 0)return m(u);if(d)return clearTimeout(l),l=setTimeout(y,e),g(u)}return l===void 0&&(l=setTimeout(y,e)),o}return _.cancel=M,_.flush=A,_}function xS(n,e,t){var i=n==null?0:n.length;if(!i)return-1;var r=i-1;return EM(n,gS(e),r)}function nl(n){for(var e=-1,t=n==null?0:n.length,i={};++e<t;){var r=n[e];hp(i,r[0],r[1])}return i}function il(n,e){return tl(n,e)}function Gn(n){return n==null}function wS(n){return n===void 0}function MS(n,e,t,i){if(!Vi(n))return n;e=qa(e,n);for(var r=-1,s=e.length,o=s-1,l=n;l!=null&&++r<s;){var u=Oo(e[r]),c=t;if(u==="__proto__"||u==="constructor"||u==="prototype")return n;if(r!=o){var f=l[u];c=void 0,c===void 0&&(c=Vi(f)?f:iu(e[r+1])?[]:{})}PM(l,u,c),l=l[u]}return n}function AS(n,e,t){for(var i=-1,r=e.length,s={};++i<r;){var o=e[i],l=du(n,o);t(l,o)&&MS(s,qa(o,n),l)}return s}function SS(n,e){return AS(n,e,function(t,i){return Up(n,i)})}var Gp=lA(function(n,e){return n==null?{}:SS(n,e)});const sn=n=>n===void 0,Ui=n=>typeof n=="boolean",et=n=>typeof n=="number",_r=n=>typeof Element>"u"?!1:n instanceof Element,No=n=>Gn(n),_S=n=>Bt(n)?!Number.isNaN(Number(n)):!1,TS=(n="")=>n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Gi=n=>Dw(n),Hp=n=>Object.keys(n);class Wp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function hs(n,e){throw new Wp(`[${n}] ${e}`)}function dt(n,e){if(process.env.NODE_ENV!=="production"){const t=Bt(n)?new Wp(`[${n}] ${e}`):n;console.warn(t)}}const ES="utils/dom/style",jp=(n="")=>n.split(" ").filter(e=>!!e.trim()),$p=(n,e)=>{!n||!e.trim()||n.classList.add(...jp(e))},rl=(n,e)=>{!n||!e.trim()||n.classList.remove(...jp(e))},Bo=(n,e)=>{var t;if(!Rt||!n||!e)return"";let i=Ow(e);i==="float"&&(i="cssFloat");try{const r=n.style[i];if(r)return r;const s=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return s?s[i]:""}catch{return n.style[i]}};function sl(n,e="px"){if(!n)return"";if(et(n)||_S(n))return`${n}${e}`;if(Bt(n))return n;dt(ES,"binding value must be a string or number")}function CS(n,e){if(!Rt)return;if(!e){n.scrollTop=0;return}const t=[];let i=e.offsetParent;for(;i!==null&&n!==i&&n.contains(i);)t.push(i),i=i.offsetParent;const r=e.offsetTop+t.reduce((u,c)=>u+c.offsetTop,0),s=r+e.offsetHeight,o=n.scrollTop,l=o+n.clientHeight;r<o?n.scrollTop=r:s>l&&(n.scrollTop=s-n.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var LS=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),yu=LS,RS=a.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Hi=RS,FS=a.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Tr=FS,PS=a.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),IS=PS,OS=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),NS=OS,BS=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),bu=BS,DS=a.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),xu=DS,kS=a.defineComponent({name:"Delete",__name:"delete",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),Zp=kS,VS=a.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),zS=VS,US=a.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Xp=US,GS=a.defineComponent({name:"Minus",__name:"minus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),HS=GS,WS=a.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),ol=WS,jS=a.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),$S=jS,ZS=a.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Yp=ZS;const Jp="__epPropKey",Be=n=>n,XS=n=>Kt(n)&&!!n[Jp],al=(n,e)=>{if(!Kt(n)||XS(n))return n;const{values:t,required:i,default:r,type:s,validator:o}=n,u={type:s,required:!!i,validator:t||o?c=>{let f=!1,d=[];if(t&&(d=Array.from(t),ep(n,"default")&&d.push(r),f||(f=d.includes(c))),o&&(f||(f=o(c))),!f&&d.length>0){const p=[...new Set(d)].map(g=>JSON.stringify(g)).join(", ");a.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return f}:void 0,[Jp]:!0};return ep(n,"default")&&(u.default=r),u},$e=n=>nl(Object.entries(n).map(([e,t])=>[e,al(t,e)])),Wi=Be([String,Object,Function]),Kp={validating:Xp,success:NS,error:bu},bt=(n,e)=>{if(n.install=t=>{for(const i of[n,...Object.values(e??{})])t.component(i.name,i)},e)for(const[t,i]of Object.entries(e))n[t]=i;return n},YS=(n,e)=>(n.install=t=>{t.directive(e,n)},n),un=n=>(n.install=Lo,n),Hn={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},tt="update:modelValue",pi="change",Er="input",qp=["","default","small","large"],ll=n=>{const e=Nt(n)?n:[n],t=[];return e.forEach(i=>{var r;Nt(i)?t.push(...ll(i)):a.isVNode(i)&&Nt(i.children)?t.push(...ll(i.children)):(t.push(i),a.isVNode(i)&&((r=i.component)!=null&&r.subTree)&&t.push(...ll(i.component.subTree)))}),t},JS=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),mi=n=>n,KS=["class","style"],qS=/^on[A-Z]/,QS=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,i=a.computed(()=>((t==null?void 0:t.value)||[]).concat(KS)),r=a.getCurrentInstance();return r?a.computed(()=>{var s;return nl(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([o])=>!i.value.includes(o)&&!(e&&qS.test(o))))}):(dt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},Do=({from:n,replacement:e,scope:t,version:i,ref:r,type:s="API"},o)=>{a.watch(()=>a.unref(o),l=>{l&&dt(t,`[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead.
6
6
  For more detail, please visit: ${r}
7
- `)},{immediate:!0})};var e_={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const t_=n=>(e,t)=>n_(e,t,a.unref(n)),n_=(n,e,t)=>hi(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),i_=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:t_(n)}},Qp=Symbol("localeContextKey"),cl=n=>{const e=n||a.inject(Qp,a.ref());return i_(a.computed(()=>e.value||e_))},ul="el",r_="is-",Cr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},em=Symbol("namespaceContextKey"),wu=n=>{const e=n||(a.getCurrentInstance()?a.inject(em,a.ref(ul)):a.ref(ul));return a.computed(()=>a.unref(e)||ul)},Ge=(n,e)=>{const t=wu(e);return{namespace:t,b:(h="")=>Cr(t.value,n,h,"",""),e:h=>h?Cr(t.value,n,"",h,""):"",m:h=>h?Cr(t.value,n,"","",h):"",be:(h,b)=>h&&b?Cr(t.value,n,h,b,""):"",em:(h,b)=>h&&b?Cr(t.value,n,"",h,b):"",bm:(h,b)=>h&&b?Cr(t.value,n,h,"",b):"",bem:(h,b,y)=>h&&b&&y?Cr(t.value,n,h,b,y):"",is:(h,...b)=>{const y=b.length>=1?b[0]:!0;return h&&y?`${r_}${h}`:""},cssVar:h=>{const b={};for(const y in h)h[y]&&(b[`--${t.value}-${y}`]=h[y]);return b},cssVarName:h=>`--${t.value}-${h}`,cssVarBlock:h=>{const b={};for(const y in h)h[y]&&(b[`--${t.value}-${n}-${y}`]=h[y]);return b},cssVarBlockName:h=>`--${t.value}-${n}-${h}`}},s_=al({type:Be(Boolean),default:null}),o_=al({type:Be(Function)}),a_=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:s_,[t]:o_};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:d})=>{const p=a.getCurrentInstance(),{emit:g}=p,m=p.props,h=a.computed(()=>Jt(m[t])),b=a.computed(()=>m[n]===null),y=C=>{o.value!==!0&&(o.value=!0,l&&(l.value=C),Jt(f)&&f(C))},v=C=>{o.value!==!1&&(o.value=!1,l&&(l.value=C),Jt(d)&&d(C))},M=C=>{if(m.disabled===!0||Jt(c)&&!c())return;const P=h.value&&Rt;P&&g(e,!0),(b.value||!P)&&y(C)},A=C=>{if(m.disabled===!0||!Rt)return;const P=h.value&&Rt;P&&g(e,!1),(b.value||!P)&&v(C)},_=C=>{Ui(C)&&(m.disabled&&C?h.value&&g(e,!1):o.value!==C&&(C?y():v()))},w=()=>{o.value?A():M()};return a.watch(()=>m[n],_),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&A()}),a.onMounted(()=>{_(m[n])}),{hide:A,show:M,toggle:w,hasUpdateHandler:h}},useModelToggleProps:r,useModelToggleEmits:i}},tm=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var on="top",wn="bottom",Mn="right",an="left",Mu="auto",ko=[on,wn,Mn,an],fs="start",Vo="end",l_="clippingParents",nm="viewport",zo="popper",c_="reference",im=ko.reduce(function(n,e){return n.concat([e+"-"+fs,e+"-"+Vo])},[]),ps=[].concat(ko,[Mu]).reduce(function(n,e){return n.concat([e,e+"-"+fs,e+"-"+Vo])},[]),u_="beforeRead",d_="read",h_="afterRead",f_="beforeMain",p_="main",m_="afterMain",g_="beforeWrite",v_="write",y_="afterWrite",b_=[u_,d_,h_,f_,p_,m_,g_,v_,y_];function Wn(n){return n?(n.nodeName||"").toLowerCase():null}function En(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function ms(n){var e=En(n).Element;return n instanceof e||n instanceof Element}function An(n){var e=En(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Au(n){if(typeof ShadowRoot>"u")return!1;var e=En(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function x_(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!An(s)||!Wn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function w_(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!An(r)||!Wn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var rm={name:"applyStyles",enabled:!0,phase:"write",fn:x_,effect:w_,requires:["computeStyles"]};function jn(n){return n.split("-")[0]}var Lr=Math.max,dl=Math.min,gs=Math.round;function vs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(An(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=gs(t.width)/o||1),s>0&&(r=gs(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function Su(n){var e=vs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function sm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Au(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function gi(n){return En(n).getComputedStyle(n)}function M_(n){return["table","td","th"].indexOf(Wn(n))>=0}function ji(n){return((ms(n)?n.ownerDocument:n.document)||window.document).documentElement}function hl(n){return Wn(n)==="html"?n:n.assignedSlot||n.parentNode||(Au(n)?n.host:null)||ji(n)}function om(n){return!An(n)||gi(n).position==="fixed"?null:n.offsetParent}function A_(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&An(n)){var i=gi(n);if(i.position==="fixed")return null}var r=hl(n);for(Au(r)&&(r=r.host);An(r)&&["html","body"].indexOf(Wn(r))<0;){var s=gi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Uo(n){for(var e=En(n),t=om(n);t&&M_(t)&&gi(t).position==="static";)t=om(t);return t&&(Wn(t)==="html"||Wn(t)==="body"&&gi(t).position==="static")?e:t||A_(n)||e}function _u(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Go(n,e,t){return Lr(n,dl(e,t))}function S_(n,e,t){var i=Go(n,e,t);return i>t?t:i}function am(){return{top:0,right:0,bottom:0,left:0}}function lm(n){return Object.assign({},am(),n)}function cm(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var __=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,lm(typeof n!="number"?n:cm(n,ko))};function T_(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=jn(t.placement),u=_u(l),c=[an,Mn].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var d=__(r.padding,t),p=Su(s),g=u==="y"?on:an,m=u==="y"?wn:Mn,h=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],y=Uo(s),v=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,M=h/2-b/2,A=d[g],_=v-p[f]-d[m],w=v/2-p[f]/2+M,C=Go(A,w,_),P=u;t.modifiersData[i]=(e={},e[P]=C,e.centerOffset=C-w,e)}}function E_(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!sm(e.elements.popper,r)||(e.elements.arrow=r))}var C_={name:"arrow",enabled:!0,phase:"main",fn:T_,effect:E_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ys(n){return n.split("-")[1]}var L_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function R_(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:gs(e*r)/r||0,y:gs(t*r)/r||0}}function um(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,d=n.isFixed,p=o.x,g=p===void 0?0:p,m=o.y,h=m===void 0?0:m,b=typeof f=="function"?f({x:g,y:h}):{x:g,y:h};g=b.x,h=b.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),M=an,A=on,_=window;if(c){var w=Uo(t),C="clientHeight",P="clientWidth";if(w===En(t)&&(w=ji(t),gi(w).position!=="static"&&l==="absolute"&&(C="scrollHeight",P="scrollWidth")),w=w,r===on||(r===an||r===Mn)&&s===Vo){A=wn;var R=d&&w===_&&_.visualViewport?_.visualViewport.height:w[C];h-=R-i.height,h*=u?1:-1}if(r===an||(r===on||r===wn)&&s===Vo){M=Mn;var I=d&&w===_&&_.visualViewport?_.visualViewport.width:w[P];g-=I-i.width,g*=u?1:-1}}var S=Object.assign({position:l},c&&L_),T=f===!0?R_({x:g,y:h}):{x:g,y:h};if(g=T.x,h=T.y,u){var E;return Object.assign({},S,(E={},E[A]=v?"0":"",E[M]=y?"0":"",E.transform=(_.devicePixelRatio||1)<=1?"translate("+g+"px, "+h+"px)":"translate3d("+g+"px, "+h+"px, 0)",E))}return Object.assign({},S,(e={},e[A]=v?h+"px":"",e[M]=y?g+"px":"",e.transform="",e))}function F_(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:jn(e.placement),variation:ys(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,um(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,um(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var dm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:F_,data:{}},fl={passive:!0};function P_(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=En(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,fl)}),l&&u.addEventListener("resize",t.update,fl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,fl)}),l&&u.removeEventListener("resize",t.update,fl)}}var hm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:P_,data:{}},I_={left:"right",right:"left",bottom:"top",top:"bottom"};function pl(n){return n.replace(/left|right|bottom|top/g,function(e){return I_[e]})}var O_={start:"end",end:"start"};function fm(n){return n.replace(/start|end/g,function(e){return O_[e]})}function Tu(n){var e=En(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Eu(n){return vs(ji(n)).left+Tu(n).scrollLeft}function N_(n){var e=En(n),t=ji(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Eu(n),y:l}}function B_(n){var e,t=ji(n),i=Tu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Lr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Lr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Eu(n),u=-i.scrollTop;return gi(r||t).direction==="rtl"&&(l+=Lr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function Cu(n){var e=gi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function pm(n){return["html","body","#document"].indexOf(Wn(n))>=0?n.ownerDocument.body:An(n)&&Cu(n)?n:pm(hl(n))}function Ho(n,e){var t;e===void 0&&(e=[]);var i=pm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=En(i),o=r?[s].concat(s.visualViewport||[],Cu(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(Ho(hl(o)))}function Lu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function D_(n){var e=vs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function mm(n,e){return e===nm?Lu(N_(n)):ms(e)?D_(e):Lu(B_(ji(n)))}function k_(n){var e=Ho(hl(n)),t=["absolute","fixed"].indexOf(gi(n).position)>=0,i=t&&An(n)?Uo(n):n;return ms(i)?e.filter(function(r){return ms(r)&&sm(r,i)&&Wn(r)!=="body"}):[]}function V_(n,e,t){var i=e==="clippingParents"?k_(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=mm(n,u);return l.top=Lr(c.top,l.top),l.right=dl(c.right,l.right),l.bottom=dl(c.bottom,l.bottom),l.left=Lr(c.left,l.left),l},mm(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function gm(n){var e=n.reference,t=n.element,i=n.placement,r=i?jn(i):null,s=i?ys(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case on:u={x:o,y:e.y-t.height};break;case wn:u={x:o,y:e.y+e.height};break;case Mn:u={x:e.x+e.width,y:l};break;case an:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?_u(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case fs:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Vo:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function Wo(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?l_:s,l=t.rootBoundary,u=l===void 0?nm:l,c=t.elementContext,f=c===void 0?zo:c,d=t.altBoundary,p=d===void 0?!1:d,g=t.padding,m=g===void 0?0:g,h=lm(typeof m!="number"?m:cm(m,ko)),b=f===zo?c_:zo,y=n.rects.popper,v=n.elements[p?b:f],M=V_(ms(v)?v:v.contextElement||ji(n.elements.popper),o,u),A=vs(n.elements.reference),_=gm({reference:A,element:y,placement:r}),w=Lu(Object.assign({},y,_)),C=f===zo?w:A,P={top:M.top-C.top+h.top,bottom:C.bottom-M.bottom+h.bottom,left:M.left-C.left+h.left,right:C.right-M.right+h.right},R=n.modifiersData.offset;if(f===zo&&R){var I=R[r];Object.keys(P).forEach(function(S){var T=[Mn,wn].indexOf(S)>=0?1:-1,E=[on,wn].indexOf(S)>=0?"y":"x";P[S]+=I[E]*T})}return P}function z_(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?ps:u,f=ys(i),d=f?l?im:im.filter(function(m){return ys(m)===f}):ko,p=d.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=d);var g=p.reduce(function(m,h){return m[h]=Wo(n,{placement:h,boundary:r,rootBoundary:s,padding:o})[jn(h)],m},{});return Object.keys(g).sort(function(m,h){return g[m]-g[h]})}function U_(n){if(jn(n)===Mu)return[];var e=pl(n);return[fm(n),e,fm(e)]}function G_(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,d=t.rootBoundary,p=t.altBoundary,g=t.flipVariations,m=g===void 0?!0:g,h=t.allowedAutoPlacements,b=e.options.placement,y=jn(b),v=y===b,M=u||(v||!m?[pl(b)]:U_(b)),A=[b].concat(M).reduce(function(Z,te){return Z.concat(jn(te)===Mu?z_(e,{placement:te,boundary:f,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:h}):te)},[]),_=e.rects.reference,w=e.rects.popper,C=new Map,P=!0,R=A[0],I=0;I<A.length;I++){var S=A[I],T=jn(S),E=ys(S)===fs,L=[on,wn].indexOf(T)>=0,F=L?"width":"height",x=Wo(e,{placement:S,boundary:f,rootBoundary:d,altBoundary:p,padding:c}),O=L?E?Mn:an:E?wn:on;_[F]>w[F]&&(O=pl(O));var B=pl(O),N=[];if(s&&N.push(x[T]<=0),l&&N.push(x[O]<=0,x[B]<=0),N.every(function(Z){return Z})){R=S,P=!1;break}C.set(S,N)}if(P)for(var k=m?3:1,z=function(Z){var te=A.find(function(q){var j=C.get(q);if(j)return j.slice(0,Z).every(function($){return $})});if(te)return R=te,"break"},G=k;G>0;G--){var Y=z(G);if(Y==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}var H_={name:"flip",enabled:!0,phase:"main",fn:G_,requiresIfExists:["offset"],data:{_skip:!1}};function vm(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function ym(n){return[on,Mn,wn,an].some(function(e){return n[e]>=0})}function W_(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Wo(e,{elementContext:"reference"}),l=Wo(e,{altBoundary:!0}),u=vm(o,i),c=vm(l,r,s),f=ym(u),d=ym(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}var j_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:W_};function $_(n,e,t){var i=jn(n),r=[an,on].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[an,Mn].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function Z_(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=ps.reduce(function(f,d){return f[d]=$_(d,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var X_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Z_};function Y_(n){var e=n.state,t=n.name;e.modifiersData[t]=gm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}var bm={name:"popperOffsets",enabled:!0,phase:"read",fn:Y_,data:{}};function J_(n){return n==="x"?"y":"x"}function K_(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,d=t.padding,p=t.tether,g=p===void 0?!0:p,m=t.tetherOffset,h=m===void 0?0:m,b=Wo(e,{boundary:u,rootBoundary:c,padding:d,altBoundary:f}),y=jn(e.placement),v=ys(e.placement),M=!v,A=_u(y),_=J_(A),w=e.modifiersData.popperOffsets,C=e.rects.reference,P=e.rects.popper,R=typeof h=="function"?h(Object.assign({},e.rects,{placement:e.placement})):h,I=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,T={x:0,y:0};if(w){if(s){var E,L=A==="y"?on:an,F=A==="y"?wn:Mn,x=A==="y"?"height":"width",O=w[A],B=O+b[L],N=O-b[F],k=g?-P[x]/2:0,z=v===fs?C[x]:P[x],G=v===fs?-P[x]:-C[x],Y=e.elements.arrow,Z=g&&Y?Su(Y):{width:0,height:0},te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:am(),q=te[L],j=te[F],$=Go(0,C[x],Z[x]),X=M?C[x]/2-k-$-q-I.mainAxis:z-$-q-I.mainAxis,K=M?-C[x]/2+k+$+j+I.mainAxis:G+$+j+I.mainAxis,re=e.elements.arrow&&Uo(e.elements.arrow),V=re?A==="y"?re.clientTop||0:re.clientLeft||0:0,W=(E=S==null?void 0:S[A])!=null?E:0,oe=O+X-W-V,ae=O+K-W,le=Go(g?dl(B,oe):B,O,g?Lr(N,ae):N);w[A]=le,T[A]=le-O}if(l){var H,U=A==="x"?on:an,D=A==="x"?wn:Mn,Q=w[_],ie=_==="y"?"height":"width",ce=Q+b[U],ge=Q-b[D],ye=[on,an].indexOf(y)!==-1,ue=(H=S==null?void 0:S[_])!=null?H:0,be=ye?ce:Q-C[ie]-P[ie]-ue+I.altAxis,ne=ye?Q+C[ie]+P[ie]-ue-I.altAxis:ge,de=g&&ye?S_(be,Q,ne):Go(g?be:ce,Q,g?ne:ge);w[_]=de,T[_]=de-Q}e.modifiersData[i]=T}}var q_={name:"preventOverflow",enabled:!0,phase:"main",fn:K_,requiresIfExists:["offset"]};function Q_(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function eT(n){return n===En(n)||!An(n)?Tu(n):Q_(n)}function tT(n){var e=n.getBoundingClientRect(),t=gs(e.width)/n.offsetWidth||1,i=gs(e.height)/n.offsetHeight||1;return t!==1||i!==1}function nT(n,e,t){t===void 0&&(t=!1);var i=An(e),r=An(e)&&tT(e),s=ji(e),o=vs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((Wn(e)!=="body"||Cu(s))&&(l=eT(e)),An(e)?(u=vs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Eu(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function iT(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function rT(n){var e=iT(n);return b_.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function sT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function oT(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var xm={placement:"bottom",modifiers:[],strategy:"absolute"};function wm(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Ru(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?xm:r;return function(o,l,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},xm,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],d=!1,p={state:c,setOptions:function(h){var b=typeof h=="function"?h(c.options):h;m(),c.options=Object.assign({},s,c.options,b),c.scrollParents={reference:ms(o)?Ho(o):o.contextElement?Ho(o.contextElement):[],popper:Ho(l)};var y=rT(oT([].concat(i,c.options.modifiers)));return c.orderedModifiers=y.filter(function(v){return v.enabled}),g(),p.update()},forceUpdate:function(){if(!d){var h=c.elements,b=h.reference,y=h.popper;if(wm(b,y)){c.rects={reference:nT(b,Uo(y),c.options.strategy==="fixed"),popper:Su(y)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(P){return c.modifiersData[P.name]=Object.assign({},P.data)});for(var v=0;v<c.orderedModifiers.length;v++){if(c.reset===!0){c.reset=!1,v=-1;continue}var M=c.orderedModifiers[v],A=M.fn,_=M.options,w=_===void 0?{}:_,C=M.name;typeof A=="function"&&(c=A({state:c,options:w,name:C,instance:p})||c)}}}},update:sT(function(){return new Promise(function(h){p.forceUpdate(),h(c)})}),destroy:function(){m(),d=!0}};if(!wm(o,l))return p;p.setOptions(u).then(function(h){!d&&u.onFirstUpdate&&u.onFirstUpdate(h)});function g(){c.orderedModifiers.forEach(function(h){var b=h.name,y=h.options,v=y===void 0?{}:y,M=h.effect;if(typeof M=="function"){var A=M({state:c,name:b,instance:p,options:v}),_=function(){};f.push(A||_)}})}function m(){f.forEach(function(h){return h()}),f=[]}return p}}Ru();var aT=[hm,bm,dm,rm];Ru({defaultModifiers:aT});var lT=[hm,bm,dm,rm,X_,H_,q_,C_,j_],cT=Ru({defaultModifiers:lT});const uT=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=dT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:d}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...d||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=cT(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function dT(n){const e=Object.keys(n.elements),t=nl(e.map(r=>[r,n.styles[r]||{}])),i=nl(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function Mm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Za(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Fu={prefix:Math.floor(Math.random()*1e4),current:0},hT=Symbol("elIdInjection"),Pu=()=>a.getCurrentInstance()?a.inject(hT,Fu):Fu,jo=n=>{const e=Pu();!Rt&&e===Fu&&dt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
7
+ `)},{immediate:!0})};var e_={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const t_=n=>(e,t)=>n_(e,t,a.unref(n)),n_=(n,e,t)=>hi(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),i_=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:t_(n)}},Qp=Symbol("localeContextKey"),cl=n=>{const e=n||a.inject(Qp,a.ref());return i_(a.computed(()=>e.value||e_))},ul="el",r_="is-",Cr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},em=Symbol("namespaceContextKey"),wu=n=>{const e=n||(a.getCurrentInstance()?a.inject(em,a.ref(ul)):a.ref(ul));return a.computed(()=>a.unref(e)||ul)},Ge=(n,e)=>{const t=wu(e);return{namespace:t,b:(h="")=>Cr(t.value,n,h,"",""),e:h=>h?Cr(t.value,n,"",h,""):"",m:h=>h?Cr(t.value,n,"","",h):"",be:(h,b)=>h&&b?Cr(t.value,n,h,b,""):"",em:(h,b)=>h&&b?Cr(t.value,n,"",h,b):"",bm:(h,b)=>h&&b?Cr(t.value,n,h,"",b):"",bem:(h,b,y)=>h&&b&&y?Cr(t.value,n,h,b,y):"",is:(h,...b)=>{const y=b.length>=1?b[0]:!0;return h&&y?`${r_}${h}`:""},cssVar:h=>{const b={};for(const y in h)h[y]&&(b[`--${t.value}-${y}`]=h[y]);return b},cssVarName:h=>`--${t.value}-${h}`,cssVarBlock:h=>{const b={};for(const y in h)h[y]&&(b[`--${t.value}-${n}-${y}`]=h[y]);return b},cssVarBlockName:h=>`--${t.value}-${n}-${h}`}},s_=al({type:Be(Boolean),default:null}),o_=al({type:Be(Function)}),a_=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:s_,[t]:o_};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:d})=>{const p=a.getCurrentInstance(),{emit:g}=p,m=p.props,h=a.computed(()=>Jt(m[t])),b=a.computed(()=>m[n]===null),y=C=>{o.value!==!0&&(o.value=!0,l&&(l.value=C),Jt(f)&&f(C))},v=C=>{o.value!==!1&&(o.value=!1,l&&(l.value=C),Jt(d)&&d(C))},M=C=>{if(m.disabled===!0||Jt(c)&&!c())return;const P=h.value&&Rt;P&&g(e,!0),(b.value||!P)&&y(C)},A=C=>{if(m.disabled===!0||!Rt)return;const P=h.value&&Rt;P&&g(e,!1),(b.value||!P)&&v(C)},_=C=>{Ui(C)&&(m.disabled&&C?h.value&&g(e,!1):o.value!==C&&(C?y():v()))},w=()=>{o.value?A():M()};return a.watch(()=>m[n],_),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&A()}),a.onMounted(()=>{_(m[n])}),{hide:A,show:M,toggle:w,hasUpdateHandler:h}},useModelToggleProps:r,useModelToggleEmits:i}},tm=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var on="top",wn="bottom",Mn="right",an="left",Mu="auto",ko=[on,wn,Mn,an],fs="start",Vo="end",l_="clippingParents",nm="viewport",zo="popper",c_="reference",im=ko.reduce(function(n,e){return n.concat([e+"-"+fs,e+"-"+Vo])},[]),ps=[].concat(ko,[Mu]).reduce(function(n,e){return n.concat([e,e+"-"+fs,e+"-"+Vo])},[]),u_="beforeRead",d_="read",h_="afterRead",f_="beforeMain",p_="main",m_="afterMain",g_="beforeWrite",v_="write",y_="afterWrite",b_=[u_,d_,h_,f_,p_,m_,g_,v_,y_];function Wn(n){return n?(n.nodeName||"").toLowerCase():null}function En(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function ms(n){var e=En(n).Element;return n instanceof e||n instanceof Element}function An(n){var e=En(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Au(n){if(typeof ShadowRoot>"u")return!1;var e=En(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function x_(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!An(s)||!Wn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function w_(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!An(r)||!Wn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var rm={name:"applyStyles",enabled:!0,phase:"write",fn:x_,effect:w_,requires:["computeStyles"]};function jn(n){return n.split("-")[0]}var Lr=Math.max,dl=Math.min,gs=Math.round;function vs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(An(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=gs(t.width)/o||1),s>0&&(r=gs(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function Su(n){var e=vs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function sm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Au(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function gi(n){return En(n).getComputedStyle(n)}function M_(n){return["table","td","th"].indexOf(Wn(n))>=0}function ji(n){return((ms(n)?n.ownerDocument:n.document)||window.document).documentElement}function hl(n){return Wn(n)==="html"?n:n.assignedSlot||n.parentNode||(Au(n)?n.host:null)||ji(n)}function om(n){return!An(n)||gi(n).position==="fixed"?null:n.offsetParent}function A_(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&An(n)){var i=gi(n);if(i.position==="fixed")return null}var r=hl(n);for(Au(r)&&(r=r.host);An(r)&&["html","body"].indexOf(Wn(r))<0;){var s=gi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Uo(n){for(var e=En(n),t=om(n);t&&M_(t)&&gi(t).position==="static";)t=om(t);return t&&(Wn(t)==="html"||Wn(t)==="body"&&gi(t).position==="static")?e:t||A_(n)||e}function _u(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Go(n,e,t){return Lr(n,dl(e,t))}function S_(n,e,t){var i=Go(n,e,t);return i>t?t:i}function am(){return{top:0,right:0,bottom:0,left:0}}function lm(n){return Object.assign({},am(),n)}function cm(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var __=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,lm(typeof n!="number"?n:cm(n,ko))};function T_(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=jn(t.placement),u=_u(l),c=[an,Mn].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var d=__(r.padding,t),p=Su(s),g=u==="y"?on:an,m=u==="y"?wn:Mn,h=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],y=Uo(s),v=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,M=h/2-b/2,A=d[g],_=v-p[f]-d[m],w=v/2-p[f]/2+M,C=Go(A,w,_),P=u;t.modifiersData[i]=(e={},e[P]=C,e.centerOffset=C-w,e)}}function E_(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!sm(e.elements.popper,r)||(e.elements.arrow=r))}var C_={name:"arrow",enabled:!0,phase:"main",fn:T_,effect:E_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ys(n){return n.split("-")[1]}var L_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function R_(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:gs(e*r)/r||0,y:gs(t*r)/r||0}}function um(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,d=n.isFixed,p=o.x,g=p===void 0?0:p,m=o.y,h=m===void 0?0:m,b=typeof f=="function"?f({x:g,y:h}):{x:g,y:h};g=b.x,h=b.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),M=an,A=on,_=window;if(c){var w=Uo(t),C="clientHeight",P="clientWidth";if(w===En(t)&&(w=ji(t),gi(w).position!=="static"&&l==="absolute"&&(C="scrollHeight",P="scrollWidth")),w=w,r===on||(r===an||r===Mn)&&s===Vo){A=wn;var R=d&&w===_&&_.visualViewport?_.visualViewport.height:w[C];h-=R-i.height,h*=u?1:-1}if(r===an||(r===on||r===wn)&&s===Vo){M=Mn;var I=d&&w===_&&_.visualViewport?_.visualViewport.width:w[P];g-=I-i.width,g*=u?1:-1}}var S=Object.assign({position:l},c&&L_),T=f===!0?R_({x:g,y:h}):{x:g,y:h};if(g=T.x,h=T.y,u){var E;return Object.assign({},S,(E={},E[A]=v?"0":"",E[M]=y?"0":"",E.transform=(_.devicePixelRatio||1)<=1?"translate("+g+"px, "+h+"px)":"translate3d("+g+"px, "+h+"px, 0)",E))}return Object.assign({},S,(e={},e[A]=v?h+"px":"",e[M]=y?g+"px":"",e.transform="",e))}function F_(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:jn(e.placement),variation:ys(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,um(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,um(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var dm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:F_,data:{}},fl={passive:!0};function P_(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=En(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,fl)}),l&&u.addEventListener("resize",t.update,fl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,fl)}),l&&u.removeEventListener("resize",t.update,fl)}}var hm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:P_,data:{}},I_={left:"right",right:"left",bottom:"top",top:"bottom"};function pl(n){return n.replace(/left|right|bottom|top/g,function(e){return I_[e]})}var O_={start:"end",end:"start"};function fm(n){return n.replace(/start|end/g,function(e){return O_[e]})}function Tu(n){var e=En(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Eu(n){return vs(ji(n)).left+Tu(n).scrollLeft}function N_(n){var e=En(n),t=ji(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Eu(n),y:l}}function B_(n){var e,t=ji(n),i=Tu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Lr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Lr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Eu(n),u=-i.scrollTop;return gi(r||t).direction==="rtl"&&(l+=Lr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function Cu(n){var e=gi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function pm(n){return["html","body","#document"].indexOf(Wn(n))>=0?n.ownerDocument.body:An(n)&&Cu(n)?n:pm(hl(n))}function Ho(n,e){var t;e===void 0&&(e=[]);var i=pm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=En(i),o=r?[s].concat(s.visualViewport||[],Cu(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(Ho(hl(o)))}function Lu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function D_(n){var e=vs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function mm(n,e){return e===nm?Lu(N_(n)):ms(e)?D_(e):Lu(B_(ji(n)))}function k_(n){var e=Ho(hl(n)),t=["absolute","fixed"].indexOf(gi(n).position)>=0,i=t&&An(n)?Uo(n):n;return ms(i)?e.filter(function(r){return ms(r)&&sm(r,i)&&Wn(r)!=="body"}):[]}function V_(n,e,t){var i=e==="clippingParents"?k_(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=mm(n,u);return l.top=Lr(c.top,l.top),l.right=dl(c.right,l.right),l.bottom=dl(c.bottom,l.bottom),l.left=Lr(c.left,l.left),l},mm(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function gm(n){var e=n.reference,t=n.element,i=n.placement,r=i?jn(i):null,s=i?ys(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case on:u={x:o,y:e.y-t.height};break;case wn:u={x:o,y:e.y+e.height};break;case Mn:u={x:e.x+e.width,y:l};break;case an:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?_u(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case fs:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Vo:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function Wo(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?l_:s,l=t.rootBoundary,u=l===void 0?nm:l,c=t.elementContext,f=c===void 0?zo:c,d=t.altBoundary,p=d===void 0?!1:d,g=t.padding,m=g===void 0?0:g,h=lm(typeof m!="number"?m:cm(m,ko)),b=f===zo?c_:zo,y=n.rects.popper,v=n.elements[p?b:f],M=V_(ms(v)?v:v.contextElement||ji(n.elements.popper),o,u),A=vs(n.elements.reference),_=gm({reference:A,element:y,placement:r}),w=Lu(Object.assign({},y,_)),C=f===zo?w:A,P={top:M.top-C.top+h.top,bottom:C.bottom-M.bottom+h.bottom,left:M.left-C.left+h.left,right:C.right-M.right+h.right},R=n.modifiersData.offset;if(f===zo&&R){var I=R[r];Object.keys(P).forEach(function(S){var T=[Mn,wn].indexOf(S)>=0?1:-1,E=[on,wn].indexOf(S)>=0?"y":"x";P[S]+=I[E]*T})}return P}function z_(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?ps:u,f=ys(i),d=f?l?im:im.filter(function(m){return ys(m)===f}):ko,p=d.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=d);var g=p.reduce(function(m,h){return m[h]=Wo(n,{placement:h,boundary:r,rootBoundary:s,padding:o})[jn(h)],m},{});return Object.keys(g).sort(function(m,h){return g[m]-g[h]})}function U_(n){if(jn(n)===Mu)return[];var e=pl(n);return[fm(n),e,fm(e)]}function G_(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,d=t.rootBoundary,p=t.altBoundary,g=t.flipVariations,m=g===void 0?!0:g,h=t.allowedAutoPlacements,b=e.options.placement,y=jn(b),v=y===b,M=u||(v||!m?[pl(b)]:U_(b)),A=[b].concat(M).reduce(function(Z,te){return Z.concat(jn(te)===Mu?z_(e,{placement:te,boundary:f,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:h}):te)},[]),_=e.rects.reference,w=e.rects.popper,C=new Map,P=!0,R=A[0],I=0;I<A.length;I++){var S=A[I],T=jn(S),E=ys(S)===fs,L=[on,wn].indexOf(T)>=0,F=L?"width":"height",x=Wo(e,{placement:S,boundary:f,rootBoundary:d,altBoundary:p,padding:c}),O=L?E?Mn:an:E?wn:on;_[F]>w[F]&&(O=pl(O));var B=pl(O),N=[];if(s&&N.push(x[T]<=0),l&&N.push(x[O]<=0,x[B]<=0),N.every(function(Z){return Z})){R=S,P=!1;break}C.set(S,N)}if(P)for(var k=m?3:1,z=function(Z){var te=A.find(function(q){var W=C.get(q);if(W)return W.slice(0,Z).every(function($){return $})});if(te)return R=te,"break"},G=k;G>0;G--){var Y=z(G);if(Y==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}var H_={name:"flip",enabled:!0,phase:"main",fn:G_,requiresIfExists:["offset"],data:{_skip:!1}};function vm(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function ym(n){return[on,Mn,wn,an].some(function(e){return n[e]>=0})}function W_(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Wo(e,{elementContext:"reference"}),l=Wo(e,{altBoundary:!0}),u=vm(o,i),c=vm(l,r,s),f=ym(u),d=ym(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}var j_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:W_};function $_(n,e,t){var i=jn(n),r=[an,on].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[an,Mn].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function Z_(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=ps.reduce(function(f,d){return f[d]=$_(d,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var X_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Z_};function Y_(n){var e=n.state,t=n.name;e.modifiersData[t]=gm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}var bm={name:"popperOffsets",enabled:!0,phase:"read",fn:Y_,data:{}};function J_(n){return n==="x"?"y":"x"}function K_(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,d=t.padding,p=t.tether,g=p===void 0?!0:p,m=t.tetherOffset,h=m===void 0?0:m,b=Wo(e,{boundary:u,rootBoundary:c,padding:d,altBoundary:f}),y=jn(e.placement),v=ys(e.placement),M=!v,A=_u(y),_=J_(A),w=e.modifiersData.popperOffsets,C=e.rects.reference,P=e.rects.popper,R=typeof h=="function"?h(Object.assign({},e.rects,{placement:e.placement})):h,I=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,T={x:0,y:0};if(w){if(s){var E,L=A==="y"?on:an,F=A==="y"?wn:Mn,x=A==="y"?"height":"width",O=w[A],B=O+b[L],N=O-b[F],k=g?-P[x]/2:0,z=v===fs?C[x]:P[x],G=v===fs?-P[x]:-C[x],Y=e.elements.arrow,Z=g&&Y?Su(Y):{width:0,height:0},te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:am(),q=te[L],W=te[F],$=Go(0,C[x],Z[x]),X=M?C[x]/2-k-$-q-I.mainAxis:z-$-q-I.mainAxis,K=M?-C[x]/2+k+$+W+I.mainAxis:G+$+W+I.mainAxis,re=e.elements.arrow&&Uo(e.elements.arrow),V=re?A==="y"?re.clientTop||0:re.clientLeft||0:0,j=(E=S==null?void 0:S[A])!=null?E:0,oe=O+X-j-V,ae=O+K-j,le=Go(g?dl(B,oe):B,O,g?Lr(N,ae):N);w[A]=le,T[A]=le-O}if(l){var H,U=A==="x"?on:an,D=A==="x"?wn:Mn,Q=w[_],ie=_==="y"?"height":"width",ce=Q+b[U],ge=Q-b[D],ye=[on,an].indexOf(y)!==-1,ue=(H=S==null?void 0:S[_])!=null?H:0,be=ye?ce:Q-C[ie]-P[ie]-ue+I.altAxis,ne=ye?Q+C[ie]+P[ie]-ue-I.altAxis:ge,de=g&&ye?S_(be,Q,ne):Go(g?be:ce,Q,g?ne:ge);w[_]=de,T[_]=de-Q}e.modifiersData[i]=T}}var q_={name:"preventOverflow",enabled:!0,phase:"main",fn:K_,requiresIfExists:["offset"]};function Q_(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function eT(n){return n===En(n)||!An(n)?Tu(n):Q_(n)}function tT(n){var e=n.getBoundingClientRect(),t=gs(e.width)/n.offsetWidth||1,i=gs(e.height)/n.offsetHeight||1;return t!==1||i!==1}function nT(n,e,t){t===void 0&&(t=!1);var i=An(e),r=An(e)&&tT(e),s=ji(e),o=vs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((Wn(e)!=="body"||Cu(s))&&(l=eT(e)),An(e)?(u=vs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Eu(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function iT(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function rT(n){var e=iT(n);return b_.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function sT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function oT(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var xm={placement:"bottom",modifiers:[],strategy:"absolute"};function wm(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Ru(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?xm:r;return function(o,l,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},xm,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],d=!1,p={state:c,setOptions:function(h){var b=typeof h=="function"?h(c.options):h;m(),c.options=Object.assign({},s,c.options,b),c.scrollParents={reference:ms(o)?Ho(o):o.contextElement?Ho(o.contextElement):[],popper:Ho(l)};var y=rT(oT([].concat(i,c.options.modifiers)));return c.orderedModifiers=y.filter(function(v){return v.enabled}),g(),p.update()},forceUpdate:function(){if(!d){var h=c.elements,b=h.reference,y=h.popper;if(wm(b,y)){c.rects={reference:nT(b,Uo(y),c.options.strategy==="fixed"),popper:Su(y)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(P){return c.modifiersData[P.name]=Object.assign({},P.data)});for(var v=0;v<c.orderedModifiers.length;v++){if(c.reset===!0){c.reset=!1,v=-1;continue}var M=c.orderedModifiers[v],A=M.fn,_=M.options,w=_===void 0?{}:_,C=M.name;typeof A=="function"&&(c=A({state:c,options:w,name:C,instance:p})||c)}}}},update:sT(function(){return new Promise(function(h){p.forceUpdate(),h(c)})}),destroy:function(){m(),d=!0}};if(!wm(o,l))return p;p.setOptions(u).then(function(h){!d&&u.onFirstUpdate&&u.onFirstUpdate(h)});function g(){c.orderedModifiers.forEach(function(h){var b=h.name,y=h.options,v=y===void 0?{}:y,M=h.effect;if(typeof M=="function"){var A=M({state:c,name:b,instance:p,options:v}),_=function(){};f.push(A||_)}})}function m(){f.forEach(function(h){return h()}),f=[]}return p}}Ru();var aT=[hm,bm,dm,rm];Ru({defaultModifiers:aT});var lT=[hm,bm,dm,rm,X_,H_,q_,C_,j_],cT=Ru({defaultModifiers:lT});const uT=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=dT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:d}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...d||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=cT(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function dT(n){const e=Object.keys(n.elements),t=nl(e.map(r=>[r,n.styles[r]||{}])),i=nl(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function Mm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Za(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Fu={prefix:Math.floor(Math.random()*1e4),current:0},hT=Symbol("elIdInjection"),Pu=()=>a.getCurrentInstance()?a.inject(hT,Fu):Fu,jo=n=>{const e=Pu();!Rt&&e===Fu&&dt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
8
8
  usage: app.provide(ID_INJECTION_KEY, {
9
9
  prefix: number,
10
10
  current: number,
@@ -17,7 +17,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,curr
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,kT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function VT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:kT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function km(n,e=1,t){var i;Cn||(Cn=document.createElement("textarea"),document.body.appendChild(Cn));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=VT(n);Cn.setAttribute("style",`${l};${DT}`),Cn.value=n.value||n.placeholder||"";let u=Cn.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Cn.value="";const f=Cn.scrollHeight-r;if(et(e)){let d=f*e;o==="border-box"&&(d=d+r+s),u=Math.max(d,u),c.minHeight=`${d}px`}if(et(t)){let d=f*t;o==="border-box"&&(d=d+r+s),u=Math.min(d,u)}return c.height=`${u}px`,(i=Cn.parentNode)==null||i.removeChild(Cn),Cn=void 0,c}const zT=$e({id:{type:String,default:void 0},size:$n,disabled:Boolean,modelValue:{type:Be([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Be([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Wi},prefixIcon:{type:Wi},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Be([Object,Array,String]),default:()=>mi({})},autofocus:Boolean,rows:{type:Number,default:2},...Zn(["ariaLabel"])}),UT={[tt]:n=>Bt(n),input:n=>Bt(n),change:n=>Bt(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},GT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),HT=a.defineComponent({...GT,props:zT,emits:UT,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ue={};return i.containerRole==="combobox"&&(ue["aria-haspopup"]=r["aria-haspopup"],ue["aria-owns"]=r["aria-owns"],ue["aria-expanded"]=r["aria-expanded"]),ue}),l=a.computed(()=>[i.type==="textarea"?b.b():h.b(),h.m(g.value),h.is("disabled",m.value),h.is("exceed",Y.value),{[h.b("group")]:s.prepend||s.append,[h.m("prefix")]:s.prefix||i.prefixIcon,[h.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[h.bm("suffix","password-clear")]:N.value&&k.value,[h.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[h.e("wrapper"),h.is("focus",R.value)]),c=QS({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:d}=yi(),{inputId:p}=ws(i,{formItemContext:d}),g=vi(),m=xs(),h=Ge("input"),b=Ge("textarea"),y=a.shallowRef(),v=a.shallowRef(),M=a.ref(!1),A=a.ref(!1),_=a.ref(),w=a.shallowRef(i.inputStyle),C=a.computed(()=>y.value||v.value),{wrapperRef:P,isFocused:R,handleFocus:I,handleBlur:S}=Om(C,{beforeFocus(){return m.value},afterBlur(){var ue;i.validateEvent&&((ue=d==null?void 0:d.validate)==null||ue.call(d,"blur").catch(be=>dt(be)))}}),T=a.computed(()=>{var ue;return(ue=f==null?void 0:f.statusIcon)!=null?ue:!1}),E=a.computed(()=>(d==null?void 0:d.validateState)||""),L=a.computed(()=>E.value&&Kp[E.value]),F=a.computed(()=>A.value?$S:zS),x=a.computed(()=>[r.style]),O=a.computed(()=>[i.inputStyle,w.value,{resize:i.resize}]),B=a.computed(()=>Gn(i.modelValue)?"":String(i.modelValue)),N=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(R.value||M.value)),k=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||R.value)),z=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),Y=a.computed(()=>!!z.value&&G.value>Number(i.maxlength)),Z=a.computed(()=>!!s.suffix||!!i.suffixIcon||N.value||i.showPassword||z.value||!!E.value&&T.value),[te,q]=xT(y);xn(v,ue=>{if(X(),!z.value||i.resize!=="both")return;const be=ue[0],{width:ne}=be.contentRect;_.value={right:`calc(100% - ${ne+15+6}px)`}});const j=()=>{const{type:ue,autosize:be}=i;if(!(!Rt||ue!=="textarea"||!v.value))if(be){const ne=Kt(be)?be.minRows:void 0,de=Kt(be)?be.maxRows:void 0,ve=km(v.value,ne,de);w.value={overflowY:"hidden",...ve},a.nextTick(()=>{v.value.offsetHeight,w.value=ve})}else w.value={minHeight:km(v.value).minHeight}},X=(ue=>{let be=!1;return()=>{var ne;if(be||!i.autosize)return;((ne=v.value)==null?void 0:ne.offsetParent)===null||(ue(),be=!0)}})(j),K=()=>{const ue=C.value,be=i.formatter?i.formatter(B.value):B.value;!ue||ue.value===be||(ue.value=be)},re=async ue=>{te();let{value:be}=ue.target;if(i.formatter&&(be=i.parser?i.parser(be):be),!W.value){if(be===B.value){K();return}t(tt,be),t("input",be),await a.nextTick(),K(),q()}},V=ue=>{t("change",ue.target.value)},{isComposing:W,handleCompositionStart:oe,handleCompositionUpdate:ae,handleCompositionEnd:le}=Nm({emit:t,afterComposition:re}),H=()=>{A.value=!A.value,U()},U=async()=>{var ue;await a.nextTick(),(ue=C.value)==null||ue.focus()},D=()=>{var ue;return(ue=C.value)==null?void 0:ue.blur()},Q=ue=>{M.value=!1,t("mouseleave",ue)},ie=ue=>{M.value=!0,t("mouseenter",ue)},ce=ue=>{t("keydown",ue)},ge=()=>{var ue;(ue=C.value)==null||ue.select()},ye=()=>{t(tt,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ue;a.nextTick(()=>j()),i.validateEvent&&((ue=d==null?void 0:d.validate)==null||ue.call(d,"change").catch(be=>dt(be)))}),a.watch(B,()=>K()),a.watch(()=>i.type,async()=>{await a.nextTick(),K(),j()}),a.onMounted(()=>{!i.formatter&&i.parser&&dt("ElInput","If you set the parser, you also need to set the formatter."),K(),a.nextTick(j)}),e({input:y,textarea:v,ref:C,textareaStyle:O,autosize:a.toRef(i,"autosize"),isComposing:W,focus:U,blur:D,select:ge,clear:ye,resizeTextarea:j}),(ue,be)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(h).bm("group","append")]:ue.$slots.append,[a.unref(h).bm("group","prepend")]:ue.$slots.prepend}],style:a.unref(x),role:ue.containerRole,onMouseenter:ie,onMouseleave:Q}),[a.createCommentVNode(" input "),ue.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ue.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(h).be("group","prepend"))},[a.renderSlot(ue.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:P,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ue.$slots.prefix||ue.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(h).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("prefix-inner"))},[a.renderSlot(ue.$slots,"prefix"),ue.prefixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(h).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:y,class:a.unref(h).e("inner")},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,type:ue.showPassword?A.value?"text":"password":ue.type,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,tabindex:ue.tabindex,"aria-label":ue.ariaLabel,placeholder:ue.placeholder,style:ue.inputStyle,form:ue.form,autofocus:ue.autofocus,onCompositionstart:a.unref(oe),onCompositionupdate:a.unref(ae),onCompositionend:a.unref(le),onInput:re,onChange:V,onKeydown:ce}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(Z)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(h).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("suffix-inner"))},[!a.unref(N)||!a.unref(k)||!a.unref(z)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ue.$slots,"suffix"),ue.suffixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(h).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(N)?(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("clear")]),onMousedown:a.withModifiers(a.unref(Lo),["prevent"]),onClick:ye},{default:a.withCtx(()=>[a.createVNode(a.unref(bu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createBlock(a.unref(mt),{key:2,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("password")]),onClick:H},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(F))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(z)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(h).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(E)&&a.unref(L)&&a.unref(T)?(a.openBlock(),a.createBlock(a.unref(mt),{key:4,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("validateIcon"),a.unref(h).is("loading",a.unref(E)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ue.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(h).be("group","append"))},[a.renderSlot(ue.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:v,class:[a.unref(b).e("inner"),a.unref(h).is("focus",a.unref(R))]},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,tabindex:ue.tabindex,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,style:a.unref(O),"aria-label":ue.ariaLabel,placeholder:ue.placeholder,form:ue.form,autofocus:ue.autofocus,rows:ue.rows,onCompositionstart:a.unref(oe),onCompositionupdate:a.unref(ae),onCompositionend:a.unref(le),onInput:re,onFocus:a.unref(I),onBlur:a.unref(S),onChange:V,onKeydown:ce}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(z)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(_.value),class:a.normalizeClass(a.unref(h).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var WT=He(HT,[["__file","input.vue"]]);const jT=bt(WT),Ms=4,$T={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},ZT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Nu=Symbol("scrollbarContextKey"),XT=$e({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),YT="Thumb";var Vm=He(a.defineComponent({__name:"thumb",props:XT,setup(n){const e=n,t=a.inject(Nu),i=Ge("scrollbar");t||hs(YT,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Rt?document.onselectstart:null;const d=a.computed(()=>$T[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>ZT({size:e.size,move:e.move,bar:d.value})),g=a.computed(()=>r.value[d.value.offset]**2/t.wrapElement[d.value.scrollSize]/e.ratio/s.value[d.value.offset]),m=w=>{var C;if(w.stopPropagation(),w.ctrlKey||[1,2].includes(w.button))return;(C=window.getSelection())==null||C.removeAllRanges(),b(w);const P=w.currentTarget;P&&(o.value[d.value.axis]=P[d.value.offset]-(w[d.value.client]-P.getBoundingClientRect()[d.value.direction]))},h=w=>{if(!s.value||!r.value||!t.wrapElement)return;const C=Math.abs(w.target.getBoundingClientRect()[d.value.direction]-w[d.value.client]),P=s.value[d.value.offset]/2,R=(C-P)*100*g.value/r.value[d.value.offset];t.wrapElement[d.value.scroll]=R*t.wrapElement[d.value.scrollSize]/100},b=w=>{w.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),f=document.onselectstart,document.onselectstart=()=>!1},y=w=>{if(!r.value||!s.value||u===!1)return;const C=o.value[d.value.axis];if(!C)return;const P=(r.value.getBoundingClientRect()[d.value.direction]-w[d.value.client])*-1,R=s.value[d.value.offset]-C,I=(P-R)*100*g.value/r.value[d.value.offset];t.wrapElement[d.value.scroll]=I*t.wrapElement[d.value.scrollSize]/100},v=()=>{u=!1,o.value[d.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v),_(),c&&(l.value=!1)},M=()=>{c=!1,l.value=!!e.size},A=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{_(),document.removeEventListener("mouseup",v)});const _=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return zt(a.toRef(t,"scrollbarElement"),"mousemove",M),zt(a.toRef(t,"scrollbarElement"),"mouseleave",A),(w,C)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(d).key)]),onMousedown:h},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,w.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const JT=$e({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var KT=He(a.defineComponent({__name:"bar",props:JT,setup(n,{expose:e}){const t=n,i=a.inject(Nu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const g=p.offsetHeight-Ms,m=p.offsetWidth-Ms;s.value=p.scrollTop*100/g*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const g=p.offsetHeight-Ms,m=p.offsetWidth-Ms,h=g**2/p.scrollHeight,b=m**2/p.scrollWidth,y=Math.max(h,t.minSize),v=Math.max(b,t.minSize);u.value=h/(g-h)/(y/(g-y)),c.value=b/(m-b)/(v/(m-v)),l.value=y+Ms<g?`${y}px`:"",o.value=v+Ms<m?`${v}px`:""}}),(p,g)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Vm,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Vm,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const qT=$e({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Be([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Zn(["ariaLabel","ariaOrientation"])}),QT={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(et)},Bu="ElScrollbar",eE=a.defineComponent({name:Bu}),tE=a.defineComponent({...eE,props:qT,emits:QT,setup(n,{expose:e,emit:t}){const i=n,r=Ge("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),d=a.ref(),p=a.ref(),g=a.computed(()=>{const _={};return i.height&&(_.height=sl(i.height)),i.maxHeight&&(_.maxHeight=sl(i.maxHeight)),[i.wrapStyle,_]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),h=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var _;f.value&&((_=p.value)==null||_.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function y(_,w){Kt(_)?f.value.scrollTo(_):et(_)&&et(w)&&f.value.scrollTo(_,w)}const v=_=>{if(!et(_)){dt(Bu,"value must be a number");return}f.value.scrollTop=_},M=_=>{if(!et(_)){dt(Bu,"value must be a number");return}f.value.scrollLeft=_},A=()=>{var _;(_=p.value)==null||_.update()};return a.watch(()=>i.noresize,_=>{_?(s==null||s(),o==null||o()):({stop:s}=xn(d,A),o=zt("resize",A))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var _;A(),f.value&&((_=p.value)==null||_.handleScroll(f.value))})}),a.provide(Nu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{A()})}),a.onUpdated(()=>A()),e({wrapRef:f,update:A,scrollTo:y,setScrollTop:v,setScrollLeft:M,handleScroll:b}),(_,w)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(g)),tabindex:_.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(_.tag),{id:_.id,ref_key:"resizeRef",ref:d,class:a.normalizeClass(a.unref(h)),style:a.normalizeStyle(_.viewStyle),role:_.role,"aria-label":_.ariaLabel,"aria-orientation":_.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(_.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),_.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(KT,{key:0,ref_key:"barRef",ref:p,always:_.always,"min-size":_.minSize},null,8,["always","min-size"]))],2))}});var nE=He(tE,[["__file","scrollbar.vue"]]);const iE=bt(nE),Du=Symbol("popper"),zm=Symbol("popperContent"),Um=$e({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),rE=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),sE=a.defineComponent({...rE,props:Um,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Du,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var oE=He(sE,[["__file","popper.vue"]]);const Gm=$e({arrowOffset:{type:Number,default:5}}),aE=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),lE=a.defineComponent({...aE,props:Gm,setup(n,{expose:e}){const t=n,i=Ge("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(zm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var cE=He(lE,[["__file","arrow.vue"]]);const ku="ElOnlyChild",uE=a.defineComponent({name:ku,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(Tm),s=bT((i=r==null?void 0:r.setForwardRef)!=null?i:Lo);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return dt(ku,"requires exact only one valid child."),null;const u=Hm(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(dt(ku,"no valid child node found"),null)}}});function Hm(n){if(!n)return null;const e=n;for(const t of e){if(Kt(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return Wm(t);case a.Fragment:return Hm(t.children);default:return t}return Wm(t)}return null}function Wm(n){const e=Ge("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const jm=$e({virtualRef:{type:Be(Object)},virtualTriggering:Boolean,onMouseenter:{type:Be(Function)},onMouseleave:{type:Be(Function)},onClick:{type:Be(Function)},onKeydown:{type:Be(Function)},onFocus:{type:Be(Function)},onBlur:{type:Be(Function)},onContextmenu:{type:Be(Function)},id:String,open:Boolean}),dE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),hE=a.defineComponent({...dE,props:jm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Du,void 0);yT(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,d=>{d&&(r.value=ci(d))},{immediate:!0}),a.watch(r,(d,p)=>{c==null||c(),c=void 0,_r(d)&&(f.forEach(g=>{var m;const h=t[g];h&&(d.addEventListener(g.slice(2).toLowerCase(),h),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,g.slice(2).toLowerCase(),h))}),c=a.watch([s,o,l,u],g=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,h)=>{Gn(g[h])?d.removeAttribute(m):d.setAttribute(m,g[h])})},{immediate:!0})),_r(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(g=>p.removeAttribute(g))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&_r(r.value)){const d=r.value;f.forEach(p=>{const g=t[p];g&&d.removeEventListener(p.slice(2).toLowerCase(),g)}),r.value=void 0}}),e({triggerRef:r}),(d,p)=>d.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(uE),a.mergeProps({key:0},d.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(d.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var fE=He(hE,[["__file","trigger.vue"]]);const Vu="focus-trap.focus-after-trapped",zu="focus-trap.focus-after-released",pE="focus-trap.focusout-prevented",$m={cancelable:!0,bubbles:!1},mE={cancelable:!0,bubbles:!1},Zm="focusAfterTrapped",Xm="focusAfterReleased",gE=Symbol("elFocusTrap"),Uu=a.ref(),vl=a.ref(0),Gu=a.ref(0);let yl=0;const Ym=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},Jm=(n,e)=>{for(const t of n)if(!vE(t,e))return t},vE=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},yE=n=>{const e=Ym(n),t=Jm(e,n),i=Jm(e.reverse(),n);return[t,i]},bE=n=>n instanceof HTMLInputElement&&"select"in n,$i=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),Gu.value=window.performance.now(),n!==t&&bE(n)&&e&&n.select()}};function Km(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const xE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=Km(n,i),n.unshift(i)},remove:i=>{var r,s;n=Km(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},wE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if($i(i,e),document.activeElement!==t)return},qm=xE(),ME=()=>vl.value>Gu.value,bl=()=>{Uu.value="pointer",vl.value=window.performance.now()},Qm=()=>{Uu.value="keyboard",vl.value=window.performance.now()},AE=()=>(a.onMounted(()=>{yl===0&&(document.addEventListener("mousedown",bl),document.addEventListener("touchstart",bl),document.addEventListener("keydown",Qm)),yl++}),a.onBeforeUnmount(()=>{yl--,yl<=0&&(document.removeEventListener("mousedown",bl),document.removeEventListener("touchstart",bl),document.removeEventListener("keydown",Qm))}),{focusReason:Uu,lastUserFocusTimestamp:vl,lastAutomatedFocusTimestamp:Gu}),xl=n=>new CustomEvent(pE,{...mE,detail:n}),SE=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Zm,Xm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=AE();fT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:h,altKey:b,ctrlKey:y,metaKey:v,currentTarget:M,shiftKey:A}=m,{loop:_}=n,w=h===Hn.tab&&!b&&!y&&!v,C=document.activeElement;if(w&&C){const P=M,[R,I]=yE(P);if(R&&I){if(!A&&C===I){const T=xl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||(m.preventDefault(),_&&$i(R,!0))}else if(A&&[R,P].includes(C)){const T=xl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||(m.preventDefault(),_&&$i(I,!0))}}else if(C===P){const T=xl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||m.preventDefault()}}};a.provide(gE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[h])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",d)),h&&(h.removeEventListener("keydown",l),h.removeEventListener("focusin",f),h.removeEventListener("focusout",d))});const u=m=>{e(Zm,m)},c=m=>e(Xm,m),f=m=>{const h=a.unref(t);if(!h)return;const b=m.target,y=m.relatedTarget,v=b&&h.contains(b);n.trapped||y&&h.contains(y)||(i=y),v&&e("focusin",m),!o.paused&&n.trapped&&(v?r=b:$i(r,!0))},d=m=>{const h=a.unref(t);if(!(o.paused||!h))if(n.trapped){const b=m.relatedTarget;!Gn(b)&&!h.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const y=xl({focusReason:s.value});e("focusout-prevented",y),y.defaultPrevented||$i(r,!0)}},0)}else{const b=m.target;b&&h.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){qm.push(o);const h=m.contains(document.activeElement)?i:document.activeElement;if(i=h,!m.contains(h)){const y=new Event(Vu,$m);m.addEventListener(Vu,u),m.dispatchEvent(y),y.defaultPrevented||a.nextTick(()=>{let v=n.focusStartEl;Bt(v)||($i(v),document.activeElement!==v&&(v="first")),v==="first"&&wE(Ym(m),!0),(document.activeElement===h||v==="container")&&$i(m)})}}}function g(){const m=a.unref(t);if(m){m.removeEventListener(Vu,u);const h=new CustomEvent(zu,{...$m,detail:{focusReason:s.value}});m.addEventListener(zu,c),m.dispatchEvent(h),!h.defaultPrevented&&(s.value=="keyboard"||!ME()||m.contains(document.activeElement))&&$i(i??document.body),m.removeEventListener(zu,c),qm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():g()})}),a.onBeforeUnmount(()=>{n.trapped&&g(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",d),t.value=void 0)}),{onKeydown:l}}});function _E(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var TE=He(SE,[["render",_E],["__file","focus-trap.vue"]]);const EE=["fixed","absolute"],CE=$e({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Be(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:ps,default:"bottom"},popperOptions:{type:Be(Object),default:()=>({})},strategy:{type:String,values:EE,default:"absolute"}}),eg=$e({...CE,id:String,style:{type:Be([String,Array,Object])},className:{type:Be([String,Array,Object])},effect:{type:Be(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Be([String,Array,Object])},popperStyle:{type:Be([String,Array,Object])},referenceEl:{type:Be(Object)},triggerTargetEl:{type:Be(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Zn(["ariaLabel"])}),LE={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},RE=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...PE(n),...e]};return IE(s,r==null?void 0:r.modifiers),s},FE=n=>{if(Rt)return ci(n)};function PE(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function IE(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const OE=0,NE=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Du,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var y;const v=a.unref(s),M=(y=a.unref(o))!=null?y:OE;return{name:"arrow",enabled:!wS(v),options:{element:v,padding:M}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...RE(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>FE(n.referenceEl)||a.unref(i)),{attributes:d,state:p,styles:g,update:m,forceUpdate:h,instanceRef:b}=uT(f,t,c);return a.watch(b,y=>e.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(f))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:d,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:g,role:r,forceUpdate:h,update:m}},BE=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Pm(),s=Ge("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(et(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),d=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:d,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=et(n.zIndex)?n.zIndex:r()}}},DE=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},kE=a.defineComponent({name:"ElPopperContent"}),VE=a.defineComponent({...kE,props:eg,emits:LE,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=DE(i,t),{attributes:d,arrowRef:p,contentRef:g,styles:m,instanceRef:h,role:b,update:y}=NE(i),{ariaModal:v,arrowStyle:M,contentAttrs:A,contentClass:_,contentStyle:w,updateZIndex:C}=BE(i,{styles:m,attributes:d,role:b}),P=a.inject(gl,void 0),R=a.ref();a.provide(zm,{arrowStyle:M,arrowRef:p,arrowOffset:R}),P&&a.provide(gl,{...P,addInputId:Lo,removeInputId:Lo});let I;const S=(E=!0)=>{y(),E&&C()},T=()=>{S(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(E,L)=>{I==null||I(),I=void 0;const F=a.unref(E||g.value),x=a.unref(L||g.value);_r(F)&&(I=a.watch([b,()=>i.ariaLabel,v,()=>i.id],O=>{["role","aria-label","aria-modal","id"].forEach((B,N)=>{Gn(O[N])?F.removeAttribute(B):F.setAttribute(B,O[N])})},{immediate:!0})),x!==F&&_r(x)&&["role","aria-label","aria-modal","id"].forEach(O=>{x.removeAttribute(O)})},{immediate:!0}),a.watch(()=>i.visible,T,{immediate:!0})}),a.onBeforeUnmount(()=>{I==null||I(),I=void 0}),e({popperContentRef:g,popperInstanceRef:h,updatePopper:S,contentStyle:w}),(E,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:g},a.unref(A),{style:a.unref(w),class:a.unref(_),tabindex:"-1",onMouseenter:F=>E.$emit("mouseenter",F),onMouseleave:F=>E.$emit("mouseleave",F)}),[a.createVNode(a.unref(TE),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(g),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(E.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var zE=He(VE,[["__file","content.vue"]]);const UE=bt(oE),Hu=Symbol("elTooltip"),dn=$e({...gT,...eg,appendTo:{type:Be([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Be(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Zn(["ariaLabel"])}),$o=$e({...jm,disabled:Boolean,trigger:{type:Be([String,Array]),default:"hover"},triggerKeys:{type:Be(Array),default:()=>[Hn.enter,Hn.space]}}),{useModelToggleProps:GE,useModelToggleEmits:HE,useModelToggle:WE}=a_("visible"),jE=$e({...Um,...GE,...dn,...$o,...Gm,showArrow:{type:Boolean,default:!0}}),$E=[...HE,"before-show","before-hide","show","hide","open","close"],ZE=(n,e)=>Nt(n)?n.includes(e):n===e,As=(n,e,t)=>i=>{ZE(a.unref(n),e)&&t(i)},XE=a.defineComponent({name:"ElTooltipTrigger"}),YE=a.defineComponent({...XE,props:$o,setup(n,{expose:e}){const t=n,i=Ge("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(Hu,void 0),f=a.ref(null),d=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),g=li(d,As(p,"hover",l)),m=li(d,As(p,"hover",u)),h=li(d,As(p,"click",A=>{A.button===0&&c(A)})),b=li(d,As(p,"focus",l)),y=li(d,As(p,"focus",u)),v=li(d,As(p,"contextmenu",A=>{A.preventDefault(),c(A)})),M=li(d,A=>{const{code:_}=A;t.triggerKeys.includes(_)&&(A.preventDefault(),c(A))});return e({triggerRef:f}),(A,_)=>(a.openBlock(),a.createBlock(a.unref(fE),{id:a.unref(s),"virtual-ref":A.virtualRef,open:a.unref(o),"virtual-triggering":A.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(y),onClick:a.unref(h),onContextmenu:a.unref(v),onFocus:a.unref(b),onMouseenter:a.unref(g),onMouseleave:a.unref(m),onKeydown:a.unref(M)},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var JE=He(YE,[["__file","trigger.vue"]]);const KE=$e({to:{type:Be([String,Object]),required:!0},disabled:Boolean});var qE=He(a.defineComponent({__name:"teleport",props:KE,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const QE=bt(qE),eC=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),tC=a.defineComponent({...eC,props:dn,setup(n,{expose:e}){const t=n,{selector:i}=_m(),r=Ge("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:d,onOpen:p,onShow:g,onHide:m,onBeforeShow:h,onBeforeHide:b}=a.inject(Hu,void 0),y=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),v=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const M=a.computed(()=>a.unref(v)?!0:a.unref(c)),A=a.computed(()=>t.disabled?!1:a.unref(c)),_=a.computed(()=>t.appendTo||i.value),w=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),C=a.ref(!0),P=()=>{m(),C.value=!0},R=()=>{if(a.unref(l))return!0},I=li(R,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),S=li(R,()=>{a.unref(f)==="hover"&&d()}),T=()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x),h==null||h()},E=()=>{b==null||b()},L=()=>{g(),o=mw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&d()})},F=()=>{t.virtualTriggering||d()};return a.watch(()=>a.unref(c),x=>{x?C.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x)}),e({contentRef:s}),(x,O)=>(a.openBlock(),a.createBlock(a.unref(QE),{disabled:!x.teleported,to:a.unref(_)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:P,onBeforeEnter:T,onAfterEnter:L,onBeforeLeave:E},{default:a.withCtx(()=>[a.unref(M)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(zE),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":C.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(w)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(A),"z-index":x.zIndex,onMouseenter:a.unref(I),onMouseleave:a.unref(S),onBlur:F,onClose:a.unref(d)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(A)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var nC=He(tC,[["__file","content.vue"]]);const iC=a.defineComponent({name:"ElTooltip"}),rC=a.defineComponent({...iC,props:jE,emits:$E,setup(n,{expose:e,emit:t}){const i=n;mT();const r=jo(),s=a.ref(),o=a.ref(),l=()=>{var y;const v=a.unref(s);v&&((y=v.popperInstanceRef)==null||y.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:d,hasUpdateHandler:p}=WE({indicator:u,toggleReason:c}),{onOpen:g,onClose:m}=vT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:d}),h=a.computed(()=>Ui(i.visible)&&!p.value);a.provide(Hu,{controlled:h,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:y=>{g(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(u)?m(y):g(y)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,y=>{y&&u.value&&(u.value=!1)});const b=y=>{var v,M;const A=(M=(v=o.value)==null?void 0:v.contentRef)==null?void 0:M.popperContentRef,_=(y==null?void 0:y.relatedTarget)||document.activeElement;return A&&A.contains(_)};return a.onDeactivated(()=>u.value&&d()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:g,onClose:m,hide:d}),(y,v)=>(a.openBlock(),a.createBlock(a.unref(UE),{ref_key:"popperRef",ref:s,role:y.role},{default:a.withCtx(()=>[a.createVNode(JE,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(nC,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(cE),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var sC=He(rC,[["__file","tooltip.vue"]]);const Wu=bt(sC),tg=Symbol("buttonGroupContextKey"),oC=(n,e)=>{Do({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(tg,void 0),i=Iu("button"),{form:r}=yi(),s=vi(a.computed(()=>t==null?void 0:t.size)),o=xs(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,h,b;return(b=(h=n.autoInsertSpace)!=null?h:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),d=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const h=(m=u.default)==null?void 0:m.call(u);if(f.value&&(h==null?void 0:h.length)===1){const b=h[0];if((b==null?void 0:b.type)===a.Text){const y=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:d,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},ju=$e({size:$n,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Wi},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Wi,default:()=>Xp},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Be([String,Object]),default:"button"}}),aC={click:n=>n instanceof MouseEvent};function Wt(n,e){lC(n)&&(n="100%");var t=cC(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function wl(n){return Math.min(1,Math.max(0,n))}function lC(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function cC(n){return typeof n=="string"&&n.indexOf("%")!==-1}function ng(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Ml(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Rr(n){return n.length===1?"0"+n:String(n)}function uC(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function ig(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function $u(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 dC(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=$u(l,o,n+1/3),r=$u(l,o,n),s=$u(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function rg(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:u,v:o}}function hC(n,e,t){n=Wt(n,360)*6,e=Wt(e,100),t=Wt(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],d=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:d*255}}function sg(n,e,t,i){var r=[Rr(Math.round(n).toString(16)),Rr(Math.round(e).toString(16)),Rr(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function fC(n,e,t,i,r){var s=[Rr(Math.round(n).toString(16)),Rr(Math.round(e).toString(16)),Rr(Math.round(t).toString(16)),Rr(pC(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function pC(n){return Math.round(parseFloat(n)*255).toString(16)}function og(n){return hn(n)/255}function hn(n){return parseInt(n,16)}function mC(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var Zu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function gC(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=bC(n)),typeof n=="object"&&(bi(n.r)&&bi(n.g)&&bi(n.b)?(e=uC(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):bi(n.h)&&bi(n.s)&&bi(n.v)?(i=Ml(n.s),r=Ml(n.v),e=hC(n.h,i,r),o=!0,l="hsv"):bi(n.h)&&bi(n.s)&&bi(n.l)&&(i=Ml(n.s),s=Ml(n.l),e=dC(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=ng(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var vC="[-\\+]?\\d+%?",yC="[-\\+]?\\d*\\.\\d+%?",Zi="(?:".concat(yC,")|(?:").concat(vC,")"),Xu="[\\s|\\(]+(".concat(Zi,")[,|\\s]+(").concat(Zi,")[,|\\s]+(").concat(Zi,")\\s*\\)?"),Yu="[\\s|\\(]+(".concat(Zi,")[,|\\s]+(").concat(Zi,")[,|\\s]+(").concat(Zi,")[,|\\s]+(").concat(Zi,")\\s*\\)?"),Ln={CSS_UNIT:new RegExp(Zi),rgb:new RegExp("rgb"+Xu),rgba:new RegExp("rgba"+Yu),hsl:new RegExp("hsl"+Xu),hsla:new RegExp("hsla"+Yu),hsv:new RegExp("hsv"+Xu),hsva:new RegExp("hsva"+Yu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function bC(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(Zu[n])n=Zu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ln.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ln.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ln.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Ln.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ln.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Ln.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ln.hex8.exec(n),t?{r:hn(t[1]),g:hn(t[2]),b:hn(t[3]),a:og(t[4]),format:e?"name":"hex8"}:(t=Ln.hex6.exec(n),t?{r:hn(t[1]),g:hn(t[2]),b:hn(t[3]),format:e?"name":"hex"}:(t=Ln.hex4.exec(n),t?{r:hn(t[1]+t[1]),g:hn(t[2]+t[2]),b:hn(t[3]+t[3]),a:og(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ln.hex3.exec(n),t?{r:hn(t[1]+t[1]),g:hn(t[2]+t[2]),b:hn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function bi(n){return!!Ln.CSS_UNIT.exec(String(n))}var xC=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=mC(e)),this.originalInput=e;var r=gC(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=ng(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=rg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=rg(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=ig(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=ig(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),sg(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),fC(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Wt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Wt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+sg(this.r,this.g,this.b,!1),t=0,i=Object.entries(Zu);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=wl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=wl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=wl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=wl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function Xi(n,e=20){return n.mix("#141414",e).toString()}function wC(n){const e=xs(),t=Ge("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new xC(r),l=n.dark?o.tint(20).toString():Xi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Xi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Xi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Xi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Xi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Xi(o,80):o.tint(80).toString());else{const u=n.dark?Xi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Xi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const MC=a.defineComponent({name:"ElButton"}),AC=a.defineComponent({...MC,props:ju,emits:aC,setup(n,{expose:e,emit:t}){const i=n,r=wC(i),s=Ge("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:d,handleClick:p}=oC(i,t),g=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:d}),(m,h)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(g),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(mt),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(d)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var SC=He(AC,[["__file","button.vue"]]);const _C={size:ju.size,type:ju.type},TC=a.defineComponent({name:"ElButtonGroup"}),EC=a.defineComponent({...TC,props:_C,setup(n){const e=n;a.provide(tg,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ge("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var ag=He(EC,[["__file","button-group.vue"]]);const Zo=bt(SC,{ButtonGroup:ag});un(ag);var Yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function CC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Al(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const Ji=new Map;if(Rt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of Ji.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function lg(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:_r(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),d=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),g=s&&(s.contains(o)||s.contains(l));u||c||f||d||p||g||e.value(i,r)}}const LC={beforeMount(n,e){Ji.has(n)||Ji.set(n,[]),Ji.get(n).push({documentHandler:lg(n,e),bindingFn:e.value})},updated(n,e){Ji.has(n)||Ji.set(n,[]);const t=Ji.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:lg(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){Ji.delete(n)}},RC=100,FC=600,cg={beforeMount(n,e){const t=e.value,{interval:i=RC,delay:r=FC}=Jt(t)?{}:t;let s,o;const l=()=>Jt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},ug={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:$n,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Zn(["ariaControls"])},dg={[tt]:n=>Bt(n)||et(n)||Ui(n),change:n=>Bt(n)||et(n)||Ui(n)},Ss=Symbol("checkboxGroupContextKey"),PC=({model:n,isChecked:e})=>{const t=a.inject(Ss,void 0),i=a.computed(()=>{var s,o;const l=(s=t==null?void 0:t.max)==null?void 0:s.value,u=(o=t==null?void 0:t.min)==null?void 0:o.value;return!sn(l)&&n.value.length>=l&&!e.value||!sn(u)&&n.value.length<=u&&e.value});return{isDisabled:xs(a.computed(()=>(t==null?void 0:t.disabled.value)||i.value)),isLimitDisabled:i}},IC=(n,{model:e,isLimitExceeded:t,hasOwnLabel:i,isDisabled:r,isLabeledByFormItem:s})=>{const o=a.inject(Ss,void 0),{formItem:l}=yi(),{emit:u}=a.getCurrentInstance();function c(m){var h,b,y,v;return[!0,n.trueValue,n.trueLabel].includes(m)?(b=(h=n.trueValue)!=null?h:n.trueLabel)!=null?b:!0:(v=(y=n.falseValue)!=null?y:n.falseLabel)!=null?v:!1}function f(m,h){u("change",c(m),h)}function d(m){if(t.value)return;const h=m.target;u("change",c(h.checked),m)}async function p(m){t.value||!i.value&&!r.value&&s.value&&(m.composedPath().some(y=>y.tagName==="LABEL")||(e.value=c([!1,n.falseValue,n.falseLabel].includes(e.value)),await a.nextTick(),f(e.value,m)))}const g=a.computed(()=>(o==null?void 0:o.validateEvent)||n.validateEvent);return a.watch(()=>n.modelValue,()=>{g.value&&(l==null||l.validate("change").catch(m=>dt(m)))}),{handleChange:d,onClickRoot:p}},OC=n=>{const e=a.ref(!1),{emit:t}=a.getCurrentInstance(),i=a.inject(Ss,void 0),r=a.computed(()=>sn(i)===!1),s=a.ref(!1),o=a.computed({get(){var l,u;return r.value?(l=i==null?void 0:i.modelValue)==null?void 0:l.value:(u=n.modelValue)!=null?u:e.value},set(l){var u,c;r.value&&Nt(l)?(s.value=((u=i==null?void 0:i.max)==null?void 0:u.value)!==void 0&&l.length>(i==null?void 0:i.max.value)&&l.length>o.value.length,s.value===!1&&((c=i==null?void 0:i.changeEvent)==null||c.call(i,l))):(t(tt,l),e.value=l)}});return{model:o,isGroup:r,isLimitExceeded:s}},NC=(n,e,{model:t})=>{const i=a.inject(Ss,void 0),r=a.ref(!1),s=a.computed(()=>No(n.value)?n.label:n.value),o=a.computed(()=>{const f=t.value;return Ui(f)?f:Nt(f)?Kt(s.value)?f.map(a.toRaw).some(d=>il(d,s.value)):f.map(a.toRaw).includes(s.value):f!=null?f===n.trueValue||f===n.trueLabel:!!f}),l=vi(a.computed(()=>{var f;return(f=i==null?void 0:i.size)==null?void 0:f.value}),{prop:!0}),u=vi(a.computed(()=>{var f;return(f=i==null?void 0:i.size)==null?void 0:f.value})),c=a.computed(()=>!!e.default||!No(s.value));return{checkboxButtonSize:l,isChecked:o,isFocused:r,checkboxSize:u,hasOwnLabel:c,actualValue:s}},hg=(n,e)=>{const{formItem:t}=yi(),{model:i,isGroup:r,isLimitExceeded:s}=OC(n),{isFocused:o,isChecked:l,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:f,actualValue:d}=NC(n,e,{model:i}),{isDisabled:p}=PC({model:i,isChecked:l}),{inputId:g,isLabeledByFormItem:m}=ws(n,{formItemContext:t,disableIdGeneration:f,disableIdManagement:r}),{handleChange:h,onClickRoot:b}=IC(n,{model:i,isLimitExceeded:s,hasOwnLabel:f,isDisabled:p,isLabeledByFormItem:m});return(()=>{function v(){var M,A;Nt(i.value)&&!i.value.includes(d.value)?i.value.push(d.value):i.value=(A=(M=n.trueValue)!=null?M:n.trueLabel)!=null?A:!0}n.checked&&v()})(),Do({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},a.computed(()=>r.value&&No(n.value))),Do({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},a.computed(()=>!!n.trueLabel)),Do({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},a.computed(()=>!!n.falseLabel)),{inputId:g,isLabeledByFormItem:m,isChecked:l,isDisabled:p,isFocused:o,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:f,model:i,actualValue:d,handleChange:h,onClickRoot:b}},BC=a.defineComponent({name:"ElCheckbox"}),DC=a.defineComponent({...BC,props:ug,emits:dg,setup(n){const e=n,t=a.useSlots(),{inputId:i,isLabeledByFormItem:r,isChecked:s,isDisabled:o,isFocused:l,checkboxSize:u,hasOwnLabel:c,model:f,actualValue:d,handleChange:p,onClickRoot:g}=hg(e,t),m=Ge("checkbox"),h=a.computed(()=>[m.b(),m.m(u.value),m.is("disabled",o.value),m.is("bordered",e.border),m.is("checked",s.value)]),b=a.computed(()=>[m.e("input"),m.is("disabled",o.value),m.is("checked",s.value),m.is("indeterminate",e.indeterminate),m.is("focus",l.value)]);return(y,v)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(!a.unref(c)&&a.unref(r)?"span":"label"),{class:a.normalizeClass(a.unref(h)),"aria-controls":y.indeterminate?y.ariaControls:null,onClick:a.unref(g)},{default:a.withCtx(()=>{var M,A,_,w;return[a.createElementVNode("span",{class:a.normalizeClass(a.unref(b))},[y.trueValue||y.falseValue||y.trueLabel||y.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,id:a.unref(i),"onUpdate:modelValue":C=>a.isRef(f)?f.value=C:null,class:a.normalizeClass(a.unref(m).e("original")),type:"checkbox",indeterminate:y.indeterminate,name:y.name,tabindex:y.tabindex,disabled:a.unref(o),"true-value":(A=(M=y.trueValue)!=null?M:y.trueLabel)!=null?A:!0,"false-value":(w=(_=y.falseValue)!=null?_:y.falseLabel)!=null?w:!1,onChange:a.unref(p),onFocus:C=>l.value=!0,onBlur:C=>l.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(f)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,id:a.unref(i),"onUpdate:modelValue":C=>a.isRef(f)?f.value=C:null,class:a.normalizeClass(a.unref(m).e("original")),type:"checkbox",indeterminate:y.indeterminate,disabled:a.unref(o),value:a.unref(d),name:y.name,tabindex:y.tabindex,onChange:a.unref(p),onFocus:C=>l.value=!0,onBlur:C=>l.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(f)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(m).e("inner"))},null,2)],2),a.unref(c)?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(m).e("label"))},[a.renderSlot(y.$slots,"default"),y.$slots.default?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(y.label),1)],64))],2)):a.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var kC=He(DC,[["__file","checkbox.vue"]]);const VC=a.defineComponent({name:"ElCheckboxButton"}),zC=a.defineComponent({...VC,props:ug,emits:dg,setup(n){const e=n,t=a.useSlots(),{isFocused:i,isChecked:r,isDisabled:s,checkboxButtonSize:o,model:l,actualValue:u,handleChange:c}=hg(e,t),f=a.inject(Ss,void 0),d=Ge("checkbox"),p=a.computed(()=>{var m,h,b,y;const v=(h=(m=f==null?void 0:f.fill)==null?void 0:m.value)!=null?h:"";return{backgroundColor:v,borderColor:v,color:(y=(b=f==null?void 0:f.textColor)==null?void 0:b.value)!=null?y:"",boxShadow:v?`-1px 0 0 0 ${v}`:void 0}}),g=a.computed(()=>[d.b("button"),d.bm("button",o.value),d.is("disabled",s.value),d.is("checked",r.value),d.is("focus",i.value)]);return(m,h)=>{var b,y,v,M;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(a.unref(g))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":A=>a.isRef(l)?l.value=A:null,class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:m.name,tabindex:m.tabindex,disabled:a.unref(s),"true-value":(y=(b=m.trueValue)!=null?b:m.trueLabel)!=null?y:!0,"false-value":(M=(v=m.falseValue)!=null?v:m.falseLabel)!=null?M:!1,onChange:a.unref(c),onFocus:A=>i.value=!0,onBlur:A=>i.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(l)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,"onUpdate:modelValue":A=>a.isRef(l)?l.value=A:null,class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:m.name,tabindex:m.tabindex,disabled:a.unref(s),value:a.unref(u),onChange:a.unref(c),onFocus:A=>i.value=!0,onBlur:A=>i.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(l)]]),m.$slots.default||m.label?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass(a.unref(d).be("button","inner")),style:a.normalizeStyle(a.unref(r)?a.unref(p):void 0)},[a.renderSlot(m.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(m.label),1)])],6)):a.createCommentVNode("v-if",!0)],2)}}});var fg=He(zC,[["__file","checkbox-button.vue"]]);const UC=$e({modelValue:{type:Be(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:$n,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),GC={[tt]:n=>Nt(n),change:n=>Nt(n)},HC=a.defineComponent({name:"ElCheckboxGroup"}),WC=a.defineComponent({...HC,props:UC,emits:GC,setup(n,{emit:e}){const t=n,i=Ge("checkbox"),{formItem:r}=yi(),{inputId:s,isLabeledByFormItem:o}=ws(t,{formItemContext:r}),l=async c=>{e(tt,c),await a.nextTick(),e("change",c)},u=a.computed({get(){return t.modelValue},set(c){l(c)}});return a.provide(Ss,{...Gp(a.toRefs(t),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(r==null||r.validate("change").catch(c=>dt(c)))}),(c,f)=>{var d;return a.openBlock(),a.createBlock(a.resolveDynamicComponent(c.tag),{id:a.unref(s),class:a.normalizeClass(a.unref(i).b("group")),role:"group","aria-label":a.unref(o)?void 0:c.ariaLabel||"checkbox-group","aria-labelledby":a.unref(o)?(d=a.unref(r))==null?void 0:d.labelId:void 0},{default:a.withCtx(()=>[a.renderSlot(c.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var pg=He(WC,[["__file","checkbox-group.vue"]]);const mg=bt(kC,{CheckboxButton:fg,CheckboxGroup:pg});un(fg),un(pg);const gg=$e({modelValue:{type:[String,Number,Boolean],default:void 0},size:$n,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),jC=$e({...gg,border:Boolean}),vg={[tt]:n=>Bt(n)||et(n)||Ui(n),[pi]:n=>Bt(n)||et(n)||Ui(n)},yg=Symbol("radioGroupKey"),bg=(n,e)=>{const t=a.ref(),i=a.inject(yg,void 0),r=a.computed(()=>!!i),s=a.computed(()=>No(n.value)?n.label:n.value),o=a.computed({get(){return r.value?i.modelValue:n.modelValue},set(d){r.value?i.changeEvent(d):e&&e(tt,d),t.value.checked=n.modelValue===s.value}}),l=vi(a.computed(()=>i==null?void 0:i.size)),u=xs(a.computed(()=>i==null?void 0:i.disabled)),c=a.ref(!1),f=a.computed(()=>u.value||r.value&&o.value!==s.value?-1:0);return Do({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},a.computed(()=>r.value&&No(n.value))),{radioRef:t,isGroup:r,radioGroup:i,focus:c,size:l,disabled:u,tabIndex:f,modelValue:o,actualValue:s}},$C=a.defineComponent({name:"ElRadio"}),ZC=a.defineComponent({...$C,props:jC,emits:vg,setup(n,{emit:e}){const t=n,i=Ge("radio"),{radioRef:r,radioGroup:s,focus:o,size:l,disabled:u,modelValue:c,actualValue:f}=bg(t,e);function d(){a.nextTick(()=>e("change",c.value))}return(p,g)=>{var m;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("focus",a.unref(o)),a.unref(i).is("bordered",p.border),a.unref(i).is("checked",a.unref(c)===a.unref(f)),a.unref(i).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(i).e("input"),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("checked",a.unref(c)===a.unref(f))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:r,"onUpdate:modelValue":h=>a.isRef(c)?c.value=h:null,class:a.normalizeClass(a.unref(i).e("original")),value:a.unref(f),name:p.name||((m=a.unref(s))==null?void 0:m.name),disabled:a.unref(u),checked:a.unref(c)===a.unref(f),type:"radio",onFocus:h=>o.value=!0,onBlur:h=>o.value=!1,onChange:d,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(c)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("label")),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var XC=He(ZC,[["__file","radio.vue"]]);const YC=$e({...gg}),JC=a.defineComponent({name:"ElRadioButton"}),KC=a.defineComponent({...JC,props:YC,setup(n){const e=n,t=Ge("radio"),{radioRef:i,focus:r,size:s,disabled:o,modelValue:l,radioGroup:u,actualValue:c}=bg(e),f=a.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(d,p)=>{var g;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(t).b("button"),a.unref(t).is("active",a.unref(l)===a.unref(c)),a.unref(t).is("disabled",a.unref(o)),a.unref(t).is("focus",a.unref(r)),a.unref(t).bm("button",a.unref(s))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":m=>a.isRef(l)?l.value=m:null,class:a.normalizeClass(a.unref(t).be("button","original-radio")),value:a.unref(c),type:"radio",name:d.name||((g=a.unref(u))==null?void 0:g.name),disabled:a.unref(o),onFocus:m=>r.value=!0,onBlur:m=>r.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(t).be("button","inner")),style:a.normalizeStyle(a.unref(l)===a.unref(c)?a.unref(f):{}),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(d.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(d.label),1)])],46,["onKeydown"])],2)}}});var xg=He(KC,[["__file","radio-button.vue"]]);const qC=$e({id:{type:String,default:void 0},size:$n,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),QC=vg,e2=a.defineComponent({name:"ElRadioGroup"}),t2=a.defineComponent({...e2,props:qC,emits:QC,setup(n,{emit:e}){const t=n,i=Ge("radio"),r=jo(),s=a.ref(),{formItem:o}=yi(),{inputId:l,isLabeledByFormItem:u}=ws(t,{formItemContext:o}),c=d=>{e(tt,d),a.nextTick(()=>e("change",d))};a.onMounted(()=>{const d=s.value.querySelectorAll("[type=radio]"),p=d[0];!Array.from(d).some(g=>g.checked)&&p&&(p.tabIndex=0)});const f=a.computed(()=>t.name||r.value);return a.provide(yg,a.reactive({...a.toRefs(t),changeEvent:c,name:f})),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(o==null||o.validate("change").catch(d=>dt(d)))}),(d,p)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:s,class:a.normalizeClass(a.unref(i).b("group")),role:"radiogroup","aria-label":a.unref(u)?void 0:d.ariaLabel||"radio-group","aria-labelledby":a.unref(u)?a.unref(o).labelId:void 0},[a.renderSlot(d.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var wg=He(t2,[["__file","radio-group.vue"]]);const Mg=bt(XC,{RadioButton:xg,RadioGroup:wg}),Ag=un(wg);un(xg);const Ju=$e({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:qp},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),n2={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},i2=a.defineComponent({name:"ElTag"}),r2=a.defineComponent({...i2,props:Ju,emits:n2,setup(n,{emit:e}){const t=n,i=vi(),r=Ge("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:d,closable:p,round:g}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(d),r.is("hit",f),r.is("round",g)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(xu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(xu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var s2=He(r2,[["__file","tag.vue"]]);const o2=bt(s2),Sg=Symbol("rowContextKey"),a2=$e({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),l2=a.defineComponent({name:"ElRow"}),c2=a.defineComponent({...l2,props:a2,setup(n){const e=n,t=Ge("row"),i=a.computed(()=>e.gutter);a.provide(Sg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var u2=He(c2,[["__file","row.vue"]]);const xi=bt(u2),d2=$e({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Be([Number,Object]),default:()=>mi({})},sm:{type:Be([Number,Object]),default:()=>mi({})},md:{type:Be([Number,Object]),default:()=>mi({})},lg:{type:Be([Number,Object]),default:()=>mi({})},xl:{type:Be([Number,Object]),default:()=>mi({})}}),h2=a.defineComponent({name:"ElCol"}),f2=a.defineComponent({...h2,props:d2,setup(n){const e=n,{gutter:t}=a.inject(Sg,{gutter:a.computed(()=>0)}),i=Ge("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];et(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{et(e[c])?o.push(i.b(`${c}-${e[c]}`)):Kt(e[c])&&Object.entries(e[c]).forEach(([f,d])=>{o.push(f!=="span"?i.b(`${c}-${f}-${d}`):i.b(`${c}-${d}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var p2=He(f2,[["__file","col.vue"]]);const Xn=bt(p2),_g=n=>et(n)||Bt(n)||Nt(n),m2=$e({accordion:Boolean,modelValue:{type:Be([Array,String,Number]),default:()=>mi([])}}),g2={[tt]:_g,[pi]:_g},Tg=Symbol("collapseContextKey"),v2=(n,e)=>{const t=a.ref(Un(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(tt,o),e(pi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Un(n.modelValue),{deep:!0}),a.provide(Tg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},y2=()=>{const n=Ge("collapse");return{rootKls:a.computed(()=>n.b())}},b2=a.defineComponent({name:"ElCollapse"}),x2=a.defineComponent({...b2,props:m2,emits:g2,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=v2(i,t),{rootKls:o}=y2();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var w2=He(x2,[["__file","collapse.vue"]]);const M2=a.defineComponent({name:"ElCollapseTransition"}),A2=a.defineComponent({...M2,setup(n){const e=Ge("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var S2=He(A2,[["__file","collapse-transition.vue"]]);const _2=bt(S2),T2=$e({title:{type:String,default:""},name:{type:Be([String,Number]),default:void 0},icon:{type:Wi,default:Tr},disabled:Boolean}),E2=n=>{const e=a.inject(Tg),{namespace:t}=Ge("collapse"),i=a.ref(!1),r=a.ref(!1),s=Pu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},C2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ge("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),d=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:d}},L2=a.defineComponent({name:"ElCollapseItem"}),R2=a.defineComponent({...L2,props:T2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=E2(t),{arrowKls:c,headKls:f,rootKls:d,itemWrapperKls:p,itemContentKls:g,scopedContentId:m,scopedHeadId:h}=C2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,y)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(d))},[a.createElementVNode("button",{id:a.unref(h),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:v=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(mt),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(_2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(h)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(g))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var Eg=He(R2,[["__file","collapse-item.vue"]]);const Cg=bt(w2,{CollapseItem:Eg}),Lg=un(Eg),F2=a.defineComponent({name:"ElContainer"}),P2=a.defineComponent({...F2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ge("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var I2=He(P2,[["__file","container.vue"]]);const O2=a.defineComponent({name:"ElAside"}),N2=a.defineComponent({...O2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ge("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Rg=He(N2,[["__file","aside.vue"]]);const B2=a.defineComponent({name:"ElFooter"}),D2=a.defineComponent({...B2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Fg=He(D2,[["__file","footer.vue"]]);const k2=a.defineComponent({name:"ElHeader"}),V2=a.defineComponent({...k2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Pg=He(V2,[["__file","header.vue"]]);const z2=a.defineComponent({name:"ElMain"}),U2=a.defineComponent({...z2,setup(n){const e=Ge("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Ig=He(U2,[["__file","main.vue"]]);const Yn=bt(I2,{Aside:Rg,Footer:Fg,Header:Pg,Main:Ig});un(Rg);const Og=un(Fg),G2=un(Pg),wi=un(Ig),H2=$e({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},contentPosition:{type:String,values:["left","center","right"],default:"center"},borderStyle:{type:Be(String),default:"solid"}}),W2=a.defineComponent({name:"ElDivider"}),j2=a.defineComponent({...W2,props:H2,setup(n){const e=n,t=Ge("divider"),i=a.computed(()=>t.cssVar({"border-style":e.borderStyle}));return(r,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(t).b(),a.unref(t).m(r.direction)]),style:a.normalizeStyle(a.unref(i)),role:"separator"},[r.$slots.default&&r.direction!=="vertical"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([a.unref(t).e("text"),a.unref(t).is(r.contentPosition)])},[a.renderSlot(r.$slots,"default")],2)):a.createCommentVNode("v-if",!0)],6))}});var $2=He(j2,[["__file","divider.vue"]]);const Ng=bt($2),Z2=a.defineComponent({inheritAttrs:!1});function X2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var Y2=He(Z2,[["render",X2],["__file","collection.vue"]]);const J2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function K2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var q2=He(J2,[["render",K2],["__file","collection-item.vue"]]);const Q2="data-el-collection-item",eL=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...Y2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const d=Array.from(f.querySelectorAll(`[${Q2}]`));return[...u.values()].sort((g,m)=>d.indexOf(g.ref)-d.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...q2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const d=a.unref(c);d&&f.itemMap.set(d,{ref:d,...u})}),a.onBeforeUnmount(()=>{const d=a.unref(c);f.itemMap.delete(d)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Ku=$e({trigger:$o.trigger,effect:{...dn.effect,default:"light"},type:{type:Be(String)},placement:{type:Be(String),default:"bottom"},popperOptions:{type:Be(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Be([Number,String]),default:0},maxHeight:{type:Be([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Be(Object)},teleported:dn.teleported});$e({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Wi}}),$e({onKeydown:{type:Be(Function)}}),eL("Dropdown");const tL=$e({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:$n,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||et(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),nL={[pi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Er]:n=>et(n)||Gn(n),[tt]:n=>et(n)||Gn(n)},iL=a.defineComponent({name:"ElInputNumber"}),rL=a.defineComponent({...iL,props:tL,emits:nL,setup(n,{expose:e,emit:t}){const i=n,{t:r}=cl(),s=Ge("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=yi(),c=a.computed(()=>et(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>et(i.modelValue)&&i.modelValue>=i.max),d=a.computed(()=>{const F=y(i.step);return sn(i.precision)?Math.max(y(i.modelValue),F):(F>i.precision&&dt("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),g=vi(),m=xs(),h=a.computed(()=>{if(l.userInput!==null)return l.userInput;let F=l.currentValue;if(Gn(F))return"";if(et(F)){if(Number.isNaN(F))return"";sn(i.precision)||(F=F.toFixed(i.precision))}return F}),b=(F,x)=>{if(sn(x)&&(x=d.value),x===0)return Math.round(F);let O=String(F);const B=O.indexOf(".");if(B===-1||!O.replace(".","").split("")[B+x])return F;const z=O.length;return O.charAt(z-1)==="5"&&(O=`${O.slice(0,Math.max(0,z-1))}6`),Number.parseFloat(Number(O).toFixed(x))},y=F=>{if(Gn(F))return 0;const x=F.toString(),O=x.indexOf(".");let B=0;return O!==-1&&(B=x.length-O-1),B},v=(F,x=1)=>et(F)?b(F+i.step*x):l.currentValue,M=()=>{if(i.readonly||m.value||f.value)return;const F=Number(h.value)||0,x=v(F);w(x),t(Er,l.currentValue),E()},A=()=>{if(i.readonly||m.value||c.value)return;const F=Number(h.value)||0,x=v(F,-1);w(x),t(Er,l.currentValue),E()},_=(F,x)=>{const{max:O,min:B,step:N,precision:k,stepStrictly:z,valueOnClear:G}=i;O<B&&hs("InputNumber","min should not be greater than max.");let Y=Number(F);if(Gn(F)||Number.isNaN(Y))return null;if(F===""){if(G===null)return null;Y=Bt(G)?{min:B,max:O}[G]:G}return z&&(Y=b(Math.round(Y/N)*N,k),Y!==F&&x&&t(tt,Y)),sn(k)||(Y=b(Y,k)),(Y>O||Y<B)&&(Y=Y>O?O:B,x&&t(tt,Y)),Y},w=(F,x=!0)=>{var O;const B=l.currentValue,N=_(F);if(!x){t(tt,N);return}B===N&&F||(l.userInput=null,t(tt,N),B!==N&&t(pi,N,B),i.validateEvent&&((O=u==null?void 0:u.validate)==null||O.call(u,"change").catch(k=>dt(k))),l.currentValue=N)},C=F=>{l.userInput=F;const x=F===""?null:Number(F);t(Er,x),w(x,!1)},P=F=>{const x=F!==""?Number(F):"";(et(x)&&!Number.isNaN(x)||F==="")&&w(x),E(),l.userInput=null},R=()=>{var F,x;(x=(F=o.value)==null?void 0:F.focus)==null||x.call(F)},I=()=>{var F,x;(x=(F=o.value)==null?void 0:F.blur)==null||x.call(F)},S=F=>{t("focus",F)},T=F=>{var x;l.userInput=null,t("blur",F),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(O=>dt(O)))},E=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=F=>{document.activeElement===F.target&&F.preventDefault()};return a.watch(()=>i.modelValue,(F,x)=>{const O=_(F,!0);l.userInput===null&&O!==x&&(l.currentValue=O)},{immediate:!0}),a.onMounted(()=>{var F;const{min:x,max:O,modelValue:B}=i,N=(F=o.value)==null?void 0:F.input;if(N.setAttribute("role","spinbutton"),Number.isFinite(O)?N.setAttribute("aria-valuemax",String(O)):N.removeAttribute("aria-valuemax"),Number.isFinite(x)?N.setAttribute("aria-valuemin",String(x)):N.removeAttribute("aria-valuemin"),N.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),N.setAttribute("aria-disabled",String(m.value)),!et(B)&&B!=null){let k=Number(B);Number.isNaN(k)&&(k=null),t(tt,k)}N.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var F,x;const O=(F=o.value)==null?void 0:F.input;O==null||O.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:R,blur:I}),(F,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(g)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!F.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[F.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(A,["enter"])},[a.renderSlot(F.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(yu),{key:0})):(a.openBlock(),a.createBlock(a.unref(HS),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(cg),A]]):a.createCommentVNode("v-if",!0),F.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(M,["enter"])},[a.renderSlot(F.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(IS),{key:0})):(a.openBlock(),a.createBlock(a.unref(ol),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(cg),M]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(jT),{id:F.id,ref_key:"input",ref:o,type:"number",step:F.step,"model-value":a.unref(h),placeholder:F.placeholder,readonly:F.readonly,disabled:a.unref(m),size:a.unref(g),max:F.max,min:F.min,name:F.name,"aria-label":F.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(M,["prevent"]),["up"]),a.withKeys(a.withModifiers(A,["prevent"]),["down"])],onBlur:T,onFocus:S,onInput:C,onChange:P},a.createSlots({_:2},[F.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(F.$slots,"prefix")])}:void 0,F.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(F.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var sL=He(rL,[["__file","input-number.vue"]]);const Mi=bt(sL),Bg=Symbol("ElSelectGroup"),Sl=Symbol("ElSelect");function oL(n,e){const t=a.inject(Sl),i=a.inject(Bg,{disabled:!1}),r=a.computed(()=>f(Un(t.props.modelValue),n.value)),s=a.computed(()=>{var g;if(t.props.multiple){const m=Un((g=t.props.modelValue)!=null?g:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(Kt(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(g=[],m)=>{if(Kt(n.value)){const h=t.props.valueKey;return g&&g.some(b=>a.toRaw(hi(b,h))===hi(m,h))}else return g&&g.includes(m)},d=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=g=>{const m=new RegExp(TS(g),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(g,m)=>{const{remote:h,valueKey:b}=t.props;if(g!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!h){if(b&&Kt(g)&&Kt(m)&&g[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:d,updateOption:p}}const aL=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ge("select"),t=jo(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=oL(n,r),{visible:d,hover:p}=a.toRefs(r),g=a.getCurrentInstance().proxy;u.onOptionCreate(g),a.onBeforeUnmount(()=>{const h=g.value,{selected:b}=u.states,v=(u.props.multiple?b:[b]).some(M=>M.value===g.value);a.nextTick(()=>{u.states.cachedOptions.get(h)===g&&!v&&u.states.cachedOptions.delete(h)}),u.onOptionDestroy(h,g)});function m(){l.value||u.handleOptionSelect(g)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:d,hover:p,selectOptionClick:m,states:r}}});function lL(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var qu=He(aL,[["render",lL],["__file","option.vue"]]);const cL=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(Sl),e=Ge("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),xn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function uL(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var dL=He(cL,[["render",uL],["__file","select-dropdown.vue"]]);const hL=11,fL=(n,e)=>{const{t}=cl(),i=jo(),r=Ge("select"),s=Ge("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),d=a.ref(null),p=a.ref(null),g=a.ref(null),m=a.ref(null),h=a.ref(null),b=a.ref(null),y=a.ref(null),v=a.ref(null),{isComposing:M,handleCompositionStart:A,handleCompositionUpdate:_,handleCompositionEnd:w}=Nm({afterComposition:he=>ne(he)}),{wrapperRef:C,isFocused:P}=Om(d,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!R.value&&(R.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(he){var xe,_e;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(he))||((_e=f.value)==null?void 0:_e.isFocusInsideContent(he))},afterBlur(){R.value=!1,o.menuVisibleOnFocus=!1}}),R=a.ref(!1),I=a.ref(),{form:S,formItem:T}=yi(),{inputId:E}=ws(n,{formItemContext:T}),{valueOnClear:L,isEmptyValue:F}=CT(n),x=a.computed(()=>n.disabled||(S==null?void 0:S.disabled)),O=a.computed(()=>Nt(n.modelValue)?n.modelValue.length>0:!F(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&O.value),N=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),k=a.computed(()=>r.is("reverse",N.value&&R.value)),z=a.computed(()=>(T==null?void 0:T.validateState)||""),G=a.computed(()=>Kp[z.value]),Y=a.computed(()=>n.remote?300:0),Z=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&te.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),te=a.computed(()=>q.value.filter(he=>he.visible).length),q=a.computed(()=>{const he=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(_e=>{const Fe=he.findIndex(Ne=>Ne.value===_e);Fe>-1&&xe.push(he[Fe])}),xe.length>=he.length?xe:he}),j=a.computed(()=>Array.from(o.cachedOptions.values())),$=a.computed(()=>{const he=q.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!he}),X=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||q.value.forEach(he=>{var xe;(xe=he.updateOption)==null||xe.call(he,o.inputValue)})},K=vi(),re=a.computed(()=>["small"].includes(K.value)?"small":"default"),V=a.computed({get(){return R.value&&Z.value!==!1},set(he){R.value=he}}),W=a.computed(()=>{if(n.multiple&&!sn(n.modelValue))return Un(n.modelValue).length===0&&!o.inputValue;const he=Nt(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||sn(he)?!o.inputValue:!0}),oe=a.computed(()=>{var he;const xe=(he=n.placeholder)!=null?he:t("el.select.placeholder");return n.multiple||!O.value?xe:o.selectedLabel}),ae=a.computed(()=>qc?null:"mouseenter");a.watch(()=>n.modelValue,(he,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",le("")),U(),!il(he,xe)&&n.validateEvent&&(T==null||T.validate("change").catch(_e=>dt(_e)))},{flush:"post",deep:!0}),a.watch(()=>R.value,he=>{he?le(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",he)}),a.watch(()=>o.options.entries(),()=>{var he;if(!Rt)return;const xe=((he=l.value)==null?void 0:he.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!sn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&U(),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value&&H()},{flush:"post"}),a.watch(()=>o.hoveringIndex,he=>{et(he)&&he>-1?I.value=q.value[he]||{}:I.value={},q.value.forEach(xe=>{xe.hover=I.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||X()});const le=he=>{o.previousQuery===he||M.value||(o.previousQuery=he,n.filterable&&Jt(n.filterMethod)?n.filterMethod(he):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(he),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value?a.nextTick(H):a.nextTick(Q))},H=()=>{const he=q.value.filter(Fe=>Fe.visible&&!Fe.disabled&&!Fe.states.groupDisabled),xe=he.find(Fe=>Fe.created),_e=he[0];o.hoveringIndex=st(q.value,xe||_e)},U=()=>{if(n.multiple)o.selectedLabel="";else{const xe=Nt(n.modelValue)?n.modelValue[0]:n.modelValue,_e=D(xe);o.selectedLabel=_e.currentLabel,o.selected=[_e];return}const he=[];sn(n.modelValue)||Un(n.modelValue).forEach(xe=>{he.push(D(xe))}),o.selected=he},D=he=>{let xe;const _e=Qc(he).toLowerCase()==="object",Fe=Qc(he).toLowerCase()==="null",Ne=Qc(he).toLowerCase()==="undefined";for(let qe=o.cachedOptions.size-1;qe>=0;qe--){const Lt=j.value[qe];if(_e?hi(Lt.value,n.valueKey)===hi(he,n.valueKey):Lt.value===he){xe={value:he,currentLabel:Lt.currentLabel,get isDisabled(){return Lt.isDisabled}};break}}if(xe)return xe;const je=_e?he.label:!Fe&&!Ne?he:"";return{value:he,currentLabel:je}},Q=()=>{o.hoveringIndex=q.value.findIndex(he=>o.selected.some(xe=>se(xe)===se(he)))},ie=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ce=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},ge=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},ye=()=>{var he,xe;(xe=(he=c.value)==null?void 0:he.updatePopper)==null||xe.call(he)},ue=()=>{var he,xe;(xe=(he=f.value)==null?void 0:he.updatePopper)==null||xe.call(he)},be=()=>{o.inputValue.length>0&&!R.value&&(R.value=!0),le(o.inputValue)},ne=he=>{if(o.inputValue=he.target.value,n.remote)de();else return be()},de=vu(()=>{be()},Y.value),ve=he=>{il(n.modelValue,he)||e(pi,he)},Ee=he=>xS(he,xe=>!o.disabledOptions.has(xe)),Se=he=>{if(n.multiple&&he.code!==Hn.delete&&he.target.value.length<=0){const xe=Un(n.modelValue).slice(),_e=Ee(xe);if(_e<0)return;const Fe=xe[_e];xe.splice(_e,1),e(tt,xe),ve(xe),e("remove-tag",Fe)}},Ie=(he,xe)=>{const _e=o.selected.indexOf(xe);if(_e>-1&&!x.value){const Fe=Un(n.modelValue).slice();Fe.splice(_e,1),e(tt,Fe),ve(Fe),e("remove-tag",xe.value)}he.stopPropagation(),pt()},Je=he=>{he.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const _e of o.selected)_e.isDisabled&&xe.push(_e.value);e(tt,xe),ve(xe),o.hoveringIndex=-1,R.value=!1,e("clear"),pt()},Ve=he=>{var xe;if(n.multiple){const _e=Un((xe=n.modelValue)!=null?xe:[]).slice(),Fe=st(_e,he.value);Fe>-1?_e.splice(Fe,1):(n.multipleLimit<=0||_e.length<n.multipleLimit)&&_e.push(he.value),e(tt,_e),ve(_e),he.created&&le(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(tt,he.value),ve(he.value),R.value=!1;pt(),!R.value&&a.nextTick(()=>{Re(he)})},st=(he=[],xe)=>{if(!Kt(xe))return he.indexOf(xe);const _e=n.valueKey;let Fe=-1;return he.some((Ne,je)=>a.toRaw(hi(Ne,_e))===hi(xe,_e)?(Fe=je,!0):!1),Fe},Re=he=>{var xe,_e,Fe,Ne,je;const ze=Nt(he)?he[0]:he;let qe=null;if(ze!=null&&ze.value){const Lt=q.value.filter(Ht=>Ht.value===ze.value);Lt.length>0&&(qe=Lt[0].$el)}if(c.value&&qe){const Lt=(Ne=(Fe=(_e=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:_e.contentRef)==null?void 0:Fe.querySelector)==null?void 0:Ne.call(Fe,`.${r.be("dropdown","wrap")}`);Lt&&CS(Lt,qe)}(je=v.value)==null||je.handleScroll()},Ue=he=>{o.options.set(he.value,he),o.cachedOptions.set(he.value,he),he.disabled&&o.disabledOptions.set(he.value,he)},We=(he,xe)=>{o.options.get(he)===xe&&o.options.delete(he)},Pt=a.computed(()=>{var he,xe;return(xe=(he=c.value)==null?void 0:he.popperRef)==null?void 0:xe.contentRef}),It=()=>{o.isBeforeHide=!1,a.nextTick(()=>Re(o.selected))},pt=()=>{var he;(he=d.value)==null||he.focus()},yt=()=>{var he;(he=d.value)==null||he.blur()},oi=he=>{Je(he)},ki=()=>{R.value=!1,P.value&&yt()},ai=()=>{o.inputValue.length>0?o.inputValue="":R.value=!1},wr=()=>{x.value||(qc&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:R.value=!R.value)},as=()=>{R.value?q.value[o.hoveringIndex]&&Ve(q.value[o.hoveringIndex]):wr()},se=he=>Kt(he.value)?hi(he.value,n.valueKey):he.value,we=a.computed(()=>q.value.filter(he=>he.visible).every(he=>he.disabled)),Te=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),De=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),J=he=>{if(!R.value){R.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||M.value)&&!we.value){he==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):he==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=q.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&J(he),a.nextTick(()=>Re(I.value))}},pe=()=>{if(!u.value)return 0;const he=window.getComputedStyle(u.value);return Number.parseFloat(he.gap||"6px")},fe=a.computed(()=>{const he=pe();return{maxWidth:`${y.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-he:o.selectionWidth}px`}}),me=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,hL)}px`}));return xn(u,ie),xn(p,ce),xn(h,ye),xn(C,ye),xn(b,ue),xn(y,ge),a.onMounted(()=>{U()}),{inputId:E,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:P,expanded:R,optionsArray:q,hoverOption:I,selectSize:K,filteredOptionsCount:te,resetCalculatorWidth:ce,updateTooltip:ye,updateTagTooltip:ue,debouncedOnInputChange:de,onInput:ne,deletePrevTag:Se,deleteTag:Ie,deleteSelected:Je,handleOptionSelect:Ve,scrollToOption:Re,hasModelValue:O,shouldShowPlaceholder:W,currentPlaceholder:oe,mouseEnterEventName:ae,showClose:B,iconComponent:N,iconReverse:k,validateState:z,validateIcon:G,showNewOption:$,updateOptions:X,collapseTagSize:re,setSelected:U,selectDisabled:x,emptyText:Z,handleCompositionStart:A,handleCompositionUpdate:_,handleCompositionEnd:w,onOptionCreate:Ue,onOptionDestroy:We,handleMenuEnter:It,focus:pt,blur:yt,handleClearClick:oi,handleClickOutside:ki,handleEsc:ai,toggleMenu:wr,selectOption:as,getValueKey:se,navigateOptions:J,dropdownMenuVisible:V,showTagList:Te,collapseTagList:De,tagStyle:fe,collapseTagStyle:me,inputStyle:Me,popperRef:Pt,inputRef:d,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:g,suffixRef:m,selectRef:l,wrapperRef:C,selectionRef:u,scrollbarRef:v,menuRef:h,tagMenuRef:b,collapseItemRef:y}};var pL=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(Sl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){Nt(c)&&c.forEach(f=>{var d,p,g,m;const h=(d=(f==null?void 0:f.type)||{})==null?void 0:d.name;h==="ElOptionGroup"?u(!Bt(f.children)&&!Nt(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(g=f.children)==null?void 0:g.default():f.children):h==="ElOption"?l.push((m=f.props)==null?void 0:m.value):Nt(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),il(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const mL=$e({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:$n,effect:{type:Be(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Be(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:dn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Wi,default:bu},fitInputWidth:Boolean,suffixIcon:{type:Wi,default:yu},tagType:{...Ju.type,default:"info"},tagEffect:{...Ju.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Be(String),values:ps,default:"bottom-start"},fallbackPlacements:{type:Be(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...ET,...Zn(["ariaLabel"])}),Dg="ElSelect",gL=a.defineComponent({name:Dg,componentName:Dg,components:{ElSelectMenu:dL,ElOption:qu,ElOptions:pL,ElTag:o2,ElScrollbar:iE,ElTooltip:Wu,ElIcon:mt},directives:{ClickOutside:LC},props:mL,emits:[tt,pi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return Nt(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=fL(i,e);return a.provide(Sl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function vL(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),d=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),g=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,h=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(h),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!h.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:h.currentLabel,value:h.value},()=>[a.createTextVNode(a.toDisplayString(h.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,h=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(h),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!h.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:h.currentLabel,value:h.value},()=>[a.createTextVNode(a.toDisplayString(h.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":h=>n.states.inputValue=h,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(h=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(h=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(d,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[g,n.handleClickOutside,n.popperRef]])}var yL=He(gL,[["render",vL],["__file","select.vue"]]);const bL=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ge("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Bg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,d;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((d=c.component)!=null&&d.proxy)},l=c=>{const f=Un(c),d=[];return f.forEach(p=>{var g,m;o(p)?d.push(p.component.proxy):(g=p.children)!=null&&g.length?d.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&d.push(...l(p.component.subTree))}),d},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Aw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function xL(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var kg=He(bL,[["render",xL],["__file","option-group.vue"]]);const _s=bt(yL,{Option:qu,OptionGroup:kg}),Ts=un(qu);un(kg);const wL=$e({trigger:$o.trigger,placement:Ku.placement,disabled:$o.disabled,visible:dn.visible,transition:dn.transition,popperOptions:Ku.popperOptions,tabindex:Ku.tabindex,content:dn.content,popperStyle:dn.popperStyle,popperClass:dn.popperClass,enterable:{...dn.enterable,default:!0},effect:{...dn.effect,default:"light"},teleported:dn.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),ML={"update:visible":n=>Ui(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},AL="onUpdate:visible",SL=a.defineComponent({name:"ElPopover"}),_L=a.defineComponent({...SL,props:wL,emits:ML,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[AL]),s=Ge("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:sl(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),d=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},g=()=>{t("before-leave")},m=()=>{t("after-enter")},h=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:d}),(b,y)=>(a.openBlock(),a.createBlock(a.unref(Wu),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:g,onShow:m,onHide:h}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var TL=He(_L,[["__file","popover.vue"]]);const Vg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var EL={mounted(n,e){Vg(n,e)},updated(n,e){Vg(n,e)}};const CL=YS(EL,"popover"),_l=bt(TL,{directive:CL}),zg=Symbol("sliderContextKey"),LL=$e({modelValue:{type:Be([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:$n,inputSize:$n,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Be(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Be(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:ps,default:"top"},marks:{type:Be(Object)},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),Qu=n=>et(n)||Nt(n)&&n.every(et),RL={[tt]:Qu,[Er]:Qu,[pi]:Qu},FL=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),zt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},PL=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),IL=(n,e,t)=>{const{form:i,formItem:r}=yi(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),d=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(d.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),g=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),h=a.computed(()=>n.vertical?{height:p.value,bottom:g.value}:{width:p.value,left:g.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},y=T=>{const E=n.min+T*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-E)<Math.abs(d.value-E)?L=e.firstValue<e.secondValue?"firstButton":"secondButton":L=e.firstValue>e.secondValue?"firstButton":"secondButton",u[L]},v=T=>{const E=y(T);return E.value.setPosition(T),E},M=T=>{e.firstValue=T??n.min,_(n.range?[f.value,d.value]:T??n.min)},A=T=>{e.secondValue=T,n.range&&_([f.value,d.value])},_=T=>{t(tt,T),t(Er,T)},w=async()=>{await a.nextTick(),t(pi,n.range?[f.value,d.value]:n.modelValue)},C=T=>{var E,L,F,x,O,B;if(c.value||e.dragging)return;b();let N=0;if(n.vertical){const k=(F=(L=(E=T.touches)==null?void 0:E.item(0))==null?void 0:L.clientY)!=null?F:T.clientY;N=(s.value.getBoundingClientRect().bottom-k)/e.sliderSize*100}else{const k=(B=(O=(x=T.touches)==null?void 0:x.item(0))==null?void 0:O.clientX)!=null?B:T.clientX,z=s.value.getBoundingClientRect().left;N=(k-z)/e.sliderSize*100}if(!(N<0||N>100))return v(N)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:d,runwayStyle:m,barStyle:h,resetSize:b,setPosition:v,emitChange:w,onSliderWrapperPrevent:T=>{var E,L;((E=u.firstButton.value)!=null&&E.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&T.preventDefault()},onSliderClick:T=>{C(T)&&w()},onSliderDown:async T=>{const E=C(T);E&&(await a.nextTick(),E.value.onButtonDown(T))},onSliderMarkerDown:T=>{c.value||e.dragging||v(T)},setFirstValue:M,setSecondValue:A}},{left:OL,down:NL,right:BL,up:DL,home:kL,end:VL,pageUp:zL,pageDown:UL}=Hn,GL=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=vu(()=>{t.value&&(r.value=!0)},50),u=vu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},HL=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:d,resetSize:p,updateDragging:g}=a.inject(zg),{tooltip:m,tooltipVisible:h,formatValue:b,displayTooltip:y,hideTooltip:v}=GL(n,f,l),M=a.ref(),A=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),_=a.computed(()=>n.vertical?{bottom:A.value}:{left:A.value}),w=()=>{e.hovering=!0,y()},C=()=>{e.hovering=!1,e.dragging||v()},P=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",N),window.addEventListener("touchmove",N),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k),M.value.focus())},R=G=>{i.value||(e.newPosition=Number.parseFloat(A.value)+G/(s.value-r.value)*100,z(e.newPosition),d())},I=()=>{R(-o.value)},S=()=>{R(o.value)},T=()=>{R(-o.value*4)},E=()=>{R(o.value*4)},L=()=>{i.value||(z(0),d())},F=()=>{i.value||(z(100),d())},x=G=>{let Y=!0;[OL,NL].includes(G.key)?I():[BL,DL].includes(G.key)?S():G.key===kL?L():G.key===VL?F():G.key===UL?T():G.key===zL?E():Y=!1,Y&&G.preventDefault()},O=G=>{let Y,Z;return G.type.startsWith("touch")?(Z=G.touches[0].clientY,Y=G.touches[0].clientX):(Z=G.clientY,Y=G.clientX),{clientX:Y,clientY:Z}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:Y,clientY:Z}=O(G);n.vertical?e.startY=Z:e.startX=Y,e.startPosition=Number.parseFloat(A.value),e.newPosition=e.startPosition},N=G=>{if(e.dragging){e.isClick=!1,y(),p();let Y;const{clientX:Z,clientY:te}=O(G);n.vertical?(e.currentY=te,Y=(e.startY-e.currentY)/c.value*100):(e.currentX=Z,Y=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+Y,z(e.newPosition)}},k=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||v(),e.isClick||z(e.newPosition),d()},0),window.removeEventListener("mousemove",N),window.removeEventListener("touchmove",N),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))},z=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const Y=100/((s.value-r.value)/o.value);let te=Math.round(G/Y)*Y*(s.value-r.value)*.01+r.value;te=Number.parseFloat(te.toFixed(u.value)),te!==n.modelValue&&t(tt,te),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&y(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{g(G)}),zt(M,"touchstart",P,{passive:!1}),{disabled:i,button:M,tooltip:m,tooltipVisible:h,showTooltip:l,wrapperStyle:_,formatValue:b,handleMouseEnter:w,handleMouseLeave:C,onButtonDown:P,onKeyDown:x,setPosition:z}},WL=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return dt("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),jL=(n,e,t,i,r,s)=>{const o=c=>{r(tt,c),r(Er,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&hs("Slider","min should not be greater than max.");const d=n.modelValue;n.range&&Array.isArray(d)?d[1]<n.min?o([n.min,n.min]):d[0]>n.max?o([n.max,n.max]):d[0]<n.min?o([n.min,d[1]]):d[1]>n.max?o([d[0],n.max]):(e.firstValue=d[0],e.secondValue=d[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>dt(p))),e.oldValue=d.slice())):!n.range&&typeof d=="number"&&!Number.isNaN(d)&&(d<n.min?o(n.min):d>n.max?o(n.max):(e.firstValue=d,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>dt(p))),e.oldValue=d)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((d,p)=>d===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},$L=$e({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:ps,default:"top"}}),ZL={[tt]:n=>et(n)},XL=a.defineComponent({name:"ElSliderButton"}),YL=a.defineComponent({...XL,props:$L,emits:ZL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:d,formatValue:p,handleMouseEnter:g,handleMouseLeave:m,onButtonDown:h,onKeyDown:b,setPosition:y}=HL(i,s,t),{hovering:v,dragging:M}=a.toRefs(s);return e({onButtonDown:h,onKeyDown:b,setPosition:y,hovering:v,dragging:M}),(A,_)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(v),dragging:a.unref(M)}]),style:a.normalizeStyle(a.unref(d)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(g),onMouseleave:a.unref(m),onMousedown:a.unref(h),onFocus:a.unref(g),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Wu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:A.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":A.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(v),dragging:a.unref(M)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var Ug=He(YL,[["__file","button.vue"]]);const JL=$e({mark:{type:Be([String,Object]),default:void 0}});var KL=a.defineComponent({name:"ElSliderMarker",props:JL,setup(n){const e=Ge("slider"),t=a.computed(()=>Bt(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Bt(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const qL=a.defineComponent({name:"ElSlider"}),QL=a.defineComponent({...qL,props:LL,emits:RL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),{t:s}=cl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:d,minValue:p,maxValue:g,runwayStyle:m,barStyle:h,resetSize:b,emitChange:y,onSliderWrapperPrevent:v,onSliderClick:M,onSliderDown:A,onSliderMarkerDown:_,setFirstValue:w,setSecondValue:C}=IL(i,o,t),{stops:P,getStopStyle:R}=WL(i,o,p,g),{inputId:I,isLabeledByFormItem:S}=ws(i,{formItemContext:l}),T=vi(),E=a.computed(()=>i.inputSize||T.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),F=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(Y.value):`${Y.value}`),O=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(Z.value):`${Z.value}`),N=a.computed(()=>[r.b(),r.m(T.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),k=PL(i);jL(i,o,p,g,t,l);const z=a.computed(()=>{const j=[i.min,i.max,i.step].map($=>{const X=`${$}`.split(".")[1];return X?X.length:0});return Math.max.apply(null,j)}),{sliderWrapper:G}=FL(i,o,b),{firstValue:Y,secondValue:Z,sliderSize:te}=a.toRefs(o),q=j=>{o.dragging=j};return zt(G,"touchstart",v,{passive:!1}),zt(G,"touchmove",v,{passive:!1}),a.provide(zg,{...a.toRefs(i),sliderSize:te,disabled:d,precision:z,emitChange:y,resetSize:b,updateDragging:q}),e({onSliderClick:M}),(j,$)=>{var X,K;return a.openBlock(),a.createElementBlock("div",{id:j.range?a.unref(I):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(N)),role:j.range?"group":void 0,"aria-label":j.range&&!a.unref(S)?a.unref(L):void 0,"aria-labelledby":j.range&&a.unref(S)?(X=a.unref(l))==null?void 0:X.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":j.showInput&&!j.range},a.unref(r).is("disabled",a.unref(d))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(A),onTouchstartPassive:a.unref(A)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(h))},null,6),a.createVNode(Ug,{id:j.range?void 0:a.unref(I),ref_key:"firstButton",ref:c,"model-value":a.unref(Y),vertical:j.vertical,"tooltip-class":j.tooltipClass,placement:j.placement,role:"slider","aria-label":j.range||!a.unref(S)?a.unref(F):void 0,"aria-labelledby":!j.range&&a.unref(S)?(K=a.unref(l))==null?void 0:K.labelId:void 0,"aria-valuemin":j.min,"aria-valuemax":j.range?a.unref(Z):j.max,"aria-valuenow":a.unref(Y),"aria-valuetext":a.unref(x),"aria-orientation":j.vertical?"vertical":"horizontal","aria-disabled":a.unref(d),"onUpdate:modelValue":a.unref(w)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),j.range?(a.openBlock(),a.createBlock(Ug,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(Z),vertical:j.vertical,"tooltip-class":j.tooltipClass,placement:j.placement,role:"slider","aria-label":a.unref(O),"aria-valuemin":a.unref(Y),"aria-valuemax":j.max,"aria-valuenow":a.unref(Z),"aria-valuetext":a.unref(B),"aria-orientation":j.vertical?"vertical":"horizontal","aria-disabled":a.unref(d),"onUpdate:modelValue":a.unref(C)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),j.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(P),(re,V)=>(a.openBlock(),a.createElementBlock("div",{key:V,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(R)(re))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(k).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(re,V)=>(a.openBlock(),a.createElementBlock("div",{key:V,style:a.normalizeStyle(a.unref(R)(re.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(re,V)=>(a.openBlock(),a.createBlock(a.unref(KL),{key:V,mark:re.mark,style:a.normalizeStyle(a.unref(R)(re.position)),onMousedown:a.withModifiers(W=>a.unref(_)(re.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),j.showInput&&!j.range?(a.openBlock(),a.createBlock(a.unref(Mi),{key:0,ref:"input","model-value":a.unref(Y),class:a.normalizeClass(a.unref(r).e("input")),step:j.step,disabled:a.unref(d),controls:j.showInputControls,min:j.min,max:j.max,precision:a.unref(z),debounce:j.debounce,size:a.unref(E),"onUpdate:modelValue":a.unref(w),onChange:a.unref(y)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var eR=He(QL,[["__file","slider.vue"]]);const Sn=bt(eR),Tl=Symbol("tabsRootContextKey"),tR=$e({tabs:{type:Be(Array),default:()=>mi([])}}),Gg="ElTabBar",nR=a.defineComponent({name:Gg}),iR=a.defineComponent({...nR,props:tR,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Tl);r||hs(Gg,"<el-tabs><el-tab-bar /></el-tabs>");const s=Ge("tabs"),o=a.ref(),l=a.ref(),u=()=>{let g=0,m=0;const h=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=h==="width"?"x":"y",y=b==="x"?"left":"top";return t.tabs.every(v=>{var M,A;const _=(A=(M=i.parent)==null?void 0:M.refs)==null?void 0:A[`tab-${v.uid}`];if(!_)return!1;if(!v.active)return!0;g=_[`offset${Gi(y)}`],m=_[`client${Gi(h)}`];const w=window.getComputedStyle(_);return h==="width"&&(m-=Number.parseFloat(w.paddingLeft)+Number.parseFloat(w.paddingRight),g+=Number.parseFloat(w.paddingLeft)),!1}),{[h]:`${m}px`,transform:`translate${Gi(b)}(${g}px)`}},c=()=>l.value=u(),f=[],d=()=>{var g;f.forEach(h=>h.stop()),f.length=0;const m=(g=i.parent)==null?void 0:g.refs;if(m){for(const h in m)if(h.startsWith("tab-")){const b=m[h];b&&f.push(xn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),d()},{immediate:!0});const p=xn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(g=>g.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(g,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var rR=He(iR,[["__file","tab-bar.vue"]]);const sR=$e({panes:{type:Be(Array),default:()=>mi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),oR={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Hg="ElTabNav",aR=a.defineComponent({name:Hg,props:sR,emits:oR,setup(n,{expose:e,emit:t}){const i=a.inject(Tl);i||hs(Hg,"<el-tabs><tab-nav /></el-tabs>");const r=Ge("tabs"),s=gw(),o=Cw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),d=a.ref(!1),p=a.ref(0),g=a.ref(!1),m=a.ref(!0),h=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${h.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!l.value)return;const P=l.value[`offset${Gi(h.value)}`],R=p.value;if(!R)return;const I=R>P?R-P:0;p.value=I},v=()=>{if(!l.value||!u.value)return;const P=u.value[`offset${Gi(h.value)}`],R=l.value[`offset${Gi(h.value)}`],I=p.value;if(P-I<=R)return;const S=P-I>R*2?I+R:P-R;p.value=S},M=async()=>{const P=u.value;if(!d.value||!c.value||!l.value||!P)return;await a.nextTick();const R=c.value.querySelector(".is-active");if(!R)return;const I=l.value,S=["top","bottom"].includes(i.props.tabPosition),T=R.getBoundingClientRect(),E=I.getBoundingClientRect(),L=S?P.offsetWidth-E.width:P.offsetHeight-E.height,F=p.value;let x=F;S?(T.left<E.left&&(x=F-(E.left-T.left)),T.right>E.right&&(x=F+T.right-E.right)):(T.top<E.top&&(x=F-(E.top-T.top)),T.bottom>E.bottom&&(x=F+(T.bottom-E.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},A=()=>{var P;if(!u.value||!l.value)return;n.stretch&&((P=f.value)==null||P.update());const R=u.value[`offset${Gi(h.value)}`],I=l.value[`offset${Gi(h.value)}`],S=p.value;I<R?(d.value=d.value||{},d.value.prev=S,d.value.next=S+I<R,R-S<I&&(p.value=R-I)):(d.value=!1,S>0&&(p.value=0))},_=P=>{const R=P.code,{up:I,down:S,left:T,right:E}=Hn;if(![I,S,T,E].includes(R))return;const L=Array.from(P.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),F=L.indexOf(P.target);let x;R===T||R===I?F===0?x=L.length-1:x=F-1:F<L.length-1?x=F+1:x=0,L[x].focus({preventScroll:!0}),L[x].click(),w()},w=()=>{m.value&&(g.value=!0)},C=()=>g.value=!1;return a.watch(s,P=>{P==="hidden"?m.value=!1:P==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,P=>{P?setTimeout(()=>m.value=!0,50):m.value=!1}),xn(c,A),a.onMounted(()=>setTimeout(()=>M(),0)),a.onUpdated(()=>A()),e({scrollToActiveTab:M,removeFocus:C}),()=>{const P=d.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!d.value.prev)],onClick:y},[a.createVNode(mt,null,{default:()=>[a.createVNode(Hi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!d.value.next)],onClick:v},[a.createVNode(mt,null,{default:()=>[a.createVNode(Tr,null,null)]})])]:null,R=n.panes.map((I,S)=>{var T,E,L,F;const x=I.uid,O=I.props.disabled,B=(E=(T=I.props.name)!=null?T:I.index)!=null?E:`${S}`,N=!O&&(I.isClosable||n.editable);I.index=`${S}`;const k=N?a.createVNode(mt,{class:"is-icon-close",onClick:Y=>t("tabRemove",I,Y)},{default:()=>[a.createVNode(xu,null,null)]}):null,z=((F=(L=I.slots).label)==null?void 0:F.call(L))||I.props.label,G=!O&&I.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",I.active),r.is("disabled",O),r.is("closable",N),r.is("focus",g.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":I.active,tabindex:G,onFocus:()=>w(),onBlur:()=>C(),onClick:Y=>{C(),t("tabClick",I,B,Y)},onKeydown:Y=>{N&&(Y.code===Hn.delete||Y.code===Hn.backspace)&&t("tabRemove",I,Y)}},[z,k])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!d.value),r.is(i.props.tabPosition)]},[P,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:_},[n.type?null:a.createVNode(rR,{ref:f,tabs:[...n.panes]},null),R])])])}}}),lR=$e({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Be(Function),default:()=>!0},stretch:Boolean}),ed=n=>Bt(n)||et(n),cR={[tt]:n=>ed(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>ed(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>ed(n),tabAdd:()=>!0},uR=a.defineComponent({name:"ElTabs",props:lR,emits:cR,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ge("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=MT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),d=a.ref((r=n.modelValue)!=null?r:"0"),p=async(y,v=!1)=>{var M,A,_;if(!(d.value===y||sn(y)))try{await((M=n.beforeLeave)==null?void 0:M.call(n,y,d.value))!==!1&&(d.value=y,v&&(e(tt,y),e("tabChange",y)),(_=(A=f.value)==null?void 0:A.removeFocus)==null||_.call(A))}catch{}},g=(y,v,M)=>{y.props.disabled||(p(v,!0),e("tabClick",y,M))},m=(y,v)=>{y.props.disabled||sn(y.props.name)||(v.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},h=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,y=>p(y)),a.watch(d,async()=>{var y;await a.nextTick(),(y=f.value)==null||y.scrollToActiveTab()}),a.provide(Tl,{props:n,currentName:d,registerPane:y=>{l.value.push(y)},sortPane:u,unregisterPane:c}),i({currentName:d});const b=({render:y})=>y();return()=>{const y=t["add-icon"],v=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:h,onKeydown:_=>{_.code===Hn.enter&&h()}},[y?a.renderSlot(t,"add-icon"):a.createVNode(mt,{class:s.is("icon-plus")},{default:()=>[a.createVNode(ol,null,null)]})]):null,M=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const _=l.value.some(w=>w.slots.label);return a.createVNode(aR,{ref:f,currentName:d.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:g,onTabRemove:m},{$stable:!_})}},null),v]),A=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[A,M])}}}),dR=$e({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Wg="ElTabPane",hR=a.defineComponent({name:Wg}),fR=a.defineComponent({...hR,props:dR,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Tl);r||hs(Wg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=Ge("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Uf(()=>{var g;return r.currentName.value===((g=e.name)!=null?g:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var g;return(g=e.name)!=null?g:o.value}),d=Uf(()=>!e.lazy||c.value||u.value);a.watch(u,g=>{g&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(g,m)=>a.unref(d)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(g.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var jg=He(fR,[["__file","tab-pane.vue"]]);const $g=bt(uR,{TabPane:jg}),Zg=un(jg);function pR(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,g=d.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(rl(p,g.bm("parent","relative")),p.removeAttribute("loading-number")),rl(p,g.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,g;(g=(p=d.$el)==null?void 0:p.parentNode)==null||g.removeChild(d.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:g}){const{ns:m,zIndex:h}=RT("loading");return g({ns:m,zIndex:h}),()=>{const b=i.spinner||i.svg,y=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),v=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,v])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),d=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:d,get $el(){return d.$el}}}let El;const td=function(n={}){if(!Rt)return;const e=mR(n);if(e.fullscreen&&El)return El;const t=pR({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(El=void 0)}});gR(e,e.parent,t),Xg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Xg(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(El=t),t},mR=n=>{var e,t,i,r;let s;return Bt(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},gR=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Bo(document.body,"position"),t.originalOverflow.value=Bo(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Bo(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(Bo(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Bo(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Xg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?rl(e,i.bm("parent","relative")):$p(e,i.bm("parent","relative")),n.fullscreen&&n.lock?$p(e,i.bm("parent","hidden")):rl(e,i.bm("parent","hidden"))},Cl=Symbol("ElLoading"),Yg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>Kt(e.value)?e.value[p]:void 0,u=p=>{const g=Bt(p)&&(o==null?void 0:o[p])||p;return g&&a.ref(g)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Bw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,d={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[Cl]={options:d,instance:td(d)}},vR=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},nd={mounted(n,e){e.value&&Yg(n,e)},updated(n,e){const t=n[Cl];e.oldValue!==e.value&&(e.value&&!e.oldValue?Yg(n,e):e.value&&e.oldValue?Kt(e.value)&&vR(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[Cl])==null||e.instance.close(),n[Cl]=null}},yR={install(n){n.directive("loading",nd),n.config.globalProperties.$loading=td},directive:nd,service:td},Jn=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},bR=[{position:"top",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"bottom",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"left",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"},{position:"right",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"}],xR={name:"ScaffoldOverlay",data:function(){return{lockRotationMode:!1,touchActive:!1,rotationOverlays:bR}},props:{positionalRotation:{type:Boolean,default:!1}},methods:{contentMouseActive:function(n,e){if(this.positionalRotation){const t=this.$refs.topLayer;t&&(e?(this.lockRotationMode=!0,t.style.pointerEvents="none",n.type==="touchstart"&&(this.touchActive=!0)):(this.lockRotationMode=!1,this.setRotationMode(void 0,"free"),t.style.pointerEvents="auto",n.type==="touchend"&&(this.touchActive=!1)))}},setRotationMode:function(n,e){this.lockRotationMode||this.$emit("onRotationModeChange",e),n&&(n.preventDefault(),n.stopPropagation())},skipWhenInBound:function(n){if(this.positionalRotation){const e=this.$refs.topLayer,t=this.$refs.contentLayer;if(e&&t){const i=e.style.pointerEvents;e.style.pointerEvents="none";const r=document.elementFromPoint(n.clientX,n.clientY);e.style.pointerEvents=i,t.contains(r)&&n.stopPropagation()}}},forwardEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=document.elementFromPoint(n.clientX,n.clientY);if(e.style.pointerEvents=t,i){const r=new MouseEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,view:n.view,clientX:n.clientX,clientY:n.clientY,button:n.button});i.dispatchEvent(r),n.stopPropagation()}n.preventDefault()},forwardTouchEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=n.changedTouches[0],r=i.clientX,s=i.clientY,o=document.elementFromPoint(r,s);if(e.style.pointerEvents=t,o){const l=new Touch({identifier:i.identifier,target:o,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,radiusX:i.radiusX,radiusY:i.radiusY,rotationAngle:i.rotationAngle,force:i.force}),u=new TouchEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,composed:!0,view:n.view,touches:[l],targetTouches:[l],changedTouches:[l]});o.dispatchEvent(u),n.stopPropagation()}n.preventDefault()}}},wR={ref:"overlay"},MR=["onMousedown","onTouchstart"];function AR(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",wR,[a.createElementVNode("div",{class:"content-layer",ref:"contentLayer",onMouseleaveCapture:e[0]||(e[0]=(...o)=>s.skipWhenInBound&&s.skipWhenInBound(...o)),onMousedownCapture:e[1]||(e[1]=o=>s.contentMouseActive(o,!0)),onMouseupCapture:e[2]||(e[2]=o=>s.contentMouseActive(o,!1)),onTouchstartCapture:e[3]||(e[3]=o=>s.contentMouseActive(o,!0)),onTouchendCapture:e[4]||(e[4]=o=>s.contentMouseActive(o,!1))},[a.renderSlot(n.$slots,"default",{},void 0,!0)],544),t.positionalRotation?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"topLayer",onMousemoveCapture:e[7]||(e[7]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onMouseoverCapture:e[8]||(e[8]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onTouchmoveCapture:e[9]||(e[9]=(...o)=>s.forwardTouchEvent&&s.forwardTouchEvent(...o)),onClickCapture:e[10]||(e[10]=(...o)=>s.forwardEvent&&s.forwardEvent(...o))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.rotationOverlays,o=>(a.openBlock(),a.createElementBlock("div",{key:o.position,class:a.normalizeClass(["rotation-overlay",o.position,n.touchActive?"touch-active":""]),onMousedown:l=>{s.setRotationMode(l,o.mode),s.forwardEvent(l)},onMouseup:e[5]||(e[5]=(...l)=>s.forwardEvent&&s.forwardEvent(...l)),onTouchstart:l=>{s.setRotationMode(l,o.mode),s.forwardTouchEvent(l)},onTouchend:e[6]||(e[6]=(...l)=>s.forwardTouchEvent&&s.forwardTouchEvent(...l))},[a.createElementVNode("span",null,a.toDisplayString(o.text),1)],42,MR))),128))],544)):a.createCommentVNode("",!0)],512)}const Jg=Jn(xR,[["render",AR],["__scopeId","data-v-f06acb4f"]]);var Kg={exports:{}},qg={},Qg;function SR(){return Qg||(Qg=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var d=c.shift();return{done:d===void 0,value:d}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(d){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof d;if(p!=="undefined")if(p==="string")d!==""&&this._fromString(d);else if(d instanceof c){var g=this;d.forEach(function(y,v){g.append(v,y)})}else if(d!==null&&p==="object")if(Object.prototype.toString.call(d)==="[object Array]")for(var m=0;m<d.length;m++){var h=d[m];if(Object.prototype.toString.call(h)==="[object Array]"||h.length!==2)this.append(h[0],h[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in d)d.hasOwnProperty(b)&&this.append(b,d[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(d,p){d in this._entries?this._entries[d].push(String(p)):this._entries[d]=[String(p)]},f.delete=function(d){delete this._entries[d]},f.get=function(d){return d in this._entries?this._entries[d][0]:null},f.getAll=function(d){return d in this._entries?this._entries[d].slice(0):[]},f.has=function(d){return d in this._entries},f.set=function(d,p){this._entries[d]=[String(p)]},f.forEach=function(d,p){var g;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){g=this._entries[m];for(var h=0;h<g.length;h++)d.call(p,g[h],m,this)}},f.keys=function(){var d=[];return this.forEach(function(p,g){d.push(g)}),i(d)},f.values=function(){var d=[];return this.forEach(function(p){d.push(p)}),i(d)},f.entries=function(){var d=[];return this.forEach(function(p,g){d.push([g,p])}),i(d)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var d=[];return this.forEach(function(p,g){d.push(r(g)+"="+r(p))}),d.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,g){f.push([g,p]),c._entries||c.delete(g)}),f.sort(function(p,g){return p[0]<g[0]?-1:p[0]>g[0]?1:0}),c._entries&&(c._entries={});for(var d=0;d<f.length;d++)this.append(f[d][0],f[d][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,h){f.push(h)});for(var d=0;d<f.length;d++)this.delete(f[d])}c=c.replace(/^\?/,"");for(var p=c.split("&"),g,d=0;d<p.length;d++)g=p[d].split("="),this.append(s(g[0]),g.length>1?s(g[1]):"")}})}(typeof Yi<"u"?Yi:typeof window<"u"?window:typeof self<"u"?self:Yi),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,d;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),d=f.createElement("base"),d.href=c,f.head.appendChild(d);try{if(d.href.indexOf(c)!==0)throw new Error(d.href)}catch(M){throw new Error("URL unable to set base "+c+" due to "+M)}}var p=f.createElement("a");p.href=u,d&&(f.body.appendChild(p),p.href=p.href);var g=f.createElement("input");if(g.type="url",g.value=u,p.protocol===":"||!/:/.test(p.href)||!g.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),h=!0,b=!0,y=this;["append","delete","set"].forEach(function(M){var A=m[M];m[M]=function(){A.apply(m,arguments),h&&(b=!1,y.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var v=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==v&&(v=this.search,b&&(h=!1,this.searchParams._fromString(this.search),h=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Yi<"u"?Yi:typeof window<"u"?window:typeof self<"u"?self:Yi)),qg}/**
20
+ `,kT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function VT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:kT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function km(n,e=1,t){var i;Cn||(Cn=document.createElement("textarea"),document.body.appendChild(Cn));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=VT(n);Cn.setAttribute("style",`${l};${DT}`),Cn.value=n.value||n.placeholder||"";let u=Cn.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Cn.value="";const f=Cn.scrollHeight-r;if(et(e)){let d=f*e;o==="border-box"&&(d=d+r+s),u=Math.max(d,u),c.minHeight=`${d}px`}if(et(t)){let d=f*t;o==="border-box"&&(d=d+r+s),u=Math.min(d,u)}return c.height=`${u}px`,(i=Cn.parentNode)==null||i.removeChild(Cn),Cn=void 0,c}const zT=$e({id:{type:String,default:void 0},size:$n,disabled:Boolean,modelValue:{type:Be([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Be([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Wi},prefixIcon:{type:Wi},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Be([Object,Array,String]),default:()=>mi({})},autofocus:Boolean,rows:{type:Number,default:2},...Zn(["ariaLabel"])}),UT={[tt]:n=>Bt(n),input:n=>Bt(n),change:n=>Bt(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},GT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),HT=a.defineComponent({...GT,props:zT,emits:UT,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ue={};return i.containerRole==="combobox"&&(ue["aria-haspopup"]=r["aria-haspopup"],ue["aria-owns"]=r["aria-owns"],ue["aria-expanded"]=r["aria-expanded"]),ue}),l=a.computed(()=>[i.type==="textarea"?b.b():h.b(),h.m(g.value),h.is("disabled",m.value),h.is("exceed",Y.value),{[h.b("group")]:s.prepend||s.append,[h.m("prefix")]:s.prefix||i.prefixIcon,[h.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[h.bm("suffix","password-clear")]:N.value&&k.value,[h.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[h.e("wrapper"),h.is("focus",R.value)]),c=QS({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:d}=yi(),{inputId:p}=ws(i,{formItemContext:d}),g=vi(),m=xs(),h=Ge("input"),b=Ge("textarea"),y=a.shallowRef(),v=a.shallowRef(),M=a.ref(!1),A=a.ref(!1),_=a.ref(),w=a.shallowRef(i.inputStyle),C=a.computed(()=>y.value||v.value),{wrapperRef:P,isFocused:R,handleFocus:I,handleBlur:S}=Om(C,{beforeFocus(){return m.value},afterBlur(){var ue;i.validateEvent&&((ue=d==null?void 0:d.validate)==null||ue.call(d,"blur").catch(be=>dt(be)))}}),T=a.computed(()=>{var ue;return(ue=f==null?void 0:f.statusIcon)!=null?ue:!1}),E=a.computed(()=>(d==null?void 0:d.validateState)||""),L=a.computed(()=>E.value&&Kp[E.value]),F=a.computed(()=>A.value?$S:zS),x=a.computed(()=>[r.style]),O=a.computed(()=>[i.inputStyle,w.value,{resize:i.resize}]),B=a.computed(()=>Gn(i.modelValue)?"":String(i.modelValue)),N=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(R.value||M.value)),k=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||R.value)),z=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),Y=a.computed(()=>!!z.value&&G.value>Number(i.maxlength)),Z=a.computed(()=>!!s.suffix||!!i.suffixIcon||N.value||i.showPassword||z.value||!!E.value&&T.value),[te,q]=xT(y);xn(v,ue=>{if(X(),!z.value||i.resize!=="both")return;const be=ue[0],{width:ne}=be.contentRect;_.value={right:`calc(100% - ${ne+15+6}px)`}});const W=()=>{const{type:ue,autosize:be}=i;if(!(!Rt||ue!=="textarea"||!v.value))if(be){const ne=Kt(be)?be.minRows:void 0,de=Kt(be)?be.maxRows:void 0,ve=km(v.value,ne,de);w.value={overflowY:"hidden",...ve},a.nextTick(()=>{v.value.offsetHeight,w.value=ve})}else w.value={minHeight:km(v.value).minHeight}},X=(ue=>{let be=!1;return()=>{var ne;if(be||!i.autosize)return;((ne=v.value)==null?void 0:ne.offsetParent)===null||(ue(),be=!0)}})(W),K=()=>{const ue=C.value,be=i.formatter?i.formatter(B.value):B.value;!ue||ue.value===be||(ue.value=be)},re=async ue=>{te();let{value:be}=ue.target;if(i.formatter&&(be=i.parser?i.parser(be):be),!j.value){if(be===B.value){K();return}t(tt,be),t("input",be),await a.nextTick(),K(),q()}},V=ue=>{t("change",ue.target.value)},{isComposing:j,handleCompositionStart:oe,handleCompositionUpdate:ae,handleCompositionEnd:le}=Nm({emit:t,afterComposition:re}),H=()=>{A.value=!A.value,U()},U=async()=>{var ue;await a.nextTick(),(ue=C.value)==null||ue.focus()},D=()=>{var ue;return(ue=C.value)==null?void 0:ue.blur()},Q=ue=>{M.value=!1,t("mouseleave",ue)},ie=ue=>{M.value=!0,t("mouseenter",ue)},ce=ue=>{t("keydown",ue)},ge=()=>{var ue;(ue=C.value)==null||ue.select()},ye=()=>{t(tt,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ue;a.nextTick(()=>W()),i.validateEvent&&((ue=d==null?void 0:d.validate)==null||ue.call(d,"change").catch(be=>dt(be)))}),a.watch(B,()=>K()),a.watch(()=>i.type,async()=>{await a.nextTick(),K(),W()}),a.onMounted(()=>{!i.formatter&&i.parser&&dt("ElInput","If you set the parser, you also need to set the formatter."),K(),a.nextTick(W)}),e({input:y,textarea:v,ref:C,textareaStyle:O,autosize:a.toRef(i,"autosize"),isComposing:j,focus:U,blur:D,select:ge,clear:ye,resizeTextarea:W}),(ue,be)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(h).bm("group","append")]:ue.$slots.append,[a.unref(h).bm("group","prepend")]:ue.$slots.prepend}],style:a.unref(x),role:ue.containerRole,onMouseenter:ie,onMouseleave:Q}),[a.createCommentVNode(" input "),ue.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ue.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(h).be("group","prepend"))},[a.renderSlot(ue.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:P,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ue.$slots.prefix||ue.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(h).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("prefix-inner"))},[a.renderSlot(ue.$slots,"prefix"),ue.prefixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(h).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:y,class:a.unref(h).e("inner")},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,type:ue.showPassword?A.value?"text":"password":ue.type,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,tabindex:ue.tabindex,"aria-label":ue.ariaLabel,placeholder:ue.placeholder,style:ue.inputStyle,form:ue.form,autofocus:ue.autofocus,onCompositionstart:a.unref(oe),onCompositionupdate:a.unref(ae),onCompositionend:a.unref(le),onInput:re,onChange:V,onKeydown:ce}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(Z)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(h).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("suffix-inner"))},[!a.unref(N)||!a.unref(k)||!a.unref(z)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ue.$slots,"suffix"),ue.suffixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(h).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(N)?(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("clear")]),onMousedown:a.withModifiers(a.unref(Lo),["prevent"]),onClick:ye},{default:a.withCtx(()=>[a.createVNode(a.unref(bu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createBlock(a.unref(mt),{key:2,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("password")]),onClick:H},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(F))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(z)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(h).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(E)&&a.unref(L)&&a.unref(T)?(a.openBlock(),a.createBlock(a.unref(mt),{key:4,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("validateIcon"),a.unref(h).is("loading",a.unref(E)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ue.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(h).be("group","append"))},[a.renderSlot(ue.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:v,class:[a.unref(b).e("inner"),a.unref(h).is("focus",a.unref(R))]},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,tabindex:ue.tabindex,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,style:a.unref(O),"aria-label":ue.ariaLabel,placeholder:ue.placeholder,form:ue.form,autofocus:ue.autofocus,rows:ue.rows,onCompositionstart:a.unref(oe),onCompositionupdate:a.unref(ae),onCompositionend:a.unref(le),onInput:re,onFocus:a.unref(I),onBlur:a.unref(S),onChange:V,onKeydown:ce}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(z)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(_.value),class:a.normalizeClass(a.unref(h).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var WT=He(HT,[["__file","input.vue"]]);const jT=bt(WT),Ms=4,$T={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},ZT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Nu=Symbol("scrollbarContextKey"),XT=$e({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),YT="Thumb";var Vm=He(a.defineComponent({__name:"thumb",props:XT,setup(n){const e=n,t=a.inject(Nu),i=Ge("scrollbar");t||hs(YT,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Rt?document.onselectstart:null;const d=a.computed(()=>$T[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>ZT({size:e.size,move:e.move,bar:d.value})),g=a.computed(()=>r.value[d.value.offset]**2/t.wrapElement[d.value.scrollSize]/e.ratio/s.value[d.value.offset]),m=w=>{var C;if(w.stopPropagation(),w.ctrlKey||[1,2].includes(w.button))return;(C=window.getSelection())==null||C.removeAllRanges(),b(w);const P=w.currentTarget;P&&(o.value[d.value.axis]=P[d.value.offset]-(w[d.value.client]-P.getBoundingClientRect()[d.value.direction]))},h=w=>{if(!s.value||!r.value||!t.wrapElement)return;const C=Math.abs(w.target.getBoundingClientRect()[d.value.direction]-w[d.value.client]),P=s.value[d.value.offset]/2,R=(C-P)*100*g.value/r.value[d.value.offset];t.wrapElement[d.value.scroll]=R*t.wrapElement[d.value.scrollSize]/100},b=w=>{w.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),f=document.onselectstart,document.onselectstart=()=>!1},y=w=>{if(!r.value||!s.value||u===!1)return;const C=o.value[d.value.axis];if(!C)return;const P=(r.value.getBoundingClientRect()[d.value.direction]-w[d.value.client])*-1,R=s.value[d.value.offset]-C,I=(P-R)*100*g.value/r.value[d.value.offset];t.wrapElement[d.value.scroll]=I*t.wrapElement[d.value.scrollSize]/100},v=()=>{u=!1,o.value[d.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v),_(),c&&(l.value=!1)},M=()=>{c=!1,l.value=!!e.size},A=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{_(),document.removeEventListener("mouseup",v)});const _=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return zt(a.toRef(t,"scrollbarElement"),"mousemove",M),zt(a.toRef(t,"scrollbarElement"),"mouseleave",A),(w,C)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(d).key)]),onMousedown:h},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,w.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const JT=$e({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var KT=He(a.defineComponent({__name:"bar",props:JT,setup(n,{expose:e}){const t=n,i=a.inject(Nu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const g=p.offsetHeight-Ms,m=p.offsetWidth-Ms;s.value=p.scrollTop*100/g*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const g=p.offsetHeight-Ms,m=p.offsetWidth-Ms,h=g**2/p.scrollHeight,b=m**2/p.scrollWidth,y=Math.max(h,t.minSize),v=Math.max(b,t.minSize);u.value=h/(g-h)/(y/(g-y)),c.value=b/(m-b)/(v/(m-v)),l.value=y+Ms<g?`${y}px`:"",o.value=v+Ms<m?`${v}px`:""}}),(p,g)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Vm,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Vm,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const qT=$e({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Be([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Zn(["ariaLabel","ariaOrientation"])}),QT={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(et)},Bu="ElScrollbar",eE=a.defineComponent({name:Bu}),tE=a.defineComponent({...eE,props:qT,emits:QT,setup(n,{expose:e,emit:t}){const i=n,r=Ge("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),d=a.ref(),p=a.ref(),g=a.computed(()=>{const _={};return i.height&&(_.height=sl(i.height)),i.maxHeight&&(_.maxHeight=sl(i.maxHeight)),[i.wrapStyle,_]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),h=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var _;f.value&&((_=p.value)==null||_.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function y(_,w){Kt(_)?f.value.scrollTo(_):et(_)&&et(w)&&f.value.scrollTo(_,w)}const v=_=>{if(!et(_)){dt(Bu,"value must be a number");return}f.value.scrollTop=_},M=_=>{if(!et(_)){dt(Bu,"value must be a number");return}f.value.scrollLeft=_},A=()=>{var _;(_=p.value)==null||_.update()};return a.watch(()=>i.noresize,_=>{_?(s==null||s(),o==null||o()):({stop:s}=xn(d,A),o=zt("resize",A))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var _;A(),f.value&&((_=p.value)==null||_.handleScroll(f.value))})}),a.provide(Nu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{A()})}),a.onUpdated(()=>A()),e({wrapRef:f,update:A,scrollTo:y,setScrollTop:v,setScrollLeft:M,handleScroll:b}),(_,w)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(g)),tabindex:_.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(_.tag),{id:_.id,ref_key:"resizeRef",ref:d,class:a.normalizeClass(a.unref(h)),style:a.normalizeStyle(_.viewStyle),role:_.role,"aria-label":_.ariaLabel,"aria-orientation":_.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(_.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),_.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(KT,{key:0,ref_key:"barRef",ref:p,always:_.always,"min-size":_.minSize},null,8,["always","min-size"]))],2))}});var nE=He(tE,[["__file","scrollbar.vue"]]);const iE=bt(nE),Du=Symbol("popper"),zm=Symbol("popperContent"),Um=$e({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),rE=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),sE=a.defineComponent({...rE,props:Um,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Du,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var oE=He(sE,[["__file","popper.vue"]]);const Gm=$e({arrowOffset:{type:Number,default:5}}),aE=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),lE=a.defineComponent({...aE,props:Gm,setup(n,{expose:e}){const t=n,i=Ge("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(zm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var cE=He(lE,[["__file","arrow.vue"]]);const ku="ElOnlyChild",uE=a.defineComponent({name:ku,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(Tm),s=bT((i=r==null?void 0:r.setForwardRef)!=null?i:Lo);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return dt(ku,"requires exact only one valid child."),null;const u=Hm(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(dt(ku,"no valid child node found"),null)}}});function Hm(n){if(!n)return null;const e=n;for(const t of e){if(Kt(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return Wm(t);case a.Fragment:return Hm(t.children);default:return t}return Wm(t)}return null}function Wm(n){const e=Ge("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const jm=$e({virtualRef:{type:Be(Object)},virtualTriggering:Boolean,onMouseenter:{type:Be(Function)},onMouseleave:{type:Be(Function)},onClick:{type:Be(Function)},onKeydown:{type:Be(Function)},onFocus:{type:Be(Function)},onBlur:{type:Be(Function)},onContextmenu:{type:Be(Function)},id:String,open:Boolean}),dE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),hE=a.defineComponent({...dE,props:jm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Du,void 0);yT(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,d=>{d&&(r.value=ci(d))},{immediate:!0}),a.watch(r,(d,p)=>{c==null||c(),c=void 0,_r(d)&&(f.forEach(g=>{var m;const h=t[g];h&&(d.addEventListener(g.slice(2).toLowerCase(),h),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,g.slice(2).toLowerCase(),h))}),c=a.watch([s,o,l,u],g=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,h)=>{Gn(g[h])?d.removeAttribute(m):d.setAttribute(m,g[h])})},{immediate:!0})),_r(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(g=>p.removeAttribute(g))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&_r(r.value)){const d=r.value;f.forEach(p=>{const g=t[p];g&&d.removeEventListener(p.slice(2).toLowerCase(),g)}),r.value=void 0}}),e({triggerRef:r}),(d,p)=>d.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(uE),a.mergeProps({key:0},d.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(d.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var fE=He(hE,[["__file","trigger.vue"]]);const Vu="focus-trap.focus-after-trapped",zu="focus-trap.focus-after-released",pE="focus-trap.focusout-prevented",$m={cancelable:!0,bubbles:!1},mE={cancelable:!0,bubbles:!1},Zm="focusAfterTrapped",Xm="focusAfterReleased",gE=Symbol("elFocusTrap"),Uu=a.ref(),vl=a.ref(0),Gu=a.ref(0);let yl=0;const Ym=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},Jm=(n,e)=>{for(const t of n)if(!vE(t,e))return t},vE=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},yE=n=>{const e=Ym(n),t=Jm(e,n),i=Jm(e.reverse(),n);return[t,i]},bE=n=>n instanceof HTMLInputElement&&"select"in n,$i=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),Gu.value=window.performance.now(),n!==t&&bE(n)&&e&&n.select()}};function Km(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const xE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=Km(n,i),n.unshift(i)},remove:i=>{var r,s;n=Km(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},wE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if($i(i,e),document.activeElement!==t)return},qm=xE(),ME=()=>vl.value>Gu.value,bl=()=>{Uu.value="pointer",vl.value=window.performance.now()},Qm=()=>{Uu.value="keyboard",vl.value=window.performance.now()},AE=()=>(a.onMounted(()=>{yl===0&&(document.addEventListener("mousedown",bl),document.addEventListener("touchstart",bl),document.addEventListener("keydown",Qm)),yl++}),a.onBeforeUnmount(()=>{yl--,yl<=0&&(document.removeEventListener("mousedown",bl),document.removeEventListener("touchstart",bl),document.removeEventListener("keydown",Qm))}),{focusReason:Uu,lastUserFocusTimestamp:vl,lastAutomatedFocusTimestamp:Gu}),xl=n=>new CustomEvent(pE,{...mE,detail:n}),SE=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Zm,Xm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=AE();fT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:h,altKey:b,ctrlKey:y,metaKey:v,currentTarget:M,shiftKey:A}=m,{loop:_}=n,w=h===Hn.tab&&!b&&!y&&!v,C=document.activeElement;if(w&&C){const P=M,[R,I]=yE(P);if(R&&I){if(!A&&C===I){const T=xl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||(m.preventDefault(),_&&$i(R,!0))}else if(A&&[R,P].includes(C)){const T=xl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||(m.preventDefault(),_&&$i(I,!0))}}else if(C===P){const T=xl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||m.preventDefault()}}};a.provide(gE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[h])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",d)),h&&(h.removeEventListener("keydown",l),h.removeEventListener("focusin",f),h.removeEventListener("focusout",d))});const u=m=>{e(Zm,m)},c=m=>e(Xm,m),f=m=>{const h=a.unref(t);if(!h)return;const b=m.target,y=m.relatedTarget,v=b&&h.contains(b);n.trapped||y&&h.contains(y)||(i=y),v&&e("focusin",m),!o.paused&&n.trapped&&(v?r=b:$i(r,!0))},d=m=>{const h=a.unref(t);if(!(o.paused||!h))if(n.trapped){const b=m.relatedTarget;!Gn(b)&&!h.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const y=xl({focusReason:s.value});e("focusout-prevented",y),y.defaultPrevented||$i(r,!0)}},0)}else{const b=m.target;b&&h.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){qm.push(o);const h=m.contains(document.activeElement)?i:document.activeElement;if(i=h,!m.contains(h)){const y=new Event(Vu,$m);m.addEventListener(Vu,u),m.dispatchEvent(y),y.defaultPrevented||a.nextTick(()=>{let v=n.focusStartEl;Bt(v)||($i(v),document.activeElement!==v&&(v="first")),v==="first"&&wE(Ym(m),!0),(document.activeElement===h||v==="container")&&$i(m)})}}}function g(){const m=a.unref(t);if(m){m.removeEventListener(Vu,u);const h=new CustomEvent(zu,{...$m,detail:{focusReason:s.value}});m.addEventListener(zu,c),m.dispatchEvent(h),!h.defaultPrevented&&(s.value=="keyboard"||!ME()||m.contains(document.activeElement))&&$i(i??document.body),m.removeEventListener(zu,c),qm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():g()})}),a.onBeforeUnmount(()=>{n.trapped&&g(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",d),t.value=void 0)}),{onKeydown:l}}});function _E(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var TE=He(SE,[["render",_E],["__file","focus-trap.vue"]]);const EE=["fixed","absolute"],CE=$e({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Be(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:ps,default:"bottom"},popperOptions:{type:Be(Object),default:()=>({})},strategy:{type:String,values:EE,default:"absolute"}}),eg=$e({...CE,id:String,style:{type:Be([String,Array,Object])},className:{type:Be([String,Array,Object])},effect:{type:Be(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Be([String,Array,Object])},popperStyle:{type:Be([String,Array,Object])},referenceEl:{type:Be(Object)},triggerTargetEl:{type:Be(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Zn(["ariaLabel"])}),LE={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},RE=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...PE(n),...e]};return IE(s,r==null?void 0:r.modifiers),s},FE=n=>{if(Rt)return ci(n)};function PE(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function IE(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const OE=0,NE=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Du,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var y;const v=a.unref(s),M=(y=a.unref(o))!=null?y:OE;return{name:"arrow",enabled:!wS(v),options:{element:v,padding:M}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...RE(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>FE(n.referenceEl)||a.unref(i)),{attributes:d,state:p,styles:g,update:m,forceUpdate:h,instanceRef:b}=uT(f,t,c);return a.watch(b,y=>e.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(f))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:d,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:g,role:r,forceUpdate:h,update:m}},BE=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Pm(),s=Ge("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(et(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),d=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:d,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=et(n.zIndex)?n.zIndex:r()}}},DE=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},kE=a.defineComponent({name:"ElPopperContent"}),VE=a.defineComponent({...kE,props:eg,emits:LE,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=DE(i,t),{attributes:d,arrowRef:p,contentRef:g,styles:m,instanceRef:h,role:b,update:y}=NE(i),{ariaModal:v,arrowStyle:M,contentAttrs:A,contentClass:_,contentStyle:w,updateZIndex:C}=BE(i,{styles:m,attributes:d,role:b}),P=a.inject(gl,void 0),R=a.ref();a.provide(zm,{arrowStyle:M,arrowRef:p,arrowOffset:R}),P&&a.provide(gl,{...P,addInputId:Lo,removeInputId:Lo});let I;const S=(E=!0)=>{y(),E&&C()},T=()=>{S(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(E,L)=>{I==null||I(),I=void 0;const F=a.unref(E||g.value),x=a.unref(L||g.value);_r(F)&&(I=a.watch([b,()=>i.ariaLabel,v,()=>i.id],O=>{["role","aria-label","aria-modal","id"].forEach((B,N)=>{Gn(O[N])?F.removeAttribute(B):F.setAttribute(B,O[N])})},{immediate:!0})),x!==F&&_r(x)&&["role","aria-label","aria-modal","id"].forEach(O=>{x.removeAttribute(O)})},{immediate:!0}),a.watch(()=>i.visible,T,{immediate:!0})}),a.onBeforeUnmount(()=>{I==null||I(),I=void 0}),e({popperContentRef:g,popperInstanceRef:h,updatePopper:S,contentStyle:w}),(E,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:g},a.unref(A),{style:a.unref(w),class:a.unref(_),tabindex:"-1",onMouseenter:F=>E.$emit("mouseenter",F),onMouseleave:F=>E.$emit("mouseleave",F)}),[a.createVNode(a.unref(TE),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(g),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(E.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var zE=He(VE,[["__file","content.vue"]]);const UE=bt(oE),Hu=Symbol("elTooltip"),dn=$e({...gT,...eg,appendTo:{type:Be([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Be(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Zn(["ariaLabel"])}),$o=$e({...jm,disabled:Boolean,trigger:{type:Be([String,Array]),default:"hover"},triggerKeys:{type:Be(Array),default:()=>[Hn.enter,Hn.space]}}),{useModelToggleProps:GE,useModelToggleEmits:HE,useModelToggle:WE}=a_("visible"),jE=$e({...Um,...GE,...dn,...$o,...Gm,showArrow:{type:Boolean,default:!0}}),$E=[...HE,"before-show","before-hide","show","hide","open","close"],ZE=(n,e)=>Nt(n)?n.includes(e):n===e,As=(n,e,t)=>i=>{ZE(a.unref(n),e)&&t(i)},XE=a.defineComponent({name:"ElTooltipTrigger"}),YE=a.defineComponent({...XE,props:$o,setup(n,{expose:e}){const t=n,i=Ge("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(Hu,void 0),f=a.ref(null),d=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),g=li(d,As(p,"hover",l)),m=li(d,As(p,"hover",u)),h=li(d,As(p,"click",A=>{A.button===0&&c(A)})),b=li(d,As(p,"focus",l)),y=li(d,As(p,"focus",u)),v=li(d,As(p,"contextmenu",A=>{A.preventDefault(),c(A)})),M=li(d,A=>{const{code:_}=A;t.triggerKeys.includes(_)&&(A.preventDefault(),c(A))});return e({triggerRef:f}),(A,_)=>(a.openBlock(),a.createBlock(a.unref(fE),{id:a.unref(s),"virtual-ref":A.virtualRef,open:a.unref(o),"virtual-triggering":A.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(y),onClick:a.unref(h),onContextmenu:a.unref(v),onFocus:a.unref(b),onMouseenter:a.unref(g),onMouseleave:a.unref(m),onKeydown:a.unref(M)},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var JE=He(YE,[["__file","trigger.vue"]]);const KE=$e({to:{type:Be([String,Object]),required:!0},disabled:Boolean});var qE=He(a.defineComponent({__name:"teleport",props:KE,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const QE=bt(qE),eC=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),tC=a.defineComponent({...eC,props:dn,setup(n,{expose:e}){const t=n,{selector:i}=_m(),r=Ge("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:d,onOpen:p,onShow:g,onHide:m,onBeforeShow:h,onBeforeHide:b}=a.inject(Hu,void 0),y=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),v=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const M=a.computed(()=>a.unref(v)?!0:a.unref(c)),A=a.computed(()=>t.disabled?!1:a.unref(c)),_=a.computed(()=>t.appendTo||i.value),w=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),C=a.ref(!0),P=()=>{m(),C.value=!0},R=()=>{if(a.unref(l))return!0},I=li(R,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),S=li(R,()=>{a.unref(f)==="hover"&&d()}),T=()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x),h==null||h()},E=()=>{b==null||b()},L=()=>{g(),o=mw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&d()})},F=()=>{t.virtualTriggering||d()};return a.watch(()=>a.unref(c),x=>{x?C.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x)}),e({contentRef:s}),(x,O)=>(a.openBlock(),a.createBlock(a.unref(QE),{disabled:!x.teleported,to:a.unref(_)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:P,onBeforeEnter:T,onAfterEnter:L,onBeforeLeave:E},{default:a.withCtx(()=>[a.unref(M)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(zE),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":C.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(w)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(A),"z-index":x.zIndex,onMouseenter:a.unref(I),onMouseleave:a.unref(S),onBlur:F,onClose:a.unref(d)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(A)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var nC=He(tC,[["__file","content.vue"]]);const iC=a.defineComponent({name:"ElTooltip"}),rC=a.defineComponent({...iC,props:jE,emits:$E,setup(n,{expose:e,emit:t}){const i=n;mT();const r=jo(),s=a.ref(),o=a.ref(),l=()=>{var y;const v=a.unref(s);v&&((y=v.popperInstanceRef)==null||y.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:d,hasUpdateHandler:p}=WE({indicator:u,toggleReason:c}),{onOpen:g,onClose:m}=vT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:d}),h=a.computed(()=>Ui(i.visible)&&!p.value);a.provide(Hu,{controlled:h,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:y=>{g(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(u)?m(y):g(y)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,y=>{y&&u.value&&(u.value=!1)});const b=y=>{var v,M;const A=(M=(v=o.value)==null?void 0:v.contentRef)==null?void 0:M.popperContentRef,_=(y==null?void 0:y.relatedTarget)||document.activeElement;return A&&A.contains(_)};return a.onDeactivated(()=>u.value&&d()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:g,onClose:m,hide:d}),(y,v)=>(a.openBlock(),a.createBlock(a.unref(UE),{ref_key:"popperRef",ref:s,role:y.role},{default:a.withCtx(()=>[a.createVNode(JE,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(nC,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(cE),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var sC=He(rC,[["__file","tooltip.vue"]]);const Wu=bt(sC),tg=Symbol("buttonGroupContextKey"),oC=(n,e)=>{Do({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(tg,void 0),i=Iu("button"),{form:r}=yi(),s=vi(a.computed(()=>t==null?void 0:t.size)),o=xs(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,h,b;return(b=(h=n.autoInsertSpace)!=null?h:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),d=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const h=(m=u.default)==null?void 0:m.call(u);if(f.value&&(h==null?void 0:h.length)===1){const b=h[0];if((b==null?void 0:b.type)===a.Text){const y=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:d,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},ju=$e({size:$n,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Wi},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Wi,default:()=>Xp},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Be([String,Object]),default:"button"}}),aC={click:n=>n instanceof MouseEvent};function Wt(n,e){lC(n)&&(n="100%");var t=cC(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function wl(n){return Math.min(1,Math.max(0,n))}function lC(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function cC(n){return typeof n=="string"&&n.indexOf("%")!==-1}function ng(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Ml(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Rr(n){return n.length===1?"0"+n:String(n)}function uC(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function ig(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function $u(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 dC(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=$u(l,o,n+1/3),r=$u(l,o,n),s=$u(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function rg(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:u,v:o}}function hC(n,e,t){n=Wt(n,360)*6,e=Wt(e,100),t=Wt(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],d=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:d*255}}function sg(n,e,t,i){var r=[Rr(Math.round(n).toString(16)),Rr(Math.round(e).toString(16)),Rr(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function fC(n,e,t,i,r){var s=[Rr(Math.round(n).toString(16)),Rr(Math.round(e).toString(16)),Rr(Math.round(t).toString(16)),Rr(pC(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function pC(n){return Math.round(parseFloat(n)*255).toString(16)}function og(n){return hn(n)/255}function hn(n){return parseInt(n,16)}function mC(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var Zu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function gC(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=bC(n)),typeof n=="object"&&(bi(n.r)&&bi(n.g)&&bi(n.b)?(e=uC(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):bi(n.h)&&bi(n.s)&&bi(n.v)?(i=Ml(n.s),r=Ml(n.v),e=hC(n.h,i,r),o=!0,l="hsv"):bi(n.h)&&bi(n.s)&&bi(n.l)&&(i=Ml(n.s),s=Ml(n.l),e=dC(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=ng(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var vC="[-\\+]?\\d+%?",yC="[-\\+]?\\d*\\.\\d+%?",Zi="(?:".concat(yC,")|(?:").concat(vC,")"),Xu="[\\s|\\(]+(".concat(Zi,")[,|\\s]+(").concat(Zi,")[,|\\s]+(").concat(Zi,")\\s*\\)?"),Yu="[\\s|\\(]+(".concat(Zi,")[,|\\s]+(").concat(Zi,")[,|\\s]+(").concat(Zi,")[,|\\s]+(").concat(Zi,")\\s*\\)?"),Ln={CSS_UNIT:new RegExp(Zi),rgb:new RegExp("rgb"+Xu),rgba:new RegExp("rgba"+Yu),hsl:new RegExp("hsl"+Xu),hsla:new RegExp("hsla"+Yu),hsv:new RegExp("hsv"+Xu),hsva:new RegExp("hsva"+Yu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function bC(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(Zu[n])n=Zu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ln.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ln.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ln.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Ln.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ln.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Ln.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ln.hex8.exec(n),t?{r:hn(t[1]),g:hn(t[2]),b:hn(t[3]),a:og(t[4]),format:e?"name":"hex8"}:(t=Ln.hex6.exec(n),t?{r:hn(t[1]),g:hn(t[2]),b:hn(t[3]),format:e?"name":"hex"}:(t=Ln.hex4.exec(n),t?{r:hn(t[1]+t[1]),g:hn(t[2]+t[2]),b:hn(t[3]+t[3]),a:og(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ln.hex3.exec(n),t?{r:hn(t[1]+t[1]),g:hn(t[2]+t[2]),b:hn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function bi(n){return!!Ln.CSS_UNIT.exec(String(n))}var xC=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=mC(e)),this.originalInput=e;var r=gC(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=ng(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=rg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=rg(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=ig(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=ig(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),sg(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),fC(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Wt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Wt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+sg(this.r,this.g,this.b,!1),t=0,i=Object.entries(Zu);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=wl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=wl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=wl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=wl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function Xi(n,e=20){return n.mix("#141414",e).toString()}function wC(n){const e=xs(),t=Ge("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new xC(r),l=n.dark?o.tint(20).toString():Xi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Xi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Xi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Xi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Xi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Xi(o,80):o.tint(80).toString());else{const u=n.dark?Xi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Xi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const MC=a.defineComponent({name:"ElButton"}),AC=a.defineComponent({...MC,props:ju,emits:aC,setup(n,{expose:e,emit:t}){const i=n,r=wC(i),s=Ge("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:d,handleClick:p}=oC(i,t),g=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:d}),(m,h)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(g),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(mt),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(d)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var SC=He(AC,[["__file","button.vue"]]);const _C={size:ju.size,type:ju.type},TC=a.defineComponent({name:"ElButtonGroup"}),EC=a.defineComponent({...TC,props:_C,setup(n){const e=n;a.provide(tg,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ge("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var ag=He(EC,[["__file","button-group.vue"]]);const Zo=bt(SC,{ButtonGroup:ag});un(ag);var Yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function CC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Al(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const Ji=new Map;if(Rt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of Ji.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function lg(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:_r(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),d=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),g=s&&(s.contains(o)||s.contains(l));u||c||f||d||p||g||e.value(i,r)}}const LC={beforeMount(n,e){Ji.has(n)||Ji.set(n,[]),Ji.get(n).push({documentHandler:lg(n,e),bindingFn:e.value})},updated(n,e){Ji.has(n)||Ji.set(n,[]);const t=Ji.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:lg(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){Ji.delete(n)}},RC=100,FC=600,cg={beforeMount(n,e){const t=e.value,{interval:i=RC,delay:r=FC}=Jt(t)?{}:t;let s,o;const l=()=>Jt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},ug={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:$n,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Zn(["ariaControls"])},dg={[tt]:n=>Bt(n)||et(n)||Ui(n),change:n=>Bt(n)||et(n)||Ui(n)},Ss=Symbol("checkboxGroupContextKey"),PC=({model:n,isChecked:e})=>{const t=a.inject(Ss,void 0),i=a.computed(()=>{var s,o;const l=(s=t==null?void 0:t.max)==null?void 0:s.value,u=(o=t==null?void 0:t.min)==null?void 0:o.value;return!sn(l)&&n.value.length>=l&&!e.value||!sn(u)&&n.value.length<=u&&e.value});return{isDisabled:xs(a.computed(()=>(t==null?void 0:t.disabled.value)||i.value)),isLimitDisabled:i}},IC=(n,{model:e,isLimitExceeded:t,hasOwnLabel:i,isDisabled:r,isLabeledByFormItem:s})=>{const o=a.inject(Ss,void 0),{formItem:l}=yi(),{emit:u}=a.getCurrentInstance();function c(m){var h,b,y,v;return[!0,n.trueValue,n.trueLabel].includes(m)?(b=(h=n.trueValue)!=null?h:n.trueLabel)!=null?b:!0:(v=(y=n.falseValue)!=null?y:n.falseLabel)!=null?v:!1}function f(m,h){u("change",c(m),h)}function d(m){if(t.value)return;const h=m.target;u("change",c(h.checked),m)}async function p(m){t.value||!i.value&&!r.value&&s.value&&(m.composedPath().some(y=>y.tagName==="LABEL")||(e.value=c([!1,n.falseValue,n.falseLabel].includes(e.value)),await a.nextTick(),f(e.value,m)))}const g=a.computed(()=>(o==null?void 0:o.validateEvent)||n.validateEvent);return a.watch(()=>n.modelValue,()=>{g.value&&(l==null||l.validate("change").catch(m=>dt(m)))}),{handleChange:d,onClickRoot:p}},OC=n=>{const e=a.ref(!1),{emit:t}=a.getCurrentInstance(),i=a.inject(Ss,void 0),r=a.computed(()=>sn(i)===!1),s=a.ref(!1),o=a.computed({get(){var l,u;return r.value?(l=i==null?void 0:i.modelValue)==null?void 0:l.value:(u=n.modelValue)!=null?u:e.value},set(l){var u,c;r.value&&Nt(l)?(s.value=((u=i==null?void 0:i.max)==null?void 0:u.value)!==void 0&&l.length>(i==null?void 0:i.max.value)&&l.length>o.value.length,s.value===!1&&((c=i==null?void 0:i.changeEvent)==null||c.call(i,l))):(t(tt,l),e.value=l)}});return{model:o,isGroup:r,isLimitExceeded:s}},NC=(n,e,{model:t})=>{const i=a.inject(Ss,void 0),r=a.ref(!1),s=a.computed(()=>No(n.value)?n.label:n.value),o=a.computed(()=>{const f=t.value;return Ui(f)?f:Nt(f)?Kt(s.value)?f.map(a.toRaw).some(d=>il(d,s.value)):f.map(a.toRaw).includes(s.value):f!=null?f===n.trueValue||f===n.trueLabel:!!f}),l=vi(a.computed(()=>{var f;return(f=i==null?void 0:i.size)==null?void 0:f.value}),{prop:!0}),u=vi(a.computed(()=>{var f;return(f=i==null?void 0:i.size)==null?void 0:f.value})),c=a.computed(()=>!!e.default||!No(s.value));return{checkboxButtonSize:l,isChecked:o,isFocused:r,checkboxSize:u,hasOwnLabel:c,actualValue:s}},hg=(n,e)=>{const{formItem:t}=yi(),{model:i,isGroup:r,isLimitExceeded:s}=OC(n),{isFocused:o,isChecked:l,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:f,actualValue:d}=NC(n,e,{model:i}),{isDisabled:p}=PC({model:i,isChecked:l}),{inputId:g,isLabeledByFormItem:m}=ws(n,{formItemContext:t,disableIdGeneration:f,disableIdManagement:r}),{handleChange:h,onClickRoot:b}=IC(n,{model:i,isLimitExceeded:s,hasOwnLabel:f,isDisabled:p,isLabeledByFormItem:m});return(()=>{function v(){var M,A;Nt(i.value)&&!i.value.includes(d.value)?i.value.push(d.value):i.value=(A=(M=n.trueValue)!=null?M:n.trueLabel)!=null?A:!0}n.checked&&v()})(),Do({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},a.computed(()=>r.value&&No(n.value))),Do({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},a.computed(()=>!!n.trueLabel)),Do({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},a.computed(()=>!!n.falseLabel)),{inputId:g,isLabeledByFormItem:m,isChecked:l,isDisabled:p,isFocused:o,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:f,model:i,actualValue:d,handleChange:h,onClickRoot:b}},BC=a.defineComponent({name:"ElCheckbox"}),DC=a.defineComponent({...BC,props:ug,emits:dg,setup(n){const e=n,t=a.useSlots(),{inputId:i,isLabeledByFormItem:r,isChecked:s,isDisabled:o,isFocused:l,checkboxSize:u,hasOwnLabel:c,model:f,actualValue:d,handleChange:p,onClickRoot:g}=hg(e,t),m=Ge("checkbox"),h=a.computed(()=>[m.b(),m.m(u.value),m.is("disabled",o.value),m.is("bordered",e.border),m.is("checked",s.value)]),b=a.computed(()=>[m.e("input"),m.is("disabled",o.value),m.is("checked",s.value),m.is("indeterminate",e.indeterminate),m.is("focus",l.value)]);return(y,v)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(!a.unref(c)&&a.unref(r)?"span":"label"),{class:a.normalizeClass(a.unref(h)),"aria-controls":y.indeterminate?y.ariaControls:null,onClick:a.unref(g)},{default:a.withCtx(()=>{var M,A,_,w;return[a.createElementVNode("span",{class:a.normalizeClass(a.unref(b))},[y.trueValue||y.falseValue||y.trueLabel||y.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,id:a.unref(i),"onUpdate:modelValue":C=>a.isRef(f)?f.value=C:null,class:a.normalizeClass(a.unref(m).e("original")),type:"checkbox",indeterminate:y.indeterminate,name:y.name,tabindex:y.tabindex,disabled:a.unref(o),"true-value":(A=(M=y.trueValue)!=null?M:y.trueLabel)!=null?A:!0,"false-value":(w=(_=y.falseValue)!=null?_:y.falseLabel)!=null?w:!1,onChange:a.unref(p),onFocus:C=>l.value=!0,onBlur:C=>l.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(f)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,id:a.unref(i),"onUpdate:modelValue":C=>a.isRef(f)?f.value=C:null,class:a.normalizeClass(a.unref(m).e("original")),type:"checkbox",indeterminate:y.indeterminate,disabled:a.unref(o),value:a.unref(d),name:y.name,tabindex:y.tabindex,onChange:a.unref(p),onFocus:C=>l.value=!0,onBlur:C=>l.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(f)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(m).e("inner"))},null,2)],2),a.unref(c)?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(m).e("label"))},[a.renderSlot(y.$slots,"default"),y.$slots.default?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(y.label),1)],64))],2)):a.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var kC=He(DC,[["__file","checkbox.vue"]]);const VC=a.defineComponent({name:"ElCheckboxButton"}),zC=a.defineComponent({...VC,props:ug,emits:dg,setup(n){const e=n,t=a.useSlots(),{isFocused:i,isChecked:r,isDisabled:s,checkboxButtonSize:o,model:l,actualValue:u,handleChange:c}=hg(e,t),f=a.inject(Ss,void 0),d=Ge("checkbox"),p=a.computed(()=>{var m,h,b,y;const v=(h=(m=f==null?void 0:f.fill)==null?void 0:m.value)!=null?h:"";return{backgroundColor:v,borderColor:v,color:(y=(b=f==null?void 0:f.textColor)==null?void 0:b.value)!=null?y:"",boxShadow:v?`-1px 0 0 0 ${v}`:void 0}}),g=a.computed(()=>[d.b("button"),d.bm("button",o.value),d.is("disabled",s.value),d.is("checked",r.value),d.is("focus",i.value)]);return(m,h)=>{var b,y,v,M;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(a.unref(g))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":A=>a.isRef(l)?l.value=A:null,class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:m.name,tabindex:m.tabindex,disabled:a.unref(s),"true-value":(y=(b=m.trueValue)!=null?b:m.trueLabel)!=null?y:!0,"false-value":(M=(v=m.falseValue)!=null?v:m.falseLabel)!=null?M:!1,onChange:a.unref(c),onFocus:A=>i.value=!0,onBlur:A=>i.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(l)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,"onUpdate:modelValue":A=>a.isRef(l)?l.value=A:null,class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:m.name,tabindex:m.tabindex,disabled:a.unref(s),value:a.unref(u),onChange:a.unref(c),onFocus:A=>i.value=!0,onBlur:A=>i.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[a.vModelCheckbox,a.unref(l)]]),m.$slots.default||m.label?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass(a.unref(d).be("button","inner")),style:a.normalizeStyle(a.unref(r)?a.unref(p):void 0)},[a.renderSlot(m.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(m.label),1)])],6)):a.createCommentVNode("v-if",!0)],2)}}});var fg=He(zC,[["__file","checkbox-button.vue"]]);const UC=$e({modelValue:{type:Be(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:$n,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),GC={[tt]:n=>Nt(n),change:n=>Nt(n)},HC=a.defineComponent({name:"ElCheckboxGroup"}),WC=a.defineComponent({...HC,props:UC,emits:GC,setup(n,{emit:e}){const t=n,i=Ge("checkbox"),{formItem:r}=yi(),{inputId:s,isLabeledByFormItem:o}=ws(t,{formItemContext:r}),l=async c=>{e(tt,c),await a.nextTick(),e("change",c)},u=a.computed({get(){return t.modelValue},set(c){l(c)}});return a.provide(Ss,{...Gp(a.toRefs(t),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(r==null||r.validate("change").catch(c=>dt(c)))}),(c,f)=>{var d;return a.openBlock(),a.createBlock(a.resolveDynamicComponent(c.tag),{id:a.unref(s),class:a.normalizeClass(a.unref(i).b("group")),role:"group","aria-label":a.unref(o)?void 0:c.ariaLabel||"checkbox-group","aria-labelledby":a.unref(o)?(d=a.unref(r))==null?void 0:d.labelId:void 0},{default:a.withCtx(()=>[a.renderSlot(c.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var pg=He(WC,[["__file","checkbox-group.vue"]]);const mg=bt(kC,{CheckboxButton:fg,CheckboxGroup:pg});un(fg),un(pg);const gg=$e({modelValue:{type:[String,Number,Boolean],default:void 0},size:$n,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),jC=$e({...gg,border:Boolean}),vg={[tt]:n=>Bt(n)||et(n)||Ui(n),[pi]:n=>Bt(n)||et(n)||Ui(n)},yg=Symbol("radioGroupKey"),bg=(n,e)=>{const t=a.ref(),i=a.inject(yg,void 0),r=a.computed(()=>!!i),s=a.computed(()=>No(n.value)?n.label:n.value),o=a.computed({get(){return r.value?i.modelValue:n.modelValue},set(d){r.value?i.changeEvent(d):e&&e(tt,d),t.value.checked=n.modelValue===s.value}}),l=vi(a.computed(()=>i==null?void 0:i.size)),u=xs(a.computed(()=>i==null?void 0:i.disabled)),c=a.ref(!1),f=a.computed(()=>u.value||r.value&&o.value!==s.value?-1:0);return Do({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},a.computed(()=>r.value&&No(n.value))),{radioRef:t,isGroup:r,radioGroup:i,focus:c,size:l,disabled:u,tabIndex:f,modelValue:o,actualValue:s}},$C=a.defineComponent({name:"ElRadio"}),ZC=a.defineComponent({...$C,props:jC,emits:vg,setup(n,{emit:e}){const t=n,i=Ge("radio"),{radioRef:r,radioGroup:s,focus:o,size:l,disabled:u,modelValue:c,actualValue:f}=bg(t,e);function d(){a.nextTick(()=>e("change",c.value))}return(p,g)=>{var m;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("focus",a.unref(o)),a.unref(i).is("bordered",p.border),a.unref(i).is("checked",a.unref(c)===a.unref(f)),a.unref(i).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(i).e("input"),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("checked",a.unref(c)===a.unref(f))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:r,"onUpdate:modelValue":h=>a.isRef(c)?c.value=h:null,class:a.normalizeClass(a.unref(i).e("original")),value:a.unref(f),name:p.name||((m=a.unref(s))==null?void 0:m.name),disabled:a.unref(u),checked:a.unref(c)===a.unref(f),type:"radio",onFocus:h=>o.value=!0,onBlur:h=>o.value=!1,onChange:d,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(c)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("label")),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var XC=He(ZC,[["__file","radio.vue"]]);const YC=$e({...gg}),JC=a.defineComponent({name:"ElRadioButton"}),KC=a.defineComponent({...JC,props:YC,setup(n){const e=n,t=Ge("radio"),{radioRef:i,focus:r,size:s,disabled:o,modelValue:l,radioGroup:u,actualValue:c}=bg(e),f=a.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(d,p)=>{var g;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(t).b("button"),a.unref(t).is("active",a.unref(l)===a.unref(c)),a.unref(t).is("disabled",a.unref(o)),a.unref(t).is("focus",a.unref(r)),a.unref(t).bm("button",a.unref(s))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":m=>a.isRef(l)?l.value=m:null,class:a.normalizeClass(a.unref(t).be("button","original-radio")),value:a.unref(c),type:"radio",name:d.name||((g=a.unref(u))==null?void 0:g.name),disabled:a.unref(o),onFocus:m=>r.value=!0,onBlur:m=>r.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(t).be("button","inner")),style:a.normalizeStyle(a.unref(l)===a.unref(c)?a.unref(f):{}),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(d.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(d.label),1)])],46,["onKeydown"])],2)}}});var xg=He(KC,[["__file","radio-button.vue"]]);const qC=$e({id:{type:String,default:void 0},size:$n,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),QC=vg,e2=a.defineComponent({name:"ElRadioGroup"}),t2=a.defineComponent({...e2,props:qC,emits:QC,setup(n,{emit:e}){const t=n,i=Ge("radio"),r=jo(),s=a.ref(),{formItem:o}=yi(),{inputId:l,isLabeledByFormItem:u}=ws(t,{formItemContext:o}),c=d=>{e(tt,d),a.nextTick(()=>e("change",d))};a.onMounted(()=>{const d=s.value.querySelectorAll("[type=radio]"),p=d[0];!Array.from(d).some(g=>g.checked)&&p&&(p.tabIndex=0)});const f=a.computed(()=>t.name||r.value);return a.provide(yg,a.reactive({...a.toRefs(t),changeEvent:c,name:f})),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(o==null||o.validate("change").catch(d=>dt(d)))}),(d,p)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:s,class:a.normalizeClass(a.unref(i).b("group")),role:"radiogroup","aria-label":a.unref(u)?void 0:d.ariaLabel||"radio-group","aria-labelledby":a.unref(u)?a.unref(o).labelId:void 0},[a.renderSlot(d.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var wg=He(t2,[["__file","radio-group.vue"]]);const Mg=bt(XC,{RadioButton:xg,RadioGroup:wg}),Ag=un(wg);un(xg);const Ju=$e({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:qp},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),n2={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},i2=a.defineComponent({name:"ElTag"}),r2=a.defineComponent({...i2,props:Ju,emits:n2,setup(n,{emit:e}){const t=n,i=vi(),r=Ge("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:d,closable:p,round:g}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(d),r.is("hit",f),r.is("round",g)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(xu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(xu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var s2=He(r2,[["__file","tag.vue"]]);const o2=bt(s2),Sg=Symbol("rowContextKey"),a2=$e({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),l2=a.defineComponent({name:"ElRow"}),c2=a.defineComponent({...l2,props:a2,setup(n){const e=n,t=Ge("row"),i=a.computed(()=>e.gutter);a.provide(Sg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var u2=He(c2,[["__file","row.vue"]]);const xi=bt(u2),d2=$e({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Be([Number,Object]),default:()=>mi({})},sm:{type:Be([Number,Object]),default:()=>mi({})},md:{type:Be([Number,Object]),default:()=>mi({})},lg:{type:Be([Number,Object]),default:()=>mi({})},xl:{type:Be([Number,Object]),default:()=>mi({})}}),h2=a.defineComponent({name:"ElCol"}),f2=a.defineComponent({...h2,props:d2,setup(n){const e=n,{gutter:t}=a.inject(Sg,{gutter:a.computed(()=>0)}),i=Ge("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];et(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{et(e[c])?o.push(i.b(`${c}-${e[c]}`)):Kt(e[c])&&Object.entries(e[c]).forEach(([f,d])=>{o.push(f!=="span"?i.b(`${c}-${f}-${d}`):i.b(`${c}-${d}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var p2=He(f2,[["__file","col.vue"]]);const Xn=bt(p2),_g=n=>et(n)||Bt(n)||Nt(n),m2=$e({accordion:Boolean,modelValue:{type:Be([Array,String,Number]),default:()=>mi([])}}),g2={[tt]:_g,[pi]:_g},Tg=Symbol("collapseContextKey"),v2=(n,e)=>{const t=a.ref(Un(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(tt,o),e(pi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Un(n.modelValue),{deep:!0}),a.provide(Tg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},y2=()=>{const n=Ge("collapse");return{rootKls:a.computed(()=>n.b())}},b2=a.defineComponent({name:"ElCollapse"}),x2=a.defineComponent({...b2,props:m2,emits:g2,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=v2(i,t),{rootKls:o}=y2();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var w2=He(x2,[["__file","collapse.vue"]]);const M2=a.defineComponent({name:"ElCollapseTransition"}),A2=a.defineComponent({...M2,setup(n){const e=Ge("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var S2=He(A2,[["__file","collapse-transition.vue"]]);const _2=bt(S2),T2=$e({title:{type:String,default:""},name:{type:Be([String,Number]),default:void 0},icon:{type:Wi,default:Tr},disabled:Boolean}),E2=n=>{const e=a.inject(Tg),{namespace:t}=Ge("collapse"),i=a.ref(!1),r=a.ref(!1),s=Pu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},C2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ge("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),d=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:d}},L2=a.defineComponent({name:"ElCollapseItem"}),R2=a.defineComponent({...L2,props:T2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=E2(t),{arrowKls:c,headKls:f,rootKls:d,itemWrapperKls:p,itemContentKls:g,scopedContentId:m,scopedHeadId:h}=C2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,y)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(d))},[a.createElementVNode("button",{id:a.unref(h),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:v=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(mt),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(_2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(h)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(g))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var Eg=He(R2,[["__file","collapse-item.vue"]]);const Cg=bt(w2,{CollapseItem:Eg}),Lg=un(Eg),F2=a.defineComponent({name:"ElContainer"}),P2=a.defineComponent({...F2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ge("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var I2=He(P2,[["__file","container.vue"]]);const O2=a.defineComponent({name:"ElAside"}),N2=a.defineComponent({...O2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ge("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Rg=He(N2,[["__file","aside.vue"]]);const B2=a.defineComponent({name:"ElFooter"}),D2=a.defineComponent({...B2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Fg=He(D2,[["__file","footer.vue"]]);const k2=a.defineComponent({name:"ElHeader"}),V2=a.defineComponent({...k2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Pg=He(V2,[["__file","header.vue"]]);const z2=a.defineComponent({name:"ElMain"}),U2=a.defineComponent({...z2,setup(n){const e=Ge("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Ig=He(U2,[["__file","main.vue"]]);const Yn=bt(I2,{Aside:Rg,Footer:Fg,Header:Pg,Main:Ig});un(Rg);const Og=un(Fg),G2=un(Pg),wi=un(Ig),H2=$e({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},contentPosition:{type:String,values:["left","center","right"],default:"center"},borderStyle:{type:Be(String),default:"solid"}}),W2=a.defineComponent({name:"ElDivider"}),j2=a.defineComponent({...W2,props:H2,setup(n){const e=n,t=Ge("divider"),i=a.computed(()=>t.cssVar({"border-style":e.borderStyle}));return(r,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(t).b(),a.unref(t).m(r.direction)]),style:a.normalizeStyle(a.unref(i)),role:"separator"},[r.$slots.default&&r.direction!=="vertical"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([a.unref(t).e("text"),a.unref(t).is(r.contentPosition)])},[a.renderSlot(r.$slots,"default")],2)):a.createCommentVNode("v-if",!0)],6))}});var $2=He(j2,[["__file","divider.vue"]]);const Ng=bt($2),Z2=a.defineComponent({inheritAttrs:!1});function X2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var Y2=He(Z2,[["render",X2],["__file","collection.vue"]]);const J2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function K2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var q2=He(J2,[["render",K2],["__file","collection-item.vue"]]);const Q2="data-el-collection-item",eL=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...Y2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const d=Array.from(f.querySelectorAll(`[${Q2}]`));return[...u.values()].sort((g,m)=>d.indexOf(g.ref)-d.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...q2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const d=a.unref(c);d&&f.itemMap.set(d,{ref:d,...u})}),a.onBeforeUnmount(()=>{const d=a.unref(c);f.itemMap.delete(d)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Ku=$e({trigger:$o.trigger,effect:{...dn.effect,default:"light"},type:{type:Be(String)},placement:{type:Be(String),default:"bottom"},popperOptions:{type:Be(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Be([Number,String]),default:0},maxHeight:{type:Be([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Be(Object)},teleported:dn.teleported});$e({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Wi}}),$e({onKeydown:{type:Be(Function)}}),eL("Dropdown");const tL=$e({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:$n,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||et(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),nL={[pi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Er]:n=>et(n)||Gn(n),[tt]:n=>et(n)||Gn(n)},iL=a.defineComponent({name:"ElInputNumber"}),rL=a.defineComponent({...iL,props:tL,emits:nL,setup(n,{expose:e,emit:t}){const i=n,{t:r}=cl(),s=Ge("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=yi(),c=a.computed(()=>et(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>et(i.modelValue)&&i.modelValue>=i.max),d=a.computed(()=>{const F=y(i.step);return sn(i.precision)?Math.max(y(i.modelValue),F):(F>i.precision&&dt("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),g=vi(),m=xs(),h=a.computed(()=>{if(l.userInput!==null)return l.userInput;let F=l.currentValue;if(Gn(F))return"";if(et(F)){if(Number.isNaN(F))return"";sn(i.precision)||(F=F.toFixed(i.precision))}return F}),b=(F,x)=>{if(sn(x)&&(x=d.value),x===0)return Math.round(F);let O=String(F);const B=O.indexOf(".");if(B===-1||!O.replace(".","").split("")[B+x])return F;const z=O.length;return O.charAt(z-1)==="5"&&(O=`${O.slice(0,Math.max(0,z-1))}6`),Number.parseFloat(Number(O).toFixed(x))},y=F=>{if(Gn(F))return 0;const x=F.toString(),O=x.indexOf(".");let B=0;return O!==-1&&(B=x.length-O-1),B},v=(F,x=1)=>et(F)?b(F+i.step*x):l.currentValue,M=()=>{if(i.readonly||m.value||f.value)return;const F=Number(h.value)||0,x=v(F);w(x),t(Er,l.currentValue),E()},A=()=>{if(i.readonly||m.value||c.value)return;const F=Number(h.value)||0,x=v(F,-1);w(x),t(Er,l.currentValue),E()},_=(F,x)=>{const{max:O,min:B,step:N,precision:k,stepStrictly:z,valueOnClear:G}=i;O<B&&hs("InputNumber","min should not be greater than max.");let Y=Number(F);if(Gn(F)||Number.isNaN(Y))return null;if(F===""){if(G===null)return null;Y=Bt(G)?{min:B,max:O}[G]:G}return z&&(Y=b(Math.round(Y/N)*N,k),Y!==F&&x&&t(tt,Y)),sn(k)||(Y=b(Y,k)),(Y>O||Y<B)&&(Y=Y>O?O:B,x&&t(tt,Y)),Y},w=(F,x=!0)=>{var O;const B=l.currentValue,N=_(F);if(!x){t(tt,N);return}B===N&&F||(l.userInput=null,t(tt,N),B!==N&&t(pi,N,B),i.validateEvent&&((O=u==null?void 0:u.validate)==null||O.call(u,"change").catch(k=>dt(k))),l.currentValue=N)},C=F=>{l.userInput=F;const x=F===""?null:Number(F);t(Er,x),w(x,!1)},P=F=>{const x=F!==""?Number(F):"";(et(x)&&!Number.isNaN(x)||F==="")&&w(x),E(),l.userInput=null},R=()=>{var F,x;(x=(F=o.value)==null?void 0:F.focus)==null||x.call(F)},I=()=>{var F,x;(x=(F=o.value)==null?void 0:F.blur)==null||x.call(F)},S=F=>{t("focus",F)},T=F=>{var x;l.userInput=null,t("blur",F),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(O=>dt(O)))},E=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=F=>{document.activeElement===F.target&&F.preventDefault()};return a.watch(()=>i.modelValue,(F,x)=>{const O=_(F,!0);l.userInput===null&&O!==x&&(l.currentValue=O)},{immediate:!0}),a.onMounted(()=>{var F;const{min:x,max:O,modelValue:B}=i,N=(F=o.value)==null?void 0:F.input;if(N.setAttribute("role","spinbutton"),Number.isFinite(O)?N.setAttribute("aria-valuemax",String(O)):N.removeAttribute("aria-valuemax"),Number.isFinite(x)?N.setAttribute("aria-valuemin",String(x)):N.removeAttribute("aria-valuemin"),N.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),N.setAttribute("aria-disabled",String(m.value)),!et(B)&&B!=null){let k=Number(B);Number.isNaN(k)&&(k=null),t(tt,k)}N.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var F,x;const O=(F=o.value)==null?void 0:F.input;O==null||O.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:R,blur:I}),(F,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(g)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!F.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[F.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(A,["enter"])},[a.renderSlot(F.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(yu),{key:0})):(a.openBlock(),a.createBlock(a.unref(HS),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(cg),A]]):a.createCommentVNode("v-if",!0),F.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(M,["enter"])},[a.renderSlot(F.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(IS),{key:0})):(a.openBlock(),a.createBlock(a.unref(ol),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(cg),M]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(jT),{id:F.id,ref_key:"input",ref:o,type:"number",step:F.step,"model-value":a.unref(h),placeholder:F.placeholder,readonly:F.readonly,disabled:a.unref(m),size:a.unref(g),max:F.max,min:F.min,name:F.name,"aria-label":F.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(M,["prevent"]),["up"]),a.withKeys(a.withModifiers(A,["prevent"]),["down"])],onBlur:T,onFocus:S,onInput:C,onChange:P},a.createSlots({_:2},[F.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(F.$slots,"prefix")])}:void 0,F.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(F.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var sL=He(rL,[["__file","input-number.vue"]]);const Mi=bt(sL),Bg=Symbol("ElSelectGroup"),Sl=Symbol("ElSelect");function oL(n,e){const t=a.inject(Sl),i=a.inject(Bg,{disabled:!1}),r=a.computed(()=>f(Un(t.props.modelValue),n.value)),s=a.computed(()=>{var g;if(t.props.multiple){const m=Un((g=t.props.modelValue)!=null?g:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(Kt(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(g=[],m)=>{if(Kt(n.value)){const h=t.props.valueKey;return g&&g.some(b=>a.toRaw(hi(b,h))===hi(m,h))}else return g&&g.includes(m)},d=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=g=>{const m=new RegExp(TS(g),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(g,m)=>{const{remote:h,valueKey:b}=t.props;if(g!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!h){if(b&&Kt(g)&&Kt(m)&&g[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:d,updateOption:p}}const aL=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ge("select"),t=jo(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=oL(n,r),{visible:d,hover:p}=a.toRefs(r),g=a.getCurrentInstance().proxy;u.onOptionCreate(g),a.onBeforeUnmount(()=>{const h=g.value,{selected:b}=u.states,v=(u.props.multiple?b:[b]).some(M=>M.value===g.value);a.nextTick(()=>{u.states.cachedOptions.get(h)===g&&!v&&u.states.cachedOptions.delete(h)}),u.onOptionDestroy(h,g)});function m(){l.value||u.handleOptionSelect(g)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:d,hover:p,selectOptionClick:m,states:r}}});function lL(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var qu=He(aL,[["render",lL],["__file","option.vue"]]);const cL=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(Sl),e=Ge("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),xn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function uL(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var dL=He(cL,[["render",uL],["__file","select-dropdown.vue"]]);const hL=11,fL=(n,e)=>{const{t}=cl(),i=jo(),r=Ge("select"),s=Ge("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),d=a.ref(null),p=a.ref(null),g=a.ref(null),m=a.ref(null),h=a.ref(null),b=a.ref(null),y=a.ref(null),v=a.ref(null),{isComposing:M,handleCompositionStart:A,handleCompositionUpdate:_,handleCompositionEnd:w}=Nm({afterComposition:he=>ne(he)}),{wrapperRef:C,isFocused:P}=Om(d,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!R.value&&(R.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(he){var xe,_e;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(he))||((_e=f.value)==null?void 0:_e.isFocusInsideContent(he))},afterBlur(){R.value=!1,o.menuVisibleOnFocus=!1}}),R=a.ref(!1),I=a.ref(),{form:S,formItem:T}=yi(),{inputId:E}=ws(n,{formItemContext:T}),{valueOnClear:L,isEmptyValue:F}=CT(n),x=a.computed(()=>n.disabled||(S==null?void 0:S.disabled)),O=a.computed(()=>Nt(n.modelValue)?n.modelValue.length>0:!F(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&O.value),N=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),k=a.computed(()=>r.is("reverse",N.value&&R.value)),z=a.computed(()=>(T==null?void 0:T.validateState)||""),G=a.computed(()=>Kp[z.value]),Y=a.computed(()=>n.remote?300:0),Z=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&te.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),te=a.computed(()=>q.value.filter(he=>he.visible).length),q=a.computed(()=>{const he=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(_e=>{const Fe=he.findIndex(Ne=>Ne.value===_e);Fe>-1&&xe.push(he[Fe])}),xe.length>=he.length?xe:he}),W=a.computed(()=>Array.from(o.cachedOptions.values())),$=a.computed(()=>{const he=q.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!he}),X=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||q.value.forEach(he=>{var xe;(xe=he.updateOption)==null||xe.call(he,o.inputValue)})},K=vi(),re=a.computed(()=>["small"].includes(K.value)?"small":"default"),V=a.computed({get(){return R.value&&Z.value!==!1},set(he){R.value=he}}),j=a.computed(()=>{if(n.multiple&&!sn(n.modelValue))return Un(n.modelValue).length===0&&!o.inputValue;const he=Nt(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||sn(he)?!o.inputValue:!0}),oe=a.computed(()=>{var he;const xe=(he=n.placeholder)!=null?he:t("el.select.placeholder");return n.multiple||!O.value?xe:o.selectedLabel}),ae=a.computed(()=>qc?null:"mouseenter");a.watch(()=>n.modelValue,(he,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",le("")),U(),!il(he,xe)&&n.validateEvent&&(T==null||T.validate("change").catch(_e=>dt(_e)))},{flush:"post",deep:!0}),a.watch(()=>R.value,he=>{he?le(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",he)}),a.watch(()=>o.options.entries(),()=>{var he;if(!Rt)return;const xe=((he=l.value)==null?void 0:he.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!sn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&U(),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value&&H()},{flush:"post"}),a.watch(()=>o.hoveringIndex,he=>{et(he)&&he>-1?I.value=q.value[he]||{}:I.value={},q.value.forEach(xe=>{xe.hover=I.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||X()});const le=he=>{o.previousQuery===he||M.value||(o.previousQuery=he,n.filterable&&Jt(n.filterMethod)?n.filterMethod(he):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(he),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value?a.nextTick(H):a.nextTick(Q))},H=()=>{const he=q.value.filter(Fe=>Fe.visible&&!Fe.disabled&&!Fe.states.groupDisabled),xe=he.find(Fe=>Fe.created),_e=he[0];o.hoveringIndex=st(q.value,xe||_e)},U=()=>{if(n.multiple)o.selectedLabel="";else{const xe=Nt(n.modelValue)?n.modelValue[0]:n.modelValue,_e=D(xe);o.selectedLabel=_e.currentLabel,o.selected=[_e];return}const he=[];sn(n.modelValue)||Un(n.modelValue).forEach(xe=>{he.push(D(xe))}),o.selected=he},D=he=>{let xe;const _e=Qc(he).toLowerCase()==="object",Fe=Qc(he).toLowerCase()==="null",Ne=Qc(he).toLowerCase()==="undefined";for(let qe=o.cachedOptions.size-1;qe>=0;qe--){const Lt=W.value[qe];if(_e?hi(Lt.value,n.valueKey)===hi(he,n.valueKey):Lt.value===he){xe={value:he,currentLabel:Lt.currentLabel,get isDisabled(){return Lt.isDisabled}};break}}if(xe)return xe;const je=_e?he.label:!Fe&&!Ne?he:"";return{value:he,currentLabel:je}},Q=()=>{o.hoveringIndex=q.value.findIndex(he=>o.selected.some(xe=>se(xe)===se(he)))},ie=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ce=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},ge=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},ye=()=>{var he,xe;(xe=(he=c.value)==null?void 0:he.updatePopper)==null||xe.call(he)},ue=()=>{var he,xe;(xe=(he=f.value)==null?void 0:he.updatePopper)==null||xe.call(he)},be=()=>{o.inputValue.length>0&&!R.value&&(R.value=!0),le(o.inputValue)},ne=he=>{if(o.inputValue=he.target.value,n.remote)de();else return be()},de=vu(()=>{be()},Y.value),ve=he=>{il(n.modelValue,he)||e(pi,he)},Ee=he=>xS(he,xe=>!o.disabledOptions.has(xe)),Se=he=>{if(n.multiple&&he.code!==Hn.delete&&he.target.value.length<=0){const xe=Un(n.modelValue).slice(),_e=Ee(xe);if(_e<0)return;const Fe=xe[_e];xe.splice(_e,1),e(tt,xe),ve(xe),e("remove-tag",Fe)}},Ie=(he,xe)=>{const _e=o.selected.indexOf(xe);if(_e>-1&&!x.value){const Fe=Un(n.modelValue).slice();Fe.splice(_e,1),e(tt,Fe),ve(Fe),e("remove-tag",xe.value)}he.stopPropagation(),pt()},Je=he=>{he.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const _e of o.selected)_e.isDisabled&&xe.push(_e.value);e(tt,xe),ve(xe),o.hoveringIndex=-1,R.value=!1,e("clear"),pt()},Ve=he=>{var xe;if(n.multiple){const _e=Un((xe=n.modelValue)!=null?xe:[]).slice(),Fe=st(_e,he.value);Fe>-1?_e.splice(Fe,1):(n.multipleLimit<=0||_e.length<n.multipleLimit)&&_e.push(he.value),e(tt,_e),ve(_e),he.created&&le(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(tt,he.value),ve(he.value),R.value=!1;pt(),!R.value&&a.nextTick(()=>{Re(he)})},st=(he=[],xe)=>{if(!Kt(xe))return he.indexOf(xe);const _e=n.valueKey;let Fe=-1;return he.some((Ne,je)=>a.toRaw(hi(Ne,_e))===hi(xe,_e)?(Fe=je,!0):!1),Fe},Re=he=>{var xe,_e,Fe,Ne,je;const ze=Nt(he)?he[0]:he;let qe=null;if(ze!=null&&ze.value){const Lt=q.value.filter(Ht=>Ht.value===ze.value);Lt.length>0&&(qe=Lt[0].$el)}if(c.value&&qe){const Lt=(Ne=(Fe=(_e=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:_e.contentRef)==null?void 0:Fe.querySelector)==null?void 0:Ne.call(Fe,`.${r.be("dropdown","wrap")}`);Lt&&CS(Lt,qe)}(je=v.value)==null||je.handleScroll()},Ue=he=>{o.options.set(he.value,he),o.cachedOptions.set(he.value,he),he.disabled&&o.disabledOptions.set(he.value,he)},We=(he,xe)=>{o.options.get(he)===xe&&o.options.delete(he)},Pt=a.computed(()=>{var he,xe;return(xe=(he=c.value)==null?void 0:he.popperRef)==null?void 0:xe.contentRef}),It=()=>{o.isBeforeHide=!1,a.nextTick(()=>Re(o.selected))},pt=()=>{var he;(he=d.value)==null||he.focus()},yt=()=>{var he;(he=d.value)==null||he.blur()},oi=he=>{Je(he)},ki=()=>{R.value=!1,P.value&&yt()},ai=()=>{o.inputValue.length>0?o.inputValue="":R.value=!1},wr=()=>{x.value||(qc&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:R.value=!R.value)},as=()=>{R.value?q.value[o.hoveringIndex]&&Ve(q.value[o.hoveringIndex]):wr()},se=he=>Kt(he.value)?hi(he.value,n.valueKey):he.value,we=a.computed(()=>q.value.filter(he=>he.visible).every(he=>he.disabled)),Te=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),De=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),J=he=>{if(!R.value){R.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||M.value)&&!we.value){he==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):he==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=q.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&J(he),a.nextTick(()=>Re(I.value))}},pe=()=>{if(!u.value)return 0;const he=window.getComputedStyle(u.value);return Number.parseFloat(he.gap||"6px")},fe=a.computed(()=>{const he=pe();return{maxWidth:`${y.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-he:o.selectionWidth}px`}}),me=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,hL)}px`}));return xn(u,ie),xn(p,ce),xn(h,ye),xn(C,ye),xn(b,ue),xn(y,ge),a.onMounted(()=>{U()}),{inputId:E,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:P,expanded:R,optionsArray:q,hoverOption:I,selectSize:K,filteredOptionsCount:te,resetCalculatorWidth:ce,updateTooltip:ye,updateTagTooltip:ue,debouncedOnInputChange:de,onInput:ne,deletePrevTag:Se,deleteTag:Ie,deleteSelected:Je,handleOptionSelect:Ve,scrollToOption:Re,hasModelValue:O,shouldShowPlaceholder:j,currentPlaceholder:oe,mouseEnterEventName:ae,showClose:B,iconComponent:N,iconReverse:k,validateState:z,validateIcon:G,showNewOption:$,updateOptions:X,collapseTagSize:re,setSelected:U,selectDisabled:x,emptyText:Z,handleCompositionStart:A,handleCompositionUpdate:_,handleCompositionEnd:w,onOptionCreate:Ue,onOptionDestroy:We,handleMenuEnter:It,focus:pt,blur:yt,handleClearClick:oi,handleClickOutside:ki,handleEsc:ai,toggleMenu:wr,selectOption:as,getValueKey:se,navigateOptions:J,dropdownMenuVisible:V,showTagList:Te,collapseTagList:De,tagStyle:fe,collapseTagStyle:me,inputStyle:Me,popperRef:Pt,inputRef:d,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:g,suffixRef:m,selectRef:l,wrapperRef:C,selectionRef:u,scrollbarRef:v,menuRef:h,tagMenuRef:b,collapseItemRef:y}};var pL=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(Sl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){Nt(c)&&c.forEach(f=>{var d,p,g,m;const h=(d=(f==null?void 0:f.type)||{})==null?void 0:d.name;h==="ElOptionGroup"?u(!Bt(f.children)&&!Nt(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(g=f.children)==null?void 0:g.default():f.children):h==="ElOption"?l.push((m=f.props)==null?void 0:m.value):Nt(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),il(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const mL=$e({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:$n,effect:{type:Be(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Be(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:dn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Wi,default:bu},fitInputWidth:Boolean,suffixIcon:{type:Wi,default:yu},tagType:{...Ju.type,default:"info"},tagEffect:{...Ju.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Be(String),values:ps,default:"bottom-start"},fallbackPlacements:{type:Be(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...ET,...Zn(["ariaLabel"])}),Dg="ElSelect",gL=a.defineComponent({name:Dg,componentName:Dg,components:{ElSelectMenu:dL,ElOption:qu,ElOptions:pL,ElTag:o2,ElScrollbar:iE,ElTooltip:Wu,ElIcon:mt},directives:{ClickOutside:LC},props:mL,emits:[tt,pi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return Nt(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=fL(i,e);return a.provide(Sl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function vL(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),d=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),g=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,h=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(h),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!h.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:h.currentLabel,value:h.value},()=>[a.createTextVNode(a.toDisplayString(h.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,h=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(h),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!h.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:h.currentLabel,value:h.value},()=>[a.createTextVNode(a.toDisplayString(h.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":h=>n.states.inputValue=h,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(h=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(h=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(d,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[g,n.handleClickOutside,n.popperRef]])}var yL=He(gL,[["render",vL],["__file","select.vue"]]);const bL=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ge("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Bg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,d;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((d=c.component)!=null&&d.proxy)},l=c=>{const f=Un(c),d=[];return f.forEach(p=>{var g,m;o(p)?d.push(p.component.proxy):(g=p.children)!=null&&g.length?d.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&d.push(...l(p.component.subTree))}),d},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Aw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function xL(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var kg=He(bL,[["render",xL],["__file","option-group.vue"]]);const _s=bt(yL,{Option:qu,OptionGroup:kg}),Ts=un(qu);un(kg);const wL=$e({trigger:$o.trigger,placement:Ku.placement,disabled:$o.disabled,visible:dn.visible,transition:dn.transition,popperOptions:Ku.popperOptions,tabindex:Ku.tabindex,content:dn.content,popperStyle:dn.popperStyle,popperClass:dn.popperClass,enterable:{...dn.enterable,default:!0},effect:{...dn.effect,default:"light"},teleported:dn.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),ML={"update:visible":n=>Ui(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},AL="onUpdate:visible",SL=a.defineComponent({name:"ElPopover"}),_L=a.defineComponent({...SL,props:wL,emits:ML,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[AL]),s=Ge("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:sl(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),d=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},g=()=>{t("before-leave")},m=()=>{t("after-enter")},h=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:d}),(b,y)=>(a.openBlock(),a.createBlock(a.unref(Wu),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:g,onShow:m,onHide:h}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var TL=He(_L,[["__file","popover.vue"]]);const Vg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var EL={mounted(n,e){Vg(n,e)},updated(n,e){Vg(n,e)}};const CL=YS(EL,"popover"),_l=bt(TL,{directive:CL}),zg=Symbol("sliderContextKey"),LL=$e({modelValue:{type:Be([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:$n,inputSize:$n,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Be(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Be(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:ps,default:"top"},marks:{type:Be(Object)},validateEvent:{type:Boolean,default:!0},...Zn(["ariaLabel"])}),Qu=n=>et(n)||Nt(n)&&n.every(et),RL={[tt]:Qu,[Er]:Qu,[pi]:Qu},FL=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),zt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},PL=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),IL=(n,e,t)=>{const{form:i,formItem:r}=yi(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),d=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(d.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),g=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),h=a.computed(()=>n.vertical?{height:p.value,bottom:g.value}:{width:p.value,left:g.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},y=T=>{const E=n.min+T*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-E)<Math.abs(d.value-E)?L=e.firstValue<e.secondValue?"firstButton":"secondButton":L=e.firstValue>e.secondValue?"firstButton":"secondButton",u[L]},v=T=>{const E=y(T);return E.value.setPosition(T),E},M=T=>{e.firstValue=T??n.min,_(n.range?[f.value,d.value]:T??n.min)},A=T=>{e.secondValue=T,n.range&&_([f.value,d.value])},_=T=>{t(tt,T),t(Er,T)},w=async()=>{await a.nextTick(),t(pi,n.range?[f.value,d.value]:n.modelValue)},C=T=>{var E,L,F,x,O,B;if(c.value||e.dragging)return;b();let N=0;if(n.vertical){const k=(F=(L=(E=T.touches)==null?void 0:E.item(0))==null?void 0:L.clientY)!=null?F:T.clientY;N=(s.value.getBoundingClientRect().bottom-k)/e.sliderSize*100}else{const k=(B=(O=(x=T.touches)==null?void 0:x.item(0))==null?void 0:O.clientX)!=null?B:T.clientX,z=s.value.getBoundingClientRect().left;N=(k-z)/e.sliderSize*100}if(!(N<0||N>100))return v(N)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:d,runwayStyle:m,barStyle:h,resetSize:b,setPosition:v,emitChange:w,onSliderWrapperPrevent:T=>{var E,L;((E=u.firstButton.value)!=null&&E.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&T.preventDefault()},onSliderClick:T=>{C(T)&&w()},onSliderDown:async T=>{const E=C(T);E&&(await a.nextTick(),E.value.onButtonDown(T))},onSliderMarkerDown:T=>{c.value||e.dragging||v(T)},setFirstValue:M,setSecondValue:A}},{left:OL,down:NL,right:BL,up:DL,home:kL,end:VL,pageUp:zL,pageDown:UL}=Hn,GL=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=vu(()=>{t.value&&(r.value=!0)},50),u=vu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},HL=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:d,resetSize:p,updateDragging:g}=a.inject(zg),{tooltip:m,tooltipVisible:h,formatValue:b,displayTooltip:y,hideTooltip:v}=GL(n,f,l),M=a.ref(),A=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),_=a.computed(()=>n.vertical?{bottom:A.value}:{left:A.value}),w=()=>{e.hovering=!0,y()},C=()=>{e.hovering=!1,e.dragging||v()},P=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",N),window.addEventListener("touchmove",N),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k),M.value.focus())},R=G=>{i.value||(e.newPosition=Number.parseFloat(A.value)+G/(s.value-r.value)*100,z(e.newPosition),d())},I=()=>{R(-o.value)},S=()=>{R(o.value)},T=()=>{R(-o.value*4)},E=()=>{R(o.value*4)},L=()=>{i.value||(z(0),d())},F=()=>{i.value||(z(100),d())},x=G=>{let Y=!0;[OL,NL].includes(G.key)?I():[BL,DL].includes(G.key)?S():G.key===kL?L():G.key===VL?F():G.key===UL?T():G.key===zL?E():Y=!1,Y&&G.preventDefault()},O=G=>{let Y,Z;return G.type.startsWith("touch")?(Z=G.touches[0].clientY,Y=G.touches[0].clientX):(Z=G.clientY,Y=G.clientX),{clientX:Y,clientY:Z}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:Y,clientY:Z}=O(G);n.vertical?e.startY=Z:e.startX=Y,e.startPosition=Number.parseFloat(A.value),e.newPosition=e.startPosition},N=G=>{if(e.dragging){e.isClick=!1,y(),p();let Y;const{clientX:Z,clientY:te}=O(G);n.vertical?(e.currentY=te,Y=(e.startY-e.currentY)/c.value*100):(e.currentX=Z,Y=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+Y,z(e.newPosition)}},k=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||v(),e.isClick||z(e.newPosition),d()},0),window.removeEventListener("mousemove",N),window.removeEventListener("touchmove",N),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))},z=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const Y=100/((s.value-r.value)/o.value);let te=Math.round(G/Y)*Y*(s.value-r.value)*.01+r.value;te=Number.parseFloat(te.toFixed(u.value)),te!==n.modelValue&&t(tt,te),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&y(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{g(G)}),zt(M,"touchstart",P,{passive:!1}),{disabled:i,button:M,tooltip:m,tooltipVisible:h,showTooltip:l,wrapperStyle:_,formatValue:b,handleMouseEnter:w,handleMouseLeave:C,onButtonDown:P,onKeyDown:x,setPosition:z}},WL=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return dt("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),jL=(n,e,t,i,r,s)=>{const o=c=>{r(tt,c),r(Er,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&hs("Slider","min should not be greater than max.");const d=n.modelValue;n.range&&Array.isArray(d)?d[1]<n.min?o([n.min,n.min]):d[0]>n.max?o([n.max,n.max]):d[0]<n.min?o([n.min,d[1]]):d[1]>n.max?o([d[0],n.max]):(e.firstValue=d[0],e.secondValue=d[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>dt(p))),e.oldValue=d.slice())):!n.range&&typeof d=="number"&&!Number.isNaN(d)&&(d<n.min?o(n.min):d>n.max?o(n.max):(e.firstValue=d,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>dt(p))),e.oldValue=d)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((d,p)=>d===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},$L=$e({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:ps,default:"top"}}),ZL={[tt]:n=>et(n)},XL=a.defineComponent({name:"ElSliderButton"}),YL=a.defineComponent({...XL,props:$L,emits:ZL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:d,formatValue:p,handleMouseEnter:g,handleMouseLeave:m,onButtonDown:h,onKeyDown:b,setPosition:y}=HL(i,s,t),{hovering:v,dragging:M}=a.toRefs(s);return e({onButtonDown:h,onKeyDown:b,setPosition:y,hovering:v,dragging:M}),(A,_)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(v),dragging:a.unref(M)}]),style:a.normalizeStyle(a.unref(d)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(g),onMouseleave:a.unref(m),onMousedown:a.unref(h),onFocus:a.unref(g),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Wu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:A.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":A.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(v),dragging:a.unref(M)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var Ug=He(YL,[["__file","button.vue"]]);const JL=$e({mark:{type:Be([String,Object]),default:void 0}});var KL=a.defineComponent({name:"ElSliderMarker",props:JL,setup(n){const e=Ge("slider"),t=a.computed(()=>Bt(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Bt(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const qL=a.defineComponent({name:"ElSlider"}),QL=a.defineComponent({...qL,props:LL,emits:RL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),{t:s}=cl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:d,minValue:p,maxValue:g,runwayStyle:m,barStyle:h,resetSize:b,emitChange:y,onSliderWrapperPrevent:v,onSliderClick:M,onSliderDown:A,onSliderMarkerDown:_,setFirstValue:w,setSecondValue:C}=IL(i,o,t),{stops:P,getStopStyle:R}=WL(i,o,p,g),{inputId:I,isLabeledByFormItem:S}=ws(i,{formItemContext:l}),T=vi(),E=a.computed(()=>i.inputSize||T.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),F=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(Y.value):`${Y.value}`),O=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(Z.value):`${Z.value}`),N=a.computed(()=>[r.b(),r.m(T.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),k=PL(i);jL(i,o,p,g,t,l);const z=a.computed(()=>{const W=[i.min,i.max,i.step].map($=>{const X=`${$}`.split(".")[1];return X?X.length:0});return Math.max.apply(null,W)}),{sliderWrapper:G}=FL(i,o,b),{firstValue:Y,secondValue:Z,sliderSize:te}=a.toRefs(o),q=W=>{o.dragging=W};return zt(G,"touchstart",v,{passive:!1}),zt(G,"touchmove",v,{passive:!1}),a.provide(zg,{...a.toRefs(i),sliderSize:te,disabled:d,precision:z,emitChange:y,resetSize:b,updateDragging:q}),e({onSliderClick:M}),(W,$)=>{var X,K;return a.openBlock(),a.createElementBlock("div",{id:W.range?a.unref(I):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(N)),role:W.range?"group":void 0,"aria-label":W.range&&!a.unref(S)?a.unref(L):void 0,"aria-labelledby":W.range&&a.unref(S)?(X=a.unref(l))==null?void 0:X.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":W.showInput&&!W.range},a.unref(r).is("disabled",a.unref(d))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(A),onTouchstartPassive:a.unref(A)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(h))},null,6),a.createVNode(Ug,{id:W.range?void 0:a.unref(I),ref_key:"firstButton",ref:c,"model-value":a.unref(Y),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":W.range||!a.unref(S)?a.unref(F):void 0,"aria-labelledby":!W.range&&a.unref(S)?(K=a.unref(l))==null?void 0:K.labelId:void 0,"aria-valuemin":W.min,"aria-valuemax":W.range?a.unref(Z):W.max,"aria-valuenow":a.unref(Y),"aria-valuetext":a.unref(x),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(d),"onUpdate:modelValue":a.unref(w)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),W.range?(a.openBlock(),a.createBlock(Ug,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(Z),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":a.unref(O),"aria-valuemin":a.unref(Y),"aria-valuemax":W.max,"aria-valuenow":a.unref(Z),"aria-valuetext":a.unref(B),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(d),"onUpdate:modelValue":a.unref(C)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),W.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(P),(re,V)=>(a.openBlock(),a.createElementBlock("div",{key:V,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(R)(re))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(k).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(re,V)=>(a.openBlock(),a.createElementBlock("div",{key:V,style:a.normalizeStyle(a.unref(R)(re.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(re,V)=>(a.openBlock(),a.createBlock(a.unref(KL),{key:V,mark:re.mark,style:a.normalizeStyle(a.unref(R)(re.position)),onMousedown:a.withModifiers(j=>a.unref(_)(re.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),W.showInput&&!W.range?(a.openBlock(),a.createBlock(a.unref(Mi),{key:0,ref:"input","model-value":a.unref(Y),class:a.normalizeClass(a.unref(r).e("input")),step:W.step,disabled:a.unref(d),controls:W.showInputControls,min:W.min,max:W.max,precision:a.unref(z),debounce:W.debounce,size:a.unref(E),"onUpdate:modelValue":a.unref(w),onChange:a.unref(y)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var eR=He(QL,[["__file","slider.vue"]]);const Sn=bt(eR),Tl=Symbol("tabsRootContextKey"),tR=$e({tabs:{type:Be(Array),default:()=>mi([])}}),Gg="ElTabBar",nR=a.defineComponent({name:Gg}),iR=a.defineComponent({...nR,props:tR,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Tl);r||hs(Gg,"<el-tabs><el-tab-bar /></el-tabs>");const s=Ge("tabs"),o=a.ref(),l=a.ref(),u=()=>{let g=0,m=0;const h=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=h==="width"?"x":"y",y=b==="x"?"left":"top";return t.tabs.every(v=>{var M,A;const _=(A=(M=i.parent)==null?void 0:M.refs)==null?void 0:A[`tab-${v.uid}`];if(!_)return!1;if(!v.active)return!0;g=_[`offset${Gi(y)}`],m=_[`client${Gi(h)}`];const w=window.getComputedStyle(_);return h==="width"&&(m-=Number.parseFloat(w.paddingLeft)+Number.parseFloat(w.paddingRight),g+=Number.parseFloat(w.paddingLeft)),!1}),{[h]:`${m}px`,transform:`translate${Gi(b)}(${g}px)`}},c=()=>l.value=u(),f=[],d=()=>{var g;f.forEach(h=>h.stop()),f.length=0;const m=(g=i.parent)==null?void 0:g.refs;if(m){for(const h in m)if(h.startsWith("tab-")){const b=m[h];b&&f.push(xn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),d()},{immediate:!0});const p=xn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(g=>g.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(g,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var rR=He(iR,[["__file","tab-bar.vue"]]);const sR=$e({panes:{type:Be(Array),default:()=>mi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),oR={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Hg="ElTabNav",aR=a.defineComponent({name:Hg,props:sR,emits:oR,setup(n,{expose:e,emit:t}){const i=a.inject(Tl);i||hs(Hg,"<el-tabs><tab-nav /></el-tabs>");const r=Ge("tabs"),s=gw(),o=Cw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),d=a.ref(!1),p=a.ref(0),g=a.ref(!1),m=a.ref(!0),h=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${h.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!l.value)return;const P=l.value[`offset${Gi(h.value)}`],R=p.value;if(!R)return;const I=R>P?R-P:0;p.value=I},v=()=>{if(!l.value||!u.value)return;const P=u.value[`offset${Gi(h.value)}`],R=l.value[`offset${Gi(h.value)}`],I=p.value;if(P-I<=R)return;const S=P-I>R*2?I+R:P-R;p.value=S},M=async()=>{const P=u.value;if(!d.value||!c.value||!l.value||!P)return;await a.nextTick();const R=c.value.querySelector(".is-active");if(!R)return;const I=l.value,S=["top","bottom"].includes(i.props.tabPosition),T=R.getBoundingClientRect(),E=I.getBoundingClientRect(),L=S?P.offsetWidth-E.width:P.offsetHeight-E.height,F=p.value;let x=F;S?(T.left<E.left&&(x=F-(E.left-T.left)),T.right>E.right&&(x=F+T.right-E.right)):(T.top<E.top&&(x=F-(E.top-T.top)),T.bottom>E.bottom&&(x=F+(T.bottom-E.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},A=()=>{var P;if(!u.value||!l.value)return;n.stretch&&((P=f.value)==null||P.update());const R=u.value[`offset${Gi(h.value)}`],I=l.value[`offset${Gi(h.value)}`],S=p.value;I<R?(d.value=d.value||{},d.value.prev=S,d.value.next=S+I<R,R-S<I&&(p.value=R-I)):(d.value=!1,S>0&&(p.value=0))},_=P=>{const R=P.code,{up:I,down:S,left:T,right:E}=Hn;if(![I,S,T,E].includes(R))return;const L=Array.from(P.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),F=L.indexOf(P.target);let x;R===T||R===I?F===0?x=L.length-1:x=F-1:F<L.length-1?x=F+1:x=0,L[x].focus({preventScroll:!0}),L[x].click(),w()},w=()=>{m.value&&(g.value=!0)},C=()=>g.value=!1;return a.watch(s,P=>{P==="hidden"?m.value=!1:P==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,P=>{P?setTimeout(()=>m.value=!0,50):m.value=!1}),xn(c,A),a.onMounted(()=>setTimeout(()=>M(),0)),a.onUpdated(()=>A()),e({scrollToActiveTab:M,removeFocus:C}),()=>{const P=d.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!d.value.prev)],onClick:y},[a.createVNode(mt,null,{default:()=>[a.createVNode(Hi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!d.value.next)],onClick:v},[a.createVNode(mt,null,{default:()=>[a.createVNode(Tr,null,null)]})])]:null,R=n.panes.map((I,S)=>{var T,E,L,F;const x=I.uid,O=I.props.disabled,B=(E=(T=I.props.name)!=null?T:I.index)!=null?E:`${S}`,N=!O&&(I.isClosable||n.editable);I.index=`${S}`;const k=N?a.createVNode(mt,{class:"is-icon-close",onClick:Y=>t("tabRemove",I,Y)},{default:()=>[a.createVNode(xu,null,null)]}):null,z=((F=(L=I.slots).label)==null?void 0:F.call(L))||I.props.label,G=!O&&I.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",I.active),r.is("disabled",O),r.is("closable",N),r.is("focus",g.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":I.active,tabindex:G,onFocus:()=>w(),onBlur:()=>C(),onClick:Y=>{C(),t("tabClick",I,B,Y)},onKeydown:Y=>{N&&(Y.code===Hn.delete||Y.code===Hn.backspace)&&t("tabRemove",I,Y)}},[z,k])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!d.value),r.is(i.props.tabPosition)]},[P,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:_},[n.type?null:a.createVNode(rR,{ref:f,tabs:[...n.panes]},null),R])])])}}}),lR=$e({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Be(Function),default:()=>!0},stretch:Boolean}),ed=n=>Bt(n)||et(n),cR={[tt]:n=>ed(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>ed(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>ed(n),tabAdd:()=>!0},uR=a.defineComponent({name:"ElTabs",props:lR,emits:cR,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ge("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=MT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),d=a.ref((r=n.modelValue)!=null?r:"0"),p=async(y,v=!1)=>{var M,A,_;if(!(d.value===y||sn(y)))try{await((M=n.beforeLeave)==null?void 0:M.call(n,y,d.value))!==!1&&(d.value=y,v&&(e(tt,y),e("tabChange",y)),(_=(A=f.value)==null?void 0:A.removeFocus)==null||_.call(A))}catch{}},g=(y,v,M)=>{y.props.disabled||(p(v,!0),e("tabClick",y,M))},m=(y,v)=>{y.props.disabled||sn(y.props.name)||(v.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},h=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,y=>p(y)),a.watch(d,async()=>{var y;await a.nextTick(),(y=f.value)==null||y.scrollToActiveTab()}),a.provide(Tl,{props:n,currentName:d,registerPane:y=>{l.value.push(y)},sortPane:u,unregisterPane:c}),i({currentName:d});const b=({render:y})=>y();return()=>{const y=t["add-icon"],v=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:h,onKeydown:_=>{_.code===Hn.enter&&h()}},[y?a.renderSlot(t,"add-icon"):a.createVNode(mt,{class:s.is("icon-plus")},{default:()=>[a.createVNode(ol,null,null)]})]):null,M=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const _=l.value.some(w=>w.slots.label);return a.createVNode(aR,{ref:f,currentName:d.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:g,onTabRemove:m},{$stable:!_})}},null),v]),A=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[A,M])}}}),dR=$e({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Wg="ElTabPane",hR=a.defineComponent({name:Wg}),fR=a.defineComponent({...hR,props:dR,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Tl);r||hs(Wg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=Ge("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Uf(()=>{var g;return r.currentName.value===((g=e.name)!=null?g:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var g;return(g=e.name)!=null?g:o.value}),d=Uf(()=>!e.lazy||c.value||u.value);a.watch(u,g=>{g&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(g,m)=>a.unref(d)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(g.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var jg=He(fR,[["__file","tab-pane.vue"]]);const $g=bt(uR,{TabPane:jg}),Zg=un(jg);function pR(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,g=d.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(rl(p,g.bm("parent","relative")),p.removeAttribute("loading-number")),rl(p,g.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,g;(g=(p=d.$el)==null?void 0:p.parentNode)==null||g.removeChild(d.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:g}){const{ns:m,zIndex:h}=RT("loading");return g({ns:m,zIndex:h}),()=>{const b=i.spinner||i.svg,y=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),v=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,v])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),d=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:d,get $el(){return d.$el}}}let El;const td=function(n={}){if(!Rt)return;const e=mR(n);if(e.fullscreen&&El)return El;const t=pR({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(El=void 0)}});gR(e,e.parent,t),Xg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Xg(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(El=t),t},mR=n=>{var e,t,i,r;let s;return Bt(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},gR=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Bo(document.body,"position"),t.originalOverflow.value=Bo(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Bo(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(Bo(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Bo(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Xg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?rl(e,i.bm("parent","relative")):$p(e,i.bm("parent","relative")),n.fullscreen&&n.lock?$p(e,i.bm("parent","hidden")):rl(e,i.bm("parent","hidden"))},Cl=Symbol("ElLoading"),Yg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>Kt(e.value)?e.value[p]:void 0,u=p=>{const g=Bt(p)&&(o==null?void 0:o[p])||p;return g&&a.ref(g)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Bw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,d={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[Cl]={options:d,instance:td(d)}},vR=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},nd={mounted(n,e){e.value&&Yg(n,e)},updated(n,e){const t=n[Cl];e.oldValue!==e.value&&(e.value&&!e.oldValue?Yg(n,e):e.value&&e.oldValue?Kt(e.value)&&vR(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[Cl])==null||e.instance.close(),n[Cl]=null}},yR={install(n){n.directive("loading",nd),n.config.globalProperties.$loading=td},directive:nd,service:td},Jn=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},bR=[{position:"top",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"bottom",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"left",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"},{position:"right",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"}],xR={name:"ScaffoldOverlay",data:function(){return{lockRotationMode:!1,touchActive:!1,rotationOverlays:bR}},props:{positionalRotation:{type:Boolean,default:!1}},methods:{contentMouseActive:function(n,e){if(this.positionalRotation){const t=this.$refs.topLayer;t&&(e?(this.lockRotationMode=!0,t.style.pointerEvents="none",n.type==="touchstart"&&(this.touchActive=!0)):(this.lockRotationMode=!1,this.setRotationMode(void 0,"free"),t.style.pointerEvents="auto",n.type==="touchend"&&(this.touchActive=!1)))}},setRotationMode:function(n,e){this.lockRotationMode||this.$emit("onRotationModeChange",e),n&&(n.preventDefault(),n.stopPropagation())},skipWhenInBound:function(n){if(this.positionalRotation){const e=this.$refs.topLayer,t=this.$refs.contentLayer;if(e&&t){const i=e.style.pointerEvents;e.style.pointerEvents="none";const r=document.elementFromPoint(n.clientX,n.clientY);e.style.pointerEvents=i,t.contains(r)&&n.stopPropagation()}}},forwardEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=document.elementFromPoint(n.clientX,n.clientY);if(e.style.pointerEvents=t,i){const r=new MouseEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,view:n.view,clientX:n.clientX,clientY:n.clientY,button:n.button});i.dispatchEvent(r),n.stopPropagation()}n.preventDefault()},forwardTouchEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=n.changedTouches[0],r=i.clientX,s=i.clientY,o=document.elementFromPoint(r,s);if(e.style.pointerEvents=t,o){const l=new Touch({identifier:i.identifier,target:o,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,radiusX:i.radiusX,radiusY:i.radiusY,rotationAngle:i.rotationAngle,force:i.force}),u=new TouchEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,composed:!0,view:n.view,touches:[l],targetTouches:[l],changedTouches:[l]});o.dispatchEvent(u),n.stopPropagation()}n.preventDefault()}}},wR={ref:"overlay"},MR=["onMousedown","onTouchstart"];function AR(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",wR,[a.createElementVNode("div",{class:"content-layer",ref:"contentLayer",onMouseleaveCapture:e[0]||(e[0]=(...o)=>s.skipWhenInBound&&s.skipWhenInBound(...o)),onMousedownCapture:e[1]||(e[1]=o=>s.contentMouseActive(o,!0)),onMouseupCapture:e[2]||(e[2]=o=>s.contentMouseActive(o,!1)),onTouchstartCapture:e[3]||(e[3]=o=>s.contentMouseActive(o,!0)),onTouchendCapture:e[4]||(e[4]=o=>s.contentMouseActive(o,!1))},[a.renderSlot(n.$slots,"default",{},void 0,!0)],544),t.positionalRotation?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"topLayer",onMousemoveCapture:e[7]||(e[7]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onMouseoverCapture:e[8]||(e[8]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onTouchmoveCapture:e[9]||(e[9]=(...o)=>s.forwardTouchEvent&&s.forwardTouchEvent(...o)),onClickCapture:e[10]||(e[10]=(...o)=>s.forwardEvent&&s.forwardEvent(...o))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.rotationOverlays,o=>(a.openBlock(),a.createElementBlock("div",{key:o.position,class:a.normalizeClass(["rotation-overlay",o.position,n.touchActive?"touch-active":""]),onMousedown:l=>{s.setRotationMode(l,o.mode),s.forwardEvent(l)},onMouseup:e[5]||(e[5]=(...l)=>s.forwardEvent&&s.forwardEvent(...l)),onTouchstart:l=>{s.setRotationMode(l,o.mode),s.forwardTouchEvent(l)},onTouchend:e[6]||(e[6]=(...l)=>s.forwardTouchEvent&&s.forwardTouchEvent(...l))},[a.createElementVNode("span",null,a.toDisplayString(o.text),1)],42,MR))),128))],544)):a.createCommentVNode("",!0)],512)}const Jg=Jn(xR,[["render",AR],["__scopeId","data-v-f06acb4f"]]);var Kg={exports:{}},qg={},Qg;function SR(){return Qg||(Qg=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var d=c.shift();return{done:d===void 0,value:d}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(d){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof d;if(p!=="undefined")if(p==="string")d!==""&&this._fromString(d);else if(d instanceof c){var g=this;d.forEach(function(y,v){g.append(v,y)})}else if(d!==null&&p==="object")if(Object.prototype.toString.call(d)==="[object Array]")for(var m=0;m<d.length;m++){var h=d[m];if(Object.prototype.toString.call(h)==="[object Array]"||h.length!==2)this.append(h[0],h[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in d)d.hasOwnProperty(b)&&this.append(b,d[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(d,p){d in this._entries?this._entries[d].push(String(p)):this._entries[d]=[String(p)]},f.delete=function(d){delete this._entries[d]},f.get=function(d){return d in this._entries?this._entries[d][0]:null},f.getAll=function(d){return d in this._entries?this._entries[d].slice(0):[]},f.has=function(d){return d in this._entries},f.set=function(d,p){this._entries[d]=[String(p)]},f.forEach=function(d,p){var g;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){g=this._entries[m];for(var h=0;h<g.length;h++)d.call(p,g[h],m,this)}},f.keys=function(){var d=[];return this.forEach(function(p,g){d.push(g)}),i(d)},f.values=function(){var d=[];return this.forEach(function(p){d.push(p)}),i(d)},f.entries=function(){var d=[];return this.forEach(function(p,g){d.push([g,p])}),i(d)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var d=[];return this.forEach(function(p,g){d.push(r(g)+"="+r(p))}),d.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,g){f.push([g,p]),c._entries||c.delete(g)}),f.sort(function(p,g){return p[0]<g[0]?-1:p[0]>g[0]?1:0}),c._entries&&(c._entries={});for(var d=0;d<f.length;d++)this.append(f[d][0],f[d][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,h){f.push(h)});for(var d=0;d<f.length;d++)this.delete(f[d])}c=c.replace(/^\?/,"");for(var p=c.split("&"),g,d=0;d<p.length;d++)g=p[d].split("="),this.append(s(g[0]),g.length>1?s(g[1]):"")}})}(typeof Yi<"u"?Yi:typeof window<"u"?window:typeof self<"u"?self:Yi),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,d;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),d=f.createElement("base"),d.href=c,f.head.appendChild(d);try{if(d.href.indexOf(c)!==0)throw new Error(d.href)}catch(M){throw new Error("URL unable to set base "+c+" due to "+M)}}var p=f.createElement("a");p.href=u,d&&(f.body.appendChild(p),p.href=p.href);var g=f.createElement("input");if(g.type="url",g.value=u,p.protocol===":"||!/:/.test(p.href)||!g.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),h=!0,b=!0,y=this;["append","delete","set"].forEach(function(M){var A=m[M];m[M]=function(){A.apply(m,arguments),h&&(b=!1,y.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var v=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==v&&(v=this.search,b&&(h=!1,this.searchParams._fromString(this.search),h=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Yi<"u"?Yi:typeof window<"u"?window:typeof self<"u"?self:Yi)),qg}/**
21
21
  * @license
22
22
  * Copyright 2010-2021 Three.js Authors
23
23
  * SPDX-License-Identifier: MIT
@@ -2864,7 +2864,7 @@ void main() {
2864
2864
  #include <logdepthbuf_vertex>
2865
2865
  #include <clipping_planes_vertex>
2866
2866
  #include <fog_vertex>
2867
- }`;const Ke={alphamap_fragment:P3,alphamap_pars_fragment:I3,alphatest_fragment:O3,aomap_fragment:N3,aomap_pars_fragment:B3,begin_vertex:D3,beginnormal_vertex:k3,bsdfs:V3,bumpmap_pars_fragment:z3,clipping_planes_fragment:U3,clipping_planes_pars_fragment:G3,clipping_planes_pars_vertex:H3,clipping_planes_vertex:W3,color_fragment:j3,color_pars_fragment:$3,color_pars_vertex:Z3,color_vertex:X3,common:Y3,cube_uv_reflection_fragment:J3,defaultnormal_vertex:K3,displacementmap_pars_vertex:q3,displacementmap_vertex:Q3,emissivemap_fragment:eF,emissivemap_pars_fragment:tF,encodings_fragment:nF,encodings_pars_fragment:iF,envmap_fragment:rF,envmap_common_pars_fragment:sF,envmap_pars_fragment:oF,envmap_pars_vertex:aF,envmap_physical_pars_fragment:yF,envmap_vertex:lF,fog_vertex:cF,fog_pars_vertex:uF,fog_fragment:dF,fog_pars_fragment:hF,gradientmap_pars_fragment:fF,lightmap_fragment:pF,lightmap_pars_fragment:mF,lights_lambert_vertex:gF,lights_pars_begin:vF,lights_toon_fragment:bF,lights_toon_pars_fragment:xF,lights_phong_fragment:wF,lights_phong_pars_fragment:MF,lights_physical_fragment:AF,lights_physical_pars_fragment:SF,lights_fragment_begin:_F,lights_fragment_maps:TF,lights_fragment_end:EF,logdepthbuf_fragment:CF,logdepthbuf_pars_fragment:LF,logdepthbuf_pars_vertex:RF,logdepthbuf_vertex:FF,map_fragment:PF,map_pars_fragment:IF,map_particle_fragment:OF,map_particle_pars_fragment:NF,metalnessmap_fragment:BF,metalnessmap_pars_fragment:DF,morphnormal_vertex:kF,morphtarget_pars_vertex:VF,morphtarget_vertex:zF,normal_fragment_begin:UF,normal_fragment_maps:GF,normalmap_pars_fragment:HF,clearcoat_normal_fragment_begin:WF,clearcoat_normal_fragment_maps:jF,clearcoat_pars_fragment:$F,packing:ZF,premultiplied_alpha_fragment:XF,project_vertex:YF,dithering_fragment:JF,dithering_pars_fragment:KF,roughnessmap_fragment:qF,roughnessmap_pars_fragment:QF,shadowmap_pars_fragment:eP,shadowmap_pars_vertex:tP,shadowmap_vertex:nP,shadowmask_pars_fragment:iP,skinbase_vertex:rP,skinning_pars_vertex:sP,skinning_vertex:oP,skinnormal_vertex:aP,specularmap_fragment:lP,specularmap_pars_fragment:cP,tonemapping_fragment:uP,tonemapping_pars_fragment:dP,transmission_fragment:hP,transmission_pars_fragment:fP,uv_pars_fragment:pP,uv_pars_vertex:mP,uv_vertex:gP,uv2_pars_fragment:vP,uv2_pars_vertex:yP,uv2_vertex:bP,worldpos_vertex:xP,background_frag:wP,background_vert:MP,cube_frag:AP,cube_vert:SP,depth_frag:_P,depth_vert:TP,distanceRGBA_frag:EP,distanceRGBA_vert:CP,equirect_frag:LP,equirect_vert:RP,linedashed_frag:FP,linedashed_vert:PP,meshbasic_frag:IP,meshbasic_vert:OP,meshlambert_frag:NP,meshlambert_vert:BP,meshmatcap_frag:DP,meshmatcap_vert:kP,meshtoon_frag:VP,meshtoon_vert:zP,meshphong_frag:UP,meshphong_vert:GP,meshphysical_frag:HP,meshphysical_vert:WP,normal_frag:jP,normal_vert:$P,points_frag:ZP,points_vert:XP,shadow_frag:YP,shadow_vert:JP,sprite_frag:KP,sprite_vert:qP},Le={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},On={basic:{uniforms:qt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:Ke.meshbasic_vert,fragmentShader:Ke.meshbasic_frag},lambert:{uniforms:qt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.fog,Le.lights,{emissive:{value:new Ce(0)}}]),vertexShader:Ke.meshlambert_vert,fragmentShader:Ke.meshlambert_frag},phong:{uniforms:qt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:Ke.meshphong_vert,fragmentShader:Ke.meshphong_frag},standard:{uniforms:qt([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag},toon:{uniforms:qt([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Ce(0)}}]),vertexShader:Ke.meshtoon_vert,fragmentShader:Ke.meshtoon_frag},matcap:{uniforms:qt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:Ke.meshmatcap_vert,fragmentShader:Ke.meshmatcap_frag},points:{uniforms:qt([Le.points,Le.fog]),vertexShader:Ke.points_vert,fragmentShader:Ke.points_frag},dashed:{uniforms:qt([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ke.linedashed_vert,fragmentShader:Ke.linedashed_frag},depth:{uniforms:qt([Le.common,Le.displacementmap]),vertexShader:Ke.depth_vert,fragmentShader:Ke.depth_frag},normal:{uniforms:qt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:Ke.normal_vert,fragmentShader:Ke.normal_frag},sprite:{uniforms:qt([Le.sprite,Le.fog]),vertexShader:Ke.sprite_vert,fragmentShader:Ke.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:Ke.background_vert,fragmentShader:Ke.background_frag},cube:{uniforms:qt([Le.envmap,{opacity:{value:1}}]),vertexShader:Ke.cube_vert,fragmentShader:Ke.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ke.equirect_vert,fragmentShader:Ke.equirect_frag},distanceRGBA:{uniforms:qt([Le.common,Le.displacementmap,{referencePosition:{value:new ee},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ke.distanceRGBA_vert,fragmentShader:Ke.distanceRGBA_frag},shadow:{uniforms:qt([Le.lights,Le.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:Ke.shadow_vert,fragmentShader:Ke.shadow_frag}};On.physical={uniforms:qt([On.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ce(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag};function QP(n,e,t,i,r){const s=new Ce(0);let o=0,l,u,c=null,f=0,d=null;function p(m,h){let b=!1,y=h.isScene===!0?h.background:null;y&&y.isTexture&&(y=e.get(y));const v=n.xr,M=v.getSession&&v.getSession();M&&M.environmentBlendMode==="additive"&&(y=null),y===null?g(s,o):y&&y.isColor&&(g(y,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ls)?(u===void 0&&(u=new St(new Ii(1,1,1),new Oi({name:"BackgroundCubeMaterial",uniforms:Zs(On.cube.uniforms),vertexShader:On.cube.vertexShader,fragmentShader:On.cube.fragmentShader,side:xt,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,_,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y._needsFlipEnvMap?-1:1,(c!==y||f!==y.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,c=y,f=y.version,d=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new St(new Wr(2,2),new Oi({name:"BackgroundMaterial",uniforms:Zs(On.background.uniforms),vertexShader:On.background.vertexShader,fragmentShader:On.background.fragmentShader,side:Ki,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(c!==y||f!==y.version||d!==n.toneMapping)&&(l.material.needsUpdate=!0,c=y,f=y.version,d=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function g(m,h){t.buffers.color.setClear(m.r,m.g,m.b,h,r)}return{getClearColor:function(){return s},setClearColor:function(m,h=1){s.set(m),o=h,g(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,g(s,o)},render:p}}function eI(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=h(null);let c=u;function f(E,L,F,x,O){let B=!1;if(o){const N=m(x,F,L);c!==N&&(c=N,p(c.object)),B=b(x,O),B&&y(x,O)}else{const N=L.wireframe===!0;(c.geometry!==x.id||c.program!==F.id||c.wireframe!==N)&&(c.geometry=x.id,c.program=F.id,c.wireframe=N,B=!0)}E.isInstancedMesh===!0&&(B=!0),O!==null&&t.update(O,34963),B&&(C(E,L,F,x),O!==null&&n.bindBuffer(34963,t.get(O).buffer))}function d(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(E){return i.isWebGL2?n.bindVertexArray(E):s.bindVertexArrayOES(E)}function g(E){return i.isWebGL2?n.deleteVertexArray(E):s.deleteVertexArrayOES(E)}function m(E,L,F){const x=F.wireframe===!0;let O=l[E.id];O===void 0&&(O={},l[E.id]=O);let B=O[L.id];B===void 0&&(B={},O[L.id]=B);let N=B[x];return N===void 0&&(N=h(d()),B[x]=N),N}function h(E){const L=[],F=[],x=[];for(let O=0;O<r;O++)L[O]=0,F[O]=0,x[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:F,attributeDivisors:x,object:E,attributes:{},index:null}}function b(E,L){const F=c.attributes,x=E.attributes;let O=0;for(const B in x){const N=F[B],k=x[B];if(N===void 0||N.attribute!==k||N.data!==k.data)return!0;O++}return c.attributesNum!==O||c.index!==L}function y(E,L){const F={},x=E.attributes;let O=0;for(const B in x){const N=x[B],k={};k.attribute=N,N.data&&(k.data=N.data),F[B]=k,O++}c.attributes=F,c.attributesNum=O,c.index=L}function v(){const E=c.newAttributes;for(let L=0,F=E.length;L<F;L++)E[L]=0}function M(E){A(E,0)}function A(E,L){const F=c.newAttributes,x=c.enabledAttributes,O=c.attributeDivisors;F[E]=1,x[E]===0&&(n.enableVertexAttribArray(E),x[E]=1),O[E]!==L&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](E,L),O[E]=L)}function _(){const E=c.newAttributes,L=c.enabledAttributes;for(let F=0,x=L.length;F<x;F++)L[F]!==E[F]&&(n.disableVertexAttribArray(F),L[F]=0)}function w(E,L,F,x,O,B){i.isWebGL2===!0&&(F===5124||F===5125)?n.vertexAttribIPointer(E,L,F,O,B):n.vertexAttribPointer(E,L,F,x,O,B)}function C(E,L,F,x){if(i.isWebGL2===!1&&(E.isInstancedMesh||x.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;v();const O=x.attributes,B=F.getAttributes(),N=L.defaultAttributeValues;for(const k in B){const z=B[k];if(z>=0){const G=O[k];if(G!==void 0){const Y=G.normalized,Z=G.itemSize,te=t.get(G);if(te===void 0)continue;const q=te.buffer,j=te.type,$=te.bytesPerElement;if(G.isInterleavedBufferAttribute){const X=G.data,K=X.stride,re=G.offset;X&&X.isInstancedInterleavedBuffer?(A(z,X.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=X.meshPerAttribute*X.count)):M(z),n.bindBuffer(34962,q),w(z,Z,j,Y,K*$,re*$)}else G.isInstancedBufferAttribute?(A(z,G.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=G.meshPerAttribute*G.count)):M(z),n.bindBuffer(34962,q),w(z,Z,j,Y,0,0)}else if(k==="instanceMatrix"){const Y=t.get(E.instanceMatrix);if(Y===void 0)continue;const Z=Y.buffer,te=Y.type;A(z+0,1),A(z+1,1),A(z+2,1),A(z+3,1),n.bindBuffer(34962,Z),n.vertexAttribPointer(z+0,4,te,!1,64,0),n.vertexAttribPointer(z+1,4,te,!1,64,16),n.vertexAttribPointer(z+2,4,te,!1,64,32),n.vertexAttribPointer(z+3,4,te,!1,64,48)}else if(k==="instanceColor"){const Y=t.get(E.instanceColor);if(Y===void 0)continue;const Z=Y.buffer,te=Y.type;A(z,1),n.bindBuffer(34962,Z),n.vertexAttribPointer(z,3,te,!1,12,0)}else if(N!==void 0){const Y=N[k];if(Y!==void 0)switch(Y.length){case 2:n.vertexAttrib2fv(z,Y);break;case 3:n.vertexAttrib3fv(z,Y);break;case 4:n.vertexAttrib4fv(z,Y);break;default:n.vertexAttrib1fv(z,Y)}}}}_()}function P(){S();for(const E in l){const L=l[E];for(const F in L){const x=L[F];for(const O in x)g(x[O].object),delete x[O];delete L[F]}delete l[E]}}function R(E){if(l[E.id]===void 0)return;const L=l[E.id];for(const F in L){const x=L[F];for(const O in x)g(x[O].object),delete x[O];delete L[F]}delete l[E.id]}function I(E){for(const L in l){const F=l[L];if(F[E.id]===void 0)continue;const x=F[E.id];for(const O in x)g(x[O].object),delete x[O];delete F[E.id]}}function S(){T(),c!==u&&(c=u,p(c.object))}function T(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:S,resetDefaultState:T,dispose:P,releaseStatesOfGeometry:R,releaseStatesOfProgram:I,initAttributes:v,enableAttribute:M,disableUnusedAttributes:_}}function tI(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,d){if(d===0)return;let p,g;if(r)p=n,g="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[g](s,c,f,d),t.update(f,s,d)}this.setMode=o,this.render=l,this.renderInstances=u}function nI(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const C=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(C){if(C==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";C="mediump"}return C==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,d=n.getParameter(34930),p=n.getParameter(35660),g=n.getParameter(3379),m=n.getParameter(34076),h=n.getParameter(34921),b=n.getParameter(36347),y=n.getParameter(36348),v=n.getParameter(36349),M=p>0,A=o||e.has("OES_texture_float"),_=M&&A,w=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:p,maxTextureSize:g,maxCubemapSize:m,maxAttributes:h,maxVertexUniforms:b,maxVaryings:y,maxFragmentUniforms:v,vertexTextures:M,floatFragmentTextures:A,floatVertexTextures:_,maxSamples:w}}function iI(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Kn,l=new Dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p,g){const m=d.length!==0||p||i!==0||r;return r=p,t=f(d,g,0),i=d.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(d,p,g){const m=d.clippingPlanes,h=d.clipIntersection,b=d.clipShadows,y=n.get(d);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const v=s?0:i,M=v*4;let A=y.clippingState||null;u.value=A,A=f(m,p,M,g);for(let _=0;_!==M;++_)A[_]=t[_];y.clippingState=A,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=v}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(d,p,g,m){const h=d!==null?d.length:0;let b=null;if(h!==0){if(b=u.value,m!==!0||b===null){const y=g+h*4,v=p.matrixWorldInverse;l.getNormalMatrix(v),(b===null||b.length<y)&&(b=new Float32Array(y));for(let M=0,A=g;M!==h;++M,A+=4)o.copy(d[M]).applyMatrix4(v,l),o.normal.toArray(b,A),b[A+3]=o.constant}u.value=b,u.needsUpdate=!0}return e.numPlanes=h,e.numIntersection=0,b}}function rI(n){let e=new WeakMap;function t(o,l){return l===Fl?o.mapping=Yo:l===Pl&&(o.mapping=Jo),o}function i(o){if(o&&o.isTexture){const l=o.mapping;if(l===Fl||l===Pl)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const c=n.getRenderTarget(),f=new sc(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function sI(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function oI(n,e,t,i){const r={},s=new WeakMap;function o(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(d,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(d){const p=d.attributes;for(const m in p)e.update(p[m],34962);const g=d.morphAttributes;for(const m in g){const h=g[m];for(let b=0,y=h.length;b<y;b++)e.update(h[b],34962)}}function c(d){const p=[],g=d.index,m=d.attributes.position;let h=0;if(g!==null){const v=g.array;h=g.version;for(let M=0,A=v.length;M<A;M+=3){const _=v[M+0],w=v[M+1],C=v[M+2];p.push(_,w,w,C,C,_)}}else{const v=m.array;h=m.version;for(let M=0,A=v.length/3-1;M<A;M+=3){const _=M+0,w=M+1,C=M+2;p.push(_,w,w,C,C,_)}}const b=new(q0(p)>65535?Yl:Xl)(p,1);b.version=h;const y=s.get(d);y&&e.remove(y),s.set(d,b)}function f(d){const p=s.get(d);if(p){const g=d.index;g!==null&&p.version<g.version&&c(d)}else c(d);return s.get(d)}return{get:l,update:u,getWireframeAttribute:f}}function aI(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let l,u;function c(p){l=p.type,u=p.bytesPerElement}function f(p,g){n.drawElements(s,g,l,p*u),t.update(g,s,1)}function d(p,g,m){if(m===0)return;let h,b;if(r)h=n,b="drawElementsInstanced";else if(h=e.get("ANGLE_instanced_arrays"),b="drawElementsInstancedANGLE",h===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}h[b](s,g,l,p*u,m),t.update(g,s,m)}this.setMode=o,this.setIndex=c,this.render=f,this.renderInstances=d}function lI(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,l){switch(t.calls++,o){case 4:t.triangles+=l*(s/3);break;case 1:t.lines+=l*(s/2);break;case 3:t.lines+=l*(s-1);break;case 2:t.lines+=l*s;break;case 0:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function cI(n,e){return n[0]-e[0]}function uI(n,e){return Math.abs(e[1])-Math.abs(n[1])}function dI(n){const e={},t=new Float32Array(8),i=[];for(let s=0;s<8;s++)i[s]=[s,0];function r(s,o,l,u){const c=s.morphTargetInfluences,f=c===void 0?0:c.length;let d=e[o.id];if(d===void 0||d.length!==f){d=[];for(let b=0;b<f;b++)d[b]=[b,0];e[o.id]=d}for(let b=0;b<f;b++){const y=d[b];y[0]=b,y[1]=c[b]}d.sort(uI);for(let b=0;b<8;b++)b<f&&d[b][1]?(i[b][0]=d[b][0],i[b][1]=d[b][1]):(i[b][0]=Number.MAX_SAFE_INTEGER,i[b][1]=0);i.sort(cI);const p=l.morphTargets&&o.morphAttributes.position,g=l.morphNormals&&o.morphAttributes.normal;let m=0;for(let b=0;b<8;b++){const y=i[b],v=y[0],M=y[1];v!==Number.MAX_SAFE_INTEGER&&M?(p&&o.getAttribute("morphTarget"+b)!==p[v]&&o.setAttribute("morphTarget"+b,p[v]),g&&o.getAttribute("morphNormal"+b)!==g[v]&&o.setAttribute("morphNormal"+b,g[v]),t[b]=M,m+=M):(p&&o.hasAttribute("morphTarget"+b)===!0&&o.deleteAttribute("morphTarget"+b),g&&o.hasAttribute("morphNormal"+b)===!0&&o.deleteAttribute("morphNormal"+b),t[b]=0)}const h=o.morphTargetsRelative?1:1-m;u.getUniforms().setValue(n,"morphTargetBaseInfluence",h),u.getUniforms().setValue(n,"morphTargetInfluences",t)}return{update:r}}function hI(n,e,t,i){let r=new WeakMap;function s(u){const c=i.render.frame,f=u.geometry,d=e.get(u,f);return r.get(d)!==c&&(e.update(d),r.set(d,c)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),d}function o(){r=new WeakMap}function l(u){const c=u.target;c.removeEventListener("dispose",l),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class rh extends Mt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=wt,this.minFilter=wt,this.wrapR=Ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}rh.prototype.isDataTexture2DArray=!0;class sh extends Mt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=wt,this.minFilter=wt,this.wrapR=Ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}sh.prototype.isDataTexture3D=!0;const ny=new Mt,fI=new rh,pI=new sh,iy=new Js,ry=[],sy=[],oy=new Float32Array(16),ay=new Float32Array(9),ly=new Float32Array(4);function qs(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=ry[r];if(s===void 0&&(s=new Float32Array(r),ry[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function nn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Qt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function cy(n,e){let t=sy[e];t===void 0&&(t=new Int32Array(e),sy[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function mI(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function gI(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(nn(t,e))return;n.uniform2fv(this.addr,e),Qt(t,e)}}function vI(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(nn(t,e))return;n.uniform3fv(this.addr,e),Qt(t,e)}}function yI(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(nn(t,e))return;n.uniform4fv(this.addr,e),Qt(t,e)}}function bI(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Qt(t,e)}else{if(nn(t,i))return;ly.set(i),n.uniformMatrix2fv(this.addr,!1,ly),Qt(t,i)}}function xI(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Qt(t,e)}else{if(nn(t,i))return;ay.set(i),n.uniformMatrix3fv(this.addr,!1,ay),Qt(t,i)}}function wI(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Qt(t,e)}else{if(nn(t,i))return;oy.set(i),n.uniformMatrix4fv(this.addr,!1,oy),Qt(t,i)}}function MI(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function AI(n,e){const t=this.cache;nn(t,e)||(n.uniform2iv(this.addr,e),Qt(t,e))}function SI(n,e){const t=this.cache;nn(t,e)||(n.uniform3iv(this.addr,e),Qt(t,e))}function _I(n,e){const t=this.cache;nn(t,e)||(n.uniform4iv(this.addr,e),Qt(t,e))}function TI(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function EI(n,e){const t=this.cache;nn(t,e)||(n.uniform2uiv(this.addr,e),Qt(t,e))}function CI(n,e){const t=this.cache;nn(t,e)||(n.uniform3uiv(this.addr,e),Qt(t,e))}function LI(n,e){const t=this.cache;nn(t,e)||(n.uniform4uiv(this.addr,e),Qt(t,e))}function RI(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||ny,r)}function FI(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||pI,r)}function PI(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||iy,r)}function II(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||fI,r)}function OI(n){switch(n){case 5126:return mI;case 35664:return gI;case 35665:return vI;case 35666:return yI;case 35674:return bI;case 35675:return xI;case 35676:return wI;case 5124:case 35670:return MI;case 35667:case 35671:return AI;case 35668:case 35672:return SI;case 35669:case 35673:return _I;case 5125:return TI;case 36294:return EI;case 36295:return CI;case 36296:return LI;case 35678:case 36198:case 36298:case 36306:case 35682:return RI;case 35679:case 36299:case 36307:return FI;case 35680:case 36300:case 36308:case 36293:return PI;case 36289:case 36303:case 36311:case 36292:return II}}function NI(n,e){n.uniform1fv(this.addr,e)}function BI(n,e){const t=qs(e,this.size,2);n.uniform2fv(this.addr,t)}function DI(n,e){const t=qs(e,this.size,3);n.uniform3fv(this.addr,t)}function kI(n,e){const t=qs(e,this.size,4);n.uniform4fv(this.addr,t)}function VI(n,e){const t=qs(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function zI(n,e){const t=qs(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function UI(n,e){const t=qs(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function GI(n,e){n.uniform1iv(this.addr,e)}function HI(n,e){n.uniform2iv(this.addr,e)}function WI(n,e){n.uniform3iv(this.addr,e)}function jI(n,e){n.uniform4iv(this.addr,e)}function $I(n,e){n.uniform1uiv(this.addr,e)}function ZI(n,e){n.uniform2uiv(this.addr,e)}function XI(n,e){n.uniform3uiv(this.addr,e)}function YI(n,e){n.uniform4uiv(this.addr,e)}function JI(n,e,t){const i=e.length,r=cy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTexture2D(e[s]||ny,r[s])}function KI(n,e,t){const i=e.length,r=cy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTextureCube(e[s]||iy,r[s])}function qI(n){switch(n){case 5126:return NI;case 35664:return BI;case 35665:return DI;case 35666:return kI;case 35674:return VI;case 35675:return zI;case 35676:return UI;case 5124:case 35670:return GI;case 35667:case 35671:return HI;case 35668:case 35672:return WI;case 35669:case 35673:return jI;case 5125:return $I;case 36294:return ZI;case 36295:return XI;case 36296:return YI;case 35678:case 36198:case 36298:case 36306:case 35682:return JI;case 35680:case 36300:case 36308:case 36293:return KI}}function QI(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=OI(e.type)}function uy(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=qI(e.type)}uy.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),Qt(e,n)};function dy(n){this.id=n,this.seq=[],this.map={}}dy.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const o=i[r];o.setValue(n,e[o.id],t)}};const oh=/(\w+)(\])?(\[|\.)?/g;function hy(n,e){n.seq.push(e),n.map[e.id]=e}function eO(n,e,t){const i=n.name,r=i.length;for(oh.lastIndex=0;;){const s=oh.exec(i),o=oh.lastIndex;let l=s[1];const u=s[2]==="]",c=s[3];if(u&&(l=l|0),c===void 0||c==="["&&o+2===r){hy(t,c===void 0?new QI(l,n,e):new uy(l,n,e));break}else{let d=t.map[l];d===void 0&&(d=new dy(l),hy(t,d)),t=d}}}function dr(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i),s=n.getUniformLocation(e,r.name);eO(r,s,this)}}dr.prototype.setValue=function(n,e,t,i){const r=this.map[e];r!==void 0&&r.setValue(n,t,i)},dr.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)},dr.upload=function(n,e,t,i){for(let r=0,s=e.length;r!==s;++r){const o=e[r],l=t[o.id];l.needsUpdate!==!1&&o.setValue(n,l.value,i)}},dr.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const s=n[i];s.id in e&&t.push(s)}return t};function fy(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let tO=0;function nO(n){const e=n.split(`
2867
+ }`;const Ke={alphamap_fragment:P3,alphamap_pars_fragment:I3,alphatest_fragment:O3,aomap_fragment:N3,aomap_pars_fragment:B3,begin_vertex:D3,beginnormal_vertex:k3,bsdfs:V3,bumpmap_pars_fragment:z3,clipping_planes_fragment:U3,clipping_planes_pars_fragment:G3,clipping_planes_pars_vertex:H3,clipping_planes_vertex:W3,color_fragment:j3,color_pars_fragment:$3,color_pars_vertex:Z3,color_vertex:X3,common:Y3,cube_uv_reflection_fragment:J3,defaultnormal_vertex:K3,displacementmap_pars_vertex:q3,displacementmap_vertex:Q3,emissivemap_fragment:eF,emissivemap_pars_fragment:tF,encodings_fragment:nF,encodings_pars_fragment:iF,envmap_fragment:rF,envmap_common_pars_fragment:sF,envmap_pars_fragment:oF,envmap_pars_vertex:aF,envmap_physical_pars_fragment:yF,envmap_vertex:lF,fog_vertex:cF,fog_pars_vertex:uF,fog_fragment:dF,fog_pars_fragment:hF,gradientmap_pars_fragment:fF,lightmap_fragment:pF,lightmap_pars_fragment:mF,lights_lambert_vertex:gF,lights_pars_begin:vF,lights_toon_fragment:bF,lights_toon_pars_fragment:xF,lights_phong_fragment:wF,lights_phong_pars_fragment:MF,lights_physical_fragment:AF,lights_physical_pars_fragment:SF,lights_fragment_begin:_F,lights_fragment_maps:TF,lights_fragment_end:EF,logdepthbuf_fragment:CF,logdepthbuf_pars_fragment:LF,logdepthbuf_pars_vertex:RF,logdepthbuf_vertex:FF,map_fragment:PF,map_pars_fragment:IF,map_particle_fragment:OF,map_particle_pars_fragment:NF,metalnessmap_fragment:BF,metalnessmap_pars_fragment:DF,morphnormal_vertex:kF,morphtarget_pars_vertex:VF,morphtarget_vertex:zF,normal_fragment_begin:UF,normal_fragment_maps:GF,normalmap_pars_fragment:HF,clearcoat_normal_fragment_begin:WF,clearcoat_normal_fragment_maps:jF,clearcoat_pars_fragment:$F,packing:ZF,premultiplied_alpha_fragment:XF,project_vertex:YF,dithering_fragment:JF,dithering_pars_fragment:KF,roughnessmap_fragment:qF,roughnessmap_pars_fragment:QF,shadowmap_pars_fragment:eP,shadowmap_pars_vertex:tP,shadowmap_vertex:nP,shadowmask_pars_fragment:iP,skinbase_vertex:rP,skinning_pars_vertex:sP,skinning_vertex:oP,skinnormal_vertex:aP,specularmap_fragment:lP,specularmap_pars_fragment:cP,tonemapping_fragment:uP,tonemapping_pars_fragment:dP,transmission_fragment:hP,transmission_pars_fragment:fP,uv_pars_fragment:pP,uv_pars_vertex:mP,uv_vertex:gP,uv2_pars_fragment:vP,uv2_pars_vertex:yP,uv2_vertex:bP,worldpos_vertex:xP,background_frag:wP,background_vert:MP,cube_frag:AP,cube_vert:SP,depth_frag:_P,depth_vert:TP,distanceRGBA_frag:EP,distanceRGBA_vert:CP,equirect_frag:LP,equirect_vert:RP,linedashed_frag:FP,linedashed_vert:PP,meshbasic_frag:IP,meshbasic_vert:OP,meshlambert_frag:NP,meshlambert_vert:BP,meshmatcap_frag:DP,meshmatcap_vert:kP,meshtoon_frag:VP,meshtoon_vert:zP,meshphong_frag:UP,meshphong_vert:GP,meshphysical_frag:HP,meshphysical_vert:WP,normal_frag:jP,normal_vert:$P,points_frag:ZP,points_vert:XP,shadow_frag:YP,shadow_vert:JP,sprite_frag:KP,sprite_vert:qP},Le={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},On={basic:{uniforms:qt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:Ke.meshbasic_vert,fragmentShader:Ke.meshbasic_frag},lambert:{uniforms:qt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.fog,Le.lights,{emissive:{value:new Ce(0)}}]),vertexShader:Ke.meshlambert_vert,fragmentShader:Ke.meshlambert_frag},phong:{uniforms:qt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:Ke.meshphong_vert,fragmentShader:Ke.meshphong_frag},standard:{uniforms:qt([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag},toon:{uniforms:qt([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Ce(0)}}]),vertexShader:Ke.meshtoon_vert,fragmentShader:Ke.meshtoon_frag},matcap:{uniforms:qt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:Ke.meshmatcap_vert,fragmentShader:Ke.meshmatcap_frag},points:{uniforms:qt([Le.points,Le.fog]),vertexShader:Ke.points_vert,fragmentShader:Ke.points_frag},dashed:{uniforms:qt([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ke.linedashed_vert,fragmentShader:Ke.linedashed_frag},depth:{uniforms:qt([Le.common,Le.displacementmap]),vertexShader:Ke.depth_vert,fragmentShader:Ke.depth_frag},normal:{uniforms:qt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:Ke.normal_vert,fragmentShader:Ke.normal_frag},sprite:{uniforms:qt([Le.sprite,Le.fog]),vertexShader:Ke.sprite_vert,fragmentShader:Ke.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:Ke.background_vert,fragmentShader:Ke.background_frag},cube:{uniforms:qt([Le.envmap,{opacity:{value:1}}]),vertexShader:Ke.cube_vert,fragmentShader:Ke.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ke.equirect_vert,fragmentShader:Ke.equirect_frag},distanceRGBA:{uniforms:qt([Le.common,Le.displacementmap,{referencePosition:{value:new ee},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ke.distanceRGBA_vert,fragmentShader:Ke.distanceRGBA_frag},shadow:{uniforms:qt([Le.lights,Le.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:Ke.shadow_vert,fragmentShader:Ke.shadow_frag}};On.physical={uniforms:qt([On.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ce(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag};function QP(n,e,t,i,r){const s=new Ce(0);let o=0,l,u,c=null,f=0,d=null;function p(m,h){let b=!1,y=h.isScene===!0?h.background:null;y&&y.isTexture&&(y=e.get(y));const v=n.xr,M=v.getSession&&v.getSession();M&&M.environmentBlendMode==="additive"&&(y=null),y===null?g(s,o):y&&y.isColor&&(g(y,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ls)?(u===void 0&&(u=new St(new Ii(1,1,1),new Oi({name:"BackgroundCubeMaterial",uniforms:Zs(On.cube.uniforms),vertexShader:On.cube.vertexShader,fragmentShader:On.cube.fragmentShader,side:xt,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,_,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y._needsFlipEnvMap?-1:1,(c!==y||f!==y.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,c=y,f=y.version,d=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new St(new Wr(2,2),new Oi({name:"BackgroundMaterial",uniforms:Zs(On.background.uniforms),vertexShader:On.background.vertexShader,fragmentShader:On.background.fragmentShader,side:Ki,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(c!==y||f!==y.version||d!==n.toneMapping)&&(l.material.needsUpdate=!0,c=y,f=y.version,d=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function g(m,h){t.buffers.color.setClear(m.r,m.g,m.b,h,r)}return{getClearColor:function(){return s},setClearColor:function(m,h=1){s.set(m),o=h,g(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,g(s,o)},render:p}}function eI(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=h(null);let c=u;function f(E,L,F,x,O){let B=!1;if(o){const N=m(x,F,L);c!==N&&(c=N,p(c.object)),B=b(x,O),B&&y(x,O)}else{const N=L.wireframe===!0;(c.geometry!==x.id||c.program!==F.id||c.wireframe!==N)&&(c.geometry=x.id,c.program=F.id,c.wireframe=N,B=!0)}E.isInstancedMesh===!0&&(B=!0),O!==null&&t.update(O,34963),B&&(C(E,L,F,x),O!==null&&n.bindBuffer(34963,t.get(O).buffer))}function d(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(E){return i.isWebGL2?n.bindVertexArray(E):s.bindVertexArrayOES(E)}function g(E){return i.isWebGL2?n.deleteVertexArray(E):s.deleteVertexArrayOES(E)}function m(E,L,F){const x=F.wireframe===!0;let O=l[E.id];O===void 0&&(O={},l[E.id]=O);let B=O[L.id];B===void 0&&(B={},O[L.id]=B);let N=B[x];return N===void 0&&(N=h(d()),B[x]=N),N}function h(E){const L=[],F=[],x=[];for(let O=0;O<r;O++)L[O]=0,F[O]=0,x[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:F,attributeDivisors:x,object:E,attributes:{},index:null}}function b(E,L){const F=c.attributes,x=E.attributes;let O=0;for(const B in x){const N=F[B],k=x[B];if(N===void 0||N.attribute!==k||N.data!==k.data)return!0;O++}return c.attributesNum!==O||c.index!==L}function y(E,L){const F={},x=E.attributes;let O=0;for(const B in x){const N=x[B],k={};k.attribute=N,N.data&&(k.data=N.data),F[B]=k,O++}c.attributes=F,c.attributesNum=O,c.index=L}function v(){const E=c.newAttributes;for(let L=0,F=E.length;L<F;L++)E[L]=0}function M(E){A(E,0)}function A(E,L){const F=c.newAttributes,x=c.enabledAttributes,O=c.attributeDivisors;F[E]=1,x[E]===0&&(n.enableVertexAttribArray(E),x[E]=1),O[E]!==L&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](E,L),O[E]=L)}function _(){const E=c.newAttributes,L=c.enabledAttributes;for(let F=0,x=L.length;F<x;F++)L[F]!==E[F]&&(n.disableVertexAttribArray(F),L[F]=0)}function w(E,L,F,x,O,B){i.isWebGL2===!0&&(F===5124||F===5125)?n.vertexAttribIPointer(E,L,F,O,B):n.vertexAttribPointer(E,L,F,x,O,B)}function C(E,L,F,x){if(i.isWebGL2===!1&&(E.isInstancedMesh||x.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;v();const O=x.attributes,B=F.getAttributes(),N=L.defaultAttributeValues;for(const k in B){const z=B[k];if(z>=0){const G=O[k];if(G!==void 0){const Y=G.normalized,Z=G.itemSize,te=t.get(G);if(te===void 0)continue;const q=te.buffer,W=te.type,$=te.bytesPerElement;if(G.isInterleavedBufferAttribute){const X=G.data,K=X.stride,re=G.offset;X&&X.isInstancedInterleavedBuffer?(A(z,X.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=X.meshPerAttribute*X.count)):M(z),n.bindBuffer(34962,q),w(z,Z,W,Y,K*$,re*$)}else G.isInstancedBufferAttribute?(A(z,G.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=G.meshPerAttribute*G.count)):M(z),n.bindBuffer(34962,q),w(z,Z,W,Y,0,0)}else if(k==="instanceMatrix"){const Y=t.get(E.instanceMatrix);if(Y===void 0)continue;const Z=Y.buffer,te=Y.type;A(z+0,1),A(z+1,1),A(z+2,1),A(z+3,1),n.bindBuffer(34962,Z),n.vertexAttribPointer(z+0,4,te,!1,64,0),n.vertexAttribPointer(z+1,4,te,!1,64,16),n.vertexAttribPointer(z+2,4,te,!1,64,32),n.vertexAttribPointer(z+3,4,te,!1,64,48)}else if(k==="instanceColor"){const Y=t.get(E.instanceColor);if(Y===void 0)continue;const Z=Y.buffer,te=Y.type;A(z,1),n.bindBuffer(34962,Z),n.vertexAttribPointer(z,3,te,!1,12,0)}else if(N!==void 0){const Y=N[k];if(Y!==void 0)switch(Y.length){case 2:n.vertexAttrib2fv(z,Y);break;case 3:n.vertexAttrib3fv(z,Y);break;case 4:n.vertexAttrib4fv(z,Y);break;default:n.vertexAttrib1fv(z,Y)}}}}_()}function P(){S();for(const E in l){const L=l[E];for(const F in L){const x=L[F];for(const O in x)g(x[O].object),delete x[O];delete L[F]}delete l[E]}}function R(E){if(l[E.id]===void 0)return;const L=l[E.id];for(const F in L){const x=L[F];for(const O in x)g(x[O].object),delete x[O];delete L[F]}delete l[E.id]}function I(E){for(const L in l){const F=l[L];if(F[E.id]===void 0)continue;const x=F[E.id];for(const O in x)g(x[O].object),delete x[O];delete F[E.id]}}function S(){T(),c!==u&&(c=u,p(c.object))}function T(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:S,resetDefaultState:T,dispose:P,releaseStatesOfGeometry:R,releaseStatesOfProgram:I,initAttributes:v,enableAttribute:M,disableUnusedAttributes:_}}function tI(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,d){if(d===0)return;let p,g;if(r)p=n,g="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[g](s,c,f,d),t.update(f,s,d)}this.setMode=o,this.render=l,this.renderInstances=u}function nI(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const C=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(C){if(C==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";C="mediump"}return C==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,d=n.getParameter(34930),p=n.getParameter(35660),g=n.getParameter(3379),m=n.getParameter(34076),h=n.getParameter(34921),b=n.getParameter(36347),y=n.getParameter(36348),v=n.getParameter(36349),M=p>0,A=o||e.has("OES_texture_float"),_=M&&A,w=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:p,maxTextureSize:g,maxCubemapSize:m,maxAttributes:h,maxVertexUniforms:b,maxVaryings:y,maxFragmentUniforms:v,vertexTextures:M,floatFragmentTextures:A,floatVertexTextures:_,maxSamples:w}}function iI(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Kn,l=new Dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p,g){const m=d.length!==0||p||i!==0||r;return r=p,t=f(d,g,0),i=d.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(d,p,g){const m=d.clippingPlanes,h=d.clipIntersection,b=d.clipShadows,y=n.get(d);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const v=s?0:i,M=v*4;let A=y.clippingState||null;u.value=A,A=f(m,p,M,g);for(let _=0;_!==M;++_)A[_]=t[_];y.clippingState=A,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=v}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(d,p,g,m){const h=d!==null?d.length:0;let b=null;if(h!==0){if(b=u.value,m!==!0||b===null){const y=g+h*4,v=p.matrixWorldInverse;l.getNormalMatrix(v),(b===null||b.length<y)&&(b=new Float32Array(y));for(let M=0,A=g;M!==h;++M,A+=4)o.copy(d[M]).applyMatrix4(v,l),o.normal.toArray(b,A),b[A+3]=o.constant}u.value=b,u.needsUpdate=!0}return e.numPlanes=h,e.numIntersection=0,b}}function rI(n){let e=new WeakMap;function t(o,l){return l===Fl?o.mapping=Yo:l===Pl&&(o.mapping=Jo),o}function i(o){if(o&&o.isTexture){const l=o.mapping;if(l===Fl||l===Pl)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const c=n.getRenderTarget(),f=new sc(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function sI(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function oI(n,e,t,i){const r={},s=new WeakMap;function o(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(d,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(d){const p=d.attributes;for(const m in p)e.update(p[m],34962);const g=d.morphAttributes;for(const m in g){const h=g[m];for(let b=0,y=h.length;b<y;b++)e.update(h[b],34962)}}function c(d){const p=[],g=d.index,m=d.attributes.position;let h=0;if(g!==null){const v=g.array;h=g.version;for(let M=0,A=v.length;M<A;M+=3){const _=v[M+0],w=v[M+1],C=v[M+2];p.push(_,w,w,C,C,_)}}else{const v=m.array;h=m.version;for(let M=0,A=v.length/3-1;M<A;M+=3){const _=M+0,w=M+1,C=M+2;p.push(_,w,w,C,C,_)}}const b=new(q0(p)>65535?Yl:Xl)(p,1);b.version=h;const y=s.get(d);y&&e.remove(y),s.set(d,b)}function f(d){const p=s.get(d);if(p){const g=d.index;g!==null&&p.version<g.version&&c(d)}else c(d);return s.get(d)}return{get:l,update:u,getWireframeAttribute:f}}function aI(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let l,u;function c(p){l=p.type,u=p.bytesPerElement}function f(p,g){n.drawElements(s,g,l,p*u),t.update(g,s,1)}function d(p,g,m){if(m===0)return;let h,b;if(r)h=n,b="drawElementsInstanced";else if(h=e.get("ANGLE_instanced_arrays"),b="drawElementsInstancedANGLE",h===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}h[b](s,g,l,p*u,m),t.update(g,s,m)}this.setMode=o,this.setIndex=c,this.render=f,this.renderInstances=d}function lI(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,l){switch(t.calls++,o){case 4:t.triangles+=l*(s/3);break;case 1:t.lines+=l*(s/2);break;case 3:t.lines+=l*(s-1);break;case 2:t.lines+=l*s;break;case 0:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function cI(n,e){return n[0]-e[0]}function uI(n,e){return Math.abs(e[1])-Math.abs(n[1])}function dI(n){const e={},t=new Float32Array(8),i=[];for(let s=0;s<8;s++)i[s]=[s,0];function r(s,o,l,u){const c=s.morphTargetInfluences,f=c===void 0?0:c.length;let d=e[o.id];if(d===void 0||d.length!==f){d=[];for(let b=0;b<f;b++)d[b]=[b,0];e[o.id]=d}for(let b=0;b<f;b++){const y=d[b];y[0]=b,y[1]=c[b]}d.sort(uI);for(let b=0;b<8;b++)b<f&&d[b][1]?(i[b][0]=d[b][0],i[b][1]=d[b][1]):(i[b][0]=Number.MAX_SAFE_INTEGER,i[b][1]=0);i.sort(cI);const p=l.morphTargets&&o.morphAttributes.position,g=l.morphNormals&&o.morphAttributes.normal;let m=0;for(let b=0;b<8;b++){const y=i[b],v=y[0],M=y[1];v!==Number.MAX_SAFE_INTEGER&&M?(p&&o.getAttribute("morphTarget"+b)!==p[v]&&o.setAttribute("morphTarget"+b,p[v]),g&&o.getAttribute("morphNormal"+b)!==g[v]&&o.setAttribute("morphNormal"+b,g[v]),t[b]=M,m+=M):(p&&o.hasAttribute("morphTarget"+b)===!0&&o.deleteAttribute("morphTarget"+b),g&&o.hasAttribute("morphNormal"+b)===!0&&o.deleteAttribute("morphNormal"+b),t[b]=0)}const h=o.morphTargetsRelative?1:1-m;u.getUniforms().setValue(n,"morphTargetBaseInfluence",h),u.getUniforms().setValue(n,"morphTargetInfluences",t)}return{update:r}}function hI(n,e,t,i){let r=new WeakMap;function s(u){const c=i.render.frame,f=u.geometry,d=e.get(u,f);return r.get(d)!==c&&(e.update(d),r.set(d,c)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),d}function o(){r=new WeakMap}function l(u){const c=u.target;c.removeEventListener("dispose",l),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class rh extends Mt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=wt,this.minFilter=wt,this.wrapR=Ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}rh.prototype.isDataTexture2DArray=!0;class sh extends Mt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=wt,this.minFilter=wt,this.wrapR=Ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}sh.prototype.isDataTexture3D=!0;const ny=new Mt,fI=new rh,pI=new sh,iy=new Js,ry=[],sy=[],oy=new Float32Array(16),ay=new Float32Array(9),ly=new Float32Array(4);function qs(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=ry[r];if(s===void 0&&(s=new Float32Array(r),ry[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function nn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Qt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function cy(n,e){let t=sy[e];t===void 0&&(t=new Int32Array(e),sy[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function mI(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function gI(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(nn(t,e))return;n.uniform2fv(this.addr,e),Qt(t,e)}}function vI(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(nn(t,e))return;n.uniform3fv(this.addr,e),Qt(t,e)}}function yI(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(nn(t,e))return;n.uniform4fv(this.addr,e),Qt(t,e)}}function bI(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Qt(t,e)}else{if(nn(t,i))return;ly.set(i),n.uniformMatrix2fv(this.addr,!1,ly),Qt(t,i)}}function xI(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Qt(t,e)}else{if(nn(t,i))return;ay.set(i),n.uniformMatrix3fv(this.addr,!1,ay),Qt(t,i)}}function wI(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Qt(t,e)}else{if(nn(t,i))return;oy.set(i),n.uniformMatrix4fv(this.addr,!1,oy),Qt(t,i)}}function MI(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function AI(n,e){const t=this.cache;nn(t,e)||(n.uniform2iv(this.addr,e),Qt(t,e))}function SI(n,e){const t=this.cache;nn(t,e)||(n.uniform3iv(this.addr,e),Qt(t,e))}function _I(n,e){const t=this.cache;nn(t,e)||(n.uniform4iv(this.addr,e),Qt(t,e))}function TI(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function EI(n,e){const t=this.cache;nn(t,e)||(n.uniform2uiv(this.addr,e),Qt(t,e))}function CI(n,e){const t=this.cache;nn(t,e)||(n.uniform3uiv(this.addr,e),Qt(t,e))}function LI(n,e){const t=this.cache;nn(t,e)||(n.uniform4uiv(this.addr,e),Qt(t,e))}function RI(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||ny,r)}function FI(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||pI,r)}function PI(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||iy,r)}function II(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||fI,r)}function OI(n){switch(n){case 5126:return mI;case 35664:return gI;case 35665:return vI;case 35666:return yI;case 35674:return bI;case 35675:return xI;case 35676:return wI;case 5124:case 35670:return MI;case 35667:case 35671:return AI;case 35668:case 35672:return SI;case 35669:case 35673:return _I;case 5125:return TI;case 36294:return EI;case 36295:return CI;case 36296:return LI;case 35678:case 36198:case 36298:case 36306:case 35682:return RI;case 35679:case 36299:case 36307:return FI;case 35680:case 36300:case 36308:case 36293:return PI;case 36289:case 36303:case 36311:case 36292:return II}}function NI(n,e){n.uniform1fv(this.addr,e)}function BI(n,e){const t=qs(e,this.size,2);n.uniform2fv(this.addr,t)}function DI(n,e){const t=qs(e,this.size,3);n.uniform3fv(this.addr,t)}function kI(n,e){const t=qs(e,this.size,4);n.uniform4fv(this.addr,t)}function VI(n,e){const t=qs(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function zI(n,e){const t=qs(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function UI(n,e){const t=qs(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function GI(n,e){n.uniform1iv(this.addr,e)}function HI(n,e){n.uniform2iv(this.addr,e)}function WI(n,e){n.uniform3iv(this.addr,e)}function jI(n,e){n.uniform4iv(this.addr,e)}function $I(n,e){n.uniform1uiv(this.addr,e)}function ZI(n,e){n.uniform2uiv(this.addr,e)}function XI(n,e){n.uniform3uiv(this.addr,e)}function YI(n,e){n.uniform4uiv(this.addr,e)}function JI(n,e,t){const i=e.length,r=cy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTexture2D(e[s]||ny,r[s])}function KI(n,e,t){const i=e.length,r=cy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTextureCube(e[s]||iy,r[s])}function qI(n){switch(n){case 5126:return NI;case 35664:return BI;case 35665:return DI;case 35666:return kI;case 35674:return VI;case 35675:return zI;case 35676:return UI;case 5124:case 35670:return GI;case 35667:case 35671:return HI;case 35668:case 35672:return WI;case 35669:case 35673:return jI;case 5125:return $I;case 36294:return ZI;case 36295:return XI;case 36296:return YI;case 35678:case 36198:case 36298:case 36306:case 35682:return JI;case 35680:case 36300:case 36308:case 36293:return KI}}function QI(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=OI(e.type)}function uy(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=qI(e.type)}uy.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),Qt(e,n)};function dy(n){this.id=n,this.seq=[],this.map={}}dy.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const o=i[r];o.setValue(n,e[o.id],t)}};const oh=/(\w+)(\])?(\[|\.)?/g;function hy(n,e){n.seq.push(e),n.map[e.id]=e}function eO(n,e,t){const i=n.name,r=i.length;for(oh.lastIndex=0;;){const s=oh.exec(i),o=oh.lastIndex;let l=s[1];const u=s[2]==="]",c=s[3];if(u&&(l=l|0),c===void 0||c==="["&&o+2===r){hy(t,c===void 0?new QI(l,n,e):new uy(l,n,e));break}else{let d=t.map[l];d===void 0&&(d=new dy(l),hy(t,d)),t=d}}}function dr(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i),s=n.getUniformLocation(e,r.name);eO(r,s,this)}}dr.prototype.setValue=function(n,e,t,i){const r=this.map[e];r!==void 0&&r.setValue(n,t,i)},dr.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)},dr.upload=function(n,e,t,i){for(let r=0,s=e.length;r!==s;++r){const o=e[r],l=t[o.id];l.needsUpdate!==!1&&o.setValue(n,l.value,i)}},dr.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const s=n[i];s.id in e&&t.push(s)}return t};function fy(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let tO=0;function nO(n){const e=n.split(`
2868
2868
  `);for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(`
2869
2869
  `)}function py(n){switch(n){case tn:return["Linear","( value )"];case kr:return["sRGB","( value )"];case Dl:return["RGBE","( value )"];case Td:return["RGBM","( value, 7.0 )"];case Ed:return["RGBM","( value, 16.0 )"];case Cd:return["RGBD","( value, 256.0 )"];case Bl:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case T0:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function my(n,e,t){const i=n.getShaderParameter(e,35713),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=n.getShaderSource(e);return"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
2870
2870
  `+r+nO(s)}function da(n,e){const t=py(e);return"vec4 "+n+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function iO(n,e){const t=py(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function rO(n,e){let t;switch(e){case Sv:t="Linear";break;case _v:t="Reinhard";break;case Tv:t="OptimizedCineon";break;case Ev:t="ACESFilmic";break;case Cv:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function sO(n){return[n.extensionDerivatives||n.envMapCubeUV||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission>0)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ha).join(`
@@ -2912,7 +2912,7 @@ void main() {
2912
2912
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
2913
2913
  }`,LO=`void main() {
2914
2914
  gl_Position = vec4( position, 1.0 );
2915
- }`;function Sy(n,e,t){let i=new ua;const r=new Ae,s=new Ae,o=new it,l=[],u=[],c={},f=t.maxTextureSize,d={0:xt,1:Ki,2:qi},p=new Oi({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:LO,fragmentShader:CO}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ze(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const h=new St(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=sd,this.render=function(w,C,P){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||w.length===0)return;const R=n.getRenderTarget(),I=n.getActiveCubeFace(),S=n.getActiveMipmapLevel(),T=n.state;T.setBlending(Ai),T.buffers.color.setClear(1,1,1,1),T.buffers.depth.setTest(!0),T.setScissorTest(!1);for(let E=0,L=w.length;E<L;E++){const F=w[E],x=F.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",F,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const O=x.getFrameExtents();if(r.multiply(O),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/O.x),r.x=s.x*O.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/O.y),r.y=s.y*O.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Es){const N={minFilter:gt,magFilter:gt,format:fn};x.map=new Rn(r.x,r.y,N),x.map.texture.name=F.name+".shadowMap",x.mapPass=new Rn(r.x,r.y,N),x.camera.updateProjectionMatrix()}if(x.map===null){const N={minFilter:wt,magFilter:wt,format:fn};x.map=new Rn(r.x,r.y,N),x.map.texture.name=F.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let N=0;N<B;N++){const k=x.getViewport(N);o.set(s.x*k.x,s.y*k.y,s.x*k.z,s.y*k.w),T.viewport(o),x.updateMatrices(F,N),i=x.getFrustum(),_(C,P,x.camera,F,this.type)}!x.isPointLightShadow&&this.type===Es&&y(x,P),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(R,I,S)};function y(w,C){const P=e.update(h);p.uniforms.shadow_pass.value=w.map.texture,p.uniforms.resolution.value=w.mapSize,p.uniforms.radius.value=w.radius,n.setRenderTarget(w.mapPass),n.clear(),n.renderBufferDirect(C,null,P,p,h,null),g.uniforms.shadow_pass.value=w.mapPass.texture,g.uniforms.resolution.value=w.mapSize,g.uniforms.radius.value=w.radius,n.setRenderTarget(w.map),n.clear(),n.renderBufferDirect(C,null,P,g,h,null)}function v(w){const C=w<<0;let P=l[C];return P===void 0&&(P=new ac({depthPacking:C0,morphTargets:w}),l[C]=P),P}function M(w){const C=w<<0;let P=u[C];return P===void 0&&(P=new lc({morphTargets:w}),u[C]=P),P}function A(w,C,P,R,I,S,T){let E=null,L=v,F=w.customDepthMaterial;if(R.isPointLight===!0&&(L=M,F=w.customDistanceMaterial),F===void 0){let x=!1;P.morphTargets===!0&&(x=C.morphAttributes&&C.morphAttributes.position&&C.morphAttributes.position.length>0),E=L(x)}else E=F;if(n.localClippingEnabled&&P.clipShadows===!0&&P.clippingPlanes.length!==0){const x=E.uuid,O=P.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let N=B[O];N===void 0&&(N=E.clone(),B[O]=N),E=N}return E.visible=P.visible,E.wireframe=P.wireframe,T===Es?E.side=P.shadowSide!==null?P.shadowSide:P.side:E.side=P.shadowSide!==null?P.shadowSide:d[P.side],E.clipShadows=P.clipShadows,E.clippingPlanes=P.clippingPlanes,E.clipIntersection=P.clipIntersection,E.wireframeLinewidth=P.wireframeLinewidth,E.linewidth=P.linewidth,R.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(R.matrixWorld),E.nearDistance=I,E.farDistance=S),E}function _(w,C,P,R,I){if(w.visible===!1)return;if(w.layers.test(C.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&I===Es)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,w.matrixWorld);const E=e.update(w),L=w.material;if(Array.isArray(L)){const F=E.groups;for(let x=0,O=F.length;x<O;x++){const B=F[x],N=L[B.materialIndex];if(N&&N.visible){const k=A(w,E,N,R,P.near,P.far,I);n.renderBufferDirect(P,null,E,k,w,B)}}}else if(L.visible){const F=A(w,E,L,R,P.near,P.far,I);n.renderBufferDirect(P,null,E,F,w,null)}}const T=w.children;for(let E=0,L=T.length;E<L;E++)_(T[E],C,P,R,I)}}function RO(n,e,t){const i=t.isWebGL2;function r(){let ne=!1;const de=new it;let ve=null;const Ee=new it(0,0,0,0);return{setMask:function(Se){ve!==Se&&!ne&&(n.colorMask(Se,Se,Se,Se),ve=Se)},setLocked:function(Se){ne=Se},setClear:function(Se,Ie,Je,Ve,st){st===!0&&(Se*=Ve,Ie*=Ve,Je*=Ve),de.set(Se,Ie,Je,Ve),Ee.equals(de)===!1&&(n.clearColor(Se,Ie,Je,Ve),Ee.copy(de))},reset:function(){ne=!1,ve=null,Ee.set(-1,0,0,0)}}}function s(){let ne=!1,de=null,ve=null,Ee=null;return{setTest:function(Se){Se?Z(2929):te(2929)},setMask:function(Se){de!==Se&&!ne&&(n.depthMask(Se),de=Se)},setFunc:function(Se){if(ve!==Se){if(Se)switch(Se){case mv:n.depthFunc(512);break;case gv:n.depthFunc(519);break;case vv:n.depthFunc(513);break;case Ll:n.depthFunc(515);break;case yv:n.depthFunc(514);break;case bv:n.depthFunc(518);break;case xv:n.depthFunc(516);break;case wv:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);ve=Se}},setLocked:function(Se){ne=Se},setClear:function(Se){Ee!==Se&&(n.clearDepth(Se),Ee=Se)},reset:function(){ne=!1,de=null,ve=null,Ee=null}}}function o(){let ne=!1,de=null,ve=null,Ee=null,Se=null,Ie=null,Je=null,Ve=null,st=null;return{setTest:function(Re){ne||(Re?Z(2960):te(2960))},setMask:function(Re){de!==Re&&!ne&&(n.stencilMask(Re),de=Re)},setFunc:function(Re,Ue,We){(ve!==Re||Ee!==Ue||Se!==We)&&(n.stencilFunc(Re,Ue,We),ve=Re,Ee=Ue,Se=We)},setOp:function(Re,Ue,We){(Ie!==Re||Je!==Ue||Ve!==We)&&(n.stencilOp(Re,Ue,We),Ie=Re,Je=Ue,Ve=We)},setLocked:function(Re){ne=Re},setClear:function(Re){st!==Re&&(n.clearStencil(Re),st=Re)},reset:function(){ne=!1,de=null,ve=null,Ee=null,Se=null,Ie=null,Je=null,Ve=null,st=null}}}const l=new r,u=new s,c=new o;let f={},d=null,p={},g=null,m=!1,h=null,b=null,y=null,v=null,M=null,A=null,_=null,w=!1,C=null,P=null,R=null,I=null,S=null;const T=n.getParameter(35661);let E=!1,L=0;const F=n.getParameter(7938);F.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(F)[1]),E=L>=1):F.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),E=L>=2);let x=null,O={};const B=n.getParameter(3088),N=n.getParameter(2978),k=new it().fromArray(B),z=new it().fromArray(N);function G(ne,de,ve){const Ee=new Uint8Array(4),Se=n.createTexture();n.bindTexture(ne,Se),n.texParameteri(ne,10241,9728),n.texParameteri(ne,10240,9728);for(let Ie=0;Ie<ve;Ie++)n.texImage2D(de+Ie,0,6408,1,1,0,6408,5121,Ee);return Se}const Y={};Y[3553]=G(3553,3553,1),Y[34067]=G(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),Z(2929),u.setFunc(Ll),W(!1),oe(rd),Z(2884),re(Ai);function Z(ne){f[ne]!==!0&&(n.enable(ne),f[ne]=!0)}function te(ne){f[ne]!==!1&&(n.disable(ne),f[ne]=!1)}function q(ne){ne!==d&&(n.bindFramebuffer(36160,ne),d=ne)}function j(ne,de){return de===null&&d!==null&&(de=d),p[ne]!==de?(n.bindFramebuffer(ne,de),p[ne]=de,i&&(ne===36009&&(p[36160]=de),ne===36160&&(p[36009]=de)),!0):!1}function $(ne){return g!==ne?(n.useProgram(ne),g=ne,!0):!1}const X={[Fr]:32774,[rv]:32778,[sv]:32779};if(i)X[ud]=32775,X[dd]=32776;else{const ne=e.get("EXT_blend_minmax");ne!==null&&(X[ud]=ne.MIN_EXT,X[dd]=ne.MAX_EXT)}const K={[ov]:0,[av]:1,[lv]:768,[hd]:770,[pv]:776,[hv]:774,[uv]:772,[cv]:769,[fd]:771,[fv]:775,[dv]:773};function re(ne,de,ve,Ee,Se,Ie,Je,Ve){if(ne===Ai){m===!0&&(te(3042),m=!1);return}if(m===!1&&(Z(3042),m=!0),ne!==iv){if(ne!==h||Ve!==w){if((b!==Fr||M!==Fr)&&(n.blendEquation(32774),b=Fr,M=Fr),Ve)switch(ne){case Cs:n.blendFuncSeparate(1,771,1,771);break;case ad:n.blendFunc(1,1);break;case ld:n.blendFuncSeparate(0,0,769,771);break;case cd:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}else switch(ne){case Cs:n.blendFuncSeparate(770,771,1,771);break;case ad:n.blendFunc(770,1);break;case ld:n.blendFunc(0,769);break;case cd:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}y=null,v=null,A=null,_=null,h=ne,w=Ve}return}Se=Se||de,Ie=Ie||ve,Je=Je||Ee,(de!==b||Se!==M)&&(n.blendEquationSeparate(X[de],X[Se]),b=de,M=Se),(ve!==y||Ee!==v||Ie!==A||Je!==_)&&(n.blendFuncSeparate(K[ve],K[Ee],K[Ie],K[Je]),y=ve,v=Ee,A=Ie,_=Je),h=ne,w=null}function V(ne,de){ne.side===qi?te(2884):Z(2884);let ve=ne.side===xt;de&&(ve=!ve),W(ve),ne.blending===Cs&&ne.transparent===!1?re(Ai):re(ne.blending,ne.blendEquation,ne.blendSrc,ne.blendDst,ne.blendEquationAlpha,ne.blendSrcAlpha,ne.blendDstAlpha,ne.premultipliedAlpha),u.setFunc(ne.depthFunc),u.setTest(ne.depthTest),u.setMask(ne.depthWrite),l.setMask(ne.colorWrite);const Ee=ne.stencilWrite;c.setTest(Ee),Ee&&(c.setMask(ne.stencilWriteMask),c.setFunc(ne.stencilFunc,ne.stencilRef,ne.stencilFuncMask),c.setOp(ne.stencilFail,ne.stencilZFail,ne.stencilZPass)),le(ne.polygonOffset,ne.polygonOffsetFactor,ne.polygonOffsetUnits),ne.alphaToCoverage===!0?Z(32926):te(32926)}function W(ne){C!==ne&&(ne?n.frontFace(2304):n.frontFace(2305),C=ne)}function oe(ne){ne!==ev?(Z(2884),ne!==P&&(ne===rd?n.cullFace(1029):ne===tv?n.cullFace(1028):n.cullFace(1032))):te(2884),P=ne}function ae(ne){ne!==R&&(E&&n.lineWidth(ne),R=ne)}function le(ne,de,ve){ne?(Z(32823),(I!==de||S!==ve)&&(n.polygonOffset(de,ve),I=de,S=ve)):te(32823)}function H(ne){ne?Z(3089):te(3089)}function U(ne){ne===void 0&&(ne=33984+T-1),x!==ne&&(n.activeTexture(ne),x=ne)}function D(ne,de){x===null&&U();let ve=O[x];ve===void 0&&(ve={type:void 0,texture:void 0},O[x]=ve),(ve.type!==ne||ve.texture!==de)&&(n.bindTexture(ne,de||Y[ne]),ve.type=ne,ve.texture=de)}function Q(){const ne=O[x];ne!==void 0&&ne.type!==void 0&&(n.bindTexture(ne.type,null),ne.type=void 0,ne.texture=void 0)}function ie(){try{n.compressedTexImage2D.apply(n,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ce(){try{n.texImage2D.apply(n,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ge(){try{n.texImage3D.apply(n,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ye(ne){k.equals(ne)===!1&&(n.scissor(ne.x,ne.y,ne.z,ne.w),k.copy(ne))}function ue(ne){z.equals(ne)===!1&&(n.viewport(ne.x,ne.y,ne.z,ne.w),z.copy(ne))}function be(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},x=null,O={},d=null,p={},g=null,m=!1,h=null,b=null,y=null,v=null,M=null,A=null,_=null,w=!1,C=null,P=null,R=null,I=null,S=null,k.set(0,0,n.canvas.width,n.canvas.height),z.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:Z,disable:te,bindFramebuffer:j,bindXRFramebuffer:q,useProgram:$,setBlending:re,setMaterial:V,setFlipSided:W,setCullFace:oe,setLineWidth:ae,setPolygonOffset:le,setScissorTest:H,activeTexture:U,bindTexture:D,unbindTexture:Q,compressedTexImage2D:ie,texImage2D:ce,texImage3D:ge,scissor:ye,viewport:ue,reset:be}}function FO(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,d=r.maxSamples,p=new WeakMap;let g,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function h(H,U){return m?new OffscreenCanvas(H,U):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(H,U,D,Q){let ie=1;if((H.width>Q||H.height>Q)&&(ie=Q/Math.max(H.width,H.height)),ie<1||U===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const ce=U?P0:Math.floor,ge=ce(ie*H.width),ye=ce(ie*H.height);g===void 0&&(g=h(ge,ye));const ue=D?h(ge,ye):g;return ue.width=ge,ue.height=ye,ue.getContext("2d").drawImage(H,0,0,ge,ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+ge+"x"+ye+")."),ue}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function y(H){return Fd(H.width)&&Fd(H.height)}function v(H){return l?!1:H.wrapS!==Ut||H.wrapT!==Ut||H.minFilter!==wt&&H.minFilter!==gt}function M(H,U){return H.generateMipmaps&&U&&H.minFilter!==wt&&H.minFilter!==gt}function A(H,U,D,Q,ie=1){n.generateMipmap(H);const ce=i.get(U);ce.__maxMipLevel=Math.log2(Math.max(D,Q,ie))}function _(H,U,D){if(l===!1)return U;if(H!==null){if(n[H]!==void 0)return n[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let Q=U;return U===6403&&(D===5126&&(Q=33326),D===5131&&(Q=33325),D===5121&&(Q=33321)),U===6407&&(D===5126&&(Q=34837),D===5131&&(Q=34843),D===5121&&(Q=32849)),U===6408&&(D===5126&&(Q=34836),D===5131&&(Q=34842),D===5121&&(Q=32856)),(Q===33325||Q===33326||Q===34842||Q===34836)&&e.get("EXT_color_buffer_float"),Q}function w(H){return H===wt||H===qo||H===Qo?9728:9729}function C(H){const U=H.target;U.removeEventListener("dispose",C),R(U),U.isVideoTexture&&p.delete(U),o.memory.textures--}function P(H){const U=H.target;U.removeEventListener("dispose",P),I(U)}function R(H){const U=i.get(H);U.__webglInit!==void 0&&(n.deleteTexture(U.__webglTexture),i.remove(H))}function I(H){const U=H.texture,D=i.get(H),Q=i.get(U);if(H){if(Q.__webglTexture!==void 0&&(n.deleteTexture(Q.__webglTexture),o.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let ie=0;ie<6;ie++)n.deleteFramebuffer(D.__webglFramebuffer[ie]),D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer[ie]);else n.deleteFramebuffer(D.__webglFramebuffer),D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer),D.__webglMultisampledFramebuffer&&n.deleteFramebuffer(D.__webglMultisampledFramebuffer),D.__webglColorRenderbuffer&&n.deleteRenderbuffer(D.__webglColorRenderbuffer),D.__webglDepthRenderbuffer&&n.deleteRenderbuffer(D.__webglDepthRenderbuffer);if(H.isWebGLMultipleRenderTargets)for(let ie=0,ce=U.length;ie<ce;ie++){const ge=i.get(U[ie]);ge.__webglTexture&&(n.deleteTexture(ge.__webglTexture),o.memory.textures--),i.remove(U[ie])}i.remove(U),i.remove(H)}}let S=0;function T(){S=0}function E(){const H=S;return H>=u&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+u),S+=1,H}function L(H,U){const D=i.get(H);if(H.isVideoTexture&&V(H),H.version>0&&D.__version!==H.version){const Q=H.image;if(Q===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(D,H,U);return}}t.activeTexture(33984+U),t.bindTexture(3553,D.__webglTexture)}function F(H,U){const D=i.get(H);if(H.version>0&&D.__version!==H.version){G(D,H,U);return}t.activeTexture(33984+U),t.bindTexture(35866,D.__webglTexture)}function x(H,U){const D=i.get(H);if(H.version>0&&D.__version!==H.version){G(D,H,U);return}t.activeTexture(33984+U),t.bindTexture(32879,D.__webglTexture)}function O(H,U){const D=i.get(H);if(H.version>0&&D.__version!==H.version){Y(D,H,U);return}t.activeTexture(33984+U),t.bindTexture(34067,D.__webglTexture)}const B={[er]:10497,[Ut]:33071,[Rs]:33648},N={[wt]:9728,[qo]:9984,[Qo]:9986,[gt]:9729,[Il]:9985,[Si]:9987};function k(H,U,D){if(D?(n.texParameteri(H,10242,B[U.wrapS]),n.texParameteri(H,10243,B[U.wrapT]),(H===32879||H===35866)&&n.texParameteri(H,32882,B[U.wrapR]),n.texParameteri(H,10240,N[U.magFilter]),n.texParameteri(H,10241,N[U.minFilter])):(n.texParameteri(H,10242,33071),n.texParameteri(H,10243,33071),(H===32879||H===35866)&&n.texParameteri(H,32882,33071),(U.wrapS!==Ut||U.wrapT!==Ut)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(H,10240,w(U.magFilter)),n.texParameteri(H,10241,w(U.minFilter)),U.minFilter!==wt&&U.minFilter!==gt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Q=e.get("EXT_texture_filter_anisotropic");if(U.type===_i&&e.has("OES_texture_float_linear")===!1||l===!1&&U.type===Ir&&e.has("OES_texture_half_float_linear")===!1)return;(U.anisotropy>1||i.get(U).__currentAnisotropy)&&(n.texParameterf(H,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy)}}function z(H,U){H.__webglInit===void 0&&(H.__webglInit=!0,U.addEventListener("dispose",C),H.__webglTexture=n.createTexture(),o.memory.textures++)}function G(H,U,D){let Q=3553;U.isDataTexture2DArray&&(Q=35866),U.isDataTexture3D&&(Q=32879),z(H,U),t.activeTexture(33984+D),t.bindTexture(Q,H.__webglTexture),n.pixelStorei(37440,U.flipY),n.pixelStorei(37441,U.premultiplyAlpha),n.pixelStorei(3317,U.unpackAlignment),n.pixelStorei(37443,0);const ie=v(U)&&y(U.image)===!1,ce=b(U.image,ie,!1,f),ge=y(ce)||l,ye=s.convert(U.format);let ue=s.convert(U.type),be=_(U.internalFormat,ye,ue);k(Q,U,ge);let ne;const de=U.mipmaps;if(U.isDepthTexture)be=6402,l?U.type===_i?be=36012:U.type===ta?be=33190:U.type===Fs?be=35056:be=33189:U.type===_i&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),U.format===Or&&be===6402&&U.type!==ea&&U.type!==ta&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),U.type=ea,ue=s.convert(U.type)),U.format===Ps&&be===6402&&(be=34041,U.type!==Fs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),U.type=Fs,ue=s.convert(U.type))),t.texImage2D(3553,0,be,ce.width,ce.height,0,ye,ue,null);else if(U.isDataTexture)if(de.length>0&&ge){for(let ve=0,Ee=de.length;ve<Ee;ve++)ne=de[ve],t.texImage2D(3553,ve,be,ne.width,ne.height,0,ye,ue,ne.data);U.generateMipmaps=!1,H.__maxMipLevel=de.length-1}else t.texImage2D(3553,0,be,ce.width,ce.height,0,ye,ue,ce.data),H.__maxMipLevel=0;else if(U.isCompressedTexture){for(let ve=0,Ee=de.length;ve<Ee;ve++)ne=de[ve],U.format!==fn&&U.format!==Ti?ye!==null?t.compressedTexImage2D(3553,ve,be,ne.width,ne.height,0,ne.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ve,be,ne.width,ne.height,0,ye,ue,ne.data);H.__maxMipLevel=de.length-1}else if(U.isDataTexture2DArray)t.texImage3D(35866,0,be,ce.width,ce.height,ce.depth,0,ye,ue,ce.data),H.__maxMipLevel=0;else if(U.isDataTexture3D)t.texImage3D(32879,0,be,ce.width,ce.height,ce.depth,0,ye,ue,ce.data),H.__maxMipLevel=0;else if(de.length>0&&ge){for(let ve=0,Ee=de.length;ve<Ee;ve++)ne=de[ve],t.texImage2D(3553,ve,be,ye,ue,ne);U.generateMipmaps=!1,H.__maxMipLevel=de.length-1}else t.texImage2D(3553,0,be,ye,ue,ce),H.__maxMipLevel=0;M(U,ge)&&A(Q,U,ce.width,ce.height),H.__version=U.version,U.onUpdate&&U.onUpdate(U)}function Y(H,U,D){if(U.image.length!==6)return;z(H,U),t.activeTexture(33984+D),t.bindTexture(34067,H.__webglTexture),n.pixelStorei(37440,U.flipY),n.pixelStorei(37441,U.premultiplyAlpha),n.pixelStorei(3317,U.unpackAlignment),n.pixelStorei(37443,0);const Q=U&&(U.isCompressedTexture||U.image[0].isCompressedTexture),ie=U.image[0]&&U.image[0].isDataTexture,ce=[];for(let ve=0;ve<6;ve++)!Q&&!ie?ce[ve]=b(U.image[ve],!1,!0,c):ce[ve]=ie?U.image[ve].image:U.image[ve];const ge=ce[0],ye=y(ge)||l,ue=s.convert(U.format),be=s.convert(U.type),ne=_(U.internalFormat,ue,be);k(34067,U,ye);let de;if(Q){for(let ve=0;ve<6;ve++){de=ce[ve].mipmaps;for(let Ee=0;Ee<de.length;Ee++){const Se=de[Ee];U.format!==fn&&U.format!==Ti?ue!==null?t.compressedTexImage2D(34069+ve,Ee,ne,Se.width,Se.height,0,Se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ve,Ee,ne,Se.width,Se.height,0,ue,be,Se.data)}}H.__maxMipLevel=de.length-1}else{de=U.mipmaps;for(let ve=0;ve<6;ve++)if(ie){t.texImage2D(34069+ve,0,ne,ce[ve].width,ce[ve].height,0,ue,be,ce[ve].data);for(let Ee=0;Ee<de.length;Ee++){const Ie=de[Ee].image[ve].image;t.texImage2D(34069+ve,Ee+1,ne,Ie.width,Ie.height,0,ue,be,Ie.data)}}else{t.texImage2D(34069+ve,0,ne,ue,be,ce[ve]);for(let Ee=0;Ee<de.length;Ee++){const Se=de[Ee];t.texImage2D(34069+ve,Ee+1,ne,ue,be,Se.image[ve])}}H.__maxMipLevel=de.length}M(U,ye)&&A(34067,U,ge.width,ge.height),H.__version=U.version,U.onUpdate&&U.onUpdate(U)}function Z(H,U,D,Q,ie){const ce=s.convert(D.format),ge=s.convert(D.type),ye=_(D.internalFormat,ce,ge);ie===32879||ie===35866?t.texImage3D(ie,0,ye,U.width,U.height,U.depth,0,ce,ge,null):t.texImage2D(ie,0,ye,U.width,U.height,0,ce,ge,null),t.bindFramebuffer(36160,H),n.framebufferTexture2D(36160,Q,ie,i.get(D).__webglTexture,0),t.bindFramebuffer(36160,null)}function te(H,U,D){if(n.bindRenderbuffer(36161,H),U.depthBuffer&&!U.stencilBuffer){let Q=33189;if(D){const ie=U.depthTexture;ie&&ie.isDepthTexture&&(ie.type===_i?Q=36012:ie.type===ta&&(Q=33190));const ce=re(U);n.renderbufferStorageMultisample(36161,ce,Q,U.width,U.height)}else n.renderbufferStorage(36161,Q,U.width,U.height);n.framebufferRenderbuffer(36160,36096,36161,H)}else if(U.depthBuffer&&U.stencilBuffer){if(D){const Q=re(U);n.renderbufferStorageMultisample(36161,Q,35056,U.width,U.height)}else n.renderbufferStorage(36161,34041,U.width,U.height);n.framebufferRenderbuffer(36160,33306,36161,H)}else{const Q=U.isWebGLMultipleRenderTargets===!0?U.texture[0]:U.texture,ie=s.convert(Q.format),ce=s.convert(Q.type),ge=_(Q.internalFormat,ie,ce);if(D){const ye=re(U);n.renderbufferStorageMultisample(36161,ye,ge,U.width,U.height)}else n.renderbufferStorage(36161,ge,U.width,U.height)}n.bindRenderbuffer(36161,null)}function q(H,U){if(U&&U.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,H),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(U.depthTexture).__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),L(U.depthTexture,0);const Q=i.get(U.depthTexture).__webglTexture;if(U.depthTexture.format===Or)n.framebufferTexture2D(36160,36096,3553,Q,0);else if(U.depthTexture.format===Ps)n.framebufferTexture2D(36160,33306,3553,Q,0);else throw new Error("Unknown depthTexture format")}function j(H){const U=i.get(H),D=H.isWebGLCubeRenderTarget===!0;if(H.depthTexture){if(D)throw new Error("target.depthTexture not supported in Cube render targets");q(U.__webglFramebuffer,H)}else if(D){U.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)t.bindFramebuffer(36160,U.__webglFramebuffer[Q]),U.__webglDepthbuffer[Q]=n.createRenderbuffer(),te(U.__webglDepthbuffer[Q],H,!1)}else t.bindFramebuffer(36160,U.__webglFramebuffer),U.__webglDepthbuffer=n.createRenderbuffer(),te(U.__webglDepthbuffer,H,!1);t.bindFramebuffer(36160,null)}function $(H){const U=H.texture,D=i.get(H),Q=i.get(U);H.addEventListener("dispose",P),H.isWebGLMultipleRenderTargets!==!0&&(Q.__webglTexture=n.createTexture(),Q.__version=U.version,o.memory.textures++);const ie=H.isWebGLCubeRenderTarget===!0,ce=H.isWebGLMultipleRenderTargets===!0,ge=H.isWebGLMultisampleRenderTarget===!0,ye=U.isDataTexture3D||U.isDataTexture2DArray,ue=y(H)||l;if(l&&U.format===Ti&&(U.type===_i||U.type===Ir)&&(U.format=fn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ie){D.__webglFramebuffer=[];for(let be=0;be<6;be++)D.__webglFramebuffer[be]=n.createFramebuffer()}else if(D.__webglFramebuffer=n.createFramebuffer(),ce)if(r.drawBuffers){const be=H.texture;for(let ne=0,de=be.length;ne<de;ne++){const ve=i.get(be[ne]);ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(ge)if(l){D.__webglMultisampledFramebuffer=n.createFramebuffer(),D.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,D.__webglColorRenderbuffer);const be=s.convert(U.format),ne=s.convert(U.type),de=_(U.internalFormat,be,ne),ve=re(H);n.renderbufferStorageMultisample(36161,ve,de,H.width,H.height),t.bindFramebuffer(36160,D.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,D.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),H.depthBuffer&&(D.__webglDepthRenderbuffer=n.createRenderbuffer(),te(D.__webglDepthRenderbuffer,H,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ie){t.bindTexture(34067,Q.__webglTexture),k(34067,U,ue);for(let be=0;be<6;be++)Z(D.__webglFramebuffer[be],H,U,36064,34069+be);M(U,ue)&&A(34067,U,H.width,H.height),t.bindTexture(34067,null)}else if(ce){const be=H.texture;for(let ne=0,de=be.length;ne<de;ne++){const ve=be[ne],Ee=i.get(ve);t.bindTexture(3553,Ee.__webglTexture),k(3553,ve,ue),Z(D.__webglFramebuffer,H,ve,36064+ne,3553),M(ve,ue)&&A(3553,ve,H.width,H.height)}t.bindTexture(3553,null)}else{let be=3553;ye&&(l?be=U.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(be,Q.__webglTexture),k(be,U,ue),Z(D.__webglFramebuffer,H,U,36064,be),M(U,ue)&&A(be,U,H.width,H.height,H.depth),t.bindTexture(be,null)}H.depthBuffer&&j(H)}function X(H){const U=y(H)||l,D=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let Q=0,ie=D.length;Q<ie;Q++){const ce=D[Q];if(M(ce,U)){const ge=H.isWebGLCubeRenderTarget?34067:3553,ye=i.get(ce).__webglTexture;t.bindTexture(ge,ye),A(ge,ce,H.width,H.height),t.bindTexture(ge,null)}}}function K(H){if(H.isWebGLMultisampleRenderTarget)if(l){const U=H.width,D=H.height;let Q=16384;H.depthBuffer&&(Q|=256),H.stencilBuffer&&(Q|=1024);const ie=i.get(H);t.bindFramebuffer(36008,ie.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ie.__webglFramebuffer),n.blitFramebuffer(0,0,U,D,0,0,U,D,Q,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ie.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function re(H){return l&&H.isWebGLMultisampleRenderTarget?Math.min(d,H.samples):0}function V(H){const U=o.render.frame;p.get(H)!==U&&(p.set(H,U),H.update())}let W=!1,oe=!1;function ae(H,U){H&&H.isWebGLRenderTarget&&(W===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),W=!0),H=H.texture),L(H,U)}function le(H,U){H&&H.isWebGLCubeRenderTarget&&(oe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),oe=!0),H=H.texture),O(H,U)}this.allocateTextureUnit=E,this.resetTextureUnits=T,this.setTexture2D=L,this.setTexture2DArray=F,this.setTexture3D=x,this.setTextureCube=O,this.setupRenderTarget=$,this.updateRenderTargetMipmap=X,this.updateMultisampleRenderTarget=K,this.safeSetTexture2D=ae,this.safeSetTextureCube=le}function _y(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Pr)return 5121;if(s===Pv)return 32819;if(s===Iv)return 32820;if(s===Ov)return 33635;if(s===Lv)return 5120;if(s===Rv)return 5122;if(s===ea)return 5123;if(s===Fv)return 5124;if(s===ta)return 5125;if(s===_i)return 5126;if(s===Ir)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===Nv)return 6406;if(s===Ti)return 6407;if(s===fn)return 6408;if(s===Bv)return 6409;if(s===Dv)return 6410;if(s===Or)return 6402;if(s===Ps)return 34041;if(s===Vv)return 6403;if(s===zv)return 36244;if(s===Uv)return 33319;if(s===Gv)return 33320;if(s===Hv)return 36248;if(s===Wv)return 36249;if(s===pd||s===md||s===gd||s===vd)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===pd)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===md)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===gd)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===vd)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===yd||s===bd||s===xd||s===wd)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===yd)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===bd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===xd)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===wd)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===jv)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===Md||s===Ad)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===Md)return o.COMPRESSED_RGB8_ETC2;if(s===Ad)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===$v||s===Zv||s===Xv||s===Yv||s===Jv||s===Kv||s===qv||s===Qv||s===e0||s===t0||s===n0||s===i0||s===r0||s===s0||s===a0||s===l0||s===c0||s===u0||s===d0||s===h0||s===f0||s===p0||s===m0||s===g0||s===v0||s===y0||s===b0||s===x0)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===o0)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Fs)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class lh extends kt{constructor(e=[]){super(),this.cameras=e}}lh.prototype.isArrayCamera=!0;class qn extends Xe{constructor(){super(),this.type="Group"}}qn.prototype.isGroup=!0;const PO={type:"move"};class ch{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qn,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 qn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ee,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ee),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ee,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ee),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}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 l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(PO))),c&&e.hand){o=!0;for(const h of e.hand.values()){const b=t.getJointPose(h,i);if(c.joints[h.jointName]===void 0){const v=new qn;v.matrixAutoUpdate=!1,v.visible=!1,c.joints[h.jointName]=v,c.add(v)}const y=c.joints[h.jointName];b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.jointRadius=b.radius),y.visible=b!==null}const f=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],p=f.position.distanceTo(d.position),g=.02,m=.005;c.inputState.pinching&&p>g+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=g-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class IO extends nr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,d=null,p=null;const g=[],m=new Map,h=new kt;h.layers.enable(1),h.viewport=new it;const b=new kt;b.layers.enable(2),b.viewport=new it;const y=[h,b],v=new lh;v.layers.enable(1),v.layers.enable(2);let M=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let x=g[F];return x===void 0&&(x=new ch,g[F]=x),x.getTargetRaySpace()},this.getControllerGrip=function(F){let x=g[F];return x===void 0&&(x=new ch,g[F]=x),x.getGripSpace()},this.getHand=function(F){let x=g[F];return x===void 0&&(x=new ch,g[F]=x),x.getHandSpace()};function _(F){const x=m.get(F.inputSource);x&&x.dispatchEvent({type:F.type,data:F.inputSource})}function w(){m.forEach(function(F,x){F.disconnect(x)}),m.clear(),M=null,A=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(F){o=F,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){u=F,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(F){if(s=F,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",w),s.addEventListener("inputsourceschange",C);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const O={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,O);s.updateRenderState({baseLayer:B})}else{let O=0;x.depth&&(O=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:O,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),d=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function C(F){const x=s.inputSources;for(let O=0;O<g.length;O++)m.set(x[O],g[O]);for(let O=0;O<F.removed.length;O++){const B=F.removed[O],N=m.get(B);N&&(N.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let O=0;O<F.added.length;O++){const B=F.added[O],N=m.get(B);N&&N.dispatchEvent({type:"connected",data:B})}}const P=new ee,R=new ee;function I(F,x,O){P.setFromMatrixPosition(x.matrixWorld),R.setFromMatrixPosition(O.matrixWorld);const B=P.distanceTo(R),N=x.projectionMatrix.elements,k=O.projectionMatrix.elements,z=N[14]/(N[10]-1),G=N[14]/(N[10]+1),Y=(N[9]+1)/N[5],Z=(N[9]-1)/N[5],te=(N[8]-1)/N[0],q=(k[8]+1)/k[0],j=z*te,$=z*q,X=B/(-te+q),K=X*-te;x.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(K),F.translateZ(X),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert();const re=z+X,V=G+X,W=j-K,oe=$+(B-K),ae=Y*G/V*re,le=Z*G/V*re;F.projectionMatrix.makePerspective(W,oe,ae,le,re,V)}function S(F,x){x===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(x.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(s===null)return;v.near=b.near=h.near=F.near,v.far=b.far=h.far=F.far,(M!==v.near||A!==v.far)&&(s.updateRenderState({depthNear:v.near,depthFar:v.far}),M=v.near,A=v.far);const x=F.parent,O=v.cameras;S(v,x);for(let N=0;N<O.length;N++)S(O[N],x);v.matrixWorld.decompose(v.position,v.quaternion,v.scale),F.position.copy(v.position),F.quaternion.copy(v.quaternion),F.scale.copy(v.scale),F.matrix.copy(v.matrix),F.matrixWorld.copy(v.matrixWorld);const B=F.children;for(let N=0,k=B.length;N<k;N++)B[N].updateMatrixWorld(!0);O.length===2?I(v,h,b):v.projectionMatrix.copy(h.projectionMatrix)},this.getCamera=function(){return v};let T=null;function E(F,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,N=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(N.framebuffer);let k=!1;B.length!==v.cameras.length&&(v.cameras.length=0,k=!0);for(let z=0;z<B.length;z++){const G=B[z];let Y=null;if(s.renderState.layers===void 0)Y=N.getViewport(G);else{const te=f.getViewSubImage(p,G);r.bindXRFramebuffer(d),t.framebufferTexture2D(36160,36064,3553,te.colorTexture,0),te.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,te.depthStencilTexture,0),Y=te.viewport}const Z=y[z];Z.matrix.fromArray(G.transform.matrix),Z.projectionMatrix.fromArray(G.projectionMatrix),Z.viewport.set(Y.x,Y.y,Y.width,Y.height),z===0&&v.matrix.copy(Z.matrix),k===!0&&v.cameras.push(Z)}}const O=s.inputSources;for(let B=0;B<g.length;B++){const N=g[B],k=O[B];N.update(k,x,l)}T&&T(F,x)}const L=new ty;L.setAnimationLoop(E),this.setAnimationLoop=function(F){T=F},this.dispose=function(){}}}function OO(n){function e(y,v){y.fogColor.value.copy(v.color),v.isFog?(y.fogNear.value=v.near,y.fogFar.value=v.far):v.isFogExp2&&(y.fogDensity.value=v.density)}function t(y,v,M,A,_){v.isMeshBasicMaterial?i(y,v):v.isMeshLambertMaterial?(i(y,v),u(y,v)):v.isMeshToonMaterial?(i(y,v),f(y,v)):v.isMeshPhongMaterial?(i(y,v),c(y,v)):v.isMeshStandardMaterial?(i(y,v),v.isMeshPhysicalMaterial?p(y,v,_):d(y,v)):v.isMeshMatcapMaterial?(i(y,v),g(y,v)):v.isMeshDepthMaterial?(i(y,v),m(y,v)):v.isMeshDistanceMaterial?(i(y,v),h(y,v)):v.isMeshNormalMaterial?(i(y,v),b(y,v)):v.isLineBasicMaterial?(r(y,v),v.isLineDashedMaterial&&s(y,v)):v.isPointsMaterial?o(y,v,M,A):v.isSpriteMaterial?l(y,v):v.isShadowMaterial?(y.color.value.copy(v.color),y.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function i(y,v){y.opacity.value=v.opacity,v.color&&y.diffuse.value.copy(v.color),v.emissive&&y.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(y.map.value=v.map),v.alphaMap&&(y.alphaMap.value=v.alphaMap),v.specularMap&&(y.specularMap.value=v.specularMap);const M=n.get(v).envMap;if(M){y.envMap.value=M,y.flipEnvMap.value=M.isCubeTexture&&M._needsFlipEnvMap?-1:1,y.reflectivity.value=v.reflectivity,y.refractionRatio.value=v.refractionRatio;const w=n.get(M).__maxMipLevel;w!==void 0&&(y.maxMipLevel.value=w)}v.lightMap&&(y.lightMap.value=v.lightMap,y.lightMapIntensity.value=v.lightMapIntensity),v.aoMap&&(y.aoMap.value=v.aoMap,y.aoMapIntensity.value=v.aoMapIntensity);let A;v.map?A=v.map:v.specularMap?A=v.specularMap:v.displacementMap?A=v.displacementMap:v.normalMap?A=v.normalMap:v.bumpMap?A=v.bumpMap:v.roughnessMap?A=v.roughnessMap:v.metalnessMap?A=v.metalnessMap:v.alphaMap?A=v.alphaMap:v.emissiveMap?A=v.emissiveMap:v.clearcoatMap?A=v.clearcoatMap:v.clearcoatNormalMap?A=v.clearcoatNormalMap:v.clearcoatRoughnessMap&&(A=v.clearcoatRoughnessMap),A!==void 0&&(A.isWebGLRenderTarget&&(A=A.texture),A.matrixAutoUpdate===!0&&A.updateMatrix(),y.uvTransform.value.copy(A.matrix));let _;v.aoMap?_=v.aoMap:v.lightMap&&(_=v.lightMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uv2Transform.value.copy(_.matrix))}function r(y,v){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity}function s(y,v){y.dashSize.value=v.dashSize,y.totalSize.value=v.dashSize+v.gapSize,y.scale.value=v.scale}function o(y,v,M,A){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,y.size.value=v.size*M,y.scale.value=A*.5,v.map&&(y.map.value=v.map),v.alphaMap&&(y.alphaMap.value=v.alphaMap);let _;v.map?_=v.map:v.alphaMap&&(_=v.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uvTransform.value.copy(_.matrix))}function l(y,v){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,y.rotation.value=v.rotation,v.map&&(y.map.value=v.map),v.alphaMap&&(y.alphaMap.value=v.alphaMap);let M;v.map?M=v.map:v.alphaMap&&(M=v.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),y.uvTransform.value.copy(M.matrix))}function u(y,v){v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap)}function c(y,v){y.specular.value.copy(v.specular),y.shininess.value=Math.max(v.shininess,1e-4),v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function f(y,v){v.gradientMap&&(y.gradientMap.value=v.gradientMap),v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function d(y,v){y.roughness.value=v.roughness,y.metalness.value=v.metalness,v.roughnessMap&&(y.roughnessMap.value=v.roughnessMap),v.metalnessMap&&(y.metalnessMap.value=v.metalnessMap),v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias),n.get(v).envMap&&(y.envMapIntensity.value=v.envMapIntensity)}function p(y,v,M){d(y,v),y.reflectivity.value=v.reflectivity,y.clearcoat.value=v.clearcoat,y.clearcoatRoughness.value=v.clearcoatRoughness,v.sheen&&y.sheen.value.copy(v.sheen),v.clearcoatMap&&(y.clearcoatMap.value=v.clearcoatMap),v.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap),v.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),y.clearcoatNormalMap.value=v.clearcoatNormalMap,v.side===xt&&y.clearcoatNormalScale.value.negate()),y.transmission.value=v.transmission,v.transmissionMap&&(y.transmissionMap.value=v.transmissionMap),v.transmission>0&&(y.transmissionSamplerMap.value=M.texture,y.transmissionSamplerSize.value.set(M.width,M.height)),y.thickness.value=v.thickness,v.thicknessMap&&(y.thicknessMap.value=v.thicknessMap),y.attenuationDistance.value=v.attenuationDistance,y.attenuationColor.value.copy(v.attenuationColor)}function g(y,v){v.matcap&&(y.matcap.value=v.matcap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function m(y,v){v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function h(y,v){v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias),y.referencePosition.value.copy(v.referencePosition),y.nearDistance.value=v.nearDistance,y.farDistance.value=v.farDistance}function b(y,v){v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function NO(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:NO(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let d=null,p=null;const g=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=tn,this.physicallyCorrectLights=!1,this.toneMapping=Qi,this.toneMappingExposure=1;const h=this;let b=!1,y=0,v=0,M=null,A=-1,_=null;const w=new it,C=new it;let P=null,R=e.width,I=e.height,S=1,T=null,E=null;const L=new it(0,0,R,I),F=new it(0,0,R,I);let x=!1;const O=[],B=new ua;let N=!1,k=!1,z=null;const G=new Oe,Y=new ee,Z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function te(){return M===null?S:1}let q=t;function j(J,pe){for(let fe=0;fe<J.length;fe++){const me=J[fe],Me=e.getContext(me,pe);if(Me!==null)return Me}return null}try{const J={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",Ie,!1),e.addEventListener("webglcontextrestored",Je,!1),q===null){const pe=["webgl2","webgl","experimental-webgl"];if(h.isWebGL1Renderer===!0&&pe.shift(),q=j(pe,J),q===null)throw j(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}q.getShaderPrecisionFormat===void 0&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(J){throw console.error("THREE.WebGLRenderer: "+J.message),J}let $,X,K,re,V,W,oe,ae,le,H,U,D,Q,ie,ce,ge,ye,ue,be,ne,de,ve;function Ee(){$=new sI(q),X=new nI(q,$,n),$.init(X),de=new _y(q,$,X),K=new RO(q,$,X),O[0]=1029,re=new lI,V=new bO,W=new FO(q,$,K,V,X,de,re),oe=new rI(h),ae=new F3(q,X),ve=new eI(q,$,ae,X),le=new oI(q,ae,re,ve),H=new hI(q,le,ae,re),ue=new dI(q),ce=new iI(V),U=new yO(h,oe,$,X,ve,ce),D=new OO(V),Q=new wO(V),ie=new EO($,X),ye=new QP(h,oe,K,H,l),ge=new Sy(h,H,X),be=new tI(q,$,re,X),ne=new aI(q,$,re,X),re.programs=U.programs,h.capabilities=X,h.extensions=$,h.properties=V,h.renderLists=Q,h.shadowMap=ge,h.state=K,h.info=re}Ee();const Se=new IO(h,q);this.xr=Se,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){const J=$.get("WEBGL_lose_context");J&&J.loseContext()},this.forceContextRestore=function(){const J=$.get("WEBGL_lose_context");J&&J.restoreContext()},this.getPixelRatio=function(){return S},this.setPixelRatio=function(J){J!==void 0&&(S=J,this.setSize(R,I,!1))},this.getSize=function(J){return J.set(R,I)},this.setSize=function(J,pe,fe){if(Se.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}R=J,I=pe,e.width=Math.floor(J*S),e.height=Math.floor(pe*S),fe!==!1&&(e.style.width=J+"px",e.style.height=pe+"px"),this.setViewport(0,0,J,pe)},this.getDrawingBufferSize=function(J){return J.set(R*S,I*S).floor()},this.setDrawingBufferSize=function(J,pe,fe){R=J,I=pe,S=fe,e.width=Math.floor(J*fe),e.height=Math.floor(pe*fe),this.setViewport(0,0,J,pe)},this.getCurrentViewport=function(J){return J.copy(w)},this.getViewport=function(J){return J.copy(L)},this.setViewport=function(J,pe,fe,me){J.isVector4?L.set(J.x,J.y,J.z,J.w):L.set(J,pe,fe,me),K.viewport(w.copy(L).multiplyScalar(S).floor())},this.getScissor=function(J){return J.copy(F)},this.setScissor=function(J,pe,fe,me){J.isVector4?F.set(J.x,J.y,J.z,J.w):F.set(J,pe,fe,me),K.scissor(C.copy(F).multiplyScalar(S).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(J){K.setScissorTest(x=J)},this.setOpaqueSort=function(J){T=J},this.setTransparentSort=function(J){E=J},this.getClearColor=function(J){return J.copy(ye.getClearColor())},this.setClearColor=function(){ye.setClearColor.apply(ye,arguments)},this.getClearAlpha=function(){return ye.getClearAlpha()},this.setClearAlpha=function(){ye.setClearAlpha.apply(ye,arguments)},this.clear=function(J,pe,fe){let me=0;(J===void 0||J)&&(me|=16384),(pe===void 0||pe)&&(me|=256),(fe===void 0||fe)&&(me|=1024),q.clear(me)},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(){e.removeEventListener("webglcontextlost",Ie,!1),e.removeEventListener("webglcontextrestored",Je,!1),Q.dispose(),ie.dispose(),V.dispose(),oe.dispose(),H.dispose(),ve.dispose(),Se.dispose(),Se.removeEventListener("sessionstart",It),Se.removeEventListener("sessionend",pt),z&&(z.dispose(),z=null),yt.stop()};function Ie(J){J.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Je(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const J=re.autoReset,pe=ge.enabled,fe=ge.autoUpdate,me=ge.needsUpdate,Me=ge.type;Ee(),re.autoReset=J,ge.enabled=pe,ge.autoUpdate=fe,ge.needsUpdate=me,ge.type=Me}function Ve(J){const pe=J.target;pe.removeEventListener("dispose",Ve),st(pe)}function st(J){Re(J),V.remove(J)}function Re(J){const pe=V.get(J).programs;pe!==void 0&&pe.forEach(function(fe){U.releaseProgram(fe)})}function Ue(J,pe){J.render(function(fe){h.renderBufferImmediate(fe,pe)})}this.renderBufferImmediate=function(J,pe){ve.initAttributes();const fe=V.get(J);J.hasPositions&&!fe.position&&(fe.position=q.createBuffer()),J.hasNormals&&!fe.normal&&(fe.normal=q.createBuffer()),J.hasUvs&&!fe.uv&&(fe.uv=q.createBuffer()),J.hasColors&&!fe.color&&(fe.color=q.createBuffer());const me=pe.getAttributes();J.hasPositions&&(q.bindBuffer(34962,fe.position),q.bufferData(34962,J.positionArray,35048),ve.enableAttribute(me.position),q.vertexAttribPointer(me.position,3,5126,!1,0,0)),J.hasNormals&&(q.bindBuffer(34962,fe.normal),q.bufferData(34962,J.normalArray,35048),ve.enableAttribute(me.normal),q.vertexAttribPointer(me.normal,3,5126,!1,0,0)),J.hasUvs&&(q.bindBuffer(34962,fe.uv),q.bufferData(34962,J.uvArray,35048),ve.enableAttribute(me.uv),q.vertexAttribPointer(me.uv,2,5126,!1,0,0)),J.hasColors&&(q.bindBuffer(34962,fe.color),q.bufferData(34962,J.colorArray,35048),ve.enableAttribute(me.color),q.vertexAttribPointer(me.color,3,5126,!1,0,0)),ve.disableUnusedAttributes(),q.drawArrays(4,0,J.count),J.count=0},this.renderBufferDirect=function(J,pe,fe,me,Me,he){pe===null&&(pe=Z);const xe=Me.isMesh&&Me.matrixWorld.determinant()<0,_e=we(J,pe,me,Me);K.setMaterial(me,xe);let Fe=fe.index;const Ne=fe.attributes.position;if(Fe===null){if(Ne===void 0||Ne.count===0)return}else if(Fe.count===0)return;let je=1;me.wireframe===!0&&(Fe=le.getWireframeAttribute(fe),je=2),(me.morphTargets||me.morphNormals)&&ue.update(Me,fe,me,_e),ve.setup(Me,me,_e,fe,Fe);let ze,qe=be;Fe!==null&&(ze=ae.get(Fe),qe=ne,qe.setIndex(ze));const Lt=Fe!==null?Fe.count:Ne.count,Ht=fe.drawRange.start*je,ls=fe.drawRange.count*je,ut=he!==null?he.start*je:0,cs=he!==null?he.count*je:1/0,en=Math.max(Ht,ut),qk=Math.min(Lt,Ht+ls,ut+cs)-1,Kc=Math.max(0,qk-en+1);if(Kc!==0){if(Me.isMesh)me.wireframe===!0?(K.setLineWidth(me.wireframeLinewidth*te()),qe.setMode(1)):qe.setMode(4);else if(Me.isLine){let Wa=me.linewidth;Wa===void 0&&(Wa=1),K.setLineWidth(Wa*te()),Me.isLineSegments?qe.setMode(1):Me.isLineLoop?qe.setMode(2):qe.setMode(3)}else Me.isPoints?qe.setMode(0):Me.isSprite&&qe.setMode(4);if(Me.isInstancedMesh)qe.renderInstances(en,Kc,Me.count);else if(fe.isInstancedBufferGeometry){const Wa=Math.min(fe.instanceCount,fe._maxInstanceCount);qe.renderInstances(en,Kc,Wa)}else qe.render(en,Kc)}},this.compile=function(J,pe){p=ie.get(J),p.init(),J.traverseVisible(function(fe){fe.isLight&&fe.layers.test(pe.layers)&&(p.pushLight(fe),fe.castShadow&&p.pushShadow(fe))}),p.setupLights(),J.traverse(function(fe){const me=fe.material;if(me)if(Array.isArray(me))for(let Me=0;Me<me.length;Me++){const he=me[Me];as(he,J,fe)}else as(me,J,fe)})};let We=null;function Pt(J){We&&We(J)}function It(){yt.stop()}function pt(){yt.start()}const yt=new ty;yt.setAnimationLoop(Pt),typeof window<"u"&&yt.setContext(window),this.setAnimationLoop=function(J){We=J,Se.setAnimationLoop(J),J===null?yt.stop():yt.start()},Se.addEventListener("sessionstart",It),Se.addEventListener("sessionend",pt),this.render=function(J,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;J.autoUpdate===!0&&J.updateMatrixWorld(),pe.parent===null&&pe.updateMatrixWorld(),Se.enabled===!0&&Se.isPresenting===!0&&(Se.cameraAutoUpdate===!0&&Se.updateCamera(pe),pe=Se.getCamera()),J.isScene===!0&&J.onBeforeRender(h,J,pe,M),p=ie.get(J,m.length),p.init(),m.push(p),G.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),B.setFromProjectionMatrix(G),k=this.localClippingEnabled,N=ce.init(this.clippingPlanes,k,pe),d=Q.get(J,g.length),d.init(),g.push(d),oi(J,pe,0,h.sortObjects),d.finish(),h.sortObjects===!0&&d.sort(T,E),N===!0&&ce.beginShadows();const fe=p.state.shadowsArray;ge.render(fe,J,pe),p.setupLights(),p.setupLightsView(pe),N===!0&&ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(d,J);const me=d.opaque,Me=d.transmissive,he=d.transparent;me.length>0&&ai(me,J,pe),Me.length>0&&ki(me,Me,J,pe),he.length>0&&ai(he,J,pe),M!==null&&(W.updateMultisampleRenderTarget(M),W.updateRenderTargetMipmap(M)),J.isScene===!0&&J.onAfterRender(h,J,pe),K.buffers.depth.setTest(!0),K.buffers.depth.setMask(!0),K.buffers.color.setMask(!0),K.setPolygonOffset(!1),ve.resetDefaultState(),A=-1,_=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,g.pop(),g.length>0?d=g[g.length-1]:d=null};function oi(J,pe,fe,me){if(J.visible===!1)return;if(J.layers.test(pe.layers)){if(J.isGroup)fe=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(pe);else if(J.isLight)p.pushLight(J),J.castShadow&&p.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||B.intersectsSprite(J)){me&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G);const xe=H.update(J),_e=J.material;_e.visible&&d.push(J,xe,_e,fe,Y.z,null)}}else if(J.isImmediateRenderObject)me&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G),d.push(J,null,J.material,fe,Y.z,null);else if((J.isMesh||J.isLine||J.isPoints)&&(J.isSkinnedMesh&&J.skeleton.frame!==re.render.frame&&(J.skeleton.update(),J.skeleton.frame=re.render.frame),!J.frustumCulled||B.intersectsObject(J))){me&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G);const xe=H.update(J),_e=J.material;if(Array.isArray(_e)){const Fe=xe.groups;for(let Ne=0,je=Fe.length;Ne<je;Ne++){const ze=Fe[Ne],qe=_e[ze.materialIndex];qe&&qe.visible&&d.push(J,xe,qe,fe,Y.z,ze)}}else _e.visible&&d.push(J,xe,_e,fe,Y.z,null)}}const he=J.children;for(let xe=0,_e=he.length;xe<_e;xe++)oi(he[xe],pe,fe,me)}function ki(J,pe,fe,me){if(z===null){const _e=o===!0&&X.isWebGL2===!0?Od:Rn;z=new _e(1024,1024,{generateMipmaps:!0,type:de.convert(Ir)!==null?Ir:Pr,minFilter:Si,magFilter:wt,wrapS:Ut,wrapT:Ut})}const Me=h.getRenderTarget();h.setRenderTarget(z),h.clear();const he=h.toneMapping;h.toneMapping=Qi,ai(J,fe,me),h.toneMapping=he,W.updateMultisampleRenderTarget(z),W.updateRenderTargetMipmap(z),h.setRenderTarget(Me),ai(pe,fe,me)}function ai(J,pe,fe){const me=pe.isScene===!0?pe.overrideMaterial:null;for(let Me=0,he=J.length;Me<he;Me++){const xe=J[Me],_e=xe.object,Fe=xe.geometry,Ne=me===null?xe.material:me,je=xe.group;if(fe.isArrayCamera){const ze=fe.cameras;for(let qe=0,Lt=ze.length;qe<Lt;qe++){const Ht=ze[qe];_e.layers.test(Ht.layers)&&(K.viewport(w.copy(Ht.viewport)),p.setupLightsView(Ht),wr(_e,pe,Ht,Fe,Ne,je))}}else wr(_e,pe,fe,Fe,Ne,je)}}function wr(J,pe,fe,me,Me,he){if(J.onBeforeRender(h,pe,fe,me,Me,he),J.modelViewMatrix.multiplyMatrices(fe.matrixWorldInverse,J.matrixWorld),J.normalMatrix.getNormalMatrix(J.modelViewMatrix),J.isImmediateRenderObject){const xe=we(fe,pe,Me,J);K.setMaterial(Me),ve.reset(),Ue(J,xe)}else Me.transparent===!0&&Me.side===qi?(Me.side=xt,Me.needsUpdate=!0,h.renderBufferDirect(fe,pe,me,Me,J,he),Me.side=Ki,Me.needsUpdate=!0,h.renderBufferDirect(fe,pe,me,Me,J,he),Me.side=qi):h.renderBufferDirect(fe,pe,me,Me,J,he);J.onAfterRender(h,pe,fe,me,Me,he)}function as(J,pe,fe){pe.isScene!==!0&&(pe=Z);const me=V.get(J),Me=p.state.lights,he=p.state.shadowsArray,xe=Me.state.version,_e=U.getParameters(J,Me.state,he,pe,fe),Fe=U.getProgramCacheKey(_e);let Ne=me.programs;me.environment=J.isMeshStandardMaterial?pe.environment:null,me.fog=pe.fog,me.envMap=oe.get(J.envMap||me.environment),Ne===void 0&&(J.addEventListener("dispose",Ve),Ne=new Map,me.programs=Ne);let je=Ne.get(Fe);if(je!==void 0){if(me.currentProgram===je&&me.lightsStateVersion===xe)return se(J,_e),je}else _e.uniforms=U.getUniforms(J),J.onBuild(_e,h),J.onBeforeCompile(_e,h),je=U.acquireProgram(_e,Fe),Ne.set(Fe,je),me.uniforms=_e.uniforms;const ze=me.uniforms;(!J.isShaderMaterial&&!J.isRawShaderMaterial||J.clipping===!0)&&(ze.clippingPlanes=ce.uniform),se(J,_e),me.needsLights=De(J),me.lightsStateVersion=xe,me.needsLights&&(ze.ambientLightColor.value=Me.state.ambient,ze.lightProbe.value=Me.state.probe,ze.directionalLights.value=Me.state.directional,ze.directionalLightShadows.value=Me.state.directionalShadow,ze.spotLights.value=Me.state.spot,ze.spotLightShadows.value=Me.state.spotShadow,ze.rectAreaLights.value=Me.state.rectArea,ze.ltc_1.value=Me.state.rectAreaLTC1,ze.ltc_2.value=Me.state.rectAreaLTC2,ze.pointLights.value=Me.state.point,ze.pointLightShadows.value=Me.state.pointShadow,ze.hemisphereLights.value=Me.state.hemi,ze.directionalShadowMap.value=Me.state.directionalShadowMap,ze.directionalShadowMatrix.value=Me.state.directionalShadowMatrix,ze.spotShadowMap.value=Me.state.spotShadowMap,ze.spotShadowMatrix.value=Me.state.spotShadowMatrix,ze.pointShadowMap.value=Me.state.pointShadowMap,ze.pointShadowMatrix.value=Me.state.pointShadowMatrix);const qe=je.getUniforms(),Lt=dr.seqWithValue(qe.seq,ze);return me.currentProgram=je,me.uniformsList=Lt,je}function se(J,pe){const fe=V.get(J);fe.outputEncoding=pe.outputEncoding,fe.instancing=pe.instancing,fe.skinning=pe.skinning,fe.numClippingPlanes=pe.numClippingPlanes,fe.numIntersection=pe.numClipIntersection,fe.vertexAlphas=pe.vertexAlphas}function we(J,pe,fe,me){pe.isScene!==!0&&(pe=Z),W.resetTextureUnits();const Me=pe.fog,he=fe.isMeshStandardMaterial?pe.environment:null,xe=M===null?h.outputEncoding:M.texture.encoding,_e=oe.get(fe.envMap||he),Fe=fe.vertexColors===!0&&me.geometry&&me.geometry.attributes.color&&me.geometry.attributes.color.itemSize===4,Ne=V.get(fe),je=p.state.lights;if(N===!0&&(k===!0||J!==_)){const en=J===_&&fe.id===A;ce.setState(fe,J,en)}let ze=!1;fe.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==je.state.version||Ne.outputEncoding!==xe||me.isInstancedMesh&&Ne.instancing===!1||!me.isInstancedMesh&&Ne.instancing===!0||me.isSkinnedMesh&&Ne.skinning===!1||!me.isSkinnedMesh&&Ne.skinning===!0||Ne.envMap!==_e||fe.fog&&Ne.fog!==Me||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==ce.numPlanes||Ne.numIntersection!==ce.numIntersection)||Ne.vertexAlphas!==Fe)&&(ze=!0):(ze=!0,Ne.__version=fe.version);let qe=Ne.currentProgram;ze===!0&&(qe=as(fe,pe,me));let Lt=!1,Ht=!1,ls=!1;const ut=qe.getUniforms(),cs=Ne.uniforms;if(K.useProgram(qe.program)&&(Lt=!0,Ht=!0,ls=!0),fe.id!==A&&(A=fe.id,Ht=!0),Lt||_!==J){if(ut.setValue(q,"projectionMatrix",J.projectionMatrix),X.logarithmicDepthBuffer&&ut.setValue(q,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),_!==J&&(_=J,Ht=!0,ls=!0),fe.isShaderMaterial||fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshStandardMaterial||fe.envMap){const en=ut.map.cameraPosition;en!==void 0&&en.setValue(q,Y.setFromMatrixPosition(J.matrixWorld))}(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&ut.setValue(q,"isOrthographic",J.isOrthographicCamera===!0),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial||fe.isShadowMaterial||me.isSkinnedMesh)&&ut.setValue(q,"viewMatrix",J.matrixWorldInverse)}if(me.isSkinnedMesh){ut.setOptional(q,me,"bindMatrix"),ut.setOptional(q,me,"bindMatrixInverse");const en=me.skeleton;en&&(X.floatVertexTextures?(en.boneTexture===null&&en.computeBoneTexture(),ut.setValue(q,"boneTexture",en.boneTexture,W),ut.setValue(q,"boneTextureSize",en.boneTextureSize)):ut.setOptional(q,en,"boneMatrices"))}return(Ht||Ne.receiveShadow!==me.receiveShadow)&&(Ne.receiveShadow=me.receiveShadow,ut.setValue(q,"receiveShadow",me.receiveShadow)),Ht&&(ut.setValue(q,"toneMappingExposure",h.toneMappingExposure),Ne.needsLights&&Te(cs,ls),Me&&fe.fog&&D.refreshFogUniforms(cs,Me),D.refreshMaterialUniforms(cs,fe,S,I,z),dr.upload(q,Ne.uniformsList,cs,W)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(dr.upload(q,Ne.uniformsList,cs,W),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&ut.setValue(q,"center",me.center),ut.setValue(q,"modelViewMatrix",me.modelViewMatrix),ut.setValue(q,"normalMatrix",me.normalMatrix),ut.setValue(q,"modelMatrix",me.matrixWorld),qe}function Te(J,pe){J.ambientLightColor.needsUpdate=pe,J.lightProbe.needsUpdate=pe,J.directionalLights.needsUpdate=pe,J.directionalLightShadows.needsUpdate=pe,J.pointLights.needsUpdate=pe,J.pointLightShadows.needsUpdate=pe,J.spotLights.needsUpdate=pe,J.spotLightShadows.needsUpdate=pe,J.rectAreaLights.needsUpdate=pe,J.hemisphereLights.needsUpdate=pe}function De(J){return J.isMeshLambertMaterial||J.isMeshToonMaterial||J.isMeshPhongMaterial||J.isMeshStandardMaterial||J.isShadowMaterial||J.isShaderMaterial&&J.lights===!0}this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return M},this.setRenderTarget=function(J,pe=0,fe=0){M=J,y=pe,v=fe,J&&V.get(J).__webglFramebuffer===void 0&&W.setupRenderTarget(J);let me=null,Me=!1,he=!1;if(J){const _e=J.texture;(_e.isDataTexture3D||_e.isDataTexture2DArray)&&(he=!0);const Fe=V.get(J).__webglFramebuffer;J.isWebGLCubeRenderTarget?(me=Fe[pe],Me=!0):J.isWebGLMultisampleRenderTarget?me=V.get(J).__webglMultisampledFramebuffer:me=Fe,w.copy(J.viewport),C.copy(J.scissor),P=J.scissorTest}else w.copy(L).multiplyScalar(S).floor(),C.copy(F).multiplyScalar(S).floor(),P=x;if(K.bindFramebuffer(36160,me)&&X.drawBuffers){let _e=!1;if(J)if(J.isWebGLMultipleRenderTargets){const Fe=J.texture;if(O.length!==Fe.length||O[0]!==36064){for(let Ne=0,je=Fe.length;Ne<je;Ne++)O[Ne]=36064+Ne;O.length=Fe.length,_e=!0}}else(O.length!==1||O[0]!==36064)&&(O[0]=36064,O.length=1,_e=!0);else(O.length!==1||O[0]!==1029)&&(O[0]=1029,O.length=1,_e=!0);_e&&(X.isWebGL2?q.drawBuffers(O):$.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if(K.viewport(w),K.scissor(C),K.setScissorTest(P),Me){const _e=V.get(J.texture);q.framebufferTexture2D(36160,36064,34069+pe,_e.__webglTexture,fe)}else if(he){const _e=V.get(J.texture),Fe=pe||0;q.framebufferTextureLayer(36160,36064,_e.__webglTexture,fe||0,Fe)}},this.readRenderTargetPixels=function(J,pe,fe,me,Me,he,xe){if(!(J&&J.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _e=V.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&xe!==void 0&&(_e=_e[xe]),_e){K.bindFramebuffer(36160,_e);try{const Fe=J.texture,Ne=Fe.format,je=Fe.type;if(Ne!==fn&&de.convert(Ne)!==q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ze=je===Ir&&($.has("EXT_color_buffer_half_float")||X.isWebGL2&&$.has("EXT_color_buffer_float"));if(je!==Pr&&de.convert(je)!==q.getParameter(35738)&&!(je===_i&&(X.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float")))&&!ze){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(36160)===36053?pe>=0&&pe<=J.width-me&&fe>=0&&fe<=J.height-Me&&q.readPixels(pe,fe,me,Me,de.convert(Ne),de.convert(je),he):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Fe=M!==null?V.get(M).__webglFramebuffer:null;K.bindFramebuffer(36160,Fe)}}},this.copyFramebufferToTexture=function(J,pe,fe=0){const me=Math.pow(2,-fe),Me=Math.floor(pe.image.width*me),he=Math.floor(pe.image.height*me);let xe=de.convert(pe.format);X.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),W.setTexture2D(pe,0),q.copyTexImage2D(3553,fe,xe,J.x,J.y,Me,he,0),K.unbindTexture()},this.copyTextureToTexture=function(J,pe,fe,me=0){const Me=pe.image.width,he=pe.image.height,xe=de.convert(fe.format),_e=de.convert(fe.type);W.setTexture2D(fe,0),q.pixelStorei(37440,fe.flipY),q.pixelStorei(37441,fe.premultiplyAlpha),q.pixelStorei(3317,fe.unpackAlignment),pe.isDataTexture?q.texSubImage2D(3553,me,J.x,J.y,Me,he,xe,_e,pe.image.data):pe.isCompressedTexture?q.compressedTexSubImage2D(3553,me,J.x,J.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):q.texSubImage2D(3553,me,J.x,J.y,xe,_e,pe.image),me===0&&fe.generateMipmaps&&q.generateMipmap(3553),K.unbindTexture()},this.copyTextureToTexture3D=function(J,pe,fe,me,Me=0){if(h.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const he=J.max.x-J.min.x+1,xe=J.max.y-J.min.y+1,_e=J.max.z-J.min.z+1,Fe=de.convert(me.format),Ne=de.convert(me.type);let je;if(me.isDataTexture3D)W.setTexture3D(me,0),je=32879;else if(me.isDataTexture2DArray)W.setTexture2DArray(me,0),je=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(37440,me.flipY),q.pixelStorei(37441,me.premultiplyAlpha),q.pixelStorei(3317,me.unpackAlignment);const ze=q.getParameter(3314),qe=q.getParameter(32878),Lt=q.getParameter(3316),Ht=q.getParameter(3315),ls=q.getParameter(32877),ut=fe.isCompressedTexture?fe.mipmaps[0]:fe.image;q.pixelStorei(3314,ut.width),q.pixelStorei(32878,ut.height),q.pixelStorei(3316,J.min.x),q.pixelStorei(3315,J.min.y),q.pixelStorei(32877,J.min.z),fe.isDataTexture||fe.isDataTexture3D?q.texSubImage3D(je,Me,pe.x,pe.y,pe.z,he,xe,_e,Fe,Ne,ut.data):fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),q.compressedTexSubImage3D(je,Me,pe.x,pe.y,pe.z,he,xe,_e,Fe,ut.data)):q.texSubImage3D(je,Me,pe.x,pe.y,pe.z,he,xe,_e,Fe,Ne,ut),q.pixelStorei(3314,ze),q.pixelStorei(32878,qe),q.pixelStorei(3316,Lt),q.pixelStorei(3315,Ht),q.pixelStorei(32877,ls),Me===0&&me.generateMipmaps&&q.generateMipmap(je),K.unbindTexture()},this.initTexture=function(J){W.setTexture2D(J,0),K.unbindTexture()},this.resetState=function(){y=0,v=0,M=null,K.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Ty extends rt{}Ty.prototype.isWebGL1Renderer=!0;class fa{constructor(e,t=25e-5){this.name="",this.color=new Ce(e),this.density=t}clone(){return new fa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}fa.prototype.isFogExp2=!0;class pa{constructor(e,t=1,i=1e3){this.name="",this.color=new Ce(e),this.near=t,this.far=i}clone(){return new pa(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}pa.prototype.isFog=!0;class cc extends Xe{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}cc.prototype.isScene=!0;class hr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Os,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=pn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=pn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=pn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}hr.prototype.isInterleavedBuffer=!0;const _t=new ee;class Ni{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyMatrix4(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyNormalMatrix(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.transformDirection(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Ze(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ni(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Ni.prototype.isInterleavedBufferAttribute=!0;class ma extends Ft{constructor(e){super(),this.type="SpriteMaterial",this.color=new Ce(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}ma.prototype.isSpriteMaterial=!0;let Qs;const ga=new ee,eo=new ee,to=new ee,no=new Ae,va=new Ae,Ey=new Oe,uc=new ee,ya=new ee,dc=new ee,Cy=new Ae,uh=new Ae,Ly=new Ae;class ba extends Xe{constructor(e){if(super(),this.type="Sprite",Qs===void 0){Qs=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new hr(t,5);Qs.setIndex([0,1,2,0,2,3]),Qs.setAttribute("position",new Ni(i,3,0,!1)),Qs.setAttribute("uv",new Ni(i,2,3,!1))}this.geometry=Qs,this.material=e!==void 0?e:new ma,this.center=new Ae(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),eo.setFromMatrixScale(this.matrixWorld),Ey.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),to.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&eo.multiplyScalar(-to.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;hc(uc.set(-.5,-.5,0),to,o,eo,r,s),hc(ya.set(.5,-.5,0),to,o,eo,r,s),hc(dc.set(.5,.5,0),to,o,eo,r,s),Cy.set(0,0),uh.set(1,0),Ly.set(1,1);let l=e.ray.intersectTriangle(uc,ya,dc,!1,ga);if(l===null&&(hc(ya.set(-.5,.5,0),to,o,eo,r,s),uh.set(0,1),l=e.ray.intersectTriangle(uc,dc,ya,!1,ga),l===null))return;const u=e.ray.origin.distanceTo(ga);u<e.near||u>e.far||t.push({distance:u,point:ga.clone(),uv:At.getUV(ga,uc,ya,dc,Cy,uh,Ly,new Ae),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}ba.prototype.isSprite=!0;function hc(n,e,t,i,r,s){no.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(va.x=s*no.x-r*no.y,va.y=r*no.x+s*no.y):va.copy(no),n.copy(e),n.x+=va.x,n.y+=va.y,n.applyMatrix4(Ey)}const fc=new ee,Ry=new ee;class Fy extends Xe{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;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){fc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(fc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){fc.setFromMatrixPosition(e.matrixWorld),Ry.setFromMatrixPosition(this.matrixWorld);const i=fc.distanceTo(Ry)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const Py=new ee,Iy=new it,Oy=new it,BO=new ee,Ny=new Oe;class xa extends St{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Oe,this.bindMatrixInverse=new Oe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new it,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;Iy.fromBufferAttribute(r.attributes.skinIndex,e),Oy.fromBufferAttribute(r.attributes.skinWeight,e),Py.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=Oy.getComponent(s);if(o!==0){const l=Iy.getComponent(s);Ny.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(BO.copy(Py).applyMatrix4(Ny),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}xa.prototype.isSkinnedMesh=!0;class wa extends Xe{constructor(){super(),this.type="Bone"}}wa.prototype.isBone=!0;class jr extends Mt{constructor(e=null,t=1,i=1,r,s,o,l,u,c=wt,f=wt,d,p){super(null,o,l,u,c,f,r,s,d,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}jr.prototype.isDataTexture=!0;const By=new Oe,DO=new Oe;class Ma{constructor(e=[],t=[]){this.uuid=pn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Oe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Oe;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:DO;By.multiplyMatrices(l,t[s]),By.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Ma(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=F0(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new jr(t,e,e,fn,_i);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new wa),this.bones.push(o),this.boneInverses.push(new Oe().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const l=i[r];e.boneInverses.push(l.toArray())}return e}}const Dy=new Oe,ky=new Oe,pc=[],Aa=new St;class dh extends St{constructor(e,t,i){super(e,t),this.instanceMatrix=new Ze(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(Aa.geometry=this.geometry,Aa.material=this.material,Aa.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,Dy),ky.multiplyMatrices(i,Dy),Aa.matrixWorld=ky,Aa.raycast(e,pc);for(let o=0,l=pc.length;o<l;o++){const u=pc[o];u.instanceId=s,u.object=this,t.push(u)}pc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ze(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}dh.prototype.isInstancedMesh=!0;class Vt extends Ft{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Ce(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Vt.prototype.isLineBasicMaterial=!0;const Vy=new ee,zy=new ee,Uy=new Oe,hh=new or,mc=new Ci;class Qn extends Xe{constructor(e=new ke,t=new Vt){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Vy.fromBufferAttribute(t,r-1),zy.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Vy.distanceTo(zy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),mc.copy(i.boundingSphere),mc.applyMatrix4(r),mc.radius+=s,e.ray.intersectsSphere(mc)===!1)return;Uy.copy(r).invert(),hh.copy(e.ray).applyMatrix4(Uy);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new ee,f=new ee,d=new ee,p=new ee,g=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const y=Math.max(0,o.start),v=Math.min(m.count,o.start+o.count);for(let M=y,A=v-1;M<A;M+=g){const _=m.getX(M),w=m.getX(M+1);if(c.fromBufferAttribute(b,_),f.fromBufferAttribute(b,w),hh.distanceSqToSegment(c,f,p,d)>u)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);P<e.near||P>e.far||t.push({distance:P,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),v=Math.min(b.count,o.start+o.count);for(let M=y,A=v-1;M<A;M+=g){if(c.fromBufferAttribute(b,M),f.fromBufferAttribute(b,M+1),hh.distanceSqToSegment(c,f,p,d)>u)continue;p.applyMatrix4(this.matrixWorld);const w=e.ray.origin.distanceTo(p);w<e.near||w>e.far||t.push({distance:w,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Qn.prototype.isLine=!0;const Gy=new ee,Hy=new ee;class rn extends Qn{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)Gy.fromBufferAttribute(t,r),Hy.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+Gy.distanceTo(Hy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}rn.prototype.isLineSegments=!0;class gc extends Qn{constructor(e,t){super(e,t),this.type="LineLoop"}}gc.prototype.isLineLoop=!0;class fr extends Ft{constructor(e){super(),this.type="PointsMaterial",this.color=new Ce(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}fr.prototype.isPointsMaterial=!0;const Wy=new Oe,fh=new or,vc=new Ci,yc=new ee;class io extends Xe{constructor(e=new ke,t=new fr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),vc.copy(i.boundingSphere),vc.applyMatrix4(r),vc.radius+=s,e.ray.intersectsSphere(vc)===!1)return;Wy.copy(r).invert(),fh.copy(e.ray).applyMatrix4(Wy);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,d=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),g=Math.min(c.count,o.start+o.count);for(let m=p,h=g;m<h;m++){const b=c.getX(m);yc.fromBufferAttribute(d,b),jy(yc,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),g=Math.min(d.count,o.start+o.count);for(let m=p,h=g;m<h;m++)yc.fromBufferAttribute(d,m),jy(yc,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}io.prototype.isPoints=!0;function jy(n,e,t,i,r,s,o){const l=fh.distanceSqToPoint(n);if(l<t){const u=new ee;fh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class $y extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Ti,this.minFilter=o!==void 0?o:gt,this.magFilter=s!==void 0?s:gt,this.generateMipmaps=!1;const f=this;function d(){f.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}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)}}$y.prototype.isVideoTexture=!0;class ph extends Mt{constructor(e,t,i,r,s,o,l,u,c,f,d,p){super(null,o,l,u,c,f,r,s,d,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}ph.prototype.isCompressedTexture=!0;class Zy extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Zy.prototype.isCanvasTexture=!0;class Xy extends Mt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Or,f!==Or&&f!==Ps)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Or&&(i=ea),i===void 0&&f===Ps&&(i=Fs),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:wt,this.minFilter=u!==void 0?u:wt,this.flipY=!1,this.generateMipmaps=!1}}Xy.prototype.isDepthTexture=!0;class ro extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new ee,f=new Ae;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const g=i+d/t*r;c.x=e*Math.cos(g),c.y=e*Math.sin(g),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("normal",new Pe(l,3)),this.setAttribute("uv",new Pe(u,2))}static fromJSON(e){return new ro(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class pr extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],d=[],p=[],g=[];let m=0;const h=[],b=i/2;let y=0;v(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(f),this.setAttribute("position",new Pe(d,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(g,2));function v(){const A=new ee,_=new ee;let w=0;const C=(t-e)/i;for(let P=0;P<=s;P++){const R=[],I=P/s,S=I*(t-e)+e;for(let T=0;T<=r;T++){const E=T/r,L=E*u+l,F=Math.sin(L),x=Math.cos(L);_.x=S*F,_.y=-I*i+b,_.z=S*x,d.push(_.x,_.y,_.z),A.set(F,C,x).normalize(),p.push(A.x,A.y,A.z),g.push(E,1-I),R.push(m++)}h.push(R)}for(let P=0;P<r;P++)for(let R=0;R<s;R++){const I=h[R][P],S=h[R+1][P],T=h[R+1][P+1],E=h[R][P+1];f.push(I,S,E),f.push(S,T,E),w+=6}c.addGroup(y,w,0),y+=w}function M(A){const _=m,w=new Ae,C=new ee;let P=0;const R=A===!0?e:t,I=A===!0?1:-1;for(let T=1;T<=r;T++)d.push(0,b*I,0),p.push(0,I,0),g.push(.5,.5),m++;const S=m;for(let T=0;T<=r;T++){const L=T/r*u+l,F=Math.cos(L),x=Math.sin(L);C.x=R*x,C.y=b*I,C.z=R*F,d.push(C.x,C.y,C.z),p.push(0,I,0),w.x=F*.5+.5,w.y=x*.5*I+.5,g.push(w.x,w.y),m++}for(let T=0;T<r;T++){const E=_+T,L=S+T;A===!0?f.push(L,L+1,E):f.push(L+1,L,E),P+=3}c.addGroup(y,P,A===!0?1:2),y+=P}}static fromJSON(e){return new pr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class so extends pr{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new so(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ei extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(s.slice(),3)),this.setAttribute("uv",new Pe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(v){const M=new ee,A=new ee,_=new ee;for(let w=0;w<t.length;w+=3)g(t[w+0],M),g(t[w+1],A),g(t[w+2],_),u(M,A,_,v)}function u(v,M,A,_){const w=_+1,C=[];for(let P=0;P<=w;P++){C[P]=[];const R=v.clone().lerp(A,P/w),I=M.clone().lerp(A,P/w),S=w-P;for(let T=0;T<=S;T++)T===0&&P===w?C[P][T]=R:C[P][T]=R.clone().lerp(I,T/S)}for(let P=0;P<w;P++)for(let R=0;R<2*(w-P)-1;R++){const I=Math.floor(R/2);R%2===0?(p(C[P][I+1]),p(C[P+1][I]),p(C[P][I])):(p(C[P][I+1]),p(C[P+1][I+1]),p(C[P+1][I]))}}function c(v){const M=new ee;for(let A=0;A<s.length;A+=3)M.x=s[A+0],M.y=s[A+1],M.z=s[A+2],M.normalize().multiplyScalar(v),s[A+0]=M.x,s[A+1]=M.y,s[A+2]=M.z}function f(){const v=new ee;for(let M=0;M<s.length;M+=3){v.x=s[M+0],v.y=s[M+1],v.z=s[M+2];const A=b(v)/2/Math.PI+.5,_=y(v)/Math.PI+.5;o.push(A,1-_)}m(),d()}function d(){for(let v=0;v<o.length;v+=6){const M=o[v+0],A=o[v+2],_=o[v+4],w=Math.max(M,A,_),C=Math.min(M,A,_);w>.9&&C<.1&&(M<.2&&(o[v+0]+=1),A<.2&&(o[v+2]+=1),_<.2&&(o[v+4]+=1))}}function p(v){s.push(v.x,v.y,v.z)}function g(v,M){const A=v*3;M.x=e[A+0],M.y=e[A+1],M.z=e[A+2]}function m(){const v=new ee,M=new ee,A=new ee,_=new ee,w=new Ae,C=new Ae,P=new Ae;for(let R=0,I=0;R<s.length;R+=9,I+=6){v.set(s[R+0],s[R+1],s[R+2]),M.set(s[R+3],s[R+4],s[R+5]),A.set(s[R+6],s[R+7],s[R+8]),w.set(o[I+0],o[I+1]),C.set(o[I+2],o[I+3]),P.set(o[I+4],o[I+5]),_.copy(v).add(M).add(A).divideScalar(3);const S=b(_);h(w,I+0,v,S),h(C,I+2,M,S),h(P,I+4,A,S)}}function h(v,M,A,_){_<0&&v.x===1&&(o[M]=v.x-1),A.x===0&&A.z===0&&(o[M]=_/2/Math.PI+.5)}function b(v){return Math.atan2(v.z,-v.x)}function y(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}static fromJSON(e){return new ei(e.vertices,e.indices,e.radius,e.details)}}class oo extends ei{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new oo(e.radius,e.detail)}}const bc=new ee,xc=new ee,mh=new ee,wc=new At;class gh extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Vr*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],d=new Array(3),p={},g=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:h,b,c:y}=wc;if(h.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),y.fromBufferAttribute(l,c[2]),wc.getNormal(mh),d[0]=`${Math.round(h.x*r)},${Math.round(h.y*r)},${Math.round(h.z*r)}`,d[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,d[2]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let v=0;v<3;v++){const M=(v+1)%3,A=d[v],_=d[M],w=wc[f[v]],C=wc[f[M]],P=`${A}_${_}`,R=`${_}_${A}`;R in p&&p[R]?(mh.dot(p[R].normal)<=s&&(g.push(w.x,w.y,w.z),g.push(C.x,C.y,C.z)),p[R]=null):P in p||(p[P]={index0:c[v],index1:c[M],normal:mh.clone()})}}for(const m in p)if(p[m]){const{index0:h,index1:b}=p[m];bc.fromBufferAttribute(l,h),xc.fromBufferAttribute(l,b),g.push(bc.x,bc.y,bc.z),g.push(xc.x,xc.y,xc.z)}this.setAttribute("position",new Pe(g,3))}}class vn{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 l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,g=(o-f)/p;return(r+g)/(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),l=this.getPoint(s),u=t||(o.isVector2?new Ae:new ee);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new ee,r=[],s=[],o=[],l=new ee,u=new Oe;for(let g=0;g<=e;g++){const m=g/e;r[g]=this.getTangentAt(m,new ee),r[g].normalize()}s[0]=new ee,o[0]=new ee;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),l.crossVectors(r[g-1],r[g]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(u.makeRotationAxis(l,m))}o[g].crossVectors(r[g],s[g])}if(t===!0){let g=Math.acos($t(s[0].dot(s[e]),-1,1));g/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(g=-g);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],g*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.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Sa extends vn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Ae,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=u-this.aX,g=c-this.aY;u=p*f-g*d+this.aX,c=p*d+g*f+this.aY}return i.set(u,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Sa.prototype.isEllipseCurve=!0;class vh extends Sa{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}vh.prototype.isArcCurve=!0;function yh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,d){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,g=(l-o)/f-(u-o)/(f+d)+(u-l)/d;p*=f,g*=f,r(o,l,p,g)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const Mc=new ee,bh=new yh,xh=new yh,wh=new yh;class Mh extends vn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new ee){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(Mc.subVectors(r[0],r[1]).add(r[0]),c=Mc);const d=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(Mc.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=Mc),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(d),g),h=Math.pow(d.distanceToSquared(p),g),b=Math.pow(p.distanceToSquared(f),g);h<1e-4&&(h=1),m<1e-4&&(m=h),b<1e-4&&(b=h),bh.initNonuniformCatmullRom(c.x,d.x,p.x,f.x,m,h,b),xh.initNonuniformCatmullRom(c.y,d.y,p.y,f.y,m,h,b),wh.initNonuniformCatmullRom(c.z,d.z,p.z,f.z,m,h,b)}else this.curveType==="catmullrom"&&(bh.initCatmullRom(c.x,d.x,p.x,f.x,this.tension),xh.initCatmullRom(c.y,d.y,p.y,f.y,this.tension),wh.initCatmullRom(c.z,d.z,p.z,f.z,this.tension));return i.set(bh.calc(u),xh.calc(u),wh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new ee().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}Mh.prototype.isCatmullRomCurve3=!0;function Yy(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function kO(n,e){const t=1-n;return t*t*e}function VO(n,e){return 2*(1-n)*n*e}function zO(n,e){return n*n*e}function _a(n,e,t,i){return kO(n,e)+VO(n,t)+zO(n,i)}function UO(n,e){const t=1-n;return t*t*t*e}function GO(n,e){const t=1-n;return 3*t*t*n*e}function HO(n,e){return 3*(1-n)*n*n*e}function WO(n,e){return n*n*n*e}function Ta(n,e,t,i,r){return UO(n,e)+GO(n,t)+HO(n,i)+WO(n,r)}class Ac extends vn{constructor(e=new Ae,t=new Ae,i=new Ae,r=new Ae){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ta(e,r.x,s.x,o.x,l.x),Ta(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ac.prototype.isCubicBezierCurve=!0;class Ah extends vn{constructor(e=new ee,t=new ee,i=new ee,r=new ee){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new ee){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ta(e,r.x,s.x,o.x,l.x),Ta(e,r.y,s.y,o.y,l.y),Ta(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ah.prototype.isCubicBezierCurve3=!0;class Ea extends vn{constructor(e=new Ae,t=new Ae){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ae){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Ae;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Ea.prototype.isLineCurve=!0;class Jy extends vn{constructor(e=new ee,t=new ee){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new ee){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Sc extends vn{constructor(e=new Ae,t=new Ae,i=new Ae){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(_a(e,r.x,s.x,o.x),_a(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Sc.prototype.isQuadraticBezierCurve=!0;class Sh extends vn{constructor(e=new ee,t=new ee,i=new ee){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ee){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(_a(e,r.x,s.x,o.x),_a(e,r.y,s.y,o.y),_a(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Sh.prototype.isQuadraticBezierCurve3=!0;class _c extends vn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Ae){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(Yy(l,u.x,c.x,f.x,d.x),Yy(l,u.y,c.y,f.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Ae().fromArray(r))}return this}}_c.prototype.isSplineCurve=!0;var _h=Object.freeze({__proto__:null,ArcCurve:vh,CatmullRomCurve3:Mh,CubicBezierCurve:Ac,CubicBezierCurve3:Ah,EllipseCurve:Sa,LineCurve:Ea,LineCurve3:Jy,QuadraticBezierCurve:Sc,QuadraticBezierCurve3:Sh,SplineCurve:_c});const jO={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=Ky(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,d,p,g;if(i&&(s=JO(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)d=n[m],p=n[m+1],d<l&&(l=d),p<u&&(u=p),d>c&&(c=d),p>f&&(f=p);g=Math.max(c-l,f-u),g=g!==0?1/g:0}return Ca(s,o,t,l,u,g),o}};function Ky(n,e,t,i,r){let s,o;if(r===aN(n,e,t,i)>0)for(s=e;s<t;s+=i)o=eb(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=eb(s,n[s],n[s+1],o);return o&&Tc(o,o.next)&&(Ra(o),o=o.next),o}function mr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Tc(t,t.next)||ht(t.prev,t,t.next)===0)){if(Ra(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Ca(n,e,t,i,r,s,o){if(!n)return;!o&&s&&tN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?ZO(n,i,r,s):$O(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ra(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=XO(mr(n),e,t),Ca(n,e,t,i,r,s,2)):o===2&&YO(n,e,t,i,r,s):Ca(mr(n),e,t,i,r,s,1);break}}}function $O(n){const e=n.prev,t=n,i=n.next;if(ht(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(ao(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ht(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ZO(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ht(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,d=Th(l,u,e,t,i),p=Th(c,f,e,t,i);let g=n.prevZ,m=n.nextZ;for(;g&&g.z>=d&&m&&m.z<=p;){if(g!==n.prev&&g!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&ht(g.prev,g,g.next)>=0||(g=g.prevZ,m!==n.prev&&m!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;g&&g.z>=d;){if(g!==n.prev&&g!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&ht(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function XO(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Tc(r,s)&&qy(r,i,i.next,s)&&La(r,s)&&La(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ra(i),Ra(i.next),i=n=s),i=i.next}while(i!==n);return mr(i)}function YO(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&rN(o,l)){let u=Qy(o,l);o=mr(o,o.next),u=mr(u,u.next),Ca(o,e,t,i,r,s),Ca(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function JO(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=Ky(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(iN(c));for(r.sort(KO),s=0;s<r.length;s++)qO(r[s],t),t=mr(t,t.next);return t}function KO(n,e){return n.x-e.x}function qO(n,e){if(e=QO(n,e),e){const t=Qy(e,n);mr(e,e.next),mr(t,t.next)}}function QO(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,d;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&ao(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(d=Math.abs(r-t.y)/(i-t.x),La(t,n)&&(d<f||d===f&&(t.x>o.x||t.x===o.x&&eN(o,t)))&&(o=t,f=d)),t=t.next;while(t!==l);return o}function eN(n,e){return ht(n.prev,n,e.prev)<0&&ht(e.next,n,n.next)<0}function tN(n,e,t,i){let r=n;do r.z===null&&(r.z=Th(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,nN(r)}function nN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Th(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,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 iN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function ao(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function rN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!sN(n,e)&&(La(n,e)&&La(e,n)&&oN(n,e)&&(ht(n.prev,n,e.prev)||ht(n,e.prev,e))||Tc(n,e)&&ht(n.prev,n,n.next)>0&&ht(e.prev,e,e.next)>0)}function ht(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Tc(n,e){return n.x===e.x&&n.y===e.y}function qy(n,e,t,i){const r=Cc(ht(n,e,t)),s=Cc(ht(n,e,i)),o=Cc(ht(t,i,n)),l=Cc(ht(t,i,e));return!!(r!==s&&o!==l||r===0&&Ec(n,t,e)||s===0&&Ec(n,i,e)||o===0&&Ec(t,n,i)||l===0&&Ec(t,e,i))}function Ec(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 Cc(n){return n>0?1:n<0?-1:0}function sN(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&&qy(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function La(n,e){return ht(n.prev,n,n.next)<0?ht(n,e,n.next)>=0&&ht(n,n.prev,e)>=0:ht(n,e,n.prev)<0||ht(n,n.next,e)<0}function oN(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 Qy(n,e){const t=new Eh(n.i,n.x,n.y),i=new Eh(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 eb(n,e,t,i){const r=new Eh(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 Ra(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 Eh(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function aN(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ti{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ti.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];tb(e),nb(i,e);let o=e.length;t.forEach(tb);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,nb(i,t[u]);const l=jO.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function tb(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function nb(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Nn extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Pe(r,3)),this.setAttribute("uv",new Pe(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let d=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:g-2,h=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const y=t.extrudePath,v=t.UVGenerator!==void 0?t.UVGenerator:lN;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);let M,A=!1,_,w,C,P;y&&(M=y.getSpacedPoints(f),A=!0,p=!1,_=y.computeFrenetFrames(f,!1),w=new ee,C=new ee,P=new ee),p||(b=0,g=0,m=0,h=0);const R=l.extractPoints(c);let I=R.shape;const S=R.holes;if(!ti.isClockWise(I)){I=I.reverse();for(let V=0,W=S.length;V<W;V++){const oe=S[V];ti.isClockWise(oe)&&(S[V]=oe.reverse())}}const E=ti.triangulateShape(I,S),L=I;for(let V=0,W=S.length;V<W;V++){const oe=S[V];I=I.concat(oe)}function F(V,W,oe){return W||console.error("THREE.ExtrudeGeometry: vec does not exist"),W.clone().multiplyScalar(oe).add(V)}const x=I.length,O=E.length;function B(V,W,oe){let ae,le,H;const U=V.x-W.x,D=V.y-W.y,Q=oe.x-V.x,ie=oe.y-V.y,ce=U*U+D*D,ge=U*ie-D*Q;if(Math.abs(ge)>Number.EPSILON){const ye=Math.sqrt(ce),ue=Math.sqrt(Q*Q+ie*ie),be=W.x-D/ye,ne=W.y+U/ye,de=oe.x-ie/ue,ve=oe.y+Q/ue,Ee=((de-be)*ie-(ve-ne)*Q)/(U*ie-D*Q);ae=be+U*Ee-V.x,le=ne+D*Ee-V.y;const Se=ae*ae+le*le;if(Se<=2)return new Ae(ae,le);H=Math.sqrt(Se/2)}else{let ye=!1;U>Number.EPSILON?Q>Number.EPSILON&&(ye=!0):U<-Number.EPSILON?Q<-Number.EPSILON&&(ye=!0):Math.sign(D)===Math.sign(ie)&&(ye=!0),ye?(ae=-D,le=U,H=Math.sqrt(ce)):(ae=U,le=D,H=Math.sqrt(ce/2))}return new Ae(ae/H,le/H)}const N=[];for(let V=0,W=L.length,oe=W-1,ae=V+1;V<W;V++,oe++,ae++)oe===W&&(oe=0),ae===W&&(ae=0),N[V]=B(L[V],L[oe],L[ae]);const k=[];let z,G=N.concat();for(let V=0,W=S.length;V<W;V++){const oe=S[V];z=[];for(let ae=0,le=oe.length,H=le-1,U=ae+1;ae<le;ae++,H++,U++)H===le&&(H=0),U===le&&(U=0),z[ae]=B(oe[ae],oe[H],oe[U]);k.push(z),G=G.concat(z)}for(let V=0;V<b;V++){const W=V/b,oe=g*Math.cos(W*Math.PI/2),ae=m*Math.sin(W*Math.PI/2)+h;for(let le=0,H=L.length;le<H;le++){const U=F(L[le],N[le],ae);j(U.x,U.y,-oe)}for(let le=0,H=S.length;le<H;le++){const U=S[le];z=k[le];for(let D=0,Q=U.length;D<Q;D++){const ie=F(U[D],z[D],ae);j(ie.x,ie.y,-oe)}}}const Y=m+h;for(let V=0;V<x;V++){const W=p?F(I[V],G[V],Y):I[V];A?(C.copy(_.normals[0]).multiplyScalar(W.x),w.copy(_.binormals[0]).multiplyScalar(W.y),P.copy(M[0]).add(C).add(w),j(P.x,P.y,P.z)):j(W.x,W.y,0)}for(let V=1;V<=f;V++)for(let W=0;W<x;W++){const oe=p?F(I[W],G[W],Y):I[W];A?(C.copy(_.normals[V]).multiplyScalar(oe.x),w.copy(_.binormals[V]).multiplyScalar(oe.y),P.copy(M[V]).add(C).add(w),j(P.x,P.y,P.z)):j(oe.x,oe.y,d/f*V)}for(let V=b-1;V>=0;V--){const W=V/b,oe=g*Math.cos(W*Math.PI/2),ae=m*Math.sin(W*Math.PI/2)+h;for(let le=0,H=L.length;le<H;le++){const U=F(L[le],N[le],ae);j(U.x,U.y,d+oe)}for(let le=0,H=S.length;le<H;le++){const U=S[le];z=k[le];for(let D=0,Q=U.length;D<Q;D++){const ie=F(U[D],z[D],ae);A?j(ie.x,ie.y+M[f-1].y,M[f-1].x+oe):j(ie.x,ie.y,d+oe)}}}Z(),te();function Z(){const V=r.length/3;if(p){let W=0,oe=x*W;for(let ae=0;ae<O;ae++){const le=E[ae];$(le[2]+oe,le[1]+oe,le[0]+oe)}W=f+b*2,oe=x*W;for(let ae=0;ae<O;ae++){const le=E[ae];$(le[0]+oe,le[1]+oe,le[2]+oe)}}else{for(let W=0;W<O;W++){const oe=E[W];$(oe[2],oe[1],oe[0])}for(let W=0;W<O;W++){const oe=E[W];$(oe[0]+x*f,oe[1]+x*f,oe[2]+x*f)}}i.addGroup(V,r.length/3-V,0)}function te(){const V=r.length/3;let W=0;q(L,W),W+=L.length;for(let oe=0,ae=S.length;oe<ae;oe++){const le=S[oe];q(le,W),W+=le.length}i.addGroup(V,r.length/3-V,1)}function q(V,W){let oe=V.length;for(;--oe>=0;){const ae=oe;let le=oe-1;le<0&&(le=V.length-1);for(let H=0,U=f+b*2;H<U;H++){const D=x*H,Q=x*(H+1),ie=W+ae+D,ce=W+le+D,ge=W+le+Q,ye=W+ae+Q;X(ie,ce,ge,ye)}}}function j(V,W,oe){u.push(V),u.push(W),u.push(oe)}function $(V,W,oe){K(V),K(W),K(oe);const ae=r.length/3,le=v.generateTopUV(i,r,ae-3,ae-2,ae-1);re(le[0]),re(le[1]),re(le[2])}function X(V,W,oe,ae){K(V),K(W),K(ae),K(W),K(oe),K(ae);const le=r.length/3,H=v.generateSideWallUV(i,r,le-6,le-3,le-2,le-1);re(H[0]),re(H[1]),re(H[3]),re(H[1]),re(H[2]),re(H[3])}function K(V){r.push(u[V*3+0]),r.push(u[V*3+1]),r.push(u[V*3+2])}function re(V){s.push(V.x),s.push(V.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return cN(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new _h[r.type]().fromJSON(r)),new Nn(i,e.options)}}const lN={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new Ae(s,o),new Ae(l,u),new Ae(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],d=e[i*3+2],p=e[r*3],g=e[r*3+1],m=e[r*3+2],h=e[s*3],b=e[s*3+1],y=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new Ae(o,1-u),new Ae(c,1-d),new Ae(p,1-m),new Ae(h,1-y)]:[new Ae(l,1-u),new Ae(f,1-d),new Ae(g,1-m),new Ae(b,1-y)]}};function cN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class lo extends ei{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lo(e.radius,e.detail)}}class co extends ke{constructor(e,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=$t(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new ee,f=new Ae;for(let d=0;d<=t;d++){const p=i+d*u*r,g=Math.sin(p),m=Math.cos(p);for(let h=0;h<=e.length-1;h++)c.x=e[h].x*g,c.y=e[h].y,c.z=e[h].x*m,o.push(c.x,c.y,c.z),f.x=d/t,f.y=h/(e.length-1),l.push(f.x,f.y)}for(let d=0;d<t;d++)for(let p=0;p<e.length-1;p++){const g=p+d*e.length,m=g,h=g+e.length,b=g+e.length+1,y=g+1;s.push(m,h,y),s.push(h,b,y)}if(this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2)),this.computeVertexNormals(),r===Math.PI*2){const d=this.attributes.normal.array,p=new ee,g=new ee,m=new ee,h=t*e.length*3;for(let b=0,y=0;b<e.length;b++,y+=3)p.x=d[y+0],p.y=d[y+1],p.z=d[y+2],g.x=d[h+y+0],g.y=d[h+y+1],g.z=d[h+y+2],m.addVectors(p,g).normalize(),d[y+0]=d[h+y+0]=m.x,d[y+1]=d[h+y+1]=m.y,d[y+2]=d[h+y+2]=m.z}}static fromJSON(e){return new co(e.points,e.segments,e.phiStart,e.phiLength)}}class $r extends ei{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new $r(e.radius,e.detail)}}class Lc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new ee,f=new ee,d=new ee,p=new ee,g=new ee;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let h=0;h<=i;h++){const b=h/i;for(let y=0;y<=t;y++){const v=y/t;e(v,b,f),s.push(f.x,f.y,f.z),v-u>=0?(e(v-u,b,d),p.subVectors(f,d)):(e(v+u,b,d),p.subVectors(d,f)),b-u>=0?(e(v,b-u,d),g.subVectors(f,d)):(e(v,b+u,d),g.subVectors(d,f)),c.crossVectors(p,g).normalize(),o.push(c.x,c.y,c.z),l.push(v,b)}}for(let h=0;h<i;h++)for(let b=0;b<t;b++){const y=h*m+b,v=h*m+b+1,M=(h+1)*m+b+1,A=(h+1)*m+b;r.push(y,v,A),r.push(v,M,A)}this.setIndex(r),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2))}}class uo extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let d=e;const p=(t-e)/r,g=new ee,m=new Ae;for(let h=0;h<=r;h++){for(let b=0;b<=i;b++){const y=s+b/i*o;g.x=d*Math.cos(y),g.y=d*Math.sin(y),u.push(g.x,g.y,g.z),c.push(0,0,1),m.x=(g.x/t+1)/2,m.y=(g.y/t+1)/2,f.push(m.x,m.y)}d+=p}for(let h=0;h<r;h++){const b=h*(i+1);for(let y=0;y<i;y++){const v=y+b,M=v,A=v+i+1,_=v+i+2,w=v+1;l.push(M,A,w),l.push(A,_,w)}}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2))}static fromJSON(e){return new uo(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Zr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Pe(r,3)),this.setAttribute("normal",new Pe(s,3)),this.setAttribute("uv",new Pe(o,2));function c(f){const d=r.length/3,p=f.extractPoints(t);let g=p.shape;const m=p.holes;ti.isClockWise(g)===!1&&(g=g.reverse());for(let b=0,y=m.length;b<y;b++){const v=m[b];ti.isClockWise(v)===!0&&(m[b]=v.reverse())}const h=ti.triangulateShape(g,m);for(let b=0,y=m.length;b<y;b++){const v=m[b];g=g.concat(v)}for(let b=0,y=g.length;b<y;b++){const v=g[b];r.push(v.x,v.y,0),s.push(0,0,1),o.push(v.x,v.y)}for(let b=0,y=h.length;b<y;b++){const v=h[b],M=v[0]+d,A=v[1]+d,_=v[2]+d;i.push(M,A,_),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return uN(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Zr(i,e.curveSegments)}}function uN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Xr extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],d=new ee,p=new ee,g=[],m=[],h=[],b=[];for(let y=0;y<=i;y++){const v=[],M=y/i;let A=0;y==0&&o==0?A=.5/t:y==i&&u==Math.PI&&(A=-.5/t);for(let _=0;_<=t;_++){const w=_/t;d.x=-e*Math.cos(r+w*s)*Math.sin(o+M*l),d.y=e*Math.cos(o+M*l),d.z=e*Math.sin(r+w*s)*Math.sin(o+M*l),m.push(d.x,d.y,d.z),p.copy(d).normalize(),h.push(p.x,p.y,p.z),b.push(w+A,1-M),v.push(c++)}f.push(v)}for(let y=0;y<i;y++)for(let v=0;v<t;v++){const M=f[y][v+1],A=f[y][v],_=f[y+1][v],w=f[y+1][v+1];(y!==0||o>0)&&g.push(M,A,w),(y!==i-1||u<Math.PI)&&g.push(A,_,w)}this.setIndex(g),this.setAttribute("position",new Pe(m,3)),this.setAttribute("normal",new Pe(h,3)),this.setAttribute("uv",new Pe(b,2))}static fromJSON(e){return new Xr(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ho extends ei{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ho(e.radius,e.detail)}}class Rc extends Nn{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class fo extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new ee,d=new ee,p=new ee;for(let g=0;g<=i;g++)for(let m=0;m<=r;m++){const h=m/r*s,b=g/i*Math.PI*2;d.x=(e+t*Math.cos(b))*Math.cos(h),d.y=(e+t*Math.cos(b))*Math.sin(h),d.z=t*Math.sin(b),l.push(d.x,d.y,d.z),f.x=e*Math.cos(h),f.y=e*Math.sin(h),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(g/i)}for(let g=1;g<=i;g++)for(let m=1;m<=r;m++){const h=(r+1)*g+m-1,b=(r+1)*(g-1)+m-1,y=(r+1)*(g-1)+m,v=(r+1)*g+m;o.push(h,b,v),o.push(b,y,v)}this.setIndex(o),this.setAttribute("position",new Pe(l,3)),this.setAttribute("normal",new Pe(u,3)),this.setAttribute("uv",new Pe(c,2))}static fromJSON(e){return new fo(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class po extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],d=new ee,p=new ee,g=new ee,m=new ee,h=new ee,b=new ee,y=new ee;for(let M=0;M<=i;++M){const A=M/i*s*Math.PI*2;v(A,s,o,e,g),v(A+.01,s,o,e,m),b.subVectors(m,g),y.addVectors(m,g),h.crossVectors(b,y),y.crossVectors(h,b),h.normalize(),y.normalize();for(let _=0;_<=r;++_){const w=_/r*Math.PI*2,C=-t*Math.cos(w),P=t*Math.sin(w);d.x=g.x+(C*y.x+P*h.x),d.y=g.y+(C*y.y+P*h.y),d.z=g.z+(C*y.z+P*h.z),u.push(d.x,d.y,d.z),p.subVectors(d,g).normalize(),c.push(p.x,p.y,p.z),f.push(M/i),f.push(_/r)}}for(let M=1;M<=i;M++)for(let A=1;A<=r;A++){const _=(r+1)*(M-1)+(A-1),w=(r+1)*M+(A-1),C=(r+1)*M+A,P=(r+1)*(M-1)+A;l.push(_,w,P),l.push(w,C,P)}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2));function v(M,A,_,w,C){const P=Math.cos(M),R=Math.sin(M),I=_/A*M,S=Math.cos(I);C.x=w*(2+S)*.5*P,C.y=w*(2+S)*R*.5,C.z=w*Math.sin(I)*.5}}static fromJSON(e){return new po(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class mo extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new ee,u=new ee,c=new Ae;let f=new ee;const d=[],p=[],g=[],m=[];h(),this.setIndex(m),this.setAttribute("position",new Pe(d,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(g,2));function h(){for(let M=0;M<t;M++)b(M);b(s===!1?t:0),v(),y()}function b(M){f=e.getPointAt(M/t,f);const A=o.normals[M],_=o.binormals[M];for(let w=0;w<=r;w++){const C=w/r*Math.PI*2,P=Math.sin(C),R=-Math.cos(C);u.x=R*A.x+P*_.x,u.y=R*A.y+P*_.y,u.z=R*A.z+P*_.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,d.push(l.x,l.y,l.z)}}function y(){for(let M=1;M<=t;M++)for(let A=1;A<=r;A++){const _=(r+1)*(M-1)+(A-1),w=(r+1)*M+(A-1),C=(r+1)*M+A,P=(r+1)*(M-1)+A;m.push(_,w,P),m.push(w,C,P)}}function v(){for(let M=0;M<=t;M++)for(let A=0;A<=r;A++)c.x=M/t,c.y=A/r,g.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new mo(new _h[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Ch extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new ee;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const d=u[c],p=d.start,g=d.count;for(let m=p,h=p+g;m<h;m+=3)for(let b=0;b<3;b++){const y=l.getX(m+b),v=l.getX(m+(b+1)%3);i[0]=Math.min(y,v),i[1]=Math.max(y,v);const M=i[0]+","+i[1];r[M]===void 0&&(r[M]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const d=3*l+(c+1)%3;s.fromBufferAttribute(o,d),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Pe(t,3))}}var ib=Object.freeze({__proto__:null,BoxGeometry:Ii,BoxBufferGeometry:Ii,CircleGeometry:ro,CircleBufferGeometry:ro,ConeGeometry:so,ConeBufferGeometry:so,CylinderGeometry:pr,CylinderBufferGeometry:pr,DodecahedronGeometry:oo,DodecahedronBufferGeometry:oo,EdgesGeometry:gh,ExtrudeGeometry:Nn,ExtrudeBufferGeometry:Nn,IcosahedronGeometry:lo,IcosahedronBufferGeometry:lo,LatheGeometry:co,LatheBufferGeometry:co,OctahedronGeometry:$r,OctahedronBufferGeometry:$r,ParametricGeometry:Lc,ParametricBufferGeometry:Lc,PlaneGeometry:Wr,PlaneBufferGeometry:Wr,PolyhedronGeometry:ei,PolyhedronBufferGeometry:ei,RingGeometry:uo,RingBufferGeometry:uo,ShapeGeometry:Zr,ShapeBufferGeometry:Zr,SphereGeometry:Xr,SphereBufferGeometry:Xr,TetrahedronGeometry:ho,TetrahedronBufferGeometry:ho,TextGeometry:Rc,TextBufferGeometry:Rc,TorusGeometry:fo,TorusBufferGeometry:fo,TorusKnotGeometry:po,TorusKnotBufferGeometry:po,TubeGeometry:mo,TubeBufferGeometry:mo,WireframeGeometry:Ch});class Lh extends Ft{constructor(e){super(),this.type="ShadowMaterial",this.color=new Ce(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Lh.prototype.isShadowMaterial=!0;class go extends Oi{constructor(e){super(e),this.type="RawShaderMaterial"}}go.prototype.isRawShaderMaterial=!0;class Yr extends Ft{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ce(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Yr.prototype.isMeshStandardMaterial=!0;class Fa extends Yr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ae(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=$t(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Ce(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ce).copy(e.sheen):this.sheen=null,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}}Fa.prototype.isMeshPhysicalMaterial=!0;class Rh extends Ft{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ce(16777215),this.specular=new Ce(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Xo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Rh.prototype.isMeshPhongMaterial=!0;class Fh extends Ft{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ce(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(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.morphTargets=!1,this.morphNormals=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Fh.prototype.isMeshToonMaterial=!0;class Ph extends Ft{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ph.prototype.isMeshNormalMaterial=!0;class Ih extends Ft{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Xo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Ih.prototype.isMeshLambertMaterial=!0;class Oh extends Ft{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ce(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Oh.prototype.isMeshMatcapMaterial=!0;class Nh extends Vt{constructor(e){super(),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}}Nh.prototype.isLineDashedMaterial=!0;var dN=Object.freeze({__proto__:null,ShadowMaterial:Lh,SpriteMaterial:ma,RawShaderMaterial:go,ShaderMaterial:Oi,PointsMaterial:fr,MeshPhysicalMaterial:Fa,MeshStandardMaterial:Yr,MeshPhongMaterial:Rh,MeshToonMaterial:Fh,MeshNormalMaterial:Ph,MeshLambertMaterial:Ih,MeshDepthMaterial:ac,MeshDistanceMaterial:lc,MeshBasicMaterial:cn,MeshMatcapMaterial:Oh,LineDashedMaterial:Nh,LineBasicMaterial:Vt,Material:Ft});const ct={arraySlice:function(n,e,t){return ct.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(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},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(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)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),d=[],p=[];for(let g=0;g<c.times.length;++g){const m=c.times[g]*r;if(!(m<t||m>=i)){d.push(c.times[g]);for(let h=0;h<f;++h)p.push(c.values[g*f+h])}}d.length!==0&&(c.times=ct.convertArray(d,c.times.constructor),c.values=ct.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(y){return y.name===l.name&&y.ValueTypeName===u});if(c===void 0)continue;let f=0;const d=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=d/3);let p=0;const g=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=g/3);const m=l.times.length-1;let h;if(s<=l.times[0]){const y=f,v=d-f;h=ct.arraySlice(l.values,y,v)}else if(s>=l.times[m]){const y=m*d+f,v=y+d-f;h=ct.arraySlice(l.values,y,v)}else{const y=l.createInterpolant(),v=f,M=d-f;y.evaluate(s),h=ct.arraySlice(y.resultBuffer,v,M)}u==="quaternion"&&new Zt().fromArray(h).normalize().conjugate().toArray(h);const b=c.times.length;for(let y=0;y<b;++y){const v=y*g+p;if(u==="quaternion")Zt.multiplyQuaternionsFlat(c.values,v,h,0,c.values,v);else{const M=g-p*2;for(let A=0;A<M;++A)c.values[v+A]-=h[A]}}}return n.blendMode=Sd,n}};class ni{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ni.prototype.beforeStart_=ni.prototype.copySampleValue_,ni.prototype.afterEnd_=ni.prototype.copySampleValue_;class rb extends ni{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Br,endingEnd:Br}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case Dr:s=e,l=2*t-i;break;case na:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Dr:o=e,u=2*i-t;break;case na:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,g=this._weightNext,m=(i-t)/(r-t),h=m*m,b=h*m,y=-p*b+2*p*h-p*m,v=(1+p)*b+(-1.5-2*p)*h+(-.5+p)*m+1,M=(-1-g)*b+(1.5+g)*h+.5*m,A=g*b-g*h;for(let _=0;_!==l;++_)s[_]=y*o[f+_]+v*o[c+_]+M*o[u+_]+A*o[d+_];return s}}class Bh extends ni{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),d=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*d+o[u+p]*f;return s}}class sb extends ni{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Bn{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ct.convertArray(t,this.TimeBufferType),this.values=ct.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ct.convertArray(e.times,Array),values:ct.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new sb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Bh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new rb(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Is:t=this.InterpolantFactoryMethodDiscrete;break;case Nr:t=this.InterpolantFactoryMethodLinear;break;case Ol:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Is;case this.InterpolantFactoryMethodLinear:return Nr;case this.InterpolantFactoryMethodSmooth:return Ol}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ct.arraySlice(i,s,o),this.values=ct.arraySlice(this.values,s*l,o*l)}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 l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ct.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ct.arraySlice(this.times),t=ct.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Ol,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const d=l*i,p=d-i,g=d+i;for(let m=0;m!==i;++m){const h=t[d+m];if(h!==t[p+m]||h!==t[g+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const d=l*i,p=o*i;for(let g=0;g!==i;++g)t[p+g]=t[d+g]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ct.arraySlice(e,0,o),this.values=ct.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ct.arraySlice(this.times,0),t=ct.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Bn.prototype.TimeBufferType=Float32Array,Bn.prototype.ValueBufferType=Float32Array,Bn.prototype.DefaultInterpolation=Nr;class Jr extends Bn{}Jr.prototype.ValueTypeName="bool",Jr.prototype.ValueBufferType=Array,Jr.prototype.DefaultInterpolation=Is,Jr.prototype.InterpolantFactoryMethodLinear=void 0,Jr.prototype.InterpolantFactoryMethodSmooth=void 0;class Dh extends Bn{}Dh.prototype.ValueTypeName="color";class vo extends Bn{}vo.prototype.ValueTypeName="number";class ob extends ni{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Kr extends Bn{InterpolantFactoryMethodLinear(e){return new ob(this.times,this.values,this.getValueSize(),e)}}Kr.prototype.ValueTypeName="quaternion",Kr.prototype.DefaultInterpolation=Nr,Kr.prototype.InterpolantFactoryMethodSmooth=void 0;class qr extends Bn{}qr.prototype.ValueTypeName="string",qr.prototype.ValueBufferType=Array,qr.prototype.DefaultInterpolation=Is,qr.prototype.InterpolantFactoryMethodLinear=void 0,qr.prototype.InterpolantFactoryMethodSmooth=void 0;class yo extends Bn{}yo.prototype.ValueTypeName="vector";class bo{constructor(e,t=-1,i,r=Nl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=pn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(fN(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(Bn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=ct.getKeyframeOrder(u);u=ct.sortedArray(u,1,f),c=ct.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new vo(".morphTargetInfluences["+t[l].name+"]",u,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const d=f[1];let p=r[d];p||(r[d]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,g,m,h){if(g.length!==0){const b=[],y=[];ct.flattenJSON(g,b,y,m),b.length!==0&&h.push(new d(p,b,y))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let d=0;d<c.length;d++){const p=c[d].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const g={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let h=0;h<p[m].morphTargets.length;h++)g[p[m].morphTargets[h]]=-1;for(const h in g){const b=[],y=[];for(let v=0;v!==p[m].morphTargets.length;++v){const M=p[m];b.push(M.time),y.push(M.morphTarget===h?1:0)}r.push(new vo(".morphTargetInfluence["+h+"]",b,y))}u=g.length*o}else{const g=".bones["+t[d].name+"]";i(yo,g+".position",p,"pos",r),i(Kr,g+".quaternion",p,"rot",r),i(yo,g+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function hN(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return vo;case"vector":case"vector2":case"vector3":case"vector4":return yo;case"color":return Dh;case"quaternion":return Kr;case"bool":case"boolean":return Jr;case"string":return qr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function fN(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=hN(n.type);if(n.times===void 0){const t=[],i=[];ct.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Qr={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class kh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,d){return c.push(f,d),this},this.removeHandler=function(f){const d=c.indexOf(f);return d!==-1&&c.splice(d,2),this},this.getHandler=function(f){for(let d=0,p=c.length;d<p;d+=2){const g=c[d],m=c[d+1];if(g.global&&(g.lastIndex=0),g.test(f))return m}return null}}}const ab=new kh;class Xt{constructor(e){this.manager=e!==void 0?e:ab,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Dn={};class yn extends Xt{constructor(e){super(e)}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=Qr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(Dn[e]!==void 0){Dn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],d=!!u[2];let p=u[3];p=decodeURIComponent(p),d&&(p=atob(p));try{let g;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const h=new Uint8Array(p.length);for(let y=0;y<p.length;y++)h[y]=p.charCodeAt(y);m==="blob"?g=new Blob([h.buffer],{type:f}):g=h.buffer;break;case"document":g=new DOMParser().parseFromString(p,f);break;case"json":g=JSON.parse(p);break;default:g=p;break}setTimeout(function(){t&&t(g),s.manager.itemEnd(e)},0)}catch(g){setTimeout(function(){r&&r(g),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{Dn[e]=[],Dn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const d=this.response,p=Dn[e];if(delete Dn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Qr.add(e,d);for(let g=0,m=p.length;g<m;g++){const h=p[g];h.onLoad&&h.onLoad(d)}s.manager.itemEnd(e)}else{for(let g=0,m=p.length;g<m;g++){const h=p[g];h.onError&&h.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const d=Dn[e];for(let p=0,g=d.length;p<g;p++){const m=d[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const d=Dn[e];delete Dn[e];for(let p=0,g=d.length;p<g;p++){const m=d[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const d=Dn[e];delete Dn[e];for(let p=0,g=d.length;p<g;p++){const m=d[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class pN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=bo.parse(e[i]);t.push(r)}return t}}class mN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new ph,u=new yn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(d){u.load(e[d],function(p){const g=s.parse(p,!0);o[d]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},c+=1,c===6&&(g.mipmapCount===1&&(l.minFilter=gt),l.image=o,l.format=g.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)f(d);else u.load(e,function(d){const p=s.parse(d,!0);if(p.isCubemap){const g=p.mipmaps.length/p.mipmapCount;for(let m=0;m<g;m++){o[m]={mipmaps:[]};for(let h=0;h<p.mipmapCount;h++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+h]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=gt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class Pa extends Xt{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Qr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),Qr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class lb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Js,o=new Pa(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class cb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new jr,l=new yn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:Ut,o.wrapT=c.wrapT!==void 0?c.wrapT:Ut,o.magFilter=c.magFilter!==void 0?c.magFilter:gt,o.minFilter=c.minFilter!==void 0?c.minFilter:gt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=Si),c.mipmapCount===1&&(o.minFilter=gt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Vh extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Mt,o=new Pa(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Ti:fn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class ub extends vn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Ea(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}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;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!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;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new _h[r.type]().fromJSON(r))}return this}}class Ia extends ub{constructor(e){super(),this.type="Path",this.currentPoint=new Ae,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Ea(this.currentPoint.clone(),new Ae(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new Sc(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new Ac(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r),new Ae(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new _c(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new Sa(e,t,i,r,s,o,l,u);if(this.curves.length>0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),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 gr extends Ia{constructor(e){super(e),this.uuid=pn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Ia().fromJSON(r))}return this}}class kn extends Xe{constructor(e,t=1){super(),this.type="Light",this.color=new Ce(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}kn.prototype.isLight=!0;class zh extends kn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.groundColor=new Ce(t)}copy(e){return kn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}zh.prototype.isHemisphereLight=!0;const db=new Oe,hb=new ee,fb=new ee;class Uh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Ae(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ua,this._frameExtents=new Ae(1,1),this._viewportCount=1,this._viewports=[new it(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;hb.setFromMatrixPosition(e.matrixWorld),t.position.copy(hb),fb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(fb),t.updateMatrixWorld(),db.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(db),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class pb extends Uh{constructor(){super(new kt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=ia*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}pb.prototype.isSpotLightShadow=!0;class Fc extends kn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new pb}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Fc.prototype.isSpotLight=!0;const mb=new Oe,Oa=new ee,Gh=new ee;class gb extends Uh{constructor(){super(new kt(90,1,.5,500)),this._frameExtents=new Ae(4,2),this._viewportCount=6,this._viewports=[new it(2,1,1,1),new it(0,1,1,1),new it(3,1,1,1),new it(1,1,1,1),new it(3,0,1,1),new it(1,0,1,1)],this._cubeDirections=[new ee(1,0,0),new ee(-1,0,0),new ee(0,0,1),new ee(0,0,-1),new ee(0,1,0),new ee(0,-1,0)],this._cubeUps=[new ee(0,1,0),new ee(0,1,0),new ee(0,1,0),new ee(0,1,0),new ee(0,0,1),new ee(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Oa.setFromMatrixPosition(e.matrixWorld),i.position.copy(Oa),Gh.copy(i.position),Gh.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Gh),i.updateMatrixWorld(),r.makeTranslation(-Oa.x,-Oa.y,-Oa.z),mb.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mb)}}gb.prototype.isPointLightShadow=!0;class Pc extends kn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new gb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Pc.prototype.isPointLight=!0;class xo extends ca{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){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.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}xo.prototype.isOrthographicCamera=!0;class vb extends Uh{constructor(){super(new xo(-5,5,5,-5,.5,500))}}vb.prototype.isDirectionalLightShadow=!0;class Ic extends kn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.shadow=new vb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Ic.prototype.isDirectionalLight=!0;class Hh extends kn{constructor(e,t){super(e,t),this.type="AmbientLight"}}Hh.prototype.isAmbientLight=!0;class Wh extends kn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Wh.prototype.isRectAreaLight=!0;class jh{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new ee)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}jh.prototype.isSphericalHarmonics3=!0;class Na extends kn{constructor(e=new jh,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Na.prototype.isLightProbe=!0;class yb extends Xt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new dN[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Ce().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0: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 Ce().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new ee().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Oe().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.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),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 Ae().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.envMap!==void 0&&(r.envMap=i(e.envMap)),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 Ae().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Bi{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class $h extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}$h.prototype.isInstancedBufferGeometry=!0;class Zh extends Ze{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Zh.prototype.isInstancedBufferAttribute=!0;class bb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(g,m){if(t[m]!==void 0)return t[m];const b=g.interleavedBuffers[m],y=s(g,b.buffer),v=Ws(b.type,y),M=new hr(v,b.stride);return M.uuid=b.uuid,t[m]=M,M}function s(g,m){if(i[m]!==void 0)return i[m];const b=g.arrayBuffers[m],y=new Uint32Array(b).buffer;return i[m]=y,y}const o=e.isInstancedBufferGeometry?new $h:new ke,l=e.data.index;if(l!==void 0){const g=Ws(l.type,l.array);o.setIndex(new Ze(g,1))}const u=e.data.attributes;for(const g in u){const m=u[g];let h;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);h=new Ni(b,m.itemSize,m.offset,m.normalized)}else{const b=Ws(m.type,m.array),y=m.isInstancedBufferAttribute?Zh:Ze;h=new y(b,m.itemSize,m.normalized)}m.name!==void 0&&(h.name=m.name),m.usage!==void 0&&h.setUsage(m.usage),m.updateRange!==void 0&&(h.updateRange.offset=m.updateRange.offset,h.updateRange.count=m.updateRange.count),o.setAttribute(g,h)}const c=e.data.morphAttributes;if(c)for(const g in c){const m=c[g],h=[];for(let b=0,y=m.length;b<y;b++){const v=m[b];let M;if(v.isInterleavedBufferAttribute){const A=r(e.data,v.data);M=new Ni(A,v.itemSize,v.offset,v.normalized)}else{const A=Ws(v.type,v.array);M=new Ze(A,v.itemSize,v.normalized)}v.name!==void 0&&(M.name=v.name),h.push(M)}o.morphAttributes[g]=h}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const d=e.data.groups||e.data.drawcalls||e.data.offsets;if(d!==void 0)for(let g=0,m=d.length;g!==m;++g){const h=d[g];o.addGroup(h.start,h.count,h.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const g=new ee;p.center!==void 0&&g.fromArray(p.center),o.boundingSphere=new Ci(g,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class gN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new yn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(d){r!==void 0&&r(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new yn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let d=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){d=!0;break}d===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new gr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new Ma().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new bb;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in ib?l=ib[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new yb;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const d=u.materials[f];i[d.uuid]===void 0&&(i[d.uuid]=s.parse(d)),c.push(i[d.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=bo.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:Ws(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new kh(t);s=new Pa(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const d=e[c],p=d.url;if(Array.isArray(p)){r[d.uuid]=[];for(let g=0,m=p.length;g<m;g++){const h=p[g],b=l(h);b!==null&&(b instanceof HTMLImageElement?r[d.uuid].push(b):r[d.uuid].push(new jr(b.data,b.width,b.height)))}}else{const g=l(d.url);g!==null&&(r[d.uuid]=g)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:Ws(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Pa(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,d=c.length;f<d;f++){const p=c[f],g=await s(p);g!==null&&(g instanceof HTMLImageElement?i[u.uuid].push(g):i[u.uuid].push(new jr(g.data,g.width,g.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new Js(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new jr(c.data,c.width,c.height):u=new Mt(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,vN)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],xb),u.wrapT=i(l.wrap[1],xb)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,wb)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,wb)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const g=[];for(let m=0,h=p.length;m<h;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),g.push(i[b])}return g}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,d;switch(e.type){case"Scene":o=new cc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Ce(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new pa(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new fa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new kt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new xo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Hh(e.color,e.intensity);break;case"DirectionalLight":o=new Ic(e.color,e.intensity);break;case"PointLight":o=new Pc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Wh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Fc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new zh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Na().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),d=u(e.material),o=new xa(f,d),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),d=u(e.material),o=new St(f,d);break;case"InstancedMesh":f=l(e.geometry),d=u(e.material);const p=e.count,g=e.instanceMatrix,m=e.instanceColor;o=new dh(f,d,p),o.instanceMatrix=new Ze(new Float32Array(g.array),16),m!==void 0&&(o.instanceColor=new Ze(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new Fy;break;case"Line":o=new Qn(l(e.geometry),u(e.material));break;case"LineLoop":o=new gc(l(e.geometry),u(e.material));break;case"LineSegments":o=new rn(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new io(l(e.geometry),u(e.material));break;case"Sprite":o=new ba(u(e.material));break;case"Group":o=new qn;break;case"Bone":o=new wa;break;default:o=new Xe}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.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(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 p=e.children;for(let g=0;g<p.length;g++)o.add(this.parseObject(p[g],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let g=0;g<p.length;g++){const m=p[g];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let g=0;g<p.length;g++){const m=p[g],h=o.getObjectByProperty("uuid",m.object);h!==void 0&&o.addLevel(h,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const vN={UVMapping:Rl,CubeReflectionMapping:Yo,CubeRefractionMapping:Jo,EquirectangularReflectionMapping:Fl,EquirectangularRefractionMapping:Pl,CubeUVReflectionMapping:Ls,CubeUVRefractionMapping:Ko},xb={RepeatWrapping:er,ClampToEdgeWrapping:Ut,MirroredRepeatWrapping:Rs},wb={NearestFilter:wt,NearestMipmapNearestFilter:qo,NearestMipmapLinearFilter:Qo,LinearFilter:gt,LinearMipmapNearestFilter:Il,LinearMipmapLinearFilter:Si};class Xh extends Xt{constructor(e){super(e),typeof createImageBitmap>"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=Qr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Qr.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}Xh.prototype.isImageBitmapLoader=!0;class Mb{constructor(){this.type="ShapePath",this.color=new Ce,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ia,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,t){function i(v){const M=[];for(let A=0,_=v.length;A<_;A++){const w=v[A],C=new gr;C.curves=w.curves,M.push(C)}return M}function r(v,M){const A=M.length;let _=!1;for(let w=A-1,C=0;C<A;w=C++){let P=M[w],R=M[C],I=R.x-P.x,S=R.y-P.y;if(Math.abs(S)>Number.EPSILON){if(S<0&&(P=M[C],I=-I,R=M[w],S=-S),v.y<P.y||v.y>R.y)continue;if(v.y===P.y){if(v.x===P.x)return!0}else{const T=S*(v.x-P.x)-I*(v.y-P.y);if(T===0)return!0;if(T<0)continue;_=!_}}else{if(v.y!==P.y)continue;if(R.x<=v.x&&v.x<=P.x||P.x<=v.x&&v.x<=R.x)return!0}}return _}const s=ti.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new gr,c.curves=u.curves,f.push(c),f;let d=!s(o[0].getPoints());d=e?!d:d;const p=[],g=[];let m=[],h=0,b;g[h]=void 0,m[h]=[];for(let v=0,M=o.length;v<M;v++)u=o[v],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!d&&g[h]&&h++,g[h]={s:new gr,p:b},g[h].s.curves=u.curves,d&&h++,m[h]=[]):m[h].push({h:u,p:b[0]});if(!g[0])return i(o);if(g.length>1){let v=!1;const M=[];for(let A=0,_=g.length;A<_;A++)p[A]=[];for(let A=0,_=g.length;A<_;A++){const w=m[A];for(let C=0;C<w.length;C++){const P=w[C];let R=!0;for(let I=0;I<g.length;I++)r(P.p,g[I].p)&&(A!==I&&M.push({froms:A,tos:I,hole:C}),R?(R=!1,p[I].push(P)):v=!0);R&&p[A].push(P)}}M.length>0&&(v||(m=p))}let y;for(let v=0,M=g.length;v<M;v++){c=g[v].s,f.push(c),y=m[v];for(let A=0,_=y.length;A<_;A++)c.holes.push(y[A].h)}return f}}class Yh{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=yN(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function yN(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
2915
+ }`;function Sy(n,e,t){let i=new ua;const r=new Ae,s=new Ae,o=new it,l=[],u=[],c={},f=t.maxTextureSize,d={0:xt,1:Ki,2:qi},p=new Oi({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:LO,fragmentShader:CO}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ze(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const h=new St(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=sd,this.render=function(w,C,P){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||w.length===0)return;const R=n.getRenderTarget(),I=n.getActiveCubeFace(),S=n.getActiveMipmapLevel(),T=n.state;T.setBlending(Ai),T.buffers.color.setClear(1,1,1,1),T.buffers.depth.setTest(!0),T.setScissorTest(!1);for(let E=0,L=w.length;E<L;E++){const F=w[E],x=F.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",F,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const O=x.getFrameExtents();if(r.multiply(O),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/O.x),r.x=s.x*O.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/O.y),r.y=s.y*O.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Es){const N={minFilter:gt,magFilter:gt,format:fn};x.map=new Rn(r.x,r.y,N),x.map.texture.name=F.name+".shadowMap",x.mapPass=new Rn(r.x,r.y,N),x.camera.updateProjectionMatrix()}if(x.map===null){const N={minFilter:wt,magFilter:wt,format:fn};x.map=new Rn(r.x,r.y,N),x.map.texture.name=F.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let N=0;N<B;N++){const k=x.getViewport(N);o.set(s.x*k.x,s.y*k.y,s.x*k.z,s.y*k.w),T.viewport(o),x.updateMatrices(F,N),i=x.getFrustum(),_(C,P,x.camera,F,this.type)}!x.isPointLightShadow&&this.type===Es&&y(x,P),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(R,I,S)};function y(w,C){const P=e.update(h);p.uniforms.shadow_pass.value=w.map.texture,p.uniforms.resolution.value=w.mapSize,p.uniforms.radius.value=w.radius,n.setRenderTarget(w.mapPass),n.clear(),n.renderBufferDirect(C,null,P,p,h,null),g.uniforms.shadow_pass.value=w.mapPass.texture,g.uniforms.resolution.value=w.mapSize,g.uniforms.radius.value=w.radius,n.setRenderTarget(w.map),n.clear(),n.renderBufferDirect(C,null,P,g,h,null)}function v(w){const C=w<<0;let P=l[C];return P===void 0&&(P=new ac({depthPacking:C0,morphTargets:w}),l[C]=P),P}function M(w){const C=w<<0;let P=u[C];return P===void 0&&(P=new lc({morphTargets:w}),u[C]=P),P}function A(w,C,P,R,I,S,T){let E=null,L=v,F=w.customDepthMaterial;if(R.isPointLight===!0&&(L=M,F=w.customDistanceMaterial),F===void 0){let x=!1;P.morphTargets===!0&&(x=C.morphAttributes&&C.morphAttributes.position&&C.morphAttributes.position.length>0),E=L(x)}else E=F;if(n.localClippingEnabled&&P.clipShadows===!0&&P.clippingPlanes.length!==0){const x=E.uuid,O=P.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let N=B[O];N===void 0&&(N=E.clone(),B[O]=N),E=N}return E.visible=P.visible,E.wireframe=P.wireframe,T===Es?E.side=P.shadowSide!==null?P.shadowSide:P.side:E.side=P.shadowSide!==null?P.shadowSide:d[P.side],E.clipShadows=P.clipShadows,E.clippingPlanes=P.clippingPlanes,E.clipIntersection=P.clipIntersection,E.wireframeLinewidth=P.wireframeLinewidth,E.linewidth=P.linewidth,R.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(R.matrixWorld),E.nearDistance=I,E.farDistance=S),E}function _(w,C,P,R,I){if(w.visible===!1)return;if(w.layers.test(C.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&I===Es)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,w.matrixWorld);const E=e.update(w),L=w.material;if(Array.isArray(L)){const F=E.groups;for(let x=0,O=F.length;x<O;x++){const B=F[x],N=L[B.materialIndex];if(N&&N.visible){const k=A(w,E,N,R,P.near,P.far,I);n.renderBufferDirect(P,null,E,k,w,B)}}}else if(L.visible){const F=A(w,E,L,R,P.near,P.far,I);n.renderBufferDirect(P,null,E,F,w,null)}}const T=w.children;for(let E=0,L=T.length;E<L;E++)_(T[E],C,P,R,I)}}function RO(n,e,t){const i=t.isWebGL2;function r(){let ne=!1;const de=new it;let ve=null;const Ee=new it(0,0,0,0);return{setMask:function(Se){ve!==Se&&!ne&&(n.colorMask(Se,Se,Se,Se),ve=Se)},setLocked:function(Se){ne=Se},setClear:function(Se,Ie,Je,Ve,st){st===!0&&(Se*=Ve,Ie*=Ve,Je*=Ve),de.set(Se,Ie,Je,Ve),Ee.equals(de)===!1&&(n.clearColor(Se,Ie,Je,Ve),Ee.copy(de))},reset:function(){ne=!1,ve=null,Ee.set(-1,0,0,0)}}}function s(){let ne=!1,de=null,ve=null,Ee=null;return{setTest:function(Se){Se?Z(2929):te(2929)},setMask:function(Se){de!==Se&&!ne&&(n.depthMask(Se),de=Se)},setFunc:function(Se){if(ve!==Se){if(Se)switch(Se){case mv:n.depthFunc(512);break;case gv:n.depthFunc(519);break;case vv:n.depthFunc(513);break;case Ll:n.depthFunc(515);break;case yv:n.depthFunc(514);break;case bv:n.depthFunc(518);break;case xv:n.depthFunc(516);break;case wv:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);ve=Se}},setLocked:function(Se){ne=Se},setClear:function(Se){Ee!==Se&&(n.clearDepth(Se),Ee=Se)},reset:function(){ne=!1,de=null,ve=null,Ee=null}}}function o(){let ne=!1,de=null,ve=null,Ee=null,Se=null,Ie=null,Je=null,Ve=null,st=null;return{setTest:function(Re){ne||(Re?Z(2960):te(2960))},setMask:function(Re){de!==Re&&!ne&&(n.stencilMask(Re),de=Re)},setFunc:function(Re,Ue,We){(ve!==Re||Ee!==Ue||Se!==We)&&(n.stencilFunc(Re,Ue,We),ve=Re,Ee=Ue,Se=We)},setOp:function(Re,Ue,We){(Ie!==Re||Je!==Ue||Ve!==We)&&(n.stencilOp(Re,Ue,We),Ie=Re,Je=Ue,Ve=We)},setLocked:function(Re){ne=Re},setClear:function(Re){st!==Re&&(n.clearStencil(Re),st=Re)},reset:function(){ne=!1,de=null,ve=null,Ee=null,Se=null,Ie=null,Je=null,Ve=null,st=null}}}const l=new r,u=new s,c=new o;let f={},d=null,p={},g=null,m=!1,h=null,b=null,y=null,v=null,M=null,A=null,_=null,w=!1,C=null,P=null,R=null,I=null,S=null;const T=n.getParameter(35661);let E=!1,L=0;const F=n.getParameter(7938);F.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(F)[1]),E=L>=1):F.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),E=L>=2);let x=null,O={};const B=n.getParameter(3088),N=n.getParameter(2978),k=new it().fromArray(B),z=new it().fromArray(N);function G(ne,de,ve){const Ee=new Uint8Array(4),Se=n.createTexture();n.bindTexture(ne,Se),n.texParameteri(ne,10241,9728),n.texParameteri(ne,10240,9728);for(let Ie=0;Ie<ve;Ie++)n.texImage2D(de+Ie,0,6408,1,1,0,6408,5121,Ee);return Se}const Y={};Y[3553]=G(3553,3553,1),Y[34067]=G(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),Z(2929),u.setFunc(Ll),j(!1),oe(rd),Z(2884),re(Ai);function Z(ne){f[ne]!==!0&&(n.enable(ne),f[ne]=!0)}function te(ne){f[ne]!==!1&&(n.disable(ne),f[ne]=!1)}function q(ne){ne!==d&&(n.bindFramebuffer(36160,ne),d=ne)}function W(ne,de){return de===null&&d!==null&&(de=d),p[ne]!==de?(n.bindFramebuffer(ne,de),p[ne]=de,i&&(ne===36009&&(p[36160]=de),ne===36160&&(p[36009]=de)),!0):!1}function $(ne){return g!==ne?(n.useProgram(ne),g=ne,!0):!1}const X={[Fr]:32774,[rv]:32778,[sv]:32779};if(i)X[ud]=32775,X[dd]=32776;else{const ne=e.get("EXT_blend_minmax");ne!==null&&(X[ud]=ne.MIN_EXT,X[dd]=ne.MAX_EXT)}const K={[ov]:0,[av]:1,[lv]:768,[hd]:770,[pv]:776,[hv]:774,[uv]:772,[cv]:769,[fd]:771,[fv]:775,[dv]:773};function re(ne,de,ve,Ee,Se,Ie,Je,Ve){if(ne===Ai){m===!0&&(te(3042),m=!1);return}if(m===!1&&(Z(3042),m=!0),ne!==iv){if(ne!==h||Ve!==w){if((b!==Fr||M!==Fr)&&(n.blendEquation(32774),b=Fr,M=Fr),Ve)switch(ne){case Cs:n.blendFuncSeparate(1,771,1,771);break;case ad:n.blendFunc(1,1);break;case ld:n.blendFuncSeparate(0,0,769,771);break;case cd:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}else switch(ne){case Cs:n.blendFuncSeparate(770,771,1,771);break;case ad:n.blendFunc(770,1);break;case ld:n.blendFunc(0,769);break;case cd:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}y=null,v=null,A=null,_=null,h=ne,w=Ve}return}Se=Se||de,Ie=Ie||ve,Je=Je||Ee,(de!==b||Se!==M)&&(n.blendEquationSeparate(X[de],X[Se]),b=de,M=Se),(ve!==y||Ee!==v||Ie!==A||Je!==_)&&(n.blendFuncSeparate(K[ve],K[Ee],K[Ie],K[Je]),y=ve,v=Ee,A=Ie,_=Je),h=ne,w=null}function V(ne,de){ne.side===qi?te(2884):Z(2884);let ve=ne.side===xt;de&&(ve=!ve),j(ve),ne.blending===Cs&&ne.transparent===!1?re(Ai):re(ne.blending,ne.blendEquation,ne.blendSrc,ne.blendDst,ne.blendEquationAlpha,ne.blendSrcAlpha,ne.blendDstAlpha,ne.premultipliedAlpha),u.setFunc(ne.depthFunc),u.setTest(ne.depthTest),u.setMask(ne.depthWrite),l.setMask(ne.colorWrite);const Ee=ne.stencilWrite;c.setTest(Ee),Ee&&(c.setMask(ne.stencilWriteMask),c.setFunc(ne.stencilFunc,ne.stencilRef,ne.stencilFuncMask),c.setOp(ne.stencilFail,ne.stencilZFail,ne.stencilZPass)),le(ne.polygonOffset,ne.polygonOffsetFactor,ne.polygonOffsetUnits),ne.alphaToCoverage===!0?Z(32926):te(32926)}function j(ne){C!==ne&&(ne?n.frontFace(2304):n.frontFace(2305),C=ne)}function oe(ne){ne!==ev?(Z(2884),ne!==P&&(ne===rd?n.cullFace(1029):ne===tv?n.cullFace(1028):n.cullFace(1032))):te(2884),P=ne}function ae(ne){ne!==R&&(E&&n.lineWidth(ne),R=ne)}function le(ne,de,ve){ne?(Z(32823),(I!==de||S!==ve)&&(n.polygonOffset(de,ve),I=de,S=ve)):te(32823)}function H(ne){ne?Z(3089):te(3089)}function U(ne){ne===void 0&&(ne=33984+T-1),x!==ne&&(n.activeTexture(ne),x=ne)}function D(ne,de){x===null&&U();let ve=O[x];ve===void 0&&(ve={type:void 0,texture:void 0},O[x]=ve),(ve.type!==ne||ve.texture!==de)&&(n.bindTexture(ne,de||Y[ne]),ve.type=ne,ve.texture=de)}function Q(){const ne=O[x];ne!==void 0&&ne.type!==void 0&&(n.bindTexture(ne.type,null),ne.type=void 0,ne.texture=void 0)}function ie(){try{n.compressedTexImage2D.apply(n,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ce(){try{n.texImage2D.apply(n,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ge(){try{n.texImage3D.apply(n,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ye(ne){k.equals(ne)===!1&&(n.scissor(ne.x,ne.y,ne.z,ne.w),k.copy(ne))}function ue(ne){z.equals(ne)===!1&&(n.viewport(ne.x,ne.y,ne.z,ne.w),z.copy(ne))}function be(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},x=null,O={},d=null,p={},g=null,m=!1,h=null,b=null,y=null,v=null,M=null,A=null,_=null,w=!1,C=null,P=null,R=null,I=null,S=null,k.set(0,0,n.canvas.width,n.canvas.height),z.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:Z,disable:te,bindFramebuffer:W,bindXRFramebuffer:q,useProgram:$,setBlending:re,setMaterial:V,setFlipSided:j,setCullFace:oe,setLineWidth:ae,setPolygonOffset:le,setScissorTest:H,activeTexture:U,bindTexture:D,unbindTexture:Q,compressedTexImage2D:ie,texImage2D:ce,texImage3D:ge,scissor:ye,viewport:ue,reset:be}}function FO(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,d=r.maxSamples,p=new WeakMap;let g,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function h(H,U){return m?new OffscreenCanvas(H,U):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(H,U,D,Q){let ie=1;if((H.width>Q||H.height>Q)&&(ie=Q/Math.max(H.width,H.height)),ie<1||U===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const ce=U?P0:Math.floor,ge=ce(ie*H.width),ye=ce(ie*H.height);g===void 0&&(g=h(ge,ye));const ue=D?h(ge,ye):g;return ue.width=ge,ue.height=ye,ue.getContext("2d").drawImage(H,0,0,ge,ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+ge+"x"+ye+")."),ue}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function y(H){return Fd(H.width)&&Fd(H.height)}function v(H){return l?!1:H.wrapS!==Ut||H.wrapT!==Ut||H.minFilter!==wt&&H.minFilter!==gt}function M(H,U){return H.generateMipmaps&&U&&H.minFilter!==wt&&H.minFilter!==gt}function A(H,U,D,Q,ie=1){n.generateMipmap(H);const ce=i.get(U);ce.__maxMipLevel=Math.log2(Math.max(D,Q,ie))}function _(H,U,D){if(l===!1)return U;if(H!==null){if(n[H]!==void 0)return n[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let Q=U;return U===6403&&(D===5126&&(Q=33326),D===5131&&(Q=33325),D===5121&&(Q=33321)),U===6407&&(D===5126&&(Q=34837),D===5131&&(Q=34843),D===5121&&(Q=32849)),U===6408&&(D===5126&&(Q=34836),D===5131&&(Q=34842),D===5121&&(Q=32856)),(Q===33325||Q===33326||Q===34842||Q===34836)&&e.get("EXT_color_buffer_float"),Q}function w(H){return H===wt||H===qo||H===Qo?9728:9729}function C(H){const U=H.target;U.removeEventListener("dispose",C),R(U),U.isVideoTexture&&p.delete(U),o.memory.textures--}function P(H){const U=H.target;U.removeEventListener("dispose",P),I(U)}function R(H){const U=i.get(H);U.__webglInit!==void 0&&(n.deleteTexture(U.__webglTexture),i.remove(H))}function I(H){const U=H.texture,D=i.get(H),Q=i.get(U);if(H){if(Q.__webglTexture!==void 0&&(n.deleteTexture(Q.__webglTexture),o.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let ie=0;ie<6;ie++)n.deleteFramebuffer(D.__webglFramebuffer[ie]),D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer[ie]);else n.deleteFramebuffer(D.__webglFramebuffer),D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer),D.__webglMultisampledFramebuffer&&n.deleteFramebuffer(D.__webglMultisampledFramebuffer),D.__webglColorRenderbuffer&&n.deleteRenderbuffer(D.__webglColorRenderbuffer),D.__webglDepthRenderbuffer&&n.deleteRenderbuffer(D.__webglDepthRenderbuffer);if(H.isWebGLMultipleRenderTargets)for(let ie=0,ce=U.length;ie<ce;ie++){const ge=i.get(U[ie]);ge.__webglTexture&&(n.deleteTexture(ge.__webglTexture),o.memory.textures--),i.remove(U[ie])}i.remove(U),i.remove(H)}}let S=0;function T(){S=0}function E(){const H=S;return H>=u&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+u),S+=1,H}function L(H,U){const D=i.get(H);if(H.isVideoTexture&&V(H),H.version>0&&D.__version!==H.version){const Q=H.image;if(Q===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(D,H,U);return}}t.activeTexture(33984+U),t.bindTexture(3553,D.__webglTexture)}function F(H,U){const D=i.get(H);if(H.version>0&&D.__version!==H.version){G(D,H,U);return}t.activeTexture(33984+U),t.bindTexture(35866,D.__webglTexture)}function x(H,U){const D=i.get(H);if(H.version>0&&D.__version!==H.version){G(D,H,U);return}t.activeTexture(33984+U),t.bindTexture(32879,D.__webglTexture)}function O(H,U){const D=i.get(H);if(H.version>0&&D.__version!==H.version){Y(D,H,U);return}t.activeTexture(33984+U),t.bindTexture(34067,D.__webglTexture)}const B={[er]:10497,[Ut]:33071,[Rs]:33648},N={[wt]:9728,[qo]:9984,[Qo]:9986,[gt]:9729,[Il]:9985,[Si]:9987};function k(H,U,D){if(D?(n.texParameteri(H,10242,B[U.wrapS]),n.texParameteri(H,10243,B[U.wrapT]),(H===32879||H===35866)&&n.texParameteri(H,32882,B[U.wrapR]),n.texParameteri(H,10240,N[U.magFilter]),n.texParameteri(H,10241,N[U.minFilter])):(n.texParameteri(H,10242,33071),n.texParameteri(H,10243,33071),(H===32879||H===35866)&&n.texParameteri(H,32882,33071),(U.wrapS!==Ut||U.wrapT!==Ut)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(H,10240,w(U.magFilter)),n.texParameteri(H,10241,w(U.minFilter)),U.minFilter!==wt&&U.minFilter!==gt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Q=e.get("EXT_texture_filter_anisotropic");if(U.type===_i&&e.has("OES_texture_float_linear")===!1||l===!1&&U.type===Ir&&e.has("OES_texture_half_float_linear")===!1)return;(U.anisotropy>1||i.get(U).__currentAnisotropy)&&(n.texParameterf(H,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy)}}function z(H,U){H.__webglInit===void 0&&(H.__webglInit=!0,U.addEventListener("dispose",C),H.__webglTexture=n.createTexture(),o.memory.textures++)}function G(H,U,D){let Q=3553;U.isDataTexture2DArray&&(Q=35866),U.isDataTexture3D&&(Q=32879),z(H,U),t.activeTexture(33984+D),t.bindTexture(Q,H.__webglTexture),n.pixelStorei(37440,U.flipY),n.pixelStorei(37441,U.premultiplyAlpha),n.pixelStorei(3317,U.unpackAlignment),n.pixelStorei(37443,0);const ie=v(U)&&y(U.image)===!1,ce=b(U.image,ie,!1,f),ge=y(ce)||l,ye=s.convert(U.format);let ue=s.convert(U.type),be=_(U.internalFormat,ye,ue);k(Q,U,ge);let ne;const de=U.mipmaps;if(U.isDepthTexture)be=6402,l?U.type===_i?be=36012:U.type===ta?be=33190:U.type===Fs?be=35056:be=33189:U.type===_i&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),U.format===Or&&be===6402&&U.type!==ea&&U.type!==ta&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),U.type=ea,ue=s.convert(U.type)),U.format===Ps&&be===6402&&(be=34041,U.type!==Fs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),U.type=Fs,ue=s.convert(U.type))),t.texImage2D(3553,0,be,ce.width,ce.height,0,ye,ue,null);else if(U.isDataTexture)if(de.length>0&&ge){for(let ve=0,Ee=de.length;ve<Ee;ve++)ne=de[ve],t.texImage2D(3553,ve,be,ne.width,ne.height,0,ye,ue,ne.data);U.generateMipmaps=!1,H.__maxMipLevel=de.length-1}else t.texImage2D(3553,0,be,ce.width,ce.height,0,ye,ue,ce.data),H.__maxMipLevel=0;else if(U.isCompressedTexture){for(let ve=0,Ee=de.length;ve<Ee;ve++)ne=de[ve],U.format!==fn&&U.format!==Ti?ye!==null?t.compressedTexImage2D(3553,ve,be,ne.width,ne.height,0,ne.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ve,be,ne.width,ne.height,0,ye,ue,ne.data);H.__maxMipLevel=de.length-1}else if(U.isDataTexture2DArray)t.texImage3D(35866,0,be,ce.width,ce.height,ce.depth,0,ye,ue,ce.data),H.__maxMipLevel=0;else if(U.isDataTexture3D)t.texImage3D(32879,0,be,ce.width,ce.height,ce.depth,0,ye,ue,ce.data),H.__maxMipLevel=0;else if(de.length>0&&ge){for(let ve=0,Ee=de.length;ve<Ee;ve++)ne=de[ve],t.texImage2D(3553,ve,be,ye,ue,ne);U.generateMipmaps=!1,H.__maxMipLevel=de.length-1}else t.texImage2D(3553,0,be,ye,ue,ce),H.__maxMipLevel=0;M(U,ge)&&A(Q,U,ce.width,ce.height),H.__version=U.version,U.onUpdate&&U.onUpdate(U)}function Y(H,U,D){if(U.image.length!==6)return;z(H,U),t.activeTexture(33984+D),t.bindTexture(34067,H.__webglTexture),n.pixelStorei(37440,U.flipY),n.pixelStorei(37441,U.premultiplyAlpha),n.pixelStorei(3317,U.unpackAlignment),n.pixelStorei(37443,0);const Q=U&&(U.isCompressedTexture||U.image[0].isCompressedTexture),ie=U.image[0]&&U.image[0].isDataTexture,ce=[];for(let ve=0;ve<6;ve++)!Q&&!ie?ce[ve]=b(U.image[ve],!1,!0,c):ce[ve]=ie?U.image[ve].image:U.image[ve];const ge=ce[0],ye=y(ge)||l,ue=s.convert(U.format),be=s.convert(U.type),ne=_(U.internalFormat,ue,be);k(34067,U,ye);let de;if(Q){for(let ve=0;ve<6;ve++){de=ce[ve].mipmaps;for(let Ee=0;Ee<de.length;Ee++){const Se=de[Ee];U.format!==fn&&U.format!==Ti?ue!==null?t.compressedTexImage2D(34069+ve,Ee,ne,Se.width,Se.height,0,Se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ve,Ee,ne,Se.width,Se.height,0,ue,be,Se.data)}}H.__maxMipLevel=de.length-1}else{de=U.mipmaps;for(let ve=0;ve<6;ve++)if(ie){t.texImage2D(34069+ve,0,ne,ce[ve].width,ce[ve].height,0,ue,be,ce[ve].data);for(let Ee=0;Ee<de.length;Ee++){const Ie=de[Ee].image[ve].image;t.texImage2D(34069+ve,Ee+1,ne,Ie.width,Ie.height,0,ue,be,Ie.data)}}else{t.texImage2D(34069+ve,0,ne,ue,be,ce[ve]);for(let Ee=0;Ee<de.length;Ee++){const Se=de[Ee];t.texImage2D(34069+ve,Ee+1,ne,ue,be,Se.image[ve])}}H.__maxMipLevel=de.length}M(U,ye)&&A(34067,U,ge.width,ge.height),H.__version=U.version,U.onUpdate&&U.onUpdate(U)}function Z(H,U,D,Q,ie){const ce=s.convert(D.format),ge=s.convert(D.type),ye=_(D.internalFormat,ce,ge);ie===32879||ie===35866?t.texImage3D(ie,0,ye,U.width,U.height,U.depth,0,ce,ge,null):t.texImage2D(ie,0,ye,U.width,U.height,0,ce,ge,null),t.bindFramebuffer(36160,H),n.framebufferTexture2D(36160,Q,ie,i.get(D).__webglTexture,0),t.bindFramebuffer(36160,null)}function te(H,U,D){if(n.bindRenderbuffer(36161,H),U.depthBuffer&&!U.stencilBuffer){let Q=33189;if(D){const ie=U.depthTexture;ie&&ie.isDepthTexture&&(ie.type===_i?Q=36012:ie.type===ta&&(Q=33190));const ce=re(U);n.renderbufferStorageMultisample(36161,ce,Q,U.width,U.height)}else n.renderbufferStorage(36161,Q,U.width,U.height);n.framebufferRenderbuffer(36160,36096,36161,H)}else if(U.depthBuffer&&U.stencilBuffer){if(D){const Q=re(U);n.renderbufferStorageMultisample(36161,Q,35056,U.width,U.height)}else n.renderbufferStorage(36161,34041,U.width,U.height);n.framebufferRenderbuffer(36160,33306,36161,H)}else{const Q=U.isWebGLMultipleRenderTargets===!0?U.texture[0]:U.texture,ie=s.convert(Q.format),ce=s.convert(Q.type),ge=_(Q.internalFormat,ie,ce);if(D){const ye=re(U);n.renderbufferStorageMultisample(36161,ye,ge,U.width,U.height)}else n.renderbufferStorage(36161,ge,U.width,U.height)}n.bindRenderbuffer(36161,null)}function q(H,U){if(U&&U.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,H),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(U.depthTexture).__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),L(U.depthTexture,0);const Q=i.get(U.depthTexture).__webglTexture;if(U.depthTexture.format===Or)n.framebufferTexture2D(36160,36096,3553,Q,0);else if(U.depthTexture.format===Ps)n.framebufferTexture2D(36160,33306,3553,Q,0);else throw new Error("Unknown depthTexture format")}function W(H){const U=i.get(H),D=H.isWebGLCubeRenderTarget===!0;if(H.depthTexture){if(D)throw new Error("target.depthTexture not supported in Cube render targets");q(U.__webglFramebuffer,H)}else if(D){U.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)t.bindFramebuffer(36160,U.__webglFramebuffer[Q]),U.__webglDepthbuffer[Q]=n.createRenderbuffer(),te(U.__webglDepthbuffer[Q],H,!1)}else t.bindFramebuffer(36160,U.__webglFramebuffer),U.__webglDepthbuffer=n.createRenderbuffer(),te(U.__webglDepthbuffer,H,!1);t.bindFramebuffer(36160,null)}function $(H){const U=H.texture,D=i.get(H),Q=i.get(U);H.addEventListener("dispose",P),H.isWebGLMultipleRenderTargets!==!0&&(Q.__webglTexture=n.createTexture(),Q.__version=U.version,o.memory.textures++);const ie=H.isWebGLCubeRenderTarget===!0,ce=H.isWebGLMultipleRenderTargets===!0,ge=H.isWebGLMultisampleRenderTarget===!0,ye=U.isDataTexture3D||U.isDataTexture2DArray,ue=y(H)||l;if(l&&U.format===Ti&&(U.type===_i||U.type===Ir)&&(U.format=fn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ie){D.__webglFramebuffer=[];for(let be=0;be<6;be++)D.__webglFramebuffer[be]=n.createFramebuffer()}else if(D.__webglFramebuffer=n.createFramebuffer(),ce)if(r.drawBuffers){const be=H.texture;for(let ne=0,de=be.length;ne<de;ne++){const ve=i.get(be[ne]);ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(ge)if(l){D.__webglMultisampledFramebuffer=n.createFramebuffer(),D.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,D.__webglColorRenderbuffer);const be=s.convert(U.format),ne=s.convert(U.type),de=_(U.internalFormat,be,ne),ve=re(H);n.renderbufferStorageMultisample(36161,ve,de,H.width,H.height),t.bindFramebuffer(36160,D.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,D.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),H.depthBuffer&&(D.__webglDepthRenderbuffer=n.createRenderbuffer(),te(D.__webglDepthRenderbuffer,H,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ie){t.bindTexture(34067,Q.__webglTexture),k(34067,U,ue);for(let be=0;be<6;be++)Z(D.__webglFramebuffer[be],H,U,36064,34069+be);M(U,ue)&&A(34067,U,H.width,H.height),t.bindTexture(34067,null)}else if(ce){const be=H.texture;for(let ne=0,de=be.length;ne<de;ne++){const ve=be[ne],Ee=i.get(ve);t.bindTexture(3553,Ee.__webglTexture),k(3553,ve,ue),Z(D.__webglFramebuffer,H,ve,36064+ne,3553),M(ve,ue)&&A(3553,ve,H.width,H.height)}t.bindTexture(3553,null)}else{let be=3553;ye&&(l?be=U.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(be,Q.__webglTexture),k(be,U,ue),Z(D.__webglFramebuffer,H,U,36064,be),M(U,ue)&&A(be,U,H.width,H.height,H.depth),t.bindTexture(be,null)}H.depthBuffer&&W(H)}function X(H){const U=y(H)||l,D=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let Q=0,ie=D.length;Q<ie;Q++){const ce=D[Q];if(M(ce,U)){const ge=H.isWebGLCubeRenderTarget?34067:3553,ye=i.get(ce).__webglTexture;t.bindTexture(ge,ye),A(ge,ce,H.width,H.height),t.bindTexture(ge,null)}}}function K(H){if(H.isWebGLMultisampleRenderTarget)if(l){const U=H.width,D=H.height;let Q=16384;H.depthBuffer&&(Q|=256),H.stencilBuffer&&(Q|=1024);const ie=i.get(H);t.bindFramebuffer(36008,ie.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ie.__webglFramebuffer),n.blitFramebuffer(0,0,U,D,0,0,U,D,Q,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ie.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function re(H){return l&&H.isWebGLMultisampleRenderTarget?Math.min(d,H.samples):0}function V(H){const U=o.render.frame;p.get(H)!==U&&(p.set(H,U),H.update())}let j=!1,oe=!1;function ae(H,U){H&&H.isWebGLRenderTarget&&(j===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),j=!0),H=H.texture),L(H,U)}function le(H,U){H&&H.isWebGLCubeRenderTarget&&(oe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),oe=!0),H=H.texture),O(H,U)}this.allocateTextureUnit=E,this.resetTextureUnits=T,this.setTexture2D=L,this.setTexture2DArray=F,this.setTexture3D=x,this.setTextureCube=O,this.setupRenderTarget=$,this.updateRenderTargetMipmap=X,this.updateMultisampleRenderTarget=K,this.safeSetTexture2D=ae,this.safeSetTextureCube=le}function _y(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Pr)return 5121;if(s===Pv)return 32819;if(s===Iv)return 32820;if(s===Ov)return 33635;if(s===Lv)return 5120;if(s===Rv)return 5122;if(s===ea)return 5123;if(s===Fv)return 5124;if(s===ta)return 5125;if(s===_i)return 5126;if(s===Ir)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===Nv)return 6406;if(s===Ti)return 6407;if(s===fn)return 6408;if(s===Bv)return 6409;if(s===Dv)return 6410;if(s===Or)return 6402;if(s===Ps)return 34041;if(s===Vv)return 6403;if(s===zv)return 36244;if(s===Uv)return 33319;if(s===Gv)return 33320;if(s===Hv)return 36248;if(s===Wv)return 36249;if(s===pd||s===md||s===gd||s===vd)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===pd)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===md)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===gd)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===vd)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===yd||s===bd||s===xd||s===wd)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===yd)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===bd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===xd)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===wd)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===jv)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===Md||s===Ad)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===Md)return o.COMPRESSED_RGB8_ETC2;if(s===Ad)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===$v||s===Zv||s===Xv||s===Yv||s===Jv||s===Kv||s===qv||s===Qv||s===e0||s===t0||s===n0||s===i0||s===r0||s===s0||s===a0||s===l0||s===c0||s===u0||s===d0||s===h0||s===f0||s===p0||s===m0||s===g0||s===v0||s===y0||s===b0||s===x0)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===o0)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Fs)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class lh extends kt{constructor(e=[]){super(),this.cameras=e}}lh.prototype.isArrayCamera=!0;class qn extends Xe{constructor(){super(),this.type="Group"}}qn.prototype.isGroup=!0;const PO={type:"move"};class ch{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qn,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 qn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ee,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ee),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ee,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ee),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}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 l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(PO))),c&&e.hand){o=!0;for(const h of e.hand.values()){const b=t.getJointPose(h,i);if(c.joints[h.jointName]===void 0){const v=new qn;v.matrixAutoUpdate=!1,v.visible=!1,c.joints[h.jointName]=v,c.add(v)}const y=c.joints[h.jointName];b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.jointRadius=b.radius),y.visible=b!==null}const f=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],p=f.position.distanceTo(d.position),g=.02,m=.005;c.inputState.pinching&&p>g+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=g-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class IO extends nr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,d=null,p=null;const g=[],m=new Map,h=new kt;h.layers.enable(1),h.viewport=new it;const b=new kt;b.layers.enable(2),b.viewport=new it;const y=[h,b],v=new lh;v.layers.enable(1),v.layers.enable(2);let M=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let x=g[F];return x===void 0&&(x=new ch,g[F]=x),x.getTargetRaySpace()},this.getControllerGrip=function(F){let x=g[F];return x===void 0&&(x=new ch,g[F]=x),x.getGripSpace()},this.getHand=function(F){let x=g[F];return x===void 0&&(x=new ch,g[F]=x),x.getHandSpace()};function _(F){const x=m.get(F.inputSource);x&&x.dispatchEvent({type:F.type,data:F.inputSource})}function w(){m.forEach(function(F,x){F.disconnect(x)}),m.clear(),M=null,A=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(F){o=F,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){u=F,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(F){if(s=F,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",w),s.addEventListener("inputsourceschange",C);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const O={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,O);s.updateRenderState({baseLayer:B})}else{let O=0;x.depth&&(O=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:O,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),d=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function C(F){const x=s.inputSources;for(let O=0;O<g.length;O++)m.set(x[O],g[O]);for(let O=0;O<F.removed.length;O++){const B=F.removed[O],N=m.get(B);N&&(N.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let O=0;O<F.added.length;O++){const B=F.added[O],N=m.get(B);N&&N.dispatchEvent({type:"connected",data:B})}}const P=new ee,R=new ee;function I(F,x,O){P.setFromMatrixPosition(x.matrixWorld),R.setFromMatrixPosition(O.matrixWorld);const B=P.distanceTo(R),N=x.projectionMatrix.elements,k=O.projectionMatrix.elements,z=N[14]/(N[10]-1),G=N[14]/(N[10]+1),Y=(N[9]+1)/N[5],Z=(N[9]-1)/N[5],te=(N[8]-1)/N[0],q=(k[8]+1)/k[0],W=z*te,$=z*q,X=B/(-te+q),K=X*-te;x.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(K),F.translateZ(X),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert();const re=z+X,V=G+X,j=W-K,oe=$+(B-K),ae=Y*G/V*re,le=Z*G/V*re;F.projectionMatrix.makePerspective(j,oe,ae,le,re,V)}function S(F,x){x===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(x.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(s===null)return;v.near=b.near=h.near=F.near,v.far=b.far=h.far=F.far,(M!==v.near||A!==v.far)&&(s.updateRenderState({depthNear:v.near,depthFar:v.far}),M=v.near,A=v.far);const x=F.parent,O=v.cameras;S(v,x);for(let N=0;N<O.length;N++)S(O[N],x);v.matrixWorld.decompose(v.position,v.quaternion,v.scale),F.position.copy(v.position),F.quaternion.copy(v.quaternion),F.scale.copy(v.scale),F.matrix.copy(v.matrix),F.matrixWorld.copy(v.matrixWorld);const B=F.children;for(let N=0,k=B.length;N<k;N++)B[N].updateMatrixWorld(!0);O.length===2?I(v,h,b):v.projectionMatrix.copy(h.projectionMatrix)},this.getCamera=function(){return v};let T=null;function E(F,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,N=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(N.framebuffer);let k=!1;B.length!==v.cameras.length&&(v.cameras.length=0,k=!0);for(let z=0;z<B.length;z++){const G=B[z];let Y=null;if(s.renderState.layers===void 0)Y=N.getViewport(G);else{const te=f.getViewSubImage(p,G);r.bindXRFramebuffer(d),t.framebufferTexture2D(36160,36064,3553,te.colorTexture,0),te.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,te.depthStencilTexture,0),Y=te.viewport}const Z=y[z];Z.matrix.fromArray(G.transform.matrix),Z.projectionMatrix.fromArray(G.projectionMatrix),Z.viewport.set(Y.x,Y.y,Y.width,Y.height),z===0&&v.matrix.copy(Z.matrix),k===!0&&v.cameras.push(Z)}}const O=s.inputSources;for(let B=0;B<g.length;B++){const N=g[B],k=O[B];N.update(k,x,l)}T&&T(F,x)}const L=new ty;L.setAnimationLoop(E),this.setAnimationLoop=function(F){T=F},this.dispose=function(){}}}function OO(n){function e(y,v){y.fogColor.value.copy(v.color),v.isFog?(y.fogNear.value=v.near,y.fogFar.value=v.far):v.isFogExp2&&(y.fogDensity.value=v.density)}function t(y,v,M,A,_){v.isMeshBasicMaterial?i(y,v):v.isMeshLambertMaterial?(i(y,v),u(y,v)):v.isMeshToonMaterial?(i(y,v),f(y,v)):v.isMeshPhongMaterial?(i(y,v),c(y,v)):v.isMeshStandardMaterial?(i(y,v),v.isMeshPhysicalMaterial?p(y,v,_):d(y,v)):v.isMeshMatcapMaterial?(i(y,v),g(y,v)):v.isMeshDepthMaterial?(i(y,v),m(y,v)):v.isMeshDistanceMaterial?(i(y,v),h(y,v)):v.isMeshNormalMaterial?(i(y,v),b(y,v)):v.isLineBasicMaterial?(r(y,v),v.isLineDashedMaterial&&s(y,v)):v.isPointsMaterial?o(y,v,M,A):v.isSpriteMaterial?l(y,v):v.isShadowMaterial?(y.color.value.copy(v.color),y.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function i(y,v){y.opacity.value=v.opacity,v.color&&y.diffuse.value.copy(v.color),v.emissive&&y.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(y.map.value=v.map),v.alphaMap&&(y.alphaMap.value=v.alphaMap),v.specularMap&&(y.specularMap.value=v.specularMap);const M=n.get(v).envMap;if(M){y.envMap.value=M,y.flipEnvMap.value=M.isCubeTexture&&M._needsFlipEnvMap?-1:1,y.reflectivity.value=v.reflectivity,y.refractionRatio.value=v.refractionRatio;const w=n.get(M).__maxMipLevel;w!==void 0&&(y.maxMipLevel.value=w)}v.lightMap&&(y.lightMap.value=v.lightMap,y.lightMapIntensity.value=v.lightMapIntensity),v.aoMap&&(y.aoMap.value=v.aoMap,y.aoMapIntensity.value=v.aoMapIntensity);let A;v.map?A=v.map:v.specularMap?A=v.specularMap:v.displacementMap?A=v.displacementMap:v.normalMap?A=v.normalMap:v.bumpMap?A=v.bumpMap:v.roughnessMap?A=v.roughnessMap:v.metalnessMap?A=v.metalnessMap:v.alphaMap?A=v.alphaMap:v.emissiveMap?A=v.emissiveMap:v.clearcoatMap?A=v.clearcoatMap:v.clearcoatNormalMap?A=v.clearcoatNormalMap:v.clearcoatRoughnessMap&&(A=v.clearcoatRoughnessMap),A!==void 0&&(A.isWebGLRenderTarget&&(A=A.texture),A.matrixAutoUpdate===!0&&A.updateMatrix(),y.uvTransform.value.copy(A.matrix));let _;v.aoMap?_=v.aoMap:v.lightMap&&(_=v.lightMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uv2Transform.value.copy(_.matrix))}function r(y,v){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity}function s(y,v){y.dashSize.value=v.dashSize,y.totalSize.value=v.dashSize+v.gapSize,y.scale.value=v.scale}function o(y,v,M,A){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,y.size.value=v.size*M,y.scale.value=A*.5,v.map&&(y.map.value=v.map),v.alphaMap&&(y.alphaMap.value=v.alphaMap);let _;v.map?_=v.map:v.alphaMap&&(_=v.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uvTransform.value.copy(_.matrix))}function l(y,v){y.diffuse.value.copy(v.color),y.opacity.value=v.opacity,y.rotation.value=v.rotation,v.map&&(y.map.value=v.map),v.alphaMap&&(y.alphaMap.value=v.alphaMap);let M;v.map?M=v.map:v.alphaMap&&(M=v.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),y.uvTransform.value.copy(M.matrix))}function u(y,v){v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap)}function c(y,v){y.specular.value.copy(v.specular),y.shininess.value=Math.max(v.shininess,1e-4),v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function f(y,v){v.gradientMap&&(y.gradientMap.value=v.gradientMap),v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function d(y,v){y.roughness.value=v.roughness,y.metalness.value=v.metalness,v.roughnessMap&&(y.roughnessMap.value=v.roughnessMap),v.metalnessMap&&(y.metalnessMap.value=v.metalnessMap),v.emissiveMap&&(y.emissiveMap.value=v.emissiveMap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias),n.get(v).envMap&&(y.envMapIntensity.value=v.envMapIntensity)}function p(y,v,M){d(y,v),y.reflectivity.value=v.reflectivity,y.clearcoat.value=v.clearcoat,y.clearcoatRoughness.value=v.clearcoatRoughness,v.sheen&&y.sheen.value.copy(v.sheen),v.clearcoatMap&&(y.clearcoatMap.value=v.clearcoatMap),v.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap),v.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),y.clearcoatNormalMap.value=v.clearcoatNormalMap,v.side===xt&&y.clearcoatNormalScale.value.negate()),y.transmission.value=v.transmission,v.transmissionMap&&(y.transmissionMap.value=v.transmissionMap),v.transmission>0&&(y.transmissionSamplerMap.value=M.texture,y.transmissionSamplerSize.value.set(M.width,M.height)),y.thickness.value=v.thickness,v.thicknessMap&&(y.thicknessMap.value=v.thicknessMap),y.attenuationDistance.value=v.attenuationDistance,y.attenuationColor.value.copy(v.attenuationColor)}function g(y,v){v.matcap&&(y.matcap.value=v.matcap),v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function m(y,v){v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}function h(y,v){v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias),y.referencePosition.value.copy(v.referencePosition),y.nearDistance.value=v.nearDistance,y.farDistance.value=v.farDistance}function b(y,v){v.bumpMap&&(y.bumpMap.value=v.bumpMap,y.bumpScale.value=v.bumpScale,v.side===xt&&(y.bumpScale.value*=-1)),v.normalMap&&(y.normalMap.value=v.normalMap,y.normalScale.value.copy(v.normalScale),v.side===xt&&y.normalScale.value.negate()),v.displacementMap&&(y.displacementMap.value=v.displacementMap,y.displacementScale.value=v.displacementScale,y.displacementBias.value=v.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function NO(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:NO(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let d=null,p=null;const g=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=tn,this.physicallyCorrectLights=!1,this.toneMapping=Qi,this.toneMappingExposure=1;const h=this;let b=!1,y=0,v=0,M=null,A=-1,_=null;const w=new it,C=new it;let P=null,R=e.width,I=e.height,S=1,T=null,E=null;const L=new it(0,0,R,I),F=new it(0,0,R,I);let x=!1;const O=[],B=new ua;let N=!1,k=!1,z=null;const G=new Oe,Y=new ee,Z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function te(){return M===null?S:1}let q=t;function W(J,pe){for(let fe=0;fe<J.length;fe++){const me=J[fe],Me=e.getContext(me,pe);if(Me!==null)return Me}return null}try{const J={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",Ie,!1),e.addEventListener("webglcontextrestored",Je,!1),q===null){const pe=["webgl2","webgl","experimental-webgl"];if(h.isWebGL1Renderer===!0&&pe.shift(),q=W(pe,J),q===null)throw W(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}q.getShaderPrecisionFormat===void 0&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(J){throw console.error("THREE.WebGLRenderer: "+J.message),J}let $,X,K,re,V,j,oe,ae,le,H,U,D,Q,ie,ce,ge,ye,ue,be,ne,de,ve;function Ee(){$=new sI(q),X=new nI(q,$,n),$.init(X),de=new _y(q,$,X),K=new RO(q,$,X),O[0]=1029,re=new lI,V=new bO,j=new FO(q,$,K,V,X,de,re),oe=new rI(h),ae=new F3(q,X),ve=new eI(q,$,ae,X),le=new oI(q,ae,re,ve),H=new hI(q,le,ae,re),ue=new dI(q),ce=new iI(V),U=new yO(h,oe,$,X,ve,ce),D=new OO(V),Q=new wO(V),ie=new EO($,X),ye=new QP(h,oe,K,H,l),ge=new Sy(h,H,X),be=new tI(q,$,re,X),ne=new aI(q,$,re,X),re.programs=U.programs,h.capabilities=X,h.extensions=$,h.properties=V,h.renderLists=Q,h.shadowMap=ge,h.state=K,h.info=re}Ee();const Se=new IO(h,q);this.xr=Se,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){const J=$.get("WEBGL_lose_context");J&&J.loseContext()},this.forceContextRestore=function(){const J=$.get("WEBGL_lose_context");J&&J.restoreContext()},this.getPixelRatio=function(){return S},this.setPixelRatio=function(J){J!==void 0&&(S=J,this.setSize(R,I,!1))},this.getSize=function(J){return J.set(R,I)},this.setSize=function(J,pe,fe){if(Se.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}R=J,I=pe,e.width=Math.floor(J*S),e.height=Math.floor(pe*S),fe!==!1&&(e.style.width=J+"px",e.style.height=pe+"px"),this.setViewport(0,0,J,pe)},this.getDrawingBufferSize=function(J){return J.set(R*S,I*S).floor()},this.setDrawingBufferSize=function(J,pe,fe){R=J,I=pe,S=fe,e.width=Math.floor(J*fe),e.height=Math.floor(pe*fe),this.setViewport(0,0,J,pe)},this.getCurrentViewport=function(J){return J.copy(w)},this.getViewport=function(J){return J.copy(L)},this.setViewport=function(J,pe,fe,me){J.isVector4?L.set(J.x,J.y,J.z,J.w):L.set(J,pe,fe,me),K.viewport(w.copy(L).multiplyScalar(S).floor())},this.getScissor=function(J){return J.copy(F)},this.setScissor=function(J,pe,fe,me){J.isVector4?F.set(J.x,J.y,J.z,J.w):F.set(J,pe,fe,me),K.scissor(C.copy(F).multiplyScalar(S).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(J){K.setScissorTest(x=J)},this.setOpaqueSort=function(J){T=J},this.setTransparentSort=function(J){E=J},this.getClearColor=function(J){return J.copy(ye.getClearColor())},this.setClearColor=function(){ye.setClearColor.apply(ye,arguments)},this.getClearAlpha=function(){return ye.getClearAlpha()},this.setClearAlpha=function(){ye.setClearAlpha.apply(ye,arguments)},this.clear=function(J,pe,fe){let me=0;(J===void 0||J)&&(me|=16384),(pe===void 0||pe)&&(me|=256),(fe===void 0||fe)&&(me|=1024),q.clear(me)},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(){e.removeEventListener("webglcontextlost",Ie,!1),e.removeEventListener("webglcontextrestored",Je,!1),Q.dispose(),ie.dispose(),V.dispose(),oe.dispose(),H.dispose(),ve.dispose(),Se.dispose(),Se.removeEventListener("sessionstart",It),Se.removeEventListener("sessionend",pt),z&&(z.dispose(),z=null),yt.stop()};function Ie(J){J.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Je(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const J=re.autoReset,pe=ge.enabled,fe=ge.autoUpdate,me=ge.needsUpdate,Me=ge.type;Ee(),re.autoReset=J,ge.enabled=pe,ge.autoUpdate=fe,ge.needsUpdate=me,ge.type=Me}function Ve(J){const pe=J.target;pe.removeEventListener("dispose",Ve),st(pe)}function st(J){Re(J),V.remove(J)}function Re(J){const pe=V.get(J).programs;pe!==void 0&&pe.forEach(function(fe){U.releaseProgram(fe)})}function Ue(J,pe){J.render(function(fe){h.renderBufferImmediate(fe,pe)})}this.renderBufferImmediate=function(J,pe){ve.initAttributes();const fe=V.get(J);J.hasPositions&&!fe.position&&(fe.position=q.createBuffer()),J.hasNormals&&!fe.normal&&(fe.normal=q.createBuffer()),J.hasUvs&&!fe.uv&&(fe.uv=q.createBuffer()),J.hasColors&&!fe.color&&(fe.color=q.createBuffer());const me=pe.getAttributes();J.hasPositions&&(q.bindBuffer(34962,fe.position),q.bufferData(34962,J.positionArray,35048),ve.enableAttribute(me.position),q.vertexAttribPointer(me.position,3,5126,!1,0,0)),J.hasNormals&&(q.bindBuffer(34962,fe.normal),q.bufferData(34962,J.normalArray,35048),ve.enableAttribute(me.normal),q.vertexAttribPointer(me.normal,3,5126,!1,0,0)),J.hasUvs&&(q.bindBuffer(34962,fe.uv),q.bufferData(34962,J.uvArray,35048),ve.enableAttribute(me.uv),q.vertexAttribPointer(me.uv,2,5126,!1,0,0)),J.hasColors&&(q.bindBuffer(34962,fe.color),q.bufferData(34962,J.colorArray,35048),ve.enableAttribute(me.color),q.vertexAttribPointer(me.color,3,5126,!1,0,0)),ve.disableUnusedAttributes(),q.drawArrays(4,0,J.count),J.count=0},this.renderBufferDirect=function(J,pe,fe,me,Me,he){pe===null&&(pe=Z);const xe=Me.isMesh&&Me.matrixWorld.determinant()<0,_e=we(J,pe,me,Me);K.setMaterial(me,xe);let Fe=fe.index;const Ne=fe.attributes.position;if(Fe===null){if(Ne===void 0||Ne.count===0)return}else if(Fe.count===0)return;let je=1;me.wireframe===!0&&(Fe=le.getWireframeAttribute(fe),je=2),(me.morphTargets||me.morphNormals)&&ue.update(Me,fe,me,_e),ve.setup(Me,me,_e,fe,Fe);let ze,qe=be;Fe!==null&&(ze=ae.get(Fe),qe=ne,qe.setIndex(ze));const Lt=Fe!==null?Fe.count:Ne.count,Ht=fe.drawRange.start*je,ls=fe.drawRange.count*je,ut=he!==null?he.start*je:0,cs=he!==null?he.count*je:1/0,en=Math.max(Ht,ut),qk=Math.min(Lt,Ht+ls,ut+cs)-1,Kc=Math.max(0,qk-en+1);if(Kc!==0){if(Me.isMesh)me.wireframe===!0?(K.setLineWidth(me.wireframeLinewidth*te()),qe.setMode(1)):qe.setMode(4);else if(Me.isLine){let Wa=me.linewidth;Wa===void 0&&(Wa=1),K.setLineWidth(Wa*te()),Me.isLineSegments?qe.setMode(1):Me.isLineLoop?qe.setMode(2):qe.setMode(3)}else Me.isPoints?qe.setMode(0):Me.isSprite&&qe.setMode(4);if(Me.isInstancedMesh)qe.renderInstances(en,Kc,Me.count);else if(fe.isInstancedBufferGeometry){const Wa=Math.min(fe.instanceCount,fe._maxInstanceCount);qe.renderInstances(en,Kc,Wa)}else qe.render(en,Kc)}},this.compile=function(J,pe){p=ie.get(J),p.init(),J.traverseVisible(function(fe){fe.isLight&&fe.layers.test(pe.layers)&&(p.pushLight(fe),fe.castShadow&&p.pushShadow(fe))}),p.setupLights(),J.traverse(function(fe){const me=fe.material;if(me)if(Array.isArray(me))for(let Me=0;Me<me.length;Me++){const he=me[Me];as(he,J,fe)}else as(me,J,fe)})};let We=null;function Pt(J){We&&We(J)}function It(){yt.stop()}function pt(){yt.start()}const yt=new ty;yt.setAnimationLoop(Pt),typeof window<"u"&&yt.setContext(window),this.setAnimationLoop=function(J){We=J,Se.setAnimationLoop(J),J===null?yt.stop():yt.start()},Se.addEventListener("sessionstart",It),Se.addEventListener("sessionend",pt),this.render=function(J,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;J.autoUpdate===!0&&J.updateMatrixWorld(),pe.parent===null&&pe.updateMatrixWorld(),Se.enabled===!0&&Se.isPresenting===!0&&(Se.cameraAutoUpdate===!0&&Se.updateCamera(pe),pe=Se.getCamera()),J.isScene===!0&&J.onBeforeRender(h,J,pe,M),p=ie.get(J,m.length),p.init(),m.push(p),G.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),B.setFromProjectionMatrix(G),k=this.localClippingEnabled,N=ce.init(this.clippingPlanes,k,pe),d=Q.get(J,g.length),d.init(),g.push(d),oi(J,pe,0,h.sortObjects),d.finish(),h.sortObjects===!0&&d.sort(T,E),N===!0&&ce.beginShadows();const fe=p.state.shadowsArray;ge.render(fe,J,pe),p.setupLights(),p.setupLightsView(pe),N===!0&&ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(d,J);const me=d.opaque,Me=d.transmissive,he=d.transparent;me.length>0&&ai(me,J,pe),Me.length>0&&ki(me,Me,J,pe),he.length>0&&ai(he,J,pe),M!==null&&(j.updateMultisampleRenderTarget(M),j.updateRenderTargetMipmap(M)),J.isScene===!0&&J.onAfterRender(h,J,pe),K.buffers.depth.setTest(!0),K.buffers.depth.setMask(!0),K.buffers.color.setMask(!0),K.setPolygonOffset(!1),ve.resetDefaultState(),A=-1,_=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,g.pop(),g.length>0?d=g[g.length-1]:d=null};function oi(J,pe,fe,me){if(J.visible===!1)return;if(J.layers.test(pe.layers)){if(J.isGroup)fe=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(pe);else if(J.isLight)p.pushLight(J),J.castShadow&&p.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||B.intersectsSprite(J)){me&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G);const xe=H.update(J),_e=J.material;_e.visible&&d.push(J,xe,_e,fe,Y.z,null)}}else if(J.isImmediateRenderObject)me&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G),d.push(J,null,J.material,fe,Y.z,null);else if((J.isMesh||J.isLine||J.isPoints)&&(J.isSkinnedMesh&&J.skeleton.frame!==re.render.frame&&(J.skeleton.update(),J.skeleton.frame=re.render.frame),!J.frustumCulled||B.intersectsObject(J))){me&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G);const xe=H.update(J),_e=J.material;if(Array.isArray(_e)){const Fe=xe.groups;for(let Ne=0,je=Fe.length;Ne<je;Ne++){const ze=Fe[Ne],qe=_e[ze.materialIndex];qe&&qe.visible&&d.push(J,xe,qe,fe,Y.z,ze)}}else _e.visible&&d.push(J,xe,_e,fe,Y.z,null)}}const he=J.children;for(let xe=0,_e=he.length;xe<_e;xe++)oi(he[xe],pe,fe,me)}function ki(J,pe,fe,me){if(z===null){const _e=o===!0&&X.isWebGL2===!0?Od:Rn;z=new _e(1024,1024,{generateMipmaps:!0,type:de.convert(Ir)!==null?Ir:Pr,minFilter:Si,magFilter:wt,wrapS:Ut,wrapT:Ut})}const Me=h.getRenderTarget();h.setRenderTarget(z),h.clear();const he=h.toneMapping;h.toneMapping=Qi,ai(J,fe,me),h.toneMapping=he,j.updateMultisampleRenderTarget(z),j.updateRenderTargetMipmap(z),h.setRenderTarget(Me),ai(pe,fe,me)}function ai(J,pe,fe){const me=pe.isScene===!0?pe.overrideMaterial:null;for(let Me=0,he=J.length;Me<he;Me++){const xe=J[Me],_e=xe.object,Fe=xe.geometry,Ne=me===null?xe.material:me,je=xe.group;if(fe.isArrayCamera){const ze=fe.cameras;for(let qe=0,Lt=ze.length;qe<Lt;qe++){const Ht=ze[qe];_e.layers.test(Ht.layers)&&(K.viewport(w.copy(Ht.viewport)),p.setupLightsView(Ht),wr(_e,pe,Ht,Fe,Ne,je))}}else wr(_e,pe,fe,Fe,Ne,je)}}function wr(J,pe,fe,me,Me,he){if(J.onBeforeRender(h,pe,fe,me,Me,he),J.modelViewMatrix.multiplyMatrices(fe.matrixWorldInverse,J.matrixWorld),J.normalMatrix.getNormalMatrix(J.modelViewMatrix),J.isImmediateRenderObject){const xe=we(fe,pe,Me,J);K.setMaterial(Me),ve.reset(),Ue(J,xe)}else Me.transparent===!0&&Me.side===qi?(Me.side=xt,Me.needsUpdate=!0,h.renderBufferDirect(fe,pe,me,Me,J,he),Me.side=Ki,Me.needsUpdate=!0,h.renderBufferDirect(fe,pe,me,Me,J,he),Me.side=qi):h.renderBufferDirect(fe,pe,me,Me,J,he);J.onAfterRender(h,pe,fe,me,Me,he)}function as(J,pe,fe){pe.isScene!==!0&&(pe=Z);const me=V.get(J),Me=p.state.lights,he=p.state.shadowsArray,xe=Me.state.version,_e=U.getParameters(J,Me.state,he,pe,fe),Fe=U.getProgramCacheKey(_e);let Ne=me.programs;me.environment=J.isMeshStandardMaterial?pe.environment:null,me.fog=pe.fog,me.envMap=oe.get(J.envMap||me.environment),Ne===void 0&&(J.addEventListener("dispose",Ve),Ne=new Map,me.programs=Ne);let je=Ne.get(Fe);if(je!==void 0){if(me.currentProgram===je&&me.lightsStateVersion===xe)return se(J,_e),je}else _e.uniforms=U.getUniforms(J),J.onBuild(_e,h),J.onBeforeCompile(_e,h),je=U.acquireProgram(_e,Fe),Ne.set(Fe,je),me.uniforms=_e.uniforms;const ze=me.uniforms;(!J.isShaderMaterial&&!J.isRawShaderMaterial||J.clipping===!0)&&(ze.clippingPlanes=ce.uniform),se(J,_e),me.needsLights=De(J),me.lightsStateVersion=xe,me.needsLights&&(ze.ambientLightColor.value=Me.state.ambient,ze.lightProbe.value=Me.state.probe,ze.directionalLights.value=Me.state.directional,ze.directionalLightShadows.value=Me.state.directionalShadow,ze.spotLights.value=Me.state.spot,ze.spotLightShadows.value=Me.state.spotShadow,ze.rectAreaLights.value=Me.state.rectArea,ze.ltc_1.value=Me.state.rectAreaLTC1,ze.ltc_2.value=Me.state.rectAreaLTC2,ze.pointLights.value=Me.state.point,ze.pointLightShadows.value=Me.state.pointShadow,ze.hemisphereLights.value=Me.state.hemi,ze.directionalShadowMap.value=Me.state.directionalShadowMap,ze.directionalShadowMatrix.value=Me.state.directionalShadowMatrix,ze.spotShadowMap.value=Me.state.spotShadowMap,ze.spotShadowMatrix.value=Me.state.spotShadowMatrix,ze.pointShadowMap.value=Me.state.pointShadowMap,ze.pointShadowMatrix.value=Me.state.pointShadowMatrix);const qe=je.getUniforms(),Lt=dr.seqWithValue(qe.seq,ze);return me.currentProgram=je,me.uniformsList=Lt,je}function se(J,pe){const fe=V.get(J);fe.outputEncoding=pe.outputEncoding,fe.instancing=pe.instancing,fe.skinning=pe.skinning,fe.numClippingPlanes=pe.numClippingPlanes,fe.numIntersection=pe.numClipIntersection,fe.vertexAlphas=pe.vertexAlphas}function we(J,pe,fe,me){pe.isScene!==!0&&(pe=Z),j.resetTextureUnits();const Me=pe.fog,he=fe.isMeshStandardMaterial?pe.environment:null,xe=M===null?h.outputEncoding:M.texture.encoding,_e=oe.get(fe.envMap||he),Fe=fe.vertexColors===!0&&me.geometry&&me.geometry.attributes.color&&me.geometry.attributes.color.itemSize===4,Ne=V.get(fe),je=p.state.lights;if(N===!0&&(k===!0||J!==_)){const en=J===_&&fe.id===A;ce.setState(fe,J,en)}let ze=!1;fe.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==je.state.version||Ne.outputEncoding!==xe||me.isInstancedMesh&&Ne.instancing===!1||!me.isInstancedMesh&&Ne.instancing===!0||me.isSkinnedMesh&&Ne.skinning===!1||!me.isSkinnedMesh&&Ne.skinning===!0||Ne.envMap!==_e||fe.fog&&Ne.fog!==Me||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==ce.numPlanes||Ne.numIntersection!==ce.numIntersection)||Ne.vertexAlphas!==Fe)&&(ze=!0):(ze=!0,Ne.__version=fe.version);let qe=Ne.currentProgram;ze===!0&&(qe=as(fe,pe,me));let Lt=!1,Ht=!1,ls=!1;const ut=qe.getUniforms(),cs=Ne.uniforms;if(K.useProgram(qe.program)&&(Lt=!0,Ht=!0,ls=!0),fe.id!==A&&(A=fe.id,Ht=!0),Lt||_!==J){if(ut.setValue(q,"projectionMatrix",J.projectionMatrix),X.logarithmicDepthBuffer&&ut.setValue(q,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),_!==J&&(_=J,Ht=!0,ls=!0),fe.isShaderMaterial||fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshStandardMaterial||fe.envMap){const en=ut.map.cameraPosition;en!==void 0&&en.setValue(q,Y.setFromMatrixPosition(J.matrixWorld))}(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&ut.setValue(q,"isOrthographic",J.isOrthographicCamera===!0),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial||fe.isShadowMaterial||me.isSkinnedMesh)&&ut.setValue(q,"viewMatrix",J.matrixWorldInverse)}if(me.isSkinnedMesh){ut.setOptional(q,me,"bindMatrix"),ut.setOptional(q,me,"bindMatrixInverse");const en=me.skeleton;en&&(X.floatVertexTextures?(en.boneTexture===null&&en.computeBoneTexture(),ut.setValue(q,"boneTexture",en.boneTexture,j),ut.setValue(q,"boneTextureSize",en.boneTextureSize)):ut.setOptional(q,en,"boneMatrices"))}return(Ht||Ne.receiveShadow!==me.receiveShadow)&&(Ne.receiveShadow=me.receiveShadow,ut.setValue(q,"receiveShadow",me.receiveShadow)),Ht&&(ut.setValue(q,"toneMappingExposure",h.toneMappingExposure),Ne.needsLights&&Te(cs,ls),Me&&fe.fog&&D.refreshFogUniforms(cs,Me),D.refreshMaterialUniforms(cs,fe,S,I,z),dr.upload(q,Ne.uniformsList,cs,j)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(dr.upload(q,Ne.uniformsList,cs,j),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&ut.setValue(q,"center",me.center),ut.setValue(q,"modelViewMatrix",me.modelViewMatrix),ut.setValue(q,"normalMatrix",me.normalMatrix),ut.setValue(q,"modelMatrix",me.matrixWorld),qe}function Te(J,pe){J.ambientLightColor.needsUpdate=pe,J.lightProbe.needsUpdate=pe,J.directionalLights.needsUpdate=pe,J.directionalLightShadows.needsUpdate=pe,J.pointLights.needsUpdate=pe,J.pointLightShadows.needsUpdate=pe,J.spotLights.needsUpdate=pe,J.spotLightShadows.needsUpdate=pe,J.rectAreaLights.needsUpdate=pe,J.hemisphereLights.needsUpdate=pe}function De(J){return J.isMeshLambertMaterial||J.isMeshToonMaterial||J.isMeshPhongMaterial||J.isMeshStandardMaterial||J.isShadowMaterial||J.isShaderMaterial&&J.lights===!0}this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return M},this.setRenderTarget=function(J,pe=0,fe=0){M=J,y=pe,v=fe,J&&V.get(J).__webglFramebuffer===void 0&&j.setupRenderTarget(J);let me=null,Me=!1,he=!1;if(J){const _e=J.texture;(_e.isDataTexture3D||_e.isDataTexture2DArray)&&(he=!0);const Fe=V.get(J).__webglFramebuffer;J.isWebGLCubeRenderTarget?(me=Fe[pe],Me=!0):J.isWebGLMultisampleRenderTarget?me=V.get(J).__webglMultisampledFramebuffer:me=Fe,w.copy(J.viewport),C.copy(J.scissor),P=J.scissorTest}else w.copy(L).multiplyScalar(S).floor(),C.copy(F).multiplyScalar(S).floor(),P=x;if(K.bindFramebuffer(36160,me)&&X.drawBuffers){let _e=!1;if(J)if(J.isWebGLMultipleRenderTargets){const Fe=J.texture;if(O.length!==Fe.length||O[0]!==36064){for(let Ne=0,je=Fe.length;Ne<je;Ne++)O[Ne]=36064+Ne;O.length=Fe.length,_e=!0}}else(O.length!==1||O[0]!==36064)&&(O[0]=36064,O.length=1,_e=!0);else(O.length!==1||O[0]!==1029)&&(O[0]=1029,O.length=1,_e=!0);_e&&(X.isWebGL2?q.drawBuffers(O):$.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if(K.viewport(w),K.scissor(C),K.setScissorTest(P),Me){const _e=V.get(J.texture);q.framebufferTexture2D(36160,36064,34069+pe,_e.__webglTexture,fe)}else if(he){const _e=V.get(J.texture),Fe=pe||0;q.framebufferTextureLayer(36160,36064,_e.__webglTexture,fe||0,Fe)}},this.readRenderTargetPixels=function(J,pe,fe,me,Me,he,xe){if(!(J&&J.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _e=V.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&xe!==void 0&&(_e=_e[xe]),_e){K.bindFramebuffer(36160,_e);try{const Fe=J.texture,Ne=Fe.format,je=Fe.type;if(Ne!==fn&&de.convert(Ne)!==q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ze=je===Ir&&($.has("EXT_color_buffer_half_float")||X.isWebGL2&&$.has("EXT_color_buffer_float"));if(je!==Pr&&de.convert(je)!==q.getParameter(35738)&&!(je===_i&&(X.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float")))&&!ze){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(36160)===36053?pe>=0&&pe<=J.width-me&&fe>=0&&fe<=J.height-Me&&q.readPixels(pe,fe,me,Me,de.convert(Ne),de.convert(je),he):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Fe=M!==null?V.get(M).__webglFramebuffer:null;K.bindFramebuffer(36160,Fe)}}},this.copyFramebufferToTexture=function(J,pe,fe=0){const me=Math.pow(2,-fe),Me=Math.floor(pe.image.width*me),he=Math.floor(pe.image.height*me);let xe=de.convert(pe.format);X.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),j.setTexture2D(pe,0),q.copyTexImage2D(3553,fe,xe,J.x,J.y,Me,he,0),K.unbindTexture()},this.copyTextureToTexture=function(J,pe,fe,me=0){const Me=pe.image.width,he=pe.image.height,xe=de.convert(fe.format),_e=de.convert(fe.type);j.setTexture2D(fe,0),q.pixelStorei(37440,fe.flipY),q.pixelStorei(37441,fe.premultiplyAlpha),q.pixelStorei(3317,fe.unpackAlignment),pe.isDataTexture?q.texSubImage2D(3553,me,J.x,J.y,Me,he,xe,_e,pe.image.data):pe.isCompressedTexture?q.compressedTexSubImage2D(3553,me,J.x,J.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):q.texSubImage2D(3553,me,J.x,J.y,xe,_e,pe.image),me===0&&fe.generateMipmaps&&q.generateMipmap(3553),K.unbindTexture()},this.copyTextureToTexture3D=function(J,pe,fe,me,Me=0){if(h.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const he=J.max.x-J.min.x+1,xe=J.max.y-J.min.y+1,_e=J.max.z-J.min.z+1,Fe=de.convert(me.format),Ne=de.convert(me.type);let je;if(me.isDataTexture3D)j.setTexture3D(me,0),je=32879;else if(me.isDataTexture2DArray)j.setTexture2DArray(me,0),je=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(37440,me.flipY),q.pixelStorei(37441,me.premultiplyAlpha),q.pixelStorei(3317,me.unpackAlignment);const ze=q.getParameter(3314),qe=q.getParameter(32878),Lt=q.getParameter(3316),Ht=q.getParameter(3315),ls=q.getParameter(32877),ut=fe.isCompressedTexture?fe.mipmaps[0]:fe.image;q.pixelStorei(3314,ut.width),q.pixelStorei(32878,ut.height),q.pixelStorei(3316,J.min.x),q.pixelStorei(3315,J.min.y),q.pixelStorei(32877,J.min.z),fe.isDataTexture||fe.isDataTexture3D?q.texSubImage3D(je,Me,pe.x,pe.y,pe.z,he,xe,_e,Fe,Ne,ut.data):fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),q.compressedTexSubImage3D(je,Me,pe.x,pe.y,pe.z,he,xe,_e,Fe,ut.data)):q.texSubImage3D(je,Me,pe.x,pe.y,pe.z,he,xe,_e,Fe,Ne,ut),q.pixelStorei(3314,ze),q.pixelStorei(32878,qe),q.pixelStorei(3316,Lt),q.pixelStorei(3315,Ht),q.pixelStorei(32877,ls),Me===0&&me.generateMipmaps&&q.generateMipmap(je),K.unbindTexture()},this.initTexture=function(J){j.setTexture2D(J,0),K.unbindTexture()},this.resetState=function(){y=0,v=0,M=null,K.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Ty extends rt{}Ty.prototype.isWebGL1Renderer=!0;class fa{constructor(e,t=25e-5){this.name="",this.color=new Ce(e),this.density=t}clone(){return new fa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}fa.prototype.isFogExp2=!0;class pa{constructor(e,t=1,i=1e3){this.name="",this.color=new Ce(e),this.near=t,this.far=i}clone(){return new pa(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}pa.prototype.isFog=!0;class cc extends Xe{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}cc.prototype.isScene=!0;class hr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Os,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=pn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=pn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=pn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}hr.prototype.isInterleavedBuffer=!0;const _t=new ee;class Ni{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyMatrix4(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyNormalMatrix(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.transformDirection(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Ze(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ni(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Ni.prototype.isInterleavedBufferAttribute=!0;class ma extends Ft{constructor(e){super(),this.type="SpriteMaterial",this.color=new Ce(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}ma.prototype.isSpriteMaterial=!0;let Qs;const ga=new ee,eo=new ee,to=new ee,no=new Ae,va=new Ae,Ey=new Oe,uc=new ee,ya=new ee,dc=new ee,Cy=new Ae,uh=new Ae,Ly=new Ae;class ba extends Xe{constructor(e){if(super(),this.type="Sprite",Qs===void 0){Qs=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new hr(t,5);Qs.setIndex([0,1,2,0,2,3]),Qs.setAttribute("position",new Ni(i,3,0,!1)),Qs.setAttribute("uv",new Ni(i,2,3,!1))}this.geometry=Qs,this.material=e!==void 0?e:new ma,this.center=new Ae(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),eo.setFromMatrixScale(this.matrixWorld),Ey.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),to.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&eo.multiplyScalar(-to.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;hc(uc.set(-.5,-.5,0),to,o,eo,r,s),hc(ya.set(.5,-.5,0),to,o,eo,r,s),hc(dc.set(.5,.5,0),to,o,eo,r,s),Cy.set(0,0),uh.set(1,0),Ly.set(1,1);let l=e.ray.intersectTriangle(uc,ya,dc,!1,ga);if(l===null&&(hc(ya.set(-.5,.5,0),to,o,eo,r,s),uh.set(0,1),l=e.ray.intersectTriangle(uc,dc,ya,!1,ga),l===null))return;const u=e.ray.origin.distanceTo(ga);u<e.near||u>e.far||t.push({distance:u,point:ga.clone(),uv:At.getUV(ga,uc,ya,dc,Cy,uh,Ly,new Ae),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}ba.prototype.isSprite=!0;function hc(n,e,t,i,r,s){no.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(va.x=s*no.x-r*no.y,va.y=r*no.x+s*no.y):va.copy(no),n.copy(e),n.x+=va.x,n.y+=va.y,n.applyMatrix4(Ey)}const fc=new ee,Ry=new ee;class Fy extends Xe{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;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){fc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(fc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){fc.setFromMatrixPosition(e.matrixWorld),Ry.setFromMatrixPosition(this.matrixWorld);const i=fc.distanceTo(Ry)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const Py=new ee,Iy=new it,Oy=new it,BO=new ee,Ny=new Oe;class xa extends St{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Oe,this.bindMatrixInverse=new Oe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new it,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;Iy.fromBufferAttribute(r.attributes.skinIndex,e),Oy.fromBufferAttribute(r.attributes.skinWeight,e),Py.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=Oy.getComponent(s);if(o!==0){const l=Iy.getComponent(s);Ny.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(BO.copy(Py).applyMatrix4(Ny),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}xa.prototype.isSkinnedMesh=!0;class wa extends Xe{constructor(){super(),this.type="Bone"}}wa.prototype.isBone=!0;class jr extends Mt{constructor(e=null,t=1,i=1,r,s,o,l,u,c=wt,f=wt,d,p){super(null,o,l,u,c,f,r,s,d,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}jr.prototype.isDataTexture=!0;const By=new Oe,DO=new Oe;class Ma{constructor(e=[],t=[]){this.uuid=pn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Oe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Oe;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:DO;By.multiplyMatrices(l,t[s]),By.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Ma(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=F0(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new jr(t,e,e,fn,_i);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new wa),this.bones.push(o),this.boneInverses.push(new Oe().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const l=i[r];e.boneInverses.push(l.toArray())}return e}}const Dy=new Oe,ky=new Oe,pc=[],Aa=new St;class dh extends St{constructor(e,t,i){super(e,t),this.instanceMatrix=new Ze(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(Aa.geometry=this.geometry,Aa.material=this.material,Aa.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,Dy),ky.multiplyMatrices(i,Dy),Aa.matrixWorld=ky,Aa.raycast(e,pc);for(let o=0,l=pc.length;o<l;o++){const u=pc[o];u.instanceId=s,u.object=this,t.push(u)}pc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ze(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}dh.prototype.isInstancedMesh=!0;class Vt extends Ft{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Ce(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Vt.prototype.isLineBasicMaterial=!0;const Vy=new ee,zy=new ee,Uy=new Oe,hh=new or,mc=new Ci;class Qn extends Xe{constructor(e=new ke,t=new Vt){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Vy.fromBufferAttribute(t,r-1),zy.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Vy.distanceTo(zy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),mc.copy(i.boundingSphere),mc.applyMatrix4(r),mc.radius+=s,e.ray.intersectsSphere(mc)===!1)return;Uy.copy(r).invert(),hh.copy(e.ray).applyMatrix4(Uy);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new ee,f=new ee,d=new ee,p=new ee,g=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const y=Math.max(0,o.start),v=Math.min(m.count,o.start+o.count);for(let M=y,A=v-1;M<A;M+=g){const _=m.getX(M),w=m.getX(M+1);if(c.fromBufferAttribute(b,_),f.fromBufferAttribute(b,w),hh.distanceSqToSegment(c,f,p,d)>u)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);P<e.near||P>e.far||t.push({distance:P,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),v=Math.min(b.count,o.start+o.count);for(let M=y,A=v-1;M<A;M+=g){if(c.fromBufferAttribute(b,M),f.fromBufferAttribute(b,M+1),hh.distanceSqToSegment(c,f,p,d)>u)continue;p.applyMatrix4(this.matrixWorld);const w=e.ray.origin.distanceTo(p);w<e.near||w>e.far||t.push({distance:w,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Qn.prototype.isLine=!0;const Gy=new ee,Hy=new ee;class rn extends Qn{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)Gy.fromBufferAttribute(t,r),Hy.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+Gy.distanceTo(Hy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}rn.prototype.isLineSegments=!0;class gc extends Qn{constructor(e,t){super(e,t),this.type="LineLoop"}}gc.prototype.isLineLoop=!0;class fr extends Ft{constructor(e){super(),this.type="PointsMaterial",this.color=new Ce(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}fr.prototype.isPointsMaterial=!0;const Wy=new Oe,fh=new or,vc=new Ci,yc=new ee;class io extends Xe{constructor(e=new ke,t=new fr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),vc.copy(i.boundingSphere),vc.applyMatrix4(r),vc.radius+=s,e.ray.intersectsSphere(vc)===!1)return;Wy.copy(r).invert(),fh.copy(e.ray).applyMatrix4(Wy);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,d=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),g=Math.min(c.count,o.start+o.count);for(let m=p,h=g;m<h;m++){const b=c.getX(m);yc.fromBufferAttribute(d,b),jy(yc,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),g=Math.min(d.count,o.start+o.count);for(let m=p,h=g;m<h;m++)yc.fromBufferAttribute(d,m),jy(yc,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}io.prototype.isPoints=!0;function jy(n,e,t,i,r,s,o){const l=fh.distanceSqToPoint(n);if(l<t){const u=new ee;fh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class $y extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Ti,this.minFilter=o!==void 0?o:gt,this.magFilter=s!==void 0?s:gt,this.generateMipmaps=!1;const f=this;function d(){f.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}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)}}$y.prototype.isVideoTexture=!0;class ph extends Mt{constructor(e,t,i,r,s,o,l,u,c,f,d,p){super(null,o,l,u,c,f,r,s,d,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}ph.prototype.isCompressedTexture=!0;class Zy extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Zy.prototype.isCanvasTexture=!0;class Xy extends Mt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Or,f!==Or&&f!==Ps)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Or&&(i=ea),i===void 0&&f===Ps&&(i=Fs),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:wt,this.minFilter=u!==void 0?u:wt,this.flipY=!1,this.generateMipmaps=!1}}Xy.prototype.isDepthTexture=!0;class ro extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new ee,f=new Ae;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const g=i+d/t*r;c.x=e*Math.cos(g),c.y=e*Math.sin(g),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("normal",new Pe(l,3)),this.setAttribute("uv",new Pe(u,2))}static fromJSON(e){return new ro(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class pr extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],d=[],p=[],g=[];let m=0;const h=[],b=i/2;let y=0;v(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(f),this.setAttribute("position",new Pe(d,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(g,2));function v(){const A=new ee,_=new ee;let w=0;const C=(t-e)/i;for(let P=0;P<=s;P++){const R=[],I=P/s,S=I*(t-e)+e;for(let T=0;T<=r;T++){const E=T/r,L=E*u+l,F=Math.sin(L),x=Math.cos(L);_.x=S*F,_.y=-I*i+b,_.z=S*x,d.push(_.x,_.y,_.z),A.set(F,C,x).normalize(),p.push(A.x,A.y,A.z),g.push(E,1-I),R.push(m++)}h.push(R)}for(let P=0;P<r;P++)for(let R=0;R<s;R++){const I=h[R][P],S=h[R+1][P],T=h[R+1][P+1],E=h[R][P+1];f.push(I,S,E),f.push(S,T,E),w+=6}c.addGroup(y,w,0),y+=w}function M(A){const _=m,w=new Ae,C=new ee;let P=0;const R=A===!0?e:t,I=A===!0?1:-1;for(let T=1;T<=r;T++)d.push(0,b*I,0),p.push(0,I,0),g.push(.5,.5),m++;const S=m;for(let T=0;T<=r;T++){const L=T/r*u+l,F=Math.cos(L),x=Math.sin(L);C.x=R*x,C.y=b*I,C.z=R*F,d.push(C.x,C.y,C.z),p.push(0,I,0),w.x=F*.5+.5,w.y=x*.5*I+.5,g.push(w.x,w.y),m++}for(let T=0;T<r;T++){const E=_+T,L=S+T;A===!0?f.push(L,L+1,E):f.push(L+1,L,E),P+=3}c.addGroup(y,P,A===!0?1:2),y+=P}}static fromJSON(e){return new pr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class so extends pr{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new so(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ei extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(s.slice(),3)),this.setAttribute("uv",new Pe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(v){const M=new ee,A=new ee,_=new ee;for(let w=0;w<t.length;w+=3)g(t[w+0],M),g(t[w+1],A),g(t[w+2],_),u(M,A,_,v)}function u(v,M,A,_){const w=_+1,C=[];for(let P=0;P<=w;P++){C[P]=[];const R=v.clone().lerp(A,P/w),I=M.clone().lerp(A,P/w),S=w-P;for(let T=0;T<=S;T++)T===0&&P===w?C[P][T]=R:C[P][T]=R.clone().lerp(I,T/S)}for(let P=0;P<w;P++)for(let R=0;R<2*(w-P)-1;R++){const I=Math.floor(R/2);R%2===0?(p(C[P][I+1]),p(C[P+1][I]),p(C[P][I])):(p(C[P][I+1]),p(C[P+1][I+1]),p(C[P+1][I]))}}function c(v){const M=new ee;for(let A=0;A<s.length;A+=3)M.x=s[A+0],M.y=s[A+1],M.z=s[A+2],M.normalize().multiplyScalar(v),s[A+0]=M.x,s[A+1]=M.y,s[A+2]=M.z}function f(){const v=new ee;for(let M=0;M<s.length;M+=3){v.x=s[M+0],v.y=s[M+1],v.z=s[M+2];const A=b(v)/2/Math.PI+.5,_=y(v)/Math.PI+.5;o.push(A,1-_)}m(),d()}function d(){for(let v=0;v<o.length;v+=6){const M=o[v+0],A=o[v+2],_=o[v+4],w=Math.max(M,A,_),C=Math.min(M,A,_);w>.9&&C<.1&&(M<.2&&(o[v+0]+=1),A<.2&&(o[v+2]+=1),_<.2&&(o[v+4]+=1))}}function p(v){s.push(v.x,v.y,v.z)}function g(v,M){const A=v*3;M.x=e[A+0],M.y=e[A+1],M.z=e[A+2]}function m(){const v=new ee,M=new ee,A=new ee,_=new ee,w=new Ae,C=new Ae,P=new Ae;for(let R=0,I=0;R<s.length;R+=9,I+=6){v.set(s[R+0],s[R+1],s[R+2]),M.set(s[R+3],s[R+4],s[R+5]),A.set(s[R+6],s[R+7],s[R+8]),w.set(o[I+0],o[I+1]),C.set(o[I+2],o[I+3]),P.set(o[I+4],o[I+5]),_.copy(v).add(M).add(A).divideScalar(3);const S=b(_);h(w,I+0,v,S),h(C,I+2,M,S),h(P,I+4,A,S)}}function h(v,M,A,_){_<0&&v.x===1&&(o[M]=v.x-1),A.x===0&&A.z===0&&(o[M]=_/2/Math.PI+.5)}function b(v){return Math.atan2(v.z,-v.x)}function y(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}static fromJSON(e){return new ei(e.vertices,e.indices,e.radius,e.details)}}class oo extends ei{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new oo(e.radius,e.detail)}}const bc=new ee,xc=new ee,mh=new ee,wc=new At;class gh extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Vr*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],d=new Array(3),p={},g=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:h,b,c:y}=wc;if(h.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),y.fromBufferAttribute(l,c[2]),wc.getNormal(mh),d[0]=`${Math.round(h.x*r)},${Math.round(h.y*r)},${Math.round(h.z*r)}`,d[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,d[2]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let v=0;v<3;v++){const M=(v+1)%3,A=d[v],_=d[M],w=wc[f[v]],C=wc[f[M]],P=`${A}_${_}`,R=`${_}_${A}`;R in p&&p[R]?(mh.dot(p[R].normal)<=s&&(g.push(w.x,w.y,w.z),g.push(C.x,C.y,C.z)),p[R]=null):P in p||(p[P]={index0:c[v],index1:c[M],normal:mh.clone()})}}for(const m in p)if(p[m]){const{index0:h,index1:b}=p[m];bc.fromBufferAttribute(l,h),xc.fromBufferAttribute(l,b),g.push(bc.x,bc.y,bc.z),g.push(xc.x,xc.y,xc.z)}this.setAttribute("position",new Pe(g,3))}}class vn{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 l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,g=(o-f)/p;return(r+g)/(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),l=this.getPoint(s),u=t||(o.isVector2?new Ae:new ee);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new ee,r=[],s=[],o=[],l=new ee,u=new Oe;for(let g=0;g<=e;g++){const m=g/e;r[g]=this.getTangentAt(m,new ee),r[g].normalize()}s[0]=new ee,o[0]=new ee;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),l.crossVectors(r[g-1],r[g]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(u.makeRotationAxis(l,m))}o[g].crossVectors(r[g],s[g])}if(t===!0){let g=Math.acos($t(s[0].dot(s[e]),-1,1));g/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(g=-g);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],g*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.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Sa extends vn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Ae,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=u-this.aX,g=c-this.aY;u=p*f-g*d+this.aX,c=p*d+g*f+this.aY}return i.set(u,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Sa.prototype.isEllipseCurve=!0;class vh extends Sa{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}vh.prototype.isArcCurve=!0;function yh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,d){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,g=(l-o)/f-(u-o)/(f+d)+(u-l)/d;p*=f,g*=f,r(o,l,p,g)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const Mc=new ee,bh=new yh,xh=new yh,wh=new yh;class Mh extends vn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new ee){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(Mc.subVectors(r[0],r[1]).add(r[0]),c=Mc);const d=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(Mc.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=Mc),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(d),g),h=Math.pow(d.distanceToSquared(p),g),b=Math.pow(p.distanceToSquared(f),g);h<1e-4&&(h=1),m<1e-4&&(m=h),b<1e-4&&(b=h),bh.initNonuniformCatmullRom(c.x,d.x,p.x,f.x,m,h,b),xh.initNonuniformCatmullRom(c.y,d.y,p.y,f.y,m,h,b),wh.initNonuniformCatmullRom(c.z,d.z,p.z,f.z,m,h,b)}else this.curveType==="catmullrom"&&(bh.initCatmullRom(c.x,d.x,p.x,f.x,this.tension),xh.initCatmullRom(c.y,d.y,p.y,f.y,this.tension),wh.initCatmullRom(c.z,d.z,p.z,f.z,this.tension));return i.set(bh.calc(u),xh.calc(u),wh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new ee().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}Mh.prototype.isCatmullRomCurve3=!0;function Yy(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function kO(n,e){const t=1-n;return t*t*e}function VO(n,e){return 2*(1-n)*n*e}function zO(n,e){return n*n*e}function _a(n,e,t,i){return kO(n,e)+VO(n,t)+zO(n,i)}function UO(n,e){const t=1-n;return t*t*t*e}function GO(n,e){const t=1-n;return 3*t*t*n*e}function HO(n,e){return 3*(1-n)*n*n*e}function WO(n,e){return n*n*n*e}function Ta(n,e,t,i,r){return UO(n,e)+GO(n,t)+HO(n,i)+WO(n,r)}class Ac extends vn{constructor(e=new Ae,t=new Ae,i=new Ae,r=new Ae){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ta(e,r.x,s.x,o.x,l.x),Ta(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ac.prototype.isCubicBezierCurve=!0;class Ah extends vn{constructor(e=new ee,t=new ee,i=new ee,r=new ee){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new ee){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ta(e,r.x,s.x,o.x,l.x),Ta(e,r.y,s.y,o.y,l.y),Ta(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ah.prototype.isCubicBezierCurve3=!0;class Ea extends vn{constructor(e=new Ae,t=new Ae){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ae){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Ae;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Ea.prototype.isLineCurve=!0;class Jy extends vn{constructor(e=new ee,t=new ee){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new ee){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Sc extends vn{constructor(e=new Ae,t=new Ae,i=new Ae){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(_a(e,r.x,s.x,o.x),_a(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Sc.prototype.isQuadraticBezierCurve=!0;class Sh extends vn{constructor(e=new ee,t=new ee,i=new ee){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ee){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(_a(e,r.x,s.x,o.x),_a(e,r.y,s.y,o.y),_a(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Sh.prototype.isQuadraticBezierCurve3=!0;class _c extends vn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Ae){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(Yy(l,u.x,c.x,f.x,d.x),Yy(l,u.y,c.y,f.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Ae().fromArray(r))}return this}}_c.prototype.isSplineCurve=!0;var _h=Object.freeze({__proto__:null,ArcCurve:vh,CatmullRomCurve3:Mh,CubicBezierCurve:Ac,CubicBezierCurve3:Ah,EllipseCurve:Sa,LineCurve:Ea,LineCurve3:Jy,QuadraticBezierCurve:Sc,QuadraticBezierCurve3:Sh,SplineCurve:_c});const jO={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=Ky(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,d,p,g;if(i&&(s=JO(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)d=n[m],p=n[m+1],d<l&&(l=d),p<u&&(u=p),d>c&&(c=d),p>f&&(f=p);g=Math.max(c-l,f-u),g=g!==0?1/g:0}return Ca(s,o,t,l,u,g),o}};function Ky(n,e,t,i,r){let s,o;if(r===aN(n,e,t,i)>0)for(s=e;s<t;s+=i)o=eb(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=eb(s,n[s],n[s+1],o);return o&&Tc(o,o.next)&&(Ra(o),o=o.next),o}function mr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Tc(t,t.next)||ht(t.prev,t,t.next)===0)){if(Ra(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Ca(n,e,t,i,r,s,o){if(!n)return;!o&&s&&tN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?ZO(n,i,r,s):$O(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ra(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=XO(mr(n),e,t),Ca(n,e,t,i,r,s,2)):o===2&&YO(n,e,t,i,r,s):Ca(mr(n),e,t,i,r,s,1);break}}}function $O(n){const e=n.prev,t=n,i=n.next;if(ht(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(ao(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ht(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ZO(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ht(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,d=Th(l,u,e,t,i),p=Th(c,f,e,t,i);let g=n.prevZ,m=n.nextZ;for(;g&&g.z>=d&&m&&m.z<=p;){if(g!==n.prev&&g!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&ht(g.prev,g,g.next)>=0||(g=g.prevZ,m!==n.prev&&m!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;g&&g.z>=d;){if(g!==n.prev&&g!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&ht(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&ao(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ht(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function XO(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Tc(r,s)&&qy(r,i,i.next,s)&&La(r,s)&&La(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ra(i),Ra(i.next),i=n=s),i=i.next}while(i!==n);return mr(i)}function YO(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&rN(o,l)){let u=Qy(o,l);o=mr(o,o.next),u=mr(u,u.next),Ca(o,e,t,i,r,s),Ca(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function JO(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=Ky(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(iN(c));for(r.sort(KO),s=0;s<r.length;s++)qO(r[s],t),t=mr(t,t.next);return t}function KO(n,e){return n.x-e.x}function qO(n,e){if(e=QO(n,e),e){const t=Qy(e,n);mr(e,e.next),mr(t,t.next)}}function QO(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,d;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&ao(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(d=Math.abs(r-t.y)/(i-t.x),La(t,n)&&(d<f||d===f&&(t.x>o.x||t.x===o.x&&eN(o,t)))&&(o=t,f=d)),t=t.next;while(t!==l);return o}function eN(n,e){return ht(n.prev,n,e.prev)<0&&ht(e.next,n,n.next)<0}function tN(n,e,t,i){let r=n;do r.z===null&&(r.z=Th(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,nN(r)}function nN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Th(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,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 iN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function ao(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function rN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!sN(n,e)&&(La(n,e)&&La(e,n)&&oN(n,e)&&(ht(n.prev,n,e.prev)||ht(n,e.prev,e))||Tc(n,e)&&ht(n.prev,n,n.next)>0&&ht(e.prev,e,e.next)>0)}function ht(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Tc(n,e){return n.x===e.x&&n.y===e.y}function qy(n,e,t,i){const r=Cc(ht(n,e,t)),s=Cc(ht(n,e,i)),o=Cc(ht(t,i,n)),l=Cc(ht(t,i,e));return!!(r!==s&&o!==l||r===0&&Ec(n,t,e)||s===0&&Ec(n,i,e)||o===0&&Ec(t,n,i)||l===0&&Ec(t,e,i))}function Ec(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 Cc(n){return n>0?1:n<0?-1:0}function sN(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&&qy(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function La(n,e){return ht(n.prev,n,n.next)<0?ht(n,e,n.next)>=0&&ht(n,n.prev,e)>=0:ht(n,e,n.prev)<0||ht(n,n.next,e)<0}function oN(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 Qy(n,e){const t=new Eh(n.i,n.x,n.y),i=new Eh(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 eb(n,e,t,i){const r=new Eh(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 Ra(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 Eh(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function aN(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ti{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ti.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];tb(e),nb(i,e);let o=e.length;t.forEach(tb);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,nb(i,t[u]);const l=jO.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function tb(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function nb(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Nn extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Pe(r,3)),this.setAttribute("uv",new Pe(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let d=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:g-2,h=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const y=t.extrudePath,v=t.UVGenerator!==void 0?t.UVGenerator:lN;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);let M,A=!1,_,w,C,P;y&&(M=y.getSpacedPoints(f),A=!0,p=!1,_=y.computeFrenetFrames(f,!1),w=new ee,C=new ee,P=new ee),p||(b=0,g=0,m=0,h=0);const R=l.extractPoints(c);let I=R.shape;const S=R.holes;if(!ti.isClockWise(I)){I=I.reverse();for(let V=0,j=S.length;V<j;V++){const oe=S[V];ti.isClockWise(oe)&&(S[V]=oe.reverse())}}const E=ti.triangulateShape(I,S),L=I;for(let V=0,j=S.length;V<j;V++){const oe=S[V];I=I.concat(oe)}function F(V,j,oe){return j||console.error("THREE.ExtrudeGeometry: vec does not exist"),j.clone().multiplyScalar(oe).add(V)}const x=I.length,O=E.length;function B(V,j,oe){let ae,le,H;const U=V.x-j.x,D=V.y-j.y,Q=oe.x-V.x,ie=oe.y-V.y,ce=U*U+D*D,ge=U*ie-D*Q;if(Math.abs(ge)>Number.EPSILON){const ye=Math.sqrt(ce),ue=Math.sqrt(Q*Q+ie*ie),be=j.x-D/ye,ne=j.y+U/ye,de=oe.x-ie/ue,ve=oe.y+Q/ue,Ee=((de-be)*ie-(ve-ne)*Q)/(U*ie-D*Q);ae=be+U*Ee-V.x,le=ne+D*Ee-V.y;const Se=ae*ae+le*le;if(Se<=2)return new Ae(ae,le);H=Math.sqrt(Se/2)}else{let ye=!1;U>Number.EPSILON?Q>Number.EPSILON&&(ye=!0):U<-Number.EPSILON?Q<-Number.EPSILON&&(ye=!0):Math.sign(D)===Math.sign(ie)&&(ye=!0),ye?(ae=-D,le=U,H=Math.sqrt(ce)):(ae=U,le=D,H=Math.sqrt(ce/2))}return new Ae(ae/H,le/H)}const N=[];for(let V=0,j=L.length,oe=j-1,ae=V+1;V<j;V++,oe++,ae++)oe===j&&(oe=0),ae===j&&(ae=0),N[V]=B(L[V],L[oe],L[ae]);const k=[];let z,G=N.concat();for(let V=0,j=S.length;V<j;V++){const oe=S[V];z=[];for(let ae=0,le=oe.length,H=le-1,U=ae+1;ae<le;ae++,H++,U++)H===le&&(H=0),U===le&&(U=0),z[ae]=B(oe[ae],oe[H],oe[U]);k.push(z),G=G.concat(z)}for(let V=0;V<b;V++){const j=V/b,oe=g*Math.cos(j*Math.PI/2),ae=m*Math.sin(j*Math.PI/2)+h;for(let le=0,H=L.length;le<H;le++){const U=F(L[le],N[le],ae);W(U.x,U.y,-oe)}for(let le=0,H=S.length;le<H;le++){const U=S[le];z=k[le];for(let D=0,Q=U.length;D<Q;D++){const ie=F(U[D],z[D],ae);W(ie.x,ie.y,-oe)}}}const Y=m+h;for(let V=0;V<x;V++){const j=p?F(I[V],G[V],Y):I[V];A?(C.copy(_.normals[0]).multiplyScalar(j.x),w.copy(_.binormals[0]).multiplyScalar(j.y),P.copy(M[0]).add(C).add(w),W(P.x,P.y,P.z)):W(j.x,j.y,0)}for(let V=1;V<=f;V++)for(let j=0;j<x;j++){const oe=p?F(I[j],G[j],Y):I[j];A?(C.copy(_.normals[V]).multiplyScalar(oe.x),w.copy(_.binormals[V]).multiplyScalar(oe.y),P.copy(M[V]).add(C).add(w),W(P.x,P.y,P.z)):W(oe.x,oe.y,d/f*V)}for(let V=b-1;V>=0;V--){const j=V/b,oe=g*Math.cos(j*Math.PI/2),ae=m*Math.sin(j*Math.PI/2)+h;for(let le=0,H=L.length;le<H;le++){const U=F(L[le],N[le],ae);W(U.x,U.y,d+oe)}for(let le=0,H=S.length;le<H;le++){const U=S[le];z=k[le];for(let D=0,Q=U.length;D<Q;D++){const ie=F(U[D],z[D],ae);A?W(ie.x,ie.y+M[f-1].y,M[f-1].x+oe):W(ie.x,ie.y,d+oe)}}}Z(),te();function Z(){const V=r.length/3;if(p){let j=0,oe=x*j;for(let ae=0;ae<O;ae++){const le=E[ae];$(le[2]+oe,le[1]+oe,le[0]+oe)}j=f+b*2,oe=x*j;for(let ae=0;ae<O;ae++){const le=E[ae];$(le[0]+oe,le[1]+oe,le[2]+oe)}}else{for(let j=0;j<O;j++){const oe=E[j];$(oe[2],oe[1],oe[0])}for(let j=0;j<O;j++){const oe=E[j];$(oe[0]+x*f,oe[1]+x*f,oe[2]+x*f)}}i.addGroup(V,r.length/3-V,0)}function te(){const V=r.length/3;let j=0;q(L,j),j+=L.length;for(let oe=0,ae=S.length;oe<ae;oe++){const le=S[oe];q(le,j),j+=le.length}i.addGroup(V,r.length/3-V,1)}function q(V,j){let oe=V.length;for(;--oe>=0;){const ae=oe;let le=oe-1;le<0&&(le=V.length-1);for(let H=0,U=f+b*2;H<U;H++){const D=x*H,Q=x*(H+1),ie=j+ae+D,ce=j+le+D,ge=j+le+Q,ye=j+ae+Q;X(ie,ce,ge,ye)}}}function W(V,j,oe){u.push(V),u.push(j),u.push(oe)}function $(V,j,oe){K(V),K(j),K(oe);const ae=r.length/3,le=v.generateTopUV(i,r,ae-3,ae-2,ae-1);re(le[0]),re(le[1]),re(le[2])}function X(V,j,oe,ae){K(V),K(j),K(ae),K(j),K(oe),K(ae);const le=r.length/3,H=v.generateSideWallUV(i,r,le-6,le-3,le-2,le-1);re(H[0]),re(H[1]),re(H[3]),re(H[1]),re(H[2]),re(H[3])}function K(V){r.push(u[V*3+0]),r.push(u[V*3+1]),r.push(u[V*3+2])}function re(V){s.push(V.x),s.push(V.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return cN(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new _h[r.type]().fromJSON(r)),new Nn(i,e.options)}}const lN={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new Ae(s,o),new Ae(l,u),new Ae(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],d=e[i*3+2],p=e[r*3],g=e[r*3+1],m=e[r*3+2],h=e[s*3],b=e[s*3+1],y=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new Ae(o,1-u),new Ae(c,1-d),new Ae(p,1-m),new Ae(h,1-y)]:[new Ae(l,1-u),new Ae(f,1-d),new Ae(g,1-m),new Ae(b,1-y)]}};function cN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class lo extends ei{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lo(e.radius,e.detail)}}class co extends ke{constructor(e,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=$t(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new ee,f=new Ae;for(let d=0;d<=t;d++){const p=i+d*u*r,g=Math.sin(p),m=Math.cos(p);for(let h=0;h<=e.length-1;h++)c.x=e[h].x*g,c.y=e[h].y,c.z=e[h].x*m,o.push(c.x,c.y,c.z),f.x=d/t,f.y=h/(e.length-1),l.push(f.x,f.y)}for(let d=0;d<t;d++)for(let p=0;p<e.length-1;p++){const g=p+d*e.length,m=g,h=g+e.length,b=g+e.length+1,y=g+1;s.push(m,h,y),s.push(h,b,y)}if(this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2)),this.computeVertexNormals(),r===Math.PI*2){const d=this.attributes.normal.array,p=new ee,g=new ee,m=new ee,h=t*e.length*3;for(let b=0,y=0;b<e.length;b++,y+=3)p.x=d[y+0],p.y=d[y+1],p.z=d[y+2],g.x=d[h+y+0],g.y=d[h+y+1],g.z=d[h+y+2],m.addVectors(p,g).normalize(),d[y+0]=d[h+y+0]=m.x,d[y+1]=d[h+y+1]=m.y,d[y+2]=d[h+y+2]=m.z}}static fromJSON(e){return new co(e.points,e.segments,e.phiStart,e.phiLength)}}class $r extends ei{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new $r(e.radius,e.detail)}}class Lc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new ee,f=new ee,d=new ee,p=new ee,g=new ee;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let h=0;h<=i;h++){const b=h/i;for(let y=0;y<=t;y++){const v=y/t;e(v,b,f),s.push(f.x,f.y,f.z),v-u>=0?(e(v-u,b,d),p.subVectors(f,d)):(e(v+u,b,d),p.subVectors(d,f)),b-u>=0?(e(v,b-u,d),g.subVectors(f,d)):(e(v,b+u,d),g.subVectors(d,f)),c.crossVectors(p,g).normalize(),o.push(c.x,c.y,c.z),l.push(v,b)}}for(let h=0;h<i;h++)for(let b=0;b<t;b++){const y=h*m+b,v=h*m+b+1,M=(h+1)*m+b+1,A=(h+1)*m+b;r.push(y,v,A),r.push(v,M,A)}this.setIndex(r),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2))}}class uo extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let d=e;const p=(t-e)/r,g=new ee,m=new Ae;for(let h=0;h<=r;h++){for(let b=0;b<=i;b++){const y=s+b/i*o;g.x=d*Math.cos(y),g.y=d*Math.sin(y),u.push(g.x,g.y,g.z),c.push(0,0,1),m.x=(g.x/t+1)/2,m.y=(g.y/t+1)/2,f.push(m.x,m.y)}d+=p}for(let h=0;h<r;h++){const b=h*(i+1);for(let y=0;y<i;y++){const v=y+b,M=v,A=v+i+1,_=v+i+2,w=v+1;l.push(M,A,w),l.push(A,_,w)}}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2))}static fromJSON(e){return new uo(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Zr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Pe(r,3)),this.setAttribute("normal",new Pe(s,3)),this.setAttribute("uv",new Pe(o,2));function c(f){const d=r.length/3,p=f.extractPoints(t);let g=p.shape;const m=p.holes;ti.isClockWise(g)===!1&&(g=g.reverse());for(let b=0,y=m.length;b<y;b++){const v=m[b];ti.isClockWise(v)===!0&&(m[b]=v.reverse())}const h=ti.triangulateShape(g,m);for(let b=0,y=m.length;b<y;b++){const v=m[b];g=g.concat(v)}for(let b=0,y=g.length;b<y;b++){const v=g[b];r.push(v.x,v.y,0),s.push(0,0,1),o.push(v.x,v.y)}for(let b=0,y=h.length;b<y;b++){const v=h[b],M=v[0]+d,A=v[1]+d,_=v[2]+d;i.push(M,A,_),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return uN(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Zr(i,e.curveSegments)}}function uN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Xr extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],d=new ee,p=new ee,g=[],m=[],h=[],b=[];for(let y=0;y<=i;y++){const v=[],M=y/i;let A=0;y==0&&o==0?A=.5/t:y==i&&u==Math.PI&&(A=-.5/t);for(let _=0;_<=t;_++){const w=_/t;d.x=-e*Math.cos(r+w*s)*Math.sin(o+M*l),d.y=e*Math.cos(o+M*l),d.z=e*Math.sin(r+w*s)*Math.sin(o+M*l),m.push(d.x,d.y,d.z),p.copy(d).normalize(),h.push(p.x,p.y,p.z),b.push(w+A,1-M),v.push(c++)}f.push(v)}for(let y=0;y<i;y++)for(let v=0;v<t;v++){const M=f[y][v+1],A=f[y][v],_=f[y+1][v],w=f[y+1][v+1];(y!==0||o>0)&&g.push(M,A,w),(y!==i-1||u<Math.PI)&&g.push(A,_,w)}this.setIndex(g),this.setAttribute("position",new Pe(m,3)),this.setAttribute("normal",new Pe(h,3)),this.setAttribute("uv",new Pe(b,2))}static fromJSON(e){return new Xr(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ho extends ei{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ho(e.radius,e.detail)}}class Rc extends Nn{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class fo extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new ee,d=new ee,p=new ee;for(let g=0;g<=i;g++)for(let m=0;m<=r;m++){const h=m/r*s,b=g/i*Math.PI*2;d.x=(e+t*Math.cos(b))*Math.cos(h),d.y=(e+t*Math.cos(b))*Math.sin(h),d.z=t*Math.sin(b),l.push(d.x,d.y,d.z),f.x=e*Math.cos(h),f.y=e*Math.sin(h),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(g/i)}for(let g=1;g<=i;g++)for(let m=1;m<=r;m++){const h=(r+1)*g+m-1,b=(r+1)*(g-1)+m-1,y=(r+1)*(g-1)+m,v=(r+1)*g+m;o.push(h,b,v),o.push(b,y,v)}this.setIndex(o),this.setAttribute("position",new Pe(l,3)),this.setAttribute("normal",new Pe(u,3)),this.setAttribute("uv",new Pe(c,2))}static fromJSON(e){return new fo(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class po extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],d=new ee,p=new ee,g=new ee,m=new ee,h=new ee,b=new ee,y=new ee;for(let M=0;M<=i;++M){const A=M/i*s*Math.PI*2;v(A,s,o,e,g),v(A+.01,s,o,e,m),b.subVectors(m,g),y.addVectors(m,g),h.crossVectors(b,y),y.crossVectors(h,b),h.normalize(),y.normalize();for(let _=0;_<=r;++_){const w=_/r*Math.PI*2,C=-t*Math.cos(w),P=t*Math.sin(w);d.x=g.x+(C*y.x+P*h.x),d.y=g.y+(C*y.y+P*h.y),d.z=g.z+(C*y.z+P*h.z),u.push(d.x,d.y,d.z),p.subVectors(d,g).normalize(),c.push(p.x,p.y,p.z),f.push(M/i),f.push(_/r)}}for(let M=1;M<=i;M++)for(let A=1;A<=r;A++){const _=(r+1)*(M-1)+(A-1),w=(r+1)*M+(A-1),C=(r+1)*M+A,P=(r+1)*(M-1)+A;l.push(_,w,P),l.push(w,C,P)}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2));function v(M,A,_,w,C){const P=Math.cos(M),R=Math.sin(M),I=_/A*M,S=Math.cos(I);C.x=w*(2+S)*.5*P,C.y=w*(2+S)*R*.5,C.z=w*Math.sin(I)*.5}}static fromJSON(e){return new po(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class mo extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new ee,u=new ee,c=new Ae;let f=new ee;const d=[],p=[],g=[],m=[];h(),this.setIndex(m),this.setAttribute("position",new Pe(d,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(g,2));function h(){for(let M=0;M<t;M++)b(M);b(s===!1?t:0),v(),y()}function b(M){f=e.getPointAt(M/t,f);const A=o.normals[M],_=o.binormals[M];for(let w=0;w<=r;w++){const C=w/r*Math.PI*2,P=Math.sin(C),R=-Math.cos(C);u.x=R*A.x+P*_.x,u.y=R*A.y+P*_.y,u.z=R*A.z+P*_.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,d.push(l.x,l.y,l.z)}}function y(){for(let M=1;M<=t;M++)for(let A=1;A<=r;A++){const _=(r+1)*(M-1)+(A-1),w=(r+1)*M+(A-1),C=(r+1)*M+A,P=(r+1)*(M-1)+A;m.push(_,w,P),m.push(w,C,P)}}function v(){for(let M=0;M<=t;M++)for(let A=0;A<=r;A++)c.x=M/t,c.y=A/r,g.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new mo(new _h[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Ch extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new ee;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const d=u[c],p=d.start,g=d.count;for(let m=p,h=p+g;m<h;m+=3)for(let b=0;b<3;b++){const y=l.getX(m+b),v=l.getX(m+(b+1)%3);i[0]=Math.min(y,v),i[1]=Math.max(y,v);const M=i[0]+","+i[1];r[M]===void 0&&(r[M]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const d=3*l+(c+1)%3;s.fromBufferAttribute(o,d),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Pe(t,3))}}var ib=Object.freeze({__proto__:null,BoxGeometry:Ii,BoxBufferGeometry:Ii,CircleGeometry:ro,CircleBufferGeometry:ro,ConeGeometry:so,ConeBufferGeometry:so,CylinderGeometry:pr,CylinderBufferGeometry:pr,DodecahedronGeometry:oo,DodecahedronBufferGeometry:oo,EdgesGeometry:gh,ExtrudeGeometry:Nn,ExtrudeBufferGeometry:Nn,IcosahedronGeometry:lo,IcosahedronBufferGeometry:lo,LatheGeometry:co,LatheBufferGeometry:co,OctahedronGeometry:$r,OctahedronBufferGeometry:$r,ParametricGeometry:Lc,ParametricBufferGeometry:Lc,PlaneGeometry:Wr,PlaneBufferGeometry:Wr,PolyhedronGeometry:ei,PolyhedronBufferGeometry:ei,RingGeometry:uo,RingBufferGeometry:uo,ShapeGeometry:Zr,ShapeBufferGeometry:Zr,SphereGeometry:Xr,SphereBufferGeometry:Xr,TetrahedronGeometry:ho,TetrahedronBufferGeometry:ho,TextGeometry:Rc,TextBufferGeometry:Rc,TorusGeometry:fo,TorusBufferGeometry:fo,TorusKnotGeometry:po,TorusKnotBufferGeometry:po,TubeGeometry:mo,TubeBufferGeometry:mo,WireframeGeometry:Ch});class Lh extends Ft{constructor(e){super(),this.type="ShadowMaterial",this.color=new Ce(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Lh.prototype.isShadowMaterial=!0;class go extends Oi{constructor(e){super(e),this.type="RawShaderMaterial"}}go.prototype.isRawShaderMaterial=!0;class Yr extends Ft{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ce(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Yr.prototype.isMeshStandardMaterial=!0;class Fa extends Yr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ae(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=$t(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Ce(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ce).copy(e.sheen):this.sheen=null,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}}Fa.prototype.isMeshPhysicalMaterial=!0;class Rh extends Ft{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ce(16777215),this.specular=new Ce(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Xo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Rh.prototype.isMeshPhongMaterial=!0;class Fh extends Ft{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ce(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(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.morphTargets=!1,this.morphNormals=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Fh.prototype.isMeshToonMaterial=!0;class Ph extends Ft{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ph.prototype.isMeshNormalMaterial=!0;class Ih extends Ft{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Xo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Ih.prototype.isMeshLambertMaterial=!0;class Oh extends Ft{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ce(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tr,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Oh.prototype.isMeshMatcapMaterial=!0;class Nh extends Vt{constructor(e){super(),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}}Nh.prototype.isLineDashedMaterial=!0;var dN=Object.freeze({__proto__:null,ShadowMaterial:Lh,SpriteMaterial:ma,RawShaderMaterial:go,ShaderMaterial:Oi,PointsMaterial:fr,MeshPhysicalMaterial:Fa,MeshStandardMaterial:Yr,MeshPhongMaterial:Rh,MeshToonMaterial:Fh,MeshNormalMaterial:Ph,MeshLambertMaterial:Ih,MeshDepthMaterial:ac,MeshDistanceMaterial:lc,MeshBasicMaterial:cn,MeshMatcapMaterial:Oh,LineDashedMaterial:Nh,LineBasicMaterial:Vt,Material:Ft});const ct={arraySlice:function(n,e,t){return ct.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(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},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(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)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),d=[],p=[];for(let g=0;g<c.times.length;++g){const m=c.times[g]*r;if(!(m<t||m>=i)){d.push(c.times[g]);for(let h=0;h<f;++h)p.push(c.values[g*f+h])}}d.length!==0&&(c.times=ct.convertArray(d,c.times.constructor),c.values=ct.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(y){return y.name===l.name&&y.ValueTypeName===u});if(c===void 0)continue;let f=0;const d=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=d/3);let p=0;const g=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=g/3);const m=l.times.length-1;let h;if(s<=l.times[0]){const y=f,v=d-f;h=ct.arraySlice(l.values,y,v)}else if(s>=l.times[m]){const y=m*d+f,v=y+d-f;h=ct.arraySlice(l.values,y,v)}else{const y=l.createInterpolant(),v=f,M=d-f;y.evaluate(s),h=ct.arraySlice(y.resultBuffer,v,M)}u==="quaternion"&&new Zt().fromArray(h).normalize().conjugate().toArray(h);const b=c.times.length;for(let y=0;y<b;++y){const v=y*g+p;if(u==="quaternion")Zt.multiplyQuaternionsFlat(c.values,v,h,0,c.values,v);else{const M=g-p*2;for(let A=0;A<M;++A)c.values[v+A]-=h[A]}}}return n.blendMode=Sd,n}};class ni{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ni.prototype.beforeStart_=ni.prototype.copySampleValue_,ni.prototype.afterEnd_=ni.prototype.copySampleValue_;class rb extends ni{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Br,endingEnd:Br}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case Dr:s=e,l=2*t-i;break;case na:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Dr:o=e,u=2*i-t;break;case na:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,g=this._weightNext,m=(i-t)/(r-t),h=m*m,b=h*m,y=-p*b+2*p*h-p*m,v=(1+p)*b+(-1.5-2*p)*h+(-.5+p)*m+1,M=(-1-g)*b+(1.5+g)*h+.5*m,A=g*b-g*h;for(let _=0;_!==l;++_)s[_]=y*o[f+_]+v*o[c+_]+M*o[u+_]+A*o[d+_];return s}}class Bh extends ni{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),d=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*d+o[u+p]*f;return s}}class sb extends ni{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Bn{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ct.convertArray(t,this.TimeBufferType),this.values=ct.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ct.convertArray(e.times,Array),values:ct.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new sb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Bh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new rb(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Is:t=this.InterpolantFactoryMethodDiscrete;break;case Nr:t=this.InterpolantFactoryMethodLinear;break;case Ol:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Is;case this.InterpolantFactoryMethodLinear:return Nr;case this.InterpolantFactoryMethodSmooth:return Ol}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ct.arraySlice(i,s,o),this.values=ct.arraySlice(this.values,s*l,o*l)}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 l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ct.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ct.arraySlice(this.times),t=ct.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Ol,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const d=l*i,p=d-i,g=d+i;for(let m=0;m!==i;++m){const h=t[d+m];if(h!==t[p+m]||h!==t[g+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const d=l*i,p=o*i;for(let g=0;g!==i;++g)t[p+g]=t[d+g]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ct.arraySlice(e,0,o),this.values=ct.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ct.arraySlice(this.times,0),t=ct.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Bn.prototype.TimeBufferType=Float32Array,Bn.prototype.ValueBufferType=Float32Array,Bn.prototype.DefaultInterpolation=Nr;class Jr extends Bn{}Jr.prototype.ValueTypeName="bool",Jr.prototype.ValueBufferType=Array,Jr.prototype.DefaultInterpolation=Is,Jr.prototype.InterpolantFactoryMethodLinear=void 0,Jr.prototype.InterpolantFactoryMethodSmooth=void 0;class Dh extends Bn{}Dh.prototype.ValueTypeName="color";class vo extends Bn{}vo.prototype.ValueTypeName="number";class ob extends ni{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Kr extends Bn{InterpolantFactoryMethodLinear(e){return new ob(this.times,this.values,this.getValueSize(),e)}}Kr.prototype.ValueTypeName="quaternion",Kr.prototype.DefaultInterpolation=Nr,Kr.prototype.InterpolantFactoryMethodSmooth=void 0;class qr extends Bn{}qr.prototype.ValueTypeName="string",qr.prototype.ValueBufferType=Array,qr.prototype.DefaultInterpolation=Is,qr.prototype.InterpolantFactoryMethodLinear=void 0,qr.prototype.InterpolantFactoryMethodSmooth=void 0;class yo extends Bn{}yo.prototype.ValueTypeName="vector";class bo{constructor(e,t=-1,i,r=Nl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=pn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(fN(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(Bn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=ct.getKeyframeOrder(u);u=ct.sortedArray(u,1,f),c=ct.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new vo(".morphTargetInfluences["+t[l].name+"]",u,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const d=f[1];let p=r[d];p||(r[d]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,g,m,h){if(g.length!==0){const b=[],y=[];ct.flattenJSON(g,b,y,m),b.length!==0&&h.push(new d(p,b,y))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let d=0;d<c.length;d++){const p=c[d].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const g={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let h=0;h<p[m].morphTargets.length;h++)g[p[m].morphTargets[h]]=-1;for(const h in g){const b=[],y=[];for(let v=0;v!==p[m].morphTargets.length;++v){const M=p[m];b.push(M.time),y.push(M.morphTarget===h?1:0)}r.push(new vo(".morphTargetInfluence["+h+"]",b,y))}u=g.length*o}else{const g=".bones["+t[d].name+"]";i(yo,g+".position",p,"pos",r),i(Kr,g+".quaternion",p,"rot",r),i(yo,g+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function hN(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return vo;case"vector":case"vector2":case"vector3":case"vector4":return yo;case"color":return Dh;case"quaternion":return Kr;case"bool":case"boolean":return Jr;case"string":return qr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function fN(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=hN(n.type);if(n.times===void 0){const t=[],i=[];ct.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Qr={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class kh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,d){return c.push(f,d),this},this.removeHandler=function(f){const d=c.indexOf(f);return d!==-1&&c.splice(d,2),this},this.getHandler=function(f){for(let d=0,p=c.length;d<p;d+=2){const g=c[d],m=c[d+1];if(g.global&&(g.lastIndex=0),g.test(f))return m}return null}}}const ab=new kh;class Xt{constructor(e){this.manager=e!==void 0?e:ab,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Dn={};class yn extends Xt{constructor(e){super(e)}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=Qr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(Dn[e]!==void 0){Dn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],d=!!u[2];let p=u[3];p=decodeURIComponent(p),d&&(p=atob(p));try{let g;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const h=new Uint8Array(p.length);for(let y=0;y<p.length;y++)h[y]=p.charCodeAt(y);m==="blob"?g=new Blob([h.buffer],{type:f}):g=h.buffer;break;case"document":g=new DOMParser().parseFromString(p,f);break;case"json":g=JSON.parse(p);break;default:g=p;break}setTimeout(function(){t&&t(g),s.manager.itemEnd(e)},0)}catch(g){setTimeout(function(){r&&r(g),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{Dn[e]=[],Dn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const d=this.response,p=Dn[e];if(delete Dn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Qr.add(e,d);for(let g=0,m=p.length;g<m;g++){const h=p[g];h.onLoad&&h.onLoad(d)}s.manager.itemEnd(e)}else{for(let g=0,m=p.length;g<m;g++){const h=p[g];h.onError&&h.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const d=Dn[e];for(let p=0,g=d.length;p<g;p++){const m=d[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const d=Dn[e];delete Dn[e];for(let p=0,g=d.length;p<g;p++){const m=d[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const d=Dn[e];delete Dn[e];for(let p=0,g=d.length;p<g;p++){const m=d[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class pN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=bo.parse(e[i]);t.push(r)}return t}}class mN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new ph,u=new yn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(d){u.load(e[d],function(p){const g=s.parse(p,!0);o[d]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},c+=1,c===6&&(g.mipmapCount===1&&(l.minFilter=gt),l.image=o,l.format=g.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)f(d);else u.load(e,function(d){const p=s.parse(d,!0);if(p.isCubemap){const g=p.mipmaps.length/p.mipmapCount;for(let m=0;m<g;m++){o[m]={mipmaps:[]};for(let h=0;h<p.mipmapCount;h++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+h]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=gt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class Pa extends Xt{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Qr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),Qr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class lb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Js,o=new Pa(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class cb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new jr,l=new yn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:Ut,o.wrapT=c.wrapT!==void 0?c.wrapT:Ut,o.magFilter=c.magFilter!==void 0?c.magFilter:gt,o.minFilter=c.minFilter!==void 0?c.minFilter:gt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=Si),c.mipmapCount===1&&(o.minFilter=gt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Vh extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Mt,o=new Pa(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Ti:fn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class ub extends vn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Ea(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}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;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!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;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new _h[r.type]().fromJSON(r))}return this}}class Ia extends ub{constructor(e){super(),this.type="Path",this.currentPoint=new Ae,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Ea(this.currentPoint.clone(),new Ae(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new Sc(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new Ac(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r),new Ae(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new _c(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new Sa(e,t,i,r,s,o,l,u);if(this.curves.length>0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),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 gr extends Ia{constructor(e){super(e),this.uuid=pn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Ia().fromJSON(r))}return this}}class kn extends Xe{constructor(e,t=1){super(),this.type="Light",this.color=new Ce(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}kn.prototype.isLight=!0;class zh extends kn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.groundColor=new Ce(t)}copy(e){return kn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}zh.prototype.isHemisphereLight=!0;const db=new Oe,hb=new ee,fb=new ee;class Uh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Ae(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ua,this._frameExtents=new Ae(1,1),this._viewportCount=1,this._viewports=[new it(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;hb.setFromMatrixPosition(e.matrixWorld),t.position.copy(hb),fb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(fb),t.updateMatrixWorld(),db.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(db),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class pb extends Uh{constructor(){super(new kt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=ia*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}pb.prototype.isSpotLightShadow=!0;class Fc extends kn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new pb}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Fc.prototype.isSpotLight=!0;const mb=new Oe,Oa=new ee,Gh=new ee;class gb extends Uh{constructor(){super(new kt(90,1,.5,500)),this._frameExtents=new Ae(4,2),this._viewportCount=6,this._viewports=[new it(2,1,1,1),new it(0,1,1,1),new it(3,1,1,1),new it(1,1,1,1),new it(3,0,1,1),new it(1,0,1,1)],this._cubeDirections=[new ee(1,0,0),new ee(-1,0,0),new ee(0,0,1),new ee(0,0,-1),new ee(0,1,0),new ee(0,-1,0)],this._cubeUps=[new ee(0,1,0),new ee(0,1,0),new ee(0,1,0),new ee(0,1,0),new ee(0,0,1),new ee(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Oa.setFromMatrixPosition(e.matrixWorld),i.position.copy(Oa),Gh.copy(i.position),Gh.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Gh),i.updateMatrixWorld(),r.makeTranslation(-Oa.x,-Oa.y,-Oa.z),mb.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mb)}}gb.prototype.isPointLightShadow=!0;class Pc extends kn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new gb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Pc.prototype.isPointLight=!0;class xo extends ca{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){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.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}xo.prototype.isOrthographicCamera=!0;class vb extends Uh{constructor(){super(new xo(-5,5,5,-5,.5,500))}}vb.prototype.isDirectionalLightShadow=!0;class Ic extends kn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.shadow=new vb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Ic.prototype.isDirectionalLight=!0;class Hh extends kn{constructor(e,t){super(e,t),this.type="AmbientLight"}}Hh.prototype.isAmbientLight=!0;class Wh extends kn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Wh.prototype.isRectAreaLight=!0;class jh{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new ee)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}jh.prototype.isSphericalHarmonics3=!0;class Na extends kn{constructor(e=new jh,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Na.prototype.isLightProbe=!0;class yb extends Xt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new dN[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Ce().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0: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 Ce().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new ee().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Oe().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.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),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 Ae().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.envMap!==void 0&&(r.envMap=i(e.envMap)),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 Ae().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Bi{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class $h extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}$h.prototype.isInstancedBufferGeometry=!0;class Zh extends Ze{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Zh.prototype.isInstancedBufferAttribute=!0;class bb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(g,m){if(t[m]!==void 0)return t[m];const b=g.interleavedBuffers[m],y=s(g,b.buffer),v=Ws(b.type,y),M=new hr(v,b.stride);return M.uuid=b.uuid,t[m]=M,M}function s(g,m){if(i[m]!==void 0)return i[m];const b=g.arrayBuffers[m],y=new Uint32Array(b).buffer;return i[m]=y,y}const o=e.isInstancedBufferGeometry?new $h:new ke,l=e.data.index;if(l!==void 0){const g=Ws(l.type,l.array);o.setIndex(new Ze(g,1))}const u=e.data.attributes;for(const g in u){const m=u[g];let h;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);h=new Ni(b,m.itemSize,m.offset,m.normalized)}else{const b=Ws(m.type,m.array),y=m.isInstancedBufferAttribute?Zh:Ze;h=new y(b,m.itemSize,m.normalized)}m.name!==void 0&&(h.name=m.name),m.usage!==void 0&&h.setUsage(m.usage),m.updateRange!==void 0&&(h.updateRange.offset=m.updateRange.offset,h.updateRange.count=m.updateRange.count),o.setAttribute(g,h)}const c=e.data.morphAttributes;if(c)for(const g in c){const m=c[g],h=[];for(let b=0,y=m.length;b<y;b++){const v=m[b];let M;if(v.isInterleavedBufferAttribute){const A=r(e.data,v.data);M=new Ni(A,v.itemSize,v.offset,v.normalized)}else{const A=Ws(v.type,v.array);M=new Ze(A,v.itemSize,v.normalized)}v.name!==void 0&&(M.name=v.name),h.push(M)}o.morphAttributes[g]=h}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const d=e.data.groups||e.data.drawcalls||e.data.offsets;if(d!==void 0)for(let g=0,m=d.length;g!==m;++g){const h=d[g];o.addGroup(h.start,h.count,h.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const g=new ee;p.center!==void 0&&g.fromArray(p.center),o.boundingSphere=new Ci(g,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class gN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new yn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(d){r!==void 0&&r(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new yn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let d=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){d=!0;break}d===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new gr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new Ma().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new bb;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in ib?l=ib[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new yb;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const d=u.materials[f];i[d.uuid]===void 0&&(i[d.uuid]=s.parse(d)),c.push(i[d.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=bo.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:Ws(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new kh(t);s=new Pa(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const d=e[c],p=d.url;if(Array.isArray(p)){r[d.uuid]=[];for(let g=0,m=p.length;g<m;g++){const h=p[g],b=l(h);b!==null&&(b instanceof HTMLImageElement?r[d.uuid].push(b):r[d.uuid].push(new jr(b.data,b.width,b.height)))}}else{const g=l(d.url);g!==null&&(r[d.uuid]=g)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:Ws(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Pa(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,d=c.length;f<d;f++){const p=c[f],g=await s(p);g!==null&&(g instanceof HTMLImageElement?i[u.uuid].push(g):i[u.uuid].push(new jr(g.data,g.width,g.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new Js(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new jr(c.data,c.width,c.height):u=new Mt(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,vN)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],xb),u.wrapT=i(l.wrap[1],xb)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,wb)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,wb)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const g=[];for(let m=0,h=p.length;m<h;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),g.push(i[b])}return g}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,d;switch(e.type){case"Scene":o=new cc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Ce(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new pa(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new fa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new kt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new xo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Hh(e.color,e.intensity);break;case"DirectionalLight":o=new Ic(e.color,e.intensity);break;case"PointLight":o=new Pc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Wh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Fc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new zh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Na().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),d=u(e.material),o=new xa(f,d),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),d=u(e.material),o=new St(f,d);break;case"InstancedMesh":f=l(e.geometry),d=u(e.material);const p=e.count,g=e.instanceMatrix,m=e.instanceColor;o=new dh(f,d,p),o.instanceMatrix=new Ze(new Float32Array(g.array),16),m!==void 0&&(o.instanceColor=new Ze(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new Fy;break;case"Line":o=new Qn(l(e.geometry),u(e.material));break;case"LineLoop":o=new gc(l(e.geometry),u(e.material));break;case"LineSegments":o=new rn(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new io(l(e.geometry),u(e.material));break;case"Sprite":o=new ba(u(e.material));break;case"Group":o=new qn;break;case"Bone":o=new wa;break;default:o=new Xe}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.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(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 p=e.children;for(let g=0;g<p.length;g++)o.add(this.parseObject(p[g],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let g=0;g<p.length;g++){const m=p[g];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let g=0;g<p.length;g++){const m=p[g],h=o.getObjectByProperty("uuid",m.object);h!==void 0&&o.addLevel(h,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const vN={UVMapping:Rl,CubeReflectionMapping:Yo,CubeRefractionMapping:Jo,EquirectangularReflectionMapping:Fl,EquirectangularRefractionMapping:Pl,CubeUVReflectionMapping:Ls,CubeUVRefractionMapping:Ko},xb={RepeatWrapping:er,ClampToEdgeWrapping:Ut,MirroredRepeatWrapping:Rs},wb={NearestFilter:wt,NearestMipmapNearestFilter:qo,NearestMipmapLinearFilter:Qo,LinearFilter:gt,LinearMipmapNearestFilter:Il,LinearMipmapLinearFilter:Si};class Xh extends Xt{constructor(e){super(e),typeof createImageBitmap>"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=Qr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Qr.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}Xh.prototype.isImageBitmapLoader=!0;class Mb{constructor(){this.type="ShapePath",this.color=new Ce,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ia,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,t){function i(v){const M=[];for(let A=0,_=v.length;A<_;A++){const w=v[A],C=new gr;C.curves=w.curves,M.push(C)}return M}function r(v,M){const A=M.length;let _=!1;for(let w=A-1,C=0;C<A;w=C++){let P=M[w],R=M[C],I=R.x-P.x,S=R.y-P.y;if(Math.abs(S)>Number.EPSILON){if(S<0&&(P=M[C],I=-I,R=M[w],S=-S),v.y<P.y||v.y>R.y)continue;if(v.y===P.y){if(v.x===P.x)return!0}else{const T=S*(v.x-P.x)-I*(v.y-P.y);if(T===0)return!0;if(T<0)continue;_=!_}}else{if(v.y!==P.y)continue;if(R.x<=v.x&&v.x<=P.x||P.x<=v.x&&v.x<=R.x)return!0}}return _}const s=ti.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new gr,c.curves=u.curves,f.push(c),f;let d=!s(o[0].getPoints());d=e?!d:d;const p=[],g=[];let m=[],h=0,b;g[h]=void 0,m[h]=[];for(let v=0,M=o.length;v<M;v++)u=o[v],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!d&&g[h]&&h++,g[h]={s:new gr,p:b},g[h].s.curves=u.curves,d&&h++,m[h]=[]):m[h].push({h:u,p:b[0]});if(!g[0])return i(o);if(g.length>1){let v=!1;const M=[];for(let A=0,_=g.length;A<_;A++)p[A]=[];for(let A=0,_=g.length;A<_;A++){const w=m[A];for(let C=0;C<w.length;C++){const P=w[C];let R=!0;for(let I=0;I<g.length;I++)r(P.p,g[I].p)&&(A!==I&&M.push({froms:A,tos:I,hole:C}),R?(R=!1,p[I].push(P)):v=!0);R&&p[A].push(P)}}M.length>0&&(v||(m=p))}let y;for(let v=0,M=g.length;v<M;v++){c=g[v].s,f.push(c),y=m[v];for(let A=0,_=y.length;A<_;A++)c.holes.push(y[A].h)}return f}}class Yh{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=yN(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function yN(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
2916
2916
  `)l=0,u-=s;else{const d=bN(f,r,l,u,t);l+=d.offsetX,o.push(d.path)}}return o}function bN(n,e,t,i,r){const s=r.glyphs[n]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+n+'" does not exists in font family '+r.familyName+".");return}const o=new Mb;let l,u,c,f,d,p,g,m;if(s.o){const h=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let b=0,y=h.length;b<y;)switch(h[b++]){case"m":l=h[b++]*e+t,u=h[b++]*e+i,o.moveTo(l,u);break;case"l":l=h[b++]*e+t,u=h[b++]*e+i,o.lineTo(l,u);break;case"q":c=h[b++]*e+t,f=h[b++]*e+i,d=h[b++]*e+t,p=h[b++]*e+i,o.quadraticCurveTo(d,p,c,f);break;case"b":c=h[b++]*e+t,f=h[b++]*e+i,d=h[b++]*e+t,p=h[b++]*e+i,g=h[b++]*e+t,m=h[b++]*e+i,o.bezierCurveTo(d,p,g,m,c,f);break}}return{offsetX:s.ha*e,path:o}}Yh.prototype.isFont=!0;class xN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let u;try{u=JSON.parse(l)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),u=JSON.parse(l.substring(65,l.length-2))}const c=s.parse(u);t&&t(c)},i,r)}parse(e){return new Yh(e)}}let Oc;const Jh={getContext:function(){return Oc===void 0&&(Oc=new(window.AudioContext||window.webkitAudioContext)),Oc},setContext:function(n){Oc=n}};class Ab extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);Jh.getContext().decodeAudioData(u,function(f){t(f)})}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}}class Sb extends Na{constructor(e,t,i=1){super(void 0,i);const r=new Ce().set(e),s=new Ce().set(t),o=new ee(r.r,r.g,r.b),l=new ee(s.r,s.g,s.b),u=Math.sqrt(Math.PI),c=u*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(l).multiplyScalar(u),this.sh.coefficients[1].copy(o).sub(l).multiplyScalar(c)}}Sb.prototype.isHemisphereLightProbe=!0;class _b extends Na{constructor(e,t=1){super(void 0,t);const i=new Ce().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}_b.prototype.isAmbientLightProbe=!0;const Tb=new Oe,Eb=new Oe;class wN{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new kt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new kt,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;const r=e.projectionMatrix.clone(),s=t.eyeSep/2,o=s*t.near/t.focus,l=t.near*Math.tan(Vr*t.fov*.5)/t.zoom;let u,c;Eb.elements[12]=-s,Tb.elements[12]=s,u=-l*t.aspect+o,c=l*t.aspect+o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraL.projectionMatrix.copy(r),u=-l*t.aspect-o,c=l*t.aspect-o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Eb),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Tb)}}class Cb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Lb(),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=Lb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Lb(){return(typeof performance>"u"?Date:performance).now()}const es=new ee,Rb=new Zt,MN=new ee,ts=new ee;class AN extends Xe{constructor(){super(),this.type="AudioListener",this.context=Jh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Cb}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(es,Rb,MN),ts.set(0,0,-1).applyQuaternion(Rb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(es.x,r),t.positionY.linearRampToValueAtTime(es.y,r),t.positionZ.linearRampToValueAtTime(es.z,r),t.forwardX.linearRampToValueAtTime(ts.x,r),t.forwardY.linearRampToValueAtTime(ts.y,r),t.forwardZ.linearRampToValueAtTime(ts.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(es.x,es.y,es.z),t.setOrientation(ts.x,ts.y,ts.z,i.x,i.y,i.z)}}class Kh extends Xe{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(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),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;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const ns=new ee,Fb=new Zt,SN=new ee,is=new ee;class _N extends Kh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(ns,Fb,SN),is.set(0,0,1).applyQuaternion(Fb);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(ns.x,i),t.positionY.linearRampToValueAtTime(ns.y,i),t.positionZ.linearRampToValueAtTime(ns.z,i),t.orientationX.linearRampToValueAtTime(is.x,i),t.orientationY.linearRampToValueAtTime(is.y,i),t.orientationZ.linearRampToValueAtTime(is.z,i)}else t.setPosition(ns.x,ns.y,ns.z),t.setOrientation(is.x,is.y,is.z)}}class Pb{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class Ib{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let l=0;l!==r;++l)i[s+l]=i[l];o=t}else{o+=t;const l=t/o;this._mixBufferRegion(i,s,0,l,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,l=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,c=t+t;u!==c;++u)if(i[u]!==i[u+t]){l.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<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Zt.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Zt.multiplyQuaternionsFlat(e,o,e,t,e,i),Zt.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let l=0;l!==s;++l){const u=t+l;e[u]=e[u]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[i+o]*r}}}const qh="\\[\\]\\.:\\/",TN=new RegExp("["+qh+"]","g"),Qh="[^"+qh+"]",EN="[^"+qh.replace("\\.","")+"]",CN=/((?:WC+[\/:])*)/.source.replace("WC",Qh),LN=/(WCOD+)?/.source.replace("WCOD",EN),RN=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Qh),FN=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Qh),PN=new RegExp("^"+CN+LN+RN+FN+"$"),IN=["material","materials","bones"];class ON{constructor(e,t,i){const r=i||Qe.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 Qe{constructor(e,t,i){this.path=t,this.parsedPath=i||Qe.parseTrackName(t),this.node=Qe.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Qe.Composite(e,t,i):new Qe(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(TN,"")}static parseTrackName(e){const t=PN.exec(e);if(!t)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);IN.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||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.length;o++){const l=s[o];if(l.name===t||l.uuid===t)return l;const u=i(l.children);if(u)return u}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=Qe.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(i){let c=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let f=0;f<e.length;f++)if(e[f].name===c){c=f;break}break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(u=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Qe.Composite=ON,Qe.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Qe.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Qe.prototype.GetterByBindingType=[Qe.prototype._getValue_direct,Qe.prototype._getValue_array,Qe.prototype._getValue_arrayElement,Qe.prototype._getValue_toArray],Qe.prototype.SetterByBindingTypeAndVersioning=[[Qe.prototype._setValue_direct,Qe.prototype._setValue_direct_setNeedsUpdate,Qe.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Qe.prototype._setValue_array,Qe.prototype._setValue_array_setNeedsUpdate,Qe.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Qe.prototype._setValue_arrayElement,Qe.prototype._setValue_arrayElement_setNeedsUpdate,Qe.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Qe.prototype._setValue_fromArray,Qe.prototype._setValue_fromArray_setNeedsUpdate,Qe.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Ob{constructor(){this.uuid=pn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let l,u=e.length,c=this.nCachedObjects_;for(let f=0,d=arguments.length;f!==d;++f){const p=arguments[f],g=p.uuid;let m=t[g];if(m===void 0){m=u++,t[g]=m,e.push(p);for(let h=0,b=o;h!==b;++h)s[h].push(new Qe(p,i[h],r[h]))}else if(m<c){l=e[m];const h=--c,b=e[h];t[b.uuid]=m,e[m]=b,t[g]=h,e[h]=p;for(let y=0,v=o;y!==v;++y){const M=s[y],A=M[h];let _=M[m];M[m]=A,_===void 0&&(_=new Qe(p,i[y],r[y])),M[h]=_}}else e[m]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],c=u.uuid,f=t[c];if(f!==void 0&&f>=s){const d=s++,p=e[d];t[p.uuid]=f,e[f]=p,t[c]=d,e[d]=u;for(let g=0,m=r;g!==m;++g){const h=i[g],b=h[d],y=h[f];h[f]=b,h[d]=y}}}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 l=0,u=arguments.length;l!==u;++l){const c=arguments[l],f=c.uuid,d=t[f];if(d!==void 0)if(delete t[f],d<s){const p=--s,g=e[p],m=--o,h=e[m];t[g.uuid]=d,e[d]=g,t[h.uuid]=p,e[p]=h,e.pop();for(let b=0,y=r;b!==y;++b){const v=i[b],M=v[p],A=v[m];v[d]=M,v[p]=A,v.pop()}}else{const p=--o,g=e[p];p>0&&(t[g.uuid]=d),e[d]=g,e.pop();for(let m=0,h=r;m!==h;++m){const b=i[m];b[d]=b[p],b.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,l=this._parsedPaths,u=this._objects,c=u.length,f=this.nCachedObjects_,d=new Array(c);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(d);for(let p=f,g=u.length;p!==g;++p){const m=u[p];d[p]=new Qe(m,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,u=o[l],c=e[l];t[c]=i,o[i]=u,o.pop(),s[i]=s[l],s.pop(),r[i]=r[l],r.pop()}}}Ob.prototype.isAnimationObjectGroup=!0;class NN{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,l=new Array(o),u={endingStart:Br,endingEnd:Br};for(let c=0;c!==o;++c){const f=s[c].createInterpolant(null);l[c]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=M0,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,l=r/s;e.warp(1,o,t),this.warp(l,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 l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const u=l.parameterPositions,c=l.sampleValues;return u[0]=s,u[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 u=(e-s)*i;if(u<0||i===0)return;this._startTime=null,t=i*u}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Sd:for(let f=0,d=u.length;f!==d;++f)u[f].evaluate(o),c[f].accumulateAdditive(l);break;case Nl:default:for(let f=0,d=u.length;f!==d;++f)u[f].evaluate(o),c[f].accumulate(r,l)}}}_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===A0;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===w0){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 l=Math.floor(r/t);r-=t*l,s+=Math.abs(l);const u=this.repetitions-s;if(u<=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(u===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:l})}}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=Dr,r.endingEnd=Dr):(e?r.endingStart=this.zeroSlopeAtStart?Dr:Br:r.endingStart=na,t?r.endingEnd=this.zeroSlopeAtEnd?Dr:Br:r.endingEnd=na)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,u[0]=t,l[1]=s+e,u[1]=i,this}}class Nb extends nr{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,l=e._interpolants,u=i.uuid,c=this._bindingsByRootAndName;let f=c[u];f===void 0&&(f={},c[u]=f);for(let d=0;d!==s;++d){const p=r[d],g=p.name;let m=f[g];if(m!==void 0)o[d]=m;else{if(m=o[d],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,u,g));continue}const h=t&&t._propertyBindings[d].binding.parsedPath;m=new Ib(Qe.create(i,g,h),p.ValueTypeName,p.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,u,g),o[d]=m}l[d].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<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const l=o.knownActions;e._byClipCacheIndex=l.length,l.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,l=o[s],u=l.knownActions,c=u[u.length-1],f=e._byClipCacheIndex;c._byClipCacheIndex=f,u[f]=c,u.pop(),e._byClipCacheIndex=null;const d=l.actionByRoot,p=(e._localRoot||this._root).uuid;delete d[p],u.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,l=o[r],u=t[t.length-1],c=e._cacheIndex;u._cacheIndex=c,t[c]=u,t.pop(),delete l[s],Object.keys(l).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new Bh(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?bo.findByName(r,e):e;const l=o!==null?o.uuid:e,u=this._actionsByClip[l];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Nl),u!==void 0){const d=u.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;c=u.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const f=new NN(this,o,t,i);return this._bindAction(f,c),this._addInactiveAction(f,l,s),f}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?bo.findByName(i,e):e,o=s?s.uuid:e,l=this._actionsByClip[o];return l!==void 0&&l.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=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 l=this._bindings,u=this._nActiveBindings;for(let c=0;c!==u;++c)l[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let l=0,u=o.length;l!==u;++l){const c=o[l];this._deactivateAction(c);const f=c._cacheIndex,d=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,d._cacheIndex=f,t[f]=d,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const l=i[o].actionByRoot,u=l[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const l=s[o];l.restoreOriginalState(),this._removeInactiveBinding(l)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}Nb.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Nc{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Nc(this.value.clone===void 0?this.value:this.value.clone())}}class Bb extends hr{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}Bb.prototype.isInstancedInterleavedBuffer=!0;class Db{constructor(e,t,i,r,s){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}Db.prototype.isGLBufferAttribute=!0;class BN{constructor(e,t,i=0,r=1/0){this.ray=new or(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Hd,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,i=[]){return ef(e,this,i,t),i.sort(kb),i}intersectObjects(e,t=!1,i=[]){for(let r=0,s=e.length;r<s;r++)ef(e[r],this,i,t);return i.sort(kb),i}}function kb(n,e){return n.distance-e.distance}function ef(n,e,t,i){if(n.layers.test(e.layers)&&n.raycast(e,t),i===!0){const r=n.children;for(let s=0,o=r.length;s<o;s++)ef(r[s],e,t,!0)}}class DN{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos($t(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class kN{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const Vb=new Ae;class wo{constructor(e=new Ae(1/0,1/0),t=new Ae(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Vb.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<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 Vb.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),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)}}wo.prototype.isBox2=!0;const zb=new ee,Bc=new ee;class Ub{constructor(e=new ee,t=new ee){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){zb.subVectors(e,this.start),Bc.subVectors(this.end,this.start);const i=Bc.dot(Bc);let s=Bc.dot(zb)/i;return t&&(s=$t(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)}}class Gb extends Xe{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}Gb.prototype.isImmediateRenderObject=!0;const Hb=new ee;class VN extends Xe{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const i=new ke,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,l=1,u=32;o<u;o++,l++){const c=o/u*Math.PI*2,f=l/u*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(f),Math.sin(f),1)}i.setAttribute("position",new Pe(r,3));const s=new Vt({fog:!1,toneMapped:!1});this.cone=new rn(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Hb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Hb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const vr=new ee,Dc=new Oe,tf=new Oe;class Wb extends rn{constructor(e){const t=jb(e),i=new ke,r=[],s=[],o=new Ce(0,0,1),l=new Ce(0,1,0);for(let c=0;c<t.length;c++){const f=t[c];f.parent&&f.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(l.r,l.g,l.b))}i.setAttribute("position",new Pe(r,3)),i.setAttribute("color",new Pe(s,3));const u=new Vt({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,u),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");tf.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const l=t[s];l.parent&&l.parent.isBone&&(Dc.multiplyMatrices(tf,l.matrixWorld),vr.setFromMatrixPosition(Dc),r.setXYZ(o,vr.x,vr.y,vr.z),Dc.multiplyMatrices(tf,l.parent.matrixWorld),vr.setFromMatrixPosition(Dc),r.setXYZ(o+1,vr.x,vr.y,vr.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function jb(n){const e=[];n&&n.isBone&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,jb(n.children[t]));return e}class zN extends St{constructor(e,t,i){const r=new Xr(t,4,2),s=new cn({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const UN=new ee,$b=new Ce,Zb=new Ce;class GN extends Xe{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const r=new $r(t);r.rotateY(Math.PI*.5),this.material=new cn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Ze(o,3)),this.add(new St(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");$b.copy(this.light.color),Zb.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?$b:Zb;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}e.lookAt(UN.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Xb extends rn{constructor(e=10,t=10,i=4473924,r=8947848){i=new Ce(i),r=new Ce(r);const s=t/2,o=e/t,l=e/2,u=[],c=[];for(let p=0,g=0,m=-l;p<=t;p++,m+=o){u.push(-l,0,m,l,0,m),u.push(m,0,-l,m,0,l);const h=p===s?i:r;h.toArray(c,g),g+=3,h.toArray(c,g),g+=3,h.toArray(c,g),g+=3,h.toArray(c,g),g+=3}const f=new ke;f.setAttribute("position",new Pe(u,3)),f.setAttribute("color",new Pe(c,3));const d=new Vt({vertexColors:!0,toneMapped:!1});super(f,d),this.type="GridHelper"}}class HN extends rn{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Ce(s),o=new Ce(o);const l=[],u=[];for(let d=0;d<=t;d++){const p=d/t*(Math.PI*2),g=Math.sin(p)*e,m=Math.cos(p)*e;l.push(0,0,0),l.push(g,0,m);const h=d&1?s:o;u.push(h.r,h.g,h.b),u.push(h.r,h.g,h.b)}for(let d=0;d<=i;d++){const p=d&1?s:o,g=e-e/i*d;for(let m=0;m<r;m++){let h=m/r*(Math.PI*2),b=Math.sin(h)*g,y=Math.cos(h)*g;l.push(b,0,y),u.push(p.r,p.g,p.b),h=(m+1)/r*(Math.PI*2),b=Math.sin(h)*g,y=Math.cos(h)*g,l.push(b,0,y),u.push(p.r,p.g,p.b)}}const c=new ke;c.setAttribute("position",new Pe(l,3)),c.setAttribute("color",new Pe(u,3));const f=new Vt({vertexColors:!0,toneMapped:!1});super(c,f),this.type="PolarGridHelper"}}const Yb=new ee,kc=new ee,Jb=new ee;class WN extends Xe{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,t===void 0&&(t=1);let r=new ke;r.setAttribute("position",new Pe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Vt({fog:!1,toneMapped:!1});this.lightPlane=new Qn(r,s),this.add(this.lightPlane),r=new ke,r.setAttribute("position",new Pe([0,0,0,0,0,1],3)),this.targetLine=new Qn(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Yb.setFromMatrixPosition(this.light.matrixWorld),kc.setFromMatrixPosition(this.light.target.matrixWorld),Jb.subVectors(kc,Yb),this.lightPlane.lookAt(kc),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(kc),this.targetLine.scale.z=Jb.length()}}const Vc=new ee,vt=new ca;class jN extends rn{constructor(e){const t=new ke,i=new Vt({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={},l=new Ce(16755200),u=new Ce(16711680),c=new Ce(43775),f=new Ce(16777215),d=new Ce(3355443);p("n1","n2",l),p("n2","n4",l),p("n4","n3",l),p("n3","n1",l),p("f1","f2",l),p("f2","f4",l),p("f4","f3",l),p("f3","f1",l),p("n1","f1",l),p("n2","f2",l),p("n3","f3",l),p("n4","f4",l),p("p","n1",u),p("p","n2",u),p("p","n3",u),p("p","n4",u),p("u1","u2",c),p("u2","u3",c),p("u3","u1",c),p("c","t",f),p("p","c",d),p("cn1","cn2",d),p("cn3","cn4",d),p("cf1","cf2",d),p("cf3","cf4",d);function p(m,h,b){g(m,b),g(h,b)}function g(m,h){r.push(0,0,0),s.push(h.r,h.g,h.b),o[m]===void 0&&(o[m]=[]),o[m].push(r.length/3-1)}t.setAttribute("position",new Pe(r,3)),t.setAttribute("color",new Pe(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;vt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Tt("c",t,e,vt,0,0,-1),Tt("t",t,e,vt,0,0,1),Tt("n1",t,e,vt,-i,-r,-1),Tt("n2",t,e,vt,i,-r,-1),Tt("n3",t,e,vt,-i,r,-1),Tt("n4",t,e,vt,i,r,-1),Tt("f1",t,e,vt,-i,-r,1),Tt("f2",t,e,vt,i,-r,1),Tt("f3",t,e,vt,-i,r,1),Tt("f4",t,e,vt,i,r,1),Tt("u1",t,e,vt,i*.7,r*1.1,-1),Tt("u2",t,e,vt,-i*.7,r*1.1,-1),Tt("u3",t,e,vt,0,r*2,-1),Tt("cf1",t,e,vt,-i,0,1),Tt("cf2",t,e,vt,i,0,1),Tt("cf3",t,e,vt,0,-r,1),Tt("cf4",t,e,vt,0,r,1),Tt("cn1",t,e,vt,-i,0,-1),Tt("cn2",t,e,vt,i,0,-1),Tt("cn3",t,e,vt,0,-r,-1),Tt("cn4",t,e,vt,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Tt(n,e,t,i,r,s,o){Vc.set(r,s,o).unproject(i);const l=e[n];if(l!==void 0){const u=t.getAttribute("position");for(let c=0,f=l.length;c<f;c++)u.setXYZ(l[c],Vc.x,Vc.y,Vc.z)}}const zc=new ln;class Kb extends rn{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new ke;s.setIndex(new Ze(i,1)),s.setAttribute("position",new Ze(r,3)),super(s,new Vt({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&zc.setFromObject(this.object),zc.isEmpty())return;const t=zc.min,i=zc.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return rn.prototype.copy.call(this,e),this.object=e.object,this}}class $N extends rn{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ke;s.setIndex(new Ze(i,1)),s.setAttribute("position",new Pe(r,3)),super(s,new Vt({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class ZN extends Qn{constructor(e,t=1,i=16776960){const r=i,s=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ke;o.setAttribute("position",new Pe(s,3)),o.computeBoundingSphere(),super(o,new Vt({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const l=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],u=new ke;u.setAttribute("position",new Pe(l,3)),u.computeBoundingSphere(),this.add(new St(u,new cn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?xt:Ki,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const qb=new ee;let Uc,nf;class XN extends Xe{constructor(e=new ee(0,0,1),t=new ee(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Uc===void 0&&(Uc=new ke,Uc.setAttribute("position",new Pe([0,0,0,0,1,0],3)),nf=new pr(0,.5,1,5,1),nf.translate(0,-.5,0)),this.position.copy(t),this.line=new Qn(Uc,new Vt({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new St(nf,new cn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{qb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(qb,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}}class Qb extends rn{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 ke;r.setAttribute("position",new Pe(t,3)),r.setAttribute("color",new Pe(i,3));const s=new Vt({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Ce,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()}}const ex=new Float32Array(1),YN=new Int32Array(ex.buffer);class JN{static toHalfFloat(e){ex[0]=e;const t=YN[0];let i=t>>16&32768,r=t>>12&2047;const s=t>>23&255;return s<103?i:s>142?(i|=31744,i|=(s==255?0:1)&&t&8388607,i):s<113?(r|=2048,i|=(r>>114-s)+(r>>113-s&1),i):(i|=s-112<<10|r>>1,i+=r&1,i)}}const Mo=4,yr=8,ii=Math.pow(2,yr),tx=[.125,.215,.35,.446,.526,.582],nx=yr-Mo+1+tx.length,Ao=20,ri={[tn]:0,[kr]:1,[Dl]:2,[Td]:3,[Ed]:4,[Cd]:5,[Bl]:6},rs=new cn({side:xt,depthWrite:!1,depthTest:!1}),KN=new St(new Ii,rs),rf=new xo,{_lodPlanes:Ba,_sizeLods:ix,_sigmas:Gc}=eB(),rx=new Ce;let sf=null;const ss=(1+Math.sqrt(5))/2,So=1/ss,sx=[new ee(1,1,1),new ee(-1,1,1),new ee(1,1,-1),new ee(-1,1,-1),new ee(0,ss,So),new ee(0,ss,-So),new ee(So,0,ss),new ee(-So,0,ss),new ee(ss,So,0),new ee(-ss,So,0)];function ox(n){const e=Math.max(n.r,n.g,n.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return n.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class qN{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=tB(Ao),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){sf=this._renderer.getRenderTarget();const s=this._allocateTargets();return this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=cx(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=lx(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Ba.length;e++)Ba[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(sf),e.scissorTest=!1,Hc(e,0,0,e.width,e.height)}_fromTexture(e){sf=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:wt,minFilter:wt,generateMipmaps:!1,type:Pr,format:kv,encoding:QN(e)?e.encoding:Dl,depthBuffer:!1},i=ax(t);return i.depthBuffer=!e,this._pingPongRenderTarget=ax(t),i}_compileMaterial(e){const t=new St(Ba[0],e);this._renderer.compile(t,rf)}_sceneToCubeUV(e,t,i,r){const l=new kt(90,1,t,i),u=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],f=this._renderer,d=f.autoClear,p=f.outputEncoding,g=f.toneMapping;f.getClearColor(rx),f.toneMapping=Qi,f.outputEncoding=tn,f.autoClear=!1;let m=!1;const h=e.background;if(h){if(h.isColor){rs.color.copy(h).convertSRGBToLinear(),e.background=null;const b=ox(rs.color);rs.opacity=b,m=!0}}else{rs.color.copy(rx).convertSRGBToLinear();const b=ox(rs.color);rs.opacity=b,m=!0}for(let b=0;b<6;b++){const y=b%3;y==0?(l.up.set(0,u[b],0),l.lookAt(c[b],0,0)):y==1?(l.up.set(0,0,u[b]),l.lookAt(0,c[b],0)):(l.up.set(0,u[b],0),l.lookAt(0,0,c[b])),Hc(r,y*ii,b>2?ii:0,ii,ii),f.setRenderTarget(r),m&&f.render(KN,l),f.render(e,l)}f.toneMapping=g,f.outputEncoding=p,f.autoClear=d}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=cx()):this._equirectShader==null&&(this._equirectShader=lx());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new St(Ba[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=ri[e.encoding],o.outputEncoding.value=ri[t.texture.encoding],Hc(t,0,0,3*ii,2*ii),i.setRenderTarget(t),i.render(s,rf)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<nx;r++){const s=Math.sqrt(Gc[r]*Gc[r]-Gc[r-1]*Gc[r-1]),o=sx[(r-1)%sx.length];this._blur(e,r-1,r,s,o)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,l){const u=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const f=3,d=new St(Ba[r],c),p=c.uniforms,g=ix[i]-1,m=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*Ao-1),h=s/m,b=isFinite(s)?1+Math.floor(f*h):Ao;b>Ao&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Ao}`);const y=[];let v=0;for(let w=0;w<Ao;++w){const C=w/h,P=Math.exp(-C*C/2);y.push(P),w==0?v+=P:w<b&&(v+=2*P)}for(let w=0;w<y.length;w++)y[w]=y[w]/v;p.envMap.value=e.texture,p.samples.value=b,p.weights.value=y,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l),p.dTheta.value=m,p.mipInt.value=yr-i,p.inputEncoding.value=ri[e.texture.encoding],p.outputEncoding.value=ri[e.texture.encoding];const M=ix[r],A=3*Math.max(0,ii-2*M),_=(r===0?0:2*ii)+2*M*(r>yr-Mo?r-yr+Mo:0);Hc(t,A,_,3*M,2*M),u.setRenderTarget(t),u.render(d,rf)}}function QN(n){return n===void 0||n.type!==Pr?!1:n.encoding===tn||n.encoding===kr||n.encoding===Bl}function eB(){const n=[],e=[],t=[];let i=yr;for(let r=0;r<nx;r++){const s=Math.pow(2,i);e.push(s);let o=1/s;r>yr-Mo?o=tx[r-yr+Mo-1]:r==0&&(o=0),t.push(o);const l=1/(s-1),u=-l/2,c=1+l/2,f=[u,u,c,u,c,c,u,u,c,c,u,c],d=6,p=6,g=3,m=2,h=1,b=new Float32Array(g*p*d),y=new Float32Array(m*p*d),v=new Float32Array(h*p*d);for(let A=0;A<d;A++){const _=A%3*2/3-1,w=A>2?0:-1,C=[_,w,0,_+2/3,w,0,_+2/3,w+1,0,_,w,0,_+2/3,w+1,0,_,w+1,0];b.set(C,g*p*A),y.set(f,m*p*A);const P=[A,A,A,A,A,A];v.set(P,h*p*A)}const M=new ke;M.setAttribute("position",new Ze(b,g)),M.setAttribute("uv",new Ze(y,m)),M.setAttribute("faceIndex",new Ze(v,h)),n.push(M),i>Mo&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function ax(n){const e=new Rn(3*ii,3*ii,n);return e.texture.mapping=Ls,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Hc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function tB(n){const e=new Float32Array(n),t=new ee(0,1,0);return new go({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:ri[tn]},outputEncoding:{value:ri[tn]}},vertexShader:of(),fragmentShader:`
2917
2917
 
2918
2918
  precision mediump float;
@@ -3179,9 +3179,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3179
3179
  `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
3180
3180
  `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
3181
3181
  `),l={specular:{value:new Ce().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class fD{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return df}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Ce(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Ce(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Ce(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new df(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=tr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class pD{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class _o extends ni{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}_o.prototype.beforeStart_=_o.prototype.copySampleValue_,_o.prototype.afterEnd_=_o.prototype.copySampleValue_,_o.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,d=f*f,p=d*f,g=n*u,m=g-u,h=-2*p+3*d,b=p-d,y=1-h,v=b-d+f;for(let M=0;M!==o;M++){const A=s[m+M+o],_=s[m+M+l]*c,w=s[g+M+o],C=s[g+M]*c;r[M]=y*A+v*_+h*w+b*C}return r};const Di={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Va={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},mx={9728:wt,9729:gt,9984:qo,9985:Il,9986:Qo,9987:Si},gx={33071:Ut,33648:Rs,10497:er},vx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hf={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},br={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},mD={CUBICSPLINE:void 0,LINEAR:Nr,STEP:Is},ff={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function yx(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function gD(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Yr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ki})),n.DefaultMaterial}function za(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function os(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function vD(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function yD(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function bD(n){const e=n.extensions&&n.extensions[nt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+bx(e.attributes):t=n.indices+":"+bx(n.attributes)+":"+n.mode,t}function bx(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function pf(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class xD{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new nD,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new Xh(this.options.manager):this.textureLoader=new Vh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new yn(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};za(s,l,r),os(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone();return r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[nt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(yx(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],u=vx[r.type],c=Va[r.componentType],f=c.BYTES_PER_ELEMENT,d=f*u,p=r.byteOffset||0,g=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let h,b;if(g&&g!==d){const y=Math.floor(p/g),v="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+y+":"+r.count;let M=t.cache.get(v);M||(h=new c(l,y*g,r.count*g/f),M=new hr(h,g/f),t.cache.add(v,M)),b=new Ni(M,u,p%g/f,m)}else l===null?h=new c(r.count*u):h=new c(l,p,r.count*u),b=new Ze(h,u,m);if(r.sparse!==void 0){const y=vx.SCALAR,v=Va[r.sparse.indices.componentType],M=r.sparse.indices.byteOffset||0,A=r.sparse.values.byteOffset||0,_=new v(o[1],M,r.sparse.count*y),w=new c(o[2],A,r.sparse.count*u);l!==null&&(b=new Ze(b.array.slice(),b.itemSize,b.normalized));for(let C=0,P=_.length;C<P;C++){const R=_[C];if(b.setX(R,w[C*u]),u>=2&&b.setY(R,w[C*u+1]),u>=3&&b.setZ(R,w[C*u+2]),u>=4&&b.setW(R,w[C*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",d=!1,p=!0;const g=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||g)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(h){if(t.mimeType==="image/png"){const y=new DataView(h,25,1).getUint8(0,!1);p=y===6||y===4||y===3}d=!0;const b=new Blob([h],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(f).then(function(h){return new Promise(function(b,y){let v=b;i.isImageBitmapLoader===!0&&(v=function(M){const A=new Mt(M);A.needsUpdate=!0,b(A)}),i.load(yx(h,o.path),v,void 0,y)})}).then(function(h){d===!0&&c.revokeObjectURL(f),h.flipY=!1,l.name&&(h.name=l.name),p||(h.format=Ti);const y=(s.samplers||{})[l.sampler]||{};return h.magFilter=mx[y.magFilter]||gt,h.minFilter=mx[y.minFilter]||Si,h.wrapS=gx[y.wrapS]||er,h.wrapT=gx[y.wrapT]||er,r.associations.set(h,{type:"textures",index:e}),h}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=m,m}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new fr,Ft.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new Vt,Ft.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Yr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const d=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=d.getMaterialType(),c.push(d.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const d=r[nt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(l,s,t))}else{const d=s.pbrMetallicRoughness||{};if(l.color=new Ce(1,1,1),l.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}d.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",d.baseColorTexture)),l.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,l.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",d.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=qi);const f=s.alphaMode||ff.OPAQUE;return f===ff.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===ff.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Ae(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==cn&&(l.emissive=new Ce().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==cn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let d;return o===df?d=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):d=new o(l),s.name&&(d.name=s.name),d.map&&(d.map.encoding=kr),d.emissiveMap&&(d.emissiveMap.encoding=kr),os(d,s),t.associations.set(d,{type:"materials",index:e}),s.extensions&&za(r,d,s),d})}createUniqueName(e){const t=Qe.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return wx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=bD(c),d=r[f];if(d)o.push(d.promise);else{let p;c.extensions&&c.extensions[nt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=wx(new ke,c,t),r[f]={primitive:c,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?gD(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],d=[];for(let g=0,m=f.length;g<m;g++){const h=f[g],b=o[g];let y;const v=c[g];if(b.mode===Di.TRIANGLES||b.mode===Di.TRIANGLE_STRIP||b.mode===Di.TRIANGLE_FAN||b.mode===void 0)y=s.isSkinnedMesh===!0?new xa(h,v):new St(h,v),y.isSkinnedMesh===!0&&!y.geometry.attributes.skinWeight.normalized&&y.normalizeSkinWeights(),b.mode===Di.TRIANGLE_STRIP?y.geometry=Mx(y.geometry,_0):b.mode===Di.TRIANGLE_FAN&&(y.geometry=Mx(y.geometry,_d));else if(b.mode===Di.LINES)y=new rn(h,v);else if(b.mode===Di.LINE_STRIP)y=new Qn(h,v);else if(b.mode===Di.LINE_LOOP)y=new gc(h,v);else if(b.mode===Di.POINTS)y=new io(h,v);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(y.geometry.morphAttributes).length>0&&yD(y,s),y.name=t.createUniqueName(s.name||"mesh_"+e),os(y,s),b.extensions&&za(r,y,b),t.assignFinalMaterial(y),d.push(y)}if(d.length===1)return d[0];const p=new qn;for(let g=0,m=d.length;g<m;g++)p.add(d[g]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new kt(Pd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new xo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),os(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const d=i.channels[c],p=i.samplers[d.sampler],g=d.target,m=g.node!==void 0?g.node:g.id,h=i.parameters!==void 0?i.parameters[p.input]:p.input,b=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",h)),o.push(this.getDependency("accessor",b)),l.push(p),u.push(g)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],d=c[1],p=c[2],g=c[3],m=c[4],h=[];for(let y=0,v=f.length;y<v;y++){const M=f[y],A=d[y],_=p[y],w=g[y],C=m[y];if(M===void 0)continue;M.updateMatrix(),M.matrixAutoUpdate=!0;let P;switch(br[C.path]){case br.weights:P=vo;break;case br.rotation:P=Kr;break;case br.position:case br.scale:default:P=yo;break}const R=M.name?M.name:M.uuid,I=w.interpolation!==void 0?mD[w.interpolation]:Nr,S=[];br[C.path]===br.weights?M.traverse(function(E){E.isMesh===!0&&E.morphTargetInfluences&&S.push(E.name?E.name:E.uuid)}):S.push(R);let T=_.array;if(_.normalized){const E=pf(T.constructor),L=new Float32Array(T.length);for(let F=0,x=T.length;F<x;F++)L[F]=T[F]*E;T=L}for(let E=0,L=S.length;E<L;E++){const F=new P(S[E]+"."+br[C.path],A.array,T,I);w.interpolation==="CUBICSPLINE"&&(F.createInterpolant=function(O){return new _o(this.times,this.values,this.getValueSize()/3,O)},F.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),h.push(F)}}const b=i.name?i.name:"animation_"+e;return new bo(b,void 0,h)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new wa:l.length>1?u=new qn:l.length===1?u=l[0]:u=new Xe,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),os(u,s),s.extensions&&za(i,u,s),s.matrix!==void 0){const c=new Oe;c.fromArray(s.matrix),u.applyMatrix4(c)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new qn;r.name&&(o.name=s.createUniqueName(r.name)),os(o,r),r.extensions&&za(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(xx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function xx(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let d=0,p=l.length;d<p;d++){const g=l[d];if(g){c.push(g);const m=new Oe;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,d*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[d])}u.bind(new Ma(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(xx(f,s,t,i))}}return Promise.all(o)})}function wD(n,e,t){const i=e.attributes,r=new ln;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new ee(u[0],u[1],u[2]),new ee(c[0],c[1],c[2])),l.normalized){const f=pf(Va[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new ee,u=new ee;for(let c=0,f=s.length;c<f;c++){const d=s[c];if(d.POSITION!==void 0){const p=t.json.accessors[d.POSITION],g=p.min,m=p.max;if(g!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(g[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(g[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(g[2]),Math.abs(m[2]))),p.normalized){const h=pf(Va[p.componentType]);u.multiplyScalar(h)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Ci;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function wx(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=hf[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return os(n,e),wD(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?vD(n,e.targets,t):n})}function Mx(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===_d)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const MD=Al(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:tD},Symbol.toStringTag,{value:"Module"})));var mf={exports:{}},Ax;function AD(){return Ax||(Ax=1,function(n){function e(c){var f={};function d(g){if(f[g])return f[g].exports;var m=f[g]={i:g,l:!1,exports:{}};return c[g].call(m.exports,m,m.exports,d),m.l=!0,m.exports}d.m=c,d.c=f,d.i=function(g){return g},d.d=function(g,m,h){d.o(g,m)||Object.defineProperty(g,m,{configurable:!1,enumerable:!0,get:h})},d.r=function(g){Object.defineProperty(g,"__esModule",{value:!0})},d.n=function(g){var m=g&&g.__esModule?function(){return g.default}:function(){return g};return d.d(m,"a",m),m},d.o=function(g,m){return Object.prototype.hasOwnProperty.call(g,m)},d.p="/",d.oe=function(g){throw console.error(g),g};var p=d(d.s=ENTRY_MODULE);return p.default||p}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,d){var p={};p[d]=[];var g=f.toString(),m=g.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var h=m[1],b=new RegExp("(\\\\n|\\W)"+r(h)+i,"g"),y;y=b.exec(g);)y[3]!=="dll-reference"&&p[d].push(y[3]);for(b=new RegExp("\\("+r(h)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");y=b.exec(g);)c[y[2]]||(p[d].push(y[1]),c[y[2]]=__webpack_require__(y[1]).m),p[y[2]]=p[y[2]]||[],p[y[2]].push(y[4]);for(var v=Object.keys(p),M=0;M<v.length;M++)for(var A=0;A<p[v[M]].length;A++)s(p[v[M]][A])&&(p[v[M]][A]=1*p[v[M]][A]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(d,p){return d||c[p].length>0},!1)}function u(c,f){for(var d={main:[f]},p={main:[]},g={main:{}};l(d);)for(var m=Object.keys(d),h=0;h<m.length;h++){var b=m[h],y=d[b],v=y.pop();if(g[b]=g[b]||{},!(g[b][v]||!c[b][v])){g[b][v]=!0,p[b]=p[b]||[],p[b].push(v);for(var M=o(c,c[b][v],b),A=Object.keys(M),_=0;_<A.length;_++)d[A[_]]=d[A[_]]||[],d[A[_]]=d[A[_]].concat(M[A[_]])}}return p}n.exports=function(c,f){f=f||{};var d={main:__webpack_modules__},p=f.all?{main:Object.keys(d.main)}:u(d,c),g="";Object.keys(p).filter(function(v){return v!=="main"}).forEach(function(v){for(var M=0;p[v][M];)M++;p[v].push(M),d[v][M]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",g=g+"var "+v+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(M))+")({"+p[v].map(function(A){return""+JSON.stringify(A)+": "+d[v][A].toString()}).join(",")+`});
3182
- `}),g=g+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(v){return""+JSON.stringify(v)+": "+d.main[v].toString()}).join(",")+"}))(self);";var m=new window.Blob([g],{type:"text/javascript"});if(f.bare)return m;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,b=h.createObjectURL(m),y=new window.Worker(b);return y.objectURL=b,y}}(mf)),mf.exports}function SD(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function _D(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(d){o(u,d)},function(d){r[u]={status:"rejected",reason:d},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function Sx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}Sx.prototype=Error.prototype;function TD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new Sx(s,"All promises were rejected"))})}catch(l){i(l)}})}var ED=setTimeout;function _x(n){return!!(n&&typeof n.length<"u")}function CD(){}function LD(n,e){return function(){n.apply(e,arguments)}}function ft(n){if(!(this instanceof ft))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ex(n,this)}function Tx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,ft._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?gf:Ua)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ua(e.promise,r);return}gf(e.promise,i)})}function gf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof ft){n._state=3,n._value=e,vf(n);return}else if(typeof t=="function"){Ex(LD(t,e),n);return}}n._state=1,n._value=e,vf(n)}catch(i){Ua(n,i)}}function Ua(n,e){n._state=2,n._value=e,vf(n)}function vf(n){n._state===2&&n._deferreds.length===0&&ft._immediateFn(function(){n._handled||ft._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Tx(n,n._deferreds[e]);n._deferreds=null}function RD(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Ex(n,e){var t=!1;try{n(function(i){t||(t=!0,gf(e,i))},function(i){t||(t=!0,Ua(e,i))})}catch(i){if(t)return;t=!0,Ua(e,i)}}ft.prototype.catch=function(n){return this.then(null,n)},ft.prototype.then=function(n,e){var t=new this.constructor(CD);return Tx(this,new RD(n,e,t)),t},ft.prototype.finally=SD,ft.all=function(n){return new ft(function(e,t){if(!_x(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},ft.any=TD,ft.allSettled=_D,ft.resolve=function(n){return n&&typeof n=="object"&&n.constructor===ft?n:new ft(function(e){e(n)})},ft.reject=function(n){return new ft(function(e,t){t(n)})},ft.race=function(n){return new ft(function(e,t){if(!_x(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)ft.resolve(n[i]).then(e,t)})},ft._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){ED(n,0)},ft._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const FD=Al(Object.freeze(Object.defineProperty({__proto__:null,default:ft},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Yi,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,d=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new d},o=>{o.exports=SR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.18.4","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,d=(g,m,h)=>{var b=f(g,h),y=!1;1>h.opacity&&(y=!0);var v;if(b._video===void 0){var M=h.localTimeEnabled||h.localMorphColour;m?(v=m,v.morphTargets=M,v.morphNormals=h.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?v=new c.MeshPhongMaterial({color:h.colour,morphTargets:M,morphNormals:h.localTimeEnabled,transparent:y,opacity:h.opacity,side:c.DoubleSide}):v=new c.MeshPhongMaterial({color:h.colour,morphTargets:M,morphNormals:h.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:h.opacity,side:c.DoubleSide}),h.localMorphColour&&b.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();v=new c.MeshBasicMaterial({morphTargets:h.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:h.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,v)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(g,m,h)=>{if(!(this.morph&&this.morph.geometry&&g!=null)){var b=d(g,m,h);this.setMesh(b,h.localTimeEnabled,h.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var g=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,h=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(g.x-m.x,g.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y<this.geometry.faces.length;y++){var v=this.geometry.vertices[this.geometry.faces[y].a],M=this.geometry.vertices[this.geometry.faces[y].b],A=this.geometry.vertices[this.geometry.faces[y].c];geometry.faceVertexUvs[0].push([new c.Vector2((v.x+h.x)/b.x,(v.y+h.y)/b.y),new c.Vector2((M.x+h.x)/b.x,(M.y+h.y)/b.y),new c.Vector2((A.x+h.x)/b.x,(A.y+h.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=g=>{this.morph.material.wireframe=g},this.editVertices=function(g,m){if(g&&g.length){var h=this.getMorph(),b=h.geometry.getAttribute("position");if(!h||0>m)return;var y=3*m;g.forEach(v=>{b.array[y++]=v[0],b.array[y++]=v[1],b.array[y++]=v[2]}),b.needsUpdate=!0,h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=DB},(o,l,u)=>{var c=u(4),f=u(6).Geometry,d=u(7).default;function p(R){var I=R,S=u(0).modelPrefix;return S&&(S[S.length-1]!="/"&&(S+="/"),/^(?:[a-z]+:)?\/\//i.test(R)||(I=S+R)),I}function g(R,I){var S=(E,L)=>{try{var F=new URL(E,L).href;if(E&&2>E.split("?").length){var x=L.split("?");x.length===2&&(F=F+"?"+x[1])}return F}catch{console.error("There is an issue creating the url link with: ".concat(E,"."))}};if(!Array.isArray(R))return S(R,I);var T=[];return R.forEach(E=>{T.push(S(E,I))}),T}function m(R,I,S,T,E){var L=R.morphTargetInfluences,F=void 0;R.geometry&&(F=R.geometry.morphAttributes);var x=!1;if(L&&F&&F.position){T.set(0,0,0),E.set(0,0,0);for(var O=0;O<L.length;O++)0<L[O]&&(x=!0,S.setFromArray(F.position[O].array),T.add(S.min.multiplyScalar(L[O])),E.add(S.max.multiplyScalar(L[O])));x&&I.set(T,E)}x||I.setFromBufferAttribute(R.geometry.attributes.position),R.updateWorldMatrix(!0,!0),I.applyMatrix4(R.matrixWorld)}function h(R,I,S,T){var E=new XMLHttpRequest;E.open("GET",p(R),!0),E.onreadystatechange=()=>{E.readyState==4&&(E.status==200?S(E.responseText,I):T(R))},E.send(null)}function b(R,I,S){function T(O,B){F[B]=O,L++,L==E&&I(F)}for(var E=R.length,L=0,F=[],x=0;x<E;x++)h(R[x],x,T,S)}l.getColorsRGB=(R,I)=>{var S=Math.floor(I/3),T=I%3,E=0;T==0?E=R[S].r:T==1?E=R[S].g:T==2&&(E=R[S].b);var L=new c.Color(E);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(R,I){if(I&&R&&R.morphAttributes&&R.morphAttributes.color){var S=R.morphAttributes.color,T=I.morphTargetInfluences,E=T.length;R.deleteAttribute("morphColor0"),R.deleteAttribute("morphColor1");for(var L=0,F=[],x=0;1>L||x<E;x++)0<T[x]&&(L++,F.push([x,T[x]]));F.length==2?(R.setAttribute("morphColor0",S[F[0][0]]),R.setAttribute("morphColor1",S[F[1][0]])):F.length==1&&(R.setAttribute("morphColor0",S[F[0][0]]),R.setAttribute("morphColor1",S[F[0][0]]))}},l.toBufferGeometry=(R,I)=>{var S;return R instanceof f?(I.localTimeEnabled&&!R.morphNormalsReady&&(R.morphNormals==null||R.morphNormals.length==0)&&R.computeMorphNormals(),S=R.toIndexedBufferGeometry(),I.localMorphColour&&y(R,S)):R instanceof c.BufferGeometry&&(S=R.clone()),S.colorsNeedUpdate=!0,S.computeBoundingBox(),S.computeBoundingSphere(),R._video&&(S._video=R._video),S},l.copyMorphColorsToBufferGeometry=(R,I)=>{if(R&&R.morphColors&&0<R.morphColors.length){for(var S=[],T=R.morphColors,E=u(5).getColorsRGB,L=0,F=T.length;L<F;L++){for(var x=T[L],O=[],B=0;B<R.faces.length;B++){var N=R.faces[B],k=E(x.colors,N.a);O.push(k[0],k[1],k[2]),k=E(x.colors,N.b),O.push(k[0],k[1],k[2]),k=E(x.colors,N.c),O.push(k[0],k[1],k[2])}var z=new c.Float32BufferAttribute(3*(3*R.faces.length),3);z.name=x.name,S.push(z.copyArray(O))}I.morphAttributes.color=S}};var y=(R,I)=>{if(R&&R.morphColors&&0<R.morphColors.length){for(var S=[],T=R.morphColors,E=u(5).getColorsRGB,L=0,F=T.length;L<F;L++){for(var x,O=T[L],B=[],N=0;N<3*O.colors.length;N++)x=E(O.colors,N),B.push(x[0],x[1],x[2]);var k=new c.Float32BufferAttribute(B,3);k.name=O.name,S.push(k)}I.morphAttributes.color=S}};function v(R){for(var I,S,T,E,L=-1,F=0,x=0;x<R.length;++x){if(E=R[x],I===void 0&&(I=E.array.constructor),I!==E.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(S===void 0&&(S=E.itemSize),S!==E.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(T===void 0&&(T=E.normalized),T!==E.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(L===-1&&(L=E.gpuType),L!==E.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;F+=E.count*S}for(var O,B=new I(F),N=new c.BufferAttribute(B,S,T),k=0,z=0;z<R.length;++z){if(O=R[z],O.isInterleavedBufferAttribute)for(var G=k/S,Y=0,Z=O.count;Y<Z;Y++)for(var te,q=0;q<S;q++)te=O.getComponent(Y,q),N.setComponent(Y+G,q,te);else B.set(O.array,k);k+=O.count*S}return L!==void 0&&(N.gpuType=L),N}l.mergeGeometries=function(R){for(var I=1<arguments.length&&arguments[1]!==void 0&&arguments[1],S=R[0].index!==null,T=new Set(Object.keys(R[0].attributes)),E=new Set(Object.keys(R[0].morphAttributes)),L={},F={},x=R[0].morphTargetsRelative,O=new c.BufferGeometry,B=0,N=0;N<R.length;++N){var k=R[N],z=0;if(S!==(k.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var G in k.attributes){if(!T.has(G))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+'. All geometries must have compatible attributes; make sure "'+G+'" attribute exists among all geometries, or in none of them.'),null;L[G]===void 0&&(L[G]=[]),L[G].push(k.attributes[G]),z++}if(z!==T.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". Make sure all geometries have the same number of attributes."),null;if(x!==k.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var Y in k.morphAttributes){if(!E.has(Y))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". .morphAttributes must be consistent throughout all geometries."),null;F[Y]===void 0&&(F[Y]=[]),F[Y].push(k.morphAttributes[Y])}if(I){var Z=void 0;if(S)Z=k.index.count;else if(k.attributes.position!==void 0)Z=k.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". The geometry must have either an index or a position attribute"),null;O.addGroup(B,Z,N),B+=Z}}if(S){for(var te,q=0,j=[],$=0;$<R.length;++$){te=R[$].index;for(var X=0;X<te.count;++X)j.push(te.getX(X)+q);q+=R[$].attributes.position.count}O.setIndex(j)}for(var K in L){var re=v(L[K]);if(!re)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+K+" attribute."),null;O.setAttribute(K,re)}for(var V in F){var W=F[V][0].length;if(W===0)break;O.morphAttributes=O.morphAttributes||{},O.morphAttributes[V]=[];for(var oe,ae=0;ae<W;++ae){oe=[];for(var le=0;le<F[V].length;++le)oe.push(F[V][le][ae]);var H=v(oe);if(!H)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+V+" morphAttribute."),null;O.morphAttributes[V].push(H)}}return O},l.mergeVertices=function(R){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;I=Math.max(I,Number.EPSILON);for(var S,T={},E=R.getIndex(),L=R.getAttribute("position"),F=E?E.count:L.count,x=0,O=Object.keys(R.attributes),B={},N={},ge=[],k=["getX","getY","getZ","getW"],z=0,G=O.length;z<G;z++){S=O[z],B[S]=[];var Y=R.morphAttributes[S];Y&&(N[S]=Array(Y.length).fill().map(()=>[]))}for(var Z=Math.log10(1/I),te=Math.pow(10,Z),z=0;z<F;z++){for(var q=E?E.getX(z):z,j="",$=0,G=O.length;$<G;$++)for(var S=O[$],X=R.getAttribute(S),K=X.itemSize,re=0;re<K;re++)j+="".concat(~~(X[k[re]](q)*te),",");if(j in T)ge.push(T[j]);else{for(var $=0,G=O.length;$<G;$++)for(var V,S=O[$],X=R.getAttribute(S),Y=R.morphAttributes[S],K=X.itemSize,W=B[S],oe=N[S],re=0;re<K;re++)if(V=k[re],W.push(X[V](q)),Y)for(var ae=0,le=Y.length;ae<le;ae++)oe[ae].push(Y[ae][V](q));T[j]=x,ge.push(x),x++}}for(var H=R.clone(),z=0,G=O.length;z<G;z++){var X,S=O[z],U=R.getAttribute(S),D=new U.array.constructor(B[S]);if(U.isInterleavedBufferAttribute?X=new c.BufferAttribute(D,U.itemSize,U.itemSize):(X=R.getAttribute(S).clone(),X.setArray(D)),H.setAttribute(S,X),S in N)for(var Q,$=0;$<N[S].length;$++)Q=R.morphAttributes[S][$].clone(),Q.setArray(new Q.array.constructor(N[S][$])),H.morphAttributes[S][$]=Q}var ie=Uint8Array;ge.length>=Math.pow(2,8)&&(ie=Uint16Array),ge.length>=Math.pow(2,16)&&(ie=Uint32Array);var ce=new ie(ge),ge=null;return E===null?ge=new c.BufferAttribute(ce,1):(ge=R.getIndex().clone(),ge.setArray(ce)),H.setIndex(ge),H};function M(R){if(R.isMeshPhongMaterial){var I=new c.MeshToonMaterial({color:R.color.clone(),morphTargets:R.morphTargets,morphNormals:R.morphNormals,vertexColors:R.vertexColors,transparent:R.transparent,opacity:R.opacity,side:R.side});return R.map&&(I.map=R.map),I}return R}function A(R,I){if(I&&R>=I.length){var S=new c.BufferGeometry,T=new Float32Array(3*R),E=0;return I.forEach(L=>{T[E++]=L[0],T[E++]=L[1],T[E++]=L[2]}),S.setAttribute("position",new c.BufferAttribute(T,3)),S.setDrawRange(0,I.length),S}}function _(){var R=new Image;R.src=u(8);var I=new c.Texture;return I.image=R,I.needsUpdate=!0,I}function w(R,I,S,T,E,L){var F=new d(R,I,S,T,E,L);return F.fontFace=T,F.fontSize=E,F.fontWeight=L,F.material.map.generateMipmaps=!1,F.material.map.anisotropy=4,F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,F.center.set(.5,-1.2),F.renderOrder=1e4,F}function C(R,I,S){if(S){var T=R||"",E=I||"",L=S.lastIndexOf("/");if(-1<L){var F=void 0,x=void 0;if(F=S.substring(0,L),x=S.substring(L+1),(F==="*"||F==="**"||F.toLowerCase()===T.toLowerCase())&&(x==="*"||x==="**"||x.toLowerCase()===E.toLowerCase()))return!0}else if(T.toLowerCase()===S.toLowerCase()||E.toLowerCase()===S.toLowerCase())return!0}return!1}function P(R,I,S){var T=R.getAttribute("position"),E=R.getAttribute("normal");if(T){var L=T.itemSize,F=I*L,x=L,O=!1,B=(N,k)=>{var z=!1,G=Array.from(N.array);if(G.length>=F+x){G.splice(F,x),S&&G.concat(Array(x).fill(0)),z=!0;var Y=new Float32Array(G);R.setAttribute(k,new c.BufferAttribute(Y,L)),R.getAttribute(k).needsUpdate=!0}return z};return O=B(T,"position"),E&&B(E,"normal"),R.index!==null&&console.warn("Removing vertices from indexed geometry requires index buffer recalculation."),O}}l.getBoundingBox=m,l.createNewURL=g,l.createBufferGeometry=A,l.getCircularTexture=_,l.resolveURL=p,l.loadExternalFile=h,l.loadExternalFiles=b,l.PhongToToon=M,l.createNewSpriteText=w,l.isRegionGroup=C,l.removeVertexAtIndex=P},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,d=new c.Object3D,p=new c.Vector3,g=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(v){for(var M,A=new c.Matrix3().getNormalMatrix(v),_=0,w=this.vertices.length;_<w;_++)M=this.vertices[_],M.applyMatrix4(v);for(var C,P=0,R=this.faces.length;P<R;P++){C=this.faces[P],C.normal.applyMatrix3(A).normalize();for(var I=0,S=C.vertexNormals.length;I<S;I++)C.vertexNormals[I].applyMatrix3(A).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(v){return f.makeRotationX(v),this.applyMatrix4(f),this},rotateY:function(v){return f.makeRotationY(v),this.applyMatrix4(f),this},rotateZ:function(v){return f.makeRotationZ(v),this.applyMatrix4(f),this},translate:function(v,M,A){return f.makeTranslation(v,M,A),this.applyMatrix4(f),this},scale:function(v,M,A){return f.makeScale(v,M,A),this.applyMatrix4(f),this},lookAt:function(v){return d.lookAt(v),d.updateMatrix(),this.applyMatrix4(d.matrix),this},fromBufferGeometry:function(v){function M(G,Y,Z,te){var q=R===void 0?[]:[A.colors[G].clone(),A.colors[Y].clone(),A.colors[Z].clone()],j=P===void 0?[]:[new c.Vector3().fromBufferAttribute(P,G),new c.Vector3().fromBufferAttribute(P,Y),new c.Vector3().fromBufferAttribute(P,Z)],$=new b(G,Y,Z,j,q,te);A.faces.push($),I!==void 0&&A.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(I,G),new c.Vector2().fromBufferAttribute(I,Y),new c.Vector2().fromBufferAttribute(I,Z)]),S!==void 0&&A.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(S,G),new c.Vector2().fromBufferAttribute(S,Y),new c.Vector2().fromBufferAttribute(S,Z)])}var A=this,_=v.index===null?void 0:v.index,w=v.attributes;if(w.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var C=w.position,P=w.normal,R=w.color,I=w.uv,S=w.uv2;S!==void 0&&(this.faceVertexUvs[1]=[]);for(var T=0;T<C.count;T++)A.vertices.push(new c.Vector3().fromBufferAttribute(C,T)),R!==void 0&&A.colors.push(new c.Color().fromBufferAttribute(R,T));var E=v.groups;if(0<E.length)for(var L=0;L<E.length;L++)for(var F=E[L],x=F.start,O=F.count,B=x,N=x+O;B<N;B+=3)_===void 0?M(B,B+1,B+2,F.materialIndex):M(_.getX(B),_.getX(B+1),_.getX(B+2),F.materialIndex);else if(_!==void 0)for(var k=0;k<_.count;k+=3)M(_.getX(k),_.getX(k+1),_.getX(k+2));else for(var z=0;z<C.count;z+=3)M(z,z+1,z+2);return this.computeFaceNormals(),v.boundingBox!==null&&(this.boundingBox=v.boundingBox.clone()),v.boundingSphere!==null&&(this.boundingSphere=v.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var v=this.boundingSphere.center,M=this.boundingSphere.radius,A=M===0?1:1/M,_=new c.Matrix4;return _.set(A,0,0,-A*v.x,0,A,0,-A*v.y,0,0,A,-A*v.z,0,0,0,1),this.applyMatrix4(_),this},computeFaceNormals:function(){for(var v=new c.Vector3,M=new c.Vector3,A=0,_=this.faces.length;A<_;A++){var w=this.faces[A],C=this.vertices[w.a],P=this.vertices[w.b],R=this.vertices[w.c];v.subVectors(R,P),M.subVectors(C,P),v.cross(M),v.normalize(),w.normal.copy(v)}},computeVertexNormals:function(){for(var v=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],M=Array(this.vertices.length),A=0,_=this.vertices.length;A<_;A++)M[A]=new c.Vector3;if(v)for(var w=new c.Vector3,C=new c.Vector3,P=0,R=this.faces.length;P<R;P++){var I=this.faces[P],S=this.vertices[I.a],T=this.vertices[I.b],E=this.vertices[I.c];w.subVectors(E,T),C.subVectors(S,T),w.cross(C),M[I.a].add(w),M[I.b].add(w),M[I.c].add(w)}else{this.computeFaceNormals();for(var L,F=0,x=this.faces.length;F<x;F++)L=this.faces[F],M[L.a].add(L.normal),M[L.b].add(L.normal),M[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)M[O].normalize();for(var N=0,k=this.faces.length;N<k;N++){var z=this.faces[N],G=z.vertexNormals;G.length===3?(G[0].copy(M[z.a]),G[1].copy(M[z.b]),G[2].copy(M[z.c])):(G[0]=M[z.a].clone(),G[1]=M[z.b].clone(),G[2]=M[z.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),M},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var v=0,M=this.faces.length;v<M;v++){var A=this.faces[v],_=A.vertexNormals;_.length===3?(_[0].copy(A.normal),_[1].copy(A.normal),_[2].copy(A.normal)):(_[0]=A.normal.clone(),_[1]=A.normal.clone(),_[2]=A.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var v,M=0,A=this.faces.length;M<A;M++){v=this.faces[M],v.__originalFaceNormal?v.__originalFaceNormal.copy(v.normal):v.__originalFaceNormal=v.normal.clone(),v.__originalVertexNormals||(v.__originalVertexNormals=[]);for(var _=0,w=v.vertexNormals.length;_<w;_++)v.__originalVertexNormals[_]?v.__originalVertexNormals[_].copy(v.vertexNormals[_]):v.__originalVertexNormals[_]=v.vertexNormals[_].clone()}var C=new m;C.faces=this.faces;for(var P=0,R=this.morphTargets.length;P<R;P++){if(!this.morphNormals[P]){this.morphNormals[P]={},this.morphNormals[P].faceNormals=[],this.morphNormals[P].vertexNormals=[];for(var I=this.morphNormals[P].faceNormals,S=this.morphNormals[P].vertexNormals,T=0,E=this.faces.length;T<E;T++){var L=new c.Vector3,F={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};I.push(L),S.push(F)}}var x=this.morphNormals[P];C.vertices=this.morphTargets[P].vertices,C.computeFaceNormals();var O=C.computeVertexNormals();if(O&&0<O.length){this.morphTargets[P].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[P].normals[B]=O[B].clone()}for(var N=0,k=this.faces.length;N<k;N++){var z=this.faces[N],G=x.faceNormals[N],Y=x.vertexNormals[N];G.copy(z.normal),Y.a.copy(z.vertexNormals[0]),Y.b.copy(z.vertexNormals[1]),Y.c.copy(z.vertexNormals[2])}}for(var Z,te=0,q=this.faces.length;te<q;te++)Z=this.faces[te],Z.normal=Z.__originalFaceNormal,Z.vertexNormals=Z.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(v,M){var A=this.morphTargets.length,_=this.morphTargets,w=v.morphTargets,C=this.morphColors.length,P=this.morphColors,R=v.morphColors;if(0<A&&A==w.length)for(var I=0,S=_.length;I<S;I++){for(var T=_[I],E=w[I],L=0,F=E.vertices.length;L<F;L++){var x=E.vertices[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),T.vertices.push(O)}if(T.normals&&E.normals)for(var B=0;B<E.normals.length;B+=3)g.set(E.normals2[B],E.normals2[B+1],E.normals2[B+2]),M!==void 0&&g.applyMatrix4(M),T.normals.push(g.x,g.y,g.z)}if(0<C&&C==R.length)for(var N=0,k=P.length;N<k;N++)for(var z=P[N],G=R[N],Y=0,Z=G.colors;Y<Z;Y++)z.colors.push(G.colors[Y].clone())},merge:function(v,M){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(v&&v.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",v);var _,w=this.vertices.length,C=this.vertices,P=v.vertices,R=v.normals,I=this.faces,S=v.faces,T=this.colors,E=v.colors;M!==void 0&&(_=new c.Matrix3().getNormalMatrix(M));for(var L=0,F=P.length;L<F;L++){var x=P[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),C.push(O)}for(var B=0;B<R.length;B+=3)g.set(R[B],R[B+1],R[B+2]),M!==void 0&&g.applyMatrix4(M),this.normals.push(g.x,g.y,g.z);for(var N=0,k=E.length;N<k;N++)typeof E[N]=="number"?T.push(E[N]):T.push(E[N].clone());for(var z=0,G=S.length;z<G;z++){var Y=S[z],Z=void 0,te=void 0,q=Y.vertexNormals,j=Y.vertexColors,$=new b(Y.a+w,Y.b+w,Y.c+w);$.normal.copy(Y.normal),_!==void 0&&$.normal.applyMatrix3(_).normalize();for(var X=0,K=q.length;X<K;X++)Z=q[X].clone(),_!==void 0&&Z.applyMatrix3(_).normalize(),$.vertexNormals.push(Z);$.color.copy(Y.color);for(var re=0,V=j.length;re<V;re++)te=j[re],$.vertexColors.push(te.clone());$.materialIndex=Y.materialIndex+A,I.push($)}for(var W,oe=0,ae=v.faceVertexUvs.length;oe<ae;oe++){W=v.faceVertexUvs[oe],this.faceVertexUvs[oe]===void 0&&(this.faceVertexUvs[oe]=[]);for(var le=0,H=W.length;le<H;le++){for(var U=W[le],D=[],Q=0,ie=U.length;Q<ie;Q++)D.push(U[Q].clone());this.faceVertexUvs[oe].push(D)}}this.mergeMorph(v,M)},mergeMesh:function(v){return v&&v.isMesh?(v.matrixAutoUpdate&&v.updateMatrix(),void this.merge(v.geometry,v.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",v)},mergeVertices:function(){for(var v=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,M={},A=[],_=[],w=Math.pow(10,v),C=0,P=this.vertices.length;C<P;C++){var R=this.vertices[C],I=Math.round(R.x*w)+"_"+Math.round(R.y*w)+"_"+Math.round(R.z*w);M[I]===void 0?(M[I]=C,A.push(this.vertices[C]),_[C]=A.length-1):_[C]=_[M[I]]}for(var S,T=[],E=0,L=this.faces.length;E<L;E++){S=this.faces[E],S.a=_[S.a],S.b=_[S.b],S.c=_[S.c];for(var F=[S.a,S.b,S.c],x=0;3>x;x++)if(F[x]===F[(x+1)%3]){T.push(E);break}}for(var O,B=T.length-1;0<=B;B--){O=T[B],this.faces.splice(O,1);for(var N=0,k=this.faceVertexUvs.length;N<k;N++)this.faceVertexUvs[N].splice(O,1)}var z=this.vertices.length-A.length;return this.vertices=A,z},setFromPoints:function(v){this.vertices=[];for(var M,A=0,_=v.length;A<_;A++)M=v[A],this.vertices.push(new c.Vector3(M.x,M.y,M.z||0));return this},sortFacesByMaterialIndex:function(){for(var v=this.faces,M=v.length,A=0;A<M;A++)v[A]._id=A;v.sort(function(S,T){return S.materialIndex-T.materialIndex});var _,w,C=this.faceVertexUvs[0],P=this.faceVertexUvs[1];C&&C.length===M&&(_=[]),P&&P.length===M&&(w=[]);for(var R,I=0;I<M;I++)R=v[I]._id,_&&_.push(C[R]),w&&w.push(P[R]);_&&(this.faceVertexUvs[0]=_),w&&(this.faceVertexUvs[1]=w)},toJSON:function(){function v(V,W,oe){return oe?V|1<<W:V&~(1<<W)}function M(V){var W=V.x.toString()+V.y.toString()+V.z.toString();return L[W]===void 0&&(L[W]=E.length/3,E.push(V.x,V.y,V.z)),L[W]}function A(V){var W=V.r.toString()+V.g.toString()+V.b.toString();return x[W]===void 0&&(x[W]=F.length,F.push(V.getHex())),x[W]}function _(V){var W=V.x.toString()+V.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(V.x,V.y)),B[W]}var w={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(w.uuid=this.uuid,w.type=this.type,this.name!==""&&(w.name=this.name),this.parameters!==void 0){var C=this.parameters;for(var P in C)C[P]!==void 0&&(w[P]=C[P]);return w}for(var R,I=[],S=0;S<this.vertices.length;S++)R=this.vertices[S],I.push(R.x,R.y,R.z);for(var T=[],E=[],L={},F=[],x={},O=[],B={},N=0;N<this.faces.length;N++){var k=this.faces[N],z=!0,G=!1,Y=this.faceVertexUvs[0][N]!==void 0,Z=0<k.normal.length(),te=0<k.vertexNormals.length,q=k.color.r!==1||k.color.g!==1||k.color.b!==1,j=0<k.vertexColors.length,$=0;if($=v($,0,0),$=v($,1,z),$=v($,2,G),$=v($,3,Y),$=v($,4,Z),$=v($,5,te),$=v($,6,q),$=v($,7,j),T.push($),T.push(k.a,k.b,k.c),T.push(k.materialIndex),Y){var X=this.faceVertexUvs[0][N];T.push(_(X[0]),_(X[1]),_(X[2]))}if(Z&&T.push(M(k.normal)),te){var K=k.vertexNormals;T.push(M(K[0]),M(K[1]),M(K[2]))}if(q&&T.push(A(k.color)),j){var re=k.vertexColors;T.push(A(re[0]),A(re[1]),A(re[2]))}}return w.data={},w.data.vertices=I,w.data.normals=E,0<F.length&&(w.data.colors=F),0<O.length&&(w.data.uvs=[O]),w.data.faces=T,w},clone:function(){return new m().copy(this)},copy:function(v){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=v.name;for(var M=v.vertices,A=0,_=M.length;A<_;A++)this.vertices.push(M[A].clone());for(var w=v.colors,C=0,P=w.length;C<P;C++)this.colors.push(w[C].clone());for(var R=v.faces,I=0,S=R.length;I<S;I++)this.faces.push(R[I].clone());for(var T,E=0,L=v.faceVertexUvs.length;E<L;E++){T=v.faceVertexUvs[E],this.faceVertexUvs[E]===void 0&&(this.faceVertexUvs[E]=[]);for(var F=0,x=T.length;F<x;F++){for(var O,B=T[F],N=[],k=0,z=B.length;k<z;k++)O=B[k],N.push(O.clone());this.faceVertexUvs[E].push(N)}}for(var G,Y=v.morphTargets,Z=0,te=Y.length;Z<te;Z++){if(G={},G.name=Y[Z].name,Y[Z].vertices!==void 0){G.vertices=[];for(var q=0,j=Y[Z].vertices.length;q<j;q++)G.vertices.push(Y[Z].vertices[q].clone())}if(Y[Z].normals!==void 0){G.normals=[];for(var $=0,X=Y[Z].normals.length;$<X;$++)G.normals.push(Y[Z].normals[$].clone())}this.morphTargets.push(G)}for(var K,re=v.morphNormals,V=0,W=re.length;V<W;V++){if(K={},re[V].vertexNormals!==void 0){K.vertexNormals=[];for(var oe=0,ae=re[V].vertexNormals.length;oe<ae;oe++){var le=re[V].vertexNormals[oe],H={};H.a=le.a.clone(),H.b=le.b.clone(),H.c=le.c.clone(),K.vertexNormals.push(H)}}if(re[V].faceNormals!==void 0){K.faceNormals=[];for(var U=0,D=re[V].faceNormals.length;U<D;U++)K.faceNormals.push(re[V].faceNormals[U].clone())}this.morphNormals.push(K)}for(var Q=v.skinWeights,ie=0,ce=Q.length;ie<ce;ie++)this.skinWeights.push(Q[ie].clone());for(var ge=v.skinIndices,ye=0,ue=ge.length;ye<ue;ye++)this.skinIndices.push(ge[ye].clone());for(var be=v.lineDistances,ne=0,de=be.length;ne<de;ne++)this.lineDistances.push(be[ne]);var ve=v.boundingBox;ve!==null&&(this.boundingBox=ve.clone());var Ee=v.boundingSphere;return Ee!==null&&(this.boundingSphere=Ee.clone()),this.elementsNeedUpdate=v.elementsNeedUpdate,this.verticesNeedUpdate=v.verticesNeedUpdate,this.uvsNeedUpdate=v.uvsNeedUpdate,this.normalsNeedUpdate=v.normalsNeedUpdate,this.colorsNeedUpdate=v.colorsNeedUpdate,this.lineDistancesNeedUpdate=v.lineDistancesNeedUpdate,this.groupsNeedUpdate=v.groupsNeedUpdate,this},computeGroups(){var y,v,M=[],A=void 0,_=this.faces;for(v=0;v<_.length;v++){var w=_[v];w.materialIndex!==A&&(A=w.materialIndex,y!==void 0&&(y.count=3*v-y.start,M.push(y)),y={start:3*v,materialIndex:A})}return y!==void 0&&(y.count=3*v-y.start,M.push(y)),M},toBufferGeometry:function(){var v=new h().fromGeometry(this),M=new c.BufferGeometry,A=new Float32Array(3*v.vertices.length);if(M.setAttribute("position",new c.BufferAttribute(A,3).copyVector3sArray(v.vertices)),0<v.normals.length){var _=new Float32Array(3*v.normals.length);M.setAttribute("normal",new c.BufferAttribute(_,3).copyVector3sArray(v.normals))}if(0<v.colors.length){var w=new Float32Array(3*v.colors.length);M.setAttribute("color",new c.BufferAttribute(w,3).copyColorsArray(v.colors))}if(0<v.uvs.length){var C=new Float32Array(2*v.uvs.length);M.setAttribute("uv",new c.BufferAttribute(C,2).copyVector2sArray(v.uvs))}if(0<v.uvs2.length){var P=new Float32Array(2*v.uvs2.length);M.setAttribute("uv2",new c.BufferAttribute(P,2).copyVector2sArray(v.uvs2))}for(var R in M.groups=v.groups,v.morphTargets){for(var I=[],S=v.morphTargets[R],T=0,E=S.length;T<E;T++){var L=S[T],F=new c.Float32BufferAttribute(3*L.data.length,3);F.name=L.name,I.push(F.copyVector3sArray(L.data))}M.morphAttributes[R]=I}if(0<v.skinIndices.length){var x=new c.Float32BufferAttribute(4*v.skinIndices.length,4);M.setAttribute("skinIndex",x.copyVector4sArray(v.skinIndices))}if(0<v.skinWeights.length){var O=new c.Float32BufferAttribute(4*v.skinWeights.length,4);M.setAttribute("skinWeight",O.copyVector4sArray(v.skinWeights))}return v.boundingSphere!==null&&(M.boundingSphere=v.boundingSphere.clone()),v.boundingBox!==null&&(M.boundingBox=v.boundingBox.clone()),M},toIndexedBufferGeometry:function(){var v=new c.BufferGeometry,M=new Float32Array(3*this.vertices.length);if(v.setAttribute("position",new c.BufferAttribute(M,3).copyVector3sArray(this.vertices)),0<this.normals.length){var A=new Float32Array(this.normals.length),_=new c.BufferAttribute(A,3).copyArray(this.normals);v.setAttribute("normal",_)}if(0<this.uvs.length&&0<this.uvs[0].length){var w=new Float32Array(2*this.uvs[0].length);v.setAttribute("uv",new c.BufferAttribute(w,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var C=new Float32Array(2*this.uvs[1].length);v.setAttribute("uv2",new c.BufferAttribute(C,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var P=[],R=0;R<this.colors.length;R++)P.push(new c.Color(this.colors[R]));var I=new Float32Array(3*P.length);v.setAttribute("color",new c.BufferAttribute(I,3).copyColorsArray(P))}else{for(var S=new Float32Array(3*this.vertices.length),T=0;T<3*this.vertices.length;T++)S[T]=1;v.setAttribute("color",new c.BufferAttribute(S,3))}if(0<this.faces.length){for(var E=[],L=[],F=0;F<this.faces.length;F++){L.push(this.faces[F].a,this.faces[F].b,this.faces[F].c);var x=this.faces[F].vertexColors;if(x.length===3)E.push(x[0],x[1],x[2]);else{var O=this.faces[F].color;E.push(O,O,O)}}v.setIndex(L),v.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],N=[],k=0,z=this.morphTargets.length;k<z;k++){var G=this.morphTargets[k],Y=new c.Float32BufferAttribute(3*G.vertices.length,3);if(Y.name=G.name,B.push(Y.copyVector3sArray(G.vertices)),G.normals){var Z=new c.Float32BufferAttribute(3*G.normals.length,3);Z.name=G.name,N.push(Z.copyVector3sArray(G.normals))}}v.morphAttributes.position=B,v.morphAttributes.normal=N}if(0<this.skinIndices.length){var te=new c.Float32BufferAttribute(4*this.skinIndices.length,4);v.setAttribute("skinIndex",te.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var q=new c.Float32BufferAttribute(4*this.skinWeights.length,4);v.setAttribute("skinWeight",q.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(v.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(v.boundingBox=this.boundingBox.clone()),v},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(v){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(v)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(y){var v=new c.BufferGeometry,M=y.geometry;if(y.isPoints||y.isLine){var A=new c.Float32BufferAttribute(3*M.vertices.length,3),_=new c.Float32BufferAttribute(3*M.colors.length,3);if(v.setAttribute("position",A.copyVector3sArray(M.vertices)),v.setAttribute("color",_.copyColorsArray(M.colors)),M.lineDistances&&M.lineDistances.length===M.vertices.length){var w=new c.Float32BufferAttribute(M.lineDistances.length,1);v.setAttribute("lineDistance",w.copyArray(M.lineDistances))}M.boundingSphere!==null&&(v.boundingSphere=M.boundingSphere.clone()),M.boundingBox!==null&&(v.boundingBox=M.boundingBox.clone())}else y.isMesh&&(v=M.toBufferGeometry());return v};class h{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(v){var M,A,_=[],w=void 0,C=v.faces;for(A=0;A<C.length;A++){var P=C[A];P.materialIndex!==w&&(w=P.materialIndex,M!==void 0&&(M.count=3*A-M.start,_.push(M)),M={start:3*A,materialIndex:w})}M!==void 0&&(M.count=3*A-M.start,_.push(M)),this.groups=_}fromGeometry(v){var M,A=v.faces,_=v.vertices,w=v.faceVertexUvs,C=w[0]&&0<w[0].length,P=w[1]&&0<w[1].length,R=v.morphTargets,I=R.length;if(0<I){M=[];for(var S=0;S<I;S++)M[S]={name:R[S].name,data:[]};this.morphTargets.position=M}var T,E=v.morphNormals,L=E.length;if(0<L){T=[];for(var F=0;F<L;F++)T[F]={name:E[F].name,data:[]};this.morphTargets.normal=T}var x=v.skinIndices,O=v.skinWeights,B=x.length===_.length,N=O.length===_.length;0<_.length&&A.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,z=0;z<A.length;z++){k=A[z],this.vertices.push(_[k.a],_[k.b],_[k.c]);var G=k.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var Y=k.normal;this.normals.push(Y,Y,Y)}var Z=k.vertexColors;if(Z.length===3)this.colors.push(Z[0],Z[1],Z[2]);else{var te=k.color;this.colors.push(te,te,te)}if(C===!0){var q=w[0][z];q===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",z),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(q[0],q[1],q[2])}if(P===!0){var j=w[1][z];j===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",z),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(j[0],j[1],j[2])}for(var $,X=0;X<I;X++)$=R[X].vertices,M[X].data.push($[k.a],$[k.b],$[k.c]);for(var K,re=0;re<L;re++)K=E[re].vertexNormals[z],T[re].data.push(K.a,K.b,K.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),N&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(v),this.verticesNeedUpdate=v.verticesNeedUpdate,this.normalsNeedUpdate=v.normalsNeedUpdate,this.colorsNeedUpdate=v.colorsNeedUpdate,this.uvsNeedUpdate=v.uvsNeedUpdate,this.groupsNeedUpdate=v.groupsNeedUpdate,v.boundingSphere!==null&&(this.boundingSphere=v.boundingSphere.clone()),v.boundingBox!==null&&(this.boundingBox=v.boundingBox.clone()),this}}class b{constructor(v,M,A,_,w){var C=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=v,this.b=M,this.c=A,this.normal=_&&_.isVector3?_:new c.Vector3,this.vertexNormals=Array.isArray(_)?_:[],this.color=w&&w.isColor?w:new c.Color,this.vertexColors=Array.isArray(w)?w:[],this.materialIndex=C}clone(){return new this.constructor().copy(this)}copy(v){this.a=v.a,this.b=v.b,this.c=v.c,this.normal.copy(v.normal),this.color.copy(v.color),this.materialIndex=v.materialIndex;for(var M=0,A=v.vertexNormals.length;M<A;M++)this.vertexNormals[M]=v.vertexNormals[M].clone();for(var _=0,w=v.vertexColors.length;_<w;_++)this.vertexColors[_]=v.vertexColors[_].clone();return this}}},o=>{o.exports=QB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3182
+ `}),g=g+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(v){return""+JSON.stringify(v)+": "+d.main[v].toString()}).join(",")+"}))(self);";var m=new window.Blob([g],{type:"text/javascript"});if(f.bare)return m;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,b=h.createObjectURL(m),y=new window.Worker(b);return y.objectURL=b,y}}(mf)),mf.exports}function SD(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function _D(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(d){o(u,d)},function(d){r[u]={status:"rejected",reason:d},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function Sx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}Sx.prototype=Error.prototype;function TD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new Sx(s,"All promises were rejected"))})}catch(l){i(l)}})}var ED=setTimeout;function _x(n){return!!(n&&typeof n.length<"u")}function CD(){}function LD(n,e){return function(){n.apply(e,arguments)}}function ft(n){if(!(this instanceof ft))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ex(n,this)}function Tx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,ft._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?gf:Ua)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ua(e.promise,r);return}gf(e.promise,i)})}function gf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof ft){n._state=3,n._value=e,vf(n);return}else if(typeof t=="function"){Ex(LD(t,e),n);return}}n._state=1,n._value=e,vf(n)}catch(i){Ua(n,i)}}function Ua(n,e){n._state=2,n._value=e,vf(n)}function vf(n){n._state===2&&n._deferreds.length===0&&ft._immediateFn(function(){n._handled||ft._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Tx(n,n._deferreds[e]);n._deferreds=null}function RD(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Ex(n,e){var t=!1;try{n(function(i){t||(t=!0,gf(e,i))},function(i){t||(t=!0,Ua(e,i))})}catch(i){if(t)return;t=!0,Ua(e,i)}}ft.prototype.catch=function(n){return this.then(null,n)},ft.prototype.then=function(n,e){var t=new this.constructor(CD);return Tx(this,new RD(n,e,t)),t},ft.prototype.finally=SD,ft.all=function(n){return new ft(function(e,t){if(!_x(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},ft.any=TD,ft.allSettled=_D,ft.resolve=function(n){return n&&typeof n=="object"&&n.constructor===ft?n:new ft(function(e){e(n)})},ft.reject=function(n){return new ft(function(e,t){t(n)})},ft.race=function(n){return new ft(function(e,t){if(!_x(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)ft.resolve(n[i]).then(e,t)})},ft._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){ED(n,0)},ft._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const FD=Al(Object.freeze(Object.defineProperty({__proto__:null,default:ft},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Yi,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,d=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new d},o=>{o.exports=SR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.18.5","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,d=(g,m,h)=>{var b=f(g,h),y=!1;1>h.opacity&&(y=!0);var v;if(b._video===void 0){var M=h.localTimeEnabled||h.localMorphColour;m?(v=m,v.morphTargets=M,v.morphNormals=h.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?v=new c.MeshPhongMaterial({color:h.colour,morphTargets:M,morphNormals:h.localTimeEnabled,transparent:y,opacity:h.opacity,side:c.DoubleSide}):v=new c.MeshPhongMaterial({color:h.colour,morphTargets:M,morphNormals:h.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:h.opacity,side:c.DoubleSide}),h.localMorphColour&&b.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();v=new c.MeshBasicMaterial({morphTargets:h.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:h.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,v)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(g,m,h)=>{if(!(this.morph&&this.morph.geometry&&g!=null)){var b=d(g,m,h);this.setMesh(b,h.localTimeEnabled,h.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var g=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,h=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(g.x-m.x,g.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y<this.geometry.faces.length;y++){var v=this.geometry.vertices[this.geometry.faces[y].a],M=this.geometry.vertices[this.geometry.faces[y].b],A=this.geometry.vertices[this.geometry.faces[y].c];geometry.faceVertexUvs[0].push([new c.Vector2((v.x+h.x)/b.x,(v.y+h.y)/b.y),new c.Vector2((M.x+h.x)/b.x,(M.y+h.y)/b.y),new c.Vector2((A.x+h.x)/b.x,(A.y+h.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=g=>{this.morph.material.wireframe=g},this.editVertices=function(g,m){if(g&&g.length){var h=this.getMorph(),b=h.geometry.getAttribute("position");if(!h||0>m)return;var y=3*m;g.forEach(v=>{b.array[y++]=v[0],b.array[y++]=v[1],b.array[y++]=v[2]}),b.needsUpdate=!0,h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=DB},(o,l,u)=>{var c=u(4),f=u(6).Geometry,d=u(7).default;function p(R){var I=R,S=u(0).modelPrefix;return S&&(S[S.length-1]!="/"&&(S+="/"),/^(?:[a-z]+:)?\/\//i.test(R)||(I=S+R)),I}function g(R,I){var S=(E,L)=>{try{var F=new URL(E,L).href;if(E&&2>E.split("?").length){var x=L.split("?");x.length===2&&(F=F+"?"+x[1])}return F}catch{console.error("There is an issue creating the url link with: ".concat(E,"."))}};if(!Array.isArray(R))return S(R,I);var T=[];return R.forEach(E=>{T.push(S(E,I))}),T}function m(R,I,S,T,E){var L=R.morphTargetInfluences,F=void 0;R.geometry&&(F=R.geometry.morphAttributes);var x=!1;if(L&&F&&F.position){T.set(0,0,0),E.set(0,0,0);for(var O=0;O<L.length;O++)0<L[O]&&(x=!0,S.setFromArray(F.position[O].array),T.add(S.min.multiplyScalar(L[O])),E.add(S.max.multiplyScalar(L[O])));x&&I.set(T,E)}x||I.setFromBufferAttribute(R.geometry.attributes.position),R.updateWorldMatrix(!0,!0),I.applyMatrix4(R.matrixWorld)}function h(R,I,S,T){var E=new XMLHttpRequest;E.open("GET",p(R),!0),E.onreadystatechange=()=>{E.readyState==4&&(E.status==200?S(E.responseText,I):T(R))},E.send(null)}function b(R,I,S){function T(O,B){F[B]=O,L++,L==E&&I(F)}for(var E=R.length,L=0,F=[],x=0;x<E;x++)h(R[x],x,T,S)}l.getColorsRGB=(R,I)=>{var S=Math.floor(I/3),T=I%3,E=0;T==0?E=R[S].r:T==1?E=R[S].g:T==2&&(E=R[S].b);var L=new c.Color(E);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(R,I){if(I&&R&&R.morphAttributes&&R.morphAttributes.color){var S=R.morphAttributes.color,T=I.morphTargetInfluences,E=T.length;R.deleteAttribute("morphColor0"),R.deleteAttribute("morphColor1");for(var L=0,F=[],x=0;1>L||x<E;x++)0<T[x]&&(L++,F.push([x,T[x]]));F.length==2?(R.setAttribute("morphColor0",S[F[0][0]]),R.setAttribute("morphColor1",S[F[1][0]])):F.length==1&&(R.setAttribute("morphColor0",S[F[0][0]]),R.setAttribute("morphColor1",S[F[0][0]]))}},l.toBufferGeometry=(R,I)=>{var S;return R instanceof f?(I.localTimeEnabled&&!R.morphNormalsReady&&(R.morphNormals==null||R.morphNormals.length==0)&&R.computeMorphNormals(),S=R.toIndexedBufferGeometry(),I.localMorphColour&&y(R,S)):R instanceof c.BufferGeometry&&(S=R.clone()),S.colorsNeedUpdate=!0,S.computeBoundingBox(),S.computeBoundingSphere(),R._video&&(S._video=R._video),S},l.copyMorphColorsToBufferGeometry=(R,I)=>{if(R&&R.morphColors&&0<R.morphColors.length){for(var S=[],T=R.morphColors,E=u(5).getColorsRGB,L=0,F=T.length;L<F;L++){for(var x=T[L],O=[],B=0;B<R.faces.length;B++){var N=R.faces[B],k=E(x.colors,N.a);O.push(k[0],k[1],k[2]),k=E(x.colors,N.b),O.push(k[0],k[1],k[2]),k=E(x.colors,N.c),O.push(k[0],k[1],k[2])}var z=new c.Float32BufferAttribute(3*(3*R.faces.length),3);z.name=x.name,S.push(z.copyArray(O))}I.morphAttributes.color=S}};var y=(R,I)=>{if(R&&R.morphColors&&0<R.morphColors.length){for(var S=[],T=R.morphColors,E=u(5).getColorsRGB,L=0,F=T.length;L<F;L++){for(var x,O=T[L],B=[],N=0;N<3*O.colors.length;N++)x=E(O.colors,N),B.push(x[0],x[1],x[2]);var k=new c.Float32BufferAttribute(B,3);k.name=O.name,S.push(k)}I.morphAttributes.color=S}};function v(R){for(var I,S,T,E,L=-1,F=0,x=0;x<R.length;++x){if(E=R[x],I===void 0&&(I=E.array.constructor),I!==E.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(S===void 0&&(S=E.itemSize),S!==E.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(T===void 0&&(T=E.normalized),T!==E.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(L===-1&&(L=E.gpuType),L!==E.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;F+=E.count*S}for(var O,B=new I(F),N=new c.BufferAttribute(B,S,T),k=0,z=0;z<R.length;++z){if(O=R[z],O.isInterleavedBufferAttribute)for(var G=k/S,Y=0,Z=O.count;Y<Z;Y++)for(var te,q=0;q<S;q++)te=O.getComponent(Y,q),N.setComponent(Y+G,q,te);else B.set(O.array,k);k+=O.count*S}return L!==void 0&&(N.gpuType=L),N}l.mergeGeometries=function(R){for(var I=1<arguments.length&&arguments[1]!==void 0&&arguments[1],S=R[0].index!==null,T=new Set(Object.keys(R[0].attributes)),E=new Set(Object.keys(R[0].morphAttributes)),L={},F={},x=R[0].morphTargetsRelative,O=new c.BufferGeometry,B=0,N=0;N<R.length;++N){var k=R[N],z=0;if(S!==(k.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var G in k.attributes){if(!T.has(G))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+'. All geometries must have compatible attributes; make sure "'+G+'" attribute exists among all geometries, or in none of them.'),null;L[G]===void 0&&(L[G]=[]),L[G].push(k.attributes[G]),z++}if(z!==T.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". Make sure all geometries have the same number of attributes."),null;if(x!==k.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var Y in k.morphAttributes){if(!E.has(Y))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". .morphAttributes must be consistent throughout all geometries."),null;F[Y]===void 0&&(F[Y]=[]),F[Y].push(k.morphAttributes[Y])}if(I){var Z=void 0;if(S)Z=k.index.count;else if(k.attributes.position!==void 0)Z=k.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+N+". The geometry must have either an index or a position attribute"),null;O.addGroup(B,Z,N),B+=Z}}if(S){for(var te,q=0,W=[],$=0;$<R.length;++$){te=R[$].index;for(var X=0;X<te.count;++X)W.push(te.getX(X)+q);q+=R[$].attributes.position.count}O.setIndex(W)}for(var K in L){var re=v(L[K]);if(!re)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+K+" attribute."),null;O.setAttribute(K,re)}for(var V in F){var j=F[V][0].length;if(j===0)break;O.morphAttributes=O.morphAttributes||{},O.morphAttributes[V]=[];for(var oe,ae=0;ae<j;++ae){oe=[];for(var le=0;le<F[V].length;++le)oe.push(F[V][le][ae]);var H=v(oe);if(!H)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+V+" morphAttribute."),null;O.morphAttributes[V].push(H)}}return O},l.mergeVertices=function(R){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;I=Math.max(I,Number.EPSILON);for(var S,T={},E=R.getIndex(),L=R.getAttribute("position"),F=E?E.count:L.count,x=0,O=Object.keys(R.attributes),B={},N={},ge=[],k=["getX","getY","getZ","getW"],z=0,G=O.length;z<G;z++){S=O[z],B[S]=[];var Y=R.morphAttributes[S];Y&&(N[S]=Array(Y.length).fill().map(()=>[]))}for(var Z=Math.log10(1/I),te=Math.pow(10,Z),z=0;z<F;z++){for(var q=E?E.getX(z):z,W="",$=0,G=O.length;$<G;$++)for(var S=O[$],X=R.getAttribute(S),K=X.itemSize,re=0;re<K;re++)W+="".concat(~~(X[k[re]](q)*te),",");if(W in T)ge.push(T[W]);else{for(var $=0,G=O.length;$<G;$++)for(var V,S=O[$],X=R.getAttribute(S),Y=R.morphAttributes[S],K=X.itemSize,j=B[S],oe=N[S],re=0;re<K;re++)if(V=k[re],j.push(X[V](q)),Y)for(var ae=0,le=Y.length;ae<le;ae++)oe[ae].push(Y[ae][V](q));T[W]=x,ge.push(x),x++}}for(var H=R.clone(),z=0,G=O.length;z<G;z++){var X,S=O[z],U=R.getAttribute(S),D=new U.array.constructor(B[S]);if(U.isInterleavedBufferAttribute?X=new c.BufferAttribute(D,U.itemSize,U.itemSize):(X=R.getAttribute(S).clone(),X.setArray(D)),H.setAttribute(S,X),S in N)for(var Q,$=0;$<N[S].length;$++)Q=R.morphAttributes[S][$].clone(),Q.setArray(new Q.array.constructor(N[S][$])),H.morphAttributes[S][$]=Q}var ie=Uint8Array;ge.length>=Math.pow(2,8)&&(ie=Uint16Array),ge.length>=Math.pow(2,16)&&(ie=Uint32Array);var ce=new ie(ge),ge=null;return E===null?ge=new c.BufferAttribute(ce,1):(ge=R.getIndex().clone(),ge.setArray(ce)),H.setIndex(ge),H};function M(R){if(R.isMeshPhongMaterial){var I=new c.MeshToonMaterial({color:R.color.clone(),morphTargets:R.morphTargets,morphNormals:R.morphNormals,vertexColors:R.vertexColors,transparent:R.transparent,opacity:R.opacity,side:R.side});return R.map&&(I.map=R.map),I}return R}function A(R,I){if(I&&R>=I.length){var S=new c.BufferGeometry,T=new Float32Array(3*R),E=0;return I.forEach(L=>{T[E++]=L[0],T[E++]=L[1],T[E++]=L[2]}),S.setAttribute("position",new c.BufferAttribute(T,3)),S.setDrawRange(0,I.length),S}}function _(){var R=new Image;R.src=u(8);var I=new c.Texture;return I.image=R,I.needsUpdate=!0,I}function w(R,I,S,T,E,L){var F=new d(R,I,S,T,E,L);return F.fontFace=T,F.fontSize=E,F.fontWeight=L,F.material.map.generateMipmaps=!1,F.material.map.anisotropy=4,F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,F.center.set(.5,-1.2),F.renderOrder=1e4,F}function C(R,I,S){if(S){var T=R||"",E=I||"",L=S.lastIndexOf("/");if(-1<L){var F=void 0,x=void 0;if(F=S.substring(0,L),x=S.substring(L+1),(F==="*"||F==="**"||F.toLowerCase()===T.toLowerCase())&&(x==="*"||x==="**"||x.toLowerCase()===E.toLowerCase()))return!0}else if(T.toLowerCase()===S.toLowerCase()||E.toLowerCase()===S.toLowerCase())return!0}return!1}function P(R,I,S){var T=R.getAttribute("position"),E=R.getAttribute("normal");if(T){var L=T.itemSize,F=I*L,x=L,O=!1,B=(N,k)=>{var z=!1,G=Array.from(N.array);if(G.length>=F+x){G.splice(F,x),S&&G.concat(Array(x).fill(0)),z=!0;var Y=new Float32Array(G);R.setAttribute(k,new c.BufferAttribute(Y,L)),R.getAttribute(k).needsUpdate=!0}return z};return O=B(T,"position"),E&&B(E,"normal"),R.index!==null&&console.warn("Removing vertices from indexed geometry requires index buffer recalculation."),O}}l.getBoundingBox=m,l.createNewURL=g,l.createBufferGeometry=A,l.getCircularTexture=_,l.resolveURL=p,l.loadExternalFile=h,l.loadExternalFiles=b,l.PhongToToon=M,l.createNewSpriteText=w,l.isRegionGroup=C,l.removeVertexAtIndex=P},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,d=new c.Object3D,p=new c.Vector3,g=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(v){for(var M,A=new c.Matrix3().getNormalMatrix(v),_=0,w=this.vertices.length;_<w;_++)M=this.vertices[_],M.applyMatrix4(v);for(var C,P=0,R=this.faces.length;P<R;P++){C=this.faces[P],C.normal.applyMatrix3(A).normalize();for(var I=0,S=C.vertexNormals.length;I<S;I++)C.vertexNormals[I].applyMatrix3(A).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(v){return f.makeRotationX(v),this.applyMatrix4(f),this},rotateY:function(v){return f.makeRotationY(v),this.applyMatrix4(f),this},rotateZ:function(v){return f.makeRotationZ(v),this.applyMatrix4(f),this},translate:function(v,M,A){return f.makeTranslation(v,M,A),this.applyMatrix4(f),this},scale:function(v,M,A){return f.makeScale(v,M,A),this.applyMatrix4(f),this},lookAt:function(v){return d.lookAt(v),d.updateMatrix(),this.applyMatrix4(d.matrix),this},fromBufferGeometry:function(v){function M(G,Y,Z,te){var q=R===void 0?[]:[A.colors[G].clone(),A.colors[Y].clone(),A.colors[Z].clone()],W=P===void 0?[]:[new c.Vector3().fromBufferAttribute(P,G),new c.Vector3().fromBufferAttribute(P,Y),new c.Vector3().fromBufferAttribute(P,Z)],$=new b(G,Y,Z,W,q,te);A.faces.push($),I!==void 0&&A.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(I,G),new c.Vector2().fromBufferAttribute(I,Y),new c.Vector2().fromBufferAttribute(I,Z)]),S!==void 0&&A.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(S,G),new c.Vector2().fromBufferAttribute(S,Y),new c.Vector2().fromBufferAttribute(S,Z)])}var A=this,_=v.index===null?void 0:v.index,w=v.attributes;if(w.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var C=w.position,P=w.normal,R=w.color,I=w.uv,S=w.uv2;S!==void 0&&(this.faceVertexUvs[1]=[]);for(var T=0;T<C.count;T++)A.vertices.push(new c.Vector3().fromBufferAttribute(C,T)),R!==void 0&&A.colors.push(new c.Color().fromBufferAttribute(R,T));var E=v.groups;if(0<E.length)for(var L=0;L<E.length;L++)for(var F=E[L],x=F.start,O=F.count,B=x,N=x+O;B<N;B+=3)_===void 0?M(B,B+1,B+2,F.materialIndex):M(_.getX(B),_.getX(B+1),_.getX(B+2),F.materialIndex);else if(_!==void 0)for(var k=0;k<_.count;k+=3)M(_.getX(k),_.getX(k+1),_.getX(k+2));else for(var z=0;z<C.count;z+=3)M(z,z+1,z+2);return this.computeFaceNormals(),v.boundingBox!==null&&(this.boundingBox=v.boundingBox.clone()),v.boundingSphere!==null&&(this.boundingSphere=v.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var v=this.boundingSphere.center,M=this.boundingSphere.radius,A=M===0?1:1/M,_=new c.Matrix4;return _.set(A,0,0,-A*v.x,0,A,0,-A*v.y,0,0,A,-A*v.z,0,0,0,1),this.applyMatrix4(_),this},computeFaceNormals:function(){for(var v=new c.Vector3,M=new c.Vector3,A=0,_=this.faces.length;A<_;A++){var w=this.faces[A],C=this.vertices[w.a],P=this.vertices[w.b],R=this.vertices[w.c];v.subVectors(R,P),M.subVectors(C,P),v.cross(M),v.normalize(),w.normal.copy(v)}},computeVertexNormals:function(){for(var v=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],M=Array(this.vertices.length),A=0,_=this.vertices.length;A<_;A++)M[A]=new c.Vector3;if(v)for(var w=new c.Vector3,C=new c.Vector3,P=0,R=this.faces.length;P<R;P++){var I=this.faces[P],S=this.vertices[I.a],T=this.vertices[I.b],E=this.vertices[I.c];w.subVectors(E,T),C.subVectors(S,T),w.cross(C),M[I.a].add(w),M[I.b].add(w),M[I.c].add(w)}else{this.computeFaceNormals();for(var L,F=0,x=this.faces.length;F<x;F++)L=this.faces[F],M[L.a].add(L.normal),M[L.b].add(L.normal),M[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)M[O].normalize();for(var N=0,k=this.faces.length;N<k;N++){var z=this.faces[N],G=z.vertexNormals;G.length===3?(G[0].copy(M[z.a]),G[1].copy(M[z.b]),G[2].copy(M[z.c])):(G[0]=M[z.a].clone(),G[1]=M[z.b].clone(),G[2]=M[z.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),M},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var v=0,M=this.faces.length;v<M;v++){var A=this.faces[v],_=A.vertexNormals;_.length===3?(_[0].copy(A.normal),_[1].copy(A.normal),_[2].copy(A.normal)):(_[0]=A.normal.clone(),_[1]=A.normal.clone(),_[2]=A.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var v,M=0,A=this.faces.length;M<A;M++){v=this.faces[M],v.__originalFaceNormal?v.__originalFaceNormal.copy(v.normal):v.__originalFaceNormal=v.normal.clone(),v.__originalVertexNormals||(v.__originalVertexNormals=[]);for(var _=0,w=v.vertexNormals.length;_<w;_++)v.__originalVertexNormals[_]?v.__originalVertexNormals[_].copy(v.vertexNormals[_]):v.__originalVertexNormals[_]=v.vertexNormals[_].clone()}var C=new m;C.faces=this.faces;for(var P=0,R=this.morphTargets.length;P<R;P++){if(!this.morphNormals[P]){this.morphNormals[P]={},this.morphNormals[P].faceNormals=[],this.morphNormals[P].vertexNormals=[];for(var I=this.morphNormals[P].faceNormals,S=this.morphNormals[P].vertexNormals,T=0,E=this.faces.length;T<E;T++){var L=new c.Vector3,F={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};I.push(L),S.push(F)}}var x=this.morphNormals[P];C.vertices=this.morphTargets[P].vertices,C.computeFaceNormals();var O=C.computeVertexNormals();if(O&&0<O.length){this.morphTargets[P].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[P].normals[B]=O[B].clone()}for(var N=0,k=this.faces.length;N<k;N++){var z=this.faces[N],G=x.faceNormals[N],Y=x.vertexNormals[N];G.copy(z.normal),Y.a.copy(z.vertexNormals[0]),Y.b.copy(z.vertexNormals[1]),Y.c.copy(z.vertexNormals[2])}}for(var Z,te=0,q=this.faces.length;te<q;te++)Z=this.faces[te],Z.normal=Z.__originalFaceNormal,Z.vertexNormals=Z.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(v,M){var A=this.morphTargets.length,_=this.morphTargets,w=v.morphTargets,C=this.morphColors.length,P=this.morphColors,R=v.morphColors;if(0<A&&A==w.length)for(var I=0,S=_.length;I<S;I++){for(var T=_[I],E=w[I],L=0,F=E.vertices.length;L<F;L++){var x=E.vertices[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),T.vertices.push(O)}if(T.normals&&E.normals)for(var B=0;B<E.normals.length;B+=3)g.set(E.normals2[B],E.normals2[B+1],E.normals2[B+2]),M!==void 0&&g.applyMatrix4(M),T.normals.push(g.x,g.y,g.z)}if(0<C&&C==R.length)for(var N=0,k=P.length;N<k;N++)for(var z=P[N],G=R[N],Y=0,Z=G.colors;Y<Z;Y++)z.colors.push(G.colors[Y].clone())},merge:function(v,M){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(v&&v.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",v);var _,w=this.vertices.length,C=this.vertices,P=v.vertices,R=v.normals,I=this.faces,S=v.faces,T=this.colors,E=v.colors;M!==void 0&&(_=new c.Matrix3().getNormalMatrix(M));for(var L=0,F=P.length;L<F;L++){var x=P[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),C.push(O)}for(var B=0;B<R.length;B+=3)g.set(R[B],R[B+1],R[B+2]),M!==void 0&&g.applyMatrix4(M),this.normals.push(g.x,g.y,g.z);for(var N=0,k=E.length;N<k;N++)typeof E[N]=="number"?T.push(E[N]):T.push(E[N].clone());for(var z=0,G=S.length;z<G;z++){var Y=S[z],Z=void 0,te=void 0,q=Y.vertexNormals,W=Y.vertexColors,$=new b(Y.a+w,Y.b+w,Y.c+w);$.normal.copy(Y.normal),_!==void 0&&$.normal.applyMatrix3(_).normalize();for(var X=0,K=q.length;X<K;X++)Z=q[X].clone(),_!==void 0&&Z.applyMatrix3(_).normalize(),$.vertexNormals.push(Z);$.color.copy(Y.color);for(var re=0,V=W.length;re<V;re++)te=W[re],$.vertexColors.push(te.clone());$.materialIndex=Y.materialIndex+A,I.push($)}for(var j,oe=0,ae=v.faceVertexUvs.length;oe<ae;oe++){j=v.faceVertexUvs[oe],this.faceVertexUvs[oe]===void 0&&(this.faceVertexUvs[oe]=[]);for(var le=0,H=j.length;le<H;le++){for(var U=j[le],D=[],Q=0,ie=U.length;Q<ie;Q++)D.push(U[Q].clone());this.faceVertexUvs[oe].push(D)}}this.mergeMorph(v,M)},mergeMesh:function(v){return v&&v.isMesh?(v.matrixAutoUpdate&&v.updateMatrix(),void this.merge(v.geometry,v.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",v)},mergeVertices:function(){for(var v=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,M={},A=[],_=[],w=Math.pow(10,v),C=0,P=this.vertices.length;C<P;C++){var R=this.vertices[C],I=Math.round(R.x*w)+"_"+Math.round(R.y*w)+"_"+Math.round(R.z*w);M[I]===void 0?(M[I]=C,A.push(this.vertices[C]),_[C]=A.length-1):_[C]=_[M[I]]}for(var S,T=[],E=0,L=this.faces.length;E<L;E++){S=this.faces[E],S.a=_[S.a],S.b=_[S.b],S.c=_[S.c];for(var F=[S.a,S.b,S.c],x=0;3>x;x++)if(F[x]===F[(x+1)%3]){T.push(E);break}}for(var O,B=T.length-1;0<=B;B--){O=T[B],this.faces.splice(O,1);for(var N=0,k=this.faceVertexUvs.length;N<k;N++)this.faceVertexUvs[N].splice(O,1)}var z=this.vertices.length-A.length;return this.vertices=A,z},setFromPoints:function(v){this.vertices=[];for(var M,A=0,_=v.length;A<_;A++)M=v[A],this.vertices.push(new c.Vector3(M.x,M.y,M.z||0));return this},sortFacesByMaterialIndex:function(){for(var v=this.faces,M=v.length,A=0;A<M;A++)v[A]._id=A;v.sort(function(S,T){return S.materialIndex-T.materialIndex});var _,w,C=this.faceVertexUvs[0],P=this.faceVertexUvs[1];C&&C.length===M&&(_=[]),P&&P.length===M&&(w=[]);for(var R,I=0;I<M;I++)R=v[I]._id,_&&_.push(C[R]),w&&w.push(P[R]);_&&(this.faceVertexUvs[0]=_),w&&(this.faceVertexUvs[1]=w)},toJSON:function(){function v(V,j,oe){return oe?V|1<<j:V&~(1<<j)}function M(V){var j=V.x.toString()+V.y.toString()+V.z.toString();return L[j]===void 0&&(L[j]=E.length/3,E.push(V.x,V.y,V.z)),L[j]}function A(V){var j=V.r.toString()+V.g.toString()+V.b.toString();return x[j]===void 0&&(x[j]=F.length,F.push(V.getHex())),x[j]}function _(V){var j=V.x.toString()+V.y.toString();return B[j]===void 0&&(B[j]=O.length/2,O.push(V.x,V.y)),B[j]}var w={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(w.uuid=this.uuid,w.type=this.type,this.name!==""&&(w.name=this.name),this.parameters!==void 0){var C=this.parameters;for(var P in C)C[P]!==void 0&&(w[P]=C[P]);return w}for(var R,I=[],S=0;S<this.vertices.length;S++)R=this.vertices[S],I.push(R.x,R.y,R.z);for(var T=[],E=[],L={},F=[],x={},O=[],B={},N=0;N<this.faces.length;N++){var k=this.faces[N],z=!0,G=!1,Y=this.faceVertexUvs[0][N]!==void 0,Z=0<k.normal.length(),te=0<k.vertexNormals.length,q=k.color.r!==1||k.color.g!==1||k.color.b!==1,W=0<k.vertexColors.length,$=0;if($=v($,0,0),$=v($,1,z),$=v($,2,G),$=v($,3,Y),$=v($,4,Z),$=v($,5,te),$=v($,6,q),$=v($,7,W),T.push($),T.push(k.a,k.b,k.c),T.push(k.materialIndex),Y){var X=this.faceVertexUvs[0][N];T.push(_(X[0]),_(X[1]),_(X[2]))}if(Z&&T.push(M(k.normal)),te){var K=k.vertexNormals;T.push(M(K[0]),M(K[1]),M(K[2]))}if(q&&T.push(A(k.color)),W){var re=k.vertexColors;T.push(A(re[0]),A(re[1]),A(re[2]))}}return w.data={},w.data.vertices=I,w.data.normals=E,0<F.length&&(w.data.colors=F),0<O.length&&(w.data.uvs=[O]),w.data.faces=T,w},clone:function(){return new m().copy(this)},copy:function(v){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=v.name;for(var M=v.vertices,A=0,_=M.length;A<_;A++)this.vertices.push(M[A].clone());for(var w=v.colors,C=0,P=w.length;C<P;C++)this.colors.push(w[C].clone());for(var R=v.faces,I=0,S=R.length;I<S;I++)this.faces.push(R[I].clone());for(var T,E=0,L=v.faceVertexUvs.length;E<L;E++){T=v.faceVertexUvs[E],this.faceVertexUvs[E]===void 0&&(this.faceVertexUvs[E]=[]);for(var F=0,x=T.length;F<x;F++){for(var O,B=T[F],N=[],k=0,z=B.length;k<z;k++)O=B[k],N.push(O.clone());this.faceVertexUvs[E].push(N)}}for(var G,Y=v.morphTargets,Z=0,te=Y.length;Z<te;Z++){if(G={},G.name=Y[Z].name,Y[Z].vertices!==void 0){G.vertices=[];for(var q=0,W=Y[Z].vertices.length;q<W;q++)G.vertices.push(Y[Z].vertices[q].clone())}if(Y[Z].normals!==void 0){G.normals=[];for(var $=0,X=Y[Z].normals.length;$<X;$++)G.normals.push(Y[Z].normals[$].clone())}this.morphTargets.push(G)}for(var K,re=v.morphNormals,V=0,j=re.length;V<j;V++){if(K={},re[V].vertexNormals!==void 0){K.vertexNormals=[];for(var oe=0,ae=re[V].vertexNormals.length;oe<ae;oe++){var le=re[V].vertexNormals[oe],H={};H.a=le.a.clone(),H.b=le.b.clone(),H.c=le.c.clone(),K.vertexNormals.push(H)}}if(re[V].faceNormals!==void 0){K.faceNormals=[];for(var U=0,D=re[V].faceNormals.length;U<D;U++)K.faceNormals.push(re[V].faceNormals[U].clone())}this.morphNormals.push(K)}for(var Q=v.skinWeights,ie=0,ce=Q.length;ie<ce;ie++)this.skinWeights.push(Q[ie].clone());for(var ge=v.skinIndices,ye=0,ue=ge.length;ye<ue;ye++)this.skinIndices.push(ge[ye].clone());for(var be=v.lineDistances,ne=0,de=be.length;ne<de;ne++)this.lineDistances.push(be[ne]);var ve=v.boundingBox;ve!==null&&(this.boundingBox=ve.clone());var Ee=v.boundingSphere;return Ee!==null&&(this.boundingSphere=Ee.clone()),this.elementsNeedUpdate=v.elementsNeedUpdate,this.verticesNeedUpdate=v.verticesNeedUpdate,this.uvsNeedUpdate=v.uvsNeedUpdate,this.normalsNeedUpdate=v.normalsNeedUpdate,this.colorsNeedUpdate=v.colorsNeedUpdate,this.lineDistancesNeedUpdate=v.lineDistancesNeedUpdate,this.groupsNeedUpdate=v.groupsNeedUpdate,this},computeGroups(){var y,v,M=[],A=void 0,_=this.faces;for(v=0;v<_.length;v++){var w=_[v];w.materialIndex!==A&&(A=w.materialIndex,y!==void 0&&(y.count=3*v-y.start,M.push(y)),y={start:3*v,materialIndex:A})}return y!==void 0&&(y.count=3*v-y.start,M.push(y)),M},toBufferGeometry:function(){var v=new h().fromGeometry(this),M=new c.BufferGeometry,A=new Float32Array(3*v.vertices.length);if(M.setAttribute("position",new c.BufferAttribute(A,3).copyVector3sArray(v.vertices)),0<v.normals.length){var _=new Float32Array(3*v.normals.length);M.setAttribute("normal",new c.BufferAttribute(_,3).copyVector3sArray(v.normals))}if(0<v.colors.length){var w=new Float32Array(3*v.colors.length);M.setAttribute("color",new c.BufferAttribute(w,3).copyColorsArray(v.colors))}if(0<v.uvs.length){var C=new Float32Array(2*v.uvs.length);M.setAttribute("uv",new c.BufferAttribute(C,2).copyVector2sArray(v.uvs))}if(0<v.uvs2.length){var P=new Float32Array(2*v.uvs2.length);M.setAttribute("uv2",new c.BufferAttribute(P,2).copyVector2sArray(v.uvs2))}for(var R in M.groups=v.groups,v.morphTargets){for(var I=[],S=v.morphTargets[R],T=0,E=S.length;T<E;T++){var L=S[T],F=new c.Float32BufferAttribute(3*L.data.length,3);F.name=L.name,I.push(F.copyVector3sArray(L.data))}M.morphAttributes[R]=I}if(0<v.skinIndices.length){var x=new c.Float32BufferAttribute(4*v.skinIndices.length,4);M.setAttribute("skinIndex",x.copyVector4sArray(v.skinIndices))}if(0<v.skinWeights.length){var O=new c.Float32BufferAttribute(4*v.skinWeights.length,4);M.setAttribute("skinWeight",O.copyVector4sArray(v.skinWeights))}return v.boundingSphere!==null&&(M.boundingSphere=v.boundingSphere.clone()),v.boundingBox!==null&&(M.boundingBox=v.boundingBox.clone()),M},toIndexedBufferGeometry:function(){var v=new c.BufferGeometry,M=new Float32Array(3*this.vertices.length);if(v.setAttribute("position",new c.BufferAttribute(M,3).copyVector3sArray(this.vertices)),0<this.normals.length){var A=new Float32Array(this.normals.length),_=new c.BufferAttribute(A,3).copyArray(this.normals);v.setAttribute("normal",_)}if(0<this.uvs.length&&0<this.uvs[0].length){var w=new Float32Array(2*this.uvs[0].length);v.setAttribute("uv",new c.BufferAttribute(w,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var C=new Float32Array(2*this.uvs[1].length);v.setAttribute("uv2",new c.BufferAttribute(C,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var P=[],R=0;R<this.colors.length;R++)P.push(new c.Color(this.colors[R]));var I=new Float32Array(3*P.length);v.setAttribute("color",new c.BufferAttribute(I,3).copyColorsArray(P))}else{for(var S=new Float32Array(3*this.vertices.length),T=0;T<3*this.vertices.length;T++)S[T]=1;v.setAttribute("color",new c.BufferAttribute(S,3))}if(0<this.faces.length){for(var E=[],L=[],F=0;F<this.faces.length;F++){L.push(this.faces[F].a,this.faces[F].b,this.faces[F].c);var x=this.faces[F].vertexColors;if(x.length===3)E.push(x[0],x[1],x[2]);else{var O=this.faces[F].color;E.push(O,O,O)}}v.setIndex(L),v.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],N=[],k=0,z=this.morphTargets.length;k<z;k++){var G=this.morphTargets[k],Y=new c.Float32BufferAttribute(3*G.vertices.length,3);if(Y.name=G.name,B.push(Y.copyVector3sArray(G.vertices)),G.normals){var Z=new c.Float32BufferAttribute(3*G.normals.length,3);Z.name=G.name,N.push(Z.copyVector3sArray(G.normals))}}v.morphAttributes.position=B,v.morphAttributes.normal=N}if(0<this.skinIndices.length){var te=new c.Float32BufferAttribute(4*this.skinIndices.length,4);v.setAttribute("skinIndex",te.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var q=new c.Float32BufferAttribute(4*this.skinWeights.length,4);v.setAttribute("skinWeight",q.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(v.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(v.boundingBox=this.boundingBox.clone()),v},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(v){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(v)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(y){var v=new c.BufferGeometry,M=y.geometry;if(y.isPoints||y.isLine){var A=new c.Float32BufferAttribute(3*M.vertices.length,3),_=new c.Float32BufferAttribute(3*M.colors.length,3);if(v.setAttribute("position",A.copyVector3sArray(M.vertices)),v.setAttribute("color",_.copyColorsArray(M.colors)),M.lineDistances&&M.lineDistances.length===M.vertices.length){var w=new c.Float32BufferAttribute(M.lineDistances.length,1);v.setAttribute("lineDistance",w.copyArray(M.lineDistances))}M.boundingSphere!==null&&(v.boundingSphere=M.boundingSphere.clone()),M.boundingBox!==null&&(v.boundingBox=M.boundingBox.clone())}else y.isMesh&&(v=M.toBufferGeometry());return v};class h{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(v){var M,A,_=[],w=void 0,C=v.faces;for(A=0;A<C.length;A++){var P=C[A];P.materialIndex!==w&&(w=P.materialIndex,M!==void 0&&(M.count=3*A-M.start,_.push(M)),M={start:3*A,materialIndex:w})}M!==void 0&&(M.count=3*A-M.start,_.push(M)),this.groups=_}fromGeometry(v){var M,A=v.faces,_=v.vertices,w=v.faceVertexUvs,C=w[0]&&0<w[0].length,P=w[1]&&0<w[1].length,R=v.morphTargets,I=R.length;if(0<I){M=[];for(var S=0;S<I;S++)M[S]={name:R[S].name,data:[]};this.morphTargets.position=M}var T,E=v.morphNormals,L=E.length;if(0<L){T=[];for(var F=0;F<L;F++)T[F]={name:E[F].name,data:[]};this.morphTargets.normal=T}var x=v.skinIndices,O=v.skinWeights,B=x.length===_.length,N=O.length===_.length;0<_.length&&A.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,z=0;z<A.length;z++){k=A[z],this.vertices.push(_[k.a],_[k.b],_[k.c]);var G=k.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var Y=k.normal;this.normals.push(Y,Y,Y)}var Z=k.vertexColors;if(Z.length===3)this.colors.push(Z[0],Z[1],Z[2]);else{var te=k.color;this.colors.push(te,te,te)}if(C===!0){var q=w[0][z];q===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",z),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(q[0],q[1],q[2])}if(P===!0){var W=w[1][z];W===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",z),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(W[0],W[1],W[2])}for(var $,X=0;X<I;X++)$=R[X].vertices,M[X].data.push($[k.a],$[k.b],$[k.c]);for(var K,re=0;re<L;re++)K=E[re].vertexNormals[z],T[re].data.push(K.a,K.b,K.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),N&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(v),this.verticesNeedUpdate=v.verticesNeedUpdate,this.normalsNeedUpdate=v.normalsNeedUpdate,this.colorsNeedUpdate=v.colorsNeedUpdate,this.uvsNeedUpdate=v.uvsNeedUpdate,this.groupsNeedUpdate=v.groupsNeedUpdate,v.boundingSphere!==null&&(this.boundingSphere=v.boundingSphere.clone()),v.boundingBox!==null&&(this.boundingBox=v.boundingBox.clone()),this}}class b{constructor(v,M,A,_,w){var C=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=v,this.b=M,this.c=A,this.normal=_&&_.isVector3?_:new c.Vector3,this.vertexNormals=Array.isArray(_)?_:[],this.color=w&&w.isColor?w:new c.Color,this.vertexColors=Array.isArray(w)?w:[],this.materialIndex=C}clone(){return new this.constructor().copy(this)}copy(v){this.a=v.a,this.b=v.b,this.c=v.c,this.normal.copy(v.normal),this.color.copy(v.color),this.materialIndex=v.materialIndex;for(var M=0,A=v.vertexNormals.length;M<A;M++)this.vertexNormals[M]=v.vertexNormals[M].clone();for(var _=0,w=v.vertexColors.length;_<w;_++)this.vertexColors[_]=v.vertexColors[_].clone();return this}}},o=>{o.exports=QB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3183
3183
  `)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
3184
- `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,d=u(5).removeVertexAtIndex,p=u(5).resolveURL,g=0,m=function(){return"pr"+g++},h=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=m(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};h.prototype.setDuration=function(b){this.duration=b,this.clipAction&&this.clipAction.setDuration(this.duration)},h.prototype.getDuration=function(){return this.duration},h.prototype.setRegion=function(b){this.region=b},h.prototype.getRegion=function(){return this.region},h.prototype.getMorph=function(){var b=this._lod.getCurrentMorph();return b||this.morph},h.prototype.getGroup=function(){return this.group},h.prototype.setMorph=function(b){this.morph=b,this.group.add(this.morph);var y=this._lod.calculateDistance("far");this._lod.addLevel(b,y),this._lod.setMaterial(b.material)},h.prototype.checkTransparentMesh=function(){},h.prototype.setMesh=function(b,y,v){this.animationGroup=new c.AnimationObjectGroup(b),this.mixer=new c.AnimationMixer(this.animationGroup);var M=b.geometry;if(this.geometry=b.geometry,this.clipAction=void 0,M&&M.morphAttributes){var A=M.morphAttributes.position;A||(A=M.morphAttributes.color?M.morphAttributes.color:M.morphAttributes.normal),A&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(A,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=y,this.morphColour=v,b.userData=this,b.matrixAutoUpdate=!1,this.setMorph(b),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(M.setAttribute("morphTarget0",M.getAttribute("position")),M.setAttribute("morphTarget1",M.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},h.prototype.setIsPickable=function(b){this.isPickable!==b&&(this.isPickable=b,this.region&&(this.region.pickableUpdateRequired=!0))},h.prototype.setAnatomicalId=function(b){this.anatomicalId=b},h.prototype.setName=function(b){this.groupName=b,this._lod.setName(b)},h.prototype.getCurrentTime=function(){if(this.clipAction){var b=this.clipAction.time/this.clipAction._clip.duration;return this.duration*b}return this.inbuildTime},h.prototype.setMorphTime=function(b){var y=!1;if(this.clipAction){var v=b/this.duration,M=this.clipAction._clip.duration,A=v*M;A!=this.clipAction.time&&(this.clipAction.time=A,y=!0),y&&this.isTimeVarying()&&this.mixer.update(0)}else{var _=b;_=b>this.duration?this.duration:0>b?0:b,_!=this.inbuildTime&&(this.inbuildTime=_,y=!0)}y&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},h.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},h.prototype.getVisibility=function(){return this.visible},h.prototype.setVisibility=function(b){b!==this.visible&&(this.visible=b,this.group.visible=b,this.region&&(this.region.pickableUpdateRequired=!0))},h.prototype.setAlpha=function(b){var y=this._lod._material,v=!1;1>b&&(v=!0),y.opacity=b,y.transparent=v,this.checkTransparentMesh()},h.prototype.setFrustumCulled=function(b){this._lod.setFrustumCulled(b)},h.prototype.setVertexColors=function(b){this._lod.setVertexColors(b)},h.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},h.prototype.setColour=function(b){this._lod.setColour(b)},h.prototype.setGreyScale=function(b){if(b){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},h.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},h.prototype.setColourHex=function(b){this._lod._material.color.setHex(b),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(b)},h.prototype.setEmissiveRGB=function(b){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...b),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...b)},h.prototype.setMaterial=function(b){this._lod.setMaterial(b)},h.prototype.getClosestVertexIndex=function(){var b=-1,y=this.getMorph();if(y&&y.geometry){var v=y.geometry.attributes.position;if(v){this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1);for(var M=-1,A=0,_=0;_<v.count;_++)this._v2.fromArray(v.array,3*_),A=this._v2.distanceTo(this._v1),M==-1?M=A:M>A&&(M=A,b=_)}}return b},h.prototype.getClosestVertex=function(b){var y=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var M=v.morphTargetInfluences,A=v.geometry.morphAttributes;if(M&&A&&A.position){for(var _=!1,w=0;w<M.length;w++)0<M[w]&&(_=!0,this._v1.fromArray(A.position[w].array,3*this.closestVertexIndex),y.add(this._v1.multiplyScalar(M[w])));if(_)return b?y.applyMatrix4(v.matrixWorld):y}else return y.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),b?y.applyMatrix4(v.matrixWorld):y}return this.getBoundingBox(),y.copy(this.center),y},h.prototype.getBoundingBox=function(){if(this.visible){var b=this._lod.getCurrentMorph();if(b&&b.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(b,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},h.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},h.prototype.markerIsRequired=function(b){return!!(this.visible&&(this.markerMode==="on"||b&&b.displayMarkers&&this.markerMode==="inherited"))},h.prototype.updateMarker=function(b,y){if(b==!1&&this.markerIsRequired(y)){var v=y.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var M=this.getClosestVertex(!1);M&&(this.marker.setPosition(M.x,M.y,M.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(y.markersList&&!(this.marker.uuid in y.markersList)&&(v=!0,y.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),y&&y.camera&&(v||y.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(y.camera.cameraObject),y.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),y.markersList&&this.marker.uuid in y.markersList&&(y.markerCluster.markerUpdateRequired=!0,delete y.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},h.prototype.processMarkerVisual=function(b,y){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(b,y)},h.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},h.prototype.setRenderOrder=function(b){this._lod.setRenderOrder(b)},h.prototype.getClosestVertexDOMElementCoords=function(b){if(b&&b.camera){var y=!0,v=this.getClosestVertex(!0);return v.project(b.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(y=!1),b.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:y}}},h.prototype.setMarkerMode=function(b,y){b!==this.markerMode&&(this.markerMode=b==="on"||b==="off"?b:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),y&&(this.markerNumber=y.number,this.markerImgURL=y.imgURL)},h.prototype.render=function(b,y,v,M){if(this.visible&&!(this.timeEnabled&&y)&&this._lod.update(v,this.center),y==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(b);else{var A=this.inbuildTime+b;A>this.duration&&(A-=this.duration),this.inbuildTime=A}this.visible&&b!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(y,M)},h.prototype.addLOD=function(b,y,v,M,A){this._lod.addLevelFromURL(b,y,v,M,A)},h.prototype.addVertices=function(b){var y=this.getMorph(),v=void 0;if(!y)v=f(500,b),this.drawRange=b.length;else if(-1<this.drawRange){var M=y.geometry.getAttribute("position");b.forEach(A=>{M.setXYZ(this.drawRange,A[0],A[1],A[2]),++this.drawRange}),M.needsUpdate=!0,y.geometry.setDrawRange(0,this.drawRange),y.geometry.computeBoundingBox(),y.geometry.computeBoundingSphere(),v=y.geoemtry,this.boundingBoxUpdateRequired=!0}return v},h.prototype.deleteVertices=function(b){var y=this.getMorph();return!!(y!=null&&y.geometry&&this.drawRange>=b&&d(y.geometry,b,!0))&&(--this.drawRange,y.geometry.setDrawRange(0,this.drawRange),y.geometry.computeBoundingBox(),y.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0,!0)},h.prototype.setPosition=function(b,y,v){var M=this.getGroup();M&&(M.position.set(b,y,v),M.matrixWorldNeedsUpdate=!0,M.updateMatrix(),M.updateWorldMatrix(!0,!0),this.boundingBoxUpdateRequired=!0)},h.prototype.loadAdditionalSources=function(b){b.load(p(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},h.prototype.setScaleAll=function(b){var y=this.getGroup();y&&(y.scale.set(b,b,b),y.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=h},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,d=u(5).toBufferGeometry,p=function(g){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=g,this.addLevel=(h,b)=>{if(h){var y,v=Math.abs(b);for(y=0;y<this.levels.length&&!(v<this.levels[y].distance);y++);this.levels.splice(y,0,{distance:v,morph:h,loaded:!0,loading:!1,url:""}),h.renderOrder=this._renderOrder}},this.levelLoaded=(h,b)=>{if(h){for(var y=Math.abs(b),v=0;v<this.levels.length;v++)if(y===this.levels[v].distance){this._parent.group.add(h),this.levels[v].morph=h,this.levels[v].loaded=!0,this.levels[v].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(h,b,y,v,M)=>{this._loader=h;var A,_=this.calculateDistance(b);for(A=0;A<this.levels.length&&!(_<this.levels[A].distance);A++);this.levels.splice(A,0,{distance:_,morph:void 0,loaded:!1,loading:!1,url:y,index:v}),M&&this.loadLevel(A)},this.loadLevel=h=>{var b=this.levels[h];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(h){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return h==="far"?y=4.5*b:h==="medium"?y=2.5*b:h=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var h=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!h.secondaryMesh&&(h.secondaryMesh=new c.Mesh(h.morph.geometry,this._secondaryMaterial),h.secondaryMesh.renderOrder=h.morph.renderOrder+1,h.secondaryMesh.userData=h.morph.userData,h.secondaryMesh.name=h.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!h.secondaryMesh.parent&&(h.morph.add(h.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(h.secondaryMesh))):(h.secondaryMesh&&(h.morph.remove(h.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(h.secondaryMesh),this._parent.animationGroup.remove(h.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&h.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var h=this.levels[this._currentLevel];return h&&h.morph?h.morph:this._parent.morph},this.lodLoader=function(h){return b=>{var y=this._material,v={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},M=d(b,v),A=void 0;this._parent.isGeometry?A=new c.Mesh(M,y):this._parent.isLines&&(A=new(u(12)).LineSegments(M,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,h)}},this.updateMorphColorAttribute=h=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(h){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=h=>{this._material.color=h,this._secondaryMaterial&&(this._secondaryMaterial.color=h),m()},this.setFrustumCulled=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=h),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=h)})},this.setMaterial=h=>{h&&(!this._material||this._material.id!==h.id)&&(this._material=h,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=h.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=h),b.secondaryMesh&&(b.secondaryMesh.name=h)})},this.setRenderOrder=h=>{this._renderOrder=h,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=h),b.secondaryMesh&&(b.secondaryMesh.renderOrder=h)})},this.setVertexColors=h=>{this._material.vertexColors=h,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=h)},this.update=(h,b)=>{var y=this.levels;if(1<y.length){var v,M,A=h.cameraObject.position.distanceTo(b),_=-1,w=-1;for(v=0,M=y.length;v<M&&A>=y[v].distance;v++)y[v].morph?(-1<_&&y[_].morph&&(y[_].morph.visible=!1),_=v,y[v].morph.visible=!0,w=-1):w=v;for(-1<w&&this.loadLevel(w);v<M;v++)y[v].morph&&(-1<_?y[v].morph.visible=!1:(y[v].morph.visible=!0,_=v));this._currentLevel!=_&&(this._currentLevel=_,this.checkTransparentMesh())}},this.toggleMarker=(h,b)=>{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(h):y.morph.remove(h))})};var m=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&(h.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>g});var c=u(13),f=u(4),d=new f.Vector3,p=new f.Vector3;class g extends c.Line{constructor(h,b){super(h,b),this.type="LineSegments"}computeLineDistances(){var h=this.geometry;if(!h.isBufferGeometry)h.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(h.index===null){for(var b=h.attributes.position,y=[],v=0,M=b.count;v<M;v+=2)d.fromBufferAttribute(b,v),p.fromBufferAttribute(b,v+1),y[v]=v==0?0:y[v-1],y[v+1]=y[v]+d.distanceTo(p);h.setAttribute("lineDistance",new f.Float32BufferAttribute(y,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}g.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>M});var c=u(4),f=new c.Vector3,d=new c.Vector3,p=new c.Matrix4,g=new c.Ray,m=new c.Sphere,h=new c.Vector3,b=new c.Vector3,y=new c.Vector3,v=new c.Vector3;class M extends c.Object3D{constructor(){var w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,C=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=w,this.material=C,this.updateMorphTargets()}copy(w){return super.copy(w),this.material=w.material,this.geometry=w.geometry,this}computeLineDistances(){var w=this.geometry;if(!w.isBufferGeometry)w.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(w.index===null){for(var C=w.attributes.position,P=[0],R=1,I=C.count;R<I;R++)f.fromBufferAttribute(C,R-1),d.fromBufferAttribute(C,R),P[R]=P[R-1],P[R]+=f.distanceTo(d);w.setAttribute("lineDistance",new c.Float32BufferAttribute(P,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(w,C){var P=this.geometry,R=this.matrixWorld,I=w.params.Line.threshold,S=P.drawRange,T=P.morphAttributes.position;if(P.boundingSphere===null&&P.computeBoundingSphere(),m.copy(P.boundingSphere),m.applyMatrix4(R),m.radius+=I,w.ray.intersectsSphere(m)!==!1){p.copy(R).invert(),g.copy(w.ray).applyMatrix4(p);var E=I/((this.scale.x+this.scale.y+this.scale.z)/3),L=E*E,F=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,N=this.isLineSegments?2:1;if(P.isBufferGeometry){var k=P.index,z=P.attributes,G=z.position;if(k!==null)for(var Y=Math.max(0,S.start),Z=Math.min(k.count,S.start+S.count),te=Y;te<Z-1;te+=N){var q=k.getX(te),j=k.getX(te+1);A(F,x,this,G,T,q,j);var $=g.distanceSqToSegment(F,x,B,O);if(!($>L)){B.applyMatrix4(this.matrixWorld);var X=w.ray.origin.distanceTo(B);X<w.near||X>w.far||C.push({distance:X,point:O.clone().applyMatrix4(this.matrixWorld),index:te,face:null,faceIndex:null,object:this})}}else for(var K=Math.max(0,S.start),re=Math.min(G.count,S.start+S.count),V=K;V<re-1;V+=N){A(F,x,this,G,T,V,V+1);var W=g.distanceSqToSegment(F,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var oe=w.ray.origin.distanceTo(B);oe<w.near||oe>w.far||C.push({distance:oe,point:O.clone().applyMatrix4(this.matrixWorld),index:V,face:null,faceIndex:null,object:this})}}}else P.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var w=this.geometry;if(w.isBufferGeometry){var C=w.morphAttributes,P=Object.keys(C);if(0<P.length){var R=C[P[0]];if(R!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var I,S=0,T=R.length;S<T;S++)I=R[S].name||S+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[I]=S}}}else{var E=w.morphTargets;E!==void 0&&0<E.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function A(_,w,C,P,R,I,S){_.fromBufferAttribute(P,I),w.fromBufferAttribute(P,S);var T=C.morphTargetInfluences;if(C.material.morphTargets&&R&&T){h.set(0,0,0),b.set(0,0,0);for(var E=0,L=R.length;E<L;E++){var F=T[E],x=R[E];F!==0&&(y.fromBufferAttribute(x,I),v.fromBufferAttribute(x,S),h.addScaledVector(y.sub(_),F),b.addScaledVector(v.sub(w),F))}_.add(h),w.add(b)}}M.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var d=new c.Texture;d.image=f,d.needsUpdate=!0;var p=[.02,.03,1],g=new c.SpriteMaterial({map:d,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,h=function(b){u(10).ZincObject.call(this),this.texture=d;var y=void 0,v=void 0,M=void 0,A=void 0,_=void 0,w=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var C=!1;this.ndc=new c.Vector3;var P=void 0,R=void 0,I=()=>{y=new c.Sprite(g),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(S,T)=>{var E=1,L=0;S!==T&&(L=1-(this.ndc.z-S)/(T-S),E=.6+.4*L),this.setSpriteSize(E)},this.updateNDC=S=>(this.ndc.copy(this.morph.position),this.ndc.project(S),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(S,T,E)=>{this.morph.position.set(S,T,E)},this.setSpriteSize=S=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(S)},this.setUserSprite=()=>{A&&(this.morph.add(A),w&&(this.morph.remove(y),R&&this.morph.remove(R),w=!1))},this.setImageForUserSprite=(S,T)=>{A&&(this.morph.remove(A),A=void 0),v&&v.dispose(),M&&M.dispose(),v=new c.Texture,v.image=S,v.needsUpdate=!0,M=new c.SpriteMaterial({map:v,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),T||(T=[.05,.05,1]),A=new c.Sprite(M),A.center.set(.5,0),A.scale.set(T[0],T[1],T[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{w||(w=!0,this.morph.add(y),A&&this.morph.remove(A),R&&this.morph.add(R))},this.loadUserSprite=(S,T)=>{if(S)if(S!==_){_=S;var E=new Image(128,128);E.crossOrigin="anonymous",E.onload=()=>{this.setImageForUserSprite(E,T)},E.src=S}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),R&&(R.material.map.dispose(),R.material.dispose(),R=void 0)},this.isEnabled=()=>C,this.setNumber=S=>{(!S||P!=S)&&R&&(this.morph.remove(R),R.material.map.dispose(),R.material.dispose(),R=void 0),!R&&S&&(R=m(S,.012,"black","Asap",120,700),this.morph.add(R)),P=S},this.getNumber=()=>P||1,this.setVisibility=function(S){S!==this.visible&&(this.visible=S,this.group.visible=S,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{C=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{C=!1,this.morph.visible=!1,this.visible=!1},I()};h.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=h},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(d,p,g,m){u(10).ZincObject.call(this);var h;p&&(h=p.clone(),h.vertexColors=c.FaceColors),this.id=g;var b=void 0,y=void 0;this.isGlyph=!0;var v=[0,0,0];this.fromMesh=M=>!!(M&&M.isMesh)&&(this.morph=M.clone(),this.morph.userData=this,this.group.add(this.morph),!0),d&&h&&this.fromMesh(new c.Mesh(d,h)),this.getGlyphset=function(){return m},this.setLabel=M=>{M&&(typeof M=="string"||M instanceof String)&&(y=M,this.morph&&(this.morph.name=M))},this.showLabel=M=>{b&&(v=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,M),b.setPosition(v[0],v[1],v[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(v=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(M,A,_,w)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=_[0],this.morph.matrix.elements[5]=_[1],this.morph.matrix.elements[6]=_[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=w[0],this.morph.matrix.elements[9]=w[1],this.morph.matrix.elements[10]=w[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=M[0],this.morph.matrix.elements[13]=M[1],this.morph.matrix.elements[14]=M[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),v=[...M],b&&b.setPosition(M[0],M[1],M[2])},this.setColour=M=>{b&&b.setColour(M),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,d){var p=f,g=void 0,m=500;g=d?new c(p,.012,d.getStyle()):new c(p,.012),g.fontFace="Asap",g.fontWeight=m,g.material.map.generateMipmaps=!1,g.material.sizeAttenuation=!1,g.center.x=-.05,g.center.y=0;var h=[g.scale.x,g.scale.y];this.getPosition=()=>g?[g.position.x,g.position.y,g.position.z]:[0,0,0],this.setPosition=(b,y,v)=>{g&&g.position.set(b,y,v)},this.setColour=b=>{b&&(g.color=b.getStyle())},this.setScale=b=>{g&&0<b&&g.scale.set(b,b,1)},this.setDepthTest=b=>{b&&b!==g.material.depthTest&&(g.material.depthTest=b)},this.setSize=b=>{0<b&&(g.scale.x=h[0]*b,g.scale.y=h[1]*b)},this.setFontWeight=b=>{b&&b!==m&&(g.fontWeight=b,m=b)},this.setText=b=>{b&&b!==g.text&&(g.text=b,p=b)},this.setVisibility=b=>{g.visible=b},this.dispose=()=>{},this.getSprite=()=>g,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,d=function(){u(10).ZincObject.call(this);var p=[],g=void 0,m=void 0,h=void 0,b=void 0,y=void 0,v=void 0,M=void 0,A=0,_=0,w=[0,0,0],C=[0,0,0],P=[0,0,0],R="NONE";this.ready=!1;var I=!1,S=!1;this.isGlyphset=!0;var T=new c.Matrix4,E=new c.Color,L=new c.Color,F=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],N=[],k=[],z=[],G=[],Y=[],Z=[];this.globalScale=1;for(var te=0;8>te;te++)new c.Vector3;this.load=(V,W,oe,ae,le)=>{g=V.axis1,m=V.axis2,h=V.axis3,b=V.positions,y=V.scale,v=V.colors,M=V.label,I=V.metadata.MorphColours,S=V.metadata.MorphVertices,A=V.metadata.number_of_time_steps,R=V.metadata.repeat_mode,_=V.metadata.number_of_vertices,R=="AXES_2D"||R=="MIRROR"?_*=2:R=="AXES_3D"&&(_*=3),w=V.metadata.base_size,C=V.metadata.offset,P=V.metadata.scale_factors;var H=new f;this.geometry=new c.BufferGeometry;var U=new c.InstancedMesh(this.geometry,void 0,_);if(this.setMorph(U),ae){var D=H.parse(W);re(oe,le)(D.geometry,D.materials),D.geometry.dispose()}else H.crossOrigin="Anonymous",H.load(W,re(oe,le))};var q=(V,W,oe,ae,le,H)=>{if(R=="NONE"||R=="MIRROR"){for(var U,D=[0,0,0],Q=[0,0,0],ie=[0,0,0],ce=[0,0,0],ge=[0,0,0],ye=[0,0,0],ue=[0,0,0],be=[0,0,0],ne=[0,0,0],de=0;3>de;de++)U=0>le[de]?-1:1,D[de]=(U*w[de]+le[de]*P[de])*this.globalScale;for(var de=0;3>de;de++)Q[de]=W[de]*D[0],ie[de]=oe[de]*D[1],ce[de]=ae[de]*D[2],ge[de]=V[de]+C[0]*Q[de]+C[1]*ie[de]+C[2]*ce[de],R=="MIRROR"&&(ye[de]=-Q[de],ue[de]=-ie[de],be[de]=-ce[de],ne[de]=ge[de],0>le[0]&&(ge[de]-=Q[de],ne[de]-=ye[de]));0>ce[0]*(Q[1]*ie[2]-Q[2]*ie[1])+ce[1]*(Q[2]*ie[0]-Q[0]*ie[2])+ce[2]*(Q[0]*ie[1]-Q[1]*ie[0])&&(ce[0]=-ce[0],ce[1]=-ce[1],ce[2]=-ce[2]),H[0]=[ge,Q,ie,ce],R=="MIRROR"&&(0>be[0]*(ye[1]*ue[2]-ye[2]*ue[1])+be[1]*(ye[2]*ue[0]-ye[0]*ue[2])+be[2]*(ye[0]*ue[1]-ye[1]*ue[0])&&(be[0]=-be[0],be[1]=-be[1],be[2]=-be[2]),H[1]=[ne,ye,ue,be])}else if(R=="AXES_2D"||R=="AXES_3D"){for(var U,ve=[0,0,0],Ee=[0,0,0],de=0;3>de;de++)U=0>le[de]?-1:1,ve[de]=(U*w[0]+le[de]*P[0])*this.globalScale;for(var de=0;3>de;de++)Ee[de]=V[de]+C[0]*ve[0]*W[de]+C[1]*ve[1]*oe[de]+C[2]*ve[2]*ae[de];for(var Se=glyph_repeat_mode=="AXES_2D"?2:3,Ie=0;Ie<Se;Ie++){var Je=void 0,Ve=void 0,st=le[Ie],Re=[0,0,0],Ue=[0,0,0],We=[0,0,0];Ie==0?(Je=W,Ve=oe):Ie==1?(Je=oe,Ve=glyph_repeat_mode=="AXES_2D"?W:ae):(Je=ae,Ve=W);var Pt=(w[0]+st*P[0])*this.globalScale;Re[0]=Je[0]*Pt,Re[1]=Je[1]*Pt,Re[2]=Je[2]*Pt,We[0]=Re[1]*Ve[2]-Ve[1]*Re[2],We[1]=Re[2]*Ve[0]-Ve[2]*Re[0],We[2]=Re[0]*Ve[1]-Re[1]*Ve[0];var It=Math.sqrt(We[0]*We[0]+We[1]*We[1]+We[2]*We[2]);if(0<It){var pt=(w[2]+st*P[2])*this.globalScale/It;R=="AXES_2D"&&0<Ie&&(pt*=-1),We[0]*=pt,We[1]*=pt,We[2]*=pt}if(Ue[0]=We[1]*Re[2]-Re[1]*We[2],Ue[1]=We[2]*Re[0]-Re[2]*We[0],Ue[2]=We[0]*Re[1]-We[1]*Re[0],It=Math.sqrt(Ue[0]*Ue[0]+Ue[1]*Ue[1]+Ue[2]*Ue[2]),0<It){var yt=(w[1]+st*P[1])*this.globalScale/It;Ue[0]*=yt,Ue[1]*=yt,Ue[2]*=yt}H[Ie]=[Ee,Re,Ue,We]}}return H},j=(V,W,oe,ae,le)=>{var H=1;R=="AXES_2D"||R=="MIRROR"?H=2:R=="AXES_3D"&&(H=3);var U=V.length/3,D=0;Z.length=H;for(var Q=0;Q<U;Q++){var ie=3*Q,ce=[V[ie],V[ie+1],V[ie+2]],ge=[W[ie],W[ie+1],W[ie+2]],ye=[oe[ie],oe[ie+1],oe[ie+2]],ue=[ae[ie],ae[ie+1],ae[ie+2]],be=[le[ie],le[ie+1],le[ie+2]],ne=q(ce,ge,ye,ue,be,Z);if(ne.length==H)for(var de=0;de<H;de++){T.elements[0]=ne[de][1][0],T.elements[1]=ne[de][1][1],T.elements[2]=ne[de][1][2],T.elements[3]=0,T.elements[4]=ne[de][2][0],T.elements[5]=ne[de][2][1],T.elements[6]=ne[de][2][2],T.elements[7]=0,T.elements[8]=ne[de][3][0],T.elements[9]=ne[de][3][1],T.elements[10]=ne[de][3][2],T.elements[11]=0,T.elements[12]=ne[de][0][0],T.elements[13]=ne[de][0][1],T.elements[14]=ne[de][0][2],T.elements[15]=1,this.morph.setMatrixAt(D,T);var ve=p[D];ve&&ve.setTransformation(ne[de][0],ne[de][1],ne[de][2],ne[de][3]),D++}}this.morph.instanceMatrix.needsUpdate=!0},$=V=>{var W=1;R=="AXES_2D"||R=="MIRROR"?W=2:R=="AXES_3D"&&(W=3);for(var oe,ae=V.length,le=0,H=0;H<ae;H++){oe=V[H];for(var U=0;U<W;U++){E.setHex(oe),this.morph.setColorAt(le,E);var D=p[le];D&&D.setColour(E),le++}}this.morph.instanceColor.needsUpdate=!0},X=()=>{var V=B,W=N,oe=k,ae=z,le=G,H=Y,U=this.inbuildTime/this.duration*(A-1),D=Math.floor(U),Q=1-(U-D),ie=Math.ceil(U);if(S){var ce=b[D.toString()],ge=b[ie.toString()],ye=g[D.toString()],ue=g[ie.toString()],be=m[D.toString()],ne=m[ie.toString()],de=h[D.toString()],ve=h[ie.toString()],Ee=y[D.toString()],Se=y[ie.toString()];B.length=ce.length,N.length=ce.length,k.length=ce.length,z.length=ce.length,G.length=ce.length;for(var Ie=0;Ie<ce.length;Ie++)V[Ie]=Q*ce[Ie]+(1-Q)*ge[Ie],W[Ie]=Q*ye[Ie]+(1-Q)*ue[Ie],oe[Ie]=Q*be[Ie]+(1-Q)*ne[Ie],ae[Ie]=Q*de[Ie]+(1-Q)*ve[Ie],le[Ie]=Q*Ee[Ie]+(1-Q)*Se[Ie]}else V=b[0],W=g[0],oe=m[0],ae=h[0],le=y[0];if(j(V,W,oe,ae,le),this.boundingBoxUpdateRequired=!0,v!=null){if(I){var Je=v[D.toString()],Ve=v[ie.toString()];H.length=Je.length;for(var st=0;st<Je.length;st++)E.setHex(Je[st]),L.setHex(Ve[st]),E.setRGB(E.r*Q+L.r*(1-Q),E.g*Q+L.g*(1-Q),E.b*Q+L.b*(1-Q)),H[st]=E.getHex()}else H=v[0];$(H)}};this.showLabel=()=>{for(var V=0;V<p.length;V++)p[V].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var V=0;V<p.length;V++)p[V].hideLabel()};var K=V=>{for(var W=0;W<_;W++){var oe=new(u(16)).Glyph(void 0,void 0,W,this),ae=M?M[W]:void 0;ae=ae||this.groupName,ae&&oe.setLabel(ae),0<A&&oe.setFrustumCulled(!1),p[W]=oe,this.morph.add(oe.getGroup())}V&&this.showLabel(),j(b[0],g[0],m[0],h[0],y[0]),v!=null&&$(v[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=V=>{V.isGlyph&&p.push(V),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(V,W)=>{if(V.isMesh){var oe=new(u(16)).Glyph(void 0,void 0,W,this);return oe.fromMesh(V),p.push(oe),this.morph.add(oe.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,oe}},this.forEachGlyph=V=>{for(var W=0;W<p.length;W++)V(p[W])};var re=(V,W)=>(oe,ae)=>{var le=oe.toBufferGeometry();this.geometry.copy(le),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),le.dispose(),ae&&ae[0]&&(this.morph.material=ae[0]),K(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),oe.dispose(),V!=null&&typeof V=="function"&&V(this)};this.getClosestVertexIndex=function(){var V=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,oe=b[0],ae=oe.length/3,le=-1,H=0,U=0;U<ae;U++)W=3*U,this._v2.set(oe[W],oe[W+1],oe[W+2]),H=this._v1.distanceTo(this._v2),(le==-1||le>H)&&(le=H,V=U)}return V},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var V=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,T),V.setFromMatrixPosition(T),V}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){F.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var V=0;V<_;V++)this.morph.getMatrixAt(V,T),x.copy(F).applyMatrix4(T),V==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=V=>{this.inbuildTime=V>this.duration?this.duration:0>V?0:V,(I||S)&&(X(),S&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<A)&&(I||S)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(V){this.globalScale=V,X()},this.dispose=()=>{for(var V=p.length-1;0<=V;V--)p[V].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),g=void 0,m=void 0,h=void 0,b=void 0,y=void 0,v=void 0,this.ready=!1,this.groupName=void 0},this.render=(V,W,oe)=>{if(W==!0){var ae=this.inbuildTime+V;ae>this.duration&&(ae-=this.duration),this.inbuildTime=ae,(I||S)&&X()}this.updateMarker(W,oe)}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=d},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>w});var c=u(4),f=u(20).Loader,d=c.LoaderUtils,p=c.AnimationClip,g=c.Vector3,m=c.Vector4,h=c.Color,b=c.Vector2,y=u(6).Face3,v=u(6).Geometry,M=c.FileLoader,A=c.DefaultLoadingManager,_=u(21).VideoHandler;function w(C){typeof C=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),C=void 0),this.manager=C===void 0?A:C,this.withCredentials=!1,this.paramsString=""}Object.assign(w.prototype,{load:function(P,R,I,S){var T=this,E=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:d.extractUrlBase(P),L=new M(this.manager);P.split("?"),this.paramsString=P.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(P,function(F){var x;try{x=JSON.parse(F)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),S)return void S({responseURL:P})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+P+" should be loaded with THREE.ObjectLoader instead.")}if(T&&T.parse)try{var N=T.parse(x,E);R(N.geometry,N.materials)}catch(k){if(console.error("The loader has encountered aon loading the geometry"),console.error(k),S)return void S({responseURL:P})}},I,S)},setTexturePath:function(P){this.texturePath=P},parse:function(){function C(S,T){function E(de,ve){return de&1<<ve}var L,F,x,O,B,N,k,z,G,Y,Z,te,q,j,$,X,K,re,V,W,oe,ae,le,H,U,D,Q,ie=S.faces,ce=S.vertices,ge=S.normals,ye=S.colors,ue=S.scale,be=0;if(S.uvs!==void 0){for(L=0;L<S.uvs.length;L++)S.uvs[L].length&&be++;for(L=0;L<be;L++)T.faceVertexUvs[L]=[]}for(O=0,B=ce.length;O<B;)re=new g,re.x=ce[O++]*ue,re.y=ce[O++]*ue,re.z=ce[O++]*ue,T.vertices.push(re);if(O=0,B=ie.length,S.uvs)for(L=0;L<S.uvs.length;L++){T.uvs[L]=[];for(var ne=0;ne<S.uvs[L].length;ne++)T.uvs[L][ne]=S.uvs[L][ne]}if(ge)for(L=0;L<ge.length;L++)T.normals[L]=ge[L];if(ye)for(L=0;L<ye.length;L++)T.colors[L]=ye[L];for(;O<B;)if(Y=ie[O++],Z=E(Y,0),te=E(Y,1),q=E(Y,3),j=E(Y,4),$=E(Y,5),X=E(Y,6),K=E(Y,7),Z){if(W=new y,W.a=ie[O],W.b=ie[O+1],W.c=ie[O+3],oe=new y,oe.a=ie[O+1],oe.b=ie[O+2],oe.c=ie[O+3],O+=4,te&&(G=ie[O++],W.materialIndex=G,oe.materialIndex=G),x=T.faces.length,q)for(L=0;L<be;L++)for(H=S.uvs[L],T.faceVertexUvs[L][x]=[],T.faceVertexUvs[L][x+1]=[],F=0;4>F;F++)z=ie[O++],D=H[2*z],Q=H[2*z+1],U=new b(D,Q),F!==2&&T.faceVertexUvs[L][x].push(U),F!==0&&T.faceVertexUvs[L][x+1].push(U);if(j&&(k=3*ie[O++],W.normal.set(ge[k++],ge[k++],ge[k]),oe.normal.copy(W.normal)),$)for(L=0;4>L;L++)k=3*ie[O++],le=new g(ge[k++],ge[k++],ge[k]),L!==2&&W.vertexNormals.push(le),L!==0&&oe.vertexNormals.push(le);if(X&&(N=ie[O++],ae=ye[N],W.color.setHex(ae),oe.color.setHex(ae)),K)for(L=0;4>L;L++)N=ie[O++],ae=ye[N],L!==2&&W.vertexColors.push(new h(ae)),L!==0&&oe.vertexColors.push(new h(ae));T.faces.push(W),T.faces.push(oe)}else{if(V=new y,V.a=ie[O++],V.b=ie[O++],V.c=ie[O++],V.b||(V.b=V.a),V.c||(V.c=V.b),te&&(G=ie[O++],V.materialIndex=G),x=T.faces.length,q)for(L=0;L<be;L++)for(H=S.uvs[L],T.faceVertexUvs[L][x]=[],F=0;3>F;F++)z=ie[O++],D=H[2*z],Q=H[2*z+1],U=new b(D,Q),T.faceVertexUvs[L][x].push(U);if(j&&(k=3*ie[O++],V.normal.set(ge[k++],ge[k++],ge[k])),$)for(L=0;3>L;L++)k=3*ie[O++],le=new g(ge[k++],ge[k++],ge[k]),V.vertexNormals.push(le);if(X&&(N=ie[O++],V.color.setHex(ye[N])),K)for(L=0;3>L;L++)N=ie[O++],V.vertexColors.push(new h(ye[N]));T.faces.push(V)}}function P(S,T){var E=S.influencesPerVertex===void 0?2:S.influencesPerVertex;if(S.skinWeights)for(var L=0,F=S.skinWeights.length;L<F;L+=E){var x=S.skinWeights[L],O=1<E?S.skinWeights[L+1]:0,B=2<E?S.skinWeights[L+2]:0,N=3<E?S.skinWeights[L+3]:0;T.skinWeights.push(new m(x,O,B,N))}if(S.skinIndices)for(var L=0,F=S.skinIndices.length;L<F;L+=E){var k=S.skinIndices[L],z=1<E?S.skinIndices[L+1]:0,G=2<E?S.skinIndices[L+2]:0,Y=3<E?S.skinIndices[L+3]:0;T.skinIndices.push(new m(k,z,G,Y))}T.bones=S.bones,T.bones&&0<T.bones.length&&(T.skinWeights.length!==T.skinIndices.length||T.skinIndices.length!==T.vertices.length)&&console.warn("When skinning, number of vertices ("+T.vertices.length+"), skinIndices ("+T.skinIndices.length+"), and skinWeights ("+T.skinWeights.length+") should match.")}function R(S,T){var E=S.scale;if(S.morphTargets!==void 0)for(var L=0,F=S.morphTargets.length;L<F;L++){T.morphTargets[L]={},T.morphTargets[L].name=S.morphTargets[L].name,T.morphTargets[L].vertices=[];for(var x,O=T.morphTargets[L].vertices,B=S.morphTargets[L].vertices,N=0,k=B.length;N<k;N+=3)x=new g,x.x=B[N]*E,x.y=B[N+1]*E,x.z=B[N+2]*E,O.push(x)}if(S.morphNormals!==void 0){for(var L=0,F=S.morphNormals.length;L<F;L++)if(T.morphTargets[L]){T.morphTargets[L].normals=[];for(var z,G=T.morphTargets[L].normals,Y=S.morphNormals[L].normals,N=0,k=Y.length;N<k;N+=3)z=new g,z.x=Y[N],z.y=Y[N+1],z.z=Y[N+2],G.push(z);T.morphNormalsReady=!0}}if(S.morphColors!==void 0){var L,F,Z,te,q,j,$;for(L=0,F=S.morphColors.length;L<F;L++)for(T.morphColors[L]={},T.morphColors[L].name=S.morphColors[L].name,T.morphColors[L].colors=[],q=T.morphColors[L].colors,j=S.morphColors[L].colors,Z=0,te=j.length;Z<te;Z+=3)$=new c.Color(16755200),$.setRGB(j[Z],j[Z+1],j[Z+2]),q.push($)}}function I(S,T){var E=[],L=[];S.animation!==void 0&&L.push(S.animation),S.animations!==void 0&&(S.animations.length?L=L.concat(S.animations):L.push(S.animations));for(var F,x=0;x<L.length;x++)F=p.parseAnimation(L[x],T.bones),F&&E.push(F);if(T.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(T.morphTargets,10);E=E.concat(O)}0<E.length&&(T.animations=E)}return function(S,T){S.data!==void 0&&(S=S.data),S.scale=S.scale===void 0?1:1/S.scale;var E=new v;if(E.morphColors=[],C(S,E),P(S,E),R(S,E),I(S,E),E.computeFaceNormals(),E.computeBoundingSphere(),S.materials===void 0||S.materials.length===0)return{geometry:E};var L=f.prototype.initMaterials(S.materials,T,"Anonymous");if(S.materials[0].video){var F=T+S.materials[0].video;this.paramsString&&(F+="?".concat(this.paramsString));var x=new _(F);E._video=x}return L&&0<L.length&&(L[0].side=S.materials[0].singleSided?c.FrontSide:S.materials[0].flipSided?c.BackSide:c.DoubleSide,S.materials[0].specularCoef&&(L[0].shininess=Math.floor(S.materials[0].specularCoef/3))),{geometry:E,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,g){this.handlers.push(p,g)},get:function(p){for(var g=this.handlers,m=0,h=g.length;m<h;m+=2){var b=g[m],y=g[m+1];if(b.test(p))return y}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,g,m){for(var h=[],b=0;b<p.length;++b)h[b]=this.createMaterial(p[b],g,m);return h},createMaterial:function(){var d={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,g=new c.TextureLoader,m=new c.MaterialLoader;return function(h,b,y){function v(C,P,R,I,S){var T,E=b+C,L=f.Handlers.get(E);L===null?(g.setCrossOrigin(y),T=g.load(E)):T=L.load(E),P!==void 0&&(T.repeat.fromArray(P),P[0]!==1&&(T.wrapS=c.RepeatWrapping),P[1]!==1&&(T.wrapT=c.RepeatWrapping)),R!==void 0&&T.offset.fromArray(R),I!==void 0&&(I[0]==="repeat"&&(T.wrapS=c.RepeatWrapping),I[0]==="mirror"&&(T.wrapS=c.MirroredRepeatWrapping),I[1]==="repeat"&&(T.wrapT=c.RepeatWrapping),I[1]==="mirror"&&(T.wrapT=c.MirroredRepeatWrapping)),S!==void 0&&(T.anisotropy=S);var F=c.MathUtils.generateUUID();return M[F]=T,F}var M={},A={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var _ in h){var w=h[_];switch(_){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":A.name=w;break;case"blending":A.blending=d[w];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",_,"is no longer supported.");break;case"colorDiffuse":A.color=p.fromArray(w).getHex();break;case"colorSpecular":A.specular=p.fromArray(w).getHex();break;case"colorEmissive":A.emissive=p.fromArray(w).getHex();break;case"specularCoef":A.shininess=w;break;case"shading":w.toLowerCase()==="basic"&&(A.type="MeshBasicMaterial"),w.toLowerCase()==="phong"&&(A.type="MeshPhongMaterial"),w.toLowerCase()==="standard"&&(A.type="MeshStandardMaterial");break;case"mapDiffuse":A.map=v(w,h.mapDiffuseRepeat,h.mapDiffuseOffset,h.mapDiffuseWrap,h.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":A.emissiveMap=v(w,h.mapEmissiveRepeat,h.mapEmissiveOffset,h.mapEmissiveWrap,h.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":A.lightMap=v(w,h.mapLightRepeat,h.mapLightOffset,h.mapLightWrap,h.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":A.aoMap=v(w,h.mapAORepeat,h.mapAOOffset,h.mapAOWrap,h.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":A.bumpMap=v(w,h.mapBumpRepeat,h.mapBumpOffset,h.mapBumpWrap,h.mapBumpAnisotropy);break;case"mapBumpScale":A.bumpScale=w;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":A.normalMap=v(w,h.mapNormalRepeat,h.mapNormalOffset,h.mapNormalWrap,h.mapNormalAnisotropy);break;case"mapNormalFactor":A.normalScale=w;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":A.specularMap=v(w,h.mapSpecularRepeat,h.mapSpecularOffset,h.mapSpecularWrap,h.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":A.metalnessMap=v(w,h.mapMetalnessRepeat,h.mapMetalnessOffset,h.mapMetalnessWrap,h.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":A.roughnessMap=v(w,h.mapRoughnessRepeat,h.mapRoughnessOffset,h.mapRoughnessWrap,h.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":A.alphaMap=v(w,h.mapAlphaRepeat,h.mapAlphaOffset,h.mapAlphaWrap,h.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":A.side=c.BackSide;break;case"doubleSided":A.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),A.opacity=w;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":A[_]=w;break;case"vertexColors":w===!0&&(A.vertexColors=c.VertexColors),w==="face"&&(A.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",_,w)}}return A.type==="MeshBasicMaterial"&&delete A.emissive,A.type!=="MeshPhongMaterial"&&delete A.specular,1>A.opacity&&(A.transparent=!0),m.setTextures(M),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var d=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,g){var m=p/g*d.video.duration;d.video.currentTime=m},this.getVideoDuration=function(){return d.video.duration},this.createCanvasVideoTexture=function(){return d.videoTexture=new c.VideoTexture(d.video),d.videoTexture.minFilter=c.LinearFilter,d.videoTexture.magFilter=c.LinearFilter,d.videoTexture.format=c.RGBFormat,d.video.currentTime=0,d.videoTexture},this.getCurrentTime=function(p){return d.video?p*(d.video.currentTime/d.video.duration):0},this.isReadyToPlay=function(){return!!(d.video&&3<=d.video.readyState)},function(){document&&(d.video=document.createElement("video"),d.video.crossOrigin="anonymous",d.video.src=f,d.video.load(),d.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,d=u(5).toBufferGeometry,p=u(5).getCircularTexture,g=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var h=[],b=1,y=!1,v=500,M=!0;this.createMesh=(w,C,P)=>{if(w&&C){var R=d(w,P),I=p();C.map=I;var S=new f(R,C);this.setMesh(S,P.localTimeEnabled,P.localMorphColour)}};var A=(w,C,P,R)=>{if(P){var I=new c.Color(R),S=new g(P,I);S.setPosition(C[0],C[1],C[2]);var T=S.getSprite();T.material.sizeAttenuation=!1,T.material.alphaTest=.5,T.material.transparent=!0,T.material.depthWrite=!1,T.material.depthTest=y,S.setFontWeight(v),S.setSize(b),S.setVisibility(M),this.group.add(T),h[w]=S}},_=w=>{var C=h[w];if(C){var P=C.getSprite();this.group.remove(P),C.dispose(),h.splice(w,1)}};this.addPoints=(w,C,P)=>{if(w&&0<w.length){var R=this.drawRange;R===-1&&(R=0);var I=this.addVertices(w),S=this.getMorph();if(!S){var T=new c.PointsMaterial({alphaTest:.5,size:10,color:P,sizeAttenuation:!1}),E={localTimeEnabled:!1,localMorphColour:!1};I.colorsNeedUpdate=!0,this.createMesh(I,T,E)}var L=R+w.length,F=0;if(Array.isArray(C)&&C.length===w.length||typeof C=="string")for(h.length,R;R+F<L;){var x=typeof C=="string"?C:C[F];A(R+F,w[F],x,this._lod._material.color),F++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setColourHex=function(w){this._lod._material.color.setHex(w),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(w);for(var C=0;C<h.length;C++)h[C]&&h[C].setColour(this._lod._material.color)},this.setColour=w=>{this._lod.setColour(w);for(var C=0;C<h.length;C++)h[C]&&h[C].setColour(this._lod._material.color)},this.setLabelDepthTest=w=>{y=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setDepthTest(w)},this.setLabelFontWeight=w=>{v=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setFontWeight(w)},this.setLabelSize=w=>{b=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setSize(b)},this.displayLabels=w=>{M=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setVisibility(M)},this.setSize=w=>{this.morph&&this.morph.material&&(this.morph.material.size=w,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=w=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=w,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(w){if(0<=w&&this.drawRange>w){var C=this.getMorph().geometry.getAttribute("position");return[C.getX(w),C.getY(w),C.getZ(w)]}},this.editVertices=function(w,C){if(w&&w.length){var P=this.getMorph(),R=C+w.length-1;if(!P||0>C||R>=this.drawRange)return;var I=P.geometry.getAttribute("position"),S=C;w.forEach(T=>{var E=h[S];E&&E.setPosition(T[0],T[1],T[2]),I.setXYZ(S++,T[0],T[1],T[2])}),I.needsUpdate=!0,P.geometry.computeBoundingBox(),P.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}},this.deleteVertices=function(w){var C=m.prototype.deleteVertices.call(this,w);return C&&_(w),this.drawRange},this.setName=function(w){var C=this.groupName;m.prototype.setName.call(this,w),h.forEach(P=>{P.getString()===C&&(P==null||P.setText(w))})},this.render=(w,C,P,R)=>{this.morph&&P&&(this.morph.sizePerPixel=P.pixelHeight),m.prototype.render.call(this,w,C,P,R)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,d=new c.Ray,p=new c.Sphere,g=new c.Vector3,m=new c.Vector3,h=new c.Vector3;class b extends c.Object3D{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,_=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=A,this.material=_,this.sizePerPixel=1,this.updateMorphTargets()}copy(A){return super.copy(A),this.material=A.material,this.geometry=A.geometry,this}raycast(A,_){var w=this.geometry,C=this.matrixWorld,P=A.params.Points.threshold,R=w.drawRange;if(w.boundingSphere===null&&w.computeBoundingSphere(),p.copy(w.boundingSphere),p.applyMatrix4(C),p.radius+=P,A.ray.intersectsSphere(p)!==!1){f.copy(C).invert(),d.copy(A.ray).applyMatrix4(f);var I=P/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,S=I*I;if(w.isBufferGeometry){var T=w.index,E=w.attributes,L=E.position,F=w.morphAttributes.position;if(T!==null)for(var x,O=Math.max(0,R.start),B=Math.min(T.count,R.start+R.count),N=O;N<B;N++)x=T.getX(N),v(this,L,F,x),y(g,x,S,C,A,_,this);else for(var k=Math.max(0,R.start),z=Math.min(L.count,R.start+R.count),G=k;G<z;G++)v(this,L,F,G),y(g,G,S,C,A,_,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var A=this.geometry;if(A.isBufferGeometry){var _=A.morphAttributes,w=Object.keys(_);if(0<w.length){var C=_[w[0]];if(C!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var P,R=0,I=C.length;R<I;R++)P=C[R].name||R+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[P]=R}}}else{var S=A.morphTargets;S!==void 0&&0<S.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function y(M,A,_,w,C,P,R){var I=d.distanceSqToPoint(M);if(I<_){var S=new c.Vector3;d.closestPointToPoint(M,S),S.applyMatrix4(w);var T=C.ray.origin.distanceTo(S);if(T<C.near||T>C.far)return;P.push({distance:T,distanceToRay:Math.sqrt(I),point:S,index:A,face:null,object:R})}}function v(M,A,_,w){g.fromBufferAttribute(A,w);var C=M.morphTargetInfluences;if(M.material.morphTargets&&_&&C){m.set(0,0,0);for(var P=0,R=_.length;P<R;P++){var I=C[P],S=_[P];I!==0&&(h.fromBufferAttribute(S,w),m.addScaledVector(h.sub(g),I))}g.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,d=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,g,m)=>{if(p&&g){var h=f(p,m);m.localMorphColour&&h.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(h,g);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,g)=>{if(p&&0<p.length){var m=this.addVertices(p),h=this.getMorph();if(!h){var b=new c.LineBasicMaterial({color:g});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=d},(o,l,u)=>{function c(g,m,h,b,y,v,M){try{var A=g[v](M),_=A.value}catch(w){return void h(w)}A.done?m(_):Promise.resolve(_).then(b,y)}function f(g){return function(){var m=this,h=arguments;return new Promise(function(b,y){function v(_){c(A,b,y,v,M,"next",_)}function M(_){c(A,b,y,v,M,"throw",_)}var A=g.apply(m,h);v(void 0)})}}var d=u(4),p=function(){var g=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(h){var b=1,y=1,v=0;if(h&&h.length){g.isLoading=!0;var M=new Image;M.crossOrigin="Anonymous";for(var A,_=document.createElement("canvas"),w=0,C=Array(h.length),P=0;P<h.length;P++)A=yield g.imageToUint8Array(g,M,h[P],_),A&&A.array&&(b=A.width,y=A.height,C[v]=A.array,w+=C[v].length,v++);var R=new Uint8Array(w);w=0,C.forEach(I=>{R.set(I,w),w+=I.length}),g.impl=new d.DataTexture2DArray(R,b,y,v),g.size={width:b,height:y,depth:v},g.isLoading=!1,g.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var h;if(!m)h=new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=d.FrontSide;m.side&&(y=m.side),h=new d.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(h.glslVersion=m.glslVersion)}if(h)return h.needsUpdate=!0,h}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(g,m,h,b,y,v,M){try{var A=g[v](M),_=A.value}catch(w){return void h(w)}A.done?m(_):Promise.resolve(_).then(b,y)}function f(g){return function(){var m=this,h=arguments;return new Promise(function(b,y){function v(_){c(A,b,y,v,M,"next",_)}function M(_){c(A,b,y,v,M,"throw",_)}var A=g.apply(m,h);v(void 0)})}}var d=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(g,m){return new Promise((h,b)=>{g.onload=()=>h(g),g.onerror=b,g.src=m})},p.prototype.imageToUint8Array=function(){var g=f(function*(m,h,b,y){yield m.loadImage(h,b),y.width=h.width,y.height=h.height;var v=y.getContext("2d");return v.drawImage(h,0,0),{array:new Uint8Array(v.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return g.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var g=f(function*(){});return function(){return g.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,v){var M=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);v&&(A=A.filter(function(_){return Object.getOwnPropertyDescriptor(y,_).enumerable})),M.push.apply(M,A)}return M}function f(y){for(var v,M=1;M<arguments.length;M++)v=arguments[M]==null?{}:arguments[M],M%2?c(Object(v),!0).forEach(function(A){d(y,A,v[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(v)):c(Object(v)).forEach(function(A){Object.defineProperty(y,A,Object.getOwnPropertyDescriptor(v,A))});return y}function d(y,v,M){return(v=p(v))in y?Object.defineProperty(y,v,{value:M,enumerable:!0,configurable:!0,writable:!0}):y[v]=M,y}function p(y){var v=g(y,"string");return typeof v=="symbol"?v:v+""}function g(y,v){if(typeof y!="object"||!y)return y;var M=y[Symbol.toPrimitive];if(M!==void 0){var A=M.call(y,v);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(y)}var m=u(4),h=u(28),b=function(y){u(29).TexturePrimitive.call(this,y),this.isTextureSlides=!0;var v=[],M={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var A=void 0,_=!0,w=0,C=1,P=!0;this.createSlides=S=>{S.forEach(T=>this.createSlide(T))};var R=(S,T)=>{var E=S.material,L=E.uniforms;switch(S.rotation.x=0,S.rotation.y=0,S.rotation.z=0,S.position.x=0,S.position.y=0,S.position.z=0,T.direction){case"x":var F=-Math.PI/2;S.rotation.y=F,L.direction.value=1,L.slide.value.set(T.value,0,0),S.position.x=T.value;break;case"y":S.rotation.x=Math.PI/2,L.direction.value=2,L.slide.value.set(0,T.value,0),S.position.y=T.value;break;case"z":L.direction.value=3,L.slide.value.set(0,0,T.value),S.position.z=T.value;break}E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=S=>{S&&S.id&&S.id in M&&M[S.id]&&R(M[S.id],S)},this.createSlide=S=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&S&&S.direction&&S.value!==void 0){var T=new m.PlaneGeometry(1,1);T.translate(.5,.5,0);var E=h.getUniforms();E.brightness.value=w,E.contrast.value=C,E.diffuse.value=this.texture.impl,E.discardAlpha.value=P,E.depth.value=this.texture.size.depth,E.flipY.value=_;var L={fs:h.fs,vs:h.vs,uniforms:E,glslVersion:h.glslVersion,side:m.DoubleSide,transparent:!1},F=this.texture.getMaterial(L);F.needsUpdate=!0;var x=new m.Mesh(T,F);x.name=this.groupName,x.userData=this;var O={value:S.value,direction:S.direction,id:x.id};return v.push(O),R(x,O),M[x.id]=x,this.morph.add(x),this.boundingBoxUpdateRequired=!0,O}},this.getTextureSettings=()=>[...v],this.getTextureSettingsWithId=S=>{for(var T=0;T<v.length;T++)if(S===v[T].id)return f({},v[T])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=S=>{S&&this.removeSlideWithId(S.id)},this.removeSlideWithId=S=>{if(this.morph&&S in M&&M[S]){if(this.morph.getObjectById(S)){var T=M[S];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var E=v.findIndex(L=>L.id===S);-1<E&&v.splice(E,1)}},this.dispose=()=>{this.morph.children.forEach(S=>{S.geometry&&S.geometry.dispose(),S.material&&S.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var I=(S,T,E)=>{if(T)switch(T.direction.value){case 1:E.copy(T.slide.value),S.expandByPoint(E),E.setY(1),E.setZ(1),S.expandByPoint(E);break;case 2:E.copy(T.slide.value),S.expandByPoint(E),E.setX(1),E.setZ(1),S.expandByPoint(E);break;case 3:E.copy(T.slide.value),S.expandByPoint(E),E.setX(1),E.setY(1),S.expandByPoint(E);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var S=new m.Vector3(0,0,0);this.morph.children.forEach(T=>{I(this.cachedBoundingBox,T.material.uniforms,S)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(S,T,E)=>{var L=new m.Matrix4;L.set(S[0],S[1],S[2],0,S[3],S[4],S[5],0,S[6],S[7],S[8],0,0,0,0,0);var F=new m.Quaternion().setFromRotationMatrix(L);this.morph.position.set(...T),this.morph.quaternion.copy(F),this.morph.scale.set(...E),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=S=>{this.morph.renderOrder=S},this.initialise=(S,T)=>{if(S){var E=S.locations;E&&0<E.length&&(this.applyTransformation(E[0].orientation,E[0].position,E[0].scale),"flipY"in E[0]&&(_=E[0].flipY)),this.createSlides(S.settings.slides),T!=null&&typeof T=="function"&&T(this)}},this.showEdges=S=>{if(A)A.material.color=S;else{var T=new m.BoxGeometry(1,1,1);T.translate(.5,.5,.5);var E=new m.EdgesGeometry(T);A=new m.LineSegments(E,new m.LineBasicMaterial({color:S})),this.group.add(A)}A.visible=!0},this.isAlphaPixelDiscarded=()=>P,this.discardAlphaPixel=S=>{P=S,this.morph.children.forEach(T=>{var E=T.material;if(E.type==="ShaderMaterial"){var L=E.uniforms;L.discardAlpha.value=P,E.needsUpdate=!0}})},this.getBrightness=()=>w,this.setBrightness=S=>{w=S,this.morph.children.forEach(T=>{var E=T.material;if(E.type==="ShaderMaterial"){var L=E.uniforms;L.brightness.value=w,E.needsUpdate=!0}})},this.getContrast=()=>C,this.setContrast=S=>{0<=C&&(C=S,this.morph.children.forEach(T=>{var E=T.material;if(E.type==="ShaderMaterial"){var L=E.uniforms;L.contrast.value=C,E.needsUpdate=!0}}))},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,d=`
3184
+ `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,d=u(5).removeVertexAtIndex,p=u(5).resolveURL,g=0,m=function(){return"pr"+g++},h=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=m(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};h.prototype.setDuration=function(b){this.duration=b,this.clipAction&&this.clipAction.setDuration(this.duration)},h.prototype.getDuration=function(){return this.duration},h.prototype.setRegion=function(b){this.region=b},h.prototype.getRegion=function(){return this.region},h.prototype.getMorph=function(){var b=this._lod.getCurrentMorph();return b||this.morph},h.prototype.getGroup=function(){return this.group},h.prototype.setMorph=function(b){this.morph=b,this.group.add(this.morph);var y=this._lod.calculateDistance("far");this._lod.addLevel(b,y),this._lod.setMaterial(b.material)},h.prototype.checkTransparentMesh=function(){},h.prototype.setMesh=function(b,y,v){this.animationGroup=new c.AnimationObjectGroup(b),this.mixer=new c.AnimationMixer(this.animationGroup);var M=b.geometry;if(this.geometry=b.geometry,this.clipAction=void 0,M&&M.morphAttributes){var A=M.morphAttributes.position;A||(A=M.morphAttributes.color?M.morphAttributes.color:M.morphAttributes.normal),A&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(A,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=y,this.morphColour=v,b.userData=this,b.matrixAutoUpdate=!1,this.setMorph(b),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(M.setAttribute("morphTarget0",M.getAttribute("position")),M.setAttribute("morphTarget1",M.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},h.prototype.setIsPickable=function(b){this.isPickable!==b&&(this.isPickable=b,this.region&&(this.region.pickableUpdateRequired=!0))},h.prototype.setAnatomicalId=function(b){this.anatomicalId=b},h.prototype.setName=function(b){this.groupName=b,this._lod.setName(b)},h.prototype.getCurrentTime=function(){if(this.clipAction){var b=this.clipAction.time/this.clipAction._clip.duration;return this.duration*b}return this.inbuildTime},h.prototype.setMorphTime=function(b){var y=!1;if(this.clipAction){var v=b/this.duration,M=this.clipAction._clip.duration,A=v*M;A!=this.clipAction.time&&(this.clipAction.time=A,y=!0),y&&this.isTimeVarying()&&this.mixer.update(0)}else{var _=b;_=b>this.duration?this.duration:0>b?0:b,_!=this.inbuildTime&&(this.inbuildTime=_,y=!0)}y&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},h.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},h.prototype.getVisibility=function(){return this.visible},h.prototype.setVisibility=function(b){b!==this.visible&&(this.visible=b,this.group.visible=b,this.region&&(this.region.pickableUpdateRequired=!0))},h.prototype.setAlpha=function(b){var y=this._lod._material,v=!1;1>b&&(v=!0),y.opacity=b,y.transparent=v,this.checkTransparentMesh()},h.prototype.setFrustumCulled=function(b){this._lod.setFrustumCulled(b)},h.prototype.setVertexColors=function(b){this._lod.setVertexColors(b)},h.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},h.prototype.setColour=function(b){this._lod.setColour(b)},h.prototype.setGreyScale=function(b){if(b){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},h.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},h.prototype.setColourHex=function(b){this._lod._material.color.setHex(b),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(b)},h.prototype.setEmissiveRGB=function(b){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...b),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...b)},h.prototype.setMaterial=function(b){this._lod.setMaterial(b)},h.prototype.getClosestVertexIndex=function(){var b=-1,y=this.getMorph();if(y&&y.geometry){var v=y.geometry.attributes.position;if(v){this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1);for(var M=-1,A=0,_=0;_<v.count;_++)this._v2.fromArray(v.array,3*_),A=this._v2.distanceTo(this._v1),M==-1?M=A:M>A&&(M=A,b=_)}}return b},h.prototype.getClosestVertex=function(b){var y=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var M=v.morphTargetInfluences,A=v.geometry.morphAttributes;if(M&&A&&A.position){for(var _=!1,w=0;w<M.length;w++)0<M[w]&&(_=!0,this._v1.fromArray(A.position[w].array,3*this.closestVertexIndex),y.add(this._v1.multiplyScalar(M[w])));if(_)return b?y.applyMatrix4(v.matrixWorld):y}else return y.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),b?y.applyMatrix4(v.matrixWorld):y}return this.getBoundingBox(),y.copy(this.center),y},h.prototype.getBoundingBox=function(){if(this.visible){var b=this._lod.getCurrentMorph();if(b&&b.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(b,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},h.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},h.prototype.markerIsRequired=function(b){return!!(this.visible&&(this.markerMode==="on"||b&&b.displayMarkers&&this.markerMode==="inherited"))},h.prototype.updateMarker=function(b,y){if(b==!1&&this.markerIsRequired(y)){var v=y.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var M=this.getClosestVertex(!1);M&&(this.marker.setPosition(M.x,M.y,M.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(y.markersList&&!(this.marker.uuid in y.markersList)&&(v=!0,y.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),y&&y.camera&&(v||y.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(y.camera.cameraObject),y.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),y.markersList&&this.marker.uuid in y.markersList&&(y.markerCluster.markerUpdateRequired=!0,delete y.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},h.prototype.processMarkerVisual=function(b,y){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(b,y)},h.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},h.prototype.setRenderOrder=function(b){this._lod.setRenderOrder(b)},h.prototype.getClosestVertexDOMElementCoords=function(b){if(b&&b.camera){var y=!0,v=this.getClosestVertex(!0);return v.project(b.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(y=!1),b.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:y}}},h.prototype.setMarkerMode=function(b,y){b!==this.markerMode&&(this.markerMode=b==="on"||b==="off"?b:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),y&&(this.markerNumber=y.number,this.markerImgURL=y.imgURL)},h.prototype.render=function(b,y,v,M){if(this.visible&&!(this.timeEnabled&&y)&&this._lod.update(v,this.center),y==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(b);else{var A=this.inbuildTime+b;A>this.duration&&(A-=this.duration),this.inbuildTime=A}this.visible&&b!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(y,M)},h.prototype.addLOD=function(b,y,v,M,A){this._lod.addLevelFromURL(b,y,v,M,A)},h.prototype.addVertices=function(b){var y=this.getMorph(),v=void 0;if(!y)v=f(500,b),this.drawRange=b.length;else if(-1<this.drawRange){var M=y.geometry.getAttribute("position");b.forEach(A=>{M.setXYZ(this.drawRange,A[0],A[1],A[2]),++this.drawRange}),M.needsUpdate=!0,y.geometry.setDrawRange(0,this.drawRange),y.geometry.computeBoundingBox(),y.geometry.computeBoundingSphere(),v=y.geoemtry,this.boundingBoxUpdateRequired=!0}return v},h.prototype.deleteVertices=function(b){var y=this.getMorph();return!!(y!=null&&y.geometry&&this.drawRange>=b&&d(y.geometry,b,!0))&&(--this.drawRange,y.geometry.setDrawRange(0,this.drawRange),y.geometry.computeBoundingBox(),y.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0,!0)},h.prototype.setPosition=function(b,y,v){var M=this.getGroup();M&&(M.position.set(b,y,v),M.matrixWorldNeedsUpdate=!0,M.updateMatrix(),M.updateWorldMatrix(!0,!0),this.boundingBoxUpdateRequired=!0)},h.prototype.loadAdditionalSources=function(b){b.load(p(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},h.prototype.setScaleAll=function(b){var y=this.getGroup();y&&(y.scale.set(b,b,b),y.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=h},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,d=u(5).toBufferGeometry,p=function(g){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=g,this.addLevel=(h,b)=>{if(h){var y,v=Math.abs(b);for(y=0;y<this.levels.length&&!(v<this.levels[y].distance);y++);this.levels.splice(y,0,{distance:v,morph:h,loaded:!0,loading:!1,url:""}),h.renderOrder=this._renderOrder}},this.levelLoaded=(h,b)=>{if(h){for(var y=Math.abs(b),v=0;v<this.levels.length;v++)if(y===this.levels[v].distance){this._parent.group.add(h),this.levels[v].morph=h,this.levels[v].loaded=!0,this.levels[v].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(h,b,y,v,M)=>{this._loader=h;var A,_=this.calculateDistance(b);for(A=0;A<this.levels.length&&!(_<this.levels[A].distance);A++);this.levels.splice(A,0,{distance:_,morph:void 0,loaded:!1,loading:!1,url:y,index:v}),M&&this.loadLevel(A)},this.loadLevel=h=>{var b=this.levels[h];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(h){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return h==="far"?y=4.5*b:h==="medium"?y=2.5*b:h=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var h=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!h.secondaryMesh&&(h.secondaryMesh=new c.Mesh(h.morph.geometry,this._secondaryMaterial),h.secondaryMesh.renderOrder=h.morph.renderOrder+1,h.secondaryMesh.userData=h.morph.userData,h.secondaryMesh.name=h.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!h.secondaryMesh.parent&&(h.morph.add(h.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(h.secondaryMesh))):(h.secondaryMesh&&(h.morph.remove(h.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(h.secondaryMesh),this._parent.animationGroup.remove(h.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&h.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var h=this.levels[this._currentLevel];return h&&h.morph?h.morph:this._parent.morph},this.lodLoader=function(h){return b=>{var y=this._material,v={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},M=d(b,v),A=void 0;this._parent.isGeometry?A=new c.Mesh(M,y):this._parent.isLines&&(A=new(u(12)).LineSegments(M,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,h)}},this.updateMorphColorAttribute=h=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(h){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=h=>{this._material.color=h,this._secondaryMaterial&&(this._secondaryMaterial.color=h),m()},this.setFrustumCulled=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=h),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=h)})},this.setMaterial=h=>{h&&(!this._material||this._material.id!==h.id)&&(this._material=h,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=h.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=h),b.secondaryMesh&&(b.secondaryMesh.name=h)})},this.setRenderOrder=h=>{this._renderOrder=h,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=h),b.secondaryMesh&&(b.secondaryMesh.renderOrder=h)})},this.setVertexColors=h=>{this._material.vertexColors=h,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=h)},this.update=(h,b)=>{var y=this.levels;if(1<y.length){var v,M,A=h.cameraObject.position.distanceTo(b),_=-1,w=-1;for(v=0,M=y.length;v<M&&A>=y[v].distance;v++)y[v].morph?(-1<_&&y[_].morph&&(y[_].morph.visible=!1),_=v,y[v].morph.visible=!0,w=-1):w=v;for(-1<w&&this.loadLevel(w);v<M;v++)y[v].morph&&(-1<_?y[v].morph.visible=!1:(y[v].morph.visible=!0,_=v));this._currentLevel!=_&&(this._currentLevel=_,this.checkTransparentMesh())}},this.toggleMarker=(h,b)=>{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(h):y.morph.remove(h))})};var m=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&(h.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>g});var c=u(13),f=u(4),d=new f.Vector3,p=new f.Vector3;class g extends c.Line{constructor(h,b){super(h,b),this.type="LineSegments"}computeLineDistances(){var h=this.geometry;if(!h.isBufferGeometry)h.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(h.index===null){for(var b=h.attributes.position,y=[],v=0,M=b.count;v<M;v+=2)d.fromBufferAttribute(b,v),p.fromBufferAttribute(b,v+1),y[v]=v==0?0:y[v-1],y[v+1]=y[v]+d.distanceTo(p);h.setAttribute("lineDistance",new f.Float32BufferAttribute(y,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}g.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>M});var c=u(4),f=new c.Vector3,d=new c.Vector3,p=new c.Matrix4,g=new c.Ray,m=new c.Sphere,h=new c.Vector3,b=new c.Vector3,y=new c.Vector3,v=new c.Vector3;class M extends c.Object3D{constructor(){var w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,C=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=w,this.material=C,this.updateMorphTargets()}copy(w){return super.copy(w),this.material=w.material,this.geometry=w.geometry,this}computeLineDistances(){var w=this.geometry;if(!w.isBufferGeometry)w.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(w.index===null){for(var C=w.attributes.position,P=[0],R=1,I=C.count;R<I;R++)f.fromBufferAttribute(C,R-1),d.fromBufferAttribute(C,R),P[R]=P[R-1],P[R]+=f.distanceTo(d);w.setAttribute("lineDistance",new c.Float32BufferAttribute(P,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(w,C){var P=this.geometry,R=this.matrixWorld,I=w.params.Line.threshold,S=P.drawRange,T=P.morphAttributes.position;if(P.boundingSphere===null&&P.computeBoundingSphere(),m.copy(P.boundingSphere),m.applyMatrix4(R),m.radius+=I,w.ray.intersectsSphere(m)!==!1){p.copy(R).invert(),g.copy(w.ray).applyMatrix4(p);var E=I/((this.scale.x+this.scale.y+this.scale.z)/3),L=E*E,F=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,N=this.isLineSegments?2:1;if(P.isBufferGeometry){var k=P.index,z=P.attributes,G=z.position;if(k!==null)for(var Y=Math.max(0,S.start),Z=Math.min(k.count,S.start+S.count),te=Y;te<Z-1;te+=N){var q=k.getX(te),W=k.getX(te+1);A(F,x,this,G,T,q,W);var $=g.distanceSqToSegment(F,x,B,O);if(!($>L)){B.applyMatrix4(this.matrixWorld);var X=w.ray.origin.distanceTo(B);X<w.near||X>w.far||C.push({distance:X,point:O.clone().applyMatrix4(this.matrixWorld),index:te,face:null,faceIndex:null,object:this})}}else for(var K=Math.max(0,S.start),re=Math.min(G.count,S.start+S.count),V=K;V<re-1;V+=N){A(F,x,this,G,T,V,V+1);var j=g.distanceSqToSegment(F,x,B,O);if(!(j>L)){B.applyMatrix4(this.matrixWorld);var oe=w.ray.origin.distanceTo(B);oe<w.near||oe>w.far||C.push({distance:oe,point:O.clone().applyMatrix4(this.matrixWorld),index:V,face:null,faceIndex:null,object:this})}}}else P.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var w=this.geometry;if(w.isBufferGeometry){var C=w.morphAttributes,P=Object.keys(C);if(0<P.length){var R=C[P[0]];if(R!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var I,S=0,T=R.length;S<T;S++)I=R[S].name||S+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[I]=S}}}else{var E=w.morphTargets;E!==void 0&&0<E.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function A(_,w,C,P,R,I,S){_.fromBufferAttribute(P,I),w.fromBufferAttribute(P,S);var T=C.morphTargetInfluences;if(C.material.morphTargets&&R&&T){h.set(0,0,0),b.set(0,0,0);for(var E=0,L=R.length;E<L;E++){var F=T[E],x=R[E];F!==0&&(y.fromBufferAttribute(x,I),v.fromBufferAttribute(x,S),h.addScaledVector(y.sub(_),F),b.addScaledVector(v.sub(w),F))}_.add(h),w.add(b)}}M.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var d=new c.Texture;d.image=f,d.needsUpdate=!0;var p=[.02,.03,1],g=new c.SpriteMaterial({map:d,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,h=function(b){u(10).ZincObject.call(this),this.texture=d;var y=void 0,v=void 0,M=void 0,A=void 0,_=void 0,w=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var C=!1;this.ndc=new c.Vector3;var P=void 0,R=void 0,I=()=>{y=new c.Sprite(g),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(S,T)=>{var E=1,L=0;S!==T&&(L=1-(this.ndc.z-S)/(T-S),E=.6+.4*L),this.setSpriteSize(E)},this.updateNDC=S=>(this.ndc.copy(this.morph.position),this.ndc.project(S),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(S,T,E)=>{this.morph.position.set(S,T,E)},this.setSpriteSize=S=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(S)},this.setUserSprite=()=>{A&&(this.morph.add(A),w&&(this.morph.remove(y),R&&this.morph.remove(R),w=!1))},this.setImageForUserSprite=(S,T)=>{A&&(this.morph.remove(A),A=void 0),v&&v.dispose(),M&&M.dispose(),v=new c.Texture,v.image=S,v.needsUpdate=!0,M=new c.SpriteMaterial({map:v,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),T||(T=[.05,.05,1]),A=new c.Sprite(M),A.center.set(.5,0),A.scale.set(T[0],T[1],T[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{w||(w=!0,this.morph.add(y),A&&this.morph.remove(A),R&&this.morph.add(R))},this.loadUserSprite=(S,T)=>{if(S)if(S!==_){_=S;var E=new Image(128,128);E.crossOrigin="anonymous",E.onload=()=>{this.setImageForUserSprite(E,T)},E.src=S}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),R&&(R.material.map.dispose(),R.material.dispose(),R=void 0)},this.isEnabled=()=>C,this.setNumber=S=>{(!S||P!=S)&&R&&(this.morph.remove(R),R.material.map.dispose(),R.material.dispose(),R=void 0),!R&&S&&(R=m(S,.012,"black","Asap",120,700),this.morph.add(R)),P=S},this.getNumber=()=>P||1,this.setVisibility=function(S){S!==this.visible&&(this.visible=S,this.group.visible=S,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{C=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{C=!1,this.morph.visible=!1,this.visible=!1},I()};h.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=h},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(d,p,g,m){u(10).ZincObject.call(this);var h;p&&(h=p.clone(),h.vertexColors=c.FaceColors),this.id=g;var b=void 0,y=void 0;this.isGlyph=!0;var v=[0,0,0];this.fromMesh=M=>!!(M&&M.isMesh)&&(this.morph=M.clone(),this.morph.userData=this,this.group.add(this.morph),!0),d&&h&&this.fromMesh(new c.Mesh(d,h)),this.getGlyphset=function(){return m},this.setLabel=M=>{M&&(typeof M=="string"||M instanceof String)&&(y=M,this.morph&&(this.morph.name=M))},this.showLabel=M=>{b&&(v=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,M),b.setPosition(v[0],v[1],v[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(v=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(M,A,_,w)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=_[0],this.morph.matrix.elements[5]=_[1],this.morph.matrix.elements[6]=_[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=w[0],this.morph.matrix.elements[9]=w[1],this.morph.matrix.elements[10]=w[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=M[0],this.morph.matrix.elements[13]=M[1],this.morph.matrix.elements[14]=M[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),v=[...M],b&&b.setPosition(M[0],M[1],M[2])},this.setColour=M=>{b&&b.setColour(M),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,d){var p=f,g=void 0,m=500;g=d?new c(p,.012,d.getStyle()):new c(p,.012),g.fontFace="Asap",g.fontWeight=m,g.material.map.generateMipmaps=!1,g.material.sizeAttenuation=!1,g.center.x=-.05,g.center.y=0;var h=[g.scale.x,g.scale.y];this.getPosition=()=>g?[g.position.x,g.position.y,g.position.z]:[0,0,0],this.setPosition=(b,y,v)=>{g&&g.position.set(b,y,v)},this.setColour=b=>{b&&(g.color=b.getStyle())},this.setScale=b=>{g&&0<b&&g.scale.set(b,b,1)},this.setDepthTest=b=>{b&&b!==g.material.depthTest&&(g.material.depthTest=b)},this.setSize=b=>{0<b&&(g.scale.x=h[0]*b,g.scale.y=h[1]*b)},this.setFontWeight=b=>{b&&b!==m&&(g.fontWeight=b,m=b)},this.setText=b=>{b&&b!==g.text&&(g.text=b,p=b)},this.setVisibility=b=>{g.visible=b},this.dispose=()=>{},this.getSprite=()=>g,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,d=function(){u(10).ZincObject.call(this);var p=[],g=void 0,m=void 0,h=void 0,b=void 0,y=void 0,v=void 0,M=void 0,A=0,_=0,w=[0,0,0],C=[0,0,0],P=[0,0,0],R="NONE";this.ready=!1;var I=!1,S=!1;this.isGlyphset=!0;var T=new c.Matrix4,E=new c.Color,L=new c.Color,F=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],N=[],k=[],z=[],G=[],Y=[],Z=[];this.globalScale=1;for(var te=0;8>te;te++)new c.Vector3;this.load=(V,j,oe,ae,le)=>{g=V.axis1,m=V.axis2,h=V.axis3,b=V.positions,y=V.scale,v=V.colors,M=V.label,I=V.metadata.MorphColours,S=V.metadata.MorphVertices,A=V.metadata.number_of_time_steps,R=V.metadata.repeat_mode,_=V.metadata.number_of_vertices,R=="AXES_2D"||R=="MIRROR"?_*=2:R=="AXES_3D"&&(_*=3),w=V.metadata.base_size,C=V.metadata.offset,P=V.metadata.scale_factors;var H=new f;this.geometry=new c.BufferGeometry;var U=new c.InstancedMesh(this.geometry,void 0,_);if(this.setMorph(U),ae){var D=H.parse(j);re(oe,le)(D.geometry,D.materials),D.geometry.dispose()}else H.crossOrigin="Anonymous",H.load(j,re(oe,le))};var q=(V,j,oe,ae,le,H)=>{if(R=="NONE"||R=="MIRROR"){for(var U,D=[0,0,0],Q=[0,0,0],ie=[0,0,0],ce=[0,0,0],ge=[0,0,0],ye=[0,0,0],ue=[0,0,0],be=[0,0,0],ne=[0,0,0],de=0;3>de;de++)U=0>le[de]?-1:1,D[de]=(U*w[de]+le[de]*P[de])*this.globalScale;for(var de=0;3>de;de++)Q[de]=j[de]*D[0],ie[de]=oe[de]*D[1],ce[de]=ae[de]*D[2],ge[de]=V[de]+C[0]*Q[de]+C[1]*ie[de]+C[2]*ce[de],R=="MIRROR"&&(ye[de]=-Q[de],ue[de]=-ie[de],be[de]=-ce[de],ne[de]=ge[de],0>le[0]&&(ge[de]-=Q[de],ne[de]-=ye[de]));0>ce[0]*(Q[1]*ie[2]-Q[2]*ie[1])+ce[1]*(Q[2]*ie[0]-Q[0]*ie[2])+ce[2]*(Q[0]*ie[1]-Q[1]*ie[0])&&(ce[0]=-ce[0],ce[1]=-ce[1],ce[2]=-ce[2]),H[0]=[ge,Q,ie,ce],R=="MIRROR"&&(0>be[0]*(ye[1]*ue[2]-ye[2]*ue[1])+be[1]*(ye[2]*ue[0]-ye[0]*ue[2])+be[2]*(ye[0]*ue[1]-ye[1]*ue[0])&&(be[0]=-be[0],be[1]=-be[1],be[2]=-be[2]),H[1]=[ne,ye,ue,be])}else if(R=="AXES_2D"||R=="AXES_3D"){for(var U,ve=[0,0,0],Ee=[0,0,0],de=0;3>de;de++)U=0>le[de]?-1:1,ve[de]=(U*w[0]+le[de]*P[0])*this.globalScale;for(var de=0;3>de;de++)Ee[de]=V[de]+C[0]*ve[0]*j[de]+C[1]*ve[1]*oe[de]+C[2]*ve[2]*ae[de];for(var Se=glyph_repeat_mode=="AXES_2D"?2:3,Ie=0;Ie<Se;Ie++){var Je=void 0,Ve=void 0,st=le[Ie],Re=[0,0,0],Ue=[0,0,0],We=[0,0,0];Ie==0?(Je=j,Ve=oe):Ie==1?(Je=oe,Ve=glyph_repeat_mode=="AXES_2D"?j:ae):(Je=ae,Ve=j);var Pt=(w[0]+st*P[0])*this.globalScale;Re[0]=Je[0]*Pt,Re[1]=Je[1]*Pt,Re[2]=Je[2]*Pt,We[0]=Re[1]*Ve[2]-Ve[1]*Re[2],We[1]=Re[2]*Ve[0]-Ve[2]*Re[0],We[2]=Re[0]*Ve[1]-Re[1]*Ve[0];var It=Math.sqrt(We[0]*We[0]+We[1]*We[1]+We[2]*We[2]);if(0<It){var pt=(w[2]+st*P[2])*this.globalScale/It;R=="AXES_2D"&&0<Ie&&(pt*=-1),We[0]*=pt,We[1]*=pt,We[2]*=pt}if(Ue[0]=We[1]*Re[2]-Re[1]*We[2],Ue[1]=We[2]*Re[0]-Re[2]*We[0],Ue[2]=We[0]*Re[1]-We[1]*Re[0],It=Math.sqrt(Ue[0]*Ue[0]+Ue[1]*Ue[1]+Ue[2]*Ue[2]),0<It){var yt=(w[1]+st*P[1])*this.globalScale/It;Ue[0]*=yt,Ue[1]*=yt,Ue[2]*=yt}H[Ie]=[Ee,Re,Ue,We]}}return H},W=(V,j,oe,ae,le)=>{var H=1;R=="AXES_2D"||R=="MIRROR"?H=2:R=="AXES_3D"&&(H=3);var U=V.length/3,D=0;Z.length=H;for(var Q=0;Q<U;Q++){var ie=3*Q,ce=[V[ie],V[ie+1],V[ie+2]],ge=[j[ie],j[ie+1],j[ie+2]],ye=[oe[ie],oe[ie+1],oe[ie+2]],ue=[ae[ie],ae[ie+1],ae[ie+2]],be=[le[ie],le[ie+1],le[ie+2]],ne=q(ce,ge,ye,ue,be,Z);if(ne.length==H)for(var de=0;de<H;de++){T.elements[0]=ne[de][1][0],T.elements[1]=ne[de][1][1],T.elements[2]=ne[de][1][2],T.elements[3]=0,T.elements[4]=ne[de][2][0],T.elements[5]=ne[de][2][1],T.elements[6]=ne[de][2][2],T.elements[7]=0,T.elements[8]=ne[de][3][0],T.elements[9]=ne[de][3][1],T.elements[10]=ne[de][3][2],T.elements[11]=0,T.elements[12]=ne[de][0][0],T.elements[13]=ne[de][0][1],T.elements[14]=ne[de][0][2],T.elements[15]=1,this.morph.setMatrixAt(D,T);var ve=p[D];ve&&ve.setTransformation(ne[de][0],ne[de][1],ne[de][2],ne[de][3]),D++}}this.morph.instanceMatrix.needsUpdate=!0},$=V=>{var j=1;R=="AXES_2D"||R=="MIRROR"?j=2:R=="AXES_3D"&&(j=3);for(var oe,ae=V.length,le=0,H=0;H<ae;H++){oe=V[H];for(var U=0;U<j;U++){E.setHex(oe),this.morph.setColorAt(le,E);var D=p[le];D&&D.setColour(E),le++}}this.morph.instanceColor.needsUpdate=!0},X=()=>{var V=B,j=N,oe=k,ae=z,le=G,H=Y,U=this.inbuildTime/this.duration*(A-1),D=Math.floor(U),Q=1-(U-D),ie=Math.ceil(U);if(S){var ce=b[D.toString()],ge=b[ie.toString()],ye=g[D.toString()],ue=g[ie.toString()],be=m[D.toString()],ne=m[ie.toString()],de=h[D.toString()],ve=h[ie.toString()],Ee=y[D.toString()],Se=y[ie.toString()];B.length=ce.length,N.length=ce.length,k.length=ce.length,z.length=ce.length,G.length=ce.length;for(var Ie=0;Ie<ce.length;Ie++)V[Ie]=Q*ce[Ie]+(1-Q)*ge[Ie],j[Ie]=Q*ye[Ie]+(1-Q)*ue[Ie],oe[Ie]=Q*be[Ie]+(1-Q)*ne[Ie],ae[Ie]=Q*de[Ie]+(1-Q)*ve[Ie],le[Ie]=Q*Ee[Ie]+(1-Q)*Se[Ie]}else V=b[0],j=g[0],oe=m[0],ae=h[0],le=y[0];if(W(V,j,oe,ae,le),this.boundingBoxUpdateRequired=!0,v!=null){if(I){var Je=v[D.toString()],Ve=v[ie.toString()];H.length=Je.length;for(var st=0;st<Je.length;st++)E.setHex(Je[st]),L.setHex(Ve[st]),E.setRGB(E.r*Q+L.r*(1-Q),E.g*Q+L.g*(1-Q),E.b*Q+L.b*(1-Q)),H[st]=E.getHex()}else H=v[0];$(H)}};this.showLabel=()=>{for(var V=0;V<p.length;V++)p[V].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var V=0;V<p.length;V++)p[V].hideLabel()};var K=V=>{for(var j=0;j<_;j++){var oe=new(u(16)).Glyph(void 0,void 0,j,this),ae=M?M[j]:void 0;ae=ae||this.groupName,ae&&oe.setLabel(ae),0<A&&oe.setFrustumCulled(!1),p[j]=oe,this.morph.add(oe.getGroup())}V&&this.showLabel(),W(b[0],g[0],m[0],h[0],y[0]),v!=null&&$(v[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=V=>{V.isGlyph&&p.push(V),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(V,j)=>{if(V.isMesh){var oe=new(u(16)).Glyph(void 0,void 0,j,this);return oe.fromMesh(V),p.push(oe),this.morph.add(oe.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,oe}},this.forEachGlyph=V=>{for(var j=0;j<p.length;j++)V(p[j])};var re=(V,j)=>(oe,ae)=>{var le=oe.toBufferGeometry();this.geometry.copy(le),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),le.dispose(),ae&&ae[0]&&(this.morph.material=ae[0]),K(j),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),oe.dispose(),V!=null&&typeof V=="function"&&V(this)};this.getClosestVertexIndex=function(){var V=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var j,oe=b[0],ae=oe.length/3,le=-1,H=0,U=0;U<ae;U++)j=3*U,this._v2.set(oe[j],oe[j+1],oe[j+2]),H=this._v1.distanceTo(this._v2),(le==-1||le>H)&&(le=H,V=U)}return V},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var V=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,T),V.setFromMatrixPosition(T),V}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){F.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var V=0;V<_;V++)this.morph.getMatrixAt(V,T),x.copy(F).applyMatrix4(T),V==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=V=>{this.inbuildTime=V>this.duration?this.duration:0>V?0:V,(I||S)&&(X(),S&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<A)&&(I||S)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(V){this.globalScale=V,X()},this.dispose=()=>{for(var V=p.length-1;0<=V;V--)p[V].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),g=void 0,m=void 0,h=void 0,b=void 0,y=void 0,v=void 0,this.ready=!1,this.groupName=void 0},this.render=(V,j,oe)=>{if(j==!0){var ae=this.inbuildTime+V;ae>this.duration&&(ae-=this.duration),this.inbuildTime=ae,(I||S)&&X()}this.updateMarker(j,oe)}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=d},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>w});var c=u(4),f=u(20).Loader,d=c.LoaderUtils,p=c.AnimationClip,g=c.Vector3,m=c.Vector4,h=c.Color,b=c.Vector2,y=u(6).Face3,v=u(6).Geometry,M=c.FileLoader,A=c.DefaultLoadingManager,_=u(21).VideoHandler;function w(C){typeof C=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),C=void 0),this.manager=C===void 0?A:C,this.withCredentials=!1,this.paramsString=""}Object.assign(w.prototype,{load:function(P,R,I,S){var T=this,E=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:d.extractUrlBase(P),L=new M(this.manager);P.split("?"),this.paramsString=P.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(P,function(F){var x;try{x=JSON.parse(F)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),S)return void S({responseURL:P})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+P+" should be loaded with THREE.ObjectLoader instead.")}if(T&&T.parse)try{var N=T.parse(x,E);R(N.geometry,N.materials)}catch(k){if(console.error("The loader has encountered aon loading the geometry"),console.error(k),S)return void S({responseURL:P})}},I,S)},setTexturePath:function(P){this.texturePath=P},parse:function(){function C(S,T){function E(de,ve){return de&1<<ve}var L,F,x,O,B,N,k,z,G,Y,Z,te,q,W,$,X,K,re,V,j,oe,ae,le,H,U,D,Q,ie=S.faces,ce=S.vertices,ge=S.normals,ye=S.colors,ue=S.scale,be=0;if(S.uvs!==void 0){for(L=0;L<S.uvs.length;L++)S.uvs[L].length&&be++;for(L=0;L<be;L++)T.faceVertexUvs[L]=[]}for(O=0,B=ce.length;O<B;)re=new g,re.x=ce[O++]*ue,re.y=ce[O++]*ue,re.z=ce[O++]*ue,T.vertices.push(re);if(O=0,B=ie.length,S.uvs)for(L=0;L<S.uvs.length;L++){T.uvs[L]=[];for(var ne=0;ne<S.uvs[L].length;ne++)T.uvs[L][ne]=S.uvs[L][ne]}if(ge)for(L=0;L<ge.length;L++)T.normals[L]=ge[L];if(ye)for(L=0;L<ye.length;L++)T.colors[L]=ye[L];for(;O<B;)if(Y=ie[O++],Z=E(Y,0),te=E(Y,1),q=E(Y,3),W=E(Y,4),$=E(Y,5),X=E(Y,6),K=E(Y,7),Z){if(j=new y,j.a=ie[O],j.b=ie[O+1],j.c=ie[O+3],oe=new y,oe.a=ie[O+1],oe.b=ie[O+2],oe.c=ie[O+3],O+=4,te&&(G=ie[O++],j.materialIndex=G,oe.materialIndex=G),x=T.faces.length,q)for(L=0;L<be;L++)for(H=S.uvs[L],T.faceVertexUvs[L][x]=[],T.faceVertexUvs[L][x+1]=[],F=0;4>F;F++)z=ie[O++],D=H[2*z],Q=H[2*z+1],U=new b(D,Q),F!==2&&T.faceVertexUvs[L][x].push(U),F!==0&&T.faceVertexUvs[L][x+1].push(U);if(W&&(k=3*ie[O++],j.normal.set(ge[k++],ge[k++],ge[k]),oe.normal.copy(j.normal)),$)for(L=0;4>L;L++)k=3*ie[O++],le=new g(ge[k++],ge[k++],ge[k]),L!==2&&j.vertexNormals.push(le),L!==0&&oe.vertexNormals.push(le);if(X&&(N=ie[O++],ae=ye[N],j.color.setHex(ae),oe.color.setHex(ae)),K)for(L=0;4>L;L++)N=ie[O++],ae=ye[N],L!==2&&j.vertexColors.push(new h(ae)),L!==0&&oe.vertexColors.push(new h(ae));T.faces.push(j),T.faces.push(oe)}else{if(V=new y,V.a=ie[O++],V.b=ie[O++],V.c=ie[O++],V.b||(V.b=V.a),V.c||(V.c=V.b),te&&(G=ie[O++],V.materialIndex=G),x=T.faces.length,q)for(L=0;L<be;L++)for(H=S.uvs[L],T.faceVertexUvs[L][x]=[],F=0;3>F;F++)z=ie[O++],D=H[2*z],Q=H[2*z+1],U=new b(D,Q),T.faceVertexUvs[L][x].push(U);if(W&&(k=3*ie[O++],V.normal.set(ge[k++],ge[k++],ge[k])),$)for(L=0;3>L;L++)k=3*ie[O++],le=new g(ge[k++],ge[k++],ge[k]),V.vertexNormals.push(le);if(X&&(N=ie[O++],V.color.setHex(ye[N])),K)for(L=0;3>L;L++)N=ie[O++],V.vertexColors.push(new h(ye[N]));T.faces.push(V)}}function P(S,T){var E=S.influencesPerVertex===void 0?2:S.influencesPerVertex;if(S.skinWeights)for(var L=0,F=S.skinWeights.length;L<F;L+=E){var x=S.skinWeights[L],O=1<E?S.skinWeights[L+1]:0,B=2<E?S.skinWeights[L+2]:0,N=3<E?S.skinWeights[L+3]:0;T.skinWeights.push(new m(x,O,B,N))}if(S.skinIndices)for(var L=0,F=S.skinIndices.length;L<F;L+=E){var k=S.skinIndices[L],z=1<E?S.skinIndices[L+1]:0,G=2<E?S.skinIndices[L+2]:0,Y=3<E?S.skinIndices[L+3]:0;T.skinIndices.push(new m(k,z,G,Y))}T.bones=S.bones,T.bones&&0<T.bones.length&&(T.skinWeights.length!==T.skinIndices.length||T.skinIndices.length!==T.vertices.length)&&console.warn("When skinning, number of vertices ("+T.vertices.length+"), skinIndices ("+T.skinIndices.length+"), and skinWeights ("+T.skinWeights.length+") should match.")}function R(S,T){var E=S.scale;if(S.morphTargets!==void 0)for(var L=0,F=S.morphTargets.length;L<F;L++){T.morphTargets[L]={},T.morphTargets[L].name=S.morphTargets[L].name,T.morphTargets[L].vertices=[];for(var x,O=T.morphTargets[L].vertices,B=S.morphTargets[L].vertices,N=0,k=B.length;N<k;N+=3)x=new g,x.x=B[N]*E,x.y=B[N+1]*E,x.z=B[N+2]*E,O.push(x)}if(S.morphNormals!==void 0){for(var L=0,F=S.morphNormals.length;L<F;L++)if(T.morphTargets[L]){T.morphTargets[L].normals=[];for(var z,G=T.morphTargets[L].normals,Y=S.morphNormals[L].normals,N=0,k=Y.length;N<k;N+=3)z=new g,z.x=Y[N],z.y=Y[N+1],z.z=Y[N+2],G.push(z);T.morphNormalsReady=!0}}if(S.morphColors!==void 0){var L,F,Z,te,q,W,$;for(L=0,F=S.morphColors.length;L<F;L++)for(T.morphColors[L]={},T.morphColors[L].name=S.morphColors[L].name,T.morphColors[L].colors=[],q=T.morphColors[L].colors,W=S.morphColors[L].colors,Z=0,te=W.length;Z<te;Z+=3)$=new c.Color(16755200),$.setRGB(W[Z],W[Z+1],W[Z+2]),q.push($)}}function I(S,T){var E=[],L=[];S.animation!==void 0&&L.push(S.animation),S.animations!==void 0&&(S.animations.length?L=L.concat(S.animations):L.push(S.animations));for(var F,x=0;x<L.length;x++)F=p.parseAnimation(L[x],T.bones),F&&E.push(F);if(T.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(T.morphTargets,10);E=E.concat(O)}0<E.length&&(T.animations=E)}return function(S,T){S.data!==void 0&&(S=S.data),S.scale=S.scale===void 0?1:1/S.scale;var E=new v;if(E.morphColors=[],C(S,E),P(S,E),R(S,E),I(S,E),E.computeFaceNormals(),E.computeBoundingSphere(),S.materials===void 0||S.materials.length===0)return{geometry:E};var L=f.prototype.initMaterials(S.materials,T,"Anonymous");if(S.materials[0].video){var F=T+S.materials[0].video;this.paramsString&&(F+="?".concat(this.paramsString));var x=new _(F);E._video=x}return L&&0<L.length&&(L[0].side=S.materials[0].singleSided?c.FrontSide:S.materials[0].flipSided?c.BackSide:c.DoubleSide,S.materials[0].specularCoef&&(L[0].shininess=Math.floor(S.materials[0].specularCoef/3))),{geometry:E,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,g){this.handlers.push(p,g)},get:function(p){for(var g=this.handlers,m=0,h=g.length;m<h;m+=2){var b=g[m],y=g[m+1];if(b.test(p))return y}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,g,m){for(var h=[],b=0;b<p.length;++b)h[b]=this.createMaterial(p[b],g,m);return h},createMaterial:function(){var d={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,g=new c.TextureLoader,m=new c.MaterialLoader;return function(h,b,y){function v(C,P,R,I,S){var T,E=b+C,L=f.Handlers.get(E);L===null?(g.setCrossOrigin(y),T=g.load(E)):T=L.load(E),P!==void 0&&(T.repeat.fromArray(P),P[0]!==1&&(T.wrapS=c.RepeatWrapping),P[1]!==1&&(T.wrapT=c.RepeatWrapping)),R!==void 0&&T.offset.fromArray(R),I!==void 0&&(I[0]==="repeat"&&(T.wrapS=c.RepeatWrapping),I[0]==="mirror"&&(T.wrapS=c.MirroredRepeatWrapping),I[1]==="repeat"&&(T.wrapT=c.RepeatWrapping),I[1]==="mirror"&&(T.wrapT=c.MirroredRepeatWrapping)),S!==void 0&&(T.anisotropy=S);var F=c.MathUtils.generateUUID();return M[F]=T,F}var M={},A={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var _ in h){var w=h[_];switch(_){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":A.name=w;break;case"blending":A.blending=d[w];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",_,"is no longer supported.");break;case"colorDiffuse":A.color=p.fromArray(w).getHex();break;case"colorSpecular":A.specular=p.fromArray(w).getHex();break;case"colorEmissive":A.emissive=p.fromArray(w).getHex();break;case"specularCoef":A.shininess=w;break;case"shading":w.toLowerCase()==="basic"&&(A.type="MeshBasicMaterial"),w.toLowerCase()==="phong"&&(A.type="MeshPhongMaterial"),w.toLowerCase()==="standard"&&(A.type="MeshStandardMaterial");break;case"mapDiffuse":A.map=v(w,h.mapDiffuseRepeat,h.mapDiffuseOffset,h.mapDiffuseWrap,h.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":A.emissiveMap=v(w,h.mapEmissiveRepeat,h.mapEmissiveOffset,h.mapEmissiveWrap,h.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":A.lightMap=v(w,h.mapLightRepeat,h.mapLightOffset,h.mapLightWrap,h.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":A.aoMap=v(w,h.mapAORepeat,h.mapAOOffset,h.mapAOWrap,h.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":A.bumpMap=v(w,h.mapBumpRepeat,h.mapBumpOffset,h.mapBumpWrap,h.mapBumpAnisotropy);break;case"mapBumpScale":A.bumpScale=w;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":A.normalMap=v(w,h.mapNormalRepeat,h.mapNormalOffset,h.mapNormalWrap,h.mapNormalAnisotropy);break;case"mapNormalFactor":A.normalScale=w;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":A.specularMap=v(w,h.mapSpecularRepeat,h.mapSpecularOffset,h.mapSpecularWrap,h.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":A.metalnessMap=v(w,h.mapMetalnessRepeat,h.mapMetalnessOffset,h.mapMetalnessWrap,h.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":A.roughnessMap=v(w,h.mapRoughnessRepeat,h.mapRoughnessOffset,h.mapRoughnessWrap,h.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":A.alphaMap=v(w,h.mapAlphaRepeat,h.mapAlphaOffset,h.mapAlphaWrap,h.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":A.side=c.BackSide;break;case"doubleSided":A.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),A.opacity=w;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":A[_]=w;break;case"vertexColors":w===!0&&(A.vertexColors=c.VertexColors),w==="face"&&(A.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",_,w)}}return A.type==="MeshBasicMaterial"&&delete A.emissive,A.type!=="MeshPhongMaterial"&&delete A.specular,1>A.opacity&&(A.transparent=!0),m.setTextures(M),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var d=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,g){var m=p/g*d.video.duration;d.video.currentTime=m},this.getVideoDuration=function(){return d.video.duration},this.createCanvasVideoTexture=function(){return d.videoTexture=new c.VideoTexture(d.video),d.videoTexture.minFilter=c.LinearFilter,d.videoTexture.magFilter=c.LinearFilter,d.videoTexture.format=c.RGBFormat,d.video.currentTime=0,d.videoTexture},this.getCurrentTime=function(p){return d.video?p*(d.video.currentTime/d.video.duration):0},this.isReadyToPlay=function(){return!!(d.video&&3<=d.video.readyState)},function(){document&&(d.video=document.createElement("video"),d.video.crossOrigin="anonymous",d.video.src=f,d.video.load(),d.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,d=u(5).toBufferGeometry,p=u(5).getCircularTexture,g=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var h=[],b=1,y=!1,v=500,M=!0;this.createMesh=(w,C,P)=>{if(w&&C){var R=d(w,P),I=p();C.map=I;var S=new f(R,C);this.setMesh(S,P.localTimeEnabled,P.localMorphColour)}};var A=(w,C,P,R)=>{if(P){var I=new c.Color(R),S=new g(P,I);S.setPosition(C[0],C[1],C[2]);var T=S.getSprite();T.material.sizeAttenuation=!1,T.material.alphaTest=.5,T.material.transparent=!0,T.material.depthWrite=!1,T.material.depthTest=y,S.setFontWeight(v),S.setSize(b),S.setVisibility(M),this.group.add(T),h[w]=S}},_=w=>{var C=h[w];if(C){var P=C.getSprite();this.group.remove(P),C.dispose(),h.splice(w,1)}};this.addPoints=(w,C,P)=>{if(w&&0<w.length){var R=this.drawRange;R===-1&&(R=0);var I=this.addVertices(w),S=this.getMorph();if(!S){var T=new c.PointsMaterial({alphaTest:.5,size:10,color:P,sizeAttenuation:!1}),E={localTimeEnabled:!1,localMorphColour:!1};I.colorsNeedUpdate=!0,this.createMesh(I,T,E)}var L=R+w.length,F=0;if(Array.isArray(C)&&C.length===w.length||typeof C=="string")for(h.length,R;R+F<L;){var x=typeof C=="string"?C:C[F];A(R+F,w[F],x,this._lod._material.color),F++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setColourHex=function(w){this._lod._material.color.setHex(w),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(w);for(var C=0;C<h.length;C++)h[C]&&h[C].setColour(this._lod._material.color)},this.setColour=w=>{this._lod.setColour(w);for(var C=0;C<h.length;C++)h[C]&&h[C].setColour(this._lod._material.color)},this.setLabelDepthTest=w=>{y=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setDepthTest(w)},this.setLabelFontWeight=w=>{v=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setFontWeight(w)},this.setLabelSize=w=>{b=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setSize(b)},this.displayLabels=w=>{M=w;for(var C=0;C<h.length;C++)h[C]&&h[C].setVisibility(M)},this.setSize=w=>{this.morph&&this.morph.material&&(this.morph.material.size=w,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=w=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=w,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(w){if(0<=w&&this.drawRange>w){var C=this.getMorph().geometry.getAttribute("position");return[C.getX(w),C.getY(w),C.getZ(w)]}},this.editVertices=function(w,C){if(w&&w.length){var P=this.getMorph(),R=C+w.length-1;if(!P||0>C||R>=this.drawRange)return;var I=P.geometry.getAttribute("position"),S=C;w.forEach(T=>{var E=h[S];E&&E.setPosition(T[0],T[1],T[2]),I.setXYZ(S++,T[0],T[1],T[2])}),I.needsUpdate=!0,P.geometry.computeBoundingBox(),P.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}},this.deleteVertices=function(w){var C=m.prototype.deleteVertices.call(this,w);return C&&_(w),this.drawRange},this.setName=function(w){var C=this.groupName;m.prototype.setName.call(this,w),h.forEach(P=>{P.getString()===C&&(P==null||P.setText(w))})},this.render=(w,C,P,R)=>{this.morph&&P&&(this.morph.sizePerPixel=P.pixelHeight),m.prototype.render.call(this,w,C,P,R)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,d=new c.Ray,p=new c.Sphere,g=new c.Vector3,m=new c.Vector3,h=new c.Vector3;class b extends c.Object3D{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,_=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=A,this.material=_,this.sizePerPixel=1,this.updateMorphTargets()}copy(A){return super.copy(A),this.material=A.material,this.geometry=A.geometry,this}raycast(A,_){var w=this.geometry,C=this.matrixWorld,P=A.params.Points.threshold,R=w.drawRange;if(w.boundingSphere===null&&w.computeBoundingSphere(),p.copy(w.boundingSphere),p.applyMatrix4(C),p.radius+=P,A.ray.intersectsSphere(p)!==!1){f.copy(C).invert(),d.copy(A.ray).applyMatrix4(f);var I=P/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,S=I*I;if(w.isBufferGeometry){var T=w.index,E=w.attributes,L=E.position,F=w.morphAttributes.position;if(T!==null)for(var x,O=Math.max(0,R.start),B=Math.min(T.count,R.start+R.count),N=O;N<B;N++)x=T.getX(N),v(this,L,F,x),y(g,x,S,C,A,_,this);else for(var k=Math.max(0,R.start),z=Math.min(L.count,R.start+R.count),G=k;G<z;G++)v(this,L,F,G),y(g,G,S,C,A,_,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var A=this.geometry;if(A.isBufferGeometry){var _=A.morphAttributes,w=Object.keys(_);if(0<w.length){var C=_[w[0]];if(C!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var P,R=0,I=C.length;R<I;R++)P=C[R].name||R+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[P]=R}}}else{var S=A.morphTargets;S!==void 0&&0<S.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function y(M,A,_,w,C,P,R){var I=d.distanceSqToPoint(M);if(I<_){var S=new c.Vector3;d.closestPointToPoint(M,S),S.applyMatrix4(w);var T=C.ray.origin.distanceTo(S);if(T<C.near||T>C.far)return;P.push({distance:T,distanceToRay:Math.sqrt(I),point:S,index:A,face:null,object:R})}}function v(M,A,_,w){g.fromBufferAttribute(A,w);var C=M.morphTargetInfluences;if(M.material.morphTargets&&_&&C){m.set(0,0,0);for(var P=0,R=_.length;P<R;P++){var I=C[P],S=_[P];I!==0&&(h.fromBufferAttribute(S,w),m.addScaledVector(h.sub(g),I))}g.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,d=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,g,m)=>{if(p&&g){var h=f(p,m);m.localMorphColour&&h.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(h,g);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,g)=>{if(p&&0<p.length){var m=this.addVertices(p),h=this.getMorph();if(!h){var b=new c.LineBasicMaterial({color:g});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=d},(o,l,u)=>{function c(g,m,h,b,y,v,M){try{var A=g[v](M),_=A.value}catch(w){return void h(w)}A.done?m(_):Promise.resolve(_).then(b,y)}function f(g){return function(){var m=this,h=arguments;return new Promise(function(b,y){function v(_){c(A,b,y,v,M,"next",_)}function M(_){c(A,b,y,v,M,"throw",_)}var A=g.apply(m,h);v(void 0)})}}var d=u(4),p=function(){var g=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(h){var b=1,y=1,v=0;if(h&&h.length){g.isLoading=!0;var M=new Image;M.crossOrigin="Anonymous";for(var A,_=document.createElement("canvas"),w=0,C=Array(h.length),P=0;P<h.length;P++)A=yield g.imageToUint8Array(g,M,h[P],_),A&&A.array&&(b=A.width,y=A.height,C[v]=A.array,w+=C[v].length,v++);var R=new Uint8Array(w);w=0,C.forEach(I=>{R.set(I,w),w+=I.length}),g.impl=new d.DataTexture2DArray(R,b,y,v),g.size={width:b,height:y,depth:v},g.isLoading=!1,g.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var h;if(!m)h=new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=d.FrontSide;m.side&&(y=m.side),h=new d.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(h.glslVersion=m.glslVersion)}if(h)return h.needsUpdate=!0,h}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(g,m,h,b,y,v,M){try{var A=g[v](M),_=A.value}catch(w){return void h(w)}A.done?m(_):Promise.resolve(_).then(b,y)}function f(g){return function(){var m=this,h=arguments;return new Promise(function(b,y){function v(_){c(A,b,y,v,M,"next",_)}function M(_){c(A,b,y,v,M,"throw",_)}var A=g.apply(m,h);v(void 0)})}}var d=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(g,m){return new Promise((h,b)=>{g.onload=()=>h(g),g.onerror=b,g.src=m})},p.prototype.imageToUint8Array=function(){var g=f(function*(m,h,b,y){yield m.loadImage(h,b),y.width=h.width,y.height=h.height;var v=y.getContext("2d");return v.drawImage(h,0,0),{array:new Uint8Array(v.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return g.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var g=f(function*(){});return function(){return g.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,v){var M=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);v&&(A=A.filter(function(_){return Object.getOwnPropertyDescriptor(y,_).enumerable})),M.push.apply(M,A)}return M}function f(y){for(var v,M=1;M<arguments.length;M++)v=arguments[M]==null?{}:arguments[M],M%2?c(Object(v),!0).forEach(function(A){d(y,A,v[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(v)):c(Object(v)).forEach(function(A){Object.defineProperty(y,A,Object.getOwnPropertyDescriptor(v,A))});return y}function d(y,v,M){return(v=p(v))in y?Object.defineProperty(y,v,{value:M,enumerable:!0,configurable:!0,writable:!0}):y[v]=M,y}function p(y){var v=g(y,"string");return typeof v=="symbol"?v:v+""}function g(y,v){if(typeof y!="object"||!y)return y;var M=y[Symbol.toPrimitive];if(M!==void 0){var A=M.call(y,v);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(y)}var m=u(4),h=u(28),b=function(y){u(29).TexturePrimitive.call(this,y),this.isTextureSlides=!0;var v=[],M={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var A=void 0,_=!0,w=0,C=1,P=!0;this.createSlides=S=>{S.forEach(T=>this.createSlide(T))};var R=(S,T)=>{var E=S.material,L=E.uniforms;switch(S.rotation.x=0,S.rotation.y=0,S.rotation.z=0,S.position.x=0,S.position.y=0,S.position.z=0,T.direction){case"x":var F=-Math.PI/2;S.rotation.y=F,L.direction.value=1,L.slide.value.set(T.value,0,0),S.position.x=T.value;break;case"y":S.rotation.x=Math.PI/2,L.direction.value=2,L.slide.value.set(0,T.value,0),S.position.y=T.value;break;case"z":L.direction.value=3,L.slide.value.set(0,0,T.value),S.position.z=T.value;break}E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=S=>{S&&S.id&&S.id in M&&M[S.id]&&R(M[S.id],S)},this.createSlide=S=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&S&&S.direction&&S.value!==void 0){var T=new m.PlaneGeometry(1,1);T.translate(.5,.5,0);var E=h.getUniforms();E.brightness.value=w,E.contrast.value=C,E.diffuse.value=this.texture.impl,E.discardAlpha.value=P,E.depth.value=this.texture.size.depth,E.flipY.value=_;var L={fs:h.fs,vs:h.vs,uniforms:E,glslVersion:h.glslVersion,side:m.DoubleSide,transparent:!1},F=this.texture.getMaterial(L);F.needsUpdate=!0;var x=new m.Mesh(T,F);x.name=this.groupName,x.userData=this;var O={value:S.value,direction:S.direction,id:x.id};return v.push(O),R(x,O),M[x.id]=x,this.morph.add(x),this.boundingBoxUpdateRequired=!0,O}},this.getTextureSettings=()=>[...v],this.getTextureSettingsWithId=S=>{for(var T=0;T<v.length;T++)if(S===v[T].id)return f({},v[T])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=S=>{S&&this.removeSlideWithId(S.id)},this.removeSlideWithId=S=>{if(this.morph&&S in M&&M[S]){if(this.morph.getObjectById(S)){var T=M[S];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var E=v.findIndex(L=>L.id===S);-1<E&&v.splice(E,1)}},this.dispose=()=>{this.morph.children.forEach(S=>{S.geometry&&S.geometry.dispose(),S.material&&S.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var I=(S,T,E)=>{if(T)switch(T.direction.value){case 1:E.copy(T.slide.value),S.expandByPoint(E),E.setY(1),E.setZ(1),S.expandByPoint(E);break;case 2:E.copy(T.slide.value),S.expandByPoint(E),E.setX(1),E.setZ(1),S.expandByPoint(E);break;case 3:E.copy(T.slide.value),S.expandByPoint(E),E.setX(1),E.setY(1),S.expandByPoint(E);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var S=new m.Vector3(0,0,0);this.morph.children.forEach(T=>{I(this.cachedBoundingBox,T.material.uniforms,S)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(S,T,E)=>{var L=new m.Matrix4;L.set(S[0],S[1],S[2],0,S[3],S[4],S[5],0,S[6],S[7],S[8],0,0,0,0,0);var F=new m.Quaternion().setFromRotationMatrix(L);this.morph.position.set(...T),this.morph.quaternion.copy(F),this.morph.scale.set(...E),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=S=>{this.morph.renderOrder=S},this.initialise=(S,T)=>{if(S){var E=S.locations;E&&0<E.length&&(this.applyTransformation(E[0].orientation,E[0].position,E[0].scale),"flipY"in E[0]&&(_=E[0].flipY)),this.createSlides(S.settings.slides),T!=null&&typeof T=="function"&&T(this)}},this.showEdges=S=>{if(A)A.material.color=S;else{var T=new m.BoxGeometry(1,1,1);T.translate(.5,.5,.5);var E=new m.EdgesGeometry(T);A=new m.LineSegments(E,new m.LineBasicMaterial({color:S})),this.group.add(A)}A.visible=!0},this.isAlphaPixelDiscarded=()=>P,this.discardAlphaPixel=S=>{P=S,this.morph.children.forEach(T=>{var E=T.material;if(E.type==="ShaderMaterial"){var L=E.uniforms;L.discardAlpha.value=P,E.needsUpdate=!0}})},this.getBrightness=()=>w,this.setBrightness=S=>{w=S,this.morph.children.forEach(T=>{var E=T.material;if(E.type==="ShaderMaterial"){var L=E.uniforms;L.brightness.value=w,E.needsUpdate=!0}})},this.getContrast=()=>C,this.setContrast=S=>{0<=C&&(C=S,this.morph.children.forEach(T=>{var E=T.material;if(E.type==="ShaderMaterial"){var L=E.uniforms;L.contrast.value=C,E.needsUpdate=!0}}))},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,d=`
3185
3185
  precision highp float;
3186
3186
  precision highp int;
3187
3187
  precision highp sampler2DArray;
@@ -3231,11 +3231,11 @@ void main() {
3231
3231
  vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth);
3232
3232
 
3233
3233
  }
3234
- `,g=function(){return{brightness:{value:0},contrast:{value:1},depth:{value:1},discardAlpha:{value:!0},diffuse:{value:void 0},direction:{value:1},flipY:{value:!0},slide:{value:new c.Vector3(0,0,1)}}};l.fs=d,l.vs=p,l.glslVersion=f,l.getUniforms=g},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(d){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=d,this.load=(p,g)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,h=[];p.images.source.forEach(y=>{h.push(c(y))});var b=this;m.loadFromImages(h).then(()=>{b.texture=m,b.initialise(p,g)})}},this.initialise=(p,g)=>{g!=null&&typeof g=="function"&&g(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(d){var p=d,g=void 0,m=void 0,h=new c.Clock(!1);this.playAnimation=!0;var b=1e3,y={},v=0,M={},A=0,_={},w=0,C={},P=0,R=void 0,I=void 0,S=void 0,T=void 0,E=[],L=[],F=new c.Group,x=void 0,O=void 0,B=!1,N=!1;this.getDrawingWidth=()=>p?p.clientWidth:x?typeof x.clientWidth>"u"?Math.round(x.width):Math.round(x.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:x?typeof x.clientHeight>"u"?Math.round(x.height):Math.round(x.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var Z=this.getDrawingWidth(),te=this.getDrawingHeight();if(g!=null){var q;p?(q=p.getBoundingClientRect(),g.setSize(Z,te)):x&&(typeof x.getBoundingClientRect>"u"||(q=x.getBoundingClientRect(),x.width=Z,x.height=te),g.setSize(Z,te,!1)),q&&(q.left,q.top);var j=new c.Vector2;g.getSize(j),j.x,j.y}},this.initialiseVisualisation=Z=>{if(!N){if(Z=Z||{},Z.antialias===void 0){var te=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(te=!0)}catch{te=!1}Z.antialias=!te}Z.canvas&&(p=void 0,x=Z.canvas),g=new c.WebGLRenderer(Z),p!==void 0&&p.appendChild(g.domElement),g.setClearColor(16777215,1),x&&x.style&&(x.style.height="100%",x.style.width="100%");var q=g.domElement;q.addEventListener("webglcontextlost",k,!1),q.addEventListener("webglcontextrestored",z,!1),g.autoClear=!1;var j=this.createScene("default");this.setCurrentScene(j),N=!0}};var k=Z=>{Z.preventDefault();for(var te of Object.keys(y))_.hasOwnProperty(te)&&_[te].call()},z=Z=>{Z.preventDefault();for(var te of Object.keys(y))C.hasOwnProperty(te)&&C[te].call()};this.getCurrentScene=()=>m,this.setCurrentScene=Z=>{if(Z){this.removeActiveScene(Z);var te=m;m=Z,te&&te.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(F),this.onWindowResize()}},this.getSceneByName=Z=>E[Z],this.createScene=Z=>{if(E[Z]==null){var te;return te=x?new(u(32)).Scene(x,g):new(u(32)).Scene(p,g),E[Z]=te,te.sceneName=Z,te}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var Z=m.getBoundingBox();if(Z){for(var te,q=0;q<L.length;q++)te=L[q].getBoundingBox(),te&&Z.union(te);m.viewAllWithBoundingBox(Z)}}},this.loadModelsURL=(Z,te,q,j,$,X)=>{m.loadModelsURL(Z,te,q,j,$,X)},this.loadViewURL=Z=>{m.loadViewURL(Z)},this.loadFromViewURL=(Z,te)=>{m.loadFromViewURL(Z,te)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var G=()=>{B?(R=requestAnimationFrame(G),this.render()):(cancelAnimationFrame(R),R=void 0)};this.stopAnimate=()=>{B&&(h.stop(),B=!1)},this.animate=()=>{B||(h.start(),B=!0,G())},this.addContextLostCallbackFunction=Z=>(++w,_[w]=Z,w),this.removeContextLostCallbackFunction=Z=>{Z in _&&delete _[Z]},this.addContextRestoredCallbackFunction=Z=>(++P,C[P]=Z,P),this.removeContextRestoredCallbackFunction=Z=>{Z in P&&delete P[Z]},this.addPreRenderCallbackFunction=Z=>(++v,y[v]=Z,v),this.removePreRenderCallbackFunction=Z=>{Z in y&&delete y[Z]},this.addPostRenderCallbackFunction=Z=>(++A,M[A]=Z,A),this.removePostRenderCallbackFunction=Z=>{Z in M&&delete M[Z]},this.getPlayRate=()=>b,this.setPlayRate=Z=>{b=Z},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=Z=>{m.setMorphsTime(Z)},this.getZincGeometryByID=Z=>m.getZincGeometryByID(Z),this.addToScene=Z=>{m.addObject(Z)},this.addToOrthoScene=Z=>{if(S==null&&(S=new c.Scene),I==null){var te=this.getDrawingWidth(),q=this.getDrawingHeight();I=new c.OrthographicCamera(-te/2,te/2,q/2,-q/2,1,10),I.position.z=10}S.add(Z)};var Y=Z=>te=>{te.needsUpdate=!0;var q=new c.SpriteMaterial({map:te}),j=q.map.image.width,$=q.map.image.height;Z.material=q,Z.scale.set(j,$,1);var X=this.getDrawingWidth(),K=this.getDrawingHeight();Z.position.set((X-j)/2,(-K+$)/2,1),this.addToOrthoScene(Z)};this.addLogo=()=>{T=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,Y(T))},this.render=()=>{O||(p?0<p.clientWidth&&0<p.clientHeight&&(O=new f(p,this.onWindowResize)):x&&0<x.width&&0<x.height&&(O=new f(x,this.onWindowResize)));var Z=h.getDelta();m.renderGeometries(b,Z,this.playAnimation);for(var te,q=0;q<L.length;q++)te=L[q],te.renderGeometries(b,Z,this.playAnimation);I!=null&&S!=null&&(g.clearDepth(),g.render(S,I));for(var j of Object.keys(y))y.hasOwnProperty(j)&&y[j].call();m.render(g);for(var $ of Object.keys(M))M.hasOwnProperty($)&&M[$].call()},this.forceContextLoss=()=>{g.forceContextLoss()},this.forceContextRestore=()=>{g.forceContextRestore()},this.getThreeJSRenderer=()=>g,this.isSceneActive=Z=>{if(m===Z)return!0;for(var te,q=0;q<L.length;q++)if(te=L[q],te===Z)return!0;return!1},this.addActiveScene=Z=>{this.isSceneActive(Z)||(L.push(Z),F.add(Z.getThreeJSScene()))},this.removeActiveScene=Z=>{for(var te,q=0;q<L.length;q++)if(te=L[q],te===Z)return L.splice(q,1),void F.remove(Z.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var Z=0;Z<L.length;Z++)F.remove(L[Z].getThreeJSScene());L.splice(0,L.length)},this.dispose=()=>{var Z;for(var te in B&&cancelAnimationFrame(R),E)E.hasOwnProperty(te)&&E[te].clearAll();E=[],L=[],F=new c.Group,this.stopAnimate(),y={},v=0,M={},M=0,_={},w=0,C={},P=0,I=void 0,S=void 0,T=void 0;var q=this.createScene("default");this.setCurrentScene(q),O=void 0,(Z=g)===null||Z===void 0||Z.dispose()},this.transitionScene=(Z,te)=>{if(m){var q=m.getZincCameraControls(),j=Z.getBoundingBox();if(j){var $=j.min.distanceTo(j.max)/2,X=(j.min.x+j.max.x)/2,K=(j.min.y+j.max.y)/2,re=(j.min.z+j.max.z)/2,V=q.getViewportFromCentreAndRadius(X,K,re,$,40,$*4),W=q.getCurrentViewport();q.cameraTransition(W,V,te),q.enableCameraTransition()}}},this.isWebGL2=()=>!!g&&g.capabilities.isWebGL2}},o=>{o.exports=eD()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,d=u(35).SceneLoader,p=u(42).SceneExporter,g=u(44).Viewport,m=u(5).createBufferGeometry,h=u(5).getCircularTexture,b=u(5).createNewSpriteText,y=0,v=function(){return"sc"+y++},M=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},A=6e3;l.Scene=function(_,w){var C=this,P=_,R=void 0,I=void 0,S=new d(this),T=void 0,E={},L=0,F={},x=0,O=new c.Scene,B=new c.Scene,N=new(u(45)).Region(void 0,this);O.add(N.getGroup());var k=new c.Group;O.add(k),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var z=6e3,G=void 0;this.sceneName=void 0;var Y=!1,Z=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.displayMiniAxes=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-right",updateRequired:!0};var te={x:0,y:0},q=M(),j=new c.Vector2,$=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var X=new f(this);X.disable(),O.add(X.group);var K={main:[],mini:[]},re=new c.Vector3(0,0,0),V=()=>P?typeof P.clientWidth>"u"?P.width:P.clientWidth:0,W=()=>P?typeof P.clientHeight>"u"?P.height:P.clientHeight:0;this.getDownloadProgress=()=>S.getDownloadProgress(),this.onWindowResize=()=>{var D=W();this.camera.aspect=V()/D,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,G.onResize(),G.calculateHeightPerPixelAtZeroDepth(D)},this.resetView=()=>{this.onWindowResize(),G.resetView()},this.changeZoomByScrollRateUnit=D=>{G.changeZoomByScrollRateUnit(D)};var oe=()=>{this.camera=new c.PerspectiveCamera(40,V()/W(),0,10),this.ambient=new c.AmbientLight(16777215,.2),O.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),O.add(this.directionalLight),G=new(u(44)).CameraControls(this.camera,w.domElement,w,this),G.setDirectionalLight(this.directionalLight),G.resetView(),T=new(u(50)).Minimap(this)};oe(),this.loadView=D=>{var Q=new g;return Q.setFromObject(D),G.setCurrentCameraSettings(Q),!0},this.setupMultipleViews=(D,Q)=>{for(var[ie,ce]of Object.entries(Q)){var ge=new g;ge.setFromObject(ce),G.addViewport(ie,ge)}G.setDefaultViewport(D)},this.getBoundingBox=()=>N.getBoundingBox(!0),this.viewAllWithBoundingBox=D=>{if(D){var Q=G.getViewportFromBoundingBox(D,1);G.setCurrentCameraSettings(Q),G.calculateHeightPerPixelAtZeroDepth(W()),X.markerUpdateRequired=!0}},this.viewAll=()=>{var D=this.getBoundingBox();this.viewAllWithBoundingBox(D),X.markerUpdateRequired=!0},this.forEachGeometry=D=>{N.forEachGeometry(D,!0)},this.forEachGlyphset=D=>{N.forEachGlyphset(D,!0)},this.forEachPointset=D=>{N.forEachPointset(D,!0)},this.forEachLine=D=>{N.forEachLine(D,!0)},this.findGeometriesWithGroupName=D=>N.findGeometriesWithGroupName(D,!0),this.findPointsetsWithGroupName=D=>N.findPointsetsWithGroupName(D,!0),this.findGlyphsetsWithGroupName=D=>N.findGlyphsetsWithGroupName(D,!0),this.findLinesWithGroupName=D=>N.findLinesWithGroupName(D,!0),this.findObjectsWithGroupName=D=>N.findObjectsWithGroupName(D,!0),this.findObjectsWithAnatomicalId=D=>N.findObjectsWithAnatomicalId(D,!0),this.getBoundingBoxOfZincObjects=D=>{for(var Q,ie=void 0,ce=0;ce<D.length;ce++)Q=D[ce].getBoundingBox(),Q&&(ie?ie.union(Q):ie=Q);return ie},this.vectorToScreenXY=D=>{D.project(this.camera);var Q=V(),ie=W(),ce=Q/2,ge=ie/2;return D.x=D.x*ce+ce,D.y=-(D.y*ge)+ge,D},this.getObjectsScreenXY=D=>{if(D&&0<D.length){var Q=this.getBoundingBoxOfZincObjects(D),ie=new c.Vector3;return Q.getCenter(ie),this.vectorToScreenXY(ie)}},this.getNamedObjectsScreenXY=D=>{var Q=this.findObjectsWithGroupName(D);return this.getObjectsScreenXY(Q)},this.addZincObject=D=>{D&&(N.addZincObject(D),G&&G.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(D,Q,ie,ce)=>{S.loadGlyphsetURL(N,D,Q,ie,ce)},this.loadPointsetURL=(D,Q,ie,ce,ge)=>{S.loadPointsetURL(N,D,Q,ie,ce,ge)},this.loadLinesURL=(D,Q,ie,ce,ge)=>{S.loadLinesURL(N,D,Q,ie,ce,ge)},this.loadSTL=(D,Q,ie)=>{S.loadSTL(N,D,Q,ie)},this.loadOBJ=(D,Q,ie)=>{S.loadOBJ(N,D,Q,ie)},this.loadMetadataURL=(D,Q,ie,ce)=>{S.loadMetadataURL(N,D,Q,ie,ce)},this.loadModelsURL=(D,Q,ie,ce,ge,ye)=>{S.loadModelsURL(N.urls,Q,ie,ce,ge,ye)},this.loadViewURL=D=>{S.loadViewURL(D)},this.loadFromViewURL=(D,Q)=>{S.loadFromViewURL(D,Q)},this.loadGLTF=(D,Q,ie,ce)=>{S.loadGLTF(N,D,Q,ie,ce)},this.updateDirectionalLight=()=>{G.updateDirectionalLight()},this.addObject=D=>{O.add(D)},this.removeObject=D=>{O.remove(D)},this.getCurrentTime=()=>{if(I!=null)return I.getCurrentTime(z);var D=N.getCurrentTime();return D===-1?0:D},this.setMorphsTime=D=>{I!=null&&I.setMorphTime(D,z),N.setMorphTime(D,!0)},this.isTimeVarying=()=>!!(I&&I.video&&!I.video.error)||N.isTimeVarying(),this.renderGeometries=(D,Q,ie)=>{var ce={};if(ce.camera=G,ce.displayMarkers=this.displayMarkers,ce.markerCluster=X,ce.markersList=X.markers,ce.ndcToBeUpdated=!1,ie&&(ce.markerCluster.markerUpdateRequired=!0),!I)S.toBeDownloaded==0?(ce.ndcToBeUpdated=G.update(Q),ce.ndcToBeUpdated&&G.calculateHeightPerPixelAtZeroDepth(W()),N.renderGeometries(D,Q,ie,G,ce,!0)):G.update(0);else if(I.isReadyToPlay()){ie?I.video.play():I.video.pause();var ge=I.video.currentTime/I.getVideoDuration()*z;S.toBeDownloaded==0?(G.setTime(ge),ce.ndcToBeUpdated=G.update(0),ce.ndcToBeUpdated&&G.calculateHeightPerPixelAtZeroDepth(W()),N.setMorphTime(ge,!0),N.renderGeometries(0,0,ie,G,ce,!0)):G.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>O,this.setVideoHandler=D=>{I||(I=D)},this.setAdditionalScenesGroup=D=>{O.add(D)};var ae=(D,Q,ie,ce,ge,ye,ue)=>{var be=0,ne=0;return ne=D.includes("top")?ue-ge-ie:D.includes("bottom")?ie:Math.floor((ue-ge)/2),be=D.includes("left")?Q:D.includes("right")?ye-Q-ce:Math.floor((ye-ce)/2),{x:be,y:ne}},le=D=>{(this.displayMinimap||this.displayMiniAxes)&&(D.setScissorTest(!0),D.getSize(j),this.minimapScissor.updateRequired&&(te=ae(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,j.x,j.y),this.minimapScissor.updateRequired=!1),D.setScissor(te.x,te.y,this.minimapScissor.width,this.minimapScissor.height),D.setViewport(te.x,te.y,this.minimapScissor.width,this.minimapScissor.height),T.updateCamera(),this.displayMiniAxes?D.render(B,T.camera):(O.add(T.mask),D.render(O,T.camera),O.remove(T.mask)),D.setScissorTest(!1),D.setViewport(0,0,j.x,j.y))};this.render=D=>{this.autoClearFlag&&D.clear(),Y&&Z?Z.render(O,this.camera):(D.render(O,this.camera),le(D))},this.setInteractiveControlEnable=D=>{D==!0?G.enable():G.disable()},this.getZincCameraControls=()=>G,this.getThreeJSScene=()=>O,this.setDuration=D=>{N.setDuration(D),z=D,G.setPathDuration(D),S.duration=D},this.getDuration=()=>z,this.setStereoEffectEnable=D=>{D!=!0||Z||(Z=new u(44).StereoEffect(w)),w.setSize(V(),W()),this.camera.updateProjectionMatrix(),Y=D},this.objectIsInScene=D=>N.objectIsInRegion(D,!0),this.alignBoundingBoxToCameraView=(D,Q)=>{if(D){D.getCenter(re);var ie=this.getZincCameraControls().getCurrentViewport(),ce=new c.Vector3(ie.targetPosition[0],ie.targetPosition[1],ie.targetPosition[2]),ge=new c.Vector3(ie.eyePosition[0],ie.eyePosition[1],ie.eyePosition[2]),ye=new c.Vector3,ue=new c.Vector3;ye.subVectors(ce,ge).normalize(),ue.subVectors(ce,re).normalize();var be=new c.Vector3;be.crossVectors(ye,ue);var ne=ye.angleTo(ue);0<Q?(this.getZincCameraControls().rotateCameraTransition(be,ne,Q),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(be,ne),X.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(D,Q,ie)=>{if(D){var ce=this.getZincCameraControls().getCurrentViewport(),ge=this.getZincCameraControls().getViewportFromBoundingBox(D,Q);0<ie&&(this.getZincCameraControls().cameraTransition(ce,ge,ie),this.getZincCameraControls().enableCameraTransition()),X.markerUpdateRequired=!0}},this.alignObjectToCameraView=(D,Q)=>{if(this.objectIsInScene(D)){var ie=D.getBoundingBox();this.alignBoundingBoxToCameraView(ie,Q)}},this.setCameraTargetToObject=D=>{if(this.objectIsInScene(D)){var Q=D.getBoundingBox(),ie=this.getZincCameraControls().getCurrentViewport();Q.getCenter(re);var ce=new c.Vector3(ie.targetPosition[0],ie.targetPosition[1],ie.targetPosition[2]),ge=new c.Vector3(ie.eyePosition[0],ie.eyePosition[1],ie.eyePosition[2]),ye=new c.Vector3,ue=new c.Vector3;ye.subVectors(ge,ce),ue.addVectors(re,ye),ie.eyePosition[0]=ue.x,ie.eyePosition[1]=ue.y,ie.eyePosition[2]=ue.z,ie.targetPosition[0]=re.x,ie.targetPosition[1]=re.y,ie.targetPosition[2]=re.z,this.getZincCameraControls().setCurrentCameraSettings(ie),X.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>Y,this.removeZincObject=D=>{N.removeZincObject(D),G&&G.calculateMaxAllowedDistance(this),X.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{$.length=0,X.isEnabled&&$.push(X.group),N.getPickableThreeJSObjects($,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||N.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),$),this.getNormalisedMinimapCoordinates=(D,Q)=>{if(this.displayMinimap){var ie=new c.Vector2;D.getSize(ie);var ce=ie.y-Q.clientY;if(te.x+this.minimapScissor.width>Q.clientX&&Q.clientX>te.x&&te.y+this.minimapScissor.height>ce&&ce>te.y){var ge=2*((Q.clientX-te.x)/this.minimapScissor.width)-1,ye=2*((ce-te.y)/this.minimapScissor.height)-1;return{x:ge,y:ye}}}},this.getMinimapDiffFromNormalised=(D,Q)=>T?T.getDiffFromNormalised(D,Q):void 0,this.isWebGL2=()=>w.isWebGL2(),this.clearAll=()=>{X.clear(),N.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),S.toBeDwonloaded=0,G&&G.calculateMaxAllowedDistance(this),X.markerUpdateRequired=!0},this.addMetadataTimeStamp=(D,Q)=>{q.TimeStamps[D]=U(Q)},this.getMetadataTag=D=>q[D],this.getMetadata=()=>q,this.setMetadataTag=(D,Q)=>{q[D]=Q},this.removeMetadataTag=D=>{delete q[D]},this.resetMetadata=()=>{q=M()},this.resetDuration=()=>{this.setDuration(A)};var H=D=>[...D.years?["".concat(D.years,"years")]:[],...D.months?["".concat(D.months,"months")]:[],...D.weeks?["".concat(D.weeks,"weeks")]:[],...D.days?["".concat(D.days,"days")]:[],...D.hours?["".concat(D.hours,"hours")]:[],...D.mins?["".concat(D.mins,"mins")]:[],...D.secs?["".concat(D.secs,"secs")]:[]].join(" "),U=D=>D.years?31536e6*D.years:0+D.months?2592e6*D.months:0+D.weeks?6048e5*D.weeks:0+D.days?864e5*D.days:0+D.hours?36e5*D.hours:0+D.mins?6e4*D.mins:0+D.secs?1e3*D.secs:0;this.setDurationFromObject=D=>{var Q=H(D),ie=U(D);this.setMetadataTag("Duration",Q),this.setDuration(ie)},this.setOriginalDurationFromObject=D=>{var Q=H(D);this.setMetadataTag("OriginalDuration",Q)},this.exportGLTF=D=>{var Q=new p(this);return Q.exportGLTF(D)},this.getRootRegion=()=>N,this.createLines=(D,Q,ie,ce)=>{var ge=N.findChildFromPath(D);return ge===void 0&&(ge=N.createChildFromPath(D)),ge.createLines(Q,ie,ce)},this.createPoints=(D,Q,ie,ce,ge)=>{var ye=N.findChildFromPath(D);return ye===void 0&&(ye=N.createChildFromPath(D)),ye.createPoints(Q,ie,ce,ge)},this.addZincObjectAddedCallbacks=D=>(++L,E[L]=D,L),this.addZincObjectRemovedCallbacks=D=>(++x,F[x]=D,x),this.removeZincObjectAddedCallbacks=D=>{D in L&&delete E[D]},this.removeZincObjectRemovedCallbacks=D=>{D in x&&delete F[D]},this.clearZincObjectAddedCallbacks=()=>{E={},L=0},this.clearZincObjectRemovedCallbacks=()=>{F={},x=0},this.triggerObjectAddedCallback=D=>{for(var Q in E)E.hasOwnProperty(Q)&&E[Q](D)},this.triggerObjectRemovedCallback=D=>{for(var Q in F)F.hasOwnProperty(Q)&&F[Q](D)},this.addTemporaryPoints=(D,Q)=>{var ie=m(D.length,D),ce=new c.PointsMaterial({alphaTest:.5,size:15,color:Q,sizeAttenuation:!1}),ge=h();ce.map=ge;var ye=new(u(23)).Points(ie,ce);return k.add(ye),ye},this.addTemporaryLines=(D,Q)=>{var ie=m(D.length,D),ce=new c.LineBasicMaterial({color:Q}),ge=new(u(12)).LineSegments(ie,ce);return k.add(ge),ge},this.enableFrustumDisplay=()=>{this.camera&&!R&&(R=new c.CameraHelper(this.camera),O.add(R))},this.disableFrustumDisplay=()=>{R&&(O.remove(R),R.dispose(),R=void 0)},this.removeTemporaryPrimitive=D=>{k.remove(D),D.geometry.dispose(),D.material.dispose()},this.clearTemporaryPrimitives=()=>{var D=0,Q=k.children;return Q.forEach(ie=>{ie.geometry.dispose(),ie.material.dispose(),D++}),k.clear(),D},this.addBoundingBoxPrimitive=function(D,Q,ie,ce,ge){var ye=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,ue=N.findChildFromPath(D);ue===void 0&&(ue=N.createChildFromPath(D));var be=ye||C.getBoundingBox();re.set(0,0,0);var ne=re.subVectors(be.max,be.min),de=new c.BoxGeometry(ne.x,ne.y,ne.z),ve=ue.createGeometryFromThreeJSGeometry(Q,de,ie,ce,ge,1e4);return ne.addVectors(be.min,be.max).multiplyScalar(.5),ve.setPosition(ne.x,ne.y,ne.z),ve},this.addSlicesPrimitive=function(D,Q,ie,ce,ge){var ye=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if(Q&&3<=Q.length&&ie&&3<=ie.length){var ue=N.findChildFromPath(D);ue===void 0&&(ue=N.createChildFromPath(D));var be=ye||C.getBoundingBox();re.set(0,0,0);var ne=re.subVectors(be.max,be.min),de=[],ve=0;return["x","y","z"].forEach(Ee=>{var Se;switch(Ee){case"x":Se=new c.PlaneGeometry(ne.z,ne.y),Se.rotateY(Math.PI/2);break;case"y":Se=new c.PlaneGeometry(ne.x,ne.z),Se.rotateX(Math.PI/2);break;case"z":Se=new c.PlaneGeometry(ne.x,ne.y);break}var Ie=ue.createGeometryFromThreeJSGeometry(Q[ve],Se,ie[ve],ce,ge,10001);de.push(Ie),ve++}),ne.addVectors(be.min,be.max).multiplyScalar(.5),de.forEach(Ee=>{Ee.setPosition(ne.x,ne.y,ne.z)}),de}},this.enableMarkerCluster=D=>{D?(X.markerUpdateRequired=!0,X.enable()):(X.markerUpdateRequired=!1,X.disable()),this.forcePickableObjectsUpdate=!0},this.destroyAxisDisplay=()=>{this.displayMiniAxes=!1,K.main&&(this.enableAxisDisplay(!1,!1),K.main.forEach(D=>{D.dispose&&D.dispose()})),K.mini&&(this.enableAxisDisplay(!1,!0),K.mini.forEach(D=>{D.dispose&&D.dispose()})),K={main:[],mini:[]}},this.createAxisDisplay=function(){var D=0<arguments.length&&arguments[0]!==void 0&&arguments[0];C.destroyAxisDisplay();var Q=[{name:"x",dir:new c.Vector3(1,0,0),colour:"red",hex:16733525},{name:"y",dir:new c.Vector3(0,1,0),colour:"green",hex:5635925},{name:"z",dir:new c.Vector3(0,0,1),colour:"blue",hex:5592575}],ie=C.getBoundingBox(),ce=ie.min.distanceTo(ie.max),ge=new c.Vector3(0,0,0);D&&ge.copy(ie.min),Q.forEach(ye=>{var ue=new c.ArrowHelper(ye.dir,ge,ce,ye.hex);K.main.push(ue);var be=new c.ArrowHelper(ye.dir,ie.getCenter(re),ce/2,ye.hex);K.mini.push(be);var ne=b(ye.name,.036,ye.colour,"Asap",120,700),de=ye.dir.clone().multiplyScalar(ce).add(ge);ne.position.set(de.x,de.y,de.z),K.main.push(ne)})},this.enableAxisDisplay=function(D){var Q,ie=1<arguments.length&&arguments[1]!==void 0&&arguments[1];ie&&(Q=K)!==null&&Q!==void 0&&(Q=Q.mini)!==null&&Q!==void 0&&Q.length?(C.displayMiniAxes=D,K.mini.forEach(ce=>{D?B.add(ce):B.remove(ce)})):!ie&&K.main&&K.main.forEach(ce=>{D?O.add(ce):O.remove(ce)})}}},(o,l,u)=>{function c(_,w){var C=Object.keys(_);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(_);w&&(P=P.filter(function(R){return Object.getOwnPropertyDescriptor(_,R).enumerable})),C.push.apply(C,P)}return C}function f(_){for(var w,C=1;C<arguments.length;C++)w=arguments[C]==null?{}:arguments[C],C%2?c(Object(w),!0).forEach(function(P){d(_,P,w[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(w)):c(Object(w)).forEach(function(P){Object.defineProperty(_,P,Object.getOwnPropertyDescriptor(w,P))});return _}function d(_,w,C){return(w=p(w))in _?Object.defineProperty(_,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[w]=C,_}function p(_){var w=g(_,"string");return typeof w=="symbol"?w:w+""}function g(_,w){if(typeof _!="object"||!_)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var P=C.call(_,w);if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(_)}var m=u(4),h=new Image(128,128);h.src=u(34);var b=new m.Texture;b.image=h,b.needsUpdate=!0;var y=[.02,.03,1],v=new m.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),M=u(5).createNewSpriteText,A=function(_){u(10).ZincObject.call(this),this.texture=b;var w=void 0;this.morph=new m.Group,this.group=this.morph,this.isMarkerCluster=!0;var C=!0,P=[];this.markers={};var R=new m.Vector2,I=new m.Vector2,S=Date.now();this.setSpriteSize=x=>{w.scale.set(.015,.02,1),w.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var T=x=>{var O=new m.Group,B=new m.Sprite(v);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(y[0],y[1],y[2]),B.userData=this,O.add(B),this.group.add(O),{group:O,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},E=(x,O,B)=>{x.group.visible=!0,x.group.position.set(O.coords[0],O.coords[1],O.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=M(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=O.min,x.max=O.max},L=x=>{var O=0;for(x.forEach(B=>{var N=B.members.length,k=0;N===1?B.members[0].setVisibility(!0):(B.members.forEach(z=>{k+=z.getNumber(),z.setVisibility(!1)}),!P[O]&&P.push(T(O)),E(P[O],B,k),O++)}),O;O<P.length;O++)P[O].group.visible=!1},F=(x,O)=>{var B=!0,N={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},k=0;for(var z in x)B?(R.set(x[z].ndc.x,x[z].ndc.y),this._b1.setFromPoints([x[z].morph.position]),B=!1,N.members.push(x[z]),N.coords=[x[z].morph.position.x,x[z].morph.position.y,x[z].morph.position.z],O.push(N),delete x[z]):(I.set(x[z].ndc.x,x[z].ndc.y),k=R.distanceTo(I),.1>k&&(N.members.push(x[z]),this._b1.expandByPoint(x[z].morph.position),delete x[z]));N.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],N.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&F(x,O)};this.calculate=()=>{if(C){var x=Date.now();if(500<x-S){var O=[];F(f({},this.markers),O),L(O),S=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>C,this.enable=()=>{C=!0,this.morph.visible=!0},this.disable=()=>{for(var x in C=!1,this.morph.visible=!1,this.markers){var O;(O=this.markers[x])!==null&&O!==void 0&&O.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1<x&&(this._v1.set(...P[x].min),this._v2.set(...P[x].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),_.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=x=>{if(x!==void 0&&-1<x&&P[x]){var O;return(O=P[x].group)===null||O===void 0?void 0:O.visible}return!1}};A.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=A},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,d=u(5).createNewURL,p=u(5).isRegionGroup,g=u(36).STLLoader,m=u(37).OBJLoader,h=u(38).PrimitivesLoader;l.SceneLoader=function(b){var y=b;this.toBeDownloaded=0,this.progressMap={};var v=!1,M=!1,A=new h;this.getDownloadProgress=()=>{var j=0,$=0,X=!1;for(var K in this.progressMap){var re=this.progressMap[K];j+=re[1],$+=re[0],re[1]==0&&(X=!0)}return X&&(j=0),[j,$,M]},this.onProgress=j=>$=>{this.progressMap[j]=[$.loaded,$.total]},this.onError=j=>$=>{--this.toBeDownloaded,M=!0,console.error("There is an issue with external resource ".concat($!=null&&$.responseURL?": "+($==null?void 0:$.responseURL):"",".")),j&&j({type:"Error",xhr:$})};var _=(j,$)=>{var X=$.Default;if($.Inline)y.setupMultipleViews(X,$.Entries);else{var K=[],re=function(ae){j&&(newURL=d(W,j),K.push(new Promise((le,H)=>{fetch(newURL).then(U=>U.json()).then(U=>le({key:ae,data:U})).catch(U=>H(U))})))};for(var[V,W]of Object.entries($.Entries))re(V);Promise.all(K).then(oe=>{var ae={};oe.forEach(H=>{ae[H.key]=H.data}),y.setupMultipleViews(X,ae);var le=y.getZincCameraControls();le&&le.setCurrentViewport(X),v=!0})}};this.loadViewURL=(j,$)=>{this.toBeDownloaded+=1;var X=new XMLHttpRequest;X.onreadystatechange=()=>{if(X.readyState==4)if(X.status==200){var re=JSON.parse(X.responseText);y.setupMultipleViews("default",{default:re}),y.resetView(),v=!0,--this.toBeDownloaded,$!=null&&typeof $=="function"&&$()}else this.onError($)({responseURL:j})};var K=f(j);X.open("GET",K,!0),X.send()},this.loadModelsURL=(j,$,X,K,re,V,W)=>{var oe=$.length;this.toBeDownloaded+=oe;for(var ae=0;ae<oe;ae++){var le=$[ae],H=u(0).defaultMaterialColor,U=u(0).defaultOpacity;X!=null&&X[ae]!=null&&(H=!!X[ae]),K!=null&&K[ae]!=null&&(U=K[ae]);var D=0;re!=null&&re[ae]!=null&&(D=!!re[ae]);var Q=0;V!=null&&V[ae]!=null&&(Q=!!V[ae]),A.load(f(le),L(j,H,U,D,Q,void 0,void 0,void 0,void 0,W),this.onProgress(le),this.onError(W))}},this.loadFromViewURL=(j,$,X)=>{var K=new XMLHttpRequest;K.onreadystatechange=()=>{if(K.readyState==4&&K.status==200){var V=JSON.parse(K.responseText);y.loadView(V);for(var W,oe=[],ae=$+"_",le=0;le<V.numberOfResources;le++)W=ae+(le+1)+".json",oe.push(W);this.loadModelsURL(j,oe,V.colour,V.opacity,V.timeEnabled,V.morphColour,X)}};var re=f($+"_view.json");K.open("GET",re,!0),K.send()};var w=(j,$,X,K,re,V,W,oe,ae)=>(le,H)=>{var U=oe?new(u(39)).TubeLines:new(u(24)).Lines,D=void 0;H&&H[0]&&(D=new c.LineBasicMaterial({color:H[0].color.clone()}),1>H[0].opacity&&(D.transparent=!0),D.opacity=H[0].opacity,D.morphTargets=$,D.vertexColors=H[0].vertexColors);var Q={localTimeEnabled:$,localMorphColour:X};if(U&&(U.createLineSegment(le,D,Q),U.setName(K),U.setAnatomicalId(re),U.setRenderOrder(V),j.addZincObject(U),U.setDuration(y.getDuration()),W&&W.levels))for(var[ie,ce]of Object.entries(W.levels))U.addLOD(A,ie,ce.URL,ce.Index,W.preload);--this.toBeDownloaded,le.dispose(),ae!=null&&typeof ae=="function"&&ae(U)};this.loadLinesURL=(j,$,X,K,re,V,W)=>{var oe=0;this.toBeDownloaded+=1;var ae=!!(W!=null&&W.isInline)&&W.isInline,le=W!=null&&W.anatomicalId?W.anatomicalId:void 0,H=W!=null&&W.renderOrder?W.renderOrder:void 0;X!=null&&(oe=!!X);var U=0;K!=null&&(U=!!K);var D=W.tubeLines&&!oe&&!U;if(ae){var Q=A.parse($);w(j,oe,U,re,le,H,W.lod,D,V)(Q.geometry,Q.materials)}else A.load($,w(j,oe,U,re,le,H,W.lod,D,V),this.onProgress($),this.onError(V),W.loaderOptions)};var C=(j,$,X,K,re)=>V=>{var W=V;(typeof W=="string"||W instanceof String)&&(W=JSON.parse(V));var oe=re&&re.isInline?re.isInline:void 0,ae=re&&re.anatomicalId?re.anatomicalId:void 0,le=re&&re.displayLabels?re.displayLabels:void 0,H=re&&re.renderOrder?re.renderOrder:void 0,U=new(u(18)).Glyphset;U.setDuration(y.getDuration()),U.groupName=X;var D=()=>{--this.toBeDownloaded,K!=null&&typeof K=="function"&&K(U)};++this.toBeDownloaded,oe?U.load(W,$,D,oe,le):U.load(W,f($),D,oe,le),U.setAnatomicalId(ae),U.setRenderOrder(H),j.addZincObject(U)};this.loadGlyphsetURL=(j,$,X,K,re,V)=>{var W=!!(V&&V.isInline)&&V.isInline;W?C(j,X,K,re,V)($):A.load($,C(j,X,K,re,V),this.onProgress($),this.onError(re),V.loaderOptions)};var P=(j,$,X,K,re,V,W)=>(oe,ae)=>{var le=new(u(22)).Pointset,H=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});ae&&ae[0]&&(1>ae[0].opacity&&(H.transparent=!0),H.opacity=ae[0].opacity,H.color=ae[0].color,H.morphTargets=$,H.vertexColors=ae[0].vertexColors);var U={};U.localTimeEnabled=$,U.localMorphColour=X,le&&(le.createMesh(oe,H,U),le.setName(K),le.setAnatomicalId(re),j.addZincObject(le),le.setDuration(y.getDuration()),le.setRenderOrder(V)),oe.dispose(),--this.toBeDownloaded,W!=null&&typeof W=="function"&&W(le)};this.loadSTL=(j,$,X,K)=>{this.toBeDownloaded+=1;var re=u(0).defaultMaterialColor,V=u(0).defaultOpacity,W=new g;W.crossOrigin="Anonymous",W.load(f($),L(j,re,V,!1,!1,X,void 0,void 0,void 0,K))},this.loadOBJ=(j,$,X,K)=>{this.toBeDownloaded+=1;var re=u(0).defaultMaterialColor,V=u(0).defaultOpacity,W=new m;W.crossOrigin="Anonymous",W.load(f($),L(j,re,V,!1,!1,X,void 0,void 0,void 0,K))};var R=(j,$,X,K,re,V,W)=>{this.toBeDownloaded+=1;var oe=u(0).defaultMaterialColor,ae=u(0).defaultOpacity,le=0,H=!!(W&&W.isInline)&&W.isInline,U=W&&W.fileFormat?W.fileFormat:void 0,D=W&&W.anatomicalId?W.anatomicalId:void 0,Q=W&&W.renderOrder?W.renderOrder:void 0;X!=null&&(le=!!X);var ie=0;K!=null&&(ie=!!K);var ce=A;if(U!==void 0){if(U=="STL")ce=new g;else if(U=="OBJ")return ce=new m,ce.crossOrigin="Anonymous",void ce.load($,objloader(j,oe,ae,le,ie,re,D,V),this.onProgress($),this.onError,W.loaderOptions)}if(H){var ge=A.parse($);L(j,oe,ae,le,ie,re,D,Q,W,V)(ge.geometry,ge.materials)}else ce.crossOrigin="Anonymous",A.load($,L(j,oe,ae,le,ie,re,D,Q,W,V),this.onProgress($),this.onError(V),W.loaderOptions)},I=function($,X,K){var re=0;return V=>{if(++re,V&&X!=null&&typeof X=="function"&&X(V),re==$&&(v==!1&&y.viewAll(),K!=null&&typeof K=="function")){K();var W=y.getZincCameraControls();W&&W.calculateMaxAllowedDistance(y)}}};this.loadPointsetURL=(j,$,X,K,re,V,W)=>{var oe=0;this.toBeDownloaded+=1,X!=null&&(oe=!!X);var ae=0;K!=null&&(ae=!!K);var le=!!(W&&W.isInline)&&W.isInline,H=W&&W.anatomicalId?W.anatomicalId:void 0,U=W&&W.renderOrder?W.renderOrder:void 0;if(le){var D=A.parse($);P(j,oe,ae,re,H,U,V)(D.geometry,D.materials)}else A.load($,P(j,oe,ae,re,H,U,V),this.onProgress($),this.onError(V),W.loaderOptions)};var S=(j,$,X,K,re,V)=>{var W=V&&V.isInline?V.isInline:void 0,oe=V&&V.anatomicalId?V.anatomicalId:void 0,ae=V&&V.renderOrder?V.renderOrder:void 0,le=void 0;if(X){if($&&X.images&&X.images.source)for(var H,U=X.images.source,D=0;D<U.length;D++)H=d(U[D],$),X.images.source[D]=H;if(X.type==="slides"&&(le=new(u(27)).TextureSlides),le){le.groupName=K;var Q=()=>{j.addZincObject(le),--this.toBeDownloaded,re!=null&&typeof re=="function"&&re(le)};++this.toBeDownloaded,le.load(X,Q,W),le.setAnatomicalId(oe),le.setRenderOrder(ae)}}},T=(j,$,X,K,re)=>()=>{if($.readyState==4&&$.status==200){var V=JSON.parse($.responseText);S(j,$.responseURL,V,X,K,re)}};this.loadTextureURL=(j,$,X,K,re)=>{var V=!!(re&&re.isInline)&&re.isInline;if(V)S(j,void 0,$,X,K,re);else{var W=new XMLHttpRequest;W.onreadystatechange=T(j,W,X,K,re),W.open("GET",f($),!0),W.send()}};var E=(j,$,X,K,re,V,W,oe,ae,le,H)=>{var U={colour:X,opacity:K,localTimeEnabled:re,localMorphColour:V},D=new(u(3)).Geometry;return D.createMesh($,oe,U),D.getMorph()?(D.setName(ae),D.setRenderOrder(le),D.setAnatomicalId(H),j&&j.addZincObject(D),D.setDuration(y.getDuration()),D.videoHandler&&y.setVideoHandler(D.videoHandler),D):void 0},L=(j,$,X,K,re,V,W,oe,ae,le)=>(H,U)=>{var D;U&&U[0]&&(D=U[0]);var Q=E(j,H,$,X,K,re,void 0,D,V,oe,W);if(ae.lod&&ae.lod.levels)for(var[ie,ce]of Object.entries(ae.lod.levels))Q.addLOD(A,ie,ce.URL,ce.Index,ae.lod.preload);--this.toBeDownloaded,H.dispose(),le!=null&&typeof le=="function"&&le(Q)},F=j=>{var $=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,X,K,re,V,W,oe,ae]=j.match($);return{years:X,months:K,weeks:re,days:V,hours:W,mins:oe,secs:ae}};this.loadSettings=j=>{if(j){if(j.Duration){var $=F(j.Duration);y.setDurationFromObject($)}if(j.OriginalDuration){var X=F(j.OriginalDuration);y.setOriginalDurationFromObject(X)}if(j.TimeStamps)for(var K in j.TimeStamps){var re=F(j.TimeStamps[K]);y.addMetadataTimeStamp(K,re)}}};var x=(j,$,X,K,re)=>{if(X){var V=void 0,W=!1;X.URL?(V=X.URL,$&&(V=d(V,$))):X.Inline&&(V=X.Inline.URL,W=!0);var oe={};if(X.LOD&&X.LOD.Levels){oe.preload=!!X.LOD.Preload,oe.levels={};for(var[ae,le]of Object.entries(X.LOD.Levels))oe.levels[ae]={},oe.levels[ae].URL=d(le.URL,$),oe.levels[ae].Index=le.Index}var H=X.GroupName;(H===void 0||H==="")&&(H="_Unnamed");var U={loaderOptions:{index:X.Index},isInline:W,fileFormat:X.FileFormat,anatomicalId:X.AnatomicalId,compression:X.compression,tubeLines:X.tubeLines,lod:oe,renderOrder:K};switch(X.Type){case"Surfaces":R(j,V,X.MorphVertices,X.MorphColours,H,re,U);break;case"Glyph":var D;W?D=X.Inline.GlyphGeometriesURL:(D=X.GlyphGeometriesURL,D=d(X.GlyphGeometriesURL,$)),X.DisplayLabels&&(U.displayLabels=!0),U.loaderOptions.isGlyphsets=!0,this.loadGlyphsetURL(j,V,D,H,re,U);break;case"Points":this.loadPointsetURL(j,V,X.MorphVertices,X.MorphColours,H,re,U);break;case"Lines":this.loadLinesURL(j,V,X.MorphVertices,X.MorphColours,H,re,U);break;case"Texture":this.loadTextureURL(j,V,H,re,U);break}}},O=(j,$,X)=>{if($){var K=void 0,re=!1;switch($.URL?(K=$.URL,j&&(K=d($.URL,j))):$.Inline&&(K=$.Inline.URL,re=!0),$.Type){case"View":re?(y.setupMultipleViews("default",{default:K}),v=!0,X!=null&&typeof X=="function"&&X()):this.loadViewURL(K,X);break;case"Settings":this.loadSettings($);break}}};this.loadGLTF=(j,$,X,K,re)=>{var V=new(u(40)).GLTFToZincJSLoader;V.load(y,j,$,X,K,re)};var B=(j,$,X,K)=>{if(X.Primitives&&X.Primitives.forEach(oe=>{var ae=1;oe.Order&&(ae=oe.Order),x(j,$,oe,ae,K)}),X.Transformation&&j.setTransformation(X.Transformation),X.Children)for(var[re,V]of Object.entries(X.Children)){var W=j.findOrCreateChildFromPath(re);W&&B(W,$,V,K)}},N=(j,$)=>{var X,K,re=j,V=$==null||(X=$.enabled)===null||X===void 0?void 0:X.include,W=$==null||(K=$.enabled)===null||K===void 0?void 0:K.exclude,oe=$==null?void 0:$.tubeLines;return(V!=null&&V.length||W!=null&&W.length)&&(V&&(re=j.filter(ae=>{if(ae.Type==="View")return!0;for(var le=0;le<V.length;le++)if(p(ae.RegionPath,ae.GroupName,V[le]))return!0;return!1})),W&&(re=re.filter(ae=>{if(ae.Type==="View")return!0;for(var le=0;le<W.length;le++)if(p(ae.RegionPath,ae.GroupName,W[le]))return!1;return!0}))),oe&&re.forEach(ae=>{ae.Type==="Lines"&&(ae.tubeLines=!0)}),re},k=(j,$)=>Array.isArray(j)?N(j,$):j,z=(j,$)=>{if(Array.isArray(j)){for(var X=0,K=0;K<j.length;K++)j[K].Type&&($&&j[K].Type==="View"||j[K].Type==="Surfaces"||j[K].Type==="Glyph"||j[K].Type==="Points"||j[K].Type==="Lines"||j[K].Type==="Texture")&&X++;return X}return 0},G=j=>{var $=j.Primitives?z(j.Primitives,!1):0;return j.Children&&Object.values(j.Children).forEach(X=>{$+=G(X)}),$},Y=j=>Array.isArray(j)?z(j,!0):typeof j=="object"&&j!==null&&j.Version==="2.0"?G(j.Regions):void 0,Z=(j,$,X,K,re)=>{var V=j;X.RegionPath&&X.RegionPath!==""&&(V=j.findOrCreateChildFromPath(X.RegionPath)),x(V,$,X,2*K,re)},te=(j,$,X,K,re,V)=>{for(var W=k($,V),oe=Y(W),ae=new I(oe,K,re),le=0;le<$.length;le++)O(X,W[le],ae);for(var H=0;H<$.length;H++)Z(j,X,W[H],H,ae)},q=(j,$,X,K,re)=>{var V=Y($),W=new I(V,K,re);$.Settings&&this.loadSettings($.Settings),$.Views&&_(X,$.Views),$.Regions&&B(j,X,$.Regions,W)};this.loadMetadataURL=(j,$,X,K,re)=>{var V=new XMLHttpRequest,W=f($);V.onreadystatechange=()=>{if(V.readyState==4&&V.status==200){y.resetMetadata(),y.resetDuration(),v=!1;var oe=V.responseURL;oe===void 0&&(oe=new URL(W).href);var ae=JSON.parse(V.responseText);Array.isArray(ae)?te(j,ae,oe,X,K,re):typeof ae=="object"&&ae!==null&&ae.Version=="2.0"&&q(j,ae,oe,X,K)}},V.open("GET",W,!0),V.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,g,m,h){var b=this,y=new c.FileLoader(this.manager);y.setPath(this.path),y.setResponseType("arraybuffer"),y.setRequestHeader(this.requestHeader),y.setWithCredentials(this.withCredentials),y.load(p,function(v){try{g(b.parse(v))}catch(M){h?h(M):console.error(M),b.manager.itemError(p)}},m,h)}parse(p){function g(h,b,y){for(var v=0,M=h.length;v<M;v++)if(h[v]!==b.getUint8(y+v,!1))return!1;return!0}var m=function(h){if(typeof h=="string"){for(var b=new Uint8Array(h.length),y=0;y<h.length;y++)b[y]=255&h.charCodeAt(y);return b.buffer||b}return h}(p);return function(h){var b=new DataView(h),y=b.getUint32(80,!0);if(84+y*50===b.byteLength)return!0;for(var v=[115,111,108,105,100],M=0;5>M;M++)if(g(v,b,M))return!1;return!0}(m)?function(h){for(var b,y,v,M,A,_,w,C,P=new DataView(h),R=P.getUint32(80,!0),I=!1,S=0;S<70;S++)P.getUint32(S,!1)==1129270351&&P.getUint8(S+4)==82&&P.getUint8(S+5)==61&&(I=!0,M=new Float32Array(3*(3*R)),A=P.getUint8(S+6)/255,_=P.getUint8(S+7)/255,w=P.getUint8(S+8)/255,C=P.getUint8(S+9)/255);for(var T=new c.BufferGeometry,E=new Float32Array(3*(3*R)),L=new Float32Array(3*(3*R)),F=0;F<R;F++){var x=84+F*50,O=P.getFloat32(x,!0),B=P.getFloat32(x+4,!0),N=P.getFloat32(x+8,!0);if(I){var k=P.getUint16(x+48,!0);32768&k?(b=A,y=_,v=w):(b=(31&k)/31,y=(31&k>>5)/31,v=(31&k>>10)/31)}for(var z=1;3>=z;z++){var G=x+12*z,Y=3*(3*F)+3*(z-1);E[Y]=P.getFloat32(G,!0),E[Y+1]=P.getFloat32(G+4,!0),E[Y+2]=P.getFloat32(G+8,!0),L[Y]=O,L[Y+1]=B,L[Y+2]=N,I&&(M[Y]=b,M[Y+1]=y,M[Y+2]=v)}}return T.setAttribute("position",new c.BufferAttribute(E,3)),T.setAttribute("normal",new c.BufferAttribute(L,3)),I&&(T.setAttribute("color",new c.BufferAttribute(M,3)),T.hasColors=!0,T.alpha=C),T}(m):function(h){for(var b,y=new c.BufferGeometry,v=/solid([\s\S]*?)endsolid/g,M=/facet([\s\S]*?)endfacet/g,A=0,_=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,w=new RegExp("vertex"+_+_+_,"g"),C=new RegExp("normal"+_+_+_,"g"),P=[],R=[],I=new c.Vector3,S=0,T=0,E=0;(b=v.exec(h))!==null;){T=E;for(var L=b[0];(b=M.exec(L))!==null;){for(var F=0,x=0,O=b[0];(b=C.exec(O))!==null;)I.x=parseFloat(b[1]),I.y=parseFloat(b[2]),I.z=parseFloat(b[3]),x++;for(;(b=w.exec(O))!==null;)P.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),R.push(I.x,I.y,I.z),F++,E++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+A),F!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+A),A++}var B=T,N=E-T;y.addGroup(B,N,S),S++}return y.setAttribute("position",new c.Float32BufferAttribute(P,3)),y.setAttribute("normal",new c.Float32BufferAttribute(R,3)),y}(function(h){return typeof h=="string"?h:c.LoaderUtils.decodeText(new Uint8Array(h))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>A});var c=u(4),f=/^[og]\s*(.+)?/,d=/^mtllib /,p=/^usemtl /,g=/^usemap /,m=new c.Vector3,h=new c.Vector3,b=new c.Vector3,y=new c.Vector3,v=new c.Vector3;function M(){var _={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(C,P){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=C,void(this.object.fromDeclaration=P!==!1);var R=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:C||"",fromDeclaration:P!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(T,E){var L=this._finalize(!1);L&&(L.inherited||0>=L.groupCount)&&this.materials.splice(L.index,1);var F={index:this.materials.length,name:T||"",mtllib:Array.isArray(E)&&0<E.length?E[E.length-1]:"",smooth:L===void 0?this.smooth:L.smooth,groupStart:L===void 0?0:L.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(O){var B={index:typeof O=="number"?O:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(F),F},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(T){var E=this.currentMaterial();if(E&&E.groupEnd===-1&&(E.groupEnd=this.geometry.vertices.length/3,E.groupCount=E.groupEnd-E.groupStart,E.inherited=!1),T&&1<this.materials.length)for(var L=this.materials.length-1;0<=L;L--)0>=this.materials[L].groupCount&&this.materials.splice(L,1);return T&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),E}},R&&R.name&&typeof R.clone=="function"){var I=R.clone(0);I.inherited=!0,this.object.materials.push(I)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(C,P){var R=parseInt(C,10);return 3*(0<=R?R-1:R+P/3)},parseNormalIndex:function(C,P){var R=parseInt(C,10);return 3*(0<=R?R-1:R+P/3)},parseUVIndex:function(C,P){var R=parseInt(C,10);return 2*(0<=R?R-1:R+P/2)},addVertex:function(C,P,R){var I=this.vertices,S=this.object.geometry.vertices;S.push(I[C+0],I[C+1],I[C+2]),S.push(I[P+0],I[P+1],I[P+2]),S.push(I[R+0],I[R+1],I[R+2])},addVertexPoint:function(C){var P=this.vertices,R=this.object.geometry.vertices;R.push(P[C+0],P[C+1],P[C+2])},addVertexLine:function(C){var P=this.vertices,R=this.object.geometry.vertices;R.push(P[C+0],P[C+1],P[C+2])},addNormal:function(C,P,R){var I=this.normals,S=this.object.geometry.normals;S.push(I[C+0],I[C+1],I[C+2]),S.push(I[P+0],I[P+1],I[P+2]),S.push(I[R+0],I[R+1],I[R+2])},addFaceNormal:function(C,P,R){var I=this.vertices,S=this.object.geometry.normals;m.fromArray(I,C),h.fromArray(I,P),b.fromArray(I,R),v.subVectors(b,h),y.subVectors(m,h),v.cross(y),v.normalize(),S.push(v.x,v.y,v.z),S.push(v.x,v.y,v.z),S.push(v.x,v.y,v.z)},addColor:function(C,P,R){var I=this.colors,S=this.object.geometry.colors;I[C]!==void 0&&S.push(I[C+0],I[C+1],I[C+2]),I[P]!==void 0&&S.push(I[P+0],I[P+1],I[P+2]),I[R]!==void 0&&S.push(I[R+0],I[R+1],I[R+2])},addUV:function(C,P,R){var I=this.uvs,S=this.object.geometry.uvs;S.push(I[C+0],I[C+1]),S.push(I[P+0],I[P+1]),S.push(I[R+0],I[R+1])},addDefaultUV:function(){var C=this.object.geometry.uvs;C.push(0,0),C.push(0,0),C.push(0,0)},addUVLine:function(C){var P=this.uvs,R=this.object.geometry.uvs;R.push(P[C+0],P[C+1])},addFace:function(C,P,R,I,S,T,E,L,F){var x=this.vertices.length,O=this.parseVertexIndex(C,x),B=this.parseVertexIndex(P,x),N=this.parseVertexIndex(R,x);if(this.addVertex(O,B,N),this.addColor(O,B,N),E!==void 0&&E!==""){var k=this.normals.length;O=this.parseNormalIndex(E,k),B=this.parseNormalIndex(L,k),N=this.parseNormalIndex(F,k),this.addNormal(O,B,N)}else this.addFaceNormal(O,B,N);if(I!==void 0&&I!==""){var z=this.uvs.length;O=this.parseUVIndex(I,z),B=this.parseUVIndex(S,z),N=this.parseUVIndex(T,z),this.addUV(O,B,N),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(C){this.object.geometry.type="Points";for(var P,R=this.vertices.length,I=0,S=C.length;I<S;I++)P=this.parseVertexIndex(C[I],R),this.addVertexPoint(P),this.addColor(P)},addLineGeometry:function(C,P){this.object.geometry.type="Line";for(var R=this.vertices.length,I=this.uvs.length,S=0,T=C.length;S<T;S++)this.addVertexLine(this.parseVertexIndex(C[S],R));for(var E=0,L=P.length;E<L;E++)this.addUVLine(this.parseUVIndex(P[E],I))}};return _.startObject("",!1),_}class A extends c.Loader{constructor(w){super(w),this.materials=null}load(w,C,P,R){var I=this,S=new c.FileLoader(this.manager);S.setPath(this.path),S.setRequestHeader(this.requestHeader),S.setWithCredentials(this.withCredentials),S.load(w,function(T){try{C(I.parse(T))}catch(E){R?R(E):console.error(E),I.manager.itemError(w)}},P,R)}setMaterials(w){return this.materials=w,this}parse(w){var C=new M;w.indexOf(`\r
3234
+ `,g=function(){return{brightness:{value:0},contrast:{value:1},depth:{value:1},discardAlpha:{value:!0},diffuse:{value:void 0},direction:{value:1},flipY:{value:!0},slide:{value:new c.Vector3(0,0,1)}}};l.fs=d,l.vs=p,l.glslVersion=f,l.getUniforms=g},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(d){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=d,this.load=(p,g)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,h=[];p.images.source.forEach(y=>{h.push(c(y))});var b=this;m.loadFromImages(h).then(()=>{b.texture=m,b.initialise(p,g)})}},this.initialise=(p,g)=>{g!=null&&typeof g=="function"&&g(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(d){var p=d,g=void 0,m=void 0,h=new c.Clock(!1);this.playAnimation=!0;var b=1e3,y={},v=0,M={},A=0,_={},w=0,C={},P=0,R=void 0,I=void 0,S=void 0,T=void 0,E=[],L=[],F=new c.Group,x=void 0,O=void 0,B=!1,N=!1;this.getDrawingWidth=()=>p?p.clientWidth:x?typeof x.clientWidth>"u"?Math.round(x.width):Math.round(x.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:x?typeof x.clientHeight>"u"?Math.round(x.height):Math.round(x.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var Z=this.getDrawingWidth(),te=this.getDrawingHeight();if(g!=null){var q;p?(q=p.getBoundingClientRect(),g.setSize(Z,te)):x&&(typeof x.getBoundingClientRect>"u"||(q=x.getBoundingClientRect(),x.width=Z,x.height=te),g.setSize(Z,te,!1)),q&&(q.left,q.top);var W=new c.Vector2;g.getSize(W),W.x,W.y}},this.initialiseVisualisation=Z=>{if(!N){if(Z=Z||{},Z.antialias===void 0){var te=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(te=!0)}catch{te=!1}Z.antialias=!te}Z.canvas&&(p=void 0,x=Z.canvas),g=new c.WebGLRenderer(Z),p!==void 0&&p.appendChild(g.domElement),g.setClearColor(16777215,1),x&&x.style&&(x.style.height="100%",x.style.width="100%");var q=g.domElement;q.addEventListener("webglcontextlost",k,!1),q.addEventListener("webglcontextrestored",z,!1),g.autoClear=!1;var W=this.createScene("default");this.setCurrentScene(W),N=!0}};var k=Z=>{Z.preventDefault();for(var te of Object.keys(y))_.hasOwnProperty(te)&&_[te].call()},z=Z=>{Z.preventDefault();for(var te of Object.keys(y))C.hasOwnProperty(te)&&C[te].call()};this.getCurrentScene=()=>m,this.setCurrentScene=Z=>{if(Z){this.removeActiveScene(Z);var te=m;m=Z,te&&te.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(F),this.onWindowResize()}},this.getSceneByName=Z=>E[Z],this.createScene=Z=>{if(E[Z]==null){var te;return te=x?new(u(32)).Scene(x,g):new(u(32)).Scene(p,g),E[Z]=te,te.sceneName=Z,te}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var Z=m.getBoundingBox();if(Z){for(var te,q=0;q<L.length;q++)te=L[q].getBoundingBox(),te&&Z.union(te);m.viewAllWithBoundingBox(Z)}}},this.loadModelsURL=(Z,te,q,W,$,X)=>{m.loadModelsURL(Z,te,q,W,$,X)},this.loadViewURL=Z=>{m.loadViewURL(Z)},this.loadFromViewURL=(Z,te)=>{m.loadFromViewURL(Z,te)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var G=()=>{B?(R=requestAnimationFrame(G),this.render()):(cancelAnimationFrame(R),R=void 0)};this.stopAnimate=()=>{B&&(h.stop(),B=!1)},this.animate=()=>{B||(h.start(),B=!0,G())},this.addContextLostCallbackFunction=Z=>(++w,_[w]=Z,w),this.removeContextLostCallbackFunction=Z=>{Z in _&&delete _[Z]},this.addContextRestoredCallbackFunction=Z=>(++P,C[P]=Z,P),this.removeContextRestoredCallbackFunction=Z=>{Z in P&&delete P[Z]},this.addPreRenderCallbackFunction=Z=>(++v,y[v]=Z,v),this.removePreRenderCallbackFunction=Z=>{Z in y&&delete y[Z]},this.addPostRenderCallbackFunction=Z=>(++A,M[A]=Z,A),this.removePostRenderCallbackFunction=Z=>{Z in M&&delete M[Z]},this.getPlayRate=()=>b,this.setPlayRate=Z=>{b=Z},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=Z=>{m.setMorphsTime(Z)},this.getZincGeometryByID=Z=>m.getZincGeometryByID(Z),this.addToScene=Z=>{m.addObject(Z)},this.addToOrthoScene=Z=>{if(S==null&&(S=new c.Scene),I==null){var te=this.getDrawingWidth(),q=this.getDrawingHeight();I=new c.OrthographicCamera(-te/2,te/2,q/2,-q/2,1,10),I.position.z=10}S.add(Z)};var Y=Z=>te=>{te.needsUpdate=!0;var q=new c.SpriteMaterial({map:te}),W=q.map.image.width,$=q.map.image.height;Z.material=q,Z.scale.set(W,$,1);var X=this.getDrawingWidth(),K=this.getDrawingHeight();Z.position.set((X-W)/2,(-K+$)/2,1),this.addToOrthoScene(Z)};this.addLogo=()=>{T=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,Y(T))},this.render=()=>{O||(p?0<p.clientWidth&&0<p.clientHeight&&(O=new f(p,this.onWindowResize)):x&&0<x.width&&0<x.height&&(O=new f(x,this.onWindowResize)));var Z=h.getDelta();m.renderGeometries(b,Z,this.playAnimation);for(var te,q=0;q<L.length;q++)te=L[q],te.renderGeometries(b,Z,this.playAnimation);I!=null&&S!=null&&(g.clearDepth(),g.render(S,I));for(var W of Object.keys(y))y.hasOwnProperty(W)&&y[W].call();m.render(g);for(var $ of Object.keys(M))M.hasOwnProperty($)&&M[$].call()},this.forceContextLoss=()=>{g.forceContextLoss()},this.forceContextRestore=()=>{g.forceContextRestore()},this.getThreeJSRenderer=()=>g,this.isSceneActive=Z=>{if(m===Z)return!0;for(var te,q=0;q<L.length;q++)if(te=L[q],te===Z)return!0;return!1},this.addActiveScene=Z=>{this.isSceneActive(Z)||(L.push(Z),F.add(Z.getThreeJSScene()))},this.removeActiveScene=Z=>{for(var te,q=0;q<L.length;q++)if(te=L[q],te===Z)return L.splice(q,1),void F.remove(Z.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var Z=0;Z<L.length;Z++)F.remove(L[Z].getThreeJSScene());L.splice(0,L.length)},this.dispose=()=>{var Z;for(var te in B&&cancelAnimationFrame(R),E)E.hasOwnProperty(te)&&E[te].clearAll();E=[],L=[],F=new c.Group,this.stopAnimate(),y={},v=0,M={},M=0,_={},w=0,C={},P=0,I=void 0,S=void 0,T=void 0;var q=this.createScene("default");this.setCurrentScene(q),O=void 0,(Z=g)===null||Z===void 0||Z.dispose()},this.transitionScene=(Z,te)=>{if(m){var q=m.getZincCameraControls(),W=Z.getBoundingBox();if(W){var $=W.min.distanceTo(W.max)/2,X=(W.min.x+W.max.x)/2,K=(W.min.y+W.max.y)/2,re=(W.min.z+W.max.z)/2,V=q.getViewportFromCentreAndRadius(X,K,re,$,40,$*4),j=q.getCurrentViewport();q.cameraTransition(j,V,te),q.enableCameraTransition()}}},this.isWebGL2=()=>!!g&&g.capabilities.isWebGL2}},o=>{o.exports=eD()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,d=u(35).SceneLoader,p=u(42).SceneExporter,g=u(44).Viewport,m=u(5).createBufferGeometry,h=u(5).getCircularTexture,b=u(5).createNewSpriteText,y=0,v=function(){return"sc"+y++},M=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},A=6e3;l.Scene=function(_,w){var C=this,P=_,R=void 0,I=void 0,S=new d(this),T=void 0,E={},L=0,F={},x=0,O=new c.Scene,B=new c.Scene,N=new(u(45)).Region(void 0,this);O.add(N.getGroup());var k=new c.Group;O.add(k),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var z=6e3,G=void 0;this.sceneName=void 0;var Y=!1,Z=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.displayMiniAxes=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-right",updateRequired:!0};var te={x:0,y:0},q=M(),W=new c.Vector2,$=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var X=new f(this);X.disable(),O.add(X.group);var K={main:[],mini:[]},re=new c.Vector3(0,0,0),V=()=>P?typeof P.clientWidth>"u"?P.width:P.clientWidth:0,j=()=>P?typeof P.clientHeight>"u"?P.height:P.clientHeight:0;this.getDownloadProgress=()=>S.getDownloadProgress(),this.onWindowResize=()=>{var D=j();this.camera.aspect=V()/D,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,G.onResize(),G.calculateHeightPerPixelAtZeroDepth(D)},this.resetView=()=>{this.onWindowResize(),G.resetView()},this.changeZoomByScrollRateUnit=D=>{G.changeZoomByScrollRateUnit(D)};var oe=()=>{this.camera=new c.PerspectiveCamera(40,V()/j(),0,10),this.ambient=new c.AmbientLight(16777215,.2),O.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),O.add(this.directionalLight),G=new(u(44)).CameraControls(this.camera,w.domElement,w,this),G.setDirectionalLight(this.directionalLight),G.resetView(),T=new(u(50)).Minimap(this)};oe(),this.loadView=D=>{var Q=new g;return Q.setFromObject(D),G.setCurrentCameraSettings(Q),!0},this.setupMultipleViews=(D,Q)=>{for(var[ie,ce]of Object.entries(Q)){var ge=new g;ge.setFromObject(ce),G.addViewport(ie,ge)}G.setDefaultViewport(D)},this.getBoundingBox=()=>N.getBoundingBox(!0),this.viewAllWithBoundingBox=D=>{if(D){var Q=G.getViewportFromBoundingBox(D,1);G.setCurrentCameraSettings(Q),G.calculateHeightPerPixelAtZeroDepth(j()),X.markerUpdateRequired=!0}},this.viewAll=()=>{var D=this.getBoundingBox();this.viewAllWithBoundingBox(D),X.markerUpdateRequired=!0},this.forEachGeometry=D=>{N.forEachGeometry(D,!0)},this.forEachGlyphset=D=>{N.forEachGlyphset(D,!0)},this.forEachPointset=D=>{N.forEachPointset(D,!0)},this.forEachLine=D=>{N.forEachLine(D,!0)},this.findGeometriesWithGroupName=D=>N.findGeometriesWithGroupName(D,!0),this.findPointsetsWithGroupName=D=>N.findPointsetsWithGroupName(D,!0),this.findGlyphsetsWithGroupName=D=>N.findGlyphsetsWithGroupName(D,!0),this.findLinesWithGroupName=D=>N.findLinesWithGroupName(D,!0),this.findObjectsWithGroupName=D=>N.findObjectsWithGroupName(D,!0),this.findObjectsWithAnatomicalId=D=>N.findObjectsWithAnatomicalId(D,!0),this.getBoundingBoxOfZincObjects=D=>{for(var Q,ie=void 0,ce=0;ce<D.length;ce++)Q=D[ce].getBoundingBox(),Q&&(ie?ie.union(Q):ie=Q);return ie},this.vectorToScreenXY=D=>{D.project(this.camera);var Q=V(),ie=j(),ce=Q/2,ge=ie/2;return D.x=D.x*ce+ce,D.y=-(D.y*ge)+ge,D},this.getObjectsScreenXY=D=>{if(D&&0<D.length){var Q=this.getBoundingBoxOfZincObjects(D),ie=new c.Vector3;return Q.getCenter(ie),this.vectorToScreenXY(ie)}},this.getNamedObjectsScreenXY=D=>{var Q=this.findObjectsWithGroupName(D);return this.getObjectsScreenXY(Q)},this.addZincObject=D=>{D&&(N.addZincObject(D),G&&G.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(D,Q,ie,ce)=>{S.loadGlyphsetURL(N,D,Q,ie,ce)},this.loadPointsetURL=(D,Q,ie,ce,ge)=>{S.loadPointsetURL(N,D,Q,ie,ce,ge)},this.loadLinesURL=(D,Q,ie,ce,ge)=>{S.loadLinesURL(N,D,Q,ie,ce,ge)},this.loadSTL=(D,Q,ie)=>{S.loadSTL(N,D,Q,ie)},this.loadOBJ=(D,Q,ie)=>{S.loadOBJ(N,D,Q,ie)},this.loadMetadataURL=(D,Q,ie,ce)=>{S.loadMetadataURL(N,D,Q,ie,ce)},this.loadModelsURL=(D,Q,ie,ce,ge,ye)=>{S.loadModelsURL(N.urls,Q,ie,ce,ge,ye)},this.loadViewURL=D=>{S.loadViewURL(D)},this.loadFromViewURL=(D,Q)=>{S.loadFromViewURL(D,Q)},this.loadGLTF=(D,Q,ie,ce)=>{S.loadGLTF(N,D,Q,ie,ce)},this.updateDirectionalLight=()=>{G.updateDirectionalLight()},this.addObject=D=>{O.add(D)},this.removeObject=D=>{O.remove(D)},this.getCurrentTime=()=>{if(I!=null)return I.getCurrentTime(z);var D=N.getCurrentTime();return D===-1?0:D},this.setMorphsTime=D=>{I!=null&&I.setMorphTime(D,z),N.setMorphTime(D,!0)},this.isTimeVarying=()=>!!(I&&I.video&&!I.video.error)||N.isTimeVarying(),this.renderGeometries=(D,Q,ie)=>{var ce={};if(ce.camera=G,ce.displayMarkers=this.displayMarkers,ce.markerCluster=X,ce.markersList=X.markers,ce.ndcToBeUpdated=!1,ie&&(ce.markerCluster.markerUpdateRequired=!0),!I)S.toBeDownloaded==0?(ce.ndcToBeUpdated=G.update(Q),ce.ndcToBeUpdated&&G.calculateHeightPerPixelAtZeroDepth(j()),N.renderGeometries(D,Q,ie,G,ce,!0)):G.update(0);else if(I.isReadyToPlay()){ie?I.video.play():I.video.pause();var ge=I.video.currentTime/I.getVideoDuration()*z;S.toBeDownloaded==0?(G.setTime(ge),ce.ndcToBeUpdated=G.update(0),ce.ndcToBeUpdated&&G.calculateHeightPerPixelAtZeroDepth(j()),N.setMorphTime(ge,!0),N.renderGeometries(0,0,ie,G,ce,!0)):G.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>O,this.setVideoHandler=D=>{I||(I=D)},this.setAdditionalScenesGroup=D=>{O.add(D)};var ae=(D,Q,ie,ce,ge,ye,ue)=>{var be=0,ne=0;return ne=D.includes("top")?ue-ge-ie:D.includes("bottom")?ie:Math.floor((ue-ge)/2),be=D.includes("left")?Q:D.includes("right")?ye-Q-ce:Math.floor((ye-ce)/2),{x:be,y:ne}},le=D=>{(this.displayMinimap||this.displayMiniAxes)&&(D.setScissorTest(!0),D.getSize(W),this.minimapScissor.updateRequired&&(te=ae(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,W.x,W.y),this.minimapScissor.updateRequired=!1),D.setScissor(te.x,te.y,this.minimapScissor.width,this.minimapScissor.height),D.setViewport(te.x,te.y,this.minimapScissor.width,this.minimapScissor.height),T.updateCamera(),this.displayMiniAxes?D.render(B,T.camera):(O.add(T.mask),D.render(O,T.camera),O.remove(T.mask)),D.setScissorTest(!1),D.setViewport(0,0,W.x,W.y))};this.render=D=>{this.autoClearFlag&&D.clear(),Y&&Z?Z.render(O,this.camera):(D.render(O,this.camera),le(D))},this.setInteractiveControlEnable=D=>{D==!0?G.enable():G.disable()},this.getZincCameraControls=()=>G,this.getThreeJSScene=()=>O,this.setDuration=D=>{N.setDuration(D),z=D,G.setPathDuration(D),S.duration=D},this.getDuration=()=>z,this.setStereoEffectEnable=D=>{D!=!0||Z||(Z=new u(44).StereoEffect(w)),w.setSize(V(),j()),this.camera.updateProjectionMatrix(),Y=D},this.objectIsInScene=D=>N.objectIsInRegion(D,!0),this.alignBoundingBoxToCameraView=(D,Q)=>{if(D){D.getCenter(re);var ie=this.getZincCameraControls().getCurrentViewport(),ce=new c.Vector3(ie.targetPosition[0],ie.targetPosition[1],ie.targetPosition[2]),ge=new c.Vector3(ie.eyePosition[0],ie.eyePosition[1],ie.eyePosition[2]),ye=new c.Vector3,ue=new c.Vector3;ye.subVectors(ce,ge).normalize(),ue.subVectors(ce,re).normalize();var be=new c.Vector3;be.crossVectors(ye,ue);var ne=ye.angleTo(ue);0<Q?(this.getZincCameraControls().rotateCameraTransition(be,ne,Q),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(be,ne),X.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(D,Q,ie)=>{if(D){var ce=this.getZincCameraControls().getCurrentViewport(),ge=this.getZincCameraControls().getViewportFromBoundingBox(D,Q);0<ie&&(this.getZincCameraControls().cameraTransition(ce,ge,ie),this.getZincCameraControls().enableCameraTransition()),X.markerUpdateRequired=!0}},this.alignObjectToCameraView=(D,Q)=>{if(this.objectIsInScene(D)){var ie=D.getBoundingBox();this.alignBoundingBoxToCameraView(ie,Q)}},this.setCameraTargetToObject=D=>{if(this.objectIsInScene(D)){var Q=D.getBoundingBox(),ie=this.getZincCameraControls().getCurrentViewport();Q.getCenter(re);var ce=new c.Vector3(ie.targetPosition[0],ie.targetPosition[1],ie.targetPosition[2]),ge=new c.Vector3(ie.eyePosition[0],ie.eyePosition[1],ie.eyePosition[2]),ye=new c.Vector3,ue=new c.Vector3;ye.subVectors(ge,ce),ue.addVectors(re,ye),ie.eyePosition[0]=ue.x,ie.eyePosition[1]=ue.y,ie.eyePosition[2]=ue.z,ie.targetPosition[0]=re.x,ie.targetPosition[1]=re.y,ie.targetPosition[2]=re.z,this.getZincCameraControls().setCurrentCameraSettings(ie),X.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>Y,this.removeZincObject=D=>{N.removeZincObject(D),G&&G.calculateMaxAllowedDistance(this),X.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{$.length=0,X.isEnabled&&$.push(X.group),N.getPickableThreeJSObjects($,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||N.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),$),this.getNormalisedMinimapCoordinates=(D,Q)=>{if(this.displayMinimap){var ie=new c.Vector2;D.getSize(ie);var ce=ie.y-Q.clientY;if(te.x+this.minimapScissor.width>Q.clientX&&Q.clientX>te.x&&te.y+this.minimapScissor.height>ce&&ce>te.y){var ge=2*((Q.clientX-te.x)/this.minimapScissor.width)-1,ye=2*((ce-te.y)/this.minimapScissor.height)-1;return{x:ge,y:ye}}}},this.getMinimapDiffFromNormalised=(D,Q)=>T?T.getDiffFromNormalised(D,Q):void 0,this.isWebGL2=()=>w.isWebGL2(),this.clearAll=()=>{X.clear(),N.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),S.toBeDwonloaded=0,G&&G.calculateMaxAllowedDistance(this),X.markerUpdateRequired=!0},this.addMetadataTimeStamp=(D,Q)=>{q.TimeStamps[D]=U(Q)},this.getMetadataTag=D=>q[D],this.getMetadata=()=>q,this.setMetadataTag=(D,Q)=>{q[D]=Q},this.removeMetadataTag=D=>{delete q[D]},this.resetMetadata=()=>{q=M()},this.resetDuration=()=>{this.setDuration(A)};var H=D=>[...D.years?["".concat(D.years,"years")]:[],...D.months?["".concat(D.months,"months")]:[],...D.weeks?["".concat(D.weeks,"weeks")]:[],...D.days?["".concat(D.days,"days")]:[],...D.hours?["".concat(D.hours,"hours")]:[],...D.mins?["".concat(D.mins,"mins")]:[],...D.secs?["".concat(D.secs,"secs")]:[]].join(" "),U=D=>D.years?31536e6*D.years:0+D.months?2592e6*D.months:0+D.weeks?6048e5*D.weeks:0+D.days?864e5*D.days:0+D.hours?36e5*D.hours:0+D.mins?6e4*D.mins:0+D.secs?1e3*D.secs:0;this.setDurationFromObject=D=>{var Q=H(D),ie=U(D);this.setMetadataTag("Duration",Q),this.setDuration(ie)},this.setOriginalDurationFromObject=D=>{var Q=H(D);this.setMetadataTag("OriginalDuration",Q)},this.exportGLTF=D=>{var Q=new p(this);return Q.exportGLTF(D)},this.getRootRegion=()=>N,this.createLines=(D,Q,ie,ce)=>{var ge=N.findChildFromPath(D);return ge===void 0&&(ge=N.createChildFromPath(D)),ge.createLines(Q,ie,ce)},this.createPoints=(D,Q,ie,ce,ge)=>{var ye=N.findChildFromPath(D);return ye===void 0&&(ye=N.createChildFromPath(D)),ye.createPoints(Q,ie,ce,ge)},this.addZincObjectAddedCallbacks=D=>(++L,E[L]=D,L),this.addZincObjectRemovedCallbacks=D=>(++x,F[x]=D,x),this.removeZincObjectAddedCallbacks=D=>{D in L&&delete E[D]},this.removeZincObjectRemovedCallbacks=D=>{D in x&&delete F[D]},this.clearZincObjectAddedCallbacks=()=>{E={},L=0},this.clearZincObjectRemovedCallbacks=()=>{F={},x=0},this.triggerObjectAddedCallback=D=>{for(var Q in E)E.hasOwnProperty(Q)&&E[Q](D)},this.triggerObjectRemovedCallback=D=>{for(var Q in F)F.hasOwnProperty(Q)&&F[Q](D)},this.addTemporaryPoints=(D,Q)=>{var ie=m(D.length,D),ce=new c.PointsMaterial({alphaTest:.5,size:15,color:Q,sizeAttenuation:!1}),ge=h();ce.map=ge;var ye=new(u(23)).Points(ie,ce);return k.add(ye),ye},this.addTemporaryLines=(D,Q)=>{var ie=m(D.length,D),ce=new c.LineBasicMaterial({color:Q}),ge=new(u(12)).LineSegments(ie,ce);return k.add(ge),ge},this.enableFrustumDisplay=()=>{this.camera&&!R&&(R=new c.CameraHelper(this.camera),O.add(R))},this.disableFrustumDisplay=()=>{R&&(O.remove(R),R.dispose(),R=void 0)},this.removeTemporaryPrimitive=D=>{k.remove(D),D.geometry.dispose(),D.material.dispose()},this.clearTemporaryPrimitives=()=>{var D=0,Q=k.children;return Q.forEach(ie=>{ie.geometry.dispose(),ie.material.dispose(),D++}),k.clear(),D},this.addBoundingBoxPrimitive=function(D,Q,ie,ce,ge){var ye=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,ue=N.findChildFromPath(D);ue===void 0&&(ue=N.createChildFromPath(D));var be=ye||C.getBoundingBox();re.set(0,0,0);var ne=re.subVectors(be.max,be.min),de=new c.BoxGeometry(ne.x,ne.y,ne.z),ve=ue.createGeometryFromThreeJSGeometry(Q,de,ie,ce,ge,1e4);return ne.addVectors(be.min,be.max).multiplyScalar(.5),ve.setPosition(ne.x,ne.y,ne.z),ve},this.addSlicesPrimitive=function(D,Q,ie,ce,ge){var ye=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if(Q&&3<=Q.length&&ie&&3<=ie.length){var ue=N.findChildFromPath(D);ue===void 0&&(ue=N.createChildFromPath(D));var be=ye||C.getBoundingBox();re.set(0,0,0);var ne=re.subVectors(be.max,be.min),de=[],ve=0;return["x","y","z"].forEach(Ee=>{var Se;switch(Ee){case"x":Se=new c.PlaneGeometry(ne.z,ne.y),Se.rotateY(Math.PI/2);break;case"y":Se=new c.PlaneGeometry(ne.x,ne.z),Se.rotateX(Math.PI/2);break;case"z":Se=new c.PlaneGeometry(ne.x,ne.y);break}var Ie=ue.createGeometryFromThreeJSGeometry(Q[ve],Se,ie[ve],ce,ge,10001);de.push(Ie),ve++}),ne.addVectors(be.min,be.max).multiplyScalar(.5),de.forEach(Ee=>{Ee.setPosition(ne.x,ne.y,ne.z)}),de}},this.enableMarkerCluster=D=>{D?(X.markerUpdateRequired=!0,X.enable()):(X.markerUpdateRequired=!1,X.disable()),this.forcePickableObjectsUpdate=!0},this.destroyAxisDisplay=()=>{this.displayMiniAxes=!1,K.main&&(this.enableAxisDisplay(!1,!1),K.main.forEach(D=>{D.dispose&&D.dispose()})),K.mini&&(this.enableAxisDisplay(!1,!0),K.mini.forEach(D=>{D.dispose&&D.dispose()})),K={main:[],mini:[]}},this.createAxisDisplay=function(){var D=0<arguments.length&&arguments[0]!==void 0&&arguments[0];C.destroyAxisDisplay();var Q=[{name:"x",dir:new c.Vector3(1,0,0),colour:"red",hex:16733525},{name:"y",dir:new c.Vector3(0,1,0),colour:"green",hex:5635925},{name:"z",dir:new c.Vector3(0,0,1),colour:"blue",hex:5592575}],ie=C.getBoundingBox(),ce=ie.min.distanceTo(ie.max),ge=new c.Vector3(0,0,0);D&&ge.copy(ie.min),Q.forEach(ye=>{var ue=new c.ArrowHelper(ye.dir,ge,ce,ye.hex);K.main.push(ue);var be=new c.ArrowHelper(ye.dir,ie.getCenter(re),ce/2,ye.hex);K.mini.push(be);var ne=b(ye.name,.036,ye.colour,"Asap",120,700),de=ye.dir.clone().multiplyScalar(ce).add(ge);ne.position.set(de.x,de.y,de.z),K.main.push(ne)})},this.enableAxisDisplay=function(D){var Q,ie=1<arguments.length&&arguments[1]!==void 0&&arguments[1];ie&&(Q=K)!==null&&Q!==void 0&&(Q=Q.mini)!==null&&Q!==void 0&&Q.length?(C.displayMiniAxes=D,K.mini.forEach(ce=>{D?B.add(ce):B.remove(ce)})):!ie&&K.main&&K.main.forEach(ce=>{D?O.add(ce):O.remove(ce)})}}},(o,l,u)=>{function c(_,w){var C=Object.keys(_);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(_);w&&(P=P.filter(function(R){return Object.getOwnPropertyDescriptor(_,R).enumerable})),C.push.apply(C,P)}return C}function f(_){for(var w,C=1;C<arguments.length;C++)w=arguments[C]==null?{}:arguments[C],C%2?c(Object(w),!0).forEach(function(P){d(_,P,w[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(w)):c(Object(w)).forEach(function(P){Object.defineProperty(_,P,Object.getOwnPropertyDescriptor(w,P))});return _}function d(_,w,C){return(w=p(w))in _?Object.defineProperty(_,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[w]=C,_}function p(_){var w=g(_,"string");return typeof w=="symbol"?w:w+""}function g(_,w){if(typeof _!="object"||!_)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var P=C.call(_,w);if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(_)}var m=u(4),h=new Image(128,128);h.src=u(34);var b=new m.Texture;b.image=h,b.needsUpdate=!0;var y=[.02,.03,1],v=new m.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),M=u(5).createNewSpriteText,A=function(_){u(10).ZincObject.call(this),this.texture=b;var w=void 0;this.morph=new m.Group,this.group=this.morph,this.isMarkerCluster=!0;var C=!0,P=[];this.markers={};var R=new m.Vector2,I=new m.Vector2,S=Date.now();this.setSpriteSize=x=>{w.scale.set(.015,.02,1),w.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var T=x=>{var O=new m.Group,B=new m.Sprite(v);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(y[0],y[1],y[2]),B.userData=this,O.add(B),this.group.add(O),{group:O,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},E=(x,O,B)=>{x.group.visible=!0,x.group.position.set(O.coords[0],O.coords[1],O.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=M(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=O.min,x.max=O.max},L=x=>{var O=0;for(x.forEach(B=>{var N=B.members.length,k=0;N===1?B.members[0].setVisibility(!0):(B.members.forEach(z=>{k+=z.getNumber(),z.setVisibility(!1)}),!P[O]&&P.push(T(O)),E(P[O],B,k),O++)}),O;O<P.length;O++)P[O].group.visible=!1},F=(x,O)=>{var B=!0,N={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},k=0;for(var z in x)B?(R.set(x[z].ndc.x,x[z].ndc.y),this._b1.setFromPoints([x[z].morph.position]),B=!1,N.members.push(x[z]),N.coords=[x[z].morph.position.x,x[z].morph.position.y,x[z].morph.position.z],O.push(N),delete x[z]):(I.set(x[z].ndc.x,x[z].ndc.y),k=R.distanceTo(I),.1>k&&(N.members.push(x[z]),this._b1.expandByPoint(x[z].morph.position),delete x[z]));N.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],N.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&F(x,O)};this.calculate=()=>{if(C){var x=Date.now();if(500<x-S){var O=[];F(f({},this.markers),O),L(O),S=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>C,this.enable=()=>{C=!0,this.morph.visible=!0},this.disable=()=>{for(var x in C=!1,this.morph.visible=!1,this.markers){var O;(O=this.markers[x])!==null&&O!==void 0&&O.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1<x&&(this._v1.set(...P[x].min),this._v2.set(...P[x].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),_.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=x=>{if(x!==void 0&&-1<x&&P[x]){var O;return(O=P[x].group)===null||O===void 0?void 0:O.visible}return!1}};A.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=A},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,d=u(5).createNewURL,p=u(5).isRegionGroup,g=u(36).STLLoader,m=u(37).OBJLoader,h=u(38).PrimitivesLoader;l.SceneLoader=function(b){var y=b;this.toBeDownloaded=0,this.progressMap={};var v=!1,M=!1,A=new h;this.getDownloadProgress=()=>{var W=0,$=0,X=!1;for(var K in this.progressMap){var re=this.progressMap[K];W+=re[1],$+=re[0],re[1]==0&&(X=!0)}return X&&(W=0),[W,$,M]},this.onProgress=W=>$=>{this.progressMap[W]=[$.loaded,$.total]},this.onError=W=>$=>{--this.toBeDownloaded,M=!0,console.error("There is an issue with external resource ".concat($!=null&&$.responseURL?": "+($==null?void 0:$.responseURL):"",".")),W&&W({type:"Error",xhr:$})};var _=(W,$)=>{var X=$.Default;if($.Inline)y.setupMultipleViews(X,$.Entries);else{var K=[],re=function(ae){W&&(newURL=d(j,W),K.push(new Promise((le,H)=>{fetch(newURL).then(U=>U.json()).then(U=>le({key:ae,data:U})).catch(U=>H(U))})))};for(var[V,j]of Object.entries($.Entries))re(V);Promise.all(K).then(oe=>{var ae={};oe.forEach(H=>{ae[H.key]=H.data}),y.setupMultipleViews(X,ae);var le=y.getZincCameraControls();le&&le.setCurrentViewport(X),v=!0})}};this.loadViewURL=(W,$)=>{this.toBeDownloaded+=1;var X=new XMLHttpRequest;X.onreadystatechange=()=>{if(X.readyState==4)if(X.status==200){var re=JSON.parse(X.responseText);y.setupMultipleViews("default",{default:re}),y.resetView(),v=!0,--this.toBeDownloaded,$!=null&&typeof $=="function"&&$()}else this.onError($)({responseURL:W})};var K=f(W);X.open("GET",K,!0),X.send()},this.loadModelsURL=(W,$,X,K,re,V,j)=>{var oe=$.length;this.toBeDownloaded+=oe;for(var ae=0;ae<oe;ae++){var le=$[ae],H=u(0).defaultMaterialColor,U=u(0).defaultOpacity;X!=null&&X[ae]!=null&&(H=!!X[ae]),K!=null&&K[ae]!=null&&(U=K[ae]);var D=0;re!=null&&re[ae]!=null&&(D=!!re[ae]);var Q=0;V!=null&&V[ae]!=null&&(Q=!!V[ae]),A.load(f(le),L(W,H,U,D,Q,void 0,void 0,void 0,void 0,j),this.onProgress(le),this.onError(j))}},this.loadFromViewURL=(W,$,X)=>{var K=new XMLHttpRequest;K.onreadystatechange=()=>{if(K.readyState==4&&K.status==200){var V=JSON.parse(K.responseText);y.loadView(V);for(var j,oe=[],ae=$+"_",le=0;le<V.numberOfResources;le++)j=ae+(le+1)+".json",oe.push(j);this.loadModelsURL(W,oe,V.colour,V.opacity,V.timeEnabled,V.morphColour,X)}};var re=f($+"_view.json");K.open("GET",re,!0),K.send()};var w=(W,$,X,K,re,V,j,oe,ae)=>(le,H)=>{var U=oe?new(u(39)).TubeLines:new(u(24)).Lines,D=void 0;H&&H[0]&&(D=new c.LineBasicMaterial({color:H[0].color.clone()}),1>H[0].opacity&&(D.transparent=!0),D.opacity=H[0].opacity,D.morphTargets=$,D.vertexColors=H[0].vertexColors);var Q={localTimeEnabled:$,localMorphColour:X};if(U&&(U.createLineSegment(le,D,Q),U.setName(K),U.setAnatomicalId(re),U.setRenderOrder(V),W.addZincObject(U),U.setDuration(y.getDuration()),j&&j.levels))for(var[ie,ce]of Object.entries(j.levels))U.addLOD(A,ie,ce.URL,ce.Index,j.preload);--this.toBeDownloaded,le.dispose(),ae!=null&&typeof ae=="function"&&ae(U)};this.loadLinesURL=(W,$,X,K,re,V,j)=>{var oe=0;this.toBeDownloaded+=1;var ae=!!(j!=null&&j.isInline)&&j.isInline,le=j!=null&&j.anatomicalId?j.anatomicalId:void 0,H=j&&"renderOrder"in j?j.renderOrder:void 0;X!=null&&(oe=!!X);var U=0;K!=null&&(U=!!K);var D=j.tubeLines&&!oe&&!U;if(ae){var Q=A.parse($);w(W,oe,U,re,le,H,j.lod,D,V)(Q.geometry,Q.materials)}else A.load($,w(W,oe,U,re,le,H,j.lod,D,V),this.onProgress($),this.onError(V),j.loaderOptions)};var C=(W,$,X,K,re)=>V=>{var j=V;(typeof j=="string"||j instanceof String)&&(j=JSON.parse(V));var oe=re&&re.isInline?re.isInline:void 0,ae=re&&re.anatomicalId?re.anatomicalId:void 0,le=re&&re.displayLabels?re.displayLabels:void 0,H=re&&"renderOrder"in re?re.renderOrder:void 0,U=new(u(18)).Glyphset;U.setDuration(y.getDuration()),U.groupName=X;var D=()=>{--this.toBeDownloaded,K!=null&&typeof K=="function"&&K(U)};++this.toBeDownloaded,oe?U.load(j,$,D,oe,le):U.load(j,f($),D,oe,le),U.setAnatomicalId(ae),U.setRenderOrder(H),W.addZincObject(U)};this.loadGlyphsetURL=(W,$,X,K,re,V)=>{var j=!!(V&&V.isInline)&&V.isInline;j?C(W,X,K,re,V)($):A.load($,C(W,X,K,re,V),this.onProgress($),this.onError(re),V.loaderOptions)};var P=(W,$,X,K,re,V,j)=>(oe,ae)=>{var le=new(u(22)).Pointset,H=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});ae&&ae[0]&&(1>ae[0].opacity&&(H.transparent=!0),H.opacity=ae[0].opacity,H.color=ae[0].color,H.morphTargets=$,H.vertexColors=ae[0].vertexColors);var U={};U.localTimeEnabled=$,U.localMorphColour=X,le&&(le.createMesh(oe,H,U),le.setName(K),le.setAnatomicalId(re),W.addZincObject(le),le.setDuration(y.getDuration()),le.setRenderOrder(V)),oe.dispose(),--this.toBeDownloaded,j!=null&&typeof j=="function"&&j(le)};this.loadSTL=(W,$,X,K)=>{this.toBeDownloaded+=1;var re=u(0).defaultMaterialColor,V=u(0).defaultOpacity,j=new g;j.crossOrigin="Anonymous",j.load(f($),L(W,re,V,!1,!1,X,void 0,void 0,void 0,K))},this.loadOBJ=(W,$,X,K)=>{this.toBeDownloaded+=1;var re=u(0).defaultMaterialColor,V=u(0).defaultOpacity,j=new m;j.crossOrigin="Anonymous",j.load(f($),L(W,re,V,!1,!1,X,void 0,void 0,void 0,K))};var R=(W,$,X,K,re,V,j)=>{this.toBeDownloaded+=1;var oe=u(0).defaultMaterialColor,ae=u(0).defaultOpacity,le=0,H=!!(j&&j.isInline)&&j.isInline,U=j&&j.fileFormat?j.fileFormat:void 0,D=j&&j.anatomicalId?j.anatomicalId:void 0,Q=j&&"renderOrder"in j?j.renderOrder:void 0;X!=null&&(le=!!X);var ie=0;K!=null&&(ie=!!K);var ce=A;if(U!==void 0){if(U=="STL")ce=new g;else if(U=="OBJ")return ce=new m,ce.crossOrigin="Anonymous",void ce.load($,objloader(W,oe,ae,le,ie,re,D,V),this.onProgress($),this.onError,j.loaderOptions)}if(H){var ge=A.parse($);L(W,oe,ae,le,ie,re,D,Q,j,V)(ge.geometry,ge.materials)}else ce.crossOrigin="Anonymous",A.load($,L(W,oe,ae,le,ie,re,D,Q,j,V),this.onProgress($),this.onError(V),j.loaderOptions)},I=function($,X,K){var re=0;return V=>{if(++re,V&&X!=null&&typeof X=="function"&&X(V),re==$&&(v==!1&&y.viewAll(),K!=null&&typeof K=="function")){K();var j=y.getZincCameraControls();j&&j.calculateMaxAllowedDistance(y)}}};this.loadPointsetURL=(W,$,X,K,re,V,j)=>{var oe=0;this.toBeDownloaded+=1,X!=null&&(oe=!!X);var ae=0;K!=null&&(ae=!!K);var le=!!(j&&j.isInline)&&j.isInline,H=j&&j.anatomicalId?j.anatomicalId:void 0,U=j&&"renderOrder"in j?j.renderOrder:void 0;if(le){var D=A.parse($);P(W,oe,ae,re,H,U,V)(D.geometry,D.materials)}else A.load($,P(W,oe,ae,re,H,U,V),this.onProgress($),this.onError(V),j.loaderOptions)};var S=(W,$,X,K,re,V)=>{var j=V&&V.isInline?V.isInline:void 0,oe=V&&V.anatomicalId?V.anatomicalId:void 0,ae=V&&"renderOrder"in V?V.renderOrder:void 0,le=void 0;if(X){if($&&X.images&&X.images.source)for(var H,U=X.images.source,D=0;D<U.length;D++)H=d(U[D],$),X.images.source[D]=H;if(X.type==="slides"&&(le=new(u(27)).TextureSlides),le){le.groupName=K;var Q=()=>{W.addZincObject(le),--this.toBeDownloaded,re!=null&&typeof re=="function"&&re(le)};++this.toBeDownloaded,le.load(X,Q,j),le.setAnatomicalId(oe),le.setRenderOrder(ae)}}},T=(W,$,X,K,re)=>()=>{if($.readyState==4&&$.status==200){var V=JSON.parse($.responseText);S(W,$.responseURL,V,X,K,re)}};this.loadTextureURL=(W,$,X,K,re)=>{var V=!!(re&&re.isInline)&&re.isInline;if(V)S(W,void 0,$,X,K,re);else{var j=new XMLHttpRequest;j.onreadystatechange=T(W,j,X,K,re),j.open("GET",f($),!0),j.send()}};var E=(W,$,X,K,re,V,j,oe,ae,le,H)=>{var U={colour:X,opacity:K,localTimeEnabled:re,localMorphColour:V},D=new(u(3)).Geometry;return D.createMesh($,oe,U),D.getMorph()?(D.setName(ae),D.setRenderOrder(le),D.setAnatomicalId(H),W&&W.addZincObject(D),D.setDuration(y.getDuration()),D.videoHandler&&y.setVideoHandler(D.videoHandler),D):void 0},L=(W,$,X,K,re,V,j,oe,ae,le)=>(H,U)=>{var D;U&&U[0]&&(D=U[0]);var Q=E(W,H,$,X,K,re,void 0,D,V,oe,j);if(ae.lod&&ae.lod.levels)for(var[ie,ce]of Object.entries(ae.lod.levels))Q.addLOD(A,ie,ce.URL,ce.Index,ae.lod.preload);--this.toBeDownloaded,H.dispose(),le!=null&&typeof le=="function"&&le(Q)},F=W=>{var $=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,X,K,re,V,j,oe,ae]=W.match($);return{years:X,months:K,weeks:re,days:V,hours:j,mins:oe,secs:ae}};this.loadSettings=W=>{if(W){if(W.Duration){var $=F(W.Duration);y.setDurationFromObject($)}if(W.OriginalDuration){var X=F(W.OriginalDuration);y.setOriginalDurationFromObject(X)}if(W.TimeStamps)for(var K in W.TimeStamps){var re=F(W.TimeStamps[K]);y.addMetadataTimeStamp(K,re)}}};var x=(W,$,X,K,re)=>{if(X){var V=void 0,j=!1;X.URL?(V=X.URL,$&&(V=d(V,$))):X.Inline&&(V=X.Inline.URL,j=!0);var oe={};if(X.LOD&&X.LOD.Levels){oe.preload=!!X.LOD.Preload,oe.levels={};for(var[ae,le]of Object.entries(X.LOD.Levels))oe.levels[ae]={},oe.levels[ae].URL=d(le.URL,$),oe.levels[ae].Index=le.Index}var H=X.GroupName;(H===void 0||H==="")&&(H="_Unnamed");var U={loaderOptions:{index:X.Index},isInline:j,fileFormat:X.FileFormat,anatomicalId:X.AnatomicalId,compression:X.compression,tubeLines:X.tubeLines,lod:oe,renderOrder:K};switch(X.Type){case"Surfaces":R(W,V,X.MorphVertices,X.MorphColours,H,re,U);break;case"Glyph":var D;j?D=X.Inline.GlyphGeometriesURL:(D=X.GlyphGeometriesURL,D=d(X.GlyphGeometriesURL,$)),X.DisplayLabels&&(U.displayLabels=!0),U.loaderOptions.isGlyphsets=!0,this.loadGlyphsetURL(W,V,D,H,re,U);break;case"Points":this.loadPointsetURL(W,V,X.MorphVertices,X.MorphColours,H,re,U);break;case"Lines":this.loadLinesURL(W,V,X.MorphVertices,X.MorphColours,H,re,U);break;case"Texture":this.loadTextureURL(W,V,H,re,U);break}}},O=(W,$,X)=>{if($){var K=void 0,re=!1;switch($.URL?(K=$.URL,W&&(K=d($.URL,W))):$.Inline&&(K=$.Inline.URL,re=!0),$.Type){case"View":re?(y.setupMultipleViews("default",{default:K}),v=!0,X!=null&&typeof X=="function"&&X()):this.loadViewURL(K,X);break;case"Settings":this.loadSettings($);break}}};this.loadGLTF=(W,$,X,K,re)=>{var V=new(u(40)).GLTFToZincJSLoader;V.load(y,W,$,X,K,re)};var B=(W,$,X,K)=>{if(X.Primitives&&X.Primitives.forEach(oe=>{var ae=1;oe.Order&&(ae=oe.Order),x(W,$,oe,ae,K)}),X.Transformation&&W.setTransformation(X.Transformation),X.Children)for(var[re,V]of Object.entries(X.Children)){var j=W.findOrCreateChildFromPath(re);j&&B(j,$,V,K)}},N=(W,$)=>{var X,K,re=W,V=$==null||(X=$.enabled)===null||X===void 0?void 0:X.include,j=$==null||(K=$.enabled)===null||K===void 0?void 0:K.exclude,oe=$==null?void 0:$.tubeLines;return(V!=null&&V.length||j!=null&&j.length)&&(V&&(re=W.filter(ae=>{if(ae.Type==="View")return!0;for(var le=0;le<V.length;le++)if(p(ae.RegionPath,ae.GroupName,V[le]))return!0;return!1})),j&&(re=re.filter(ae=>{if(ae.Type==="View")return!0;for(var le=0;le<j.length;le++)if(p(ae.RegionPath,ae.GroupName,j[le]))return!1;return!0}))),oe&&re.forEach(ae=>{ae.Type==="Lines"&&(ae.tubeLines=!0)}),re},k=(W,$)=>Array.isArray(W)?N(W,$):W,z=(W,$)=>{if(Array.isArray(W)){for(var X=0,K=0;K<W.length;K++)W[K].Type&&($&&W[K].Type==="View"||W[K].Type==="Surfaces"||W[K].Type==="Glyph"||W[K].Type==="Points"||W[K].Type==="Lines"||W[K].Type==="Texture")&&X++;return X}return 0},G=W=>{var $=W.Primitives?z(W.Primitives,!1):0;return W.Children&&Object.values(W.Children).forEach(X=>{$+=G(X)}),$},Y=W=>Array.isArray(W)?z(W,!0):typeof W=="object"&&W!==null&&W.Version==="2.0"?G(W.Regions):void 0,Z=(W,$,X,K,re)=>{var V=W;X.RegionPath&&X.RegionPath!==""&&(V=W.findOrCreateChildFromPath(X.RegionPath)),x(V,$,X,2*K,re)},te=(W,$,X,K,re,V)=>{for(var j=k($,V),oe=Y(j),ae=new I(oe,K,re),le=0;le<$.length;le++)O(X,j[le],ae);for(var H=0;H<$.length;H++)Z(W,X,j[H],H,ae)},q=(W,$,X,K,re)=>{var V=Y($),j=new I(V,K,re);$.Settings&&this.loadSettings($.Settings),$.Views&&_(X,$.Views),$.Regions&&B(W,X,$.Regions,j)};this.loadMetadataURL=(W,$,X,K,re)=>{var V=new XMLHttpRequest,j=f($);V.onreadystatechange=()=>{if(V.readyState==4&&V.status==200){y.resetMetadata(),y.resetDuration(),v=!1;var oe=V.responseURL;oe===void 0&&(oe=new URL(j).href);var ae=JSON.parse(V.responseText);Array.isArray(ae)?te(W,ae,oe,X,K,re):typeof ae=="object"&&ae!==null&&ae.Version=="2.0"&&q(W,ae,oe,X,K)}},V.open("GET",j,!0),V.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,g,m,h){var b=this,y=new c.FileLoader(this.manager);y.setPath(this.path),y.setResponseType("arraybuffer"),y.setRequestHeader(this.requestHeader),y.setWithCredentials(this.withCredentials),y.load(p,function(v){try{g(b.parse(v))}catch(M){h?h(M):console.error(M),b.manager.itemError(p)}},m,h)}parse(p){function g(h,b,y){for(var v=0,M=h.length;v<M;v++)if(h[v]!==b.getUint8(y+v,!1))return!1;return!0}var m=function(h){if(typeof h=="string"){for(var b=new Uint8Array(h.length),y=0;y<h.length;y++)b[y]=255&h.charCodeAt(y);return b.buffer||b}return h}(p);return function(h){var b=new DataView(h),y=b.getUint32(80,!0);if(84+y*50===b.byteLength)return!0;for(var v=[115,111,108,105,100],M=0;5>M;M++)if(g(v,b,M))return!1;return!0}(m)?function(h){for(var b,y,v,M,A,_,w,C,P=new DataView(h),R=P.getUint32(80,!0),I=!1,S=0;S<70;S++)P.getUint32(S,!1)==1129270351&&P.getUint8(S+4)==82&&P.getUint8(S+5)==61&&(I=!0,M=new Float32Array(3*(3*R)),A=P.getUint8(S+6)/255,_=P.getUint8(S+7)/255,w=P.getUint8(S+8)/255,C=P.getUint8(S+9)/255);for(var T=new c.BufferGeometry,E=new Float32Array(3*(3*R)),L=new Float32Array(3*(3*R)),F=0;F<R;F++){var x=84+F*50,O=P.getFloat32(x,!0),B=P.getFloat32(x+4,!0),N=P.getFloat32(x+8,!0);if(I){var k=P.getUint16(x+48,!0);32768&k?(b=A,y=_,v=w):(b=(31&k)/31,y=(31&k>>5)/31,v=(31&k>>10)/31)}for(var z=1;3>=z;z++){var G=x+12*z,Y=3*(3*F)+3*(z-1);E[Y]=P.getFloat32(G,!0),E[Y+1]=P.getFloat32(G+4,!0),E[Y+2]=P.getFloat32(G+8,!0),L[Y]=O,L[Y+1]=B,L[Y+2]=N,I&&(M[Y]=b,M[Y+1]=y,M[Y+2]=v)}}return T.setAttribute("position",new c.BufferAttribute(E,3)),T.setAttribute("normal",new c.BufferAttribute(L,3)),I&&(T.setAttribute("color",new c.BufferAttribute(M,3)),T.hasColors=!0,T.alpha=C),T}(m):function(h){for(var b,y=new c.BufferGeometry,v=/solid([\s\S]*?)endsolid/g,M=/facet([\s\S]*?)endfacet/g,A=0,_=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,w=new RegExp("vertex"+_+_+_,"g"),C=new RegExp("normal"+_+_+_,"g"),P=[],R=[],I=new c.Vector3,S=0,T=0,E=0;(b=v.exec(h))!==null;){T=E;for(var L=b[0];(b=M.exec(L))!==null;){for(var F=0,x=0,O=b[0];(b=C.exec(O))!==null;)I.x=parseFloat(b[1]),I.y=parseFloat(b[2]),I.z=parseFloat(b[3]),x++;for(;(b=w.exec(O))!==null;)P.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),R.push(I.x,I.y,I.z),F++,E++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+A),F!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+A),A++}var B=T,N=E-T;y.addGroup(B,N,S),S++}return y.setAttribute("position",new c.Float32BufferAttribute(P,3)),y.setAttribute("normal",new c.Float32BufferAttribute(R,3)),y}(function(h){return typeof h=="string"?h:c.LoaderUtils.decodeText(new Uint8Array(h))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>A});var c=u(4),f=/^[og]\s*(.+)?/,d=/^mtllib /,p=/^usemtl /,g=/^usemap /,m=new c.Vector3,h=new c.Vector3,b=new c.Vector3,y=new c.Vector3,v=new c.Vector3;function M(){var _={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(C,P){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=C,void(this.object.fromDeclaration=P!==!1);var R=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:C||"",fromDeclaration:P!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(T,E){var L=this._finalize(!1);L&&(L.inherited||0>=L.groupCount)&&this.materials.splice(L.index,1);var F={index:this.materials.length,name:T||"",mtllib:Array.isArray(E)&&0<E.length?E[E.length-1]:"",smooth:L===void 0?this.smooth:L.smooth,groupStart:L===void 0?0:L.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(O){var B={index:typeof O=="number"?O:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(F),F},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(T){var E=this.currentMaterial();if(E&&E.groupEnd===-1&&(E.groupEnd=this.geometry.vertices.length/3,E.groupCount=E.groupEnd-E.groupStart,E.inherited=!1),T&&1<this.materials.length)for(var L=this.materials.length-1;0<=L;L--)0>=this.materials[L].groupCount&&this.materials.splice(L,1);return T&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),E}},R&&R.name&&typeof R.clone=="function"){var I=R.clone(0);I.inherited=!0,this.object.materials.push(I)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(C,P){var R=parseInt(C,10);return 3*(0<=R?R-1:R+P/3)},parseNormalIndex:function(C,P){var R=parseInt(C,10);return 3*(0<=R?R-1:R+P/3)},parseUVIndex:function(C,P){var R=parseInt(C,10);return 2*(0<=R?R-1:R+P/2)},addVertex:function(C,P,R){var I=this.vertices,S=this.object.geometry.vertices;S.push(I[C+0],I[C+1],I[C+2]),S.push(I[P+0],I[P+1],I[P+2]),S.push(I[R+0],I[R+1],I[R+2])},addVertexPoint:function(C){var P=this.vertices,R=this.object.geometry.vertices;R.push(P[C+0],P[C+1],P[C+2])},addVertexLine:function(C){var P=this.vertices,R=this.object.geometry.vertices;R.push(P[C+0],P[C+1],P[C+2])},addNormal:function(C,P,R){var I=this.normals,S=this.object.geometry.normals;S.push(I[C+0],I[C+1],I[C+2]),S.push(I[P+0],I[P+1],I[P+2]),S.push(I[R+0],I[R+1],I[R+2])},addFaceNormal:function(C,P,R){var I=this.vertices,S=this.object.geometry.normals;m.fromArray(I,C),h.fromArray(I,P),b.fromArray(I,R),v.subVectors(b,h),y.subVectors(m,h),v.cross(y),v.normalize(),S.push(v.x,v.y,v.z),S.push(v.x,v.y,v.z),S.push(v.x,v.y,v.z)},addColor:function(C,P,R){var I=this.colors,S=this.object.geometry.colors;I[C]!==void 0&&S.push(I[C+0],I[C+1],I[C+2]),I[P]!==void 0&&S.push(I[P+0],I[P+1],I[P+2]),I[R]!==void 0&&S.push(I[R+0],I[R+1],I[R+2])},addUV:function(C,P,R){var I=this.uvs,S=this.object.geometry.uvs;S.push(I[C+0],I[C+1]),S.push(I[P+0],I[P+1]),S.push(I[R+0],I[R+1])},addDefaultUV:function(){var C=this.object.geometry.uvs;C.push(0,0),C.push(0,0),C.push(0,0)},addUVLine:function(C){var P=this.uvs,R=this.object.geometry.uvs;R.push(P[C+0],P[C+1])},addFace:function(C,P,R,I,S,T,E,L,F){var x=this.vertices.length,O=this.parseVertexIndex(C,x),B=this.parseVertexIndex(P,x),N=this.parseVertexIndex(R,x);if(this.addVertex(O,B,N),this.addColor(O,B,N),E!==void 0&&E!==""){var k=this.normals.length;O=this.parseNormalIndex(E,k),B=this.parseNormalIndex(L,k),N=this.parseNormalIndex(F,k),this.addNormal(O,B,N)}else this.addFaceNormal(O,B,N);if(I!==void 0&&I!==""){var z=this.uvs.length;O=this.parseUVIndex(I,z),B=this.parseUVIndex(S,z),N=this.parseUVIndex(T,z),this.addUV(O,B,N),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(C){this.object.geometry.type="Points";for(var P,R=this.vertices.length,I=0,S=C.length;I<S;I++)P=this.parseVertexIndex(C[I],R),this.addVertexPoint(P),this.addColor(P)},addLineGeometry:function(C,P){this.object.geometry.type="Line";for(var R=this.vertices.length,I=this.uvs.length,S=0,T=C.length;S<T;S++)this.addVertexLine(this.parseVertexIndex(C[S],R));for(var E=0,L=P.length;E<L;E++)this.addUVLine(this.parseUVIndex(P[E],I))}};return _.startObject("",!1),_}class A extends c.Loader{constructor(w){super(w),this.materials=null}load(w,C,P,R){var I=this,S=new c.FileLoader(this.manager);S.setPath(this.path),S.setRequestHeader(this.requestHeader),S.setWithCredentials(this.withCredentials),S.load(w,function(T){try{C(I.parse(T))}catch(E){R?R(E):console.error(E),I.manager.itemError(w)}},P,R)}setMaterials(w){return this.materials=w,this}parse(w){var C=new M;w.indexOf(`\r
3235
3235
  `)!==-1&&(w=w.replace(/\r\n/g,`
3236
3236
  `)),w.indexOf(`\\
3237
3237
  `)!==-1&&(w=w.replace(/\\\n/g,""));for(var P=w.split(`
3238
- `),R="",I="",S=0,T=[],E=typeof"".trimLeft=="function",L=0,F=P.length;L<F;L++)if(R=P[L],R=E?R.trimLeft():R.trim(),S=R.length,S!==0&&(I=R.charAt(0),I!=="#"))if(I==="v"){var x=R.split(/\s+/);switch(x[0]){case"v":C.vertices.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3])),7<=x.length?C.colors.push(parseFloat(x[4]),parseFloat(x[5]),parseFloat(x[6])):C.colors.push(void 0,void 0,void 0);break;case"vn":C.normals.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3]));break;case"vt":C.uvs.push(parseFloat(x[1]),parseFloat(x[2]))}}else if(I==="f"){for(var O,B=R.substr(1).trim(),N=B.split(/\s+/),k=[],z=0,G=N.length;z<G;z++)if(O=N[z],0<O.length){var Y=O.split("/");k.push(Y)}for(var Z=k[0],te=1,q=k.length-1;te<q;te++){var j=k[te],$=k[te+1];C.addFace(Z[0],j[0],$[0],Z[1],j[1],$[1],Z[2],j[2],$[2])}}else if(I==="l"){var X=R.substring(1).trim().split(" "),K=[],re=[];if(R.indexOf("/")===-1)K=X;else for(var V,W=0,oe=X.length;W<oe;W++)V=X[W].split("/"),V[0]!==""&&K.push(V[0]),V[1]!==""&&re.push(V[1]);C.addLineGeometry(K,re)}else if(I==="p"){var ae=R.substr(1).trim(),le=ae.split(" ");C.addPointGeometry(le)}else if((T=f.exec(R))!==null){var H=(" "+T[0].substr(1).trim()).substr(1);C.startObject(H)}else if(p.test(R))C.object.startMaterial(R.substring(7).trim(),C.materialLibraries);else if(d.test(R))C.materialLibraries.push(R.substring(7).trim());else if(g.test(R))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(I==="s"){if(T=R.split(" "),1<T.length){var U=T[1].trim().toLowerCase();C.object.smooth=U!=="0"&&U!=="off"}else C.object.smooth=!0;var D=C.object.currentMaterial();D&&(D.smooth=C.object.smooth)}else{if(R==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+R+'"')}C.finalize();var Q=new c.Group;Q.materialLibraries=[].concat(C.materialLibraries);var ie=C.objects.length!==1||C.objects[0].geometry.vertices.length!==0;if(ie==!0)for(var ce=0,ge=C.objects.length;ce<ge;ce++){var ye=C.objects[ce],ue=ye.geometry,be=ye.materials,ne=ue.type==="Line",de=ue.type==="Points",ve=!1;if(ue.vertices.length!==0){var Ee=new c.BufferGeometry;Ee.setAttribute("position",new c.Float32BufferAttribute(ue.vertices,3)),0<ue.normals.length&&Ee.setAttribute("normal",new c.Float32BufferAttribute(ue.normals,3)),0<ue.colors.length&&(ve=!0,Ee.setAttribute("color",new c.Float32BufferAttribute(ue.colors,3))),ue.hasUVIndices===!0&&Ee.setAttribute("uv",new c.Float32BufferAttribute(ue.uvs,2));for(var Se=[],Ie=0,Je=be.length;Ie<Je;Ie++){var Ve=be[Ie],st=Ve.name+"_"+Ve.smooth+"_"+ve,Re=C.materials[st];if(this.materials!==null){if(Re=this.materials.create(Ve.name),ne&&Re&&!(Re instanceof c.LineBasicMaterial)){var Ue=new c.LineBasicMaterial;c.Material.prototype.copy.call(Ue,Re),Ue.color.copy(Re.color),Re=Ue}else if(de&&Re&&!(Re instanceof c.PointsMaterial)){var We=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(We,Re),We.color.copy(Re.color),We.map=Re.map,Re=We}}Re===void 0&&(Re=ne?new c.LineBasicMaterial:de?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Re.name=Ve.name,Re.flatShading=!Ve.smooth,Re.vertexColors=ve,C.materials[st]=Re),Se.push(Re)}var Pt=void 0;if(1<Se.length){for(var It,pt=0,yt=be.length;pt<yt;pt++)It=be[pt],Ee.addGroup(It.groupStart,It.groupCount,pt);Pt=ne?new c.LineSegments(Ee,Se):de?new c.Points(Ee,Se):new c.Mesh(Ee,Se)}else Pt=ne?new c.LineSegments(Ee,Se[0]):de?new c.Points(Ee,Se[0]):new c.Mesh(Ee,Se[0]);Pt.name=ye.name,Q.add(Pt)}}else if(0<C.vertices.length){var oi=new c.PointsMaterial({size:1,sizeAttenuation:!1}),ki=new c.BufferGeometry;ki.setAttribute("position",new c.Float32BufferAttribute(C.vertices,3)),0<C.colors.length&&C.colors[0]!==void 0&&(ki.setAttribute("color",new c.Float32BufferAttribute(C.colors,3)),oi.vertexColors=!0);var ai=new c.Points(ki,oi);Q.add(ai)}return Q}}},(o,l,u)=>{function c(_,w){var C=Object.keys(_);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(_);w&&(P=P.filter(function(R){return Object.getOwnPropertyDescriptor(_,R).enumerable})),C.push.apply(C,P)}return C}function f(_){for(var w,C=1;C<arguments.length;C++)w=arguments[C]==null?{}:arguments[C],C%2?c(Object(w),!0).forEach(function(P){d(_,P,w[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(w)):c(Object(w)).forEach(function(P){Object.defineProperty(_,P,Object.getOwnPropertyDescriptor(w,P))});return _}function d(_,w,C){return(w=p(w))in _?Object.defineProperty(_,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[w]=C,_}function p(_){var w=g(_,"string");return typeof w=="symbol"?w:w+""}function g(_,w){if(typeof _!="object"||!_)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var P=C.call(_,w);if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(_)}var m=u(19).JSONLoader,h=u(4),b=h.FileLoader,y=_=>{var w=(P,R)=>{P.metadata.number_of_vertices+=R.metadata.number_of_vertices,"labels"in P&&P.labels.push(...P.labels);var I=["axis1","axis2","axis3","colors","positions","scale"];I.forEach(S=>{S in P&&Object.keys(P[S]).forEach(T=>{P[S][T].push(...R[S][T])})})};if(_&&0<_.length)for(;1<_.length;){var C=_.splice(1,1);w(_[0],C[0])}},v=_=>{var w=(P,R)=>{P.merge(R)};if(_&&0<_.length){for(;1<_.length;){var C=_.splice(1,1);w(_[0],C[0])}return _[0]}},M=function(w,C,P){var R=new b,I=new m;R.crossOrigin=C;var S=w,T=P,E=void 0,L=!1,F=!1,x=void 0,O=[],B=G=>{var Y=E[G.index];if(!Y)N(G);else if("GlyphGeometriesURL"in Y)G.onLoad(Y);else{var Z=I.parse(Y);G.onLoad(Z.geometry,Z.materials)}},N=G=>{G.onError&&(!x&&(x={responseURL:S}),G.onError(x))};this.downloadCompleted=G=>{try{E=JSON.parse(G[0]),L=!1,F=!0,Array.isArray(E)?O.forEach(Y=>B(Y)):O.forEach(Y=>N(Y))}catch{O.forEach(Z=>N(Z))}};var k=()=>G=>{x=G,F=!0,L=!1,O.forEach(Y=>{N(Y)})},z=()=>G=>{O.forEach(Y=>{Y.onProgress&&Y.onProgress(G)})};this.load=(G,Y,Z,te)=>{var q={index:G,onLoad:Y,onProgress:Z,onError:te};F?E?B(q):N(x):L?O.push(q):(O.push(q),L=!0,R.load(S,T,z,k))}},A=function(w,C,P){var R=[],I=w,S=C,T=0,E=P.isGlyphsets;this.itemDownloaded=(L,F)=>{if(R[L]=F,T++,T==I&&0<R.length)if(E){var k=R.map(z=>JSON.parse(z[0]));y(k),S(k[0])}else{for(var x=R[0][1],O=R.map(z=>z[0]),B=v(O),N=1;N<I;N++)R[L][0].dispose(),R[L][1].forEach(z=>z.dispose());S(B,x)}}};l.PrimitivesLoader=function(){var _=0,w=20;this.crossOrigin="Anonymous";var C=new m,P=new b;P.crossOrigin="Anonymous";var R=[],I={},S=(F,x,O,B,N)=>{var k=F.length,z=new A(k,x,N),G=0;F.forEach(Y=>{var Z=N?f({},N):{};Z.msHandler=z,Z.order=G,G++,E(Y,x,O,B,Z)})},T=(F,x,O,B,N)=>{var k=N?f({},N):{},z=I[F];if(!z)if(w>_){var G=new L(void 0,this,k);++_,z=new M(F,this.crossOrigin,G),I[F]=z}else R.push({url:F,onLoad:x,onProgress:O,onError:B,options:N});z&&(k.isHandler=z,z.load(N.index,x,O,B))},E=(F,x,O,B,N)=>{if(N&&N.index!==void 0)T(F,x,O,B,N);else if(w>_){++_;var k=new L(x,this,N),z=new L(B,this,N);N.isGlyphsets?P.load(F,k,O,z):(C.crossOrigin=this.crossOrigin,C.load(F,k,O,z))}else R.push({url:F,onLoad:x,onProgress:O,onError:B,options:N})};this.load=(F,x,O,B,N)=>{Array.isArray(F)?S(F,x,O,B,N):E(F,x,O,B,N)},this.loadFromWaitingList=()=>{for(;w>_;){var F=R.shift();if(F)this.load(F.url,F.onLoad,F.onProgress,F.onError,F.options);else return}},this.itemRemainingCheck=()=>{if(R.length===0&&_==0)for(var F in I)I.hasOwnProperty(F)&&delete I[F]};var L=function(x,O,B){return function(){--_;for(var N=arguments.length,k=Array(N),z=0;z<N;z++)k[z]=arguments[z];B!=null&&B.msHandler?B.msHandler.itemDownloaded(B.order,k):B!=null&&B.isHandler?B.isHandler.downloadCompleted(k):x&&x(...k),O.loadFromWaitingList(),O.itemRemainingCheck()}};this.parse=F=>loader.parse(F)}},(o,l,u)=>{var c=u(4),f=u(5).mergeGeometries,d=function(){u(10).ZincObject.call(this),this.isTubeLines=!0;var p={},g={radius:1,radialSegments:8,smooth:!1};this.createLineSegment=(h,b,y)=>{if(h&&b){p={geometryIn:h,materialIn:b,options:y};var v=m(h.vertices),M=new c.MeshStandardMaterial({color:b.color}),A=new c.Mesh(v,M);this.setMesh(A,y.localTimeEnabled,y.localMorphColour)}},this.setWidth=h=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=h,this.morph.material.needsUpdate=!0)},this.setAlpha=function(h){var b=this.getMorph();b.material.opacity=h,b.material.transparent=1>h,b.material.depthWrite=.5<h},this.setWireframe=h=>{var b=this.getMorph();b.material.wireframe=h},this.setTubeLines=(h,b)=>{if(h&&b){var{geometryIn:y}=p,v=this.getMorph();v.geometry.dispose(),g=Object.assign(g,{radius:h,radialSegments:b}),v.geometry=m(y.vertices)}};var m=h=>{var b,{radius:y,radialSegments:v,smooth:M}=g;if(M){var A=new c.CatmullRomCurve3(h);b=new c.TubeGeometry(A,h.length,y,v,!1)}else{for(var _=[],w=0;w+1<h.length;w+=2){var C=new c.LineCurve3(h[w],h[w+1]),P=new c.TubeGeometry(C,1,y,v,!1);_.push(P)}b=f(_,!0),_.forEach(R=>R.dispose())}return b}};d.prototype=Object.create(u(10).ZincObject.prototype),l.TubeLines=d},(o,l,u)=>{u(4);var c=u(41).GLTFLoader,f=function(){var d=this;this.parseGLTFObjects=(p,g,m,h)=>{var b=g;if(m!==0){if(p.type!=="Object3D"){var y;if(p.type==="Mesh"?y=new(u(3)).Geometry:p.type==="LineSegments"?y=new(u(24)).Lines:p.type==="Points"&&(y=new(u(22)).Pointset),y){var v=!1,M=!1;p.geometry&&p.geometry.morphAttributes&&(v=!!p.geometry.morphAttributes.position,M=!!p.geometry.morphAttributes.color),y.setMesh(p.clone(),v,M);var A=y.getMorph();y.groupName=A.name,A.matrixAutoUpdate=!0,g.addZincObject(y),h!=null&&typeof h=="function"&&h(y)}}else if(p.name!==""&&(g&&(b=g.findOrCreateChildFromPath(p.name)),b)){var _=b.getGroup();_.position.copy(p.position),_.rotation.copy(p.rotation),_.quaternion.copy(p.quaternion),_.matrixAutoUpdate=!0}}m++,p.children.forEach(w=>{d.parseGLTFObjects(w,b,m,h)})},this.setCamera=p=>{p.viewAll();var g=p.getZincCameraControls(),m=g.getCurrentViewport();g.addViewport("default",m),g.setDefaultViewport("default")},this.load=(p,g,m,h,b)=>{var y=m.substring(0,m.lastIndexOf("/")+1),v=m.substring(m.lastIndexOf("/")+1,m.length),M=new c().setPath(y);M.load(v,function(A){console.log(A),d.parseGLTFObjects(A.scene,g,0,h),d.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=MD},(o,l,u)=>{var c=u(43).GLTFExporter,f=function(d){var p=d;this.exportGLTF=g=>{var m=p.getRootRegion(),h=m.getAllObjects(!0),b=[];h.forEach(M=>{M.animationClip&&b.push({clip:M.animationClip[0],mesh:M.getMorph()})});var y=new c,v={binary:g,animations:b};return new Promise(M=>{y.parse(p.getThreeJSScene(),function(A){M(A)},v)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new T(x)}),this.register(function(x){return new E(x)}),this.register(function(x){return new L(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,O,B){for(var N=new S,k=[],z=0,G=this.pluginCallbacks.length;z<G;z++)k.push(this.pluginCallbacks[z](N));N.setPlugins(k),N.write(x,O,B)}}var d={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p={};p[c.NearestFilter]=d.NEAREST,p[c.NearestMipmapNearestFilter]=d.NEAREST_MIPMAP_NEAREST,p[c.NearestMipmapLinearFilter]=d.NEAREST_MIPMAP_LINEAR,p[c.LinearFilter]=d.LINEAR,p[c.LinearMipmapNearestFilter]=d.LINEAR_MIPMAP_NEAREST,p[c.LinearMipmapLinearFilter]=d.LINEAR_MIPMAP_LINEAR,p[c.ClampToEdgeWrapping]=d.CLAMP_TO_EDGE,p[c.RepeatWrapping]=d.REPEAT,p[c.MirroredRepeatWrapping]=d.MIRRORED_REPEAT;var g={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},m=12,h=1179937895,b=2,y=8,v=1313821514,M=5130562;function A(F,x){return F.length===x.length&&F.every(function(O,B){return O===x[B]})}function _(F){if(window.TextEncoder!==void 0)return new TextEncoder().encode(F).buffer;for(var x,O=new Uint8Array(new ArrayBuffer(F.length)),B=0,N=F.length;B<N;B++)x=F.charCodeAt(B),O[B]=255<x?32:x;return O.buffer}function w(F){return A(F.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function C(F,x,O){for(var B={min:Array(F.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(F.itemSize).fill(Number.NEGATIVE_INFINITY)},N=x;N<x+O;N++)for(var k,z=0;z<F.itemSize;z++)k=void 0,4<F.itemSize?k=F.array[N*F.itemSize+z]:z===0?k=F.getX(N):z===1?k=F.getY(N):z===2?k=F.getZ(N):z==3&&(k=F.getW(N)),B.min[z]=Math.min(B.min[z],k),B.max[z]=Math.max(B.max[z],k);return B}function P(F){return 4*Math.ceil(F/4)}function R(F){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,O=P(F.byteLength);if(O!==F.byteLength){var B=new Uint8Array(O);if(B.set(new Uint8Array(F)),x!==0)for(var N=F.byteLength;N<O;N++)B[N]=x;return B.buffer}return F}var I=null;class S{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(x){this.plugins=x}write(x,O,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(x);var N=this;Promise.all(this.pending).then(function(){var k=N.buffers,z=N.json,G=N.options,Y=N.extensionsUsed,Z=new Blob(k,{type:"application/octet-stream"}),te=Object.keys(Y);if(0<te.length&&(z.extensionsUsed=te),z.buffers&&0<z.buffers.length&&(z.buffers[0].byteLength=Z.size),G.binary===!0){var q=new window.FileReader;q.readAsArrayBuffer(Z),q.onloadend=function(){var $=R(q.result),X=new DataView(new ArrayBuffer(y));X.setUint32(0,$.byteLength,!0),X.setUint32(4,M,!0);var K=R(_(JSON.stringify(z)),32),re=new DataView(new ArrayBuffer(y));re.setUint32(0,K.byteLength,!0),re.setUint32(4,v,!0);var V=new ArrayBuffer(m),W=new DataView(V);W.setUint32(0,h,!0),W.setUint32(4,b,!0);var oe=m+re.byteLength+K.byteLength+X.byteLength+$.byteLength;W.setUint32(8,oe,!0);var ae=new Blob([V,re,K,X,$],{type:"application/octet-stream"}),le=new window.FileReader;le.readAsArrayBuffer(ae),le.onloadend=function(){O(le.result)}}}else if(z.buffers&&0<z.buffers.length){var j=new window.FileReader;j.readAsDataURL(Z),j.onloadend=function(){var $=j.result;z.buffers[0].uri=$,O(z)}}else O(z)})}serializeUserData(x,O){if(!(x.userData&&x.userData.isZincObject)&&Object.keys(x.userData).length!==0){var B=this.options,N=this.extensionsUsed;try{var k=JSON.parse(JSON.stringify(x.userData));if(B.includeCustomExtensions&&k.gltfExtensions){for(var z in O.extensions===void 0&&(O.extensions={}),k.gltfExtensions)O.extensions[z]=k.gltfExtensions[z],N[z]=!0;delete k.gltfExtensions}0<Object.keys(k).length&&(O.extras=k)}catch(G){console.warn("THREE.GLTFExporter: userData of '"+x.name+"' won't be serialized because of JSON.stringify error - "+G.message)}}}getUID(x){return this.uids.has(x)||this.uids.set(x,this.uid++),this.uids.get(x)}isNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return!1;for(var B=new c.Vector3,N=0,k=x.count;N<k;N++)if(5e-4<Math.abs(B.fromBufferAttribute(x,N).length()-1))return!1;return!0}createNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return O.attributesNormalized.get(x);for(var B=x.clone(),N=new c.Vector3,k=0,z=B.count;k<z;k++)N.fromBufferAttribute(B,k),N.x===0&&N.y===0&&N.z===0?N.setX(1):N.normalize(),B.setXYZ(k,N.x,N.y,N.z);return O.attributesNormalized.set(x,B),B}applyTextureTransform(x,O){var B=!1,N={};(O.offset.x!==0||O.offset.y!==0)&&(N.offset=O.offset.toArray(),B=!0),O.rotation!==0&&(N.rotation=O.rotation,B=!0),(O.repeat.x!==1||O.repeat.y!==1)&&(N.scale=O.repeat.toArray(),B=!0),B&&(x.extensions=x.extensions||{},x.extensions.KHR_texture_transform=N,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(x){var O=this.json,B=this.buffers;return O.buffers||(O.buffers=[{byteLength:0}]),B.push(x),0}processBufferView(x,O,B,N,k){var z=this.json;z.bufferViews||(z.bufferViews=[]);for(var G=O===d.UNSIGNED_BYTE?1:O===d.UNSIGNED_SHORT?2:4,Y=P(N*x.itemSize*G),Z=new DataView(new ArrayBuffer(Y)),te=0,q=B;q<B+N;q++)for(var j,$=0;$<x.itemSize;$++)j=void 0,4<x.itemSize?j=x.array[q*x.itemSize+$]:$===0?j=x.getX(q):$===1?j=x.getY(q):$===2?j=x.getZ(q):$==3&&(j=x.getW(q)),O===d.FLOAT?Z.setFloat32(te,j,!0):O===d.UNSIGNED_INT?Z.setUint32(te,j,!0):O===d.UNSIGNED_SHORT?Z.setUint16(te,j,!0):O===d.UNSIGNED_BYTE&&Z.setUint8(te,j),te+=G;var X={buffer:this.processBuffer(Z.buffer),byteOffset:this.byteOffset,byteLength:Y};k!==void 0&&(X.target=k),k===d.ARRAY_BUFFER&&(X.byteStride=x.itemSize*G),this.byteOffset+=Y,z.bufferViews.push(X);var K={id:z.bufferViews.length-1,byteLength:0};return K}processBufferViewImage(x){var O=this,B=O.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(N){var k=new window.FileReader;k.readAsArrayBuffer(x),k.onloadend=function(){var z=R(k.result),G={buffer:O.processBuffer(z),byteOffset:O.byteOffset,byteLength:z.byteLength};O.byteOffset+=z.byteLength,N(B.bufferViews.push(G)-1)}})}processAccessor(x,O,B,N){var k,z=this.options,G=this.json;if(x.array.constructor===Float32Array)k=d.FLOAT;else if(x.array.constructor===Uint32Array)k=d.UNSIGNED_INT;else if(x.array.constructor===Uint16Array)k=d.UNSIGNED_SHORT;else if(x.array.constructor===Uint8Array)k=d.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),N===void 0&&(N=x.count),z.truncateDrawRange&&O!==void 0&&O.index===null){var Y=B+N,Z=O.drawRange.count===1/0?x.count:O.drawRange.start+O.drawRange.count;B=Math.max(B,O.drawRange.start),N=Math.min(Y,Z)-B,0>N&&(N=0)}if(N===0)return null;var te,q=C(x,B,N);O!==void 0&&(te=x===O.index?d.ELEMENT_ARRAY_BUFFER:d.ARRAY_BUFFER);var j=this.processBufferView(x,k,B,N,te),$={bufferView:j.id,byteOffset:j.byteOffset,componentType:k,count:N,max:q.max,min:q.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&($.normalized=!0),G.accessors||(G.accessors=[]),G.accessors.push($)-1}processImage(x,O,B){var N=this,k=N.cache,z=N.json,G=N.options,Y=N.pending;k.images.has(x)||k.images.set(x,{});var Z=k.images.get(x),te=O===c.RGBAFormat?"image/png":"image/jpeg",q=te+":flipY/"+B.toString();if(Z[q]!==void 0)return Z[q];z.images||(z.images=[]);var j={mimeType:te};if(G.embedImages){var $=I=I||document.createElement("canvas");$.width=Math.min(x.width,G.maxTextureSize),$.height=Math.min(x.height,G.maxTextureSize);var X=$.getContext("2d");if(B===!0&&(X.translate(0,$.height),X.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)X.drawImage(x,0,0,$.width,$.height);else{O!==c.RGBAFormat&&O!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>G.maxTextureSize||x.height>G.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var K=new Uint8ClampedArray(4*(x.height*x.width));if(O===c.RGBAFormat)for(var re=0;re<K.length;re+=4)K[re+0]=x.data[re+0],K[re+1]=x.data[re+1],K[re+2]=x.data[re+2],K[re+3]=x.data[re+3];else for(var V=0,W=0;V<K.length;V+=4,W+=3)K[V+0]=x.data[W+0],K[V+1]=x.data[W+1],K[V+2]=x.data[W+2],K[V+3]=255;X.putImageData(new ImageData(K,x.width,x.height),0,0)}G.binary===!0?Y.push(new Promise(function(ae){$.toBlob(function(le){N.processBufferViewImage(le).then(function(H){j.bufferView=H,ae()})},te)})):j.uri=$.toDataURL(te)}else j.uri=x.src;var oe=z.images.push(j)-1;return Z[q]=oe,oe}processSampler(x){var O=this.json;O.samplers||(O.samplers=[]);var B={magFilter:p[x.magFilter],minFilter:p[x.minFilter],wrapS:p[x.wrapS],wrapT:p[x.wrapT]};return O.samplers.push(B)-1}processTexture(x){var O=this.cache,B=this.json;if(O.textures.has(x))return O.textures.get(x);B.textures||(B.textures=[]);var N={sampler:this.processSampler(x),source:this.processImage(x.image,x.format,x.flipY)};x.name&&(N.name=x.name),this._invokeAll(function(z){z.writeTexture&&z.writeTexture(x,N)});var k=B.textures.push(N)-1;return O.textures.set(x,k),k}processMaterial(x){var O=this.cache,B=this.json;if(O.materials.has(x))return O.materials.get(x);if(x.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var N={pbrMetallicRoughness:{}};x.isMeshStandardMaterial!==!0&&x.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var k=x.color.toArray().concat([x.opacity]);if(A(k,[1,1,1,1])||(N.pbrMetallicRoughness.baseColorFactor=k),x.isMeshStandardMaterial?(N.pbrMetallicRoughness.metallicFactor=x.metalness,N.pbrMetallicRoughness.roughnessFactor=x.roughness):(N.pbrMetallicRoughness.metallicFactor=.5,N.pbrMetallicRoughness.roughnessFactor=.5),x.metalnessMap||x.roughnessMap)if(x.metalnessMap===x.roughnessMap){var z={index:this.processTexture(x.metalnessMap)};this.applyTextureTransform(z,x.metalnessMap),N.pbrMetallicRoughness.metallicRoughnessTexture=z}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(x.map){var G={index:this.processTexture(x.map)};this.applyTextureTransform(G,x.map),N.pbrMetallicRoughness.baseColorTexture=G}if(x.emissive){var Y=x.emissive.clone().multiplyScalar(x.emissiveIntensity),Z=Math.max(Y.r,Y.g,Y.b);if(1<Z&&(Y.multiplyScalar(1/Z),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<Z&&(N.emissiveFactor=Y.toArray()),x.emissiveMap){var te={index:this.processTexture(x.emissiveMap)};this.applyTextureTransform(te,x.emissiveMap),N.emissiveTexture=te}}if(x.normalMap){var q={index:this.processTexture(x.normalMap)};x.normalScale&&x.normalScale.x!==-1&&(x.normalScale.x!==x.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),q.scale=x.normalScale.x),this.applyTextureTransform(q,x.normalMap),N.normalTexture=q}if(x.aoMap){var j={index:this.processTexture(x.aoMap),texCoord:1};x.aoMapIntensity!==1&&(j.strength=x.aoMapIntensity),this.applyTextureTransform(j,x.aoMap),N.occlusionTexture=j}x.transparent?N.alphaMode="BLEND":0<x.alphaTest&&(N.alphaMode="MASK",N.alphaCutoff=x.alphaTest),x.side===c.DoubleSide&&(N.doubleSided=!0),x.name!==""&&(N.name=x.name),this.serializeUserData(x,N),this._invokeAll(function(X){X.writeMaterial&&X.writeMaterial(x,N)});var $=B.materials.push(N)-1;return O.materials.set(x,$),$}processMesh(x){var O=this.cache,B=this.json,N=[x.geometry.uuid];if(Array.isArray(x.material))for(var k=0,z=x.material.length;k<z;k++)N.push(x.material[k].uuid);else N.push(x.material.uuid);var G=N.join(":");if(O.meshes.has(G))return O.meshes.get(G);var Y,Z=x.geometry;if(Y=x.isLineSegments?d.LINES:x.isLineLoop?d.LINE_LOOP:x.isLine?d.LINE_STRIP:x.isPoints?d.POINTS:x.material.wireframe?d.LINES:d.TRIANGLES,Z.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var te={},q={},j=[],$=[],X={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},K=Z.getAttribute("normal");K===void 0||this.isNormalizedNormalAttribute(K)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),Z.setAttribute("normal",this.createNormalizedNormalAttribute(K)));var re=null;for(var V in Z.attributes)if(V.substr(0,5)!=="morph"){var W=Z.attributes[V];V=X[V]||V.toUpperCase();var oe=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(oe.test(V)||(V="_"+V),O.attributes.has(this.getUID(W))){q[V]=O.attributes.get(this.getUID(W));continue}re=null;var ae=W.array;V!=="JOINTS_0"||ae instanceof Uint16Array||ae instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),re=new c.BufferAttribute(new Uint16Array(ae),W.itemSize,W.normalized));var le=this.processAccessor(re||W,Z);le!==null&&(q[V]=le,O.attributes.set(this.getUID(W),le))}if(K!==void 0&&Z.setAttribute("normal",K),Object.keys(q).length===0)return null;if(x.morphTargetInfluences!==void 0&&0<x.morphTargetInfluences.length){var H=[],U=[],D={};if(x.morphTargetDictionary!==void 0)for(var Q in x.morphTargetDictionary)D[x.morphTargetDictionary[Q]]=Q;for(var ie=0;ie<x.morphTargetInfluences.length;++ie){var ce={},ge=!1;for(var ye in Z.morphAttributes){if(ye!="position"&&ye!=="normal"&&ye!=="color"){ge||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),ge=!0);continue}var ue=Z.morphAttributes[ye][ie],be=ye.toUpperCase();X[ye]&&(be=X[ye]);var ne=Z.attributes[ye];if(O.attributes.has(this.getUID(ue))){ce[be]=O.attributes.get(this.getUID(ue));continue}var de=ne.clone();if(!Z.morphTargetsRelative)if(ne)for(var ve=0,Ee=ue.count;ve<Ee;ve++)ne.count>ve&&de.setXYZ(ve,ue.getX(ve)-ne.getX(ve),ue.getY(ve)-ne.getY(ve),ue.getZ(ve)-ne.getZ(ve));else for(var Se=0,Ie=ue.count;Se<Ie;Se++)de.setXYZ(Se,0,0,0);ce[be]=this.processAccessor(de,Z),O.attributes.set(this.getUID(ne),ce[be])}$.push(ce),H.push(x.morphTargetInfluences[ie]),x.morphTargetDictionary!==void 0&&U.push(D[ie])}te.weights=H,0<U.length&&(te.extras={},te.extras.targetNames=U)}var Je=Array.isArray(x.material);if(Je&&Z.groups.length===0)return null;for(var Ve,st=Je?x.material:[x.material],Re=Je?Z.groups:[{materialIndex:0,start:void 0,count:void 0}],Ue=0,We=Re.length;Ue<We;Ue++){if(Ve={mode:Y,attributes:q},this.serializeUserData(Z,Ve),0<$.length&&(Ve.targets=$),Z.index!==null){var Pt=this.getUID(Z.index);(Re[Ue].start!==void 0||Re[Ue].count!==void 0)&&(Pt+=":"+Re[Ue].start+":"+Re[Ue].count),O.attributes.has(Pt)?Ve.indices=O.attributes.get(Pt):(Ve.indices=this.processAccessor(Z.index,Z,Re[Ue].start,Re[Ue].count),O.attributes.set(Pt,Ve.indices)),Ve.indices===null&&delete Ve.indices}var It=this.processMaterial(st[Re[Ue].materialIndex]);It!==null&&(Ve.material=It),j.push(Ve)}te.primitives=j,B.meshes||(B.meshes=[]),this._invokeAll(function(yt){yt.writeMesh&&yt.writeMesh(x,te)});var pt=B.meshes.push(te)-1;return O.meshes.set(G,pt),pt}processCamera(x){var O=this.json;O.cameras||(O.cameras=[]);var B=x.isOrthographicCamera,N={type:B?"orthographic":"perspective"};return B?N.orthographic={xmag:2*x.right,ymag:2*x.top,zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near}:N.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(N.name=x.type),O.cameras.push(N)-1}processAnimation(x,O){var B=this.json,N=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),O);for(var k=x.tracks,z=[],G=[],Y=0;Y<k.length;++Y){var Z=k[Y],te=c.PropertyBinding.parseTrackName(Z.name),q=c.PropertyBinding.findNode(O,te.nodeName),j=g[te.propertyName];if(te.objectName==="bones"&&(q.isSkinnedMesh===!0?q=q.skeleton.getBoneByName(te.objectIndex):q=void 0),!q||!j)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',Z.name),null;var $=1,X=Z.values.length/Z.times.length;j===g.morphTargetInfluences&&(X/=q.morphTargetInfluences.length);var K=void 0;Z.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(K="CUBICSPLINE",X/=3):Z.getInterpolation()===c.InterpolateDiscrete?K="STEP":K="LINEAR",G.push({input:this.processAccessor(new c.BufferAttribute(Z.times,$)),output:this.processAccessor(new c.BufferAttribute(Z.values,X)),interpolation:K}),z.push({sampler:G.length-1,target:{node:N.get(q),path:j}})}return B.animations.push({name:x.name||"clip_"+B.animations.length,samplers:G,channels:z}),B.animations.length-1}processSkin(x){var O=this.json,B=this.nodeMap,N=O.nodes[B.get(x)],k=x.skeleton;if(k===void 0)return null;var z=x.skeleton.bones[0];if(z===void 0)return null;for(var G=[],Y=new Float32Array(16*k.bones.length),Z=new c.Matrix4,te=0;te<k.bones.length;++te)G.push(B.get(k.bones[te])),Z.copy(k.boneInverses[te]),Z.multiply(x.bindMatrix).toArray(Y,16*te);O.skins===void 0&&(O.skins=[]),O.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(Y,16)),joints:G,skeleton:B.get(z)});var q=N.skin=O.skins.length-1;return q}processNode(x){var O=this.json,B=this.options,N=this.nodeMap;O.nodes||(O.nodes=[]);var k={};if(B.trs){var z=x.quaternion.toArray(),G=x.position.toArray(),Y=x.scale.toArray();A(z,[0,0,0,1])||(k.rotation=z),A(G,[0,0,0])||(k.translation=G),A(Y,[1,1,1])||(k.scale=Y)}else x.matrixAutoUpdate&&x.updateMatrix(),w(x.matrix)===!1&&(k.matrix=x.matrix.elements);if(x.name!==""&&(k.name=x.name+""),this.serializeUserData(x,k),x.isMesh||x.isLine||x.isPoints){var Z=this.processMesh(x);Z!==null&&(k.mesh=Z)}else x.isCamera&&(k.camera=this.processCamera(x));if(x.isSkinnedMesh&&this.skins.push(x),0<x.children.length){for(var te,q=[],j=0,$=x.children.length;j<$;j++)if(te=x.children[j],te.visible||B.onlyVisible===!1){var X=this.processNode(te);X!==null&&q.push(X)}0<q.length&&(k.children=q)}this._invokeAll(function(re){re.writeNode&&re.writeNode(x,k)});var K=O.nodes.push(k)-1;return N.set(x,K),K}processScene(x){var O=this.json,B=this.options;O.scenes||(O.scenes=[],O.scene=0);var N={};x.name!==""&&(N.name=x.name),O.scenes.push(N);for(var k,z=[],G=0,Y=x.children.length;G<Y;G++)if(k=x.children[G],k.visible||B.onlyVisible===!1){var Z=this.processNode(k);Z!==null&&z.push(Z)}0<z.length&&(N.nodes=z),this.serializeUserData(x,N)}processObjects(x){var O=new c.Scene;O.name="AuxScene";for(var B=0;B<x.length;B++)O.children.push(x[B]);this.processScene(O)}processInput(x){var O=this.options;x=x instanceof Array?x:[x],this._invokeAll(function(G){G.beforeParse&&G.beforeParse(x)});for(var B=[],N=0;N<x.length;N++)x[N]instanceof c.Scene?this.processScene(x[N]):B.push(x[N]);0<B.length&&this.processObjects(B);for(var k=0;k<this.skins.length;++k)this.processSkin(this.skins[k]);for(var z=0;z<O.animations.length;++z)this.processAnimation(O.animations[z].clip,O.animations[z].mesh);this._invokeAll(function(G){G.afterParse&&G.afterParse(x)})}_invokeAll(x){for(var O=0,B=this.plugins.length;O<B;O++)x(this.plugins[O])}}class T{constructor(x){this.writer=x,this.name="KHR_lights_punctual"}writeNode(x,O){if(x.isLight){if(!x.isDirectionalLight&&!x.isPointLight&&!x.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",x);var B=this.writer,N=B.json,k=B.extensionsUsed,z={};x.name&&(z.name=x.name),z.color=x.color.toArray(),z.intensity=x.intensity,x.isDirectionalLight?z.type="directional":x.isPointLight?(z.type="point",0<x.distance&&(z.range=x.distance)):x.isSpotLight&&(z.type="spot",0<x.distance&&(z.range=x.distance),z.spot={},z.spot.innerConeAngle=-1*((x.penumbra-1)*x.angle),z.spot.outerConeAngle=x.angle),x.decay!==void 0&&x.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),x.target&&(x.target.parent!==x||x.target.position.x!==0||x.target.position.y!==0||x.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),k[this.name]||(N.extensions=N.extensions||{},N.extensions[this.name]={lights:[]},k[this.name]=!0);var G=N.extensions[this.name].lights;G.push(z),O.extensions=O.extensions||{},O.extensions[this.name]={light:G.length-1}}}}class E{constructor(x){this.writer=x,this.name="KHR_materials_unlit"}writeMaterial(x,O){if(x.isMeshBasicMaterial){var B=this.writer,N=B.extensionsUsed;O.extensions=O.extensions||{},O.extensions[this.name]={},N[this.name]=!0,O.pbrMetallicRoughness.metallicFactor=0,O.pbrMetallicRoughness.roughnessFactor=.9}}}class L{constructor(x){this.writer=x,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(x,O){if(x.isGLTFSpecularGlossinessMaterial){var B=this.writer,N=B.extensionsUsed,k={};O.pbrMetallicRoughness.baseColorFactor&&(k.diffuseFactor=O.pbrMetallicRoughness.baseColorFactor);var z=[1,1,1];if(x.specular.toArray(z,0),k.specularFactor=z,k.glossinessFactor=x.glossiness,O.pbrMetallicRoughness.baseColorTexture&&(k.diffuseTexture=O.pbrMetallicRoughness.baseColorTexture),x.specularMap){var G={index:B.processTexture(x.specularMap)};B.applyTextureTransform(G,x.specularMap),k.specularGlossinessTexture=G}O.extensions=O.extensions||{},O.extensions[this.name]=k,N[this.name]=!0}}}f.Utils={insertKeyframe:function(x,O){var B,N=.001,k=x.getValueSize(),z=new x.TimeBufferType(x.times.length+1),G=new x.ValueBufferType(x.values.length+k),Y=x.createInterpolant(new x.ValueBufferType(k));if(x.times.length===0){z[0]=O;for(var Z=0;Z<k;Z++)G[Z]=0;B=0}else if(O<x.times[0]){if(Math.abs(x.times[0]-O)<N)return 0;z[0]=O,z.set(x.times,1),G.set(Y.evaluate(O),0),G.set(x.values,k),B=0}else if(O>x.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-O)<N)return x.times.length-1;z[z.length-1]=O,z.set(x.times,0),G.set(x.values,0),G.set(Y.evaluate(O),x.values.length),B=z.length-1}else for(var te=0;te<x.times.length;te++){if(Math.abs(x.times[te]-O)<N)return te;if(x.times[te]<O&&x.times[te+1]>O){z.set(x.times.slice(0,te+1),0),z[te+1]=O,z.set(x.times.slice(te+1),te+2),G.set(x.values.slice(0,(te+1)*k),0),G.set(Y.evaluate(O),(te+1)*k),G.set(x.values.slice((te+1)*k),(te+2)*k),B=te+1;break}}return x.times=z,x.values=G,B},mergeMorphTargetTracks:function(x,O){for(var B=[],N={},k=x.tracks,z=0;z<k.length;++z){var G=k[z],Y=c.PropertyBinding.parseTrackName(G.name),Z=c.PropertyBinding.findNode(O,Y.nodeName);if(Y.propertyName!=="morphTargetInfluences"||Y.propertyIndex===void 0){B.push(G);continue}if(G.createInterpolant!==G.InterpolantFactoryMethodDiscrete&&G.createInterpolant!==G.InterpolantFactoryMethodLinear){if(G.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),G=G.clone(),G.setInterpolation(c.InterpolateLinear)}var te=Z.morphTargetInfluences.length,q=Z.morphTargetDictionary[Y.propertyIndex];if(q===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+Y.propertyIndex);var j=void 0;if(N[Z.uuid]===void 0){j=G.clone();for(var $=new j.ValueBufferType(te*j.times.length),X=0;X<j.times.length;X++)$[X*te+q]=j.values[X];j.name=(Y.nodeName||"")+".morphTargetInfluences",j.values=$,N[Z.uuid]=j,B.push(j);continue}var K=G.createInterpolant(new G.ValueBufferType(1));j=N[Z.uuid];for(var re=0;re<j.times.length;re++)j.values[re*te+q]=K.evaluate(j.times[re]);for(var V,W=0;W<G.times.length;W++)V=this.insertKeyframe(j,G.times[W]),j.values[V*te+q]=G.values[W]}return x.tracks=B,x}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,d=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var _=this;this.setFromObject=w=>{var{nearPlane:C,farPlane:P,eyePosition:R,targetPosition:I,upVector:S}=w;_.nearPlane=C,_.farPlane=P,_.eyePosition=R,_.targetPosition=I,_.upVector=S}},p=function(_,w,C,P){var R={DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,MINIMAP:5,SYNC_CONTROL:6},I={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},S={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},T={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},E={};E.MAIN=I.ROTATE,E.AUXILIARY=I.ZOOM,E.SECONDARY=I.PAN,this.cameraObject=_,this.domElement=w===void 0?document:w,this.renderer=C,this.scene=P,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var L=6e3,F=!0,x=0,O=void 0,B=void 0,N=!1,k=500,z=void 0,G="default",Y=R.DEFAULT,Z=void 0,te=void 0,q=void 0,j=0,$=S.FREE;this._state=I.NONE;var X;this.targetTouchId=-1;var K=void 0,re=new c.Vector3,V=new c.Vector3,W=new c.Vector3,oe=new c.Vector3,ae=new c.Vector3,le=new c.Vector3,H=new c.Vector3,U=new c.Vector3,D=new c.Sphere,Q=new c.Vector3,ie=!1,ce=void 0,ge=0,ye={default:new d};ye.default.nearPlane=.1,ye.default.farPlane=2e3,ye.default.eyePosition=[0,0,0],ye.default.targetPosition=[0,0,-1],ye.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...ye.default.targetPosition)),this.calculateMaxAllowedDistance=se=>{var we=se.getBoundingBox();if(we){we.getBoundingSphere(D),ge=6*D.radius;var Te=0;this.cameraObject&&(Te=this.cameraObject.position.distanceTo(D.center)),ge=Te>ge?1.5*Te:ge}else ge=0};var ue=se=>{var we=.001;re.copy(this.cameraObject.position);var Te=re.sub(this.cameraObject.target).length();this.cameraObject.near=Math.max(1e-4,Te*we),this.cameraObject.far=1e4*this.cameraObject.near};this.addViewport=(se,we)=>{se&&we&&(ye[se]=we)},this.setDefaultViewport=se=>!!(se&&se in ye)&&(G=se,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=se=>ye[se],this.setCurrentViewport=se=>se in ye&&(this.setCurrentCameraSettings(ye[se]),!0),this.setRotationMode=se=>{switch(se){case"none":$=S.NONE;break;case"horizontal":$=S.HORIZONTAL;break;case"vertical":$=S.VERTICAL;break;case"free":default:$=S.FREE}},this.onResize=()=>{K&&(K=void 0),ce&&ce.setCurrentCameraSettings(this.cameraObject,ye[G])},this.getVisibleHeightAtZDepth=se=>{var we=this.cameraObject.position.distanceTo(this.cameraObject.target);se<we?se-=we:se+=we;var Te=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Te/2)*Math.abs(se)},this.calculateHeightPerPixelAtZeroDepth=se=>{var we=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=we/se,this.pixelHeight},this.getNDCFromDocumentCoords=(se,we,Te)=>{Ue(!1);var De=Te||new c.Vector2,J=2*((se-K.left)/K.width)-1,pe=2*-((we-K.top)/K.height)+1;return De.set(J,pe)},this.getRelativeCoordsFromNDC=(se,we,Te)=>{Ue(!1);var De=Te||new c.Vector2;return De.x=(se+1)*K.width/2,De.y=(1-we)*K.height/2,De},this.setMouseButtonAction=(se,we)=>{E[se]=I[we]};var be=(se,we)=>{se instanceof HTMLCanvasElement&&(se.tabIndex=we)},ne=()=>{if(0<ge){var se=Q.distanceTo(D.center);return ge>se||this.cameraObject.position.distanceTo(D.center)>se}return!0},de=se=>{Q.copy(this.cameraObject.position).add(se),ne()&&(this.cameraObject.target.add(se),this.cameraObject.position.add(se),this.updateDirectionalLight())},ve=se=>{Ue(!1);var we;if(Y===R.DEFAULT&&(we=this.scene.getNormalisedMinimapCoordinates(this.renderer,se)),!we)se.button==0?se.ctrlKey?this._state=E.AUXILIARY:se.shiftKey?this._state=E.SECONDARY:this._state=E.MAIN:se.button==1?(se.preventDefault(),this._state=E.AUXILIARY):se.button==2&&(this._state=E.SECONDARY),this.pointer_x=se.clientX-K.left,this.pointer_y=se.clientY-K.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{Y=R.MINIMAP;var Te=this.scene.getMinimapDiffFromNormalised(we.x,we.y);de(Te)}},Ee=se=>{if(Ue(!1),K)if(this.pointer_x=se.clientX-K.left,this.pointer_y=se.clientY-K.top,Y===R.MINIMAP){var we=this.scene.getNormalisedMinimapCoordinates(this.renderer,se);if(we){var Te=this.scene.getMinimapDiffFromNormalised(we.x,we.y);de(Te)}}else this._state===I.NONE&&X!==void 0&&X.move(this,se.clientX,se.clientY,this.renderer)},Se=se=>{this._state=I.NONE,Y==R.MINIMAP&&(Y=R.DEFAULT),X!==void 0&&this.pointer_x_start==se.clientX-K.left&&this.pointer_y_start==se.clientY-K.top&&X.pick(this,se.clientX,se.clientY,this.renderer)},Ie=se=>{this._state=I.NONE},Je=se=>{Ue(!1);var we=se.touches.length;if(we==1){var Te,De;this._state=I.TOUCH_ROTATE,this.pointer_x=se.touches[0].clientX-((Te=K)===null||Te===void 0?void 0:Te.left),this.pointer_y=se.touches[0].clientY-((De=K)===null||De===void 0?void 0:De.top),this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}else if(we==2){this._state=I.TOUCH_ZOOM;var J=se.touches[0].clientX-se.touches[1].clientX,pe=se.touches[0].clientY-se.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(J*J+pe*pe)}else if(we==3){var fe,me;this._state=I.TOUCH_PAN,this.targetTouchId=se.touches[0].identifier,this.pointer_x=se.touches[0].clientX-((fe=K)===null||fe===void 0?void 0:fe.left),this.pointer_y=se.touches[0].clientY-((me=K)===null||me===void 0?void 0:me.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},Ve=se=>{se.preventDefault(),se.stopPropagation();var we=se.touches.length;if(we==1)this.pointer_x=se.touches[0].clientX-K.left,this.pointer_y=se.touches[0].clientY-K.top;else if(we==2){if(this._state===I.TOUCH_ZOOM){var Te=se.touches[0].clientX-se.touches[1].clientX,De=se.touches[0].clientY-se.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Te*Te+De*De)}}else if(we==3&&this._state===I.TOUCH_PAN)for(var J=0;3>J;J++)se.touches[J].identifier==this.targetTouchId&&(this.pointer_x=se.touches[0].clientX-K.left,this.pointer_y=se.touches[0].clientY-K.top)},st=se=>{var we=se.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=I.NONE,we==1&&X!==void 0&&this.pointer_x_start==se.touches[0].clientX-K.left&&this.pointer_y_start==se.touches[0].clientY-K.top&&X.pick(this.cameraObject,se.touches[0].clientX,se.touches[0].clientY,this.renderer)},Re=()=>{Ue(!0)},Ue=se=>{if(se||K===void 0){var we=new IntersectionObserver(Te=>{for(var De of Te)K=De.boundingClientRect;we.disconnect()});we.observe(this.domElement)}},We=se=>{Ue(!1),this._state=I.SCROLL;var we=0;0<se.deltaY?we=this.zoomRate:0>se.deltaY&&(we=-1*this.zoomRate),j+=we,se.preventDefault(),se.stopImmediatePropagation()},Pt=se=>{Ue(!1);var we=0;if(se.keyCode===T.EQUAL||se.keyCode===T.MINUS||se.keyCode===T.NUMPADADD||se.keyCode===T.NUMPADSUBTRACT){this._state=I.KEYBOARD_ZOOM;var Te=1;se.shiftKey&&(Te*=2),se.keyCode===T.EQUAL||se.keyCode===T.NUMPADADD?we=-1*(this.zoomRate*Te):(se.keyCode===T.MINUS||se.keyCode===T.NUMPADSUBTRACT)&&(we=this.zoomRate*Te),j+=we}else(se.keyCode===T.ARROWLEFT||se.keyCode===T.ARROWUP||se.keyCode===T.ARROWRIGHT||se.keyCode===T.ARROWDOWN)&&(se.shiftKey?(this._state=I.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,we=this.rotateRate):(this._state=I.KEYBOARD_PAN,we=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,se.keyCode===T.ARROWLEFT?this.pointer_x-=we:se.keyCode===T.ARROWUP?this.pointer_y-=we:se.keyCode===T.ARROWRIGHT?this.pointer_x+=we:se.keyCode===T.ARROWDOWN&&(this.pointer_y+=we));Object.values(T).includes(se.keyCode)&&se.preventDefault()},It=se=>{this._state=I.NONE},pt=()=>{if(typeof this.cameraObject<"u"){var se=K.height,we=this.cameraObject.position.distanceTo(this.cameraObject.target),Te=0;this.cameraObject.far>this.cameraObject.near&&we>=this.cameraObject.near&&we<=this.cameraObject.far&&(Te=(we-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),V.set(this.previous_pointer_x,se-this.previous_pointer_y,0),W.set(this.previous_pointer_x,se-this.previous_pointer_y,1),oe.set(this.pointer_x,se-this.pointer_y,0),ae.set(this.pointer_x,se-this.pointer_y,1),V.unproject(this.cameraObject),W.unproject(this.cameraObject),oe.unproject(this.cameraObject),ae.unproject(this.cameraObject);var De=-.002;oe.sub(V).multiplyScalar(1-Te),ae.sub(W).multiplyScalar(Te),oe.add(ae).multiplyScalar(De),de(oe)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(se,we)=>{se.normalize(),H.copy(this.cameraObject.position).sub(this.cameraObject.target),U.copy(H),H.normalize(),.8<Math.abs(H.dot(se))&&H.copy(this.cameraObject.up),V.crossVectors(se,H).normalize(),W.crossVectors(se,V);var Te=se.dot(U),De=V.dot(U),J=W.dot(U),pe=se.dot(this.cameraObject.up),fe=V.dot(this.cameraObject.up),me=W.dot(this.cameraObject.up),Me=Math.cos(we),he=Math.sin(we);return oe.set(Me*V.x+he*W.x,Me*V.y+he*W.y,Me*V.z+he*W.z),ae.set(Me*W.x-he*V.x,Me*W.y-he*V.y,Me*W.z-he*V.z),H.copy(this.cameraObject.target),H.x=H.x+se.x*Te+oe.x*De+ae.x*J,H.y=H.y+se.y*Te+oe.y*De+ae.y*J,H.z=H.z+se.z*Te+oe.z*De+ae.z*J,re.set(se.x*pe+oe.x*fe+ae.x*me,se.y*pe+oe.y*fe+ae.y*me,se.z*pe+oe.z*fe+ae.z*me),{position:H,up:re}},this.rotateAboutLookAtpoint=(se,we)=>{var Te=this.getVectorsFromRotateAboutLookAtPoints(se,we);this.cameraObject.position.copy(Te.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Te.up)};var yt=()=>{if(typeof this.cameraObject<"u"){var se,we,Te=(se=K)===null||se===void 0?void 0:se.width,De=(we=K)===null||we===void 0?void 0:we.height;if(0<Te&&0<De){var J=.25*(Te+De),pe=0,fe=0;($===S.FREE||$===S.HORIZONTAL)&&(pe=this.pointer_x-this.previous_pointer_x),($===S.FREE||$===S.VERTICAL)&&(fe=this.previous_pointer_y-this.pointer_y);var me=Math.sqrt(pe*pe+fe*fe);if(0<me){var Me=1*-fe/me,he=1*pe/me,xe=0;$===S.FREE&&Me*(this.pointer_x-.5*(Te-1))+he*(.5*(De-1)-this.pointer_y);var _e=Math.acos(xe/J)-.5*Math.PI,Fe=this.tumble_rate*me/J;re.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),V.copy(this.cameraObject.up).normalize(),W.copy(V).cross(re).normalize().multiplyScalar(Me),V.multiplyScalar(he),le.addVectors(W,V).multiplyScalar(Math.cos(_e)),re.multiplyScalar(Math.sin(_e)),le.add(re),this.rotateAboutLookAtpoint(le,-Fe)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},oi=()=>{var se=0;return this._state===I.ZOOM?se=this.previous_pointer_y-this.pointer_y:this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM?se=j:(se=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),se};this.changeZoomByScrollRateUnit=se=>{var we=se*this.zoomRate;this.changeZoomByValue(we)},this.changeZoomByValue=se=>{if(typeof this.cameraObject<"u"){var we=K.height,Te=this.cameraObject.position.clone();Te.sub(this.cameraObject.target);var De=Te.length(),J=1.5*se/we,pe=De*J;.01<De+pe&&(Te.normalize(),Q.copy(this.cameraObject.position),Q.x+=Te.x*pe,Q.y+=Te.y*pe,Q.z+=Te.z*pe,ne()&&(this.cameraObject.position.copy(Q),this.updateDirectionalLight(),ue(),ie=!0))}};var ki=()=>{var se=oi();this.changeZoomByValue(se),this._state===I.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&(j=0,this._state=I.NONE)};this.setDirectionalLight=se=>{this.directionalLight=se},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){F=!0,this.domElement&&this.domElement.addEventListener&&(be(this.domElement,0),this.domElement.addEventListener("mousedown",ve,!1),this.domElement.addEventListener("mousemove",Ee,!1),this.domElement.addEventListener("mouseup",Se,!1),this.domElement.addEventListener("mouseleave",Ie,!1),this.domElement.addEventListener("touchstart",Je,!1),this.domElement.addEventListener("touchmove",Ve,!1),this.domElement.addEventListener("touchend",st,!1),this.domElement.addEventListener("wheel",We,!1),this.domElement.addEventListener("mouseenter",Re,!1),this.domElement.addEventListener("contextmenu",se=>{se.preventDefault()},!1),this.domElement.addEventListener("keydown",Pt,!1),this.domElement.addEventListener("keyup",It,!1))},this.disable=function(){F=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",ve,!1),this.domElement.removeEventListener("mousemove",Ee,!1),this.domElement.removeEventListener("mouseup",Se,!1),this.domElement.removeEventListener("mouseleave",Ie,!1),this.domElement.removeEventListener("touchstart",Je,!1),this.domElement.removeEventListener("touchmove",Ve,!1),this.domElement.removeEventListener("touchend",st,!1),this.domElement.removeEventListener("wheel",We,!1),this.domElement.removeEventListener("mouseenter",Re,!1),this.domElement.removeEventListener("contextmenu",se=>{se.preventDefault()},!1),this.domElement.removeEventListener("keydown",Pt,!1),this.domElement.removeEventListener("keyup",It,!1),be(this.domElement,-1))},this.loadPath=se=>{O=se.CameraPath,B=se.NumberOfPoints},this.loadPathURL=(se,we)=>{var Te=new XMLHttpRequest;Te.onreadystatechange=()=>{if(Te.readyState==4&&Te.status==200){var J=JSON.parse(Te.responseText);this.loadPath(J),we!=null&&typeof we=="function"&&we()}};var De=f(se);Te.open("GET",De,!0),Te.send()},this.setPathDuration=se=>{L=se,Z&&Z.setDuration(L),te&&te.setDuration(L)},this.getPlayRate=()=>k,this.setPlayRate=se=>{k=se};var ai=se=>{var we=x+se;we>L&&(we-=L),x=we};this.getTime=()=>x,this.setTime=se=>{x=se>L?L:0>se?0:se},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var se=x/L*(B-1),we=Math.floor(se),Te=1-(se-we),De=Math.ceil(se);return we==De?we==B-1?[we-1,De,0]:[we,De+1,1]:[we,De,Te]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=se=>{2<B&&(x=L*se/(B-1),0>x&&(x=0),x>L&&(x=L))};var wr=se=>{if(Y===R.PATH&&(ai(se),O)){for(var we=this.getCurrentTimeFrame(),Te=we[0],De=we[1],J=we[2],pe=[O[3*Te],O[3*Te+1],O[3*Te+2]],fe=[O[3*De],O[3*De+1],O[3*De+2]],me=[],Me=0;Me<pe.length;Me++)me.push(J*pe[Me]+(1-J)*fe[Me]);this.cameraObject.position.set(me[0],me[1],me[2]),this.cameraObject.target.set(fe[0],fe[1],fe[2]),z&&this.cameraObject.lookAt(this.cameraObject.target),N&&(this.directionalLight.position.set(me[0],me[1],me[2]),this.directionalLight.target.position.set(fe[0],fe[1],fe[2]))}};this.calculatePathNow=()=>{wr(0)};var as=()=>{this._state===I.ROTATE||this._state===I.TOUCH_ROTATE||this._state===I.KEYBOARD_ROTATE?yt():this._state===I.PAN||this._state===I.TOUCH_PAN||this._state===I.KEYBOARD_PAN?(pt(),ce.triggerCallback()):(this._state===I.ZOOM||this._state===I.TOUCH_ZOOM||this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&(ce.zoom(oi()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&(this._state=I.NONE),j=0,ce.triggerCallback())};this.update=se=>{var we=se*k,Te=F,De=!0;return Y===R.PATH?wr(we):Y===R.SMOOTH_CAMERA_TRANSITION&&Z?(Z.update(we),Z.isTransitionCompleted()&&(Y=R.DEFAULT),Te=!1):Y===R.ROTATE_CAMERA_TRANSITION&&te?(te.update(we),te.isTransitionCompleted()&&(Y=R.DEFAULT),Te=!1):Y===R.AUTO_TUMBLE&&q?q.update(we):Y===R.SYNC_CONTROL&&ce?(as(),Te=!1):De=!1,Te&&(this._state!==I.NONE&&(De=!0),this._state===I.ROTATE||this._state===I.TOUCH_ROTATE||this._state===I.KEYBOARD_ROTATE?yt():this._state===I.PAN||this._state===I.TOUCH_PAN||this._state===I.KEYBOARD_PAN?pt():(this._state===I.ZOOM||this._state===I.TOUCH_ZOOM||this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&ki(),this._state!==I.NONE&&Y===R.AUTO_TUMBLE&&q&&q.stopOnCameraInput,this._state===I.SCROLL&&(this._state=I.NONE)),z?(De=!0,z.update()):this.cameraObject.lookAt(this.cameraObject.target),De=De||ie,ie=!1,De},this.playPath=()=>{Y=R.PATH},this.stopPath=()=>{Y=R.DEFAULT},this.isPlayingPath=()=>Y===R.PATH,this.enableDirectionalLightUpdateWithPath=se=>{N=se},this.enableDeviceOrientation=()=>{z||(z=new M(this.cameraObject))},this.disableDeviceOrientation=()=>{z&&(z.dispose(),z=void 0)},this.isDeviceOrientationEnabled=()=>!!z,this.resetView=()=>{var se=ye[G];this.cameraObject.near=se.nearPlane,this.cameraObject.far=se.farPlane,this.cameraObject.position.set(se.eyePosition[0],se.eyePosition[1],se.eyePosition[2]),this.cameraObject.target.set(se.targetPosition[0],se.targetPosition[1],se.targetPosition[2]),this.cameraObject.up.set(se.upVector[0],se.upVector[1],se.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=se=>{se.nearPlane&&(this.cameraObject.near=se.nearPlane),se.farPlane&&(this.cameraObject.far=se.farPlane),se.eyePosition&&this.cameraObject.position.set(se.eyePosition[0],se.eyePosition[1],se.eyePosition[2]),se.targetPosition&&this.cameraObject.target.set(se.targetPosition[0],se.targetPosition[1],se.targetPosition[2]),se.upVector&&this.cameraObject.up.set(se.upVector[0],se.upVector[1],se.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),ie=!0},this.getViewportFromCentreAndRadius=(se,we,Te,De,J,pe)=>{re.copy(this.cameraObject.position),re.sub(this.cameraObject.target),re.normalize();var fe=[se,we,Te],me=De/Math.tan(J*Math.PI/360),Me=[se+re.x*me,we+re.y*me,Te+re.z*me],he=me+pe,xe=0,_e=.95;xe=pe>_e*me?(1-_e)*me:me-pe;var Fe=new d;return Fe.nearPlane=xe,Fe.farPlane=he,Fe.eyePosition=Me,Fe.targetPosition=fe,Fe.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],Fe},this.getViewportFromBoundingBox=(se,we)=>{var Te=se.min.distanceTo(se.max)/2*we,De=(se.min.x+se.max.x)/2,J=(se.min.y+se.max.y)/2,pe=(se.min.z+se.max.z)/2,fe=4,me=this.getViewportFromCentreAndRadius(De,J,pe,Te,40,Te*fe);return me},this.getCurrentViewport=()=>{var se=new d;return se.nearPlane=this.cameraObject.near,se.farPlane=this.cameraObject.far,se.eyePosition[0]=this.cameraObject.position.x,se.eyePosition[1]=this.cameraObject.position.y,se.eyePosition[2]=this.cameraObject.position.z,se.targetPosition[0]=this.cameraObject.target.x,se.targetPosition[1]=this.cameraObject.target.y,se.targetPosition[2]=this.cameraObject.target.z,se.upVector[0]=this.cameraObject.up.x,se.upVector[1]=this.cameraObject.up.y,se.upVector[2]=this.cameraObject.up.z,se},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(se,we,Te)=>{te==null&&(Z=new g(se,we,this,Te))},this.rotateCameraTransition=(se,we,Te)=>{Z==null&&(te=new m(se,we,this,Te))},this.enableCameraTransition=()=>{Z&&(Y=R.SMOOTH_CAMERA_TRANSITION),te&&(Y=R.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{Y=R.DEFAULT},this.stopCameraTransition=()=>{Y=R.DEFAULT,Z=void 0,te=void 0},this.isTransitioningCamera=()=>Y===R.SMOOTH_CAMERA_TRANSITION||Y===R.ROTATE_CAMERA_TRANSITION,this.autoTumble=(se,we,Te)=>{q=new b(se,we,Te,this)},this.enableAutoTumble=()=>{Y=R.AUTO_TUMBLE},this.stopAutoTumble=()=>{Y=R.DEFAULT,q=void 0},this.updateAutoTumble=()=>{q&&(q.requireUpdate=!0)},this.isAutoTumble=()=>Y===R.AUTO_TUMBLE,this.enableRaycaster=(se,we,Te)=>{X==null&&(X=new h(se,this.scene,we,Te,this.renderer))},this.disableRaycaster=()=>{X.disable(),X=void 0},this.isSyncControl=()=>currentMpde===R.SYNC_CONTROL,this.enableSyncControl=()=>(Y=R.SYNC_CONTROL,ce||(ce=new A),ce.setCurrentCameraSettings(this.cameraObject,ye[G]),ce),this.disableSyncControl=()=>{Y=R.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},g=function(w,C,P,R){var I=w.eyePosition,S=w.targetPosition,T=w.upVector,E=C.eyePosition,L=C.targetPosition,F=C.upVector,x=P,O=R,B=0,N=!1;x.near=Math.min(w.nearPlane,C.nearPlane),x.far=Math.max(w.farPlane,C.farPlane),x.cameraObject.up.set(C.upVector[0],C.upVector[1],C.upVector[2]),this.setDuration=G=>{O=G};var k=G=>{var Y=B+G;Y>O&&(Y=O),B=Y},z=()=>{var G=B/O,Y=[I[0]*(1-G)+E[0]*G,I[1]*(1-G)+E[1]*G,I[2]*(1-G)+E[2]*G],Z=[S[0]*(1-G)+L[0]*G,S[1]*(1-G)+L[1]*G,S[2]*(1-G)+L[2]*G];T[0]*(1-G)+F[0]*G,T[1]*(1-G)+F[1]*G,T[2]*(1-G)+F[2]*G,x.cameraObject.position.set(Y[0],Y[1],Y[2]),x.cameraObject.target.set(Z[0],Z[1],Z[2])};this.update=G=>{this.enabled===!1||(k(G),z(),B==O&&(N=!0))},this.isTransitionCompleted=()=>N},m=function(w,C,P,R){var I=w,S=C,T=P,E=R,L=0,F=!1;this.setDuration=O=>{E=O};var x=O=>{var B=L,N=L+O;N>E&&(N=E),L=N;var k=L-B,z=k/E,G=z*S;T.rotateAboutLookAtpoint(I,G)};this.update=O=>{this.enabled===!1||(x(O),L==E&&(F=!0))},this.isTransitionCompleted=()=>F},h=function(w,C,P,R,I){var S=w,T=C,E=I,L=P,F=R,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var O=new c.Vector2,B=!1,N=new Date,k=!1,z=0,G=[],Y={zincCamera:void 0,x:-1,y:-1},Z=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=j=>{if(T!==S){var $=S.getThreeJSScene();E.render($,j.cameraObject)}var X=Z||S.getPickableThreeJSObjects();return G.length=0,x.intersectObjects(X,!0,G)},this.setPickableObjects=j=>{j===void 0?Z=void 0:(Z=[],j.forEach($=>{$.getGroup()&&$.getGroup().visible&&Z.push($.getGroup())}))},this.getIntersectsObjectWithOrigin=(j,$,X)=>(x.set($,X),this.getIntersectsObject(j)),this.getIntersectsObjectWithCamera=(j,$,X)=>(j.getNDCFromDocumentCoords($,X,O),x.setFromCamera(O,j.cameraObject),this.getIntersectsObject(j)),this.pick=(j,$,X)=>{if(E&&S&&j&&L){this.getIntersectsObjectWithCamera(j,$,X);for(var K,re=G.length,V=0;V<re;V++)if(K=G[V].object?G[V].object.userData:void 0,K&&K.isMarkerCluster&&K.visible&&K.clusterIsVisible(G[V].object.clusterIndex)&&K.zoomToCluster(G[V].object.clusterIndex))return;L(G,$,X)}};var te=(j,$,X)=>{if(E&&S&&j&&F){if(this.getIntersectsObjectWithCamera(j,$,X),N.setTime(Date.now()),G.length===0){if(k)return;k=!0}else k=!1;F(G,$,X)}};this.move=(j,$,X)=>{E&&S&&j&&F&&(S.displayMarkers?te(j,$,X):(Y.zincCamera=j,Y.x=$,Y.y=X,!B&&(z=N?Date.now()-N.getTime():250,250<=z?te(j,$,X):(B=!0,setTimeout(q(Y),z)))))};var q=j=>function(){B=!1,te(j.zincCamera,j.x,j.y)}},b=function(w,C,P,R){var I=new c.Vector3,S=-C,T=R,E=w;this.stopOnCameraInput=P,this.requireUpdate=!0;var L=new c.Vector3,F=new c.Vector3,x=O=>{var B=Math.sqrt(O[0]*O[0]+O[1]*O[1]),N=4*Math.abs(O[0]),k=4*Math.abs(O[1]),z=.25*(N+k),G=-O[1]/B,Y=O[0]/B,Z=G*O[0]+Y*-O[1];Z>z?Z=z:Z<-z&&(Z=-z);var te=Math.acos(Z/z)-.5*Math.PI;I.copy(T.cameraObject.position).sub(T.cameraObject.target).normalize(),L.copy(T.cameraObject.up).normalize(),F.crossVectors(L,I).normalize().multiplyScalar(G),L.multiplyScalar(Y),L.add(F).multiplyScalar(Math.cos(te)),I.multiplyScalar(Math.sin(te)).add(L)};this.update=O=>{this.enabled===!1||(this.requireUpdate&&(x(E),this.requireUpdate=!1),T.rotateAboutLookAtpoint(I,S*O/1e3))}},y=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(y.prototype,{update:(()=>{var _,w,C,P,R,I,S=new c.Matrix4,T=new c.Matrix4;return function(L){var F=_!==L.focus||w!==L.fov||C!==L.aspect*this.aspect||P!==L.near||R!==L.far||I!==L.zoom;if(F){_=L.focus,w=L.fov,C=L.aspect*this.aspect,P=L.near,R=L.far,I=L.zoom;var x,O,B=L.projectionMatrix.clone(),N=.064/2,k=N*P/_,z=P*Math.tan(.5*(c.Math.DEG2RAD*w))/L.zoom;T.elements[12]=-N,S.elements[12]=N,x=-z*C+k,O=z*C+k,B.elements[0]=2*P/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraL.projectionMatrix.copy(B),x=-z*C-k,O=z*C-k,B.elements[0]=2*P/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(L.matrixWorld).multiply(T),this.cameraR.matrixWorld.copy(L.matrixWorld).multiply(S)}})()});var v=function(w){var C=new y;C.aspect=.5,this.setSize=(P,R)=>{w.setSize(P,R)},this.render=(P,R)=>{P.updateMatrixWorld(),R.parent===null&&R.updateMatrixWorld(),C.update(R);var I=w.getSize();w.setScissorTest(!0),w.clear(),w.setScissor(0,0,I.width/2,I.height),w.setViewport(0,0,I.width/2,I.height),w.render(P,C.cameraL),w.setScissor(I.width/2,0,I.width/2,I.height),w.setViewport(I.width/2,0,I.width/2,I.height),w.render(P,C.cameraR),w.setScissorTest(!1)}},M=function(w){var C=this;this.object=w,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var P=S=>{C.deviceOrientation=S},R=()=>{typeof window<"u"&&(C.screenOrientation=window.orientation||0)},I=(()=>{var S=new c.Vector3(0,0,1),T=new c.Euler,E=new c.Quaternion,L=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(F,x,O,B,N)=>{var k=new c.Vector3(0,0,1);k.subVectors(F.target,F.position),T.set(O,x,-B,"YXZ");var z=new c.Quaternion;z.setFromEuler(T),z.multiply(L),z.multiply(E.setFromAxisAngle(S,-N)),k.applyQuaternion(z),k.addVectors(F.position,k),F.lookAt(k)}})();this.connect=()=>{R(),typeof window<"u"&&(window.addEventListener("orientationchange",R,!1),window.addEventListener("deviceorientation",P,!1)),C.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",R,!1),window.removeEventListener("deviceorientation",P,!1)),C.enabled=!1},this.update=()=>{if(C.enabled!==!1){var S=C.deviceOrientation.alpha?c.Math.degToRad(C.deviceOrientation.alpha):0,T=C.deviceOrientation.beta?c.Math.degToRad(C.deviceOrientation.beta):0,E=C.deviceOrientation.gamma?c.Math.degToRad(C.deviceOrientation.gamma):0,L=C.screenOrientation?c.Math.degToRad(C.screenOrientation):0;I(C.object,S,T,E,L)}},this.dispose=function(){this.disconnect()},this.connect()},A=function(){var w=void 0,C=void 0,P=void 0,R=new c.Vector3,I=new c.Vector3,S=new c.Vector3,T=new c.Vector3,E=void 0;this.setCurrentCameraSettings=(L,F)=>{this.near_plane_fly_debt==0,w=L.clone(),C=L,P=F,w.near=P.nearPlane,P.farPlane&&(w.far=P.farPlane),P.eyePosition&&w.position.set(P.eyePosition[0],P.eyePosition[1],P.eyePosition[2]),P.upVector&&w.up.set(P.upVector[0],P.upVector[1],P.upVector[2]),P.targetPosition&&(w.target=new c.Vector3(P.targetPosition[0],P.targetPosition[1],P.targetPosition[2]),w.lookAt(w.target)),w.updateProjectionMatrix(),R.copy(w.position).project(w),I.copy(w.target).project(w)},this.getCurrentPosition=()=>(I.copy(C.target).project(w),[I.x,I.y]),this.zoom=L=>{var F=.002*L,x=Math.max(C.zoom-F,1);C.zoom=x,C.updateProjectionMatrix()},this.zoomToBox=(L,F)=>{L.getCenter(S),S.project(w),this.setCenterZoom([S.x,S.y],F)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:C.zoom}),this.setCenterZoom=(L,F)=>{S.set(L[0],L[1],I.z).unproject(w),T.copy(S).sub(C.target),C.target.copy(S),C.lookAt(C.target),C.position.add(T),C.zoom=F,C.updateProjectionMatrix()},this.setEventCallback=L=>{(L===void 0||typeof L=="function")&&(E=L)},this.triggerCallback=()=>{E!==void 0&&typeof E=="function"&&E()}};l.Viewport=d,l.CameraControls=p,l.SmoothCameraTransition=g,l.RotateCameraTransition=m,l.RayCaster=h,l.CameraAutoTumble=b,l.StereoEffect=v,l.NDCCameraControl=A},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),d=u(22).Pointset;u(24).Lines;var p=u(46).Lines2,g=u(3).Geometry,m=u(4),h=0,b=function(){return"re"+h++},y=function(v,M){var A=v,_=new c;_.matrixAutoUpdate=!1,_.userData=this;var w=[],C="",P=[],R=M,I=new f,S=3e3;I.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{w.forEach(T=>T.hideAllPrimitives()),P.forEach(T=>T.setVisibility(!1))},this.showAllPrimitives=()=>{w.forEach(T=>T.showAllPrimitives()),P.forEach(T=>T.setVisibility(!0))},this.setVisibility=T=>{T!=_.visible&&(_.visible=T,this.pickableUpdateRequired=!0)},this.getVisibility=()=>_.visible,this.getGroup=()=>_,this.setTransformation=T=>{I.set(...T),_.matrix.copy(I),_.updateMatrixWorld()},this.setName=T=>{T&&T!==""&&(C=T)},this.getName=()=>C,this.getParent=()=>A,this.getFullSeparatedPath=()=>{var T=[];if(C!==""){T.push(C);for(var E,L=A;L!==void 0;)E=L.getName(),E!==""&&T.unshift(E),L=L.getParent()}return T},this.getFullPath=()=>{var T=this.getFullSeparatedPath();if(0<T.length){var E=T.shift();return T.forEach(L=>{E=E.concat("/",L)}),E}return""},this.createChild=T=>{var E=new y(this,R);return E.setName(T),w.push(E),_.add(E.getGroup()),E},this.getChildWithName=T=>{if(T){for(var E=T.toLowerCase(),L=0;L<w.length;L++)if(w[L].getName().toLowerCase()===E)return w[L]}},this.findChildFromSeparatedPath=T=>{if(T&&0<T.length&&T[0]===""&&T.shift(),T&&0<T.length){var E=this.getChildWithName(T[0]);return E?(T.shift(),E.findChildFromSeparatedPath(T)):void 0}return this},this.findChildFromPath=T=>{var E=T.split("/");return this.findChildFromSeparatedPath(E)},this.createChildFromSeparatedPath=T=>{if(0<T.length&&T[0]===""&&T.shift(),0<T.length){var E=this.getChildWithName(T[0]);return E||(E=this.createChild(T[0])),T.shift(),E.createChildFromSeparatedPath(T)}return this},this.createChildFromPath=T=>{var E=T.split("/");return this.createChildFromSeparatedPath(E)},this.findOrCreateChildFromPath=T=>{var E=this.findChildFromPath(T);return E||(E=this.createChildFromPath(T)),E},this.addZincObject=T=>{T&&(T.setRegion(this),_.add(T.getGroup()),P.push(T),this.pickableUpdateRequired=!0,R&&R.triggerObjectAddedCallback(T))},this.removeZincObject=T=>{for(var E=0;E<P.length;E++)if(T===P[E])return _.remove(T.getGroup()),P.splice(E,1),R&&R.triggerObjectRemovedCallback(T),T.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=T=>{if(this.pickableUpdateRequired)return!0;if(T){for(var E=!1,L=0;L<w.length;L++)if(E=w[L].checkPickableUpdateRequred(T),E)return!0}return!1},this.getPickableThreeJSObjects=(T,E)=>(_.visible&&(P.forEach(L=>{if(L.isPickable&&L.getGroup()&&L.getGroup().visible){var F=L.marker;F&&F.isEnabled()&&T.push(F.getMorph()),T.push(L.getGroup())}}),E&&w.forEach(L=>{L.getPickableThreeJSObjects(T,E)}),this.pickableUpdateRequired=!1),T),this.setDuration=T=>{S=T,P.forEach(E=>E.setDuration(T)),w.forEach(E=>E.setDuration(T))},this.getDuration=()=>S,this.getBoundingBox=T=>{var E,L;return P.forEach(F=>{L=F.getBoundingBox(),L&&(E==null?E=L.clone():E.union(L))}),T&&w.forEach(F=>{L=F.getBoundingBox(T),L&&(E==null?E=L.clone():E.union(L))}),E},this.clear=T=>{T&&w.forEach(E=>E.clear(T)),P.forEach(E=>{_.remove(E.getGroup()),E.dispose()}),w=[],P=[]},this.objectIsInRegion=(T,E)=>{for(var L=0;L<P.length;L++)if(T===P[L])return!0;if(E){for(var F=0;F<w.length;F++)if(w[F].objectIsInRegion(T,E))return!0}return!1},this.forEachGeometry=(T,E)=>{P.forEach(L=>{L.isGeometry&&T(L)}),E&&w.forEach(L=>L.forEachGeometry(T,E))},this.forEachGlyphset=(T,E)=>{P.forEach(L=>{L.isGlyphset&&T(L)}),E&&w.forEach(L=>L.forEachGlyphset(T,E))},this.forEachPointset=(T,E)=>{P.forEach(L=>{L.isPointset&&T(L)}),E&&w.forEach(L=>L.forEachPointset(T,E))},this.forEachLine=(T,E)=>{P.forEach(L=>{L.isLines&&T(L)}),E&&w.forEach(L=>L.forEachLine(T,E))},this.findObjectsWithAnatomicalId=(T,E)=>{var L=[];return P.forEach(F=>{F.anatomicalId===T&&L.push(F)}),E&&w.forEach(F=>{var x=F.findObjectsWithAnatomicalId(T,E);L.push(...x)}),L},this.findObjectsWithGroupName=(T,E)=>{var L=[];return P.forEach(F=>{var x=F.groupName?F.groupName.toLowerCase():F.groupName,O=T&&T.toLowerCase();x===O&&L.push(F)}),E&&w.forEach(F=>{var x=F.findObjectsWithGroupName(T,E);L.push(...x)}),L},this.findGeometriesWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isGeometry);return F},this.findPointsetsWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isPointset);return F},this.findGlyphsetsWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isGlyphset);return F},this.findLinesWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isLines);return F},this.getAllObjects=T=>{var E=[...P];return T&&w.forEach(L=>{var F=L.getAllObjects(T);E.push(...F)}),E},this.getChildRegions=T=>{var E=[...w];return T&&w.forEach(L=>{var F=L.getChildRegions(T);E.push(...F)}),E},this.getCurrentTime=()=>{if(P[0]!=null)return P[0].getCurrentTime();for(var T,E=0;E<w.length;E++)if(T=w[E].getCurrentTime(),T!==-1)return T;return-1},this.setMorphTime=(T,E)=>{P.forEach(L=>{L.setMorphTime(T)}),E&&w.forEach(L=>{L.setMorphTime(T)})},this.isTimeVarying=()=>{for(var T=0;T<P.length;T++)if(P[T].isTimeVarying())return!0;for(var E=0;E<w.length;E++)if(w[E].isTimeVarying())return!0;return!1},this.renderGeometries=(T,E,L,F,x,O)=>{var B,N=this.getAllObjects(O);N.forEach(k=>{k.render(T*E,L,F,x)}),x&&L===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(T,E,L,F)=>{var x=!1,O=this.findObjectsWithGroupName(T,!1),B=O.findIndex(k=>k.isPointset),N=-1<B?O[B]:new d;return N.addPoints(E,L,F),B===-1?(N.setName(T),this.addZincObject(N),x=!0):this.pickableUpdateRequired=!0,{zincObject:N,isNew:x}},this.createLines=(T,E,L)=>{var F=!1,x=this.findObjectsWithGroupName(T,!1),O=x.findIndex(N=>N.isLines),B=-1<O?x[O]:new p;return B.addLines(E,L),O===-1?(B.setName(T),this.addZincObject(B),F=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:F}},this.createGeometryFromThreeJSGeometry=(T,E,L,F,x,O)=>{var B=new g,N=new m.MeshPhongMaterial({color:L,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:F,side:m.DoubleSide});return B.createMesh(E,N,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(T),B.setRenderOrder(O),this.addZincObject(B),B):void 0}};l.Region=y},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(47).LineSegments2,f=u(49).LineMaterial,d=u(48).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var g=Array(300);this.createLineSegment=(m,h,b)=>{if(m&&h){var y=new d;y.setPositions(m),y.colorsNeedUpdate=!0;var v=new c(y,h);v.scale.set(1,1,1),v.computeLineDistances(),this.setMesh(v,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var h=this.getMorph();h||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(y=>{g[b++]=y[0],g[b++]=y[1],g[b++]=y[2],this.drawRange++}),!h)for(;300>b;)g[b++]=m[0][0],g[b++]=m[0][1],g[b++]=m[0][2];h&&(h.geometry.setPositions(g),h.computeLineDistances(),h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0)}return g},this.getVerticesByFaceIndex=function(m){var h=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>h){var y=b.geometry.getAttribute("instanceStart");return[[y.data.array[h],y.data.array[++h],y.data.array[++h]],[y.data.array[++h],y.data.array[++h],y.data.array[++h]]]}return[]},this.editVertices=function(m,h){if(m&&m.length){var b=this.getMorph(),y=h+m.length-1;if(!b||0>h||y>=this.drawRange)return;var v=3*h;for(m.forEach(M=>{g[v++]=M[0],g[v++]=M[1],g[v++]=M[2]}),v=3*this.drawRange;300>v;)g[v++]=m[0][0],g[v++]=m[0][1],g[v++]=m[0][2];b.geometry.setPositions(g),b.computeLineDistances(),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}return g},this.addLines=(m,h)=>{if(m&&0<m.length){this.addVertices(m);var b=this.getMorph();if(!b){var y=new f({color:h,linewidth:1,vertexColors:!1,worldUnits:!1});y.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(g,y,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>P});var c=u(4),f=u(48),d=u(49),p=new c.Vector3,g=new c.Vector3,m=new c.Vector4,h=new c.Vector4,b=new c.Vector4,y=new c.Vector3,v=new c.Matrix4,M=new c.Line3,A=new c.Vector3,_=new c.Box3,w=new c.Sphere,C=new c.Vector4;class P extends c.Mesh{constructor(){var I=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new d.LineMaterial({color:16777215*Math.random()});super(I,S),this.type="LineSegments2"}computeLineDistances(){for(var I=this.geometry,S=I.attributes.instanceStart,T=I.attributes.instanceEnd,E=new Float32Array(2*S.count),L=0,F=0,x=S.count;L<x;L++,F+=2)p.fromBufferAttribute(S,L),g.fromBufferAttribute(T,L),E[F]=F==0?0:E[F-1],E[F+1]=E[F]+p.distanceTo(g);var O=new c.InstancedInterleavedBuffer(E,2,1);return I.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(O,1,0)),I.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(O,1,1)),this}raycast(I,S){I.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var T=I.params.Line2===void 0?0:I.params.Line2.threshold||0,E=I.ray,L=I.camera,F=L.projectionMatrix,x=this.matrixWorld,O=this.geometry,B=this.material,N=B.resolution,k=B.linewidth+T,z=O.attributes.instanceStart,G=O.attributes.instanceEnd,Y=-L.near,Z=2*Math.max(k/N.width,k/N.height);O.boundingSphere===null&&O.computeBoundingSphere(),w.copy(O.boundingSphere).applyMatrix4(x);var te=Math.max(L.near,w.distanceToPoint(E.origin));C.set(0,0,-te,1).applyMatrix4(L.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(L.projectionMatrixInverse);var q=.5*Math.abs(Z/C.w);if(w.radius+=q,I.ray.intersectsSphere(w)!==!1){O.boundingBox===null&&O.computeBoundingBox(),_.copy(O.boundingBox).applyMatrix4(x);var j=Math.max(L.near,_.distanceToPoint(E.origin));C.set(0,0,-j,1).applyMatrix4(L.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(L.projectionMatrixInverse);var $=.5*Math.abs(Z/C.w);if(_.max.x+=$,_.max.y+=$,_.max.z+=$,_.min.x-=$,_.min.y-=$,_.min.z-=$,I.ray.intersectsBox(_)!==!1){E.at(1,b),b.w=1,b.applyMatrix4(L.matrixWorldInverse),b.applyMatrix4(F),b.multiplyScalar(1/b.w),b.x*=N.x/2,b.y*=N.y/2,b.z=0,y.copy(b),v.multiplyMatrices(L.matrixWorldInverse,x);for(var X=0,K=z.count;X<K;X++){m.fromBufferAttribute(z,X),h.fromBufferAttribute(G,X),m.w=1,h.w=1,m.applyMatrix4(v),h.applyMatrix4(v);var re=m.z>Y&&h.z>Y;if(!re){if(m.z>Y){var V=m.z-h.z,W=(m.z-Y)/V;m.lerp(h,W)}else if(h.z>Y){var oe=h.z-m.z,ae=(h.z-Y)/oe;h.lerp(m,ae)}m.applyMatrix4(F),h.applyMatrix4(F),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w),m.x*=N.x/2,m.y*=N.y/2,h.x*=N.x/2,h.y*=N.y/2,M.start.copy(m),M.start.z=0,M.end.copy(h),M.end.z=0;var le=M.closestPointToPointParameter(y,!0);M.at(le,A);var H=c.MathUtils.lerp(m.z,h.z,le),U=-1<=H&&1>=H,D=y.distanceTo(A)<.5*k;if(U&&D){M.start.fromBufferAttribute(z,X),M.end.fromBufferAttribute(G,X),M.start.applyMatrix4(x),M.end.applyMatrix4(x);var Q=new c.Vector3,ie=new c.Vector3;E.distanceSqToSegment(M.start,M.end,ie,Q),S.push({point:ie,pointOnLine:Q,distance:E.origin.distanceTo(ie),object:this,face:null,faceIndex:X,uv:null,uv2:null})}}}}}}}P.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,d=new c.Vector3;class p extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(m){var h=this.attributes.instanceStart,b=this.attributes.instanceEnd;return h!==void 0&&(h.applyMatrix4(m),b.applyMatrix4(m),h.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var h;m instanceof Float32Array?h=m:Array.isArray(m)&&(h=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(h,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(m){var h;m instanceof Float32Array?h=m:Array.isArray(m)&&(h=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(h,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var h=m.geometry;return h.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(h.isBufferGeometry&&this.setPositions(h.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,h=this.attributes.instanceEnd;m!==void 0&&h!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(h),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,h=this.attributes.instanceEnd;if(m!==void 0&&h!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var y=0,v=0,M=m.count;v<M;v++)d.fromBufferAttribute(m,v),y=Math.max(y,b.distanceToSquared(d)),d.fromBufferAttribute(h,v),y=Math.max(y,b.distanceToSquared(d));this.boundingSphere.radius=Math.sqrt(y),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(m){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(m)}}p.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3238
+ `),R="",I="",S=0,T=[],E=typeof"".trimLeft=="function",L=0,F=P.length;L<F;L++)if(R=P[L],R=E?R.trimLeft():R.trim(),S=R.length,S!==0&&(I=R.charAt(0),I!=="#"))if(I==="v"){var x=R.split(/\s+/);switch(x[0]){case"v":C.vertices.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3])),7<=x.length?C.colors.push(parseFloat(x[4]),parseFloat(x[5]),parseFloat(x[6])):C.colors.push(void 0,void 0,void 0);break;case"vn":C.normals.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3]));break;case"vt":C.uvs.push(parseFloat(x[1]),parseFloat(x[2]))}}else if(I==="f"){for(var O,B=R.substr(1).trim(),N=B.split(/\s+/),k=[],z=0,G=N.length;z<G;z++)if(O=N[z],0<O.length){var Y=O.split("/");k.push(Y)}for(var Z=k[0],te=1,q=k.length-1;te<q;te++){var W=k[te],$=k[te+1];C.addFace(Z[0],W[0],$[0],Z[1],W[1],$[1],Z[2],W[2],$[2])}}else if(I==="l"){var X=R.substring(1).trim().split(" "),K=[],re=[];if(R.indexOf("/")===-1)K=X;else for(var V,j=0,oe=X.length;j<oe;j++)V=X[j].split("/"),V[0]!==""&&K.push(V[0]),V[1]!==""&&re.push(V[1]);C.addLineGeometry(K,re)}else if(I==="p"){var ae=R.substr(1).trim(),le=ae.split(" ");C.addPointGeometry(le)}else if((T=f.exec(R))!==null){var H=(" "+T[0].substr(1).trim()).substr(1);C.startObject(H)}else if(p.test(R))C.object.startMaterial(R.substring(7).trim(),C.materialLibraries);else if(d.test(R))C.materialLibraries.push(R.substring(7).trim());else if(g.test(R))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(I==="s"){if(T=R.split(" "),1<T.length){var U=T[1].trim().toLowerCase();C.object.smooth=U!=="0"&&U!=="off"}else C.object.smooth=!0;var D=C.object.currentMaterial();D&&(D.smooth=C.object.smooth)}else{if(R==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+R+'"')}C.finalize();var Q=new c.Group;Q.materialLibraries=[].concat(C.materialLibraries);var ie=C.objects.length!==1||C.objects[0].geometry.vertices.length!==0;if(ie==!0)for(var ce=0,ge=C.objects.length;ce<ge;ce++){var ye=C.objects[ce],ue=ye.geometry,be=ye.materials,ne=ue.type==="Line",de=ue.type==="Points",ve=!1;if(ue.vertices.length!==0){var Ee=new c.BufferGeometry;Ee.setAttribute("position",new c.Float32BufferAttribute(ue.vertices,3)),0<ue.normals.length&&Ee.setAttribute("normal",new c.Float32BufferAttribute(ue.normals,3)),0<ue.colors.length&&(ve=!0,Ee.setAttribute("color",new c.Float32BufferAttribute(ue.colors,3))),ue.hasUVIndices===!0&&Ee.setAttribute("uv",new c.Float32BufferAttribute(ue.uvs,2));for(var Se=[],Ie=0,Je=be.length;Ie<Je;Ie++){var Ve=be[Ie],st=Ve.name+"_"+Ve.smooth+"_"+ve,Re=C.materials[st];if(this.materials!==null){if(Re=this.materials.create(Ve.name),ne&&Re&&!(Re instanceof c.LineBasicMaterial)){var Ue=new c.LineBasicMaterial;c.Material.prototype.copy.call(Ue,Re),Ue.color.copy(Re.color),Re=Ue}else if(de&&Re&&!(Re instanceof c.PointsMaterial)){var We=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(We,Re),We.color.copy(Re.color),We.map=Re.map,Re=We}}Re===void 0&&(Re=ne?new c.LineBasicMaterial:de?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Re.name=Ve.name,Re.flatShading=!Ve.smooth,Re.vertexColors=ve,C.materials[st]=Re),Se.push(Re)}var Pt=void 0;if(1<Se.length){for(var It,pt=0,yt=be.length;pt<yt;pt++)It=be[pt],Ee.addGroup(It.groupStart,It.groupCount,pt);Pt=ne?new c.LineSegments(Ee,Se):de?new c.Points(Ee,Se):new c.Mesh(Ee,Se)}else Pt=ne?new c.LineSegments(Ee,Se[0]):de?new c.Points(Ee,Se[0]):new c.Mesh(Ee,Se[0]);Pt.name=ye.name,Q.add(Pt)}}else if(0<C.vertices.length){var oi=new c.PointsMaterial({size:1,sizeAttenuation:!1}),ki=new c.BufferGeometry;ki.setAttribute("position",new c.Float32BufferAttribute(C.vertices,3)),0<C.colors.length&&C.colors[0]!==void 0&&(ki.setAttribute("color",new c.Float32BufferAttribute(C.colors,3)),oi.vertexColors=!0);var ai=new c.Points(ki,oi);Q.add(ai)}return Q}}},(o,l,u)=>{function c(_,w){var C=Object.keys(_);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(_);w&&(P=P.filter(function(R){return Object.getOwnPropertyDescriptor(_,R).enumerable})),C.push.apply(C,P)}return C}function f(_){for(var w,C=1;C<arguments.length;C++)w=arguments[C]==null?{}:arguments[C],C%2?c(Object(w),!0).forEach(function(P){d(_,P,w[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(w)):c(Object(w)).forEach(function(P){Object.defineProperty(_,P,Object.getOwnPropertyDescriptor(w,P))});return _}function d(_,w,C){return(w=p(w))in _?Object.defineProperty(_,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[w]=C,_}function p(_){var w=g(_,"string");return typeof w=="symbol"?w:w+""}function g(_,w){if(typeof _!="object"||!_)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var P=C.call(_,w);if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(_)}var m=u(19).JSONLoader,h=u(4),b=h.FileLoader,y=_=>{var w=(P,R)=>{P.metadata.number_of_vertices+=R.metadata.number_of_vertices,"labels"in P&&P.labels.push(...P.labels);var I=["axis1","axis2","axis3","colors","positions","scale"];I.forEach(S=>{S in P&&Object.keys(P[S]).forEach(T=>{P[S][T].push(...R[S][T])})})};if(_&&0<_.length)for(;1<_.length;){var C=_.splice(1,1);w(_[0],C[0])}},v=_=>{var w=(P,R)=>{P.merge(R)};if(_&&0<_.length){for(;1<_.length;){var C=_.splice(1,1);w(_[0],C[0])}return _[0]}},M=function(w,C,P){var R=new b,I=new m;R.crossOrigin=C;var S=w,T=P,E=void 0,L=!1,F=!1,x=void 0,O=[],B=G=>{var Y=E[G.index];if(!Y)N(G);else if("GlyphGeometriesURL"in Y)G.onLoad(Y);else{var Z=I.parse(Y);G.onLoad(Z.geometry,Z.materials)}},N=G=>{G.onError&&(!x&&(x={responseURL:S}),G.onError(x))};this.downloadCompleted=G=>{try{E=JSON.parse(G[0]),L=!1,F=!0,Array.isArray(E)?O.forEach(Y=>B(Y)):O.forEach(Y=>N(Y))}catch{O.forEach(Z=>N(Z))}};var k=()=>G=>{x=G,F=!0,L=!1,O.forEach(Y=>{N(Y)})},z=()=>G=>{O.forEach(Y=>{Y.onProgress&&Y.onProgress(G)})};this.load=(G,Y,Z,te)=>{var q={index:G,onLoad:Y,onProgress:Z,onError:te};F?E?B(q):N(x):L?O.push(q):(O.push(q),L=!0,R.load(S,T,z,k))}},A=function(w,C,P){var R=[],I=w,S=C,T=0,E=P.isGlyphsets;this.itemDownloaded=(L,F)=>{if(R[L]=F,T++,T==I&&0<R.length)if(E){var k=R.map(z=>JSON.parse(z[0]));y(k),S(k[0])}else{for(var x=R[0][1],O=R.map(z=>z[0]),B=v(O),N=1;N<I;N++)R[L][0].dispose(),R[L][1].forEach(z=>z.dispose());S(B,x)}}};l.PrimitivesLoader=function(){var _=0,w=20;this.crossOrigin="Anonymous";var C=new m,P=new b;P.crossOrigin="Anonymous";var R=[],I={},S=(F,x,O,B,N)=>{var k=F.length,z=new A(k,x,N),G=0;F.forEach(Y=>{var Z=N?f({},N):{};Z.msHandler=z,Z.order=G,G++,E(Y,x,O,B,Z)})},T=(F,x,O,B,N)=>{var k=N?f({},N):{},z=I[F];if(!z)if(w>_){var G=new L(void 0,this,k);++_,z=new M(F,this.crossOrigin,G),I[F]=z}else R.push({url:F,onLoad:x,onProgress:O,onError:B,options:N});z&&(k.isHandler=z,z.load(N.index,x,O,B))},E=(F,x,O,B,N)=>{if(N&&N.index!==void 0)T(F,x,O,B,N);else if(w>_){++_;var k=new L(x,this,N),z=new L(B,this,N);N.isGlyphsets?P.load(F,k,O,z):(C.crossOrigin=this.crossOrigin,C.load(F,k,O,z))}else R.push({url:F,onLoad:x,onProgress:O,onError:B,options:N})};this.load=(F,x,O,B,N)=>{Array.isArray(F)?S(F,x,O,B,N):E(F,x,O,B,N)},this.loadFromWaitingList=()=>{for(;w>_;){var F=R.shift();if(F)this.load(F.url,F.onLoad,F.onProgress,F.onError,F.options);else return}},this.itemRemainingCheck=()=>{if(R.length===0&&_==0)for(var F in I)I.hasOwnProperty(F)&&delete I[F]};var L=function(x,O,B){return function(){--_;for(var N=arguments.length,k=Array(N),z=0;z<N;z++)k[z]=arguments[z];B!=null&&B.msHandler?B.msHandler.itemDownloaded(B.order,k):B!=null&&B.isHandler?B.isHandler.downloadCompleted(k):x&&x(...k),O.loadFromWaitingList(),O.itemRemainingCheck()}};this.parse=F=>loader.parse(F)}},(o,l,u)=>{var c=u(4),f=u(5).mergeGeometries,d=function(){u(10).ZincObject.call(this),this.isTubeLines=!0;var p={},g={radius:1,radialSegments:8,smooth:!1};this.createLineSegment=(h,b,y)=>{if(h&&b){p={geometryIn:h,materialIn:b,options:y};var v=m(h.vertices),M=new c.MeshStandardMaterial({color:b.color}),A=new c.Mesh(v,M);this.setMesh(A,y.localTimeEnabled,y.localMorphColour)}},this.setWidth=h=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=h,this.morph.material.needsUpdate=!0)},this.setAlpha=function(h){var b=this.getMorph();b.material.opacity=h,b.material.transparent=1>h,b.material.depthWrite=.5<h},this.setWireframe=h=>{var b=this.getMorph();b.material.wireframe=h},this.setTubeLines=(h,b)=>{if(h&&b){var{geometryIn:y}=p,v=this.getMorph();v.geometry.dispose(),g=Object.assign(g,{radius:h,radialSegments:b}),v.geometry=m(y.vertices)}};var m=h=>{var b,{radius:y,radialSegments:v,smooth:M}=g;if(M){var A=new c.CatmullRomCurve3(h);b=new c.TubeGeometry(A,h.length,y,v,!1)}else{for(var _=[],w=0;w+1<h.length;w+=2){var C=new c.LineCurve3(h[w],h[w+1]),P=new c.TubeGeometry(C,1,y,v,!1);_.push(P)}b=f(_,!0),_.forEach(R=>R.dispose())}return b}};d.prototype=Object.create(u(10).ZincObject.prototype),l.TubeLines=d},(o,l,u)=>{u(4);var c=u(41).GLTFLoader,f=function(){var d=this;this.parseGLTFObjects=(p,g,m,h)=>{var b=g;if(m!==0){if(p.type!=="Object3D"){var y;if(p.type==="Mesh"?y=new(u(3)).Geometry:p.type==="LineSegments"?y=new(u(24)).Lines:p.type==="Points"&&(y=new(u(22)).Pointset),y){var v=!1,M=!1;p.geometry&&p.geometry.morphAttributes&&(v=!!p.geometry.morphAttributes.position,M=!!p.geometry.morphAttributes.color),y.setMesh(p.clone(),v,M);var A=y.getMorph();y.groupName=A.name,A.matrixAutoUpdate=!0,g.addZincObject(y),h!=null&&typeof h=="function"&&h(y)}}else if(p.name!==""&&(g&&(b=g.findOrCreateChildFromPath(p.name)),b)){var _=b.getGroup();_.position.copy(p.position),_.rotation.copy(p.rotation),_.quaternion.copy(p.quaternion),_.matrixAutoUpdate=!0}}m++,p.children.forEach(w=>{d.parseGLTFObjects(w,b,m,h)})},this.setCamera=p=>{p.viewAll();var g=p.getZincCameraControls(),m=g.getCurrentViewport();g.addViewport("default",m),g.setDefaultViewport("default")},this.load=(p,g,m,h,b)=>{var y=m.substring(0,m.lastIndexOf("/")+1),v=m.substring(m.lastIndexOf("/")+1,m.length),M=new c().setPath(y);M.load(v,function(A){console.log(A),d.parseGLTFObjects(A.scene,g,0,h),d.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=MD},(o,l,u)=>{var c=u(43).GLTFExporter,f=function(d){var p=d;this.exportGLTF=g=>{var m=p.getRootRegion(),h=m.getAllObjects(!0),b=[];h.forEach(M=>{M.animationClip&&b.push({clip:M.animationClip[0],mesh:M.getMorph()})});var y=new c,v={binary:g,animations:b};return new Promise(M=>{y.parse(p.getThreeJSScene(),function(A){M(A)},v)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new T(x)}),this.register(function(x){return new E(x)}),this.register(function(x){return new L(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,O,B){for(var N=new S,k=[],z=0,G=this.pluginCallbacks.length;z<G;z++)k.push(this.pluginCallbacks[z](N));N.setPlugins(k),N.write(x,O,B)}}var d={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p={};p[c.NearestFilter]=d.NEAREST,p[c.NearestMipmapNearestFilter]=d.NEAREST_MIPMAP_NEAREST,p[c.NearestMipmapLinearFilter]=d.NEAREST_MIPMAP_LINEAR,p[c.LinearFilter]=d.LINEAR,p[c.LinearMipmapNearestFilter]=d.LINEAR_MIPMAP_NEAREST,p[c.LinearMipmapLinearFilter]=d.LINEAR_MIPMAP_LINEAR,p[c.ClampToEdgeWrapping]=d.CLAMP_TO_EDGE,p[c.RepeatWrapping]=d.REPEAT,p[c.MirroredRepeatWrapping]=d.MIRRORED_REPEAT;var g={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},m=12,h=1179937895,b=2,y=8,v=1313821514,M=5130562;function A(F,x){return F.length===x.length&&F.every(function(O,B){return O===x[B]})}function _(F){if(window.TextEncoder!==void 0)return new TextEncoder().encode(F).buffer;for(var x,O=new Uint8Array(new ArrayBuffer(F.length)),B=0,N=F.length;B<N;B++)x=F.charCodeAt(B),O[B]=255<x?32:x;return O.buffer}function w(F){return A(F.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function C(F,x,O){for(var B={min:Array(F.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(F.itemSize).fill(Number.NEGATIVE_INFINITY)},N=x;N<x+O;N++)for(var k,z=0;z<F.itemSize;z++)k=void 0,4<F.itemSize?k=F.array[N*F.itemSize+z]:z===0?k=F.getX(N):z===1?k=F.getY(N):z===2?k=F.getZ(N):z==3&&(k=F.getW(N)),B.min[z]=Math.min(B.min[z],k),B.max[z]=Math.max(B.max[z],k);return B}function P(F){return 4*Math.ceil(F/4)}function R(F){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,O=P(F.byteLength);if(O!==F.byteLength){var B=new Uint8Array(O);if(B.set(new Uint8Array(F)),x!==0)for(var N=F.byteLength;N<O;N++)B[N]=x;return B.buffer}return F}var I=null;class S{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(x){this.plugins=x}write(x,O,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(x);var N=this;Promise.all(this.pending).then(function(){var k=N.buffers,z=N.json,G=N.options,Y=N.extensionsUsed,Z=new Blob(k,{type:"application/octet-stream"}),te=Object.keys(Y);if(0<te.length&&(z.extensionsUsed=te),z.buffers&&0<z.buffers.length&&(z.buffers[0].byteLength=Z.size),G.binary===!0){var q=new window.FileReader;q.readAsArrayBuffer(Z),q.onloadend=function(){var $=R(q.result),X=new DataView(new ArrayBuffer(y));X.setUint32(0,$.byteLength,!0),X.setUint32(4,M,!0);var K=R(_(JSON.stringify(z)),32),re=new DataView(new ArrayBuffer(y));re.setUint32(0,K.byteLength,!0),re.setUint32(4,v,!0);var V=new ArrayBuffer(m),j=new DataView(V);j.setUint32(0,h,!0),j.setUint32(4,b,!0);var oe=m+re.byteLength+K.byteLength+X.byteLength+$.byteLength;j.setUint32(8,oe,!0);var ae=new Blob([V,re,K,X,$],{type:"application/octet-stream"}),le=new window.FileReader;le.readAsArrayBuffer(ae),le.onloadend=function(){O(le.result)}}}else if(z.buffers&&0<z.buffers.length){var W=new window.FileReader;W.readAsDataURL(Z),W.onloadend=function(){var $=W.result;z.buffers[0].uri=$,O(z)}}else O(z)})}serializeUserData(x,O){if(!(x.userData&&x.userData.isZincObject)&&Object.keys(x.userData).length!==0){var B=this.options,N=this.extensionsUsed;try{var k=JSON.parse(JSON.stringify(x.userData));if(B.includeCustomExtensions&&k.gltfExtensions){for(var z in O.extensions===void 0&&(O.extensions={}),k.gltfExtensions)O.extensions[z]=k.gltfExtensions[z],N[z]=!0;delete k.gltfExtensions}0<Object.keys(k).length&&(O.extras=k)}catch(G){console.warn("THREE.GLTFExporter: userData of '"+x.name+"' won't be serialized because of JSON.stringify error - "+G.message)}}}getUID(x){return this.uids.has(x)||this.uids.set(x,this.uid++),this.uids.get(x)}isNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return!1;for(var B=new c.Vector3,N=0,k=x.count;N<k;N++)if(5e-4<Math.abs(B.fromBufferAttribute(x,N).length()-1))return!1;return!0}createNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return O.attributesNormalized.get(x);for(var B=x.clone(),N=new c.Vector3,k=0,z=B.count;k<z;k++)N.fromBufferAttribute(B,k),N.x===0&&N.y===0&&N.z===0?N.setX(1):N.normalize(),B.setXYZ(k,N.x,N.y,N.z);return O.attributesNormalized.set(x,B),B}applyTextureTransform(x,O){var B=!1,N={};(O.offset.x!==0||O.offset.y!==0)&&(N.offset=O.offset.toArray(),B=!0),O.rotation!==0&&(N.rotation=O.rotation,B=!0),(O.repeat.x!==1||O.repeat.y!==1)&&(N.scale=O.repeat.toArray(),B=!0),B&&(x.extensions=x.extensions||{},x.extensions.KHR_texture_transform=N,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(x){var O=this.json,B=this.buffers;return O.buffers||(O.buffers=[{byteLength:0}]),B.push(x),0}processBufferView(x,O,B,N,k){var z=this.json;z.bufferViews||(z.bufferViews=[]);for(var G=O===d.UNSIGNED_BYTE?1:O===d.UNSIGNED_SHORT?2:4,Y=P(N*x.itemSize*G),Z=new DataView(new ArrayBuffer(Y)),te=0,q=B;q<B+N;q++)for(var W,$=0;$<x.itemSize;$++)W=void 0,4<x.itemSize?W=x.array[q*x.itemSize+$]:$===0?W=x.getX(q):$===1?W=x.getY(q):$===2?W=x.getZ(q):$==3&&(W=x.getW(q)),O===d.FLOAT?Z.setFloat32(te,W,!0):O===d.UNSIGNED_INT?Z.setUint32(te,W,!0):O===d.UNSIGNED_SHORT?Z.setUint16(te,W,!0):O===d.UNSIGNED_BYTE&&Z.setUint8(te,W),te+=G;var X={buffer:this.processBuffer(Z.buffer),byteOffset:this.byteOffset,byteLength:Y};k!==void 0&&(X.target=k),k===d.ARRAY_BUFFER&&(X.byteStride=x.itemSize*G),this.byteOffset+=Y,z.bufferViews.push(X);var K={id:z.bufferViews.length-1,byteLength:0};return K}processBufferViewImage(x){var O=this,B=O.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(N){var k=new window.FileReader;k.readAsArrayBuffer(x),k.onloadend=function(){var z=R(k.result),G={buffer:O.processBuffer(z),byteOffset:O.byteOffset,byteLength:z.byteLength};O.byteOffset+=z.byteLength,N(B.bufferViews.push(G)-1)}})}processAccessor(x,O,B,N){var k,z=this.options,G=this.json;if(x.array.constructor===Float32Array)k=d.FLOAT;else if(x.array.constructor===Uint32Array)k=d.UNSIGNED_INT;else if(x.array.constructor===Uint16Array)k=d.UNSIGNED_SHORT;else if(x.array.constructor===Uint8Array)k=d.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),N===void 0&&(N=x.count),z.truncateDrawRange&&O!==void 0&&O.index===null){var Y=B+N,Z=O.drawRange.count===1/0?x.count:O.drawRange.start+O.drawRange.count;B=Math.max(B,O.drawRange.start),N=Math.min(Y,Z)-B,0>N&&(N=0)}if(N===0)return null;var te,q=C(x,B,N);O!==void 0&&(te=x===O.index?d.ELEMENT_ARRAY_BUFFER:d.ARRAY_BUFFER);var W=this.processBufferView(x,k,B,N,te),$={bufferView:W.id,byteOffset:W.byteOffset,componentType:k,count:N,max:q.max,min:q.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&($.normalized=!0),G.accessors||(G.accessors=[]),G.accessors.push($)-1}processImage(x,O,B){var N=this,k=N.cache,z=N.json,G=N.options,Y=N.pending;k.images.has(x)||k.images.set(x,{});var Z=k.images.get(x),te=O===c.RGBAFormat?"image/png":"image/jpeg",q=te+":flipY/"+B.toString();if(Z[q]!==void 0)return Z[q];z.images||(z.images=[]);var W={mimeType:te};if(G.embedImages){var $=I=I||document.createElement("canvas");$.width=Math.min(x.width,G.maxTextureSize),$.height=Math.min(x.height,G.maxTextureSize);var X=$.getContext("2d");if(B===!0&&(X.translate(0,$.height),X.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)X.drawImage(x,0,0,$.width,$.height);else{O!==c.RGBAFormat&&O!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>G.maxTextureSize||x.height>G.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var K=new Uint8ClampedArray(4*(x.height*x.width));if(O===c.RGBAFormat)for(var re=0;re<K.length;re+=4)K[re+0]=x.data[re+0],K[re+1]=x.data[re+1],K[re+2]=x.data[re+2],K[re+3]=x.data[re+3];else for(var V=0,j=0;V<K.length;V+=4,j+=3)K[V+0]=x.data[j+0],K[V+1]=x.data[j+1],K[V+2]=x.data[j+2],K[V+3]=255;X.putImageData(new ImageData(K,x.width,x.height),0,0)}G.binary===!0?Y.push(new Promise(function(ae){$.toBlob(function(le){N.processBufferViewImage(le).then(function(H){W.bufferView=H,ae()})},te)})):W.uri=$.toDataURL(te)}else W.uri=x.src;var oe=z.images.push(W)-1;return Z[q]=oe,oe}processSampler(x){var O=this.json;O.samplers||(O.samplers=[]);var B={magFilter:p[x.magFilter],minFilter:p[x.minFilter],wrapS:p[x.wrapS],wrapT:p[x.wrapT]};return O.samplers.push(B)-1}processTexture(x){var O=this.cache,B=this.json;if(O.textures.has(x))return O.textures.get(x);B.textures||(B.textures=[]);var N={sampler:this.processSampler(x),source:this.processImage(x.image,x.format,x.flipY)};x.name&&(N.name=x.name),this._invokeAll(function(z){z.writeTexture&&z.writeTexture(x,N)});var k=B.textures.push(N)-1;return O.textures.set(x,k),k}processMaterial(x){var O=this.cache,B=this.json;if(O.materials.has(x))return O.materials.get(x);if(x.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var N={pbrMetallicRoughness:{}};x.isMeshStandardMaterial!==!0&&x.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var k=x.color.toArray().concat([x.opacity]);if(A(k,[1,1,1,1])||(N.pbrMetallicRoughness.baseColorFactor=k),x.isMeshStandardMaterial?(N.pbrMetallicRoughness.metallicFactor=x.metalness,N.pbrMetallicRoughness.roughnessFactor=x.roughness):(N.pbrMetallicRoughness.metallicFactor=.5,N.pbrMetallicRoughness.roughnessFactor=.5),x.metalnessMap||x.roughnessMap)if(x.metalnessMap===x.roughnessMap){var z={index:this.processTexture(x.metalnessMap)};this.applyTextureTransform(z,x.metalnessMap),N.pbrMetallicRoughness.metallicRoughnessTexture=z}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(x.map){var G={index:this.processTexture(x.map)};this.applyTextureTransform(G,x.map),N.pbrMetallicRoughness.baseColorTexture=G}if(x.emissive){var Y=x.emissive.clone().multiplyScalar(x.emissiveIntensity),Z=Math.max(Y.r,Y.g,Y.b);if(1<Z&&(Y.multiplyScalar(1/Z),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<Z&&(N.emissiveFactor=Y.toArray()),x.emissiveMap){var te={index:this.processTexture(x.emissiveMap)};this.applyTextureTransform(te,x.emissiveMap),N.emissiveTexture=te}}if(x.normalMap){var q={index:this.processTexture(x.normalMap)};x.normalScale&&x.normalScale.x!==-1&&(x.normalScale.x!==x.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),q.scale=x.normalScale.x),this.applyTextureTransform(q,x.normalMap),N.normalTexture=q}if(x.aoMap){var W={index:this.processTexture(x.aoMap),texCoord:1};x.aoMapIntensity!==1&&(W.strength=x.aoMapIntensity),this.applyTextureTransform(W,x.aoMap),N.occlusionTexture=W}x.transparent?N.alphaMode="BLEND":0<x.alphaTest&&(N.alphaMode="MASK",N.alphaCutoff=x.alphaTest),x.side===c.DoubleSide&&(N.doubleSided=!0),x.name!==""&&(N.name=x.name),this.serializeUserData(x,N),this._invokeAll(function(X){X.writeMaterial&&X.writeMaterial(x,N)});var $=B.materials.push(N)-1;return O.materials.set(x,$),$}processMesh(x){var O=this.cache,B=this.json,N=[x.geometry.uuid];if(Array.isArray(x.material))for(var k=0,z=x.material.length;k<z;k++)N.push(x.material[k].uuid);else N.push(x.material.uuid);var G=N.join(":");if(O.meshes.has(G))return O.meshes.get(G);var Y,Z=x.geometry;if(Y=x.isLineSegments?d.LINES:x.isLineLoop?d.LINE_LOOP:x.isLine?d.LINE_STRIP:x.isPoints?d.POINTS:x.material.wireframe?d.LINES:d.TRIANGLES,Z.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var te={},q={},W=[],$=[],X={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},K=Z.getAttribute("normal");K===void 0||this.isNormalizedNormalAttribute(K)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),Z.setAttribute("normal",this.createNormalizedNormalAttribute(K)));var re=null;for(var V in Z.attributes)if(V.substr(0,5)!=="morph"){var j=Z.attributes[V];V=X[V]||V.toUpperCase();var oe=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(oe.test(V)||(V="_"+V),O.attributes.has(this.getUID(j))){q[V]=O.attributes.get(this.getUID(j));continue}re=null;var ae=j.array;V!=="JOINTS_0"||ae instanceof Uint16Array||ae instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),re=new c.BufferAttribute(new Uint16Array(ae),j.itemSize,j.normalized));var le=this.processAccessor(re||j,Z);le!==null&&(q[V]=le,O.attributes.set(this.getUID(j),le))}if(K!==void 0&&Z.setAttribute("normal",K),Object.keys(q).length===0)return null;if(x.morphTargetInfluences!==void 0&&0<x.morphTargetInfluences.length){var H=[],U=[],D={};if(x.morphTargetDictionary!==void 0)for(var Q in x.morphTargetDictionary)D[x.morphTargetDictionary[Q]]=Q;for(var ie=0;ie<x.morphTargetInfluences.length;++ie){var ce={},ge=!1;for(var ye in Z.morphAttributes){if(ye!="position"&&ye!=="normal"&&ye!=="color"){ge||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),ge=!0);continue}var ue=Z.morphAttributes[ye][ie],be=ye.toUpperCase();X[ye]&&(be=X[ye]);var ne=Z.attributes[ye];if(O.attributes.has(this.getUID(ue))){ce[be]=O.attributes.get(this.getUID(ue));continue}var de=ne.clone();if(!Z.morphTargetsRelative)if(ne)for(var ve=0,Ee=ue.count;ve<Ee;ve++)ne.count>ve&&de.setXYZ(ve,ue.getX(ve)-ne.getX(ve),ue.getY(ve)-ne.getY(ve),ue.getZ(ve)-ne.getZ(ve));else for(var Se=0,Ie=ue.count;Se<Ie;Se++)de.setXYZ(Se,0,0,0);ce[be]=this.processAccessor(de,Z),O.attributes.set(this.getUID(ne),ce[be])}$.push(ce),H.push(x.morphTargetInfluences[ie]),x.morphTargetDictionary!==void 0&&U.push(D[ie])}te.weights=H,0<U.length&&(te.extras={},te.extras.targetNames=U)}var Je=Array.isArray(x.material);if(Je&&Z.groups.length===0)return null;for(var Ve,st=Je?x.material:[x.material],Re=Je?Z.groups:[{materialIndex:0,start:void 0,count:void 0}],Ue=0,We=Re.length;Ue<We;Ue++){if(Ve={mode:Y,attributes:q},this.serializeUserData(Z,Ve),0<$.length&&(Ve.targets=$),Z.index!==null){var Pt=this.getUID(Z.index);(Re[Ue].start!==void 0||Re[Ue].count!==void 0)&&(Pt+=":"+Re[Ue].start+":"+Re[Ue].count),O.attributes.has(Pt)?Ve.indices=O.attributes.get(Pt):(Ve.indices=this.processAccessor(Z.index,Z,Re[Ue].start,Re[Ue].count),O.attributes.set(Pt,Ve.indices)),Ve.indices===null&&delete Ve.indices}var It=this.processMaterial(st[Re[Ue].materialIndex]);It!==null&&(Ve.material=It),W.push(Ve)}te.primitives=W,B.meshes||(B.meshes=[]),this._invokeAll(function(yt){yt.writeMesh&&yt.writeMesh(x,te)});var pt=B.meshes.push(te)-1;return O.meshes.set(G,pt),pt}processCamera(x){var O=this.json;O.cameras||(O.cameras=[]);var B=x.isOrthographicCamera,N={type:B?"orthographic":"perspective"};return B?N.orthographic={xmag:2*x.right,ymag:2*x.top,zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near}:N.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(N.name=x.type),O.cameras.push(N)-1}processAnimation(x,O){var B=this.json,N=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),O);for(var k=x.tracks,z=[],G=[],Y=0;Y<k.length;++Y){var Z=k[Y],te=c.PropertyBinding.parseTrackName(Z.name),q=c.PropertyBinding.findNode(O,te.nodeName),W=g[te.propertyName];if(te.objectName==="bones"&&(q.isSkinnedMesh===!0?q=q.skeleton.getBoneByName(te.objectIndex):q=void 0),!q||!W)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',Z.name),null;var $=1,X=Z.values.length/Z.times.length;W===g.morphTargetInfluences&&(X/=q.morphTargetInfluences.length);var K=void 0;Z.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(K="CUBICSPLINE",X/=3):Z.getInterpolation()===c.InterpolateDiscrete?K="STEP":K="LINEAR",G.push({input:this.processAccessor(new c.BufferAttribute(Z.times,$)),output:this.processAccessor(new c.BufferAttribute(Z.values,X)),interpolation:K}),z.push({sampler:G.length-1,target:{node:N.get(q),path:W}})}return B.animations.push({name:x.name||"clip_"+B.animations.length,samplers:G,channels:z}),B.animations.length-1}processSkin(x){var O=this.json,B=this.nodeMap,N=O.nodes[B.get(x)],k=x.skeleton;if(k===void 0)return null;var z=x.skeleton.bones[0];if(z===void 0)return null;for(var G=[],Y=new Float32Array(16*k.bones.length),Z=new c.Matrix4,te=0;te<k.bones.length;++te)G.push(B.get(k.bones[te])),Z.copy(k.boneInverses[te]),Z.multiply(x.bindMatrix).toArray(Y,16*te);O.skins===void 0&&(O.skins=[]),O.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(Y,16)),joints:G,skeleton:B.get(z)});var q=N.skin=O.skins.length-1;return q}processNode(x){var O=this.json,B=this.options,N=this.nodeMap;O.nodes||(O.nodes=[]);var k={};if(B.trs){var z=x.quaternion.toArray(),G=x.position.toArray(),Y=x.scale.toArray();A(z,[0,0,0,1])||(k.rotation=z),A(G,[0,0,0])||(k.translation=G),A(Y,[1,1,1])||(k.scale=Y)}else x.matrixAutoUpdate&&x.updateMatrix(),w(x.matrix)===!1&&(k.matrix=x.matrix.elements);if(x.name!==""&&(k.name=x.name+""),this.serializeUserData(x,k),x.isMesh||x.isLine||x.isPoints){var Z=this.processMesh(x);Z!==null&&(k.mesh=Z)}else x.isCamera&&(k.camera=this.processCamera(x));if(x.isSkinnedMesh&&this.skins.push(x),0<x.children.length){for(var te,q=[],W=0,$=x.children.length;W<$;W++)if(te=x.children[W],te.visible||B.onlyVisible===!1){var X=this.processNode(te);X!==null&&q.push(X)}0<q.length&&(k.children=q)}this._invokeAll(function(re){re.writeNode&&re.writeNode(x,k)});var K=O.nodes.push(k)-1;return N.set(x,K),K}processScene(x){var O=this.json,B=this.options;O.scenes||(O.scenes=[],O.scene=0);var N={};x.name!==""&&(N.name=x.name),O.scenes.push(N);for(var k,z=[],G=0,Y=x.children.length;G<Y;G++)if(k=x.children[G],k.visible||B.onlyVisible===!1){var Z=this.processNode(k);Z!==null&&z.push(Z)}0<z.length&&(N.nodes=z),this.serializeUserData(x,N)}processObjects(x){var O=new c.Scene;O.name="AuxScene";for(var B=0;B<x.length;B++)O.children.push(x[B]);this.processScene(O)}processInput(x){var O=this.options;x=x instanceof Array?x:[x],this._invokeAll(function(G){G.beforeParse&&G.beforeParse(x)});for(var B=[],N=0;N<x.length;N++)x[N]instanceof c.Scene?this.processScene(x[N]):B.push(x[N]);0<B.length&&this.processObjects(B);for(var k=0;k<this.skins.length;++k)this.processSkin(this.skins[k]);for(var z=0;z<O.animations.length;++z)this.processAnimation(O.animations[z].clip,O.animations[z].mesh);this._invokeAll(function(G){G.afterParse&&G.afterParse(x)})}_invokeAll(x){for(var O=0,B=this.plugins.length;O<B;O++)x(this.plugins[O])}}class T{constructor(x){this.writer=x,this.name="KHR_lights_punctual"}writeNode(x,O){if(x.isLight){if(!x.isDirectionalLight&&!x.isPointLight&&!x.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",x);var B=this.writer,N=B.json,k=B.extensionsUsed,z={};x.name&&(z.name=x.name),z.color=x.color.toArray(),z.intensity=x.intensity,x.isDirectionalLight?z.type="directional":x.isPointLight?(z.type="point",0<x.distance&&(z.range=x.distance)):x.isSpotLight&&(z.type="spot",0<x.distance&&(z.range=x.distance),z.spot={},z.spot.innerConeAngle=-1*((x.penumbra-1)*x.angle),z.spot.outerConeAngle=x.angle),x.decay!==void 0&&x.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),x.target&&(x.target.parent!==x||x.target.position.x!==0||x.target.position.y!==0||x.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),k[this.name]||(N.extensions=N.extensions||{},N.extensions[this.name]={lights:[]},k[this.name]=!0);var G=N.extensions[this.name].lights;G.push(z),O.extensions=O.extensions||{},O.extensions[this.name]={light:G.length-1}}}}class E{constructor(x){this.writer=x,this.name="KHR_materials_unlit"}writeMaterial(x,O){if(x.isMeshBasicMaterial){var B=this.writer,N=B.extensionsUsed;O.extensions=O.extensions||{},O.extensions[this.name]={},N[this.name]=!0,O.pbrMetallicRoughness.metallicFactor=0,O.pbrMetallicRoughness.roughnessFactor=.9}}}class L{constructor(x){this.writer=x,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(x,O){if(x.isGLTFSpecularGlossinessMaterial){var B=this.writer,N=B.extensionsUsed,k={};O.pbrMetallicRoughness.baseColorFactor&&(k.diffuseFactor=O.pbrMetallicRoughness.baseColorFactor);var z=[1,1,1];if(x.specular.toArray(z,0),k.specularFactor=z,k.glossinessFactor=x.glossiness,O.pbrMetallicRoughness.baseColorTexture&&(k.diffuseTexture=O.pbrMetallicRoughness.baseColorTexture),x.specularMap){var G={index:B.processTexture(x.specularMap)};B.applyTextureTransform(G,x.specularMap),k.specularGlossinessTexture=G}O.extensions=O.extensions||{},O.extensions[this.name]=k,N[this.name]=!0}}}f.Utils={insertKeyframe:function(x,O){var B,N=.001,k=x.getValueSize(),z=new x.TimeBufferType(x.times.length+1),G=new x.ValueBufferType(x.values.length+k),Y=x.createInterpolant(new x.ValueBufferType(k));if(x.times.length===0){z[0]=O;for(var Z=0;Z<k;Z++)G[Z]=0;B=0}else if(O<x.times[0]){if(Math.abs(x.times[0]-O)<N)return 0;z[0]=O,z.set(x.times,1),G.set(Y.evaluate(O),0),G.set(x.values,k),B=0}else if(O>x.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-O)<N)return x.times.length-1;z[z.length-1]=O,z.set(x.times,0),G.set(x.values,0),G.set(Y.evaluate(O),x.values.length),B=z.length-1}else for(var te=0;te<x.times.length;te++){if(Math.abs(x.times[te]-O)<N)return te;if(x.times[te]<O&&x.times[te+1]>O){z.set(x.times.slice(0,te+1),0),z[te+1]=O,z.set(x.times.slice(te+1),te+2),G.set(x.values.slice(0,(te+1)*k),0),G.set(Y.evaluate(O),(te+1)*k),G.set(x.values.slice((te+1)*k),(te+2)*k),B=te+1;break}}return x.times=z,x.values=G,B},mergeMorphTargetTracks:function(x,O){for(var B=[],N={},k=x.tracks,z=0;z<k.length;++z){var G=k[z],Y=c.PropertyBinding.parseTrackName(G.name),Z=c.PropertyBinding.findNode(O,Y.nodeName);if(Y.propertyName!=="morphTargetInfluences"||Y.propertyIndex===void 0){B.push(G);continue}if(G.createInterpolant!==G.InterpolantFactoryMethodDiscrete&&G.createInterpolant!==G.InterpolantFactoryMethodLinear){if(G.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),G=G.clone(),G.setInterpolation(c.InterpolateLinear)}var te=Z.morphTargetInfluences.length,q=Z.morphTargetDictionary[Y.propertyIndex];if(q===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+Y.propertyIndex);var W=void 0;if(N[Z.uuid]===void 0){W=G.clone();for(var $=new W.ValueBufferType(te*W.times.length),X=0;X<W.times.length;X++)$[X*te+q]=W.values[X];W.name=(Y.nodeName||"")+".morphTargetInfluences",W.values=$,N[Z.uuid]=W,B.push(W);continue}var K=G.createInterpolant(new G.ValueBufferType(1));W=N[Z.uuid];for(var re=0;re<W.times.length;re++)W.values[re*te+q]=K.evaluate(W.times[re]);for(var V,j=0;j<G.times.length;j++)V=this.insertKeyframe(W,G.times[j]),W.values[V*te+q]=G.values[j]}return x.tracks=B,x}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,d=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var _=this;this.setFromObject=w=>{var{nearPlane:C,farPlane:P,eyePosition:R,targetPosition:I,upVector:S}=w;_.nearPlane=C,_.farPlane=P,_.eyePosition=R,_.targetPosition=I,_.upVector=S}},p=function(_,w,C,P){var R={DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,MINIMAP:5,SYNC_CONTROL:6},I={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},S={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},T={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},E={};E.MAIN=I.ROTATE,E.AUXILIARY=I.ZOOM,E.SECONDARY=I.PAN,this.cameraObject=_,this.domElement=w===void 0?document:w,this.renderer=C,this.scene=P,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var L=6e3,F=!0,x=0,O=void 0,B=void 0,N=!1,k=500,z=void 0,G="default",Y=R.DEFAULT,Z=void 0,te=void 0,q=void 0,W=0,$=S.FREE;this._state=I.NONE;var X;this.targetTouchId=-1;var K=void 0,re=new c.Vector3,V=new c.Vector3,j=new c.Vector3,oe=new c.Vector3,ae=new c.Vector3,le=new c.Vector3,H=new c.Vector3,U=new c.Vector3,D=new c.Sphere,Q=new c.Vector3,ie=!1,ce=void 0,ge=0,ye={default:new d};ye.default.nearPlane=.1,ye.default.farPlane=2e3,ye.default.eyePosition=[0,0,0],ye.default.targetPosition=[0,0,-1],ye.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...ye.default.targetPosition)),this.calculateMaxAllowedDistance=se=>{var we=se.getBoundingBox();if(we){we.getBoundingSphere(D),ge=6*D.radius;var Te=0;this.cameraObject&&(Te=this.cameraObject.position.distanceTo(D.center)),ge=Te>ge?1.5*Te:ge}else ge=0};var ue=se=>{var we=.001;re.copy(this.cameraObject.position);var Te=re.sub(this.cameraObject.target).length();this.cameraObject.near=Math.max(1e-4,Te*we),this.cameraObject.far=1e4*this.cameraObject.near};this.addViewport=(se,we)=>{se&&we&&(ye[se]=we)},this.setDefaultViewport=se=>!!(se&&se in ye)&&(G=se,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=se=>ye[se],this.setCurrentViewport=se=>se in ye&&(this.setCurrentCameraSettings(ye[se]),!0),this.setRotationMode=se=>{switch(se){case"none":$=S.NONE;break;case"horizontal":$=S.HORIZONTAL;break;case"vertical":$=S.VERTICAL;break;case"free":default:$=S.FREE}},this.onResize=()=>{K&&(K=void 0),ce&&ce.setCurrentCameraSettings(this.cameraObject,ye[G])},this.getVisibleHeightAtZDepth=se=>{var we=this.cameraObject.position.distanceTo(this.cameraObject.target);se<we?se-=we:se+=we;var Te=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Te/2)*Math.abs(se)},this.calculateHeightPerPixelAtZeroDepth=se=>{var we=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=we/se,this.pixelHeight},this.getNDCFromDocumentCoords=(se,we,Te)=>{Ue(!1);var De=Te||new c.Vector2,J=2*((se-K.left)/K.width)-1,pe=2*-((we-K.top)/K.height)+1;return De.set(J,pe)},this.getRelativeCoordsFromNDC=(se,we,Te)=>{Ue(!1);var De=Te||new c.Vector2;return De.x=(se+1)*K.width/2,De.y=(1-we)*K.height/2,De},this.setMouseButtonAction=(se,we)=>{E[se]=I[we]};var be=(se,we)=>{se instanceof HTMLCanvasElement&&(se.tabIndex=we)},ne=()=>{if(0<ge){var se=Q.distanceTo(D.center);return ge>se||this.cameraObject.position.distanceTo(D.center)>se}return!0},de=se=>{Q.copy(this.cameraObject.position).add(se),ne()&&(this.cameraObject.target.add(se),this.cameraObject.position.add(se),this.updateDirectionalLight())},ve=se=>{Ue(!1);var we;if(Y===R.DEFAULT&&(we=this.scene.getNormalisedMinimapCoordinates(this.renderer,se)),!we)se.button==0?se.ctrlKey?this._state=E.AUXILIARY:se.shiftKey?this._state=E.SECONDARY:this._state=E.MAIN:se.button==1?(se.preventDefault(),this._state=E.AUXILIARY):se.button==2&&(this._state=E.SECONDARY),this.pointer_x=se.clientX-K.left,this.pointer_y=se.clientY-K.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{Y=R.MINIMAP;var Te=this.scene.getMinimapDiffFromNormalised(we.x,we.y);de(Te)}},Ee=se=>{if(Ue(!1),K)if(this.pointer_x=se.clientX-K.left,this.pointer_y=se.clientY-K.top,Y===R.MINIMAP){var we=this.scene.getNormalisedMinimapCoordinates(this.renderer,se);if(we){var Te=this.scene.getMinimapDiffFromNormalised(we.x,we.y);de(Te)}}else this._state===I.NONE&&X!==void 0&&X.move(this,se.clientX,se.clientY,this.renderer)},Se=se=>{this._state=I.NONE,Y==R.MINIMAP&&(Y=R.DEFAULT),X!==void 0&&this.pointer_x_start==se.clientX-K.left&&this.pointer_y_start==se.clientY-K.top&&X.pick(this,se.clientX,se.clientY,this.renderer)},Ie=se=>{this._state=I.NONE},Je=se=>{Ue(!1);var we=se.touches.length;if(we==1){var Te,De;this._state=I.TOUCH_ROTATE,this.pointer_x=se.touches[0].clientX-((Te=K)===null||Te===void 0?void 0:Te.left),this.pointer_y=se.touches[0].clientY-((De=K)===null||De===void 0?void 0:De.top),this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}else if(we==2){this._state=I.TOUCH_ZOOM;var J=se.touches[0].clientX-se.touches[1].clientX,pe=se.touches[0].clientY-se.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(J*J+pe*pe)}else if(we==3){var fe,me;this._state=I.TOUCH_PAN,this.targetTouchId=se.touches[0].identifier,this.pointer_x=se.touches[0].clientX-((fe=K)===null||fe===void 0?void 0:fe.left),this.pointer_y=se.touches[0].clientY-((me=K)===null||me===void 0?void 0:me.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},Ve=se=>{se.preventDefault(),se.stopPropagation();var we=se.touches.length;if(we==1)this.pointer_x=se.touches[0].clientX-K.left,this.pointer_y=se.touches[0].clientY-K.top;else if(we==2){if(this._state===I.TOUCH_ZOOM){var Te=se.touches[0].clientX-se.touches[1].clientX,De=se.touches[0].clientY-se.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Te*Te+De*De)}}else if(we==3&&this._state===I.TOUCH_PAN)for(var J=0;3>J;J++)se.touches[J].identifier==this.targetTouchId&&(this.pointer_x=se.touches[0].clientX-K.left,this.pointer_y=se.touches[0].clientY-K.top)},st=se=>{var we=se.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=I.NONE,we==1&&X!==void 0&&this.pointer_x_start==se.touches[0].clientX-K.left&&this.pointer_y_start==se.touches[0].clientY-K.top&&X.pick(this.cameraObject,se.touches[0].clientX,se.touches[0].clientY,this.renderer)},Re=()=>{Ue(!0)},Ue=se=>{if(se||K===void 0){var we=new IntersectionObserver(Te=>{for(var De of Te)K=De.boundingClientRect;we.disconnect()});we.observe(this.domElement)}},We=se=>{Ue(!1),this._state=I.SCROLL;var we=0;0<se.deltaY?we=this.zoomRate:0>se.deltaY&&(we=-1*this.zoomRate),W+=we,se.preventDefault(),se.stopImmediatePropagation()},Pt=se=>{Ue(!1);var we=0;if(se.keyCode===T.EQUAL||se.keyCode===T.MINUS||se.keyCode===T.NUMPADADD||se.keyCode===T.NUMPADSUBTRACT){this._state=I.KEYBOARD_ZOOM;var Te=1;se.shiftKey&&(Te*=2),se.keyCode===T.EQUAL||se.keyCode===T.NUMPADADD?we=-1*(this.zoomRate*Te):(se.keyCode===T.MINUS||se.keyCode===T.NUMPADSUBTRACT)&&(we=this.zoomRate*Te),W+=we}else(se.keyCode===T.ARROWLEFT||se.keyCode===T.ARROWUP||se.keyCode===T.ARROWRIGHT||se.keyCode===T.ARROWDOWN)&&(se.shiftKey?(this._state=I.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,we=this.rotateRate):(this._state=I.KEYBOARD_PAN,we=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,se.keyCode===T.ARROWLEFT?this.pointer_x-=we:se.keyCode===T.ARROWUP?this.pointer_y-=we:se.keyCode===T.ARROWRIGHT?this.pointer_x+=we:se.keyCode===T.ARROWDOWN&&(this.pointer_y+=we));Object.values(T).includes(se.keyCode)&&se.preventDefault()},It=se=>{this._state=I.NONE},pt=()=>{if(typeof this.cameraObject<"u"){var se=K.height,we=this.cameraObject.position.distanceTo(this.cameraObject.target),Te=0;this.cameraObject.far>this.cameraObject.near&&we>=this.cameraObject.near&&we<=this.cameraObject.far&&(Te=(we-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),V.set(this.previous_pointer_x,se-this.previous_pointer_y,0),j.set(this.previous_pointer_x,se-this.previous_pointer_y,1),oe.set(this.pointer_x,se-this.pointer_y,0),ae.set(this.pointer_x,se-this.pointer_y,1),V.unproject(this.cameraObject),j.unproject(this.cameraObject),oe.unproject(this.cameraObject),ae.unproject(this.cameraObject);var De=-.002;oe.sub(V).multiplyScalar(1-Te),ae.sub(j).multiplyScalar(Te),oe.add(ae).multiplyScalar(De),de(oe)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(se,we)=>{se.normalize(),H.copy(this.cameraObject.position).sub(this.cameraObject.target),U.copy(H),H.normalize(),.8<Math.abs(H.dot(se))&&H.copy(this.cameraObject.up),V.crossVectors(se,H).normalize(),j.crossVectors(se,V);var Te=se.dot(U),De=V.dot(U),J=j.dot(U),pe=se.dot(this.cameraObject.up),fe=V.dot(this.cameraObject.up),me=j.dot(this.cameraObject.up),Me=Math.cos(we),he=Math.sin(we);return oe.set(Me*V.x+he*j.x,Me*V.y+he*j.y,Me*V.z+he*j.z),ae.set(Me*j.x-he*V.x,Me*j.y-he*V.y,Me*j.z-he*V.z),H.copy(this.cameraObject.target),H.x=H.x+se.x*Te+oe.x*De+ae.x*J,H.y=H.y+se.y*Te+oe.y*De+ae.y*J,H.z=H.z+se.z*Te+oe.z*De+ae.z*J,re.set(se.x*pe+oe.x*fe+ae.x*me,se.y*pe+oe.y*fe+ae.y*me,se.z*pe+oe.z*fe+ae.z*me),{position:H,up:re}},this.rotateAboutLookAtpoint=(se,we)=>{var Te=this.getVectorsFromRotateAboutLookAtPoints(se,we);this.cameraObject.position.copy(Te.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Te.up)};var yt=()=>{if(typeof this.cameraObject<"u"){var se,we,Te=(se=K)===null||se===void 0?void 0:se.width,De=(we=K)===null||we===void 0?void 0:we.height;if(0<Te&&0<De){var J=.25*(Te+De),pe=0,fe=0;($===S.FREE||$===S.HORIZONTAL)&&(pe=this.pointer_x-this.previous_pointer_x),($===S.FREE||$===S.VERTICAL)&&(fe=this.previous_pointer_y-this.pointer_y);var me=Math.sqrt(pe*pe+fe*fe);if(0<me){var Me=1*-fe/me,he=1*pe/me,xe=0;$===S.FREE&&Me*(this.pointer_x-.5*(Te-1))+he*(.5*(De-1)-this.pointer_y);var _e=Math.acos(xe/J)-.5*Math.PI,Fe=this.tumble_rate*me/J;re.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),V.copy(this.cameraObject.up).normalize(),j.copy(V).cross(re).normalize().multiplyScalar(Me),V.multiplyScalar(he),le.addVectors(j,V).multiplyScalar(Math.cos(_e)),re.multiplyScalar(Math.sin(_e)),le.add(re),this.rotateAboutLookAtpoint(le,-Fe)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},oi=()=>{var se=0;return this._state===I.ZOOM?se=this.previous_pointer_y-this.pointer_y:this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM?se=W:(se=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),se};this.changeZoomByScrollRateUnit=se=>{var we=se*this.zoomRate;this.changeZoomByValue(we)},this.changeZoomByValue=se=>{if(typeof this.cameraObject<"u"){var we=K.height,Te=this.cameraObject.position.clone();Te.sub(this.cameraObject.target);var De=Te.length(),J=1.5*se/we,pe=De*J;.01<De+pe&&(Te.normalize(),Q.copy(this.cameraObject.position),Q.x+=Te.x*pe,Q.y+=Te.y*pe,Q.z+=Te.z*pe,ne()&&(this.cameraObject.position.copy(Q),this.updateDirectionalLight(),ue(),ie=!0))}};var ki=()=>{var se=oi();this.changeZoomByValue(se),this._state===I.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&(W=0,this._state=I.NONE)};this.setDirectionalLight=se=>{this.directionalLight=se},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){F=!0,this.domElement&&this.domElement.addEventListener&&(be(this.domElement,0),this.domElement.addEventListener("mousedown",ve,!1),this.domElement.addEventListener("mousemove",Ee,!1),this.domElement.addEventListener("mouseup",Se,!1),this.domElement.addEventListener("mouseleave",Ie,!1),this.domElement.addEventListener("touchstart",Je,!1),this.domElement.addEventListener("touchmove",Ve,!1),this.domElement.addEventListener("touchend",st,!1),this.domElement.addEventListener("wheel",We,!1),this.domElement.addEventListener("mouseenter",Re,!1),this.domElement.addEventListener("contextmenu",se=>{se.preventDefault()},!1),this.domElement.addEventListener("keydown",Pt,!1),this.domElement.addEventListener("keyup",It,!1))},this.disable=function(){F=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",ve,!1),this.domElement.removeEventListener("mousemove",Ee,!1),this.domElement.removeEventListener("mouseup",Se,!1),this.domElement.removeEventListener("mouseleave",Ie,!1),this.domElement.removeEventListener("touchstart",Je,!1),this.domElement.removeEventListener("touchmove",Ve,!1),this.domElement.removeEventListener("touchend",st,!1),this.domElement.removeEventListener("wheel",We,!1),this.domElement.removeEventListener("mouseenter",Re,!1),this.domElement.removeEventListener("contextmenu",se=>{se.preventDefault()},!1),this.domElement.removeEventListener("keydown",Pt,!1),this.domElement.removeEventListener("keyup",It,!1),be(this.domElement,-1))},this.loadPath=se=>{O=se.CameraPath,B=se.NumberOfPoints},this.loadPathURL=(se,we)=>{var Te=new XMLHttpRequest;Te.onreadystatechange=()=>{if(Te.readyState==4&&Te.status==200){var J=JSON.parse(Te.responseText);this.loadPath(J),we!=null&&typeof we=="function"&&we()}};var De=f(se);Te.open("GET",De,!0),Te.send()},this.setPathDuration=se=>{L=se,Z&&Z.setDuration(L),te&&te.setDuration(L)},this.getPlayRate=()=>k,this.setPlayRate=se=>{k=se};var ai=se=>{var we=x+se;we>L&&(we-=L),x=we};this.getTime=()=>x,this.setTime=se=>{x=se>L?L:0>se?0:se},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var se=x/L*(B-1),we=Math.floor(se),Te=1-(se-we),De=Math.ceil(se);return we==De?we==B-1?[we-1,De,0]:[we,De+1,1]:[we,De,Te]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=se=>{2<B&&(x=L*se/(B-1),0>x&&(x=0),x>L&&(x=L))};var wr=se=>{if(Y===R.PATH&&(ai(se),O)){for(var we=this.getCurrentTimeFrame(),Te=we[0],De=we[1],J=we[2],pe=[O[3*Te],O[3*Te+1],O[3*Te+2]],fe=[O[3*De],O[3*De+1],O[3*De+2]],me=[],Me=0;Me<pe.length;Me++)me.push(J*pe[Me]+(1-J)*fe[Me]);this.cameraObject.position.set(me[0],me[1],me[2]),this.cameraObject.target.set(fe[0],fe[1],fe[2]),z&&this.cameraObject.lookAt(this.cameraObject.target),N&&(this.directionalLight.position.set(me[0],me[1],me[2]),this.directionalLight.target.position.set(fe[0],fe[1],fe[2]))}};this.calculatePathNow=()=>{wr(0)};var as=()=>{this._state===I.ROTATE||this._state===I.TOUCH_ROTATE||this._state===I.KEYBOARD_ROTATE?yt():this._state===I.PAN||this._state===I.TOUCH_PAN||this._state===I.KEYBOARD_PAN?(pt(),ce.triggerCallback()):(this._state===I.ZOOM||this._state===I.TOUCH_ZOOM||this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&(ce.zoom(oi()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&(this._state=I.NONE),W=0,ce.triggerCallback())};this.update=se=>{var we=se*k,Te=F,De=!0;return Y===R.PATH?wr(we):Y===R.SMOOTH_CAMERA_TRANSITION&&Z?(Z.update(we),Z.isTransitionCompleted()&&(Y=R.DEFAULT),Te=!1):Y===R.ROTATE_CAMERA_TRANSITION&&te?(te.update(we),te.isTransitionCompleted()&&(Y=R.DEFAULT),Te=!1):Y===R.AUTO_TUMBLE&&q?q.update(we):Y===R.SYNC_CONTROL&&ce?(as(),Te=!1):De=!1,Te&&(this._state!==I.NONE&&(De=!0),this._state===I.ROTATE||this._state===I.TOUCH_ROTATE||this._state===I.KEYBOARD_ROTATE?yt():this._state===I.PAN||this._state===I.TOUCH_PAN||this._state===I.KEYBOARD_PAN?pt():(this._state===I.ZOOM||this._state===I.TOUCH_ZOOM||this._state===I.SCROLL||this._state===I.KEYBOARD_ZOOM)&&ki(),this._state!==I.NONE&&Y===R.AUTO_TUMBLE&&q&&q.stopOnCameraInput,this._state===I.SCROLL&&(this._state=I.NONE)),z?(De=!0,z.update()):this.cameraObject.lookAt(this.cameraObject.target),De=De||ie,ie=!1,De},this.playPath=()=>{Y=R.PATH},this.stopPath=()=>{Y=R.DEFAULT},this.isPlayingPath=()=>Y===R.PATH,this.enableDirectionalLightUpdateWithPath=se=>{N=se},this.enableDeviceOrientation=()=>{z||(z=new M(this.cameraObject))},this.disableDeviceOrientation=()=>{z&&(z.dispose(),z=void 0)},this.isDeviceOrientationEnabled=()=>!!z,this.resetView=()=>{var se=ye[G];this.cameraObject.near=se.nearPlane,this.cameraObject.far=se.farPlane,this.cameraObject.position.set(se.eyePosition[0],se.eyePosition[1],se.eyePosition[2]),this.cameraObject.target.set(se.targetPosition[0],se.targetPosition[1],se.targetPosition[2]),this.cameraObject.up.set(se.upVector[0],se.upVector[1],se.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=se=>{se.nearPlane&&(this.cameraObject.near=se.nearPlane),se.farPlane&&(this.cameraObject.far=se.farPlane),se.eyePosition&&this.cameraObject.position.set(se.eyePosition[0],se.eyePosition[1],se.eyePosition[2]),se.targetPosition&&this.cameraObject.target.set(se.targetPosition[0],se.targetPosition[1],se.targetPosition[2]),se.upVector&&this.cameraObject.up.set(se.upVector[0],se.upVector[1],se.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),ie=!0},this.getViewportFromCentreAndRadius=(se,we,Te,De,J,pe)=>{re.copy(this.cameraObject.position),re.sub(this.cameraObject.target),re.normalize();var fe=[se,we,Te],me=De/Math.tan(J*Math.PI/360),Me=[se+re.x*me,we+re.y*me,Te+re.z*me],he=me+pe,xe=0,_e=.95;xe=pe>_e*me?(1-_e)*me:me-pe;var Fe=new d;return Fe.nearPlane=xe,Fe.farPlane=he,Fe.eyePosition=Me,Fe.targetPosition=fe,Fe.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],Fe},this.getViewportFromBoundingBox=(se,we)=>{var Te=se.min.distanceTo(se.max)/2*we,De=(se.min.x+se.max.x)/2,J=(se.min.y+se.max.y)/2,pe=(se.min.z+se.max.z)/2,fe=4,me=this.getViewportFromCentreAndRadius(De,J,pe,Te,40,Te*fe);return me},this.getCurrentViewport=()=>{var se=new d;return se.nearPlane=this.cameraObject.near,se.farPlane=this.cameraObject.far,se.eyePosition[0]=this.cameraObject.position.x,se.eyePosition[1]=this.cameraObject.position.y,se.eyePosition[2]=this.cameraObject.position.z,se.targetPosition[0]=this.cameraObject.target.x,se.targetPosition[1]=this.cameraObject.target.y,se.targetPosition[2]=this.cameraObject.target.z,se.upVector[0]=this.cameraObject.up.x,se.upVector[1]=this.cameraObject.up.y,se.upVector[2]=this.cameraObject.up.z,se},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(se,we,Te)=>{te==null&&(Z=new g(se,we,this,Te))},this.rotateCameraTransition=(se,we,Te)=>{Z==null&&(te=new m(se,we,this,Te))},this.enableCameraTransition=()=>{Z&&(Y=R.SMOOTH_CAMERA_TRANSITION),te&&(Y=R.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{Y=R.DEFAULT},this.stopCameraTransition=()=>{Y=R.DEFAULT,Z=void 0,te=void 0},this.isTransitioningCamera=()=>Y===R.SMOOTH_CAMERA_TRANSITION||Y===R.ROTATE_CAMERA_TRANSITION,this.autoTumble=(se,we,Te)=>{q=new b(se,we,Te,this)},this.enableAutoTumble=()=>{Y=R.AUTO_TUMBLE},this.stopAutoTumble=()=>{Y=R.DEFAULT,q=void 0},this.updateAutoTumble=()=>{q&&(q.requireUpdate=!0)},this.isAutoTumble=()=>Y===R.AUTO_TUMBLE,this.enableRaycaster=(se,we,Te)=>{X==null&&(X=new h(se,this.scene,we,Te,this.renderer))},this.disableRaycaster=()=>{X.disable(),X=void 0},this.isSyncControl=()=>currentMpde===R.SYNC_CONTROL,this.enableSyncControl=()=>(Y=R.SYNC_CONTROL,ce||(ce=new A),ce.setCurrentCameraSettings(this.cameraObject,ye[G]),ce),this.disableSyncControl=()=>{Y=R.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},g=function(w,C,P,R){var I=w.eyePosition,S=w.targetPosition,T=w.upVector,E=C.eyePosition,L=C.targetPosition,F=C.upVector,x=P,O=R,B=0,N=!1;x.near=Math.min(w.nearPlane,C.nearPlane),x.far=Math.max(w.farPlane,C.farPlane),x.cameraObject.up.set(C.upVector[0],C.upVector[1],C.upVector[2]),this.setDuration=G=>{O=G};var k=G=>{var Y=B+G;Y>O&&(Y=O),B=Y},z=()=>{var G=B/O,Y=[I[0]*(1-G)+E[0]*G,I[1]*(1-G)+E[1]*G,I[2]*(1-G)+E[2]*G],Z=[S[0]*(1-G)+L[0]*G,S[1]*(1-G)+L[1]*G,S[2]*(1-G)+L[2]*G];T[0]*(1-G)+F[0]*G,T[1]*(1-G)+F[1]*G,T[2]*(1-G)+F[2]*G,x.cameraObject.position.set(Y[0],Y[1],Y[2]),x.cameraObject.target.set(Z[0],Z[1],Z[2])};this.update=G=>{this.enabled===!1||(k(G),z(),B==O&&(N=!0))},this.isTransitionCompleted=()=>N},m=function(w,C,P,R){var I=w,S=C,T=P,E=R,L=0,F=!1;this.setDuration=O=>{E=O};var x=O=>{var B=L,N=L+O;N>E&&(N=E),L=N;var k=L-B,z=k/E,G=z*S;T.rotateAboutLookAtpoint(I,G)};this.update=O=>{this.enabled===!1||(x(O),L==E&&(F=!0))},this.isTransitionCompleted=()=>F},h=function(w,C,P,R,I){var S=w,T=C,E=I,L=P,F=R,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var O=new c.Vector2,B=!1,N=new Date,k=!1,z=0,G=[],Y={zincCamera:void 0,x:-1,y:-1},Z=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=W=>{if(T!==S){var $=S.getThreeJSScene();E.render($,W.cameraObject)}var X=Z||S.getPickableThreeJSObjects();return G.length=0,x.intersectObjects(X,!0,G)},this.setPickableObjects=W=>{W===void 0?Z=void 0:(Z=[],W.forEach($=>{$.getGroup()&&$.getGroup().visible&&Z.push($.getGroup())}))},this.getIntersectsObjectWithOrigin=(W,$,X)=>(x.set($,X),this.getIntersectsObject(W)),this.getIntersectsObjectWithCamera=(W,$,X)=>(W.getNDCFromDocumentCoords($,X,O),x.setFromCamera(O,W.cameraObject),this.getIntersectsObject(W)),this.pick=(W,$,X)=>{if(E&&S&&W&&L){this.getIntersectsObjectWithCamera(W,$,X);for(var K,re=G.length,V=0;V<re;V++)if(K=G[V].object?G[V].object.userData:void 0,K&&K.isMarkerCluster&&K.visible&&K.clusterIsVisible(G[V].object.clusterIndex)&&K.zoomToCluster(G[V].object.clusterIndex))return;L(G,$,X)}};var te=(W,$,X)=>{if(E&&S&&W&&F){if(this.getIntersectsObjectWithCamera(W,$,X),N.setTime(Date.now()),G.length===0){if(k)return;k=!0}else k=!1;F(G,$,X)}};this.move=(W,$,X)=>{E&&S&&W&&F&&(S.displayMarkers?te(W,$,X):(Y.zincCamera=W,Y.x=$,Y.y=X,!B&&(z=N?Date.now()-N.getTime():250,250<=z?te(W,$,X):(B=!0,setTimeout(q(Y),z)))))};var q=W=>function(){B=!1,te(W.zincCamera,W.x,W.y)}},b=function(w,C,P,R){var I=new c.Vector3,S=-C,T=R,E=w;this.stopOnCameraInput=P,this.requireUpdate=!0;var L=new c.Vector3,F=new c.Vector3,x=O=>{var B=Math.sqrt(O[0]*O[0]+O[1]*O[1]),N=4*Math.abs(O[0]),k=4*Math.abs(O[1]),z=.25*(N+k),G=-O[1]/B,Y=O[0]/B,Z=G*O[0]+Y*-O[1];Z>z?Z=z:Z<-z&&(Z=-z);var te=Math.acos(Z/z)-.5*Math.PI;I.copy(T.cameraObject.position).sub(T.cameraObject.target).normalize(),L.copy(T.cameraObject.up).normalize(),F.crossVectors(L,I).normalize().multiplyScalar(G),L.multiplyScalar(Y),L.add(F).multiplyScalar(Math.cos(te)),I.multiplyScalar(Math.sin(te)).add(L)};this.update=O=>{this.enabled===!1||(this.requireUpdate&&(x(E),this.requireUpdate=!1),T.rotateAboutLookAtpoint(I,S*O/1e3))}},y=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(y.prototype,{update:(()=>{var _,w,C,P,R,I,S=new c.Matrix4,T=new c.Matrix4;return function(L){var F=_!==L.focus||w!==L.fov||C!==L.aspect*this.aspect||P!==L.near||R!==L.far||I!==L.zoom;if(F){_=L.focus,w=L.fov,C=L.aspect*this.aspect,P=L.near,R=L.far,I=L.zoom;var x,O,B=L.projectionMatrix.clone(),N=.064/2,k=N*P/_,z=P*Math.tan(.5*(c.Math.DEG2RAD*w))/L.zoom;T.elements[12]=-N,S.elements[12]=N,x=-z*C+k,O=z*C+k,B.elements[0]=2*P/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraL.projectionMatrix.copy(B),x=-z*C-k,O=z*C-k,B.elements[0]=2*P/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(L.matrixWorld).multiply(T),this.cameraR.matrixWorld.copy(L.matrixWorld).multiply(S)}})()});var v=function(w){var C=new y;C.aspect=.5,this.setSize=(P,R)=>{w.setSize(P,R)},this.render=(P,R)=>{P.updateMatrixWorld(),R.parent===null&&R.updateMatrixWorld(),C.update(R);var I=w.getSize();w.setScissorTest(!0),w.clear(),w.setScissor(0,0,I.width/2,I.height),w.setViewport(0,0,I.width/2,I.height),w.render(P,C.cameraL),w.setScissor(I.width/2,0,I.width/2,I.height),w.setViewport(I.width/2,0,I.width/2,I.height),w.render(P,C.cameraR),w.setScissorTest(!1)}},M=function(w){var C=this;this.object=w,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var P=S=>{C.deviceOrientation=S},R=()=>{typeof window<"u"&&(C.screenOrientation=window.orientation||0)},I=(()=>{var S=new c.Vector3(0,0,1),T=new c.Euler,E=new c.Quaternion,L=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(F,x,O,B,N)=>{var k=new c.Vector3(0,0,1);k.subVectors(F.target,F.position),T.set(O,x,-B,"YXZ");var z=new c.Quaternion;z.setFromEuler(T),z.multiply(L),z.multiply(E.setFromAxisAngle(S,-N)),k.applyQuaternion(z),k.addVectors(F.position,k),F.lookAt(k)}})();this.connect=()=>{R(),typeof window<"u"&&(window.addEventListener("orientationchange",R,!1),window.addEventListener("deviceorientation",P,!1)),C.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",R,!1),window.removeEventListener("deviceorientation",P,!1)),C.enabled=!1},this.update=()=>{if(C.enabled!==!1){var S=C.deviceOrientation.alpha?c.Math.degToRad(C.deviceOrientation.alpha):0,T=C.deviceOrientation.beta?c.Math.degToRad(C.deviceOrientation.beta):0,E=C.deviceOrientation.gamma?c.Math.degToRad(C.deviceOrientation.gamma):0,L=C.screenOrientation?c.Math.degToRad(C.screenOrientation):0;I(C.object,S,T,E,L)}},this.dispose=function(){this.disconnect()},this.connect()},A=function(){var w=void 0,C=void 0,P=void 0,R=new c.Vector3,I=new c.Vector3,S=new c.Vector3,T=new c.Vector3,E=void 0;this.setCurrentCameraSettings=(L,F)=>{this.near_plane_fly_debt==0,w=L.clone(),C=L,P=F,w.near=P.nearPlane,P.farPlane&&(w.far=P.farPlane),P.eyePosition&&w.position.set(P.eyePosition[0],P.eyePosition[1],P.eyePosition[2]),P.upVector&&w.up.set(P.upVector[0],P.upVector[1],P.upVector[2]),P.targetPosition&&(w.target=new c.Vector3(P.targetPosition[0],P.targetPosition[1],P.targetPosition[2]),w.lookAt(w.target)),w.updateProjectionMatrix(),R.copy(w.position).project(w),I.copy(w.target).project(w)},this.getCurrentPosition=()=>(I.copy(C.target).project(w),[I.x,I.y]),this.zoom=L=>{var F=.002*L,x=Math.max(C.zoom-F,1);C.zoom=x,C.updateProjectionMatrix()},this.zoomToBox=(L,F)=>{L.getCenter(S),S.project(w),this.setCenterZoom([S.x,S.y],F)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:C.zoom}),this.setCenterZoom=(L,F)=>{S.set(L[0],L[1],I.z).unproject(w),T.copy(S).sub(C.target),C.target.copy(S),C.lookAt(C.target),C.position.add(T),C.zoom=F,C.updateProjectionMatrix()},this.setEventCallback=L=>{(L===void 0||typeof L=="function")&&(E=L)},this.triggerCallback=()=>{E!==void 0&&typeof E=="function"&&E()}};l.Viewport=d,l.CameraControls=p,l.SmoothCameraTransition=g,l.RotateCameraTransition=m,l.RayCaster=h,l.CameraAutoTumble=b,l.StereoEffect=v,l.NDCCameraControl=A},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),d=u(22).Pointset;u(24).Lines;var p=u(46).Lines2,g=u(3).Geometry,m=u(4),h=0,b=function(){return"re"+h++},y=function(v,M){var A=v,_=new c;_.matrixAutoUpdate=!1,_.userData=this;var w=[],C="",P=[],R=M,I=new f,S=3e3;I.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{w.forEach(T=>T.hideAllPrimitives()),P.forEach(T=>T.setVisibility(!1))},this.showAllPrimitives=()=>{w.forEach(T=>T.showAllPrimitives()),P.forEach(T=>T.setVisibility(!0))},this.setVisibility=T=>{T!=_.visible&&(_.visible=T,this.pickableUpdateRequired=!0)},this.getVisibility=()=>_.visible,this.getGroup=()=>_,this.setTransformation=T=>{I.set(...T),_.matrix.copy(I),_.updateMatrixWorld()},this.setName=T=>{T&&T!==""&&(C=T)},this.getName=()=>C,this.getParent=()=>A,this.getFullSeparatedPath=()=>{var T=[];if(C!==""){T.push(C);for(var E,L=A;L!==void 0;)E=L.getName(),E!==""&&T.unshift(E),L=L.getParent()}return T},this.getFullPath=()=>{var T=this.getFullSeparatedPath();if(0<T.length){var E=T.shift();return T.forEach(L=>{E=E.concat("/",L)}),E}return""},this.createChild=T=>{var E=new y(this,R);return E.setName(T),w.push(E),_.add(E.getGroup()),E},this.getChildWithName=T=>{if(T){for(var E=T.toLowerCase(),L=0;L<w.length;L++)if(w[L].getName().toLowerCase()===E)return w[L]}},this.findChildFromSeparatedPath=T=>{if(T&&0<T.length&&T[0]===""&&T.shift(),T&&0<T.length){var E=this.getChildWithName(T[0]);return E?(T.shift(),E.findChildFromSeparatedPath(T)):void 0}return this},this.findChildFromPath=T=>{var E=T.split("/");return this.findChildFromSeparatedPath(E)},this.createChildFromSeparatedPath=T=>{if(0<T.length&&T[0]===""&&T.shift(),0<T.length){var E=this.getChildWithName(T[0]);return E||(E=this.createChild(T[0])),T.shift(),E.createChildFromSeparatedPath(T)}return this},this.createChildFromPath=T=>{var E=T.split("/");return this.createChildFromSeparatedPath(E)},this.findOrCreateChildFromPath=T=>{var E=this.findChildFromPath(T);return E||(E=this.createChildFromPath(T)),E},this.addZincObject=T=>{T&&(T.setRegion(this),_.add(T.getGroup()),P.push(T),this.pickableUpdateRequired=!0,R&&R.triggerObjectAddedCallback(T))},this.removeZincObject=T=>{for(var E=0;E<P.length;E++)if(T===P[E])return _.remove(T.getGroup()),P.splice(E,1),R&&R.triggerObjectRemovedCallback(T),T.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=T=>{if(this.pickableUpdateRequired)return!0;if(T){for(var E=!1,L=0;L<w.length;L++)if(E=w[L].checkPickableUpdateRequred(T),E)return!0}return!1},this.getPickableThreeJSObjects=(T,E)=>(_.visible&&(P.forEach(L=>{if(L.isPickable&&L.getGroup()&&L.getGroup().visible){var F=L.marker;F&&F.isEnabled()&&T.push(F.getMorph()),T.push(L.getGroup())}}),E&&w.forEach(L=>{L.getPickableThreeJSObjects(T,E)}),this.pickableUpdateRequired=!1),T),this.setDuration=T=>{S=T,P.forEach(E=>E.setDuration(T)),w.forEach(E=>E.setDuration(T))},this.getDuration=()=>S,this.getBoundingBox=T=>{var E,L;return P.forEach(F=>{L=F.getBoundingBox(),L&&(E==null?E=L.clone():E.union(L))}),T&&w.forEach(F=>{L=F.getBoundingBox(T),L&&(E==null?E=L.clone():E.union(L))}),E},this.clear=T=>{T&&w.forEach(E=>E.clear(T)),P.forEach(E=>{_.remove(E.getGroup()),E.dispose()}),w=[],P=[]},this.objectIsInRegion=(T,E)=>{for(var L=0;L<P.length;L++)if(T===P[L])return!0;if(E){for(var F=0;F<w.length;F++)if(w[F].objectIsInRegion(T,E))return!0}return!1},this.forEachGeometry=(T,E)=>{P.forEach(L=>{L.isGeometry&&T(L)}),E&&w.forEach(L=>L.forEachGeometry(T,E))},this.forEachGlyphset=(T,E)=>{P.forEach(L=>{L.isGlyphset&&T(L)}),E&&w.forEach(L=>L.forEachGlyphset(T,E))},this.forEachPointset=(T,E)=>{P.forEach(L=>{L.isPointset&&T(L)}),E&&w.forEach(L=>L.forEachPointset(T,E))},this.forEachLine=(T,E)=>{P.forEach(L=>{L.isLines&&T(L)}),E&&w.forEach(L=>L.forEachLine(T,E))},this.findObjectsWithAnatomicalId=(T,E)=>{var L=[];return P.forEach(F=>{F.anatomicalId===T&&L.push(F)}),E&&w.forEach(F=>{var x=F.findObjectsWithAnatomicalId(T,E);L.push(...x)}),L},this.findObjectsWithGroupName=(T,E)=>{var L=[];return P.forEach(F=>{var x=F.groupName?F.groupName.toLowerCase():F.groupName,O=T&&T.toLowerCase();x===O&&L.push(F)}),E&&w.forEach(F=>{var x=F.findObjectsWithGroupName(T,E);L.push(...x)}),L},this.findGeometriesWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isGeometry);return F},this.findPointsetsWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isPointset);return F},this.findGlyphsetsWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isGlyphset);return F},this.findLinesWithGroupName=(T,E)=>{var L=this.findObjectsWithGroupName(T,E),F=L.filter(x=>x.isLines);return F},this.getAllObjects=T=>{var E=[...P];return T&&w.forEach(L=>{var F=L.getAllObjects(T);E.push(...F)}),E},this.getChildRegions=T=>{var E=[...w];return T&&w.forEach(L=>{var F=L.getChildRegions(T);E.push(...F)}),E},this.getCurrentTime=()=>{if(P[0]!=null)return P[0].getCurrentTime();for(var T,E=0;E<w.length;E++)if(T=w[E].getCurrentTime(),T!==-1)return T;return-1},this.setMorphTime=(T,E)=>{P.forEach(L=>{L.setMorphTime(T)}),E&&w.forEach(L=>{L.setMorphTime(T)})},this.isTimeVarying=()=>{for(var T=0;T<P.length;T++)if(P[T].isTimeVarying())return!0;for(var E=0;E<w.length;E++)if(w[E].isTimeVarying())return!0;return!1},this.renderGeometries=(T,E,L,F,x,O)=>{var B,N=this.getAllObjects(O);N.forEach(k=>{k.render(T*E,L,F,x)}),x&&L===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(T,E,L,F)=>{var x=!1,O=this.findObjectsWithGroupName(T,!1),B=O.findIndex(k=>k.isPointset),N=-1<B?O[B]:new d;return N.addPoints(E,L,F),B===-1?(N.setName(T),this.addZincObject(N),x=!0):this.pickableUpdateRequired=!0,{zincObject:N,isNew:x}},this.createLines=(T,E,L)=>{var F=!1,x=this.findObjectsWithGroupName(T,!1),O=x.findIndex(N=>N.isLines),B=-1<O?x[O]:new p;return B.addLines(E,L),O===-1?(B.setName(T),this.addZincObject(B),F=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:F}},this.createGeometryFromThreeJSGeometry=(T,E,L,F,x,O)=>{var B=new g,N=new m.MeshPhongMaterial({color:L,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:F,side:m.DoubleSide});return B.createMesh(E,N,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(T),B.setRenderOrder(O),this.addZincObject(B),B):void 0}};l.Region=y},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(47).LineSegments2,f=u(49).LineMaterial,d=u(48).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var g=Array(300);this.createLineSegment=(m,h,b)=>{if(m&&h){var y=new d;y.setPositions(m),y.colorsNeedUpdate=!0;var v=new c(y,h);v.scale.set(1,1,1),v.computeLineDistances(),this.setMesh(v,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var h=this.getMorph();h||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(y=>{g[b++]=y[0],g[b++]=y[1],g[b++]=y[2],this.drawRange++}),!h)for(;300>b;)g[b++]=m[0][0],g[b++]=m[0][1],g[b++]=m[0][2];h&&(h.geometry.setPositions(g),h.computeLineDistances(),h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0)}return g},this.getVerticesByFaceIndex=function(m){var h=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>h){var y=b.geometry.getAttribute("instanceStart");return[[y.data.array[h],y.data.array[++h],y.data.array[++h]],[y.data.array[++h],y.data.array[++h],y.data.array[++h]]]}return[]},this.editVertices=function(m,h){if(m&&m.length){var b=this.getMorph(),y=h+m.length-1;if(!b||0>h||y>=this.drawRange)return;var v=3*h;for(m.forEach(M=>{g[v++]=M[0],g[v++]=M[1],g[v++]=M[2]}),v=3*this.drawRange;300>v;)g[v++]=m[0][0],g[v++]=m[0][1],g[v++]=m[0][2];b.geometry.setPositions(g),b.computeLineDistances(),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}return g},this.addLines=(m,h)=>{if(m&&0<m.length){this.addVertices(m);var b=this.getMorph();if(!b){var y=new f({color:h,linewidth:1,vertexColors:!1,worldUnits:!1});y.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(g,y,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>P});var c=u(4),f=u(48),d=u(49),p=new c.Vector3,g=new c.Vector3,m=new c.Vector4,h=new c.Vector4,b=new c.Vector4,y=new c.Vector3,v=new c.Matrix4,M=new c.Line3,A=new c.Vector3,_=new c.Box3,w=new c.Sphere,C=new c.Vector4;class P extends c.Mesh{constructor(){var I=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new d.LineMaterial({color:16777215*Math.random()});super(I,S),this.type="LineSegments2"}computeLineDistances(){for(var I=this.geometry,S=I.attributes.instanceStart,T=I.attributes.instanceEnd,E=new Float32Array(2*S.count),L=0,F=0,x=S.count;L<x;L++,F+=2)p.fromBufferAttribute(S,L),g.fromBufferAttribute(T,L),E[F]=F==0?0:E[F-1],E[F+1]=E[F]+p.distanceTo(g);var O=new c.InstancedInterleavedBuffer(E,2,1);return I.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(O,1,0)),I.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(O,1,1)),this}raycast(I,S){I.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var T=I.params.Line2===void 0?0:I.params.Line2.threshold||0,E=I.ray,L=I.camera,F=L.projectionMatrix,x=this.matrixWorld,O=this.geometry,B=this.material,N=B.resolution,k=B.linewidth+T,z=O.attributes.instanceStart,G=O.attributes.instanceEnd,Y=-L.near,Z=2*Math.max(k/N.width,k/N.height);O.boundingSphere===null&&O.computeBoundingSphere(),w.copy(O.boundingSphere).applyMatrix4(x);var te=Math.max(L.near,w.distanceToPoint(E.origin));C.set(0,0,-te,1).applyMatrix4(L.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(L.projectionMatrixInverse);var q=.5*Math.abs(Z/C.w);if(w.radius+=q,I.ray.intersectsSphere(w)!==!1){O.boundingBox===null&&O.computeBoundingBox(),_.copy(O.boundingBox).applyMatrix4(x);var W=Math.max(L.near,_.distanceToPoint(E.origin));C.set(0,0,-W,1).applyMatrix4(L.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(L.projectionMatrixInverse);var $=.5*Math.abs(Z/C.w);if(_.max.x+=$,_.max.y+=$,_.max.z+=$,_.min.x-=$,_.min.y-=$,_.min.z-=$,I.ray.intersectsBox(_)!==!1){E.at(1,b),b.w=1,b.applyMatrix4(L.matrixWorldInverse),b.applyMatrix4(F),b.multiplyScalar(1/b.w),b.x*=N.x/2,b.y*=N.y/2,b.z=0,y.copy(b),v.multiplyMatrices(L.matrixWorldInverse,x);for(var X=0,K=z.count;X<K;X++){m.fromBufferAttribute(z,X),h.fromBufferAttribute(G,X),m.w=1,h.w=1,m.applyMatrix4(v),h.applyMatrix4(v);var re=m.z>Y&&h.z>Y;if(!re){if(m.z>Y){var V=m.z-h.z,j=(m.z-Y)/V;m.lerp(h,j)}else if(h.z>Y){var oe=h.z-m.z,ae=(h.z-Y)/oe;h.lerp(m,ae)}m.applyMatrix4(F),h.applyMatrix4(F),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w),m.x*=N.x/2,m.y*=N.y/2,h.x*=N.x/2,h.y*=N.y/2,M.start.copy(m),M.start.z=0,M.end.copy(h),M.end.z=0;var le=M.closestPointToPointParameter(y,!0);M.at(le,A);var H=c.MathUtils.lerp(m.z,h.z,le),U=-1<=H&&1>=H,D=y.distanceTo(A)<.5*k;if(U&&D){M.start.fromBufferAttribute(z,X),M.end.fromBufferAttribute(G,X),M.start.applyMatrix4(x),M.end.applyMatrix4(x);var Q=new c.Vector3,ie=new c.Vector3;E.distanceSqToSegment(M.start,M.end,ie,Q),S.push({point:ie,pointOnLine:Q,distance:E.origin.distanceTo(ie),object:this,face:null,faceIndex:X,uv:null,uv2:null})}}}}}}}P.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,d=new c.Vector3;class p extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(m){var h=this.attributes.instanceStart,b=this.attributes.instanceEnd;return h!==void 0&&(h.applyMatrix4(m),b.applyMatrix4(m),h.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var h;m instanceof Float32Array?h=m:Array.isArray(m)&&(h=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(h,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(m){var h;m instanceof Float32Array?h=m:Array.isArray(m)&&(h=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(h,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var h=m.geometry;return h.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(h.isBufferGeometry&&this.setPositions(h.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,h=this.attributes.instanceEnd;m!==void 0&&h!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(h),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,h=this.attributes.instanceEnd;if(m!==void 0&&h!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var y=0,v=0,M=m.count;v<M;v++)d.fromBufferAttribute(m,v),y=Math.max(y,b.distanceToSquared(d)),d.fromBufferAttribute(h,v),y=Math.max(y,b.distanceToSquared(d));this.boundingSphere.radius=Math.sqrt(y),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(m){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(m)}}p.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3239
3239
  #include <common>
3240
3240
  #include <color_pars_vertex>
3241
3241
  #include <fog_pars_vertex>