@splinetool/runtime 0.9.59 → 0.9.62
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.
- package/build/runtime.js +25 -25
- package/package.json +2 -3
package/build/runtime.js
CHANGED
|
@@ -2983,11 +2983,11 @@ void main() {
|
|
|
2983
2983
|
squared_mean = squared_mean / samples;
|
|
2984
2984
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
2985
2985
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
2986
|
-
}`;function Cb(i,e,t){let r=new Na,n=new B,s=new B,o=new Je,a=new Jc({depthPacking:F_}),l=new Kc,c={},h=t.maxTextureSize,u={0:Dr,1:si,2:or},f=new Mt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new B},radius:{value:4}},vertexShader:CL,fragmentShader:PL}),d=f.clone();d.defines.HORIZONTAL_PASS=1;let p=new De;p.setAttribute("position",new Ve(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new Vt(p,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fb,this.render=function(b,S,T){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||b.length===0)return;let A=i.getRenderTarget(),x=i.getActiveCubeFace(),_=i.getActiveMipmapLevel(),E=i.state;E.setBlending(Ht),E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);for(let C=0,I=b.length;C<I;C++){let N=b[C],R=N.shadow;if(R===void 0){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(R.autoUpdate===!1&&R.needsUpdate===!1)continue;n.copy(R.mapSize);let k=R.getFrameExtents();if(n.multiply(k),s.copy(R.mapSize),(n.x>h||n.y>h)&&(n.x>h&&(s.x=Math.floor(h/k.x),n.x=s.x*k.x,R.mapSize.x=s.x),n.y>h&&(s.y=Math.floor(h/k.y),n.y=s.y*k.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Nc&&(R.map=new mt(n.x,n.y),R.map.texture.name=N.name+".shadowMap",R.mapPass=new mt(n.x,n.y),R.camera.updateProjectionMatrix()),R.map===null){let K={minFilter:hr,magFilter:hr,format:Fn};R.map=new mt(n.x,n.y,K),R.map.texture.name=N.name+".shadowMap",R.camera.updateProjectionMatrix()}i.setRenderTarget(R.map),i.clear();let G=R.getViewportCount();for(let K=0;K<G;K++){let J=R.getViewport(K);o.set(s.x*J.x,s.y*J.y,s.x*J.z,s.y*J.w),E.viewport(o),R.updateMatrices(N,K),r=R.getFrustum(),w(S,T,R.camera,N,this.type)}!R.isPointLightShadow&&this.type===Nc&&v(R,T),R.needsUpdate=!1}g.needsUpdate=!1,i.setRenderTarget(A,x,_)};function v(b,S){let T=e.update(m);f.defines.VSM_SAMPLES!==b.blurSamples&&(f.defines.VSM_SAMPLES=b.blurSamples,d.defines.VSM_SAMPLES=b.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),f.uniforms.shadow_pass.value=b.map.texture,f.uniforms.resolution.value=b.mapSize,f.uniforms.radius.value=b.radius,i.setRenderTarget(b.mapPass),i.clear(),i.renderBufferDirect(S,null,T,f,m,null),d.uniforms.shadow_pass.value=b.mapPass.texture,d.uniforms.resolution.value=b.mapSize,d.uniforms.radius.value=b.radius,i.setRenderTarget(b.map),i.clear(),i.renderBufferDirect(S,null,T,d,m,null)}function y(b,S,T,A,x,_){let E=null,C=T.isPointLight===!0?b.customDistanceMaterial:b.customDepthMaterial;if(C!==void 0?E=C:E=T.isPointLight===!0?l:a,i.localClippingEnabled&&S.clipShadows===!0&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0){let I=E.uuid,N=S.uuid,R=c[I];R===void 0&&(R={},c[I]=R);let k=R[N];k===void 0&&(k=E.clone(),R[N]=k),E=k}return E.visible=S.visible,E.wireframe=S.wireframe,_===Nc?E.side=S.shadowSide!==null?S.shadowSide:S.side:E.side=S.shadowSide!==null?S.shadowSide:u[S.side],E.alphaMap=S.alphaMap,E.alphaTest=S.alphaTest,E.clipShadows=S.clipShadows,E.clippingPlanes=S.clippingPlanes,E.clipIntersection=S.clipIntersection,E.displacementMap=S.displacementMap,E.displacementScale=S.displacementScale,E.displacementBias=S.displacementBias,E.wireframeLinewidth=S.wireframeLinewidth,E.linewidth=S.linewidth,T.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(T.matrixWorld),E.nearDistance=A,E.farDistance=x),E}function w(b,S,T,A,x){if(b.visible===!1)return;if(b.layers.test(S.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&x===Nc)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,b.matrixWorld);let C=e.update(b),I=b.material;if(Array.isArray(I)){let N=C.groups;for(let R=0,k=N.length;R<k;R++){let G=N[R],K=I[G.materialIndex];if(K&&K.visible){let J=y(b,K,A,T.near,T.far,x);i.renderBufferDirect(T,null,C,J,b,G)}}}else if(I.visible){let N=y(b,I,A,T.near,T.far,x);i.renderBufferDirect(T,null,C,N,b,null)}}let E=b.children;for(let C=0,I=E.length;C<I;C++)w(E[C],S,T,A,x)}}function DL(i,e,t){let r=t.isWebGL2;function n(){let z=!1,Me=new Je,Pe=null,Ze=new Je(0,0,0,0);return{setMask:function(Oe){Pe!==Oe&&!z&&(i.colorMask(Oe,Oe,Oe,Oe),Pe=Oe)},setLocked:function(Oe){z=Oe},setClear:function(Oe,Qe,_e,$e,lt){lt===!0&&(Oe*=$e,Qe*=$e,_e*=$e),Me.set(Oe,Qe,_e,$e),Ze.equals(Me)===!1&&(i.clearColor(Oe,Qe,_e,$e),Ze.copy(Me))},reset:function(){z=!1,Pe=null,Ze.set(-1,0,0,0)}}}function s(){let z=!1,Me=null,Pe=null,Ze=null;return{setTest:function(Oe){Oe?X(2929):V(2929)},setMask:function(Oe){Me!==Oe&&!z&&(i.depthMask(Oe),Me=Oe)},setFunc:function(Oe){if(Pe!==Oe){if(Oe)switch(Oe){case i_:i.depthFunc(512);break;case s_:i.depthFunc(519);break;case o_:i.depthFunc(513);break;case tg:i.depthFunc(515);break;case a_:i.depthFunc(514);break;case l_:i.depthFunc(518);break;case c_:i.depthFunc(516);break;case h_:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Pe=Oe}},setLocked:function(Oe){z=Oe},setClear:function(Oe){Ze!==Oe&&(i.clearDepth(Oe),Ze=Oe)},reset:function(){z=!1,Me=null,Pe=null,Ze=null}}}function o(){let z=!1,Me=null,Pe=null,Ze=null,Oe=null,Qe=null,_e=null,$e=null,lt=null;return{setTest:function(dt){z||(dt?X(2960):V(2960))},setMask:function(dt){Me!==dt&&!z&&(i.stencilMask(dt),Me=dt)},setFunc:function(dt,Ut,Ur){(Pe!==dt||Ze!==Ut||Oe!==Ur)&&(i.stencilFunc(dt,Ut,Ur),Pe=dt,Ze=Ut,Oe=Ur)},setOp:function(dt,Ut,Ur){(Qe!==dt||_e!==Ut||$e!==Ur)&&(i.stencilOp(dt,Ut,Ur),Qe=dt,_e=Ut,$e=Ur)},setLocked:function(dt){z=dt},setClear:function(dt){lt!==dt&&(i.clearStencil(dt),lt=dt)},reset:function(){z=!1,Me=null,Pe=null,Ze=null,Oe=null,Qe=null,_e=null,$e=null,lt=null}}}let a=new n,l=new s,c=new o,h={},u={},f=new WeakMap,d=[],p=null,m=!1,g=null,v=null,y=null,w=null,b=null,S=null,T=null,A=!1,x=null,_=null,E=null,C=null,I=null,N=i.getParameter(35661),R=!1,k=0,G=i.getParameter(7938);G.indexOf("WebGL")!==-1?(k=parseFloat(/^WebGL (\d)/.exec(G)[1]),R=k>=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),R=k>=2);let K=null,J={},Y=i.getParameter(3088),F=i.getParameter(2978),U=new Je().fromArray(Y),O=new Je().fromArray(F);function j(z,Me,Pe){let Ze=new Uint8Array(4),Oe=i.createTexture();i.bindTexture(z,Oe),i.texParameteri(z,10241,9728),i.texParameteri(z,10240,9728);for(let Qe=0;Qe<Pe;Qe++)i.texImage2D(Me+Qe,0,6408,1,1,0,6408,5121,Ze);return Oe}let H={};H[3553]=j(3553,3553,1),H[34067]=j(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),X(2929),l.setFunc(tg),$(!1),ce(Ex),X(2884),Z(Ht);function X(z){h[z]!==!0&&(i.enable(z),h[z]=!0)}function V(z){h[z]!==!1&&(i.disable(z),h[z]=!1)}function he(z,Me){return u[z]!==Me?(i.bindFramebuffer(z,Me),u[z]=Me,r&&(z===36009&&(u[36160]=Me),z===36160&&(u[36009]=Me)),!0):!1}function ie(z,Me){let Pe=d,Ze=!1;if(z)if(Pe=f.get(Me),Pe===void 0&&(Pe=[],f.set(Me,Pe)),z.isWebGLMultipleRenderTargets){let Oe=z.texture;if(Pe.length!==Oe.length||Pe[0]!==36064){for(let Qe=0,_e=Oe.length;Qe<_e;Qe++)Pe[Qe]=36064+Qe;Pe.length=Oe.length,Ze=!0}}else Pe[0]!==36064&&(Pe[0]=36064,Ze=!0);else Pe[0]!==1029&&(Pe[0]=1029,Ze=!0);Ze&&(t.isWebGL2?i.drawBuffers(Pe):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(Pe))}function le(z){return p!==z?(i.useProgram(z),p=z,!0):!1}let q={[_a]:32774,[YT]:32778,[XT]:32779};if(r)q[Lx]=32775,q[Ix]=32776;else{let z=e.get("EXT_blend_minmax");z!==null&&(q[Lx]=z.MIN_EXT,q[Ix]=z.MAX_EXT)}let ue={[QT]:0,[JT]:1,[KT]:768,[pb]:770,[n_]:776,[t_]:774,[$T]:772,[ZT]:769,[mb]:771,[r_]:775,[e_]:773};function Z(z,Me,Pe,Ze,Oe,Qe,_e,$e){if(z===Ht){m===!0&&(V(3042),m=!1);return}if(m===!1&&(X(3042),m=!0),z!==qT){if(z!==g||$e!==A){if((v!==_a||b!==_a)&&(i.blendEquation(32774),v=_a,b=_a),$e)switch(z){case Ds:i.blendFuncSeparate(1,771,1,771);break;case Cx:i.blendFunc(1,1);break;case Px:i.blendFuncSeparate(0,769,0,1);break;case Dx:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}else switch(z){case Ds:i.blendFuncSeparate(770,771,1,771);break;case Cx:i.blendFunc(770,1);break;case Px:i.blendFuncSeparate(0,769,0,1);break;case Dx:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}y=null,w=null,S=null,T=null,g=z,A=$e}return}Oe=Oe||Me,Qe=Qe||Pe,_e=_e||Ze,(Me!==v||Oe!==b)&&(i.blendEquationSeparate(q[Me],q[Oe]),v=Me,b=Oe),(Pe!==y||Ze!==w||Qe!==S||_e!==T)&&(i.blendFuncSeparate(ue[Pe],ue[Ze],ue[Qe],ue[_e]),y=Pe,w=Ze,S=Qe,T=_e),g=z,A=null}function W(z,Me){z.side===or?V(2884):X(2884);let Pe=z.side===Dr;Me&&(Pe=!Pe),$(Pe),z.blending===Ds&&z.transparent===!1?Z(Ht):Z(z.blending,z.blendEquation,z.blendSrc,z.blendDst,z.blendEquationAlpha,z.blendSrcAlpha,z.blendDstAlpha,z.premultipliedAlpha),l.setFunc(z.depthFunc),l.setTest(z.depthTest),l.setMask(z.depthWrite),a.setMask(z.colorWrite);let Ze=z.stencilWrite;c.setTest(Ze),Ze&&(c.setMask(z.stencilWriteMask),c.setFunc(z.stencilFunc,z.stencilRef,z.stencilFuncMask),c.setOp(z.stencilFail,z.stencilZFail,z.stencilZPass)),me(z.polygonOffset,z.polygonOffsetFactor,z.polygonOffsetUnits),z.alphaToCoverage===!0?X(32926):V(32926)}function $(z){x!==z&&(z?i.frontFace(2304):i.frontFace(2305),x=z)}function ce(z){z!==WT?(X(2884),z!==_&&(z===Ex?i.cullFace(1029):z===jT?i.cullFace(1028):i.cullFace(1032))):V(2884),_=z}function oe(z){z!==E&&(R&&i.lineWidth(z),E=z)}function me(z,Me,Pe){z?(X(32823),(C!==Me||I!==Pe)&&(i.polygonOffset(Me,Pe),C=Me,I=Pe)):V(32823)}function ve(z){z?X(3089):V(3089)}function ge(z){z===void 0&&(z=33984+N-1),K!==z&&(i.activeTexture(z),K=z)}function Le(z,Me){K===null&&ge();let Pe=J[K];Pe===void 0&&(Pe={type:void 0,texture:void 0},J[K]=Pe),(Pe.type!==z||Pe.texture!==Me)&&(i.bindTexture(z,Me||H[z]),Pe.type=z,Pe.texture=Me)}function ke(){let z=J[K];z!==void 0&&z.type!==void 0&&(i.bindTexture(z.type,null),z.type=void 0,z.texture=void 0)}function L(){try{i.compressedTexImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function P(){try{i.texSubImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function re(){try{i.texSubImage3D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function ye(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Se(){try{i.texStorage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Ie(){try{i.texStorage3D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Fe(){try{i.texImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function fe(){try{i.texImage3D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function rt(z){U.equals(z)===!1&&(i.scissor(z.x,z.y,z.z,z.w),U.copy(z))}function st(z){O.equals(z)===!1&&(i.viewport(z.x,z.y,z.z,z.w),O.copy(z))}function Ee(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),r===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),h={},K=null,J={},u={},f=new WeakMap,d=[],p=null,m=!1,g=null,v=null,y=null,w=null,b=null,S=null,T=null,A=!1,x=null,_=null,E=null,C=null,I=null,U.set(0,0,i.canvas.width,i.canvas.height),O.set(0,0,i.canvas.width,i.canvas.height),a.reset(),l.reset(),c.reset()}return{buffers:{color:a,depth:l,stencil:c},enable:X,disable:V,bindFramebuffer:he,drawBuffers:ie,useProgram:le,setBlending:Z,setMaterial:W,setFlipSided:$,setCullFace:ce,setLineWidth:oe,setPolygonOffset:me,setScissorTest:ve,activeTexture:ge,bindTexture:Le,unbindTexture:ke,compressedTexImage2D:L,texImage2D:Fe,texImage3D:fe,texStorage2D:Se,texStorage3D:Ie,texSubImage2D:P,texSubImage3D:re,compressedTexSubImage2D:ye,scissor:rt,viewport:st,reset:Ee}}function LL(i,e,t,r,n,s,o){let a=n.isWebGL2,l=n.maxTextures,c=n.maxCubemapSize,h=n.maxTextureSize,u=n.maxSamples,f=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap,m,g=new WeakMap,v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(L,P){return v?new OffscreenCanvas(L,P):qc("canvas")}function w(L,P,re,ye){let Se=1;if((L.width>ye||L.height>ye)&&(Se=ye/Math.max(L.width,L.height)),Se<1||P===!0)if(typeof HTMLImageElement<"u"&&L instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&L instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&L instanceof ImageBitmap){let Ie=P?pf:Math.floor,Fe=Ie(Se*L.width),fe=Ie(Se*L.height);m===void 0&&(m=y(Fe,fe));let rt=re?y(Fe,fe):m;return rt.width=Fe,rt.height=fe,rt.getContext("2d").drawImage(L,0,0,Fe,fe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+L.width+"x"+L.height+") to ("+Fe+"x"+fe+")."),rt}else return"data"in L&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+L.width+"x"+L.height+")."),L;return L}function b(L){return og(L.width)&&og(L.height)}function S(L){return a?!1:L.wrapS!==Pr||L.wrapT!==Pr||L.minFilter!==hr&&L.minFilter!==ct}function T(L,P){return L.generateMipmaps&&P&&L.minFilter!==hr&&L.minFilter!==ct}function A(L){i.generateMipmap(L)}function x(L,P,re,ye,Se=!1){if(a===!1)return P;if(L!==null){if(i[L]!==void 0)return i[L];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+L+"'")}let Ie=P;return P===6403&&(re===5126&&(Ie=33326),re===5131&&(Ie=33325),re===5121&&(Ie=33321)),P===33319&&(re===5126&&(Ie=33328),re===5131&&(Ie=33327),re===5121&&(Ie=33323)),P===6408&&(re===5126&&(Ie=34836),re===5131&&(Ie=34842),re===5121&&(Ie=ye===je&&Se===!1?35907:32856),re===32819&&(Ie=32854),re===32820&&(Ie=32855)),(Ie===33325||Ie===33326||Ie===33327||Ie===33328||Ie===34842||Ie===34836)&&e.get("EXT_color_buffer_float"),Ie}function _(L,P,re){return T(L,re)===!0||L.isFramebufferTexture&&L.minFilter!==hr&&L.minFilter!==ct?Math.log2(Math.max(P.width,P.height))+1:L.mipmaps!==void 0&&L.mipmaps.length>0?L.mipmaps.length:L.isCompressedTexture&&Array.isArray(L.image)?P.mipmaps.length:1}function E(L){return L===hr||L===Rx||L===Bx?9728:9729}function C(L){let P=L.target;P.removeEventListener("dispose",C),N(P),P.isVideoTexture&&p.delete(P)}function I(L){let P=L.target;P.removeEventListener("dispose",I),k(P)}function N(L){let P=r.get(L);if(P.__webglInit===void 0)return;let re=L.source,ye=g.get(re);if(ye){let Se=ye[P.__cacheKey];Se.usedTimes--,Se.usedTimes===0&&R(L),Object.keys(ye).length===0&&g.delete(re)}r.remove(L)}function R(L){let P=r.get(L);i.deleteTexture(P.__webglTexture);let re=L.source,ye=g.get(re);delete ye[P.__cacheKey],o.memory.textures--}function k(L){let P=L.texture,re=r.get(L),ye=r.get(P);if(ye.__webglTexture!==void 0&&(i.deleteTexture(ye.__webglTexture),o.memory.textures--),L.depthTexture&&L.depthTexture.dispose(),L.isWebGLCubeRenderTarget)for(let Se=0;Se<6;Se++)i.deleteFramebuffer(re.__webglFramebuffer[Se]),re.__webglDepthbuffer&&i.deleteRenderbuffer(re.__webglDepthbuffer[Se]);else i.deleteFramebuffer(re.__webglFramebuffer),re.__webglDepthbuffer&&i.deleteRenderbuffer(re.__webglDepthbuffer),re.__webglMultisampledFramebuffer&&i.deleteFramebuffer(re.__webglMultisampledFramebuffer),re.__webglColorRenderbuffer&&i.deleteRenderbuffer(re.__webglColorRenderbuffer),re.__webglDepthRenderbuffer&&i.deleteRenderbuffer(re.__webglDepthRenderbuffer);if(L.isWebGLMultipleRenderTargets)for(let Se=0,Ie=P.length;Se<Ie;Se++){let Fe=r.get(P[Se]);Fe.__webglTexture&&(i.deleteTexture(Fe.__webglTexture),o.memory.textures--),r.remove(P[Se])}r.remove(P),r.remove(L)}let G=0;function K(){G=0}function J(){let L=G;return L>=l&&console.warn("THREE.WebGLTextures: Trying to use "+L+" texture units while this GPU supports only "+l),G+=1,L}function Y(L){let P=[];return P.push(L.wrapS),P.push(L.wrapT),P.push(L.magFilter),P.push(L.minFilter),P.push(L.anisotropy),P.push(L.internalFormat),P.push(L.format),P.push(L.type),P.push(L.generateMipmaps),P.push(L.premultiplyAlpha),P.push(L.flipY),P.push(L.unpackAlignment),P.push(L.encoding),P.join()}function F(L,P){let re=r.get(L);if(L.isVideoTexture&&Le(L),L.isRenderTargetTexture===!1&&L.version>0&&re.__version!==L.version){let ye=L.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ie(re,L,P);return}}t.activeTexture(33984+P),t.bindTexture(3553,re.__webglTexture)}function U(L,P){let re=r.get(L);if(L.version>0&&re.__version!==L.version){ie(re,L,P);return}t.activeTexture(33984+P),t.bindTexture(35866,re.__webglTexture)}function O(L,P){let re=r.get(L);if(L.version>0&&re.__version!==L.version){ie(re,L,P);return}t.activeTexture(33984+P),t.bindTexture(32879,re.__webglTexture)}function j(L,P){let re=r.get(L);if(L.version>0&&re.__version!==L.version){le(re,L,P);return}t.activeTexture(33984+P),t.bindTexture(34067,re.__webglTexture)}let H={[Ia]:10497,[Pr]:33071,[ig]:33648},X={[hr]:9728,[Rx]:9984,[Bx]:9986,[ct]:9729,[v_]:9985,[js]:9987};function V(L,P,re){if(re?(i.texParameteri(L,10242,H[P.wrapS]),i.texParameteri(L,10243,H[P.wrapT]),(L===32879||L===35866)&&i.texParameteri(L,32882,H[P.wrapR]),i.texParameteri(L,10240,X[P.magFilter]),i.texParameteri(L,10241,X[P.minFilter])):(i.texParameteri(L,10242,33071),i.texParameteri(L,10243,33071),(L===32879||L===35866)&&i.texParameteri(L,32882,33071),(P.wrapS!==Pr||P.wrapT!==Pr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(L,10240,E(P.magFilter)),i.texParameteri(L,10241,E(P.minFilter)),P.minFilter!==hr&&P.minFilter!==ct&&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){let ye=e.get("EXT_texture_filter_anisotropic");if(P.type===Ps&&e.has("OES_texture_float_linear")===!1||a===!1&&P.type===Hc&&e.has("OES_texture_half_float_linear")===!1)return;(P.anisotropy>1||r.get(P).__currentAnisotropy)&&(i.texParameterf(L,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,n.getMaxAnisotropy())),r.get(P).__currentAnisotropy=P.anisotropy)}}function he(L,P){let re=!1;L.__webglInit===void 0&&(L.__webglInit=!0,P.addEventListener("dispose",C));let ye=P.source,Se=g.get(ye);Se===void 0&&(Se={},g.set(ye,Se));let Ie=Y(P);if(Ie!==L.__cacheKey){Se[Ie]===void 0&&(Se[Ie]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,re=!0),Se[Ie].usedTimes++;let Fe=Se[L.__cacheKey];Fe!==void 0&&(Se[L.__cacheKey].usedTimes--,Fe.usedTimes===0&&R(P)),L.__cacheKey=Ie,L.__webglTexture=Se[Ie].texture}return re}function ie(L,P,re){let ye=3553;P.isDataArrayTexture&&(ye=35866),P.isData3DTexture&&(ye=32879);let Se=he(L,P),Ie=P.source;if(t.activeTexture(33984+re),t.bindTexture(ye,L.__webglTexture),Ie.version!==Ie.__currentVersion||Se===!0){i.pixelStorei(37440,P.flipY),i.pixelStorei(37441,P.premultiplyAlpha),i.pixelStorei(3317,P.unpackAlignment),i.pixelStorei(37443,0);let Fe=S(P)&&b(P.image)===!1,fe=w(P.image,Fe,!1,h);fe=ke(P,fe);let rt=b(fe)||a,st=s.convert(P.format,P.encoding),Ee=s.convert(P.type),z=x(P.internalFormat,st,Ee,P.encoding,P.isVideoTexture);V(ye,P,rt);let Me,Pe=P.mipmaps,Ze=a&&P.isVideoTexture!==!0,Oe=L.__version===void 0||Se===!0,Qe=_(P,fe,rt);if(P.isDepthTexture)z=6402,a?P.type===Ps?z=36012:P.type===La?z=33190:P.type===Ls?z=35056:z=33189:P.type===Ps&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),P.format===_o&&z===6402&&P.type!==Vc&&P.type!==La&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),P.type=Vc,Ee=s.convert(P.type)),P.format===Ns&&z===6402&&(z=34041,P.type!==Ls&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),P.type=Ls,Ee=s.convert(P.type))),Oe&&(Ze?t.texStorage2D(3553,1,z,fe.width,fe.height):t.texImage2D(3553,0,z,fe.width,fe.height,0,st,Ee,null));else if(P.isDataTexture)if(Pe.length>0&&rt){Ze&&Oe&&t.texStorage2D(3553,Qe,z,Pe[0].width,Pe[0].height);for(let _e=0,$e=Pe.length;_e<$e;_e++)Me=Pe[_e],Ze?t.texSubImage2D(3553,_e,0,0,Me.width,Me.height,st,Ee,Me.data):t.texImage2D(3553,_e,z,Me.width,Me.height,0,st,Ee,Me.data);P.generateMipmaps=!1}else Ze?(Oe&&t.texStorage2D(3553,Qe,z,fe.width,fe.height),t.texSubImage2D(3553,0,0,0,fe.width,fe.height,st,Ee,fe.data)):t.texImage2D(3553,0,z,fe.width,fe.height,0,st,Ee,fe.data);else if(P.isCompressedTexture){Ze&&Oe&&t.texStorage2D(3553,Qe,z,Pe[0].width,Pe[0].height);for(let _e=0,$e=Pe.length;_e<$e;_e++)Me=Pe[_e],P.format!==Fn?st!==null?Ze?t.compressedTexSubImage2D(3553,_e,0,0,Me.width,Me.height,st,Me.data):t.compressedTexImage2D(3553,_e,z,Me.width,Me.height,0,Me.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ze?t.texSubImage2D(3553,_e,0,0,Me.width,Me.height,st,Ee,Me.data):t.texImage2D(3553,_e,z,Me.width,Me.height,0,st,Ee,Me.data)}else if(P.isDataArrayTexture)Ze?(Oe&&t.texStorage3D(35866,Qe,z,fe.width,fe.height,fe.depth),t.texSubImage3D(35866,0,0,0,0,fe.width,fe.height,fe.depth,st,Ee,fe.data)):t.texImage3D(35866,0,z,fe.width,fe.height,fe.depth,0,st,Ee,fe.data);else if(P.isData3DTexture)Ze?(Oe&&t.texStorage3D(32879,Qe,z,fe.width,fe.height,fe.depth),t.texSubImage3D(32879,0,0,0,0,fe.width,fe.height,fe.depth,st,Ee,fe.data)):t.texImage3D(32879,0,z,fe.width,fe.height,fe.depth,0,st,Ee,fe.data);else if(P.isFramebufferTexture){if(Oe)if(Ze)t.texStorage2D(3553,Qe,z,fe.width,fe.height);else{let _e=fe.width,$e=fe.height;for(let lt=0;lt<Qe;lt++)t.texImage2D(3553,lt,z,_e,$e,0,st,Ee,null),_e>>=1,$e>>=1}}else if(Pe.length>0&&rt){Ze&&Oe&&t.texStorage2D(3553,Qe,z,Pe[0].width,Pe[0].height);for(let _e=0,$e=Pe.length;_e<$e;_e++)Me=Pe[_e],Ze?t.texSubImage2D(3553,_e,0,0,st,Ee,Me):t.texImage2D(3553,_e,z,st,Ee,Me);P.generateMipmaps=!1}else Ze?(Oe&&t.texStorage2D(3553,Qe,z,fe.width,fe.height),t.texSubImage2D(3553,0,0,0,st,Ee,fe)):t.texImage2D(3553,0,z,st,Ee,fe);T(P,rt)&&A(ye),Ie.__currentVersion=Ie.version,P.onUpdate&&P.onUpdate(P)}L.__version=P.version}function le(L,P,re){if(P.image.length!==6)return;let ye=he(L,P),Se=P.source;if(t.activeTexture(33984+re),t.bindTexture(34067,L.__webglTexture),Se.version!==Se.__currentVersion||ye===!0){i.pixelStorei(37440,P.flipY),i.pixelStorei(37441,P.premultiplyAlpha),i.pixelStorei(3317,P.unpackAlignment),i.pixelStorei(37443,0);let Ie=P.isCompressedTexture||P.image[0].isCompressedTexture,Fe=P.image[0]&&P.image[0].isDataTexture,fe=[];for(let _e=0;_e<6;_e++)!Ie&&!Fe?fe[_e]=w(P.image[_e],!1,!0,c):fe[_e]=Fe?P.image[_e].image:P.image[_e],fe[_e]=ke(P,fe[_e]);let rt=fe[0],st=b(rt)||a,Ee=s.convert(P.format,P.encoding),z=s.convert(P.type),Me=x(P.internalFormat,Ee,z,P.encoding),Pe=a&&P.isVideoTexture!==!0,Ze=L.__version===void 0,Oe=_(P,rt,st);V(34067,P,st);let Qe;if(Ie){Pe&&Ze&&t.texStorage2D(34067,Oe,Me,rt.width,rt.height);for(let _e=0;_e<6;_e++){Qe=fe[_e].mipmaps;for(let $e=0;$e<Qe.length;$e++){let lt=Qe[$e];P.format!==Fn?Ee!==null?Pe?t.compressedTexSubImage2D(34069+_e,$e,0,0,lt.width,lt.height,Ee,lt.data):t.compressedTexImage2D(34069+_e,$e,Me,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Pe?t.texSubImage2D(34069+_e,$e,0,0,lt.width,lt.height,Ee,z,lt.data):t.texImage2D(34069+_e,$e,Me,lt.width,lt.height,0,Ee,z,lt.data)}}}else{Qe=P.mipmaps,Pe&&Ze&&(Qe.length>0&&Oe++,t.texStorage2D(34067,Oe,Me,fe[0].width,fe[0].height));for(let _e=0;_e<6;_e++)if(Fe){Pe?t.texSubImage2D(34069+_e,0,0,0,fe[_e].width,fe[_e].height,Ee,z,fe[_e].data):t.texImage2D(34069+_e,0,Me,fe[_e].width,fe[_e].height,0,Ee,z,fe[_e].data);for(let $e=0;$e<Qe.length;$e++){let dt=Qe[$e].image[_e].image;Pe?t.texSubImage2D(34069+_e,$e+1,0,0,dt.width,dt.height,Ee,z,dt.data):t.texImage2D(34069+_e,$e+1,Me,dt.width,dt.height,0,Ee,z,dt.data)}}else{Pe?t.texSubImage2D(34069+_e,0,0,0,Ee,z,fe[_e]):t.texImage2D(34069+_e,0,Me,Ee,z,fe[_e]);for(let $e=0;$e<Qe.length;$e++){let lt=Qe[$e];Pe?t.texSubImage2D(34069+_e,$e+1,0,0,Ee,z,lt.image[_e]):t.texImage2D(34069+_e,$e+1,Me,Ee,z,lt.image[_e])}}}T(P,st)&&A(34067),Se.__currentVersion=Se.version,P.onUpdate&&P.onUpdate(P)}L.__version=P.version}function q(L,P,re,ye,Se){let Ie=s.convert(re.format,re.encoding),Fe=s.convert(re.type),fe=x(re.internalFormat,Ie,Fe,re.encoding);r.get(P).__hasExternalTextures||(Se===32879||Se===35866?t.texImage3D(Se,0,fe,P.width,P.height,P.depth,0,Ie,Fe,null):t.texImage2D(Se,0,fe,P.width,P.height,0,Ie,Fe,null)),t.bindFramebuffer(36160,L),ge(P)?f.framebufferTexture2DMultisampleEXT(36160,ye,Se,r.get(re).__webglTexture,0,ve(P)):i.framebufferTexture2D(36160,ye,Se,r.get(re).__webglTexture,0),t.bindFramebuffer(36160,null)}function ue(L,P,re){if(i.bindRenderbuffer(36161,L),P.depthBuffer&&!P.stencilBuffer){let ye=33189;if(re||ge(P)){let Se=P.depthTexture;Se&&Se.isDepthTexture&&(Se.type===Ps?ye=36012:Se.type===La&&(ye=33190));let Ie=ve(P);ge(P)?f.renderbufferStorageMultisampleEXT(36161,Ie,ye,P.width,P.height):i.renderbufferStorageMultisample(36161,Ie,ye,P.width,P.height)}else i.renderbufferStorage(36161,ye,P.width,P.height);i.framebufferRenderbuffer(36160,36096,36161,L)}else if(P.depthBuffer&&P.stencilBuffer){let ye=ve(P);re&&ge(P)===!1?i.renderbufferStorageMultisample(36161,ye,35056,P.width,P.height):ge(P)?f.renderbufferStorageMultisampleEXT(36161,ye,35056,P.width,P.height):i.renderbufferStorage(36161,34041,P.width,P.height),i.framebufferRenderbuffer(36160,33306,36161,L)}else{let ye=P.isWebGLMultipleRenderTargets===!0?P.texture[0]:P.texture,Se=s.convert(ye.format,ye.encoding),Ie=s.convert(ye.type),Fe=x(ye.internalFormat,Se,Ie,ye.encoding),fe=ve(P);re&&ge(P)===!1?i.renderbufferStorageMultisample(36161,fe,Fe,P.width,P.height):ge(P)?f.renderbufferStorageMultisampleEXT(36161,fe,Fe,P.width,P.height):i.renderbufferStorage(36161,Fe,P.width,P.height)}i.bindRenderbuffer(36161,null)}function Z(L,P){if(P&&P.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,L),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(P.depthTexture).__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),F(P.depthTexture,0);let ye=r.get(P.depthTexture).__webglTexture,Se=ve(P);if(P.depthTexture.format===_o)ge(P)?f.framebufferTexture2DMultisampleEXT(36160,36096,3553,ye,0,Se):i.framebufferTexture2D(36160,36096,3553,ye,0);else if(P.depthTexture.format===Ns)ge(P)?f.framebufferTexture2DMultisampleEXT(36160,33306,3553,ye,0,Se):i.framebufferTexture2D(36160,33306,3553,ye,0);else throw new Error("Unknown depthTexture format")}function W(L){let P=r.get(L),re=L.isWebGLCubeRenderTarget===!0;if(L.depthTexture&&!P.__autoAllocateDepthBuffer){if(re)throw new Error("target.depthTexture not supported in Cube render targets");Z(P.__webglFramebuffer,L)}else if(re){P.__webglDepthbuffer=[];for(let ye=0;ye<6;ye++)t.bindFramebuffer(36160,P.__webglFramebuffer[ye]),P.__webglDepthbuffer[ye]=i.createRenderbuffer(),ue(P.__webglDepthbuffer[ye],L,!1)}else t.bindFramebuffer(36160,P.__webglFramebuffer),P.__webglDepthbuffer=i.createRenderbuffer(),ue(P.__webglDepthbuffer,L,!1);t.bindFramebuffer(36160,null)}function $(L,P,re){let ye=r.get(L);P!==void 0&&q(ye.__webglFramebuffer,L,L.texture,36064,3553),re!==void 0&&W(L)}function ce(L){let P=L.texture,re=r.get(L),ye=r.get(P);L.addEventListener("dispose",I),L.isWebGLMultipleRenderTargets!==!0&&(ye.__webglTexture===void 0&&(ye.__webglTexture=i.createTexture()),ye.__version=P.version,o.memory.textures++);let Se=L.isWebGLCubeRenderTarget===!0,Ie=L.isWebGLMultipleRenderTargets===!0,Fe=b(L)||a;if(Se){re.__webglFramebuffer=[];for(let fe=0;fe<6;fe++)re.__webglFramebuffer[fe]=i.createFramebuffer()}else if(re.__webglFramebuffer=i.createFramebuffer(),Ie)if(n.drawBuffers){let fe=L.texture;for(let rt=0,st=fe.length;rt<st;rt++){let Ee=r.get(fe[rt]);Ee.__webglTexture===void 0&&(Ee.__webglTexture=i.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(a&&L.samples>0&&ge(L)===!1){re.__webglMultisampledFramebuffer=i.createFramebuffer(),re.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,re.__webglColorRenderbuffer);let fe=s.convert(P.format,P.encoding),rt=s.convert(P.type),st=x(P.internalFormat,fe,rt,P.encoding),Ee=ve(L);i.renderbufferStorageMultisample(36161,Ee,st,L.width,L.height),t.bindFramebuffer(36160,re.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,re.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),L.depthBuffer&&(re.__webglDepthRenderbuffer=i.createRenderbuffer(),ue(re.__webglDepthRenderbuffer,L,!0)),t.bindFramebuffer(36160,null)}if(Se){t.bindTexture(34067,ye.__webglTexture),V(34067,P,Fe);for(let fe=0;fe<6;fe++)q(re.__webglFramebuffer[fe],L,P,36064,34069+fe);T(P,Fe)&&A(34067),t.unbindTexture()}else if(Ie){let fe=L.texture;for(let rt=0,st=fe.length;rt<st;rt++){let Ee=fe[rt],z=r.get(Ee);t.bindTexture(3553,z.__webglTexture),V(3553,Ee,Fe),q(re.__webglFramebuffer,L,Ee,36064+rt,3553),T(Ee,Fe)&&A(3553)}t.unbindTexture()}else{let fe=3553;(L.isWebGL3DRenderTarget||L.isWebGLArrayRenderTarget)&&(a?fe=L.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(fe,ye.__webglTexture),V(fe,P,Fe),q(re.__webglFramebuffer,L,P,36064,fe),T(P,Fe)&&A(fe),t.unbindTexture()}L.depthBuffer&&W(L)}function oe(L){let P=b(L)||a,re=L.isWebGLMultipleRenderTargets===!0?L.texture:[L.texture];for(let ye=0,Se=re.length;ye<Se;ye++){let Ie=re[ye];if(T(Ie,P)){let Fe=L.isWebGLCubeRenderTarget?34067:3553,fe=r.get(Ie).__webglTexture;t.bindTexture(Fe,fe),A(Fe),t.unbindTexture()}}}function me(L){if(a&&L.samples>0&&ge(L)===!1){let P=L.width,re=L.height,ye=16384,Se=[36064],Ie=L.stencilBuffer?33306:36096;L.depthBuffer&&Se.push(Ie);let Fe=r.get(L),fe=Fe.__ignoreDepthValues!==void 0?Fe.__ignoreDepthValues:!1;fe===!1&&(L.depthBuffer&&(ye|=256),L.stencilBuffer&&(ye|=1024)),t.bindFramebuffer(36008,Fe.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,Fe.__webglFramebuffer),fe===!0&&(i.invalidateFramebuffer(36008,[Ie]),i.invalidateFramebuffer(36009,[Ie])),i.blitFramebuffer(0,0,P,re,0,0,P,re,ye,9728),d&&i.invalidateFramebuffer(36008,Se),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,Fe.__webglMultisampledFramebuffer)}}function ve(L){return Math.min(u,L.samples)}function ge(L){let P=r.get(L);return a&&L.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function Le(L){let P=o.render.frame;p.get(L)!==P&&(p.set(L,P),L.update())}function ke(L,P){let re=L.encoding,ye=L.format,Se=L.type;return L.isCompressedTexture===!0||L.isVideoTexture===!0||L.format===sg||re!==gn&&(re===je?a===!1?e.has("EXT_sRGB")===!0&&ye===Fn?(L.format=sg,L.minFilter=ct,L.generateMipmaps=!1):P=ns.sRGBToLinear(P):(ye!==Fn||Se!==qt)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",re)),P}this.allocateTextureUnit=J,this.resetTextureUnits=K,this.setTexture2D=F,this.setTexture2DArray=U,this.setTexture3D=O,this.setTextureCube=j,this.rebindTextures=$,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=oe,this.updateMultisampleRenderTarget=me,this.setupDepthRenderbuffer=W,this.setupFrameBufferTexture=q,this.useMultisampledRTT=ge}function IL(i,e,t){let r=t.isWebGL2;function n(s,o=null){let a;if(s===qt)return 5121;if(s===S_)return 32819;if(s===M_)return 32820;if(s===x_)return 5120;if(s===b_)return 5122;if(s===Vc)return 5123;if(s===w_)return 5124;if(s===La)return 5125;if(s===Ps)return 5126;if(s===Hc)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===A_)return 6406;if(s===Fn)return 6408;if(s===__)return 6409;if(s===E_)return 6410;if(s===_o)return 6402;if(s===Ns)return 34041;if(s===C_)return 6403;if(s===T_)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===sg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===P_)return 36244;if(s===D_)return 33319;if(s===L_)return 33320;if(s===I_)return 36249;if(s===ym||s===vm||s===xm||s===bm)if(o===je)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===ym)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===xm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===bm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===ym)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===vm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===xm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===bm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Nx||s===Ox||s===Fx||s===Ux)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Nx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Ox)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Fx)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Ux)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===R_)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===zx||s===Gx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===zx)return o===je?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Gx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===kx||s===Vx||s===Hx||s===Wx||s===jx||s===qx||s===Yx||s===Xx||s===Qx||s===Jx||s===Kx||s===Zx||s===$x||s===e0)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===kx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Vx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Hx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Wx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===jx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===qx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Yx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Xx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Qx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Jx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Kx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Zx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===$x)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===e0)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===t0)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===t0)return o===je?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===Ls?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):i[s]!==void 0?i[s]:null}return{convert:n}}var xf=class extends sr{constructor(e=[]){super(),this.cameras=e}};xf.prototype.isArrayCamera=!0;var ts=class extends ot{constructor(){super(),this.type="Group"}};ts.prototype.isGroup=!0;var RL={type:"move"},zc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ts,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 ts,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new M,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new M),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ts,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new M,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new M),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,r){let n=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(n=t.getPose(e.targetRaySpace,r),n!==null&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(RL))),c&&e.hand){o=!0;for(let m of e.hand.values()){let g=t.getJointPose(m,r);if(c.joints[m.jointName]===void 0){let y=new ts;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[m.jointName]=y,c.add(y)}let v=c.joints[m.jointName];g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=g.radius),v.visible=g!==null}let h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],f=h.position.distanceTo(u.position),d=.02,p=.005;c.inputState.pinching&&f>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=d-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=n!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},ai=class extends Pt{constructor(e,t,r,n,s,o,a,l,c,h){if(h=h!==void 0?h:_o,h!==_o&&h!==Ns)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&h===_o&&(r=Vc),r===void 0&&h===Ns&&(r=Ls),super(null,n,s,o,a,l,h,r,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:hr,this.minFilter=l!==void 0?l:hr,this.flipY=!1,this.generateMipmaps=!1}};ai.prototype.isDepthTexture=!0;var pg=class extends Yt{constructor(e,t){super();let r=this,n=null,s=1,o=null,a="local-floor",l=null,c=null,h=null,u=null,f=null,d=null,p=t.getContextAttributes(),m=null,g=null,v=[],y=new Map,w=new sr;w.layers.enable(1),w.viewport=new Je;let b=new sr;b.layers.enable(2),b.viewport=new Je;let S=[w,b],T=new xf;T.layers.enable(1),T.layers.enable(2);let A=null,x=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let F=v[Y];return F===void 0&&(F=new zc,v[Y]=F),F.getTargetRaySpace()},this.getControllerGrip=function(Y){let F=v[Y];return F===void 0&&(F=new zc,v[Y]=F),F.getGripSpace()},this.getHand=function(Y){let F=v[Y];return F===void 0&&(F=new zc,v[Y]=F),F.getHandSpace()};function _(Y){let F=y.get(Y.inputSource);F&&F.dispatchEvent({type:Y.type,data:Y.inputSource})}function E(){y.forEach(function(Y,F){Y.disconnect(F)}),y.clear(),A=null,x=null,e.setRenderTarget(m),f=null,u=null,h=null,n=null,g=null,J.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(Y){l=Y},this.getBaseLayer=function(){return u!==null?u:f},this.getBinding=function(){return h},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=async function(Y){if(n=Y,n!==null){if(m=e.getRenderTarget(),n.addEventListener("select",_),n.addEventListener("selectstart",_),n.addEventListener("selectend",_),n.addEventListener("squeeze",_),n.addEventListener("squeezestart",_),n.addEventListener("squeezeend",_),n.addEventListener("end",E),n.addEventListener("inputsourceschange",C),p.xrCompatible!==!0&&await t.makeXRCompatible(),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let F={antialias:n.renderState.layers===void 0?p.antialias:!0,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(n,t,F),n.updateRenderState({baseLayer:f}),g=new mt(f.framebufferWidth,f.framebufferHeight,{format:Fn,type:qt,encoding:e.outputEncoding})}else{let F=null,U=null,O=null;p.depth&&(O=p.stencil?35056:33190,F=p.stencil?Ns:_o,U=p.stencil?Ls:Vc);let j={colorFormat:e.outputEncoding===je?35907:32856,depthFormat:O,scaleFactor:s};h=new XRWebGLBinding(n,t),u=h.createProjectionLayer(j),n.updateRenderState({layers:[u]}),g=new mt(u.textureWidth,u.textureHeight,{format:Fn,type:qt,depthTexture:new ai(u.textureWidth,u.textureHeight,U,void 0,void 0,void 0,void 0,void 0,void 0,F),stencilBuffer:p.stencil,encoding:e.outputEncoding,samples:p.antialias?4:0});let H=e.properties.get(g);H.__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(1),o=await n.requestReferenceSpace(a),J.setContext(n),J.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function C(Y){let F=n.inputSources;for(let U=0;U<F.length;U++){let O=F[U].handedness==="right"?1:0;y.set(F[U],v[O])}for(let U=0;U<Y.removed.length;U++){let O=Y.removed[U],j=y.get(O);j&&(j.dispatchEvent({type:"disconnected",data:O}),y.delete(O))}for(let U=0;U<Y.added.length;U++){let O=Y.added[U],j=y.get(O);j&&j.dispatchEvent({type:"connected",data:O})}}let I=new M,N=new M;function R(Y,F,U){I.setFromMatrixPosition(F.matrixWorld),N.setFromMatrixPosition(U.matrixWorld);let O=I.distanceTo(N),j=F.projectionMatrix.elements,H=U.projectionMatrix.elements,X=j[14]/(j[10]-1),V=j[14]/(j[10]+1),he=(j[9]+1)/j[5],ie=(j[9]-1)/j[5],le=(j[8]-1)/j[0],q=(H[8]+1)/H[0],ue=X*le,Z=X*q,W=O/(-le+q),$=W*-le;F.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX($),Y.translateZ(W),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert();let ce=X+W,oe=V+W,me=ue-$,ve=Z+(O-$),ge=he*V/oe*ce,Le=ie*V/oe*ce;Y.projectionMatrix.makePerspective(me,ve,ge,Le,ce,oe)}function k(Y,F){F===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(F.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(n===null)return;T.near=b.near=w.near=Y.near,T.far=b.far=w.far=Y.far,(A!==T.near||x!==T.far)&&(n.updateRenderState({depthNear:T.near,depthFar:T.far}),A=T.near,x=T.far);let F=Y.parent,U=T.cameras;k(T,F);for(let j=0;j<U.length;j++)k(U[j],F);T.matrixWorld.decompose(T.position,T.quaternion,T.scale),Y.position.copy(T.position),Y.quaternion.copy(T.quaternion),Y.scale.copy(T.scale),Y.matrix.copy(T.matrix),Y.matrixWorld.copy(T.matrixWorld);let O=Y.children;for(let j=0,H=O.length;j<H;j++)O[j].updateMatrixWorld(!0);U.length===2?R(T,w,b):T.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return T},this.getFoveation=function(){if(u!==null)return u.fixedFoveation;if(f!==null)return f.fixedFoveation},this.setFoveation=function(Y){u!==null&&(u.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)};let G=null;function K(Y,F){if(c=F.getViewerPose(l||o),d=F,c!==null){let O=c.views;f!==null&&(e.setRenderTargetFramebuffer(g,f.framebuffer),e.setRenderTarget(g));let j=!1;O.length!==T.cameras.length&&(T.cameras.length=0,j=!0);for(let H=0;H<O.length;H++){let X=O[H],V=null;if(f!==null)V=f.getViewport(X);else{let ie=h.getViewSubImage(u,X);V=ie.viewport,H===0&&(e.setRenderTargetTextures(g,ie.colorTexture,u.ignoreDepthValues?void 0:ie.depthStencilTexture),e.setRenderTarget(g))}let he=S[H];he.matrix.fromArray(X.transform.matrix),he.projectionMatrix.fromArray(X.projectionMatrix),he.viewport.set(V.x,V.y,V.width,V.height),H===0&&T.matrix.copy(he.matrix),j===!0&&T.cameras.push(he)}}let U=n.inputSources;for(let O=0;O<v.length;O++){let j=U[O],H=y.get(j);H!==void 0&&H.update(j,F,l||o)}G&&G(Y,F),d=null}let J=new wb;J.setAnimationLoop(K),this.setAnimationLoop=function(Y){G=Y},this.dispose=function(){}}};function BL(i,e){function t(m,g){m.fogColor.value.copy(g.color),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function r(m,g,v,y,w){g.isMeshBasicMaterial||g.isMeshLambertMaterial?n(m,g):g.isMeshToonMaterial?(n(m,g),h(m,g)):g.isMeshPhongMaterial?(n(m,g),c(m,g)):g.isMeshStandardMaterial?(n(m,g),u(m,g),g.isMeshPhysicalMaterial&&f(m,g,w)):g.isMeshMatcapMaterial?(n(m,g),d(m,g)):g.isMeshDepthMaterial?n(m,g):g.isMeshDistanceMaterial?(n(m,g),p(m,g)):g.isMeshNormalMaterial?n(m,g):g.isLineBasicMaterial?(s(m,g),g.isLineDashedMaterial&&o(m,g)):g.isPointsMaterial?a(m,g,v,y):g.isSpriteMaterial?l(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function n(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.bumpMap&&(m.bumpMap.value=g.bumpMap,m.bumpScale.value=g.bumpScale,g.side===Dr&&(m.bumpScale.value*=-1)),g.displacementMap&&(m.displacementMap.value=g.displacementMap,m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap),g.normalMap&&(m.normalMap.value=g.normalMap,m.normalScale.value.copy(g.normalScale),g.side===Dr&&m.normalScale.value.negate()),g.specularMap&&(m.specularMap.value=g.specularMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v=e.get(g).envMap;if(v&&(m.envMap.value=v,m.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;let b=i.physicallyCorrectLights!==!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*b}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity);let y;g.map?y=g.map:g.specularMap?y=g.specularMap:g.displacementMap?y=g.displacementMap:g.normalMap?y=g.normalMap:g.bumpMap?y=g.bumpMap:g.roughnessMap?y=g.roughnessMap:g.metalnessMap?y=g.metalnessMap:g.alphaMap?y=g.alphaMap:g.emissiveMap?y=g.emissiveMap:g.clearcoatMap?y=g.clearcoatMap:g.clearcoatNormalMap?y=g.clearcoatNormalMap:g.clearcoatRoughnessMap?y=g.clearcoatRoughnessMap:g.specularIntensityMap?y=g.specularIntensityMap:g.specularColorMap?y=g.specularColorMap:g.transmissionMap?y=g.transmissionMap:g.thicknessMap?y=g.thicknessMap:g.sheenColorMap?y=g.sheenColorMap:g.sheenRoughnessMap&&(y=g.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),m.uvTransform.value.copy(y.matrix));let w;g.aoMap?w=g.aoMap:g.lightMap&&(w=g.lightMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),m.uv2Transform.value.copy(w.matrix))}function s(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity}function o(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function a(m,g,v,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*v,m.scale.value=y*.5,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let w;g.map?w=g.map:g.alphaMap&&(w=g.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),m.uvTransform.value.copy(w.matrix))}function l(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v;g.map?v=g.map:g.alphaMap&&(v=g.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),m.uvTransform.value.copy(v.matrix))}function c(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function h(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function u(m,g){m.roughness.value=g.roughness,m.metalness.value=g.metalness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap),e.get(g).envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function f(m,g,v){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap)),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),m.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===Dr&&m.clearcoatNormalScale.value.negate())),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap)}function d(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){m.referencePosition.value.copy(g.referencePosition),m.nearDistance.value=g.nearDistance,m.farDistance.value=g.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function NL(){let i=qc("canvas");return i.style.display="block",i}function Dt(i={}){let e=i.canvas!==void 0?i.canvas:NL(),t=i.context!==void 0?i.context:null,r=i.depth!==void 0?i.depth:!0,n=i.stencil!==void 0?i.stencil:!0,s=i.antialias!==void 0?i.antialias:!1,o=i.premultipliedAlpha!==void 0?i.premultipliedAlpha:!0,a=i.preserveDrawingBuffer!==void 0?i.preserveDrawingBuffer:!1,l=i.powerPreference!==void 0?i.powerPreference:"default",c=i.failIfMajorPerformanceCaveat!==void 0?i.failIfMajorPerformanceCaveat:!1,h;t!==null?h=t.getContextAttributes().alpha:h=i.alpha!==void 0?i.alpha:!1;let u=null,f=null,d=[],p=[];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.outputEncoding=gn,this.physicallyCorrectLights=!1,this.toneMapping=rs,this.toneMappingExposure=1;let m=this,g=!1,v=0,y=0,w=null,b=-1,S=null,T=new Je,A=new Je,x=null,_=e.width,E=e.height,C=1,I=null,N=null,R=new Je(0,0,_,E),k=new Je(0,0,_,E),G=!1,K=new Na,J=!1,Y=!1,F=null,U=new Ae,O=new B,j=new M,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function X(){return w===null?C:1}let V=t;function he(D,Q){for(let ne=0;ne<D.length;ne++){let te=D[ne],de=e.getContext(te,Q);if(de!==null)return de}return null}try{let D={alpha:!0,depth:r,stencil:n,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Uo}`),e.addEventListener("webglcontextlost",z,!1),e.addEventListener("webglcontextrestored",Me,!1),V===null){let Q=["webgl2","webgl","experimental-webgl"];if(m.isWebGL1Renderer===!0&&Q.shift(),V=he(Q,D),V===null)throw he(Q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}V.getShaderPrecisionFormat===void 0&&(V.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let ie,le,q,ue,Z,W,$,ce,oe,me,ve,ge,Le,ke,L,P,re,ye,Se,Ie,Fe,fe,rt;function st(){ie=new tD(V),le=new QP(V,ie,i),ie.init(le),fe=new IL(V,ie,le),q=new DL(V,ie,le),ue=new iD(V),Z=new xL,W=new LL(V,ie,q,Z,le,fe,ue),$=new KP(m),ce=new eD(m),oe=new vE(V,le),rt=new YP(V,ie,oe,le),me=new rD(V,oe,ue,rt),ve=new lD(V,me,oe,ue),Se=new aD(V,le,W),P=new JP(Z),ge=new vL(m,$,ce,ie,le,rt,P),Le=new BL(m,Z),ke=new wL,L=new EL(ie,le),ye=new qP(m,$,q,ve,h,o),re=new Cb(m,ve,le),Ie=new XP(V,ie,ue,le),Fe=new nD(V,ie,ue,le),ue.programs=ge.programs,m.capabilities=le,m.extensions=ie,m.properties=Z,m.renderLists=ke,m.shadowMap=re,m.state=q,m.info=ue}st();let Ee=new pg(m,V);this.xr=Ee,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){let D=ie.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){let D=ie.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return C},this.setPixelRatio=function(D){D!==void 0&&(C=D,this.setSize(_,E,!1))},this.getSize=function(D){return D.set(_,E)},this.setSize=function(D,Q,ne){if(Ee.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}_=D,E=Q,e.width=Math.floor(D*C),e.height=Math.floor(Q*C),ne!==!1&&(e.style.width=D+"px",e.style.height=Q+"px"),this.setViewport(0,0,D,Q)},this.getDrawingBufferSize=function(D){return D.set(_*C,E*C).floor()},this.setDrawingBufferSize=function(D,Q,ne){_=D,E=Q,C=ne,e.width=Math.floor(D*ne),e.height=Math.floor(Q*ne),this.setViewport(0,0,D,Q)},this.getCurrentViewport=function(D){return D.copy(T)},this.getViewport=function(D){return D.copy(R)},this.setViewport=function(D,Q,ne,te){D.isVector4?R.set(D.x,D.y,D.z,D.w):R.set(D,Q,ne,te),q.viewport(T.copy(R).multiplyScalar(C).floor())},this.getScissor=function(D){return D.copy(k)},this.setScissor=function(D,Q,ne,te){D.isVector4?k.set(D.x,D.y,D.z,D.w):k.set(D,Q,ne,te),q.scissor(A.copy(k).multiplyScalar(C).floor())},this.getScissorTest=function(){return G},this.setScissorTest=function(D){q.setScissorTest(G=D)},this.setOpaqueSort=function(D){I=D},this.setTransparentSort=function(D){N=D},this.getClearColor=function(D){return D.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(D=!0,Q=!0,ne=!0){let te=0;D&&(te|=16384),Q&&(te|=256),ne&&(te|=1024),V.clear(te)},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",z,!1),e.removeEventListener("webglcontextrestored",Me,!1),ke.dispose(),L.dispose(),Z.dispose(),$.dispose(),ce.dispose(),ve.dispose(),rt.dispose(),ge.dispose(),Ee.dispose(),Ee.removeEventListener("sessionstart",$e),Ee.removeEventListener("sessionend",lt),F&&(F.dispose(),F=null),dt.stop()};function z(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;let D=ue.autoReset,Q=re.enabled,ne=re.autoUpdate,te=re.needsUpdate,de=re.type;st(),ue.autoReset=D,re.enabled=Q,re.autoUpdate=ne,re.needsUpdate=te,re.type=de}function Pe(D){let Q=D.target;Q.removeEventListener("dispose",Pe),Ze(Q)}function Ze(D){Oe(D),Z.remove(D)}function Oe(D){let Q=Z.get(D).programs;Q!==void 0&&(Q.forEach(function(ne){ge.releaseProgram(ne)}),D.isShaderMaterial&&ge.releaseShaderCache(D))}this.renderBufferDirect=function(D,Q,ne,te,de,Ue){Q===null&&(Q=H);let He=de.isMesh&&de.matrixWorld.determinant()<0,nt=pt(D,Q,ne,te,de);q.setMaterial(te,He);let it=ne.index,_t=ne.attributes.position;if(it===null){if(_t===void 0||_t.count===0)return}else if(it.count===0)return;let St=1;te.wireframe===!0&&(it=me.getWireframeAttribute(ne),St=2),rt.setup(de,te,nt,ne,it);let Et,nr=Ie;it!==null&&(Et=oe.get(it),nr=Fe,nr.setIndex(Et));let xo=it!==null?it.count:_t.count,sa=ne.drawRange.start*St,oa=ne.drawRange.count*St,wi=Ue!==null?Ue.start*St:0,Rt=Ue!==null?Ue.count*St:1/0,aa=Math.max(sa,wi),yr=Math.min(xo,sa+oa,wi+Rt)-1,Si=Math.max(0,yr-aa+1);if(Si!==0){if(de.isMesh)te.wireframe===!0?(q.setLineWidth(te.wireframeLinewidth*X()),nr.setMode(1)):nr.setMode(4);else if(de.isLine){let bs=te.linewidth;bs===void 0&&(bs=1),q.setLineWidth(bs*X()),de.isLineSegments?nr.setMode(1):de.isLineLoop?nr.setMode(2):nr.setMode(3)}else de.isPoints?nr.setMode(0):de.isSprite&&nr.setMode(4);if(de.isInstancedMesh)nr.renderInstances(aa,Si,de.count);else if(ne.isInstancedBufferGeometry){let bs=Math.min(ne.instanceCount,ne._maxInstanceCount);nr.renderInstances(aa,Si,bs)}else nr.render(aa,Si)}},this.compile=function(D,Q){f=L.get(D),f.init(),p.push(f),D.traverseVisible(function(ne){ne.isLight&&ne.layers.test(Q.layers)&&(f.pushLight(ne),ne.castShadow&&f.pushShadow(ne))}),f.setupLights(m.physicallyCorrectLights),D.traverse(function(ne){let te=ne.material;if(te)if(Array.isArray(te))for(let de=0;de<te.length;de++){let Ue=te[de];ut(Ue,D,ne)}else ut(te,D,ne)}),p.pop(),f=null};let Qe=null;function _e(D){Qe&&Qe(D)}function $e(){dt.stop()}function lt(){dt.start()}let dt=new wb;dt.setAnimationLoop(_e),typeof self<"u"&&dt.setContext(self),this.setAnimationLoop=function(D){Qe=D,Ee.setAnimationLoop(D),D===null?dt.stop():dt.start()},Ee.addEventListener("sessionstart",$e),Ee.addEventListener("sessionend",lt),this.render=function(D,Q){if(Q!==void 0&&Q.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(g===!0)return;D.autoUpdate===!0&&D.updateMatrixWorld(),Q.parent===null&&Q.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(Q),Q=Ee.getCamera()),D.isScene===!0&&D.onBeforeRender(m,D,Q,w),f=L.get(D,p.length),f.init(),p.push(f),U.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),K.setFromProjectionMatrix(U),Y=this.localClippingEnabled,J=P.init(this.clippingPlanes,Y,Q),u=ke.get(D,d.length),u.init(),d.push(u),Ut(D,Q,0,m.sortObjects),u.finish(),m.sortObjects===!0&&u.sort(I,N),J===!0&&P.beginShadows();let ne=f.state.shadowsArray;if(re.render(ne,D,Q),J===!0&&P.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(u,D),f.setupLights(m.physicallyCorrectLights),Q.isArrayCamera){let te=Q.cameras;for(let de=0,Ue=te.length;de<Ue;de++){let He=te[de];Ur(u,D,He,He.viewport)}}else Ur(u,D,Q);w!==null&&(W.updateMultisampleRenderTarget(w),W.updateRenderTargetMipmap(w)),D.isScene===!0&&D.onAfterRender(m,D,Q),rt.resetDefaultState(),b=-1,S=null,p.pop(),p.length>0?f=p[p.length-1]:f=null,d.pop(),d.length>0?u=d[d.length-1]:u=null};function Ut(D,Q,ne,te){if(D.visible===!1)return;if(D.layers.test(Q.layers)){if(D.isGroup)ne=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(Q);else if(D.isLight)f.pushLight(D),D.castShadow&&f.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||K.intersectsSprite(D)){te&&j.setFromMatrixPosition(D.matrixWorld).applyMatrix4(U);let He=ve.update(D),nt=D.material;nt.visible&&u.push(D,He,nt,ne,j.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(D.isSkinnedMesh&&D.skeleton.frame!==ue.render.frame&&(D.skeleton.update(),D.skeleton.frame=ue.render.frame),!D.frustumCulled||K.intersectsObject(D))){te&&j.setFromMatrixPosition(D.matrixWorld).applyMatrix4(U);let He=ve.update(D),nt=D.material;if(Array.isArray(nt)){let it=He.groups;for(let _t=0,St=it.length;_t<St;_t++){let Et=it[_t],nr=nt[Et.materialIndex];nr&&nr.visible&&u.push(D,He,nr,ne,j.z,Et)}}else nt.visible&&u.push(D,He,nt,ne,j.z,null)}}let Ue=D.children;for(let He=0,nt=Ue.length;He<nt;He++)Ut(Ue[He],Q,ne,te)}function Ur(D,Q,ne,te){let de=D.opaque,Ue=D.transmissive,He=D.transparent;f.setupLightsView(ne),Ue.length>0&&ia(de,Q,ne),te&&q.viewport(T.copy(te)),de.length>0&&Nn(de,Q,ne),Ue.length>0&&Nn(Ue,Q,ne),He.length>0&&Nn(He,Q,ne),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function ia(D,Q,ne){let te=le.isWebGL2;F===null&&(F=new mt(1,1,{generateMipmaps:!0,type:ie.has("EXT_color_buffer_half_float")?Hc:qt,minFilter:js,samples:te&&s===!0?4:0})),m.getDrawingBufferSize(O),te?F.setSize(O.x,O.y):F.setSize(pf(O.x),pf(O.y));let de=m.getRenderTarget();m.setRenderTarget(F),m.clear();let Ue=m.toneMapping;m.toneMapping=rs,Nn(D,Q,ne),m.toneMapping=Ue,W.updateMultisampleRenderTarget(F),W.updateRenderTargetMipmap(F),m.setRenderTarget(de)}function Nn(D,Q,ne){let te=Q.isScene===!0?Q.overrideMaterial:null;for(let de=0,Ue=D.length;de<Ue;de++){let He=D[de],nt=He.object,it=He.geometry,_t=te===null?He.material:te,St=He.group;nt.layers.test(ne.layers)&&at(nt,Q,ne,it,_t,St)}}function at(D,Q,ne,te,de,Ue){D.onBeforeRender(m,Q,ne,te,de,Ue),D.modelViewMatrix.multiplyMatrices(ne.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),de.onBeforeRender(m,Q,ne,te,D,Ue),de.transparent===!0&&de.side===or?(de.side=Dr,de.needsUpdate=!0,m.renderBufferDirect(ne,Q,te,de,D,Ue),de.side=si,de.needsUpdate=!0,m.renderBufferDirect(ne,Q,te,de,D,Ue),de.side=or):m.renderBufferDirect(ne,Q,te,de,D,Ue),D.onAfterRender(m,Q,ne,te,de,Ue)}function ut(D,Q,ne){Q.isScene!==!0&&(Q=H);let te=Z.get(D),de=f.state.lights,Ue=f.state.shadowsArray,He=de.state.version,nt=ge.getParameters(D,de.state,Ue,Q,ne),it=ge.getProgramCacheKey(nt),_t=te.programs;te.environment=D.isMeshStandardMaterial?Q.environment:null,te.fog=Q.fog,te.envMap=(D.isMeshStandardMaterial?ce:$).get(D.envMap||te.environment),_t===void 0&&(D.addEventListener("dispose",Pe),_t=new Map,te.programs=_t);let St=_t.get(it);if(St!==void 0){if(te.currentProgram===St&&te.lightsStateVersion===He)return ft(D,nt),St}else nt.uniforms=ge.getUniforms(D),D.onBuild(ne,nt,m),D.onBeforeCompile(nt,m),St=ge.acquireProgram(nt,it),_t.set(it,St),te.uniforms=nt.uniforms;let Et=te.uniforms;(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(Et.clippingPlanes=P.uniform),ft(D,nt),te.needsLights=It(D),te.lightsStateVersion=He,te.needsLights&&(Et.ambientLightColor.value=de.state.ambient,Et.lightProbe.value=de.state.probe,Et.directionalLights.value=de.state.directional,Et.directionalLightShadows.value=de.state.directionalShadow,Et.spotLights.value=de.state.spot,Et.spotLightShadows.value=de.state.spotShadow,Et.rectAreaLights.value=de.state.rectArea,Et.ltc_1.value=de.state.rectAreaLTC1,Et.ltc_2.value=de.state.rectAreaLTC2,Et.pointLights.value=de.state.point,Et.pointLightShadows.value=de.state.pointShadow,Et.hemisphereLights.value=de.state.hemi,Et.directionalShadowMap.value=de.state.directionalShadowMap,Et.directionalShadowMatrix.value=de.state.directionalShadowMatrix,Et.spotShadowMap.value=de.state.spotShadowMap,Et.spotShadowMatrix.value=de.state.spotShadowMatrix,Et.pointShadowMap.value=de.state.pointShadowMap,Et.pointShadowMatrix.value=de.state.pointShadowMatrix);let nr=St.getUniforms(),xo=Is.seqWithValue(nr.seq,Et);return te.currentProgram=St,te.uniformsList=xo,St}function ft(D,Q){let ne=Z.get(D);ne.outputEncoding=Q.outputEncoding,ne.instancing=Q.instancing,ne.skinning=Q.skinning,ne.morphTargets=Q.morphTargets,ne.morphNormals=Q.morphNormals,ne.morphColors=Q.morphColors,ne.morphTargetsCount=Q.morphTargetsCount,ne.numClippingPlanes=Q.numClippingPlanes,ne.numIntersection=Q.numClipIntersection,ne.vertexAlphas=Q.vertexAlphas,ne.vertexTangents=Q.vertexTangents,ne.toneMapping=Q.toneMapping}function pt(D,Q,ne,te,de){Q.isScene!==!0&&(Q=H),W.resetTextureUnits();let Ue=Q.fog,He=te.isMeshStandardMaterial?Q.environment:null,nt=w===null?m.outputEncoding:w.isXRRenderTarget===!0?w.texture.encoding:gn,it=(te.isMeshStandardMaterial?ce:$).get(te.envMap||He),_t=te.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,St=!!te.normalMap&&!!ne.attributes.tangent,Et=!!ne.morphAttributes.position,nr=!!ne.morphAttributes.normal,xo=!!ne.morphAttributes.color,sa=te.toneMapped?m.toneMapping:rs,oa=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,wi=oa!==void 0?oa.length:0,Rt=Z.get(te),aa=f.state.lights;if(J===!0&&(Y===!0||D!==S)){let Mi=D===S&&te.id===b;P.setState(te,D,Mi)}let yr=!1;te.version===Rt.__version?(Rt.needsLights&&Rt.lightsStateVersion!==aa.state.version||Rt.outputEncoding!==nt||de.isInstancedMesh&&Rt.instancing===!1||!de.isInstancedMesh&&Rt.instancing===!0||de.isSkinnedMesh&&Rt.skinning===!1||!de.isSkinnedMesh&&Rt.skinning===!0||Rt.envMap!==it||te.fog===!0&&Rt.fog!==Ue||Rt.numClippingPlanes!==void 0&&(Rt.numClippingPlanes!==P.numPlanes||Rt.numIntersection!==P.numIntersection)||Rt.vertexAlphas!==_t||Rt.vertexTangents!==St||Rt.morphTargets!==Et||Rt.morphNormals!==nr||Rt.morphColors!==xo||Rt.toneMapping!==sa||le.isWebGL2===!0&&Rt.morphTargetsCount!==wi)&&(yr=!0):(yr=!0,Rt.__version=te.version);let Si=Rt.currentProgram;yr===!0&&(Si=ut(te,Q,de));let bs=!1,Tc=!1,pm=!1,en=Si.getUniforms(),_c=Rt.uniforms;if(q.useProgram(Si.program)&&(bs=!0,Tc=!0,pm=!0),te.id!==b&&(b=te.id,Tc=!0),bs||S!==D){if(en.setValue(V,"projectionMatrix",D.projectionMatrix),le.logarithmicDepthBuffer&&en.setValue(V,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),S!==D&&(S=D,Tc=!0,pm=!0),te.isShaderMaterial||te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshStandardMaterial||te.envMap){let Mi=en.map.cameraPosition;Mi!==void 0&&Mi.setValue(V,j.setFromMatrixPosition(D.matrixWorld))}(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&en.setValue(V,"isOrthographic",D.isOrthographicCamera===!0),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial||te.isShadowMaterial||de.isSkinnedMesh)&&en.setValue(V,"viewMatrix",D.matrixWorldInverse)}if(de.isSkinnedMesh){en.setOptional(V,de,"bindMatrix"),en.setOptional(V,de,"bindMatrixInverse");let Mi=de.skeleton;Mi&&(le.floatVertexTextures?(Mi.boneTexture===null&&Mi.computeBoneTexture(),en.setValue(V,"boneTexture",Mi.boneTexture,W),en.setValue(V,"boneTextureSize",Mi.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let mm=ne.morphAttributes;return(mm.position!==void 0||mm.normal!==void 0||mm.color!==void 0&&le.isWebGL2===!0)&&Se.update(de,ne,te,Si),(Tc||Rt.receiveShadow!==de.receiveShadow)&&(Rt.receiveShadow=de.receiveShadow,en.setValue(V,"receiveShadow",de.receiveShadow)),Tc&&(en.setValue(V,"toneMappingExposure",m.toneMappingExposure),Rt.needsLights&&xt(_c,pm),Ue&&te.fog===!0&&Le.refreshFogUniforms(_c,Ue),Le.refreshMaterialUniforms(_c,te,C,E,F),Is.upload(V,Rt.uniformsList,_c,W)),te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Is.upload(V,Rt.uniformsList,_c,W),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&en.setValue(V,"center",de.center),en.setValue(V,"modelViewMatrix",de.modelViewMatrix),en.setValue(V,"normalMatrix",de.normalMatrix),en.setValue(V,"modelMatrix",de.matrixWorld),Si}function xt(D,Q){D.ambientLightColor.needsUpdate=Q,D.lightProbe.needsUpdate=Q,D.directionalLights.needsUpdate=Q,D.directionalLightShadows.needsUpdate=Q,D.pointLights.needsUpdate=Q,D.pointLightShadows.needsUpdate=Q,D.spotLights.needsUpdate=Q,D.spotLightShadows.needsUpdate=Q,D.rectAreaLights.needsUpdate=Q,D.hemisphereLights.needsUpdate=Q}function It(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(D,Q,ne){Z.get(D.texture).__webglTexture=Q,Z.get(D.depthTexture).__webglTexture=ne;let te=Z.get(D);te.__hasExternalTextures=!0,te.__hasExternalTextures&&(te.__autoAllocateDepthBuffer=ne===void 0,te.__autoAllocateDepthBuffer||ie.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),te.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(D,Q){let ne=Z.get(D);ne.__webglFramebuffer=Q,ne.__useDefaultFramebuffer=Q===void 0},this.setRenderTarget=function(D,Q=0,ne=0){w=D,v=Q,y=ne;let te=!0;if(D){let it=Z.get(D);it.__useDefaultFramebuffer!==void 0?(q.bindFramebuffer(36160,null),te=!1):it.__webglFramebuffer===void 0?W.setupRenderTarget(D):it.__hasExternalTextures&&W.rebindTextures(D,Z.get(D.texture).__webglTexture,Z.get(D.depthTexture).__webglTexture)}let de=null,Ue=!1,He=!1;if(D){let it=D.texture;(it.isData3DTexture||it.isDataArrayTexture)&&(He=!0);let _t=Z.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(de=_t[Q],Ue=!0):le.isWebGL2&&D.samples>0&&W.useMultisampledRTT(D)===!1?de=Z.get(D).__webglMultisampledFramebuffer:de=_t,T.copy(D.viewport),A.copy(D.scissor),x=D.scissorTest}else T.copy(R).multiplyScalar(C).floor(),A.copy(k).multiplyScalar(C).floor(),x=G;if(q.bindFramebuffer(36160,de)&&le.drawBuffers&&te&&q.drawBuffers(D,de),q.viewport(T),q.scissor(A),q.setScissorTest(x),Ue){let it=Z.get(D.texture);V.framebufferTexture2D(36160,36064,34069+Q,it.__webglTexture,ne)}else if(He){let it=Z.get(D.texture),_t=Q||0;V.framebufferTextureLayer(36160,36064,it.__webglTexture,ne||0,_t)}b=-1},this.readRenderTargetPixels=function(D,Q,ne,te,de,Ue,He){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nt=Z.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&He!==void 0&&(nt=nt[He]),nt){q.bindFramebuffer(36160,nt);try{let it=D.texture,_t=it.format,St=it.type;if(_t!==Fn&&fe.convert(_t)!==V.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Et=St===Hc&&(ie.has("EXT_color_buffer_half_float")||le.isWebGL2&&ie.has("EXT_color_buffer_float"));if(St!==qt&&fe.convert(St)!==V.getParameter(35738)&&!(St===Ps&&(le.isWebGL2||ie.has("OES_texture_float")||ie.has("WEBGL_color_buffer_float")))&&!Et){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Q>=0&&Q<=D.width-te&&ne>=0&&ne<=D.height-de&&V.readPixels(Q,ne,te,de,fe.convert(_t),fe.convert(St),Ue)}finally{let it=w!==null?Z.get(w).__webglFramebuffer:null;q.bindFramebuffer(36160,it)}}},this.copyFramebufferToTexture=function(D,Q,ne=0){if(Q.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let te=Math.pow(2,-ne),de=Math.floor(Q.image.width*te),Ue=Math.floor(Q.image.height*te);W.setTexture2D(Q,0),V.copyTexSubImage2D(3553,ne,0,0,D.x,D.y,de,Ue),q.unbindTexture()},this.copyTextureToTexture=function(D,Q,ne,te=0){let de=Q.image.width,Ue=Q.image.height,He=fe.convert(ne.format),nt=fe.convert(ne.type);W.setTexture2D(ne,0),V.pixelStorei(37440,ne.flipY),V.pixelStorei(37441,ne.premultiplyAlpha),V.pixelStorei(3317,ne.unpackAlignment),Q.isDataTexture?V.texSubImage2D(3553,te,D.x,D.y,de,Ue,He,nt,Q.image.data):Q.isCompressedTexture?V.compressedTexSubImage2D(3553,te,D.x,D.y,Q.mipmaps[0].width,Q.mipmaps[0].height,He,Q.mipmaps[0].data):V.texSubImage2D(3553,te,D.x,D.y,He,nt,Q.image),te===0&&ne.generateMipmaps&&V.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(D,Q,ne,te,de=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Ue=D.max.x-D.min.x+1,He=D.max.y-D.min.y+1,nt=D.max.z-D.min.z+1,it=fe.convert(te.format),_t=fe.convert(te.type),St;if(te.isData3DTexture)W.setTexture3D(te,0),St=32879;else if(te.isDataArrayTexture)W.setTexture2DArray(te,0),St=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,te.flipY),V.pixelStorei(37441,te.premultiplyAlpha),V.pixelStorei(3317,te.unpackAlignment);let Et=V.getParameter(3314),nr=V.getParameter(32878),xo=V.getParameter(3316),sa=V.getParameter(3315),oa=V.getParameter(32877),wi=ne.isCompressedTexture?ne.mipmaps[0]:ne.image;V.pixelStorei(3314,wi.width),V.pixelStorei(32878,wi.height),V.pixelStorei(3316,D.min.x),V.pixelStorei(3315,D.min.y),V.pixelStorei(32877,D.min.z),ne.isDataTexture||ne.isData3DTexture?V.texSubImage3D(St,de,Q.x,Q.y,Q.z,Ue,He,nt,it,_t,wi.data):ne.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(St,de,Q.x,Q.y,Q.z,Ue,He,nt,it,wi.data)):V.texSubImage3D(St,de,Q.x,Q.y,Q.z,Ue,He,nt,it,_t,wi),V.pixelStorei(3314,Et),V.pixelStorei(32878,nr),V.pixelStorei(3316,xo),V.pixelStorei(3315,sa),V.pixelStorei(32877,oa),de===0&&te.generateMipmaps&&V.generateMipmap(St),q.unbindTexture()},this.initTexture=function(D){W.setTexture2D(D,0),q.unbindTexture()},this.resetState=function(){v=0,y=0,w=null,q.reset(),rt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Dt.prototype.isWebGLRenderer=!0;var mg=class extends Dt{};mg.prototype.isWebGL1Renderer=!0;var Zc=class{constructor(e,t=25e-5){this.name="",this.color=new be(e),this.density=t}clone(){return new Zc(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};Zc.prototype.isFogExp2=!0;var Po=class{constructor(e,t=1,r=1e3){this.name="",this.color=new be(e),this.near=t,this.far=r}clone(){return new Po(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};Po.prototype.isFog=!0;var on=class extends ot{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){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};on.prototype.isScene=!0;var ss=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Wc,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Un()}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,r){e*=this.stride,r*=t.stride;for(let n=0,s=this.stride;n<s;n++)this.array[e+n]=t.array[r+n];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=Un()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}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=Un()),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}}};ss.prototype.isInterleavedBuffer=!0;var tn=new M,Ei=class{constructor(e,t,r,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=n===!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,r=this.data.count;t<r;t++)tn.fromBufferAttribute(this,t),tn.applyMatrix4(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)tn.fromBufferAttribute(this,t),tn.applyNormalMatrix(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)tn.fromBufferAttribute(this,t),tn.transformDirection(e),this.setXYZ(t,tn.x,tn.y,tn.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,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this}setXYZW(e,t,r,n,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,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.");let t=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[n+s])}return new Ve(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 Ei(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.");let t=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[n+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}}};Ei.prototype.isInterleavedBufferAttribute=!0;var $c=class extends ur{constructor(e){super(),this.type="SpriteMaterial",this.color=new be(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!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.fog=e.fog,this}};$c.prototype.isSpriteMaterial=!0;var Sa,Dc=new M,Ma=new M,Aa=new M,Ta=new B,Lc=new B,Pb=new Ae,Yu=new M,Ic=new M,Xu=new M,O0=new B,Xm=new B,F0=new B,gg=class extends ot{constructor(e){if(super(),this.type="Sprite",Sa===void 0){Sa=new De;let t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new ss(t,5);Sa.setIndex([0,1,2,0,2,3]),Sa.setAttribute("position",new Ei(r,3,0,!1)),Sa.setAttribute("uv",new Ei(r,2,3,!1))}this.geometry=Sa,this.material=e!==void 0?e:new $c,this.center=new B(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ma.setFromMatrixScale(this.matrixWorld),Pb.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Aa.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ma.multiplyScalar(-Aa.z);let r=this.material.rotation,n,s;r!==0&&(s=Math.cos(r),n=Math.sin(r));let o=this.center;Qu(Yu.set(-.5,-.5,0),Aa,o,Ma,n,s),Qu(Ic.set(.5,-.5,0),Aa,o,Ma,n,s),Qu(Xu.set(.5,.5,0),Aa,o,Ma,n,s),O0.set(0,0),Xm.set(1,0),F0.set(1,1);let a=e.ray.intersectTriangle(Yu,Ic,Xu,!1,Dc);if(a===null&&(Qu(Ic.set(-.5,.5,0),Aa,o,Ma,n,s),Xm.set(0,1),a=e.ray.intersectTriangle(Yu,Xu,Ic,!1,Dc),a===null))return;let l=e.ray.origin.distanceTo(Dc);l<e.near||l>e.far||t.push({distance:l,point:Dc.clone(),uv:Jt.getUV(Dc,Yu,Ic,Xu,O0,Xm,F0,new B),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};gg.prototype.isSprite=!0;function Qu(i,e,t,r,n,s){Ta.subVectors(i,t).addScalar(.5).multiply(r),n!==void 0?(Lc.x=s*Ta.x-n*Ta.y,Lc.y=n*Ta.x+s*Ta.y):Lc.copy(Ta),i.copy(e),i.x+=Lc.x,i.y+=Lc.y,i.applyMatrix4(Pb)}var U0=new M,z0=new Je,G0=new Je,OL=new M,k0=new Ae,bf=class extends Vt{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ae,this.bindMatrixInverse=new Ae}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(){let e=new Je,t=this.geometry.attributes.skinWeight;for(let r=0,n=t.count;r<n;r++){e.fromBufferAttribute(t,r);let s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(r,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){let r=this.skeleton,n=this.geometry;z0.fromBufferAttribute(n.attributes.skinIndex,e),G0.fromBufferAttribute(n.attributes.skinWeight,e),U0.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){let o=G0.getComponent(s);if(o!==0){let a=z0.getComponent(s);k0.multiplyMatrices(r.bones[a].matrixWorld,r.boneInverses[a]),t.addScaledVector(OL.copy(U0).applyMatrix4(k0),o)}}return t.applyMatrix4(this.bindMatrixInverse)}};bf.prototype.isSkinnedMesh=!0;var yg=class extends ot{constructor(){super(),this.type="Bone"}};yg.prototype.isBone=!0;var wf=class extends Pt{constructor(e=null,t=1,r=1,n,s,o,a,l,c=hr,h=hr,u,f){super(null,o,a,l,c,h,n,s,u,f),this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};wf.prototype.isDataTexture=!0;var Oa=class extends Ve{constructor(e,t,r,n=1){typeof r=="number"&&(n=r,r=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,r),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}};Oa.prototype.isInstancedBufferAttribute=!0;var V0=new Ae,H0=new Ae,Ju=[],Rc=new Vt,vg=class extends Vt{constructor(e,t,r){super(e,t),this.instanceMatrix=new Oa(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,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){let r=this.matrixWorld,n=this.count;if(Rc.geometry=this.geometry,Rc.material=this.material,Rc.material!==void 0)for(let s=0;s<n;s++){this.getMatrixAt(s,V0),H0.multiplyMatrices(r,V0),Rc.matrixWorld=H0,Rc.raycast(e,Ju);for(let o=0,a=Ju.length;o<a;o++){let l=Ju[o];l.instanceId=s,l.object=this,t.push(l)}Ju.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Oa(new Float32Array(this.instanceMatrix.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"})}};vg.prototype.isInstancedMesh=!0;var kr=class extends ur{constructor(e){super(),this.type="LineBasicMaterial",this.color=new be(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,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.fog=e.fog,this}};kr.prototype.isLineBasicMaterial=!0;var W0=new M,j0=new M,q0=new Ae,Qm=new oi,Ku=new Lr,os=class extends ot{constructor(e=new De,t=new kr){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(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,r=[0];for(let n=1,s=t.count;n<s;n++)W0.fromBufferAttribute(t,n-1),j0.fromBufferAttribute(t,n),r[n]=r[n-1],r[n]+=W0.distanceTo(j0);e.setAttribute("lineDistance",new Te(r,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){let r=this.geometry,n=this.matrixWorld,s=e.params.Line.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Ku.copy(r.boundingSphere),Ku.applyMatrix4(n),Ku.radius+=s,e.ray.intersectsSphere(Ku)===!1)return;q0.copy(n).invert(),Qm.copy(e.ray).applyMatrix4(q0);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=new M,h=new M,u=new M,f=new M,d=this.isLineSegments?2:1;if(r.isBufferGeometry){let p=r.index,g=r.attributes.position;if(p!==null){let v=Math.max(0,o.start),y=Math.min(p.count,o.start+o.count);for(let w=v,b=y-1;w<b;w+=d){let S=p.getX(w),T=p.getX(w+1);if(c.fromBufferAttribute(g,S),h.fromBufferAttribute(g,T),Qm.distanceSqToSegment(c,h,f,u)>l)continue;f.applyMatrix4(this.matrixWorld);let x=e.ray.origin.distanceTo(f);x<e.near||x>e.far||t.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{let v=Math.max(0,o.start),y=Math.min(g.count,o.start+o.count);for(let w=v,b=y-1;w<b;w+=d){if(c.fromBufferAttribute(g,w),h.fromBufferAttribute(g,w+1),Qm.distanceSqToSegment(c,h,f,u)>l)continue;f.applyMatrix4(this.matrixWorld);let T=e.ray.origin.distanceTo(f);T<e.near||T>e.far||t.push({distance:T,point:u.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,r=Object.keys(t);if(r.length>0){let n=t[r[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s<o;s++){let a=n[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{let t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};os.prototype.isLine=!0;var Y0=new M,X0=new M,li=class extends os{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,r=[];for(let n=0,s=t.count;n<s;n+=2)Y0.fromBufferAttribute(t,n),X0.fromBufferAttribute(t,n+1),r[n]=n===0?0:r[n-1],r[n+1]=r[n]+Y0.distanceTo(X0);e.setAttribute("lineDistance",new Te(r,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}};li.prototype.isLineSegments=!0;var xg=class extends os{constructor(e,t){super(e,t),this.type="LineLoop"}};xg.prototype.isLineLoop=!0;var eh=class extends ur{constructor(e){super(),this.type="PointsMaterial",this.color=new be(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,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.fog=e.fog,this}};eh.prototype.isPointsMaterial=!0;var Q0=new Ae,bg=new oi,Zu=new Lr,$u=new M,wg=class extends ot{constructor(e=new De,t=new eh){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){let r=this.geometry,n=this.matrixWorld,s=e.params.Points.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Zu.copy(r.boundingSphere),Zu.applyMatrix4(n),Zu.radius+=s,e.ray.intersectsSphere(Zu)===!1)return;Q0.copy(n).invert(),bg.copy(e.ray).applyMatrix4(Q0);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(r.isBufferGeometry){let c=r.index,u=r.attributes.position;if(c!==null){let f=Math.max(0,o.start),d=Math.min(c.count,o.start+o.count);for(let p=f,m=d;p<m;p++){let g=c.getX(p);$u.fromBufferAttribute(u,g),J0($u,g,l,n,e,t,this)}}else{let f=Math.max(0,o.start),d=Math.min(u.count,o.start+o.count);for(let p=f,m=d;p<m;p++)$u.fromBufferAttribute(u,p),J0($u,p,l,n,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,r=Object.keys(t);if(r.length>0){let n=t[r[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s<o;s++){let a=n[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{let t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};wg.prototype.isPoints=!0;function J0(i,e,t,r,n,s,o){let a=bg.distanceSqToPoint(i);if(a<t){let l=new M;bg.closestPointToPoint(i,l),l.applyMatrix4(r);let c=n.ray.origin.distanceTo(l);if(c<n.near||c>n.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var th=class extends Pt{constructor(e,t,r,n,s,o,a,l,c){super(e,t,r,n,s,o,a,l,c),this.minFilter=o!==void 0?o:ct,this.magFilter=s!==void 0?s:ct,this.generateMipmaps=!1;let h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};th.prototype.isVideoTexture=!0;var Sg=class extends Pt{constructor(e,t,r){super({width:e,height:t}),this.format=r,this.magFilter=hr,this.minFilter=hr,this.generateMipmaps=!1,this.needsUpdate=!0}};Sg.prototype.isFramebufferTexture=!0;var Mg=class extends Pt{constructor(e,t,r,n,s,o,a,l,c,h,u,f){super(null,o,a,l,c,h,n,s,u,f),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};Mg.prototype.isCompressedTexture=!0;var Ag=class extends Pt{constructor(e,t,r,n,s,o,a,l,c){super(e,t,r,n,s,o,a,l,c),this.needsUpdate=!0}};Ag.prototype.isCanvasTexture=!0;var xn=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){let 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;let t=[],r,n=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(n),t.push(s),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let r=this.getLengths(),n=0,s=r.length,o;t?o=t:o=e*r[s-1];let a=0,l=s-1,c;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),c=r[n]-o,c<0)a=n+1;else if(c>0)l=n-1;else{l=n;break}if(n=l,r[n]===o)return n/(s-1);let h=r[n],f=r[n+1]-h,d=(o-h)/f;return(n+d)/(s-1)}getTangent(e,t){let n=e-1e-4,s=e+1e-4;n<0&&(n=0),s>1&&(s=1);let o=this.getPoint(n),a=this.getPoint(s),l=t||(o.isVector2?new B:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){let r=new M,n=[],s=[],o=[],a=new M,l=new Ae;for(let d=0;d<=e;d++){let p=d/e;n[d]=this.getTangentAt(p,new M)}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,h=Math.abs(n[0].x),u=Math.abs(n[0].y),f=Math.abs(n[0].z);h<=c&&(c=h,r.set(1,0,0)),u<=c&&(c=u,r.set(0,1,0)),f<=c&&r.set(0,0,1),a.crossVectors(n[0],r).normalize(),s[0].crossVectors(n[0],a),o[0].crossVectors(n[0],s[0]);for(let d=1;d<=e;d++){if(s[d]=s[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(n[d-1],n[d]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(xr(n[d-1].dot(n[d]),-1,1));s[d].applyMatrix4(l.makeRotationAxis(a,p))}o[d].crossVectors(n[d],s[d])}if(t===!0){let d=Math.acos(xr(s[0].dot(s[e]),-1,1));d/=e,n[0].dot(a.crossVectors(s[0],s[e]))>0&&(d=-d);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(n[p],d*p)),o[p].crossVectors(n[p],s[p])}return{tangents:n,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let 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}},Us=class extends xn{constructor(e=0,t=0,r=1,n=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let r=t||new B,n=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=n;for(;s>n;)s-=n;s<Number.EPSILON&&(o?s=0:s=n),this.aClockwise===!0&&!o&&(s===n?s=-n:s=s-n);let a=this.aStartAngle+e*s,l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){let h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),f=l-this.aX,d=c-this.aY;l=f*h-d*u+this.aX,c=f*u+d*h+this.aY}return r.set(l,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(){let 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}};Us.prototype.isEllipseCurve=!0;var Sf=class extends Us{constructor(e,t,r,n,s,o){super(e,t,r,r,n,s,o),this.type="ArcCurve"}};Sf.prototype.isArcCurve=!0;function ry(){let i=0,e=0,t=0,r=0;function n(s,o,a,l){i=s,e=a,t=-3*s+3*o-2*a-l,r=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,c){n(o,a,c*(a-s),c*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,c,h,u){let f=(o-s)/c-(a-s)/(c+h)+(a-o)/h,d=(a-o)/h-(l-o)/(h+u)+(l-a)/u;f*=h,d*=h,n(o,a,f,d)},calc:function(s){let o=s*s,a=o*s;return i+e*s+t*o+r*a}}}var ef=new M,Jm=new ry,Km=new ry,Zm=new ry,Mf=class extends xn{constructor(e=[],t=!1,r="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=n}getPoint(e,t=new M){let r=t,n=this.points,s=n.length,o=(s-(this.closed?0:1))*e,a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,h;this.closed||a>0?c=n[(a-1)%s]:(ef.subVectors(n[0],n[1]).add(n[0]),c=ef);let u=n[a%s],f=n[(a+1)%s];if(this.closed||a+2<s?h=n[(a+2)%s]:(ef.subVectors(n[s-1],n[s-2]).add(n[s-1]),h=ef),this.curveType==="centripetal"||this.curveType==="chordal"){let d=this.curveType==="chordal"?.5:.25,p=Math.pow(c.distanceToSquared(u),d),m=Math.pow(u.distanceToSquared(f),d),g=Math.pow(f.distanceToSquared(h),d);m<1e-4&&(m=1),p<1e-4&&(p=m),g<1e-4&&(g=m),Jm.initNonuniformCatmullRom(c.x,u.x,f.x,h.x,p,m,g),Km.initNonuniformCatmullRom(c.y,u.y,f.y,h.y,p,m,g),Zm.initNonuniformCatmullRom(c.z,u.z,f.z,h.z,p,m,g)}else this.curveType==="catmullrom"&&(Jm.initCatmullRom(c.x,u.x,f.x,h.x,this.tension),Km.initCatmullRom(c.y,u.y,f.y,h.y,this.tension),Zm.initCatmullRom(c.z,u.z,f.z,h.z,this.tension));return r.set(Jm.calc(l),Km.calc(l),Zm.calc(l)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){let n=this.points[t];e.points.push(n.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,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(new M().fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};Mf.prototype.isCatmullRomCurve3=!0;function K0(i,e,t,r,n){let s=(r-e)*.5,o=(n-t)*.5,a=i*i,l=i*a;return(2*t-2*r+s+o)*l+(-3*t+3*r-2*s-o)*a+s*i+t}function FL(i,e){let t=1-i;return t*t*e}function UL(i,e){return 2*(1-i)*i*e}function zL(i,e){return i*i*e}function Gc(i,e,t,r){return FL(i,e)+UL(i,t)+zL(i,r)}function GL(i,e){let t=1-i;return t*t*t*e}function kL(i,e){let t=1-i;return 3*t*t*i*e}function VL(i,e){return 3*(1-i)*i*i*e}function HL(i,e){return i*i*i*e}function kc(i,e,t,r,n){return GL(i,e)+kL(i,t)+VL(i,r)+HL(i,n)}var an=class extends xn{constructor(e=new B,t=new B,r=new B,n=new B){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new B){let r=t,n=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(kc(e,n.x,s.x,o.x,a.x),kc(e,n.y,s.y,o.y,a.y)),r}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(){let 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}};an.prototype.isCubicBezierCurve=!0;var Af=class extends xn{constructor(e=new M,t=new M,r=new M,n=new M){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new M){let r=t,n=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(kc(e,n.x,s.x,o.x,a.x),kc(e,n.y,s.y,o.y,a.y),kc(e,n.z,s.z,o.z,a.z)),r}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(){let 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}};Af.prototype.isCubicBezierCurve3=!0;var ln=class extends xn{constructor(e=new B,t=new B){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new B){let r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){let r=t||new B;return r.copy(this.v2).sub(this.v1).normalize(),r}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let 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}};ln.prototype.isLineCurve=!0;var rh=class extends xn{constructor(e=new M,t=new M){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new M){let r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}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(){let 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}},kn=class extends xn{constructor(e=new B,t=new B,r=new B){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new B){let r=t,n=this.v0,s=this.v1,o=this.v2;return r.set(Gc(e,n.x,s.x,o.x),Gc(e,n.y,s.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let 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}};kn.prototype.isQuadraticBezierCurve=!0;var Tf=class extends xn{constructor(e=new M,t=new M,r=new M){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new M){let r=t,n=this.v0,s=this.v1,o=this.v2;return r.set(Gc(e,n.x,s.x,o.x),Gc(e,n.y,s.y,o.y),Gc(e,n.z,s.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let 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}};Tf.prototype.isQuadraticBezierCurve3=!0;var Do=class extends xn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new B){let r=t,n=this.points,s=(n.length-1)*e,o=Math.floor(s),a=s-o,l=n[o===0?o:o-1],c=n[o],h=n[o>n.length-2?n.length-1:o+1],u=n[o>n.length-3?n.length-1:o+2];return r.set(K0(a,l.x,c.x,h.x,u.x),K0(a,l.y,c.y,h.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(new B().fromArray(n))}return this}};Do.prototype.isSplineCurve=!0;var Db=Object.freeze({__proto__:null,ArcCurve:Sf,CatmullRomCurve3:Mf,CubicBezierCurve:an,CubicBezierCurve3:Af,EllipseCurve:Us,LineCurve:ln,LineCurve3:rh,QuadraticBezierCurve:kn,QuadraticBezierCurve3:Tf,SplineCurve:Do}),Tg=class extends xn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ln(t,e))}getPoint(e,t){let r=e*this.getLength(),n=this.getCurveLengths(),s=0;for(;s<n.length;){if(n[s]>=r){let o=n[s]-r,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){let 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;let e=[],t=0;for(let r=0,n=this.curves.length;r<n;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t=[],r;for(let n=0,s=this.curves;n<s.length;n++){let o=s[n],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){let h=l[c];r&&r.equals(h)||(t.push(h),r=h)}}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,r=e.curves.length;t<r;t++){let n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){let n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){let n=e.curves[t];this.curves.push(new Db[n.type]().fromJSON(n))}return this}},Fa=class extends Tg{constructor(e){super(),this.type="Path",this.currentPoint=new B,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let r=new ln(this.currentPoint.clone(),new B(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,n){let s=new kn(this.currentPoint.clone(),new B(e,t),new B(r,n));return this.curves.push(s),this.currentPoint.set(r,n),this}bezierCurveTo(e,t,r,n,s,o){let a=new an(this.currentPoint.clone(),new B(e,t),new B(r,n),new B(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),r=new Do(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,n,s,o){let a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,r,n,s,o),this}absarc(e,t,r,n,s,o){return this.absellipse(e,t,r,r,n,s,o),this}ellipse(e,t,r,n,s,o,a,l){let c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+c,t+h,r,n,s,o,a,l),this}absellipse(e,t,r,n,s,o,a,l){let c=new Us(e,t,r,n,s,o,a,l);if(this.curves.length>0){let u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);let h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Ua=class extends De{constructor(e=[new B(0,.5),new B(.5,0),new B(0,-.5)],t=12,r=0,n=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t),n=xr(n,0,Math.PI*2);let s=[],o=[],a=[],l=[],c=[],h=1/t,u=new M,f=new B,d=new M,p=new M,m=new M,g=0,v=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,v=e[y+1].y-e[y].y,d.x=v*1,d.y=-g,d.z=v*0,m.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(m.x,m.y,m.z);break;default:g=e[y+1].x-e[y].x,v=e[y+1].y-e[y].y,d.x=v*1,d.y=-g,d.z=v*0,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),l.push(d.x,d.y,d.z),m.copy(p)}for(let y=0;y<=t;y++){let w=r+y*h*n,b=Math.sin(w),S=Math.cos(w);for(let T=0;T<=e.length-1;T++){u.x=e[T].x*b,u.y=e[T].y,u.z=e[T].x*S,o.push(u.x,u.y,u.z),f.x=y/t,f.y=T/(e.length-1),a.push(f.x,f.y);let A=l[3*T+0]*b,x=l[3*T+1],_=l[3*T+0]*S;c.push(A,x,_)}}for(let y=0;y<t;y++)for(let w=0;w<e.length-1;w++){let b=w+y*e.length,S=b,T=b+e.length,A=b+e.length+1,x=b+1;s.push(S,T,x),s.push(A,x,T)}this.setIndex(s),this.setAttribute("position",new Te(o,3)),this.setAttribute("uv",new Te(a,2)),this.setAttribute("normal",new Te(c,3))}static fromJSON(e){return new Ua(e.points,e.segments,e.phiStart,e.phiLength)}};var Lo=class extends De{constructor(e=1,t=1,r=1,n=8,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;n=Math.floor(n),s=Math.floor(s);let h=[],u=[],f=[],d=[],p=0,m=[],g=r/2,v=0;y(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(h),this.setAttribute("position",new Te(u,3)),this.setAttribute("normal",new Te(f,3)),this.setAttribute("uv",new Te(d,2));function y(){let b=new M,S=new M,T=0,A=(t-e)/r;for(let x=0;x<=s;x++){let _=[],E=x/s,C=E*(t-e)+e;for(let I=0;I<=n;I++){let N=I/n,R=N*l+a,k=Math.sin(R),G=Math.cos(R);S.x=C*k,S.y=-E*r+g,S.z=C*G,u.push(S.x,S.y,S.z),b.set(k,A,G).normalize(),f.push(b.x,b.y,b.z),d.push(N,1-E),_.push(p++)}m.push(_)}for(let x=0;x<n;x++)for(let _=0;_<s;_++){let E=m[_][x],C=m[_+1][x],I=m[_+1][x+1],N=m[_][x+1];h.push(E,C,N),h.push(C,I,N),T+=6}c.addGroup(v,T,0),v+=T}function w(b){let S=p,T=new B,A=new M,x=0,_=b===!0?e:t,E=b===!0?1:-1;for(let I=1;I<=n;I++)u.push(0,g*E,0),f.push(0,E,0),d.push(.5,.5),p++;let C=p;for(let I=0;I<=n;I++){let R=I/n*l+a,k=Math.cos(R),G=Math.sin(R);A.x=_*G,A.y=g*E,A.z=_*k,u.push(A.x,A.y,A.z),f.push(0,E,0),T.x=k*.5+.5,T.y=G*.5*E+.5,d.push(T.x,T.y),p++}for(let I=0;I<n;I++){let N=S+I,R=C+I;b===!0?h.push(R,R+1,N):h.push(R+1,R,N),x+=3}c.addGroup(v,x,b===!0?1:2),v+=x}}static fromJSON(e){return new Lo(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},za=class extends Lo{constructor(e=1,t=1,r=8,n=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,r,n,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new za(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},Ga=class extends De{constructor(e=[],t=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n};let s=[],o=[];a(n),c(r),h(),this.setAttribute("position",new Te(s,3)),this.setAttribute("normal",new Te(s.slice(),3)),this.setAttribute("uv",new Te(o,2)),n===0?this.computeVertexNormals():this.normalizeNormals();function a(y){let w=new M,b=new M,S=new M;for(let T=0;T<t.length;T+=3)d(t[T+0],w),d(t[T+1],b),d(t[T+2],S),l(w,b,S,y)}function l(y,w,b,S){let T=S+1,A=[];for(let x=0;x<=T;x++){A[x]=[];let _=y.clone().lerp(b,x/T),E=w.clone().lerp(b,x/T),C=T-x;for(let I=0;I<=C;I++)I===0&&x===T?A[x][I]=_:A[x][I]=_.clone().lerp(E,I/C)}for(let x=0;x<T;x++)for(let _=0;_<2*(T-x)-1;_++){let E=Math.floor(_/2);_%2===0?(f(A[x][E+1]),f(A[x+1][E]),f(A[x][E])):(f(A[x][E+1]),f(A[x+1][E+1]),f(A[x+1][E]))}}function c(y){let w=new M;for(let b=0;b<s.length;b+=3)w.x=s[b+0],w.y=s[b+1],w.z=s[b+2],w.normalize().multiplyScalar(y),s[b+0]=w.x,s[b+1]=w.y,s[b+2]=w.z}function h(){let y=new M;for(let w=0;w<s.length;w+=3){y.x=s[w+0],y.y=s[w+1],y.z=s[w+2];let b=g(y)/2/Math.PI+.5,S=v(y)/Math.PI+.5;o.push(b,1-S)}p(),u()}function u(){for(let y=0;y<o.length;y+=6){let w=o[y+0],b=o[y+2],S=o[y+4],T=Math.max(w,b,S),A=Math.min(w,b,S);T>.9&&A<.1&&(w<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),S<.2&&(o[y+4]+=1))}}function f(y){s.push(y.x,y.y,y.z)}function d(y,w){let b=y*3;w.x=e[b+0],w.y=e[b+1],w.z=e[b+2]}function p(){let y=new M,w=new M,b=new M,S=new M,T=new B,A=new B,x=new B;for(let _=0,E=0;_<s.length;_+=9,E+=6){y.set(s[_+0],s[_+1],s[_+2]),w.set(s[_+3],s[_+4],s[_+5]),b.set(s[_+6],s[_+7],s[_+8]),T.set(o[E+0],o[E+1]),A.set(o[E+2],o[E+3]),x.set(o[E+4],o[E+5]),S.copy(y).add(w).add(b).divideScalar(3);let C=g(S);m(T,E+0,y,C),m(A,E+2,w,C),m(x,E+4,b,C)}}function m(y,w,b,S){S<0&&y.x===1&&(o[w]=y.x-1),b.x===0&&b.z===0&&(o[w]=S/2/Math.PI+.5)}function g(y){return Math.atan2(y.z,-y.x)}function v(y){return Math.atan2(-y.y,Math.sqrt(y.x*y.x+y.z*y.z))}}static fromJSON(e){return new Ga(e.vertices,e.indices,e.radius,e.details)}},ka=class extends Ga{constructor(e=1,t=0){let r=(1+Math.sqrt(5))/2,n=1/r,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,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],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 ka(e.radius,e.detail)}},vG=new M,xG=new M,bG=new M,wG=new Jt;var rn=class extends Fa{constructor(e){super(e),this.uuid=Un(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let r=0,n=this.holes.length;r<n;r++)t[r]=this.holes[r].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,r=e.holes.length;t<r;t++){let n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){let n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){let n=e.holes[t];this.holes.push(new Fa().fromJSON(n))}return this}},WL={triangulate:function(i,e,t=2){let r=e&&e.length,n=r?e[0]*t:i.length,s=Lb(i,0,n,t,!0),o=[];if(!s||s.next===s.prev)return o;let a,l,c,h,u,f,d;if(r&&(s=QL(i,e,s,t)),i.length>80*t){a=c=i[0],l=h=i[1];for(let p=t;p<n;p+=t)u=i[p],f=i[p+1],u<a&&(a=u),f<l&&(l=f),u>c&&(c=u),f>h&&(h=f);d=Math.max(c-a,h-l),d=d!==0?1/d:0}return nh(s,o,t,a,l,d),o}};function Lb(i,e,t,r,n){let s,o;if(n===o2(i,e,t,r)>0)for(s=e;s<t;s+=r)o=Z0(s,i[s],i[s+1],o);else for(s=t-r;s>=e;s-=r)o=Z0(s,i[s],i[s+1],o);return o&&ed(o,o.next)&&(sh(o),o=o.next),o}function zs(i,e){if(!i)return i;e||(e=i);let t=i,r;do if(r=!1,!t.steiner&&(ed(t,t.next)||tr(t.prev,t,t.next)===0)){if(sh(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function nh(i,e,t,r,n,s,o){if(!i)return;!o&&s&&e2(i,r,n,s);let a=i,l,c;for(;i.prev!==i.next;){if(l=i.prev,c=i.next,s?qL(i,r,n,s):jL(i)){e.push(l.i/t),e.push(i.i/t),e.push(c.i/t),sh(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=YL(zs(i),e,t),nh(i,e,t,r,n,s,2)):o===2&&XL(i,e,t,r,n,s):nh(zs(i),e,t,r,n,s,1);break}}}function jL(i){let e=i.prev,t=i,r=i.next;if(tr(e,t,r)>=0)return!1;let n=i.next.next;for(;n!==i.prev;){if(Da(e.x,e.y,t.x,t.y,r.x,r.y,n.x,n.y)&&tr(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function qL(i,e,t,r){let n=i.prev,s=i,o=i.next;if(tr(n,s,o)>=0)return!1;let a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,h=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,u=_g(a,l,e,t,r),f=_g(c,h,e,t,r),d=i.prevZ,p=i.nextZ;for(;d&&d.z>=u&&p&&p.z<=f;){if(d!==i.prev&&d!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,d.x,d.y)&&tr(d.prev,d,d.next)>=0||(d=d.prevZ,p!==i.prev&&p!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&tr(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;d&&d.z>=u;){if(d!==i.prev&&d!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,d.x,d.y)&&tr(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==i.prev&&p!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&tr(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function YL(i,e,t){let r=i;do{let n=r.prev,s=r.next.next;!ed(n,s)&&Ib(n,r,r.next,s)&&ih(n,s)&&ih(s,n)&&(e.push(n.i/t),e.push(r.i/t),e.push(s.i/t),sh(r),sh(r.next),r=i=s),r=r.next}while(r!==i);return zs(r)}function XL(i,e,t,r,n,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&n2(o,a)){let l=Rb(o,a);o=zs(o,o.next),l=zs(l,l.next),nh(o,e,t,r,n,s),nh(l,e,t,r,n,s);return}a=a.next}o=o.next}while(o!==i)}function QL(i,e,t,r){let n=[],s,o,a,l,c;for(s=0,o=e.length;s<o;s++)a=e[s]*r,l=s<o-1?e[s+1]*r:i.length,c=Lb(i,a,l,r,!1),c===c.next&&(c.steiner=!0),n.push(r2(c));for(n.sort(JL),s=0;s<n.length;s++)KL(n[s],t),t=zs(t,t.next);return t}function JL(i,e){return i.x-e.x}function KL(i,e){if(e=ZL(i,e),e){let t=Rb(e,i);zs(e,e.next),zs(t,t.next)}}function ZL(i,e){let t=e,r=i.x,n=i.y,s=-1/0,o;do{if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){let f=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=r&&f>s){if(s=f,f===r){if(n===t.y)return t;if(n===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(r===s)return o;let a=o,l=o.x,c=o.y,h=1/0,u;t=o;do r>=t.x&&t.x>=l&&r!==t.x&&Da(n<c?r:s,n,l,c,n<c?s:r,n,t.x,t.y)&&(u=Math.abs(n-t.y)/(r-t.x),ih(t,i)&&(u<h||u===h&&(t.x>o.x||t.x===o.x&&$L(o,t)))&&(o=t,h=u)),t=t.next;while(t!==a);return o}function $L(i,e){return tr(i.prev,i,e.prev)<0&&tr(e.next,i,i.next)<0}function e2(i,e,t,r){let n=i;do n.z===null&&(n.z=_g(n.x,n.y,e,t,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==i);n.prevZ.nextZ=null,n.prevZ=null,t2(n)}function t2(i){let e,t,r,n,s,o,a,l,c=1;do{for(t=i,i=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e<c&&(a++,r=r.nextZ,!!r);e++);for(l=c;a>0||l>0&&r;)a!==0&&(l===0||!r||t.z<=r.z)?(n=t,t=t.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:i=n,n.prevZ=s,s=n;t=r}s.nextZ=null,c*=2}while(o>1);return i}function _g(i,e,t,r,n){return i=32767*(i-t)*n,e=32767*(e-r)*n,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function r2(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Da(i,e,t,r,n,s,o,a){return(n-o)*(e-a)-(i-o)*(s-a)>=0&&(i-o)*(r-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(n-o)*(r-a)>=0}function n2(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!i2(i,e)&&(ih(i,e)&&ih(e,i)&&s2(i,e)&&(tr(i.prev,i,e.prev)||tr(i,e.prev,e))||ed(i,e)&&tr(i.prev,i,i.next)>0&&tr(e.prev,e,e.next)>0)}function tr(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function ed(i,e){return i.x===e.x&&i.y===e.y}function Ib(i,e,t,r){let n=rf(tr(i,e,t)),s=rf(tr(i,e,r)),o=rf(tr(t,r,i)),a=rf(tr(t,r,e));return!!(n!==s&&o!==a||n===0&&tf(i,t,e)||s===0&&tf(i,r,e)||o===0&&tf(t,i,r)||a===0&&tf(t,e,r))}function tf(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function rf(i){return i>0?1:i<0?-1:0}function i2(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&Ib(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function ih(i,e){return tr(i.prev,i,i.next)<0?tr(i,e,i.next)>=0&&tr(i,i.prev,e)>=0:tr(i,e,i.prev)<0||tr(i,i.next,e)<0}function s2(i,e){let t=i,r=!1,n=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==i);return r}function Rb(i,e){let t=new Eg(i.i,i.x,i.y),r=new Eg(e.i,e.x,e.y),n=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=n,n.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function Z0(i,e,t,r){let n=new Eg(i,e,t);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function sh(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Eg(i,e,t){this.i=i,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 o2(i,e,t,r){let n=0;for(let s=e,o=t-r;s<t;s+=r)n+=(i[o]-i[s])*(i[s+1]+i[o+1]),o=s;return n}var ii=class{static area(e){let t=e.length,r=0;for(let n=t-1,s=0;s<t;n=s++)r+=e[n].x*e[s].y-e[s].x*e[n].y;return r*.5}static isClockWise(e){return ii.area(e)<0}static triangulateShape(e,t){let r=[],n=[],s=[];$0(e),eb(r,e);let o=e.length;t.forEach($0);for(let l=0;l<t.length;l++)n.push(o),o+=t[l].length,eb(r,t[l]);let a=WL.triangulate(r,n);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}};function $0(i){let e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function eb(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}var Gs=class extends De{constructor(e=new rn([new B(.5,.5),new B(-.5,.5),new B(-.5,-.5),new B(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let r=this,n=[],s=[];for(let a=0,l=e.length;a<l;a++){let c=e[a];o(c)}this.setAttribute("position",new Te(n,3)),this.setAttribute("uv",new Te(s,2)),this.computeVertexNormals();function o(a){let l=[],c=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,u=t.depth!==void 0?t.depth:1,f=t.bevelEnabled!==void 0?t.bevelEnabled:!0,d=t.bevelThickness!==void 0?t.bevelThickness:.2,p=t.bevelSize!==void 0?t.bevelSize:d-.1,m=t.bevelOffset!==void 0?t.bevelOffset:0,g=t.bevelSegments!==void 0?t.bevelSegments:3,v=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:a2;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=t.amount);let w,b=!1,S,T,A,x;v&&(w=v.getSpacedPoints(h),b=!0,f=!1,S=v.computeFrenetFrames(h,!1),T=new M,A=new M,x=new M),f||(g=0,d=0,p=0,m=0);let _=a.extractPoints(c),E=_.shape,C=_.holes;if(!ii.isClockWise(E)){E=E.reverse();for(let Z=0,W=C.length;Z<W;Z++){let $=C[Z];ii.isClockWise($)&&(C[Z]=$.reverse())}}let N=ii.triangulateShape(E,C),R=E;for(let Z=0,W=C.length;Z<W;Z++){let $=C[Z];E=E.concat($)}function k(Z,W,$){return W||console.error("THREE.ExtrudeGeometry: vec does not exist"),W.clone().multiplyScalar($).add(Z)}let G=E.length,K=N.length;function J(Z,W,$){let ce,oe,me,ve=Z.x-W.x,ge=Z.y-W.y,Le=$.x-Z.x,ke=$.y-Z.y,L=ve*ve+ge*ge,P=ve*ke-ge*Le;if(Math.abs(P)>Number.EPSILON){let re=Math.sqrt(L),ye=Math.sqrt(Le*Le+ke*ke),Se=W.x-ge/re,Ie=W.y+ve/re,Fe=$.x-ke/ye,fe=$.y+Le/ye,rt=((Fe-Se)*ke-(fe-Ie)*Le)/(ve*ke-ge*Le);ce=Se+ve*rt-Z.x,oe=Ie+ge*rt-Z.y;let st=ce*ce+oe*oe;if(st<=2)return new B(ce,oe);me=Math.sqrt(st/2)}else{let re=!1;ve>Number.EPSILON?Le>Number.EPSILON&&(re=!0):ve<-Number.EPSILON?Le<-Number.EPSILON&&(re=!0):Math.sign(ge)===Math.sign(ke)&&(re=!0),re?(ce=-ge,oe=ve,me=Math.sqrt(L)):(ce=ve,oe=ge,me=Math.sqrt(L/2))}return new B(ce/me,oe/me)}let Y=[];for(let Z=0,W=R.length,$=W-1,ce=Z+1;Z<W;Z++,$++,ce++)$===W&&($=0),ce===W&&(ce=0),Y[Z]=J(R[Z],R[$],R[ce]);let F=[],U,O=Y.concat();for(let Z=0,W=C.length;Z<W;Z++){let $=C[Z];U=[];for(let ce=0,oe=$.length,me=oe-1,ve=ce+1;ce<oe;ce++,me++,ve++)me===oe&&(me=0),ve===oe&&(ve=0),U[ce]=J($[ce],$[me],$[ve]);F.push(U),O=O.concat(U)}for(let Z=0;Z<g;Z++){let W=Z/g,$=d*Math.cos(W*Math.PI/2),ce=p*Math.sin(W*Math.PI/2)+m;for(let oe=0,me=R.length;oe<me;oe++){let ve=k(R[oe],Y[oe],ce);he(ve.x,ve.y,-$)}for(let oe=0,me=C.length;oe<me;oe++){let ve=C[oe];U=F[oe];for(let ge=0,Le=ve.length;ge<Le;ge++){let ke=k(ve[ge],U[ge],ce);he(ke.x,ke.y,-$)}}}let j=p+m;for(let Z=0;Z<G;Z++){let W=f?k(E[Z],O[Z],j):E[Z];b?(A.copy(S.normals[0]).multiplyScalar(W.x),T.copy(S.binormals[0]).multiplyScalar(W.y),x.copy(w[0]).add(A).add(T),he(x.x,x.y,x.z)):he(W.x,W.y,0)}for(let Z=1;Z<=h;Z++)for(let W=0;W<G;W++){let $=f?k(E[W],O[W],j):E[W];b?(A.copy(S.normals[Z]).multiplyScalar($.x),T.copy(S.binormals[Z]).multiplyScalar($.y),x.copy(w[Z]).add(A).add(T),he(x.x,x.y,x.z)):he($.x,$.y,u/h*Z)}for(let Z=g-1;Z>=0;Z--){let W=Z/g,$=d*Math.cos(W*Math.PI/2),ce=p*Math.sin(W*Math.PI/2)+m;for(let oe=0,me=R.length;oe<me;oe++){let ve=k(R[oe],Y[oe],ce);he(ve.x,ve.y,u+$)}for(let oe=0,me=C.length;oe<me;oe++){let ve=C[oe];U=F[oe];for(let ge=0,Le=ve.length;ge<Le;ge++){let ke=k(ve[ge],U[ge],ce);b?he(ke.x,ke.y+w[h-1].y,w[h-1].x+$):he(ke.x,ke.y,u+$)}}}H(),X();function H(){let Z=n.length/3;if(f){let W=0,$=G*W;for(let ce=0;ce<K;ce++){let oe=N[ce];ie(oe[2]+$,oe[1]+$,oe[0]+$)}W=h+g*2,$=G*W;for(let ce=0;ce<K;ce++){let oe=N[ce];ie(oe[0]+$,oe[1]+$,oe[2]+$)}}else{for(let W=0;W<K;W++){let $=N[W];ie($[2],$[1],$[0])}for(let W=0;W<K;W++){let $=N[W];ie($[0]+G*h,$[1]+G*h,$[2]+G*h)}}r.addGroup(Z,n.length/3-Z,0)}function X(){let Z=n.length/3,W=0;V(R,W),W+=R.length;for(let $=0,ce=C.length;$<ce;$++){let oe=C[$];V(oe,W),W+=oe.length}r.addGroup(Z,n.length/3-Z,1)}function V(Z,W){let $=Z.length;for(;--$>=0;){let ce=$,oe=$-1;oe<0&&(oe=Z.length-1);for(let me=0,ve=h+g*2;me<ve;me++){let ge=G*me,Le=G*(me+1),ke=W+ce+ge,L=W+oe+ge,P=W+oe+Le,re=W+ce+Le;le(ke,L,P,re)}}}function he(Z,W,$){l.push(Z),l.push(W),l.push($)}function ie(Z,W,$){q(Z),q(W),q($);let ce=n.length/3,oe=y.generateTopUV(r,n,ce-3,ce-2,ce-1);ue(oe[0]),ue(oe[1]),ue(oe[2])}function le(Z,W,$,ce){q(Z),q(W),q(ce),q(W),q($),q(ce);let oe=n.length/3,me=y.generateSideWallUV(r,n,oe-6,oe-3,oe-2,oe-1);ue(me[0]),ue(me[1]),ue(me[3]),ue(me[1]),ue(me[2]),ue(me[3])}function q(Z){n.push(l[Z*3+0]),n.push(l[Z*3+1]),n.push(l[Z*3+2])}function ue(Z){s.push(Z.x),s.push(Z.y)}}}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return l2(t,r,e)}static fromJSON(e,t){let r=[];for(let s=0,o=e.shapes.length;s<o;s++){let a=t[e.shapes[s]];r.push(a)}let n=e.options.extrudePath;return n!==void 0&&(e.options.extrudePath=new Db[n.type]().fromJSON(n)),new Gs(r,e.options)}},a2={generateTopUV:function(i,e,t,r,n){let s=e[t*3],o=e[t*3+1],a=e[r*3],l=e[r*3+1],c=e[n*3],h=e[n*3+1];return[new B(s,o),new B(a,l),new B(c,h)]},generateSideWallUV:function(i,e,t,r,n,s){let o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[r*3],h=e[r*3+1],u=e[r*3+2],f=e[n*3],d=e[n*3+1],p=e[n*3+2],m=e[s*3],g=e[s*3+1],v=e[s*3+2];return Math.abs(a-h)<Math.abs(o-c)?[new B(o,1-l),new B(c,1-u),new B(f,1-p),new B(m,1-v)]:[new B(a,1-l),new B(h,1-u),new B(d,1-p),new B(g,1-v)]}};function l2(i,e,t){if(t.shapes=[],Array.isArray(i))for(let r=0,n=i.length;r<n;r++){let s=i[r];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}var Va=class extends Ga{constructor(e=1,t=0){let r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,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(n,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Va(e.radius,e.detail)}};var Io=class extends De{constructor(e=new rn([new B(0,.5),new B(-.5,-.5),new B(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let r=[],n=[],s=[],o=[],a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let h=0;h<e.length;h++)c(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(r),this.setAttribute("position",new Te(n,3)),this.setAttribute("normal",new Te(s,3)),this.setAttribute("uv",new Te(o,2));function c(h){let u=n.length/3,f=h.extractPoints(t),d=f.shape,p=f.holes;ii.isClockWise(d)===!1&&(d=d.reverse());for(let g=0,v=p.length;g<v;g++){let y=p[g];ii.isClockWise(y)===!0&&(p[g]=y.reverse())}let m=ii.triangulateShape(d,p);for(let g=0,v=p.length;g<v;g++){let y=p[g];d=d.concat(y)}for(let g=0,v=d.length;g<v;g++){let y=d[g];n.push(y.x,y.y,0),s.push(0,0,1),o.push(y.x,y.y)}for(let g=0,v=m.length;g<v;g++){let y=m[g],w=y[0]+u,b=y[1]+u,S=y[2]+u;r.push(w,b,S),l+=3}}}toJSON(){let e=super.toJSON(),t=this.parameters.shapes;return c2(t,e)}static fromJSON(e,t){let r=[];for(let n=0,s=e.shapes.length;n<s;n++){let o=t[e.shapes[n]];r.push(o)}return new Io(r,e.curveSegments)}};function c2(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,r=i.length;t<r;t++){let n=i[t];e.shapes.push(n.uuid)}else e.shapes.push(i.uuid);return e}var Ro=class extends De{constructor(e=1,t=32,r=16,n=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));let l=Math.min(o+a,Math.PI),c=0,h=[],u=new M,f=new M,d=[],p=[],m=[],g=[];for(let v=0;v<=r;v++){let y=[],w=v/r,b=0;v==0&&o==0?b=.5/t:v==r&&l==Math.PI&&(b=-.5/t);for(let S=0;S<=t;S++){let T=S/t;u.x=-e*Math.cos(n+T*s)*Math.sin(o+w*a),u.y=e*Math.cos(o+w*a),u.z=e*Math.sin(n+T*s)*Math.sin(o+w*a),p.push(u.x,u.y,u.z),f.copy(u).normalize(),m.push(f.x,f.y,f.z),g.push(T+b,1-w),y.push(c++)}h.push(y)}for(let v=0;v<r;v++)for(let y=0;y<t;y++){let w=h[v][y+1],b=h[v][y],S=h[v+1][y],T=h[v+1][y+1];(v!==0||o>0)&&d.push(w,b,T),(v!==r-1||l<Math.PI)&&d.push(b,S,T)}this.setIndex(d),this.setAttribute("position",new Te(p,3)),this.setAttribute("normal",new Te(m,3)),this.setAttribute("uv",new Te(g,2))}static fromJSON(e){return new Ro(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}};var Ha=class extends De{constructor(e=1,t=.4,r=64,n=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:s,q:o},r=Math.floor(r),n=Math.floor(n);let a=[],l=[],c=[],h=[],u=new M,f=new M,d=new M,p=new M,m=new M,g=new M,v=new M;for(let w=0;w<=r;++w){let b=w/r*s*Math.PI*2;y(b,s,o,e,d),y(b+.01,s,o,e,p),g.subVectors(p,d),v.addVectors(p,d),m.crossVectors(g,v),v.crossVectors(m,g),m.normalize(),v.normalize();for(let S=0;S<=n;++S){let T=S/n*Math.PI*2,A=-t*Math.cos(T),x=t*Math.sin(T);u.x=d.x+(A*v.x+x*m.x),u.y=d.y+(A*v.y+x*m.y),u.z=d.z+(A*v.z+x*m.z),l.push(u.x,u.y,u.z),f.subVectors(u,d).normalize(),c.push(f.x,f.y,f.z),h.push(w/r),h.push(S/n)}}for(let w=1;w<=r;w++)for(let b=1;b<=n;b++){let S=(n+1)*(w-1)+(b-1),T=(n+1)*w+(b-1),A=(n+1)*w+b,x=(n+1)*(w-1)+b;a.push(S,T,x),a.push(T,A,x)}this.setIndex(a),this.setAttribute("position",new Te(l,3)),this.setAttribute("normal",new Te(c,3)),this.setAttribute("uv",new Te(h,2));function y(w,b,S,T,A){let x=Math.cos(w),_=Math.sin(w),E=S/b*w,C=Math.cos(E);A.x=T*(2+C)*.5*x,A.y=T*(2+C)*_*.5,A.z=T*Math.sin(E)*.5}}static fromJSON(e){return new Ha(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}};var _f=class extends ur{constructor(e){super(),this.type="ShadowMaterial",this.color=new be(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}};_f.prototype.isShadowMaterial=!0;var Ef=class extends Mt{constructor(e){super(e),this.type="RawShaderMaterial"}};Ef.prototype.isRawShaderMaterial=!0;var oh=class extends ur{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new be(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 be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(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.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}};oh.prototype.isMeshStandardMaterial=!0;var Cf=class extends oh{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new B(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return xr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new be(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new be(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new be(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.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.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};Cf.prototype.isMeshPhysicalMaterial=!0;var Pf=class extends ur{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new be(16777215),this.specular=new be(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}};Pf.prototype.isMeshPhongMaterial=!0;var Df=class extends ur{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new be(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};Df.prototype.isMeshToonMaterial=!0;var Lf=class extends ur{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};Lf.prototype.isMeshNormalMaterial=!0;var If=class extends ur{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.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.fog=e.fog,this}};If.prototype.isMeshLambertMaterial=!0;var Rf=class extends ur{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new be(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}};Rf.prototype.isMeshMatcapMaterial=!0;var Bf=class extends kr{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}};Bf.prototype.isLineDashedMaterial=!0;var h2={ShadowMaterial:_f,SpriteMaterial:$c,RawShaderMaterial:Ef,ShaderMaterial:Mt,PointsMaterial:eh,MeshPhysicalMaterial:Cf,MeshStandardMaterial:oh,MeshPhongMaterial:Pf,MeshToonMaterial:Df,MeshNormalMaterial:Lf,MeshLambertMaterial:If,MeshDepthMaterial:Jc,MeshDistanceMaterial:Kc,MeshBasicMaterial:zn,MeshMatcapMaterial:Rf,LineDashedMaterial:Bf,LineBasicMaterial:kr,Material:ur};ur.fromType=function(i){return new h2[i]};var Qt={arraySlice:function(i,e,t){return Qt.isTypedArray(i)?new i.constructor(i.subarray(e,t!==void 0?t:i.length)):i.slice(e,t)},convertArray:function(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){function e(n,s){return i[n]-i[s]}let t=i.length,r=new Array(t);for(let n=0;n!==t;++n)r[n]=n;return r.sort(e),r},sortedArray:function(i,e,t){let r=i.length,n=new i.constructor(r);for(let s=0,o=0;o!==r;++s){let a=t[s]*e;for(let l=0;l!==e;++l)n[o++]=i[a+l]}return n},flattenJSON:function(i,e,t,r){let n=1,s=i[0];for(;s!==void 0&&s[r]===void 0;)s=i[n++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=i[n++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=i[n++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=i[n++];while(s!==void 0)},subclip:function(i,e,t,r,n=30){let s=i.clone();s.name=e;let o=[];for(let l=0;l<s.tracks.length;++l){let c=s.tracks[l],h=c.getValueSize(),u=[],f=[];for(let d=0;d<c.times.length;++d){let p=c.times[d]*n;if(!(p<t||p>=r)){u.push(c.times[d]);for(let m=0;m<h;++m)f.push(c.values[d*h+m])}}u.length!==0&&(c.times=Qt.convertArray(u,c.times.constructor),c.values=Qt.convertArray(f,c.values.constructor),o.push(c))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(i,e=0,t=i,r=30){r<=0&&(r=30);let n=t.tracks.length,s=e/r;for(let o=0;o<n;++o){let a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;let c=i.tracks.find(function(v){return v.name===a.name&&v.ValueTypeName===l});if(c===void 0)continue;let h=0,u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=u/3);let f=0,d=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=d/3);let p=a.times.length-1,m;if(s<=a.times[0]){let v=h,y=u-h;m=Qt.arraySlice(a.values,v,y)}else if(s>=a.times[p]){let v=p*u+h,y=v+u-h;m=Qt.arraySlice(a.values,v,y)}else{let v=a.createInterpolant(),y=h,w=u-h;v.evaluate(s),m=Qt.arraySlice(v.resultBuffer,y,w)}l==="quaternion"&&new zt().fromArray(m).normalize().conjugate().toArray(m);let g=c.times.length;for(let v=0;v<g;++v){let y=v*d+f;if(l==="quaternion")zt.multiplyQuaternionsFlat(c.values,y,m,0,c.values,y);else{let w=d-f*2;for(let b=0;b<w;++b)c.values[y+b]-=m[b]}}}return i.blendMode=yb,i}},Ci=class{constructor(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=n!==void 0?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,r=this._cachedIndex,n=t[r],s=t[r-1];e:{t:{let o;r:{n:if(!(e<n)){for(let a=r+2;;){if(n===void 0){if(e<s)break n;return r=t.length,this._cachedIndex=r,this.afterEnd_(r-1,e,s)}if(r===a)break;if(s=n,n=t[++r],e<n)break t}o=t.length;break r}if(!(e>=s)){let a=t[1];e<a&&(r=2,s=a);for(let l=r-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(r===l)break;if(n=s,s=t[--r-1],e>=s)break t}o=r,r=0;break r}break e}for(;r<o;){let a=r+o>>>1;e<t[a]?o=a:r=a+1}if(n=t[r],s=t[r-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(n===void 0)return r=t.length,this._cachedIndex=r,this.afterEnd_(r-1,s,e)}this._cachedIndex=r,this.intervalChanged_(r,s,n)}return this.interpolate_(r,s,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=e*n;for(let o=0;o!==n;++o)t[o]=r[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}};Ci.prototype.beforeStart_=Ci.prototype.copySampleValue_;Ci.prototype.afterEnd_=Ci.prototype.copySampleValue_;var Cg=class extends Ci{constructor(e,t,r,n){super(e,t,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ea,endingEnd:Ea}}intervalChanged_(e,t,r){let n=this.parameterPositions,s=e-2,o=e+1,a=n[s],l=n[o];if(a===void 0)switch(this.getSettings_().endingStart){case Ca:s=e,a=2*t-r;break;case ff:s=n.length-2,a=t+n[s]-n[s+1];break;default:s=e,a=r}if(l===void 0)switch(this.getSettings_().endingEnd){case Ca:o=e,l=2*r-t;break;case ff:o=1,l=r+n[1]-n[0];break;default:o=e-1,l=t}let c=(r-t)*.5,h=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-r),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(e,t,r,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=this._offsetPrev,u=this._offsetNext,f=this._weightPrev,d=this._weightNext,p=(r-t)/(n-t),m=p*p,g=m*p,v=-f*g+2*f*m-f*p,y=(1+f)*g+(-1.5-2*f)*m+(-.5+f)*p+1,w=(-1-d)*g+(1.5+d)*m+.5*p,b=d*g-d*m;for(let S=0;S!==a;++S)s[S]=v*o[h+S]+y*o[c+S]+w*o[l+S]+b*o[u+S];return s}},Nf=class extends Ci{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=(r-t)/(n-t),u=1-h;for(let f=0;f!==a;++f)s[f]=o[c+f]*u+o[l+f]*h;return s}},Pg=class extends Ci{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e){return this.copySampleValue_(e-1)}},Vn=class{constructor(e,t,r,n){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=Qt.convertArray(t,this.TimeBufferType),this.values=Qt.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:Qt.convertArray(e.times,Array),values:Qt.convertArray(e.values,Array)};let n=e.getInterpolation();n!==e.DefaultInterpolation&&(r.interpolation=n)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new Pg(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Nf(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Cg(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case hf:t=this.InterpolantFactoryMethodDiscrete;break;case uf:t=this.InterpolantFactoryMethodLinear;break;case wm:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let r="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(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return hf;case this.InterpolantFactoryMethodLinear:return uf;case this.InterpolantFactoryMethodSmooth:return wm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]*=e}return this}trim(e,t){let r=this.times,n=r.length,s=0,o=n-1;for(;s!==n&&r[s]<e;)++s;for(;o!==-1&&r[o]>t;)--o;if(++o,s!==0||o!==n){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Qt.arraySlice(r,s,o),this.values=Qt.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let r=this.times,n=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(n!==void 0&&Qt.isTypedArray(n))for(let a=0,l=n.length;a!==l;++a){let c=n[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Qt.arraySlice(this.times),t=Qt.arraySlice(this.values),r=this.getValueSize(),n=this.getInterpolation()===wm,s=e.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=e[a],h=e[a+1];if(c!==h&&(a!==1||c!==e[0]))if(n)l=!0;else{let u=a*r,f=u-r,d=u+r;for(let p=0;p!==r;++p){let m=t[u+p];if(m!==t[f+p]||m!==t[d+p]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];let u=a*r,f=o*r;for(let d=0;d!==r;++d)t[f+d]=t[u+d]}++o}}if(s>0){e[o]=e[s];for(let a=s*r,l=o*r,c=0;c!==r;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Qt.arraySlice(e,0,o),this.values=Qt.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}clone(){let e=Qt.arraySlice(this.times,0),t=Qt.arraySlice(this.values,0),r=this.constructor,n=new r(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};Vn.prototype.TimeBufferType=Float32Array;Vn.prototype.ValueBufferType=Float32Array;Vn.prototype.DefaultInterpolation=uf;var ks=class extends Vn{};ks.prototype.ValueTypeName="bool";ks.prototype.ValueBufferType=Array;ks.prototype.DefaultInterpolation=hf;ks.prototype.InterpolantFactoryMethodLinear=void 0;ks.prototype.InterpolantFactoryMethodSmooth=void 0;var Of=class extends Vn{};Of.prototype.ValueTypeName="color";var Wa=class extends Vn{};Wa.prototype.ValueTypeName="number";var Dg=class extends Ci{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(r-t)/(n-t),c=e*a;for(let h=c+a;c!==h;c+=4)zt.slerpFlat(s,0,o,c-a,o,c,l);return s}},Bo=class extends Vn{InterpolantFactoryMethodLinear(e){return new Dg(this.times,this.values,this.getValueSize(),e)}};Bo.prototype.ValueTypeName="quaternion";Bo.prototype.DefaultInterpolation=uf;Bo.prototype.InterpolantFactoryMethodSmooth=void 0;var Vs=class extends Vn{};Vs.prototype.ValueTypeName="string";Vs.prototype.ValueBufferType=Array;Vs.prototype.DefaultInterpolation=hf;Vs.prototype.InterpolantFactoryMethodLinear=void 0;Vs.prototype.InterpolantFactoryMethodSmooth=void 0;var ja=class extends Vn{};ja.prototype.ValueTypeName="vector";var Ff=class{constructor(e,t=-1,r,n=$g){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Un(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],r=e.tracks,n=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(f2(r[o]).scale(n));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(Vn.toJSON(r[s]));return n}static CreateFromMorphTargetSequence(e,t,r,n){let s=t.length,o=[];for(let a=0;a<s;a++){let l=[],c=[];l.push((a+s-1)%s,a,(a+1)%s),c.push(0,1,0);let h=Qt.getKeyframeOrder(l);l=Qt.sortedArray(l,1,h),c=Qt.sortedArray(c,1,h),!n&&l[0]===0&&(l.push(s),c.push(c[0])),o.push(new Wa(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/r))}return new this(e,-1,o)}static findByName(e,t){let r=e;if(!Array.isArray(e)){let n=e;r=n.geometry&&n.geometry.animations||n.animations}for(let n=0;n<r.length;n++)if(r[n].name===t)return r[n];return null}static CreateClipsFromMorphTargetSequences(e,t,r){let n={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){let c=e[a],h=c.name.match(s);if(h&&h.length>1){let u=h[1],f=n[u];f||(n[u]=f=[]),f.push(c)}}let o=[];for(let a in n)o.push(this.CreateFromMorphTargetSequence(a,n[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let r=function(u,f,d,p,m){if(d.length!==0){let g=[],v=[];Qt.flattenJSON(d,g,v,p),g.length!==0&&m.push(new u(f,g,v))}},n=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let u=0;u<c.length;u++){let f=c[u].keys;if(!(!f||f.length===0))if(f[0].morphTargets){let d={},p;for(p=0;p<f.length;p++)if(f[p].morphTargets)for(let m=0;m<f[p].morphTargets.length;m++)d[f[p].morphTargets[m]]=-1;for(let m in d){let g=[],v=[];for(let y=0;y!==f[p].morphTargets.length;++y){let w=f[p];g.push(w.time),v.push(w.morphTarget===m?1:0)}n.push(new Wa(".morphTargetInfluence["+m+"]",g,v))}l=d.length*o}else{let d=".bones["+t[u].name+"]";r(ja,d+".position",f,"pos",n),r(Bo,d+".quaternion",f,"rot",n),r(ja,d+".scale",f,"scl",n)}}return n.length===0?null:new this(s,l,n,a)}resetDuration(){let e=this.tracks,t=0;for(let r=0,n=e.length;r!==n;++r){let s=this.tracks[r];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(){let 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 u2(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wa;case"vector":case"vector2":case"vector3":case"vector4":return ja;case"color":return Of;case"quaternion":return Bo;case"bool":case"boolean":return ks;case"string":return Vs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function f2(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=u2(i.type);if(i.times===void 0){let t=[],r=[];Qt.flattenJSON(i.keys,t,r,"value"),i.times=t,i.values=r}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}var qa={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}},No=class{constructor(e,t,r){let n=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(h){a++,s===!1&&n.onStart!==void 0&&n.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,n.onProgress!==void 0&&n.onProgress(h,o,a),o===a&&(s=!1,n.onLoad!==void 0&&n.onLoad())},this.itemError=function(h){n.onError!==void 0&&n.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){let u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,f=c.length;u<f;u+=2){let d=c[u],p=c[u+1];if(d.global&&(d.lastIndex=0),d.test(h))return p}return null}}},d2=new No,cn=class{constructor(e){this.manager=e!==void 0?e:d2,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let r=this;return new Promise(function(n,s){r.load(e,n,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}},$i={},as=class extends cn{constructor(e){super(e)}load(e,t,r,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=qa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if($i[e]!==void 0){$i[e].push({onLoad:t,onProgress:r,onError:n});return}$i[e]=[],$i[e].push({onLoad:t,onProgress:r,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;let h=$i[e],u=c.body.getReader(),f=c.headers.get("Content-Length"),d=f?parseInt(f):0,p=d!==0,m=0,g=new ReadableStream({start(v){y();function y(){u.read().then(({done:w,value:b})=>{if(w)v.close();else{m+=b.byteLength;let S=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:d});for(let T=0,A=h.length;T<A;T++){let x=h[T];x.onProgress&&x.onProgress(S)}v.enqueue(b),y()}})}}});return new Response(g)}else throw Error(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return c.json();default:if(a===void 0)return c.text();{let u=/charset="?([^;"\s]*)"?/i.exec(a),f=u&&u[1]?u[1].toLowerCase():void 0,d=new TextDecoder(f);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{qa.add(e,c);let h=$i[e];delete $i[e];for(let u=0,f=h.length;u<f;u++){let d=h[u];d.onLoad&&d.onLoad(c)}}).catch(c=>{let h=$i[e];if(h===void 0)throw this.manager.itemError(e),c;delete $i[e];for(let u=0,f=h.length;u<f;u++){let d=h[u];d.onError&&d.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var Uf=class extends cn{constructor(e){super(e)}load(e,t,r,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=qa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a=qc("img");function l(){h(),qa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(u){h(),n&&n(u),s.manager.itemError(e),s.manager.itemEnd(e)}function h(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}},Lg=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=new Fs,o=new Uf(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(h){s.images[c]=h,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,n)}for(let c=0;c<e.length;++c)l(c);return s}};var Ig=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=new Pt,o=new Uf(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},r,n),s}},bn=class extends ot{constructor(e,t=1){super(),this.type="Light",this.color=new be(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let 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}};bn.prototype.isLight=!0;var Hs=class extends bn{constructor(e,t,r){super(e,r),this.type="HemisphereLight",this.position.copy(ot.DefaultUp),this.updateMatrix(),this.groundColor=new be(t)}copy(e){return bn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}};Hs.prototype.isHemisphereLight=!0;var tb=new Ae,rb=new M,nb=new M,ah=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new B(512,512),this.map=null,this.mapPass=null,this.matrix=new Ae,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Na,this._frameExtents=new B(1,1),this._viewportCount=1,this._viewports=[new Je(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,r=this.matrix;rb.setFromMatrixPosition(e.matrixWorld),t.position.copy(rb),nb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(nb),t.updateMatrixWorld(),tb.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(tb),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(t.projectionMatrix),r.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(){let 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}},zf=class extends ah{constructor(){super(new sr(50,1,.5,500)),this.focus=1}updateMatrices(e){let t=this.camera,r=jc*2*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(r!==t.fov||n!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=n,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}};zf.prototype.isSpotLightShadow=!0;var lh=class extends bn{constructor(e,t,r=0,n=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(ot.DefaultUp),this.updateMatrix(),this.target=new ot,this.distance=r,this.angle=n,this.penumbra=s,this.decay=o,this.shadow=new zf}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}};lh.prototype.isSpotLight=!0;var ib=new Ae,Bc=new M,$m=new M,Gf=class extends ah{constructor(){super(new sr(90,1,.5,500)),this._frameExtents=new B(4,2),this._viewportCount=6,this._viewports=[new Je(2,1,1,1),new Je(0,1,1,1),new Je(3,1,1,1),new Je(1,1,1,1),new Je(3,0,1,1),new Je(1,0,1,1)],this._cubeDirections=[new M(1,0,0),new M(-1,0,0),new M(0,0,1),new M(0,0,-1),new M(0,1,0),new M(0,-1,0)],this._cubeUps=[new M(0,1,0),new M(0,1,0),new M(0,1,0),new M(0,1,0),new M(0,0,1),new M(0,0,-1)]}updateMatrices(e,t=0){let r=this.camera,n=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),Bc.setFromMatrixPosition(e.matrixWorld),r.position.copy(Bc),$m.copy(r.position),$m.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt($m),r.updateMatrixWorld(),n.makeTranslation(-Bc.x,-Bc.y,-Bc.z),ib.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ib)}};Gf.prototype.isPointLightShadow=!0;var ch=class extends bn{constructor(e,t,r=0,n=1){super(e,t),this.type="PointLight",this.distance=r,this.decay=n,this.shadow=new Gf}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}};ch.prototype.isPointLight=!0;var kf=class extends ah{constructor(){super(new Co(-5,5,5,-5,.5,500))}};kf.prototype.isDirectionalLightShadow=!0;var hh=class extends bn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(ot.DefaultUp),this.updateMatrix(),this.target=new ot,this.shadow=new kf}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};hh.prototype.isDirectionalLight=!0;var Rg=class extends bn{constructor(e,t){super(e,t),this.type="AmbientLight"}};Rg.prototype.isAmbientLight=!0;var Bg=class extends bn{constructor(e,t,r=10,n=10){super(e,t),this.type="RectAreaLight",this.width=r,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}};Bg.prototype.isRectAreaLight=!0;var Vf=class{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new M)}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){let r=e.x,n=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*n),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],1.092548*(r*n)),t.addScaledVector(o[5],1.092548*(n*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(r*s)),t.addScaledVector(o[8],.546274*(r*r-n*n)),t}getIrradianceAt(e,t){let r=e.x,n=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*n),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*r),t.addScaledVector(o[4],2*.429043*r*n),t.addScaledVector(o[5],2*.429043*n*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*r*s),t.addScaledVector(o[8],.429043*(r*r-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],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){let r=this.coefficients;for(let n=0;n<9;n++)r[n].fromArray(e,t+n*3);return this}toArray(e=[],t=0){let r=this.coefficients;for(let n=0;n<9;n++)r[n].toArray(e,t+n*3);return e}static getBasisAt(e,t){let r=e.x,n=e.y,s=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*s,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*r*s,t[8]=.546274*(r*r-n*n)}};Vf.prototype.isSphericalHarmonics3=!0;var uh=class extends bn{constructor(e=new Vf,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){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}};uh.prototype.isLightProbe=!0;var Ng=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,n=e.length;r<n;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},Hf=class extends De{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(){let e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}};Hf.prototype.isInstancedBufferGeometry=!0;var Ws=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=this,o=new as(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},r,n)}parse(e){let t={},r={};function n(d,p){if(t[p]!==void 0)return t[p];let g=d.interleavedBuffers[p],v=s(d,g.buffer),y=_u(g.type,v),w=new ss(y,g.stride);return w.uuid=g.uuid,t[p]=w,w}function s(d,p){if(r[p]!==void 0)return r[p];let g=d.arrayBuffers[p],v=new Uint32Array(g).buffer;return r[p]=v,v}let o=e.isInstancedBufferGeometry?new Hf:new De,a=e.data.index;if(a!==void 0){let d=_u(a.type,a.array);o.setIndex(new Ve(d,1))}let l=e.data.attributes;for(let d in l){let p=l[d],m;if(p.isInterleavedBufferAttribute){let g=n(e.data,p.data);m=new Ei(g,p.itemSize,p.offset,p.normalized)}else{let g=_u(p.type,p.array),v=p.isInstancedBufferAttribute?Oa:Ve;m=new v(g,p.itemSize,p.normalized)}p.name!==void 0&&(m.name=p.name),p.usage!==void 0&&m.setUsage(p.usage),p.updateRange!==void 0&&(m.updateRange.offset=p.updateRange.offset,m.updateRange.count=p.updateRange.count),o.setAttribute(d,m)}let c=e.data.morphAttributes;if(c)for(let d in c){let p=c[d],m=[];for(let g=0,v=p.length;g<v;g++){let y=p[g],w;if(y.isInterleavedBufferAttribute){let b=n(e.data,y.data);w=new Ei(b,y.itemSize,y.offset,y.normalized)}else{let b=_u(y.type,y.array);w=new Ve(b,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),m.push(w)}o.morphAttributes[d]=m}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);let u=e.data.groups||e.data.drawcalls||e.data.offsets;if(u!==void 0)for(let d=0,p=u.length;d!==p;++d){let m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}let f=e.data.boundingSphere;if(f!==void 0){let d=new M;f.center!==void 0&&d.fromArray(f.center),o.boundingSphere=new Lr(d,f.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}};var Og=class extends cn{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,r,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=qa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){qa.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){n&&n(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}};Og.prototype.isImageBitmapLoader=!0;var nf,p2={getContext:function(){return nf===void 0&&(nf=new(window.AudioContext||window.webkitAudioContext)),nf},setContext:function(i){nf=i}},Fg=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=this,o=new as(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{let l=a.slice(0);p2.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},r,n)}},Ug=class extends uh{constructor(e,t,r=1){super(void 0,r);let n=new be().set(e),s=new be().set(t),o=new M(n.r,n.g,n.b),a=new M(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}};Ug.prototype.isHemisphereLightProbe=!0;var zg=class extends uh{constructor(e,t=1){super(void 0,t);let r=new be().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}};zg.prototype.isAmbientLightProbe=!0;var Wf=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=sb(),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){let t=sb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function sb(){return(typeof performance>"u"?Date:performance).now()}var Gg=class extends ot{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;let 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}};var kg=class{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,t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}},Vg=class{constructor(e,t,r){this.binding=e,this.valueSize=r;let n,s,o;switch(t){case"quaternion":n=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":n=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:n=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=n,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){let r=this.buffer,n=this.valueSize,s=e*n+n,o=this.cumulativeWeight;if(o===0){for(let a=0;a!==n;++a)r[s+a]=r[a];o=t}else{o+=t;let a=t/o;this._mixBufferRegion(r,s,0,a,n)}this.cumulativeWeight=o}accumulateAdditive(e){let t=this.buffer,r=this.valueSize,n=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,r=this.buffer,n=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){let l=t*this._origIndex;this._mixBufferRegion(r,n,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(r[l]!==r[l+t]){a.setValue(r,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let s=r,o=n;s!==o;++s)t[s]=t[n+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,n,s){if(n>=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,n){zt.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,s){let o=this._workIndex*s;zt.multiplyQuaternionsFlat(e,o,e,t,e,r),zt.slerpFlat(e,t,e,t,e,o,n)}_lerp(e,t,r,n,s){let o=1-n;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[r+a]*n}}_lerpAdditive(e,t,r,n,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[r+o]*n}}},ny="\\[\\]\\.:\\/",m2=new RegExp("["+ny+"]","g"),iy="[^"+ny+"]",g2="[^"+ny.replace("\\.","")+"]",y2=/((?:WC+[\/:])*)/.source.replace("WC",iy),v2=/(WCOD+)?/.source.replace("WCOD",g2),x2=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",iy),b2=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",iy),w2=new RegExp("^"+y2+v2+x2+b2+"$"),S2=["material","materials","bones"],Hg=class{constructor(e,t,r){let n=r||bt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let r=this._targetGroup.nCachedObjects_,n=this._bindings[r];n!==void 0&&n.getValue(e,t)}setValue(e,t){let r=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=r.length;n!==s;++n)r[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},bt=class{constructor(e,t,r){this.path=t,this.parsedPath=r||bt.parseTrackName(t),this.node=bt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new bt.Composite(e,t,r):new bt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(m2,"")}static parseTrackName(e){let t=w2.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let s=r.nodeName.substring(n+1);S2.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){let r=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===t||a.uuid===t)return a;let l=r(a.children);if(l)return l}return null},n=r(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)e[t++]=r[n]}_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){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)r[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)r[n]=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,t=this.parsedPath,r=t.objectName,n=t.propertyName,s=t.propertyIndex;if(e||(e=bt.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(r){let c=t.objectIndex;switch(r){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 h=0;h<e.length;h++)if(e[h].name===c){c=h;break}break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}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]}}let o=e[n];if(o===void 0){let c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+n+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(n==="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}}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};bt.Composite=Hg;bt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};bt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};bt.prototype.GetterByBindingType=[bt.prototype._getValue_direct,bt.prototype._getValue_array,bt.prototype._getValue_arrayElement,bt.prototype._getValue_toArray];bt.prototype.SetterByBindingTypeAndVersioning=[[bt.prototype._setValue_direct,bt.prototype._setValue_direct_setNeedsUpdate,bt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_array,bt.prototype._setValue_array_setNeedsUpdate,bt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_arrayElement,bt.prototype._setValue_arrayElement_setNeedsUpdate,bt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_fromArray,bt.prototype._setValue_fromArray_setNeedsUpdate,bt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Wg=class{constructor(){this.uuid=Un(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let r=0,n=arguments.length;r!==n;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let 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(){let e=this._objects,t=this._indicesByUUID,r=this._paths,n=this._parsedPaths,s=this._bindings,o=s.length,a,l=e.length,c=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){let f=arguments[h],d=f.uuid,p=t[d];if(p===void 0){p=l++,t[d]=p,e.push(f);for(let m=0,g=o;m!==g;++m)s[m].push(new bt(f,r[m],n[m]))}else if(p<c){a=e[p];let m=--c,g=e[m];t[g.uuid]=p,e[p]=g,t[d]=m,e[m]=f;for(let v=0,y=o;v!==y;++v){let w=s[v],b=w[m],S=w[p];w[p]=b,S===void 0&&(S=new bt(f,r[v],n[v])),w[m]=S}}else e[p]!==a&&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(){let e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length,s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){let l=arguments[o],c=l.uuid,h=t[c];if(h!==void 0&&h>=s){let u=s++,f=e[u];t[f.uuid]=h,e[h]=f,t[c]=u,e[u]=l;for(let d=0,p=n;d!==p;++d){let m=r[d],g=m[u],v=m[h];m[h]=g,m[u]=v}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u<s){let f=--s,d=e[f],p=--o,m=e[p];t[d.uuid]=u,e[u]=d,t[m.uuid]=f,e[f]=m,e.pop();for(let g=0,v=n;g!==v;++g){let y=r[g],w=y[f],b=y[p];y[u]=w,y[f]=b,y.pop()}}else{let f=--o,d=e[f];f>0&&(t[d.uuid]=u),e[u]=d,e.pop();for(let p=0,m=n;p!==m;++p){let g=r[p];g[u]=g[f],g.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let r=this._bindingsIndicesByPath,n=r[e],s=this._bindings;if(n!==void 0)return s[n];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);n=s.length,r[e]=n,o.push(e),a.push(t),s.push(u);for(let f=h,d=l.length;f!==d;++f){let p=l[f];u[f]=new bt(p,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){let n=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=r,o[r]=l,o.pop(),s[r]=s[a],s.pop(),n[r]=n[a],n.pop()}}};Wg.prototype.isAnimationObjectGroup=!0;var jg=class{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Ea,endingEnd:Ea};for(let c=0;c!==o;++c){let h=s[c].createInterpolant(null);a[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=N_,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,r){if(e.fadeOut(t),this.fadeIn(t),r){let n=this._clip.duration,s=e._clip.duration,o=s/n,a=n/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){let 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,r){let n=this._mixer,s=n.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+r,c[0]=e/o,c[1]=t/o,this}stopWarping(){let 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,r,n){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*r;if(l<0||r===0)return;this._startTime=null,t=r*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case yb:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulateAdditive(a);break;case $g:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulate(n,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let r=this._weightInterpolant;if(r!==null){let n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),n===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let r=this._timeScaleInterpolant;r!==null&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,r=this.loop,n=this.time+e,s=this._loopCount,o=r===O_;if(e===0)return s===-1?n:o&&(s&1)===1?t-n:n;if(r===B_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else if(n<0)n=0;else{this.time=n;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,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)),n>=t||n<0){let a=Math.floor(n/t);n-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=n;if(o&&(s&1)===1)return t-n}return n}_setEndings(e,t,r){let n=this._interpolantSettings;r?(n.endingStart=Ca,n.endingEnd=Ca):(e?n.endingStart=this.zeroSlopeAtStart?Ca:Ea:n.endingStart=ff,t?n.endingEnd=this.zeroSlopeAtEnd?Ca:Ea:n.endingEnd=ff)}_scheduleFading(e,t,r){let n=this._mixer,s=n.time,o=this._weightInterpolant;o===null&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=r,this}},qg=class extends Yt{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let r=e._localRoot||this._root,n=e._clip.tracks,s=n.length,o=e._propertyBindings,a=e._interpolants,l=r.uuid,c=this._bindingsByRootAndName,h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){let f=n[u],d=f.name,p=h[d];if(p!==void 0)++p.referenceCount,o[u]=p;else{if(p=o[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}let m=t&&t._propertyBindings[u].binding.parsedPath;p=new Vg(bt.create(r,d,m),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),o[u]=p}a[u].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let r=(e._localRoot||this._root).uuid,n=e._clip.uuid,s=this._actionsByClip[n];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,n,r)}let t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){let s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){let s=t[r];--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;let 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){let t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,r){let n=this._actions,s=this._actionsByClip,o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{let a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=n.length,n.push(e),o.actionByRoot[r]=e}_removeInactiveAction(e){let t=this._actions,r=t[t.length-1],n=e._cacheIndex;r._cacheIndex=n,t[n]=r,t.pop(),e._cacheIndex=null;let s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,c=l[l.length-1],h=e._byClipCacheIndex;c._byClipCacheIndex=h,l[h]=c,l.pop(),e._byClipCacheIndex=null;let u=a.actionByRoot,f=(e._localRoot||this._root).uuid;delete u[f],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){let s=t[r];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){let t=this._actions,r=e._cacheIndex,n=this._nActiveActions++,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_takeBackAction(e){let t=this._actions,r=e._cacheIndex,n=--this._nActiveActions,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_addInactiveBinding(e,t,r){let n=this._bindingsByRootAndName,s=this._bindings,o=n[t];o===void 0&&(o={},n[t]=o),o[r]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){let t=this._bindings,r=e.binding,n=r.rootNode.uuid,s=r.path,o=this._bindingsByRootAndName,a=o[n],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[n]}_lendBinding(e){let t=this._bindings,r=e._cacheIndex,n=this._nActiveBindings++,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_takeBackBinding(e){let t=this._bindings,r=e._cacheIndex,n=--this._nActiveBindings,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,r=e[t];return r===void 0&&(r=new Nf(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){let t=this._controlInterpolants,r=e.__cacheIndex,n=--this._nActiveControlInterpolants,s=t[n];e.__cacheIndex=n,t[n]=e,s.__cacheIndex=r,t[r]=s}clipAction(e,t,r){let n=t||this._root,s=n.uuid,o=typeof e=="string"?Ff.findByName(n,e):e,a=o!==null?o.uuid:e,l=this._actionsByClip[a],c=null;if(r===void 0&&(o!==null?r=o.blendMode:r=$g),l!==void 0){let u=l.actionByRoot[s];if(u!==void 0&&u.blendMode===r)return u;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;let h=new jg(this,o,t,r);return this._bindAction(h,c),this._addInactiveAction(h,a,s),h}existingAction(e,t){let r=t||this._root,n=r.uuid,s=typeof e=="string"?Ff.findByName(r,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[n]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let r=t-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;let t=this._actions,r=this._nActiveActions,n=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==r;++c)t[c]._update(n,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,r=e.uuid,n=this._actionsByClip,s=n[r];if(s!==void 0){let o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){let c=o[a];this._deactivateAction(c);let h=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete n[r]}}uncacheRoot(e){let t=e.uuid,r=this._actionsByClip;for(let o in r){let a=r[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}let n=this._bindingsByRootAndName,s=n[t];if(s!==void 0)for(let o in s){let a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){let r=this.existingAction(e,t);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}};qg.prototype._controlInterpolantsResultBuffer=new Float32Array(1);var Ce=class{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Ce(this.value.clone===void 0?this.value:this.value.clone())}},Yg=class extends ss{constructor(e,t,r=1){super(e,t),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}};Yg.prototype.isInstancedInterleavedBuffer=!0;var Xg=class{constructor(e,t,r,n,s){this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=n,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}};Xg.prototype.isGLBufferAttribute=!0;var jf=class{constructor(e,t,r=0,n=1/0){this.ray=new oi(e,t),this.near=r,this.far=n,this.camera=null,this.layers=new Xc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,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.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=!0,r=[]){return Qg(e,this,r,t),r.sort(ob),r}intersectObjects(e,t=!0,r=[]){for(let n=0,s=e.length;n<s;n++)Qg(e[n],this,r,t);return r.sort(ob),r}};function ob(i,e){return i.distance-e.distance}function Qg(i,e,t,r){if(i.layers.test(e.layers)&&i.raycast(e,t),r===!0){let n=i.children;for(let s=0,o=n.length;s<o;s++)Qg(n[s],e,t,!0)}}var fh=class{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,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,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(xr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}};var ab=new B,Oo=class{constructor(e=new B(1/0,1/0),t=new B(-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,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let r=ab.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),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 ab.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)}};Oo.prototype.isBox2=!0;var lb=new M,sf=new M,Jr=class{constructor(e=new M,t=new M){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){lb.subVectors(e,this.start),sf.subVectors(this.end,this.start);let r=sf.dot(sf),s=sf.dot(lb)/r;return t&&(s=xr(s,0,1)),s}closestPointToPoint(e,t,r){let n=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(n).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)}},cb=new M,qf=class extends ot{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let r=new De,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){let c=o/l*Math.PI*2,h=a/l*Math.PI*2;n.push(Math.cos(c),Math.sin(c),1,Math.cos(h),Math.sin(h),1)}r.setAttribute("position",new Te(n,3));let s=new kr({fog:!1,toneMapped:!1});this.cone=new li(r,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),cb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(cb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},Cs=new M,of=new Ae,eg=new Ae,Jg=class extends li{constructor(e){let t=Bb(e),r=new De,n=[],s=[],o=new be(0,0,1),a=new be(0,1,0);for(let c=0;c<t.length;c++){let h=t[c];h.parent&&h.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}r.setAttribute("position",new Te(n,3)),r.setAttribute("color",new Te(s,3));let l=new kr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,l),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){let t=this.bones,r=this.geometry,n=r.getAttribute("position");eg.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){let a=t[s];a.parent&&a.parent.isBone&&(of.multiplyMatrices(eg,a.matrixWorld),Cs.setFromMatrixPosition(of),n.setXYZ(o,Cs.x,Cs.y,Cs.z),of.multiplyMatrices(eg,a.parent.matrixWorld),Cs.setFromMatrixPosition(of),n.setXYZ(o+1,Cs.x,Cs.y,Cs.z),o+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}};function Bb(i){let e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push.apply(e,Bb(i.children[t]));return e}var Yf=class extends Vt{constructor(e,t,r){let n=new Ro(t,4,2),s=new zn({wireframe:!0,fog:!1,toneMapped:!1});super(n,s),this.light=e,this.light.updateMatrixWorld(),this.color=r,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)}};var Kg=class extends li{constructor(e=10,t=10,r=4473924,n=8947848){r=new be(r),n=new be(n);let s=t/2,o=e/t,a=e/2,l=[],c=[];for(let f=0,d=0,p=-a;f<=t;f++,p+=o){l.push(-a,0,p,a,0,p),l.push(p,0,-a,p,0,a);let m=f===s?r:n;m.toArray(c,d),d+=3,m.toArray(c,d),d+=3,m.toArray(c,d),d+=3,m.toArray(c,d),d+=3}let h=new De;h.setAttribute("position",new Te(l,3)),h.setAttribute("color",new Te(c,3));let u=new kr({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}};var hb=new M,af=new M,ub=new M,Xf=class extends ot{constructor(e,t,r){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,t===void 0&&(t=1);let n=new De;n.setAttribute("position",new Te([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let s=new kr({fog:!1,toneMapped:!1});this.lightPlane=new os(n,s),this.add(this.lightPlane),n=new De,n.setAttribute("position",new Te([0,0,0,0,0,1],3)),this.targetLine=new os(n,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(){hb.setFromMatrixPosition(this.light.matrixWorld),af.setFromMatrixPosition(this.light.target.matrixWorld),ub.subVectors(af,hb),this.lightPlane.lookAt(af),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(af),this.targetLine.scale.z=ub.length()}},lf=new M,ir=new Gn,Hn=class extends li{constructor(e){let t=new De,r=new kr({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],s=[],o={},a=new be(16755200),l=new be(16711680),c=new be(43775),h=new be(16777215),u=new be(3355443);f("n1","n2",a),f("n2","n4",a),f("n4","n3",a),f("n3","n1",a),f("f1","f2",a),f("f2","f4",a),f("f4","f3",a),f("f3","f1",a),f("n1","f1",a),f("n2","f2",a),f("n3","f3",a),f("n4","f4",a),f("p","n1",l),f("p","n2",l),f("p","n3",l),f("p","n4",l),f("u1","u2",c),f("u2","u3",c),f("u3","u1",c),f("c","t",h),f("p","c",u),f("cn1","cn2",u),f("cn3","cn4",u),f("cf1","cf2",u),f("cf3","cf4",u);function f(p,m,g){d(p,g),d(m,g)}function d(p,m){n.push(0,0,0),s.push(m.r,m.g,m.b),o[p]===void 0&&(o[p]=[]),o[p].push(n.length/3-1)}t.setAttribute("position",new Te(n,3)),t.setAttribute("color",new Te(s,3)),super(t,r),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(){let e=this.geometry,t=this.pointMap,r=1,n=1;ir.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),cr("c",t,e,ir,0,0,-1),cr("t",t,e,ir,0,0,1),cr("n1",t,e,ir,-r,-n,-1),cr("n2",t,e,ir,r,-n,-1),cr("n3",t,e,ir,-r,n,-1),cr("n4",t,e,ir,r,n,-1),cr("f1",t,e,ir,-r,-n,1),cr("f2",t,e,ir,r,-n,1),cr("f3",t,e,ir,-r,n,1),cr("f4",t,e,ir,r,n,1),cr("u1",t,e,ir,r*.7,n*1.1,-1),cr("u2",t,e,ir,-r*.7,n*1.1,-1),cr("u3",t,e,ir,0,n*2,-1),cr("cf1",t,e,ir,-r,0,1),cr("cf2",t,e,ir,r,0,1),cr("cf3",t,e,ir,0,-n,1),cr("cf4",t,e,ir,0,n,1),cr("cn1",t,e,ir,-r,0,-1),cr("cn2",t,e,ir,r,0,-1),cr("cn3",t,e,ir,0,-n,-1),cr("cn4",t,e,ir,0,n,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function cr(i,e,t,r,n,s,o){lf.set(n,s,o).unproject(r);let a=e[i];if(a!==void 0){let l=t.getAttribute("position");for(let c=0,h=a.length;c<h;c++)l.setXYZ(a[c],lf.x,lf.y,lf.z)}}var Fo=class extends li{constructor(e,t=16776960){let r=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]),n=[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 De;s.setIndex(new Ve(r,1)),s.setAttribute("position",new Te(n,3)),super(s,new kr({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}};var Qf=class extends li{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new De;n.setAttribute("position",new Te(t,3)),n.setAttribute("color",new Te(r,3));let s=new kr({vertexColors:!0,toneMapped:!1});super(n,s),this.type="AxesHelper"}setColors(e,t,r){let n=new be,s=this.geometry.attributes.color.array;return n.set(e),n.toArray(s,0),n.toArray(s,3),n.set(t),n.toArray(s,6),n.toArray(s,9),n.set(r),n.toArray(s,12),n.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Jf=class{constructor(){this.type="ShapePath",this.color=new be,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Fa,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,n){return this.currentPath.quadraticCurveTo(e,t,r,n),this}bezierCurveTo(e,t,r,n,s,o){return this.currentPath.bezierCurveTo(e,t,r,n,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function r(y){let w=[];for(let b=0,S=y.length;b<S;b++){let T=y[b],A=new rn;A.curves=T.curves,w.push(A)}return w}function n(y,w){let b=w.length,S=!1;for(let T=b-1,A=0;A<b;T=A++){let x=w[T],_=w[A],E=_.x-x.x,C=_.y-x.y;if(Math.abs(C)>Number.EPSILON){if(C<0&&(x=w[A],E=-E,_=w[T],C=-C),y.y<x.y||y.y>_.y)continue;if(y.y===x.y){if(y.x===x.x)return!0}else{let I=C*(y.x-x.x)-E*(y.y-x.y);if(I===0)return!0;if(I<0)continue;S=!S}}else{if(y.y!==x.y)continue;if(_.x<=y.x&&y.x<=x.x||x.x<=y.x&&y.x<=_.x)return!0}}return S}let s=ii.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return r(o);let a,l,c,h=[];if(o.length===1)return l=o[0],c=new rn,c.curves=l.curves,h.push(c),h;let u=!s(o[0].getPoints());u=e?!u:u;let f=[],d=[],p=[],m=0,g;d[m]=void 0,p[m]=[];for(let y=0,w=o.length;y<w;y++)l=o[y],g=l.getPoints(),a=s(g),a=e?!a:a,a?(!u&&d[m]&&m++,d[m]={s:new rn,p:g},d[m].s.curves=l.curves,u&&m++,p[m]=[]):p[m].push({h:l,p:g[0]});if(!d[0])return r(o);if(d.length>1){let y=!1,w=0;for(let b=0,S=d.length;b<S;b++)f[b]=[];for(let b=0,S=d.length;b<S;b++){let T=p[b];for(let A=0;A<T.length;A++){let x=T[A],_=!0;for(let E=0;E<d.length;E++)n(x.p,d[E].p)&&(b!==E&&w++,_?(_=!1,f[E].push(x)):y=!0);_&&f[b].push(x)}}w>0&&y===!1&&(p=f)}let v;for(let y=0,w=d.length;y<w;y++){c=d[y].s,h.push(c),v=p[y];for(let b=0,S=v.length;b<S;b++)c.holes.push(v[b].h)}return h}};var Nb=new ArrayBuffer(4),SG=new Float32Array(Nb),MG=new Uint32Array(Nb),Ai=new Uint32Array(512),Ti=new Uint32Array(512);for(let i=0;i<256;++i){let e=i-127;e<-27?(Ai[i]=0,Ai[i|256]=32768,Ti[i]=24,Ti[i|256]=24):e<-14?(Ai[i]=1024>>-e-14,Ai[i|256]=1024>>-e-14|32768,Ti[i]=-e-1,Ti[i|256]=-e-1):e<=15?(Ai[i]=e+15<<10,Ai[i|256]=e+15<<10|32768,Ti[i]=13,Ti[i|256]=13):e<128?(Ai[i]=31744,Ai[i|256]=64512,Ti[i]=24,Ti[i|256]=24):(Ai[i]=31744,Ai[i|256]=64512,Ti[i]=13,Ti[i|256]=13)}var Ob=new Uint32Array(2048),dh=new Uint32Array(64),M2=new Uint32Array(64);for(let i=1;i<1024;++i){let e=i<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,Ob[i]=e|t}for(let i=1024;i<2048;++i)Ob[i]=939524096+(i-1024<<13);for(let i=1;i<31;++i)dh[i]=i<<23;dh[31]=1199570944;dh[32]=2147483648;for(let i=33;i<63;++i)dh[i]=2147483648+(i-32<<23);dh[63]=3347054592;for(let i=1;i<64;++i)i!==32&&(M2[i]=1024);xn.create=function(i,e){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(xn.prototype),i.prototype.constructor=i,i.prototype.getPoint=e,i};Fa.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)};Kg.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Jg.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};cn.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ng.extractUrlBase(i)};cn.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};Oo.prototype.center=function(i){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(i)};Oo.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Oo.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};Oo.prototype.size=function(i){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(i)};Kt.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)};Kt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Kt.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};Kt.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)};Kt.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)};yn.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")};Lr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Na.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)};Jr.prototype.center=function(i){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(i)};Ft.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)};Ft.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)};Ft.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};Ft.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)};Ft.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};Ft.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()};Ae.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)};Ae.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)};Ae.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new M().setFromMatrixColumn(this,3)};Ae.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)};Ae.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};Ae.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};Ae.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)};Ae.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};Ae.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};Ae.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};Ae.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};Ae.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};Ae.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};Ae.prototype.makeFrustum=function(i,e,t,r,n,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,e,r,t,n,s)};Ae.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()};Gr.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)};zt.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)};zt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};oi.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};oi.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)};oi.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)};Jt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};Jt.prototype.barycoordFromPoint=function(i,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,e)};Jt.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)};Jt.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)};Jt.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)};Jt.barycoordFromPoint=function(i,e,t,r,n){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Jt.getBarycoord(i,e,t,r,n)};Jt.normal=function(i,e,t,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Jt.getNormal(i,e,t,r)};rn.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)};rn.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Gs(this,i)};rn.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Io(this,i)};B.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};B.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)};B.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};M.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};M.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};M.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)};M.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)};M.prototype.getColumnFromMatrix=function(i,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,i)};M.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)};M.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};M.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)};M.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Je.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};Je.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};ot.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)};ot.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};ot.prototype.translate=function(i,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,i)};ot.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};ot.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)};Object.defineProperties(ot.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});Vt.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(Vt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),vb},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});bf.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};sr.prototype.setLens=function(i,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(i)};Object.defineProperties(bn.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}});Object.defineProperties(Ve.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===df},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(df)}}});Ve.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?df:Wc),this};Ve.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ve.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};De.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)};De.prototype.addAttribute=function(i,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new Ve(arguments[1],arguments[2]))):i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(i,e)};De.prototype.addDrawCall=function(i,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,e)};De.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};De.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};De.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)};De.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)};Object.defineProperties(De.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});ss.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?df:Wc),this};ss.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};Gs.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};Gs.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};Gs.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};on.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Ce.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties(ur.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new be}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===db}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(Mt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}});Dt.prototype.clearTarget=function(i,e,t,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(e,t,r)};Dt.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)};Dt.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};Dt.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};Dt.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};Dt.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};Dt.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};Dt.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};Dt.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};Dt.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};Dt.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};Dt.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};Dt.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};Dt.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};Dt.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)};Dt.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};Dt.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};Dt.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};Dt.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Dt.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};Dt.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};Dt.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};Dt.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};Dt.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};Dt.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(Dt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?je:gn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties(Cb.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(mt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}});Gg.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");let e=this;return new Fg().load(i,function(r){e.setBuffer(r)}),this};kg.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};Qc.prototype.updateCubeMap=function(i,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,e)};Qc.prototype.clear=function(i,e,t,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,e,t,r)};ns.crossOrigin=void 0;ns.loadTexture=function(i,e,t,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");let n=new Ig;n.setCrossOrigin(this.crossOrigin);let s=n.load(i,t,void 0,r);return e&&(s.mapping=e),s};ns.loadTextureCube=function(i,e,t,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");let n=new Lg;n.setCrossOrigin(this.crossOrigin);let s=n.load(i,t,void 0,r);return e&&(s.mapping=e),s};ns.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ns.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Kf=class extends mt{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Uo}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Uo);var Ja=".",ph=Symbol("target"),sy=Symbol("unsubscribe");function mh(i){return i instanceof Date||i instanceof Set||i instanceof Map||i instanceof WeakSet||i instanceof WeakMap||ArrayBuffer.isView(i)}function Fb(i){return(typeof i=="object"?i===null:typeof i!="function")||i instanceof RegExp}var Pn=Array.isArray;function zo(i){return typeof i=="symbol"}var A2={after:(i,e)=>Pn(i)?i.slice(e.length):e===""?i:i.slice(e.length+1),concat:(i,e)=>Pn(i)?(i=[...i],e&&i.push(e),i):e&&e.toString!==void 0?(i!==""&&(i+=Ja),zo(e)?i+e.toString():i+e):i,initial:i=>{if(Pn(i))return i.slice(0,-1);if(i==="")return i;let e=i.lastIndexOf(Ja);return e===-1?"":i.slice(0,e)},last:i=>{if(Pn(i))return i[i.length-1]||"";if(i==="")return i;let e=i.lastIndexOf(Ja);return e===-1?i:i.slice(e+1)},walk:(i,e)=>{if(Pn(i))for(let t of i)e(t);else if(i!==""){let t=0,r=i.indexOf(Ja);if(r===-1)e(i);else for(;t<i.length;)r===-1&&(r=i.length),e(i.slice(t,r)),t=r+1,r=i.indexOf(Ja,t)}},get(i,e){return this.walk(e,t=>{i&&(i=i[t])}),i}},hn=A2;function oy(i){return typeof i=="object"&&typeof i.next=="function"}function ay(i,e,t,r,n){let s=i.next;if(e.name==="entries")i.next=function(){let o=s.call(this);return o.done===!1&&(o.value[0]=n(o.value[0],e,o.value[0],r),o.value[1]=n(o.value[1],e,o.value[0],r)),o};else if(e.name==="values"){let o=t[ph].keys();i.next=function(){let a=s.call(this);return a.done===!1&&(a.value=n(a.value,e,o.next().value,r)),a}}else i.next=function(){let o=s.call(this);return o.done===!1&&(o.value=n(o.value,e,o.value,r)),o};return i}function td(i,e,t){return i.isUnsubscribed||e.ignoreSymbols&&zo(t)||e.ignoreUnderscores&&t.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(t)}var gh=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),r=t.get(e);return r===void 0&&(r={},t.set(e,r)),r}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let r=this._getProperties(e),n=r[t];return n===void 0&&(n=Reflect.getOwnPropertyDescriptor(e,t),r[t]=n),n}getProxy(e,t,r,n){if(this.isUnsubscribed)return e;let s=e[n],o=s||e;this._pathCache.set(o,t);let a=this._proxyCache.get(o);return a===void 0&&(a=s===void 0?new Proxy(e,r):e,this._proxyCache.set(o,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,hn.get(t,this.getPath(e)))}defineProperty(e,t,r){return Reflect.defineProperty(e,t,r)?(this.isUnsubscribed||(this._getProperties(e)[t]=r),!0):!1}setProperty(e,t,r,n,s){if(!this._equals(s,r)||!(t in e)){let o=this._getOwnPropertyDescriptor(e,t);return o!==void 0&&"set"in o?Reflect.set(e,t,r,n):Reflect.set(e,t,r)}return!0}deleteProperty(e,t,r){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(e);n&&(delete n[t],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,t,r){let n=this._getOwnPropertyDescriptor(t,r);return e!==void 0&&n!==void 0&&Object.is(e.value,n.value)&&(e.writable||!1)===(n.writable||!1)&&(e.enumerable||!1)===(n.enumerable||!1)&&(e.configurable||!1)===(n.configurable||!1)&&e.get===n.get&&e.set===n.set}isGetInvariant(e,t){let r=this._getOwnPropertyDescriptor(e,t);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function Ka(i){return toString.call(i)==="[object Object]"}function Za(){return!0}function qs(i,e){return i.length!==e.length||i.some((t,r)=>e[r]!==t)}var rd=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]);var T2=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),ly={push:Za,pop:Za,shift:Za,unshift:Za,copyWithin:qs,reverse:qs,sort:qs,splice:qs,flat:qs,fill:qs},Ub=new Set([...rd,...T2,...Object.keys(ly)]);function $a(i,e){if(i.size!==e.size)return!0;for(let t of i)if(!e.has(t))return!0;return!1}var cy=["keys","values","entries"],hy=new Set(["has","toString"]),uy={add:$a,clear:$a,delete:$a,forEach:$a},zb=new Set([...hy,...Object.keys(uy),...cy]);function el(i,e){if(i.size!==e.size)return!0;let t;for(let[r,n]of i)if(t=e.get(r),t!==n||t===void 0&&!e.has(r))return!0;return!1}var _2=new Set([...hy,"get"]),fy={set:el,clear:el,delete:el,forEach:el},Gb=new Set([..._2,...Object.keys(fy),...cy]);var Rr=class{constructor(e,t,r,n){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=t===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return rd.has(e)}_shallowClone(e){let t=e;if(Ka(e))t=se({},e);else if(Pn(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){t=new Map;for(let[r,n]of e.entries())t.set(r,this._shallowClone(n))}return this._clonedCache.add(t),t}preferredThisArg(e,t,r,n){return e?(Pn(n)?this._onIsChanged=ly[t]:n instanceof Set?this._onIsChanged=uy[t]:n instanceof Map&&(this._onIsChanged=fy[t]),n):r}update(e,t,r){let n=hn.after(e,this._path);if(t!=="length"){let s=this.clone;hn.walk(n,o=>{s&&s[o]&&(this._clonedCache.has(s[o])||(s[o]=this._shallowClone(s[o])),s=s[o])}),this._hasOnValidate&&this._changes.push({path:n,property:t,previous:r}),s&&s[t]&&(s[t]=r)}this._isChanged=!0}undo(e){let t;for(let r=this._changes.length-1;r!==-1;r--)t=this._changes[r],hn.get(e,t.path)[t.property]=t.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}};var tl=class extends Rr{static isHandledMethod(e){return Ub.has(e)}};var yh=class extends Rr{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}};var rl=class extends Rr{static isHandledMethod(e){return zb.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}};var nl=class extends Rr{static isHandledMethod(e){return Gb.has(e)}undo(e){for(let[t,r]of this.clone.entries())e.set(t,r);for(let t of e.keys())this.clone.has(t)||e.delete(t)}};var vh=class extends Rr{constructor(e,t,r,n){super(void 0,t,r,n),this._arg1=r[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}};var xh=class extends Rr{constructor(e,t,r,n){super(void 0,t,r,n),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}};var hi=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return Ka(e)||Pn(e)||mh(e)}static isHandledMethod(e,t){return Ka(e)?Rr.isHandledMethod(t):Pn(e)?tl.isHandledMethod(t):e instanceof Set?rl.isHandledMethod(t):e instanceof Map?nl.isHandledMethod(t):mh(e)}get isCloning(){return this._stack.length>0}start(e,t,r){let n=Rr;Pn(e)?n=tl:e instanceof Date?n=yh:e instanceof Set?n=rl:e instanceof Map?n=nl:e instanceof WeakSet?n=vh:e instanceof WeakMap&&(n=xh),this._stack.push(new n(e,t,r,this._hasOnValidate))}update(e,t,r){this._stack[this._stack.length-1].update(e,t,r)}preferredThisArg(e,t,r){let{name:n}=e,s=hi.isHandledMethod(r,n);return this._stack[this._stack.length-1].preferredThisArg(s,n,t,r)}isChanged(e,t,r){return this._stack[this._stack.length-1].isChanged(e,t,r)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}};var E2={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},dy=(i,e,t={})=>{t=se(se({},E2),t);let r=Symbol("ProxyTarget"),{equals:n,isShallow:s,ignoreDetached:o,details:a}=t,l=new gh(n),c=typeof t.onValidate=="function",h=new hi(c),u=(y,w,b,S,T)=>!c||h.isCloning||t.onValidate(hn.concat(l.getPath(y),w),b,S,T)===!0,f=(y,w,b,S)=>{!td(l,t,w)&&!(o&&l.isDetached(y,i))&&d(l.getPath(y),w,b,S)},d=(y,w,b,S,T)=>{h.isCloning?h.update(y,w,S):e(hn.concat(y,w),b,S,T)},p=y=>y&&(y[r]||y),m=(y,w,b,S)=>Fb(y)||b==="constructor"||s&&!hi.isHandledMethod(w,b)||td(l,t,b)||l.isGetInvariant(w,b)||o&&l.isDetached(w,i)?y:(S===void 0&&(S=l.getPath(w)),l.getProxy(y,hn.concat(S,b),g,r)),g={get(y,w,b){if(zo(w)){if(w===r||w===ph)return y;if(w===sy&&!l.isUnsubscribed&&l.getPath(y).length===0)return l.unsubscribe(),y}let S=mh(y)?Reflect.get(y,w):Reflect.get(y,w,b);return m(S,y,w)},set(y,w,b,S){b=p(b);let T=y[r]||y,A=T[w];if(n(A,b)&&w in y)return!0;let x=u(y,w,b,A);return x&&l.setProperty(T,w,b,S,A)?(f(y,w,y[w],A),!0):!x},defineProperty(y,w,b){if(!l.isSameDescriptor(b,y,w)){let S=y[w];u(y,w,b.value,S)&&l.defineProperty(y,w,b,S)&&f(y,w,b.value,S)}return!0},deleteProperty(y,w){if(!Reflect.has(y,w))return!0;let b=Reflect.get(y,w),S=u(y,w,void 0,b);return S&&l.deleteProperty(y,w,b)?(f(y,w,void 0,b),!0):!S},apply(y,w,b){let S=w[r]||w;if(l.isUnsubscribed)return Reflect.apply(y,S,b);if((a===!1||a!==!0&&!a.includes(y.name))&&hi.isHandledType(S)){let T=hn.initial(l.getPath(y)),A=hi.isHandledMethod(S,y.name);h.start(S,T,b);let x=Reflect.apply(y,h.preferredThisArg(y,w,S),A?b.map(C=>p(C)):b),_=h.isChanged(S,n),E=h.stop();if(hi.isHandledType(x)&&A&&(w instanceof Map&&y.name==="get"&&(T=hn.concat(T,b[0])),x=l.getProxy(x,T,g)),_){let C={name:y.name,args:b,result:x},I=h.isCloning?hn.initial(T):T,N=h.isCloning?hn.last(T):"";u(hn.get(i,I),N,S,E,C)?d(I,N,S,E,C):h.undo(S)}return(w instanceof Map||w instanceof Set)&&oy(x)?ay(x,y,w,T,m):x}return Reflect.apply(y,w,b)}},v=l.getProxy(i,t.pathAsArray?[]:"",g);return e=e.bind(v),c&&(t.onValidate=t.onValidate.bind(v)),v};dy.target=i=>i&&i[ph]||i;dy.unsubscribe=i=>i[sy]||i;var py=dy;var C2=typeof global=="object"&&global&&global.Object===Object&&global,nd=C2;var P2=typeof self=="object"&&self&&self.Object===Object&&self,D2=nd||P2||Function("return this")(),ar=D2;var L2=ar.Symbol,un=L2;var kb=Object.prototype,I2=kb.hasOwnProperty,R2=kb.toString,bh=un?un.toStringTag:void 0;function B2(i){var e=I2.call(i,bh),t=i[bh];try{i[bh]=void 0;var r=!0}catch{}var n=R2.call(i);return r&&(e?i[bh]=t:delete i[bh]),n}var Vb=B2;var N2=Object.prototype,O2=N2.toString;function F2(i){return O2.call(i)}var Hb=F2;var U2="[object Null]",z2="[object Undefined]",Wb=un?un.toStringTag:void 0;function G2(i){return i==null?i===void 0?z2:U2:Wb&&Wb in Object(i)?Vb(i):Hb(i)}var Dn=G2;function k2(i){return i!=null&&typeof i=="object"}var Kr=k2;var V2="[object Symbol]";function H2(i){return typeof i=="symbol"||Kr(i)&&Dn(i)==V2}var Ys=H2;function W2(i,e){for(var t=-1,r=i==null?0:i.length,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n}var id=W2;var j2=Array.isArray,Vr=j2;var q2=1/0,jb=un?un.prototype:void 0,qb=jb?jb.toString:void 0;function Yb(i){if(typeof i=="string")return i;if(Vr(i))return id(i,Yb)+"";if(Ys(i))return qb?qb.call(i):"";var e=i+"";return e=="0"&&1/i==-q2?"-0":e}var Xb=Yb;var Y2=/\s/;function X2(i){for(var e=i.length;e--&&Y2.test(i.charAt(e)););return e}var Qb=X2;var Q2=/^\s+/;function J2(i){return i&&i.slice(0,Qb(i)+1).replace(Q2,"")}var Jb=J2;function K2(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var fr=K2;var Kb=0/0,Z2=/^[-+]0x[0-9a-f]+$/i,$2=/^0b[01]+$/i,eI=/^0o[0-7]+$/i,tI=parseInt;function rI(i){if(typeof i=="number")return i;if(Ys(i))return Kb;if(fr(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=fr(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Jb(i);var t=$2.test(i);return t||eI.test(i)?tI(i.slice(2),t?2:8):Z2.test(i)?Kb:+i}var my=rI;function nI(i){return i}var sd=nI;var iI="[object AsyncFunction]",sI="[object Function]",oI="[object GeneratorFunction]",aI="[object Proxy]";function lI(i){if(!fr(i))return!1;var e=Dn(i);return e==sI||e==oI||e==iI||e==aI}var il=lI;var cI=ar["__core-js_shared__"],od=cI;var Zb=function(){var i=/[^.]+$/.exec(od&&od.keys&&od.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function hI(i){return!!Zb&&Zb in i}var $b=hI;var uI=Function.prototype,fI=uI.toString;function dI(i){if(i!=null){try{return fI.call(i)}catch{}try{return i+""}catch{}}return""}var ls=dI;var pI=/[\\^$.*+?()[\]{}|]/g,mI=/^\[object .+?Constructor\]$/,gI=Function.prototype,yI=Object.prototype,vI=gI.toString,xI=yI.hasOwnProperty,bI=RegExp("^"+vI.call(xI).replace(pI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wI(i){if(!fr(i)||$b(i))return!1;var e=il(i)?bI:mI;return e.test(ls(i))}var ew=wI;function SI(i,e){return i==null?void 0:i[e]}var tw=SI;function MI(i,e){var t=tw(i,e);return ew(t)?t:void 0}var wn=MI;var AI=wn(ar,"WeakMap"),ad=AI;var rw=Object.create,TI=function(){function i(){}return function(e){if(!fr(e))return{};if(rw)return rw(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}}(),nw=TI;function _I(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}var iw=_I;function EI(i,e){var t=-1,r=i.length;for(e||(e=Array(r));++t<r;)e[t]=i[t];return e}var ld=EI;var CI=800,PI=16,DI=Date.now;function LI(i){var e=0,t=0;return function(){var r=DI(),n=PI-(r-t);if(t=r,n>0){if(++e>=CI)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}var sw=LI;function II(i){return function(){return i}}var ow=II;var RI=function(){try{var i=wn(Object,"defineProperty");return i({},"",{}),i}catch{}}(),sl=RI;var BI=sl?function(i,e){return sl(i,"toString",{configurable:!0,enumerable:!1,value:ow(e),writable:!0})}:sd,aw=BI;var NI=sw(aw),cd=NI;function OI(i,e){for(var t=-1,r=i==null?0:i.length;++t<r&&e(i[t],t,i)!==!1;);return i}var lw=OI;var FI=9007199254740991,UI=/^(?:0|[1-9]\d*)$/;function zI(i,e){var t=typeof i;return e=e==null?FI:e,!!e&&(t=="number"||t!="symbol"&&UI.test(i))&&i>-1&&i%1==0&&i<e}var hd=zI;function GI(i,e,t){e=="__proto__"&&sl?sl(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}var ol=GI;function kI(i,e){return i===e||i!==i&&e!==e}var Xs=kI;var VI=Object.prototype,HI=VI.hasOwnProperty;function WI(i,e,t){var r=i[e];(!(HI.call(i,e)&&Xs(r,t))||t===void 0&&!(e in i))&&ol(i,e,t)}var ud=WI;function jI(i,e,t,r){var n=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],i[a],a,t,i):void 0;l===void 0&&(l=i[a]),n?ol(t,a,l):ud(t,a,l)}return t}var Wn=jI;var cw=Math.max;function qI(i,e,t){return e=cw(e===void 0?i.length-1:e,0),function(){for(var r=arguments,n=-1,s=cw(r.length-e,0),o=Array(s);++n<s;)o[n]=r[e+n];n=-1;for(var a=Array(e+1);++n<e;)a[n]=r[n];return a[e]=t(o),iw(i,this,a)}}var fd=qI;function YI(i,e){return cd(fd(i,e,sd),i+"")}var hw=YI;var XI=9007199254740991;function QI(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=XI}var dd=QI;function JI(i){return i!=null&&dd(i.length)&&!il(i)}var Qs=JI;function KI(i,e,t){if(!fr(t))return!1;var r=typeof e;return(r=="number"?Qs(t)&&hd(e,t.length):r=="string"&&e in t)?Xs(t[e],i):!1}var uw=KI;function ZI(i){return hw(function(e,t){var r=-1,n=t.length,s=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(s=i.length>3&&typeof s=="function"?(n--,s):void 0,o&&uw(t[0],t[1],o)&&(s=n<3?void 0:s,n=1),e=Object(e);++r<n;){var a=t[r];a&&i(e,a,r,s)}return e})}var fw=ZI;var $I=Object.prototype;function eR(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||$I;return i===t}var al=eR;function tR(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r}var dw=tR;var rR="[object Arguments]";function nR(i){return Kr(i)&&Dn(i)==rR}var gy=nR;var pw=Object.prototype,iR=pw.hasOwnProperty,sR=pw.propertyIsEnumerable,oR=gy(function(){return arguments}())?gy:function(i){return Kr(i)&&iR.call(i,"callee")&&!sR.call(i,"callee")},Go=oR;function aR(){return!1}var mw=aR;var vw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gw=vw&&typeof module=="object"&&module&&!module.nodeType&&module,lR=gw&&gw.exports===vw,yw=lR?ar.Buffer:void 0,cR=yw?yw.isBuffer:void 0,hR=cR||mw,ll=hR;var uR="[object Arguments]",fR="[object Array]",dR="[object Boolean]",pR="[object Date]",mR="[object Error]",gR="[object Function]",yR="[object Map]",vR="[object Number]",xR="[object Object]",bR="[object RegExp]",wR="[object Set]",SR="[object String]",MR="[object WeakMap]",AR="[object ArrayBuffer]",TR="[object DataView]",_R="[object Float32Array]",ER="[object Float64Array]",CR="[object Int8Array]",PR="[object Int16Array]",DR="[object Int32Array]",LR="[object Uint8Array]",IR="[object Uint8ClampedArray]",RR="[object Uint16Array]",BR="[object Uint32Array]",Xt={};Xt[_R]=Xt[ER]=Xt[CR]=Xt[PR]=Xt[DR]=Xt[LR]=Xt[IR]=Xt[RR]=Xt[BR]=!0;Xt[uR]=Xt[fR]=Xt[AR]=Xt[dR]=Xt[TR]=Xt[pR]=Xt[mR]=Xt[gR]=Xt[yR]=Xt[vR]=Xt[xR]=Xt[bR]=Xt[wR]=Xt[SR]=Xt[MR]=!1;function NR(i){return Kr(i)&&dd(i.length)&&!!Xt[Dn(i)]}var xw=NR;function OR(i){return function(e){return i(e)}}var cl=OR;var bw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wh=bw&&typeof module=="object"&&module&&!module.nodeType&&module,FR=wh&&wh.exports===bw,yy=FR&&nd.process,UR=function(){try{var i=wh&&wh.require&&wh.require("util").types;return i||yy&&yy.binding&&yy.binding("util")}catch{}}(),cs=UR;var ww=cs&&cs.isTypedArray,zR=ww?cl(ww):xw,pd=zR;var GR=Object.prototype,kR=GR.hasOwnProperty;function VR(i,e){var t=Vr(i),r=!t&&Go(i),n=!t&&!r&&ll(i),s=!t&&!r&&!n&&pd(i),o=t||r||n||s,a=o?dw(i.length,String):[],l=a.length;for(var c in i)(e||kR.call(i,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hd(c,l)))&&a.push(c);return a}var md=VR;function HR(i,e){return function(t){return i(e(t))}}var gd=HR;var WR=gd(Object.keys,Object),Sw=WR;var jR=Object.prototype,qR=jR.hasOwnProperty;function YR(i){if(!al(i))return Sw(i);var e=[];for(var t in Object(i))qR.call(i,t)&&t!="constructor"&&e.push(t);return e}var Mw=YR;function XR(i){return Qs(i)?md(i):Mw(i)}var hl=XR;function QR(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e}var Aw=QR;var JR=Object.prototype,KR=JR.hasOwnProperty;function ZR(i){if(!fr(i))return Aw(i);var e=al(i),t=[];for(var r in i)r=="constructor"&&(e||!KR.call(i,r))||t.push(r);return t}var Tw=ZR;function $R(i){return Qs(i)?md(i,!0):Tw(i)}var Pi=$R;var eB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tB=/^\w*$/;function rB(i,e){if(Vr(i))return!1;var t=typeof i;return t=="number"||t=="symbol"||t=="boolean"||i==null||Ys(i)?!0:tB.test(i)||!eB.test(i)||e!=null&&i in Object(e)}var _w=rB;var nB=wn(Object,"create"),hs=nB;function iB(){this.__data__=hs?hs(null):{},this.size=0}var Ew=iB;function sB(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var Cw=sB;var oB="__lodash_hash_undefined__",aB=Object.prototype,lB=aB.hasOwnProperty;function cB(i){var e=this.__data__;if(hs){var t=e[i];return t===oB?void 0:t}return lB.call(e,i)?e[i]:void 0}var Pw=cB;var hB=Object.prototype,uB=hB.hasOwnProperty;function fB(i){var e=this.__data__;return hs?e[i]!==void 0:uB.call(e,i)}var Dw=fB;var dB="__lodash_hash_undefined__";function pB(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=hs&&e===void 0?dB:e,this}var Lw=pB;function ul(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1])}}ul.prototype.clear=Ew;ul.prototype.delete=Cw;ul.prototype.get=Pw;ul.prototype.has=Dw;ul.prototype.set=Lw;var vy=ul;function mB(){this.__data__=[],this.size=0}var Iw=mB;function gB(i,e){for(var t=i.length;t--;)if(Xs(i[t][0],e))return t;return-1}var Js=gB;var yB=Array.prototype,vB=yB.splice;function xB(i){var e=this.__data__,t=Js(e,i);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():vB.call(e,t,1),--this.size,!0}var Rw=xB;function bB(i){var e=this.__data__,t=Js(e,i);return t<0?void 0:e[t][1]}var Bw=bB;function wB(i){return Js(this.__data__,i)>-1}var Nw=wB;function SB(i,e){var t=this.__data__,r=Js(t,i);return r<0?(++this.size,t.push([i,e])):t[r][1]=e,this}var Ow=SB;function fl(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1])}}fl.prototype.clear=Iw;fl.prototype.delete=Rw;fl.prototype.get=Bw;fl.prototype.has=Nw;fl.prototype.set=Ow;var Ks=fl;var MB=wn(ar,"Map"),Zs=MB;function AB(){this.size=0,this.__data__={hash:new vy,map:new(Zs||Ks),string:new vy}}var Fw=AB;function TB(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}var Uw=TB;function _B(i,e){var t=i.__data__;return Uw(e)?t[typeof e=="string"?"string":"hash"]:t.map}var $s=_B;function EB(i){var e=$s(this,i).delete(i);return this.size-=e?1:0,e}var zw=EB;function CB(i){return $s(this,i).get(i)}var Gw=CB;function PB(i){return $s(this,i).has(i)}var kw=PB;function DB(i,e){var t=$s(this,i),r=t.size;return t.set(i,e),this.size+=t.size==r?0:1,this}var Vw=DB;function dl(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1])}}dl.prototype.clear=Fw;dl.prototype.delete=zw;dl.prototype.get=Gw;dl.prototype.has=kw;dl.prototype.set=Vw;var Sh=dl;var LB="Expected a function";function xy(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError(LB);var t=function(){var r=arguments,n=e?e.apply(this,r):r[0],s=t.cache;if(s.has(n))return s.get(n);var o=i.apply(this,r);return t.cache=s.set(n,o)||s,o};return t.cache=new(xy.Cache||Sh),t}xy.Cache=Sh;var Hw=xy;var IB=500;function RB(i){var e=Hw(i,function(r){return t.size===IB&&t.clear(),r}),t=e.cache;return e}var Ww=RB;var BB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,NB=/\\(\\)?/g,OB=Ww(function(i){var e=[];return i.charCodeAt(0)===46&&e.push(""),i.replace(BB,function(t,r,n,s){e.push(n?s.replace(NB,"$1"):r||t)}),e}),jw=OB;function FB(i){return i==null?"":Xb(i)}var qw=FB;function UB(i,e){return Vr(i)?i:_w(i,e)?[i]:jw(qw(i))}var pl=UB;var zB=1/0;function GB(i){if(typeof i=="string"||Ys(i))return i;var e=i+"";return e=="0"&&1/i==-zB?"-0":e}var yd=GB;function kB(i,e){e=pl(e,i);for(var t=0,r=e.length;i!=null&&t<r;)i=i[yd(e[t++])];return t&&t==r?i:void 0}var Yw=kB;function VB(i,e){for(var t=-1,r=e.length,n=i.length;++t<r;)i[n+t]=e[t];return i}var ml=VB;var Xw=un?un.isConcatSpreadable:void 0;function HB(i){return Vr(i)||Go(i)||!!(Xw&&i&&i[Xw])}var Qw=HB;function Jw(i,e,t,r,n){var s=-1,o=i.length;for(t||(t=Qw),n||(n=[]);++s<o;){var a=i[s];e>0&&t(a)?e>1?Jw(a,e-1,t,r,n):ml(n,a):r||(n[n.length]=a)}return n}var Kw=Jw;function WB(i){var e=i==null?0:i.length;return e?Kw(i,1):[]}var Zw=WB;function jB(i){return cd(fd(i,void 0,Zw),i+"")}var $w=jB;var qB=gd(Object.getPrototypeOf,Object),gl=qB;var YB="[object Object]",XB=Function.prototype,QB=Object.prototype,eS=XB.toString,JB=QB.hasOwnProperty,KB=eS.call(Object);function ZB(i){if(!Kr(i)||Dn(i)!=YB)return!1;var e=gl(i);if(e===null)return!0;var t=JB.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&eS.call(t)==KB}var vd=ZB;function $B(i,e,t){var r=-1,n=i.length;e<0&&(e=-e>n?0:n+e),t=t>n?n:t,t<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(n);++r<n;)s[r]=i[r+e];return s}var tS=$B;function eN(){this.__data__=new Ks,this.size=0}var rS=eN;function tN(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t}var nS=tN;function rN(i){return this.__data__.get(i)}var iS=rN;function nN(i){return this.__data__.has(i)}var sS=nN;var iN=200;function sN(i,e){var t=this.__data__;if(t instanceof Ks){var r=t.__data__;if(!Zs||r.length<iN-1)return r.push([i,e]),this.size=++t.size,this;t=this.__data__=new Sh(r)}return t.set(i,e),this.size=t.size,this}var oS=sN;function yl(i){var e=this.__data__=new Ks(i);this.size=e.size}yl.prototype.clear=rS;yl.prototype.delete=nS;yl.prototype.get=iS;yl.prototype.has=sS;yl.prototype.set=oS;var xd=yl;function oN(i,e){return i&&Wn(e,hl(e),i)}var aS=oN;function aN(i,e){return i&&Wn(e,Pi(e),i)}var lS=aN;var fS=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cS=fS&&typeof module=="object"&&module&&!module.nodeType&&module,lN=cS&&cS.exports===fS,hS=lN?ar.Buffer:void 0,uS=hS?hS.allocUnsafe:void 0;function cN(i,e){if(e)return i.slice();var t=i.length,r=uS?uS(t):new i.constructor(t);return i.copy(r),r}var bd=cN;function hN(i,e){for(var t=-1,r=i==null?0:i.length,n=0,s=[];++t<r;){var o=i[t];e(o,t,i)&&(s[n++]=o)}return s}var dS=hN;function uN(){return[]}var wd=uN;var fN=Object.prototype,dN=fN.propertyIsEnumerable,pS=Object.getOwnPropertySymbols,pN=pS?function(i){return i==null?[]:(i=Object(i),dS(pS(i),function(e){return dN.call(i,e)}))}:wd,vl=pN;function mN(i,e){return Wn(i,vl(i),e)}var mS=mN;var gN=Object.getOwnPropertySymbols,yN=gN?function(i){for(var e=[];i;)ml(e,vl(i)),i=gl(i);return e}:wd,Sd=yN;function vN(i,e){return Wn(i,Sd(i),e)}var gS=vN;function xN(i,e,t){var r=e(i);return Vr(i)?r:ml(r,t(i))}var Md=xN;function bN(i){return Md(i,hl,vl)}var yS=bN;function wN(i){return Md(i,Pi,Sd)}var Ad=wN;var SN=wn(ar,"DataView"),Td=SN;var MN=wn(ar,"Promise"),_d=MN;var AN=wn(ar,"Set"),Ed=AN;var vS="[object Map]",TN="[object Object]",xS="[object Promise]",bS="[object Set]",wS="[object WeakMap]",SS="[object DataView]",_N=ls(Td),EN=ls(Zs),CN=ls(_d),PN=ls(Ed),DN=ls(ad),ko=Dn;(Td&&ko(new Td(new ArrayBuffer(1)))!=SS||Zs&&ko(new Zs)!=vS||_d&&ko(_d.resolve())!=xS||Ed&&ko(new Ed)!=bS||ad&&ko(new ad)!=wS)&&(ko=function(i){var e=Dn(i),t=e==TN?i.constructor:void 0,r=t?ls(t):"";if(r)switch(r){case _N:return SS;case EN:return vS;case CN:return xS;case PN:return bS;case DN:return wS}return e});var xl=ko;var LN=Object.prototype,IN=LN.hasOwnProperty;function RN(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&IN.call(i,"index")&&(t.index=i.index,t.input=i.input),t}var MS=RN;var BN=ar.Uint8Array,by=BN;function NN(i){var e=new i.constructor(i.byteLength);return new by(e).set(new by(i)),e}var bl=NN;function ON(i,e){var t=e?bl(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength)}var AS=ON;var FN=/\w*$/;function UN(i){var e=new i.constructor(i.source,FN.exec(i));return e.lastIndex=i.lastIndex,e}var TS=UN;var _S=un?un.prototype:void 0,ES=_S?_S.valueOf:void 0;function zN(i){return ES?Object(ES.call(i)):{}}var CS=zN;function GN(i,e){var t=e?bl(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length)}var Cd=GN;var kN="[object Boolean]",VN="[object Date]",HN="[object Map]",WN="[object Number]",jN="[object RegExp]",qN="[object Set]",YN="[object String]",XN="[object Symbol]",QN="[object ArrayBuffer]",JN="[object DataView]",KN="[object Float32Array]",ZN="[object Float64Array]",$N="[object Int8Array]",e3="[object Int16Array]",t3="[object Int32Array]",r3="[object Uint8Array]",n3="[object Uint8ClampedArray]",i3="[object Uint16Array]",s3="[object Uint32Array]";function o3(i,e,t){var r=i.constructor;switch(e){case QN:return bl(i);case kN:case VN:return new r(+i);case JN:return AS(i,t);case KN:case ZN:case $N:case e3:case t3:case r3:case n3:case i3:case s3:return Cd(i,t);case HN:return new r;case WN:case YN:return new r(i);case jN:return TS(i);case qN:return new r;case XN:return CS(i)}}var PS=o3;function a3(i){return typeof i.constructor=="function"&&!al(i)?nw(gl(i)):{}}var Pd=a3;var l3="[object Map]";function c3(i){return Kr(i)&&xl(i)==l3}var DS=c3;var LS=cs&&cs.isMap,h3=LS?cl(LS):DS,IS=h3;var u3="[object Set]";function f3(i){return Kr(i)&&xl(i)==u3}var RS=f3;var BS=cs&&cs.isSet,d3=BS?cl(BS):RS,NS=d3;var p3=1,m3=2,g3=4,OS="[object Arguments]",y3="[object Array]",v3="[object Boolean]",x3="[object Date]",b3="[object Error]",FS="[object Function]",w3="[object GeneratorFunction]",S3="[object Map]",M3="[object Number]",US="[object Object]",A3="[object RegExp]",T3="[object Set]",_3="[object String]",E3="[object Symbol]",C3="[object WeakMap]",P3="[object ArrayBuffer]",D3="[object DataView]",L3="[object Float32Array]",I3="[object Float64Array]",R3="[object Int8Array]",B3="[object Int16Array]",N3="[object Int32Array]",O3="[object Uint8Array]",F3="[object Uint8ClampedArray]",U3="[object Uint16Array]",z3="[object Uint32Array]",Wt={};Wt[OS]=Wt[y3]=Wt[P3]=Wt[D3]=Wt[v3]=Wt[x3]=Wt[L3]=Wt[I3]=Wt[R3]=Wt[B3]=Wt[N3]=Wt[S3]=Wt[M3]=Wt[US]=Wt[A3]=Wt[T3]=Wt[_3]=Wt[E3]=Wt[O3]=Wt[F3]=Wt[U3]=Wt[z3]=!0;Wt[b3]=Wt[FS]=Wt[C3]=!1;function Dd(i,e,t,r,n,s){var o,a=e&p3,l=e&m3,c=e&g3;if(t&&(o=n?t(i,r,n,s):t(i)),o!==void 0)return o;if(!fr(i))return i;var h=Vr(i);if(h){if(o=MS(i),!a)return ld(i,o)}else{var u=xl(i),f=u==FS||u==w3;if(ll(i))return bd(i,a);if(u==US||u==OS||f&&!n){if(o=l||f?{}:Pd(i),!a)return l?gS(i,lS(o,i)):mS(i,aS(o,i))}else{if(!Wt[u])return n?i:{};o=PS(i,u,a)}}s||(s=new xd);var d=s.get(i);if(d)return d;s.set(i,o),NS(i)?i.forEach(function(g){o.add(Dd(g,e,t,g,i,s))}):IS(i)&&i.forEach(function(g,v){o.set(v,Dd(g,e,t,v,i,s))});var p=c?l?Ad:yS:l?Pi:hl,m=h?void 0:p(i);return lw(m||i,function(g,v){m&&(v=g,g=i[v]),ud(o,v,Dd(g,e,t,v,i,s))}),o}var Ld=Dd;var G3=1,k3=4;function V3(i){return Ld(i,G3|k3)}var Mh=V3;function H3(i){return function(e,t,r){for(var n=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[i?a:++n];if(t(s[l],l,s)===!1)break}return e}}var zS=H3;var W3=zS(),GS=W3;var j3=function(){return ar.Date.now()},Id=j3;var q3="Expected a function",Y3=Math.max,X3=Math.min;function Q3(i,e,t){var r,n,s,o,a,l,c=0,h=!1,u=!1,f=!0;if(typeof i!="function")throw new TypeError(q3);e=my(e)||0,fr(t)&&(h=!!t.leading,u="maxWait"in t,s=u?Y3(my(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(T){var A=r,x=n;return r=n=void 0,c=T,o=i.apply(x,A),o}function p(T){return c=T,a=setTimeout(v,e),h?d(T):o}function m(T){var A=T-l,x=T-c,_=e-A;return u?X3(_,s-x):_}function g(T){var A=T-l,x=T-c;return l===void 0||A>=e||A<0||u&&x>=s}function v(){var T=Id();if(g(T))return y(T);a=setTimeout(v,m(T))}function y(T){return a=void 0,f&&r?d(T):(r=n=void 0,o)}function w(){a!==void 0&&clearTimeout(a),c=0,r=l=n=a=void 0}function b(){return a===void 0?o:y(Id())}function S(){var T=Id(),A=g(T);if(r=arguments,n=this,l=T,A){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(v,e),d(l)}return a===void 0&&(a=setTimeout(v,e)),o}return S.cancel=w,S.flush=b,S}var Ah=Q3;function J3(i,e,t){(t!==void 0&&!Xs(i[e],t)||t===void 0&&!(e in i))&&ol(i,e,t)}var Th=J3;function K3(i){return Kr(i)&&Qs(i)}var kS=K3;function Z3(i,e){if(!(e==="constructor"&&typeof i[e]=="function")&&e!="__proto__")return i[e]}var _h=Z3;function $3(i){return Wn(i,Pi(i))}var VS=$3;function eO(i,e,t,r,n,s,o){var a=_h(i,t),l=_h(e,t),c=o.get(l);if(c){Th(i,t,c);return}var h=s?s(a,l,t+"",i,e,o):void 0,u=h===void 0;if(u){var f=Vr(l),d=!f&&ll(l),p=!f&&!d&&pd(l);h=l,f||d||p?Vr(a)?h=a:kS(a)?h=ld(a):d?(u=!1,h=bd(l,!0)):p?(u=!1,h=Cd(l,!0)):h=[]:vd(l)||Go(l)?(h=a,Go(a)?h=VS(a):(!fr(a)||il(a))&&(h=Pd(l))):u=!1}u&&(o.set(l,h),n(h,l,r,s,o),o.delete(l)),Th(i,t,h)}var HS=eO;function WS(i,e,t,r,n){i!==e&&GS(e,function(s,o){if(n||(n=new xd),fr(s))HS(i,e,o,t,WS,r,n);else{var a=r?r(_h(i,o),s,o+"",i,e,n):void 0;a===void 0&&(a=s),Th(i,o,a)}},Pi)}var jS=WS;function tO(i){var e=i==null?0:i.length;return e?i[e-1]:void 0}var qS=tO;function rO(i,e){return e.length<2?i:Yw(i,tS(e,0,-1))}var YS=rO;var nO=fw(function(i,e,t){jS(i,e,t)}),Vo=nO;function iO(i,e){return e=pl(e,i),i=YS(i,e),i==null||delete i[yd(qS(e))]}var XS=iO;function sO(i){return vd(i)?void 0:i}var QS=sO;var oO=1,aO=2,lO=4,cO=$w(function(i,e){var t={};if(i==null)return t;var r=!1;e=id(e,function(s){return s=pl(s,i),r||(r=s.length>1),s}),Wn(i,Ad(i),t),r&&(t=Ld(t,oO|aO|lO,QS));for(var n=e.length;n--;)XS(t,e[n]);return t}),wl=cO;var JS=i=>new Promise(e=>setTimeout(e,i));var hO=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().includes(" electron/"),uO=()=>typeof window>"u"?!1:window.navigator.platform.toUpperCase().includes("MAC"),fO=()=>typeof window>"u"?!1:/iPad|iPhone|iPod/.test(window.navigator.userAgent)||Eh&&"ontouchend"in document,dO=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,pO=()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,mO=()=>{let i=navigator.userAgent,e=navigator.vendor;return/Safari/i.test(i)&&/Apple Computer/.test(e)},s9=hO(),Eh=uO(),Ho=fO(),KS=dO(),Rd=pO(),ZS=mO();function $S(i){return Array.isArray(i)?i:[i]}function Ch(i){return Eh?i.metaKey:i.ctrlKey}var eo;(t=>{t.all=["PerspectiveCamera","OrthographicCamera"];function e(r){return t.all.includes(r)}t.is=e})(eo||(eo={}));var Wo;(n=>{n.DefaultUp=[0,1,0],n.DefaultTargetOffset=1e3,n.defaultData={far:1e5,type:"OrthographicCamera",perspective:{near:5,fov:45,zoom:1},orthographic:{near:-1e5,zoom:1},up:n.DefaultUp,isUpVectorFlipped:!1,targetOffset:n.DefaultTargetOffset};function r(s){return s.type==="PerspectiveCamera"?s.perspective.zoom:s.orthographic.zoom}n.getZoom=r})(Wo||(Wo={}));var us;(t=>{function i(r,n){return r[0]===n[0]&&r[1]===n[1]}t.isEqual=i;function e(r,n,s){return[r[0]+(n[0]-r[0])*s,r[1]+(n[1]-r[1])*s]}t.lerp=e})(us||(us={}));var br;(n=>{function i(s,o){return s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]}n.isEqual=i;function e(s,o){return[s[0]+o[0],s[1]+o[1],s[2]+o[2]]}n.add=e;function t(s,o){return[s[0]-o[0],s[1]-o[1],s[2]-o[2]]}n.sub=t;function r(s,o,a){return[s[0]+(o[0]-s[0])*a,s[1]+(o[1]-s[1])*a,s[2]+(o[2]-s[2])*a]}n.lerp=r})(br||(br={}));var Ph;(t=>{function i(r,n){return r[0]===n[0]&&r[1]===n[1]&&r[2]===n[2]&&r[3]===n[3]}t.isEqual=i;function e(r,n,s){return[r[0]+(n[0]-r[0])*s,r[1]+(n[1]-r[1])*s,r[2]+(n[2]-r[2])*s,r[3]+(n[3]-r[3])*s]}t.lerp=e})(Ph||(Ph={}));var Di;(n=>{n.identity=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function e(s,o){for(let a=0;a<16;a++)if(s[a]!==o[a])return!1;return!0}n.isEqual=e;function t(s){return s!=null?s:n.identity}n.simplify=t;function r(s,o){let a=o.slice(0);for(var l=0,c=o.length;l<c;l+=3){let h=s[3]*o[l]+s[7]*o[l+1]+s[11]*o[l+2]+s[15];a[l]=(s[0]*o[l]+s[4]*o[l+1]+s[8]*o[l+2]+s[12])/h,a[l+1]=(s[1]*o[l]+s[5]*o[l+1]+s[9]*o[l+2]+s[13])/h,a[l+2]=(s[2]*o[l]+s[6]*o[l+1]+s[10]*o[l+2]+s[14])/h}return a}n.applyMatrix4=r})(Di||(Di={}));var Ar;(l=>{l.white={r:1,g:1,b:1},l.red={r:1,g:0,b:0},l.black={r:0,g:0,b:0};function r(c){return{r:Math.round(c.r*255),g:Math.round(c.g*255),b:Math.round(c.b*255),a:1}}l.toRgb255a1=r;function n(c){return{r:c.r,g:c.g,b:c.b}}l.clone=n;function s(c){return c=Math.floor(c),{r:(c>>16&255)/255,g:(c>>8&255)/255,b:(c&255)/255}}l.fromHex=s;function o(c,h){return c.r===h.r&&c.g===h.g&&c.b===h.b}l.equals=o;function a(c,h,u){return{r:c.r+(h.r-c.r)*u,g:c.g+(h.g-c.g)*u,b:c.b+(h.b-c.b)*u}}l.lerp=a})(Ar||(Ar={}));var Ln;(o=>{o.white=xe(se({},Ar.white),{a:1});function e(a){return{r:a[0],g:a[1],b:a[2],a:a[3]}}o.from0to1=e;function t(a,l){return xe(se({},Ar.fromHex(a)),{a:l})}o.fromHexAndA=t;function r(a){return{r:Math.round(a.r*255),g:Math.round(a.g*255),b:Math.round(a.b*255),a:a.a}}o.toRgb255a1=r;function n(a,l){return Ar.equals(a,l)&&a.a===l.a}o.equals=n;function s(a,l,c){return{r:a.r+(l.r-a.r)*c,g:a.g+(l.g-a.g)*c,b:a.b+(l.b-a.b)*c,a:a.a+(l.a-a.a)*c}}o.lerp=s})(Ln||(Ln={}));var Bd;(e=>e.identity={position:[0,0,0],rotation:[0,0,0],scale:[1,1,1]})(Bd||(Bd={}));var Nd;(e=>e.defaultData={mass:1,stiffness:80,damping:10,velocity:0})(Nd||(Nd={}));var Od;(e=>e.defaultData={control1:[.5,.05],control2:[.1,.3]})(Od||(Od={}));var Fd;(e=>{function i(t,r=.1){return{type:"radial",hideBase:!1,count:3,radial:{radius:Math.max(t[0],t[1])*2,start:0,end:360,alignment:!1,axis:"y",scale:[1,1,1],rotation:[0,0,0],position:[0,0,0]},linear:{scale:[1,1,1],rotation:[0,0,0],position:[t[0]+t[0]*r,0,0]},grid:{count:[2,2,2],size:t.map(n=>n*(1+r)),useCenter:!0}}}e.defaultData=i})(Fd||(Fd={}));var jn=class{modifyById(e,t){let r=this;if(r[e]===void 0)throw new Error("not expected");{let s=xe(se({},r),{[e]:t});return Object.setPrototypeOf(s,jn.prototype),s}}add(e,t){var n;let r=this.runOp({type:1,id:e,data:t});return(n=r==null?void 0:r.data)!=null?n:this}runOp(e){let t=this;if(e.type===1){let r=t[e.id],n;r===void 0?n={type:2,id:e.id}:n={type:1,id:e.id,data:r};let{id:s,data:o}=e,a=xe(se({},t),{[s]:o});return Object.setPrototypeOf(a,jn.prototype),{data:a,actual:e,reverse:n}}else if(e.type===2){let{id:r}=e,n=t[r];if(n===void 0)return null;{let s=se({},t);return Object.setPrototypeOf(s,jn.prototype),delete s[r],{data:s,actual:e,reverse:{type:1,id:r,data:n}}}}throw new Error("illegal arg")}};function Dh(i){if(i.deepFreeze!==void 0){i.deepFreeze(i);return}let e=Object.getOwnPropertyNames(i);for(let t of e){let r=i[t];r&&typeof r=="object"&&Dh(r)}return Object.freeze(i)}function eM(i,e){let t=0;for(;t<i.length&&t<e.length;){if(i[t]<e[t])return-1;if(i[t]>e[t])return 1;t+=1}return t!==e.length?-1:t!==i.length?1:0}var Ud=class extends Error{};function Li(i,e,t){if(i===void 0?e===void 0?(i=0,e=10):i=e-10:e===void 0&&(e=i+10),i>e){let s=i;i=e,e=s}let r=[],n=1/(t+1);for(let s=0;s<t;s++){let o=i+(e-i)*(s+.75+Math.random()*.5)*n;r.push(o)}return r}function tM(i){return i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Uint32Array||i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array||i instanceof Float32Array||i instanceof Float64Array}function rM(){return typeof process<"u"}function nM(i,e){for(let t of i)e(t.id,t.data),nM(t.children,e)}function iM(i,e){e(i.id,i.data);for(let t of i.children)iM(t,e)}var qn=class extends Array{constructor(...t){super(...t);Object.setPrototypeOf(this,qn.prototype)}deepFreeze(){let t=0;for(;t<this.length;)Dh(this[t]),t++}fillCaches0(t,r){this.objCaches.set(t.id,t),this.parentCaches.set(t.id,r);for(let n of t.children)this.fillCaches0(n,t.id)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,this.parentCaches=new Map;for(let t of this)this.fillCaches0(t,null)}}randomId(){this.fillCaches();let t=Array.from(this.objCaches.keys());if(t.length!==0)return t[Math.max(0,Math.floor(Math.random()*t.length)-1)]}isDescendantOf(t,r){for(;t;){let n=this.parent(t);if(n===r)return!0;t=n}return!1}data(t){var r;return(r=this.get(t))==null?void 0:r.data}has(t){return this.childrenOf(t)!==void 0}get(t){return this.fillCaches(),this.objCaches.get(t)}childrenOf(t){var r;return t===null?this:(r=this.get(t))==null?void 0:r.children}traverseFrom(t,r){if(t===null)this.traverse(r);else{let n=this.get(t);n&&iM(n,r)}}traverse(t){nM(this,t)}totalSize(){return this.fillCaches(),this.objCaches.size}parent(t){return this.fillCaches(),this.parentCaches.get(t)}childrenArray(t){return t===null?this:this.get(t).children}modifyById(t,r){if(this.get(t)===void 0)throw new Error("not expected");{let s=this.parent(t),o=this.childrenArray(s),a=o.findIndex(h=>h.id===t);if(a<0)throw new Error("not expected");let l=o[a];return o=[...o],o[a]=xe(se({},l),{data:r}),this.modifyArrayBy(s,o)}}modifyArrayBy(t,r){let n=t,s=r;for(;n!==null;){let a=s,l=n;if(n=this.parent(n),n===void 0)throw new Error;s=this.childrenArray(n);let c=s.findIndex(h=>h.id===l);if(c<0)throw new Error;s=[...s],s[c]=xe(se({},s[c]),{children:a})}Object.setPrototypeOf(s,qn.prototype);let o=s;return o.fillCaches(),o}runOp(t){switch(t.type){case 7:return this.addOp(t);case 8:return this.deleteOp(t);case 9:return this.moveOp(t)}}checkDuplicatedIdRec({id:t,children:r}){if(this.get(t)!==void 0)return!0;for(let n of r)if(this.checkDuplicatedIdRec(n))return!0;return!1}addOp(t){let{parent:r,fi:n,id:s,data:o,children:a}=t;if(r!==null&&this.get(r)===void 0)return null;if(this.checkDuplicatedIdRec(t))return null;{let l=r,c=this.childrenArray(l),h={fi:n,id:s,data:o,children:a};return c=[...c,h],c.sort((f,d)=>f.fi-d.fi),t.localIndex=c.indexOf(h),{data:this.modifyArrayBy(l,c),actual:t,reverse:{type:8,id:s}}}}deleteOp(t){let{id:r}=t;if(this.get(r)===null)return null;{let n=this.parent(r);if(n===void 0)return null;let s=this.childrenArray(n),o=s.findIndex(c=>c.id===r);t.localIndex=o,s=[...s];let a=s.splice(o,1)[0];return{data:this.modifyArrayBy(n,s),actual:t,reverse:xe(se({type:7},a),{parent:n})}}}moveOp(t){let{parent:r,fi:n,id:s}=t;if(r!==null&&this.get(r)===void 0)return this.deleteOp({type:8,id:s});if(r!==null){let d=r;for(;d!==null;){if(d===void 0)throw new Error;if(d===s)throw new Ud("cyclic tree");d=this.parent(d)}}let o=this.parent(s);if(o===void 0)return null;let a=o,l=this.childrenArray(o),c=l.findIndex(d=>d.id===s);l=[...l];let h=l.splice(c,1)[0],u=this.modifyArrayBy(o,l);o=r,l=u.childrenArray(o);let f=h.fi;return h=xe(se({},h),{fi:n}),l=[...l,h],l.sort((d,p)=>d.fi-p.fi),t.localIndex=l.indexOf(h),u=u.modifyArrayBy(o,l),{data:u,actual:t,reverse:{type:9,parent:a,fi:f,id:s}}}previous(t,r){if(r===null){let s=this.childrenArray(t);return s.length===0?null:s[s.length-1].id}let n=null;for(let s of this.childrenArray(t)){if(s.id===r)return n;n=s.id}return null}traverseSortNext(t){let r=this.parent(t);if(r!==void 0){let n=this.childrenArray(r),s=n.findIndex(o=>o.id===t)+1;if(s<n.length)return n[s].id;if(r)return this.traverseSortNext(r)}}sortNext(t){let r=this.childrenArray(t);return r.length>0?r[0].id:this.traverseSortNext(t)}traverseSortPrevious(t){let r=this.childrenArray(t);return r.length>0?this.traverseSortPrevious(r[r.length-1].id):t}sortPrevious(t){let r=this.parent(t);if(r!==void 0){let n=this.childrenArray(r),s=n.findIndex(o=>o.id===t)-1;return s>=0?this.traverseSortPrevious(n[s].id):r}}getAllSorted(t){let r=[];for(let n of t){let s=this.getWithSortKey(n.id);s!==void 0&&r.push(se(se({},n),s))}r.sort((n,s)=>eM(n.sortKey,s.sortKey));for(let n of r)delete n.sortKey;return r}getWithSortKey(t){var r=t;let n=[],s=this.get(r),o=s;if(s!==void 0){for(;r;)n.splice(0,0,s.fi),r=this.parent(r),r!==null&&(s=this.get(r));return xe(se({},o),{sortKey:n})}}insertBeforeHelper(t,r,n){return this.insertAfterHelper(t,this.previous(t,r),n)}insertAfterHelper(t,r,n){let s=this.childrenArray(t);if(r===null){if(s.length===0)return Li(0,n,n);{let o=s[0].fi;return Li(o-n,o,n)}}else{let o=this.get(r);if(o===void 0||this.parent(r)!==t)throw new Error("illegal args");let a=s.find(l=>l.fi>o.fi);if(a===void 0){let l=s[s.length-1].fi;return Li(l,l+n,n)}else return Li(o.fi,a.fi,n)}}};var zd;(e=>{function i(t,r){if(Array.isArray(t)){let n=r.props,s={},o=[...t],a=!1;if(n)for(let l of Object.keys(n)){let c=parseInt(l);if(isNaN(c))throw new Error("wrong index");s[l]=o[c],o[c]=n[l],a=!0}return a?{data:o,actual:r,reverse:{type:0,props:s}}:null}else{let n=r.props,s={},o=se({},t),a=!1;if(n)for(let l of Object.keys(n)){s[l]=o[l];let c=n[l];c===void 0?delete o[l]:o[l]=c,a=!0}return a?{data:o,actual:r,reverse:{type:0,props:s}}:null}}e.runOp=i})(zd||(zd={}));var rr=class extends Array{constructor(...t){super(...t);Object.setPrototypeOf(this,rr.prototype)}deepFreeze(){let t=0;for(;t<this.length;)Dh(this[t]),t++}fillCaches0(t){this.objCaches.set(t.id,t)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,Object.getOwnPropertyDescriptor(this,"objCaches").enumerable=!1;for(let t of this)this.fillCaches0(t)}}randomId(){this.fillCaches();let t=Array.from(this.objCaches.keys());if(t.length!==0)return t[Math.max(0,Math.floor(Math.random()*t.length)-1)]}data(t){var r;return(r=this.get(t))==null?void 0:r.data}get(t){return this.fillCaches(),this.objCaches.get(t)}modifyById(t,r){if(this.get(t)===void 0)throw new Error("not expected");{let s=this,o=s.findIndex(c=>c.id===t);if(o<0)throw new Error("not expected");let a=s[o];return s=[...s],s[o]=xe(se({},a),{data:r}),this.modifyArrayBy(s)}}modifyArrayBy(t){Object.setPrototypeOf(t,rr.prototype);let r=t;return rM()||r.fillCaches(),r}runOp(t){switch(t.type){case 4:return this.addOp(t);case 5:return this.deleteOp(t);case 6:return this.moveOp(t)}}addOp(t){let{fi:r,id:n,data:s}=t,o=this,a={fi:r,id:n,data:s};return o=[...o,a],o.sort((c,h)=>c.fi-h.fi),t.localIndex=o.indexOf(a),{data:this.modifyArrayBy(o),actual:t,reverse:{type:5,id:n}}}deleteOp(t){let{id:r}=t,n=this,s=n.findIndex(l=>l.id===r);if(s===-1)return null;t.localIndex=s,n=[...n];let o=n.splice(s,1)[0];return{data:this.modifyArrayBy(n),actual:t,reverse:se({type:4},o)}}moveOp(t){let{fi:r,id:n}=t,s=this;s=[...s];let o=s.findIndex(h=>h.id===n);if(o===-1)return null;let a=s[o].fi,l=xe(se({},s[o]),{fi:r});return s[o]=l,s.sort((h,u)=>h.fi-u.fi),t.localIndex=s.indexOf(l),{data:this.modifyArrayBy(s),actual:t,reverse:{type:6,fi:a,id:n}}}previous(t){if(t===null)return this.length===0?null:this[this.length-1].id;let r=null;for(let n of this){if(n.id===t)return r;r=n.id}return null}insertBeforeHelper(t,r){return this.insertAfterHelper(this.previous(t),r)}insertAfterHelper(t,r){let n=this;if(t===null){if(n.length===0)return Li(0,r,r);{let s=n[0].fi;return Li(s-r,s,r)}}else{let s=this.get(t);if(s===void 0)throw new Error("illegal args");let o=n.find(a=>a.fi>s.fi);if(o===void 0){let a=n[n.length-1].fi;return Li(a,a+r,r)}else return Li(s.fi,o.fi,r)}}};var sM=Symbol(),kd=Symbol(),Sl=class{reportOp(e,t){let r=this;if(t===null)return;r._current=t.data;let n=[];for(;!(r instanceof Gd);){let s=r._path,o=r._current;if(s!==""&&n.splice(0,0,s),r=r._parent,r===null)return;r.update(s,o)}r.push(n,e,t.actual,t.reverse)}deleteChildren(e){if(this._children){let t=this._children[e];if(t){let r=t[kd];r&&r(),delete this._children[e]}}}},Sy=class extends Sl{constructor(e,t,r){super(),this._parent=e,this._path=t,this._current=r}update(e,t){if(Array.isArray(this._current)){if(typeof e=="string"&&(e=parseInt(e),isNaN(e)))throw new Error("Invalid path");this._current=[...this._current],this._current[e]=t}else this._current=xe(se({},this._current),{[e]:t})}runOp(e){this.reportOp(e,zd.runOp(this._current,e))}},My=class extends Sl{constructor(e,t,r){super(),this._parent=e,this._path=t,this._current=r}update(e,t){this._current=xe(se({},this._current),{[e]:t}),Object.setPrototypeOf(this._current,jn.prototype)}runOp(e){this.reportOp(e,this._current.runOp(e))}},oM={get(i,e){if(e===kd)return()=>{i._parent=null};if(e===sM)return i._current;let{_current:t,_children:r}=i;if(e==="push"&&Array.isArray(t))throw new Error("not supported to expand array");let n=r===void 0?void 0:r[e];if(n!==void 0)return n;let s=t[e],o=Vd(i,e,s);return o!==s?(r===void 0&&(r={},i._children=r),r[e]=o,o):s},has(i,e){return e in i._current},ownKeys(i){return Reflect.ownKeys(i._current)},defineProperty(){throw Error("not supported")},getPrototypeOf(i){return Object.getPrototypeOf(i._current)},setPrototypeOf(){throw Error("not supported")},getOwnPropertyDescriptor(i,e){let t=i._current,r=Reflect.getOwnPropertyDescriptor(t,e);return r&&{writable:!0,configurable:!0,enumerable:r.enumerable,value:t[e]}}},gO=xe(se({},oM),{set(i,e,t){var n;let r={type:0,props:{[e]:(n=_y(t))!=null?n:t}};return i.deleteChildren(e),i.runOp(r),!0},deleteProperty(i,e){let t={type:0,props:{[e]:void 0}};return i.deleteChildren(e),i.runOp(t),!0}}),yO=xe(se({},oM),{set(i,e,t){return t===void 0?this.deleteProperty(i,e):(i.deleteChildren(e),i.runOp({type:1,id:e,data:t})),!0},deleteProperty(i,e){return i.runOp({type:2,id:e}),!0}}),Ml=class extends Sl{constructor(e,t,r){super(),this._children={},this._parent=e,this._path=t,this._current=r,this[kd]=()=>{this._parent=null}}unproxy(){return this._current}update(e,t){this._current=this._current.modifyById(e,t)}runOp(e){this.reportOp(e,this._current.runOp(e))}randomId(){return this._current.randomId()}isDescendantOf(e,t){return this._current.isDescendantOf(e,t)}childrenOf(e){return this._current.childrenOf(e)}traverse(e){return this._current.traverse(e)}get(e){return this._current.get(e)}parent(e){return this._current.parent(e)}traverse(e){this._current.traverse((t,r)=>{e(t,this.data(t))})}data(e){var a;let{_current:t,_children:r}=this,n=r===void 0?void 0:r[e];if(n!==void 0)return n;let s=(a=t.get(e))==null?void 0:a.data,o=Vd(this,e,s);return o!==s?(r===void 0&&(r={},this._children=r),r[e]=o,o):s}add(e,t,r,n,s){this.runOp({type:7,parent:e,fi:t,id:r,data:n,children:s})}move(e,t,r){this.runOp({type:9,parent:e,fi:t,id:r})}insertAfter(e,t,r){let n=this._current.insertAfterHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.add(e,n[s],o.id,o.data,o.children)}}insertBefore(e,t,r){let n=this._current.insertBeforeHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.add(e,n[s],o.id,o.data,o.children)}}moveAfter(e,t,r){let n=this._current.insertAfterHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.move(e,n[s],o)}}moveBefore(e,t,r){let n=this._current.insertBeforeHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.move(e,n[s],o)}}delete(e){this.deleteChildren(e),this.runOp({type:8,id:e})}sortNext(e){return this._current.sortNext(e)}sortPrevious(e){return this._current.sortPrevious(e)}getAllSorted(e){return this._current.getAllSorted(e)}},Al=class extends Sl{constructor(e,t,r){super(),this._children={},this._parent=e,this._path=t,this._current=r,this[kd]=()=>{this._parent=null}}unproxy(){return this._current}get length(){return this._current.length}forEach(e){let t=this.length;for(let r=0;r<t;r++){let n=this._current[r].id;e(this.data(this._current[r].id),n)}}update(e,t){this._current=this._current.modifyById(e,t)}randomId(){return this._current.randomId()}get(e){return xe(se({},this._current.get(e)),{data:this.data(e)})}data(e){var a;let{_current:t,_children:r}=this,n=r===void 0?void 0:r[e];if(n!==void 0)return n;let s=(a=t.get(e))==null?void 0:a.data,o=Vd(this,e,s);return o!==s?(r===void 0&&(r={},this._children=r),r[e]=o,o):s}runOp(e){this.reportOp(e,this._current.runOp(e))}add(e,t,r){this.runOp({type:4,fi:e,id:t,data:r})}move(e,t){this.runOp({type:6,fi:e,id:t})}insertAfter(e,t){let r=this._current.insertAfterHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.add(r[n],s.id,s.data)}}insertBefore(e,t){let r=this._current.insertBeforeHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.add(r[n],s.id,s.data)}}moveAfter(e,t){let r=this._current.insertAfterHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.move(r[n],s)}}moveBefore(e,t){let r=this._current.insertBeforeHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.move(r[n],s)}}delete(e){this.deleteChildren(e),this.runOp({type:5,id:e})}};function wy(i,e,t){if(i.length>0){let r=i[i.length-1];if(r.type===0&&e.type===0&&Hd.equal(r.path,t)){Object.assign(r.props,e.props);return}}i.push(xe(se({},e),{path:t}))}var Gd=class{constructor(e){this.ts=[],this.actual=[],this.reverse=[],this._current=e}update(e,t){if(e!=="")throw new Error("");this._current=t}push(e,t,r,n){wy(this.ts,t,e),wy(this.actual,r,e),wy(this.reverse,n,e)}result(){return{data:this._current,ts:this.ts,actual:this.actual,reverse:this.reverse.reverse()}}};function Vd(i,e,t){return t instanceof qn?new Ml(i,e,t):t instanceof rr?new Al(i,e,t):t instanceof jn?new Proxy(new My(i,e,t),yO):t!==null&&typeof t=="object"?tM(t)?t:new Proxy(new Sy(i,e,t),gO):t}function Ay(i){let e=new Gd(i);return[Vd(e,"",i),e]}function Ty(i,e){let[t,r]=Ay(i);return e(t),r.result()}function _y(i){return i instanceof Ml||i instanceof Al?i._current:i!==null&&typeof i=="object"?i[sM]:i}var Hd;(r=>{function i(n,s){if(s.length===n.length)for(var o=0;o<n.length;){if(n[o]!==s[o])return!1;o+=1}else return!1;return!0}r.equal=i;function e(n,s,o){let a=t(o,n);if(a!==void 0&&typeof a=="object"&&a!==null){let l=se({},s);return Object.keys(a).forEach(c=>{delete l[c]}),l}else return s}r.removeOverridden=e;function t(n,s,o=0){if(s.length<=o)return n;if((n instanceof qn||n instanceof Ml)&&typeof s[o]=="string")return t(n.data(s[o]),s,o+1);if((n instanceof rr||n instanceof Al)&&typeof s[o]=="string")return t(n.data(s[o]),s,o+1);if(typeof s[o]=="number"&&Array.isArray(n))return t(n[s[o]],s,o+1);if(typeof s[o]=="string"&&typeof n=="object")return t(n[s[o]],s,o+1)}r.zoom=t})(Hd||(Hd={}));var Wd=class{},Lh=class extends Wd{constructor(t){super();this.id=t}},Ih=class extends Wd{constructor(t){super();this.data=t}};var Cy;try{Cy=new TextDecoder}catch{}var Re,ro,ee=0;var pM=[],Py=pM,Dy=0,Sn={},Ct,to,Yn=0,Ii=0,In,fs,fn=[],Bt,aM={useRecords:!1,mapsAsObjects:!0},Rh=class{},Iy=new Rh;Iy.name="MessagePack 0xC1";var Tl=!1,Ri=class{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0)),Object.assign(this,e)}unpack(e,t){if(Re)return xM(()=>(qd(),this?this.unpack(e,t):Ri.prototype.unpack.call(aM,e,t)));ro=t>-1?t:e.length,ee=0,Dy=0,Ii=0,to=null,Py=pM,In=null,Re=e;try{Bt=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(r){throw Re=null,e instanceof Uint8Array?r:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof Ri){if(Sn=this,this.structures)return Ct=this.structures,jd();(!Ct||Ct.length>0)&&(Ct=[])}else Sn=aM,(!Ct||Ct.length>0)&&(Ct=[]);return jd()}unpackMultiple(e,t){let r,n=0;try{Tl=!0;let s=e.length,o=this?this.unpack(e,s):Qd.unpack(e,s);if(t){for(t(o);ee<s;)if(n=ee,t(jd())===!1)return}else{for(r=[o];ee<s;)n=ee,r.push(jd());return r}}catch(s){throw s.lastPosition=n,s.values=r,s}finally{Tl=!1,qd()}}_mergeStructures(e,t){e=e||[];for(let r=0,n=e.length;r<n;r++){let s=e[r];s&&(s.isShared=!0,r>=32&&(s.highByte=r-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],s=t[r];s&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=s)}return this.structures=e}decode(e,t){return this.unpack(e,t)}};function jd(){try{if(!Sn.trusted&&!Tl){let e=Ct.sharedLength||0;e<Ct.length&&(Ct.length=e)}let i=lr();if(ee==ro)Ct.restoreStructures&&lM(),Ct=null,Re=null,fs&&(fs=null);else if(ee>ro){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}else if(!Tl)throw new Error("Data read, but end of buffer not reached");return i}catch(i){throw Ct.restoreStructures&&lM(),qd(),(i instanceof RangeError||i.message.startsWith("Unexpected end of buffer"))&&(i.incomplete=!0),i}}function lM(){for(let i in Ct.restoreStructures)Ct[i]=Ct.restoreStructures[i];Ct.restoreStructures=null}function lr(){let i=Re[ee++];if(i<160)if(i<128){if(i<64)return i;{let e=Ct[i&63]||Sn.getStructures&&mM()[i&63];return e?(e.read||(e.read=Ry(e,i&63)),e.read()):i}}else if(i<144)if(i-=128,Sn.mapsAsObjects){let e={};for(let t=0;t<i;t++)e[yM()]=lr();return e}else{let e=new Map;for(let t=0;t<i;t++)e.set(lr(),lr());return e}else{i-=144;let e=new Array(i);for(let t=0;t<i;t++)e[t]=lr();return e}else if(i<192){let e=i-160;if(Ii>=ee)return to.slice(ee-Yn,(ee+=e)-Yn);if(Ii==0&&ro<140){let t=e<16?By(e):gM(e);if(t!=null)return t}return Ly(e)}else{let e;switch(i){case 192:return null;case 193:return In?(e=lr(),e>0?In[1].slice(In.position1,In.position1+=e):In[0].slice(In.position0,In.position0-=e)):Iy;case 194:return!1;case 195:return!0;case 196:return Ey(Re[ee++]);case 197:return e=Bt.getUint16(ee),ee+=2,Ey(e);case 198:return e=Bt.getUint32(ee),ee+=4,Ey(e);case 199:return jo(Re[ee++]);case 200:return e=Bt.getUint16(ee),ee+=2,jo(e);case 201:return e=Bt.getUint32(ee),ee+=4,jo(e);case 202:if(e=Bt.getFloat32(ee),Sn.useFloat32>2){let t=Xd[(Re[ee]&127)<<1|Re[ee+1]>>7];return ee+=4,(t*e+(e>0?.5:-.5)>>0)/t}return ee+=4,e;case 203:return e=Bt.getFloat64(ee),ee+=8,e;case 204:return Re[ee++];case 205:return e=Bt.getUint16(ee),ee+=2,e;case 206:return e=Bt.getUint32(ee),ee+=4,e;case 207:return Sn.int64AsNumber?(e=Bt.getUint32(ee)*4294967296,e+=Bt.getUint32(ee+4)):e=Bt.getBigUint64(ee),ee+=8,e;case 208:return Bt.getInt8(ee++);case 209:return e=Bt.getInt16(ee),ee+=2,e;case 210:return e=Bt.getInt32(ee),ee+=4,e;case 211:return Sn.int64AsNumber?(e=Bt.getInt32(ee)*4294967296,e+=Bt.getUint32(ee+4)):e=Bt.getBigInt64(ee),ee+=8,e;case 212:if(e=Re[ee++],e==114)return dM(Re[ee++]&63);{let t=fn[e];if(t)return t.read?(ee++,t.read(lr())):t.noBuffer?(ee++,t()):t(Re.subarray(ee,++ee));throw new Error("Unknown extension "+e)}case 213:return e=Re[ee],e==114?(ee++,dM(Re[ee++]&63,Re[ee++])):jo(2);case 214:return jo(4);case 215:return jo(8);case 216:return jo(16);case 217:return e=Re[ee++],Ii>=ee?to.slice(ee-Yn,(ee+=e)-Yn):xO(e);case 218:return e=Bt.getUint16(ee),ee+=2,Ii>=ee?to.slice(ee-Yn,(ee+=e)-Yn):bO(e);case 219:return e=Bt.getUint32(ee),ee+=4,Ii>=ee?to.slice(ee-Yn,(ee+=e)-Yn):wO(e);case 220:return e=Bt.getUint16(ee),ee+=2,hM(e);case 221:return e=Bt.getUint32(ee),ee+=4,hM(e);case 222:return e=Bt.getUint16(ee),ee+=2,uM(e);case 223:return e=Bt.getUint32(ee),ee+=4,uM(e);default:if(i>=224)return i-256;if(i===void 0){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+i)}}}var vO=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Ry(i,e){function t(){if(t.count++>2){let n=i.read=new Function("r","return function(){return {"+i.map(s=>vO.test(s)?s+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}}")(lr);return i.highByte===0&&(i.read=cM(e,i.read)),n()}let r={};for(let n=0,s=i.length;n<s;n++){let o=i[n];r[o]=lr()}return r}return t.count=0,i.highByte===0?cM(e,t):t}var cM=(i,e)=>function(){let t=Re[ee++];if(t===0)return e();let r=i<32?-(i+(t<<5)):i+(t<<5),n=Ct[r]||mM()[r];if(!n)throw new Error("Record id is not defined for "+r);return n.read||(n.read=Ry(n,i)),n.read()};function mM(){let i=xM(()=>(Re=null,Sn.getStructures()));return Ct=Sn._mergeStructures(i,Ct)}var Ly=Yd,xO=Yd,bO=Yd,wO=Yd;function Yd(i){let e;if(i<16&&(e=By(i)))return e;if(i>64&&Cy)return Cy.decode(Re.subarray(ee,ee+=i));let t=ee+i,r=[];for(e="";ee<t;){let n=Re[ee++];if((n&128)===0)r.push(n);else if((n&224)===192){let s=Re[ee++]&63;r.push((n&31)<<6|s)}else if((n&240)===224){let s=Re[ee++]&63,o=Re[ee++]&63;r.push((n&31)<<12|s<<6|o)}else if((n&248)===240){let s=Re[ee++]&63,o=Re[ee++]&63,a=Re[ee++]&63,l=(n&7)<<18|s<<12|o<<6|a;l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|l&1023),r.push(l)}else r.push(n);r.length>=4096&&(e+=Br.apply(String,r),r.length=0)}return r.length>0&&(e+=Br.apply(String,r)),e}function hM(i){let e=new Array(i);for(let t=0;t<i;t++)e[t]=lr();return e}function uM(i){if(Sn.mapsAsObjects){let e={};for(let t=0;t<i;t++)e[yM()]=lr();return e}else{let e=new Map;for(let t=0;t<i;t++)e.set(lr(),lr());return e}}var Br=String.fromCharCode;function gM(i){let e=ee,t=new Array(i);for(let r=0;r<i;r++){let n=Re[ee++];if((n&128)>0){ee=e;return}t[r]=n}return Br.apply(String,t)}function By(i){if(i<4)if(i<2){if(i===0)return"";{let e=Re[ee++];if((e&128)>1){ee-=1;return}return Br(e)}}else{let e=Re[ee++],t=Re[ee++];if((e&128)>0||(t&128)>0){ee-=2;return}if(i<3)return Br(e,t);let r=Re[ee++];if((r&128)>0){ee-=3;return}return Br(e,t,r)}else{let e=Re[ee++],t=Re[ee++],r=Re[ee++],n=Re[ee++];if((e&128)>0||(t&128)>0||(r&128)>0||(n&128)>0){ee-=4;return}if(i<6){if(i===4)return Br(e,t,r,n);{let s=Re[ee++];if((s&128)>0){ee-=5;return}return Br(e,t,r,n,s)}}else if(i<8){let s=Re[ee++],o=Re[ee++];if((s&128)>0||(o&128)>0){ee-=6;return}if(i<7)return Br(e,t,r,n,s,o);let a=Re[ee++];if((a&128)>0){ee-=7;return}return Br(e,t,r,n,s,o,a)}else{let s=Re[ee++],o=Re[ee++],a=Re[ee++],l=Re[ee++];if((s&128)>0||(o&128)>0||(a&128)>0||(l&128)>0){ee-=8;return}if(i<10){if(i===8)return Br(e,t,r,n,s,o,a,l);{let c=Re[ee++];if((c&128)>0){ee-=9;return}return Br(e,t,r,n,s,o,a,l,c)}}else if(i<12){let c=Re[ee++],h=Re[ee++];if((c&128)>0||(h&128)>0){ee-=10;return}if(i<11)return Br(e,t,r,n,s,o,a,l,c,h);let u=Re[ee++];if((u&128)>0){ee-=11;return}return Br(e,t,r,n,s,o,a,l,c,h,u)}else{let c=Re[ee++],h=Re[ee++],u=Re[ee++],f=Re[ee++];if((c&128)>0||(h&128)>0||(u&128)>0||(f&128)>0){ee-=12;return}if(i<14){if(i===12)return Br(e,t,r,n,s,o,a,l,c,h,u,f);{let d=Re[ee++];if((d&128)>0){ee-=13;return}return Br(e,t,r,n,s,o,a,l,c,h,u,f,d)}}else{let d=Re[ee++],p=Re[ee++];if((d&128)>0||(p&128)>0){ee-=14;return}if(i<15)return Br(e,t,r,n,s,o,a,l,c,h,u,f,d,p);let m=Re[ee++];if((m&128)>0){ee-=15;return}return Br(e,t,r,n,s,o,a,l,c,h,u,f,d,p,m)}}}}}function Ey(i){return Sn.copyBuffers?Uint8Array.prototype.slice.call(Re,ee,ee+=i):Re.subarray(ee,ee+=i)}function jo(i){let e=Re[ee++];if(fn[e])return fn[e](Re.subarray(ee,ee+=i));throw new Error("Unknown extension type "+e)}var fM=new Array(4096);function yM(){let i=Re[ee++];if(i>=160&&i<192){if(i=i-160,Ii>=ee)return to.slice(ee-Yn,(ee+=i)-Yn);if(!(Ii==0&&ro<180))return Ly(i)}else return ee--,lr();let e=(i<<5^(i>1?Bt.getUint16(ee):i>0?Re[ee]:0))&4095,t=fM[e],r=ee,n=ee+i-3,s,o=0;if(t&&t.bytes==i){for(;r<n;){if(s=Bt.getUint32(r),s!=t[o++]){r=1879048192;break}r+=4}for(n+=3;r<n;)if(s=Re[r++],s!=t[o++]){r=1879048192;break}if(r===n)return ee=r,t.string;n-=3,r=ee}for(t=[],fM[e]=t,t.bytes=i;r<n;)s=Bt.getUint32(r),t.push(s),r+=4;for(n+=3;r<n;)s=Re[r++],t.push(s);let a=i<16?By(i):gM(i);return a!=null?t.string=a:t.string=Ly(i)}var dM=(i,e)=>{var t=lr();let r=i;e!==void 0&&(i=i<32?-((e<<5)+i):(e<<5)+i,t.highByte=e);let n=Ct[i];return n&&n.isShared&&((Ct.restoreStructures||(Ct.restoreStructures=[]))[i]=n),Ct[i]=t,t.read=Ry(t,r),t.read()},vM=typeof self=="object"?self:global;fn[0]=()=>{};fn[0].noBuffer=!0;fn[101]=()=>{let i=lr();return(vM[i[0]]||Error)(i[1])};fn[105]=i=>{let e=Bt.getUint32(ee-4);fs||(fs=new Map);let t=Re[ee],r;t>=144&&t<160||t==220||t==221?r=[]:r={};let n={target:r};fs.set(e,n);let s=lr();return n.used?Object.assign(r,s):(n.target=s,s)};fn[112]=i=>{let e=Bt.getUint32(ee-4),t=fs.get(e);return t.used=!0,t.target};fn[115]=()=>new Set(lr());var Ny=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(i=>i+"Array");fn[116]=i=>{let e=i[0],t=Ny[e];if(!t)throw new Error("Could not find typed array for code "+e);return new vM[t](Uint8Array.prototype.slice.call(i,1).buffer)};fn[120]=()=>{let i=lr();return new RegExp(i[0],i[1])};fn[98]=i=>{let e=(i[0]<<24)+(i[1]<<16)+(i[2]<<8)+i[3],t=ee;ee+=e-4,In=[lr(),lr()],In.position0=0,In.position1=0;let r=ee;ee=t;try{return lr()}finally{ee=r}};fn[255]=i=>i.length==4?new Date((i[0]*16777216+(i[1]<<16)+(i[2]<<8)+i[3])*1e3):i.length==8?new Date(((i[0]<<22)+(i[1]<<14)+(i[2]<<6)+(i[3]>>2))/1e6+((i[3]&3)*4294967296+i[4]*16777216+(i[5]<<16)+(i[6]<<8)+i[7])*1e3):i.length==12?new Date(((i[0]<<24)+(i[1]<<16)+(i[2]<<8)+i[3])/1e6+((i[4]&128?-281474976710656:0)+i[6]*1099511627776+i[7]*4294967296+i[8]*16777216+(i[9]<<16)+(i[10]<<8)+i[11])*1e3):new Date("invalid");function xM(i){let e=ro,t=ee,r=Dy,n=Yn,s=Ii,o=to,a=Py,l=fs,c=In,h=new Uint8Array(Re.slice(0,ro)),u=Ct,f=Ct.slice(0,Ct.length),d=Sn,p=Tl,m=i();return ro=e,ee=t,Dy=r,Yn=n,Ii=s,to=o,Py=a,fs=l,In=c,Re=h,Tl=p,Ct=u,Ct.splice(0,Ct.length,...f),Sn=d,Bt=new DataView(Re.buffer,Re.byteOffset,Re.byteLength),m}function qd(){Re=null,fs=null,Ct=null}function bM(i){i.unpack?fn[i.type]=i.unpack:fn[i.type]=i}var Xd=new Array(147);for(let i=0;i<256;i++)Xd[i]=+("1e"+Math.floor(45.15-i*.30103));var Qd=new Ri({useRecords:!1}),SO=Qd.unpack,MO=Qd.unpackMultiple,AO=Qd.unpack,Jd={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4},TO=new Float32Array(1),F9=new Uint8Array(TO.buffer,0,4);var Kd;try{Kd=new TextEncoder}catch{}var Zd,Fy,$d=typeof Buffer<"u",Oy=$d?Buffer.allocUnsafeSlow:Uint8Array,AM=$d?Buffer:Uint8Array,wM=$d?4294967296:2144337920,pe,dr,ae=0,Bi,Ni=null,_O=/[\u0080-\uFFFF]/,Bh=Symbol("record-id"),qo=class extends Ri{constructor(e){super(e),this.offset=0;let t,r,n,s,o,a,l=0,c=AM.prototype.utf8Write?function(x,_,E){return pe.utf8Write(x,_,E)}:Kd&&Kd.encodeInto?function(x,_){return Kd.encodeInto(x,pe.subarray(_)).written}:!1,h=this;e||(e={});let u=e&&e.sequential,f=e.structures||e.saveStructures,d=e.maxSharedStructures;if(d==null&&(d=f?32:0),d>8160)throw new Error("Maximum maxSharedStructure is 8160");let p=e.maxOwnStructures;p==null&&(p=f?32:64),u&&!e.saveStructures&&(this.structures=[]);let m=d>32||p+d>64,g=d+64,v=d+p+64;if(v>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let y=[],w=0,b=0;this.pack=this.encode=function(x,_){if(pe||(pe=new Oy(8192),dr=new DataView(pe.buffer,0,8192),ae=0),Bi=pe.length-10,Bi-ae<2048?(pe=new Oy(pe.length),dr=new DataView(pe.buffer,0,pe.length),Bi=pe.length-10,ae=0):ae=ae+7&2147483640,r=ae,a=h.structuredClone?new Map:null,h.bundleStrings?(Ni=["",""],pe[ae++]=214,pe[ae++]=98,Ni.position=ae-r,ae+=4):Ni=null,n=h.structures,n){n.uninitialized&&(n=h._mergeStructures(h.getStructures()));let E=n.sharedLength||0;if(E>d)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let C=0;C<E;C++){let I=n[C];if(!I)continue;let N,R=n.transitions;for(let k=0,G=I.length;k<G;k++){let K=I[k];N=R[K],N||(N=R[K]=Object.create(null)),R=N}R[Bh]=C+64}l=E}u||(n.nextId=E+64)}s&&(s=!1),o=n||[];try{if(S(x),Ni){dr.setUint32(Ni.position+r,ae-Ni.position-r);let E=Ni;Ni=null,S(E[0]),S(E[1])}if(h.offset=ae,a&&a.idsToInsert){ae+=a.idsToInsert.length*6,ae>Bi&&A(ae),h.offset=ae;let E=CO(pe.subarray(r,ae),a.idsToInsert);return a=null,E}return _&_M?(pe.start=r,pe.end=ae,pe):pe.subarray(r,ae)}finally{if(n){if(b<10&&b++,w>1e4)n.transitions=null,b=0,w=0,y.length>0&&(y=[]);else if(y.length>0&&!u){for(let E=0,C=y.length;E<C;E++)y[E][Bh]=0;y=[]}if(s&&h.saveStructures){let E=n.sharedLength||d;n.length>E&&(n=n.slice(0,E));let C=pe.subarray(r,ae);return h.saveStructures(n,l)===!1?(h._mergeStructures(h.getStructures()),h.pack(x)):(l=E,C)}}_&NO&&(ae=r)}};let S=x=>{ae>Bi&&(pe=A(ae));var _=typeof x,E;if(_==="string"){let C=x.length;if(Ni&&C>=8&&C<4096){let R=_O.test(x);Ni[R?0:1]+=x,pe[ae++]=193,S(R?-C:C);return}let I;C<32?I=1:C<256?I=2:C<65536?I=3:I=5;let N=C*3;if(ae+N>Bi&&(pe=A(ae+N)),C<64||!c){let R,k,G,K=ae+I;for(R=0;R<C;R++)k=x.charCodeAt(R),k<128?pe[K++]=k:k<2048?(pe[K++]=k>>6|192,pe[K++]=k&63|128):(k&64512)===55296&&((G=x.charCodeAt(R+1))&64512)===56320?(k=65536+((k&1023)<<10)+(G&1023),R++,pe[K++]=k>>18|240,pe[K++]=k>>12&63|128,pe[K++]=k>>6&63|128,pe[K++]=k&63|128):(pe[K++]=k>>12|224,pe[K++]=k>>6&63|128,pe[K++]=k&63|128);E=K-ae-I}else E=c(x,ae+I,N);E<32?pe[ae++]=160|E:E<256?(I<2&&pe.copyWithin(ae+2,ae+1,ae+1+E),pe[ae++]=217,pe[ae++]=E):E<65536?(I<3&&pe.copyWithin(ae+3,ae+2,ae+2+E),pe[ae++]=218,pe[ae++]=E>>8,pe[ae++]=E&255):(I<5&&pe.copyWithin(ae+5,ae+3,ae+3+E),pe[ae++]=219,dr.setUint32(ae,E),ae+=4),ae+=E}else if(_==="number")if(x>>>0===x)x<64?pe[ae++]=x:x<256?(pe[ae++]=204,pe[ae++]=x):x<65536?(pe[ae++]=205,pe[ae++]=x>>8,pe[ae++]=x&255):(pe[ae++]=206,dr.setUint32(ae,x),ae+=4);else if(x>>0===x)x>=-32?pe[ae++]=256+x:x>=-128?(pe[ae++]=208,pe[ae++]=x+256):x>=-32768?(pe[ae++]=209,dr.setInt16(ae,x),ae+=2):(pe[ae++]=210,dr.setInt32(ae,x),ae+=4);else{let C;if((C=this.useFloat32)>0&&x<4294967296&&x>=-2147483648){pe[ae++]=202,dr.setFloat32(ae,x);let I;if(C<4||(I=x*Xd[(pe[ae]&127)<<1|pe[ae+1]>>7])>>0===I){ae+=4;return}else ae--}pe[ae++]=203,dr.setFloat64(ae,x),ae+=8}else if(_==="object")if(!x)pe[ae++]=192;else{if(a){let I=a.get(x);if(I){if(!I.id){let N=a.idsToInsert||(a.idsToInsert=[]);I.id=N.push(I)}pe[ae++]=214,pe[ae++]=112,dr.setUint32(ae,I.id),ae+=4;return}else a.set(x,{offset:ae-r})}let C=x.constructor;if(C===Object)T(x,!0);else if(C===Array){E=x.length,E<16?pe[ae++]=144|E:E<65536?(pe[ae++]=220,pe[ae++]=E>>8,pe[ae++]=E&255):(pe[ae++]=221,dr.setUint32(ae,E),ae+=4);for(let I=0;I<E;I++)S(x[I])}else if(C===Map){E=x.size,E<16?pe[ae++]=128|E:E<65536?(pe[ae++]=222,pe[ae++]=E>>8,pe[ae++]=E&255):(pe[ae++]=223,dr.setUint32(ae,E),ae+=4);for(let[I,N]of x)S(I),S(N)}else{for(let I=0,N=Zd.length;I<N;I++){let R=Fy[I];if(x instanceof R){let k=Zd[I];if(k.write){k.type&&(pe[ae++]=212,pe[ae++]=k.type,pe[ae++]=0),S(k.write.call(this,x));return}let G=pe,K=dr,J=ae;pe=null;let Y;try{Y=k.pack.call(this,x,F=>(pe=G,G=null,ae+=F,ae>Bi&&A(ae),{target:pe,targetView:dr,position:ae-F}),S)}finally{G&&(pe=G,dr=K,ae=J,Bi=pe.length-10)}Y&&(Y.length+ae>Bi&&A(Y.length+ae),ae=EO(Y,pe,ae,k.type));return}}T(x,!x.hasOwnProperty)}}else if(_==="boolean")pe[ae++]=x?195:194;else if(_==="bigint"){if(x<BigInt(1)<<BigInt(63)&&x>=-(BigInt(1)<<BigInt(63)))pe[ae++]=211,dr.setBigInt64(ae,x);else if(x<BigInt(1)<<BigInt(64)&&x>0)pe[ae++]=207,dr.setBigUint64(ae,x);else if(this.largeBigIntToFloat)pe[ae++]=203,dr.setFloat64(ae,Number(x));else throw new RangeError(x+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");ae+=8}else if(_==="undefined")this.encodeUndefinedAsNil?pe[ae++]=192:(pe[ae++]=212,pe[ae++]=0,pe[ae++]=0);else if(_==="function")S(this.writeFunction&&this.writeFunction());else throw new Error("Unknown type: "+_)},T=this.useRecords===!1?this.variableMapSize?x=>{let _=Object.keys(x),E=_.length;E<16?pe[ae++]=128|E:E<65536?(pe[ae++]=222,pe[ae++]=E>>8,pe[ae++]=E&255):(pe[ae++]=223,dr.setUint32(ae,E),ae+=4);let C;for(let I=0;I<E;I++)S(C=_[I]),S(x[C])}:(x,_)=>{pe[ae++]=222;let E=ae-r;ae+=2;let C=0;for(let I in x)(_||x.hasOwnProperty(I))&&(S(I),S(x[I]),C++);pe[E+++r]=C>>8,pe[E+r]=C&255}:x=>{let _=Object.keys(x),E,C=o.transitions||(o.transitions=Object.create(null)),I=0;for(let R=0,k=_.length;R<k;R++){let G=_[R];E=C[G],E||(E=C[G]=Object.create(null),I++),C=E}let N=C[Bh];if(N)N>=96&&m?(pe[ae++]=((N-=96)&31)+96,pe[ae++]=N>>5):pe[ae++]=N;else{N=o.nextId,N||(N=64),N<g&&this.shouldShareStructure&&!this.shouldShareStructure(_)?(N=o.nextOwnId,N<v||(N=g),o.nextOwnId=N+1):(N>=v&&(N=g),o.nextId=N+1);let R=_.highByte=N>=96&&m?N-96>>5:-1;C[Bh]=N,o[N-64]=_,N<g?(_.isShared=!0,o.sharedLength=N-63,s=!0,R>=0?(pe[ae++]=(N&31)+96,pe[ae++]=R):pe[ae++]=N):(R>=0?(pe[ae++]=213,pe[ae++]=114,pe[ae++]=(N&31)+96,pe[ae++]=R):(pe[ae++]=212,pe[ae++]=114,pe[ae++]=N),I&&(w+=b*I),y.length>=p&&(y.shift()[Bh]=0),y.push(C),S(_))}for(let R=0,k=_.length;R<k;R++)S(x[_[R]])},A=x=>{let _;if(x>16777216){if(x-r>wM)throw new Error("Packed buffer would be larger than maximum buffer size");_=Math.min(wM,Math.round(Math.max((x-r)*(x>67108864?1.25:2),4194304)/4096)*4096)}else _=(Math.max(x-r<<2,pe.length-1)>>12)+1<<12;let E=new Oy(_);return dr=new DataView(E.buffer,0,_),pe.copy?pe.copy(E,0,r,x):E.set(pe.slice(r,x)),ae-=r,r=0,Bi=E.length-10,pe=E}}useBuffer(e){pe=e,dr=new DataView(pe.buffer,pe.byteOffset,pe.byteLength),ae=0}};Fy=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,Rh];Zd=[{pack(i,e,t){let r=i.getTime()/1e3;if((this.useTimestamp32||i.getMilliseconds()===0)&&r>=0&&r<4294967296){let{target:n,targetView:s,position:o}=e(6);n[o++]=214,n[o++]=255,s.setUint32(o,r)}else if(r>0&&r<17179869184){let{target:n,targetView:s,position:o}=e(10);n[o++]=215,n[o++]=255,s.setUint32(o,i.getMilliseconds()*4e6+(r/1e3/4294967296>>0)),s.setUint32(o+4,r)}else if(isNaN(r)){if(this.onInvalidDate)return e(0),t(this.onInvalidDate());let{target:n,targetView:s,position:o}=e(3);n[o++]=212,n[o++]=255,n[o++]=255}else{let{target:n,targetView:s,position:o}=e(15);n[o++]=199,n[o++]=12,n[o++]=255,s.setUint32(o,i.getMilliseconds()*1e6),s.setBigInt64(o+4,BigInt(Math.floor(r)))}}},{pack(i,e,t){let r=Array.from(i),{target:n,position:s}=e(this.structuredClone?3:0);this.structuredClone&&(n[s++]=212,n[s++]=115,n[s++]=0),t(r)}},{pack(i,e,t){let{target:r,position:n}=e(this.structuredClone?3:0);this.structuredClone&&(r[n++]=212,r[n++]=101,r[n++]=0),t([i.name,i.message])}},{pack(i,e,t){let{target:r,position:n}=e(this.structuredClone?3:0);this.structuredClone&&(r[n++]=212,r[n++]=120,r[n++]=0),t([i.source,i.flags])}},{pack(i,e){this.structuredClone?SM(i,16,e):MM($d?Buffer.from(i):new Uint8Array(i),e)}},{pack(i,e){let t=i.constructor;t!==AM&&this.structuredClone?SM(i,Ny.indexOf(t.name),e):MM(i,e)}},{pack(i,e){let{target:t,position:r}=e(1);t[r]=193}}];function SM(i,e,t,r){let n=i.byteLength;if(n+1<256){var{target:s,position:o}=t(4+n);s[o++]=199,s[o++]=n+1}else if(n+1<65536){var{target:s,position:o}=t(5+n);s[o++]=200,s[o++]=n+1>>8,s[o++]=n+1&255}else{var{target:s,position:o,targetView:a}=t(7+n);s[o++]=201,a.setUint32(o,n+1),o+=4}s[o++]=116,s[o++]=e,s.set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength),o)}function MM(i,e){let t=i.byteLength;var r,n;if(t<256){var{target:r,position:n}=e(t+2);r[n++]=196,r[n++]=t}else if(t<65536){var{target:r,position:n}=e(t+3);r[n++]=197,r[n++]=t>>8,r[n++]=t&255}else{var{target:r,position:n,targetView:s}=e(t+5);r[n++]=198,s.setUint32(n,t),n+=4}r.set(i,n)}function EO(i,e,t,r){let n=i.length;switch(n){case 1:e[t++]=212;break;case 2:e[t++]=213;break;case 4:e[t++]=214;break;case 8:e[t++]=215;break;case 16:e[t++]=216;break;default:n<256?(e[t++]=199,e[t++]=n):n<65536?(e[t++]=200,e[t++]=n>>8,e[t++]=n&255):(e[t++]=201,e[t++]=n>>24,e[t++]=n>>16&255,e[t++]=n>>8&255,e[t++]=n&255)}return e[t++]=r,e.set(i,t),t+=n,t}function CO(i,e){let t,r=e.length*6,n=i.length-r;for(e.sort((s,o)=>s.offset>o.offset?1:-1);t=e.pop();){let s=t.offset,o=t.id;i.copyWithin(s+r,s,n),r-=6;let a=s+r;i[a++]=214,i[a++]=105,i[a++]=o>>24,i[a++]=o>>16&255,i[a++]=o>>8&255,i[a++]=o&255,n=s}return i}function Yo(i){if(i.Class){if(!i.pack&&!i.write)throw new Error("Extension has no pack or write function");if(i.pack&&!i.type)throw new Error("Extension has no type (numeric code to identify the extension)");Fy.unshift(i.Class),Zd.unshift(i)}bM(i)}var TM=new qo({useRecords:!1}),PO=TM.pack,DO=TM.pack;var{NEVER:LO,ALWAYS:IO,DECIMAL_ROUND:RO,DECIMAL_FIT:BO}=Jd,_M=512,NO=1024;var EM=new qo({structuredClone:!0});Yo({Class:jn.prototype.constructor,type:1,write(i){return se({},i)},read(i){return Object.setPrototypeOf(i,jn.prototype),i}});Yo({Class:rr.prototype.constructor,type:2,write(i){return[...i]},read(i){return Object.setPrototypeOf(i,rr.prototype),i}});Yo({Class:qn.prototype.constructor,type:3,write(i){return[...i]},read(i){return Object.setPrototypeOf(i,qn.prototype),i}});Yo({Class:Lh.prototype.constructor,type:4,write(i){return i.id},read(i){return new Lh(i)}});Yo({Class:Ih.prototype.constructor,type:5,write(i){return i.data},read(i){return new Ih(i)}});function OO(i){var e=0;if(i.length===0)return e;for(let t=0;t<i.length;t++){let r=i[t];e=(e<<5)-e+r,e=e&e}return e}var ep;(r=>{function i(n){return EM.pack(n)}r.serialize=i;function e(n){return EM.unpack(n)}r.deserialize=e;function t(n){return OO(i(n)).toString()}r.checksum=t})(ep||(ep={}));var tp;(t=>{t.all=["PointLight","SpotLight","DirectionalLight","HemisphereLight"];function e(r){return t.all.includes(r)}t.is=e})(tp||(tp={}));var rp;(t=>{function i(r){return e(r)}t.defaultData=i;function e(r){if(r==="PointLight")return{type:r,color:Ln.white,intensity:1,distance:2e3,decay:1,shadows:!0,shadowResolution:1024,shadowRadius:1,depth:2500,helper:!0};if(r==="SpotLight")return{type:r,color:Ln.white,intensity:1,distance:2e3,decay:1,shadows:!0,penumbra:0,angle:30/180*Math.PI,depth:2500,helper:!0};if(r==="DirectionalLight")return{type:r,color:Ln.white,intensity:1,shadows:!0,size:2500,depth:2500,helper:!0};throw new Error("not implemented")}})(rp||(rp={}));var Uy;(t=>{t.defaultData={castShadow:!0,receiveShadow:!0};function e(r,n){return r.castShadow===n.castShadow&&r.receiveShadow===n.receiveShadow}t.equals=e})(Uy||(Uy={}));var zy;(t=>{t.defaultData={flatShading:!1,wireframe:!1,side:0};function e(r,n){return r.flatShading===n.flatShading&&r.side===n.side&&r.wireframe===n.wireframe}t.equals=e})(zy||(zy={}));var np;(e=>e.defaultData=xe(se(se({},zy.defaultData),Uy.defaultData),{cloner:null,booleanExclude:null}))(np||(np={}));var Gy=(n=>(n[n.Left=1]="Left",n[n.Right=2]="Right",n[n.Center=3]="Center",n[n.Justify=4]="Justify",n))(Gy||{}),ky=(r=>(r[r.Top=1]="Top",r[r.Center=2]="Center",r[r.Bottom=3]="Bottom",r))(ky||{}),Vy=(r=>(r[r.None=1]="None",r[r.Upper=2]="Upper",r[r.Lower=3]="Lower",r))(Vy||{}),ip;(e=>e.defaultData={width:100,height:100,horizontalAlign:1,verticalAlign:1,fontSize:16,lineHeight:1.5,letterSpacing:1,text:"",textTransform:1,color:Ln.fromHexAndA(6974058,1),alpha:1,font:"roboto_regular"})(ip||(ip={}));var CM=["mode","gradientType","noiseType","displacementType","projection","cnormal","crop","axis","side"];var _l;(r=>{function i(n,s){return n==="light"&&s?e(s):t(n)}r.defaultData=i;function e(n){switch(n){case"basic":return{type:"light",category:"basic",alpha:1,visible:!0,mode:0};case"phong":return{category:"phong",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1,visible:!0,mode:0};case"toon":return{category:"toon",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1,visible:!0,mode:0};case"lambert":return{category:"lambert",emissive:{r:0,g:0,b:0,a:1},type:"light",alpha:1,visible:!0,mode:0};case"physical":return{category:"physical",roughness:.2,metalness:.2,reflectivity:.2,type:"light",alpha:1,visible:!0,mode:0}}}function t(n){switch(n){case"texture":return{alpha:1,visible:!0,size:[128,128],mode:0,axis:"x",side:2,type:"texture",projection:0,texture:{image:"image_0",wrapping:1001,repeat:[1,1],offset:[0,0]},crop:!0};case"color":return{type:"color",alpha:1,visible:!0,mode:0,color:Ar.fromHex(4737101)};case"depth":return{type:"depth",alpha:1,visible:!0,mode:0,gradientType:1,smooth:!1,isVector:!0,isWorldSpace:!1,origin:[0,0,0],direction:[1,0,0],colors:[[1,1,1,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,near:50,far:200};case"normal":return{type:"normal",alpha:1,visible:!0,mode:0,cnormal:[1,1,1]};case"gradient":return{type:"gradient",alpha:1,visible:!0,mode:0,gradientType:0,smooth:!1,colors:[[0,0,0,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,angle:0,offset:[0,0],morph:[0,0]};case"noise":return{type:"noise",alpha:1,visible:!0,mode:0,size:[100,100,100],noiseType:0,scale:1,move:1,colorA:xe(se({},Ar.fromHex(6710886)),{a:1}),colorB:xe(se({},Ar.fromHex(6710886)),{a:1}),colorC:xe(se({},Ar.fromHex(16777215)),{a:1}),colorD:xe(se({},Ar.fromHex(16777215)),{a:1}),distortion:[1,1],fA:[1.7,9.2],fB:[8.3,2.8]};case"fresnel":return{type:"fresnel",alpha:1,visible:!0,mode:0,color:Ln.fromHexAndA(16777215,1),bias:.1,scale:1,intensity:2,factor:1};case"rainbow":return{type:"rainbow",alpha:1,visible:!0,mode:0,filmThickness:30,movement:0,wavelengths:[0,0,0],noiseStrength:0,noiseScale:1,offset:[0,0,0]};case"matcap":return{type:"matcap",alpha:1,visible:!0,mode:0,texture:{image:"matcap_0",wrapping:1001,repeat:[1,1],offset:[0,0]}};case"transmission":return{type:"transmission",alpha:1,visible:!0,mode:0,thickness:10,ior:1.5,roughness:1};case"displace":return{type:"displace",displacementType:"noise",noiseType:0,scale:10,movement:1,offset:[0,0,0],intensity:8,visible:!0}}}})(_l||(_l={}));var ui;(a=>{function i(l){return!l.layers.some(h=>{if(h.data.type==="texture"&&h.data.projection!==0||h.data.type==="depth"&&!h.data.isWorldSpace||h.data.type==="noise"||h.data.type==="displace")return!0})&&!t(l)}a.isMergable=i;function e(l){let c="";return l.layers.forEach(h=>{Object.entries(h.data).forEach(([u,f])=>{c+=`${u}${f}`,Array.isArray(f)?f.forEach(d=>c+=`${d}`):typeof f=="object"?Object.values(f).forEach(d=>{typeof d=="number"?c+=`${d.toFixed(4)}`:c+=`${d}`}):c+=`${f}`})}),c}a.getHash=e;function t(l){let c=0;for(let h of l.layers)"alpha"in h.data&&h.data.type!=="light"&&h.data.type!=="fresnel"&&(c+=(1-c)*h.data.alpha);return c<1}a.isTransparent=t;function r(){return{layers:new rr}}a.defaultEmptyData=r;function n(l="layer1",c="layer2"){return s("phong",l,c)}a.defaultData=n;function s(l,c="layer1",h="layer2"){let u=new rr;return u.push({fi:0,data:_l.defaultData("light",l),id:c}),u.push({fi:1,data:_l.defaultData("color"),id:h}),{layers:u}}a.defaultTwoLayerData=s;function o(l,c="basic",h="layer1",u="layer2"){let f=_l.defaultData("texture");Object.assign(f.texture,{image:l});let d=new rr;return d.push({fi:0,data:f,id:h}),d.push({fi:1,data:_l.defaultData("light",c),id:u}),{layers:d}}a.defaultTwoLayerTextureData=o})(ui||(ui={}));var El;(e=>{function i(){return{points:new rr,roundness:0,shapeHoles:[],isClosed:!1}}e.defaultData=i})(El||(El={}));var sp;(e=>{function i(t){return t==="PolygonGeometry"||t==="RectangleGeometry"||t==="StarGeometry"||t==="TriangleGeometry"||t==="EllipseGeometry"}e.is2DParametricMesh=i})(sp||(sp={}));var Nh;(e=>{function i(t){if(t==="RectangleGeometry")return{width:320,height:320,type:t,cornerRadius:[0,0,0,0],cornerType:0,depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if(t==="VectorGeometry")return{width:1,height:1,type:t,subdivisions:12,shape:El.defaultData(),depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if(t==="BooleanGeometry")return{type:t,operation:2,width:0,height:0,depth:0,phongAngle:35};throw new Error("not implemented")}e.defaultData=i})(Nh||(Nh={}));var Oh;(n=>{n.identity=xe(se({},Bd.identity),{hiddenMatrix:Di.identity});function e(s){return{position:s.position,rotation:s.rotation,scale:s.scale,hiddenMatrix:s.hiddenMatrix}}n.fromObject=e;function t(s,o){return{position:(o==null?void 0:o.position)||s.position,rotation:(o==null?void 0:o.rotation)||s.rotation,scale:(o==null?void 0:o.scale)||s.scale,hiddenMatrix:(o==null?void 0:o.hiddenMatrix)||s.hiddenMatrix}}n.merge=t;function r(s,o){return{position:br.isEqual(s.position,o.position)?null:o.position,rotation:br.isEqual(s.rotation,o.rotation)?null:o.rotation,scale:br.isEqual(s.scale,o.scale)?null:o.scale,hiddenMatrix:Di.isEqual(s.hiddenMatrix,o.hiddenMatrix)?null:o.hiddenMatrix}}n.diff=r})(Oh||(Oh={}));var ds;(e=>e.defaultData=se({states:new rr,events:new rr,visible:!0,raycastLock:!1},Oh.identity))(ds||(ds={}));var PM;(e=>e.defaultData=se({type:"Empty"},ds.defaultData))(PM||(PM={}));var op;(e=>e.defaultData=se(se({type:"Mesh"},ds.defaultData),np.defaultData))(op||(op={}));var DM;(e=>e.defaultData=se(se({type:"TextFrame"},ds.defaultData),ip.defaultData))(DM||(DM={}));var ap;(e=>e.defaultData=se(se(se({},ds.defaultData),Oh.identity),Wo.defaultData))(ap||(ap={}));var LM;(e=>{function i(t){return se(se({},ds.defaultData),rp.defaultData(t))}e.defaultData=i})(LM||(LM={}));var IM;(r=>(r.defaultCamera=se({position:[0,0,1e3],scale:[1,1,1],rotation:[0,0,0],hiddenMatrix:Di.identity,name:"Play Camera",visible:!0,raycastLock:!1,states:new rr,events:new rr},Wo.defaultData),r.defaultMeshObject=xe(se(se({name:"Rectangle"},ds.defaultData),op.defaultData),{geometry:Nh.defaultData("RectangleGeometry"),material:ui.defaultTwoLayerData("basic","layer1","layer2")}),r.defaultBooleanObject=xe(se(se({name:"Boolean"},ds.defaultData),op.defaultData),{geometry:Nh.defaultData("BooleanGeometry"),material:ui.defaultTwoLayerData("phong","layer1","layer2")})))(IM||(IM={}));var Fh;(t=>{function i(r,n){if(n===void 0)return r;let s=se({},r);return"material"in s&&"material"in n&&n.material&&(s.material=Ty(s.material,o=>{if(typeof o!="string")for(let[a,l]of Object.entries(n.material.layers)){let c=o.layers.data(a);c&&Vo(c,l)}}).data),s.materials&&n.materials&&(s.materials=Ty(s.materials,o=>{var a,l;for(let c=0;c<s.materials.length;c++){let h=n.materials[c];if(typeof h!="string")for(let[u,f]of Object.entries(h.layers)){let d=(l=(a=o[c])==null?void 0:a.layers)==null?void 0:l.data(u);d&&Vo(d,f)}}}).data),s}t.patchMaterialState=i;function e(r,n){var o,a;if(n===void 0)return r;let s=se({},r);if(Object.assign(s,Oh.merge(s,n)),eo.is(r.type)){s.orthographic=se({},s.orthographic),s.perspective=se({},s.perspective);let l=n;((o=l.orthographic)==null?void 0:o.zoom)!==void 0&&(s.orthographic.zoom=l.orthographic.zoom),((a=l.perspective)==null?void 0:a.zoom)!==void 0&&(s.perspective.zoom=l.perspective.zoom),l.isUpVectorFlipped!==void 0&&(s.isUpVectorFlipped=l.isUpVectorFlipped),l.targetOffset!==void 0&&(s.targetOffset=l.targetOffset)}else if(r.type==="Mesh")s.geometry=se({},s.geometry),Object.assign(s.geometry,n.geometry),s=i(s,n);else if(tp.is(r.type)){let l=n;s.intensity!==void 0&&(s.intensity=l.intensity),l.color!==void 0&&(typeof l.color=="string"?s.color=l.color:s.color=Ar.clone(l.color))}return s}t.patch=e})(Fh||(Fh={}));function BM(i,e=!1){let t=i[0].index!==null,r=new Set(Object.keys(i[0].attributes)),n=new Set(Object.keys(i[0].morphAttributes)),s={},o={},a=i[0].morphTargetsRelative,l=new De,c=0;for(let h=0;h<i.length;++h){let u=i[h],f=0;if(t!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let d in u.attributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;s[d]===void 0&&(s[d]=[]),s[d].push(u.attributes[d]),f++}if(f!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(a!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let d in u.morphAttributes){if(!n.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;o[d]===void 0&&(o[d]=[]),o[d].push(u.morphAttributes[d])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(u.userData),e){let d;if(t)d=u.index.count;else if(u.attributes.position!==void 0)d=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,d,h),c+=d}}if(t){let h=0,u=[];for(let f=0;f<i.length;++f){let d=i[f].index;for(let p=0;p<d.count;++p)u.push(d.getX(p)+h);h+=i[f].attributes.position.count}l.setIndex(u)}for(let h in s){let u=RM(s[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(let h in o){let u=o[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let f=0;f<u;++f){let d=[];for(let m=0;m<o[h].length;++m)d.push(o[h][m][f]);let p=RM(d);if(!p)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(p)}}return l}function RM(i){let e,t,r,n=0;for(let a=0;a<i.length;++a){let l=i[a];if(l.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(e===void 0&&(e=l.array.constructor),e!==l.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=l.itemSize),t!==l.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=l.normalized),r!==l.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;n+=l.array.length}let s=new e(n),o=0;for(let a=0;a<i.length;++a)s.set(i[a].array,o),o+=i[a].array.length;return new Ve(s,t,r)}var Hy={type:"change"},NM={type:"changeZoom"},FO={type:"changePan"},Cl={type:"start"},Uh={type:"end"},Wy=new zt,UO=new B,zO=2*Math.PI,GO=1e-8,kO=.01,OM=2,jy=.125,FM=2,qy=1,Yy=1,Xy=.1;var lp=class extends Yt{constructor(t,r){super();this.object=t;this.domElement=r;this.enabled=!0;this.useKeyEvents=!0;this.enableDamping=!1;this.enableZoom=!0;this.enableRotate=!0;this.enablePan=!0;this.autoRotate=!1;this.rotationLimitsMode=0;this.panLimitsMode=0;this.rotationSoftLimit=2;this.panSoftLimit=2;this.hoverRotatePanMode=0;this.zoomLimitsEnabled=!1;this.preventScroll=!0;this.mouseButtons=[0,5];this.mouseButtonsPlay=[3,4,5];this.touches=[null,Cn.DOLLY_ROTATE,Cn.PAN];this.offset=new M;this.eye=new M;this.lastPosition=new M;this.lastQuaternion=new zt;this.current=new B;this.overShoot=new B;this.overRatio=new B;this.spherical=new fh;this.sphericalDelta=new fh;this.panOffset=new M;this.panLeftV=new M;this.panUpV=new M;this.panV=new M;this.rotateStart=new B;this.rotateEnd=new B;this.rotateDelta=new B;this.panStart=new B;this.panEnd=new B;this.panDelta=new B;this.dollyStart=new B;this.dollyEnd=new B;this.dollyDelta=new B;this.rotationRangeFactor=new B;this.panRangeFactor=new B;this.state=-1;this.zoomChanged=!1;this.isPointerDown=!1;this.isFirstHover=!0;this.isThetaFlipped=!1;this.prevScale=0;this.scale=1;this.gesture=!1;this.timer=-1;this.timerHover=-1;this.minDistance=0;this.maxDistance=1/0;this.minZoom=0;this.maxZoom=1/0;this.minPhi=0;this.maxPhi=Math.PI;this.minTheta=-1/0;this.maxTheta=1/0;this.minH=0;this.maxH=Math.PI;this.minV=-1/0;this.maxV=1/0;this.autoRotateClockwise=!0;this.isPanOverShoot=!1;this.isRotateOverShoot=!1;this.update=()=>{let t=this.object.position;this.offset.copy(t).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&this.state===-1&&this.rotateLeft((this.autoRotateClockwise===!0?1:-1)*this.getAutoRotationAngle()),this.rotationLimitsMode!==0&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),this.rotationLimitsMode!==2&&(this.spherical.phi+=this.sphericalDelta.phi),(this.rotationLimitsMode!==1||this.autoRotate===!0)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),this.panLimitsMode!==0&&(this.target.applyQuaternion(Wy.copy(this.object.quaternion).invert()),this.panOffset.applyQuaternion(Wy),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion(this.object.quaternion),this.panOffset.applyQuaternion(this.object.quaternion)),this.panLimitsMode===2&&(this.panOffset.y=0),this.panLimitsMode===1&&(this.panOffset.x=0),this.state===-1&&!this.gesture?(this.panOffset.multiplyScalar(1-jy),this.target.add(this.panOffset)):(this.target.add(this.panOffset),this.panOffset.set(0,0,0)),this.offset.setFromSpherical(this.spherical),t.copy(this.target).add(this.offset);let r=this.spherical.phi%zO;return this.eye.copy(this.offset).normalize(),this.object.up.copy(ot.DefaultUp).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),r>0&&r>Math.PI||r<0&&r>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),this.state===-1||this.enableDamping===!0?(this.sphericalDelta.theta*=1-jy,this.sphericalDelta.phi*=1-jy):this.sphericalDelta.set(0,0,0),this.scale=1,this.zoomChanged||this.lastPosition.distanceToSquared(this.object.position)>kO||8*(1-this.lastQuaternion.dot(this.object.quaternion))>GO?(this.dispatchEvent(Hy),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):(this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),!1)};this.onPointerDown=t=>{this.enabled!==!1&&(this.isPointerDown=!0,At.length===0&&(this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)),HO(t),t.pointerType==="touch"?this.onPointerDownTouch(t):this.onPointerDownMouse(t))};this.onPointerMove=t=>{this.enabled!==!1&&(t.pointerType==="touch"?this.onPointerMoveTouch(t):this.onPointerMoveMouse(t))};this.onPointerUp=t=>{zM(t),this.isPointerDown=!1,At.length===0&&(this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp)),this.dispatchEvent(Uh),this.state=-1};this.onPointerCancel=t=>{zM(t)};this.onPointerDownMouse=t=>{let r;switch(this.useKeyEvents?r=this.mouseButtons[t.button]:r=this.mouseButtonsPlay[t.button],r){case 0:if(t.altKey===!0&&!t.shiftKey&&!Ch(t)){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else if(this.key===" "){if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}break;case 4:if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2;break;case 3:if(Ch(t)||t.shiftKey){if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}else{if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}break;case 5:if(Ch(t)||t.shiftKey){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else{if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}break;default:this.state=-1}this.state!==-1&&this.dispatchEvent(Cl)};this.onPointerMoveMouse=t=>{switch(this.state){case 0:if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t);break;case 1:if(this.enableZoom===!1)return;this.handleMouseMoveDolly(t);break;case 2:if(this.enablePan===!1)return;this.handleMouseMovePan(t);break}};this.onPointerDownTouch=t=>{switch(GM(t),this.touches[At.length-1]){case Cn.ROTATE:if(this.enableRotate===!1){this.state=-1;return}this.handleTouchStartRotate(),this.state=3;break;case Cn.PAN:if(this.enablePan===!1){this.state=-1;return}this.handleTouchStartPan(),this.state=4;break;case Cn.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchStartDollyPan(),this.state=5;break;case Cn.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}this.state!==-1&&this.dispatchEvent(Cl)};this.onPointerMoveTouch=t=>{switch(GM(t),this.state){case 3:if(this.enableRotate===!1)return;this.handleTouchMoveRotate(t),this.update();break;case 4:if(this.enablePan===!1)return;this.handleTouchMovePan(t),this.update();break;case 5:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchMoveDollyPan(t),this.update();break;case 6:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchMoveDollyRotate(t),this.update();break;default:this.state=-1}};this.dispatchEndDebounced=Ah(()=>this.dispatchEvent(Uh),33);this.onMouseWheel=t=>{this.enabled===!1||this.enableZoom===!1&&this.enablePan===!1||((this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth||this.preventScroll)&&t.preventDefault(),this.dispatchEvent(Cl),this.handleMouseWheel(t),this.dispatchEndDebounced())};this.onGesture=t=>{if(this.enabled!==!1)if(t.preventDefault(),t.type==="gesturechange"){if(this.enableZoom===!1)return;this.dispatchEvent(Cl),t.scale>this.prevScale?this.dollyIn(this.getZoomScale()):t.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=t.scale,this.update()}else this.dispatchEvent(Uh)};this.onContextMenu=t=>{this.enabled!==!1&&t.preventDefault()};this.onTouchMove=t=>{(t.touches.length>1||this.preventScroll)&&t.preventDefault()};this.onTouchEnd=t=>{t.preventDefault()};this.onKeyDown=t=>{this.enabled!==!1&&(this.key=t.key)};this.onKeyUp=()=>{this.enabled!==!1&&(this.key=void 0,this.state!==-1&&this.onPointerUp(At[0]))};this.onPointerHover=t=>{if(!(Rd||this.enabled===!1||this.state!==-1||this.hoverRotatePanMode===2&&this.isPanOverShoot||this.hoverRotatePanMode===1&&this.isRotateOverShoot)){if(window.clearTimeout(this.timerHover),this.isPointerDown=!0,this.isFirstHover){let r={clientX:window.innerWidth/2,clientY:window.innerHeight/2};this.hoverRotatePanMode===2?this.handleMouseDownPan(r):this.hoverRotatePanMode===1&&this.handleMouseDownRotate(r),this.isFirstHover=!1}this.hoverRotatePanMode===2?this.handleMouseMovePan(t,Xy):this.hoverRotatePanMode===1&&this.handleMouseMoveRotate(t,Xy),this.timerHover=window.setTimeout(()=>{this.isPointerDown=!1},30)}};this.object=t,this.domElement=r,this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.connect(),this.update()}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Hy),this.isFirstHover=!0,this.update(),this.state=-1}resetTo(t,r,n){this.target.copy(t),this.object.position.copy(r),this.object.zoom=n,this.object.updateProjectionMatrix(),this.dispatchEvent(Hy),this.update(),this.state=-1}fromJSON(t){this.setEnableDampingSpeed(t.enableDamping),this.enablePan=t.enablePan,this.enableZoom=t.enableZoom,this.enableRotate=t.enableRotate,this.rotationLimitsMode=t.rotationLimitsMode,this.panLimitsMode=t.panLimitsMode,this.panSoftLimit=t.panSoftLimit,this.rotationSoftLimit=t.rotationSoftLimit,this.hoverRotatePanMode=t.hoverRotatePanMode,this.isFirstHover=!0,this.hoverRotatePanMode!==0&&this.domElement.addEventListener("pointermove",this.onPointerHover),Xy=(t.hoverRotatePanStrength/100)**2,this.zoomLimitsEnabled=t.zoomLimitsEnabled,this.minZoom=t.zoomLimits.min,this.maxZoom=Math.max(t.zoomLimits.min,t.zoomLimits.max),this.minDistance=1e3/t.zoomLimits.max,this.maxDistance=Math.max(this.minDistance,1e3/t.zoomLimits.min),this.autoRotate=t.autoRotate,OM=t.autoRotateSpeed,this.autoRotateClockwise=t.autoRotateClockwise;let n=this.object.getTarget().applyQuaternion(Wy.copy(this.object.quaternion).invert());this.minV=-t.panVerticalOffset.min+n.y,this.maxV=t.panVerticalOffset.max+n.y,this.minH=-t.panHorizontalOffset.min+n.x,this.maxH=t.panHorizontalOffset.max+n.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=no(this.spherical.phi-t.rotationVerticalOffset.min),this.maxPhi=no(this.spherical.phi+t.rotationVerticalOffset.max),this.minTheta=no(this.spherical.theta-t.rotationHorizontalOffset.min),this.maxTheta=no(this.spherical.theta+t.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,this.preventScroll=t.preventScroll,t.orbitTouches===1&&(this.touches[0]=Cn.ROTATE),t.panTouches===1&&(this.touches[0]=Cn.PAN),t.orbitTouches===2&&(this.touches[1]=Cn.DOLLY_ROTATE),t.panTouches===2&&(this.touches[1]=Cn.DOLLY_PAN),t.orbitTouches===3&&(this.touches[2]=Cn.ROTATE),t.panTouches===3&&(this.touches[2]=Cn.PAN)}connect(){this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),Ho||(this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture)),this.domElement.addEventListener("touchmove",this.onTouchMove),this.domElement.addEventListener("touchend",this.onTouchEnd)}dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerCancel),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),Ho||(this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture)),this.domElement.removeEventListener("touchmove",this.onTouchMove),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp)}applyLimits(t,r,n,s,o,a,l,c){this.overShoot.set(0,0);let h,u,f;t instanceof M?(h=t.x,u=t.y,this.current.set(this.target.x,this.target.y),f=!0):(h=t.theta,u=t.phi,this.current.set(no(this.spherical.theta),no(this.spherical.phi)),f=!1),n===0&&(this.current.x+=h,this.current.y+=u),(r===3||r===2)&&(!f&&this.isThetaFlipped?this.current.x>s&&this.current.x<0?this.overShoot.x=s-this.current.x:this.current.x<o&&this.current.x>0&&(this.overShoot.x=o-this.current.x):this.current.x>s?this.overShoot.x=s-this.current.x:this.current.x<o&&(this.overShoot.x=o-this.current.x),s===o&&(h=0)),(r===3||r===1)&&(this.current.y>a?this.overShoot.y=a-this.current.y:this.current.y<l&&(this.overShoot.y=l-this.current.y),a===l&&(u=0)),f||(this.overShoot.x=no(this.overShoot.x),this.overShoot.y=no(this.overShoot.y)),n!==0?(this.overRatio.copy(this.overShoot).divide(c),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),n===1&&(this.overRatio.x=UM(Math.abs(this.overRatio.x)),this.overRatio.y=UM(Math.abs(this.overRatio.y))),this.isPointerDown||n===1?n===2&&(this.overRatio.x>.9||this.overRatio.y>.9)?this.isPointerDown=!1:(h*this.overShoot.x<0&&(h*=1-this.overRatio.x),u*this.overShoot.y<0&&(u*=1-this.overRatio.y)):n===2&&(!f&&(this.overRatio.x>.002||this.overRatio.y>.002)||f&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(h=this.overShoot.x*.05,u=this.overShoot.y*.05,f?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):f?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(h+=this.overShoot.x,u+=this.overShoot.y),t instanceof M?(t.x=h,t.y=u):(t.theta=h,t.phi=u)}setEnableDampingSpeed(t){this.enableDamping=t,qy=t===!0?.2:1}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0}getAutoRotationAngle(){return 2*Math.PI/60/60*OM}getZoomScale(){return Math.pow(.95,FM)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}panLeft(t,r){this.panLeftV.setFromMatrixColumn(r,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,r){this.panUpV.setFromMatrixColumn(r,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,r){let n=this.domElement;if(n&&this.object.isPerspectiveCamera){let s=this.object.position;this.panV.copy(s).sub(this.target);let o=this.panV.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/n.clientHeight,this.object.matrix),this.panUp(2*r*o/n.clientHeight,this.object.matrix)}else n&&this.object.isOrthographicCamera&&(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this.panUp(r*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix));this.dispatchEvent(FO)}dollyOut(t){this.object.isPerspectiveCamera?this.scale/=t:this.object.isOrthographicCamera&&(this.object.zoom*=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(NM)}dollyIn(t){this.object.isPerspectiveCamera?this.scale*=t:this.object.isOrthographicCamera&&(this.object.zoom/=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(NM)}zoomOut(t=this.getZoomScale()){this.dispatchEvent(Cl),this.dollyOut(t),this.dispatchEvent(Uh)}zoomIn(t=this.getZoomScale()){this.dispatchEvent(Cl),this.dollyIn(t),this.dispatchEvent(Uh)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t,r=1){this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(qy*r).rotateAround(UO,-this.object.angleOffsetFromUp);let n=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/n.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/n.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t,r=1){this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(Yy*r),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.update()}handleMouseWheel(t){if(KS===!1&&Ch(t)===!1&&VO(t)===!0){if(this.enablePan===!1)return;this.gesture?(this.panDelta.set(-t.deltaX,-t.deltaY).multiplyScalar(Yy),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),t.altKey?this.pan(0,this.panDelta.y):t.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()):(this.gesture=!0,this.isPointerDown=!0),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.gesture=!1,this.isPointerDown=!1},30)}else{if(this.enableZoom===!1)return;t.deltaY===0?t.deltaX<0?this.dollyIn(this.getZoomScale()):t.deltaX>0&&this.dollyOut(this.getZoomScale()):t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}}handleTouchStartRotate(){if(At.length===2){let t=.5*(At[0].pageX+At[1].pageX),r=.5*(At[0].pageY+At[1].pageY);this.rotateStart.set(t,r)}else this.rotateStart.set(At[0].pageX,At[0].pageY)}handleTouchStartPan(){if(At.length===2){let t=.5*(At[0].pageX+At[1].pageX),r=.5*(At[0].pageY+At[1].pageY);this.panStart.set(t,r)}else this.panStart.set(At[0].pageX,At[0].pageY)}handleTouchStartDolly(){let t=At[0].pageX-At[1].pageX,r=At[0].pageY-At[1].pageY,n=Math.sqrt(t*t+r*r);this.dollyStart.set(0,n)}handleTouchStartDollyPan(){this.enableZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(t){if(At.length===2){let n=Qy(t),s=.5*(t.pageX+n.x),o=.5*(t.pageY+n.y);this.rotateEnd.set(s,o)}else{if(t.pointerId!==At[0].pointerId)return;this.rotateEnd.set(t.pageX,t.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(qy);let r=this.domElement;r&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/r.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/r.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(At.length===2){let r=Qy(t),n=.5*(t.pageX+r.x),s=.5*(t.pageY+r.y);this.panEnd.set(n,s)}else{if(t.pointerId!==At[0].pointerId)return;this.panEnd.set(t.pageX,t.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(Yy),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){let r=Qy(t),n=t.pageX-r.x,s=t.pageY-r.y,o=Math.sqrt(n*n+s*s);this.dollyEnd.set(0,o),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,FM)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}};function no(i){let e=Math.PI*2;for(;i<=-Math.PI;)i+=e;for(;i>Math.PI;)i-=e;return i}function UM(i){return 1-Math.pow(1-i,4)}function VO(i){return i.wheelDeltaY===0||i.deltaY===0?Eh&&i.shiftKey&&Math.abs(i.wheelDeltaX)>=120?!1:i.wheelDeltaX?i.wheelDeltaX===-3*i.deltaX:i.deltaMode===0:i.wheelDeltaY?i.wheelDeltaY===-3*i.deltaY:i.deltaMode===0}var At=[],cp={};function HO(i){At.push(i)}function zM(i){delete cp[i.pointerId];for(let e=0;e<At.length;e++)if(At[e].pointerId===i.pointerId){At.splice(e,1);return}}function GM(i){let e=cp[i.pointerId];e===void 0&&(e=new B,cp[i.pointerId]=e),e.set(i.pageX,i.pageY)}function Qy(i){let e=i.pointerId===At[0].pointerId?At[1]:At[0];return cp[e.pointerId]}var io=class extends jf{constructor(){super(),this.layers.enable(3)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,r=[]){return e.forEach(n=>{n.visible&&this.intersectObject(n,t,r)}),r}createRaycastLineHelper(){let e=new kr({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),r=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),n=this.camera.far-this.camera.near,s=new M().addVectors(t,r.multiplyScalar(n)),o=new De;return o.setFromPoints([t,s]),new os(o,e)}};var VM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var o,a,l,c,h;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},i.parameters),r=t.width/2,n=(a=t.radiusTop)!=null?a:r,s=(l=t.radiusBottom)!=null?l:r;return n===s?(n=r,s=r):n>s?(n=r,s=s*r/n):(n=n*r/s,s=r),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((h=t.depth)!=null?h:t.width),radiusTop:n,radiusBottom:s})}}static build(i){let{width:e,depth:t,height:r,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:h,cornerRadius:u,cornerSegments:f,hollow:d}=i.parameters,p;return u||d?p=new zh(c,h,r,n,s,o,a,l*Math.PI/180,u,u,f,d):p=new Lo(c,h,r,n,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:xe(se({},i),{type:"CylinderGeometry"})})}};function so(i,e,t){t.x=i.x*e.x,t.y=i.y,t.z=i.x*e.y}function kM(i){return new B(i.y,-i.x)}var zh=class extends De{constructor(e,t,r,n,s,o,a,l,c,h,u,f,d=!1){super(),this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,r=r||1,n=Math.floor(n)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,h=0);let p=[],m=[],g=[],v=[],y=0,w=r/2,b=new M,S=new M;d&&e==0&&(e=c),d&&t==0&&(t=h);let T=new B(e,w),A=new B(t,-w),x=null,_=null,E=null,C=null,I=T.clone().sub(A),N=0,R=0,k=0;f>0&&(N=Math.min(e,t)*(1-f),R=e-N,k=t-N);let G=T.clone();G.x-=N;let K=Math.PI-I.angle(),J=I.angle(),Y=Math.tan(J/2),F=Math.tan(K/2),U=Y+F,O=f?U:F,j=f?U:Y;if(c=Math.min(c,(e-R)/O,I.length()/U),h=Math.min(h,(t-k)/j,I.length()/U),c>0){let le=c/Y;x=T.clone().sub(new B(le,c)),f&&(E=x.clone(),E.x-=N-U*c),T.sub(I.clone().setLength(le))}if(h>0){let le=h/F;_=A.clone().sub(new B(le,-h)),A.add(I.clone().setLength(le)),f&&(C=_.clone(),C.x-=N-U*h,G.sub(I.clone().setLength(le)))}I=T.clone().sub(A);let H=I.length()<.5,X=[];for(let le=0;le<=n;le++){let q=[],ue=le/n,Z=ue*l+a,W=new B(Math.sin(Z),Math.cos(Z));C&&_?(V(q,ue,W,K,h,C,-1,!0),V(q,ue,W,J,h,_,-1,!1)):_?(he(q,W,_.x,0,-1),V(q,ue,W,J,h,_,-1,!1)):o||he(q,W,t,k,-1);let $=kM(I).normalize();if(so($,W,b),!H)for(let ce=0;ce<=s;ce++){let oe=ce/s,me=I.clone().multiplyScalar(oe).add(A);so(me,W,S),m.push(S.x,S.y,S.z),g.push(b.x,b.y,b.z),v.push(ue,.5+S.y/r),q.push(y++)}if(E&&x?(V(q,ue,W,K,c,x,1,!1),V(q,ue,W,J,c,E,1,!0)):x?(V(q,ue,W,K,c,x,1,!1),he(q,W,x.x,0,1)):o||he(q,W,e,R,1),f&&!H){let ce=kM(I).multiplyScalar(-1).normalize();so(ce,W,b);for(let oe=0;oe<=s;oe++){let me=oe/s,ve=I.clone().multiplyScalar(-me).add(G);so(ve,W,S),m.push(S.x,S.y,S.z),g.push(b.x,b.y,b.z),v.push(ue,.5+S.y/r),q.push(y++)}}f&&!o&&q.push(q[0]),X.push(q)}for(let le=0;le<X.length-1;le++)for(let q=0;q<X[0].length-1;q++){if(o&&f&&q==s)continue;let ue=X[le][q],Z=X[le+1][q],W=X[le+1][q+1],$=X[le][q+1],ce=m[W*3+0],oe=m[W*3+2];p.push(ue,Z,$),(ce!=0||oe!=0)&&p.push(Z,W,$)}l<Math.PI*2&&(ie(-1,X[0],a),ie(1,X[X.length-1],a+l)),this.setIndex(p),this.setAttribute("position",new Te(m,3)),this.setAttribute("normal",new Te(g,3)),this.setAttribute("uv",new Te(v,2));function V(le,q,ue,Z,W,$,ce,oe){for(let me=0;me<u+1;me++){let ve=me/u,ge=ce<0?ve:1-ve;oe&&(ge-=1),ge*=Z;let Le=new B(Math.sin(ge),Math.cos(ge)*ce),ke=Le.clone().multiplyScalar(W).add($);so(ke,ue,S),m.push(S.x,S.y,S.z),so(Le,ue,b),g.push(b.x,b.y,b.z),v.push(q,.5+S.y/r),le.push(y++)}}function he(le,q,ue,Z,W){let $=new M,ce=new B,oe=[ue,Z];W<0&&oe.reverse();for(let me of oe)ce.set(me,w*W),so(ce,q,$),m.push($.x,$.y,$.z),g.push(0,W,0),v.push(.5,.5),le.push(y++)}function ie(le,q,ue){let Z=new B(Math.sin(ue),Math.cos(ue)),W=new B(-Math.cos(ue),Math.sin(ue)),$=new M,ce=le<0?(ve,ge,Le)=>p.push(ve,ge,Le):(ve,ge,Le)=>p.push(ve,Le,ge),oe=new B((e+t+R+k)/4,0);so(oe,Z,$),m.push($.x,$.y,$.z),g.push(W.x,0,W.y),v.push(.5,.5);let me=y++;for(let ve of q){let ge=m.slice(ve*3,ve*3+3);m.push(...ge),g.push(W.x,0,W.y);let Le=v.slice(ve*2,ve*2+2);v.push(...Le),y++}for(let ve=me+1;ve<y-1;ve++)ce(me,ve,ve+1);ce(me,y-1,me+1)}}};var HM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,radialSegments:32,heightSegments:8,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadiusTop:0,cornerRadiusBottom:0,cornerSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,depth:t,height:r,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,cornerRadiusTop:c,cornerRadiusBottom:h,cornerSegments:u}=i.parameters,f;return c>0||h>0||l<360?f=new zh(0,e/2,r,n,s,o,a,l*Math.PI/180,c,h,u,0,!0):f=new za(e/2,r,n,s,o),f.scale(1,1,t/e),Object.assign(f,{userData:xe(se({},i),{type:"ConeGeometry"})})}};var WM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,widthSegments:n,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=i.parameters,c;return a==0?c=new vn(e,t,r,n,s,o):c=new Ky(e,t,r,n,s,o,a,l),Object.assign(c,{userData:xe(se({},i),{type:"CubeGeometry"})})}},Jy=Math.PI/2,Ky=class extends De{constructor(e=1,t=1,r=1,n=1,s=1,o=1,a=0,l=4){super(),this.type="BoxBufferGeometry";let c=this;n=Math.floor(n),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,r/2);let h=[],u=[],f=[],d=[],p=0,m=0;g("z","y","x",-1,-1,r,t,e,o,s,0),g("z","y","x",1,-1,r,t,-e,o,s,1),g("x","z","y",1,1,e,r,t,n,o,2),g("x","z","y",1,-1,e,r,-t,n,o,3),g("x","y","z",1,-1,e,t,r,n,s,4),g("x","y","z",-1,-1,e,t,-r,n,s,5),a>0&&(v("z","y","x",-1,-1,1,r,t,e,o,0),v("z","y","x",1,-1,-1,r,t,e,o,1),v("z","y","x",-1,1,-1,r,t,e,o,1),v("z","y","x",1,1,1,r,t,e,o,0),v("x","y","z",-1,-1,-1,e,t,r,n,0),v("x","y","z",1,-1,1,e,t,r,n,1),v("x","y","z",-1,1,1,e,t,r,n,0),v("x","y","z",1,1,-1,e,t,r,n,1),v("y","x","z",-1,-1,1,t,e,r,s,0),v("y","x","z",1,-1,-1,t,e,r,s,1),v("y","x","z",1,1,1,t,e,r,s,1),v("y","x","z",-1,1,-1,t,e,r,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(h),this.setAttribute("position",new Te(u,3)),this.setAttribute("normal",new Te(f,3)),this.setAttribute("uv",new Te(d,2));function g(w,b,S,T,A,x,_,E,C,I,N){let R=(x-2*a)/C,k=(_-2*a)/I,G=x/2-a,K=_/2-a,J=E/2,Y=C+1,F=I+1,U=0,O=0,j=new M;for(let H=0;H<F;H++){let X=H*k-K;for(let V=0;V<Y;V++){let he=V*R-G;j[w]=he*T,j[b]=X*A,j[S]=J,u.push(j.x,j.y,j.z),j[w]=0,j[b]=0,j[S]=E>0?1:-1,f.push(j.x,j.y,j.z),d.push(V/C),d.push(1-H/I),U+=1}}for(let H=0;H<I;H++)for(let X=0;X<C;X++){let V=p+X+Y*H,he=p+X+Y*(H+1),ie=p+(X+1)+Y*(H+1),le=p+(X+1)+Y*H;h.push(V,he,le),h.push(he,ie,le),O+=6}c.addGroup(m,O,N),m+=O,p+=U}function v(w,b,S,T,A,x,_,E,C,I,N){let R=(_-2*a)/I,k=_/2-a,G=E/2-a,K=C/2,J=I+1,Y=0,F=0,U=new M,O=new M;for(let j=0;j<l+1;j++){let H=j/l*Jy,X=Math.sin(H)*a,V=(1-Math.cos(H))*a,he=Math.sin(H),ie=Math.cos(H);U[b]=(G+X)*A,U[S]=(K-V)*x,O[w]=0,O[b]=he*Math.sign(U[b]),O[S]=ie*Math.sign(U[S]);for(let le=0;le<J;le++){let q=le*R-k;U[w]=q*T,u.push(U.x,U.y,U.z),f.push(O.x,O.y,O.z),d.push(le/I),d.push(0),Y+=1}}for(let j=0;j<l;j++)for(let H=0;H<I;H++){let X=p+H+J*j,V=p+H+J*(j+1),he=p+(H+1)+J*(j+1),ie=p+(H+1)+J*j;h.push(X,V,ie),h.push(V,he,ie),F+=6}c.addGroup(m,F,N),m+=F,p+=Y}function y(w,b,S){let T=new M,A=new M(e/2,t/2,r/2);A.subScalar(a);let x=[],_=w*b*S>0?(C,I,N)=>h.push(C,I,N):(C,I,N)=>h.push(C,N,I);for(let C=0;C<=l;C++){let I=[],N=Jy*(1-C/l),R=Math.cos(N),k=Math.sin(N),G=0;for(let K=0;K<=C;K++){let J=Math.cos(G),Y=Math.sin(G);T.x=R*J,T.y=k,T.z=R*Y;let F=A.clone().addScaledVector(T,a);u.push(w*F.x,b*F.y,S*F.z),f.push(w*T.x,b*T.y,S*T.z),d.push(0,0),I.push(p++),G+=Jy/C}x.push(I)}let E=x.length-1;for(let C=0;C<E;C++){let I=x[C],N=x[C+1],R=I.length-1;_(I[0],N[1],N[0]);for(let k=1;k<=R;k++)_(I[k-1],I[k],N[k]),_(I[k],N[k+1],N[k])}}}};var oo=class extends De{constructor(e=[],t=[],r="",n=1,s=.2,o=4){super(),this.type="PolyhedronGeometryRound";let a=[],l=[],c=[];h(),u(),this.setAttribute("position",new Te(a,3)),this.setAttribute("normal",new Te(c,3)),this.setAttribute("uv",new Te(l,2));return;function h(){var Y;s=Math.min(1-1e-5,s),s==0&&(o=0);let d={IcosahedronGeometry:5,DodecahedronGeometry:3,HexahedronGeometry:3,OctahedronGeometry:4,TetrahedronGeometry:3}[r],p=new M,m=p.clone(),g=new Jt,v=s*n,y=n-v,w=o+1,b=new M,S=(F,U)=>b.subVectors(F,U).normalize(),T=(F,U)=>Array(F).fill(void 0).map(U),A=T(e.length/3,(F,U)=>new M().fromArray(e,U*3).setLength(n)),x=[],_=1e6;for(let F=0;F<A.length;F++){let U=A[F],O=[],j,H,X,V=1e10,he=-1;for(;(he=t.indexOf(F,he+1))!=-1;){let ue=he-he%3;j=t[ue+(he+1)%3],H=t[ue+(he+2)%3],X=U.distanceToSquared(A[j]),V=Math.min(V,X),O.push([j,H,X])}V+=1e-6;let ie=[],le=0,q=O.length;for(let ue=0;ue<q;ue++){[j,H,X]=O[le];let Z=((Y=x[j])==null?void 0:Y.includes(F))==!0;X<=V&&ie.push(j+ +Z*_),le=O.findIndex(W=>W[0]==H)}x.push(ie)}let E=[];{let F=0,U=0,O,j,H=d==3;for(let X=0;X<=o;X++){O=X*(X+1)/2,j=(X+1)*(X+2)/2;for(let V=0;V<o-X;V++)[F,U]=[O+V+X+2,j+V+X+3],E.push(O,j,...H?[U,O]:[F,j],U,F),[O,j]=[F,U];E.push(O,j,O+o+2)}}let C=p.clone(),I=p.clone(),N=p.clone(),R=p.clone(),k=p.clone(),G=[],K=T(A.length,()=>T(d,()=>p.clone()));for(let F=0;F<A.length;F++){p.copy(A[F]).normalize(),C.copy(p).multiplyScalar(y);let U=x[F];for(let ie=0;ie<U.length;ie++){let le=U[ie],q=U[(ie+1)%d];g.setFromPointsAndIndices(A,F,le%_,q%_),g.b.sub(g.a).setLength(1e10).add(g.a),g.c.sub(g.a).setLength(1e10).add(g.a),g.closestPointToPoint(C,K[F][ie])}let O=[],j=[],H=[],X=new M;o==0&&[...K[F]].reduce((ie,le)=>ie.add(le),X).multiplyScalar(1/d);for(let ie=0;ie<d;ie++){let le=[],q=(ie-1+d)%d,ue=K[F][q],Z=K[F][ie];p.copy(ue).sub(C),m.copy(Z).sub(C);let W=C.angleTo(p),$=p.angleTo(m),ce=Math.cos(W)*v;o==0?I.copy(X):I.copy(C).setLength(y+ce),j.push(ce);let oe=[I,ue,Z];for(let me=0;me<2;me++){let ve=oe[me],ge=oe[me+1];R.subVectors(ve,C),k.subVectors(ge,C),N.crossVectors(R,k).normalize();for(let Le=0;Le<w;Le++){let ke=[W,$][me]*Le/w;p.copy(R).applyAxisAngle(N,ke).add(C),O.push(p.clone()),me&&(S(p,C),le.push([Le==0?ve:p.clone(),b.clone()]))}me&&(S(ge,C),le.push([ge,b.clone()]))}H.push(le)}G.push(H);let V=2*w,he=2;for(let ie=0;ie<d;ie++){let le=V*ie,q=V*((ie+1)%d),ue=[O[le]];for(let W=1;W<w;W++){R=O[le+W],k=O[q+W],ue.push(R);for(let $=1,ce=W-he+1;$<=ce;$++)p.lerpVectors(R,k,$/(ce+1)),p.sub(C).setLength(j[ie]).add(C),ue.push(p.clone());ue.push(k)}for(let W=0;W<w;W++)ue.push(O[W+w+le]);ue.push(O[q+w]);let Z=E.map(W=>ue[W]);a.push(...Z.map(W=>[W.x,W.y,W.z]).flat()),c.push(...Z.map(W=>(S(W,C),[b.x,b.y,b.z])).flat())}}let J=[];for(let F=0;F<x.length;F++)for(let U=0;U<d;U++){let O=x[F][U];if(O<_){let j=x[O].findIndex(V=>V%_==F),H=G[F][U],X=G[O][j];for(let V=0;V<w;V++){let he=H[V],ie=X[w-V],le=H[V+1],q=X[w-(V+1)];[he,ie,le,le,ie,q].forEach(ue=>{a.push(ue[0].x,ue[0].y,ue[0].z),c.push(ue[1].x,ue[1].y,ue[1].z)})}J.push(H[0][0],X[w][0],H[w][0],X[0][0])}}for(;J.length;){let F,U,O,j;[F,U]=J.splice(0,2);let H=[F];for(;F!=U;)H.push(U),O=J.indexOf(U),j=O%2,U=J.splice(O-j,2)[1-j];b.subVectors(H[0],H[1]).cross(p.subVectors(H[0],H[2])).normalize();let X=b.dot(H[0])<0;X&&b.negate();for(let V=1;V<=H.length-2;V++)[H[V+ +X],H[V+1-+X],H[0]].forEach(he=>{a.push(he.x,he.y,he.z),c.push(b.x,b.y,b.z)})}}function u(){let f=new M;for(let A=0;A<a.length;A+=3){f.x=a[A+0],f.y=a[A+1],f.z=a[A+2];let x=S(f)/2/Math.PI+.5,_=T(f)/Math.PI+.5;l.push(x,1-_)}let d=new M,p=new M,m=new M,g=new M,v=new B,y=new B,w=new B,b=(A,x,_,E)=>{E<0&&A.x===1&&(l[x]=A.x-1),_.x===0&&_.z===0&&(l[x]=E/2/Math.PI+.5)};for(let A=0,x=0;A<a.length;A+=9,x+=6){d.set(a[A+0],a[A+1],a[A+2]),p.set(a[A+3],a[A+4],a[A+5]),m.set(a[A+6],a[A+7],a[A+8]),v.set(l[x+0],l[x+1]),y.set(l[x+2],l[x+3]),w.set(l[x+4],l[x+5]),g.copy(d).add(p).add(m).divideScalar(3);let _=S(g);b(v,x+0,d,_),b(y,x+2,p,_),b(w,x+4,m,_)}for(let A=0;A<l.length;A+=6){let x=l[A+0],_=l[A+2],E=l[A+4],C=Math.max(x,_,E),I=Math.min(x,_,E);C>.9&&I<.1&&(x<.2&&(l[A+0]+=1),_<.2&&(l[A+2]+=1),E<.2&&(l[A+4]+=1))}function S(A){return Math.atan2(A.z,-A.x)}function T(A){return Math.atan2(-A.y,Math.sqrt(A.x*A.x+A.z*A.z))}}}static fromJSON(e){return new oo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var jM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,detail:0,corner:0,cornerSides:4},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,detail:n,corner:s,cornerSides:o}=i.parameters,a=n===0&&s!==0?new Gh(e*.5,s,o):new ka(e*.5,n);return a.scale(1,t/e,r/e),Object.assign(a,{userData:xe(se({},i),{type:"DodecahedronGeometry"})})}},Gh=class extends oo{constructor(e=1,t=.2,r=4){let n=(1+Math.sqrt(5))/2,s=1/n,o=[-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,-s,-n,0,-s,n,0,s,-n,0,s,n,-s,-n,0,-s,n,0,s,-n,0,s,n,0,-n,0,-s,n,0,-s,-n,0,s,n,0,s],a=[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],l="DodecahedronGeometry";super(o,a,l,e,t,r),this.type=l}static fromJSON(e){return new Gh(e.radius,e.corner,e.cornerSides)}};var kh=1e-12,Pl=class{constructor(e){this.position=new B;this.startPosition=new B;this.uuid=et.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Pl(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Dl=class extends Pl{constructor(t){super(t.position);this.parent=t}copy(t){return super.copy(t),this}clone(){return new Dl(this.parent).copy(this)}},fi=class extends Pl{constructor(t,r){super(r);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=t,this.controls.push(new Dl(this),new Dl(this))}static create(t,r){let n=new fi(t,new B(...r.position));return n.controls[0].position.set(...r.controlPrevious.position),n.controls[1].position.set(...r.controlNext.position),n.roundness=r.roundness,n.areControlsDirectionsMirrored=r.areControlsDirectionsMirrored,n}getOppositeControl(t){let r=this.controls.indexOf(t);return r===0?this.controls[1]:r===1?this.controls[0]:null}applyOffsetToControls(t,r=1){for(let n=0,s=this.controls.length;n<s;n++){let o=this.controls[n];this.position.distanceTo(o.position)<=r?o.position.copy(this.position):o.applyOffset(t)}}controlsMoved(){return!(this.position.equals(this.controls[0].position)&&this.position.equals(this.controls[1].position))}copy(t){return super.copy(t),this.controls[0].copy(t.controls[0]),this.controls[1].copy(t.controls[1]),this.roundness=t.roundness,this.uuid=t.uuid,this}clone(){return new fi(this.uuid,this.position).copy(this)}toJSON(){return super.toJSON().concat(this.controls[0].toJSON(),this.controls[1].toJSON(),[this.roundness])}computeTangents(){var n,s;let t=(n=this.curveBefore)==null?void 0:n.getTangentAt(1),r=(s=this.curveAfter)==null?void 0:s.getTangentAt(0);return[t,r]}computeNormals(t=new B,r=new B){let[n,s]=this.computeTangents();return n&&s&&(qM(n,t),qM(s,r)),[t,r]}computeTangent(t=new B){let[r,n]=this.computeTangents();return r&&n&&t.copy(r).add(n).normalize(),t}computeNormal(t=new B){let[r,n]=this.computeNormals();return t.copy(r).add(n).normalize(),t}};function qM(i,e=new B){let t=i.length();return e.set(-i.y/t,i.x/t)}var $y=i=>i,Ll=new B,hp=new B,WO=new B,jO=new B,qO=new B,YO=new B,XM=new M,QM=new M;function JM(i){let e=new B;e.addVectors(i.v0,Ll.subVectors(i.v1,i.v0).multiplyScalar(2/3));let t=new B;return t.addVectors(i.v2,hp.subVectors(i.v1,i.v2).multiplyScalar(2/3)),new an(i.v0,e,t,i.v2)}function Vh(i,e,t=Number.EPSILON){return Math.abs(i-e)<t}function XO(i,e,t=Number.EPSILON){return i.distanceTo(e)<t}function QO(i,e,t=Number.EPSILON){return i.distanceTo(e)<t}function ev(i,e,t){let r=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),s=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2));return Math.acos((n*n+r*r-s*s)/(2*n*r))}function KM(i,e,t){return YM(i,e)&&YM(e,t)&&Zy(i.position,e.position,t.position)}function Zy(i,e,t){return Ll.copy(e).sub(i).cross(hp.copy(t).sub(i))===0}function ZM(i,e,t,r,n){let s=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),o=(i.y+e.y)/2,a=(i.x+e.x)/2,l=Math.sqrt(Math.pow(t,2)-Math.pow(s/2,2))*(i.y-e.y)/s,c=Math.sqrt(Math.pow(t,2)-Math.pow(s/2,2))*(e.x-i.x)/s;return r.set(a+l,o+c),n.set(a-l,o-c),[r,n]}function $M(i,e,t){let r=i.distanceTo(t),n=e.distanceTo(t);return r<n?e:i}function e1(i,e,t,r,n,s){let o=e.x-i.x,a=e.y-i.y,l=t.x-i.x,c=t.y-i.y,h=Math.sqrt((o+l)*(o+l)+(a+c)*(a+c)),u;return ev(e,i,t)>Math.PI&&(h*=-1),Vh(c,a)?u=(a+c)*(r/h-.5)*8/3/(o-l):u=(o+l)*(r/h-.5)*8/3/(c-a),n.set(e.x-u*a,e.y+u*o),s.set(t.x+u*c,t.y-u*l),[n,s]}function tv(i,e){return i.position.equals(i.controls[1].position)&&e.position.equals(e.controls[0].position)}function YM(i,e){return Zy(i.position,i.controls[1].position,e.position)&&Zy(i.position,e.controls[0].position,e.position)}function t1(i,e,t,r,n=.5){let s=Ll.subVectors(e,i).multiplyScalar(n).add(i),o=hp.subVectors(t,e).multiplyScalar(n).add(e),a=WO.subVectors(r,t).multiplyScalar(n).add(t),l=s,c=jO.subVectors(o,s).multiplyScalar(n).add(s),h=qO.subVectors(a,o).multiplyScalar(n).add(o),u=a,f=YO.subVectors(h,c).multiplyScalar(n).add(c);return[i.x,i.y,l.x,l.y,c.x,c.y,f.x,f.y,h.x,h.y,u.x,u.y,r.x,r.y]}function r1(i,e,t=12,r=!0){let n=QM.set(0,0,0),s,o=0,a=[];for(let l=0;l<e.length;l++){let c=$y(e[l]),h=Ll,u=ao(c,t);a.push(u);for(let f=0;f<=u;f++)if(c instanceof an||c instanceof kn||c instanceof ln){if(c.getPoint(f/u,h),n.set(h.x,h.y,0),s!==void 0&&QO(s,n))continue;s===void 0&&(s=XM),s.copy(n),i.setXYZ(o,n.x,n.y,n.z),o++}}return r&&o>1&&!(i.getX(o-1)===i.getX(0)&&i.getY(o-1)===i.getY(0)&&i.getZ(o-1)===i.getZ(0))&&(i.setXYZ(o,i.getX(0),i.getY(0),i.getZ(0)),o++),i}function n1(i,e,t,r=12,n=!0){let s=QM.set(0,0,0),o=0,a=[];for(let l=0;l<e.length;l++){if(t[l]===!1)continue;let c,h=$y(e[l]),u=Ll,f=ao(h,r);a.push(f);for(let d=0;d<=f;d++)if(h instanceof an||h instanceof kn||h instanceof ln){if(h.getPoint(d/f,u),s.set(u.x,u.y,0),c!=null&&c.equals(s))continue;c===void 0?c=XM:(i.setXYZ(o,c.x,c.y,c.z),o++,i.setXYZ(o,s.x,s.y,s.z),o++),c.copy(s)}}return n&&o>1&&!(i.getX(o-1)===i.getX(0)&&i.getY(o-1)===i.getY(0)&&i.getZ(o-1)===i.getZ(0))&&(i.setXYZ(o,i.getX(0),i.getY(0),i.getZ(0)),o++),a}function rv(i,e=12,t=!1){let r=[];for(let n=0,s=i.length;n<s;n++){let o=i[n],a=0;if(t&&o.roundedCurveCorner!==void 0){let l=ao(o.roundedCurveCorner,e)*.5;n>0&&(r[n-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=ao(o.curveAfter,e)),r.push(a)}return i.length>0&&t&&i[0].roundedCurveCorner!==void 0&&(r[i.length-1]+=ao(i[0].roundedCurveCorner,e)*.5),r}function ao(i,e=12){return i&&i instanceof Us?e*2:i&&(i instanceof ln||i instanceof rh)?1:i&&i instanceof Do?e*i.points.length:e}function i1(i,e,t=12,r=!0){let n,s=0;for(let o=0;o<e.length;o++){let a=$y(e[o]),l=ao(a,t),c=Ll;for(let h=0;h<=l;h++)if(a instanceof an||a instanceof kn||a instanceof ln){if(a.getPoint(h/l,c),n!==void 0&&XO(n,c,kh))continue;n===void 0&&(n=hp),n.copy(c),i.push(c.x,c.y),s++}}return Vh(i[0],i[i.length-2],kh)&&Vh(i[1],i[i.length-1],kh)&&(i.pop(),i.pop()),r&&s>1&&!(Vh(i[s-1],i[1],kh)&&Vh(i[s-2],i[0],kh))&&(i.push(i[0],i[1]),s++),i}var nv=new B,JO=new B,KO=new B,ZO=new B,$O=new B,eF=new B,Tt=class extends rn{constructor(t=100,r=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new Yt;this.plane=new Gr(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=et.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=t,this._height=r}static createFromState(t,r,n){let s=new Tt;return s.isClosed=t.isClosed,s.points=t.points.map(o=>fi.create(o.id,o.data)),typeof t.roundness=="number"&&(s.roundness=t.roundness),s.shapeHoles=t.shapeHoles.map(o=>Tt.createFromState(o)),r!==void 0&&n!==void 0&&s.applySize(r,n),s.update(),s}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(t){if(this._roundness!==t){this._roundness=t;for(let r=0,n=this.points.length;r<n;r++)this.points[r].roundness=t;this.needsUpdate=!0}}getPointsIndexesByIds(t){return t.map(r=>this.getPointIndexById(r)).filter(r=>r>=0)}getPointIndexById(t){let r=this.points.length,n=this.points.findIndex(s=>s.uuid===t);if(n<0){let s=r;for(let o=0,a=this.shapeHoles.length;o<a;o++){let l=this.shapeHoles[o],c=l.points.length-1,h=l.getPointIndexById(t);if(h<0)s+=c;else return h+s}}return n}getLineIndexById(t){return this.getPointIndexById(t)}getBezierPoint(t){if(t<=this.points.length-1)return this.points[t];if(this.shapeHoles.length>0)for(let r=0,n=this.shapeHoles.length;r<n;r++){let s=this.shapeHoles[r],o=t-this.points.length;if(o<=s.points.length-1)return s.points[o]}throw new Error("This shape does not have a point for this index: "+t)}getBezierPointIndex(t){let r=this.points.indexOf(t);if(r>=0)return r;if(r=this.points.length,this.shapeHoles.length>0)for(let n=0,s=this.shapeHoles.length;n<s;n++){let o=this.shapeHoles[n],a=o.points.indexOf(t);if(a>=0)return r+a;r+=o.points.length}return-1}getAllPoints(){let t=[].concat(...this.shapeHoles.map(r=>r.points));return[...this.points,...t]}applySize(t,r){t===0&&(t=.001),r===0&&(r=.001),this._width=t,this._height=r}applyScale(t,r){let n=nv.set(t,r);for(let s=0,o=this.points.length;s<o;s++){let a=this.points[s];a.position.multiply(n),a.controls[0].position.multiply(n),a.controls[1].position.multiply(n)}for(let s=0,o=this.shapeHoles.length;s<o;s++)this.shapeHoles[s].applyScale(t,r);this._update(!1)}createPoint(t,r=0,n=et.generateUUID()){let s;t instanceof B?s=t:s=new B(t,r);let o=new fi(n,s);return o.roundness=this.roundness,o}addPoint(t){this.points.push(t),this.needsUpdate=!0}addPointAt(t,r){this.points.splice(r,0,t),this.needsUpdate=!0}getPointByUuid(t){for(let r=0,n=this.points.length;r<n;r++){let s=this.points[r];if(s.uuid===t)return s}for(let r=0,n=this.shapeHoles.length;r<n;r++){let o=this.shapeHoles[r].getPointByUuid(t);if(o)return o}}getFirstPoint(){return this.points[0]}getLastPoint(){return this.points[this.points.length-1]}removePoint(t){let r=this.points.indexOf(t);r>=0&&this.points.splice(r,1),this.needsUpdate=!0}removePointById(t){let r=this.points.find(n=>n.uuid===t);r&&this.removePoint(r)}update(t=!0){for(let r=0,n=this.shapeHoles.length;r<n;r++)this.shapeHoles[r].update(!1);this._update(t)}extractShapePointsToBuffer(t,r=12,n=!1){this.subdivision=r,this.curveDivisions===void 0&&this.computeCurveDivisions(r);let s=n?this.roundedCurveDivisions:this.curveDivisions;return r1(t,n?this.roundedCurves:this.curves,r,this.autoClose),s.reduce((o,a)=>o+a,0)+1}computeCurveDivisions(t=12){return this.curveDivisions=rv(this.points,t,!1),this.roundedCurveDivisions=rv(this.points,t,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(t,r,n=12){return n1(t,this.curves,r,n,this.autoClose).reduce((o,a)=>o+a,0)*2}extractShapePointsToFlatArray(t,r=12){return this.subdivision=r,this.curveDivisions===void 0&&this.computeCurveDivisions(r),i1(t,this.roundedCurves,r,this.autoClose)}getCurveIndexFromVertexId(t,r=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let s=r?this.roundedCurveDivisions:this.curveDivisions,o=0;r&&this.points[0].roundedCurveCorner!==void 0&&(o=ao(this.points[0].roundedCurveCorner,this.subdivision)*.5);let a=t-o;a<0&&(a+=s.reduce((l,c)=>l+c,0));for(let l=0,c=s.length;l<c;l++){let h=s[l];if(a<n+h)return[l,(a-n+1)/h];n+=h}return[0,1]}getCurveT(t,r,n){let s=this.points[t],o=this.points[t>=this.points.length-1?0:t+1],a=this.curveDivisions,l=a[t];if(tv(s,o)){let u=s.position.distanceTo(o.position);return s.position.distanceTo(nv.set(n.x,n.y))/u}let c=0;for(let u=0;u<t;u++)c+=a[u];return(r-c)/l}dispose(){this.eventDispatcher=null}_applyCurveForPoint(t,r){tv(r,t)?this.lineTo(t.position.x,t.position.y):this.bezierCurveTo(r.controls[1].position.x,r.controls[1].position.y,t.controls[0].position.x,t.controls[0].position.y,t.position.x,t.position.y);let n=this.curves[this.curves.length-1];t.curveBefore=n,r.curveAfter=n;let s=n.clone();t.roundedCurveBefore=s,r.roundedCurveAfter=s,t.roundedCurveCorner=void 0,this.roundedCurves.push(s)}_update(t=!0){var n,s,o;if(this.curves=[],this.roundedCurves=[],!this.points.length)return;for(let a=0,l=this.points.length;a<l;a++){let c=this.points[a];if(a===0)this.moveTo(c.position.x,c.position.y);else{let h=this.points[a-1];this._applyCurveForPoint(c,h)}}let r=this.getLastPoint();if(r!=null&&r.curveAfter&&(r.curveAfter=void 0),this.isClosed){let a=this.points[0],l=this.points[this.points.length-1];this._applyCurveForPoint(a,l)}if(this.points.length>2){let a=0;for(let l=0,c=this.points.length;l<c;l++){let h=this.points[l],u=(n=this.points[l-1])!=null?n:this.points[this.points.length-1],f=(s=this.points[l+1])!=null?s:this.points[0],d=h.roundness,p=u&&f&&KM(u,h,f);if(!h.controlsMoved()&&d>0&&!p){let m=h.curveBefore,g=h.curveAfter;if(m===void 0||g===void 0)continue;let v=h.roundedCurveBefore,y=h.roundedCurveAfter,w=m.getLength(),b=g.getLength(),S=Math.min(d,w*.499),T=Math.min(d,b*.499),A=Math.min(S,T),x=1-A/w,_=A/b,E=m.getPointAt(x,nv),C=g.getPointAt(_,JO);this._subSplitCurve(m,v,x,E,void 0),this._subSplitCurve(g,y,_,void 0,C);let I;if(this.useCubicForRoundedCorners){let N=ev(E,h.position,C)/2,R=Math.tan(N)*E.distanceTo(h.position),[k,G]=ZM(E,C,R,KO,ZO),K=$M(k,G,h.position),[J,Y]=e1(K,E,C,R,$O,eF);I=new an(E.clone(),J.clone(),Y.clone(),C.clone())}else I=new kn(E.clone(),h.position.clone(),C.clone());h.roundedCurveCorner=I,this.roundedCurves.splice(l+a,0,I),a++}}}t&&((o=this.eventDispatcher)==null||o.dispatchEvent({type:"update"}))}_subSplitCurve(t,r,n,s,o){if(t instanceof ln)s!==void 0&&r.v2.copy(s),o!==void 0&&r.v1.copy(o);else{let a=t,l=r,c=a.getUtoTmapping(n,0),h=t1(a.v0,a.v1,a.v2,a.v3,c);return s!==void 0&&(l.v0.set(h[0],h[1]),l.v1.set(h[2],h[3]),l.v2.set(h[4],h[5]),l.v3.set(h[6],h[7])),o!==void 0&&(l.v0.set(h[6],h[7]),l.v1.set(h[8],h[9]),l.v2.set(h[10],h[11]),l.v3.set(h[12],h[13])),l}return r}clone(){let t=new Tt(this._width,this._height);return t.points=this.points.map(r=>r.clone()),t.isClosed=this.isClosed,t.roundness=this.roundness,t.isMesh2D=this.isMesh2D,t.shapeHoles=this.shapeHoles.map(r=>r.clone()),t}toJSON(){return{points:this.points.reduce((t,r)=>t.concat(r.toJSON()),[]),shapeHoles:this.shapeHoles.map(t=>t.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(t){var n;this.points=[],this.pointIDs=0;let r=t.points.length/7;for(let s=0;s<r;s++){let o=s*7,a=t.points[o+0],l=t.points[o+1],c=t.points[o+2],h=t.points[o+3],u=t.points[o+4],f=t.points[o+5],d=t.points[o+6],p=new fi(et.generateUUID(),new B(a,l));p.controls[0].position.set(c,h),p.controls[1].position.set(u,f),p.roundness=d,this.points.push(p)}return this.shapeHoles=(n=t.shapeHoles)!=null&&n.length?t.shapeHoles.map(s=>{let o=new Tt;return o.fromJSON(s),o}):[],this.isClosed=t.isClosed,this._roundness=t.roundness,this._update(),this}fromShape(t){let r=(s,o)=>{o instanceof an&&o.v3.equals(s.position)&&s.controls[0].position.copy(o.v2)},n=s=>{let o=[],a,l;for(a=0,l=s.length;a<l;a++)s[a]instanceof kn&&(s[a]=JM(s[a]));for(a=0,l=s.length;a<l;a++){let u=s[a],f=a>0?s[a-1]:null,d;u instanceof an?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ln&&(d=this.createPoint(u.v1)),d!==void 0&&(f!==null&&r(d,f),o.push(d))}let c=s[s.length-1],h=!1;return c instanceof an?c.v3.equals(o[0].position)&&(o[0].controls[0].position.copy(c.v2),h=!0):c instanceof ln&&c.v2.equals(o[0].position)&&(h=!0),this.isClosed=h,o};return this.points=n(t.curves),t instanceof rn&&(this.shapeHoles=t.holes.map(s=>{let o=new Tt;return o.fromShape(s),o})),this.update(),this}};var sv=Math.PI*2;function iv({x:i,y:e},t,r,n,s){return{x:i*t+n,y:e*r+s}}function tF(i,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),r=Math.cos(i),n=Math.sin(i),s=Math.cos(i+e),o=Math.sin(i+e);return[{x:r-n*t,y:n+r*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function s1(i,e,t,r){let n=i*r-e*t<0?-1:1,s=Math.min(1,Math.max(-1,i*t+e*r));return n*Math.acos(s)}function rF(i,e,t,r,n,s,o,a,l,c){let h=Math.pow(n,2),u=Math.pow(s,2),f=Math.pow(o,2),d=Math.pow(a,2),p=h*u-h*d-u*f;p<0&&(p=0),p/=h*d+u*f,p=Math.sqrt(p)*(l===c?-1:1);let m=p*n/s*a,g=p*-s/n*o,v=m+(i+t)/2,y=g+(e+r)/2,w=(o-m)/n,b=(a-g)/s,S=(-o-m)/n,T=(-a-g)/s,A=s1(1,0,w,b),x=s1(w,b,S,T);return!c&&x>0&&(x-=sv),c&&x<0&&(x+=sv),{centerx:v,centery:y,ang1:A,ang2:x}}function o1({px:i,py:e,cx:t,cy:r,rx:n,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(n===0||s===0)return[];let c=(i-t)/2,h=(e-r)/2;if(c===0&&h===0)return[];n=Math.abs(n),s=Math.abs(s);let u=Math.pow(c,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(s,2);u>1&&(n*=Math.sqrt(u),s*=Math.sqrt(u));let f=rF(i,e,t,r,n,s,c,h,o,a),{ang1:d,ang2:p}=f,{centerx:m,centery:g}=f,v=Math.abs(p)/(sv/4);Math.abs(1-v)<1e-7&&(v=1);let y=Math.max(Math.ceil(v),1);p/=y;for(let w=0;w<y;w++)l.push(tF(d,p)),d+=p;return l.map(w=>{let{x:b,y:S}=iv(w[0],n,s,m,g),{x:T,y:A}=iv(w[1],n,s,m,g),{x,y:_}=iv(w[2],n,s,m,g);return{x1:b,y1:S,x2:T,y2:A,x,y:_}})}var Zt;(function(i){i[i.ODD=0]="ODD",i[i.NONZERO=1]="NONZERO",i[i.POSITIVE=2]="POSITIVE",i[i.NEGATIVE=3]="NEGATIVE",i[i.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Zt||(Zt={}));var Tr;(function(i){i[i.POLYGONS=0]="POLYGONS",i[i.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",i[i.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(Tr||(Tr={}));function qe(i,e){if(!i)throw e||"Assertion Failed!"}var ze=function(){function i(){}return i.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},i.vertLeq=function(e,t){return e.s<t.s||e.s===t.s&&e.t<=t.t},i.transLeq=function(e,t){return e.t<t.t||e.t===t.t&&e.s<=t.s},i.edgeGoesLeft=function(e){return i.vertLeq(e.Dst,e.Org)},i.edgeGoesRight=function(e){return i.vertLeq(e.Org,e.Dst)},i.vertL1dist=function(e,t){return Math.abs(e.s-t.s)+Math.abs(e.t-t.t)},i.edgeEval=function(e,t,r){qe(i.vertLeq(e,t)&&i.vertLeq(t,r));var n=t.s-e.s,s=r.s-t.s;return n+s>0?n<s?t.t-e.t+(e.t-r.t)*(n/(n+s)):t.t-r.t+(r.t-e.t)*(s/(n+s)):0},i.edgeSign=function(e,t,r){qe(i.vertLeq(e,t)&&i.vertLeq(t,r));var n=t.s-e.s,s=r.s-t.s;return n+s>0?(t.t-r.t)*n+(t.t-e.t)*s:0},i.transEval=function(e,t,r){qe(i.transLeq(e,t)&&i.transLeq(t,r));var n=t.t-e.t,s=r.t-t.t;return n+s>0?n<s?t.s-e.s+(e.s-r.s)*(n/(n+s)):t.s-r.s+(r.s-e.s)*(s/(n+s)):0},i.transSign=function(e,t,r){qe(i.transLeq(e,t)&&i.transLeq(t,r));var n=t.t-e.t,s=r.t-t.t;return n+s>0?(t.s-r.s)*n+(t.s-e.s)*s:0},i.vertCCW=function(e,t,r){return e.s*(t.t-r.t)+t.s*(r.t-e.t)+r.s*(e.t-t.t)>=0},i.interpolate=function(e,t,r,n){return e=e<0?0:e,r=r<0?0:r,e<=r?r===0?(t+n)/2:t+(n-t)*(e/(e+r)):n+(t-n)*(r/(e+r))},i.intersect=function(e,t,r,n,s){var o,a,l;i.vertLeq(e,t)||(l=e,e=t,t=l),i.vertLeq(r,n)||(l=r,r=n,n=l),i.vertLeq(e,r)||(l=e,e=r,r=l,l=t,t=n,n=l),i.vertLeq(r,t)?i.vertLeq(t,n)?(o=i.edgeEval(e,r,t),a=i.edgeEval(r,t,n),o+a<0&&(o=-o,a=-a),s.s=i.interpolate(o,r.s,a,t.s)):(o=i.edgeSign(e,r,t),a=-i.edgeSign(e,n,t),o+a<0&&(o=-o,a=-a),s.s=i.interpolate(o,r.s,a,n.s)):s.s=(r.s+t.s)/2,i.transLeq(e,t)||(l=e,e=t,t=l),i.transLeq(r,n)||(l=r,r=n,n=l),i.transLeq(e,r)||(l=e,e=r,r=l,l=t,t=n,n=l),i.transLeq(r,t)?i.transLeq(t,n)?(o=i.transEval(e,r,t),a=i.transEval(r,t,n),o+a<0&&(o=-o,a=-a),s.t=i.interpolate(o,r.t,a,t.t)):(o=i.transSign(e,r,t),a=-i.transSign(e,n,t),o+a<0&&(o=-o,a=-a),s.t=i.interpolate(o,r.t,a,n.t)):s.t=(r.t+t.t)/2},i}(),Hh=function(){function i(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return i}(),up=function(){function i(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(i.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),i}(),Il=function(){function i(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return i}(),a1=function(){function i(){var e=new Il,t=new Hh,r=new up(0),n=new up(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,r.next=r,r.Sym=n,n.next=n,n.Sym=r,this.vHead=e,this.fHead=t,this.eHead=r,this.eHeadSym=n}return i.prototype.makeEdge_=function(e){var t=new up(0),r=new up(1);e.Sym.side<e.side&&(e=e.Sym);var n=e.Sym.next;return r.next=n,n.Sym.next=t,t.next=e,e.Sym.next=r,t.Sym=r,t.Onext=t,t.Lnext=r,t.Org=null,t.Lface=null,t.winding=0,t.activeRegion=null,r.Sym=t,r.Onext=r,r.Lnext=t,r.Org=null,r.Lface=null,r.winding=0,r.activeRegion=null,t},i.prototype.splice_=function(e,t){var r=e.Onext,n=t.Onext;r.Sym.Lnext=t,n.Sym.Lnext=e,e.Onext=n,t.Onext=r},i.prototype.makeVertex_=function(e,t,r){var n=e;qe(n,"Vertex can't be null!");var s=r.prev;n.prev=s,s.next=n,n.next=r,r.prev=n,n.anEdge=t;var o=t;do o.Org=n,o=o.Onext;while(o!==t)},i.prototype.makeFace_=function(e,t,r){var n=e;qe(n,"Face can't be null");var s=r.prev;n.prev=s,s.next=n,n.next=r,r.prev=n,n.anEdge=t,n.trail=null,n.marked=!1,n.inside=r.inside;var o=t;do o.Lface=n,o=o.Lnext;while(o!==t)},i.prototype.killEdge_=function(e){e.Sym.side<e.side&&(e=e.Sym);var t=e.next,r=e.Sym.next;t.Sym.next=r,r.Sym.next=t},i.prototype.killVertex_=function(e,t){var r=e.anEdge,n=r;do n.Org=t,n=n.Onext;while(n!==r);var s=e.prev,o=e.next;o.prev=s,s.next=o},i.prototype.killFace_=function(e,t){var r=e.anEdge,n=r;do n.Lface=t,n=n.Lnext;while(n!==r);var s=e.prev,o=e.next;o.prev=s,s.next=o},i.prototype.makeEdge=function(){var e=new Il,t=new Il,r=new Hh,n=this.makeEdge_(this.eHead);return this.makeVertex_(e,n,this.vHead),this.makeVertex_(t,n.Sym,this.vHead),this.makeFace_(r,n,this.fHead),n},i.prototype.splice=function(e,t){var r=!1,n=!1;if(e!==t){if(t.Org!==e.Org&&(n=!0,this.killVertex_(t.Org,e.Org)),t.Lface!==e.Lface&&(r=!0,this.killFace_(t.Lface,e.Lface)),this.splice_(t,e),!n){var s=new Il;this.makeVertex_(s,t,e.Org),e.Org.anEdge=e}if(!r){var o=new Hh;this.makeFace_(o,t,e.Lface),e.Lface.anEdge=e}}},i.prototype.delete=function(e){var t=e.Sym,r=!1;if(e.Lface!==e.Rface&&(r=!0,this.killFace_(e.Lface,e.Rface)),e.Onext===e)this.killVertex_(e.Org,null);else if(e.Rface.anEdge=e.Oprev,e.Org.anEdge=e.Onext,this.splice_(e,e.Oprev),!r){var n=new Hh;this.makeFace_(n,e,e.Lface)}t.Onext===t?(this.killVertex_(t.Org,null),this.killFace_(t.Lface,null)):(e.Lface.anEdge=t.Oprev,t.Org.anEdge=t.Onext,this.splice_(t,t.Oprev)),this.killEdge_(e)},i.prototype.addEdgeVertex=function(e){var t=this.makeEdge_(e),r=t.Sym;this.splice_(t,e.Lnext),t.Org=e.Dst;var n=new Il;return this.makeVertex_(n,r,t.Org),t.Lface=r.Lface=e.Lface,t},i.prototype.splitEdge=function(e){var t=this.addEdgeVertex(e),r=t.Sym;return this.splice_(e.Sym,e.Sym.Oprev),this.splice_(e.Sym,r),e.Dst=r.Org,r.Dst.anEdge=r.Sym,r.Rface=e.Rface,r.winding=e.winding,r.Sym.winding=e.Sym.winding,r.idx=e.idx,r.Sym.idx=e.Sym.idx,r},i.prototype.connect=function(e,t){var r=!1,n=this.makeEdge_(e),s=n.Sym;if(t.Lface!==e.Lface&&(r=!0,this.killFace_(t.Lface,e.Lface)),this.splice_(n,e.Lnext),this.splice_(s,t),n.Org=e.Dst,s.Org=t.Org,n.Lface=s.Lface=e.Lface,e.Lface.anEdge=s,!r){var o=new Hh;this.makeFace_(o,n,e.Lface)}return n},i.prototype.zapFace=function(e){var t=e.anEdge,r,n,s,o,a;n=t.Lnext;do r=n,n=r.Lnext,r.Lface=null,r.Rface===null&&(r.Onext===r?this.killVertex_(r.Org,null):(r.Org.anEdge=r.Onext,this.splice_(r,r.Oprev)),s=r.Sym,s.Onext===s?this.killVertex_(s.Org,null):(s.Org.anEdge=s.Onext,this.splice_(s,s.Oprev)),this.killEdge_(r));while(r!=t);o=e.prev,a=e.next,a.prev=o,o.next=a},i.prototype.countFaceVerts_=function(e){var t=e.anEdge,r=0;do r++,t=t.Lnext;while(t!==e.anEdge);return r},i.prototype.mergeConvexFaces=function(e){var t,r,n,s,o,a,l;for(t=this.fHead.next;t!==this.fHead;t=t.next)if(!!t.inside)for(r=t.anEdge,o=r.Org;n=r.Lnext,s=r.Sym,s&&s.Lface&&s.Lface.inside&&(a=this.countFaceVerts_(t),l=this.countFaceVerts_(s.Lface),a+l-2<=e&&ze.vertCCW(r.Lprev.Org,r.Org,s.Lnext.Lnext.Org)&&ze.vertCCW(s.Lprev.Org,s.Org,r.Lnext.Lnext.Org)&&(n=s.Lnext,this.delete(s),r=null,s=null)),!(r&&r.Lnext.Org===o);)r=n;return!0},i.prototype.check=function(){var e=this.fHead,t=this.vHead,r=this.eHead,n,s,o,a,l,c;for(s=e,s=e;(n=s.next)!==e;s=n){qe(n.prev===s),l=n.anEdge;do qe(l.Sym!==l),qe(l.Sym.Sym===l),qe(l.Lnext.Onext.Sym===l),qe(l.Onext.Sym.Lnext===l),qe(l.Lface===n),l=l.Lnext;while(l!==n.anEdge)}for(qe(n.prev===s&&n.anEdge===null),a=t,a=t;(o=a.next)!==t;a=o){qe(o.prev===a),l=o.anEdge;do qe(l.Sym!==l),qe(l.Sym.Sym===l),qe(l.Lnext.Onext.Sym===l),qe(l.Onext.Sym.Lnext===l),qe(l.Org===o),l=l.Onext;while(l!==o.anEdge)}for(qe(o.prev===a&&o.anEdge===null),c=r,c=r;(l=c.next)!==r;c=l)qe(l.Sym.next===c.Sym),qe(l.Sym!==l),qe(l.Sym.Sym===l),qe(l.Org!==null),qe(l.Dst!==null),qe(l.Lnext.Onext.Sym===l),qe(l.Onext.Sym.Lnext===l);qe(l.Sym.next===c.Sym&&l.Sym===this.eHeadSym&&l.Sym.Sym===l&&l.Org===null&&l.Dst===null&&l.Lface===null&&l.Rface===null)},i}(),l1=function(){function i(){this.handle=null}return i}(),c1=function(){function i(){this.key=null,this.node=0}return i}(),nF=function(){function i(e,t){this.leq=t,this.max=0,this.nodes=[],this.handles=[],this.initialized=!1,this.freeList=0,this.size=0,this.max=e,this.nodes=[],this.handles=[];for(var r=0;r<e+1;r++)this.nodes[r]=new l1,this.handles[r]=new c1;this.initialized=!1,this.nodes[1].handle=1,this.handles[1].key=null}return i.prototype.floatDown_=function(e){var t=this.nodes,r=this.handles,n,s,o;for(n=t[e].handle;;){if(o=e<<1,o<this.size&&this.leq(r[t[o+1].handle].key,r[t[o].handle].key)&&++o,qe(o<=this.max),s=t[o].handle,o>this.size||this.leq(r[n].key,r[s].key)){t[e].handle=n,r[n].node=e;break}t[e].handle=s,r[s].node=e,e=o}},i.prototype.floatUp_=function(e){var t=this.nodes,r=this.handles,n,s,o;for(n=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(r[s].key,r[n].key)){t[e].handle=n,r[n].node=e;break}t[e].handle=s,r[s].node=e,e=o}},i.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},i.prototype.min=function(){return this.handles[this.nodes[1].handle].key},i.prototype.insert=function(e){var t,r;if(t=++this.size,t*2>this.max){this.max*=2;var n,s;for(s=this.nodes.length,this.nodes.length=this.max+1,n=s;n<this.nodes.length;n++)this.nodes[n]=new l1;for(s=this.handles.length,this.handles.length=this.max+1,n=s;n<this.handles.length;n++)this.handles[n]=new c1}return this.freeList===0?r=t:(r=this.freeList,this.freeList=this.handles[r].node),this.nodes[t].handle=r,this.handles[r].node=t,this.handles[r].key=e,this.initialized&&this.floatUp_(t),r},i.prototype.extractMin=function(){var e=this.nodes,t=this.handles,r=e[1].handle,n=t[r].key;return this.size>0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[r].key=null,t[r].node=this.freeList,this.freeList=r,--this.size,this.size>0&&this.floatDown_(1)),n},i.prototype.delete=function(e){var t=this.nodes,r=this.handles,n;qe(e>=1&&e<=this.max&&r[e].key!==null),n=r[e].node,t[n].handle=t[this.size].handle,r[t[n].handle].node=n,--this.size,n<=this.size&&(n<=1||this.leq(r[t[n>>1].handle].key,r[t[n].handle].key)?this.floatDown_(n):this.floatUp_(n)),r[e].key=null,r[e].node=this.freeList,this.freeList=e},i}(),ov=function(){function i(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return i}(),h1=function(){function i(){this.key=null,this.next=null,this.prev=null}return i}(),iF=function(){function i(e,t){this.frame=e,this.leq=t,this.head=new h1,this.head.next=this.head,this.head.prev=this.head}return i.prototype.min=function(){return this.head.next},i.prototype.max=function(){return this.head.prev},i.prototype.insert=function(e){return this.insertBefore(this.head,e)},i.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},i.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var r=new h1;return r.key=t,r.next=e.next,e.next.prev=r,r.prev=e,e.next=r,r},i.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},i}(),sF=function(){function i(){}return i.regionBelow=function(e){return e.nodeUp.prev.key},i.regionAbove=function(e){return e.nodeUp.next.key},i.debugEvent=function(e){},i.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},i.edgeLeq=function(e,t,r){var n=e.event,s=t.eUp,o=r.eUp;if(s.Dst===n)return o.Dst===n?ze.vertLeq(s.Org,o.Org)?ze.edgeSign(o.Dst,s.Org,o.Org)<=0:ze.edgeSign(s.Dst,o.Org,s.Org)>=0:ze.edgeSign(o.Dst,n,o.Org)<=0;if(o.Dst===n)return ze.edgeSign(s.Dst,n,s.Org)>=0;var a=ze.edgeEval(s.Dst,n,s.Org),l=ze.edgeEval(o.Dst,n,o.Org);return a>=l},i.deleteRegion=function(e,t){t.fixUpperEdge&&qe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},i.fixUpperEdge=function(e,t,r){qe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=r,r.activeRegion=t},i.topLeftRegion=function(e,t){var r=t.eUp.Org,n;do t=i.regionAbove(t);while(t.eUp.Org===r);if(t.fixUpperEdge){if(n=e.mesh.connect(i.regionBelow(t).eUp.Sym,t.eUp.Lnext),n===null)return null;i.fixUpperEdge(e,t,n),t=i.regionAbove(t)}return t},i.topRightRegion=function(e){var t=e.eUp.Dst;do e=i.regionAbove(e);while(e.eUp.Dst===t);return e},i.addRegionBelow=function(e,t,r){var n=new ov;return n.eUp=r,n.nodeUp=e.dict.insertBefore(t.nodeUp,n),n.fixUpperEdge=!1,n.sentinel=!1,n.dirty=!1,r.activeRegion=n,n},i.isWindingInside=function(e,t){switch(e.windingRule){case Zt.ODD:return(t&1)!==0;case Zt.NONZERO:return t!==0;case Zt.POSITIVE:return t>0;case Zt.NEGATIVE:return t<0;case Zt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},i.computeWinding=function(e,t){t.windingNumber=i.regionAbove(t).windingNumber+t.eUp.winding,t.inside=i.isWindingInside(e,t.windingNumber)},i.finishRegion=function(e,t){var r=t.eUp,n=r.Lface;n.inside=t.inside,n.anEdge=r,i.deleteRegion(e,t)},i.finishLeftRegions=function(e,t,r){for(var n,s=null,o=t,a=t.eUp;o!==r;){if(o.fixUpperEdge=!1,s=i.regionBelow(o),n=s.eUp,n.Org!=a.Org){if(!s.fixUpperEdge){i.finishRegion(e,o);break}n=e.mesh.connect(a.Lprev,n.Sym),i.fixUpperEdge(e,s,n)}a.Onext!==n&&(e.mesh.splice(n.Oprev,n),e.mesh.splice(a,n)),i.finishRegion(e,o),a=s.eUp,o=s}return a},i.addRightEdges=function(e,t,r,n,s,o){var a,l,c,h,u=!0;c=r;do qe(ze.vertLeq(c.Org,c.Dst)),i.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==n);for(s===null&&(s=i.regionBelow(t).eUp.Rprev),l=t,h=s;a=i.regionBelow(l),c=a.eUp.Sym,c.Org===h.Org;)c.Onext!==h&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(h.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=i.isWindingInside(e,a.windingNumber),l.dirty=!0,!u&&i.checkForRightSplice(e,l)&&(i.addWinding(c,h),i.deleteRegion(e,l),e.mesh.delete(h)),u=!1,l=a,h=c;l.dirty=!0,qe(l.windingNumber-c.winding===a.windingNumber),o&&i.walkDirtyRegions(e,l)},i.spliceMergeVertices=function(e,t,r){e.mesh.splice(t,r)},i.vertexWeights=function(e,t,r){var n=ze.vertL1dist(t,e),s=ze.vertL1dist(r,e),o=.5*s/(n+s),a=.5*n/(n+s);e.coords[0]+=o*t.coords[0]+a*r.coords[0],e.coords[1]+=o*t.coords[1]+a*r.coords[1],e.coords[2]+=o*t.coords[2]+a*r.coords[2]},i.getIntersectData=function(e,t,r,n,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,i.vertexWeights(t,r,n),i.vertexWeights(t,s,o)},i.checkForRightSplice=function(e,t){var r=i.regionBelow(t),n=t.eUp,s=r.eUp;if(ze.vertLeq(n.Org,s.Org)){if(ze.edgeSign(s.Dst,n.Org,s.Org)>0)return!1;ze.vertEq(n.Org,s.Org)?n.Org!==s.Org&&(e.pq.delete(n.Org.pqHandle),i.spliceMergeVertices(e,s.Oprev,n)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(n,s.Oprev),t.dirty=r.dirty=!0)}else{if(ze.edgeSign(n.Dst,s.Org,n.Org)<0)return!1;i.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(n.Sym),e.mesh.splice(s.Oprev,n)}return!0},i.checkForLeftSplice=function(e,t){var r=i.regionBelow(t),n=t.eUp,s=r.eUp,o;if(qe(!ze.vertEq(n.Dst,s.Dst)),ze.vertLeq(n.Dst,s.Dst)){if(ze.edgeSign(n.Dst,s.Dst,n.Org)<0)return!1;i.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(n),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(ze.edgeSign(s.Dst,n.Dst,s.Org)>0)return!1;t.dirty=r.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(n.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},i.checkForIntersect=function(e,t){var r=i.regionBelow(t),n=t.eUp,s=r.eUp,o=n.Org,a=s.Org,l=n.Dst,c=s.Dst,h,u,f=new Il,d,p;if(qe(!ze.vertEq(c,l)),qe(ze.edgeSign(l,e.event,o)<=0),qe(ze.edgeSign(c,e.event,a)>=0),qe(o!==e.event&&a!==e.event),qe(!t.fixUpperEdge&&!r.fixUpperEdge),o===a||(h=Math.min(o.t,l.t),u=Math.max(a.t,c.t),h>u))return!1;if(ze.vertLeq(o,a)){if(ze.edgeSign(c,o,a)>0)return!1}else if(ze.edgeSign(l,a,o)<0)return!1;return i.debugEvent(e),ze.intersect(l,o,c,a,f),qe(Math.min(o.t,l.t)<=f.t),qe(f.t<=Math.max(a.t,c.t)),qe(Math.min(c.s,l.s)<=f.s),qe(f.s<=Math.max(a.s,o.s)),ze.vertLeq(f,e.event)&&(f.s=e.event.s,f.t=e.event.t),d=ze.vertLeq(o,a)?o:a,ze.vertLeq(d,f)&&(f.s=d.s,f.t=d.t),ze.vertEq(f,o)||ze.vertEq(f,a)?(i.checkForRightSplice(e,t),!1):!ze.vertEq(l,e.event)&&ze.edgeSign(l,e.event,f)>=0||!ze.vertEq(c,e.event)&&ze.edgeSign(c,e.event,f)<=0?c===e.event?(e.mesh.splitEdge(n.Sym),e.mesh.splice(s.Sym,n),t=i.topLeftRegion(e,t),n=i.regionBelow(t).eUp,i.finishLeftRegions(e,i.regionBelow(t),r),i.addRightEdges(e,t,n.Oprev,n,n,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(n.Lnext,s.Oprev),r=t,t=i.topRightRegion(t),p=i.regionBelow(t).eUp.Rprev,r.eUp=s.Oprev,s=i.finishLeftRegions(e,r,null),i.addRightEdges(e,t,s.Onext,n.Rprev,p,!0),!0):(ze.edgeSign(l,e.event,f)>=0&&(i.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(n.Sym),n.Org.s=e.event.s,n.Org.t=e.event.t),ze.edgeSign(c,e.event,f)<=0&&(t.dirty=r.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(n.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,n),n.Org.s=f.s,n.Org.t=f.t,n.Org.pqHandle=e.pq.insert(n.Org),i.getIntersectData(e,n.Org,o,l,a,c),i.regionAbove(t).dirty=t.dirty=r.dirty=!0,!1)},i.walkDirtyRegions=function(e,t){for(var r=i.regionBelow(t),n,s;;){for(;r.dirty;)t=r,r=i.regionBelow(r);if(!t.dirty&&(r=t,t=i.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,n=t.eUp,s=r.eUp,n.Dst!==s.Dst&&i.checkForLeftSplice(e,t)&&(r.fixUpperEdge?(i.deleteRegion(e,r),e.mesh.delete(s),r=i.regionBelow(t),s=r.eUp):t.fixUpperEdge&&(i.deleteRegion(e,t),e.mesh.delete(n),t=i.regionAbove(r),n=t.eUp)),n.Org!==s.Org)if(n.Dst!==s.Dst&&!t.fixUpperEdge&&!r.fixUpperEdge&&(n.Dst===e.event||s.Dst===e.event)){if(i.checkForIntersect(e,t))return}else i.checkForRightSplice(e,t);n.Org===s.Org&&n.Dst===s.Dst&&(i.addWinding(s,n),i.deleteRegion(e,t),e.mesh.delete(n),t=i.regionAbove(r))}},i.connectRightVertex=function(e,t,r){var n,s=r.Onext,o=i.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&i.checkForIntersect(e,t),ze.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=i.topLeftRegion(e,t),s=i.regionBelow(t).eUp,i.finishLeftRegions(e,i.regionBelow(t),o),c=!0),ze.vertEq(l.Org,e.event)&&(e.mesh.splice(r,l.Oprev),r=i.finishLeftRegions(e,o,null),c=!0),c){i.addRightEdges(e,t,r.Onext,s,s,!0);return}ze.vertLeq(l.Org,a.Org)?n=l.Oprev:n=a,n=e.mesh.connect(r.Lprev,n),i.addRightEdges(e,t,n,n.Onext,n.Onext,!1),n.Sym.activeRegion.fixUpperEdge=!0,i.walkDirtyRegions(e,t)},i.connectLeftDegenerate=function(e,t,r){var n,s,o,a,l;if(n=t.eUp,ze.vertEq(n.Org,r)){qe(!1),i.spliceMergeVertices(e,n,r.anEdge);return}if(!ze.vertEq(n.Dst,r)){e.mesh.splitEdge(n.Sym),t.fixUpperEdge&&(e.mesh.delete(n.Onext),t.fixUpperEdge=!1),e.mesh.splice(r.anEdge,n),i.sweepEvent(e,r);return}qe(!1),t=i.topRightRegion(t),l=i.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(qe(s!==o),i.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(r.anEdge,o),ze.edgeGoesLeft(s)||(s=null),i.addRightEdges(e,t,o.Onext,a,s,!0)},i.connectLeftVertex=function(e,t){var r,n,s,o,a,l,c=new ov;if(c.eUp=t.anEdge.Sym,r=e.dict.search(c).key,n=i.regionBelow(r),!!n){if(o=r.eUp,a=n.eUp,ze.edgeSign(o.Dst,t,o.Org)===0){i.connectLeftDegenerate(e,r,t);return}if(s=ze.vertLeq(a.Dst,o.Dst)?r:n,r.inside||s.fixUpperEdge){if(s===r)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var h=e.mesh.connect(a.Dnext,t.anEdge);l=h.Sym}s.fixUpperEdge?i.fixUpperEdge(e,s,l):i.computeWinding(e,i.addRegionBelow(e,r,l)),i.sweepEvent(e,t)}else i.addRightEdges(e,r,t.anEdge,t.anEdge,null,!0)}},i.sweepEvent=function(e,t){e.event=t,i.debugEvent(e);for(var r=t.anEdge;r.activeRegion===null;)if(r=r.Onext,r===t.anEdge){i.connectLeftVertex(e,t);return}var n=i.topLeftRegion(e,r.activeRegion);qe(n!==null);var s=i.regionBelow(n),o=s.eUp,a=i.finishLeftRegions(e,s,null);a.Onext===o?i.connectRightVertex(e,n,a):i.addRightEdges(e,n,a.Onext,o,o,!0)},i.addSentinel=function(e,t,r,n){var s=new ov,o=e.mesh.makeEdge();o.Org.s=r,o.Org.t=n,o.Dst.s=t,o.Dst.t=n,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},i.initEdgeDict=function(e){e.dict=new iF(e,i.edgeLeq);var t=e.bmax[0]-e.bmin[0],r=e.bmax[1]-e.bmin[1],n=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-r,a=e.bmax[1]+r;i.addSentinel(e,n,s,o),i.addSentinel(e,n,s,a)},i.doneEdgeDict=function(e){for(var t,r=0;(t=e.dict.min().key)!==null;)t.sentinel||(qe(t.fixUpperEdge),qe(++r===1)),qe(t.windingNumber===0),i.deleteRegion(e,t)},i.removeDegenerateEdges=function(e){var t,r,n,s=e.mesh.eHead;for(t=s.next;t!==s;t=r)r=t.next,n=t.Lnext,ze.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(i.spliceMergeVertices(e,n,t),e.mesh.delete(t),t=n,n=t.Lnext),n.Lnext===t&&(n!==t&&((n===r||n===r.Sym)&&(r=r.next),e.mesh.delete(n)),(t===r||t===r.Sym)&&(r=r.next),e.mesh.delete(t))},i.initPriorityQ=function(e){var t,r,n,s=0;for(n=e.mesh.vHead,r=n.next;r!==n;r=r.next)s++;for(s+=8,t=e.pq=new nF(s,ze.vertLeq),n=e.mesh.vHead,r=n.next;r!==n;r=r.next)r.pqHandle=t.insert(r);return r!==n?!1:(t.init(),!0)},i.donePriorityQ=function(e){e.pq=null},i.removeDegenerateFaces=function(e,t){var r,n,s;for(r=t.fHead.next;r!==t.fHead;r=n)n=r.next,s=r.anEdge,qe(s.Lnext!==s),s.Lnext.Lnext===s&&(i.addWinding(s.Onext,s),e.mesh.delete(s));return!0},i.computeInterior=function(e,t){t===void 0&&(t=!0);var r,n;if(i.removeDegenerateEdges(e),!i.initPriorityQ(e))return!1;for(i.initEdgeDict(e);(r=e.pq.extractMin())!==null;){for(;n=e.pq.min(),!(n===null||!ze.vertEq(n,r));)n=e.pq.extractMin(),i.spliceMergeVertices(e,r.anEdge,n.anEdge);i.sweepEvent(e,r)}return e.event=e.dict.min().key.eUp.Org,i.debugEvent(e),i.doneEdgeDict(e),i.donePriorityQ(e),i.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},i}(),oF=function(){function i(){this.mesh=new a1,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Zt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return i.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},i.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},i.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},i.prototype.computeNormal_=function(e){var t,r,n,s,o,a,l=[0,0,0],c=[0,0,0],h=[0,0,0],u=[0,0,0],f=[0,0,0],d=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var g=0;g<3;++g)s=t.coords[g],c[g]=s,p[g]=t,l[g]=s,d[g]=t;for(t=m.next;t!==m;t=t.next)for(var v=0;v<3;++v)s=t.coords[v],s<c[v]&&(c[v]=s,p[v]=t),s>l[v]&&(l[v]=s,d[v]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,r=p[y],n=d[y],h[0]=r.coords[0]-n.coords[0],h[1]=r.coords[1]-n.coords[1],h[2]=r.coords[2]-n.coords[2],t=m.next;t!==m;t=t.next)u[0]=t.coords[0]-n.coords[0],u[1]=t.coords[1]-n.coords[1],u[2]=t.coords[2]-n.coords[2],f[0]=h[1]*u[2]-h[2]*u[1],f[1]=h[2]*u[0]-h[0]*u[2],f[2]=h[0]*u[1]-h[1]*u[0],o=f[0]*f[0]+f[1]*f[1]+f[2]*f[2],o>a&&(a=o,e[0]=f[0],e[1]=f[1],e[2]=f[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(h)]=1)},i.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,r=this.mesh.vHead,n,s=0,o=e.next;o!==e;o=o.next)if(n=o.anEdge,!(n.winding<=0))do s+=(n.Org.s-n.Dst.s)*(n.Org.t+n.Dst.t),n=n.Lnext;while(n!==o.anEdge);if(s<0){for(t=r.next;t!==r;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},i.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],r,n,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),r=this.sUnit,n=this.tUnit;var o=this.longAxis_(t);r[o]=0,r[(o+1)%3]=1,r[(o+2)%3]=0,n[o]=0,n[(o+1)%3]=0,n[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,r),a.t=this.dot_(a.coords,n);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.s<this.bmin[0]&&(this.bmin[0]=c.s),c.s>this.bmax[0]&&(this.bmax[0]=c.s),c.t<this.bmin[1]&&(this.bmin[1]=c.t),c.t>this.bmax[1]&&(this.bmax[1]=c.t))},i.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},i.prototype.tessellateMonoRegion_=function(e,t){var r,n;if(r=t.anEdge,!(r.Lnext!==r&&r.Lnext.Lnext!==r))throw"Mono region invalid";for(;ze.vertLeq(r.Dst,r.Org);r=r.Lprev);for(;ze.vertLeq(r.Org,r.Dst);r=r.Lnext);n=r.Lprev;for(var s=void 0;r.Lnext!==n;)if(ze.vertLeq(r.Dst,n.Org)){for(;n.Lnext!==r&&(ze.edgeGoesLeft(n.Lnext)||ze.edgeSign(n.Org,n.Dst,n.Lnext.Dst)<=0);)s=e.connect(n.Lnext,n),n=s.Sym;n=n.Lprev}else{for(;n.Lnext!==r&&(ze.edgeGoesRight(r.Lprev)||ze.edgeSign(r.Dst,r.Org,r.Lprev.Org)>=0);)s=e.connect(r,r.Lprev),r=s.Sym;r=r.Lnext}if(n.Lnext===r)throw"Mono region invalid";for(;n.Lnext.Lnext!==r;)s=e.connect(n.Lnext,n),n=s.Sym;return!0},i.prototype.tessellateInterior_=function(e){for(var t,r=e.fHead.next;r!==e.fHead;r=t)if(t=r.next,r.inside&&!this.tessellateMonoRegion_(e,r))return!1;return!0},i.prototype.discardExterior_=function(e){for(var t,r=e.fHead.next;r!==e.fHead;r=t)t=r.next,r.inside||e.zapFace(r)},i.prototype.setWindingNumber_=function(e,t,r){for(var n,s=e.eHead.next;s!==e.eHead;s=n)n=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:r?e.delete(s):s.winding=0},i.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},i.prototype.outputPolymesh_=function(e,t,r,n){var s,o=0,a=0,l;r>3&&e.mergeConvexFaces(r);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var h=e.fHead.next;h!==e.fHead;h=h.next)if(h.n=-1,!!h.inside){s=h.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==h.anEdge);if(l>r)throw"Face vertex greater that support polygon";h.n=o,++o}this.elementCount=o,t===Tr.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*r,this.vertexCount=a,this.vertices=[],this.vertices.length=a*n,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var u=c.n*n;this.vertices[u+0]=c.coords[0],this.vertices[u+1]=c.coords[1],n>2&&(this.vertices[u+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var f=0,h=e.fHead.next;h!==e.fHead;h=h.next)if(!!h.inside){s=h.anEdge,l=0;do{var c=s.Org;this.elements[f++]=c.n,l++,s=s.Lnext}while(s!==h.anEdge);for(var d=l;d<r;++d)this.elements[f++]=-1;if(t===Tr.CONNECTED_POLYGONS){s=h.anEdge;do this.elements[f++]=this.getNeighbourFace_(s),s=s.Lnext;while(s!==h.anEdge);for(var p=l;p<r;++p)this.elements[f++]=-1}}},i.prototype.outputContours_=function(e,t){var r,n,s=0,o=0;this.vertexCount=0,this.elementCount=0;for(var a=e.fHead.next;a!==e.fHead;a=a.next)if(!!a.inside){n=r=a.anEdge;do this.vertexCount++,r=r.Lnext;while(r!==n);this.elementCount++}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*t,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var l=0,c=0,h=0;s=0;for(var a=e.fHead.next;a!==e.fHead;a=a.next)if(!!a.inside){o=0,n=r=a.anEdge;do this.vertices[l++]=r.Org.coords[0],this.vertices[l++]=r.Org.coords[1],t>2&&(this.vertices[l++]=r.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(r):r.Org.idx,o++,r=r.Lnext;while(r!==n);this.elements[h++]=s,this.elements[h++]=o,s+=o}},i.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new a1),e<2&&(e=2),e>3&&(e=3);for(var r=null,n=0;n<t.length;n+=e)r===null?(r=this.mesh.makeEdge(),this.mesh.splice(r,r.Sym)):(this.mesh.splitEdge(r),r=r.Lnext),r.Org.coords[0]=t[n+0],r.Org.coords[1]=t[n+1],e>2?r.Org.coords[2]=t[n+2]:r.Org.coords[2]=0,r.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(r),r.winding=1,r.Sym.winding=-1},i.prototype.tesselate=function(e,t,r,n,s,o){if(e===void 0&&(e=Zt.ODD),t===void 0&&(t=Tr.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,n<2&&(n=2),n>3&&(n=3),!this.mesh)return!1;this.projectPolygon_(),sF.computeInterior(this,o);var a=this.mesh;return t===Tr.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===Tr.BOUNDARY_CONTOURS?this.outputContours_(a,n):this.outputPolymesh_(a,t,r,n),!0},i}();function Xo(i){var e=i.windingRule,t=e===void 0?Zt.ODD:e,r=i.elementType,n=r===void 0?Tr.POLYGONS:r,s=i.polySize,o=s===void 0?3:s,a=i.vertexSize,l=a===void 0?2:a,c=i.normal,h=c===void 0?[0,0,1]:c,u=i.contours,f=u===void 0?[]:u,d=i.strict,p=d===void 0?!0:d,m=i.debug,g=m===void 0?!1:m;if(!f&&p)throw new Error("Contours can't be empty");if(!!f){var v=new oF;i.edgeCreateCallback&&(v.edgeCreateCallback=i.edgeCreateCallback),i.vertexIdCallback&&(v.vertexIdCallback=i.vertexIdCallback);for(var y=0;y<f.length;y++)v.addContour(l||2,f[y]);return v.tesselate(t,n,o,l,h,p),{vertices:v.vertices,vertexIndices:v.vertexIndices,vertexCount:v.vertexCount,elements:v.elements,elementCount:v.elementCount,mesh:g?v.mesh:void 0}}}var z7=Zt.ODD,G7=Zt.NONZERO,k7=Zt.POSITIVE,V7=Zt.NEGATIVE,H7=Zt.ABS_GEQ_TWO,W7=Tr.POLYGONS,j7=Tr.CONNECTED_POLYGONS,q7=Tr.BOUNDARY_CONTOURS;var Rl=class extends De{constructor(t,r=12,n={}){var p,m,g;super();this.type="ShapeGeometry";this.windingRule=Zt.ODD;this.elementType=Tr.POLYGONS;this.polySize=3;this.vertexSize=2;this.strict=!0;this._shape=t,this._curveSegments=r,this._triangulationOptions=Object.assign({windingRule:Zt.ODD,elementType:Tr.POLYGONS,polySize:3,vertexSize:2,strict:!0},n);let s=this._shape.extractShapePointsToFlatArray([],this._curveSegments),o=this._shape.shapeHoles.map(v=>v.extractShapePointsToFlatArray([],this._curveSegments)),a,l=!0,c=!0,h,u;for(let v=0,y=s.length/2;v<y;v++){let w=v*2,b=s[w+0],S=s[w+1];if(h!==void 0&&b!==h&&(l=!1),u!==void 0&&S!==u&&(c=!1),h=b,u=S,!l&&!c)break}!l&&!c&&(a=Xo({contours:[s,...o],windingRule:this._triangulationOptions.windingRule,elementType:this._triangulationOptions.elementType,polySize:this._triangulationOptions.polySize,vertexSize:this._triangulationOptions.vertexSize,strict:this._triangulationOptions.strict}));let f=(p=a==null?void 0:a.vertexCount)!=null?p:1,d=(m=a==null?void 0:a.elementCount)!=null?m:1;if(this._positionAttribute=new Ve(new Float32Array(f*3),3),this._normalAttribute=new Ve(new Float32Array(f*3),3),this._uvAttribute=new Ve(new Float32Array(f*2),2),this._indexAttribute=new Ve(new Uint32Array(d*3),1),a){let v=1/0,y=-1/0,w=1/0,b=-1/0;for(let A=0,x=f;A<x;A++){let _=A*2,E=a.vertices[_+0],C=a.vertices[_+1];E<v&&(v=E),E>y&&(y=E),C<w&&(w=C),C>b&&(b=C)}let S=y-v,T=b-w;for(let A=0,x=f;A<x;A++){let _=A*2,E=a.vertices[_+0],C=a.vertices[_+1],I=(E-v)/S,N=(C-w)/T;this._positionAttribute.setXYZ(A,E,C,0),this._normalAttribute.setXYZ(A,0,0,1),this._uvAttribute.setXY(A,I,N)}for(let A=0,x=d;A<x;A++){let _=A*3,E=a.elements[_+0],C=a.elements[_+1],I=a.elements[_+2];this._indexAttribute.setX(_+0,E),this._indexAttribute.setX(_+1,C),this._indexAttribute.setX(_+2,I)}}this.setAttribute("position",this._positionAttribute),this.setAttribute("normal",this._normalAttribute),this.setAttribute("uv",this._uvAttribute),this.setIndex(this._indexAttribute),this.setDrawRange(0,((g=a==null?void 0:a.elementCount)!=null?g:1)*3)}clone(){let t=new Rl(this._shape,this._curveSegments);return t.userData=Mh(this.userData),t}};var fp=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let r=e*fp.eSize;this.buffer=new ArrayBuffer(r);let n=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*n,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*n,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*n,2*e)}realloc(e,t=!1){if(e<this.size)throw Error("cannot shrink buffer");if(e<=this.capacity&&!t)return;this.debug&&console.log(`resizing from ${this.capacity} \u2192 ${e}`);let r=e*fp.eSize,n=new ArrayBuffer(r),s=Float32Array.BYTES_PER_ELEMENT,o=0,a=new Float32Array(n,o*s,3*e);o+=3*e;let l=new Float32Array(n,o*s,3*e);o+=3*e;let c=new Float32Array(n,o*s,2*e);a.set(this.positions.slice(0,this.size*3)),l.set(this.normals.slice(0,this.size*3)),c.set(this.uvs.slice(0,this.size*2)),this.buffer=n,this.positions=a,this.normals=l,this.uvs=c,this.capacity=e}get(e=1){let t=this.size+e;if(t>this.capacity){let n=this.capacity;for(;t>n;)n*=2;this.realloc(n)}let r=this.size;return this.size=t,r}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Wh=fp;Wh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var av=(i,e)=>([t,r])=>(r<t&&(r+=e),(i>=t?i:i+e)<=r),Bl=class extends De{constructor(t,r,n=0,s=12,o=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=t,this._depth=r,this._bevel=n,this._curveSegments=s,this._bevelSegmentsInput=o,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,r/2-1e-12),this._bevelSegments=Math.floor(o));let a=this._shape.extractShapePointsToFlatArray([],s),l=this._shape.shapeHoles.map(A=>{let x=A.extractShapePointsToFlatArray([],s),_=[];for(let E=x.length-1;E>=1;E-=2){let C=x[E-1],I=x[E-0];_.push(C,I)}return _}),c=Xo({windingRule:Zt.ODD,elementType:Tr.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[a]}),h=Xo({windingRule:Zt.ODD,elementType:Tr.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...l]});if(!c)throw new Error("error generating geometry");let u=c.elementCount;if(h){c.elementCount+=h.elementCount;for(let A=0;A<h.elements.length;A++){let x=h.elements[A],_=A%2===0?c.vertexCount:0;c.elements.push(x+_)}for(let A=0;A<h.vertexIndices.length;A++){let x=h.vertexIndices[A],_=c.vertexCount;c.vertexIndices.push(x+_)}for(let A=0;A<h.vertices.length;A++){let x=h.vertices[A];c.vertices.push(x)}}let f=1/0,d=-1/0,p=1/0,m=-1/0;for(let A=0,x=c.vertexCount;A<x;A++){let _=A*2,E=c.vertices[_+0],C=c.vertices[_+1];E<f&&(f=E),E>d&&(d=E),C<p&&(p=C),C>m&&(m=C)}this._minX=f,this._minY=p,this._width=d-f,this._height=m-p;let g=c.vertexCount*2*(2+this._bevelSegments);this._buffer=new Wh(g);let v=[],y=[];for(let A=c.elementCount-1;A>=0;A--){let x=A>=u,_=A*2,E=c.elements[_+0],C=c.elements[_+1],I=E+C,N={start:E,count:C,normals:[],continuous:[],concave:[]},R=E,k=I-1,G=E+1,K=this._shape.roundedCurves.length;do{let U=R-E,O=c.vertices[k*2+0],j=c.vertices[k*2+1],H=c.vertices[R*2+0],X=c.vertices[R*2+1],V=c.vertices[G*2+0],he=c.vertices[G*2+1],ie=H-O,le=X-j,q=Math.sqrt(ie*ie+le*le);ie/=q,le/=q;let ue=H-V,Z=X-he,W=Math.sqrt(ue*ue+Z*Z);ue/=W,Z/=W,N.normals[U*2+0]=-Z,N.normals[U*2+1]=ue,N.concave[U]=ie*Z-le*ue>0;let $=c.vertexIndices[R];if(Array.isArray($))N.continuous[U]=!1;else{let[ce,oe]=this._shape.getCurveIndexFromVertexId($-1,!0);if(oe>0&&oe<1)N.continuous[U]=!0;else{let me=oe===1?ce+1:ce-1;me=(me+K)%K;let ve=oe===1?0:1,ge=this._shape.roundedCurves[ce].getTangent(oe),Le=this._shape.roundedCurves[me].getTangent(ve);N.continuous[U]=ge.dot(Le)>.95}}x&&(N.normals[U*2+0]*=-1,N.normals[U*2+1]*=-1),[k,R,G]=[R,G,G+1],G>=I&&(G-=C)}while(G!==E+1);let J=[];J.push({bevelI:0,angle:0,size:0,boundary:{vertices:c.vertices.slice(E*2,I*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((U,O)=>[O,O]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:c.vertices.slice(E*2,I*2)});for(let U=1;U<=this._bevelSegments;U++){let O=U/this._bevelSegments*Math.PI/2,j=(1-Math.cos(O))*this._bevelSize,H=[],X=[],V=[],he=[],ie=0;for(let q=0;q<C;q++){let ue=q*2,Z=(q-1+C)%C*2,W=c.vertices[N.start*2+ue+0],$=c.vertices[N.start*2+ue+1],ce=-N.normals[Z+0]*j,oe=-N.normals[Z+1]*j,me=-N.normals[ue+0]*j,ve=-N.normals[ue+1]*j;if(N.concave[q]||!N.concave[q]&&x){let ge=Math.atan2(oe,ce),Le=Math.atan2(ve,me);Le>ge&&(Le-=Math.PI*2);let ke=Le-ge;if(N.continuous[q]||x){let L=ge+ke/2,P=Math.cos(L)*j,re=Math.sin(L)*j;H[2*ie+0]=W+P*(x?-1:1),H[2*ie+1]=$+re*(x?-1:1),he[ie]=q,ie++}else{let L=Math.max(1,Math.floor(s/4*Math.abs(ke)/Math.PI));for(let P=0;P<=L;P++){let re=ge+ke*(P/L),ye=Math.cos(re)*j,Se=Math.sin(re)*j;H[2*ie+0]=W+ye,H[2*ie+1]=$+Se,he[ie]=q,ie++}}}else H[2*ie+0]=W+ce,H[2*ie+1]=$+oe,he[ie]=q,X[q]=ie,ie++,H[2*ie+0]=W,H[2*ie+1]=$,he[ie]=q,ie++,H[2*ie+0]=W+me,H[2*ie+1]=$+ve,he[ie]=q,V[q]=ie,ie++}let le=Xo({windingRule:Zt.POSITIVE,elementType:Tr.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[H],edgeCreateCallback:q=>{let Z=q.Org.idx,W=he[Z],$=he[(Z+1)%he.length];q.idx=[W,$],q.Sym.idx=[$,W]},vertexIdCallback:q=>{let ue=q.Lprev.idx;return[ue?ue[1]:0,q.idx[0]]}});if(!le)throw console.log("Error"),new Error(`error generating bevel geometry for ${U}'th loop`);if(!le.vertexCount)break;for(let q=0;q<le.vertexIndices.length;q++){let[ue,Z]=le.vertexIndices[q];if(ue===Z)continue;let W=Z;Z<ue&&(W+=C);for(let $=ue;$<W;$++){let ce=$%C,oe=($+1)%C;if(!N.continuous[ce]||!N.continuous[oe]){le.vertexIndices[q]=[ue,ce],le.vertexIndices.splice(q+1,0,[oe,Z]),le.vertices.splice((q+1)*2,0,le.vertices[q*2],le.vertices[q*2+1]);break}}}J.push({bevelI:U,angle:O,size:j,boundary:le,reverseMap:he,insetPoints:H})}let Y=(U,O,j)=>{let H=0,X=U.boundary.vertexIndices.length;for(;H<X&&j(U.boundary.vertexIndices[O]);)O=(O+1)%X,H++;return H},F=v.length;for(let U=1;U<J.length;U++){let O=J[U-1],j=J[U],H=O.boundary.vertexIndices.length,X=j.boundary.vertexIndices.length;if(!H||!X)break;let V=N.concave.length,he=0,ie=av(he,C);for(;!O.boundary.vertexIndices.filter(ie).length||!j.boundary.vertexIndices.filter(ie).length;)he++,ie=av(he,C);let le=O.boundary.vertexIndices.findIndex(ie),q=j.boundary.vertexIndices.findIndex(ie);do le=(le+1)%H;while(ie(O.boundary.vertexIndices[le]));do q=(q+1)%X;while(ie(j.boundary.vertexIndices[q]));he=(he+1)%C;let ue=he,Z=this.buildBevelVert(N,O,(le-1+H)%H),W=this.buildBevelVert(N,j,(q-1+X)%X),$=Z,ce=W,oe,me,ve=!1;do{ie=av(he,C);let ge=Y(O,le,ie),Le=Y(j,q,ie),ke=ve;if(ve=!1,ge&&!Le){for(let L=0;L<ge;L++)oe=this.buildBevelVert(N,O,(le+L)%H,L/(ge-1)),v.push($.topN,oe.topP,ce.topN),v.push(oe.bottomP,$.bottomN,ce.bottomN),$=oe;ve=!0}else if(!ge&&Le)for(let L=0;L<Le;L++)me=this.buildBevelVert(N,j,(q+L)%X,L/(Le-1)),v.push(ce.topN,$.topP,me.topP),v.push($.bottomP,ce.bottomN,me.bottomP),ce=me;else if(ge&&Le)if(oe=this.buildBevelVert(N,O,le,0),me=this.buildBevelVert(N,j,q,0),ke?(v.push($.topN,me.topP,ce.topN),v.push($.topN,oe.topP,me.topP),v.push(me.bottomP,$.bottomN,ce.bottomN),v.push(me.bottomP,oe.bottomP,$.bottomN)):(v.push(ce.topN,$.topN,oe.topP),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,$.bottomN,ce.bottomN),v.push(oe.bottomP,ce.bottomN,me.bottomP)),$=oe,ce=me,ge===Le)for(let L=1;L<ge;L++)oe=this.buildBevelVert(N,O,(le+L)%H,L/(ge-1)),me=this.buildBevelVert(N,j,(q+L)%X,L/(Le-1)),v.push($.topN,oe.topP,ce.topN),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,$.bottomN,ce.bottomN),v.push(oe.bottomP,ce.bottomN,me.bottomP),$=oe,ce=me;else if(ge>Le){let L=ge/Le,P=0;for(let re=1;re<ge;re++)oe=this.buildBevelVert(N,O,(le+re)%H,re/(ge-1)),v.push($.topN,oe.topP,ce.topN),v.push(oe.bottomP,$.bottomN,ce.bottomN),$=oe,re>(P+1)*L&&(P++,me=this.buildBevelVert(N,j,(q+P)%X,P/(Le-1)),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,ce.bottomN,me.bottomP),ce=me)}else{let L=Le/ge,P=0;for(let re=1;re<Le;re++)me=this.buildBevelVert(N,j,(q+re)%X,re/(Le-1)),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,ce.bottomN,me.bottomP),ce=me,re>(P+1)*L&&(P++,oe=this.buildBevelVert(N,O,(le+P)%H,P/(ge-1)),v.push($.topN,oe.topP,ce.topN),v.push(oe.bottomP,$.bottomN,ce.bottomN),$=oe)}le=(le+ge)%H,q=(q+Le)%X,he=(he+1)%V}while(he!==ue)}{let U=J[0];for(let O=0,j=U.boundary.vertexCount;O<j;O++){let H=this.buildBevelVert(N,U,O),X=this.buildBevelVert(N,U,(O+1)%j);v.push(X.topP,H.topN,H.bottomN),v.push(X.topP,H.bottomN,X.bottomP)}}if(x){let U=[];for(let O=v.length-1;O>=F+2;O-=3){let j=v[O-2],H=v[O-1],X=v[O-0];U.push(X,H,j)}v.splice(F,v.length-F,...U)}if(x){let U=[];for(let O=J[J.length-1].boundary.vertices.length-1;O>=1;O-=2){let j=J[J.length-1].boundary.vertices[O-1],H=J[J.length-1].boundary.vertices[O-0];U.push(j,H)}y.push(U)}if(!x){let U=J[J.length-1],O=Xo({windingRule:J.length>1?Zt.POSITIVE:Zt.ODD,elementType:Tr.POLYGONS,vertexSize:2,strict:!0,contours:[U.insetPoints,...y]});if(!O)throw new Error("Error generating geometry for surface");Object.assign(this,{capStartIndex:v.length});for(let j=0;j<O.elementCount*3;j+=3){let H=this.buildSurfaceVert(O,O.elements[j+0]),X=this.buildSurfaceVert(O,O.elements[j+1]),V=this.buildSurfaceVert(O,O.elements[j+2]);v.push(H.top,X.top,V.top),v.push(V.bottom,X.bottom,H.bottom)}}this.vertexCache={}}this._buffer.shrink();let w=new Ve(Uint32Array.from(v),1),b=new Ve(this._buffer.positions,3),S=new Ve(this._buffer.normals,3),T=new Ve(this._buffer.uvs,2);b.needsUpdate=!0,S.needsUpdate=!0,T.needsUpdate=!0,w.needsUpdate=!0,this.setAttribute("position",b),this.setAttribute("normal",S),this.setAttribute("uv",T),this.setIndex(w)}buildSurfaceVert(t,r){let n=r.toString();if(n in this.vertexCache)return this.vertexCache[n];let s=t.vertices[r*2+0],o=t.vertices[r*2+1],a=(s-this._minX)/this._width,l=(o-this._minY)/this._height,c=this._buffer.get(2),h=c*3,u=c*2,f={top:c+0,bottom:c+1};return this._buffer.positions[h+0]=s,this._buffer.positions[h+1]=o,this._buffer.positions[h+2]=this._depth,this._buffer.normals[h+0]=0,this._buffer.normals[h+1]=0,this._buffer.normals[h+2]=1,this._buffer.uvs[u+0]=a,this._buffer.uvs[u+1]=l,this._buffer.positions[h+3]=s,this._buffer.positions[h+4]=o,this._buffer.positions[h+5]=0,this._buffer.normals[h+3]=0,this._buffer.normals[h+4]=0,this._buffer.normals[h+5]=-1,this._buffer.uvs[u+2]=a,this._buffer.uvs[u+3]=l,this.vertexCache[n]=f,f}buildBevelVert(t,r,n,s=1){let o=`${r.bevelI}:${n}`;if(o in this.vertexCache)return this.vertexCache[o];let[a,l]=r.boundary.vertexIndices[n],c,h,u,f;a!==l?(h=a,c=l,f=!1,u=t.continuous[h]&&t.continuous[c]):(c=a,h=(c-1+t.count)%t.count,f=t.concave[c]&&r.bevelI>0,u=t.continuous[c]||f);let d=Math.cos(r.angle),p=Math.sin(r.angle),m=n*2,g=c*2,v=h*2,y=r.boundary.vertices[m+0],w=r.boundary.vertices[m+1],b=(1-p)*this._bevelSize,S=(y-this._minX)/this._width,T=(w-this._minY)/this._height,A=t.normals[g+0],x=t.normals[g+1],_=t.normals[v+0],E=t.normals[v+1];if(f){let k=_-A,G=E-x;A=A+k*(1-s),x=x+G*(1-s);let K=Math.sqrt(A*A+x*x);A/=K,x/=K}let C=this._buffer.get(u?2:4),I=C*3,N=C*2,R={i:n,fi:c,topP:C+0,topN:C+0,bottomP:C+1,bottomN:C+1};return this._buffer.positions[I+0]=y,this._buffer.positions[I+1]=w,this._buffer.positions[I+2]=this._depth-b,this._buffer.normals[I+0]=A*d,this._buffer.normals[I+1]=x*d,this._buffer.normals[I+2]=p,this._buffer.uvs[N+0]=S,this._buffer.uvs[N+1]=T,this._buffer.positions[I+3]=y,this._buffer.positions[I+4]=w,this._buffer.positions[I+5]=b,this._buffer.normals[I+3]=A*d,this._buffer.normals[I+4]=x*d,this._buffer.normals[I+5]=-p,this._buffer.uvs[N+2]=T,this._buffer.uvs[N+3]=S,u||(C+=2,I+=6,N+=4,R.topP=C+0,R.bottomP=C+1,this._buffer.positions[I+0]=y,this._buffer.positions[I+1]=w,this._buffer.positions[I+2]=this._depth-b,this._buffer.normals[I+0]=_*d,this._buffer.normals[I+1]=E*d,this._buffer.normals[I+2]=p,this._buffer.uvs[N+0]=S,this._buffer.uvs[N+1]=T,this._buffer.positions[I+3]=y,this._buffer.positions[I+4]=w,this._buffer.positions[I+5]=b,this._buffer.normals[I+3]=_*d,this._buffer.normals[I+4]=E*d,this._buffer.normals[I+5]=-p,this._buffer.uvs[N+2]=T,this._buffer.uvs[N+3]=S),this.vertexCache[o]=R,R}clone(){let t=new Bl(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegmentsInput);return t.userData=Mh(this.userData),t}};var Hr=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var c,h,u,f,d,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3},i.parameters),r=Math.abs(t.width),n=Math.abs((h=t.height)!=null?h:t.width),s=Math.abs((u=t.depth)!=null?u:0),o=(f=i.shape)!=null?f:e==null?void 0:e.shape,a=(d=o==null?void 0:o.roundness)!=null?d:t.roundness;o!==void 0&&(o instanceof Tt?(o.width!==r||o.height!==n)&&o.applySize(r,n):o=new Tt(r,n).fromJSON(o),((p=i.parameters)==null?void 0:p.roundness)!==void 0&&((m=i.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Tt(r,n);return{parameters:Object.assign(t,{width:r,height:n,depth:s,roundness:a}),shape:l}}static build(i){let{depth:e,extrudeBevelSize:t,extrudeBevelSegments:r,subdivisions:n,roundness:s}=i.parameters;i.shape.roundness=s;let o;return e<=0?o=new Rl(i.shape,n):o=new Bl(i.shape,e,t,n,r),Object.assign(o,{userData:xe(se({},i),{type:"VectorGeometry"})})}};var f1=Math.PI*2,d1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,spikes:64,angle:360,innerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e,height:t,spikes:r,angle:n,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}=i.parameters,c=i.shape,h=e*.5,u=t*.5,f=aF(c,h,u,n*Math.PI/180,r,s);c.isClosed=!0,c.update();let d=Hr.create({shape:c,parameters:{subdivisions:f,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(d,{userData:xe(se({},i),{type:"EllipseGeometry"})})}};function aF(i,e,t,r,n,s){if(r>=f1)return n>30||n%4===0?(cF(i,e,t,s),Math.round(n/4)):u1(i,r,n,e,t,s);let o={x:0,y:t},a=r+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=o1({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:r>Math.PI,sweepFlag:!0});return n>30||n%c.length===0?lF(i,o.x,o.y,c,n,e,t,s):u1(i,r,n,e,t,s)}function lF(i,e,t,r,n,s,o,a){let l=Math.round(n/r.length);i.addPoint(Nl(e,t));for(let c=0,h=r.length;c<h;c++){let u=r[c],f=i.points[c],d=Nl(u.x,u.y);f.controls[1].position.set(u.x1,u.y1),d.controls[0].position.set(u.x2,u.y2),i.addPoint(d)}return a>0?p1(i,s,o,a):i.addPoint(Nl(0,0)),l}function u1(i,e,t,r,n,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*r,h=Math.cos(l)*n;i.addPoint(Nl(c,h))}return e<f1?s>0?p1(i,r,n,s):i.addPoint(Nl(0,0)):(i.removePoint(i.points[i.points.length-1]),s>0&&m1(i,r,n,s)),1}function cF(i,e,t,r=0,n=0,s=0){let o=.5522847498,a=e*o,l=t*o;i.addPoint(dp(n-e,s,n-e,s-l,n-e,s+l)),i.addPoint(dp(n,s+t,n-a,s+t,n+a,s+t)),i.addPoint(dp(n+e,s,n+e,s+l,n+e,s-l)),i.addPoint(dp(n,s-t,n+a,s-t,n-a,s-t)),r>0&&m1(i,e,t,r)}function Nl(i,e){return new fi(et.generateUUID(),new B(i,e))}function dp(i,e,t,r,n,s){let o=Nl(i,e);return o.controls[0].position.set(t,r),o.controls[1].position.set(n,s),o}function p1(i,e,t,r){g1(i,e,t,r).forEach(s=>i.addPoint(s))}function m1(i,e,t,r){let n=g1(i,e,t,r),s=new Tt;n.forEach(o=>s.addPoint(o)),s.isClosed=!0,i.shapeHoles.push(s)}function g1(i,e,t,r){let n=r*e/100,s=n*(Math.abs(t)/Math.abs(e)),o=new B(n/e,s/t),a=i.points.map(l=>{let c=l.clone();return c.uuid=et.generateUUID(),c}).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),h=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(h),l.controls[1].position.copy(c)}),a}var y1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},i.parameters),r=Math.abs(t.width),n=Math.abs((l=t.height)!=null?l:r),s=Math.abs((c=t.depth)!=null?c:r),o=Math.abs(Math.min(r,s))/2;return{parameters:Object.assign(t,{width:r,height:n,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(i){let{width:e,height:t,depth:r,radius:n,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:h,cornerSegments:u}=i.parameters,f=new jh(!1,e,t,r,n,s,o,a,l,c,h,u);return Object.assign(f,{userData:xe(se({},i),{type:"HelixGeometry"})})}},jh=class extends De{constructor(e=!0,t=1,r=1,n=1,s=1,o=1,a=1,l=1,c=1,h=1,u=1,f=1){super();let d=e&&o===1;d&&(f=0),u>100&&(u=100);let p=()=>new M,m=new M,g=p(),v=p(),y=p(),w,b,S,T,A,x,_,E,C=p(),I=p(),N=p(),R=p(),k=p(),G=p(),K=p(),J=p(),Y=r-2*l+.001,F=Y/o,U=Math.ceil(a*o),O=U+1,j=Y/U,H=-Y/2,X=h+1,V=2*Math.PI/h,he=Math.PI/2/f,ie=.01,le=Math.min((1-u/100)*l,l-ie),q=l-le,ue=0,Z=2,W=f*Z+Z,$=X*W/Z,ce=$+X*O,oe=X*(O+W),[me,ve,ge]=[3,3,2].map(Ee=>Array(oe*Ee).fill(0)),Le=[],ke=s-l;function L(Ee,z){let Me=Math.PI/2;x=z*j,E=2*Math.PI*(x%F)/F+Me,x+=H,_=Math.sin(E)*ke,A=Math.cos(E)*ke,e?Ee.set(A,_,x):Ee.set(A,x,_)}L(m,-1e-10),L(g,0),C.copy(m),L(m,1);let P=m.distanceTo(g),re=q+le,ye=P*U+2*re,Se=le,Ie=ye-re;for(let Ee=0;Ee<=U;Ee++){L(v,Ee),J.subVectors(v,C).normalize(),C.copy(v),G.copy(v).setComponent(+e+1,0).normalize(),K.crossVectors(J,G).normalize();let z=Ee===0,Me=Ee===U,Pe=z?3*Math.PI/2:he,Ze=z?Se:Ie,Oe=z?X:ce,Qe=z?0:oe-X,_e=J.clone().multiplyScalar(z?-q:q).add(v),$e=J.clone().multiplyScalar(z?-1:1).normalize();for(let lt=0;lt<X;lt++){let dt=lt*V;if(I.addVectors(m.copy(G).multiplyScalar(l*Math.cos(dt)),g.copy(K).multiplyScalar(l*Math.sin(dt))),N.copy(I).normalize(),z||Me){d||(ue=Qe+lt,[0,1,2].forEach(Ut=>{me[ue*3+Ut]=_e.getComponent(Ut),ve[ue*3+Ut]=$e.getComponent(Ut)}),ge[ue*2]=+Me,ge[ue*2+1]=lt/h),g.copy(N).multiplyScalar(le),y.addVectors(v,g);for(let Ut=0;Ut<f;Ut++){let Ur=Ut*he+Pe;R.addVectors(m.copy(J).multiplyScalar(q*Math.sin(Ur)),g.copy(N).multiplyScalar(q*Math.cos(Ur))),k.copy(R).normalize(),g.addVectors(y,R),R.normalize(),ue=Oe+Ut*X+lt,[0,1,2].forEach(Nn=>{me[ue*3+Nn]=g.getComponent(Nn),ve[ue*3+Nn]=k.getComponent(Nn)});let ia=+z+Math.sin(Ur);ge[ue*2]=(Ze+q*ia)/ye,ge[ue*2+1]=lt/h}}g.addVectors(v,I),ue=$+Ee*X+lt,[0,1,2].forEach(Ut=>{me[ue*3+Ut]=g.getComponent(Ut),ve[ue*3+Ut]=N.getComponent(Ut)}),ge[ue*2]=(re+Ee*P)/ye,ge[ue*2+1]=lt/h}}let Fe=O+2*f+Z,fe=1,[rt,st]=d?[fe,fe+O-1]:[0,Fe-1];for(let Ee=rt;Ee<=st-1;Ee++){let z=d&&Ee===st-1;for(let Me=0;Me<X-1;Me++)w=Ee*X+Me,b=w+1,S=(z?Me:w)+X,T=(z?Me+1:b)+X,Ee===0?Le.push(b,T,S):Ee===Fe-2?Le.push(w,b,S):Le.push(w,b,S,b,T,S)}this.setIndex(Le),this.setAttribute("position",new Te(me,3)),this.setAttribute("normal",new Te(ve,3)),this.setAttribute("uv",new Te(ge,2))}};var v1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,detail:0,corner:0,cornerSides:4},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,detail:n,corner:s,cornerSides:o}=i.parameters,a=n===0&&s!==0?new qh(e*.5,s,o):new Va(e*.5,n);return a.scale(1,t/e,r/e),Object.assign(a,{userData:xe(se({},i),{type:"IcosahedronGeometry"})})}},qh=class extends oo{constructor(e=1,t=.2,r=4){let n=(1+Math.sqrt(5))/2,s=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],o=[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],a="IcosahedronGeometry";super(s,o,a,e,t,r),this.type=a}static fromJSON(e){return new qh(e.radius,e.corner,e.cornerSides)}};var x1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s,o,a;((n=(r=i.parameters)==null?void 0:r.points)!=null?n:[]).forEach(l=>{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(i){let{points:e,segments:t,verticalSegments:r}=i.parameters,n=new rn;n.moveTo(e[0].x,e[0].y),n.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new Ua(n.extractPoints(r).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:xe(se({},i),{type:"LatheGeometry"})})}};var Oi=new Ae,lv=new ot,pp=new M,lo=class extends Yt{constructor(){super(),this.uuid=et.generateUUID(),this.name="",this.type="Geometry",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.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Ft().getNormalMatrix(e);for(let r=0,n=this.vertices.length;r<n;r++)this.vertices[r].applyMatrix4(e);for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r];s.normal.applyMatrix3(t).normalize();for(let o=0,a=s.vertexNormals.length;o<a;o++)s.vertexNormals[o].applyMatrix3(t).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(e){return Oi.makeRotationX(e),this.applyMatrix4(Oi),this}rotateY(e){return Oi.makeRotationY(e),this.applyMatrix4(Oi),this}rotateZ(e){return Oi.makeRotationZ(e),this.applyMatrix4(Oi),this}translate(e,t,r){return Oi.makeTranslation(e,t,r),this.applyMatrix4(Oi),this}scale(e,t,r){return Oi.makeScale(e,t,r),this.applyMatrix4(Oi),this}lookAt(e){return lv.lookAt(e),lv.updateMatrix(),this.applyMatrix4(lv.matrix),this}fromBufferGeometry(e){let t=this,r=e.index!==null?e.index:void 0,n=e.attributes;if(n.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;let s=n.position,o=n.normal,a=n.color,l=n.uv,c=n.uv2;c!==void 0&&(this.faceVertexUvs[1]=[]);for(let f=0;f<s.count;f++)t.vertices.push(new M().fromBufferAttribute(s,f)),a!==void 0&&t.colors.push(new be().fromBufferAttribute(a,f));function h(f,d,p,m){let g=a===void 0?[]:[t.colors[f].clone(),t.colors[d].clone(),t.colors[p].clone()],v=o===void 0?[]:[new M().fromBufferAttribute(o,f),new M().fromBufferAttribute(o,d),new M().fromBufferAttribute(o,p)],y=new Ol(f,d,p,v,g,m);t.faces.push(y),l!==void 0&&t.faceVertexUvs[0].push([new B().fromBufferAttribute(l,f),new B().fromBufferAttribute(l,d),new B().fromBufferAttribute(l,p)]),c!==void 0&&t.faceVertexUvs[1].push([new B().fromBufferAttribute(c,f),new B().fromBufferAttribute(c,d),new B().fromBufferAttribute(c,p)])}let u=e.groups;if(u.length>0)for(let f=0;f<u.length;f++){let d=u[f],p=d.start,m=d.count;for(let g=p,v=p+m;g<v;g+=3)r!==void 0?h(r.getX(g),r.getX(g+1),r.getX(g+2),d.materialIndex):h(g,g+1,g+2,d.materialIndex)}else if(r!==void 0)for(let f=0;f<r.count;f+=3)h(r.getX(f),r.getX(f+1),r.getX(f+2));else for(let f=0;f<s.count;f+=3)h(f,f+1,f+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pp).negate(),this.translate(pp.x,pp.y,pp.z),this}normalize(){this.computeBoundingSphere();let e=this.boundingSphere.center,t=this.boundingSphere.radius,r=t===0?1:1/t,n=new Ae;return n.set(r,0,0,-r*e.x,0,r,0,-r*e.y,0,0,r,-r*e.z,0,0,0,1),this.applyMatrix4(n),this}computeFaceNormals(){let e=new M,t=new M;for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r],o=this.vertices[s.a],a=this.vertices[s.b],l=this.vertices[s.c];e.subVectors(l,a),t.subVectors(o,a),e.cross(t),e.normalize(),s.normal.copy(e)}}computeVertexNormals(e=!0){let t=new Array(this.vertices.length);for(let r=0,n=this.vertices.length;r<n;r++)t[r]=new M;if(e){let r=new M,n=new M;for(let s=0,o=this.faces.length;s<o;s++){let a=this.faces[s],l=this.vertices[a.a],c=this.vertices[a.b],h=this.vertices[a.c];r.subVectors(h,c),n.subVectors(l,c),r.cross(n),t[a.a].add(r),t[a.b].add(r),t[a.c].add(r)}}else{this.computeFaceNormals();for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r];t[s.a].add(s.normal),t[s.b].add(s.normal),t[s.c].add(s.normal)}}for(let r=0,n=this.vertices.length;r<n;r++)t[r].normalize();for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r],o=s.vertexNormals;o.length===3?(o[0].copy(t[s.a]),o[1].copy(t[s.b]),o[2].copy(t[s.c])):(o[0]=t[s.a].clone(),o[1]=t[s.b].clone(),o[2]=t[s.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e<t;e++){let r=this.faces[e],n=r.vertexNormals;n.length===3?(n[0].copy(r.normal),n[1].copy(r.normal),n[2].copy(r.normal)):(n[0]=r.normal.clone(),n[1]=r.normal.clone(),n[2]=r.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,r=this.faces.length;t<r;t++){let n=this.faces[t];n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(let s=0,o=n.vertexNormals.length;s<o;s++)n.__originalVertexNormals[s]?n.__originalVertexNormals[s].copy(n.vertexNormals[s]):n.__originalVertexNormals[s]=n.vertexNormals[s].clone()}let e=new lo;e.faces=this.faces;for(let t=0,r=this.morphTargets.length;t<r;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];let s=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals;for(let a=0,l=this.faces.length;a<l;a++){let c=new M,h={a:new M,b:new M,c:new M};s.push(c),o.push(h)}}let n=this.morphNormals[t];e.vertices=this.morphTargets[t].vertices,e.computeFaceNormals(),e.computeVertexNormals();for(let s=0,o=this.faces.length;s<o;s++){let a=this.faces[s],l=n.faceNormals[s],c=n.vertexNormals[s];l.copy(a.normal),c.a.copy(a.vertexNormals[0]),c.b.copy(a.vertexNormals[1]),c.c.copy(a.vertexNormals[2])}}for(let t=0,r=this.faces.length;t<r;t++){let n=this.faces[t];n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals}}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Kt),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Lr),this.boundingSphere.setFromPoints(this.vertices)}merge(e,t,r=0){if(!(e&&e.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}let n,s=this.vertices.length,o=this.vertices,a=e.vertices,l=this.faces,c=e.faces,h=this.colors,u=e.colors;t!==void 0&&(n=new Ft().getNormalMatrix(t));for(let f=0,d=a.length;f<d;f++){let m=a[f].clone();t!==void 0&&m.applyMatrix4(t),o.push(m)}for(let f=0,d=u.length;f<d;f++)h.push(u[f].clone());for(let f=0,d=c.length;f<d;f++){let p=c[f],m,g,v=p.vertexNormals,y=p.vertexColors,w=new Ol(p.a+s,p.b+s,p.c+s);w.normal.copy(p.normal),n!==void 0&&w.normal.applyMatrix3(n).normalize();for(let b=0,S=v.length;b<S;b++)m=v[b].clone(),n!==void 0&&m.applyMatrix3(n).normalize(),w.vertexNormals.push(m);w.color.copy(p.color);for(let b=0,S=y.length;b<S;b++)g=y[b],w.vertexColors.push(g.clone());w.materialIndex=p.materialIndex+r,l.push(w)}for(let f=0,d=e.faceVertexUvs.length;f<d;f++){let p=e.faceVertexUvs[f];this.faceVertexUvs[f]===void 0&&(this.faceVertexUvs[f]=[]);for(let m=0,g=p.length;m<g;m++){let v=p[m],y=[];for(let w=0,b=v.length;w<b;w++)y.push(v[w].clone());this.faceVertexUvs[f].push(y)}}}mergeMesh(e){if(!(e&&e.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)}mergeVertices(e=4){let t={},r=[],n=[],s=Math.pow(10,e);for(let l=0,c=this.vertices.length;l<c;l++){let h=this.vertices[l],u=Math.round(h.x*s)+"_"+Math.round(h.y*s)+"_"+Math.round(h.z*s);t[u]===void 0?(t[u]=l,r.push(this.vertices[l]),n[l]=r.length-1):n[l]=n[t[u]]}let o=[];for(let l=0,c=this.faces.length;l<c;l++){let h=this.faces[l];h.a=n[h.a],h.b=n[h.b],h.c=n[h.c];let u=[h.a,h.b,h.c];for(let f=0;f<3;f++)if(u[f]===u[(f+1)%3]){o.push(l);break}}for(let l=o.length-1;l>=0;l--){let c=o[l];this.faces.splice(c,1);for(let h=0,u=this.faceVertexUvs.length;h<u;h++)this.faceVertexUvs[h].splice(c,1)}let a=this.vertices.length-r.length;return this.vertices=r,a}setFromPoints(e){this.vertices=[];for(let t=0,r=e.length;t<r;t++){let n=e[t];this.vertices.push(new M(n.x,n.y,n.z||0))}return this}sortFacesByMaterialIndex(){let e=this.faces,t=e.length;for(let l=0;l<t;l++)e[l]._id=l;function r(l,c){return l.materialIndex-c.materialIndex}e.sort(r);let n=this.faceVertexUvs[0],s=this.faceVertexUvs[1],o,a;n&&n.length===t&&(o=[]),s&&s.length===t&&(a=[]);for(let l=0;l<t;l++){let c=e[l]._id;o&&o.push(n[c]),a&&a.push(s[c])}o&&(this.faceVertexUvs[0]=o),a&&(this.faceVertexUvs[1]=a)}toJSON(){let e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),this.parameters!==void 0){let p=this.parameters;for(let m in p)p[m]!==void 0&&(e[m]=p[m]);return e}let t=[];for(let p=0;p<this.vertices.length;p++){let m=this.vertices[p];t.push(m.x,m.y,m.z)}let r=[],n=[],s={},o=[],a={},l=[],c={};for(let p=0;p<this.faces.length;p++){let m=this.faces[p],g=!0,v=!1,y=this.faceVertexUvs[0][p]!==void 0,w=m.normal.length()>0,b=m.vertexNormals.length>0,S=m.color.r!==1||m.color.g!==1||m.color.b!==1,T=m.vertexColors.length>0,A=0;if(A=h(A,0,0),A=h(A,1,g),A=h(A,2,v),A=h(A,3,y),A=h(A,4,w),A=h(A,5,b),A=h(A,6,S),A=h(A,7,T),r.push(A),r.push(m.a,m.b,m.c),r.push(m.materialIndex),y){let x=this.faceVertexUvs[0][p];r.push(d(x[0]),d(x[1]),d(x[2]))}if(w&&r.push(u(m.normal)),b){let x=m.vertexNormals;r.push(u(x[0]),u(x[1]),u(x[2]))}if(S&&r.push(f(m.color)),T){let x=m.vertexColors;r.push(f(x[0]),f(x[1]),f(x[2]))}}function h(p,m,g){return g?p|1<<m:p&~(1<<m)}function u(p){let m=p.x.toString()+p.y.toString()+p.z.toString();return s[m]!==void 0||(s[m]=n.length/3,n.push(p.x,p.y,p.z)),s[m]}function f(p){let m=p.r.toString()+p.g.toString()+p.b.toString();return a[m]!==void 0||(a[m]=o.length,o.push(p.getHex())),a[m]}function d(p){let m=p.x.toString()+p.y.toString();return c[m]!==void 0||(c[m]=l.length/2,l.push(p.x,p.y)),c[m]}return e.data={},e.data.vertices=t,e.data.normals=n,o.length>0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=r,e}clone(){return new lo().copy(this)}copy(e){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=e.name;let t=e.vertices;for(let f=0,d=t.length;f<d;f++)this.vertices.push(t[f].clone());let r=e.colors;for(let f=0,d=r.length;f<d;f++)this.colors.push(r[f].clone());let n=e.faces;for(let f=0,d=n.length;f<d;f++)this.faces.push(n[f].clone());for(let f=0,d=e.faceVertexUvs.length;f<d;f++){let p=e.faceVertexUvs[f];this.faceVertexUvs[f]===void 0&&(this.faceVertexUvs[f]=[]);for(let m=0,g=p.length;m<g;m++){let v=p[m],y=[];for(let w=0,b=v.length;w<b;w++){let S=v[w];y.push(S.clone())}this.faceVertexUvs[f].push(y)}}let s=e.morphTargets;for(let f=0,d=s.length;f<d;f++){let p={};if(p.name=s[f].name,s[f].vertices!==void 0){p.vertices=[];for(let m=0,g=s[f].vertices.length;m<g;m++)p.vertices.push(s[f].vertices[m].clone())}if(s[f].normals!==void 0){p.normals=[];for(let m=0,g=s[f].normals.length;m<g;m++)p.normals.push(s[f].normals[m].clone())}this.morphTargets.push(p)}let o=e.morphNormals;for(let f=0,d=o.length;f<d;f++){let p={};if(o[f].vertexNormals!==void 0){p.vertexNormals=[];for(let m=0,g=o[f].vertexNormals.length;m<g;m++){let v=o[f].vertexNormals[m],y={};y.a=v.a.clone(),y.b=v.b.clone(),y.c=v.c.clone(),p.vertexNormals.push(y)}}if(o[f].faceNormals!==void 0){p.faceNormals=[];for(let m=0,g=o[f].faceNormals.length;m<g;m++)p.faceNormals.push(o[f].faceNormals[m].clone())}this.morphNormals.push(p)}let a=e.skinWeights;for(let f=0,d=a.length;f<d;f++)this.skinWeights.push(a[f].clone());let l=e.skinIndices;for(let f=0,d=l.length;f<d;f++)this.skinIndices.push(l[f].clone());let c=e.lineDistances;for(let f=0,d=c.length;f<d;f++)this.lineDistances.push(c[f]);let h=e.boundingBox;h!==null&&(this.boundingBox=h.clone());let u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}toBufferGeometry(){let e=new cv().fromGeometry(this),t=new De,r=new Float32Array(e.vertices.length*3);if(t.setAttribute("position",new Ve(r,3).copyVector3sArray(e.vertices)),e.normals.length>0){let n=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Ve(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let n=new Float32Array(e.colors.length*3);t.setAttribute("color",new Ve(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let n=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Ve(n,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let n=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Ve(n,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let n in e.morphTargets){let s=[],o=e.morphTargets[n];for(let a=0,l=o.length;a<l;a++){let c=o[a],h=new Te(c.data.length*3,3);h.name=c.name,s.push(h.copyVector3sArray(c.data))}t.morphAttributes[n]=s}if(e.skinIndices.length>0){let n=new Te(e.skinIndices.length*4,4);t.setAttribute("skinIndex",n.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let n=new Te(e.skinWeights.length*4,4);t.setAttribute("skinWeight",n.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new De,r=e.geometry;if(e.isPoints||e.isLine){let n=new Te(r.vertices.length*3,3),s=new Te(r.colors.length*3,3);if(t.setAttribute("position",n.copyVector3sArray(r.vertices)),t.setAttribute("color",s.copyColorsArray(r.colors)),r.lineDistances&&r.lineDistances.length===r.vertices.length){let o=new Te(r.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(r.lineDistances))}r.boundingSphere!==null&&(t.boundingSphere=r.boundingSphere.clone()),r.boundingBox!==null&&(t.boundingBox=r.boundingBox.clone())}else e.isMesh&&(t=r.toBufferGeometry());return t}};lo.prototype.isGeometry=!0;var cv=class{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(e){let t=[],r,n,s,o=e.faces;for(n=0;n<o.length;n++){let a=o[n];a.materialIndex!==s&&(s=a.materialIndex,r!==void 0&&(r.count=n*3-r.start,t.push(r)),r={start:n*3,materialIndex:s})}r!==void 0&&(r.count=n*3-r.start,t.push(r)),this.groups=t}fromGeometry(e){let t=e.faces,r=e.vertices,n=e.faceVertexUvs,s=n[0]&&n[0].length>0,o=n[1]&&n[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let v=0;v<l;v++)c[v]={name:a[v].name,data:[]};this.morphTargets.position=c}let h=e.morphNormals,u=h.length,f;if(u>0){f=[];for(let v=0;v<u;v++)f[v]={name:h[v].name,data:[]};this.morphTargets.normal=f}let d=e.skinIndices,p=e.skinWeights,m=d.length===r.length,g=p.length===r.length;r.length>0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let v=0;v<t.length;v++){let y=t[v];this.vertices.push(r[y.a],r[y.b],r[y.c]);let w=y.vertexNormals;if(w.length===3)this.normals.push(w[0],w[1],w[2]);else{let S=y.normal;this.normals.push(S,S,S)}let b=y.vertexColors;if(b.length===3)this.colors.push(b[0],b[1],b[2]);else{let S=y.color;this.colors.push(S,S,S)}if(s===!0){let S=n[0][v];S!==void 0?this.uvs.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",v),this.uvs.push(new B,new B,new B))}if(o===!0){let S=n[1][v];S!==void 0?this.uvs2.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",v),this.uvs2.push(new B,new B,new B))}for(let S=0;S<l;S++){let T=a[S].vertices;c[S].data.push(T[y.a],T[y.b],T[y.c])}for(let S=0;S<u;S++){let T=h[S].vertexNormals[v];f[S].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[y.a],d[y.b],d[y.c]),g&&this.skinWeights.push(p[y.a],p[y.b],p[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}},Ol=class{constructor(e,t,r,n,s,o=0){this.a=e,this.b=t,this.c=r,this.normal=n&&n.isVector3?n:new M,this.vertexNormals=Array.isArray(n)?n:[],this.color=s&&s.isColor?s:new be,this.vertexColors=Array.isArray(s)?s:[],this.materialIndex=o}clone(){return new this.constructor().copy(this)}copy(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(let t=0,r=e.vertexNormals.length;t<r;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(let t=0,r=e.vertexColors.length;t<r;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}};var hF=["a","b","c"];function uF(i,e){switch(e){case"c":return i.c;case"b":return i.b;case"a":default:return i.a}}function hv(i,e,t){let r=Math.min(i,e),n=Math.max(i,e),s=r+"_"+n;return t.get(s)}function uv(i,e,t,r,n,s){let o=Math.min(i,e),a=Math.max(i,e),l=o+"_"+a,c;if(r.has(l))c=r.get(l);else{let h=t[o],u=t[a];c={a:h,b:u,newEdge:null,faces:[]},r.set(l,c)}c.faces.push(n),s[i].edges.push(c),s[e].edges.push(c)}function fF(i,e,t,r){let n,s,o;for(n=0,s=i.length;n<s;n++)t[n]={edges:[]};for(n=0,s=e.length;n<s;n++)o=e[n],uv(o.a,o.b,i,r,o,t),uv(o.b,o.c,i,r,o,t),uv(o.c,o.a,i,r,o,t)}function mp(i,e,t,r,n){i.push(new Ol(e,t,r,void 0,void 0,n))}function Fl(i,e){return Math.abs(e-i)/2+Math.min(i,e)}function gp(i,e,t,r){i.push([e.clone(),t.clone(),r.clone()])}var yp=class{constructor(e=1){this.subdivisions=e}modify(e){e instanceof De?e=new lo().fromBufferGeometry(e):e=e.clone(),e.mergeVertices();let t=this.subdivisions;for(;t-- >0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,r,n,s,o,a,l=e.vertices,c=e.faces,h=e.faceVertexUvs[0],u=h!==void 0&&h.length>0,f=[],d=new Map;fF(l,c,f,d);let p=[],m,g,v,y,w,b,S;for(let ie of Array.from(d.keys())){for(g=d.get(ie),v=new M,w=3/8,b=1/8,S=g.faces.length,S!=2&&(w=.5,b=0,S!=1),v.addVectors(g.a,g.b).multiplyScalar(w),t.set(0,0,0),o=0;o<S;o++){for(y=g.faces[o],a=0;a<3&&(m=l[uF(y,hF[a])],!(m!==g.a&&m!==g.b));a++);m&&t.add(m)}t.multiplyScalar(b),v.add(t),g.newEdge=p.length,p.push(v)}let T,A,x,_,E,C,I,N=[];for(n=0,s=l.length;n<s;n++){for(C=l[n],E=f[n].edges,r=E.length,r==3?T=3/16:r>3&&(T=3/(8*r)),A=1-r*Number(T),x=T,r<=2&&(r==2?(A=3/4,x=1/8):r==1||r==0),I=C.clone().multiplyScalar(A),t.set(0,0,0),o=0;o<r;o++)_=E[o],m=_.a!==C?_.a:_.b,t.add(m);t.multiplyScalar(Number(x)),I.add(t),N.push(I)}let R=N.concat(p),k=N.length,G,K,J,Y=[],F=[],U,O,j,H,X=new B,V=new B,he=new B;for(n=0,s=c.length;n<s;n++)y=c[n],G=Number(hv(y.a,y.b,d).newEdge)+k,K=Number(hv(y.b,y.c,d).newEdge)+k,J=Number(hv(y.c,y.a,d).newEdge)+k,mp(Y,G,K,J,y.materialIndex),mp(Y,y.a,G,J,y.materialIndex),mp(Y,y.b,K,G,y.materialIndex),mp(Y,y.c,J,K,y.materialIndex),u&&(U=h[n],O=U[0],j=U[1],H=U[2],X.set(Fl(O.x,j.x),Fl(O.y,j.y)),V.set(Fl(j.x,H.x),Fl(j.y,H.y)),he.set(Fl(O.x,H.x),Fl(O.y,H.y)),gp(F,X,V,he),gp(F,O,X,he),gp(F,j,V,X),gp(F,H,he,V));e.vertices=R,e.faces=Y,u&&(e.faceVertexUvs[0]=F)}};var _r=new M,b1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var s,o;let t=(o=(s=i.geometry)!=null?s:e==null?void 0:e.geometry)!=null?o:new De().copy(new vn(100,100,100)),r;e===void 0?(t.computeBoundingBox(),t.boundingBox.getSize(_r),r={width:_r.x,height:_r.y,depth:_r.z,subdivisions:0}):r=e.parameters;let n=se(se({},r),i.parameters);return{parameters:{width:Math.abs(n.width),height:Math.abs(n.height),depth:Math.abs(n.depth),subdivisions:Math.abs(n.subdivisions)},geometry:t}}static build(i){var l;let{width:e,height:t,depth:r,subdivisions:n}=i.parameters,s=(l=i.geometry)!=null?l:new De().copy(new vn(100,100,100)),o=s.userData.parameters;o===void 0?(s.computeBoundingBox(),s.boundingBox.getSize(_r)):_r.set(o.width,o.height,o.depth),(e!==_r.x||t!==_r.y||r!==_r.z)&&s.scale(_r.x===0?1:e/_r.x,_r.y===0?1:t/_r.y,_r.z===0?1:r/_r.z);let a=s.originalGeometry;return n>0?(a===void 0||(o==null?void 0:o.subdivisions)!==n)&&(a===void 0&&(a=s),s=new yp(n).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0,s.getAttribute("normal")===void 0&&s.computeVertexNormals()),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete i.geometry,Object.assign(s,{userData:xe(se({},i),{type:"NonParametricGeometry"})})}static loadFromUrl(i,e,t){new Ws(t).load(i,n=>{let s=this.normalizeInputs({geometry:n});n.boundingBox.getSize(_r);let o=100/_r.x;Object.assign(s.parameters,{width:100,height:_r.y*o,depth:_r.z*o}),e(this.build(s))})}};var w1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:3},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e,height:t,spikes:r,cornerRadius:n,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a}=i.parameters,l=i.shape,c=e*.5,h=t*.5,u=0,f=0,d=2*Math.PI/r;for(let m=0;m<r;m++){let g=d*m,v=u+Math.sin(g)*c,y=f+Math.cos(g)*h;l.addPoint(l.createPoint(v,y))}l.isClosed=!0;for(let m=0,g=l.points.length;m<g;m++)l.points[m].roundness=n;l.roundness=n,l.update();let p=Hr.create({shape:l,parameters:{roundness:n,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a}});return Object.assign(p,{userData:xe(se({},i),{type:"PolygonGeometry"})})}};var S1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,radialSegments:4,heightSegments:1,cornerRadius:0,cornerSegments:8,openEnded:!1},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,radialSegments:n,heightSegments:s,openEnded:o,cornerRadius:a,cornerSegments:l}=i.parameters,c=new dv(e*.5,t,n,s,o,a,l);return c.scale(1,1,r/e),Object.assign(c,{userData:xe(se({},i),{type:"PyramidGeometry"})})}};function Yh(i,e,t){t.x=i.x*e.x,t.y=i.y,t.z=i.x*e.y}function fv(i,e,t,r,n,s){let o=e.clone().sub(i),a=t.clone().sub(i),l=o.angleTo(a);if(o.normalize(),a.normalize(),r===n){let c=o.add(a).normalize();s.copy(i).addScaledVector(c,r/Math.sin(l/2))}else{let c=o.angleTo(a);s.copy(i),s.addScaledVector(o,n/Math.sin(c)),s.addScaledVector(a,r/Math.sin(c))}}function dF(i,e,t){let r=i.clone().sub(e),n=t.clone().sub(e);return r.projectOnVector(n),r.add(e)}var dv=class extends De{constructor(e=.5,t=1,r=4,n=1,s=!1,o=0,a=4){super(),r=Math.floor(Math.max(3,r)),n=Math.floor(n),a=Math.floor(a);let l=[],c=[],h=[],u=[],f=0,d=t/2,p=Math.PI/r,m=e*Math.cos(Math.PI/r),g=2*Math.PI/r,v=(r-2)*Math.PI/r,y=Math.PI-v,w=new M(0,-d,0),b=new M(0,d,0),S=new B(e,-d),T=new B(m,-d),A=new B(0,b.y).sub(T),x=new B(0,b.y).sub(S),_=new B(A.y,-A.x).normalize(),E=new B(x.y,-x.x).normalize(),I=e*Math.cos(Math.PI/r)*Math.tan((Math.PI-A.angle())/2)-1e-8;o=Math.min(o,I);let N;{let F=new M(_.x,_.y,0),U=new M(Math.cos(g)*F.x,F.y,Math.sin(g)*F.x);N=F.angleTo(U)}let R=o/Math.tan((Math.PI-A.angle())/2),k=o/Math.tan((Math.PI-N)/2),G=new M;if(!s){c.push(w.x,w.y,w.z),h.push(0,-1,0),u.push(0,0);let F=f++,U=[],O=S.clone(),j=R/Math.cos(Math.PI/r);O.x-=j;for(let H=0;H<r;H++){let X=H/r*Math.PI*2+p,V=new B(Math.sin(X),Math.cos(X));Yh(O,V,G),c.push(G.x,G.y,G.z),h.push(0,-1,0),u.push(0,0),U.push(f++)}for(let H=0;H<U.length;H++)l.push(U[H],F,U[(H+1)%U.length])}let K=[];{let F=new M,U=new M,O=new M,j=new M,H=new M,X=new M;for(let V=0;V<r;V++){let he=V/r*Math.PI*2+p,ie=(V+.5)/r*Math.PI*2+p,le=(V+1)/r*Math.PI*2+p,q=new B(Math.sin(he),Math.cos(he)),ue=new B(Math.sin(ie),Math.cos(ie)),Z=new B(Math.sin(le),Math.cos(le));Yh(S,q,U),Yh(S,Z,O),Yh(_,ue,F),fv(b,U,O,k,k,j),c.push(j.x,j.y,j.z),fv(U,b,O,k,R,H),c.push(H.x,H.y,H.z),fv(O,U,b,R,k,X),c.push(X.x,X.y,X.z),h.push(F.x,F.y,F.z),h.push(F.x,F.y,F.z),h.push(F.x,F.y,F.z),u.push(0,0),u.push(0,0),u.push(0,0);let W=f++,$=f++,ce=f++;if(l.push(W,$,ce),o>0){{let ve=U.clone().add(O).multiplyScalar(.5),ge=b.clone().sub(ve).normalize(),ke=w.clone().sub(ve).normalize().add(ge).normalize().multiplyScalar(-1),L=X.clone().sub(H);J(ve,L,ke,A.angle())}let oe,me;{let ve=new M;Yh(E,Z,ve);let ge=X.clone().add(j).multiplyScalar(.5);ge=dF(ge,O,b);let Le=X.clone().sub(j);[oe,me]=J(ge,Le,ve,N,j.y)}{let ve=oe,ge=ve.clone().setY(0).normalize(),Le=new M(0,-1,0),ke=ge.clone().cross(Le);Y(ve,ge,Le,ke)}K.concat(me);{let ve=A.angle(),ge=Math.PI-ve,Le=b.clone();Le.y-=o/Math.sin(ve-Math.PI/2);let ke=new M,L=[];for(let re=0;re<a;re++){let ye=[],Se=Math.PI/2-ge*re/a,Ie=Math.cos(Se),Fe=Math.sin(Se),fe=ie;for(let rt=0;rt<=re;rt++){let st=Math.cos(fe),Ee=Math.sin(fe);F.x=Ie*Ee,F.y=Fe,F.z=Ie*st,ke.copy(Le).addScaledVector(F,o),c.push(ke.x,ke.y,ke.z),h.push(F.x,F.y,F.z),u.push(0,0),ye.push(f++),fe+=Math.PI*2/re/r}L.push(ye)}me.reverse(),L.push(me);let P=L.length-1;for(let re=0;re<P;re++){let ye=L[re],Se=L[re+1],Ie=ye.length-1;l.push(Se[1],ye[0],Se[0]);for(let Fe=1;Fe<=Ie;Fe++)l.push(ye[Fe],ye[Fe-1],Se[Fe]),l.push(Se[Fe+1],ye[Fe],Se[Fe])}}}}}this.setIndex(l),this.setAttribute("position",new Te(c,3)),this.setAttribute("normal",new Te(h,3)),this.setAttribute("uv",new Te(u,2));function J(F,U,O,j,H){let X=-j/2,V=(Math.PI-j)/2,he=U.clone().normalize().cross(O);F.addScaledVector(O,-o/Math.sin(V));let ie=new M,le=new M,q=1,ue=f,Z=[];for(let W=0;W<=a;W++){let $=X+W/a*j;le.set(0,0,0),le.addScaledVector(he,Math.sin($)),le.addScaledVector(O,Math.cos($));for(let ce=0;ce<=q;ce++){let oe=ce/q-.5;if(ie.copy(F),ie.addScaledVector(U,oe),ie.addScaledVector(le,o),H!=null){let me=Math.max(0,ie.y-H);ie.addScaledVector(U,-me/U.y)}c.push(ie.x,ie.y,ie.z),h.push(le.x,le.y,le.z),u.push(0,0),ce===0&&Z.push(f),f++}}for(let W=0;W<a;W++)for(let $=0;$<q;$++){let ce=ue+$+(q+1)*W,oe=ce+(q+1),me=oe+1,ve=ce+1;l.push(ce,oe,ve),l.push(oe,me,ve)}return[F.clone().addScaledVector(U,.5),Z]}function Y(F,U,O,j){let H=Math.PI/2,X=x.angle()-H,V=[],he=new M,ie=new M;for(let q=0;q<=a;q++){let ue=[],Z=q/a;for(let W=0;W<=q;W++){let ce=((q?W/q:0)-.5)*y,oe=Math.cos(ce),me=Math.sin(ce),ve=Math.atan(Math.tan(X)*oe),ge=(H+ve)*Z,Le=Math.cos(ge),ke=Math.sin(ge);he.set(0,0,0),he.addScaledVector(U,ke*oe),he.addScaledVector(O,Le),he.addScaledVector(j,ke*me),ie.copy(F).addScaledVector(he,o),c.push(ie.x,ie.y,ie.z),h.push(he.x,he.y,he.z),u.push(0,0),ue.push(f++)}V.push(ue)}let le=V.length-1;for(let q=0;q<le;q++){let ue=V[q],Z=V[q+1],W=ue.length-1;l.push(ue[0],Z[1],Z[0]);for(let $=1;$<=W;$++)l.push(ue[$-1],ue[$],Z[$]),l.push(ue[$],Z[$+1],Z[$])}}}};var vp=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var s,o,a,l;let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,depth:0,cornerRadius:[0,0,0,0],cornerType:1,extrudeBevelSize:0,extrudeBevelSegments:1},i.parameters),r=Object.assign((o=e==null?void 0:e.ui)!=null?o:{enabledIndieCorners:!1},i.ui);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((a=t.height)!=null?a:t.width),depth:Math.abs((l=t.depth)!=null?l:0)}),ui:r}}static build(i){let e=i.shape,{width:t,height:r,cornerRadius:n,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}=i.parameters,c={x:t*.5,y:r*.5},h={x:-c.x,y:-c.y},u={x:c.x,y:c.y};function f(b,S,T){return S>t&&T>r?Math.min(b*t/S,b*r/T):S>t?b*t/S:T>r?b*r/T:b}let d=[];d[0]=n[0]===0?0:f(n[0],n[0]+n[3],n[0]+n[1]),d[1]=n[1]===0?0:f(n[1],n[1]+n[2],n[1]+n[0]),d[2]=n[2]===0?0:f(n[2],n[2]+n[1],n[2]+n[3]),d[3]=n[3]===0?0:f(n[3],n[3]+n[0],n[3]+n[2]);let p=h.x,m=u.x,g=u.y,v=h.y;e.addPoint(e.createPoint(p,g)),e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(m,v)),e.addPoint(e.createPoint(p,v)),e.isClosed=!0;let y=!0;for(let b=0,S=e.points.length;b<S;b++)e.points[b].roundness=d[b],b>0&&d[b]!==d[b-1]&&(y=!1);y&&(e.roundness=d[0]),e.useCubicForRoundedCorners=s!==1,e.update();let w=Hr.create({shape:e,parameters:{depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(w,{userData:xe(se({},i),{type:"RectangleGeometry"})})}};var M1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e=100,height:t=e,depth:r=e,widthSegments:n=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=i.parameters,h=new Ro(.5*e,n,s,o,a,l,c);return h.scale(1,t/e,r/e),Object.assign(h,{userData:xe(se({},i),{type:"SphereGeometry"})})}};var A1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,depth:0,widthSegments:8,heightSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:0})}}static build(i){let{width:e=100,height:t=e,widthSegments:r=8,heightSegments:n=8}=i.parameters,s=new is(e,t,r,n);return s.scale(1,1,1),Object.assign(s,{userData:xe(se({},i),{type:"PlaneGeometry"})})}};var T1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,angle:90,cornerRadius:24,cornerSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,angle:n,cornerRadius:s,cornerSegments:o}=i.parameters,a=new pv(e,t,r,n,s,o);return Object.assign(a,{userData:xe(se({},i),{type:"BackdropGeometry"})})}},pv=class extends De{constructor(e=1,t=1,r=1,n=90,s=10,o=24){super(),this.type="BackdropGeometry";let a=[],l=[],c=[];s==0&&(o=1),o=Math.max(1,Math.floor(o)),s=Math.min(s,100),n=Math.min(179,n),n*=Math.PI/180;let h=[],u=(he=0,ie=0,le=0)=>new M(he,ie,le),f=u(),d=u(),[p,m,g]=[t/2,e/2,r/2],v=-m,y=+m,[w,b,S]=[u(v,-p,+g),u(v,-p,-g),u(v,+p,-g)],[T,A]=[he=>Math.sin(he),he=>Math.cos(he)],x=(he,ie=!1)=>Math.sin(he-Math.PI/(1+ +ie)),_=(he,ie=!1)=>Math.cos(he-Math.PI/(1+ +ie));S.y=T(n)*t-p;let E=A(n)*t-g;n<=Math.PI/2?S.z=E:b.z=Math.min(b.z-E-g,w.z-.001),f.subVectors(w,b),d.subVectors(S,b);let C=Math.min(f.length(),d.length())*s/100,I=C*Math.tan(n/2),N=C/Math.cos(n/2),R=f.clone().normalize().add(d.normalize()).setLength(N).add(b);f.set(0,x(n,!0),_(n,!0)),h.push([S,f.clone()]);let k=(Math.PI-n)/o;for(let he=0;he<=o;he++){let ie=Math.PI/2+n+he*k;f.set(0,T(ie)*I,A(ie)*I),f.add(R),d.set(0,x(ie),_(ie)),h.push([f.clone(),d.clone()])}h.push([w,u(0,1,0)]);let G=Math.sin(k/2)*I*2,K=h.length-1,J=h[0][0].distanceTo(h[1][0]),Y=h[K-1][0].distanceTo(h[K][0]),F=J+G*o+Y;h[0].push(1);for(let he=0;he<=o;he++)h[he+1].push(1-(J+he*G)/F);h[K].push(0);let[U,O,j]=h[0],H,X,V;for(let he=1;he<h.length;he++)[H,X,V]=h[he],a.push(v,U.y,U.z,v,H.y,H.z,y,U.y,U.z,y,U.y,U.z,v,H.y,H.z,y,H.y,H.z),l.push(0,O.y,O.z,0,X.y,X.z,0,O.y,O.z,0,O.y,O.z,0,X.y,X.z,0,X.y,X.z),c.push(0,j,0,V,1,j,1,j,0,V,1,V),[U,O,j]=[H,X,V];this.setAttribute("position",new Te(a,3)),this.setAttribute("normal",new Te(l,3)),this.setAttribute("uv",new Te(c,2))}};var _1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeBevelSize:0,extrudeBevelSegments:1},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e,height:t,innerRadiusPercent:r,spikes:n,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c}=i.parameters,h=i.shape,u=e*.5,f=t*.5,d=0,p=0,m=o*Math.PI/360/n,g=Math.PI/2*3*-1,v=u*r/100,y=f*r/100;if(n===3&&r===50){m=2*Math.PI/n;for(let b=0;b<n;b++){let S=m*b,T=d+Math.sin(S)*u,A=p+Math.cos(S)*f;h.addPoint(h.createPoint(T,A))}}else for(let b=0;b<n;b++){let S=d+Math.cos(g)*u,T=p+Math.sin(g)*f;h.addPoint(h.createPoint(S,T)),g+=m,S=d+Math.cos(g)*v,T=p+Math.sin(g)*y,b<=n,h.addPoint(h.createPoint(S,T)),g+=m}h.isClosed=!0;for(let b=0,S=h.points.length;b<S;b++)h.points[b].roundness=s;h.roundness=s,h.update();let w=Hr.create({shape:h,parameters:{roundness:s,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c}});return Object.assign(w,{userData:xe(se({},i),{type:"StarGeometry"})})}};var xp=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,depth:0},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:0)})}}static build(i){let{width:e,height:t}=i.parameters,r=new is(e,t);return Object.assign(r,{userData:xe(se({},i),{type:"TextFrameGeometry"})})}};var E1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var o,a,l;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:32,tubularSegments:64,arc:Math.PI*2,cornerRadius:30,cornerSegments:8},i.parameters),r=Math.abs(t.width),n=Math.abs((a=t.height)!=null?a:t.width),s=Math.abs((l=t.depth)!=null?l:t.width*.25);return{parameters:Object.assign(t,{width:r,height:n,depth:s})}}static build(i){let{width:e,height:t,depth:r,radialSegments:n,tubularSegments:s,arc:o,cornerRadius:a,cornerSegments:l}=i.parameters,c=pF(e,t,r,e*.5,o,s,0,0,n,a,l);return c.scale(1,t/e,1),Object.assign(c,{userData:xe(se({},i),{type:"TorusGeometry"})})}};function pF(i,e,t,r,n,s,o,a,l,c,h){return[e,t]=[t,e],o=e/2,n/=2*Math.PI,n==1&&(c=0),new jh(!0,i,e,t,r,n,s,o,a,l,c,h)}var C1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s,o;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,tubularSegments:64,radialSegments:32,p:2,q:3},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width),tube:(o=t.tube)!=null?o:t.width*.125})}}static build(i){let{width:e,tube:t,tubularSegments:r,radialSegments:n,p:s,q:o}=i.parameters,a=e*.5;a!==t&&(a-=t);let l=new Ha(a,t,r,n,s,o);return Object.assign(l,{userData:xe(se({},i),{type:"TorusKnotGeometry"})})}};var P1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1,isRect:!1},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e=100,height:t,cornerRadius:r,depth:n,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a}=i.parameters,l=i.shape,c=e*.5,h=t*.5;a?(l.addPoint(l.createPoint(-c,h)),l.addPoint(l.createPoint(c,-h)),l.addPoint(l.createPoint(-c,-h))):(l.addPoint(l.createPoint(0,h)),l.addPoint(l.createPoint(c,-h)),l.addPoint(l.createPoint(-c,-h))),l.isClosed=!0;for(let f=0,d=l.points.length;f<d;f++)l.points[f].roundness=r;l.roundness=r,l.update();let u=Hr.create({shape:l,parameters:{roundness:r,depth:n,extrudeBevelSize:s,extrudeBevelSegments:o}});return Object.assign(u,{userData:xe(se({},i),{type:"TriangleGeometry"})})}};var Xh={};_x(Xh,{addBarycentricAttribute:()=>yF,fixUvs:()=>xF,loadFromUrl:()=>vF,resizeGeometry:()=>gF,roundShapePolygon:()=>mF});var D1=function(i,e){let t=e.x-i.x,r=e.y-i.y,n=Math.sqrt(t*t+r*r),s=t/n,o=r/n,a=Math.atan2(o,s);return{x:t,y:r,len:n,nx:s,ny:o,ang:a}},mF=(i,e,t)=>{let r,n,s,o,a,l,c,h,u,f,d,p,m,g,v=e.length;for(o=e[v-2],i.curves=[],r=1;r<v-1;r++){a=e[r%v],l=e[(r+1)%v];let y=D1(a,o),w=D1(a,l);c=y.nx*w.ny-y.ny*w.nx,h=y.nx*w.nx-y.ny*-w.ny,d=Math.asin(c),u=1,f=!1,h<0?d<0?d=Math.PI+d:(d=Math.PI-d,u=-1,f=!0):d>0&&(u=-1,f=!0),p=d/2,g=Math.abs(Math.cos(p)*t/Math.sin(p)),g>Math.min(y.len/2,w.len/2)?(g=Math.min(y.len/2,w.len/2),m=Math.abs(g*Math.sin(p)/Math.cos(p))):m=t,n=a.x+w.nx*g,s=a.y+w.ny*g,n+=-w.ny*m*u,s+=w.nx*m*u,i.absarc(n,s,m,y.ang+Math.PI/2*u,w.ang-Math.PI/2*u,f),o=a,a=l}i.closePath()},gF=(i,{width:e,height:t,depth:r})=>{e=Math.abs(e),t=Math.abs(t),r=Math.abs(r);let n=i.userData.parameters,s,o,a;e===0?(e=n.width,s=1):s=e/n.width,t===0?(t=n.height,o=1):o=t/n.height,r===0?(r=n.depth,a=1):a=r/n.depth,i.scale(s,o,a),n.width=e,n.height=t,n.depth=r},yF=(i,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],r=i.attributes.position,n=new Float32Array(r.count*3);for(let s=0,o=r.count;s<o;s++)t[s%3].toArray(n,s*3);i.setAttribute(e,new Te(n,3))},vF=i=>new Promise(e=>{new Ws().load(i,r=>e(r))}),xF=(i,e,t)=>{let r=i.getAttribute("uv");if(r)for(let n=0;n<r.count;n++){let s=r.getX(n),o=r.getY(n);r.setXY(n,(s+e/2)/e,1-(o-t/2)/t*-1)}};var bF,bp=new Promise(i=>{bF=i});var Qh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var We=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=et.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,r){return r=r!=null?r:{},this.analyze(e,r),this.flow(e,t,r)}flow(e,t,r){r=r!=null?r:{},e.addFlow(r.slot,r.cache,r.context);let n={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),n}build(e,t,r){t=t!=null?t:this.getType(e,t);let n=e.getNodeData(r!=null?r:this);return e.analyzing&&this.appendDepsNode(e,n,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,r)}updateFrame(e){}generateReadonly(e,t,r,n,s,o){return""}generate(e,t,r,n,s){return""}parse(e,t,r,n){}appendDepsNode(e,t,r){t.deps=(t.deps||0)+1;let n=e.getTypeLength(r);(n>(t.outputMax||0)||this.getType(e,r))&&(t.outputMax=n,t.output=r)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,r;for(t in this)r=this[t],r instanceof We&&(e+='"'+t+'":'+r.getHash()+",");if(this.hashProperties)for(let n=0;n<this.hashProperties.length;n++)t=this.hashProperties[n],r=this[t],e+='"'+t+'":"'+String(r)+'",';return e+='"id":"'+this.uuid+'"}',e}copy(e){return this.name=e.name,e.type&&(this.type=e.type),e.frameId&&(this.frameId=e.frameId),e.hashProperties&&(this.hashProperties=e.hashProperties.map(t=>t)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let r={};return r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=r),r}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var mv=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,r){r=r!==void 0?r:!0,this.keywords[e]={callback:t,cache:r}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},Er=new mv;var Ye=class extends We{constructor(t,r){super(t);this.scope="";r=r!=null?r:{},this.shared=r.shared!==void 0?r.shared:!0,this.unique=r.unique!==void 0?r.unique:!1}build(t,r,n,s){if(r=r!=null?r:this.getType(t),this.getShared(t,r)){let o=this.getUnique(t,r);o&&this.uuid===void 0&&(this.uuid=et.generateUUID()),n=t.getUUID(n!=null?n:this.getUUID(),!o);let a=t.getNodeData(n),l=a.output||this.getType(t);if(t.analyzing)return(a.deps||0)>0||this.getLabel()?(this.appendDepsNode(t,a,r),this.generate(t,r,n)):super.build(t,r,n);if(o)return a.name=a.name||super.build(t,r,n),a.name;if(!this.getLabel()&&(!this.getShared(t,l)||t.context.ignoreCache||a.deps===1))return super.build(t,r,n);n=this.getUUID(!1);let c=this.getTemp(t,n);if(c)return t.format(c,l,r);{c=super.generate(t,r,n,a.output,s);let h=this.generate(t,l,n);return t.addNodeCode(c+" = "+h+";"),t.format(c,l,r)}}return super.build(t,r,n)}getShared(t,r){return r!=="sampler2D"&&r!=="samplerCube"&&this.shared}getUnique(t,r){return this.unique}setLabel(t){return this.label=t,this}getLabel(){return this.label}getUUID(t){let r=this.uuid;return typeof this.scope=="string"&&(r=this.scope+"-"+r),r}getTemp(t,r){r=r||this.uuid;let n=t.getVars()[r];return n?n.name:void 0}generate(t,r,n,s,o){return this.getShared(t,r)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,t.getTempVar(n,s!=null?s:this.getType(t),o,this.getLabel()).name}};var jt=class extends Ye{constructor(t,r){r=r!=null?r:{},r.shared=r.shared!==void 0?r.shared:!1;super(t,r);this.readonly=!1}setReadonly(t){return this.readonly=t,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(t){let r=super.createJSONNode(t);return this.readonly===!0&&(r.readonly=this.readonly),r}fromJSON(t,r){return super.fromJSON(t,r),t.readonly!==void 0&&this.setReadonly(t.readonly),this}generate(t,r,n,s,o,a){n=t.getUUID(n!=null?n:this.getUUID()),s=s!=null?s:this.getType(t);let l=t.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(t,r,n,s,o,a):t.isShader("vertex")?(l.vertex||(l.vertex=t.createVertexUniform(s,this,o,a,this.getLabel())),t.format(l.vertex.name,s,r)):(l.fragment||(l.fragment=t.createFragmentUniform(s,this,o,a,this.getLabel())),t.format(l.fragment.name,s,r))}copy(t){return super.copy(t),this.readonly=t.readonly,this}};var Nr=class extends jt{constructor(t=0,r){super("v2");this.nodeType="Vector2";this.value=t instanceof B?t:new B(t,r)}get x(){return this.value.x}set x(t){this.value.x=t}get y(){return this.value.y}set y(t){this.value.y=t}generateReadonly(t,r,n,s,o,a){return t.format("vec2("+this.value.x+", "+this.value.y+")",s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this}};var Or=class extends jt{constructor(t=0,r,n){super("v3");this.nodeType="Vector3";this.value=t instanceof M?t:new M(t,r,n)}get x(){return this.value.x}set x(t){this.value.x=t}get y(){return this.value.y}set y(t){this.value.y=t}get z(){return this.value.z}set z(t){this.value.z=t}generateReadonly(t,r,n,s,o,a){return t.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this}};var Wr=class extends be{constructor(t,r,n,s){super(t,r,n);this.isColorA=!0;this.a=s}setRGBA(t,r,n,s){super.setRGB(t,r,n),this.a=s}copy(t){return super.copy(t),this.a="a"in t?t.a:1,this}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}get x(){return this.r}get y(){return this.g}get z(){return this.b}get w(){return this.a}set x(t){this.r=t}set y(t){this.g=t}set z(t){this.b=t}set w(t){this.a=t}};var di=class extends jt{constructor(t){super("v4");this.nodeType="Vector4";this.value=t instanceof Wr?t:new Wr(t.r,t.g,t.b,t.a)}generateReadonly(t,r,n,s,o,a){return t.format("vec4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")",s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this}};var wF=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,L1=/[a-z_0-9]+/gi,Ne=class extends Ye{constructor(t,r,n,s,o){super(o);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=o===void 0,this.isInterface=!1,this.parse(t,r,n,s)}getShared(t,r){return!this.isMethod}getType(t){return t.getTypeByFormat(this.type)}getInputByName(t){if(this.inputs){let r=this.inputs.length;for(;r--;)if(this.inputs[r].name===t)return this.inputs[r]}}getIncludeByName(t){if(this.includes){let r=this.includes.length;for(;r--;)if(this.includes[r].name===t)return this.includes[r]}}generate(t,r,n,s,o){let a,l=0,c=this.src;if(this.includes)for(let u=0;u<this.includes.length;u++)t.include(this.includes[u],this);for(let u in this.extensions)t.extensions[u]=!0;let h=[];for(;a=L1.exec(this.src);)h.push(a);for(let u=0;u<h.length;u++){let f=h[u],d=f[0],p=this.isMethod?!this.getInputByName(d):!0,m=d;if(this.keywords[d]||this.useKeywords&&p&&Er.containsKeyword(d)){let g=this.keywords[d];if(!g){let v=Er.getKeywordData(d);v.cache&&(g=t.keywords[d]),g=g||Er.getKeyword(d,t),v.cache&&(t.keywords[d]=g)}m=g.build(t)}d!==m&&(c=c.substring(0,f.index+l)+m+c.substring(f.index+d.length+l),l+=m.length-d.length),this.getIncludeByName(m)===void 0&&Er.contains(m)&&t.include(Er.get(m))}return r==="source"?c:this.isMethod?(this.isInterface||t.include(this,void 0,c),this.name):t.format("( "+c+" )",this.getType(t),r)}parse(t,r,n,s){if(this.src=t||"",this.includes=r!=null?r:[],this.extensions=n!=null?n:{},this.keywords=s!=null?s:{},this.isMethod){let o=wF.exec(this.src);if(this.inputs=[],o&&o.length==4){this.type=o[1],this.name=o[2];let a=o[3].match(L1);if(a){let l=0;for(;l<a.length;){let c=a[l++],h;c==="in"||c==="out"||c==="inout"?h=a[l++]:(h=c,c="");let u=a[l++];this.inputs.push({name:u,type:h,qualifier:c})}}this.isInterface=this.src.indexOf("{")===-1}else this.type="",this.name=""}}copy(t){return super.copy(t),this.isMethod=t.isMethod,this.useKeywords=t.useKeywords,t.type!==void 0&&(this.type=t.type),this.parse(t.src,t.includes,t.extensions,t.keywords),this}toJSON(t){var n;let r=this.getJSONNode(t);if(!r){r=this.createJSONNode(t),r.src=this.src,r.isMethod=this.isMethod,r.useKeywords=this.useKeywords,this.isMethod||(r.type=this.type),r.extensions=JSON.parse(JSON.stringify(this.extensions));let s={};for(let o in this.keywords)s[o]=this.keywords[o].toJSON(t).uuid;if(r.keywords=s,(n=this.includes)!=null&&n.length){let o=[];for(let a=0;a<this.includes.length;a++)o.push(this.includes[a].toJSON(t).uuid);r.includes=o}r.isMethod=this.isMethod,r.inputs=this.inputs}return r.nodeType=this.nodeType,r}fromJSON(t,r){if(super.fromJSON(t,r),t.inputs!==void 0&&(this.inputs=t.inputs),t.isMethod!==void 0&&(this.isMethod=t.isMethod),t.src&&(this.src=t.src),t.isMethod&&(this.isMethod=t.isMethod),t.useKeywords&&(this.useKeywords=t.useKeywords),t.type&&(this.type=t.type),t.extensions&&(this.extensions=t.extensions),t.keywords&&r){this.keywords={};for(let n in t.keywords)this.keywords[n]=r.getNode(t.keywords[n])}return t.includes&&r&&(this.includes=t.includes.map(n=>r.getNode(n))),this}};var SF=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,gv=class extends Ye{constructor(t="",r){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(t||gv.PI,void 0,void 0,void 0,r)}getType(t){return t.getTypeByFormat(this.type)}parse(t,r,n,s,o){this.src=t||"";let a,l,c="",h=SF.exec(t);this.useDefine=o!=null?o:this.src.charAt(0)==="#",h&&h.length>1?(l=h[1],a=h[2],c=h[3]):(a=this.src,l="f"),this.name=a,this.type=l,this.value=c}build(t,r){if(r==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return t.include(this),t.format(this.name,this.getType(t),r)}generate(t,r,n,s,o){return t.format(this.name,this.getType(t),r)}copy(t){return super.copy(t),this.parse(t.src,void 0,void 0,void 0,t.useDefine),this}},wt=gv;wt.PI="PI",wt.PI2="PI2",wt.RECIPROCAL_PI="RECIPROCAL_PI",wt.RECIPROCAL_PI2="RECIPROCAL_PI2",wt.LOG2="LOG2",wt.EPSILON="EPSILON";var MF=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.|
|
|
2987
|
-
)*?)}`,"gim"),
|
|
2986
|
+
}`;function Cb(i,e,t){let r=new Na,n=new B,s=new B,o=new Je,a=new Jc({depthPacking:F_}),l=new Kc,c={},h=t.maxTextureSize,u={0:Dr,1:si,2:or},f=new Mt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new B},radius:{value:4}},vertexShader:CL,fragmentShader:PL}),d=f.clone();d.defines.HORIZONTAL_PASS=1;let p=new De;p.setAttribute("position",new Ve(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new Vt(p,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fb,this.render=function(b,S,T){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||b.length===0)return;let A=i.getRenderTarget(),x=i.getActiveCubeFace(),_=i.getActiveMipmapLevel(),E=i.state;E.setBlending(Ht),E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);for(let C=0,I=b.length;C<I;C++){let N=b[C],R=N.shadow;if(R===void 0){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(R.autoUpdate===!1&&R.needsUpdate===!1)continue;n.copy(R.mapSize);let k=R.getFrameExtents();if(n.multiply(k),s.copy(R.mapSize),(n.x>h||n.y>h)&&(n.x>h&&(s.x=Math.floor(h/k.x),n.x=s.x*k.x,R.mapSize.x=s.x),n.y>h&&(s.y=Math.floor(h/k.y),n.y=s.y*k.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Nc&&(R.map=new mt(n.x,n.y),R.map.texture.name=N.name+".shadowMap",R.mapPass=new mt(n.x,n.y),R.camera.updateProjectionMatrix()),R.map===null){let K={minFilter:hr,magFilter:hr,format:Fn};R.map=new mt(n.x,n.y,K),R.map.texture.name=N.name+".shadowMap",R.camera.updateProjectionMatrix()}i.setRenderTarget(R.map),i.clear();let G=R.getViewportCount();for(let K=0;K<G;K++){let J=R.getViewport(K);o.set(s.x*J.x,s.y*J.y,s.x*J.z,s.y*J.w),E.viewport(o),R.updateMatrices(N,K),r=R.getFrustum(),w(S,T,R.camera,N,this.type)}!R.isPointLightShadow&&this.type===Nc&&v(R,T),R.needsUpdate=!1}g.needsUpdate=!1,i.setRenderTarget(A,x,_)};function v(b,S){let T=e.update(m);f.defines.VSM_SAMPLES!==b.blurSamples&&(f.defines.VSM_SAMPLES=b.blurSamples,d.defines.VSM_SAMPLES=b.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),f.uniforms.shadow_pass.value=b.map.texture,f.uniforms.resolution.value=b.mapSize,f.uniforms.radius.value=b.radius,i.setRenderTarget(b.mapPass),i.clear(),i.renderBufferDirect(S,null,T,f,m,null),d.uniforms.shadow_pass.value=b.mapPass.texture,d.uniforms.resolution.value=b.mapSize,d.uniforms.radius.value=b.radius,i.setRenderTarget(b.map),i.clear(),i.renderBufferDirect(S,null,T,d,m,null)}function y(b,S,T,A,x,_){let E=null,C=T.isPointLight===!0?b.customDistanceMaterial:b.customDepthMaterial;if(C!==void 0?E=C:E=T.isPointLight===!0?l:a,i.localClippingEnabled&&S.clipShadows===!0&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0){let I=E.uuid,N=S.uuid,R=c[I];R===void 0&&(R={},c[I]=R);let k=R[N];k===void 0&&(k=E.clone(),R[N]=k),E=k}return E.visible=S.visible,E.wireframe=S.wireframe,_===Nc?E.side=S.shadowSide!==null?S.shadowSide:S.side:E.side=S.shadowSide!==null?S.shadowSide:u[S.side],E.alphaMap=S.alphaMap,E.alphaTest=S.alphaTest,E.clipShadows=S.clipShadows,E.clippingPlanes=S.clippingPlanes,E.clipIntersection=S.clipIntersection,E.displacementMap=S.displacementMap,E.displacementScale=S.displacementScale,E.displacementBias=S.displacementBias,E.wireframeLinewidth=S.wireframeLinewidth,E.linewidth=S.linewidth,T.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(T.matrixWorld),E.nearDistance=A,E.farDistance=x),E}function w(b,S,T,A,x){if(b.visible===!1)return;if(b.layers.test(S.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&x===Nc)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,b.matrixWorld);let C=e.update(b),I=b.material;if(Array.isArray(I)){let N=C.groups;for(let R=0,k=N.length;R<k;R++){let G=N[R],K=I[G.materialIndex];if(K&&K.visible){let J=y(b,K,A,T.near,T.far,x);i.renderBufferDirect(T,null,C,J,b,G)}}}else if(I.visible){let N=y(b,I,A,T.near,T.far,x);i.renderBufferDirect(T,null,C,N,b,null)}}let E=b.children;for(let C=0,I=E.length;C<I;C++)w(E[C],S,T,A,x)}}function DL(i,e,t){let r=t.isWebGL2;function n(){let z=!1,Me=new Je,Pe=null,Ze=new Je(0,0,0,0);return{setMask:function(Oe){Pe!==Oe&&!z&&(i.colorMask(Oe,Oe,Oe,Oe),Pe=Oe)},setLocked:function(Oe){z=Oe},setClear:function(Oe,Qe,_e,$e,lt){lt===!0&&(Oe*=$e,Qe*=$e,_e*=$e),Me.set(Oe,Qe,_e,$e),Ze.equals(Me)===!1&&(i.clearColor(Oe,Qe,_e,$e),Ze.copy(Me))},reset:function(){z=!1,Pe=null,Ze.set(-1,0,0,0)}}}function s(){let z=!1,Me=null,Pe=null,Ze=null;return{setTest:function(Oe){Oe?X(2929):V(2929)},setMask:function(Oe){Me!==Oe&&!z&&(i.depthMask(Oe),Me=Oe)},setFunc:function(Oe){if(Pe!==Oe){if(Oe)switch(Oe){case i_:i.depthFunc(512);break;case s_:i.depthFunc(519);break;case o_:i.depthFunc(513);break;case tg:i.depthFunc(515);break;case a_:i.depthFunc(514);break;case l_:i.depthFunc(518);break;case c_:i.depthFunc(516);break;case h_:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Pe=Oe}},setLocked:function(Oe){z=Oe},setClear:function(Oe){Ze!==Oe&&(i.clearDepth(Oe),Ze=Oe)},reset:function(){z=!1,Me=null,Pe=null,Ze=null}}}function o(){let z=!1,Me=null,Pe=null,Ze=null,Oe=null,Qe=null,_e=null,$e=null,lt=null;return{setTest:function(dt){z||(dt?X(2960):V(2960))},setMask:function(dt){Me!==dt&&!z&&(i.stencilMask(dt),Me=dt)},setFunc:function(dt,Ut,Ur){(Pe!==dt||Ze!==Ut||Oe!==Ur)&&(i.stencilFunc(dt,Ut,Ur),Pe=dt,Ze=Ut,Oe=Ur)},setOp:function(dt,Ut,Ur){(Qe!==dt||_e!==Ut||$e!==Ur)&&(i.stencilOp(dt,Ut,Ur),Qe=dt,_e=Ut,$e=Ur)},setLocked:function(dt){z=dt},setClear:function(dt){lt!==dt&&(i.clearStencil(dt),lt=dt)},reset:function(){z=!1,Me=null,Pe=null,Ze=null,Oe=null,Qe=null,_e=null,$e=null,lt=null}}}let a=new n,l=new s,c=new o,h={},u={},f=new WeakMap,d=[],p=null,m=!1,g=null,v=null,y=null,w=null,b=null,S=null,T=null,A=!1,x=null,_=null,E=null,C=null,I=null,N=i.getParameter(35661),R=!1,k=0,G=i.getParameter(7938);G.indexOf("WebGL")!==-1?(k=parseFloat(/^WebGL (\d)/.exec(G)[1]),R=k>=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),R=k>=2);let K=null,J={},Y=i.getParameter(3088),F=i.getParameter(2978),U=new Je().fromArray(Y),O=new Je().fromArray(F);function j(z,Me,Pe){let Ze=new Uint8Array(4),Oe=i.createTexture();i.bindTexture(z,Oe),i.texParameteri(z,10241,9728),i.texParameteri(z,10240,9728);for(let Qe=0;Qe<Pe;Qe++)i.texImage2D(Me+Qe,0,6408,1,1,0,6408,5121,Ze);return Oe}let H={};H[3553]=j(3553,3553,1),H[34067]=j(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),X(2929),l.setFunc(tg),$(!1),ce(Ex),X(2884),Z(Ht);function X(z){h[z]!==!0&&(i.enable(z),h[z]=!0)}function V(z){h[z]!==!1&&(i.disable(z),h[z]=!1)}function he(z,Me){return u[z]!==Me?(i.bindFramebuffer(z,Me),u[z]=Me,r&&(z===36009&&(u[36160]=Me),z===36160&&(u[36009]=Me)),!0):!1}function ie(z,Me){let Pe=d,Ze=!1;if(z)if(Pe=f.get(Me),Pe===void 0&&(Pe=[],f.set(Me,Pe)),z.isWebGLMultipleRenderTargets){let Oe=z.texture;if(Pe.length!==Oe.length||Pe[0]!==36064){for(let Qe=0,_e=Oe.length;Qe<_e;Qe++)Pe[Qe]=36064+Qe;Pe.length=Oe.length,Ze=!0}}else Pe[0]!==36064&&(Pe[0]=36064,Ze=!0);else Pe[0]!==1029&&(Pe[0]=1029,Ze=!0);Ze&&(t.isWebGL2?i.drawBuffers(Pe):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(Pe))}function le(z){return p!==z?(i.useProgram(z),p=z,!0):!1}let q={[_a]:32774,[YT]:32778,[XT]:32779};if(r)q[Lx]=32775,q[Ix]=32776;else{let z=e.get("EXT_blend_minmax");z!==null&&(q[Lx]=z.MIN_EXT,q[Ix]=z.MAX_EXT)}let ue={[QT]:0,[JT]:1,[KT]:768,[pb]:770,[n_]:776,[t_]:774,[$T]:772,[ZT]:769,[mb]:771,[r_]:775,[e_]:773};function Z(z,Me,Pe,Ze,Oe,Qe,_e,$e){if(z===Ht){m===!0&&(V(3042),m=!1);return}if(m===!1&&(X(3042),m=!0),z!==qT){if(z!==g||$e!==A){if((v!==_a||b!==_a)&&(i.blendEquation(32774),v=_a,b=_a),$e)switch(z){case Ds:i.blendFuncSeparate(1,771,1,771);break;case Cx:i.blendFunc(1,1);break;case Px:i.blendFuncSeparate(0,769,0,1);break;case Dx:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}else switch(z){case Ds:i.blendFuncSeparate(770,771,1,771);break;case Cx:i.blendFunc(770,1);break;case Px:i.blendFuncSeparate(0,769,0,1);break;case Dx:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}y=null,w=null,S=null,T=null,g=z,A=$e}return}Oe=Oe||Me,Qe=Qe||Pe,_e=_e||Ze,(Me!==v||Oe!==b)&&(i.blendEquationSeparate(q[Me],q[Oe]),v=Me,b=Oe),(Pe!==y||Ze!==w||Qe!==S||_e!==T)&&(i.blendFuncSeparate(ue[Pe],ue[Ze],ue[Qe],ue[_e]),y=Pe,w=Ze,S=Qe,T=_e),g=z,A=null}function W(z,Me){z.side===or?V(2884):X(2884);let Pe=z.side===Dr;Me&&(Pe=!Pe),$(Pe),z.blending===Ds&&z.transparent===!1?Z(Ht):Z(z.blending,z.blendEquation,z.blendSrc,z.blendDst,z.blendEquationAlpha,z.blendSrcAlpha,z.blendDstAlpha,z.premultipliedAlpha),l.setFunc(z.depthFunc),l.setTest(z.depthTest),l.setMask(z.depthWrite),a.setMask(z.colorWrite);let Ze=z.stencilWrite;c.setTest(Ze),Ze&&(c.setMask(z.stencilWriteMask),c.setFunc(z.stencilFunc,z.stencilRef,z.stencilFuncMask),c.setOp(z.stencilFail,z.stencilZFail,z.stencilZPass)),me(z.polygonOffset,z.polygonOffsetFactor,z.polygonOffsetUnits),z.alphaToCoverage===!0?X(32926):V(32926)}function $(z){x!==z&&(z?i.frontFace(2304):i.frontFace(2305),x=z)}function ce(z){z!==WT?(X(2884),z!==_&&(z===Ex?i.cullFace(1029):z===jT?i.cullFace(1028):i.cullFace(1032))):V(2884),_=z}function oe(z){z!==E&&(R&&i.lineWidth(z),E=z)}function me(z,Me,Pe){z?(X(32823),(C!==Me||I!==Pe)&&(i.polygonOffset(Me,Pe),C=Me,I=Pe)):V(32823)}function ve(z){z?X(3089):V(3089)}function ge(z){z===void 0&&(z=33984+N-1),K!==z&&(i.activeTexture(z),K=z)}function Le(z,Me){K===null&&ge();let Pe=J[K];Pe===void 0&&(Pe={type:void 0,texture:void 0},J[K]=Pe),(Pe.type!==z||Pe.texture!==Me)&&(i.bindTexture(z,Me||H[z]),Pe.type=z,Pe.texture=Me)}function ke(){let z=J[K];z!==void 0&&z.type!==void 0&&(i.bindTexture(z.type,null),z.type=void 0,z.texture=void 0)}function L(){try{i.compressedTexImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function P(){try{i.texSubImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function re(){try{i.texSubImage3D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function ye(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Se(){try{i.texStorage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Ie(){try{i.texStorage3D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Fe(){try{i.texImage2D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function fe(){try{i.texImage3D.apply(i,arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function rt(z){U.equals(z)===!1&&(i.scissor(z.x,z.y,z.z,z.w),U.copy(z))}function st(z){O.equals(z)===!1&&(i.viewport(z.x,z.y,z.z,z.w),O.copy(z))}function Ee(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),r===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),h={},K=null,J={},u={},f=new WeakMap,d=[],p=null,m=!1,g=null,v=null,y=null,w=null,b=null,S=null,T=null,A=!1,x=null,_=null,E=null,C=null,I=null,U.set(0,0,i.canvas.width,i.canvas.height),O.set(0,0,i.canvas.width,i.canvas.height),a.reset(),l.reset(),c.reset()}return{buffers:{color:a,depth:l,stencil:c},enable:X,disable:V,bindFramebuffer:he,drawBuffers:ie,useProgram:le,setBlending:Z,setMaterial:W,setFlipSided:$,setCullFace:ce,setLineWidth:oe,setPolygonOffset:me,setScissorTest:ve,activeTexture:ge,bindTexture:Le,unbindTexture:ke,compressedTexImage2D:L,texImage2D:Fe,texImage3D:fe,texStorage2D:Se,texStorage3D:Ie,texSubImage2D:P,texSubImage3D:re,compressedTexSubImage2D:ye,scissor:rt,viewport:st,reset:Ee}}function LL(i,e,t,r,n,s,o){let a=n.isWebGL2,l=n.maxTextures,c=n.maxCubemapSize,h=n.maxTextureSize,u=n.maxSamples,f=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap,m,g=new WeakMap,v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(L,P){return v?new OffscreenCanvas(L,P):qc("canvas")}function w(L,P,re,ye){let Se=1;if((L.width>ye||L.height>ye)&&(Se=ye/Math.max(L.width,L.height)),Se<1||P===!0)if(typeof HTMLImageElement<"u"&&L instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&L instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&L instanceof ImageBitmap){let Ie=P?pf:Math.floor,Fe=Ie(Se*L.width),fe=Ie(Se*L.height);m===void 0&&(m=y(Fe,fe));let rt=re?y(Fe,fe):m;return rt.width=Fe,rt.height=fe,rt.getContext("2d").drawImage(L,0,0,Fe,fe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+L.width+"x"+L.height+") to ("+Fe+"x"+fe+")."),rt}else return"data"in L&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+L.width+"x"+L.height+")."),L;return L}function b(L){return og(L.width)&&og(L.height)}function S(L){return a?!1:L.wrapS!==Pr||L.wrapT!==Pr||L.minFilter!==hr&&L.minFilter!==ct}function T(L,P){return L.generateMipmaps&&P&&L.minFilter!==hr&&L.minFilter!==ct}function A(L){i.generateMipmap(L)}function x(L,P,re,ye,Se=!1){if(a===!1)return P;if(L!==null){if(i[L]!==void 0)return i[L];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+L+"'")}let Ie=P;return P===6403&&(re===5126&&(Ie=33326),re===5131&&(Ie=33325),re===5121&&(Ie=33321)),P===33319&&(re===5126&&(Ie=33328),re===5131&&(Ie=33327),re===5121&&(Ie=33323)),P===6408&&(re===5126&&(Ie=34836),re===5131&&(Ie=34842),re===5121&&(Ie=ye===je&&Se===!1?35907:32856),re===32819&&(Ie=32854),re===32820&&(Ie=32855)),(Ie===33325||Ie===33326||Ie===33327||Ie===33328||Ie===34842||Ie===34836)&&e.get("EXT_color_buffer_float"),Ie}function _(L,P,re){return T(L,re)===!0||L.isFramebufferTexture&&L.minFilter!==hr&&L.minFilter!==ct?Math.log2(Math.max(P.width,P.height))+1:L.mipmaps!==void 0&&L.mipmaps.length>0?L.mipmaps.length:L.isCompressedTexture&&Array.isArray(L.image)?P.mipmaps.length:1}function E(L){return L===hr||L===Rx||L===Bx?9728:9729}function C(L){let P=L.target;P.removeEventListener("dispose",C),N(P),P.isVideoTexture&&p.delete(P)}function I(L){let P=L.target;P.removeEventListener("dispose",I),k(P)}function N(L){let P=r.get(L);if(P.__webglInit===void 0)return;let re=L.source,ye=g.get(re);if(ye){let Se=ye[P.__cacheKey];Se.usedTimes--,Se.usedTimes===0&&R(L),Object.keys(ye).length===0&&g.delete(re)}r.remove(L)}function R(L){let P=r.get(L);i.deleteTexture(P.__webglTexture);let re=L.source,ye=g.get(re);delete ye[P.__cacheKey],o.memory.textures--}function k(L){let P=L.texture,re=r.get(L),ye=r.get(P);if(ye.__webglTexture!==void 0&&(i.deleteTexture(ye.__webglTexture),o.memory.textures--),L.depthTexture&&L.depthTexture.dispose(),L.isWebGLCubeRenderTarget)for(let Se=0;Se<6;Se++)i.deleteFramebuffer(re.__webglFramebuffer[Se]),re.__webglDepthbuffer&&i.deleteRenderbuffer(re.__webglDepthbuffer[Se]);else i.deleteFramebuffer(re.__webglFramebuffer),re.__webglDepthbuffer&&i.deleteRenderbuffer(re.__webglDepthbuffer),re.__webglMultisampledFramebuffer&&i.deleteFramebuffer(re.__webglMultisampledFramebuffer),re.__webglColorRenderbuffer&&i.deleteRenderbuffer(re.__webglColorRenderbuffer),re.__webglDepthRenderbuffer&&i.deleteRenderbuffer(re.__webglDepthRenderbuffer);if(L.isWebGLMultipleRenderTargets)for(let Se=0,Ie=P.length;Se<Ie;Se++){let Fe=r.get(P[Se]);Fe.__webglTexture&&(i.deleteTexture(Fe.__webglTexture),o.memory.textures--),r.remove(P[Se])}r.remove(P),r.remove(L)}let G=0;function K(){G=0}function J(){let L=G;return L>=l&&console.warn("THREE.WebGLTextures: Trying to use "+L+" texture units while this GPU supports only "+l),G+=1,L}function Y(L){let P=[];return P.push(L.wrapS),P.push(L.wrapT),P.push(L.magFilter),P.push(L.minFilter),P.push(L.anisotropy),P.push(L.internalFormat),P.push(L.format),P.push(L.type),P.push(L.generateMipmaps),P.push(L.premultiplyAlpha),P.push(L.flipY),P.push(L.unpackAlignment),P.push(L.encoding),P.join()}function F(L,P){let re=r.get(L);if(L.isVideoTexture&&Le(L),L.isRenderTargetTexture===!1&&L.version>0&&re.__version!==L.version){let ye=L.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ie(re,L,P);return}}t.activeTexture(33984+P),t.bindTexture(3553,re.__webglTexture)}function U(L,P){let re=r.get(L);if(L.version>0&&re.__version!==L.version){ie(re,L,P);return}t.activeTexture(33984+P),t.bindTexture(35866,re.__webglTexture)}function O(L,P){let re=r.get(L);if(L.version>0&&re.__version!==L.version){ie(re,L,P);return}t.activeTexture(33984+P),t.bindTexture(32879,re.__webglTexture)}function j(L,P){let re=r.get(L);if(L.version>0&&re.__version!==L.version){le(re,L,P);return}t.activeTexture(33984+P),t.bindTexture(34067,re.__webglTexture)}let H={[Ia]:10497,[Pr]:33071,[ig]:33648},X={[hr]:9728,[Rx]:9984,[Bx]:9986,[ct]:9729,[v_]:9985,[js]:9987};function V(L,P,re){if(re?(i.texParameteri(L,10242,H[P.wrapS]),i.texParameteri(L,10243,H[P.wrapT]),(L===32879||L===35866)&&i.texParameteri(L,32882,H[P.wrapR]),i.texParameteri(L,10240,X[P.magFilter]),i.texParameteri(L,10241,X[P.minFilter])):(i.texParameteri(L,10242,33071),i.texParameteri(L,10243,33071),(L===32879||L===35866)&&i.texParameteri(L,32882,33071),(P.wrapS!==Pr||P.wrapT!==Pr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(L,10240,E(P.magFilter)),i.texParameteri(L,10241,E(P.minFilter)),P.minFilter!==hr&&P.minFilter!==ct&&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){let ye=e.get("EXT_texture_filter_anisotropic");if(P.type===Ps&&e.has("OES_texture_float_linear")===!1||a===!1&&P.type===Hc&&e.has("OES_texture_half_float_linear")===!1)return;(P.anisotropy>1||r.get(P).__currentAnisotropy)&&(i.texParameterf(L,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,n.getMaxAnisotropy())),r.get(P).__currentAnisotropy=P.anisotropy)}}function he(L,P){let re=!1;L.__webglInit===void 0&&(L.__webglInit=!0,P.addEventListener("dispose",C));let ye=P.source,Se=g.get(ye);Se===void 0&&(Se={},g.set(ye,Se));let Ie=Y(P);if(Ie!==L.__cacheKey){Se[Ie]===void 0&&(Se[Ie]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,re=!0),Se[Ie].usedTimes++;let Fe=Se[L.__cacheKey];Fe!==void 0&&(Se[L.__cacheKey].usedTimes--,Fe.usedTimes===0&&R(P)),L.__cacheKey=Ie,L.__webglTexture=Se[Ie].texture}return re}function ie(L,P,re){let ye=3553;P.isDataArrayTexture&&(ye=35866),P.isData3DTexture&&(ye=32879);let Se=he(L,P),Ie=P.source;if(t.activeTexture(33984+re),t.bindTexture(ye,L.__webglTexture),Ie.version!==Ie.__currentVersion||Se===!0){i.pixelStorei(37440,P.flipY),i.pixelStorei(37441,P.premultiplyAlpha),i.pixelStorei(3317,P.unpackAlignment),i.pixelStorei(37443,0);let Fe=S(P)&&b(P.image)===!1,fe=w(P.image,Fe,!1,h);fe=ke(P,fe);let rt=b(fe)||a,st=s.convert(P.format,P.encoding),Ee=s.convert(P.type),z=x(P.internalFormat,st,Ee,P.encoding,P.isVideoTexture);V(ye,P,rt);let Me,Pe=P.mipmaps,Ze=a&&P.isVideoTexture!==!0,Oe=L.__version===void 0||Se===!0,Qe=_(P,fe,rt);if(P.isDepthTexture)z=6402,a?P.type===Ps?z=36012:P.type===La?z=33190:P.type===Ls?z=35056:z=33189:P.type===Ps&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),P.format===_o&&z===6402&&P.type!==Vc&&P.type!==La&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),P.type=Vc,Ee=s.convert(P.type)),P.format===Ns&&z===6402&&(z=34041,P.type!==Ls&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),P.type=Ls,Ee=s.convert(P.type))),Oe&&(Ze?t.texStorage2D(3553,1,z,fe.width,fe.height):t.texImage2D(3553,0,z,fe.width,fe.height,0,st,Ee,null));else if(P.isDataTexture)if(Pe.length>0&&rt){Ze&&Oe&&t.texStorage2D(3553,Qe,z,Pe[0].width,Pe[0].height);for(let _e=0,$e=Pe.length;_e<$e;_e++)Me=Pe[_e],Ze?t.texSubImage2D(3553,_e,0,0,Me.width,Me.height,st,Ee,Me.data):t.texImage2D(3553,_e,z,Me.width,Me.height,0,st,Ee,Me.data);P.generateMipmaps=!1}else Ze?(Oe&&t.texStorage2D(3553,Qe,z,fe.width,fe.height),t.texSubImage2D(3553,0,0,0,fe.width,fe.height,st,Ee,fe.data)):t.texImage2D(3553,0,z,fe.width,fe.height,0,st,Ee,fe.data);else if(P.isCompressedTexture){Ze&&Oe&&t.texStorage2D(3553,Qe,z,Pe[0].width,Pe[0].height);for(let _e=0,$e=Pe.length;_e<$e;_e++)Me=Pe[_e],P.format!==Fn?st!==null?Ze?t.compressedTexSubImage2D(3553,_e,0,0,Me.width,Me.height,st,Me.data):t.compressedTexImage2D(3553,_e,z,Me.width,Me.height,0,Me.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ze?t.texSubImage2D(3553,_e,0,0,Me.width,Me.height,st,Ee,Me.data):t.texImage2D(3553,_e,z,Me.width,Me.height,0,st,Ee,Me.data)}else if(P.isDataArrayTexture)Ze?(Oe&&t.texStorage3D(35866,Qe,z,fe.width,fe.height,fe.depth),t.texSubImage3D(35866,0,0,0,0,fe.width,fe.height,fe.depth,st,Ee,fe.data)):t.texImage3D(35866,0,z,fe.width,fe.height,fe.depth,0,st,Ee,fe.data);else if(P.isData3DTexture)Ze?(Oe&&t.texStorage3D(32879,Qe,z,fe.width,fe.height,fe.depth),t.texSubImage3D(32879,0,0,0,0,fe.width,fe.height,fe.depth,st,Ee,fe.data)):t.texImage3D(32879,0,z,fe.width,fe.height,fe.depth,0,st,Ee,fe.data);else if(P.isFramebufferTexture){if(Oe)if(Ze)t.texStorage2D(3553,Qe,z,fe.width,fe.height);else{let _e=fe.width,$e=fe.height;for(let lt=0;lt<Qe;lt++)t.texImage2D(3553,lt,z,_e,$e,0,st,Ee,null),_e>>=1,$e>>=1}}else if(Pe.length>0&&rt){Ze&&Oe&&t.texStorage2D(3553,Qe,z,Pe[0].width,Pe[0].height);for(let _e=0,$e=Pe.length;_e<$e;_e++)Me=Pe[_e],Ze?t.texSubImage2D(3553,_e,0,0,st,Ee,Me):t.texImage2D(3553,_e,z,st,Ee,Me);P.generateMipmaps=!1}else Ze?(Oe&&t.texStorage2D(3553,Qe,z,fe.width,fe.height),t.texSubImage2D(3553,0,0,0,st,Ee,fe)):t.texImage2D(3553,0,z,st,Ee,fe);T(P,rt)&&A(ye),Ie.__currentVersion=Ie.version,P.onUpdate&&P.onUpdate(P)}L.__version=P.version}function le(L,P,re){if(P.image.length!==6)return;let ye=he(L,P),Se=P.source;if(t.activeTexture(33984+re),t.bindTexture(34067,L.__webglTexture),Se.version!==Se.__currentVersion||ye===!0){i.pixelStorei(37440,P.flipY),i.pixelStorei(37441,P.premultiplyAlpha),i.pixelStorei(3317,P.unpackAlignment),i.pixelStorei(37443,0);let Ie=P.isCompressedTexture||P.image[0].isCompressedTexture,Fe=P.image[0]&&P.image[0].isDataTexture,fe=[];for(let _e=0;_e<6;_e++)!Ie&&!Fe?fe[_e]=w(P.image[_e],!1,!0,c):fe[_e]=Fe?P.image[_e].image:P.image[_e],fe[_e]=ke(P,fe[_e]);let rt=fe[0],st=b(rt)||a,Ee=s.convert(P.format,P.encoding),z=s.convert(P.type),Me=x(P.internalFormat,Ee,z,P.encoding),Pe=a&&P.isVideoTexture!==!0,Ze=L.__version===void 0,Oe=_(P,rt,st);V(34067,P,st);let Qe;if(Ie){Pe&&Ze&&t.texStorage2D(34067,Oe,Me,rt.width,rt.height);for(let _e=0;_e<6;_e++){Qe=fe[_e].mipmaps;for(let $e=0;$e<Qe.length;$e++){let lt=Qe[$e];P.format!==Fn?Ee!==null?Pe?t.compressedTexSubImage2D(34069+_e,$e,0,0,lt.width,lt.height,Ee,lt.data):t.compressedTexImage2D(34069+_e,$e,Me,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Pe?t.texSubImage2D(34069+_e,$e,0,0,lt.width,lt.height,Ee,z,lt.data):t.texImage2D(34069+_e,$e,Me,lt.width,lt.height,0,Ee,z,lt.data)}}}else{Qe=P.mipmaps,Pe&&Ze&&(Qe.length>0&&Oe++,t.texStorage2D(34067,Oe,Me,fe[0].width,fe[0].height));for(let _e=0;_e<6;_e++)if(Fe){Pe?t.texSubImage2D(34069+_e,0,0,0,fe[_e].width,fe[_e].height,Ee,z,fe[_e].data):t.texImage2D(34069+_e,0,Me,fe[_e].width,fe[_e].height,0,Ee,z,fe[_e].data);for(let $e=0;$e<Qe.length;$e++){let dt=Qe[$e].image[_e].image;Pe?t.texSubImage2D(34069+_e,$e+1,0,0,dt.width,dt.height,Ee,z,dt.data):t.texImage2D(34069+_e,$e+1,Me,dt.width,dt.height,0,Ee,z,dt.data)}}else{Pe?t.texSubImage2D(34069+_e,0,0,0,Ee,z,fe[_e]):t.texImage2D(34069+_e,0,Me,Ee,z,fe[_e]);for(let $e=0;$e<Qe.length;$e++){let lt=Qe[$e];Pe?t.texSubImage2D(34069+_e,$e+1,0,0,Ee,z,lt.image[_e]):t.texImage2D(34069+_e,$e+1,Me,Ee,z,lt.image[_e])}}}T(P,st)&&A(34067),Se.__currentVersion=Se.version,P.onUpdate&&P.onUpdate(P)}L.__version=P.version}function q(L,P,re,ye,Se){let Ie=s.convert(re.format,re.encoding),Fe=s.convert(re.type),fe=x(re.internalFormat,Ie,Fe,re.encoding);r.get(P).__hasExternalTextures||(Se===32879||Se===35866?t.texImage3D(Se,0,fe,P.width,P.height,P.depth,0,Ie,Fe,null):t.texImage2D(Se,0,fe,P.width,P.height,0,Ie,Fe,null)),t.bindFramebuffer(36160,L),ge(P)?f.framebufferTexture2DMultisampleEXT(36160,ye,Se,r.get(re).__webglTexture,0,ve(P)):i.framebufferTexture2D(36160,ye,Se,r.get(re).__webglTexture,0),t.bindFramebuffer(36160,null)}function ue(L,P,re){if(i.bindRenderbuffer(36161,L),P.depthBuffer&&!P.stencilBuffer){let ye=33189;if(re||ge(P)){let Se=P.depthTexture;Se&&Se.isDepthTexture&&(Se.type===Ps?ye=36012:Se.type===La&&(ye=33190));let Ie=ve(P);ge(P)?f.renderbufferStorageMultisampleEXT(36161,Ie,ye,P.width,P.height):i.renderbufferStorageMultisample(36161,Ie,ye,P.width,P.height)}else i.renderbufferStorage(36161,ye,P.width,P.height);i.framebufferRenderbuffer(36160,36096,36161,L)}else if(P.depthBuffer&&P.stencilBuffer){let ye=ve(P);re&&ge(P)===!1?i.renderbufferStorageMultisample(36161,ye,35056,P.width,P.height):ge(P)?f.renderbufferStorageMultisampleEXT(36161,ye,35056,P.width,P.height):i.renderbufferStorage(36161,34041,P.width,P.height),i.framebufferRenderbuffer(36160,33306,36161,L)}else{let ye=P.isWebGLMultipleRenderTargets===!0?P.texture[0]:P.texture,Se=s.convert(ye.format,ye.encoding),Ie=s.convert(ye.type),Fe=x(ye.internalFormat,Se,Ie,ye.encoding),fe=ve(P);re&&ge(P)===!1?i.renderbufferStorageMultisample(36161,fe,Fe,P.width,P.height):ge(P)?f.renderbufferStorageMultisampleEXT(36161,fe,Fe,P.width,P.height):i.renderbufferStorage(36161,Fe,P.width,P.height)}i.bindRenderbuffer(36161,null)}function Z(L,P){if(P&&P.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,L),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(P.depthTexture).__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),F(P.depthTexture,0);let ye=r.get(P.depthTexture).__webglTexture,Se=ve(P);if(P.depthTexture.format===_o)ge(P)?f.framebufferTexture2DMultisampleEXT(36160,36096,3553,ye,0,Se):i.framebufferTexture2D(36160,36096,3553,ye,0);else if(P.depthTexture.format===Ns)ge(P)?f.framebufferTexture2DMultisampleEXT(36160,33306,3553,ye,0,Se):i.framebufferTexture2D(36160,33306,3553,ye,0);else throw new Error("Unknown depthTexture format")}function W(L){let P=r.get(L),re=L.isWebGLCubeRenderTarget===!0;if(L.depthTexture&&!P.__autoAllocateDepthBuffer){if(re)throw new Error("target.depthTexture not supported in Cube render targets");Z(P.__webglFramebuffer,L)}else if(re){P.__webglDepthbuffer=[];for(let ye=0;ye<6;ye++)t.bindFramebuffer(36160,P.__webglFramebuffer[ye]),P.__webglDepthbuffer[ye]=i.createRenderbuffer(),ue(P.__webglDepthbuffer[ye],L,!1)}else t.bindFramebuffer(36160,P.__webglFramebuffer),P.__webglDepthbuffer=i.createRenderbuffer(),ue(P.__webglDepthbuffer,L,!1);t.bindFramebuffer(36160,null)}function $(L,P,re){let ye=r.get(L);P!==void 0&&q(ye.__webglFramebuffer,L,L.texture,36064,3553),re!==void 0&&W(L)}function ce(L){let P=L.texture,re=r.get(L),ye=r.get(P);L.addEventListener("dispose",I),L.isWebGLMultipleRenderTargets!==!0&&(ye.__webglTexture===void 0&&(ye.__webglTexture=i.createTexture()),ye.__version=P.version,o.memory.textures++);let Se=L.isWebGLCubeRenderTarget===!0,Ie=L.isWebGLMultipleRenderTargets===!0,Fe=b(L)||a;if(Se){re.__webglFramebuffer=[];for(let fe=0;fe<6;fe++)re.__webglFramebuffer[fe]=i.createFramebuffer()}else if(re.__webglFramebuffer=i.createFramebuffer(),Ie)if(n.drawBuffers){let fe=L.texture;for(let rt=0,st=fe.length;rt<st;rt++){let Ee=r.get(fe[rt]);Ee.__webglTexture===void 0&&(Ee.__webglTexture=i.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(a&&L.samples>0&&ge(L)===!1){re.__webglMultisampledFramebuffer=i.createFramebuffer(),re.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,re.__webglColorRenderbuffer);let fe=s.convert(P.format,P.encoding),rt=s.convert(P.type),st=x(P.internalFormat,fe,rt,P.encoding),Ee=ve(L);i.renderbufferStorageMultisample(36161,Ee,st,L.width,L.height),t.bindFramebuffer(36160,re.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,re.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),L.depthBuffer&&(re.__webglDepthRenderbuffer=i.createRenderbuffer(),ue(re.__webglDepthRenderbuffer,L,!0)),t.bindFramebuffer(36160,null)}if(Se){t.bindTexture(34067,ye.__webglTexture),V(34067,P,Fe);for(let fe=0;fe<6;fe++)q(re.__webglFramebuffer[fe],L,P,36064,34069+fe);T(P,Fe)&&A(34067),t.unbindTexture()}else if(Ie){let fe=L.texture;for(let rt=0,st=fe.length;rt<st;rt++){let Ee=fe[rt],z=r.get(Ee);t.bindTexture(3553,z.__webglTexture),V(3553,Ee,Fe),q(re.__webglFramebuffer,L,Ee,36064+rt,3553),T(Ee,Fe)&&A(3553)}t.unbindTexture()}else{let fe=3553;(L.isWebGL3DRenderTarget||L.isWebGLArrayRenderTarget)&&(a?fe=L.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(fe,ye.__webglTexture),V(fe,P,Fe),q(re.__webglFramebuffer,L,P,36064,fe),T(P,Fe)&&A(fe),t.unbindTexture()}L.depthBuffer&&W(L)}function oe(L){let P=b(L)||a,re=L.isWebGLMultipleRenderTargets===!0?L.texture:[L.texture];for(let ye=0,Se=re.length;ye<Se;ye++){let Ie=re[ye];if(T(Ie,P)){let Fe=L.isWebGLCubeRenderTarget?34067:3553,fe=r.get(Ie).__webglTexture;t.bindTexture(Fe,fe),A(Fe),t.unbindTexture()}}}function me(L){if(a&&L.samples>0&&ge(L)===!1){let P=L.width,re=L.height,ye=16384,Se=[36064],Ie=L.stencilBuffer?33306:36096;L.depthBuffer&&Se.push(Ie);let Fe=r.get(L),fe=Fe.__ignoreDepthValues!==void 0?Fe.__ignoreDepthValues:!1;fe===!1&&(L.depthBuffer&&(ye|=256),L.stencilBuffer&&(ye|=1024)),t.bindFramebuffer(36008,Fe.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,Fe.__webglFramebuffer),fe===!0&&(i.invalidateFramebuffer(36008,[Ie]),i.invalidateFramebuffer(36009,[Ie])),i.blitFramebuffer(0,0,P,re,0,0,P,re,ye,9728),d&&i.invalidateFramebuffer(36008,Se),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,Fe.__webglMultisampledFramebuffer)}}function ve(L){return Math.min(u,L.samples)}function ge(L){let P=r.get(L);return a&&L.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function Le(L){let P=o.render.frame;p.get(L)!==P&&(p.set(L,P),L.update())}function ke(L,P){let re=L.encoding,ye=L.format,Se=L.type;return L.isCompressedTexture===!0||L.isVideoTexture===!0||L.format===sg||re!==gn&&(re===je?a===!1?e.has("EXT_sRGB")===!0&&ye===Fn?(L.format=sg,L.minFilter=ct,L.generateMipmaps=!1):P=ns.sRGBToLinear(P):(ye!==Fn||Se!==qt)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",re)),P}this.allocateTextureUnit=J,this.resetTextureUnits=K,this.setTexture2D=F,this.setTexture2DArray=U,this.setTexture3D=O,this.setTextureCube=j,this.rebindTextures=$,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=oe,this.updateMultisampleRenderTarget=me,this.setupDepthRenderbuffer=W,this.setupFrameBufferTexture=q,this.useMultisampledRTT=ge}function IL(i,e,t){let r=t.isWebGL2;function n(s,o=null){let a;if(s===qt)return 5121;if(s===S_)return 32819;if(s===M_)return 32820;if(s===x_)return 5120;if(s===b_)return 5122;if(s===Vc)return 5123;if(s===w_)return 5124;if(s===La)return 5125;if(s===Ps)return 5126;if(s===Hc)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===A_)return 6406;if(s===Fn)return 6408;if(s===__)return 6409;if(s===E_)return 6410;if(s===_o)return 6402;if(s===Ns)return 34041;if(s===C_)return 6403;if(s===T_)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===sg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===P_)return 36244;if(s===D_)return 33319;if(s===L_)return 33320;if(s===I_)return 36249;if(s===ym||s===vm||s===xm||s===bm)if(o===je)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===ym)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===xm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===bm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===ym)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===vm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===xm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===bm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Nx||s===Ox||s===Fx||s===Ux)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Nx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Ox)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Fx)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Ux)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===R_)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===zx||s===Gx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===zx)return o===je?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Gx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===kx||s===Vx||s===Hx||s===Wx||s===jx||s===qx||s===Yx||s===Xx||s===Qx||s===Jx||s===Kx||s===Zx||s===$x||s===e0)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===kx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Vx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Hx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Wx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===jx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===qx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Yx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Xx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Qx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Jx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Kx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Zx)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===$x)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===e0)return o===je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===t0)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===t0)return o===je?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===Ls?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):i[s]!==void 0?i[s]:null}return{convert:n}}var xf=class extends sr{constructor(e=[]){super(),this.cameras=e}};xf.prototype.isArrayCamera=!0;var ts=class extends ot{constructor(){super(),this.type="Group"}};ts.prototype.isGroup=!0;var RL={type:"move"},zc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ts,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 ts,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new M,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new M),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ts,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new M,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new M),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,r){let n=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(n=t.getPose(e.targetRaySpace,r),n!==null&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(RL))),c&&e.hand){o=!0;for(let m of e.hand.values()){let g=t.getJointPose(m,r);if(c.joints[m.jointName]===void 0){let y=new ts;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[m.jointName]=y,c.add(y)}let v=c.joints[m.jointName];g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=g.radius),v.visible=g!==null}let h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],f=h.position.distanceTo(u.position),d=.02,p=.005;c.inputState.pinching&&f>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=d-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=n!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},ai=class extends Pt{constructor(e,t,r,n,s,o,a,l,c,h){if(h=h!==void 0?h:_o,h!==_o&&h!==Ns)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&h===_o&&(r=Vc),r===void 0&&h===Ns&&(r=Ls),super(null,n,s,o,a,l,h,r,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:hr,this.minFilter=l!==void 0?l:hr,this.flipY=!1,this.generateMipmaps=!1}};ai.prototype.isDepthTexture=!0;var pg=class extends Yt{constructor(e,t){super();let r=this,n=null,s=1,o=null,a="local-floor",l=null,c=null,h=null,u=null,f=null,d=null,p=t.getContextAttributes(),m=null,g=null,v=[],y=new Map,w=new sr;w.layers.enable(1),w.viewport=new Je;let b=new sr;b.layers.enable(2),b.viewport=new Je;let S=[w,b],T=new xf;T.layers.enable(1),T.layers.enable(2);let A=null,x=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let F=v[Y];return F===void 0&&(F=new zc,v[Y]=F),F.getTargetRaySpace()},this.getControllerGrip=function(Y){let F=v[Y];return F===void 0&&(F=new zc,v[Y]=F),F.getGripSpace()},this.getHand=function(Y){let F=v[Y];return F===void 0&&(F=new zc,v[Y]=F),F.getHandSpace()};function _(Y){let F=y.get(Y.inputSource);F&&F.dispatchEvent({type:Y.type,data:Y.inputSource})}function E(){y.forEach(function(Y,F){Y.disconnect(F)}),y.clear(),A=null,x=null,e.setRenderTarget(m),f=null,u=null,h=null,n=null,g=null,J.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(Y){l=Y},this.getBaseLayer=function(){return u!==null?u:f},this.getBinding=function(){return h},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=async function(Y){if(n=Y,n!==null){if(m=e.getRenderTarget(),n.addEventListener("select",_),n.addEventListener("selectstart",_),n.addEventListener("selectend",_),n.addEventListener("squeeze",_),n.addEventListener("squeezestart",_),n.addEventListener("squeezeend",_),n.addEventListener("end",E),n.addEventListener("inputsourceschange",C),p.xrCompatible!==!0&&await t.makeXRCompatible(),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let F={antialias:n.renderState.layers===void 0?p.antialias:!0,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(n,t,F),n.updateRenderState({baseLayer:f}),g=new mt(f.framebufferWidth,f.framebufferHeight,{format:Fn,type:qt,encoding:e.outputEncoding})}else{let F=null,U=null,O=null;p.depth&&(O=p.stencil?35056:33190,F=p.stencil?Ns:_o,U=p.stencil?Ls:Vc);let j={colorFormat:e.outputEncoding===je?35907:32856,depthFormat:O,scaleFactor:s};h=new XRWebGLBinding(n,t),u=h.createProjectionLayer(j),n.updateRenderState({layers:[u]}),g=new mt(u.textureWidth,u.textureHeight,{format:Fn,type:qt,depthTexture:new ai(u.textureWidth,u.textureHeight,U,void 0,void 0,void 0,void 0,void 0,void 0,F),stencilBuffer:p.stencil,encoding:e.outputEncoding,samples:p.antialias?4:0});let H=e.properties.get(g);H.__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(1),o=await n.requestReferenceSpace(a),J.setContext(n),J.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function C(Y){let F=n.inputSources;for(let U=0;U<F.length;U++){let O=F[U].handedness==="right"?1:0;y.set(F[U],v[O])}for(let U=0;U<Y.removed.length;U++){let O=Y.removed[U],j=y.get(O);j&&(j.dispatchEvent({type:"disconnected",data:O}),y.delete(O))}for(let U=0;U<Y.added.length;U++){let O=Y.added[U],j=y.get(O);j&&j.dispatchEvent({type:"connected",data:O})}}let I=new M,N=new M;function R(Y,F,U){I.setFromMatrixPosition(F.matrixWorld),N.setFromMatrixPosition(U.matrixWorld);let O=I.distanceTo(N),j=F.projectionMatrix.elements,H=U.projectionMatrix.elements,X=j[14]/(j[10]-1),V=j[14]/(j[10]+1),he=(j[9]+1)/j[5],ie=(j[9]-1)/j[5],le=(j[8]-1)/j[0],q=(H[8]+1)/H[0],ue=X*le,Z=X*q,W=O/(-le+q),$=W*-le;F.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX($),Y.translateZ(W),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert();let ce=X+W,oe=V+W,me=ue-$,ve=Z+(O-$),ge=he*V/oe*ce,Le=ie*V/oe*ce;Y.projectionMatrix.makePerspective(me,ve,ge,Le,ce,oe)}function k(Y,F){F===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(F.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(n===null)return;T.near=b.near=w.near=Y.near,T.far=b.far=w.far=Y.far,(A!==T.near||x!==T.far)&&(n.updateRenderState({depthNear:T.near,depthFar:T.far}),A=T.near,x=T.far);let F=Y.parent,U=T.cameras;k(T,F);for(let j=0;j<U.length;j++)k(U[j],F);T.matrixWorld.decompose(T.position,T.quaternion,T.scale),Y.position.copy(T.position),Y.quaternion.copy(T.quaternion),Y.scale.copy(T.scale),Y.matrix.copy(T.matrix),Y.matrixWorld.copy(T.matrixWorld);let O=Y.children;for(let j=0,H=O.length;j<H;j++)O[j].updateMatrixWorld(!0);U.length===2?R(T,w,b):T.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return T},this.getFoveation=function(){if(u!==null)return u.fixedFoveation;if(f!==null)return f.fixedFoveation},this.setFoveation=function(Y){u!==null&&(u.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)};let G=null;function K(Y,F){if(c=F.getViewerPose(l||o),d=F,c!==null){let O=c.views;f!==null&&(e.setRenderTargetFramebuffer(g,f.framebuffer),e.setRenderTarget(g));let j=!1;O.length!==T.cameras.length&&(T.cameras.length=0,j=!0);for(let H=0;H<O.length;H++){let X=O[H],V=null;if(f!==null)V=f.getViewport(X);else{let ie=h.getViewSubImage(u,X);V=ie.viewport,H===0&&(e.setRenderTargetTextures(g,ie.colorTexture,u.ignoreDepthValues?void 0:ie.depthStencilTexture),e.setRenderTarget(g))}let he=S[H];he.matrix.fromArray(X.transform.matrix),he.projectionMatrix.fromArray(X.projectionMatrix),he.viewport.set(V.x,V.y,V.width,V.height),H===0&&T.matrix.copy(he.matrix),j===!0&&T.cameras.push(he)}}let U=n.inputSources;for(let O=0;O<v.length;O++){let j=U[O],H=y.get(j);H!==void 0&&H.update(j,F,l||o)}G&&G(Y,F),d=null}let J=new wb;J.setAnimationLoop(K),this.setAnimationLoop=function(Y){G=Y},this.dispose=function(){}}};function BL(i,e){function t(m,g){m.fogColor.value.copy(g.color),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function r(m,g,v,y,w){g.isMeshBasicMaterial||g.isMeshLambertMaterial?n(m,g):g.isMeshToonMaterial?(n(m,g),h(m,g)):g.isMeshPhongMaterial?(n(m,g),c(m,g)):g.isMeshStandardMaterial?(n(m,g),u(m,g),g.isMeshPhysicalMaterial&&f(m,g,w)):g.isMeshMatcapMaterial?(n(m,g),d(m,g)):g.isMeshDepthMaterial?n(m,g):g.isMeshDistanceMaterial?(n(m,g),p(m,g)):g.isMeshNormalMaterial?n(m,g):g.isLineBasicMaterial?(s(m,g),g.isLineDashedMaterial&&o(m,g)):g.isPointsMaterial?a(m,g,v,y):g.isSpriteMaterial?l(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function n(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.bumpMap&&(m.bumpMap.value=g.bumpMap,m.bumpScale.value=g.bumpScale,g.side===Dr&&(m.bumpScale.value*=-1)),g.displacementMap&&(m.displacementMap.value=g.displacementMap,m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap),g.normalMap&&(m.normalMap.value=g.normalMap,m.normalScale.value.copy(g.normalScale),g.side===Dr&&m.normalScale.value.negate()),g.specularMap&&(m.specularMap.value=g.specularMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v=e.get(g).envMap;if(v&&(m.envMap.value=v,m.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;let b=i.physicallyCorrectLights!==!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*b}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity);let y;g.map?y=g.map:g.specularMap?y=g.specularMap:g.displacementMap?y=g.displacementMap:g.normalMap?y=g.normalMap:g.bumpMap?y=g.bumpMap:g.roughnessMap?y=g.roughnessMap:g.metalnessMap?y=g.metalnessMap:g.alphaMap?y=g.alphaMap:g.emissiveMap?y=g.emissiveMap:g.clearcoatMap?y=g.clearcoatMap:g.clearcoatNormalMap?y=g.clearcoatNormalMap:g.clearcoatRoughnessMap?y=g.clearcoatRoughnessMap:g.specularIntensityMap?y=g.specularIntensityMap:g.specularColorMap?y=g.specularColorMap:g.transmissionMap?y=g.transmissionMap:g.thicknessMap?y=g.thicknessMap:g.sheenColorMap?y=g.sheenColorMap:g.sheenRoughnessMap&&(y=g.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),m.uvTransform.value.copy(y.matrix));let w;g.aoMap?w=g.aoMap:g.lightMap&&(w=g.lightMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),m.uv2Transform.value.copy(w.matrix))}function s(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity}function o(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function a(m,g,v,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*v,m.scale.value=y*.5,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let w;g.map?w=g.map:g.alphaMap&&(w=g.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),m.uvTransform.value.copy(w.matrix))}function l(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v;g.map?v=g.map:g.alphaMap&&(v=g.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),m.uvTransform.value.copy(v.matrix))}function c(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function h(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function u(m,g){m.roughness.value=g.roughness,m.metalness.value=g.metalness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap),e.get(g).envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function f(m,g,v){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap)),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),m.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===Dr&&m.clearcoatNormalScale.value.negate())),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap)}function d(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){m.referencePosition.value.copy(g.referencePosition),m.nearDistance.value=g.nearDistance,m.farDistance.value=g.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function NL(){let i=qc("canvas");return i.style.display="block",i}function Dt(i={}){let e=i.canvas!==void 0?i.canvas:NL(),t=i.context!==void 0?i.context:null,r=i.depth!==void 0?i.depth:!0,n=i.stencil!==void 0?i.stencil:!0,s=i.antialias!==void 0?i.antialias:!1,o=i.premultipliedAlpha!==void 0?i.premultipliedAlpha:!0,a=i.preserveDrawingBuffer!==void 0?i.preserveDrawingBuffer:!1,l=i.powerPreference!==void 0?i.powerPreference:"default",c=i.failIfMajorPerformanceCaveat!==void 0?i.failIfMajorPerformanceCaveat:!1,h;t!==null?h=t.getContextAttributes().alpha:h=i.alpha!==void 0?i.alpha:!1;let u=null,f=null,d=[],p=[];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.outputEncoding=gn,this.physicallyCorrectLights=!1,this.toneMapping=rs,this.toneMappingExposure=1;let m=this,g=!1,v=0,y=0,w=null,b=-1,S=null,T=new Je,A=new Je,x=null,_=e.width,E=e.height,C=1,I=null,N=null,R=new Je(0,0,_,E),k=new Je(0,0,_,E),G=!1,K=new Na,J=!1,Y=!1,F=null,U=new Ae,O=new B,j=new M,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function X(){return w===null?C:1}let V=t;function he(D,Q){for(let ne=0;ne<D.length;ne++){let te=D[ne],de=e.getContext(te,Q);if(de!==null)return de}return null}try{let D={alpha:!0,depth:r,stencil:n,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Uo}`),e.addEventListener("webglcontextlost",z,!1),e.addEventListener("webglcontextrestored",Me,!1),V===null){let Q=["webgl2","webgl","experimental-webgl"];if(m.isWebGL1Renderer===!0&&Q.shift(),V=he(Q,D),V===null)throw he(Q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}V.getShaderPrecisionFormat===void 0&&(V.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let ie,le,q,ue,Z,W,$,ce,oe,me,ve,ge,Le,ke,L,P,re,ye,Se,Ie,Fe,fe,rt;function st(){ie=new tD(V),le=new QP(V,ie,i),ie.init(le),fe=new IL(V,ie,le),q=new DL(V,ie,le),ue=new iD(V),Z=new xL,W=new LL(V,ie,q,Z,le,fe,ue),$=new KP(m),ce=new eD(m),oe=new vE(V,le),rt=new YP(V,ie,oe,le),me=new rD(V,oe,ue,rt),ve=new lD(V,me,oe,ue),Se=new aD(V,le,W),P=new JP(Z),ge=new vL(m,$,ce,ie,le,rt,P),Le=new BL(m,Z),ke=new wL,L=new EL(ie,le),ye=new qP(m,$,q,ve,h,o),re=new Cb(m,ve,le),Ie=new XP(V,ie,ue,le),Fe=new nD(V,ie,ue,le),ue.programs=ge.programs,m.capabilities=le,m.extensions=ie,m.properties=Z,m.renderLists=ke,m.shadowMap=re,m.state=q,m.info=ue}st();let Ee=new pg(m,V);this.xr=Ee,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){let D=ie.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){let D=ie.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return C},this.setPixelRatio=function(D){D!==void 0&&(C=D,this.setSize(_,E,!1))},this.getSize=function(D){return D.set(_,E)},this.setSize=function(D,Q,ne){if(Ee.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}_=D,E=Q,e.width=Math.floor(D*C),e.height=Math.floor(Q*C),ne!==!1&&(e.style.width=D+"px",e.style.height=Q+"px"),this.setViewport(0,0,D,Q)},this.getDrawingBufferSize=function(D){return D.set(_*C,E*C).floor()},this.setDrawingBufferSize=function(D,Q,ne){_=D,E=Q,C=ne,e.width=Math.floor(D*ne),e.height=Math.floor(Q*ne),this.setViewport(0,0,D,Q)},this.getCurrentViewport=function(D){return D.copy(T)},this.getViewport=function(D){return D.copy(R)},this.setViewport=function(D,Q,ne,te){D.isVector4?R.set(D.x,D.y,D.z,D.w):R.set(D,Q,ne,te),q.viewport(T.copy(R).multiplyScalar(C).floor())},this.getScissor=function(D){return D.copy(k)},this.setScissor=function(D,Q,ne,te){D.isVector4?k.set(D.x,D.y,D.z,D.w):k.set(D,Q,ne,te),q.scissor(A.copy(k).multiplyScalar(C).floor())},this.getScissorTest=function(){return G},this.setScissorTest=function(D){q.setScissorTest(G=D)},this.setOpaqueSort=function(D){I=D},this.setTransparentSort=function(D){N=D},this.getClearColor=function(D){return D.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(D=!0,Q=!0,ne=!0){let te=0;D&&(te|=16384),Q&&(te|=256),ne&&(te|=1024),V.clear(te)},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",z,!1),e.removeEventListener("webglcontextrestored",Me,!1),ke.dispose(),L.dispose(),Z.dispose(),$.dispose(),ce.dispose(),ve.dispose(),rt.dispose(),ge.dispose(),Ee.dispose(),Ee.removeEventListener("sessionstart",$e),Ee.removeEventListener("sessionend",lt),F&&(F.dispose(),F=null),dt.stop()};function z(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;let D=ue.autoReset,Q=re.enabled,ne=re.autoUpdate,te=re.needsUpdate,de=re.type;st(),ue.autoReset=D,re.enabled=Q,re.autoUpdate=ne,re.needsUpdate=te,re.type=de}function Pe(D){let Q=D.target;Q.removeEventListener("dispose",Pe),Ze(Q)}function Ze(D){Oe(D),Z.remove(D)}function Oe(D){let Q=Z.get(D).programs;Q!==void 0&&(Q.forEach(function(ne){ge.releaseProgram(ne)}),D.isShaderMaterial&&ge.releaseShaderCache(D))}this.renderBufferDirect=function(D,Q,ne,te,de,Ue){Q===null&&(Q=H);let He=de.isMesh&&de.matrixWorld.determinant()<0,nt=pt(D,Q,ne,te,de);q.setMaterial(te,He);let it=ne.index,_t=ne.attributes.position;if(it===null){if(_t===void 0||_t.count===0)return}else if(it.count===0)return;let St=1;te.wireframe===!0&&(it=me.getWireframeAttribute(ne),St=2),rt.setup(de,te,nt,ne,it);let Et,nr=Ie;it!==null&&(Et=oe.get(it),nr=Fe,nr.setIndex(Et));let xo=it!==null?it.count:_t.count,sa=ne.drawRange.start*St,oa=ne.drawRange.count*St,wi=Ue!==null?Ue.start*St:0,Rt=Ue!==null?Ue.count*St:1/0,aa=Math.max(sa,wi),yr=Math.min(xo,sa+oa,wi+Rt)-1,Si=Math.max(0,yr-aa+1);if(Si!==0){if(de.isMesh)te.wireframe===!0?(q.setLineWidth(te.wireframeLinewidth*X()),nr.setMode(1)):nr.setMode(4);else if(de.isLine){let bs=te.linewidth;bs===void 0&&(bs=1),q.setLineWidth(bs*X()),de.isLineSegments?nr.setMode(1):de.isLineLoop?nr.setMode(2):nr.setMode(3)}else de.isPoints?nr.setMode(0):de.isSprite&&nr.setMode(4);if(de.isInstancedMesh)nr.renderInstances(aa,Si,de.count);else if(ne.isInstancedBufferGeometry){let bs=Math.min(ne.instanceCount,ne._maxInstanceCount);nr.renderInstances(aa,Si,bs)}else nr.render(aa,Si)}},this.compile=function(D,Q){f=L.get(D),f.init(),p.push(f),D.traverseVisible(function(ne){ne.isLight&&ne.layers.test(Q.layers)&&(f.pushLight(ne),ne.castShadow&&f.pushShadow(ne))}),f.setupLights(m.physicallyCorrectLights),D.traverse(function(ne){let te=ne.material;if(te)if(Array.isArray(te))for(let de=0;de<te.length;de++){let Ue=te[de];ut(Ue,D,ne)}else ut(te,D,ne)}),p.pop(),f=null};let Qe=null;function _e(D){Qe&&Qe(D)}function $e(){dt.stop()}function lt(){dt.start()}let dt=new wb;dt.setAnimationLoop(_e),typeof self<"u"&&dt.setContext(self),this.setAnimationLoop=function(D){Qe=D,Ee.setAnimationLoop(D),D===null?dt.stop():dt.start()},Ee.addEventListener("sessionstart",$e),Ee.addEventListener("sessionend",lt),this.render=function(D,Q){if(Q!==void 0&&Q.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(g===!0)return;D.autoUpdate===!0&&D.updateMatrixWorld(),Q.parent===null&&Q.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(Q),Q=Ee.getCamera()),D.isScene===!0&&D.onBeforeRender(m,D,Q,w),f=L.get(D,p.length),f.init(),p.push(f),U.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),K.setFromProjectionMatrix(U),Y=this.localClippingEnabled,J=P.init(this.clippingPlanes,Y,Q),u=ke.get(D,d.length),u.init(),d.push(u),Ut(D,Q,0,m.sortObjects),u.finish(),m.sortObjects===!0&&u.sort(I,N),J===!0&&P.beginShadows();let ne=f.state.shadowsArray;if(re.render(ne,D,Q),J===!0&&P.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(u,D),f.setupLights(m.physicallyCorrectLights),Q.isArrayCamera){let te=Q.cameras;for(let de=0,Ue=te.length;de<Ue;de++){let He=te[de];Ur(u,D,He,He.viewport)}}else Ur(u,D,Q);w!==null&&(W.updateMultisampleRenderTarget(w),W.updateRenderTargetMipmap(w)),D.isScene===!0&&D.onAfterRender(m,D,Q),rt.resetDefaultState(),b=-1,S=null,p.pop(),p.length>0?f=p[p.length-1]:f=null,d.pop(),d.length>0?u=d[d.length-1]:u=null};function Ut(D,Q,ne,te){if(D.visible===!1)return;if(D.layers.test(Q.layers)){if(D.isGroup)ne=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(Q);else if(D.isLight)f.pushLight(D),D.castShadow&&f.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||K.intersectsSprite(D)){te&&j.setFromMatrixPosition(D.matrixWorld).applyMatrix4(U);let He=ve.update(D),nt=D.material;nt.visible&&u.push(D,He,nt,ne,j.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(D.isSkinnedMesh&&D.skeleton.frame!==ue.render.frame&&(D.skeleton.update(),D.skeleton.frame=ue.render.frame),!D.frustumCulled||K.intersectsObject(D))){te&&j.setFromMatrixPosition(D.matrixWorld).applyMatrix4(U);let He=ve.update(D),nt=D.material;if(Array.isArray(nt)){let it=He.groups;for(let _t=0,St=it.length;_t<St;_t++){let Et=it[_t],nr=nt[Et.materialIndex];nr&&nr.visible&&u.push(D,He,nr,ne,j.z,Et)}}else nt.visible&&u.push(D,He,nt,ne,j.z,null)}}let Ue=D.children;for(let He=0,nt=Ue.length;He<nt;He++)Ut(Ue[He],Q,ne,te)}function Ur(D,Q,ne,te){let de=D.opaque,Ue=D.transmissive,He=D.transparent;f.setupLightsView(ne),Ue.length>0&&ia(de,Q,ne),te&&q.viewport(T.copy(te)),de.length>0&&Nn(de,Q,ne),Ue.length>0&&Nn(Ue,Q,ne),He.length>0&&Nn(He,Q,ne),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function ia(D,Q,ne){let te=le.isWebGL2;F===null&&(F=new mt(1,1,{generateMipmaps:!0,type:ie.has("EXT_color_buffer_half_float")?Hc:qt,minFilter:js,samples:te&&s===!0?4:0})),m.getDrawingBufferSize(O),te?F.setSize(O.x,O.y):F.setSize(pf(O.x),pf(O.y));let de=m.getRenderTarget();m.setRenderTarget(F),m.clear();let Ue=m.toneMapping;m.toneMapping=rs,Nn(D,Q,ne),m.toneMapping=Ue,W.updateMultisampleRenderTarget(F),W.updateRenderTargetMipmap(F),m.setRenderTarget(de)}function Nn(D,Q,ne){let te=Q.isScene===!0?Q.overrideMaterial:null;for(let de=0,Ue=D.length;de<Ue;de++){let He=D[de],nt=He.object,it=He.geometry,_t=te===null?He.material:te,St=He.group;nt.layers.test(ne.layers)&&at(nt,Q,ne,it,_t,St)}}function at(D,Q,ne,te,de,Ue){D.onBeforeRender(m,Q,ne,te,de,Ue),D.modelViewMatrix.multiplyMatrices(ne.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),de.onBeforeRender(m,Q,ne,te,D,Ue),de.transparent===!0&&de.side===or?(de.side=Dr,de.needsUpdate=!0,m.renderBufferDirect(ne,Q,te,de,D,Ue),de.side=si,de.needsUpdate=!0,m.renderBufferDirect(ne,Q,te,de,D,Ue),de.side=or):m.renderBufferDirect(ne,Q,te,de,D,Ue),D.onAfterRender(m,Q,ne,te,de,Ue)}function ut(D,Q,ne){Q.isScene!==!0&&(Q=H);let te=Z.get(D),de=f.state.lights,Ue=f.state.shadowsArray,He=de.state.version,nt=ge.getParameters(D,de.state,Ue,Q,ne),it=ge.getProgramCacheKey(nt),_t=te.programs;te.environment=D.isMeshStandardMaterial?Q.environment:null,te.fog=Q.fog,te.envMap=(D.isMeshStandardMaterial?ce:$).get(D.envMap||te.environment),_t===void 0&&(D.addEventListener("dispose",Pe),_t=new Map,te.programs=_t);let St=_t.get(it);if(St!==void 0){if(te.currentProgram===St&&te.lightsStateVersion===He)return ft(D,nt),St}else nt.uniforms=ge.getUniforms(D),D.onBuild(ne,nt,m),D.onBeforeCompile(nt,m),St=ge.acquireProgram(nt,it),_t.set(it,St),te.uniforms=nt.uniforms;let Et=te.uniforms;(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(Et.clippingPlanes=P.uniform),ft(D,nt),te.needsLights=It(D),te.lightsStateVersion=He,te.needsLights&&(Et.ambientLightColor.value=de.state.ambient,Et.lightProbe.value=de.state.probe,Et.directionalLights.value=de.state.directional,Et.directionalLightShadows.value=de.state.directionalShadow,Et.spotLights.value=de.state.spot,Et.spotLightShadows.value=de.state.spotShadow,Et.rectAreaLights.value=de.state.rectArea,Et.ltc_1.value=de.state.rectAreaLTC1,Et.ltc_2.value=de.state.rectAreaLTC2,Et.pointLights.value=de.state.point,Et.pointLightShadows.value=de.state.pointShadow,Et.hemisphereLights.value=de.state.hemi,Et.directionalShadowMap.value=de.state.directionalShadowMap,Et.directionalShadowMatrix.value=de.state.directionalShadowMatrix,Et.spotShadowMap.value=de.state.spotShadowMap,Et.spotShadowMatrix.value=de.state.spotShadowMatrix,Et.pointShadowMap.value=de.state.pointShadowMap,Et.pointShadowMatrix.value=de.state.pointShadowMatrix);let nr=St.getUniforms(),xo=Is.seqWithValue(nr.seq,Et);return te.currentProgram=St,te.uniformsList=xo,St}function ft(D,Q){let ne=Z.get(D);ne.outputEncoding=Q.outputEncoding,ne.instancing=Q.instancing,ne.skinning=Q.skinning,ne.morphTargets=Q.morphTargets,ne.morphNormals=Q.morphNormals,ne.morphColors=Q.morphColors,ne.morphTargetsCount=Q.morphTargetsCount,ne.numClippingPlanes=Q.numClippingPlanes,ne.numIntersection=Q.numClipIntersection,ne.vertexAlphas=Q.vertexAlphas,ne.vertexTangents=Q.vertexTangents,ne.toneMapping=Q.toneMapping}function pt(D,Q,ne,te,de){Q.isScene!==!0&&(Q=H),W.resetTextureUnits();let Ue=Q.fog,He=te.isMeshStandardMaterial?Q.environment:null,nt=w===null?m.outputEncoding:w.isXRRenderTarget===!0?w.texture.encoding:gn,it=(te.isMeshStandardMaterial?ce:$).get(te.envMap||He),_t=te.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,St=!!te.normalMap&&!!ne.attributes.tangent,Et=!!ne.morphAttributes.position,nr=!!ne.morphAttributes.normal,xo=!!ne.morphAttributes.color,sa=te.toneMapped?m.toneMapping:rs,oa=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,wi=oa!==void 0?oa.length:0,Rt=Z.get(te),aa=f.state.lights;if(J===!0&&(Y===!0||D!==S)){let Mi=D===S&&te.id===b;P.setState(te,D,Mi)}let yr=!1;te.version===Rt.__version?(Rt.needsLights&&Rt.lightsStateVersion!==aa.state.version||Rt.outputEncoding!==nt||de.isInstancedMesh&&Rt.instancing===!1||!de.isInstancedMesh&&Rt.instancing===!0||de.isSkinnedMesh&&Rt.skinning===!1||!de.isSkinnedMesh&&Rt.skinning===!0||Rt.envMap!==it||te.fog===!0&&Rt.fog!==Ue||Rt.numClippingPlanes!==void 0&&(Rt.numClippingPlanes!==P.numPlanes||Rt.numIntersection!==P.numIntersection)||Rt.vertexAlphas!==_t||Rt.vertexTangents!==St||Rt.morphTargets!==Et||Rt.morphNormals!==nr||Rt.morphColors!==xo||Rt.toneMapping!==sa||le.isWebGL2===!0&&Rt.morphTargetsCount!==wi)&&(yr=!0):(yr=!0,Rt.__version=te.version);let Si=Rt.currentProgram;yr===!0&&(Si=ut(te,Q,de));let bs=!1,Tc=!1,pm=!1,en=Si.getUniforms(),_c=Rt.uniforms;if(q.useProgram(Si.program)&&(bs=!0,Tc=!0,pm=!0),te.id!==b&&(b=te.id,Tc=!0),bs||S!==D){if(en.setValue(V,"projectionMatrix",D.projectionMatrix),le.logarithmicDepthBuffer&&en.setValue(V,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),S!==D&&(S=D,Tc=!0,pm=!0),te.isShaderMaterial||te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshStandardMaterial||te.envMap){let Mi=en.map.cameraPosition;Mi!==void 0&&Mi.setValue(V,j.setFromMatrixPosition(D.matrixWorld))}(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&en.setValue(V,"isOrthographic",D.isOrthographicCamera===!0),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial||te.isShadowMaterial||de.isSkinnedMesh)&&en.setValue(V,"viewMatrix",D.matrixWorldInverse)}if(de.isSkinnedMesh){en.setOptional(V,de,"bindMatrix"),en.setOptional(V,de,"bindMatrixInverse");let Mi=de.skeleton;Mi&&(le.floatVertexTextures?(Mi.boneTexture===null&&Mi.computeBoneTexture(),en.setValue(V,"boneTexture",Mi.boneTexture,W),en.setValue(V,"boneTextureSize",Mi.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let mm=ne.morphAttributes;return(mm.position!==void 0||mm.normal!==void 0||mm.color!==void 0&&le.isWebGL2===!0)&&Se.update(de,ne,te,Si),(Tc||Rt.receiveShadow!==de.receiveShadow)&&(Rt.receiveShadow=de.receiveShadow,en.setValue(V,"receiveShadow",de.receiveShadow)),Tc&&(en.setValue(V,"toneMappingExposure",m.toneMappingExposure),Rt.needsLights&&xt(_c,pm),Ue&&te.fog===!0&&Le.refreshFogUniforms(_c,Ue),Le.refreshMaterialUniforms(_c,te,C,E,F),Is.upload(V,Rt.uniformsList,_c,W)),te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Is.upload(V,Rt.uniformsList,_c,W),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&en.setValue(V,"center",de.center),en.setValue(V,"modelViewMatrix",de.modelViewMatrix),en.setValue(V,"normalMatrix",de.normalMatrix),en.setValue(V,"modelMatrix",de.matrixWorld),Si}function xt(D,Q){D.ambientLightColor.needsUpdate=Q,D.lightProbe.needsUpdate=Q,D.directionalLights.needsUpdate=Q,D.directionalLightShadows.needsUpdate=Q,D.pointLights.needsUpdate=Q,D.pointLightShadows.needsUpdate=Q,D.spotLights.needsUpdate=Q,D.spotLightShadows.needsUpdate=Q,D.rectAreaLights.needsUpdate=Q,D.hemisphereLights.needsUpdate=Q}function It(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(D,Q,ne){Z.get(D.texture).__webglTexture=Q,Z.get(D.depthTexture).__webglTexture=ne;let te=Z.get(D);te.__hasExternalTextures=!0,te.__hasExternalTextures&&(te.__autoAllocateDepthBuffer=ne===void 0,te.__autoAllocateDepthBuffer||ie.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),te.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(D,Q){let ne=Z.get(D);ne.__webglFramebuffer=Q,ne.__useDefaultFramebuffer=Q===void 0},this.setRenderTarget=function(D,Q=0,ne=0){w=D,v=Q,y=ne;let te=!0;if(D){let it=Z.get(D);it.__useDefaultFramebuffer!==void 0?(q.bindFramebuffer(36160,null),te=!1):it.__webglFramebuffer===void 0?W.setupRenderTarget(D):it.__hasExternalTextures&&W.rebindTextures(D,Z.get(D.texture).__webglTexture,Z.get(D.depthTexture).__webglTexture)}let de=null,Ue=!1,He=!1;if(D){let it=D.texture;(it.isData3DTexture||it.isDataArrayTexture)&&(He=!0);let _t=Z.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(de=_t[Q],Ue=!0):le.isWebGL2&&D.samples>0&&W.useMultisampledRTT(D)===!1?de=Z.get(D).__webglMultisampledFramebuffer:de=_t,T.copy(D.viewport),A.copy(D.scissor),x=D.scissorTest}else T.copy(R).multiplyScalar(C).floor(),A.copy(k).multiplyScalar(C).floor(),x=G;if(q.bindFramebuffer(36160,de)&&le.drawBuffers&&te&&q.drawBuffers(D,de),q.viewport(T),q.scissor(A),q.setScissorTest(x),Ue){let it=Z.get(D.texture);V.framebufferTexture2D(36160,36064,34069+Q,it.__webglTexture,ne)}else if(He){let it=Z.get(D.texture),_t=Q||0;V.framebufferTextureLayer(36160,36064,it.__webglTexture,ne||0,_t)}b=-1},this.readRenderTargetPixels=function(D,Q,ne,te,de,Ue,He){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nt=Z.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&He!==void 0&&(nt=nt[He]),nt){q.bindFramebuffer(36160,nt);try{let it=D.texture,_t=it.format,St=it.type;if(_t!==Fn&&fe.convert(_t)!==V.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Et=St===Hc&&(ie.has("EXT_color_buffer_half_float")||le.isWebGL2&&ie.has("EXT_color_buffer_float"));if(St!==qt&&fe.convert(St)!==V.getParameter(35738)&&!(St===Ps&&(le.isWebGL2||ie.has("OES_texture_float")||ie.has("WEBGL_color_buffer_float")))&&!Et){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Q>=0&&Q<=D.width-te&&ne>=0&&ne<=D.height-de&&V.readPixels(Q,ne,te,de,fe.convert(_t),fe.convert(St),Ue)}finally{let it=w!==null?Z.get(w).__webglFramebuffer:null;q.bindFramebuffer(36160,it)}}},this.copyFramebufferToTexture=function(D,Q,ne=0){if(Q.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let te=Math.pow(2,-ne),de=Math.floor(Q.image.width*te),Ue=Math.floor(Q.image.height*te);W.setTexture2D(Q,0),V.copyTexSubImage2D(3553,ne,0,0,D.x,D.y,de,Ue),q.unbindTexture()},this.copyTextureToTexture=function(D,Q,ne,te=0){let de=Q.image.width,Ue=Q.image.height,He=fe.convert(ne.format),nt=fe.convert(ne.type);W.setTexture2D(ne,0),V.pixelStorei(37440,ne.flipY),V.pixelStorei(37441,ne.premultiplyAlpha),V.pixelStorei(3317,ne.unpackAlignment),Q.isDataTexture?V.texSubImage2D(3553,te,D.x,D.y,de,Ue,He,nt,Q.image.data):Q.isCompressedTexture?V.compressedTexSubImage2D(3553,te,D.x,D.y,Q.mipmaps[0].width,Q.mipmaps[0].height,He,Q.mipmaps[0].data):V.texSubImage2D(3553,te,D.x,D.y,He,nt,Q.image),te===0&&ne.generateMipmaps&&V.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(D,Q,ne,te,de=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Ue=D.max.x-D.min.x+1,He=D.max.y-D.min.y+1,nt=D.max.z-D.min.z+1,it=fe.convert(te.format),_t=fe.convert(te.type),St;if(te.isData3DTexture)W.setTexture3D(te,0),St=32879;else if(te.isDataArrayTexture)W.setTexture2DArray(te,0),St=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,te.flipY),V.pixelStorei(37441,te.premultiplyAlpha),V.pixelStorei(3317,te.unpackAlignment);let Et=V.getParameter(3314),nr=V.getParameter(32878),xo=V.getParameter(3316),sa=V.getParameter(3315),oa=V.getParameter(32877),wi=ne.isCompressedTexture?ne.mipmaps[0]:ne.image;V.pixelStorei(3314,wi.width),V.pixelStorei(32878,wi.height),V.pixelStorei(3316,D.min.x),V.pixelStorei(3315,D.min.y),V.pixelStorei(32877,D.min.z),ne.isDataTexture||ne.isData3DTexture?V.texSubImage3D(St,de,Q.x,Q.y,Q.z,Ue,He,nt,it,_t,wi.data):ne.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(St,de,Q.x,Q.y,Q.z,Ue,He,nt,it,wi.data)):V.texSubImage3D(St,de,Q.x,Q.y,Q.z,Ue,He,nt,it,_t,wi),V.pixelStorei(3314,Et),V.pixelStorei(32878,nr),V.pixelStorei(3316,xo),V.pixelStorei(3315,sa),V.pixelStorei(32877,oa),de===0&&te.generateMipmaps&&V.generateMipmap(St),q.unbindTexture()},this.initTexture=function(D){W.setTexture2D(D,0),q.unbindTexture()},this.resetState=function(){v=0,y=0,w=null,q.reset(),rt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Dt.prototype.isWebGLRenderer=!0;var mg=class extends Dt{};mg.prototype.isWebGL1Renderer=!0;var Zc=class{constructor(e,t=25e-5){this.name="",this.color=new be(e),this.density=t}clone(){return new Zc(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};Zc.prototype.isFogExp2=!0;var Po=class{constructor(e,t=1,r=1e3){this.name="",this.color=new be(e),this.near=t,this.far=r}clone(){return new Po(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};Po.prototype.isFog=!0;var on=class extends ot{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){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};on.prototype.isScene=!0;var ss=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Wc,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Un()}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,r){e*=this.stride,r*=t.stride;for(let n=0,s=this.stride;n<s;n++)this.array[e+n]=t.array[r+n];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=Un()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}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=Un()),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}}};ss.prototype.isInterleavedBuffer=!0;var tn=new M,Ei=class{constructor(e,t,r,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=n===!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,r=this.data.count;t<r;t++)tn.fromBufferAttribute(this,t),tn.applyMatrix4(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)tn.fromBufferAttribute(this,t),tn.applyNormalMatrix(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)tn.fromBufferAttribute(this,t),tn.transformDirection(e),this.setXYZ(t,tn.x,tn.y,tn.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,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this}setXYZW(e,t,r,n,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,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.");let t=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[n+s])}return new Ve(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 Ei(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.");let t=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[n+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}}};Ei.prototype.isInterleavedBufferAttribute=!0;var $c=class extends ur{constructor(e){super(),this.type="SpriteMaterial",this.color=new be(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!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.fog=e.fog,this}};$c.prototype.isSpriteMaterial=!0;var Sa,Dc=new M,Ma=new M,Aa=new M,Ta=new B,Lc=new B,Pb=new Ae,Yu=new M,Ic=new M,Xu=new M,O0=new B,Xm=new B,F0=new B,gg=class extends ot{constructor(e){if(super(),this.type="Sprite",Sa===void 0){Sa=new De;let t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new ss(t,5);Sa.setIndex([0,1,2,0,2,3]),Sa.setAttribute("position",new Ei(r,3,0,!1)),Sa.setAttribute("uv",new Ei(r,2,3,!1))}this.geometry=Sa,this.material=e!==void 0?e:new $c,this.center=new B(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ma.setFromMatrixScale(this.matrixWorld),Pb.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Aa.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ma.multiplyScalar(-Aa.z);let r=this.material.rotation,n,s;r!==0&&(s=Math.cos(r),n=Math.sin(r));let o=this.center;Qu(Yu.set(-.5,-.5,0),Aa,o,Ma,n,s),Qu(Ic.set(.5,-.5,0),Aa,o,Ma,n,s),Qu(Xu.set(.5,.5,0),Aa,o,Ma,n,s),O0.set(0,0),Xm.set(1,0),F0.set(1,1);let a=e.ray.intersectTriangle(Yu,Ic,Xu,!1,Dc);if(a===null&&(Qu(Ic.set(-.5,.5,0),Aa,o,Ma,n,s),Xm.set(0,1),a=e.ray.intersectTriangle(Yu,Xu,Ic,!1,Dc),a===null))return;let l=e.ray.origin.distanceTo(Dc);l<e.near||l>e.far||t.push({distance:l,point:Dc.clone(),uv:Jt.getUV(Dc,Yu,Ic,Xu,O0,Xm,F0,new B),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};gg.prototype.isSprite=!0;function Qu(i,e,t,r,n,s){Ta.subVectors(i,t).addScalar(.5).multiply(r),n!==void 0?(Lc.x=s*Ta.x-n*Ta.y,Lc.y=n*Ta.x+s*Ta.y):Lc.copy(Ta),i.copy(e),i.x+=Lc.x,i.y+=Lc.y,i.applyMatrix4(Pb)}var U0=new M,z0=new Je,G0=new Je,OL=new M,k0=new Ae,bf=class extends Vt{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ae,this.bindMatrixInverse=new Ae}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(){let e=new Je,t=this.geometry.attributes.skinWeight;for(let r=0,n=t.count;r<n;r++){e.fromBufferAttribute(t,r);let s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(r,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){let r=this.skeleton,n=this.geometry;z0.fromBufferAttribute(n.attributes.skinIndex,e),G0.fromBufferAttribute(n.attributes.skinWeight,e),U0.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){let o=G0.getComponent(s);if(o!==0){let a=z0.getComponent(s);k0.multiplyMatrices(r.bones[a].matrixWorld,r.boneInverses[a]),t.addScaledVector(OL.copy(U0).applyMatrix4(k0),o)}}return t.applyMatrix4(this.bindMatrixInverse)}};bf.prototype.isSkinnedMesh=!0;var yg=class extends ot{constructor(){super(),this.type="Bone"}};yg.prototype.isBone=!0;var wf=class extends Pt{constructor(e=null,t=1,r=1,n,s,o,a,l,c=hr,h=hr,u,f){super(null,o,a,l,c,h,n,s,u,f),this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};wf.prototype.isDataTexture=!0;var Oa=class extends Ve{constructor(e,t,r,n=1){typeof r=="number"&&(n=r,r=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,r),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}};Oa.prototype.isInstancedBufferAttribute=!0;var V0=new Ae,H0=new Ae,Ju=[],Rc=new Vt,vg=class extends Vt{constructor(e,t,r){super(e,t),this.instanceMatrix=new Oa(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,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){let r=this.matrixWorld,n=this.count;if(Rc.geometry=this.geometry,Rc.material=this.material,Rc.material!==void 0)for(let s=0;s<n;s++){this.getMatrixAt(s,V0),H0.multiplyMatrices(r,V0),Rc.matrixWorld=H0,Rc.raycast(e,Ju);for(let o=0,a=Ju.length;o<a;o++){let l=Ju[o];l.instanceId=s,l.object=this,t.push(l)}Ju.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Oa(new Float32Array(this.instanceMatrix.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"})}};vg.prototype.isInstancedMesh=!0;var kr=class extends ur{constructor(e){super(),this.type="LineBasicMaterial",this.color=new be(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,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.fog=e.fog,this}};kr.prototype.isLineBasicMaterial=!0;var W0=new M,j0=new M,q0=new Ae,Qm=new oi,Ku=new Lr,os=class extends ot{constructor(e=new De,t=new kr){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(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,r=[0];for(let n=1,s=t.count;n<s;n++)W0.fromBufferAttribute(t,n-1),j0.fromBufferAttribute(t,n),r[n]=r[n-1],r[n]+=W0.distanceTo(j0);e.setAttribute("lineDistance",new Te(r,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){let r=this.geometry,n=this.matrixWorld,s=e.params.Line.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Ku.copy(r.boundingSphere),Ku.applyMatrix4(n),Ku.radius+=s,e.ray.intersectsSphere(Ku)===!1)return;q0.copy(n).invert(),Qm.copy(e.ray).applyMatrix4(q0);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=new M,h=new M,u=new M,f=new M,d=this.isLineSegments?2:1;if(r.isBufferGeometry){let p=r.index,g=r.attributes.position;if(p!==null){let v=Math.max(0,o.start),y=Math.min(p.count,o.start+o.count);for(let w=v,b=y-1;w<b;w+=d){let S=p.getX(w),T=p.getX(w+1);if(c.fromBufferAttribute(g,S),h.fromBufferAttribute(g,T),Qm.distanceSqToSegment(c,h,f,u)>l)continue;f.applyMatrix4(this.matrixWorld);let x=e.ray.origin.distanceTo(f);x<e.near||x>e.far||t.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{let v=Math.max(0,o.start),y=Math.min(g.count,o.start+o.count);for(let w=v,b=y-1;w<b;w+=d){if(c.fromBufferAttribute(g,w),h.fromBufferAttribute(g,w+1),Qm.distanceSqToSegment(c,h,f,u)>l)continue;f.applyMatrix4(this.matrixWorld);let T=e.ray.origin.distanceTo(f);T<e.near||T>e.far||t.push({distance:T,point:u.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,r=Object.keys(t);if(r.length>0){let n=t[r[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s<o;s++){let a=n[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{let t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};os.prototype.isLine=!0;var Y0=new M,X0=new M,li=class extends os{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,r=[];for(let n=0,s=t.count;n<s;n+=2)Y0.fromBufferAttribute(t,n),X0.fromBufferAttribute(t,n+1),r[n]=n===0?0:r[n-1],r[n+1]=r[n]+Y0.distanceTo(X0);e.setAttribute("lineDistance",new Te(r,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}};li.prototype.isLineSegments=!0;var xg=class extends os{constructor(e,t){super(e,t),this.type="LineLoop"}};xg.prototype.isLineLoop=!0;var eh=class extends ur{constructor(e){super(),this.type="PointsMaterial",this.color=new be(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,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.fog=e.fog,this}};eh.prototype.isPointsMaterial=!0;var Q0=new Ae,bg=new oi,Zu=new Lr,$u=new M,wg=class extends ot{constructor(e=new De,t=new eh){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){let r=this.geometry,n=this.matrixWorld,s=e.params.Points.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Zu.copy(r.boundingSphere),Zu.applyMatrix4(n),Zu.radius+=s,e.ray.intersectsSphere(Zu)===!1)return;Q0.copy(n).invert(),bg.copy(e.ray).applyMatrix4(Q0);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(r.isBufferGeometry){let c=r.index,u=r.attributes.position;if(c!==null){let f=Math.max(0,o.start),d=Math.min(c.count,o.start+o.count);for(let p=f,m=d;p<m;p++){let g=c.getX(p);$u.fromBufferAttribute(u,g),J0($u,g,l,n,e,t,this)}}else{let f=Math.max(0,o.start),d=Math.min(u.count,o.start+o.count);for(let p=f,m=d;p<m;p++)$u.fromBufferAttribute(u,p),J0($u,p,l,n,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,r=Object.keys(t);if(r.length>0){let n=t[r[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s<o;s++){let a=n[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{let t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};wg.prototype.isPoints=!0;function J0(i,e,t,r,n,s,o){let a=bg.distanceSqToPoint(i);if(a<t){let l=new M;bg.closestPointToPoint(i,l),l.applyMatrix4(r);let c=n.ray.origin.distanceTo(l);if(c<n.near||c>n.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var th=class extends Pt{constructor(e,t,r,n,s,o,a,l,c){super(e,t,r,n,s,o,a,l,c),this.minFilter=o!==void 0?o:ct,this.magFilter=s!==void 0?s:ct,this.generateMipmaps=!1;let h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};th.prototype.isVideoTexture=!0;var Sg=class extends Pt{constructor(e,t,r){super({width:e,height:t}),this.format=r,this.magFilter=hr,this.minFilter=hr,this.generateMipmaps=!1,this.needsUpdate=!0}};Sg.prototype.isFramebufferTexture=!0;var Mg=class extends Pt{constructor(e,t,r,n,s,o,a,l,c,h,u,f){super(null,o,a,l,c,h,n,s,u,f),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};Mg.prototype.isCompressedTexture=!0;var Ag=class extends Pt{constructor(e,t,r,n,s,o,a,l,c){super(e,t,r,n,s,o,a,l,c),this.needsUpdate=!0}};Ag.prototype.isCanvasTexture=!0;var xn=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){let 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;let t=[],r,n=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(n),t.push(s),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let r=this.getLengths(),n=0,s=r.length,o;t?o=t:o=e*r[s-1];let a=0,l=s-1,c;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),c=r[n]-o,c<0)a=n+1;else if(c>0)l=n-1;else{l=n;break}if(n=l,r[n]===o)return n/(s-1);let h=r[n],f=r[n+1]-h,d=(o-h)/f;return(n+d)/(s-1)}getTangent(e,t){let n=e-1e-4,s=e+1e-4;n<0&&(n=0),s>1&&(s=1);let o=this.getPoint(n),a=this.getPoint(s),l=t||(o.isVector2?new B:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){let r=new M,n=[],s=[],o=[],a=new M,l=new Ae;for(let d=0;d<=e;d++){let p=d/e;n[d]=this.getTangentAt(p,new M)}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,h=Math.abs(n[0].x),u=Math.abs(n[0].y),f=Math.abs(n[0].z);h<=c&&(c=h,r.set(1,0,0)),u<=c&&(c=u,r.set(0,1,0)),f<=c&&r.set(0,0,1),a.crossVectors(n[0],r).normalize(),s[0].crossVectors(n[0],a),o[0].crossVectors(n[0],s[0]);for(let d=1;d<=e;d++){if(s[d]=s[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(n[d-1],n[d]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(xr(n[d-1].dot(n[d]),-1,1));s[d].applyMatrix4(l.makeRotationAxis(a,p))}o[d].crossVectors(n[d],s[d])}if(t===!0){let d=Math.acos(xr(s[0].dot(s[e]),-1,1));d/=e,n[0].dot(a.crossVectors(s[0],s[e]))>0&&(d=-d);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(n[p],d*p)),o[p].crossVectors(n[p],s[p])}return{tangents:n,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let 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}},Us=class extends xn{constructor(e=0,t=0,r=1,n=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let r=t||new B,n=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=n;for(;s>n;)s-=n;s<Number.EPSILON&&(o?s=0:s=n),this.aClockwise===!0&&!o&&(s===n?s=-n:s=s-n);let a=this.aStartAngle+e*s,l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){let h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),f=l-this.aX,d=c-this.aY;l=f*h-d*u+this.aX,c=f*u+d*h+this.aY}return r.set(l,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(){let 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}};Us.prototype.isEllipseCurve=!0;var Sf=class extends Us{constructor(e,t,r,n,s,o){super(e,t,r,r,n,s,o),this.type="ArcCurve"}};Sf.prototype.isArcCurve=!0;function ry(){let i=0,e=0,t=0,r=0;function n(s,o,a,l){i=s,e=a,t=-3*s+3*o-2*a-l,r=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,c){n(o,a,c*(a-s),c*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,c,h,u){let f=(o-s)/c-(a-s)/(c+h)+(a-o)/h,d=(a-o)/h-(l-o)/(h+u)+(l-a)/u;f*=h,d*=h,n(o,a,f,d)},calc:function(s){let o=s*s,a=o*s;return i+e*s+t*o+r*a}}}var ef=new M,Jm=new ry,Km=new ry,Zm=new ry,Mf=class extends xn{constructor(e=[],t=!1,r="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=n}getPoint(e,t=new M){let r=t,n=this.points,s=n.length,o=(s-(this.closed?0:1))*e,a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,h;this.closed||a>0?c=n[(a-1)%s]:(ef.subVectors(n[0],n[1]).add(n[0]),c=ef);let u=n[a%s],f=n[(a+1)%s];if(this.closed||a+2<s?h=n[(a+2)%s]:(ef.subVectors(n[s-1],n[s-2]).add(n[s-1]),h=ef),this.curveType==="centripetal"||this.curveType==="chordal"){let d=this.curveType==="chordal"?.5:.25,p=Math.pow(c.distanceToSquared(u),d),m=Math.pow(u.distanceToSquared(f),d),g=Math.pow(f.distanceToSquared(h),d);m<1e-4&&(m=1),p<1e-4&&(p=m),g<1e-4&&(g=m),Jm.initNonuniformCatmullRom(c.x,u.x,f.x,h.x,p,m,g),Km.initNonuniformCatmullRom(c.y,u.y,f.y,h.y,p,m,g),Zm.initNonuniformCatmullRom(c.z,u.z,f.z,h.z,p,m,g)}else this.curveType==="catmullrom"&&(Jm.initCatmullRom(c.x,u.x,f.x,h.x,this.tension),Km.initCatmullRom(c.y,u.y,f.y,h.y,this.tension),Zm.initCatmullRom(c.z,u.z,f.z,h.z,this.tension));return r.set(Jm.calc(l),Km.calc(l),Zm.calc(l)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){let n=this.points[t];e.points.push(n.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,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(new M().fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};Mf.prototype.isCatmullRomCurve3=!0;function K0(i,e,t,r,n){let s=(r-e)*.5,o=(n-t)*.5,a=i*i,l=i*a;return(2*t-2*r+s+o)*l+(-3*t+3*r-2*s-o)*a+s*i+t}function FL(i,e){let t=1-i;return t*t*e}function UL(i,e){return 2*(1-i)*i*e}function zL(i,e){return i*i*e}function Gc(i,e,t,r){return FL(i,e)+UL(i,t)+zL(i,r)}function GL(i,e){let t=1-i;return t*t*t*e}function kL(i,e){let t=1-i;return 3*t*t*i*e}function VL(i,e){return 3*(1-i)*i*i*e}function HL(i,e){return i*i*i*e}function kc(i,e,t,r,n){return GL(i,e)+kL(i,t)+VL(i,r)+HL(i,n)}var an=class extends xn{constructor(e=new B,t=new B,r=new B,n=new B){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new B){let r=t,n=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(kc(e,n.x,s.x,o.x,a.x),kc(e,n.y,s.y,o.y,a.y)),r}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(){let 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}};an.prototype.isCubicBezierCurve=!0;var Af=class extends xn{constructor(e=new M,t=new M,r=new M,n=new M){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new M){let r=t,n=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set(kc(e,n.x,s.x,o.x,a.x),kc(e,n.y,s.y,o.y,a.y),kc(e,n.z,s.z,o.z,a.z)),r}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(){let 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}};Af.prototype.isCubicBezierCurve3=!0;var ln=class extends xn{constructor(e=new B,t=new B){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new B){let r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){let r=t||new B;return r.copy(this.v2).sub(this.v1).normalize(),r}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let 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}};ln.prototype.isLineCurve=!0;var rh=class extends xn{constructor(e=new M,t=new M){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new M){let r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}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(){let 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}},kn=class extends xn{constructor(e=new B,t=new B,r=new B){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new B){let r=t,n=this.v0,s=this.v1,o=this.v2;return r.set(Gc(e,n.x,s.x,o.x),Gc(e,n.y,s.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let 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}};kn.prototype.isQuadraticBezierCurve=!0;var Tf=class extends xn{constructor(e=new M,t=new M,r=new M){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new M){let r=t,n=this.v0,s=this.v1,o=this.v2;return r.set(Gc(e,n.x,s.x,o.x),Gc(e,n.y,s.y,o.y),Gc(e,n.z,s.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let 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}};Tf.prototype.isQuadraticBezierCurve3=!0;var Do=class extends xn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new B){let r=t,n=this.points,s=(n.length-1)*e,o=Math.floor(s),a=s-o,l=n[o===0?o:o-1],c=n[o],h=n[o>n.length-2?n.length-1:o+1],u=n[o>n.length-3?n.length-1:o+2];return r.set(K0(a,l.x,c.x,h.x,u.x),K0(a,l.y,c.y,h.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){let n=e.points[t];this.points.push(new B().fromArray(n))}return this}};Do.prototype.isSplineCurve=!0;var Db=Object.freeze({__proto__:null,ArcCurve:Sf,CatmullRomCurve3:Mf,CubicBezierCurve:an,CubicBezierCurve3:Af,EllipseCurve:Us,LineCurve:ln,LineCurve3:rh,QuadraticBezierCurve:kn,QuadraticBezierCurve3:Tf,SplineCurve:Do}),Tg=class extends xn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ln(t,e))}getPoint(e,t){let r=e*this.getLength(),n=this.getCurveLengths(),s=0;for(;s<n.length;){if(n[s]>=r){let o=n[s]-r,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){let 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;let e=[],t=0;for(let r=0,n=this.curves.length;r<n;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t=[],r;for(let n=0,s=this.curves;n<s.length;n++){let o=s[n],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){let h=l[c];r&&r.equals(h)||(t.push(h),r=h)}}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,r=e.curves.length;t<r;t++){let n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){let n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){let n=e.curves[t];this.curves.push(new Db[n.type]().fromJSON(n))}return this}},Fa=class extends Tg{constructor(e){super(),this.type="Path",this.currentPoint=new B,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let r=new ln(this.currentPoint.clone(),new B(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,n){let s=new kn(this.currentPoint.clone(),new B(e,t),new B(r,n));return this.curves.push(s),this.currentPoint.set(r,n),this}bezierCurveTo(e,t,r,n,s,o){let a=new an(this.currentPoint.clone(),new B(e,t),new B(r,n),new B(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),r=new Do(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,n,s,o){let a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,r,n,s,o),this}absarc(e,t,r,n,s,o){return this.absellipse(e,t,r,r,n,s,o),this}ellipse(e,t,r,n,s,o,a,l){let c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+c,t+h,r,n,s,o,a,l),this}absellipse(e,t,r,n,s,o,a,l){let c=new Us(e,t,r,n,s,o,a,l);if(this.curves.length>0){let u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);let h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Ua=class extends De{constructor(e=[new B(0,.5),new B(.5,0),new B(0,-.5)],t=12,r=0,n=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t),n=xr(n,0,Math.PI*2);let s=[],o=[],a=[],l=[],c=[],h=1/t,u=new M,f=new B,d=new M,p=new M,m=new M,g=0,v=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,v=e[y+1].y-e[y].y,d.x=v*1,d.y=-g,d.z=v*0,m.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(m.x,m.y,m.z);break;default:g=e[y+1].x-e[y].x,v=e[y+1].y-e[y].y,d.x=v*1,d.y=-g,d.z=v*0,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),l.push(d.x,d.y,d.z),m.copy(p)}for(let y=0;y<=t;y++){let w=r+y*h*n,b=Math.sin(w),S=Math.cos(w);for(let T=0;T<=e.length-1;T++){u.x=e[T].x*b,u.y=e[T].y,u.z=e[T].x*S,o.push(u.x,u.y,u.z),f.x=y/t,f.y=T/(e.length-1),a.push(f.x,f.y);let A=l[3*T+0]*b,x=l[3*T+1],_=l[3*T+0]*S;c.push(A,x,_)}}for(let y=0;y<t;y++)for(let w=0;w<e.length-1;w++){let b=w+y*e.length,S=b,T=b+e.length,A=b+e.length+1,x=b+1;s.push(S,T,x),s.push(A,x,T)}this.setIndex(s),this.setAttribute("position",new Te(o,3)),this.setAttribute("uv",new Te(a,2)),this.setAttribute("normal",new Te(c,3))}static fromJSON(e){return new Ua(e.points,e.segments,e.phiStart,e.phiLength)}};var Lo=class extends De{constructor(e=1,t=1,r=1,n=8,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;n=Math.floor(n),s=Math.floor(s);let h=[],u=[],f=[],d=[],p=0,m=[],g=r/2,v=0;y(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(h),this.setAttribute("position",new Te(u,3)),this.setAttribute("normal",new Te(f,3)),this.setAttribute("uv",new Te(d,2));function y(){let b=new M,S=new M,T=0,A=(t-e)/r;for(let x=0;x<=s;x++){let _=[],E=x/s,C=E*(t-e)+e;for(let I=0;I<=n;I++){let N=I/n,R=N*l+a,k=Math.sin(R),G=Math.cos(R);S.x=C*k,S.y=-E*r+g,S.z=C*G,u.push(S.x,S.y,S.z),b.set(k,A,G).normalize(),f.push(b.x,b.y,b.z),d.push(N,1-E),_.push(p++)}m.push(_)}for(let x=0;x<n;x++)for(let _=0;_<s;_++){let E=m[_][x],C=m[_+1][x],I=m[_+1][x+1],N=m[_][x+1];h.push(E,C,N),h.push(C,I,N),T+=6}c.addGroup(v,T,0),v+=T}function w(b){let S=p,T=new B,A=new M,x=0,_=b===!0?e:t,E=b===!0?1:-1;for(let I=1;I<=n;I++)u.push(0,g*E,0),f.push(0,E,0),d.push(.5,.5),p++;let C=p;for(let I=0;I<=n;I++){let R=I/n*l+a,k=Math.cos(R),G=Math.sin(R);A.x=_*G,A.y=g*E,A.z=_*k,u.push(A.x,A.y,A.z),f.push(0,E,0),T.x=k*.5+.5,T.y=G*.5*E+.5,d.push(T.x,T.y),p++}for(let I=0;I<n;I++){let N=S+I,R=C+I;b===!0?h.push(R,R+1,N):h.push(R+1,R,N),x+=3}c.addGroup(v,x,b===!0?1:2),v+=x}}static fromJSON(e){return new Lo(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},za=class extends Lo{constructor(e=1,t=1,r=8,n=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,r,n,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new za(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},Ga=class extends De{constructor(e=[],t=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n};let s=[],o=[];a(n),c(r),h(),this.setAttribute("position",new Te(s,3)),this.setAttribute("normal",new Te(s.slice(),3)),this.setAttribute("uv",new Te(o,2)),n===0?this.computeVertexNormals():this.normalizeNormals();function a(y){let w=new M,b=new M,S=new M;for(let T=0;T<t.length;T+=3)d(t[T+0],w),d(t[T+1],b),d(t[T+2],S),l(w,b,S,y)}function l(y,w,b,S){let T=S+1,A=[];for(let x=0;x<=T;x++){A[x]=[];let _=y.clone().lerp(b,x/T),E=w.clone().lerp(b,x/T),C=T-x;for(let I=0;I<=C;I++)I===0&&x===T?A[x][I]=_:A[x][I]=_.clone().lerp(E,I/C)}for(let x=0;x<T;x++)for(let _=0;_<2*(T-x)-1;_++){let E=Math.floor(_/2);_%2===0?(f(A[x][E+1]),f(A[x+1][E]),f(A[x][E])):(f(A[x][E+1]),f(A[x+1][E+1]),f(A[x+1][E]))}}function c(y){let w=new M;for(let b=0;b<s.length;b+=3)w.x=s[b+0],w.y=s[b+1],w.z=s[b+2],w.normalize().multiplyScalar(y),s[b+0]=w.x,s[b+1]=w.y,s[b+2]=w.z}function h(){let y=new M;for(let w=0;w<s.length;w+=3){y.x=s[w+0],y.y=s[w+1],y.z=s[w+2];let b=g(y)/2/Math.PI+.5,S=v(y)/Math.PI+.5;o.push(b,1-S)}p(),u()}function u(){for(let y=0;y<o.length;y+=6){let w=o[y+0],b=o[y+2],S=o[y+4],T=Math.max(w,b,S),A=Math.min(w,b,S);T>.9&&A<.1&&(w<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),S<.2&&(o[y+4]+=1))}}function f(y){s.push(y.x,y.y,y.z)}function d(y,w){let b=y*3;w.x=e[b+0],w.y=e[b+1],w.z=e[b+2]}function p(){let y=new M,w=new M,b=new M,S=new M,T=new B,A=new B,x=new B;for(let _=0,E=0;_<s.length;_+=9,E+=6){y.set(s[_+0],s[_+1],s[_+2]),w.set(s[_+3],s[_+4],s[_+5]),b.set(s[_+6],s[_+7],s[_+8]),T.set(o[E+0],o[E+1]),A.set(o[E+2],o[E+3]),x.set(o[E+4],o[E+5]),S.copy(y).add(w).add(b).divideScalar(3);let C=g(S);m(T,E+0,y,C),m(A,E+2,w,C),m(x,E+4,b,C)}}function m(y,w,b,S){S<0&&y.x===1&&(o[w]=y.x-1),b.x===0&&b.z===0&&(o[w]=S/2/Math.PI+.5)}function g(y){return Math.atan2(y.z,-y.x)}function v(y){return Math.atan2(-y.y,Math.sqrt(y.x*y.x+y.z*y.z))}}static fromJSON(e){return new Ga(e.vertices,e.indices,e.radius,e.details)}},ka=class extends Ga{constructor(e=1,t=0){let r=(1+Math.sqrt(5))/2,n=1/r,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,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],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 ka(e.radius,e.detail)}},xG=new M,bG=new M,wG=new M,SG=new Jt;var rn=class extends Fa{constructor(e){super(e),this.uuid=Un(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let r=0,n=this.holes.length;r<n;r++)t[r]=this.holes[r].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,r=e.holes.length;t<r;t++){let n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){let n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){let n=e.holes[t];this.holes.push(new Fa().fromJSON(n))}return this}},WL={triangulate:function(i,e,t=2){let r=e&&e.length,n=r?e[0]*t:i.length,s=Lb(i,0,n,t,!0),o=[];if(!s||s.next===s.prev)return o;let a,l,c,h,u,f,d;if(r&&(s=QL(i,e,s,t)),i.length>80*t){a=c=i[0],l=h=i[1];for(let p=t;p<n;p+=t)u=i[p],f=i[p+1],u<a&&(a=u),f<l&&(l=f),u>c&&(c=u),f>h&&(h=f);d=Math.max(c-a,h-l),d=d!==0?1/d:0}return nh(s,o,t,a,l,d),o}};function Lb(i,e,t,r,n){let s,o;if(n===o2(i,e,t,r)>0)for(s=e;s<t;s+=r)o=Z0(s,i[s],i[s+1],o);else for(s=t-r;s>=e;s-=r)o=Z0(s,i[s],i[s+1],o);return o&&ed(o,o.next)&&(sh(o),o=o.next),o}function zs(i,e){if(!i)return i;e||(e=i);let t=i,r;do if(r=!1,!t.steiner&&(ed(t,t.next)||tr(t.prev,t,t.next)===0)){if(sh(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function nh(i,e,t,r,n,s,o){if(!i)return;!o&&s&&e2(i,r,n,s);let a=i,l,c;for(;i.prev!==i.next;){if(l=i.prev,c=i.next,s?qL(i,r,n,s):jL(i)){e.push(l.i/t),e.push(i.i/t),e.push(c.i/t),sh(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=YL(zs(i),e,t),nh(i,e,t,r,n,s,2)):o===2&&XL(i,e,t,r,n,s):nh(zs(i),e,t,r,n,s,1);break}}}function jL(i){let e=i.prev,t=i,r=i.next;if(tr(e,t,r)>=0)return!1;let n=i.next.next;for(;n!==i.prev;){if(Da(e.x,e.y,t.x,t.y,r.x,r.y,n.x,n.y)&&tr(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function qL(i,e,t,r){let n=i.prev,s=i,o=i.next;if(tr(n,s,o)>=0)return!1;let a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,h=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,u=_g(a,l,e,t,r),f=_g(c,h,e,t,r),d=i.prevZ,p=i.nextZ;for(;d&&d.z>=u&&p&&p.z<=f;){if(d!==i.prev&&d!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,d.x,d.y)&&tr(d.prev,d,d.next)>=0||(d=d.prevZ,p!==i.prev&&p!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&tr(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;d&&d.z>=u;){if(d!==i.prev&&d!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,d.x,d.y)&&tr(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==i.prev&&p!==i.next&&Da(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&tr(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function YL(i,e,t){let r=i;do{let n=r.prev,s=r.next.next;!ed(n,s)&&Ib(n,r,r.next,s)&&ih(n,s)&&ih(s,n)&&(e.push(n.i/t),e.push(r.i/t),e.push(s.i/t),sh(r),sh(r.next),r=i=s),r=r.next}while(r!==i);return zs(r)}function XL(i,e,t,r,n,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&n2(o,a)){let l=Rb(o,a);o=zs(o,o.next),l=zs(l,l.next),nh(o,e,t,r,n,s),nh(l,e,t,r,n,s);return}a=a.next}o=o.next}while(o!==i)}function QL(i,e,t,r){let n=[],s,o,a,l,c;for(s=0,o=e.length;s<o;s++)a=e[s]*r,l=s<o-1?e[s+1]*r:i.length,c=Lb(i,a,l,r,!1),c===c.next&&(c.steiner=!0),n.push(r2(c));for(n.sort(JL),s=0;s<n.length;s++)KL(n[s],t),t=zs(t,t.next);return t}function JL(i,e){return i.x-e.x}function KL(i,e){if(e=ZL(i,e),e){let t=Rb(e,i);zs(e,e.next),zs(t,t.next)}}function ZL(i,e){let t=e,r=i.x,n=i.y,s=-1/0,o;do{if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){let f=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=r&&f>s){if(s=f,f===r){if(n===t.y)return t;if(n===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(r===s)return o;let a=o,l=o.x,c=o.y,h=1/0,u;t=o;do r>=t.x&&t.x>=l&&r!==t.x&&Da(n<c?r:s,n,l,c,n<c?s:r,n,t.x,t.y)&&(u=Math.abs(n-t.y)/(r-t.x),ih(t,i)&&(u<h||u===h&&(t.x>o.x||t.x===o.x&&$L(o,t)))&&(o=t,h=u)),t=t.next;while(t!==a);return o}function $L(i,e){return tr(i.prev,i,e.prev)<0&&tr(e.next,i,i.next)<0}function e2(i,e,t,r){let n=i;do n.z===null&&(n.z=_g(n.x,n.y,e,t,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==i);n.prevZ.nextZ=null,n.prevZ=null,t2(n)}function t2(i){let e,t,r,n,s,o,a,l,c=1;do{for(t=i,i=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e<c&&(a++,r=r.nextZ,!!r);e++);for(l=c;a>0||l>0&&r;)a!==0&&(l===0||!r||t.z<=r.z)?(n=t,t=t.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:i=n,n.prevZ=s,s=n;t=r}s.nextZ=null,c*=2}while(o>1);return i}function _g(i,e,t,r,n){return i=32767*(i-t)*n,e=32767*(e-r)*n,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function r2(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Da(i,e,t,r,n,s,o,a){return(n-o)*(e-a)-(i-o)*(s-a)>=0&&(i-o)*(r-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(n-o)*(r-a)>=0}function n2(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!i2(i,e)&&(ih(i,e)&&ih(e,i)&&s2(i,e)&&(tr(i.prev,i,e.prev)||tr(i,e.prev,e))||ed(i,e)&&tr(i.prev,i,i.next)>0&&tr(e.prev,e,e.next)>0)}function tr(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function ed(i,e){return i.x===e.x&&i.y===e.y}function Ib(i,e,t,r){let n=rf(tr(i,e,t)),s=rf(tr(i,e,r)),o=rf(tr(t,r,i)),a=rf(tr(t,r,e));return!!(n!==s&&o!==a||n===0&&tf(i,t,e)||s===0&&tf(i,r,e)||o===0&&tf(t,i,r)||a===0&&tf(t,e,r))}function tf(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function rf(i){return i>0?1:i<0?-1:0}function i2(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&Ib(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function ih(i,e){return tr(i.prev,i,i.next)<0?tr(i,e,i.next)>=0&&tr(i,i.prev,e)>=0:tr(i,e,i.prev)<0||tr(i,i.next,e)<0}function s2(i,e){let t=i,r=!1,n=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==i);return r}function Rb(i,e){let t=new Eg(i.i,i.x,i.y),r=new Eg(e.i,e.x,e.y),n=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=n,n.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function Z0(i,e,t,r){let n=new Eg(i,e,t);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function sh(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Eg(i,e,t){this.i=i,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 o2(i,e,t,r){let n=0;for(let s=e,o=t-r;s<t;s+=r)n+=(i[o]-i[s])*(i[s+1]+i[o+1]),o=s;return n}var ii=class{static area(e){let t=e.length,r=0;for(let n=t-1,s=0;s<t;n=s++)r+=e[n].x*e[s].y-e[s].x*e[n].y;return r*.5}static isClockWise(e){return ii.area(e)<0}static triangulateShape(e,t){let r=[],n=[],s=[];$0(e),eb(r,e);let o=e.length;t.forEach($0);for(let l=0;l<t.length;l++)n.push(o),o+=t[l].length,eb(r,t[l]);let a=WL.triangulate(r,n);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}};function $0(i){let e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function eb(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}var Gs=class extends De{constructor(e=new rn([new B(.5,.5),new B(-.5,.5),new B(-.5,-.5),new B(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let r=this,n=[],s=[];for(let a=0,l=e.length;a<l;a++){let c=e[a];o(c)}this.setAttribute("position",new Te(n,3)),this.setAttribute("uv",new Te(s,2)),this.computeVertexNormals();function o(a){let l=[],c=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,u=t.depth!==void 0?t.depth:1,f=t.bevelEnabled!==void 0?t.bevelEnabled:!0,d=t.bevelThickness!==void 0?t.bevelThickness:.2,p=t.bevelSize!==void 0?t.bevelSize:d-.1,m=t.bevelOffset!==void 0?t.bevelOffset:0,g=t.bevelSegments!==void 0?t.bevelSegments:3,v=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:a2;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=t.amount);let w,b=!1,S,T,A,x;v&&(w=v.getSpacedPoints(h),b=!0,f=!1,S=v.computeFrenetFrames(h,!1),T=new M,A=new M,x=new M),f||(g=0,d=0,p=0,m=0);let _=a.extractPoints(c),E=_.shape,C=_.holes;if(!ii.isClockWise(E)){E=E.reverse();for(let Z=0,W=C.length;Z<W;Z++){let $=C[Z];ii.isClockWise($)&&(C[Z]=$.reverse())}}let N=ii.triangulateShape(E,C),R=E;for(let Z=0,W=C.length;Z<W;Z++){let $=C[Z];E=E.concat($)}function k(Z,W,$){return W||console.error("THREE.ExtrudeGeometry: vec does not exist"),W.clone().multiplyScalar($).add(Z)}let G=E.length,K=N.length;function J(Z,W,$){let ce,oe,me,ve=Z.x-W.x,ge=Z.y-W.y,Le=$.x-Z.x,ke=$.y-Z.y,L=ve*ve+ge*ge,P=ve*ke-ge*Le;if(Math.abs(P)>Number.EPSILON){let re=Math.sqrt(L),ye=Math.sqrt(Le*Le+ke*ke),Se=W.x-ge/re,Ie=W.y+ve/re,Fe=$.x-ke/ye,fe=$.y+Le/ye,rt=((Fe-Se)*ke-(fe-Ie)*Le)/(ve*ke-ge*Le);ce=Se+ve*rt-Z.x,oe=Ie+ge*rt-Z.y;let st=ce*ce+oe*oe;if(st<=2)return new B(ce,oe);me=Math.sqrt(st/2)}else{let re=!1;ve>Number.EPSILON?Le>Number.EPSILON&&(re=!0):ve<-Number.EPSILON?Le<-Number.EPSILON&&(re=!0):Math.sign(ge)===Math.sign(ke)&&(re=!0),re?(ce=-ge,oe=ve,me=Math.sqrt(L)):(ce=ve,oe=ge,me=Math.sqrt(L/2))}return new B(ce/me,oe/me)}let Y=[];for(let Z=0,W=R.length,$=W-1,ce=Z+1;Z<W;Z++,$++,ce++)$===W&&($=0),ce===W&&(ce=0),Y[Z]=J(R[Z],R[$],R[ce]);let F=[],U,O=Y.concat();for(let Z=0,W=C.length;Z<W;Z++){let $=C[Z];U=[];for(let ce=0,oe=$.length,me=oe-1,ve=ce+1;ce<oe;ce++,me++,ve++)me===oe&&(me=0),ve===oe&&(ve=0),U[ce]=J($[ce],$[me],$[ve]);F.push(U),O=O.concat(U)}for(let Z=0;Z<g;Z++){let W=Z/g,$=d*Math.cos(W*Math.PI/2),ce=p*Math.sin(W*Math.PI/2)+m;for(let oe=0,me=R.length;oe<me;oe++){let ve=k(R[oe],Y[oe],ce);he(ve.x,ve.y,-$)}for(let oe=0,me=C.length;oe<me;oe++){let ve=C[oe];U=F[oe];for(let ge=0,Le=ve.length;ge<Le;ge++){let ke=k(ve[ge],U[ge],ce);he(ke.x,ke.y,-$)}}}let j=p+m;for(let Z=0;Z<G;Z++){let W=f?k(E[Z],O[Z],j):E[Z];b?(A.copy(S.normals[0]).multiplyScalar(W.x),T.copy(S.binormals[0]).multiplyScalar(W.y),x.copy(w[0]).add(A).add(T),he(x.x,x.y,x.z)):he(W.x,W.y,0)}for(let Z=1;Z<=h;Z++)for(let W=0;W<G;W++){let $=f?k(E[W],O[W],j):E[W];b?(A.copy(S.normals[Z]).multiplyScalar($.x),T.copy(S.binormals[Z]).multiplyScalar($.y),x.copy(w[Z]).add(A).add(T),he(x.x,x.y,x.z)):he($.x,$.y,u/h*Z)}for(let Z=g-1;Z>=0;Z--){let W=Z/g,$=d*Math.cos(W*Math.PI/2),ce=p*Math.sin(W*Math.PI/2)+m;for(let oe=0,me=R.length;oe<me;oe++){let ve=k(R[oe],Y[oe],ce);he(ve.x,ve.y,u+$)}for(let oe=0,me=C.length;oe<me;oe++){let ve=C[oe];U=F[oe];for(let ge=0,Le=ve.length;ge<Le;ge++){let ke=k(ve[ge],U[ge],ce);b?he(ke.x,ke.y+w[h-1].y,w[h-1].x+$):he(ke.x,ke.y,u+$)}}}H(),X();function H(){let Z=n.length/3;if(f){let W=0,$=G*W;for(let ce=0;ce<K;ce++){let oe=N[ce];ie(oe[2]+$,oe[1]+$,oe[0]+$)}W=h+g*2,$=G*W;for(let ce=0;ce<K;ce++){let oe=N[ce];ie(oe[0]+$,oe[1]+$,oe[2]+$)}}else{for(let W=0;W<K;W++){let $=N[W];ie($[2],$[1],$[0])}for(let W=0;W<K;W++){let $=N[W];ie($[0]+G*h,$[1]+G*h,$[2]+G*h)}}r.addGroup(Z,n.length/3-Z,0)}function X(){let Z=n.length/3,W=0;V(R,W),W+=R.length;for(let $=0,ce=C.length;$<ce;$++){let oe=C[$];V(oe,W),W+=oe.length}r.addGroup(Z,n.length/3-Z,1)}function V(Z,W){let $=Z.length;for(;--$>=0;){let ce=$,oe=$-1;oe<0&&(oe=Z.length-1);for(let me=0,ve=h+g*2;me<ve;me++){let ge=G*me,Le=G*(me+1),ke=W+ce+ge,L=W+oe+ge,P=W+oe+Le,re=W+ce+Le;le(ke,L,P,re)}}}function he(Z,W,$){l.push(Z),l.push(W),l.push($)}function ie(Z,W,$){q(Z),q(W),q($);let ce=n.length/3,oe=y.generateTopUV(r,n,ce-3,ce-2,ce-1);ue(oe[0]),ue(oe[1]),ue(oe[2])}function le(Z,W,$,ce){q(Z),q(W),q(ce),q(W),q($),q(ce);let oe=n.length/3,me=y.generateSideWallUV(r,n,oe-6,oe-3,oe-2,oe-1);ue(me[0]),ue(me[1]),ue(me[3]),ue(me[1]),ue(me[2]),ue(me[3])}function q(Z){n.push(l[Z*3+0]),n.push(l[Z*3+1]),n.push(l[Z*3+2])}function ue(Z){s.push(Z.x),s.push(Z.y)}}}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return l2(t,r,e)}static fromJSON(e,t){let r=[];for(let s=0,o=e.shapes.length;s<o;s++){let a=t[e.shapes[s]];r.push(a)}let n=e.options.extrudePath;return n!==void 0&&(e.options.extrudePath=new Db[n.type]().fromJSON(n)),new Gs(r,e.options)}},a2={generateTopUV:function(i,e,t,r,n){let s=e[t*3],o=e[t*3+1],a=e[r*3],l=e[r*3+1],c=e[n*3],h=e[n*3+1];return[new B(s,o),new B(a,l),new B(c,h)]},generateSideWallUV:function(i,e,t,r,n,s){let o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[r*3],h=e[r*3+1],u=e[r*3+2],f=e[n*3],d=e[n*3+1],p=e[n*3+2],m=e[s*3],g=e[s*3+1],v=e[s*3+2];return Math.abs(a-h)<Math.abs(o-c)?[new B(o,1-l),new B(c,1-u),new B(f,1-p),new B(m,1-v)]:[new B(a,1-l),new B(h,1-u),new B(d,1-p),new B(g,1-v)]}};function l2(i,e,t){if(t.shapes=[],Array.isArray(i))for(let r=0,n=i.length;r<n;r++){let s=i[r];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}var Va=class extends Ga{constructor(e=1,t=0){let r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,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(n,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Va(e.radius,e.detail)}};var Io=class extends De{constructor(e=new rn([new B(0,.5),new B(-.5,-.5),new B(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let r=[],n=[],s=[],o=[],a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let h=0;h<e.length;h++)c(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(r),this.setAttribute("position",new Te(n,3)),this.setAttribute("normal",new Te(s,3)),this.setAttribute("uv",new Te(o,2));function c(h){let u=n.length/3,f=h.extractPoints(t),d=f.shape,p=f.holes;ii.isClockWise(d)===!1&&(d=d.reverse());for(let g=0,v=p.length;g<v;g++){let y=p[g];ii.isClockWise(y)===!0&&(p[g]=y.reverse())}let m=ii.triangulateShape(d,p);for(let g=0,v=p.length;g<v;g++){let y=p[g];d=d.concat(y)}for(let g=0,v=d.length;g<v;g++){let y=d[g];n.push(y.x,y.y,0),s.push(0,0,1),o.push(y.x,y.y)}for(let g=0,v=m.length;g<v;g++){let y=m[g],w=y[0]+u,b=y[1]+u,S=y[2]+u;r.push(w,b,S),l+=3}}}toJSON(){let e=super.toJSON(),t=this.parameters.shapes;return c2(t,e)}static fromJSON(e,t){let r=[];for(let n=0,s=e.shapes.length;n<s;n++){let o=t[e.shapes[n]];r.push(o)}return new Io(r,e.curveSegments)}};function c2(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,r=i.length;t<r;t++){let n=i[t];e.shapes.push(n.uuid)}else e.shapes.push(i.uuid);return e}var Ro=class extends De{constructor(e=1,t=32,r=16,n=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));let l=Math.min(o+a,Math.PI),c=0,h=[],u=new M,f=new M,d=[],p=[],m=[],g=[];for(let v=0;v<=r;v++){let y=[],w=v/r,b=0;v==0&&o==0?b=.5/t:v==r&&l==Math.PI&&(b=-.5/t);for(let S=0;S<=t;S++){let T=S/t;u.x=-e*Math.cos(n+T*s)*Math.sin(o+w*a),u.y=e*Math.cos(o+w*a),u.z=e*Math.sin(n+T*s)*Math.sin(o+w*a),p.push(u.x,u.y,u.z),f.copy(u).normalize(),m.push(f.x,f.y,f.z),g.push(T+b,1-w),y.push(c++)}h.push(y)}for(let v=0;v<r;v++)for(let y=0;y<t;y++){let w=h[v][y+1],b=h[v][y],S=h[v+1][y],T=h[v+1][y+1];(v!==0||o>0)&&d.push(w,b,T),(v!==r-1||l<Math.PI)&&d.push(b,S,T)}this.setIndex(d),this.setAttribute("position",new Te(p,3)),this.setAttribute("normal",new Te(m,3)),this.setAttribute("uv",new Te(g,2))}static fromJSON(e){return new Ro(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}};var Ha=class extends De{constructor(e=1,t=.4,r=64,n=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:s,q:o},r=Math.floor(r),n=Math.floor(n);let a=[],l=[],c=[],h=[],u=new M,f=new M,d=new M,p=new M,m=new M,g=new M,v=new M;for(let w=0;w<=r;++w){let b=w/r*s*Math.PI*2;y(b,s,o,e,d),y(b+.01,s,o,e,p),g.subVectors(p,d),v.addVectors(p,d),m.crossVectors(g,v),v.crossVectors(m,g),m.normalize(),v.normalize();for(let S=0;S<=n;++S){let T=S/n*Math.PI*2,A=-t*Math.cos(T),x=t*Math.sin(T);u.x=d.x+(A*v.x+x*m.x),u.y=d.y+(A*v.y+x*m.y),u.z=d.z+(A*v.z+x*m.z),l.push(u.x,u.y,u.z),f.subVectors(u,d).normalize(),c.push(f.x,f.y,f.z),h.push(w/r),h.push(S/n)}}for(let w=1;w<=r;w++)for(let b=1;b<=n;b++){let S=(n+1)*(w-1)+(b-1),T=(n+1)*w+(b-1),A=(n+1)*w+b,x=(n+1)*(w-1)+b;a.push(S,T,x),a.push(T,A,x)}this.setIndex(a),this.setAttribute("position",new Te(l,3)),this.setAttribute("normal",new Te(c,3)),this.setAttribute("uv",new Te(h,2));function y(w,b,S,T,A){let x=Math.cos(w),_=Math.sin(w),E=S/b*w,C=Math.cos(E);A.x=T*(2+C)*.5*x,A.y=T*(2+C)*_*.5,A.z=T*Math.sin(E)*.5}}static fromJSON(e){return new Ha(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}};var _f=class extends ur{constructor(e){super(),this.type="ShadowMaterial",this.color=new be(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}};_f.prototype.isShadowMaterial=!0;var Ef=class extends Mt{constructor(e){super(e),this.type="RawShaderMaterial"}};Ef.prototype.isRawShaderMaterial=!0;var oh=class extends ur{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new be(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 be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(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.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}};oh.prototype.isMeshStandardMaterial=!0;var Cf=class extends oh{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new B(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return xr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new be(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new be(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new be(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.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.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};Cf.prototype.isMeshPhysicalMaterial=!0;var Pf=class extends ur{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new be(16777215),this.specular=new be(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}};Pf.prototype.isMeshPhongMaterial=!0;var Df=class extends ur{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new be(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};Df.prototype.isMeshToonMaterial=!0;var Lf=class extends ur{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};Lf.prototype.isMeshNormalMaterial=!0;var If=class extends ur{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.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.fog=e.fog,this}};If.prototype.isMeshLambertMaterial=!0;var Rf=class extends ur{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new be(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xa,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}};Rf.prototype.isMeshMatcapMaterial=!0;var Bf=class extends kr{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}};Bf.prototype.isLineDashedMaterial=!0;var h2={ShadowMaterial:_f,SpriteMaterial:$c,RawShaderMaterial:Ef,ShaderMaterial:Mt,PointsMaterial:eh,MeshPhysicalMaterial:Cf,MeshStandardMaterial:oh,MeshPhongMaterial:Pf,MeshToonMaterial:Df,MeshNormalMaterial:Lf,MeshLambertMaterial:If,MeshDepthMaterial:Jc,MeshDistanceMaterial:Kc,MeshBasicMaterial:zn,MeshMatcapMaterial:Rf,LineDashedMaterial:Bf,LineBasicMaterial:kr,Material:ur};ur.fromType=function(i){return new h2[i]};var Qt={arraySlice:function(i,e,t){return Qt.isTypedArray(i)?new i.constructor(i.subarray(e,t!==void 0?t:i.length)):i.slice(e,t)},convertArray:function(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){function e(n,s){return i[n]-i[s]}let t=i.length,r=new Array(t);for(let n=0;n!==t;++n)r[n]=n;return r.sort(e),r},sortedArray:function(i,e,t){let r=i.length,n=new i.constructor(r);for(let s=0,o=0;o!==r;++s){let a=t[s]*e;for(let l=0;l!==e;++l)n[o++]=i[a+l]}return n},flattenJSON:function(i,e,t,r){let n=1,s=i[0];for(;s!==void 0&&s[r]===void 0;)s=i[n++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=i[n++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=i[n++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=i[n++];while(s!==void 0)},subclip:function(i,e,t,r,n=30){let s=i.clone();s.name=e;let o=[];for(let l=0;l<s.tracks.length;++l){let c=s.tracks[l],h=c.getValueSize(),u=[],f=[];for(let d=0;d<c.times.length;++d){let p=c.times[d]*n;if(!(p<t||p>=r)){u.push(c.times[d]);for(let m=0;m<h;++m)f.push(c.values[d*h+m])}}u.length!==0&&(c.times=Qt.convertArray(u,c.times.constructor),c.values=Qt.convertArray(f,c.values.constructor),o.push(c))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(i,e=0,t=i,r=30){r<=0&&(r=30);let n=t.tracks.length,s=e/r;for(let o=0;o<n;++o){let a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;let c=i.tracks.find(function(v){return v.name===a.name&&v.ValueTypeName===l});if(c===void 0)continue;let h=0,u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=u/3);let f=0,d=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=d/3);let p=a.times.length-1,m;if(s<=a.times[0]){let v=h,y=u-h;m=Qt.arraySlice(a.values,v,y)}else if(s>=a.times[p]){let v=p*u+h,y=v+u-h;m=Qt.arraySlice(a.values,v,y)}else{let v=a.createInterpolant(),y=h,w=u-h;v.evaluate(s),m=Qt.arraySlice(v.resultBuffer,y,w)}l==="quaternion"&&new zt().fromArray(m).normalize().conjugate().toArray(m);let g=c.times.length;for(let v=0;v<g;++v){let y=v*d+f;if(l==="quaternion")zt.multiplyQuaternionsFlat(c.values,y,m,0,c.values,y);else{let w=d-f*2;for(let b=0;b<w;++b)c.values[y+b]-=m[b]}}}return i.blendMode=yb,i}},Ci=class{constructor(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=n!==void 0?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,r=this._cachedIndex,n=t[r],s=t[r-1];e:{t:{let o;r:{n:if(!(e<n)){for(let a=r+2;;){if(n===void 0){if(e<s)break n;return r=t.length,this._cachedIndex=r,this.afterEnd_(r-1,e,s)}if(r===a)break;if(s=n,n=t[++r],e<n)break t}o=t.length;break r}if(!(e>=s)){let a=t[1];e<a&&(r=2,s=a);for(let l=r-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(r===l)break;if(n=s,s=t[--r-1],e>=s)break t}o=r,r=0;break r}break e}for(;r<o;){let a=r+o>>>1;e<t[a]?o=a:r=a+1}if(n=t[r],s=t[r-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(n===void 0)return r=t.length,this._cachedIndex=r,this.afterEnd_(r-1,s,e)}this._cachedIndex=r,this.intervalChanged_(r,s,n)}return this.interpolate_(r,s,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=e*n;for(let o=0;o!==n;++o)t[o]=r[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}};Ci.prototype.beforeStart_=Ci.prototype.copySampleValue_;Ci.prototype.afterEnd_=Ci.prototype.copySampleValue_;var Cg=class extends Ci{constructor(e,t,r,n){super(e,t,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ea,endingEnd:Ea}}intervalChanged_(e,t,r){let n=this.parameterPositions,s=e-2,o=e+1,a=n[s],l=n[o];if(a===void 0)switch(this.getSettings_().endingStart){case Ca:s=e,a=2*t-r;break;case ff:s=n.length-2,a=t+n[s]-n[s+1];break;default:s=e,a=r}if(l===void 0)switch(this.getSettings_().endingEnd){case Ca:o=e,l=2*r-t;break;case ff:o=1,l=r+n[1]-n[0];break;default:o=e-1,l=t}let c=(r-t)*.5,h=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-r),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(e,t,r,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=this._offsetPrev,u=this._offsetNext,f=this._weightPrev,d=this._weightNext,p=(r-t)/(n-t),m=p*p,g=m*p,v=-f*g+2*f*m-f*p,y=(1+f)*g+(-1.5-2*f)*m+(-.5+f)*p+1,w=(-1-d)*g+(1.5+d)*m+.5*p,b=d*g-d*m;for(let S=0;S!==a;++S)s[S]=v*o[h+S]+y*o[c+S]+w*o[l+S]+b*o[u+S];return s}},Nf=class extends Ci{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=(r-t)/(n-t),u=1-h;for(let f=0;f!==a;++f)s[f]=o[c+f]*u+o[l+f]*h;return s}},Pg=class extends Ci{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e){return this.copySampleValue_(e-1)}},Vn=class{constructor(e,t,r,n){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=Qt.convertArray(t,this.TimeBufferType),this.values=Qt.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:Qt.convertArray(e.times,Array),values:Qt.convertArray(e.values,Array)};let n=e.getInterpolation();n!==e.DefaultInterpolation&&(r.interpolation=n)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new Pg(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Nf(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Cg(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case hf:t=this.InterpolantFactoryMethodDiscrete;break;case uf:t=this.InterpolantFactoryMethodLinear;break;case wm:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let r="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(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return hf;case this.InterpolantFactoryMethodLinear:return uf;case this.InterpolantFactoryMethodSmooth:return wm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]*=e}return this}trim(e,t){let r=this.times,n=r.length,s=0,o=n-1;for(;s!==n&&r[s]<e;)++s;for(;o!==-1&&r[o]>t;)--o;if(++o,s!==0||o!==n){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Qt.arraySlice(r,s,o),this.values=Qt.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let r=this.times,n=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(n!==void 0&&Qt.isTypedArray(n))for(let a=0,l=n.length;a!==l;++a){let c=n[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Qt.arraySlice(this.times),t=Qt.arraySlice(this.values),r=this.getValueSize(),n=this.getInterpolation()===wm,s=e.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=e[a],h=e[a+1];if(c!==h&&(a!==1||c!==e[0]))if(n)l=!0;else{let u=a*r,f=u-r,d=u+r;for(let p=0;p!==r;++p){let m=t[u+p];if(m!==t[f+p]||m!==t[d+p]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];let u=a*r,f=o*r;for(let d=0;d!==r;++d)t[f+d]=t[u+d]}++o}}if(s>0){e[o]=e[s];for(let a=s*r,l=o*r,c=0;c!==r;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Qt.arraySlice(e,0,o),this.values=Qt.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}clone(){let e=Qt.arraySlice(this.times,0),t=Qt.arraySlice(this.values,0),r=this.constructor,n=new r(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};Vn.prototype.TimeBufferType=Float32Array;Vn.prototype.ValueBufferType=Float32Array;Vn.prototype.DefaultInterpolation=uf;var ks=class extends Vn{};ks.prototype.ValueTypeName="bool";ks.prototype.ValueBufferType=Array;ks.prototype.DefaultInterpolation=hf;ks.prototype.InterpolantFactoryMethodLinear=void 0;ks.prototype.InterpolantFactoryMethodSmooth=void 0;var Of=class extends Vn{};Of.prototype.ValueTypeName="color";var Wa=class extends Vn{};Wa.prototype.ValueTypeName="number";var Dg=class extends Ci{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(r-t)/(n-t),c=e*a;for(let h=c+a;c!==h;c+=4)zt.slerpFlat(s,0,o,c-a,o,c,l);return s}},Bo=class extends Vn{InterpolantFactoryMethodLinear(e){return new Dg(this.times,this.values,this.getValueSize(),e)}};Bo.prototype.ValueTypeName="quaternion";Bo.prototype.DefaultInterpolation=uf;Bo.prototype.InterpolantFactoryMethodSmooth=void 0;var Vs=class extends Vn{};Vs.prototype.ValueTypeName="string";Vs.prototype.ValueBufferType=Array;Vs.prototype.DefaultInterpolation=hf;Vs.prototype.InterpolantFactoryMethodLinear=void 0;Vs.prototype.InterpolantFactoryMethodSmooth=void 0;var ja=class extends Vn{};ja.prototype.ValueTypeName="vector";var Ff=class{constructor(e,t=-1,r,n=$g){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Un(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],r=e.tracks,n=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(f2(r[o]).scale(n));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(Vn.toJSON(r[s]));return n}static CreateFromMorphTargetSequence(e,t,r,n){let s=t.length,o=[];for(let a=0;a<s;a++){let l=[],c=[];l.push((a+s-1)%s,a,(a+1)%s),c.push(0,1,0);let h=Qt.getKeyframeOrder(l);l=Qt.sortedArray(l,1,h),c=Qt.sortedArray(c,1,h),!n&&l[0]===0&&(l.push(s),c.push(c[0])),o.push(new Wa(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/r))}return new this(e,-1,o)}static findByName(e,t){let r=e;if(!Array.isArray(e)){let n=e;r=n.geometry&&n.geometry.animations||n.animations}for(let n=0;n<r.length;n++)if(r[n].name===t)return r[n];return null}static CreateClipsFromMorphTargetSequences(e,t,r){let n={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){let c=e[a],h=c.name.match(s);if(h&&h.length>1){let u=h[1],f=n[u];f||(n[u]=f=[]),f.push(c)}}let o=[];for(let a in n)o.push(this.CreateFromMorphTargetSequence(a,n[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let r=function(u,f,d,p,m){if(d.length!==0){let g=[],v=[];Qt.flattenJSON(d,g,v,p),g.length!==0&&m.push(new u(f,g,v))}},n=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let u=0;u<c.length;u++){let f=c[u].keys;if(!(!f||f.length===0))if(f[0].morphTargets){let d={},p;for(p=0;p<f.length;p++)if(f[p].morphTargets)for(let m=0;m<f[p].morphTargets.length;m++)d[f[p].morphTargets[m]]=-1;for(let m in d){let g=[],v=[];for(let y=0;y!==f[p].morphTargets.length;++y){let w=f[p];g.push(w.time),v.push(w.morphTarget===m?1:0)}n.push(new Wa(".morphTargetInfluence["+m+"]",g,v))}l=d.length*o}else{let d=".bones["+t[u].name+"]";r(ja,d+".position",f,"pos",n),r(Bo,d+".quaternion",f,"rot",n),r(ja,d+".scale",f,"scl",n)}}return n.length===0?null:new this(s,l,n,a)}resetDuration(){let e=this.tracks,t=0;for(let r=0,n=e.length;r!==n;++r){let s=this.tracks[r];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(){let 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 u2(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wa;case"vector":case"vector2":case"vector3":case"vector4":return ja;case"color":return Of;case"quaternion":return Bo;case"bool":case"boolean":return ks;case"string":return Vs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function f2(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=u2(i.type);if(i.times===void 0){let t=[],r=[];Qt.flattenJSON(i.keys,t,r,"value"),i.times=t,i.values=r}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}var qa={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}},No=class{constructor(e,t,r){let n=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(h){a++,s===!1&&n.onStart!==void 0&&n.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,n.onProgress!==void 0&&n.onProgress(h,o,a),o===a&&(s=!1,n.onLoad!==void 0&&n.onLoad())},this.itemError=function(h){n.onError!==void 0&&n.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){let u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,f=c.length;u<f;u+=2){let d=c[u],p=c[u+1];if(d.global&&(d.lastIndex=0),d.test(h))return p}return null}}},d2=new No,cn=class{constructor(e){this.manager=e!==void 0?e:d2,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let r=this;return new Promise(function(n,s){r.load(e,n,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}},$i={},as=class extends cn{constructor(e){super(e)}load(e,t,r,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=qa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if($i[e]!==void 0){$i[e].push({onLoad:t,onProgress:r,onError:n});return}$i[e]=[],$i[e].push({onLoad:t,onProgress:r,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;let h=$i[e],u=c.body.getReader(),f=c.headers.get("Content-Length"),d=f?parseInt(f):0,p=d!==0,m=0,g=new ReadableStream({start(v){y();function y(){u.read().then(({done:w,value:b})=>{if(w)v.close();else{m+=b.byteLength;let S=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:d});for(let T=0,A=h.length;T<A;T++){let x=h[T];x.onProgress&&x.onProgress(S)}v.enqueue(b),y()}})}}});return new Response(g)}else throw Error(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return c.json();default:if(a===void 0)return c.text();{let u=/charset="?([^;"\s]*)"?/i.exec(a),f=u&&u[1]?u[1].toLowerCase():void 0,d=new TextDecoder(f);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{qa.add(e,c);let h=$i[e];delete $i[e];for(let u=0,f=h.length;u<f;u++){let d=h[u];d.onLoad&&d.onLoad(c)}}).catch(c=>{let h=$i[e];if(h===void 0)throw this.manager.itemError(e),c;delete $i[e];for(let u=0,f=h.length;u<f;u++){let d=h[u];d.onError&&d.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var Uf=class extends cn{constructor(e){super(e)}load(e,t,r,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=qa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a=qc("img");function l(){h(),qa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(u){h(),n&&n(u),s.manager.itemError(e),s.manager.itemEnd(e)}function h(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}},Lg=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=new Fs,o=new Uf(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(h){s.images[c]=h,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,n)}for(let c=0;c<e.length;++c)l(c);return s}};var Ig=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=new Pt,o=new Uf(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},r,n),s}},bn=class extends ot{constructor(e,t=1){super(),this.type="Light",this.color=new be(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let 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}};bn.prototype.isLight=!0;var Hs=class extends bn{constructor(e,t,r){super(e,r),this.type="HemisphereLight",this.position.copy(ot.DefaultUp),this.updateMatrix(),this.groundColor=new be(t)}copy(e){return bn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}};Hs.prototype.isHemisphereLight=!0;var tb=new Ae,rb=new M,nb=new M,ah=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new B(512,512),this.map=null,this.mapPass=null,this.matrix=new Ae,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Na,this._frameExtents=new B(1,1),this._viewportCount=1,this._viewports=[new Je(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,r=this.matrix;rb.setFromMatrixPosition(e.matrixWorld),t.position.copy(rb),nb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(nb),t.updateMatrixWorld(),tb.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(tb),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(t.projectionMatrix),r.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(){let 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}},zf=class extends ah{constructor(){super(new sr(50,1,.5,500)),this.focus=1}updateMatrices(e){let t=this.camera,r=jc*2*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(r!==t.fov||n!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=n,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}};zf.prototype.isSpotLightShadow=!0;var lh=class extends bn{constructor(e,t,r=0,n=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(ot.DefaultUp),this.updateMatrix(),this.target=new ot,this.distance=r,this.angle=n,this.penumbra=s,this.decay=o,this.shadow=new zf}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}};lh.prototype.isSpotLight=!0;var ib=new Ae,Bc=new M,$m=new M,Gf=class extends ah{constructor(){super(new sr(90,1,.5,500)),this._frameExtents=new B(4,2),this._viewportCount=6,this._viewports=[new Je(2,1,1,1),new Je(0,1,1,1),new Je(3,1,1,1),new Je(1,1,1,1),new Je(3,0,1,1),new Je(1,0,1,1)],this._cubeDirections=[new M(1,0,0),new M(-1,0,0),new M(0,0,1),new M(0,0,-1),new M(0,1,0),new M(0,-1,0)],this._cubeUps=[new M(0,1,0),new M(0,1,0),new M(0,1,0),new M(0,1,0),new M(0,0,1),new M(0,0,-1)]}updateMatrices(e,t=0){let r=this.camera,n=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),Bc.setFromMatrixPosition(e.matrixWorld),r.position.copy(Bc),$m.copy(r.position),$m.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt($m),r.updateMatrixWorld(),n.makeTranslation(-Bc.x,-Bc.y,-Bc.z),ib.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ib)}};Gf.prototype.isPointLightShadow=!0;var ch=class extends bn{constructor(e,t,r=0,n=1){super(e,t),this.type="PointLight",this.distance=r,this.decay=n,this.shadow=new Gf}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}};ch.prototype.isPointLight=!0;var kf=class extends ah{constructor(){super(new Co(-5,5,5,-5,.5,500))}};kf.prototype.isDirectionalLightShadow=!0;var hh=class extends bn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(ot.DefaultUp),this.updateMatrix(),this.target=new ot,this.shadow=new kf}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};hh.prototype.isDirectionalLight=!0;var Rg=class extends bn{constructor(e,t){super(e,t),this.type="AmbientLight"}};Rg.prototype.isAmbientLight=!0;var Bg=class extends bn{constructor(e,t,r=10,n=10){super(e,t),this.type="RectAreaLight",this.width=r,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}};Bg.prototype.isRectAreaLight=!0;var Vf=class{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new M)}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){let r=e.x,n=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*n),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],1.092548*(r*n)),t.addScaledVector(o[5],1.092548*(n*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(r*s)),t.addScaledVector(o[8],.546274*(r*r-n*n)),t}getIrradianceAt(e,t){let r=e.x,n=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*n),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*r),t.addScaledVector(o[4],2*.429043*r*n),t.addScaledVector(o[5],2*.429043*n*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*r*s),t.addScaledVector(o[8],.429043*(r*r-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],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){let r=this.coefficients;for(let n=0;n<9;n++)r[n].fromArray(e,t+n*3);return this}toArray(e=[],t=0){let r=this.coefficients;for(let n=0;n<9;n++)r[n].toArray(e,t+n*3);return e}static getBasisAt(e,t){let r=e.x,n=e.y,s=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*s,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*r*s,t[8]=.546274*(r*r-n*n)}};Vf.prototype.isSphericalHarmonics3=!0;var uh=class extends bn{constructor(e=new Vf,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){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}};uh.prototype.isLightProbe=!0;var Ng=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,n=e.length;r<n;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},Hf=class extends De{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(){let e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}};Hf.prototype.isInstancedBufferGeometry=!0;var Ws=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=this,o=new as(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},r,n)}parse(e){let t={},r={};function n(d,p){if(t[p]!==void 0)return t[p];let g=d.interleavedBuffers[p],v=s(d,g.buffer),y=_u(g.type,v),w=new ss(y,g.stride);return w.uuid=g.uuid,t[p]=w,w}function s(d,p){if(r[p]!==void 0)return r[p];let g=d.arrayBuffers[p],v=new Uint32Array(g).buffer;return r[p]=v,v}let o=e.isInstancedBufferGeometry?new Hf:new De,a=e.data.index;if(a!==void 0){let d=_u(a.type,a.array);o.setIndex(new Ve(d,1))}let l=e.data.attributes;for(let d in l){let p=l[d],m;if(p.isInterleavedBufferAttribute){let g=n(e.data,p.data);m=new Ei(g,p.itemSize,p.offset,p.normalized)}else{let g=_u(p.type,p.array),v=p.isInstancedBufferAttribute?Oa:Ve;m=new v(g,p.itemSize,p.normalized)}p.name!==void 0&&(m.name=p.name),p.usage!==void 0&&m.setUsage(p.usage),p.updateRange!==void 0&&(m.updateRange.offset=p.updateRange.offset,m.updateRange.count=p.updateRange.count),o.setAttribute(d,m)}let c=e.data.morphAttributes;if(c)for(let d in c){let p=c[d],m=[];for(let g=0,v=p.length;g<v;g++){let y=p[g],w;if(y.isInterleavedBufferAttribute){let b=n(e.data,y.data);w=new Ei(b,y.itemSize,y.offset,y.normalized)}else{let b=_u(y.type,y.array);w=new Ve(b,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),m.push(w)}o.morphAttributes[d]=m}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);let u=e.data.groups||e.data.drawcalls||e.data.offsets;if(u!==void 0)for(let d=0,p=u.length;d!==p;++d){let m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}let f=e.data.boundingSphere;if(f!==void 0){let d=new M;f.center!==void 0&&d.fromArray(f.center),o.boundingSphere=new Lr(d,f.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}};var Og=class extends cn{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,r,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=qa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){qa.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){n&&n(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}};Og.prototype.isImageBitmapLoader=!0;var nf,p2={getContext:function(){return nf===void 0&&(nf=new(window.AudioContext||window.webkitAudioContext)),nf},setContext:function(i){nf=i}},Fg=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=this,o=new as(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{let l=a.slice(0);p2.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},r,n)}},Ug=class extends uh{constructor(e,t,r=1){super(void 0,r);let n=new be().set(e),s=new be().set(t),o=new M(n.r,n.g,n.b),a=new M(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}};Ug.prototype.isHemisphereLightProbe=!0;var zg=class extends uh{constructor(e,t=1){super(void 0,t);let r=new be().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}};zg.prototype.isAmbientLightProbe=!0;var Wf=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=sb(),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){let t=sb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function sb(){return(typeof performance>"u"?Date:performance).now()}var Gg=class extends ot{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;let 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}};var kg=class{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,t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}},Vg=class{constructor(e,t,r){this.binding=e,this.valueSize=r;let n,s,o;switch(t){case"quaternion":n=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":n=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:n=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=n,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){let r=this.buffer,n=this.valueSize,s=e*n+n,o=this.cumulativeWeight;if(o===0){for(let a=0;a!==n;++a)r[s+a]=r[a];o=t}else{o+=t;let a=t/o;this._mixBufferRegion(r,s,0,a,n)}this.cumulativeWeight=o}accumulateAdditive(e){let t=this.buffer,r=this.valueSize,n=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,r=this.buffer,n=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){let l=t*this._origIndex;this._mixBufferRegion(r,n,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(r[l]!==r[l+t]){a.setValue(r,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let s=r,o=n;s!==o;++s)t[s]=t[n+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,n,s){if(n>=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,n){zt.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,s){let o=this._workIndex*s;zt.multiplyQuaternionsFlat(e,o,e,t,e,r),zt.slerpFlat(e,t,e,t,e,o,n)}_lerp(e,t,r,n,s){let o=1-n;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[r+a]*n}}_lerpAdditive(e,t,r,n,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[r+o]*n}}},ny="\\[\\]\\.:\\/",m2=new RegExp("["+ny+"]","g"),iy="[^"+ny+"]",g2="[^"+ny.replace("\\.","")+"]",y2=/((?:WC+[\/:])*)/.source.replace("WC",iy),v2=/(WCOD+)?/.source.replace("WCOD",g2),x2=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",iy),b2=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",iy),w2=new RegExp("^"+y2+v2+x2+b2+"$"),S2=["material","materials","bones"],Hg=class{constructor(e,t,r){let n=r||bt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let r=this._targetGroup.nCachedObjects_,n=this._bindings[r];n!==void 0&&n.getValue(e,t)}setValue(e,t){let r=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=r.length;n!==s;++n)r[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},bt=class{constructor(e,t,r){this.path=t,this.parsedPath=r||bt.parseTrackName(t),this.node=bt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new bt.Composite(e,t,r):new bt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(m2,"")}static parseTrackName(e){let t=w2.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let s=r.nodeName.substring(n+1);S2.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){let r=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===t||a.uuid===t)return a;let l=r(a.children);if(l)return l}return null},n=r(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)e[t++]=r[n]}_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){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)r[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let r=this.resolvedProperty;for(let n=0,s=r.length;n!==s;++n)r[n]=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,t=this.parsedPath,r=t.objectName,n=t.propertyName,s=t.propertyIndex;if(e||(e=bt.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(r){let c=t.objectIndex;switch(r){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 h=0;h<e.length;h++)if(e[h].name===c){c=h;break}break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}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]}}let o=e[n];if(o===void 0){let c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+n+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(n==="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}}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};bt.Composite=Hg;bt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};bt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};bt.prototype.GetterByBindingType=[bt.prototype._getValue_direct,bt.prototype._getValue_array,bt.prototype._getValue_arrayElement,bt.prototype._getValue_toArray];bt.prototype.SetterByBindingTypeAndVersioning=[[bt.prototype._setValue_direct,bt.prototype._setValue_direct_setNeedsUpdate,bt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_array,bt.prototype._setValue_array_setNeedsUpdate,bt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_arrayElement,bt.prototype._setValue_arrayElement_setNeedsUpdate,bt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_fromArray,bt.prototype._setValue_fromArray_setNeedsUpdate,bt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Wg=class{constructor(){this.uuid=Un(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let r=0,n=arguments.length;r!==n;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let 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(){let e=this._objects,t=this._indicesByUUID,r=this._paths,n=this._parsedPaths,s=this._bindings,o=s.length,a,l=e.length,c=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){let f=arguments[h],d=f.uuid,p=t[d];if(p===void 0){p=l++,t[d]=p,e.push(f);for(let m=0,g=o;m!==g;++m)s[m].push(new bt(f,r[m],n[m]))}else if(p<c){a=e[p];let m=--c,g=e[m];t[g.uuid]=p,e[p]=g,t[d]=m,e[m]=f;for(let v=0,y=o;v!==y;++v){let w=s[v],b=w[m],S=w[p];w[p]=b,S===void 0&&(S=new bt(f,r[v],n[v])),w[m]=S}}else e[p]!==a&&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(){let e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length,s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){let l=arguments[o],c=l.uuid,h=t[c];if(h!==void 0&&h>=s){let u=s++,f=e[u];t[f.uuid]=h,e[h]=f,t[c]=u,e[u]=l;for(let d=0,p=n;d!==p;++d){let m=r[d],g=m[u],v=m[h];m[h]=g,m[u]=v}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u<s){let f=--s,d=e[f],p=--o,m=e[p];t[d.uuid]=u,e[u]=d,t[m.uuid]=f,e[f]=m,e.pop();for(let g=0,v=n;g!==v;++g){let y=r[g],w=y[f],b=y[p];y[u]=w,y[f]=b,y.pop()}}else{let f=--o,d=e[f];f>0&&(t[d.uuid]=u),e[u]=d,e.pop();for(let p=0,m=n;p!==m;++p){let g=r[p];g[u]=g[f],g.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let r=this._bindingsIndicesByPath,n=r[e],s=this._bindings;if(n!==void 0)return s[n];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);n=s.length,r[e]=n,o.push(e),a.push(t),s.push(u);for(let f=h,d=l.length;f!==d;++f){let p=l[f];u[f]=new bt(p,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){let n=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=r,o[r]=l,o.pop(),s[r]=s[a],s.pop(),n[r]=n[a],n.pop()}}};Wg.prototype.isAnimationObjectGroup=!0;var jg=class{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Ea,endingEnd:Ea};for(let c=0;c!==o;++c){let h=s[c].createInterpolant(null);a[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=N_,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,r){if(e.fadeOut(t),this.fadeIn(t),r){let n=this._clip.duration,s=e._clip.duration,o=s/n,a=n/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){let 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,r){let n=this._mixer,s=n.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+r,c[0]=e/o,c[1]=t/o,this}stopWarping(){let 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,r,n){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*r;if(l<0||r===0)return;this._startTime=null,t=r*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case yb:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulateAdditive(a);break;case $g:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulate(n,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let r=this._weightInterpolant;if(r!==null){let n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),n===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let r=this._timeScaleInterpolant;r!==null&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,r=this.loop,n=this.time+e,s=this._loopCount,o=r===O_;if(e===0)return s===-1?n:o&&(s&1)===1?t-n:n;if(r===B_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else if(n<0)n=0;else{this.time=n;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,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)),n>=t||n<0){let a=Math.floor(n/t);n-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=n;if(o&&(s&1)===1)return t-n}return n}_setEndings(e,t,r){let n=this._interpolantSettings;r?(n.endingStart=Ca,n.endingEnd=Ca):(e?n.endingStart=this.zeroSlopeAtStart?Ca:Ea:n.endingStart=ff,t?n.endingEnd=this.zeroSlopeAtEnd?Ca:Ea:n.endingEnd=ff)}_scheduleFading(e,t,r){let n=this._mixer,s=n.time,o=this._weightInterpolant;o===null&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=r,this}},qg=class extends Yt{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let r=e._localRoot||this._root,n=e._clip.tracks,s=n.length,o=e._propertyBindings,a=e._interpolants,l=r.uuid,c=this._bindingsByRootAndName,h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){let f=n[u],d=f.name,p=h[d];if(p!==void 0)++p.referenceCount,o[u]=p;else{if(p=o[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}let m=t&&t._propertyBindings[u].binding.parsedPath;p=new Vg(bt.create(r,d,m),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),o[u]=p}a[u].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let r=(e._localRoot||this._root).uuid,n=e._clip.uuid,s=this._actionsByClip[n];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,n,r)}let t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){let s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){let s=t[r];--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;let 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){let t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,r){let n=this._actions,s=this._actionsByClip,o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{let a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=n.length,n.push(e),o.actionByRoot[r]=e}_removeInactiveAction(e){let t=this._actions,r=t[t.length-1],n=e._cacheIndex;r._cacheIndex=n,t[n]=r,t.pop(),e._cacheIndex=null;let s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,c=l[l.length-1],h=e._byClipCacheIndex;c._byClipCacheIndex=h,l[h]=c,l.pop(),e._byClipCacheIndex=null;let u=a.actionByRoot,f=(e._localRoot||this._root).uuid;delete u[f],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let r=0,n=t.length;r!==n;++r){let s=t[r];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){let t=this._actions,r=e._cacheIndex,n=this._nActiveActions++,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_takeBackAction(e){let t=this._actions,r=e._cacheIndex,n=--this._nActiveActions,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_addInactiveBinding(e,t,r){let n=this._bindingsByRootAndName,s=this._bindings,o=n[t];o===void 0&&(o={},n[t]=o),o[r]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){let t=this._bindings,r=e.binding,n=r.rootNode.uuid,s=r.path,o=this._bindingsByRootAndName,a=o[n],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[n]}_lendBinding(e){let t=this._bindings,r=e._cacheIndex,n=this._nActiveBindings++,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_takeBackBinding(e){let t=this._bindings,r=e._cacheIndex,n=--this._nActiveBindings,s=t[n];e._cacheIndex=n,t[n]=e,s._cacheIndex=r,t[r]=s}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,r=e[t];return r===void 0&&(r=new Nf(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){let t=this._controlInterpolants,r=e.__cacheIndex,n=--this._nActiveControlInterpolants,s=t[n];e.__cacheIndex=n,t[n]=e,s.__cacheIndex=r,t[r]=s}clipAction(e,t,r){let n=t||this._root,s=n.uuid,o=typeof e=="string"?Ff.findByName(n,e):e,a=o!==null?o.uuid:e,l=this._actionsByClip[a],c=null;if(r===void 0&&(o!==null?r=o.blendMode:r=$g),l!==void 0){let u=l.actionByRoot[s];if(u!==void 0&&u.blendMode===r)return u;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;let h=new jg(this,o,t,r);return this._bindAction(h,c),this._addInactiveAction(h,a,s),h}existingAction(e,t){let r=t||this._root,n=r.uuid,s=typeof e=="string"?Ff.findByName(r,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[n]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let r=t-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;let t=this._actions,r=this._nActiveActions,n=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==r;++c)t[c]._update(n,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,r=e.uuid,n=this._actionsByClip,s=n[r];if(s!==void 0){let o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){let c=o[a];this._deactivateAction(c);let h=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete n[r]}}uncacheRoot(e){let t=e.uuid,r=this._actionsByClip;for(let o in r){let a=r[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}let n=this._bindingsByRootAndName,s=n[t];if(s!==void 0)for(let o in s){let a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){let r=this.existingAction(e,t);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}};qg.prototype._controlInterpolantsResultBuffer=new Float32Array(1);var Ce=class{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Ce(this.value.clone===void 0?this.value:this.value.clone())}},Yg=class extends ss{constructor(e,t,r=1){super(e,t),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}};Yg.prototype.isInstancedInterleavedBuffer=!0;var Xg=class{constructor(e,t,r,n,s){this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=n,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}};Xg.prototype.isGLBufferAttribute=!0;var jf=class{constructor(e,t,r=0,n=1/0){this.ray=new oi(e,t),this.near=r,this.far=n,this.camera=null,this.layers=new Xc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,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.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=!0,r=[]){return Qg(e,this,r,t),r.sort(ob),r}intersectObjects(e,t=!0,r=[]){for(let n=0,s=e.length;n<s;n++)Qg(e[n],this,r,t);return r.sort(ob),r}};function ob(i,e){return i.distance-e.distance}function Qg(i,e,t,r){if(i.layers.test(e.layers)&&i.raycast(e,t),r===!0){let n=i.children;for(let s=0,o=n.length;s<o;s++)Qg(n[s],e,t,!0)}}var fh=class{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,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,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(xr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}};var ab=new B,Oo=class{constructor(e=new B(1/0,1/0),t=new B(-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,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let r=ab.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),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 ab.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)}};Oo.prototype.isBox2=!0;var lb=new M,sf=new M,Jr=class{constructor(e=new M,t=new M){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){lb.subVectors(e,this.start),sf.subVectors(this.end,this.start);let r=sf.dot(sf),s=sf.dot(lb)/r;return t&&(s=xr(s,0,1)),s}closestPointToPoint(e,t,r){let n=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(n).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)}},cb=new M,qf=class extends ot{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let r=new De,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){let c=o/l*Math.PI*2,h=a/l*Math.PI*2;n.push(Math.cos(c),Math.sin(c),1,Math.cos(h),Math.sin(h),1)}r.setAttribute("position",new Te(n,3));let s=new kr({fog:!1,toneMapped:!1});this.cone=new li(r,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),cb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(cb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},Cs=new M,of=new Ae,eg=new Ae,Jg=class extends li{constructor(e){let t=Bb(e),r=new De,n=[],s=[],o=new be(0,0,1),a=new be(0,1,0);for(let c=0;c<t.length;c++){let h=t[c];h.parent&&h.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}r.setAttribute("position",new Te(n,3)),r.setAttribute("color",new Te(s,3));let l=new kr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,l),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){let t=this.bones,r=this.geometry,n=r.getAttribute("position");eg.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){let a=t[s];a.parent&&a.parent.isBone&&(of.multiplyMatrices(eg,a.matrixWorld),Cs.setFromMatrixPosition(of),n.setXYZ(o,Cs.x,Cs.y,Cs.z),of.multiplyMatrices(eg,a.parent.matrixWorld),Cs.setFromMatrixPosition(of),n.setXYZ(o+1,Cs.x,Cs.y,Cs.z),o+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}};function Bb(i){let e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push.apply(e,Bb(i.children[t]));return e}var Yf=class extends Vt{constructor(e,t,r){let n=new Ro(t,4,2),s=new zn({wireframe:!0,fog:!1,toneMapped:!1});super(n,s),this.light=e,this.light.updateMatrixWorld(),this.color=r,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)}};var Kg=class extends li{constructor(e=10,t=10,r=4473924,n=8947848){r=new be(r),n=new be(n);let s=t/2,o=e/t,a=e/2,l=[],c=[];for(let f=0,d=0,p=-a;f<=t;f++,p+=o){l.push(-a,0,p,a,0,p),l.push(p,0,-a,p,0,a);let m=f===s?r:n;m.toArray(c,d),d+=3,m.toArray(c,d),d+=3,m.toArray(c,d),d+=3,m.toArray(c,d),d+=3}let h=new De;h.setAttribute("position",new Te(l,3)),h.setAttribute("color",new Te(c,3));let u=new kr({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}};var hb=new M,af=new M,ub=new M,Xf=class extends ot{constructor(e,t,r){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,t===void 0&&(t=1);let n=new De;n.setAttribute("position",new Te([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let s=new kr({fog:!1,toneMapped:!1});this.lightPlane=new os(n,s),this.add(this.lightPlane),n=new De,n.setAttribute("position",new Te([0,0,0,0,0,1],3)),this.targetLine=new os(n,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(){hb.setFromMatrixPosition(this.light.matrixWorld),af.setFromMatrixPosition(this.light.target.matrixWorld),ub.subVectors(af,hb),this.lightPlane.lookAt(af),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(af),this.targetLine.scale.z=ub.length()}},lf=new M,ir=new Gn,Hn=class extends li{constructor(e){let t=new De,r=new kr({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],s=[],o={},a=new be(16755200),l=new be(16711680),c=new be(43775),h=new be(16777215),u=new be(3355443);f("n1","n2",a),f("n2","n4",a),f("n4","n3",a),f("n3","n1",a),f("f1","f2",a),f("f2","f4",a),f("f4","f3",a),f("f3","f1",a),f("n1","f1",a),f("n2","f2",a),f("n3","f3",a),f("n4","f4",a),f("p","n1",l),f("p","n2",l),f("p","n3",l),f("p","n4",l),f("u1","u2",c),f("u2","u3",c),f("u3","u1",c),f("c","t",h),f("p","c",u),f("cn1","cn2",u),f("cn3","cn4",u),f("cf1","cf2",u),f("cf3","cf4",u);function f(p,m,g){d(p,g),d(m,g)}function d(p,m){n.push(0,0,0),s.push(m.r,m.g,m.b),o[p]===void 0&&(o[p]=[]),o[p].push(n.length/3-1)}t.setAttribute("position",new Te(n,3)),t.setAttribute("color",new Te(s,3)),super(t,r),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(){let e=this.geometry,t=this.pointMap,r=1,n=1;ir.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),cr("c",t,e,ir,0,0,-1),cr("t",t,e,ir,0,0,1),cr("n1",t,e,ir,-r,-n,-1),cr("n2",t,e,ir,r,-n,-1),cr("n3",t,e,ir,-r,n,-1),cr("n4",t,e,ir,r,n,-1),cr("f1",t,e,ir,-r,-n,1),cr("f2",t,e,ir,r,-n,1),cr("f3",t,e,ir,-r,n,1),cr("f4",t,e,ir,r,n,1),cr("u1",t,e,ir,r*.7,n*1.1,-1),cr("u2",t,e,ir,-r*.7,n*1.1,-1),cr("u3",t,e,ir,0,n*2,-1),cr("cf1",t,e,ir,-r,0,1),cr("cf2",t,e,ir,r,0,1),cr("cf3",t,e,ir,0,-n,1),cr("cf4",t,e,ir,0,n,1),cr("cn1",t,e,ir,-r,0,-1),cr("cn2",t,e,ir,r,0,-1),cr("cn3",t,e,ir,0,-n,-1),cr("cn4",t,e,ir,0,n,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function cr(i,e,t,r,n,s,o){lf.set(n,s,o).unproject(r);let a=e[i];if(a!==void 0){let l=t.getAttribute("position");for(let c=0,h=a.length;c<h;c++)l.setXYZ(a[c],lf.x,lf.y,lf.z)}}var Fo=class extends li{constructor(e,t=16776960){let r=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]),n=[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 De;s.setIndex(new Ve(r,1)),s.setAttribute("position",new Te(n,3)),super(s,new kr({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}};var Qf=class extends li{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new De;n.setAttribute("position",new Te(t,3)),n.setAttribute("color",new Te(r,3));let s=new kr({vertexColors:!0,toneMapped:!1});super(n,s),this.type="AxesHelper"}setColors(e,t,r){let n=new be,s=this.geometry.attributes.color.array;return n.set(e),n.toArray(s,0),n.toArray(s,3),n.set(t),n.toArray(s,6),n.toArray(s,9),n.set(r),n.toArray(s,12),n.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Jf=class{constructor(){this.type="ShapePath",this.color=new be,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Fa,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,n){return this.currentPath.quadraticCurveTo(e,t,r,n),this}bezierCurveTo(e,t,r,n,s,o){return this.currentPath.bezierCurveTo(e,t,r,n,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function r(y){let w=[];for(let b=0,S=y.length;b<S;b++){let T=y[b],A=new rn;A.curves=T.curves,w.push(A)}return w}function n(y,w){let b=w.length,S=!1;for(let T=b-1,A=0;A<b;T=A++){let x=w[T],_=w[A],E=_.x-x.x,C=_.y-x.y;if(Math.abs(C)>Number.EPSILON){if(C<0&&(x=w[A],E=-E,_=w[T],C=-C),y.y<x.y||y.y>_.y)continue;if(y.y===x.y){if(y.x===x.x)return!0}else{let I=C*(y.x-x.x)-E*(y.y-x.y);if(I===0)return!0;if(I<0)continue;S=!S}}else{if(y.y!==x.y)continue;if(_.x<=y.x&&y.x<=x.x||x.x<=y.x&&y.x<=_.x)return!0}}return S}let s=ii.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return r(o);let a,l,c,h=[];if(o.length===1)return l=o[0],c=new rn,c.curves=l.curves,h.push(c),h;let u=!s(o[0].getPoints());u=e?!u:u;let f=[],d=[],p=[],m=0,g;d[m]=void 0,p[m]=[];for(let y=0,w=o.length;y<w;y++)l=o[y],g=l.getPoints(),a=s(g),a=e?!a:a,a?(!u&&d[m]&&m++,d[m]={s:new rn,p:g},d[m].s.curves=l.curves,u&&m++,p[m]=[]):p[m].push({h:l,p:g[0]});if(!d[0])return r(o);if(d.length>1){let y=!1,w=0;for(let b=0,S=d.length;b<S;b++)f[b]=[];for(let b=0,S=d.length;b<S;b++){let T=p[b];for(let A=0;A<T.length;A++){let x=T[A],_=!0;for(let E=0;E<d.length;E++)n(x.p,d[E].p)&&(b!==E&&w++,_?(_=!1,f[E].push(x)):y=!0);_&&f[b].push(x)}}w>0&&y===!1&&(p=f)}let v;for(let y=0,w=d.length;y<w;y++){c=d[y].s,h.push(c),v=p[y];for(let b=0,S=v.length;b<S;b++)c.holes.push(v[b].h)}return h}};var Nb=new ArrayBuffer(4),MG=new Float32Array(Nb),AG=new Uint32Array(Nb),Ai=new Uint32Array(512),Ti=new Uint32Array(512);for(let i=0;i<256;++i){let e=i-127;e<-27?(Ai[i]=0,Ai[i|256]=32768,Ti[i]=24,Ti[i|256]=24):e<-14?(Ai[i]=1024>>-e-14,Ai[i|256]=1024>>-e-14|32768,Ti[i]=-e-1,Ti[i|256]=-e-1):e<=15?(Ai[i]=e+15<<10,Ai[i|256]=e+15<<10|32768,Ti[i]=13,Ti[i|256]=13):e<128?(Ai[i]=31744,Ai[i|256]=64512,Ti[i]=24,Ti[i|256]=24):(Ai[i]=31744,Ai[i|256]=64512,Ti[i]=13,Ti[i|256]=13)}var Ob=new Uint32Array(2048),dh=new Uint32Array(64),M2=new Uint32Array(64);for(let i=1;i<1024;++i){let e=i<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,Ob[i]=e|t}for(let i=1024;i<2048;++i)Ob[i]=939524096+(i-1024<<13);for(let i=1;i<31;++i)dh[i]=i<<23;dh[31]=1199570944;dh[32]=2147483648;for(let i=33;i<63;++i)dh[i]=2147483648+(i-32<<23);dh[63]=3347054592;for(let i=1;i<64;++i)i!==32&&(M2[i]=1024);xn.create=function(i,e){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(xn.prototype),i.prototype.constructor=i,i.prototype.getPoint=e,i};Fa.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)};Kg.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Jg.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};cn.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ng.extractUrlBase(i)};cn.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};Oo.prototype.center=function(i){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(i)};Oo.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Oo.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};Oo.prototype.size=function(i){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(i)};Kt.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)};Kt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Kt.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};Kt.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)};Kt.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)};yn.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")};Lr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Na.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)};Jr.prototype.center=function(i){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(i)};Ft.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)};Ft.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)};Ft.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};Ft.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)};Ft.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};Ft.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()};Ae.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)};Ae.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)};Ae.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new M().setFromMatrixColumn(this,3)};Ae.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)};Ae.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};Ae.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};Ae.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)};Ae.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};Ae.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};Ae.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};Ae.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};Ae.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};Ae.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};Ae.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};Ae.prototype.makeFrustum=function(i,e,t,r,n,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,e,r,t,n,s)};Ae.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()};Gr.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)};zt.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)};zt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};oi.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};oi.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)};oi.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)};Jt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};Jt.prototype.barycoordFromPoint=function(i,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,e)};Jt.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)};Jt.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)};Jt.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)};Jt.barycoordFromPoint=function(i,e,t,r,n){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Jt.getBarycoord(i,e,t,r,n)};Jt.normal=function(i,e,t,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Jt.getNormal(i,e,t,r)};rn.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)};rn.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Gs(this,i)};rn.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Io(this,i)};B.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};B.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)};B.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};M.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};M.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};M.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)};M.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)};M.prototype.getColumnFromMatrix=function(i,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,i)};M.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)};M.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};M.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)};M.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Je.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};Je.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};ot.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)};ot.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};ot.prototype.translate=function(i,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,i)};ot.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};ot.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)};Object.defineProperties(ot.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});Vt.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(Vt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),vb},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});bf.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};sr.prototype.setLens=function(i,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(i)};Object.defineProperties(bn.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}});Object.defineProperties(Ve.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===df},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(df)}}});Ve.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?df:Wc),this};Ve.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ve.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};De.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)};De.prototype.addAttribute=function(i,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new Ve(arguments[1],arguments[2]))):i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(i,e)};De.prototype.addDrawCall=function(i,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,e)};De.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};De.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};De.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)};De.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)};Object.defineProperties(De.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});ss.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?df:Wc),this};ss.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};Gs.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};Gs.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};Gs.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};on.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Ce.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties(ur.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new be}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===db}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(Mt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}});Dt.prototype.clearTarget=function(i,e,t,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(e,t,r)};Dt.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)};Dt.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};Dt.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};Dt.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};Dt.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};Dt.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};Dt.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};Dt.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};Dt.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};Dt.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};Dt.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};Dt.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};Dt.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};Dt.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)};Dt.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};Dt.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};Dt.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};Dt.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Dt.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};Dt.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};Dt.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};Dt.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};Dt.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};Dt.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(Dt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?je:gn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties(Cb.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(mt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}});Gg.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");let e=this;return new Fg().load(i,function(r){e.setBuffer(r)}),this};kg.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};Qc.prototype.updateCubeMap=function(i,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,e)};Qc.prototype.clear=function(i,e,t,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,e,t,r)};ns.crossOrigin=void 0;ns.loadTexture=function(i,e,t,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");let n=new Ig;n.setCrossOrigin(this.crossOrigin);let s=n.load(i,t,void 0,r);return e&&(s.mapping=e),s};ns.loadTextureCube=function(i,e,t,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");let n=new Lg;n.setCrossOrigin(this.crossOrigin);let s=n.load(i,t,void 0,r);return e&&(s.mapping=e),s};ns.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ns.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Kf=class extends mt{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Uo}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Uo);var Ja=".",ph=Symbol("target"),sy=Symbol("unsubscribe");function mh(i){return i instanceof Date||i instanceof Set||i instanceof Map||i instanceof WeakSet||i instanceof WeakMap||ArrayBuffer.isView(i)}function Fb(i){return(typeof i=="object"?i===null:typeof i!="function")||i instanceof RegExp}var Pn=Array.isArray;function zo(i){return typeof i=="symbol"}var A2={after:(i,e)=>Pn(i)?i.slice(e.length):e===""?i:i.slice(e.length+1),concat:(i,e)=>Pn(i)?(i=[...i],e&&i.push(e),i):e&&e.toString!==void 0?(i!==""&&(i+=Ja),zo(e)?i+e.toString():i+e):i,initial:i=>{if(Pn(i))return i.slice(0,-1);if(i==="")return i;let e=i.lastIndexOf(Ja);return e===-1?"":i.slice(0,e)},last:i=>{if(Pn(i))return i[i.length-1]||"";if(i==="")return i;let e=i.lastIndexOf(Ja);return e===-1?i:i.slice(e+1)},walk:(i,e)=>{if(Pn(i))for(let t of i)e(t);else if(i!==""){let t=0,r=i.indexOf(Ja);if(r===-1)e(i);else for(;t<i.length;)r===-1&&(r=i.length),e(i.slice(t,r)),t=r+1,r=i.indexOf(Ja,t)}},get(i,e){return this.walk(e,t=>{i&&(i=i[t])}),i}},hn=A2;function oy(i){return typeof i=="object"&&typeof i.next=="function"}function ay(i,e,t,r,n){let s=i.next;if(e.name==="entries")i.next=function(){let o=s.call(this);return o.done===!1&&(o.value[0]=n(o.value[0],e,o.value[0],r),o.value[1]=n(o.value[1],e,o.value[0],r)),o};else if(e.name==="values"){let o=t[ph].keys();i.next=function(){let a=s.call(this);return a.done===!1&&(a.value=n(a.value,e,o.next().value,r)),a}}else i.next=function(){let o=s.call(this);return o.done===!1&&(o.value=n(o.value,e,o.value,r)),o};return i}function td(i,e,t){return i.isUnsubscribed||e.ignoreSymbols&&zo(t)||e.ignoreUnderscores&&t.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(t)}var gh=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),r=t.get(e);return r===void 0&&(r={},t.set(e,r)),r}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let r=this._getProperties(e),n=r[t];return n===void 0&&(n=Reflect.getOwnPropertyDescriptor(e,t),r[t]=n),n}getProxy(e,t,r,n){if(this.isUnsubscribed)return e;let s=e[n],o=s||e;this._pathCache.set(o,t);let a=this._proxyCache.get(o);return a===void 0&&(a=s===void 0?new Proxy(e,r):e,this._proxyCache.set(o,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,hn.get(t,this.getPath(e)))}defineProperty(e,t,r){return Reflect.defineProperty(e,t,r)?(this.isUnsubscribed||(this._getProperties(e)[t]=r),!0):!1}setProperty(e,t,r,n,s){if(!this._equals(s,r)||!(t in e)){let o=this._getOwnPropertyDescriptor(e,t);return o!==void 0&&"set"in o?Reflect.set(e,t,r,n):Reflect.set(e,t,r)}return!0}deleteProperty(e,t,r){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(e);n&&(delete n[t],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,t,r){let n=this._getOwnPropertyDescriptor(t,r);return e!==void 0&&n!==void 0&&Object.is(e.value,n.value)&&(e.writable||!1)===(n.writable||!1)&&(e.enumerable||!1)===(n.enumerable||!1)&&(e.configurable||!1)===(n.configurable||!1)&&e.get===n.get&&e.set===n.set}isGetInvariant(e,t){let r=this._getOwnPropertyDescriptor(e,t);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function Ka(i){return toString.call(i)==="[object Object]"}function Za(){return!0}function qs(i,e){return i.length!==e.length||i.some((t,r)=>e[r]!==t)}var rd=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]);var T2=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),ly={push:Za,pop:Za,shift:Za,unshift:Za,copyWithin:qs,reverse:qs,sort:qs,splice:qs,flat:qs,fill:qs},Ub=new Set([...rd,...T2,...Object.keys(ly)]);function $a(i,e){if(i.size!==e.size)return!0;for(let t of i)if(!e.has(t))return!0;return!1}var cy=["keys","values","entries"],hy=new Set(["has","toString"]),uy={add:$a,clear:$a,delete:$a,forEach:$a},zb=new Set([...hy,...Object.keys(uy),...cy]);function el(i,e){if(i.size!==e.size)return!0;let t;for(let[r,n]of i)if(t=e.get(r),t!==n||t===void 0&&!e.has(r))return!0;return!1}var _2=new Set([...hy,"get"]),fy={set:el,clear:el,delete:el,forEach:el},Gb=new Set([..._2,...Object.keys(fy),...cy]);var Rr=class{constructor(e,t,r,n){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=t===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return rd.has(e)}_shallowClone(e){let t=e;if(Ka(e))t=se({},e);else if(Pn(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){t=new Map;for(let[r,n]of e.entries())t.set(r,this._shallowClone(n))}return this._clonedCache.add(t),t}preferredThisArg(e,t,r,n){return e?(Pn(n)?this._onIsChanged=ly[t]:n instanceof Set?this._onIsChanged=uy[t]:n instanceof Map&&(this._onIsChanged=fy[t]),n):r}update(e,t,r){let n=hn.after(e,this._path);if(t!=="length"){let s=this.clone;hn.walk(n,o=>{s&&s[o]&&(this._clonedCache.has(s[o])||(s[o]=this._shallowClone(s[o])),s=s[o])}),this._hasOnValidate&&this._changes.push({path:n,property:t,previous:r}),s&&s[t]&&(s[t]=r)}this._isChanged=!0}undo(e){let t;for(let r=this._changes.length-1;r!==-1;r--)t=this._changes[r],hn.get(e,t.path)[t.property]=t.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}};var tl=class extends Rr{static isHandledMethod(e){return Ub.has(e)}};var yh=class extends Rr{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}};var rl=class extends Rr{static isHandledMethod(e){return zb.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}};var nl=class extends Rr{static isHandledMethod(e){return Gb.has(e)}undo(e){for(let[t,r]of this.clone.entries())e.set(t,r);for(let t of e.keys())this.clone.has(t)||e.delete(t)}};var vh=class extends Rr{constructor(e,t,r,n){super(void 0,t,r,n),this._arg1=r[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}};var xh=class extends Rr{constructor(e,t,r,n){super(void 0,t,r,n),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}};var hi=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return Ka(e)||Pn(e)||mh(e)}static isHandledMethod(e,t){return Ka(e)?Rr.isHandledMethod(t):Pn(e)?tl.isHandledMethod(t):e instanceof Set?rl.isHandledMethod(t):e instanceof Map?nl.isHandledMethod(t):mh(e)}get isCloning(){return this._stack.length>0}start(e,t,r){let n=Rr;Pn(e)?n=tl:e instanceof Date?n=yh:e instanceof Set?n=rl:e instanceof Map?n=nl:e instanceof WeakSet?n=vh:e instanceof WeakMap&&(n=xh),this._stack.push(new n(e,t,r,this._hasOnValidate))}update(e,t,r){this._stack[this._stack.length-1].update(e,t,r)}preferredThisArg(e,t,r){let{name:n}=e,s=hi.isHandledMethod(r,n);return this._stack[this._stack.length-1].preferredThisArg(s,n,t,r)}isChanged(e,t,r){return this._stack[this._stack.length-1].isChanged(e,t,r)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}};var E2={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},dy=(i,e,t={})=>{t=se(se({},E2),t);let r=Symbol("ProxyTarget"),{equals:n,isShallow:s,ignoreDetached:o,details:a}=t,l=new gh(n),c=typeof t.onValidate=="function",h=new hi(c),u=(y,w,b,S,T)=>!c||h.isCloning||t.onValidate(hn.concat(l.getPath(y),w),b,S,T)===!0,f=(y,w,b,S)=>{!td(l,t,w)&&!(o&&l.isDetached(y,i))&&d(l.getPath(y),w,b,S)},d=(y,w,b,S,T)=>{h.isCloning?h.update(y,w,S):e(hn.concat(y,w),b,S,T)},p=y=>y&&(y[r]||y),m=(y,w,b,S)=>Fb(y)||b==="constructor"||s&&!hi.isHandledMethod(w,b)||td(l,t,b)||l.isGetInvariant(w,b)||o&&l.isDetached(w,i)?y:(S===void 0&&(S=l.getPath(w)),l.getProxy(y,hn.concat(S,b),g,r)),g={get(y,w,b){if(zo(w)){if(w===r||w===ph)return y;if(w===sy&&!l.isUnsubscribed&&l.getPath(y).length===0)return l.unsubscribe(),y}let S=mh(y)?Reflect.get(y,w):Reflect.get(y,w,b);return m(S,y,w)},set(y,w,b,S){b=p(b);let T=y[r]||y,A=T[w];if(n(A,b)&&w in y)return!0;let x=u(y,w,b,A);return x&&l.setProperty(T,w,b,S,A)?(f(y,w,y[w],A),!0):!x},defineProperty(y,w,b){if(!l.isSameDescriptor(b,y,w)){let S=y[w];u(y,w,b.value,S)&&l.defineProperty(y,w,b,S)&&f(y,w,b.value,S)}return!0},deleteProperty(y,w){if(!Reflect.has(y,w))return!0;let b=Reflect.get(y,w),S=u(y,w,void 0,b);return S&&l.deleteProperty(y,w,b)?(f(y,w,void 0,b),!0):!S},apply(y,w,b){let S=w[r]||w;if(l.isUnsubscribed)return Reflect.apply(y,S,b);if((a===!1||a!==!0&&!a.includes(y.name))&&hi.isHandledType(S)){let T=hn.initial(l.getPath(y)),A=hi.isHandledMethod(S,y.name);h.start(S,T,b);let x=Reflect.apply(y,h.preferredThisArg(y,w,S),A?b.map(C=>p(C)):b),_=h.isChanged(S,n),E=h.stop();if(hi.isHandledType(x)&&A&&(w instanceof Map&&y.name==="get"&&(T=hn.concat(T,b[0])),x=l.getProxy(x,T,g)),_){let C={name:y.name,args:b,result:x},I=h.isCloning?hn.initial(T):T,N=h.isCloning?hn.last(T):"";u(hn.get(i,I),N,S,E,C)?d(I,N,S,E,C):h.undo(S)}return(w instanceof Map||w instanceof Set)&&oy(x)?ay(x,y,w,T,m):x}return Reflect.apply(y,w,b)}},v=l.getProxy(i,t.pathAsArray?[]:"",g);return e=e.bind(v),c&&(t.onValidate=t.onValidate.bind(v)),v};dy.target=i=>i&&i[ph]||i;dy.unsubscribe=i=>i[sy]||i;var py=dy;var C2=typeof global=="object"&&global&&global.Object===Object&&global,nd=C2;var P2=typeof self=="object"&&self&&self.Object===Object&&self,D2=nd||P2||Function("return this")(),ar=D2;var L2=ar.Symbol,un=L2;var kb=Object.prototype,I2=kb.hasOwnProperty,R2=kb.toString,bh=un?un.toStringTag:void 0;function B2(i){var e=I2.call(i,bh),t=i[bh];try{i[bh]=void 0;var r=!0}catch{}var n=R2.call(i);return r&&(e?i[bh]=t:delete i[bh]),n}var Vb=B2;var N2=Object.prototype,O2=N2.toString;function F2(i){return O2.call(i)}var Hb=F2;var U2="[object Null]",z2="[object Undefined]",Wb=un?un.toStringTag:void 0;function G2(i){return i==null?i===void 0?z2:U2:Wb&&Wb in Object(i)?Vb(i):Hb(i)}var Dn=G2;function k2(i){return i!=null&&typeof i=="object"}var Kr=k2;var V2="[object Symbol]";function H2(i){return typeof i=="symbol"||Kr(i)&&Dn(i)==V2}var Ys=H2;function W2(i,e){for(var t=-1,r=i==null?0:i.length,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n}var id=W2;var j2=Array.isArray,Vr=j2;var q2=1/0,jb=un?un.prototype:void 0,qb=jb?jb.toString:void 0;function Yb(i){if(typeof i=="string")return i;if(Vr(i))return id(i,Yb)+"";if(Ys(i))return qb?qb.call(i):"";var e=i+"";return e=="0"&&1/i==-q2?"-0":e}var Xb=Yb;var Y2=/\s/;function X2(i){for(var e=i.length;e--&&Y2.test(i.charAt(e)););return e}var Qb=X2;var Q2=/^\s+/;function J2(i){return i&&i.slice(0,Qb(i)+1).replace(Q2,"")}var Jb=J2;function K2(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var fr=K2;var Kb=0/0,Z2=/^[-+]0x[0-9a-f]+$/i,$2=/^0b[01]+$/i,eI=/^0o[0-7]+$/i,tI=parseInt;function rI(i){if(typeof i=="number")return i;if(Ys(i))return Kb;if(fr(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=fr(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Jb(i);var t=$2.test(i);return t||eI.test(i)?tI(i.slice(2),t?2:8):Z2.test(i)?Kb:+i}var my=rI;function nI(i){return i}var sd=nI;var iI="[object AsyncFunction]",sI="[object Function]",oI="[object GeneratorFunction]",aI="[object Proxy]";function lI(i){if(!fr(i))return!1;var e=Dn(i);return e==sI||e==oI||e==iI||e==aI}var il=lI;var cI=ar["__core-js_shared__"],od=cI;var Zb=function(){var i=/[^.]+$/.exec(od&&od.keys&&od.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function hI(i){return!!Zb&&Zb in i}var $b=hI;var uI=Function.prototype,fI=uI.toString;function dI(i){if(i!=null){try{return fI.call(i)}catch{}try{return i+""}catch{}}return""}var ls=dI;var pI=/[\\^$.*+?()[\]{}|]/g,mI=/^\[object .+?Constructor\]$/,gI=Function.prototype,yI=Object.prototype,vI=gI.toString,xI=yI.hasOwnProperty,bI=RegExp("^"+vI.call(xI).replace(pI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wI(i){if(!fr(i)||$b(i))return!1;var e=il(i)?bI:mI;return e.test(ls(i))}var ew=wI;function SI(i,e){return i==null?void 0:i[e]}var tw=SI;function MI(i,e){var t=tw(i,e);return ew(t)?t:void 0}var wn=MI;var AI=wn(ar,"WeakMap"),ad=AI;var rw=Object.create,TI=function(){function i(){}return function(e){if(!fr(e))return{};if(rw)return rw(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}}(),nw=TI;function _I(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}var iw=_I;function EI(i,e){var t=-1,r=i.length;for(e||(e=Array(r));++t<r;)e[t]=i[t];return e}var ld=EI;var CI=800,PI=16,DI=Date.now;function LI(i){var e=0,t=0;return function(){var r=DI(),n=PI-(r-t);if(t=r,n>0){if(++e>=CI)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}var sw=LI;function II(i){return function(){return i}}var ow=II;var RI=function(){try{var i=wn(Object,"defineProperty");return i({},"",{}),i}catch{}}(),sl=RI;var BI=sl?function(i,e){return sl(i,"toString",{configurable:!0,enumerable:!1,value:ow(e),writable:!0})}:sd,aw=BI;var NI=sw(aw),cd=NI;function OI(i,e){for(var t=-1,r=i==null?0:i.length;++t<r&&e(i[t],t,i)!==!1;);return i}var lw=OI;var FI=9007199254740991,UI=/^(?:0|[1-9]\d*)$/;function zI(i,e){var t=typeof i;return e=e==null?FI:e,!!e&&(t=="number"||t!="symbol"&&UI.test(i))&&i>-1&&i%1==0&&i<e}var hd=zI;function GI(i,e,t){e=="__proto__"&&sl?sl(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}var ol=GI;function kI(i,e){return i===e||i!==i&&e!==e}var Xs=kI;var VI=Object.prototype,HI=VI.hasOwnProperty;function WI(i,e,t){var r=i[e];(!(HI.call(i,e)&&Xs(r,t))||t===void 0&&!(e in i))&&ol(i,e,t)}var ud=WI;function jI(i,e,t,r){var n=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],i[a],a,t,i):void 0;l===void 0&&(l=i[a]),n?ol(t,a,l):ud(t,a,l)}return t}var Wn=jI;var cw=Math.max;function qI(i,e,t){return e=cw(e===void 0?i.length-1:e,0),function(){for(var r=arguments,n=-1,s=cw(r.length-e,0),o=Array(s);++n<s;)o[n]=r[e+n];n=-1;for(var a=Array(e+1);++n<e;)a[n]=r[n];return a[e]=t(o),iw(i,this,a)}}var fd=qI;function YI(i,e){return cd(fd(i,e,sd),i+"")}var hw=YI;var XI=9007199254740991;function QI(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=XI}var dd=QI;function JI(i){return i!=null&&dd(i.length)&&!il(i)}var Qs=JI;function KI(i,e,t){if(!fr(t))return!1;var r=typeof e;return(r=="number"?Qs(t)&&hd(e,t.length):r=="string"&&e in t)?Xs(t[e],i):!1}var uw=KI;function ZI(i){return hw(function(e,t){var r=-1,n=t.length,s=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(s=i.length>3&&typeof s=="function"?(n--,s):void 0,o&&uw(t[0],t[1],o)&&(s=n<3?void 0:s,n=1),e=Object(e);++r<n;){var a=t[r];a&&i(e,a,r,s)}return e})}var fw=ZI;var $I=Object.prototype;function eR(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||$I;return i===t}var al=eR;function tR(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r}var dw=tR;var rR="[object Arguments]";function nR(i){return Kr(i)&&Dn(i)==rR}var gy=nR;var pw=Object.prototype,iR=pw.hasOwnProperty,sR=pw.propertyIsEnumerable,oR=gy(function(){return arguments}())?gy:function(i){return Kr(i)&&iR.call(i,"callee")&&!sR.call(i,"callee")},Go=oR;function aR(){return!1}var mw=aR;var vw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gw=vw&&typeof module=="object"&&module&&!module.nodeType&&module,lR=gw&&gw.exports===vw,yw=lR?ar.Buffer:void 0,cR=yw?yw.isBuffer:void 0,hR=cR||mw,ll=hR;var uR="[object Arguments]",fR="[object Array]",dR="[object Boolean]",pR="[object Date]",mR="[object Error]",gR="[object Function]",yR="[object Map]",vR="[object Number]",xR="[object Object]",bR="[object RegExp]",wR="[object Set]",SR="[object String]",MR="[object WeakMap]",AR="[object ArrayBuffer]",TR="[object DataView]",_R="[object Float32Array]",ER="[object Float64Array]",CR="[object Int8Array]",PR="[object Int16Array]",DR="[object Int32Array]",LR="[object Uint8Array]",IR="[object Uint8ClampedArray]",RR="[object Uint16Array]",BR="[object Uint32Array]",Xt={};Xt[_R]=Xt[ER]=Xt[CR]=Xt[PR]=Xt[DR]=Xt[LR]=Xt[IR]=Xt[RR]=Xt[BR]=!0;Xt[uR]=Xt[fR]=Xt[AR]=Xt[dR]=Xt[TR]=Xt[pR]=Xt[mR]=Xt[gR]=Xt[yR]=Xt[vR]=Xt[xR]=Xt[bR]=Xt[wR]=Xt[SR]=Xt[MR]=!1;function NR(i){return Kr(i)&&dd(i.length)&&!!Xt[Dn(i)]}var xw=NR;function OR(i){return function(e){return i(e)}}var cl=OR;var bw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wh=bw&&typeof module=="object"&&module&&!module.nodeType&&module,FR=wh&&wh.exports===bw,yy=FR&&nd.process,UR=function(){try{var i=wh&&wh.require&&wh.require("util").types;return i||yy&&yy.binding&&yy.binding("util")}catch{}}(),cs=UR;var ww=cs&&cs.isTypedArray,zR=ww?cl(ww):xw,pd=zR;var GR=Object.prototype,kR=GR.hasOwnProperty;function VR(i,e){var t=Vr(i),r=!t&&Go(i),n=!t&&!r&&ll(i),s=!t&&!r&&!n&&pd(i),o=t||r||n||s,a=o?dw(i.length,String):[],l=a.length;for(var c in i)(e||kR.call(i,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hd(c,l)))&&a.push(c);return a}var md=VR;function HR(i,e){return function(t){return i(e(t))}}var gd=HR;var WR=gd(Object.keys,Object),Sw=WR;var jR=Object.prototype,qR=jR.hasOwnProperty;function YR(i){if(!al(i))return Sw(i);var e=[];for(var t in Object(i))qR.call(i,t)&&t!="constructor"&&e.push(t);return e}var Mw=YR;function XR(i){return Qs(i)?md(i):Mw(i)}var hl=XR;function QR(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e}var Aw=QR;var JR=Object.prototype,KR=JR.hasOwnProperty;function ZR(i){if(!fr(i))return Aw(i);var e=al(i),t=[];for(var r in i)r=="constructor"&&(e||!KR.call(i,r))||t.push(r);return t}var Tw=ZR;function $R(i){return Qs(i)?md(i,!0):Tw(i)}var Pi=$R;var eB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tB=/^\w*$/;function rB(i,e){if(Vr(i))return!1;var t=typeof i;return t=="number"||t=="symbol"||t=="boolean"||i==null||Ys(i)?!0:tB.test(i)||!eB.test(i)||e!=null&&i in Object(e)}var _w=rB;var nB=wn(Object,"create"),hs=nB;function iB(){this.__data__=hs?hs(null):{},this.size=0}var Ew=iB;function sB(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var Cw=sB;var oB="__lodash_hash_undefined__",aB=Object.prototype,lB=aB.hasOwnProperty;function cB(i){var e=this.__data__;if(hs){var t=e[i];return t===oB?void 0:t}return lB.call(e,i)?e[i]:void 0}var Pw=cB;var hB=Object.prototype,uB=hB.hasOwnProperty;function fB(i){var e=this.__data__;return hs?e[i]!==void 0:uB.call(e,i)}var Dw=fB;var dB="__lodash_hash_undefined__";function pB(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=hs&&e===void 0?dB:e,this}var Lw=pB;function ul(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1])}}ul.prototype.clear=Ew;ul.prototype.delete=Cw;ul.prototype.get=Pw;ul.prototype.has=Dw;ul.prototype.set=Lw;var vy=ul;function mB(){this.__data__=[],this.size=0}var Iw=mB;function gB(i,e){for(var t=i.length;t--;)if(Xs(i[t][0],e))return t;return-1}var Js=gB;var yB=Array.prototype,vB=yB.splice;function xB(i){var e=this.__data__,t=Js(e,i);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():vB.call(e,t,1),--this.size,!0}var Rw=xB;function bB(i){var e=this.__data__,t=Js(e,i);return t<0?void 0:e[t][1]}var Bw=bB;function wB(i){return Js(this.__data__,i)>-1}var Nw=wB;function SB(i,e){var t=this.__data__,r=Js(t,i);return r<0?(++this.size,t.push([i,e])):t[r][1]=e,this}var Ow=SB;function fl(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1])}}fl.prototype.clear=Iw;fl.prototype.delete=Rw;fl.prototype.get=Bw;fl.prototype.has=Nw;fl.prototype.set=Ow;var Ks=fl;var MB=wn(ar,"Map"),Zs=MB;function AB(){this.size=0,this.__data__={hash:new vy,map:new(Zs||Ks),string:new vy}}var Fw=AB;function TB(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}var Uw=TB;function _B(i,e){var t=i.__data__;return Uw(e)?t[typeof e=="string"?"string":"hash"]:t.map}var $s=_B;function EB(i){var e=$s(this,i).delete(i);return this.size-=e?1:0,e}var zw=EB;function CB(i){return $s(this,i).get(i)}var Gw=CB;function PB(i){return $s(this,i).has(i)}var kw=PB;function DB(i,e){var t=$s(this,i),r=t.size;return t.set(i,e),this.size+=t.size==r?0:1,this}var Vw=DB;function dl(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1])}}dl.prototype.clear=Fw;dl.prototype.delete=zw;dl.prototype.get=Gw;dl.prototype.has=kw;dl.prototype.set=Vw;var Sh=dl;var LB="Expected a function";function xy(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError(LB);var t=function(){var r=arguments,n=e?e.apply(this,r):r[0],s=t.cache;if(s.has(n))return s.get(n);var o=i.apply(this,r);return t.cache=s.set(n,o)||s,o};return t.cache=new(xy.Cache||Sh),t}xy.Cache=Sh;var Hw=xy;var IB=500;function RB(i){var e=Hw(i,function(r){return t.size===IB&&t.clear(),r}),t=e.cache;return e}var Ww=RB;var BB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,NB=/\\(\\)?/g,OB=Ww(function(i){var e=[];return i.charCodeAt(0)===46&&e.push(""),i.replace(BB,function(t,r,n,s){e.push(n?s.replace(NB,"$1"):r||t)}),e}),jw=OB;function FB(i){return i==null?"":Xb(i)}var qw=FB;function UB(i,e){return Vr(i)?i:_w(i,e)?[i]:jw(qw(i))}var pl=UB;var zB=1/0;function GB(i){if(typeof i=="string"||Ys(i))return i;var e=i+"";return e=="0"&&1/i==-zB?"-0":e}var yd=GB;function kB(i,e){e=pl(e,i);for(var t=0,r=e.length;i!=null&&t<r;)i=i[yd(e[t++])];return t&&t==r?i:void 0}var Yw=kB;function VB(i,e){for(var t=-1,r=e.length,n=i.length;++t<r;)i[n+t]=e[t];return i}var ml=VB;var Xw=un?un.isConcatSpreadable:void 0;function HB(i){return Vr(i)||Go(i)||!!(Xw&&i&&i[Xw])}var Qw=HB;function Jw(i,e,t,r,n){var s=-1,o=i.length;for(t||(t=Qw),n||(n=[]);++s<o;){var a=i[s];e>0&&t(a)?e>1?Jw(a,e-1,t,r,n):ml(n,a):r||(n[n.length]=a)}return n}var Kw=Jw;function WB(i){var e=i==null?0:i.length;return e?Kw(i,1):[]}var Zw=WB;function jB(i){return cd(fd(i,void 0,Zw),i+"")}var $w=jB;var qB=gd(Object.getPrototypeOf,Object),gl=qB;var YB="[object Object]",XB=Function.prototype,QB=Object.prototype,eS=XB.toString,JB=QB.hasOwnProperty,KB=eS.call(Object);function ZB(i){if(!Kr(i)||Dn(i)!=YB)return!1;var e=gl(i);if(e===null)return!0;var t=JB.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&eS.call(t)==KB}var vd=ZB;function $B(i,e,t){var r=-1,n=i.length;e<0&&(e=-e>n?0:n+e),t=t>n?n:t,t<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(n);++r<n;)s[r]=i[r+e];return s}var tS=$B;function eN(){this.__data__=new Ks,this.size=0}var rS=eN;function tN(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t}var nS=tN;function rN(i){return this.__data__.get(i)}var iS=rN;function nN(i){return this.__data__.has(i)}var sS=nN;var iN=200;function sN(i,e){var t=this.__data__;if(t instanceof Ks){var r=t.__data__;if(!Zs||r.length<iN-1)return r.push([i,e]),this.size=++t.size,this;t=this.__data__=new Sh(r)}return t.set(i,e),this.size=t.size,this}var oS=sN;function yl(i){var e=this.__data__=new Ks(i);this.size=e.size}yl.prototype.clear=rS;yl.prototype.delete=nS;yl.prototype.get=iS;yl.prototype.has=sS;yl.prototype.set=oS;var xd=yl;function oN(i,e){return i&&Wn(e,hl(e),i)}var aS=oN;function aN(i,e){return i&&Wn(e,Pi(e),i)}var lS=aN;var fS=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cS=fS&&typeof module=="object"&&module&&!module.nodeType&&module,lN=cS&&cS.exports===fS,hS=lN?ar.Buffer:void 0,uS=hS?hS.allocUnsafe:void 0;function cN(i,e){if(e)return i.slice();var t=i.length,r=uS?uS(t):new i.constructor(t);return i.copy(r),r}var bd=cN;function hN(i,e){for(var t=-1,r=i==null?0:i.length,n=0,s=[];++t<r;){var o=i[t];e(o,t,i)&&(s[n++]=o)}return s}var dS=hN;function uN(){return[]}var wd=uN;var fN=Object.prototype,dN=fN.propertyIsEnumerable,pS=Object.getOwnPropertySymbols,pN=pS?function(i){return i==null?[]:(i=Object(i),dS(pS(i),function(e){return dN.call(i,e)}))}:wd,vl=pN;function mN(i,e){return Wn(i,vl(i),e)}var mS=mN;var gN=Object.getOwnPropertySymbols,yN=gN?function(i){for(var e=[];i;)ml(e,vl(i)),i=gl(i);return e}:wd,Sd=yN;function vN(i,e){return Wn(i,Sd(i),e)}var gS=vN;function xN(i,e,t){var r=e(i);return Vr(i)?r:ml(r,t(i))}var Md=xN;function bN(i){return Md(i,hl,vl)}var yS=bN;function wN(i){return Md(i,Pi,Sd)}var Ad=wN;var SN=wn(ar,"DataView"),Td=SN;var MN=wn(ar,"Promise"),_d=MN;var AN=wn(ar,"Set"),Ed=AN;var vS="[object Map]",TN="[object Object]",xS="[object Promise]",bS="[object Set]",wS="[object WeakMap]",SS="[object DataView]",_N=ls(Td),EN=ls(Zs),CN=ls(_d),PN=ls(Ed),DN=ls(ad),ko=Dn;(Td&&ko(new Td(new ArrayBuffer(1)))!=SS||Zs&&ko(new Zs)!=vS||_d&&ko(_d.resolve())!=xS||Ed&&ko(new Ed)!=bS||ad&&ko(new ad)!=wS)&&(ko=function(i){var e=Dn(i),t=e==TN?i.constructor:void 0,r=t?ls(t):"";if(r)switch(r){case _N:return SS;case EN:return vS;case CN:return xS;case PN:return bS;case DN:return wS}return e});var xl=ko;var LN=Object.prototype,IN=LN.hasOwnProperty;function RN(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&IN.call(i,"index")&&(t.index=i.index,t.input=i.input),t}var MS=RN;var BN=ar.Uint8Array,by=BN;function NN(i){var e=new i.constructor(i.byteLength);return new by(e).set(new by(i)),e}var bl=NN;function ON(i,e){var t=e?bl(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength)}var AS=ON;var FN=/\w*$/;function UN(i){var e=new i.constructor(i.source,FN.exec(i));return e.lastIndex=i.lastIndex,e}var TS=UN;var _S=un?un.prototype:void 0,ES=_S?_S.valueOf:void 0;function zN(i){return ES?Object(ES.call(i)):{}}var CS=zN;function GN(i,e){var t=e?bl(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length)}var Cd=GN;var kN="[object Boolean]",VN="[object Date]",HN="[object Map]",WN="[object Number]",jN="[object RegExp]",qN="[object Set]",YN="[object String]",XN="[object Symbol]",QN="[object ArrayBuffer]",JN="[object DataView]",KN="[object Float32Array]",ZN="[object Float64Array]",$N="[object Int8Array]",e3="[object Int16Array]",t3="[object Int32Array]",r3="[object Uint8Array]",n3="[object Uint8ClampedArray]",i3="[object Uint16Array]",s3="[object Uint32Array]";function o3(i,e,t){var r=i.constructor;switch(e){case QN:return bl(i);case kN:case VN:return new r(+i);case JN:return AS(i,t);case KN:case ZN:case $N:case e3:case t3:case r3:case n3:case i3:case s3:return Cd(i,t);case HN:return new r;case WN:case YN:return new r(i);case jN:return TS(i);case qN:return new r;case XN:return CS(i)}}var PS=o3;function a3(i){return typeof i.constructor=="function"&&!al(i)?nw(gl(i)):{}}var Pd=a3;var l3="[object Map]";function c3(i){return Kr(i)&&xl(i)==l3}var DS=c3;var LS=cs&&cs.isMap,h3=LS?cl(LS):DS,IS=h3;var u3="[object Set]";function f3(i){return Kr(i)&&xl(i)==u3}var RS=f3;var BS=cs&&cs.isSet,d3=BS?cl(BS):RS,NS=d3;var p3=1,m3=2,g3=4,OS="[object Arguments]",y3="[object Array]",v3="[object Boolean]",x3="[object Date]",b3="[object Error]",FS="[object Function]",w3="[object GeneratorFunction]",S3="[object Map]",M3="[object Number]",US="[object Object]",A3="[object RegExp]",T3="[object Set]",_3="[object String]",E3="[object Symbol]",C3="[object WeakMap]",P3="[object ArrayBuffer]",D3="[object DataView]",L3="[object Float32Array]",I3="[object Float64Array]",R3="[object Int8Array]",B3="[object Int16Array]",N3="[object Int32Array]",O3="[object Uint8Array]",F3="[object Uint8ClampedArray]",U3="[object Uint16Array]",z3="[object Uint32Array]",Wt={};Wt[OS]=Wt[y3]=Wt[P3]=Wt[D3]=Wt[v3]=Wt[x3]=Wt[L3]=Wt[I3]=Wt[R3]=Wt[B3]=Wt[N3]=Wt[S3]=Wt[M3]=Wt[US]=Wt[A3]=Wt[T3]=Wt[_3]=Wt[E3]=Wt[O3]=Wt[F3]=Wt[U3]=Wt[z3]=!0;Wt[b3]=Wt[FS]=Wt[C3]=!1;function Dd(i,e,t,r,n,s){var o,a=e&p3,l=e&m3,c=e&g3;if(t&&(o=n?t(i,r,n,s):t(i)),o!==void 0)return o;if(!fr(i))return i;var h=Vr(i);if(h){if(o=MS(i),!a)return ld(i,o)}else{var u=xl(i),f=u==FS||u==w3;if(ll(i))return bd(i,a);if(u==US||u==OS||f&&!n){if(o=l||f?{}:Pd(i),!a)return l?gS(i,lS(o,i)):mS(i,aS(o,i))}else{if(!Wt[u])return n?i:{};o=PS(i,u,a)}}s||(s=new xd);var d=s.get(i);if(d)return d;s.set(i,o),NS(i)?i.forEach(function(g){o.add(Dd(g,e,t,g,i,s))}):IS(i)&&i.forEach(function(g,v){o.set(v,Dd(g,e,t,v,i,s))});var p=c?l?Ad:yS:l?Pi:hl,m=h?void 0:p(i);return lw(m||i,function(g,v){m&&(v=g,g=i[v]),ud(o,v,Dd(g,e,t,v,i,s))}),o}var Ld=Dd;var G3=1,k3=4;function V3(i){return Ld(i,G3|k3)}var Mh=V3;function H3(i){return function(e,t,r){for(var n=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[i?a:++n];if(t(s[l],l,s)===!1)break}return e}}var zS=H3;var W3=zS(),GS=W3;var j3=function(){return ar.Date.now()},Id=j3;var q3="Expected a function",Y3=Math.max,X3=Math.min;function Q3(i,e,t){var r,n,s,o,a,l,c=0,h=!1,u=!1,f=!0;if(typeof i!="function")throw new TypeError(q3);e=my(e)||0,fr(t)&&(h=!!t.leading,u="maxWait"in t,s=u?Y3(my(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(T){var A=r,x=n;return r=n=void 0,c=T,o=i.apply(x,A),o}function p(T){return c=T,a=setTimeout(v,e),h?d(T):o}function m(T){var A=T-l,x=T-c,_=e-A;return u?X3(_,s-x):_}function g(T){var A=T-l,x=T-c;return l===void 0||A>=e||A<0||u&&x>=s}function v(){var T=Id();if(g(T))return y(T);a=setTimeout(v,m(T))}function y(T){return a=void 0,f&&r?d(T):(r=n=void 0,o)}function w(){a!==void 0&&clearTimeout(a),c=0,r=l=n=a=void 0}function b(){return a===void 0?o:y(Id())}function S(){var T=Id(),A=g(T);if(r=arguments,n=this,l=T,A){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(v,e),d(l)}return a===void 0&&(a=setTimeout(v,e)),o}return S.cancel=w,S.flush=b,S}var Ah=Q3;function J3(i,e,t){(t!==void 0&&!Xs(i[e],t)||t===void 0&&!(e in i))&&ol(i,e,t)}var Th=J3;function K3(i){return Kr(i)&&Qs(i)}var kS=K3;function Z3(i,e){if(!(e==="constructor"&&typeof i[e]=="function")&&e!="__proto__")return i[e]}var _h=Z3;function $3(i){return Wn(i,Pi(i))}var VS=$3;function eO(i,e,t,r,n,s,o){var a=_h(i,t),l=_h(e,t),c=o.get(l);if(c){Th(i,t,c);return}var h=s?s(a,l,t+"",i,e,o):void 0,u=h===void 0;if(u){var f=Vr(l),d=!f&&ll(l),p=!f&&!d&&pd(l);h=l,f||d||p?Vr(a)?h=a:kS(a)?h=ld(a):d?(u=!1,h=bd(l,!0)):p?(u=!1,h=Cd(l,!0)):h=[]:vd(l)||Go(l)?(h=a,Go(a)?h=VS(a):(!fr(a)||il(a))&&(h=Pd(l))):u=!1}u&&(o.set(l,h),n(h,l,r,s,o),o.delete(l)),Th(i,t,h)}var HS=eO;function WS(i,e,t,r,n){i!==e&&GS(e,function(s,o){if(n||(n=new xd),fr(s))HS(i,e,o,t,WS,r,n);else{var a=r?r(_h(i,o),s,o+"",i,e,n):void 0;a===void 0&&(a=s),Th(i,o,a)}},Pi)}var jS=WS;function tO(i){var e=i==null?0:i.length;return e?i[e-1]:void 0}var qS=tO;function rO(i,e){return e.length<2?i:Yw(i,tS(e,0,-1))}var YS=rO;var nO=fw(function(i,e,t){jS(i,e,t)}),Vo=nO;function iO(i,e){return e=pl(e,i),i=YS(i,e),i==null||delete i[yd(qS(e))]}var XS=iO;function sO(i){return vd(i)?void 0:i}var QS=sO;var oO=1,aO=2,lO=4,cO=$w(function(i,e){var t={};if(i==null)return t;var r=!1;e=id(e,function(s){return s=pl(s,i),r||(r=s.length>1),s}),Wn(i,Ad(i),t),r&&(t=Ld(t,oO|aO|lO,QS));for(var n=e.length;n--;)XS(t,e[n]);return t}),wl=cO;var hO=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().includes(" electron/"),uO=()=>typeof window>"u"?!1:window.navigator.platform.toUpperCase().includes("MAC"),fO=()=>typeof window>"u"?!1:/iPad|iPhone|iPod/.test(window.navigator.userAgent)||Eh&&"ontouchend"in document,dO=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,pO=()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,mO=()=>{let i=navigator.userAgent,e=navigator.vendor;return/Safari/i.test(i)&&/Apple Computer/.test(e)},gO=()=>{let e=navigator.userAgent.match(/Version\/(\d+\.\d)/);return e&&e[1]},s9=hO(),Eh=uO(),Ho=fO(),JS=dO(),Rd=pO(),KS=mO(),ZS=Number(gO());function $S(i){return Array.isArray(i)?i:[i]}function Ch(i){return Eh?i.metaKey:i.ctrlKey}var eo;(t=>{t.all=["PerspectiveCamera","OrthographicCamera"];function e(r){return t.all.includes(r)}t.is=e})(eo||(eo={}));var Wo;(n=>{n.DefaultUp=[0,1,0],n.DefaultTargetOffset=1e3,n.defaultData={far:1e5,type:"OrthographicCamera",perspective:{near:5,fov:45,zoom:1},orthographic:{near:-1e5,zoom:1},up:n.DefaultUp,isUpVectorFlipped:!1,targetOffset:n.DefaultTargetOffset};function r(s){return s.type==="PerspectiveCamera"?s.perspective.zoom:s.orthographic.zoom}n.getZoom=r})(Wo||(Wo={}));var us;(t=>{function i(r,n){return r[0]===n[0]&&r[1]===n[1]}t.isEqual=i;function e(r,n,s){return[r[0]+(n[0]-r[0])*s,r[1]+(n[1]-r[1])*s]}t.lerp=e})(us||(us={}));var br;(n=>{function i(s,o){return s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]}n.isEqual=i;function e(s,o){return[s[0]+o[0],s[1]+o[1],s[2]+o[2]]}n.add=e;function t(s,o){return[s[0]-o[0],s[1]-o[1],s[2]-o[2]]}n.sub=t;function r(s,o,a){return[s[0]+(o[0]-s[0])*a,s[1]+(o[1]-s[1])*a,s[2]+(o[2]-s[2])*a]}n.lerp=r})(br||(br={}));var Ph;(t=>{function i(r,n){return r[0]===n[0]&&r[1]===n[1]&&r[2]===n[2]&&r[3]===n[3]}t.isEqual=i;function e(r,n,s){return[r[0]+(n[0]-r[0])*s,r[1]+(n[1]-r[1])*s,r[2]+(n[2]-r[2])*s,r[3]+(n[3]-r[3])*s]}t.lerp=e})(Ph||(Ph={}));var Di;(n=>{n.identity=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function e(s,o){for(let a=0;a<16;a++)if(s[a]!==o[a])return!1;return!0}n.isEqual=e;function t(s){return s!=null?s:n.identity}n.simplify=t;function r(s,o){let a=o.slice(0);for(var l=0,c=o.length;l<c;l+=3){let h=s[3]*o[l]+s[7]*o[l+1]+s[11]*o[l+2]+s[15];a[l]=(s[0]*o[l]+s[4]*o[l+1]+s[8]*o[l+2]+s[12])/h,a[l+1]=(s[1]*o[l]+s[5]*o[l+1]+s[9]*o[l+2]+s[13])/h,a[l+2]=(s[2]*o[l]+s[6]*o[l+1]+s[10]*o[l+2]+s[14])/h}return a}n.applyMatrix4=r})(Di||(Di={}));var Ar;(l=>{l.white={r:1,g:1,b:1},l.red={r:1,g:0,b:0},l.black={r:0,g:0,b:0};function r(c){return{r:Math.round(c.r*255),g:Math.round(c.g*255),b:Math.round(c.b*255),a:1}}l.toRgb255a1=r;function n(c){return{r:c.r,g:c.g,b:c.b}}l.clone=n;function s(c){return c=Math.floor(c),{r:(c>>16&255)/255,g:(c>>8&255)/255,b:(c&255)/255}}l.fromHex=s;function o(c,h){return c.r===h.r&&c.g===h.g&&c.b===h.b}l.equals=o;function a(c,h,u){return{r:c.r+(h.r-c.r)*u,g:c.g+(h.g-c.g)*u,b:c.b+(h.b-c.b)*u}}l.lerp=a})(Ar||(Ar={}));var Ln;(o=>{o.white=xe(se({},Ar.white),{a:1});function e(a){return{r:a[0],g:a[1],b:a[2],a:a[3]}}o.from0to1=e;function t(a,l){return xe(se({},Ar.fromHex(a)),{a:l})}o.fromHexAndA=t;function r(a){return{r:Math.round(a.r*255),g:Math.round(a.g*255),b:Math.round(a.b*255),a:a.a}}o.toRgb255a1=r;function n(a,l){return Ar.equals(a,l)&&a.a===l.a}o.equals=n;function s(a,l,c){return{r:a.r+(l.r-a.r)*c,g:a.g+(l.g-a.g)*c,b:a.b+(l.b-a.b)*c,a:a.a+(l.a-a.a)*c}}o.lerp=s})(Ln||(Ln={}));var Bd;(e=>e.identity={position:[0,0,0],rotation:[0,0,0],scale:[1,1,1]})(Bd||(Bd={}));var Nd;(e=>e.defaultData={mass:1,stiffness:80,damping:10,velocity:0})(Nd||(Nd={}));var Od;(e=>e.defaultData={control1:[.5,.05],control2:[.1,.3]})(Od||(Od={}));var Fd;(e=>{function i(t,r=.1){return{type:"radial",hideBase:!1,count:3,radial:{radius:Math.max(t[0],t[1])*2,start:0,end:360,alignment:!1,axis:"y",scale:[1,1,1],rotation:[0,0,0],position:[0,0,0]},linear:{scale:[1,1,1],rotation:[0,0,0],position:[t[0]+t[0]*r,0,0]},grid:{count:[2,2,2],size:t.map(n=>n*(1+r)),useCenter:!0}}}e.defaultData=i})(Fd||(Fd={}));var jn=class{modifyById(e,t){let r=this;if(r[e]===void 0)throw new Error("not expected");{let s=xe(se({},r),{[e]:t});return Object.setPrototypeOf(s,jn.prototype),s}}add(e,t){var n;let r=this.runOp({type:1,id:e,data:t});return(n=r==null?void 0:r.data)!=null?n:this}runOp(e){let t=this;if(e.type===1){let r=t[e.id],n;r===void 0?n={type:2,id:e.id}:n={type:1,id:e.id,data:r};let{id:s,data:o}=e,a=xe(se({},t),{[s]:o});return Object.setPrototypeOf(a,jn.prototype),{data:a,actual:e,reverse:n}}else if(e.type===2){let{id:r}=e,n=t[r];if(n===void 0)return null;{let s=se({},t);return Object.setPrototypeOf(s,jn.prototype),delete s[r],{data:s,actual:e,reverse:{type:1,id:r,data:n}}}}throw new Error("illegal arg")}};function Dh(i){if(i.deepFreeze!==void 0){i.deepFreeze(i);return}let e=Object.getOwnPropertyNames(i);for(let t of e){let r=i[t];r&&typeof r=="object"&&Dh(r)}return Object.freeze(i)}function eM(i,e){let t=0;for(;t<i.length&&t<e.length;){if(i[t]<e[t])return-1;if(i[t]>e[t])return 1;t+=1}return t!==e.length?-1:t!==i.length?1:0}var Ud=class extends Error{};function Li(i,e,t){if(i===void 0?e===void 0?(i=0,e=10):i=e-10:e===void 0&&(e=i+10),i>e){let s=i;i=e,e=s}let r=[],n=1/(t+1);for(let s=0;s<t;s++){let o=i+(e-i)*(s+.75+Math.random()*.5)*n;r.push(o)}return r}function tM(i){return i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Uint32Array||i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array||i instanceof Float32Array||i instanceof Float64Array}function rM(){return typeof process<"u"}function nM(i,e){for(let t of i)e(t.id,t.data),nM(t.children,e)}function iM(i,e){e(i.id,i.data);for(let t of i.children)iM(t,e)}var qn=class extends Array{constructor(...t){super(...t);Object.setPrototypeOf(this,qn.prototype)}deepFreeze(){let t=0;for(;t<this.length;)Dh(this[t]),t++}fillCaches0(t,r){this.objCaches.set(t.id,t),this.parentCaches.set(t.id,r);for(let n of t.children)this.fillCaches0(n,t.id)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,this.parentCaches=new Map;for(let t of this)this.fillCaches0(t,null)}}randomId(){this.fillCaches();let t=Array.from(this.objCaches.keys());if(t.length!==0)return t[Math.max(0,Math.floor(Math.random()*t.length)-1)]}isDescendantOf(t,r){for(;t;){let n=this.parent(t);if(n===r)return!0;t=n}return!1}data(t){var r;return(r=this.get(t))==null?void 0:r.data}has(t){return this.childrenOf(t)!==void 0}get(t){return this.fillCaches(),this.objCaches.get(t)}childrenOf(t){var r;return t===null?this:(r=this.get(t))==null?void 0:r.children}traverseFrom(t,r){if(t===null)this.traverse(r);else{let n=this.get(t);n&&iM(n,r)}}traverse(t){nM(this,t)}totalSize(){return this.fillCaches(),this.objCaches.size}parent(t){return this.fillCaches(),this.parentCaches.get(t)}childrenArray(t){return t===null?this:this.get(t).children}modifyById(t,r){if(this.get(t)===void 0)throw new Error("not expected");{let s=this.parent(t),o=this.childrenArray(s),a=o.findIndex(h=>h.id===t);if(a<0)throw new Error("not expected");let l=o[a];return o=[...o],o[a]=xe(se({},l),{data:r}),this.modifyArrayBy(s,o)}}modifyArrayBy(t,r){let n=t,s=r;for(;n!==null;){let a=s,l=n;if(n=this.parent(n),n===void 0)throw new Error;s=this.childrenArray(n);let c=s.findIndex(h=>h.id===l);if(c<0)throw new Error;s=[...s],s[c]=xe(se({},s[c]),{children:a})}Object.setPrototypeOf(s,qn.prototype);let o=s;return o.fillCaches(),o}runOp(t){switch(t.type){case 7:return this.addOp(t);case 8:return this.deleteOp(t);case 9:return this.moveOp(t)}}checkDuplicatedIdRec({id:t,children:r}){if(this.get(t)!==void 0)return!0;for(let n of r)if(this.checkDuplicatedIdRec(n))return!0;return!1}addOp(t){let{parent:r,fi:n,id:s,data:o,children:a}=t;if(r!==null&&this.get(r)===void 0)return null;if(this.checkDuplicatedIdRec(t))return null;{let l=r,c=this.childrenArray(l),h={fi:n,id:s,data:o,children:a};return c=[...c,h],c.sort((f,d)=>f.fi-d.fi),t.localIndex=c.indexOf(h),{data:this.modifyArrayBy(l,c),actual:t,reverse:{type:8,id:s}}}}deleteOp(t){let{id:r}=t;if(this.get(r)===null)return null;{let n=this.parent(r);if(n===void 0)return null;let s=this.childrenArray(n),o=s.findIndex(c=>c.id===r);t.localIndex=o,s=[...s];let a=s.splice(o,1)[0];return{data:this.modifyArrayBy(n,s),actual:t,reverse:xe(se({type:7},a),{parent:n})}}}moveOp(t){let{parent:r,fi:n,id:s}=t;if(r!==null&&this.get(r)===void 0)return this.deleteOp({type:8,id:s});if(r!==null){let d=r;for(;d!==null;){if(d===void 0)throw new Error;if(d===s)throw new Ud("cyclic tree");d=this.parent(d)}}let o=this.parent(s);if(o===void 0)return null;let a=o,l=this.childrenArray(o),c=l.findIndex(d=>d.id===s);l=[...l];let h=l.splice(c,1)[0],u=this.modifyArrayBy(o,l);o=r,l=u.childrenArray(o);let f=h.fi;return h=xe(se({},h),{fi:n}),l=[...l,h],l.sort((d,p)=>d.fi-p.fi),t.localIndex=l.indexOf(h),u=u.modifyArrayBy(o,l),{data:u,actual:t,reverse:{type:9,parent:a,fi:f,id:s}}}previous(t,r){if(r===null){let s=this.childrenArray(t);return s.length===0?null:s[s.length-1].id}let n=null;for(let s of this.childrenArray(t)){if(s.id===r)return n;n=s.id}return null}traverseSortNext(t){let r=this.parent(t);if(r!==void 0){let n=this.childrenArray(r),s=n.findIndex(o=>o.id===t)+1;if(s<n.length)return n[s].id;if(r)return this.traverseSortNext(r)}}sortNext(t){let r=this.childrenArray(t);return r.length>0?r[0].id:this.traverseSortNext(t)}traverseSortPrevious(t){let r=this.childrenArray(t);return r.length>0?this.traverseSortPrevious(r[r.length-1].id):t}sortPrevious(t){let r=this.parent(t);if(r!==void 0){let n=this.childrenArray(r),s=n.findIndex(o=>o.id===t)-1;return s>=0?this.traverseSortPrevious(n[s].id):r}}getAllSorted(t){let r=[];for(let n of t){let s=this.getWithSortKey(n.id);s!==void 0&&r.push(se(se({},n),s))}r.sort((n,s)=>eM(n.sortKey,s.sortKey));for(let n of r)delete n.sortKey;return r}getWithSortKey(t){var r=t;let n=[],s=this.get(r),o=s;if(s!==void 0){for(;r;)n.splice(0,0,s.fi),r=this.parent(r),r!==null&&(s=this.get(r));return xe(se({},o),{sortKey:n})}}insertBeforeHelper(t,r,n){return this.insertAfterHelper(t,this.previous(t,r),n)}insertAfterHelper(t,r,n){let s=this.childrenArray(t);if(r===null){if(s.length===0)return Li(0,n,n);{let o=s[0].fi;return Li(o-n,o,n)}}else{let o=this.get(r);if(o===void 0||this.parent(r)!==t)throw new Error("illegal args");let a=s.find(l=>l.fi>o.fi);if(a===void 0){let l=s[s.length-1].fi;return Li(l,l+n,n)}else return Li(o.fi,a.fi,n)}}};var zd;(e=>{function i(t,r){if(Array.isArray(t)){let n=r.props,s={},o=[...t],a=!1;if(n)for(let l of Object.keys(n)){let c=parseInt(l);if(isNaN(c))throw new Error("wrong index");s[l]=o[c],o[c]=n[l],a=!0}return a?{data:o,actual:r,reverse:{type:0,props:s}}:null}else{let n=r.props,s={},o=se({},t),a=!1;if(n)for(let l of Object.keys(n)){s[l]=o[l];let c=n[l];c===void 0?delete o[l]:o[l]=c,a=!0}return a?{data:o,actual:r,reverse:{type:0,props:s}}:null}}e.runOp=i})(zd||(zd={}));var rr=class extends Array{constructor(...t){super(...t);Object.setPrototypeOf(this,rr.prototype)}deepFreeze(){let t=0;for(;t<this.length;)Dh(this[t]),t++}fillCaches0(t){this.objCaches.set(t.id,t)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,Object.getOwnPropertyDescriptor(this,"objCaches").enumerable=!1;for(let t of this)this.fillCaches0(t)}}randomId(){this.fillCaches();let t=Array.from(this.objCaches.keys());if(t.length!==0)return t[Math.max(0,Math.floor(Math.random()*t.length)-1)]}data(t){var r;return(r=this.get(t))==null?void 0:r.data}get(t){return this.fillCaches(),this.objCaches.get(t)}modifyById(t,r){if(this.get(t)===void 0)throw new Error("not expected");{let s=this,o=s.findIndex(c=>c.id===t);if(o<0)throw new Error("not expected");let a=s[o];return s=[...s],s[o]=xe(se({},a),{data:r}),this.modifyArrayBy(s)}}modifyArrayBy(t){Object.setPrototypeOf(t,rr.prototype);let r=t;return rM()||r.fillCaches(),r}runOp(t){switch(t.type){case 4:return this.addOp(t);case 5:return this.deleteOp(t);case 6:return this.moveOp(t)}}addOp(t){let{fi:r,id:n,data:s}=t,o=this,a={fi:r,id:n,data:s};return o=[...o,a],o.sort((c,h)=>c.fi-h.fi),t.localIndex=o.indexOf(a),{data:this.modifyArrayBy(o),actual:t,reverse:{type:5,id:n}}}deleteOp(t){let{id:r}=t,n=this,s=n.findIndex(l=>l.id===r);if(s===-1)return null;t.localIndex=s,n=[...n];let o=n.splice(s,1)[0];return{data:this.modifyArrayBy(n),actual:t,reverse:se({type:4},o)}}moveOp(t){let{fi:r,id:n}=t,s=this;s=[...s];let o=s.findIndex(h=>h.id===n);if(o===-1)return null;let a=s[o].fi,l=xe(se({},s[o]),{fi:r});return s[o]=l,s.sort((h,u)=>h.fi-u.fi),t.localIndex=s.indexOf(l),{data:this.modifyArrayBy(s),actual:t,reverse:{type:6,fi:a,id:n}}}previous(t){if(t===null)return this.length===0?null:this[this.length-1].id;let r=null;for(let n of this){if(n.id===t)return r;r=n.id}return null}insertBeforeHelper(t,r){return this.insertAfterHelper(this.previous(t),r)}insertAfterHelper(t,r){let n=this;if(t===null){if(n.length===0)return Li(0,r,r);{let s=n[0].fi;return Li(s-r,s,r)}}else{let s=this.get(t);if(s===void 0)throw new Error("illegal args");let o=n.find(a=>a.fi>s.fi);if(o===void 0){let a=n[n.length-1].fi;return Li(a,a+r,r)}else return Li(s.fi,o.fi,r)}}};var sM=Symbol(),kd=Symbol(),Sl=class{reportOp(e,t){let r=this;if(t===null)return;r._current=t.data;let n=[];for(;!(r instanceof Gd);){let s=r._path,o=r._current;if(s!==""&&n.splice(0,0,s),r=r._parent,r===null)return;r.update(s,o)}r.push(n,e,t.actual,t.reverse)}deleteChildren(e){if(this._children){let t=this._children[e];if(t){let r=t[kd];r&&r(),delete this._children[e]}}}},Sy=class extends Sl{constructor(e,t,r){super(),this._parent=e,this._path=t,this._current=r}update(e,t){if(Array.isArray(this._current)){if(typeof e=="string"&&(e=parseInt(e),isNaN(e)))throw new Error("Invalid path");this._current=[...this._current],this._current[e]=t}else this._current=xe(se({},this._current),{[e]:t})}runOp(e){this.reportOp(e,zd.runOp(this._current,e))}},My=class extends Sl{constructor(e,t,r){super(),this._parent=e,this._path=t,this._current=r}update(e,t){this._current=xe(se({},this._current),{[e]:t}),Object.setPrototypeOf(this._current,jn.prototype)}runOp(e){this.reportOp(e,this._current.runOp(e))}},oM={get(i,e){if(e===kd)return()=>{i._parent=null};if(e===sM)return i._current;let{_current:t,_children:r}=i;if(e==="push"&&Array.isArray(t))throw new Error("not supported to expand array");let n=r===void 0?void 0:r[e];if(n!==void 0)return n;let s=t[e],o=Vd(i,e,s);return o!==s?(r===void 0&&(r={},i._children=r),r[e]=o,o):s},has(i,e){return e in i._current},ownKeys(i){return Reflect.ownKeys(i._current)},defineProperty(){throw Error("not supported")},getPrototypeOf(i){return Object.getPrototypeOf(i._current)},setPrototypeOf(){throw Error("not supported")},getOwnPropertyDescriptor(i,e){let t=i._current,r=Reflect.getOwnPropertyDescriptor(t,e);return r&&{writable:!0,configurable:!0,enumerable:r.enumerable,value:t[e]}}},yO=xe(se({},oM),{set(i,e,t){var n;let r={type:0,props:{[e]:(n=_y(t))!=null?n:t}};return i.deleteChildren(e),i.runOp(r),!0},deleteProperty(i,e){let t={type:0,props:{[e]:void 0}};return i.deleteChildren(e),i.runOp(t),!0}}),vO=xe(se({},oM),{set(i,e,t){return t===void 0?this.deleteProperty(i,e):(i.deleteChildren(e),i.runOp({type:1,id:e,data:t})),!0},deleteProperty(i,e){return i.runOp({type:2,id:e}),!0}}),Ml=class extends Sl{constructor(e,t,r){super(),this._children={},this._parent=e,this._path=t,this._current=r,this[kd]=()=>{this._parent=null}}unproxy(){return this._current}update(e,t){this._current=this._current.modifyById(e,t)}runOp(e){this.reportOp(e,this._current.runOp(e))}randomId(){return this._current.randomId()}isDescendantOf(e,t){return this._current.isDescendantOf(e,t)}childrenOf(e){return this._current.childrenOf(e)}traverse(e){return this._current.traverse(e)}get(e){return this._current.get(e)}parent(e){return this._current.parent(e)}traverse(e){this._current.traverse((t,r)=>{e(t,this.data(t))})}data(e){var a;let{_current:t,_children:r}=this,n=r===void 0?void 0:r[e];if(n!==void 0)return n;let s=(a=t.get(e))==null?void 0:a.data,o=Vd(this,e,s);return o!==s?(r===void 0&&(r={},this._children=r),r[e]=o,o):s}add(e,t,r,n,s){this.runOp({type:7,parent:e,fi:t,id:r,data:n,children:s})}move(e,t,r){this.runOp({type:9,parent:e,fi:t,id:r})}insertAfter(e,t,r){let n=this._current.insertAfterHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.add(e,n[s],o.id,o.data,o.children)}}insertBefore(e,t,r){let n=this._current.insertBeforeHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.add(e,n[s],o.id,o.data,o.children)}}moveAfter(e,t,r){let n=this._current.insertAfterHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.move(e,n[s],o)}}moveBefore(e,t,r){let n=this._current.insertBeforeHelper(e,t,r.length);for(let s=0;s<r.length;s++){let o=r[s];this.move(e,n[s],o)}}delete(e){this.deleteChildren(e),this.runOp({type:8,id:e})}sortNext(e){return this._current.sortNext(e)}sortPrevious(e){return this._current.sortPrevious(e)}getAllSorted(e){return this._current.getAllSorted(e)}},Al=class extends Sl{constructor(e,t,r){super(),this._children={},this._parent=e,this._path=t,this._current=r,this[kd]=()=>{this._parent=null}}unproxy(){return this._current}get length(){return this._current.length}forEach(e){let t=this.length;for(let r=0;r<t;r++){let n=this._current[r].id;e(this.data(this._current[r].id),n)}}update(e,t){this._current=this._current.modifyById(e,t)}randomId(){return this._current.randomId()}get(e){return xe(se({},this._current.get(e)),{data:this.data(e)})}data(e){var a;let{_current:t,_children:r}=this,n=r===void 0?void 0:r[e];if(n!==void 0)return n;let s=(a=t.get(e))==null?void 0:a.data,o=Vd(this,e,s);return o!==s?(r===void 0&&(r={},this._children=r),r[e]=o,o):s}runOp(e){this.reportOp(e,this._current.runOp(e))}add(e,t,r){this.runOp({type:4,fi:e,id:t,data:r})}move(e,t){this.runOp({type:6,fi:e,id:t})}insertAfter(e,t){let r=this._current.insertAfterHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.add(r[n],s.id,s.data)}}insertBefore(e,t){let r=this._current.insertBeforeHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.add(r[n],s.id,s.data)}}moveAfter(e,t){let r=this._current.insertAfterHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.move(r[n],s)}}moveBefore(e,t){let r=this._current.insertBeforeHelper(e,t.length);for(let n=0;n<t.length;n++){let s=t[n];this.move(r[n],s)}}delete(e){this.deleteChildren(e),this.runOp({type:5,id:e})}};function wy(i,e,t){if(i.length>0){let r=i[i.length-1];if(r.type===0&&e.type===0&&Hd.equal(r.path,t)){Object.assign(r.props,e.props);return}}i.push(xe(se({},e),{path:t}))}var Gd=class{constructor(e){this.ts=[],this.actual=[],this.reverse=[],this._current=e}update(e,t){if(e!=="")throw new Error("");this._current=t}push(e,t,r,n){wy(this.ts,t,e),wy(this.actual,r,e),wy(this.reverse,n,e)}result(){return{data:this._current,ts:this.ts,actual:this.actual,reverse:this.reverse.reverse()}}};function Vd(i,e,t){return t instanceof qn?new Ml(i,e,t):t instanceof rr?new Al(i,e,t):t instanceof jn?new Proxy(new My(i,e,t),vO):t!==null&&typeof t=="object"?tM(t)?t:new Proxy(new Sy(i,e,t),yO):t}function Ay(i){let e=new Gd(i);return[Vd(e,"",i),e]}function Ty(i,e){let[t,r]=Ay(i);return e(t),r.result()}function _y(i){return i instanceof Ml||i instanceof Al?i._current:i!==null&&typeof i=="object"?i[sM]:i}var Hd;(r=>{function i(n,s){if(s.length===n.length)for(var o=0;o<n.length;){if(n[o]!==s[o])return!1;o+=1}else return!1;return!0}r.equal=i;function e(n,s,o){let a=t(o,n);if(a!==void 0&&typeof a=="object"&&a!==null){let l=se({},s);return Object.keys(a).forEach(c=>{delete l[c]}),l}else return s}r.removeOverridden=e;function t(n,s,o=0){if(s.length<=o)return n;if((n instanceof qn||n instanceof Ml)&&typeof s[o]=="string")return t(n.data(s[o]),s,o+1);if((n instanceof rr||n instanceof Al)&&typeof s[o]=="string")return t(n.data(s[o]),s,o+1);if(typeof s[o]=="number"&&Array.isArray(n))return t(n[s[o]],s,o+1);if(typeof s[o]=="string"&&typeof n=="object")return t(n[s[o]],s,o+1)}r.zoom=t})(Hd||(Hd={}));var Wd=class{},Lh=class extends Wd{constructor(t){super();this.id=t}},Ih=class extends Wd{constructor(t){super();this.data=t}};var Cy;try{Cy=new TextDecoder}catch{}var Re,ro,ee=0;var pM=[],Py=pM,Dy=0,Sn={},Ct,to,Yn=0,Ii=0,In,fs,fn=[],Bt,aM={useRecords:!1,mapsAsObjects:!0},Rh=class{},Iy=new Rh;Iy.name="MessagePack 0xC1";var Tl=!1,Ri=class{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0)),Object.assign(this,e)}unpack(e,t){if(Re)return xM(()=>(qd(),this?this.unpack(e,t):Ri.prototype.unpack.call(aM,e,t)));ro=t>-1?t:e.length,ee=0,Dy=0,Ii=0,to=null,Py=pM,In=null,Re=e;try{Bt=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(r){throw Re=null,e instanceof Uint8Array?r:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof Ri){if(Sn=this,this.structures)return Ct=this.structures,jd();(!Ct||Ct.length>0)&&(Ct=[])}else Sn=aM,(!Ct||Ct.length>0)&&(Ct=[]);return jd()}unpackMultiple(e,t){let r,n=0;try{Tl=!0;let s=e.length,o=this?this.unpack(e,s):Qd.unpack(e,s);if(t){for(t(o);ee<s;)if(n=ee,t(jd())===!1)return}else{for(r=[o];ee<s;)n=ee,r.push(jd());return r}}catch(s){throw s.lastPosition=n,s.values=r,s}finally{Tl=!1,qd()}}_mergeStructures(e,t){e=e||[];for(let r=0,n=e.length;r<n;r++){let s=e[r];s&&(s.isShared=!0,r>=32&&(s.highByte=r-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],s=t[r];s&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=s)}return this.structures=e}decode(e,t){return this.unpack(e,t)}};function jd(){try{if(!Sn.trusted&&!Tl){let e=Ct.sharedLength||0;e<Ct.length&&(Ct.length=e)}let i=lr();if(ee==ro)Ct.restoreStructures&&lM(),Ct=null,Re=null,fs&&(fs=null);else if(ee>ro){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}else if(!Tl)throw new Error("Data read, but end of buffer not reached");return i}catch(i){throw Ct.restoreStructures&&lM(),qd(),(i instanceof RangeError||i.message.startsWith("Unexpected end of buffer"))&&(i.incomplete=!0),i}}function lM(){for(let i in Ct.restoreStructures)Ct[i]=Ct.restoreStructures[i];Ct.restoreStructures=null}function lr(){let i=Re[ee++];if(i<160)if(i<128){if(i<64)return i;{let e=Ct[i&63]||Sn.getStructures&&mM()[i&63];return e?(e.read||(e.read=Ry(e,i&63)),e.read()):i}}else if(i<144)if(i-=128,Sn.mapsAsObjects){let e={};for(let t=0;t<i;t++)e[yM()]=lr();return e}else{let e=new Map;for(let t=0;t<i;t++)e.set(lr(),lr());return e}else{i-=144;let e=new Array(i);for(let t=0;t<i;t++)e[t]=lr();return e}else if(i<192){let e=i-160;if(Ii>=ee)return to.slice(ee-Yn,(ee+=e)-Yn);if(Ii==0&&ro<140){let t=e<16?By(e):gM(e);if(t!=null)return t}return Ly(e)}else{let e;switch(i){case 192:return null;case 193:return In?(e=lr(),e>0?In[1].slice(In.position1,In.position1+=e):In[0].slice(In.position0,In.position0-=e)):Iy;case 194:return!1;case 195:return!0;case 196:return Ey(Re[ee++]);case 197:return e=Bt.getUint16(ee),ee+=2,Ey(e);case 198:return e=Bt.getUint32(ee),ee+=4,Ey(e);case 199:return jo(Re[ee++]);case 200:return e=Bt.getUint16(ee),ee+=2,jo(e);case 201:return e=Bt.getUint32(ee),ee+=4,jo(e);case 202:if(e=Bt.getFloat32(ee),Sn.useFloat32>2){let t=Xd[(Re[ee]&127)<<1|Re[ee+1]>>7];return ee+=4,(t*e+(e>0?.5:-.5)>>0)/t}return ee+=4,e;case 203:return e=Bt.getFloat64(ee),ee+=8,e;case 204:return Re[ee++];case 205:return e=Bt.getUint16(ee),ee+=2,e;case 206:return e=Bt.getUint32(ee),ee+=4,e;case 207:return Sn.int64AsNumber?(e=Bt.getUint32(ee)*4294967296,e+=Bt.getUint32(ee+4)):e=Bt.getBigUint64(ee),ee+=8,e;case 208:return Bt.getInt8(ee++);case 209:return e=Bt.getInt16(ee),ee+=2,e;case 210:return e=Bt.getInt32(ee),ee+=4,e;case 211:return Sn.int64AsNumber?(e=Bt.getInt32(ee)*4294967296,e+=Bt.getUint32(ee+4)):e=Bt.getBigInt64(ee),ee+=8,e;case 212:if(e=Re[ee++],e==114)return dM(Re[ee++]&63);{let t=fn[e];if(t)return t.read?(ee++,t.read(lr())):t.noBuffer?(ee++,t()):t(Re.subarray(ee,++ee));throw new Error("Unknown extension "+e)}case 213:return e=Re[ee],e==114?(ee++,dM(Re[ee++]&63,Re[ee++])):jo(2);case 214:return jo(4);case 215:return jo(8);case 216:return jo(16);case 217:return e=Re[ee++],Ii>=ee?to.slice(ee-Yn,(ee+=e)-Yn):bO(e);case 218:return e=Bt.getUint16(ee),ee+=2,Ii>=ee?to.slice(ee-Yn,(ee+=e)-Yn):wO(e);case 219:return e=Bt.getUint32(ee),ee+=4,Ii>=ee?to.slice(ee-Yn,(ee+=e)-Yn):SO(e);case 220:return e=Bt.getUint16(ee),ee+=2,hM(e);case 221:return e=Bt.getUint32(ee),ee+=4,hM(e);case 222:return e=Bt.getUint16(ee),ee+=2,uM(e);case 223:return e=Bt.getUint32(ee),ee+=4,uM(e);default:if(i>=224)return i-256;if(i===void 0){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+i)}}}var xO=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Ry(i,e){function t(){if(t.count++>2){let n=i.read=new Function("r","return function(){return {"+i.map(s=>xO.test(s)?s+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}}")(lr);return i.highByte===0&&(i.read=cM(e,i.read)),n()}let r={};for(let n=0,s=i.length;n<s;n++){let o=i[n];r[o]=lr()}return r}return t.count=0,i.highByte===0?cM(e,t):t}var cM=(i,e)=>function(){let t=Re[ee++];if(t===0)return e();let r=i<32?-(i+(t<<5)):i+(t<<5),n=Ct[r]||mM()[r];if(!n)throw new Error("Record id is not defined for "+r);return n.read||(n.read=Ry(n,i)),n.read()};function mM(){let i=xM(()=>(Re=null,Sn.getStructures()));return Ct=Sn._mergeStructures(i,Ct)}var Ly=Yd,bO=Yd,wO=Yd,SO=Yd;function Yd(i){let e;if(i<16&&(e=By(i)))return e;if(i>64&&Cy)return Cy.decode(Re.subarray(ee,ee+=i));let t=ee+i,r=[];for(e="";ee<t;){let n=Re[ee++];if((n&128)===0)r.push(n);else if((n&224)===192){let s=Re[ee++]&63;r.push((n&31)<<6|s)}else if((n&240)===224){let s=Re[ee++]&63,o=Re[ee++]&63;r.push((n&31)<<12|s<<6|o)}else if((n&248)===240){let s=Re[ee++]&63,o=Re[ee++]&63,a=Re[ee++]&63,l=(n&7)<<18|s<<12|o<<6|a;l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|l&1023),r.push(l)}else r.push(n);r.length>=4096&&(e+=Br.apply(String,r),r.length=0)}return r.length>0&&(e+=Br.apply(String,r)),e}function hM(i){let e=new Array(i);for(let t=0;t<i;t++)e[t]=lr();return e}function uM(i){if(Sn.mapsAsObjects){let e={};for(let t=0;t<i;t++)e[yM()]=lr();return e}else{let e=new Map;for(let t=0;t<i;t++)e.set(lr(),lr());return e}}var Br=String.fromCharCode;function gM(i){let e=ee,t=new Array(i);for(let r=0;r<i;r++){let n=Re[ee++];if((n&128)>0){ee=e;return}t[r]=n}return Br.apply(String,t)}function By(i){if(i<4)if(i<2){if(i===0)return"";{let e=Re[ee++];if((e&128)>1){ee-=1;return}return Br(e)}}else{let e=Re[ee++],t=Re[ee++];if((e&128)>0||(t&128)>0){ee-=2;return}if(i<3)return Br(e,t);let r=Re[ee++];if((r&128)>0){ee-=3;return}return Br(e,t,r)}else{let e=Re[ee++],t=Re[ee++],r=Re[ee++],n=Re[ee++];if((e&128)>0||(t&128)>0||(r&128)>0||(n&128)>0){ee-=4;return}if(i<6){if(i===4)return Br(e,t,r,n);{let s=Re[ee++];if((s&128)>0){ee-=5;return}return Br(e,t,r,n,s)}}else if(i<8){let s=Re[ee++],o=Re[ee++];if((s&128)>0||(o&128)>0){ee-=6;return}if(i<7)return Br(e,t,r,n,s,o);let a=Re[ee++];if((a&128)>0){ee-=7;return}return Br(e,t,r,n,s,o,a)}else{let s=Re[ee++],o=Re[ee++],a=Re[ee++],l=Re[ee++];if((s&128)>0||(o&128)>0||(a&128)>0||(l&128)>0){ee-=8;return}if(i<10){if(i===8)return Br(e,t,r,n,s,o,a,l);{let c=Re[ee++];if((c&128)>0){ee-=9;return}return Br(e,t,r,n,s,o,a,l,c)}}else if(i<12){let c=Re[ee++],h=Re[ee++];if((c&128)>0||(h&128)>0){ee-=10;return}if(i<11)return Br(e,t,r,n,s,o,a,l,c,h);let u=Re[ee++];if((u&128)>0){ee-=11;return}return Br(e,t,r,n,s,o,a,l,c,h,u)}else{let c=Re[ee++],h=Re[ee++],u=Re[ee++],f=Re[ee++];if((c&128)>0||(h&128)>0||(u&128)>0||(f&128)>0){ee-=12;return}if(i<14){if(i===12)return Br(e,t,r,n,s,o,a,l,c,h,u,f);{let d=Re[ee++];if((d&128)>0){ee-=13;return}return Br(e,t,r,n,s,o,a,l,c,h,u,f,d)}}else{let d=Re[ee++],p=Re[ee++];if((d&128)>0||(p&128)>0){ee-=14;return}if(i<15)return Br(e,t,r,n,s,o,a,l,c,h,u,f,d,p);let m=Re[ee++];if((m&128)>0){ee-=15;return}return Br(e,t,r,n,s,o,a,l,c,h,u,f,d,p,m)}}}}}function Ey(i){return Sn.copyBuffers?Uint8Array.prototype.slice.call(Re,ee,ee+=i):Re.subarray(ee,ee+=i)}function jo(i){let e=Re[ee++];if(fn[e])return fn[e](Re.subarray(ee,ee+=i));throw new Error("Unknown extension type "+e)}var fM=new Array(4096);function yM(){let i=Re[ee++];if(i>=160&&i<192){if(i=i-160,Ii>=ee)return to.slice(ee-Yn,(ee+=i)-Yn);if(!(Ii==0&&ro<180))return Ly(i)}else return ee--,lr();let e=(i<<5^(i>1?Bt.getUint16(ee):i>0?Re[ee]:0))&4095,t=fM[e],r=ee,n=ee+i-3,s,o=0;if(t&&t.bytes==i){for(;r<n;){if(s=Bt.getUint32(r),s!=t[o++]){r=1879048192;break}r+=4}for(n+=3;r<n;)if(s=Re[r++],s!=t[o++]){r=1879048192;break}if(r===n)return ee=r,t.string;n-=3,r=ee}for(t=[],fM[e]=t,t.bytes=i;r<n;)s=Bt.getUint32(r),t.push(s),r+=4;for(n+=3;r<n;)s=Re[r++],t.push(s);let a=i<16?By(i):gM(i);return a!=null?t.string=a:t.string=Ly(i)}var dM=(i,e)=>{var t=lr();let r=i;e!==void 0&&(i=i<32?-((e<<5)+i):(e<<5)+i,t.highByte=e);let n=Ct[i];return n&&n.isShared&&((Ct.restoreStructures||(Ct.restoreStructures=[]))[i]=n),Ct[i]=t,t.read=Ry(t,r),t.read()},vM=typeof self=="object"?self:global;fn[0]=()=>{};fn[0].noBuffer=!0;fn[101]=()=>{let i=lr();return(vM[i[0]]||Error)(i[1])};fn[105]=i=>{let e=Bt.getUint32(ee-4);fs||(fs=new Map);let t=Re[ee],r;t>=144&&t<160||t==220||t==221?r=[]:r={};let n={target:r};fs.set(e,n);let s=lr();return n.used?Object.assign(r,s):(n.target=s,s)};fn[112]=i=>{let e=Bt.getUint32(ee-4),t=fs.get(e);return t.used=!0,t.target};fn[115]=()=>new Set(lr());var Ny=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(i=>i+"Array");fn[116]=i=>{let e=i[0],t=Ny[e];if(!t)throw new Error("Could not find typed array for code "+e);return new vM[t](Uint8Array.prototype.slice.call(i,1).buffer)};fn[120]=()=>{let i=lr();return new RegExp(i[0],i[1])};fn[98]=i=>{let e=(i[0]<<24)+(i[1]<<16)+(i[2]<<8)+i[3],t=ee;ee+=e-4,In=[lr(),lr()],In.position0=0,In.position1=0;let r=ee;ee=t;try{return lr()}finally{ee=r}};fn[255]=i=>i.length==4?new Date((i[0]*16777216+(i[1]<<16)+(i[2]<<8)+i[3])*1e3):i.length==8?new Date(((i[0]<<22)+(i[1]<<14)+(i[2]<<6)+(i[3]>>2))/1e6+((i[3]&3)*4294967296+i[4]*16777216+(i[5]<<16)+(i[6]<<8)+i[7])*1e3):i.length==12?new Date(((i[0]<<24)+(i[1]<<16)+(i[2]<<8)+i[3])/1e6+((i[4]&128?-281474976710656:0)+i[6]*1099511627776+i[7]*4294967296+i[8]*16777216+(i[9]<<16)+(i[10]<<8)+i[11])*1e3):new Date("invalid");function xM(i){let e=ro,t=ee,r=Dy,n=Yn,s=Ii,o=to,a=Py,l=fs,c=In,h=new Uint8Array(Re.slice(0,ro)),u=Ct,f=Ct.slice(0,Ct.length),d=Sn,p=Tl,m=i();return ro=e,ee=t,Dy=r,Yn=n,Ii=s,to=o,Py=a,fs=l,In=c,Re=h,Tl=p,Ct=u,Ct.splice(0,Ct.length,...f),Sn=d,Bt=new DataView(Re.buffer,Re.byteOffset,Re.byteLength),m}function qd(){Re=null,fs=null,Ct=null}function bM(i){i.unpack?fn[i.type]=i.unpack:fn[i.type]=i}var Xd=new Array(147);for(let i=0;i<256;i++)Xd[i]=+("1e"+Math.floor(45.15-i*.30103));var Qd=new Ri({useRecords:!1}),MO=Qd.unpack,AO=Qd.unpackMultiple,TO=Qd.unpack,Jd={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4},_O=new Float32Array(1),F9=new Uint8Array(_O.buffer,0,4);var Kd;try{Kd=new TextEncoder}catch{}var Zd,Fy,$d=typeof Buffer<"u",Oy=$d?Buffer.allocUnsafeSlow:Uint8Array,AM=$d?Buffer:Uint8Array,wM=$d?4294967296:2144337920,pe,dr,ae=0,Bi,Ni=null,EO=/[\u0080-\uFFFF]/,Bh=Symbol("record-id"),qo=class extends Ri{constructor(e){super(e),this.offset=0;let t,r,n,s,o,a,l=0,c=AM.prototype.utf8Write?function(x,_,E){return pe.utf8Write(x,_,E)}:Kd&&Kd.encodeInto?function(x,_){return Kd.encodeInto(x,pe.subarray(_)).written}:!1,h=this;e||(e={});let u=e&&e.sequential,f=e.structures||e.saveStructures,d=e.maxSharedStructures;if(d==null&&(d=f?32:0),d>8160)throw new Error("Maximum maxSharedStructure is 8160");let p=e.maxOwnStructures;p==null&&(p=f?32:64),u&&!e.saveStructures&&(this.structures=[]);let m=d>32||p+d>64,g=d+64,v=d+p+64;if(v>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let y=[],w=0,b=0;this.pack=this.encode=function(x,_){if(pe||(pe=new Oy(8192),dr=new DataView(pe.buffer,0,8192),ae=0),Bi=pe.length-10,Bi-ae<2048?(pe=new Oy(pe.length),dr=new DataView(pe.buffer,0,pe.length),Bi=pe.length-10,ae=0):ae=ae+7&2147483640,r=ae,a=h.structuredClone?new Map:null,h.bundleStrings?(Ni=["",""],pe[ae++]=214,pe[ae++]=98,Ni.position=ae-r,ae+=4):Ni=null,n=h.structures,n){n.uninitialized&&(n=h._mergeStructures(h.getStructures()));let E=n.sharedLength||0;if(E>d)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let C=0;C<E;C++){let I=n[C];if(!I)continue;let N,R=n.transitions;for(let k=0,G=I.length;k<G;k++){let K=I[k];N=R[K],N||(N=R[K]=Object.create(null)),R=N}R[Bh]=C+64}l=E}u||(n.nextId=E+64)}s&&(s=!1),o=n||[];try{if(S(x),Ni){dr.setUint32(Ni.position+r,ae-Ni.position-r);let E=Ni;Ni=null,S(E[0]),S(E[1])}if(h.offset=ae,a&&a.idsToInsert){ae+=a.idsToInsert.length*6,ae>Bi&&A(ae),h.offset=ae;let E=PO(pe.subarray(r,ae),a.idsToInsert);return a=null,E}return _&_M?(pe.start=r,pe.end=ae,pe):pe.subarray(r,ae)}finally{if(n){if(b<10&&b++,w>1e4)n.transitions=null,b=0,w=0,y.length>0&&(y=[]);else if(y.length>0&&!u){for(let E=0,C=y.length;E<C;E++)y[E][Bh]=0;y=[]}if(s&&h.saveStructures){let E=n.sharedLength||d;n.length>E&&(n=n.slice(0,E));let C=pe.subarray(r,ae);return h.saveStructures(n,l)===!1?(h._mergeStructures(h.getStructures()),h.pack(x)):(l=E,C)}}_&OO&&(ae=r)}};let S=x=>{ae>Bi&&(pe=A(ae));var _=typeof x,E;if(_==="string"){let C=x.length;if(Ni&&C>=8&&C<4096){let R=EO.test(x);Ni[R?0:1]+=x,pe[ae++]=193,S(R?-C:C);return}let I;C<32?I=1:C<256?I=2:C<65536?I=3:I=5;let N=C*3;if(ae+N>Bi&&(pe=A(ae+N)),C<64||!c){let R,k,G,K=ae+I;for(R=0;R<C;R++)k=x.charCodeAt(R),k<128?pe[K++]=k:k<2048?(pe[K++]=k>>6|192,pe[K++]=k&63|128):(k&64512)===55296&&((G=x.charCodeAt(R+1))&64512)===56320?(k=65536+((k&1023)<<10)+(G&1023),R++,pe[K++]=k>>18|240,pe[K++]=k>>12&63|128,pe[K++]=k>>6&63|128,pe[K++]=k&63|128):(pe[K++]=k>>12|224,pe[K++]=k>>6&63|128,pe[K++]=k&63|128);E=K-ae-I}else E=c(x,ae+I,N);E<32?pe[ae++]=160|E:E<256?(I<2&&pe.copyWithin(ae+2,ae+1,ae+1+E),pe[ae++]=217,pe[ae++]=E):E<65536?(I<3&&pe.copyWithin(ae+3,ae+2,ae+2+E),pe[ae++]=218,pe[ae++]=E>>8,pe[ae++]=E&255):(I<5&&pe.copyWithin(ae+5,ae+3,ae+3+E),pe[ae++]=219,dr.setUint32(ae,E),ae+=4),ae+=E}else if(_==="number")if(x>>>0===x)x<64?pe[ae++]=x:x<256?(pe[ae++]=204,pe[ae++]=x):x<65536?(pe[ae++]=205,pe[ae++]=x>>8,pe[ae++]=x&255):(pe[ae++]=206,dr.setUint32(ae,x),ae+=4);else if(x>>0===x)x>=-32?pe[ae++]=256+x:x>=-128?(pe[ae++]=208,pe[ae++]=x+256):x>=-32768?(pe[ae++]=209,dr.setInt16(ae,x),ae+=2):(pe[ae++]=210,dr.setInt32(ae,x),ae+=4);else{let C;if((C=this.useFloat32)>0&&x<4294967296&&x>=-2147483648){pe[ae++]=202,dr.setFloat32(ae,x);let I;if(C<4||(I=x*Xd[(pe[ae]&127)<<1|pe[ae+1]>>7])>>0===I){ae+=4;return}else ae--}pe[ae++]=203,dr.setFloat64(ae,x),ae+=8}else if(_==="object")if(!x)pe[ae++]=192;else{if(a){let I=a.get(x);if(I){if(!I.id){let N=a.idsToInsert||(a.idsToInsert=[]);I.id=N.push(I)}pe[ae++]=214,pe[ae++]=112,dr.setUint32(ae,I.id),ae+=4;return}else a.set(x,{offset:ae-r})}let C=x.constructor;if(C===Object)T(x,!0);else if(C===Array){E=x.length,E<16?pe[ae++]=144|E:E<65536?(pe[ae++]=220,pe[ae++]=E>>8,pe[ae++]=E&255):(pe[ae++]=221,dr.setUint32(ae,E),ae+=4);for(let I=0;I<E;I++)S(x[I])}else if(C===Map){E=x.size,E<16?pe[ae++]=128|E:E<65536?(pe[ae++]=222,pe[ae++]=E>>8,pe[ae++]=E&255):(pe[ae++]=223,dr.setUint32(ae,E),ae+=4);for(let[I,N]of x)S(I),S(N)}else{for(let I=0,N=Zd.length;I<N;I++){let R=Fy[I];if(x instanceof R){let k=Zd[I];if(k.write){k.type&&(pe[ae++]=212,pe[ae++]=k.type,pe[ae++]=0),S(k.write.call(this,x));return}let G=pe,K=dr,J=ae;pe=null;let Y;try{Y=k.pack.call(this,x,F=>(pe=G,G=null,ae+=F,ae>Bi&&A(ae),{target:pe,targetView:dr,position:ae-F}),S)}finally{G&&(pe=G,dr=K,ae=J,Bi=pe.length-10)}Y&&(Y.length+ae>Bi&&A(Y.length+ae),ae=CO(Y,pe,ae,k.type));return}}T(x,!x.hasOwnProperty)}}else if(_==="boolean")pe[ae++]=x?195:194;else if(_==="bigint"){if(x<BigInt(1)<<BigInt(63)&&x>=-(BigInt(1)<<BigInt(63)))pe[ae++]=211,dr.setBigInt64(ae,x);else if(x<BigInt(1)<<BigInt(64)&&x>0)pe[ae++]=207,dr.setBigUint64(ae,x);else if(this.largeBigIntToFloat)pe[ae++]=203,dr.setFloat64(ae,Number(x));else throw new RangeError(x+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");ae+=8}else if(_==="undefined")this.encodeUndefinedAsNil?pe[ae++]=192:(pe[ae++]=212,pe[ae++]=0,pe[ae++]=0);else if(_==="function")S(this.writeFunction&&this.writeFunction());else throw new Error("Unknown type: "+_)},T=this.useRecords===!1?this.variableMapSize?x=>{let _=Object.keys(x),E=_.length;E<16?pe[ae++]=128|E:E<65536?(pe[ae++]=222,pe[ae++]=E>>8,pe[ae++]=E&255):(pe[ae++]=223,dr.setUint32(ae,E),ae+=4);let C;for(let I=0;I<E;I++)S(C=_[I]),S(x[C])}:(x,_)=>{pe[ae++]=222;let E=ae-r;ae+=2;let C=0;for(let I in x)(_||x.hasOwnProperty(I))&&(S(I),S(x[I]),C++);pe[E+++r]=C>>8,pe[E+r]=C&255}:x=>{let _=Object.keys(x),E,C=o.transitions||(o.transitions=Object.create(null)),I=0;for(let R=0,k=_.length;R<k;R++){let G=_[R];E=C[G],E||(E=C[G]=Object.create(null),I++),C=E}let N=C[Bh];if(N)N>=96&&m?(pe[ae++]=((N-=96)&31)+96,pe[ae++]=N>>5):pe[ae++]=N;else{N=o.nextId,N||(N=64),N<g&&this.shouldShareStructure&&!this.shouldShareStructure(_)?(N=o.nextOwnId,N<v||(N=g),o.nextOwnId=N+1):(N>=v&&(N=g),o.nextId=N+1);let R=_.highByte=N>=96&&m?N-96>>5:-1;C[Bh]=N,o[N-64]=_,N<g?(_.isShared=!0,o.sharedLength=N-63,s=!0,R>=0?(pe[ae++]=(N&31)+96,pe[ae++]=R):pe[ae++]=N):(R>=0?(pe[ae++]=213,pe[ae++]=114,pe[ae++]=(N&31)+96,pe[ae++]=R):(pe[ae++]=212,pe[ae++]=114,pe[ae++]=N),I&&(w+=b*I),y.length>=p&&(y.shift()[Bh]=0),y.push(C),S(_))}for(let R=0,k=_.length;R<k;R++)S(x[_[R]])},A=x=>{let _;if(x>16777216){if(x-r>wM)throw new Error("Packed buffer would be larger than maximum buffer size");_=Math.min(wM,Math.round(Math.max((x-r)*(x>67108864?1.25:2),4194304)/4096)*4096)}else _=(Math.max(x-r<<2,pe.length-1)>>12)+1<<12;let E=new Oy(_);return dr=new DataView(E.buffer,0,_),pe.copy?pe.copy(E,0,r,x):E.set(pe.slice(r,x)),ae-=r,r=0,Bi=E.length-10,pe=E}}useBuffer(e){pe=e,dr=new DataView(pe.buffer,pe.byteOffset,pe.byteLength),ae=0}};Fy=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,Rh];Zd=[{pack(i,e,t){let r=i.getTime()/1e3;if((this.useTimestamp32||i.getMilliseconds()===0)&&r>=0&&r<4294967296){let{target:n,targetView:s,position:o}=e(6);n[o++]=214,n[o++]=255,s.setUint32(o,r)}else if(r>0&&r<17179869184){let{target:n,targetView:s,position:o}=e(10);n[o++]=215,n[o++]=255,s.setUint32(o,i.getMilliseconds()*4e6+(r/1e3/4294967296>>0)),s.setUint32(o+4,r)}else if(isNaN(r)){if(this.onInvalidDate)return e(0),t(this.onInvalidDate());let{target:n,targetView:s,position:o}=e(3);n[o++]=212,n[o++]=255,n[o++]=255}else{let{target:n,targetView:s,position:o}=e(15);n[o++]=199,n[o++]=12,n[o++]=255,s.setUint32(o,i.getMilliseconds()*1e6),s.setBigInt64(o+4,BigInt(Math.floor(r)))}}},{pack(i,e,t){let r=Array.from(i),{target:n,position:s}=e(this.structuredClone?3:0);this.structuredClone&&(n[s++]=212,n[s++]=115,n[s++]=0),t(r)}},{pack(i,e,t){let{target:r,position:n}=e(this.structuredClone?3:0);this.structuredClone&&(r[n++]=212,r[n++]=101,r[n++]=0),t([i.name,i.message])}},{pack(i,e,t){let{target:r,position:n}=e(this.structuredClone?3:0);this.structuredClone&&(r[n++]=212,r[n++]=120,r[n++]=0),t([i.source,i.flags])}},{pack(i,e){this.structuredClone?SM(i,16,e):MM($d?Buffer.from(i):new Uint8Array(i),e)}},{pack(i,e){let t=i.constructor;t!==AM&&this.structuredClone?SM(i,Ny.indexOf(t.name),e):MM(i,e)}},{pack(i,e){let{target:t,position:r}=e(1);t[r]=193}}];function SM(i,e,t,r){let n=i.byteLength;if(n+1<256){var{target:s,position:o}=t(4+n);s[o++]=199,s[o++]=n+1}else if(n+1<65536){var{target:s,position:o}=t(5+n);s[o++]=200,s[o++]=n+1>>8,s[o++]=n+1&255}else{var{target:s,position:o,targetView:a}=t(7+n);s[o++]=201,a.setUint32(o,n+1),o+=4}s[o++]=116,s[o++]=e,s.set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength),o)}function MM(i,e){let t=i.byteLength;var r,n;if(t<256){var{target:r,position:n}=e(t+2);r[n++]=196,r[n++]=t}else if(t<65536){var{target:r,position:n}=e(t+3);r[n++]=197,r[n++]=t>>8,r[n++]=t&255}else{var{target:r,position:n,targetView:s}=e(t+5);r[n++]=198,s.setUint32(n,t),n+=4}r.set(i,n)}function CO(i,e,t,r){let n=i.length;switch(n){case 1:e[t++]=212;break;case 2:e[t++]=213;break;case 4:e[t++]=214;break;case 8:e[t++]=215;break;case 16:e[t++]=216;break;default:n<256?(e[t++]=199,e[t++]=n):n<65536?(e[t++]=200,e[t++]=n>>8,e[t++]=n&255):(e[t++]=201,e[t++]=n>>24,e[t++]=n>>16&255,e[t++]=n>>8&255,e[t++]=n&255)}return e[t++]=r,e.set(i,t),t+=n,t}function PO(i,e){let t,r=e.length*6,n=i.length-r;for(e.sort((s,o)=>s.offset>o.offset?1:-1);t=e.pop();){let s=t.offset,o=t.id;i.copyWithin(s+r,s,n),r-=6;let a=s+r;i[a++]=214,i[a++]=105,i[a++]=o>>24,i[a++]=o>>16&255,i[a++]=o>>8&255,i[a++]=o&255,n=s}return i}function Yo(i){if(i.Class){if(!i.pack&&!i.write)throw new Error("Extension has no pack or write function");if(i.pack&&!i.type)throw new Error("Extension has no type (numeric code to identify the extension)");Fy.unshift(i.Class),Zd.unshift(i)}bM(i)}var TM=new qo({useRecords:!1}),DO=TM.pack,LO=TM.pack;var{NEVER:IO,ALWAYS:RO,DECIMAL_ROUND:BO,DECIMAL_FIT:NO}=Jd,_M=512,OO=1024;var EM=new qo({structuredClone:!0});Yo({Class:jn.prototype.constructor,type:1,write(i){return se({},i)},read(i){return Object.setPrototypeOf(i,jn.prototype),i}});Yo({Class:rr.prototype.constructor,type:2,write(i){return[...i]},read(i){return Object.setPrototypeOf(i,rr.prototype),i}});Yo({Class:qn.prototype.constructor,type:3,write(i){return[...i]},read(i){return Object.setPrototypeOf(i,qn.prototype),i}});Yo({Class:Lh.prototype.constructor,type:4,write(i){return i.id},read(i){return new Lh(i)}});Yo({Class:Ih.prototype.constructor,type:5,write(i){return i.data},read(i){return new Ih(i)}});function FO(i){var e=0;if(i.length===0)return e;for(let t=0;t<i.length;t++){let r=i[t];e=(e<<5)-e+r,e=e&e}return e}var ep;(r=>{function i(n){return EM.pack(n)}r.serialize=i;function e(n){return EM.unpack(n)}r.deserialize=e;function t(n){return FO(i(n)).toString()}r.checksum=t})(ep||(ep={}));var tp;(t=>{t.all=["PointLight","SpotLight","DirectionalLight","HemisphereLight"];function e(r){return t.all.includes(r)}t.is=e})(tp||(tp={}));var rp;(t=>{function i(r){return e(r)}t.defaultData=i;function e(r){if(r==="PointLight")return{type:r,color:Ln.white,intensity:1,distance:2e3,decay:1,shadows:!0,shadowResolution:1024,shadowRadius:1,depth:2500,helper:!0};if(r==="SpotLight")return{type:r,color:Ln.white,intensity:1,distance:2e3,decay:1,shadows:!0,penumbra:0,angle:30/180*Math.PI,depth:2500,helper:!0};if(r==="DirectionalLight")return{type:r,color:Ln.white,intensity:1,shadows:!0,size:2500,depth:2500,helper:!0};throw new Error("not implemented")}})(rp||(rp={}));var Uy;(t=>{t.defaultData={castShadow:!0,receiveShadow:!0};function e(r,n){return r.castShadow===n.castShadow&&r.receiveShadow===n.receiveShadow}t.equals=e})(Uy||(Uy={}));var zy;(t=>{t.defaultData={flatShading:!1,wireframe:!1,side:0};function e(r,n){return r.flatShading===n.flatShading&&r.side===n.side&&r.wireframe===n.wireframe}t.equals=e})(zy||(zy={}));var np;(e=>e.defaultData=xe(se(se({},zy.defaultData),Uy.defaultData),{cloner:null,booleanExclude:null}))(np||(np={}));var Gy=(n=>(n[n.Left=1]="Left",n[n.Right=2]="Right",n[n.Center=3]="Center",n[n.Justify=4]="Justify",n))(Gy||{}),ky=(r=>(r[r.Top=1]="Top",r[r.Center=2]="Center",r[r.Bottom=3]="Bottom",r))(ky||{}),Vy=(r=>(r[r.None=1]="None",r[r.Upper=2]="Upper",r[r.Lower=3]="Lower",r))(Vy||{}),ip;(e=>e.defaultData={width:100,height:100,horizontalAlign:1,verticalAlign:1,fontSize:16,lineHeight:1.5,letterSpacing:1,text:"",textTransform:1,color:Ln.fromHexAndA(6974058,1),alpha:1,font:"roboto_regular"})(ip||(ip={}));var CM=["mode","gradientType","noiseType","displacementType","projection","cnormal","crop","axis","side"];var _l;(r=>{function i(n,s){return n==="light"&&s?e(s):t(n)}r.defaultData=i;function e(n){switch(n){case"basic":return{type:"light",category:"basic",alpha:1,visible:!0,mode:0};case"phong":return{category:"phong",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1,visible:!0,mode:0};case"toon":return{category:"toon",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1,visible:!0,mode:0};case"lambert":return{category:"lambert",emissive:{r:0,g:0,b:0,a:1},type:"light",alpha:1,visible:!0,mode:0};case"physical":return{category:"physical",roughness:.2,metalness:.2,reflectivity:.2,type:"light",alpha:1,visible:!0,mode:0}}}function t(n){switch(n){case"texture":return{alpha:1,visible:!0,size:[128,128],mode:0,axis:"x",side:2,type:"texture",projection:0,texture:{image:"image_0",wrapping:1001,repeat:[1,1],offset:[0,0]},crop:!0};case"color":return{type:"color",alpha:1,visible:!0,mode:0,color:Ar.fromHex(4737101)};case"depth":return{type:"depth",alpha:1,visible:!0,mode:0,gradientType:1,smooth:!1,isVector:!0,isWorldSpace:!1,origin:[0,0,0],direction:[1,0,0],colors:[[1,1,1,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,near:50,far:200};case"normal":return{type:"normal",alpha:1,visible:!0,mode:0,cnormal:[1,1,1]};case"gradient":return{type:"gradient",alpha:1,visible:!0,mode:0,gradientType:0,smooth:!1,colors:[[0,0,0,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,angle:0,offset:[0,0],morph:[0,0]};case"noise":return{type:"noise",alpha:1,visible:!0,mode:0,size:[100,100,100],noiseType:0,scale:1,move:1,colorA:xe(se({},Ar.fromHex(6710886)),{a:1}),colorB:xe(se({},Ar.fromHex(6710886)),{a:1}),colorC:xe(se({},Ar.fromHex(16777215)),{a:1}),colorD:xe(se({},Ar.fromHex(16777215)),{a:1}),distortion:[1,1],fA:[1.7,9.2],fB:[8.3,2.8]};case"fresnel":return{type:"fresnel",alpha:1,visible:!0,mode:0,color:Ln.fromHexAndA(16777215,1),bias:.1,scale:1,intensity:2,factor:1};case"rainbow":return{type:"rainbow",alpha:1,visible:!0,mode:0,filmThickness:30,movement:0,wavelengths:[0,0,0],noiseStrength:0,noiseScale:1,offset:[0,0,0]};case"matcap":return{type:"matcap",alpha:1,visible:!0,mode:0,texture:{image:"matcap_0",wrapping:1001,repeat:[1,1],offset:[0,0]}};case"transmission":return{type:"transmission",alpha:1,visible:!0,mode:0,thickness:10,ior:1.5,roughness:1};case"displace":return{type:"displace",displacementType:"noise",noiseType:0,scale:10,movement:1,offset:[0,0,0],intensity:8,visible:!0}}}})(_l||(_l={}));var ui;(a=>{function i(l){return!l.layers.some(h=>{if(h.data.type==="texture"&&h.data.projection!==0||h.data.type==="depth"&&!h.data.isWorldSpace||h.data.type==="noise"||h.data.type==="displace")return!0})&&!t(l)}a.isMergable=i;function e(l){let c="";return l.layers.forEach(h=>{Object.entries(h.data).forEach(([u,f])=>{c+=`${u}${f}`,Array.isArray(f)?f.forEach(d=>c+=`${d}`):typeof f=="object"?Object.values(f).forEach(d=>{typeof d=="number"?c+=`${d.toFixed(4)}`:c+=`${d}`}):c+=`${f}`})}),c}a.getHash=e;function t(l){let c=0;for(let h of l.layers)"alpha"in h.data&&h.data.type!=="light"&&h.data.type!=="fresnel"&&(c+=(1-c)*h.data.alpha);return c<1}a.isTransparent=t;function r(){return{layers:new rr}}a.defaultEmptyData=r;function n(l="layer1",c="layer2"){return s("phong",l,c)}a.defaultData=n;function s(l,c="layer1",h="layer2"){let u=new rr;return u.push({fi:0,data:_l.defaultData("light",l),id:c}),u.push({fi:1,data:_l.defaultData("color"),id:h}),{layers:u}}a.defaultTwoLayerData=s;function o(l,c="basic",h="layer1",u="layer2"){let f=_l.defaultData("texture");Object.assign(f.texture,{image:l});let d=new rr;return d.push({fi:0,data:f,id:h}),d.push({fi:1,data:_l.defaultData("light",c),id:u}),{layers:d}}a.defaultTwoLayerTextureData=o})(ui||(ui={}));var El;(e=>{function i(){return{points:new rr,roundness:0,shapeHoles:[],isClosed:!1}}e.defaultData=i})(El||(El={}));var sp;(e=>{function i(t){return t==="PolygonGeometry"||t==="RectangleGeometry"||t==="StarGeometry"||t==="TriangleGeometry"||t==="EllipseGeometry"}e.is2DParametricMesh=i})(sp||(sp={}));var Nh;(e=>{function i(t){if(t==="RectangleGeometry")return{width:320,height:320,type:t,cornerRadius:[0,0,0,0],cornerType:0,depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if(t==="VectorGeometry")return{width:1,height:1,type:t,subdivisions:12,shape:El.defaultData(),depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if(t==="BooleanGeometry")return{type:t,operation:2,width:0,height:0,depth:0,phongAngle:35};throw new Error("not implemented")}e.defaultData=i})(Nh||(Nh={}));var Oh;(n=>{n.identity=xe(se({},Bd.identity),{hiddenMatrix:Di.identity});function e(s){return{position:s.position,rotation:s.rotation,scale:s.scale,hiddenMatrix:s.hiddenMatrix}}n.fromObject=e;function t(s,o){return{position:(o==null?void 0:o.position)||s.position,rotation:(o==null?void 0:o.rotation)||s.rotation,scale:(o==null?void 0:o.scale)||s.scale,hiddenMatrix:(o==null?void 0:o.hiddenMatrix)||s.hiddenMatrix}}n.merge=t;function r(s,o){return{position:br.isEqual(s.position,o.position)?null:o.position,rotation:br.isEqual(s.rotation,o.rotation)?null:o.rotation,scale:br.isEqual(s.scale,o.scale)?null:o.scale,hiddenMatrix:Di.isEqual(s.hiddenMatrix,o.hiddenMatrix)?null:o.hiddenMatrix}}n.diff=r})(Oh||(Oh={}));var ds;(e=>e.defaultData=se({states:new rr,events:new rr,visible:!0,raycastLock:!1},Oh.identity))(ds||(ds={}));var PM;(e=>e.defaultData=se({type:"Empty"},ds.defaultData))(PM||(PM={}));var op;(e=>e.defaultData=se(se({type:"Mesh"},ds.defaultData),np.defaultData))(op||(op={}));var DM;(e=>e.defaultData=se(se({type:"TextFrame"},ds.defaultData),ip.defaultData))(DM||(DM={}));var ap;(e=>e.defaultData=se(se(se({},ds.defaultData),Oh.identity),Wo.defaultData))(ap||(ap={}));var LM;(e=>{function i(t){return se(se({},ds.defaultData),rp.defaultData(t))}e.defaultData=i})(LM||(LM={}));var IM;(r=>(r.defaultCamera=se({position:[0,0,1e3],scale:[1,1,1],rotation:[0,0,0],hiddenMatrix:Di.identity,name:"Play Camera",visible:!0,raycastLock:!1,states:new rr,events:new rr},Wo.defaultData),r.defaultMeshObject=xe(se(se({name:"Rectangle"},ds.defaultData),op.defaultData),{geometry:Nh.defaultData("RectangleGeometry"),material:ui.defaultTwoLayerData("basic","layer1","layer2")}),r.defaultBooleanObject=xe(se(se({name:"Boolean"},ds.defaultData),op.defaultData),{geometry:Nh.defaultData("BooleanGeometry"),material:ui.defaultTwoLayerData("phong","layer1","layer2")})))(IM||(IM={}));var Fh;(t=>{function i(r,n){if(n===void 0)return r;let s=se({},r);return"material"in s&&"material"in n&&n.material&&(s.material=Ty(s.material,o=>{if(typeof o!="string")for(let[a,l]of Object.entries(n.material.layers)){let c=o.layers.data(a);c&&Vo(c,l)}}).data),s.materials&&n.materials&&(s.materials=Ty(s.materials,o=>{var a,l;for(let c=0;c<s.materials.length;c++){let h=n.materials[c];if(typeof h!="string")for(let[u,f]of Object.entries(h.layers)){let d=(l=(a=o[c])==null?void 0:a.layers)==null?void 0:l.data(u);d&&Vo(d,f)}}}).data),s}t.patchMaterialState=i;function e(r,n){var o,a;if(n===void 0)return r;let s=se({},r);if(Object.assign(s,Oh.merge(s,n)),eo.is(r.type)){s.orthographic=se({},s.orthographic),s.perspective=se({},s.perspective);let l=n;((o=l.orthographic)==null?void 0:o.zoom)!==void 0&&(s.orthographic.zoom=l.orthographic.zoom),((a=l.perspective)==null?void 0:a.zoom)!==void 0&&(s.perspective.zoom=l.perspective.zoom),l.isUpVectorFlipped!==void 0&&(s.isUpVectorFlipped=l.isUpVectorFlipped),l.targetOffset!==void 0&&(s.targetOffset=l.targetOffset)}else if(r.type==="Mesh")s.geometry=se({},s.geometry),Object.assign(s.geometry,n.geometry),s=i(s,n);else if(tp.is(r.type)){let l=n;s.intensity!==void 0&&(s.intensity=l.intensity),l.color!==void 0&&(typeof l.color=="string"?s.color=l.color:s.color=Ar.clone(l.color))}return s}t.patch=e})(Fh||(Fh={}));function BM(i,e=!1){let t=i[0].index!==null,r=new Set(Object.keys(i[0].attributes)),n=new Set(Object.keys(i[0].morphAttributes)),s={},o={},a=i[0].morphTargetsRelative,l=new De,c=0;for(let h=0;h<i.length;++h){let u=i[h],f=0;if(t!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let d in u.attributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;s[d]===void 0&&(s[d]=[]),s[d].push(u.attributes[d]),f++}if(f!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(a!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let d in u.morphAttributes){if(!n.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;o[d]===void 0&&(o[d]=[]),o[d].push(u.morphAttributes[d])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(u.userData),e){let d;if(t)d=u.index.count;else if(u.attributes.position!==void 0)d=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,d,h),c+=d}}if(t){let h=0,u=[];for(let f=0;f<i.length;++f){let d=i[f].index;for(let p=0;p<d.count;++p)u.push(d.getX(p)+h);h+=i[f].attributes.position.count}l.setIndex(u)}for(let h in s){let u=RM(s[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(let h in o){let u=o[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let f=0;f<u;++f){let d=[];for(let m=0;m<o[h].length;++m)d.push(o[h][m][f]);let p=RM(d);if(!p)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(p)}}return l}function RM(i){let e,t,r,n=0;for(let a=0;a<i.length;++a){let l=i[a];if(l.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(e===void 0&&(e=l.array.constructor),e!==l.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=l.itemSize),t!==l.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=l.normalized),r!==l.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;n+=l.array.length}let s=new e(n),o=0;for(let a=0;a<i.length;++a)s.set(i[a].array,o),o+=i[a].array.length;return new Ve(s,t,r)}var Hy={type:"change"},NM={type:"changeZoom"},UO={type:"changePan"},Cl={type:"start"},Uh={type:"end"},Wy=new zt,zO=new B,GO=2*Math.PI,kO=1e-8,VO=.01,OM=2,jy=.125,FM=2,qy=1,Yy=1,Xy=.1;var lp=class extends Yt{constructor(t,r){super();this.object=t;this.domElement=r;this.enabled=!0;this.useKeyEvents=!0;this.enableDamping=!1;this.enableZoom=!0;this.enableRotate=!0;this.enablePan=!0;this.autoRotate=!1;this.rotationLimitsMode=0;this.panLimitsMode=0;this.rotationSoftLimit=2;this.panSoftLimit=2;this.hoverRotatePanMode=0;this.zoomLimitsEnabled=!1;this.preventScroll=!0;this.mouseButtons=[0,5];this.mouseButtonsPlay=[3,4,5];this.touches=[null,Cn.DOLLY_ROTATE,Cn.PAN];this.offset=new M;this.eye=new M;this.lastPosition=new M;this.lastQuaternion=new zt;this.current=new B;this.overShoot=new B;this.overRatio=new B;this.spherical=new fh;this.sphericalDelta=new fh;this.panOffset=new M;this.panLeftV=new M;this.panUpV=new M;this.panV=new M;this.rotateStart=new B;this.rotateEnd=new B;this.rotateDelta=new B;this.panStart=new B;this.panEnd=new B;this.panDelta=new B;this.dollyStart=new B;this.dollyEnd=new B;this.dollyDelta=new B;this.rotationRangeFactor=new B;this.panRangeFactor=new B;this.state=-1;this.zoomChanged=!1;this.isPointerDown=!1;this.isFirstHover=!0;this.isThetaFlipped=!1;this.prevScale=0;this.scale=1;this.gesture=!1;this.timer=-1;this.timerHover=-1;this.minDistance=0;this.maxDistance=1/0;this.minZoom=0;this.maxZoom=1/0;this.minPhi=0;this.maxPhi=Math.PI;this.minTheta=-1/0;this.maxTheta=1/0;this.minH=0;this.maxH=Math.PI;this.minV=-1/0;this.maxV=1/0;this.autoRotateClockwise=!0;this.isPanOverShoot=!1;this.isRotateOverShoot=!1;this.update=()=>{let t=this.object.position;this.offset.copy(t).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&this.state===-1&&this.rotateLeft((this.autoRotateClockwise===!0?1:-1)*this.getAutoRotationAngle()),this.rotationLimitsMode!==0&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),this.rotationLimitsMode!==2&&(this.spherical.phi+=this.sphericalDelta.phi),(this.rotationLimitsMode!==1||this.autoRotate===!0)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),this.panLimitsMode!==0&&(this.target.applyQuaternion(Wy.copy(this.object.quaternion).invert()),this.panOffset.applyQuaternion(Wy),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion(this.object.quaternion),this.panOffset.applyQuaternion(this.object.quaternion)),this.panLimitsMode===2&&(this.panOffset.y=0),this.panLimitsMode===1&&(this.panOffset.x=0),this.state===-1&&!this.gesture?(this.panOffset.multiplyScalar(1-jy),this.target.add(this.panOffset)):(this.target.add(this.panOffset),this.panOffset.set(0,0,0)),this.offset.setFromSpherical(this.spherical),t.copy(this.target).add(this.offset);let r=this.spherical.phi%GO;return this.eye.copy(this.offset).normalize(),this.object.up.copy(ot.DefaultUp).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),r>0&&r>Math.PI||r<0&&r>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),this.state===-1||this.enableDamping===!0?(this.sphericalDelta.theta*=1-jy,this.sphericalDelta.phi*=1-jy):this.sphericalDelta.set(0,0,0),this.scale=1,this.zoomChanged||this.lastPosition.distanceToSquared(this.object.position)>VO||8*(1-this.lastQuaternion.dot(this.object.quaternion))>kO?(this.dispatchEvent(Hy),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):(this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),!1)};this.onPointerDown=t=>{this.enabled!==!1&&(this.isPointerDown=!0,At.length===0&&(this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)),WO(t),t.pointerType==="touch"?this.onPointerDownTouch(t):this.onPointerDownMouse(t))};this.onPointerMove=t=>{this.enabled!==!1&&(t.pointerType==="touch"?this.onPointerMoveTouch(t):this.onPointerMoveMouse(t))};this.onPointerUp=t=>{zM(t),this.isPointerDown=!1,At.length===0&&(this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp)),this.dispatchEvent(Uh),this.state=-1};this.onPointerCancel=t=>{zM(t)};this.onPointerDownMouse=t=>{let r;switch(this.useKeyEvents?r=this.mouseButtons[t.button]:r=this.mouseButtonsPlay[t.button],r){case 0:if(t.altKey===!0&&!t.shiftKey&&!Ch(t)){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else if(this.key===" "){if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}break;case 4:if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2;break;case 3:if(Ch(t)||t.shiftKey){if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}else{if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}break;case 5:if(Ch(t)||t.shiftKey){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else{if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}break;default:this.state=-1}this.state!==-1&&this.dispatchEvent(Cl)};this.onPointerMoveMouse=t=>{switch(this.state){case 0:if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t);break;case 1:if(this.enableZoom===!1)return;this.handleMouseMoveDolly(t);break;case 2:if(this.enablePan===!1)return;this.handleMouseMovePan(t);break}};this.onPointerDownTouch=t=>{switch(GM(t),this.touches[At.length-1]){case Cn.ROTATE:if(this.enableRotate===!1){this.state=-1;return}this.handleTouchStartRotate(),this.state=3;break;case Cn.PAN:if(this.enablePan===!1){this.state=-1;return}this.handleTouchStartPan(),this.state=4;break;case Cn.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchStartDollyPan(),this.state=5;break;case Cn.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}this.state!==-1&&this.dispatchEvent(Cl)};this.onPointerMoveTouch=t=>{switch(GM(t),this.state){case 3:if(this.enableRotate===!1)return;this.handleTouchMoveRotate(t),this.update();break;case 4:if(this.enablePan===!1)return;this.handleTouchMovePan(t),this.update();break;case 5:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchMoveDollyPan(t),this.update();break;case 6:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchMoveDollyRotate(t),this.update();break;default:this.state=-1}};this.dispatchEndDebounced=Ah(()=>this.dispatchEvent(Uh),33);this.onMouseWheel=t=>{this.enabled===!1||this.enableZoom===!1&&this.enablePan===!1||((this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth||this.preventScroll)&&t.preventDefault(),this.dispatchEvent(Cl),this.handleMouseWheel(t),this.dispatchEndDebounced())};this.onGesture=t=>{if(this.enabled!==!1)if(t.preventDefault(),t.type==="gesturechange"){if(this.enableZoom===!1)return;this.dispatchEvent(Cl),t.scale>this.prevScale?this.dollyIn(this.getZoomScale()):t.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=t.scale,this.update()}else this.dispatchEvent(Uh)};this.onContextMenu=t=>{this.enabled!==!1&&t.preventDefault()};this.onTouchMove=t=>{(t.touches.length>1||this.preventScroll)&&t.preventDefault()};this.onTouchEnd=t=>{t.preventDefault()};this.onKeyDown=t=>{this.enabled!==!1&&(this.key=t.key)};this.onKeyUp=()=>{this.enabled!==!1&&(this.key=void 0,this.state!==-1&&this.onPointerUp(At[0]))};this.onPointerHover=t=>{if(!(Rd||this.enabled===!1||this.state!==-1||this.hoverRotatePanMode===2&&this.isPanOverShoot||this.hoverRotatePanMode===1&&this.isRotateOverShoot)){if(window.clearTimeout(this.timerHover),this.isPointerDown=!0,this.isFirstHover){let r={clientX:window.innerWidth/2,clientY:window.innerHeight/2};this.hoverRotatePanMode===2?this.handleMouseDownPan(r):this.hoverRotatePanMode===1&&this.handleMouseDownRotate(r),this.isFirstHover=!1}this.hoverRotatePanMode===2?this.handleMouseMovePan(t,Xy):this.hoverRotatePanMode===1&&this.handleMouseMoveRotate(t,Xy),this.timerHover=window.setTimeout(()=>{this.isPointerDown=!1},30)}};this.object=t,this.domElement=r,this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.connect(),this.update()}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Hy),this.isFirstHover=!0,this.update(),this.state=-1}resetTo(t,r,n){this.target.copy(t),this.object.position.copy(r),this.object.zoom=n,this.object.updateProjectionMatrix(),this.dispatchEvent(Hy),this.update(),this.state=-1}fromJSON(t){this.setEnableDampingSpeed(t.enableDamping),this.enablePan=t.enablePan,this.enableZoom=t.enableZoom,this.enableRotate=t.enableRotate,this.rotationLimitsMode=t.rotationLimitsMode,this.panLimitsMode=t.panLimitsMode,this.panSoftLimit=t.panSoftLimit,this.rotationSoftLimit=t.rotationSoftLimit,this.hoverRotatePanMode=t.hoverRotatePanMode,this.isFirstHover=!0,this.hoverRotatePanMode!==0&&this.domElement.addEventListener("pointermove",this.onPointerHover),Xy=(t.hoverRotatePanStrength/100)**2,this.zoomLimitsEnabled=t.zoomLimitsEnabled,this.minZoom=t.zoomLimits.min,this.maxZoom=Math.max(t.zoomLimits.min,t.zoomLimits.max),this.minDistance=1e3/t.zoomLimits.max,this.maxDistance=Math.max(this.minDistance,1e3/t.zoomLimits.min),this.autoRotate=t.autoRotate,OM=t.autoRotateSpeed,this.autoRotateClockwise=t.autoRotateClockwise;let n=this.object.getTarget().applyQuaternion(Wy.copy(this.object.quaternion).invert());this.minV=-t.panVerticalOffset.min+n.y,this.maxV=t.panVerticalOffset.max+n.y,this.minH=-t.panHorizontalOffset.min+n.x,this.maxH=t.panHorizontalOffset.max+n.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=no(this.spherical.phi-t.rotationVerticalOffset.min),this.maxPhi=no(this.spherical.phi+t.rotationVerticalOffset.max),this.minTheta=no(this.spherical.theta-t.rotationHorizontalOffset.min),this.maxTheta=no(this.spherical.theta+t.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,this.preventScroll=t.preventScroll,t.orbitTouches===1&&(this.touches[0]=Cn.ROTATE),t.panTouches===1&&(this.touches[0]=Cn.PAN),t.orbitTouches===2&&(this.touches[1]=Cn.DOLLY_ROTATE),t.panTouches===2&&(this.touches[1]=Cn.DOLLY_PAN),t.orbitTouches===3&&(this.touches[2]=Cn.ROTATE),t.panTouches===3&&(this.touches[2]=Cn.PAN)}connect(){this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),Ho||(this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture)),this.domElement.addEventListener("touchmove",this.onTouchMove),this.domElement.addEventListener("touchend",this.onTouchEnd)}dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerCancel),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),Ho||(this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture)),this.domElement.removeEventListener("touchmove",this.onTouchMove),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp)}applyLimits(t,r,n,s,o,a,l,c){this.overShoot.set(0,0);let h,u,f;t instanceof M?(h=t.x,u=t.y,this.current.set(this.target.x,this.target.y),f=!0):(h=t.theta,u=t.phi,this.current.set(no(this.spherical.theta),no(this.spherical.phi)),f=!1),n===0&&(this.current.x+=h,this.current.y+=u),(r===3||r===2)&&(!f&&this.isThetaFlipped?this.current.x>s&&this.current.x<0?this.overShoot.x=s-this.current.x:this.current.x<o&&this.current.x>0&&(this.overShoot.x=o-this.current.x):this.current.x>s?this.overShoot.x=s-this.current.x:this.current.x<o&&(this.overShoot.x=o-this.current.x),s===o&&(h=0)),(r===3||r===1)&&(this.current.y>a?this.overShoot.y=a-this.current.y:this.current.y<l&&(this.overShoot.y=l-this.current.y),a===l&&(u=0)),f||(this.overShoot.x=no(this.overShoot.x),this.overShoot.y=no(this.overShoot.y)),n!==0?(this.overRatio.copy(this.overShoot).divide(c),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),n===1&&(this.overRatio.x=UM(Math.abs(this.overRatio.x)),this.overRatio.y=UM(Math.abs(this.overRatio.y))),this.isPointerDown||n===1?n===2&&(this.overRatio.x>.9||this.overRatio.y>.9)?this.isPointerDown=!1:(h*this.overShoot.x<0&&(h*=1-this.overRatio.x),u*this.overShoot.y<0&&(u*=1-this.overRatio.y)):n===2&&(!f&&(this.overRatio.x>.002||this.overRatio.y>.002)||f&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(h=this.overShoot.x*.05,u=this.overShoot.y*.05,f?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):f?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(h+=this.overShoot.x,u+=this.overShoot.y),t instanceof M?(t.x=h,t.y=u):(t.theta=h,t.phi=u)}setEnableDampingSpeed(t){this.enableDamping=t,qy=t===!0?.2:1}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0}getAutoRotationAngle(){return 2*Math.PI/60/60*OM}getZoomScale(){return Math.pow(.95,FM)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}panLeft(t,r){this.panLeftV.setFromMatrixColumn(r,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,r){this.panUpV.setFromMatrixColumn(r,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,r){let n=this.domElement;if(n&&this.object.isPerspectiveCamera){let s=this.object.position;this.panV.copy(s).sub(this.target);let o=this.panV.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/n.clientHeight,this.object.matrix),this.panUp(2*r*o/n.clientHeight,this.object.matrix)}else n&&this.object.isOrthographicCamera&&(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this.panUp(r*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix));this.dispatchEvent(UO)}dollyOut(t){this.object.isPerspectiveCamera?this.scale/=t:this.object.isOrthographicCamera&&(this.object.zoom*=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(NM)}dollyIn(t){this.object.isPerspectiveCamera?this.scale*=t:this.object.isOrthographicCamera&&(this.object.zoom/=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(NM)}zoomOut(t=this.getZoomScale()){this.dispatchEvent(Cl),this.dollyOut(t),this.dispatchEvent(Uh)}zoomIn(t=this.getZoomScale()){this.dispatchEvent(Cl),this.dollyIn(t),this.dispatchEvent(Uh)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t,r=1){this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(qy*r).rotateAround(zO,-this.object.angleOffsetFromUp);let n=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/n.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/n.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t,r=1){this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(Yy*r),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.update()}handleMouseWheel(t){if(JS===!1&&Ch(t)===!1&&HO(t)===!0){if(this.enablePan===!1)return;this.gesture?(this.panDelta.set(-t.deltaX,-t.deltaY).multiplyScalar(Yy),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),t.altKey?this.pan(0,this.panDelta.y):t.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()):(this.gesture=!0,this.isPointerDown=!0),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.gesture=!1,this.isPointerDown=!1},30)}else{if(this.enableZoom===!1)return;t.deltaY===0?t.deltaX<0?this.dollyIn(this.getZoomScale()):t.deltaX>0&&this.dollyOut(this.getZoomScale()):t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}}handleTouchStartRotate(){if(At.length===2){let t=.5*(At[0].pageX+At[1].pageX),r=.5*(At[0].pageY+At[1].pageY);this.rotateStart.set(t,r)}else this.rotateStart.set(At[0].pageX,At[0].pageY)}handleTouchStartPan(){if(At.length===2){let t=.5*(At[0].pageX+At[1].pageX),r=.5*(At[0].pageY+At[1].pageY);this.panStart.set(t,r)}else this.panStart.set(At[0].pageX,At[0].pageY)}handleTouchStartDolly(){let t=At[0].pageX-At[1].pageX,r=At[0].pageY-At[1].pageY,n=Math.sqrt(t*t+r*r);this.dollyStart.set(0,n)}handleTouchStartDollyPan(){this.enableZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(t){if(At.length===2){let n=Qy(t),s=.5*(t.pageX+n.x),o=.5*(t.pageY+n.y);this.rotateEnd.set(s,o)}else{if(t.pointerId!==At[0].pointerId)return;this.rotateEnd.set(t.pageX,t.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(qy);let r=this.domElement;r&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/r.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/r.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(At.length===2){let r=Qy(t),n=.5*(t.pageX+r.x),s=.5*(t.pageY+r.y);this.panEnd.set(n,s)}else{if(t.pointerId!==At[0].pointerId)return;this.panEnd.set(t.pageX,t.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(Yy),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){let r=Qy(t),n=t.pageX-r.x,s=t.pageY-r.y,o=Math.sqrt(n*n+s*s);this.dollyEnd.set(0,o),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,FM)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}};function no(i){let e=Math.PI*2;for(;i<=-Math.PI;)i+=e;for(;i>Math.PI;)i-=e;return i}function UM(i){return 1-Math.pow(1-i,4)}function HO(i){return i.wheelDeltaY===0||i.deltaY===0?Eh&&i.shiftKey&&Math.abs(i.wheelDeltaX)>=120?!1:i.wheelDeltaX?i.wheelDeltaX===-3*i.deltaX:i.deltaMode===0:i.wheelDeltaY?i.wheelDeltaY===-3*i.deltaY:i.deltaMode===0}var At=[],cp={};function WO(i){At.push(i)}function zM(i){delete cp[i.pointerId];for(let e=0;e<At.length;e++)if(At[e].pointerId===i.pointerId){At.splice(e,1);return}}function GM(i){let e=cp[i.pointerId];e===void 0&&(e=new B,cp[i.pointerId]=e),e.set(i.pageX,i.pageY)}function Qy(i){let e=i.pointerId===At[0].pointerId?At[1]:At[0];return cp[e.pointerId]}var io=class extends jf{constructor(){super(),this.layers.enable(3)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,r=[]){return e.forEach(n=>{n.visible&&this.intersectObject(n,t,r)}),r}createRaycastLineHelper(){let e=new kr({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),r=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),n=this.camera.far-this.camera.near,s=new M().addVectors(t,r.multiplyScalar(n)),o=new De;return o.setFromPoints([t,s]),new os(o,e)}};var VM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var o,a,l,c,h;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},i.parameters),r=t.width/2,n=(a=t.radiusTop)!=null?a:r,s=(l=t.radiusBottom)!=null?l:r;return n===s?(n=r,s=r):n>s?(n=r,s=s*r/n):(n=n*r/s,s=r),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((h=t.depth)!=null?h:t.width),radiusTop:n,radiusBottom:s})}}static build(i){let{width:e,depth:t,height:r,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:h,cornerRadius:u,cornerSegments:f,hollow:d}=i.parameters,p;return u||d?p=new zh(c,h,r,n,s,o,a,l*Math.PI/180,u,u,f,d):p=new Lo(c,h,r,n,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:xe(se({},i),{type:"CylinderGeometry"})})}};function so(i,e,t){t.x=i.x*e.x,t.y=i.y,t.z=i.x*e.y}function kM(i){return new B(i.y,-i.x)}var zh=class extends De{constructor(e,t,r,n,s,o,a,l,c,h,u,f,d=!1){super(),this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,r=r||1,n=Math.floor(n)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,h=0);let p=[],m=[],g=[],v=[],y=0,w=r/2,b=new M,S=new M;d&&e==0&&(e=c),d&&t==0&&(t=h);let T=new B(e,w),A=new B(t,-w),x=null,_=null,E=null,C=null,I=T.clone().sub(A),N=0,R=0,k=0;f>0&&(N=Math.min(e,t)*(1-f),R=e-N,k=t-N);let G=T.clone();G.x-=N;let K=Math.PI-I.angle(),J=I.angle(),Y=Math.tan(J/2),F=Math.tan(K/2),U=Y+F,O=f?U:F,j=f?U:Y;if(c=Math.min(c,(e-R)/O,I.length()/U),h=Math.min(h,(t-k)/j,I.length()/U),c>0){let le=c/Y;x=T.clone().sub(new B(le,c)),f&&(E=x.clone(),E.x-=N-U*c),T.sub(I.clone().setLength(le))}if(h>0){let le=h/F;_=A.clone().sub(new B(le,-h)),A.add(I.clone().setLength(le)),f&&(C=_.clone(),C.x-=N-U*h,G.sub(I.clone().setLength(le)))}I=T.clone().sub(A);let H=I.length()<.5,X=[];for(let le=0;le<=n;le++){let q=[],ue=le/n,Z=ue*l+a,W=new B(Math.sin(Z),Math.cos(Z));C&&_?(V(q,ue,W,K,h,C,-1,!0),V(q,ue,W,J,h,_,-1,!1)):_?(he(q,W,_.x,0,-1),V(q,ue,W,J,h,_,-1,!1)):o||he(q,W,t,k,-1);let $=kM(I).normalize();if(so($,W,b),!H)for(let ce=0;ce<=s;ce++){let oe=ce/s,me=I.clone().multiplyScalar(oe).add(A);so(me,W,S),m.push(S.x,S.y,S.z),g.push(b.x,b.y,b.z),v.push(ue,.5+S.y/r),q.push(y++)}if(E&&x?(V(q,ue,W,K,c,x,1,!1),V(q,ue,W,J,c,E,1,!0)):x?(V(q,ue,W,K,c,x,1,!1),he(q,W,x.x,0,1)):o||he(q,W,e,R,1),f&&!H){let ce=kM(I).multiplyScalar(-1).normalize();so(ce,W,b);for(let oe=0;oe<=s;oe++){let me=oe/s,ve=I.clone().multiplyScalar(-me).add(G);so(ve,W,S),m.push(S.x,S.y,S.z),g.push(b.x,b.y,b.z),v.push(ue,.5+S.y/r),q.push(y++)}}f&&!o&&q.push(q[0]),X.push(q)}for(let le=0;le<X.length-1;le++)for(let q=0;q<X[0].length-1;q++){if(o&&f&&q==s)continue;let ue=X[le][q],Z=X[le+1][q],W=X[le+1][q+1],$=X[le][q+1],ce=m[W*3+0],oe=m[W*3+2];p.push(ue,Z,$),(ce!=0||oe!=0)&&p.push(Z,W,$)}l<Math.PI*2&&(ie(-1,X[0],a),ie(1,X[X.length-1],a+l)),this.setIndex(p),this.setAttribute("position",new Te(m,3)),this.setAttribute("normal",new Te(g,3)),this.setAttribute("uv",new Te(v,2));function V(le,q,ue,Z,W,$,ce,oe){for(let me=0;me<u+1;me++){let ve=me/u,ge=ce<0?ve:1-ve;oe&&(ge-=1),ge*=Z;let Le=new B(Math.sin(ge),Math.cos(ge)*ce),ke=Le.clone().multiplyScalar(W).add($);so(ke,ue,S),m.push(S.x,S.y,S.z),so(Le,ue,b),g.push(b.x,b.y,b.z),v.push(q,.5+S.y/r),le.push(y++)}}function he(le,q,ue,Z,W){let $=new M,ce=new B,oe=[ue,Z];W<0&&oe.reverse();for(let me of oe)ce.set(me,w*W),so(ce,q,$),m.push($.x,$.y,$.z),g.push(0,W,0),v.push(.5,.5),le.push(y++)}function ie(le,q,ue){let Z=new B(Math.sin(ue),Math.cos(ue)),W=new B(-Math.cos(ue),Math.sin(ue)),$=new M,ce=le<0?(ve,ge,Le)=>p.push(ve,ge,Le):(ve,ge,Le)=>p.push(ve,Le,ge),oe=new B((e+t+R+k)/4,0);so(oe,Z,$),m.push($.x,$.y,$.z),g.push(W.x,0,W.y),v.push(.5,.5);let me=y++;for(let ve of q){let ge=m.slice(ve*3,ve*3+3);m.push(...ge),g.push(W.x,0,W.y);let Le=v.slice(ve*2,ve*2+2);v.push(...Le),y++}for(let ve=me+1;ve<y-1;ve++)ce(me,ve,ve+1);ce(me,y-1,me+1)}}};var HM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,radialSegments:32,heightSegments:8,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadiusTop:0,cornerRadiusBottom:0,cornerSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,depth:t,height:r,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,cornerRadiusTop:c,cornerRadiusBottom:h,cornerSegments:u}=i.parameters,f;return c>0||h>0||l<360?f=new zh(0,e/2,r,n,s,o,a,l*Math.PI/180,c,h,u,0,!0):f=new za(e/2,r,n,s,o),f.scale(1,1,t/e),Object.assign(f,{userData:xe(se({},i),{type:"ConeGeometry"})})}};var WM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,widthSegments:n,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=i.parameters,c;return a==0?c=new vn(e,t,r,n,s,o):c=new Ky(e,t,r,n,s,o,a,l),Object.assign(c,{userData:xe(se({},i),{type:"CubeGeometry"})})}},Jy=Math.PI/2,Ky=class extends De{constructor(e=1,t=1,r=1,n=1,s=1,o=1,a=0,l=4){super(),this.type="BoxBufferGeometry";let c=this;n=Math.floor(n),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,r/2);let h=[],u=[],f=[],d=[],p=0,m=0;g("z","y","x",-1,-1,r,t,e,o,s,0),g("z","y","x",1,-1,r,t,-e,o,s,1),g("x","z","y",1,1,e,r,t,n,o,2),g("x","z","y",1,-1,e,r,-t,n,o,3),g("x","y","z",1,-1,e,t,r,n,s,4),g("x","y","z",-1,-1,e,t,-r,n,s,5),a>0&&(v("z","y","x",-1,-1,1,r,t,e,o,0),v("z","y","x",1,-1,-1,r,t,e,o,1),v("z","y","x",-1,1,-1,r,t,e,o,1),v("z","y","x",1,1,1,r,t,e,o,0),v("x","y","z",-1,-1,-1,e,t,r,n,0),v("x","y","z",1,-1,1,e,t,r,n,1),v("x","y","z",-1,1,1,e,t,r,n,0),v("x","y","z",1,1,-1,e,t,r,n,1),v("y","x","z",-1,-1,1,t,e,r,s,0),v("y","x","z",1,-1,-1,t,e,r,s,1),v("y","x","z",1,1,1,t,e,r,s,1),v("y","x","z",-1,1,-1,t,e,r,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(h),this.setAttribute("position",new Te(u,3)),this.setAttribute("normal",new Te(f,3)),this.setAttribute("uv",new Te(d,2));function g(w,b,S,T,A,x,_,E,C,I,N){let R=(x-2*a)/C,k=(_-2*a)/I,G=x/2-a,K=_/2-a,J=E/2,Y=C+1,F=I+1,U=0,O=0,j=new M;for(let H=0;H<F;H++){let X=H*k-K;for(let V=0;V<Y;V++){let he=V*R-G;j[w]=he*T,j[b]=X*A,j[S]=J,u.push(j.x,j.y,j.z),j[w]=0,j[b]=0,j[S]=E>0?1:-1,f.push(j.x,j.y,j.z),d.push(V/C),d.push(1-H/I),U+=1}}for(let H=0;H<I;H++)for(let X=0;X<C;X++){let V=p+X+Y*H,he=p+X+Y*(H+1),ie=p+(X+1)+Y*(H+1),le=p+(X+1)+Y*H;h.push(V,he,le),h.push(he,ie,le),O+=6}c.addGroup(m,O,N),m+=O,p+=U}function v(w,b,S,T,A,x,_,E,C,I,N){let R=(_-2*a)/I,k=_/2-a,G=E/2-a,K=C/2,J=I+1,Y=0,F=0,U=new M,O=new M;for(let j=0;j<l+1;j++){let H=j/l*Jy,X=Math.sin(H)*a,V=(1-Math.cos(H))*a,he=Math.sin(H),ie=Math.cos(H);U[b]=(G+X)*A,U[S]=(K-V)*x,O[w]=0,O[b]=he*Math.sign(U[b]),O[S]=ie*Math.sign(U[S]);for(let le=0;le<J;le++){let q=le*R-k;U[w]=q*T,u.push(U.x,U.y,U.z),f.push(O.x,O.y,O.z),d.push(le/I),d.push(0),Y+=1}}for(let j=0;j<l;j++)for(let H=0;H<I;H++){let X=p+H+J*j,V=p+H+J*(j+1),he=p+(H+1)+J*(j+1),ie=p+(H+1)+J*j;h.push(X,V,ie),h.push(V,he,ie),F+=6}c.addGroup(m,F,N),m+=F,p+=Y}function y(w,b,S){let T=new M,A=new M(e/2,t/2,r/2);A.subScalar(a);let x=[],_=w*b*S>0?(C,I,N)=>h.push(C,I,N):(C,I,N)=>h.push(C,N,I);for(let C=0;C<=l;C++){let I=[],N=Jy*(1-C/l),R=Math.cos(N),k=Math.sin(N),G=0;for(let K=0;K<=C;K++){let J=Math.cos(G),Y=Math.sin(G);T.x=R*J,T.y=k,T.z=R*Y;let F=A.clone().addScaledVector(T,a);u.push(w*F.x,b*F.y,S*F.z),f.push(w*T.x,b*T.y,S*T.z),d.push(0,0),I.push(p++),G+=Jy/C}x.push(I)}let E=x.length-1;for(let C=0;C<E;C++){let I=x[C],N=x[C+1],R=I.length-1;_(I[0],N[1],N[0]);for(let k=1;k<=R;k++)_(I[k-1],I[k],N[k]),_(I[k],N[k+1],N[k])}}}};var oo=class extends De{constructor(e=[],t=[],r="",n=1,s=.2,o=4){super(),this.type="PolyhedronGeometryRound";let a=[],l=[],c=[];h(),u(),this.setAttribute("position",new Te(a,3)),this.setAttribute("normal",new Te(c,3)),this.setAttribute("uv",new Te(l,2));return;function h(){var Y;s=Math.min(1-1e-5,s),s==0&&(o=0);let d={IcosahedronGeometry:5,DodecahedronGeometry:3,HexahedronGeometry:3,OctahedronGeometry:4,TetrahedronGeometry:3}[r],p=new M,m=p.clone(),g=new Jt,v=s*n,y=n-v,w=o+1,b=new M,S=(F,U)=>b.subVectors(F,U).normalize(),T=(F,U)=>Array(F).fill(void 0).map(U),A=T(e.length/3,(F,U)=>new M().fromArray(e,U*3).setLength(n)),x=[],_=1e6;for(let F=0;F<A.length;F++){let U=A[F],O=[],j,H,X,V=1e10,he=-1;for(;(he=t.indexOf(F,he+1))!=-1;){let ue=he-he%3;j=t[ue+(he+1)%3],H=t[ue+(he+2)%3],X=U.distanceToSquared(A[j]),V=Math.min(V,X),O.push([j,H,X])}V+=1e-6;let ie=[],le=0,q=O.length;for(let ue=0;ue<q;ue++){[j,H,X]=O[le];let Z=((Y=x[j])==null?void 0:Y.includes(F))==!0;X<=V&&ie.push(j+ +Z*_),le=O.findIndex(W=>W[0]==H)}x.push(ie)}let E=[];{let F=0,U=0,O,j,H=d==3;for(let X=0;X<=o;X++){O=X*(X+1)/2,j=(X+1)*(X+2)/2;for(let V=0;V<o-X;V++)[F,U]=[O+V+X+2,j+V+X+3],E.push(O,j,...H?[U,O]:[F,j],U,F),[O,j]=[F,U];E.push(O,j,O+o+2)}}let C=p.clone(),I=p.clone(),N=p.clone(),R=p.clone(),k=p.clone(),G=[],K=T(A.length,()=>T(d,()=>p.clone()));for(let F=0;F<A.length;F++){p.copy(A[F]).normalize(),C.copy(p).multiplyScalar(y);let U=x[F];for(let ie=0;ie<U.length;ie++){let le=U[ie],q=U[(ie+1)%d];g.setFromPointsAndIndices(A,F,le%_,q%_),g.b.sub(g.a).setLength(1e10).add(g.a),g.c.sub(g.a).setLength(1e10).add(g.a),g.closestPointToPoint(C,K[F][ie])}let O=[],j=[],H=[],X=new M;o==0&&[...K[F]].reduce((ie,le)=>ie.add(le),X).multiplyScalar(1/d);for(let ie=0;ie<d;ie++){let le=[],q=(ie-1+d)%d,ue=K[F][q],Z=K[F][ie];p.copy(ue).sub(C),m.copy(Z).sub(C);let W=C.angleTo(p),$=p.angleTo(m),ce=Math.cos(W)*v;o==0?I.copy(X):I.copy(C).setLength(y+ce),j.push(ce);let oe=[I,ue,Z];for(let me=0;me<2;me++){let ve=oe[me],ge=oe[me+1];R.subVectors(ve,C),k.subVectors(ge,C),N.crossVectors(R,k).normalize();for(let Le=0;Le<w;Le++){let ke=[W,$][me]*Le/w;p.copy(R).applyAxisAngle(N,ke).add(C),O.push(p.clone()),me&&(S(p,C),le.push([Le==0?ve:p.clone(),b.clone()]))}me&&(S(ge,C),le.push([ge,b.clone()]))}H.push(le)}G.push(H);let V=2*w,he=2;for(let ie=0;ie<d;ie++){let le=V*ie,q=V*((ie+1)%d),ue=[O[le]];for(let W=1;W<w;W++){R=O[le+W],k=O[q+W],ue.push(R);for(let $=1,ce=W-he+1;$<=ce;$++)p.lerpVectors(R,k,$/(ce+1)),p.sub(C).setLength(j[ie]).add(C),ue.push(p.clone());ue.push(k)}for(let W=0;W<w;W++)ue.push(O[W+w+le]);ue.push(O[q+w]);let Z=E.map(W=>ue[W]);a.push(...Z.map(W=>[W.x,W.y,W.z]).flat()),c.push(...Z.map(W=>(S(W,C),[b.x,b.y,b.z])).flat())}}let J=[];for(let F=0;F<x.length;F++)for(let U=0;U<d;U++){let O=x[F][U];if(O<_){let j=x[O].findIndex(V=>V%_==F),H=G[F][U],X=G[O][j];for(let V=0;V<w;V++){let he=H[V],ie=X[w-V],le=H[V+1],q=X[w-(V+1)];[he,ie,le,le,ie,q].forEach(ue=>{a.push(ue[0].x,ue[0].y,ue[0].z),c.push(ue[1].x,ue[1].y,ue[1].z)})}J.push(H[0][0],X[w][0],H[w][0],X[0][0])}}for(;J.length;){let F,U,O,j;[F,U]=J.splice(0,2);let H=[F];for(;F!=U;)H.push(U),O=J.indexOf(U),j=O%2,U=J.splice(O-j,2)[1-j];b.subVectors(H[0],H[1]).cross(p.subVectors(H[0],H[2])).normalize();let X=b.dot(H[0])<0;X&&b.negate();for(let V=1;V<=H.length-2;V++)[H[V+ +X],H[V+1-+X],H[0]].forEach(he=>{a.push(he.x,he.y,he.z),c.push(b.x,b.y,b.z)})}}function u(){let f=new M;for(let A=0;A<a.length;A+=3){f.x=a[A+0],f.y=a[A+1],f.z=a[A+2];let x=S(f)/2/Math.PI+.5,_=T(f)/Math.PI+.5;l.push(x,1-_)}let d=new M,p=new M,m=new M,g=new M,v=new B,y=new B,w=new B,b=(A,x,_,E)=>{E<0&&A.x===1&&(l[x]=A.x-1),_.x===0&&_.z===0&&(l[x]=E/2/Math.PI+.5)};for(let A=0,x=0;A<a.length;A+=9,x+=6){d.set(a[A+0],a[A+1],a[A+2]),p.set(a[A+3],a[A+4],a[A+5]),m.set(a[A+6],a[A+7],a[A+8]),v.set(l[x+0],l[x+1]),y.set(l[x+2],l[x+3]),w.set(l[x+4],l[x+5]),g.copy(d).add(p).add(m).divideScalar(3);let _=S(g);b(v,x+0,d,_),b(y,x+2,p,_),b(w,x+4,m,_)}for(let A=0;A<l.length;A+=6){let x=l[A+0],_=l[A+2],E=l[A+4],C=Math.max(x,_,E),I=Math.min(x,_,E);C>.9&&I<.1&&(x<.2&&(l[A+0]+=1),_<.2&&(l[A+2]+=1),E<.2&&(l[A+4]+=1))}function S(A){return Math.atan2(A.z,-A.x)}function T(A){return Math.atan2(-A.y,Math.sqrt(A.x*A.x+A.z*A.z))}}}static fromJSON(e){return new oo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var jM=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,detail:0,corner:0,cornerSides:4},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,detail:n,corner:s,cornerSides:o}=i.parameters,a=n===0&&s!==0?new Gh(e*.5,s,o):new ka(e*.5,n);return a.scale(1,t/e,r/e),Object.assign(a,{userData:xe(se({},i),{type:"DodecahedronGeometry"})})}},Gh=class extends oo{constructor(e=1,t=.2,r=4){let n=(1+Math.sqrt(5))/2,s=1/n,o=[-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,-s,-n,0,-s,n,0,s,-n,0,s,n,-s,-n,0,-s,n,0,s,-n,0,s,n,0,-n,0,-s,n,0,-s,-n,0,s,n,0,s],a=[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],l="DodecahedronGeometry";super(o,a,l,e,t,r),this.type=l}static fromJSON(e){return new Gh(e.radius,e.corner,e.cornerSides)}};var kh=1e-12,Pl=class{constructor(e){this.position=new B;this.startPosition=new B;this.uuid=et.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Pl(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Dl=class extends Pl{constructor(t){super(t.position);this.parent=t}copy(t){return super.copy(t),this}clone(){return new Dl(this.parent).copy(this)}},fi=class extends Pl{constructor(t,r){super(r);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=t,this.controls.push(new Dl(this),new Dl(this))}static create(t,r){let n=new fi(t,new B(...r.position));return n.controls[0].position.set(...r.controlPrevious.position),n.controls[1].position.set(...r.controlNext.position),n.roundness=r.roundness,n.areControlsDirectionsMirrored=r.areControlsDirectionsMirrored,n}getOppositeControl(t){let r=this.controls.indexOf(t);return r===0?this.controls[1]:r===1?this.controls[0]:null}applyOffsetToControls(t,r=1){for(let n=0,s=this.controls.length;n<s;n++){let o=this.controls[n];this.position.distanceTo(o.position)<=r?o.position.copy(this.position):o.applyOffset(t)}}controlsMoved(){return!(this.position.equals(this.controls[0].position)&&this.position.equals(this.controls[1].position))}copy(t){return super.copy(t),this.controls[0].copy(t.controls[0]),this.controls[1].copy(t.controls[1]),this.roundness=t.roundness,this.uuid=t.uuid,this}clone(){return new fi(this.uuid,this.position).copy(this)}toJSON(){return super.toJSON().concat(this.controls[0].toJSON(),this.controls[1].toJSON(),[this.roundness])}computeTangents(){var n,s;let t=(n=this.curveBefore)==null?void 0:n.getTangentAt(1),r=(s=this.curveAfter)==null?void 0:s.getTangentAt(0);return[t,r]}computeNormals(t=new B,r=new B){let[n,s]=this.computeTangents();return n&&s&&(qM(n,t),qM(s,r)),[t,r]}computeTangent(t=new B){let[r,n]=this.computeTangents();return r&&n&&t.copy(r).add(n).normalize(),t}computeNormal(t=new B){let[r,n]=this.computeNormals();return t.copy(r).add(n).normalize(),t}};function qM(i,e=new B){let t=i.length();return e.set(-i.y/t,i.x/t)}var $y=i=>i,Ll=new B,hp=new B,jO=new B,qO=new B,YO=new B,XO=new B,XM=new M,QM=new M;function JM(i){let e=new B;e.addVectors(i.v0,Ll.subVectors(i.v1,i.v0).multiplyScalar(2/3));let t=new B;return t.addVectors(i.v2,hp.subVectors(i.v1,i.v2).multiplyScalar(2/3)),new an(i.v0,e,t,i.v2)}function Vh(i,e,t=Number.EPSILON){return Math.abs(i-e)<t}function QO(i,e,t=Number.EPSILON){return i.distanceTo(e)<t}function JO(i,e,t=Number.EPSILON){return i.distanceTo(e)<t}function ev(i,e,t){let r=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),s=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2));return Math.acos((n*n+r*r-s*s)/(2*n*r))}function KM(i,e,t){return YM(i,e)&&YM(e,t)&&Zy(i.position,e.position,t.position)}function Zy(i,e,t){return Ll.copy(e).sub(i).cross(hp.copy(t).sub(i))===0}function ZM(i,e,t,r,n){let s=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),o=(i.y+e.y)/2,a=(i.x+e.x)/2,l=Math.sqrt(Math.pow(t,2)-Math.pow(s/2,2))*(i.y-e.y)/s,c=Math.sqrt(Math.pow(t,2)-Math.pow(s/2,2))*(e.x-i.x)/s;return r.set(a+l,o+c),n.set(a-l,o-c),[r,n]}function $M(i,e,t){let r=i.distanceTo(t),n=e.distanceTo(t);return r<n?e:i}function e1(i,e,t,r,n,s){let o=e.x-i.x,a=e.y-i.y,l=t.x-i.x,c=t.y-i.y,h=Math.sqrt((o+l)*(o+l)+(a+c)*(a+c)),u;return ev(e,i,t)>Math.PI&&(h*=-1),Vh(c,a)?u=(a+c)*(r/h-.5)*8/3/(o-l):u=(o+l)*(r/h-.5)*8/3/(c-a),n.set(e.x-u*a,e.y+u*o),s.set(t.x+u*c,t.y-u*l),[n,s]}function tv(i,e){return i.position.equals(i.controls[1].position)&&e.position.equals(e.controls[0].position)}function YM(i,e){return Zy(i.position,i.controls[1].position,e.position)&&Zy(i.position,e.controls[0].position,e.position)}function t1(i,e,t,r,n=.5){let s=Ll.subVectors(e,i).multiplyScalar(n).add(i),o=hp.subVectors(t,e).multiplyScalar(n).add(e),a=jO.subVectors(r,t).multiplyScalar(n).add(t),l=s,c=qO.subVectors(o,s).multiplyScalar(n).add(s),h=YO.subVectors(a,o).multiplyScalar(n).add(o),u=a,f=XO.subVectors(h,c).multiplyScalar(n).add(c);return[i.x,i.y,l.x,l.y,c.x,c.y,f.x,f.y,h.x,h.y,u.x,u.y,r.x,r.y]}function r1(i,e,t=12,r=!0){let n=QM.set(0,0,0),s,o=0,a=[];for(let l=0;l<e.length;l++){let c=$y(e[l]),h=Ll,u=ao(c,t);a.push(u);for(let f=0;f<=u;f++)if(c instanceof an||c instanceof kn||c instanceof ln){if(c.getPoint(f/u,h),n.set(h.x,h.y,0),s!==void 0&&JO(s,n))continue;s===void 0&&(s=XM),s.copy(n),i.setXYZ(o,n.x,n.y,n.z),o++}}return r&&o>1&&!(i.getX(o-1)===i.getX(0)&&i.getY(o-1)===i.getY(0)&&i.getZ(o-1)===i.getZ(0))&&(i.setXYZ(o,i.getX(0),i.getY(0),i.getZ(0)),o++),i}function n1(i,e,t,r=12,n=!0){let s=QM.set(0,0,0),o=0,a=[];for(let l=0;l<e.length;l++){if(t[l]===!1)continue;let c,h=$y(e[l]),u=Ll,f=ao(h,r);a.push(f);for(let d=0;d<=f;d++)if(h instanceof an||h instanceof kn||h instanceof ln){if(h.getPoint(d/f,u),s.set(u.x,u.y,0),c!=null&&c.equals(s))continue;c===void 0?c=XM:(i.setXYZ(o,c.x,c.y,c.z),o++,i.setXYZ(o,s.x,s.y,s.z),o++),c.copy(s)}}return n&&o>1&&!(i.getX(o-1)===i.getX(0)&&i.getY(o-1)===i.getY(0)&&i.getZ(o-1)===i.getZ(0))&&(i.setXYZ(o,i.getX(0),i.getY(0),i.getZ(0)),o++),a}function rv(i,e=12,t=!1){let r=[];for(let n=0,s=i.length;n<s;n++){let o=i[n],a=0;if(t&&o.roundedCurveCorner!==void 0){let l=ao(o.roundedCurveCorner,e)*.5;n>0&&(r[n-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=ao(o.curveAfter,e)),r.push(a)}return i.length>0&&t&&i[0].roundedCurveCorner!==void 0&&(r[i.length-1]+=ao(i[0].roundedCurveCorner,e)*.5),r}function ao(i,e=12){return i&&i instanceof Us?e*2:i&&(i instanceof ln||i instanceof rh)?1:i&&i instanceof Do?e*i.points.length:e}function i1(i,e,t=12,r=!0){let n,s=0;for(let o=0;o<e.length;o++){let a=$y(e[o]),l=ao(a,t),c=Ll;for(let h=0;h<=l;h++)if(a instanceof an||a instanceof kn||a instanceof ln){if(a.getPoint(h/l,c),n!==void 0&&QO(n,c,kh))continue;n===void 0&&(n=hp),n.copy(c),i.push(c.x,c.y),s++}}return Vh(i[0],i[i.length-2],kh)&&Vh(i[1],i[i.length-1],kh)&&(i.pop(),i.pop()),r&&s>1&&!(Vh(i[s-1],i[1],kh)&&Vh(i[s-2],i[0],kh))&&(i.push(i[0],i[1]),s++),i}var nv=new B,KO=new B,ZO=new B,$O=new B,eF=new B,tF=new B,Tt=class extends rn{constructor(t=100,r=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new Yt;this.plane=new Gr(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=et.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=t,this._height=r}static createFromState(t,r,n){let s=new Tt;return s.isClosed=t.isClosed,s.points=t.points.map(o=>fi.create(o.id,o.data)),typeof t.roundness=="number"&&(s.roundness=t.roundness),s.shapeHoles=t.shapeHoles.map(o=>Tt.createFromState(o)),r!==void 0&&n!==void 0&&s.applySize(r,n),s.update(),s}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(t){if(this._roundness!==t){this._roundness=t;for(let r=0,n=this.points.length;r<n;r++)this.points[r].roundness=t;this.needsUpdate=!0}}getPointsIndexesByIds(t){return t.map(r=>this.getPointIndexById(r)).filter(r=>r>=0)}getPointIndexById(t){let r=this.points.length,n=this.points.findIndex(s=>s.uuid===t);if(n<0){let s=r;for(let o=0,a=this.shapeHoles.length;o<a;o++){let l=this.shapeHoles[o],c=l.points.length-1,h=l.getPointIndexById(t);if(h<0)s+=c;else return h+s}}return n}getLineIndexById(t){return this.getPointIndexById(t)}getBezierPoint(t){if(t<=this.points.length-1)return this.points[t];if(this.shapeHoles.length>0)for(let r=0,n=this.shapeHoles.length;r<n;r++){let s=this.shapeHoles[r],o=t-this.points.length;if(o<=s.points.length-1)return s.points[o]}throw new Error("This shape does not have a point for this index: "+t)}getBezierPointIndex(t){let r=this.points.indexOf(t);if(r>=0)return r;if(r=this.points.length,this.shapeHoles.length>0)for(let n=0,s=this.shapeHoles.length;n<s;n++){let o=this.shapeHoles[n],a=o.points.indexOf(t);if(a>=0)return r+a;r+=o.points.length}return-1}getAllPoints(){let t=[].concat(...this.shapeHoles.map(r=>r.points));return[...this.points,...t]}applySize(t,r){t===0&&(t=.001),r===0&&(r=.001),this._width=t,this._height=r}applyScale(t,r){let n=nv.set(t,r);for(let s=0,o=this.points.length;s<o;s++){let a=this.points[s];a.position.multiply(n),a.controls[0].position.multiply(n),a.controls[1].position.multiply(n)}for(let s=0,o=this.shapeHoles.length;s<o;s++)this.shapeHoles[s].applyScale(t,r);this._update(!1)}createPoint(t,r=0,n=et.generateUUID()){let s;t instanceof B?s=t:s=new B(t,r);let o=new fi(n,s);return o.roundness=this.roundness,o}addPoint(t){this.points.push(t),this.needsUpdate=!0}addPointAt(t,r){this.points.splice(r,0,t),this.needsUpdate=!0}getPointByUuid(t){for(let r=0,n=this.points.length;r<n;r++){let s=this.points[r];if(s.uuid===t)return s}for(let r=0,n=this.shapeHoles.length;r<n;r++){let o=this.shapeHoles[r].getPointByUuid(t);if(o)return o}}getFirstPoint(){return this.points[0]}getLastPoint(){return this.points[this.points.length-1]}removePoint(t){let r=this.points.indexOf(t);r>=0&&this.points.splice(r,1),this.needsUpdate=!0}removePointById(t){let r=this.points.find(n=>n.uuid===t);r&&this.removePoint(r)}update(t=!0){for(let r=0,n=this.shapeHoles.length;r<n;r++)this.shapeHoles[r].update(!1);this._update(t)}extractShapePointsToBuffer(t,r=12,n=!1){this.subdivision=r,this.curveDivisions===void 0&&this.computeCurveDivisions(r);let s=n?this.roundedCurveDivisions:this.curveDivisions;return r1(t,n?this.roundedCurves:this.curves,r,this.autoClose),s.reduce((o,a)=>o+a,0)+1}computeCurveDivisions(t=12){return this.curveDivisions=rv(this.points,t,!1),this.roundedCurveDivisions=rv(this.points,t,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(t,r,n=12){return n1(t,this.curves,r,n,this.autoClose).reduce((o,a)=>o+a,0)*2}extractShapePointsToFlatArray(t,r=12){return this.subdivision=r,this.curveDivisions===void 0&&this.computeCurveDivisions(r),i1(t,this.roundedCurves,r,this.autoClose)}getCurveIndexFromVertexId(t,r=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let s=r?this.roundedCurveDivisions:this.curveDivisions,o=0;r&&this.points[0].roundedCurveCorner!==void 0&&(o=ao(this.points[0].roundedCurveCorner,this.subdivision)*.5);let a=t-o;a<0&&(a+=s.reduce((l,c)=>l+c,0));for(let l=0,c=s.length;l<c;l++){let h=s[l];if(a<n+h)return[l,(a-n+1)/h];n+=h}return[0,1]}getCurveT(t,r,n){let s=this.points[t],o=this.points[t>=this.points.length-1?0:t+1],a=this.curveDivisions,l=a[t];if(tv(s,o)){let u=s.position.distanceTo(o.position);return s.position.distanceTo(nv.set(n.x,n.y))/u}let c=0;for(let u=0;u<t;u++)c+=a[u];return(r-c)/l}dispose(){this.eventDispatcher=null}_applyCurveForPoint(t,r){tv(r,t)?this.lineTo(t.position.x,t.position.y):this.bezierCurveTo(r.controls[1].position.x,r.controls[1].position.y,t.controls[0].position.x,t.controls[0].position.y,t.position.x,t.position.y);let n=this.curves[this.curves.length-1];t.curveBefore=n,r.curveAfter=n;let s=n.clone();t.roundedCurveBefore=s,r.roundedCurveAfter=s,t.roundedCurveCorner=void 0,this.roundedCurves.push(s)}_update(t=!0){var n,s,o;if(this.curves=[],this.roundedCurves=[],!this.points.length)return;for(let a=0,l=this.points.length;a<l;a++){let c=this.points[a];if(a===0)this.moveTo(c.position.x,c.position.y);else{let h=this.points[a-1];this._applyCurveForPoint(c,h)}}let r=this.getLastPoint();if(r!=null&&r.curveAfter&&(r.curveAfter=void 0),this.isClosed){let a=this.points[0],l=this.points[this.points.length-1];this._applyCurveForPoint(a,l)}if(this.points.length>2){let a=0;for(let l=0,c=this.points.length;l<c;l++){let h=this.points[l],u=(n=this.points[l-1])!=null?n:this.points[this.points.length-1],f=(s=this.points[l+1])!=null?s:this.points[0],d=h.roundness,p=u&&f&&KM(u,h,f);if(!h.controlsMoved()&&d>0&&!p){let m=h.curveBefore,g=h.curveAfter;if(m===void 0||g===void 0)continue;let v=h.roundedCurveBefore,y=h.roundedCurveAfter,w=m.getLength(),b=g.getLength(),S=Math.min(d,w*.499),T=Math.min(d,b*.499),A=Math.min(S,T),x=1-A/w,_=A/b,E=m.getPointAt(x,nv),C=g.getPointAt(_,KO);this._subSplitCurve(m,v,x,E,void 0),this._subSplitCurve(g,y,_,void 0,C);let I;if(this.useCubicForRoundedCorners){let N=ev(E,h.position,C)/2,R=Math.tan(N)*E.distanceTo(h.position),[k,G]=ZM(E,C,R,ZO,$O),K=$M(k,G,h.position),[J,Y]=e1(K,E,C,R,eF,tF);I=new an(E.clone(),J.clone(),Y.clone(),C.clone())}else I=new kn(E.clone(),h.position.clone(),C.clone());h.roundedCurveCorner=I,this.roundedCurves.splice(l+a,0,I),a++}}}t&&((o=this.eventDispatcher)==null||o.dispatchEvent({type:"update"}))}_subSplitCurve(t,r,n,s,o){if(t instanceof ln)s!==void 0&&r.v2.copy(s),o!==void 0&&r.v1.copy(o);else{let a=t,l=r,c=a.getUtoTmapping(n,0),h=t1(a.v0,a.v1,a.v2,a.v3,c);return s!==void 0&&(l.v0.set(h[0],h[1]),l.v1.set(h[2],h[3]),l.v2.set(h[4],h[5]),l.v3.set(h[6],h[7])),o!==void 0&&(l.v0.set(h[6],h[7]),l.v1.set(h[8],h[9]),l.v2.set(h[10],h[11]),l.v3.set(h[12],h[13])),l}return r}clone(){let t=new Tt(this._width,this._height);return t.points=this.points.map(r=>r.clone()),t.isClosed=this.isClosed,t.roundness=this.roundness,t.isMesh2D=this.isMesh2D,t.shapeHoles=this.shapeHoles.map(r=>r.clone()),t}toJSON(){return{points:this.points.reduce((t,r)=>t.concat(r.toJSON()),[]),shapeHoles:this.shapeHoles.map(t=>t.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(t){var n;this.points=[],this.pointIDs=0;let r=t.points.length/7;for(let s=0;s<r;s++){let o=s*7,a=t.points[o+0],l=t.points[o+1],c=t.points[o+2],h=t.points[o+3],u=t.points[o+4],f=t.points[o+5],d=t.points[o+6],p=new fi(et.generateUUID(),new B(a,l));p.controls[0].position.set(c,h),p.controls[1].position.set(u,f),p.roundness=d,this.points.push(p)}return this.shapeHoles=(n=t.shapeHoles)!=null&&n.length?t.shapeHoles.map(s=>{let o=new Tt;return o.fromJSON(s),o}):[],this.isClosed=t.isClosed,this._roundness=t.roundness,this._update(),this}fromShape(t){let r=(s,o)=>{o instanceof an&&o.v3.equals(s.position)&&s.controls[0].position.copy(o.v2)},n=s=>{let o=[],a,l;for(a=0,l=s.length;a<l;a++)s[a]instanceof kn&&(s[a]=JM(s[a]));for(a=0,l=s.length;a<l;a++){let u=s[a],f=a>0?s[a-1]:null,d;u instanceof an?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ln&&(d=this.createPoint(u.v1)),d!==void 0&&(f!==null&&r(d,f),o.push(d))}let c=s[s.length-1],h=!1;return c instanceof an?c.v3.equals(o[0].position)&&(o[0].controls[0].position.copy(c.v2),h=!0):c instanceof ln&&c.v2.equals(o[0].position)&&(h=!0),this.isClosed=h,o};return this.points=n(t.curves),t instanceof rn&&(this.shapeHoles=t.holes.map(s=>{let o=new Tt;return o.fromShape(s),o})),this.update(),this}};var sv=Math.PI*2;function iv({x:i,y:e},t,r,n,s){return{x:i*t+n,y:e*r+s}}function rF(i,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),r=Math.cos(i),n=Math.sin(i),s=Math.cos(i+e),o=Math.sin(i+e);return[{x:r-n*t,y:n+r*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function s1(i,e,t,r){let n=i*r-e*t<0?-1:1,s=Math.min(1,Math.max(-1,i*t+e*r));return n*Math.acos(s)}function nF(i,e,t,r,n,s,o,a,l,c){let h=Math.pow(n,2),u=Math.pow(s,2),f=Math.pow(o,2),d=Math.pow(a,2),p=h*u-h*d-u*f;p<0&&(p=0),p/=h*d+u*f,p=Math.sqrt(p)*(l===c?-1:1);let m=p*n/s*a,g=p*-s/n*o,v=m+(i+t)/2,y=g+(e+r)/2,w=(o-m)/n,b=(a-g)/s,S=(-o-m)/n,T=(-a-g)/s,A=s1(1,0,w,b),x=s1(w,b,S,T);return!c&&x>0&&(x-=sv),c&&x<0&&(x+=sv),{centerx:v,centery:y,ang1:A,ang2:x}}function o1({px:i,py:e,cx:t,cy:r,rx:n,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(n===0||s===0)return[];let c=(i-t)/2,h=(e-r)/2;if(c===0&&h===0)return[];n=Math.abs(n),s=Math.abs(s);let u=Math.pow(c,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(s,2);u>1&&(n*=Math.sqrt(u),s*=Math.sqrt(u));let f=nF(i,e,t,r,n,s,c,h,o,a),{ang1:d,ang2:p}=f,{centerx:m,centery:g}=f,v=Math.abs(p)/(sv/4);Math.abs(1-v)<1e-7&&(v=1);let y=Math.max(Math.ceil(v),1);p/=y;for(let w=0;w<y;w++)l.push(rF(d,p)),d+=p;return l.map(w=>{let{x:b,y:S}=iv(w[0],n,s,m,g),{x:T,y:A}=iv(w[1],n,s,m,g),{x,y:_}=iv(w[2],n,s,m,g);return{x1:b,y1:S,x2:T,y2:A,x,y:_}})}var Zt;(function(i){i[i.ODD=0]="ODD",i[i.NONZERO=1]="NONZERO",i[i.POSITIVE=2]="POSITIVE",i[i.NEGATIVE=3]="NEGATIVE",i[i.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Zt||(Zt={}));var Tr;(function(i){i[i.POLYGONS=0]="POLYGONS",i[i.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",i[i.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(Tr||(Tr={}));function qe(i,e){if(!i)throw e||"Assertion Failed!"}var ze=function(){function i(){}return i.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},i.vertLeq=function(e,t){return e.s<t.s||e.s===t.s&&e.t<=t.t},i.transLeq=function(e,t){return e.t<t.t||e.t===t.t&&e.s<=t.s},i.edgeGoesLeft=function(e){return i.vertLeq(e.Dst,e.Org)},i.edgeGoesRight=function(e){return i.vertLeq(e.Org,e.Dst)},i.vertL1dist=function(e,t){return Math.abs(e.s-t.s)+Math.abs(e.t-t.t)},i.edgeEval=function(e,t,r){qe(i.vertLeq(e,t)&&i.vertLeq(t,r));var n=t.s-e.s,s=r.s-t.s;return n+s>0?n<s?t.t-e.t+(e.t-r.t)*(n/(n+s)):t.t-r.t+(r.t-e.t)*(s/(n+s)):0},i.edgeSign=function(e,t,r){qe(i.vertLeq(e,t)&&i.vertLeq(t,r));var n=t.s-e.s,s=r.s-t.s;return n+s>0?(t.t-r.t)*n+(t.t-e.t)*s:0},i.transEval=function(e,t,r){qe(i.transLeq(e,t)&&i.transLeq(t,r));var n=t.t-e.t,s=r.t-t.t;return n+s>0?n<s?t.s-e.s+(e.s-r.s)*(n/(n+s)):t.s-r.s+(r.s-e.s)*(s/(n+s)):0},i.transSign=function(e,t,r){qe(i.transLeq(e,t)&&i.transLeq(t,r));var n=t.t-e.t,s=r.t-t.t;return n+s>0?(t.s-r.s)*n+(t.s-e.s)*s:0},i.vertCCW=function(e,t,r){return e.s*(t.t-r.t)+t.s*(r.t-e.t)+r.s*(e.t-t.t)>=0},i.interpolate=function(e,t,r,n){return e=e<0?0:e,r=r<0?0:r,e<=r?r===0?(t+n)/2:t+(n-t)*(e/(e+r)):n+(t-n)*(r/(e+r))},i.intersect=function(e,t,r,n,s){var o,a,l;i.vertLeq(e,t)||(l=e,e=t,t=l),i.vertLeq(r,n)||(l=r,r=n,n=l),i.vertLeq(e,r)||(l=e,e=r,r=l,l=t,t=n,n=l),i.vertLeq(r,t)?i.vertLeq(t,n)?(o=i.edgeEval(e,r,t),a=i.edgeEval(r,t,n),o+a<0&&(o=-o,a=-a),s.s=i.interpolate(o,r.s,a,t.s)):(o=i.edgeSign(e,r,t),a=-i.edgeSign(e,n,t),o+a<0&&(o=-o,a=-a),s.s=i.interpolate(o,r.s,a,n.s)):s.s=(r.s+t.s)/2,i.transLeq(e,t)||(l=e,e=t,t=l),i.transLeq(r,n)||(l=r,r=n,n=l),i.transLeq(e,r)||(l=e,e=r,r=l,l=t,t=n,n=l),i.transLeq(r,t)?i.transLeq(t,n)?(o=i.transEval(e,r,t),a=i.transEval(r,t,n),o+a<0&&(o=-o,a=-a),s.t=i.interpolate(o,r.t,a,t.t)):(o=i.transSign(e,r,t),a=-i.transSign(e,n,t),o+a<0&&(o=-o,a=-a),s.t=i.interpolate(o,r.t,a,n.t)):s.t=(r.t+t.t)/2},i}(),Hh=function(){function i(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return i}(),up=function(){function i(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(i.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),i}(),Il=function(){function i(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return i}(),a1=function(){function i(){var e=new Il,t=new Hh,r=new up(0),n=new up(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,r.next=r,r.Sym=n,n.next=n,n.Sym=r,this.vHead=e,this.fHead=t,this.eHead=r,this.eHeadSym=n}return i.prototype.makeEdge_=function(e){var t=new up(0),r=new up(1);e.Sym.side<e.side&&(e=e.Sym);var n=e.Sym.next;return r.next=n,n.Sym.next=t,t.next=e,e.Sym.next=r,t.Sym=r,t.Onext=t,t.Lnext=r,t.Org=null,t.Lface=null,t.winding=0,t.activeRegion=null,r.Sym=t,r.Onext=r,r.Lnext=t,r.Org=null,r.Lface=null,r.winding=0,r.activeRegion=null,t},i.prototype.splice_=function(e,t){var r=e.Onext,n=t.Onext;r.Sym.Lnext=t,n.Sym.Lnext=e,e.Onext=n,t.Onext=r},i.prototype.makeVertex_=function(e,t,r){var n=e;qe(n,"Vertex can't be null!");var s=r.prev;n.prev=s,s.next=n,n.next=r,r.prev=n,n.anEdge=t;var o=t;do o.Org=n,o=o.Onext;while(o!==t)},i.prototype.makeFace_=function(e,t,r){var n=e;qe(n,"Face can't be null");var s=r.prev;n.prev=s,s.next=n,n.next=r,r.prev=n,n.anEdge=t,n.trail=null,n.marked=!1,n.inside=r.inside;var o=t;do o.Lface=n,o=o.Lnext;while(o!==t)},i.prototype.killEdge_=function(e){e.Sym.side<e.side&&(e=e.Sym);var t=e.next,r=e.Sym.next;t.Sym.next=r,r.Sym.next=t},i.prototype.killVertex_=function(e,t){var r=e.anEdge,n=r;do n.Org=t,n=n.Onext;while(n!==r);var s=e.prev,o=e.next;o.prev=s,s.next=o},i.prototype.killFace_=function(e,t){var r=e.anEdge,n=r;do n.Lface=t,n=n.Lnext;while(n!==r);var s=e.prev,o=e.next;o.prev=s,s.next=o},i.prototype.makeEdge=function(){var e=new Il,t=new Il,r=new Hh,n=this.makeEdge_(this.eHead);return this.makeVertex_(e,n,this.vHead),this.makeVertex_(t,n.Sym,this.vHead),this.makeFace_(r,n,this.fHead),n},i.prototype.splice=function(e,t){var r=!1,n=!1;if(e!==t){if(t.Org!==e.Org&&(n=!0,this.killVertex_(t.Org,e.Org)),t.Lface!==e.Lface&&(r=!0,this.killFace_(t.Lface,e.Lface)),this.splice_(t,e),!n){var s=new Il;this.makeVertex_(s,t,e.Org),e.Org.anEdge=e}if(!r){var o=new Hh;this.makeFace_(o,t,e.Lface),e.Lface.anEdge=e}}},i.prototype.delete=function(e){var t=e.Sym,r=!1;if(e.Lface!==e.Rface&&(r=!0,this.killFace_(e.Lface,e.Rface)),e.Onext===e)this.killVertex_(e.Org,null);else if(e.Rface.anEdge=e.Oprev,e.Org.anEdge=e.Onext,this.splice_(e,e.Oprev),!r){var n=new Hh;this.makeFace_(n,e,e.Lface)}t.Onext===t?(this.killVertex_(t.Org,null),this.killFace_(t.Lface,null)):(e.Lface.anEdge=t.Oprev,t.Org.anEdge=t.Onext,this.splice_(t,t.Oprev)),this.killEdge_(e)},i.prototype.addEdgeVertex=function(e){var t=this.makeEdge_(e),r=t.Sym;this.splice_(t,e.Lnext),t.Org=e.Dst;var n=new Il;return this.makeVertex_(n,r,t.Org),t.Lface=r.Lface=e.Lface,t},i.prototype.splitEdge=function(e){var t=this.addEdgeVertex(e),r=t.Sym;return this.splice_(e.Sym,e.Sym.Oprev),this.splice_(e.Sym,r),e.Dst=r.Org,r.Dst.anEdge=r.Sym,r.Rface=e.Rface,r.winding=e.winding,r.Sym.winding=e.Sym.winding,r.idx=e.idx,r.Sym.idx=e.Sym.idx,r},i.prototype.connect=function(e,t){var r=!1,n=this.makeEdge_(e),s=n.Sym;if(t.Lface!==e.Lface&&(r=!0,this.killFace_(t.Lface,e.Lface)),this.splice_(n,e.Lnext),this.splice_(s,t),n.Org=e.Dst,s.Org=t.Org,n.Lface=s.Lface=e.Lface,e.Lface.anEdge=s,!r){var o=new Hh;this.makeFace_(o,n,e.Lface)}return n},i.prototype.zapFace=function(e){var t=e.anEdge,r,n,s,o,a;n=t.Lnext;do r=n,n=r.Lnext,r.Lface=null,r.Rface===null&&(r.Onext===r?this.killVertex_(r.Org,null):(r.Org.anEdge=r.Onext,this.splice_(r,r.Oprev)),s=r.Sym,s.Onext===s?this.killVertex_(s.Org,null):(s.Org.anEdge=s.Onext,this.splice_(s,s.Oprev)),this.killEdge_(r));while(r!=t);o=e.prev,a=e.next,a.prev=o,o.next=a},i.prototype.countFaceVerts_=function(e){var t=e.anEdge,r=0;do r++,t=t.Lnext;while(t!==e.anEdge);return r},i.prototype.mergeConvexFaces=function(e){var t,r,n,s,o,a,l;for(t=this.fHead.next;t!==this.fHead;t=t.next)if(!!t.inside)for(r=t.anEdge,o=r.Org;n=r.Lnext,s=r.Sym,s&&s.Lface&&s.Lface.inside&&(a=this.countFaceVerts_(t),l=this.countFaceVerts_(s.Lface),a+l-2<=e&&ze.vertCCW(r.Lprev.Org,r.Org,s.Lnext.Lnext.Org)&&ze.vertCCW(s.Lprev.Org,s.Org,r.Lnext.Lnext.Org)&&(n=s.Lnext,this.delete(s),r=null,s=null)),!(r&&r.Lnext.Org===o);)r=n;return!0},i.prototype.check=function(){var e=this.fHead,t=this.vHead,r=this.eHead,n,s,o,a,l,c;for(s=e,s=e;(n=s.next)!==e;s=n){qe(n.prev===s),l=n.anEdge;do qe(l.Sym!==l),qe(l.Sym.Sym===l),qe(l.Lnext.Onext.Sym===l),qe(l.Onext.Sym.Lnext===l),qe(l.Lface===n),l=l.Lnext;while(l!==n.anEdge)}for(qe(n.prev===s&&n.anEdge===null),a=t,a=t;(o=a.next)!==t;a=o){qe(o.prev===a),l=o.anEdge;do qe(l.Sym!==l),qe(l.Sym.Sym===l),qe(l.Lnext.Onext.Sym===l),qe(l.Onext.Sym.Lnext===l),qe(l.Org===o),l=l.Onext;while(l!==o.anEdge)}for(qe(o.prev===a&&o.anEdge===null),c=r,c=r;(l=c.next)!==r;c=l)qe(l.Sym.next===c.Sym),qe(l.Sym!==l),qe(l.Sym.Sym===l),qe(l.Org!==null),qe(l.Dst!==null),qe(l.Lnext.Onext.Sym===l),qe(l.Onext.Sym.Lnext===l);qe(l.Sym.next===c.Sym&&l.Sym===this.eHeadSym&&l.Sym.Sym===l&&l.Org===null&&l.Dst===null&&l.Lface===null&&l.Rface===null)},i}(),l1=function(){function i(){this.handle=null}return i}(),c1=function(){function i(){this.key=null,this.node=0}return i}(),iF=function(){function i(e,t){this.leq=t,this.max=0,this.nodes=[],this.handles=[],this.initialized=!1,this.freeList=0,this.size=0,this.max=e,this.nodes=[],this.handles=[];for(var r=0;r<e+1;r++)this.nodes[r]=new l1,this.handles[r]=new c1;this.initialized=!1,this.nodes[1].handle=1,this.handles[1].key=null}return i.prototype.floatDown_=function(e){var t=this.nodes,r=this.handles,n,s,o;for(n=t[e].handle;;){if(o=e<<1,o<this.size&&this.leq(r[t[o+1].handle].key,r[t[o].handle].key)&&++o,qe(o<=this.max),s=t[o].handle,o>this.size||this.leq(r[n].key,r[s].key)){t[e].handle=n,r[n].node=e;break}t[e].handle=s,r[s].node=e,e=o}},i.prototype.floatUp_=function(e){var t=this.nodes,r=this.handles,n,s,o;for(n=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(r[s].key,r[n].key)){t[e].handle=n,r[n].node=e;break}t[e].handle=s,r[s].node=e,e=o}},i.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},i.prototype.min=function(){return this.handles[this.nodes[1].handle].key},i.prototype.insert=function(e){var t,r;if(t=++this.size,t*2>this.max){this.max*=2;var n,s;for(s=this.nodes.length,this.nodes.length=this.max+1,n=s;n<this.nodes.length;n++)this.nodes[n]=new l1;for(s=this.handles.length,this.handles.length=this.max+1,n=s;n<this.handles.length;n++)this.handles[n]=new c1}return this.freeList===0?r=t:(r=this.freeList,this.freeList=this.handles[r].node),this.nodes[t].handle=r,this.handles[r].node=t,this.handles[r].key=e,this.initialized&&this.floatUp_(t),r},i.prototype.extractMin=function(){var e=this.nodes,t=this.handles,r=e[1].handle,n=t[r].key;return this.size>0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[r].key=null,t[r].node=this.freeList,this.freeList=r,--this.size,this.size>0&&this.floatDown_(1)),n},i.prototype.delete=function(e){var t=this.nodes,r=this.handles,n;qe(e>=1&&e<=this.max&&r[e].key!==null),n=r[e].node,t[n].handle=t[this.size].handle,r[t[n].handle].node=n,--this.size,n<=this.size&&(n<=1||this.leq(r[t[n>>1].handle].key,r[t[n].handle].key)?this.floatDown_(n):this.floatUp_(n)),r[e].key=null,r[e].node=this.freeList,this.freeList=e},i}(),ov=function(){function i(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return i}(),h1=function(){function i(){this.key=null,this.next=null,this.prev=null}return i}(),sF=function(){function i(e,t){this.frame=e,this.leq=t,this.head=new h1,this.head.next=this.head,this.head.prev=this.head}return i.prototype.min=function(){return this.head.next},i.prototype.max=function(){return this.head.prev},i.prototype.insert=function(e){return this.insertBefore(this.head,e)},i.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},i.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var r=new h1;return r.key=t,r.next=e.next,e.next.prev=r,r.prev=e,e.next=r,r},i.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},i}(),oF=function(){function i(){}return i.regionBelow=function(e){return e.nodeUp.prev.key},i.regionAbove=function(e){return e.nodeUp.next.key},i.debugEvent=function(e){},i.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},i.edgeLeq=function(e,t,r){var n=e.event,s=t.eUp,o=r.eUp;if(s.Dst===n)return o.Dst===n?ze.vertLeq(s.Org,o.Org)?ze.edgeSign(o.Dst,s.Org,o.Org)<=0:ze.edgeSign(s.Dst,o.Org,s.Org)>=0:ze.edgeSign(o.Dst,n,o.Org)<=0;if(o.Dst===n)return ze.edgeSign(s.Dst,n,s.Org)>=0;var a=ze.edgeEval(s.Dst,n,s.Org),l=ze.edgeEval(o.Dst,n,o.Org);return a>=l},i.deleteRegion=function(e,t){t.fixUpperEdge&&qe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},i.fixUpperEdge=function(e,t,r){qe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=r,r.activeRegion=t},i.topLeftRegion=function(e,t){var r=t.eUp.Org,n;do t=i.regionAbove(t);while(t.eUp.Org===r);if(t.fixUpperEdge){if(n=e.mesh.connect(i.regionBelow(t).eUp.Sym,t.eUp.Lnext),n===null)return null;i.fixUpperEdge(e,t,n),t=i.regionAbove(t)}return t},i.topRightRegion=function(e){var t=e.eUp.Dst;do e=i.regionAbove(e);while(e.eUp.Dst===t);return e},i.addRegionBelow=function(e,t,r){var n=new ov;return n.eUp=r,n.nodeUp=e.dict.insertBefore(t.nodeUp,n),n.fixUpperEdge=!1,n.sentinel=!1,n.dirty=!1,r.activeRegion=n,n},i.isWindingInside=function(e,t){switch(e.windingRule){case Zt.ODD:return(t&1)!==0;case Zt.NONZERO:return t!==0;case Zt.POSITIVE:return t>0;case Zt.NEGATIVE:return t<0;case Zt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},i.computeWinding=function(e,t){t.windingNumber=i.regionAbove(t).windingNumber+t.eUp.winding,t.inside=i.isWindingInside(e,t.windingNumber)},i.finishRegion=function(e,t){var r=t.eUp,n=r.Lface;n.inside=t.inside,n.anEdge=r,i.deleteRegion(e,t)},i.finishLeftRegions=function(e,t,r){for(var n,s=null,o=t,a=t.eUp;o!==r;){if(o.fixUpperEdge=!1,s=i.regionBelow(o),n=s.eUp,n.Org!=a.Org){if(!s.fixUpperEdge){i.finishRegion(e,o);break}n=e.mesh.connect(a.Lprev,n.Sym),i.fixUpperEdge(e,s,n)}a.Onext!==n&&(e.mesh.splice(n.Oprev,n),e.mesh.splice(a,n)),i.finishRegion(e,o),a=s.eUp,o=s}return a},i.addRightEdges=function(e,t,r,n,s,o){var a,l,c,h,u=!0;c=r;do qe(ze.vertLeq(c.Org,c.Dst)),i.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==n);for(s===null&&(s=i.regionBelow(t).eUp.Rprev),l=t,h=s;a=i.regionBelow(l),c=a.eUp.Sym,c.Org===h.Org;)c.Onext!==h&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(h.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=i.isWindingInside(e,a.windingNumber),l.dirty=!0,!u&&i.checkForRightSplice(e,l)&&(i.addWinding(c,h),i.deleteRegion(e,l),e.mesh.delete(h)),u=!1,l=a,h=c;l.dirty=!0,qe(l.windingNumber-c.winding===a.windingNumber),o&&i.walkDirtyRegions(e,l)},i.spliceMergeVertices=function(e,t,r){e.mesh.splice(t,r)},i.vertexWeights=function(e,t,r){var n=ze.vertL1dist(t,e),s=ze.vertL1dist(r,e),o=.5*s/(n+s),a=.5*n/(n+s);e.coords[0]+=o*t.coords[0]+a*r.coords[0],e.coords[1]+=o*t.coords[1]+a*r.coords[1],e.coords[2]+=o*t.coords[2]+a*r.coords[2]},i.getIntersectData=function(e,t,r,n,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,i.vertexWeights(t,r,n),i.vertexWeights(t,s,o)},i.checkForRightSplice=function(e,t){var r=i.regionBelow(t),n=t.eUp,s=r.eUp;if(ze.vertLeq(n.Org,s.Org)){if(ze.edgeSign(s.Dst,n.Org,s.Org)>0)return!1;ze.vertEq(n.Org,s.Org)?n.Org!==s.Org&&(e.pq.delete(n.Org.pqHandle),i.spliceMergeVertices(e,s.Oprev,n)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(n,s.Oprev),t.dirty=r.dirty=!0)}else{if(ze.edgeSign(n.Dst,s.Org,n.Org)<0)return!1;i.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(n.Sym),e.mesh.splice(s.Oprev,n)}return!0},i.checkForLeftSplice=function(e,t){var r=i.regionBelow(t),n=t.eUp,s=r.eUp,o;if(qe(!ze.vertEq(n.Dst,s.Dst)),ze.vertLeq(n.Dst,s.Dst)){if(ze.edgeSign(n.Dst,s.Dst,n.Org)<0)return!1;i.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(n),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(ze.edgeSign(s.Dst,n.Dst,s.Org)>0)return!1;t.dirty=r.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(n.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},i.checkForIntersect=function(e,t){var r=i.regionBelow(t),n=t.eUp,s=r.eUp,o=n.Org,a=s.Org,l=n.Dst,c=s.Dst,h,u,f=new Il,d,p;if(qe(!ze.vertEq(c,l)),qe(ze.edgeSign(l,e.event,o)<=0),qe(ze.edgeSign(c,e.event,a)>=0),qe(o!==e.event&&a!==e.event),qe(!t.fixUpperEdge&&!r.fixUpperEdge),o===a||(h=Math.min(o.t,l.t),u=Math.max(a.t,c.t),h>u))return!1;if(ze.vertLeq(o,a)){if(ze.edgeSign(c,o,a)>0)return!1}else if(ze.edgeSign(l,a,o)<0)return!1;return i.debugEvent(e),ze.intersect(l,o,c,a,f),qe(Math.min(o.t,l.t)<=f.t),qe(f.t<=Math.max(a.t,c.t)),qe(Math.min(c.s,l.s)<=f.s),qe(f.s<=Math.max(a.s,o.s)),ze.vertLeq(f,e.event)&&(f.s=e.event.s,f.t=e.event.t),d=ze.vertLeq(o,a)?o:a,ze.vertLeq(d,f)&&(f.s=d.s,f.t=d.t),ze.vertEq(f,o)||ze.vertEq(f,a)?(i.checkForRightSplice(e,t),!1):!ze.vertEq(l,e.event)&&ze.edgeSign(l,e.event,f)>=0||!ze.vertEq(c,e.event)&&ze.edgeSign(c,e.event,f)<=0?c===e.event?(e.mesh.splitEdge(n.Sym),e.mesh.splice(s.Sym,n),t=i.topLeftRegion(e,t),n=i.regionBelow(t).eUp,i.finishLeftRegions(e,i.regionBelow(t),r),i.addRightEdges(e,t,n.Oprev,n,n,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(n.Lnext,s.Oprev),r=t,t=i.topRightRegion(t),p=i.regionBelow(t).eUp.Rprev,r.eUp=s.Oprev,s=i.finishLeftRegions(e,r,null),i.addRightEdges(e,t,s.Onext,n.Rprev,p,!0),!0):(ze.edgeSign(l,e.event,f)>=0&&(i.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(n.Sym),n.Org.s=e.event.s,n.Org.t=e.event.t),ze.edgeSign(c,e.event,f)<=0&&(t.dirty=r.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(n.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,n),n.Org.s=f.s,n.Org.t=f.t,n.Org.pqHandle=e.pq.insert(n.Org),i.getIntersectData(e,n.Org,o,l,a,c),i.regionAbove(t).dirty=t.dirty=r.dirty=!0,!1)},i.walkDirtyRegions=function(e,t){for(var r=i.regionBelow(t),n,s;;){for(;r.dirty;)t=r,r=i.regionBelow(r);if(!t.dirty&&(r=t,t=i.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,n=t.eUp,s=r.eUp,n.Dst!==s.Dst&&i.checkForLeftSplice(e,t)&&(r.fixUpperEdge?(i.deleteRegion(e,r),e.mesh.delete(s),r=i.regionBelow(t),s=r.eUp):t.fixUpperEdge&&(i.deleteRegion(e,t),e.mesh.delete(n),t=i.regionAbove(r),n=t.eUp)),n.Org!==s.Org)if(n.Dst!==s.Dst&&!t.fixUpperEdge&&!r.fixUpperEdge&&(n.Dst===e.event||s.Dst===e.event)){if(i.checkForIntersect(e,t))return}else i.checkForRightSplice(e,t);n.Org===s.Org&&n.Dst===s.Dst&&(i.addWinding(s,n),i.deleteRegion(e,t),e.mesh.delete(n),t=i.regionAbove(r))}},i.connectRightVertex=function(e,t,r){var n,s=r.Onext,o=i.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&i.checkForIntersect(e,t),ze.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=i.topLeftRegion(e,t),s=i.regionBelow(t).eUp,i.finishLeftRegions(e,i.regionBelow(t),o),c=!0),ze.vertEq(l.Org,e.event)&&(e.mesh.splice(r,l.Oprev),r=i.finishLeftRegions(e,o,null),c=!0),c){i.addRightEdges(e,t,r.Onext,s,s,!0);return}ze.vertLeq(l.Org,a.Org)?n=l.Oprev:n=a,n=e.mesh.connect(r.Lprev,n),i.addRightEdges(e,t,n,n.Onext,n.Onext,!1),n.Sym.activeRegion.fixUpperEdge=!0,i.walkDirtyRegions(e,t)},i.connectLeftDegenerate=function(e,t,r){var n,s,o,a,l;if(n=t.eUp,ze.vertEq(n.Org,r)){qe(!1),i.spliceMergeVertices(e,n,r.anEdge);return}if(!ze.vertEq(n.Dst,r)){e.mesh.splitEdge(n.Sym),t.fixUpperEdge&&(e.mesh.delete(n.Onext),t.fixUpperEdge=!1),e.mesh.splice(r.anEdge,n),i.sweepEvent(e,r);return}qe(!1),t=i.topRightRegion(t),l=i.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(qe(s!==o),i.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(r.anEdge,o),ze.edgeGoesLeft(s)||(s=null),i.addRightEdges(e,t,o.Onext,a,s,!0)},i.connectLeftVertex=function(e,t){var r,n,s,o,a,l,c=new ov;if(c.eUp=t.anEdge.Sym,r=e.dict.search(c).key,n=i.regionBelow(r),!!n){if(o=r.eUp,a=n.eUp,ze.edgeSign(o.Dst,t,o.Org)===0){i.connectLeftDegenerate(e,r,t);return}if(s=ze.vertLeq(a.Dst,o.Dst)?r:n,r.inside||s.fixUpperEdge){if(s===r)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var h=e.mesh.connect(a.Dnext,t.anEdge);l=h.Sym}s.fixUpperEdge?i.fixUpperEdge(e,s,l):i.computeWinding(e,i.addRegionBelow(e,r,l)),i.sweepEvent(e,t)}else i.addRightEdges(e,r,t.anEdge,t.anEdge,null,!0)}},i.sweepEvent=function(e,t){e.event=t,i.debugEvent(e);for(var r=t.anEdge;r.activeRegion===null;)if(r=r.Onext,r===t.anEdge){i.connectLeftVertex(e,t);return}var n=i.topLeftRegion(e,r.activeRegion);qe(n!==null);var s=i.regionBelow(n),o=s.eUp,a=i.finishLeftRegions(e,s,null);a.Onext===o?i.connectRightVertex(e,n,a):i.addRightEdges(e,n,a.Onext,o,o,!0)},i.addSentinel=function(e,t,r,n){var s=new ov,o=e.mesh.makeEdge();o.Org.s=r,o.Org.t=n,o.Dst.s=t,o.Dst.t=n,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},i.initEdgeDict=function(e){e.dict=new sF(e,i.edgeLeq);var t=e.bmax[0]-e.bmin[0],r=e.bmax[1]-e.bmin[1],n=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-r,a=e.bmax[1]+r;i.addSentinel(e,n,s,o),i.addSentinel(e,n,s,a)},i.doneEdgeDict=function(e){for(var t,r=0;(t=e.dict.min().key)!==null;)t.sentinel||(qe(t.fixUpperEdge),qe(++r===1)),qe(t.windingNumber===0),i.deleteRegion(e,t)},i.removeDegenerateEdges=function(e){var t,r,n,s=e.mesh.eHead;for(t=s.next;t!==s;t=r)r=t.next,n=t.Lnext,ze.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(i.spliceMergeVertices(e,n,t),e.mesh.delete(t),t=n,n=t.Lnext),n.Lnext===t&&(n!==t&&((n===r||n===r.Sym)&&(r=r.next),e.mesh.delete(n)),(t===r||t===r.Sym)&&(r=r.next),e.mesh.delete(t))},i.initPriorityQ=function(e){var t,r,n,s=0;for(n=e.mesh.vHead,r=n.next;r!==n;r=r.next)s++;for(s+=8,t=e.pq=new iF(s,ze.vertLeq),n=e.mesh.vHead,r=n.next;r!==n;r=r.next)r.pqHandle=t.insert(r);return r!==n?!1:(t.init(),!0)},i.donePriorityQ=function(e){e.pq=null},i.removeDegenerateFaces=function(e,t){var r,n,s;for(r=t.fHead.next;r!==t.fHead;r=n)n=r.next,s=r.anEdge,qe(s.Lnext!==s),s.Lnext.Lnext===s&&(i.addWinding(s.Onext,s),e.mesh.delete(s));return!0},i.computeInterior=function(e,t){t===void 0&&(t=!0);var r,n;if(i.removeDegenerateEdges(e),!i.initPriorityQ(e))return!1;for(i.initEdgeDict(e);(r=e.pq.extractMin())!==null;){for(;n=e.pq.min(),!(n===null||!ze.vertEq(n,r));)n=e.pq.extractMin(),i.spliceMergeVertices(e,r.anEdge,n.anEdge);i.sweepEvent(e,r)}return e.event=e.dict.min().key.eUp.Org,i.debugEvent(e),i.doneEdgeDict(e),i.donePriorityQ(e),i.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},i}(),aF=function(){function i(){this.mesh=new a1,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Zt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return i.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},i.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},i.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},i.prototype.computeNormal_=function(e){var t,r,n,s,o,a,l=[0,0,0],c=[0,0,0],h=[0,0,0],u=[0,0,0],f=[0,0,0],d=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var g=0;g<3;++g)s=t.coords[g],c[g]=s,p[g]=t,l[g]=s,d[g]=t;for(t=m.next;t!==m;t=t.next)for(var v=0;v<3;++v)s=t.coords[v],s<c[v]&&(c[v]=s,p[v]=t),s>l[v]&&(l[v]=s,d[v]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,r=p[y],n=d[y],h[0]=r.coords[0]-n.coords[0],h[1]=r.coords[1]-n.coords[1],h[2]=r.coords[2]-n.coords[2],t=m.next;t!==m;t=t.next)u[0]=t.coords[0]-n.coords[0],u[1]=t.coords[1]-n.coords[1],u[2]=t.coords[2]-n.coords[2],f[0]=h[1]*u[2]-h[2]*u[1],f[1]=h[2]*u[0]-h[0]*u[2],f[2]=h[0]*u[1]-h[1]*u[0],o=f[0]*f[0]+f[1]*f[1]+f[2]*f[2],o>a&&(a=o,e[0]=f[0],e[1]=f[1],e[2]=f[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(h)]=1)},i.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,r=this.mesh.vHead,n,s=0,o=e.next;o!==e;o=o.next)if(n=o.anEdge,!(n.winding<=0))do s+=(n.Org.s-n.Dst.s)*(n.Org.t+n.Dst.t),n=n.Lnext;while(n!==o.anEdge);if(s<0){for(t=r.next;t!==r;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},i.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],r,n,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),r=this.sUnit,n=this.tUnit;var o=this.longAxis_(t);r[o]=0,r[(o+1)%3]=1,r[(o+2)%3]=0,n[o]=0,n[(o+1)%3]=0,n[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,r),a.t=this.dot_(a.coords,n);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.s<this.bmin[0]&&(this.bmin[0]=c.s),c.s>this.bmax[0]&&(this.bmax[0]=c.s),c.t<this.bmin[1]&&(this.bmin[1]=c.t),c.t>this.bmax[1]&&(this.bmax[1]=c.t))},i.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},i.prototype.tessellateMonoRegion_=function(e,t){var r,n;if(r=t.anEdge,!(r.Lnext!==r&&r.Lnext.Lnext!==r))throw"Mono region invalid";for(;ze.vertLeq(r.Dst,r.Org);r=r.Lprev);for(;ze.vertLeq(r.Org,r.Dst);r=r.Lnext);n=r.Lprev;for(var s=void 0;r.Lnext!==n;)if(ze.vertLeq(r.Dst,n.Org)){for(;n.Lnext!==r&&(ze.edgeGoesLeft(n.Lnext)||ze.edgeSign(n.Org,n.Dst,n.Lnext.Dst)<=0);)s=e.connect(n.Lnext,n),n=s.Sym;n=n.Lprev}else{for(;n.Lnext!==r&&(ze.edgeGoesRight(r.Lprev)||ze.edgeSign(r.Dst,r.Org,r.Lprev.Org)>=0);)s=e.connect(r,r.Lprev),r=s.Sym;r=r.Lnext}if(n.Lnext===r)throw"Mono region invalid";for(;n.Lnext.Lnext!==r;)s=e.connect(n.Lnext,n),n=s.Sym;return!0},i.prototype.tessellateInterior_=function(e){for(var t,r=e.fHead.next;r!==e.fHead;r=t)if(t=r.next,r.inside&&!this.tessellateMonoRegion_(e,r))return!1;return!0},i.prototype.discardExterior_=function(e){for(var t,r=e.fHead.next;r!==e.fHead;r=t)t=r.next,r.inside||e.zapFace(r)},i.prototype.setWindingNumber_=function(e,t,r){for(var n,s=e.eHead.next;s!==e.eHead;s=n)n=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:r?e.delete(s):s.winding=0},i.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},i.prototype.outputPolymesh_=function(e,t,r,n){var s,o=0,a=0,l;r>3&&e.mergeConvexFaces(r);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var h=e.fHead.next;h!==e.fHead;h=h.next)if(h.n=-1,!!h.inside){s=h.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==h.anEdge);if(l>r)throw"Face vertex greater that support polygon";h.n=o,++o}this.elementCount=o,t===Tr.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*r,this.vertexCount=a,this.vertices=[],this.vertices.length=a*n,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var u=c.n*n;this.vertices[u+0]=c.coords[0],this.vertices[u+1]=c.coords[1],n>2&&(this.vertices[u+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var f=0,h=e.fHead.next;h!==e.fHead;h=h.next)if(!!h.inside){s=h.anEdge,l=0;do{var c=s.Org;this.elements[f++]=c.n,l++,s=s.Lnext}while(s!==h.anEdge);for(var d=l;d<r;++d)this.elements[f++]=-1;if(t===Tr.CONNECTED_POLYGONS){s=h.anEdge;do this.elements[f++]=this.getNeighbourFace_(s),s=s.Lnext;while(s!==h.anEdge);for(var p=l;p<r;++p)this.elements[f++]=-1}}},i.prototype.outputContours_=function(e,t){var r,n,s=0,o=0;this.vertexCount=0,this.elementCount=0;for(var a=e.fHead.next;a!==e.fHead;a=a.next)if(!!a.inside){n=r=a.anEdge;do this.vertexCount++,r=r.Lnext;while(r!==n);this.elementCount++}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*t,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var l=0,c=0,h=0;s=0;for(var a=e.fHead.next;a!==e.fHead;a=a.next)if(!!a.inside){o=0,n=r=a.anEdge;do this.vertices[l++]=r.Org.coords[0],this.vertices[l++]=r.Org.coords[1],t>2&&(this.vertices[l++]=r.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(r):r.Org.idx,o++,r=r.Lnext;while(r!==n);this.elements[h++]=s,this.elements[h++]=o,s+=o}},i.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new a1),e<2&&(e=2),e>3&&(e=3);for(var r=null,n=0;n<t.length;n+=e)r===null?(r=this.mesh.makeEdge(),this.mesh.splice(r,r.Sym)):(this.mesh.splitEdge(r),r=r.Lnext),r.Org.coords[0]=t[n+0],r.Org.coords[1]=t[n+1],e>2?r.Org.coords[2]=t[n+2]:r.Org.coords[2]=0,r.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(r),r.winding=1,r.Sym.winding=-1},i.prototype.tesselate=function(e,t,r,n,s,o){if(e===void 0&&(e=Zt.ODD),t===void 0&&(t=Tr.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,n<2&&(n=2),n>3&&(n=3),!this.mesh)return!1;this.projectPolygon_(),oF.computeInterior(this,o);var a=this.mesh;return t===Tr.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===Tr.BOUNDARY_CONTOURS?this.outputContours_(a,n):this.outputPolymesh_(a,t,r,n),!0},i}();function Xo(i){var e=i.windingRule,t=e===void 0?Zt.ODD:e,r=i.elementType,n=r===void 0?Tr.POLYGONS:r,s=i.polySize,o=s===void 0?3:s,a=i.vertexSize,l=a===void 0?2:a,c=i.normal,h=c===void 0?[0,0,1]:c,u=i.contours,f=u===void 0?[]:u,d=i.strict,p=d===void 0?!0:d,m=i.debug,g=m===void 0?!1:m;if(!f&&p)throw new Error("Contours can't be empty");if(!!f){var v=new aF;i.edgeCreateCallback&&(v.edgeCreateCallback=i.edgeCreateCallback),i.vertexIdCallback&&(v.vertexIdCallback=i.vertexIdCallback);for(var y=0;y<f.length;y++)v.addContour(l||2,f[y]);return v.tesselate(t,n,o,l,h,p),{vertices:v.vertices,vertexIndices:v.vertexIndices,vertexCount:v.vertexCount,elements:v.elements,elementCount:v.elementCount,mesh:g?v.mesh:void 0}}}var z7=Zt.ODD,G7=Zt.NONZERO,k7=Zt.POSITIVE,V7=Zt.NEGATIVE,H7=Zt.ABS_GEQ_TWO,W7=Tr.POLYGONS,j7=Tr.CONNECTED_POLYGONS,q7=Tr.BOUNDARY_CONTOURS;var Rl=class extends De{constructor(t,r=12,n={}){var p,m,g;super();this.type="ShapeGeometry";this.windingRule=Zt.ODD;this.elementType=Tr.POLYGONS;this.polySize=3;this.vertexSize=2;this.strict=!0;this._shape=t,this._curveSegments=r,this._triangulationOptions=Object.assign({windingRule:Zt.ODD,elementType:Tr.POLYGONS,polySize:3,vertexSize:2,strict:!0},n);let s=this._shape.extractShapePointsToFlatArray([],this._curveSegments),o=this._shape.shapeHoles.map(v=>v.extractShapePointsToFlatArray([],this._curveSegments)),a,l=!0,c=!0,h,u;for(let v=0,y=s.length/2;v<y;v++){let w=v*2,b=s[w+0],S=s[w+1];if(h!==void 0&&b!==h&&(l=!1),u!==void 0&&S!==u&&(c=!1),h=b,u=S,!l&&!c)break}!l&&!c&&(a=Xo({contours:[s,...o],windingRule:this._triangulationOptions.windingRule,elementType:this._triangulationOptions.elementType,polySize:this._triangulationOptions.polySize,vertexSize:this._triangulationOptions.vertexSize,strict:this._triangulationOptions.strict}));let f=(p=a==null?void 0:a.vertexCount)!=null?p:1,d=(m=a==null?void 0:a.elementCount)!=null?m:1;if(this._positionAttribute=new Ve(new Float32Array(f*3),3),this._normalAttribute=new Ve(new Float32Array(f*3),3),this._uvAttribute=new Ve(new Float32Array(f*2),2),this._indexAttribute=new Ve(new Uint32Array(d*3),1),a){let v=1/0,y=-1/0,w=1/0,b=-1/0;for(let A=0,x=f;A<x;A++){let _=A*2,E=a.vertices[_+0],C=a.vertices[_+1];E<v&&(v=E),E>y&&(y=E),C<w&&(w=C),C>b&&(b=C)}let S=y-v,T=b-w;for(let A=0,x=f;A<x;A++){let _=A*2,E=a.vertices[_+0],C=a.vertices[_+1],I=(E-v)/S,N=(C-w)/T;this._positionAttribute.setXYZ(A,E,C,0),this._normalAttribute.setXYZ(A,0,0,1),this._uvAttribute.setXY(A,I,N)}for(let A=0,x=d;A<x;A++){let _=A*3,E=a.elements[_+0],C=a.elements[_+1],I=a.elements[_+2];this._indexAttribute.setX(_+0,E),this._indexAttribute.setX(_+1,C),this._indexAttribute.setX(_+2,I)}}this.setAttribute("position",this._positionAttribute),this.setAttribute("normal",this._normalAttribute),this.setAttribute("uv",this._uvAttribute),this.setIndex(this._indexAttribute),this.setDrawRange(0,((g=a==null?void 0:a.elementCount)!=null?g:1)*3)}clone(){let t=new Rl(this._shape,this._curveSegments);return t.userData=Mh(this.userData),t}};var fp=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let r=e*fp.eSize;this.buffer=new ArrayBuffer(r);let n=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*n,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*n,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*n,2*e)}realloc(e,t=!1){if(e<this.size)throw Error("cannot shrink buffer");if(e<=this.capacity&&!t)return;this.debug&&console.log(`resizing from ${this.capacity} \u2192 ${e}`);let r=e*fp.eSize,n=new ArrayBuffer(r),s=Float32Array.BYTES_PER_ELEMENT,o=0,a=new Float32Array(n,o*s,3*e);o+=3*e;let l=new Float32Array(n,o*s,3*e);o+=3*e;let c=new Float32Array(n,o*s,2*e);a.set(this.positions.slice(0,this.size*3)),l.set(this.normals.slice(0,this.size*3)),c.set(this.uvs.slice(0,this.size*2)),this.buffer=n,this.positions=a,this.normals=l,this.uvs=c,this.capacity=e}get(e=1){let t=this.size+e;if(t>this.capacity){let n=this.capacity;for(;t>n;)n*=2;this.realloc(n)}let r=this.size;return this.size=t,r}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Wh=fp;Wh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var av=(i,e)=>([t,r])=>(r<t&&(r+=e),(i>=t?i:i+e)<=r),Bl=class extends De{constructor(t,r,n=0,s=12,o=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=t,this._depth=r,this._bevel=n,this._curveSegments=s,this._bevelSegmentsInput=o,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,r/2-1e-12),this._bevelSegments=Math.floor(o));let a=this._shape.extractShapePointsToFlatArray([],s),l=this._shape.shapeHoles.map(A=>{let x=A.extractShapePointsToFlatArray([],s),_=[];for(let E=x.length-1;E>=1;E-=2){let C=x[E-1],I=x[E-0];_.push(C,I)}return _}),c=Xo({windingRule:Zt.ODD,elementType:Tr.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[a]}),h=Xo({windingRule:Zt.ODD,elementType:Tr.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...l]});if(!c)throw new Error("error generating geometry");let u=c.elementCount;if(h){c.elementCount+=h.elementCount;for(let A=0;A<h.elements.length;A++){let x=h.elements[A],_=A%2===0?c.vertexCount:0;c.elements.push(x+_)}for(let A=0;A<h.vertexIndices.length;A++){let x=h.vertexIndices[A],_=c.vertexCount;c.vertexIndices.push(x+_)}for(let A=0;A<h.vertices.length;A++){let x=h.vertices[A];c.vertices.push(x)}}let f=1/0,d=-1/0,p=1/0,m=-1/0;for(let A=0,x=c.vertexCount;A<x;A++){let _=A*2,E=c.vertices[_+0],C=c.vertices[_+1];E<f&&(f=E),E>d&&(d=E),C<p&&(p=C),C>m&&(m=C)}this._minX=f,this._minY=p,this._width=d-f,this._height=m-p;let g=c.vertexCount*2*(2+this._bevelSegments);this._buffer=new Wh(g);let v=[],y=[];for(let A=c.elementCount-1;A>=0;A--){let x=A>=u,_=A*2,E=c.elements[_+0],C=c.elements[_+1],I=E+C,N={start:E,count:C,normals:[],continuous:[],concave:[]},R=E,k=I-1,G=E+1,K=this._shape.roundedCurves.length;do{let U=R-E,O=c.vertices[k*2+0],j=c.vertices[k*2+1],H=c.vertices[R*2+0],X=c.vertices[R*2+1],V=c.vertices[G*2+0],he=c.vertices[G*2+1],ie=H-O,le=X-j,q=Math.sqrt(ie*ie+le*le);ie/=q,le/=q;let ue=H-V,Z=X-he,W=Math.sqrt(ue*ue+Z*Z);ue/=W,Z/=W,N.normals[U*2+0]=-Z,N.normals[U*2+1]=ue,N.concave[U]=ie*Z-le*ue>0;let $=c.vertexIndices[R];if(Array.isArray($))N.continuous[U]=!1;else{let[ce,oe]=this._shape.getCurveIndexFromVertexId($-1,!0);if(oe>0&&oe<1)N.continuous[U]=!0;else{let me=oe===1?ce+1:ce-1;me=(me+K)%K;let ve=oe===1?0:1,ge=this._shape.roundedCurves[ce].getTangent(oe),Le=this._shape.roundedCurves[me].getTangent(ve);N.continuous[U]=ge.dot(Le)>.95}}x&&(N.normals[U*2+0]*=-1,N.normals[U*2+1]*=-1),[k,R,G]=[R,G,G+1],G>=I&&(G-=C)}while(G!==E+1);let J=[];J.push({bevelI:0,angle:0,size:0,boundary:{vertices:c.vertices.slice(E*2,I*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((U,O)=>[O,O]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:c.vertices.slice(E*2,I*2)});for(let U=1;U<=this._bevelSegments;U++){let O=U/this._bevelSegments*Math.PI/2,j=(1-Math.cos(O))*this._bevelSize,H=[],X=[],V=[],he=[],ie=0;for(let q=0;q<C;q++){let ue=q*2,Z=(q-1+C)%C*2,W=c.vertices[N.start*2+ue+0],$=c.vertices[N.start*2+ue+1],ce=-N.normals[Z+0]*j,oe=-N.normals[Z+1]*j,me=-N.normals[ue+0]*j,ve=-N.normals[ue+1]*j;if(N.concave[q]||!N.concave[q]&&x){let ge=Math.atan2(oe,ce),Le=Math.atan2(ve,me);Le>ge&&(Le-=Math.PI*2);let ke=Le-ge;if(N.continuous[q]||x){let L=ge+ke/2,P=Math.cos(L)*j,re=Math.sin(L)*j;H[2*ie+0]=W+P*(x?-1:1),H[2*ie+1]=$+re*(x?-1:1),he[ie]=q,ie++}else{let L=Math.max(1,Math.floor(s/4*Math.abs(ke)/Math.PI));for(let P=0;P<=L;P++){let re=ge+ke*(P/L),ye=Math.cos(re)*j,Se=Math.sin(re)*j;H[2*ie+0]=W+ye,H[2*ie+1]=$+Se,he[ie]=q,ie++}}}else H[2*ie+0]=W+ce,H[2*ie+1]=$+oe,he[ie]=q,X[q]=ie,ie++,H[2*ie+0]=W,H[2*ie+1]=$,he[ie]=q,ie++,H[2*ie+0]=W+me,H[2*ie+1]=$+ve,he[ie]=q,V[q]=ie,ie++}let le=Xo({windingRule:Zt.POSITIVE,elementType:Tr.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[H],edgeCreateCallback:q=>{let Z=q.Org.idx,W=he[Z],$=he[(Z+1)%he.length];q.idx=[W,$],q.Sym.idx=[$,W]},vertexIdCallback:q=>{let ue=q.Lprev.idx;return[ue?ue[1]:0,q.idx[0]]}});if(!le)throw console.log("Error"),new Error(`error generating bevel geometry for ${U}'th loop`);if(!le.vertexCount)break;for(let q=0;q<le.vertexIndices.length;q++){let[ue,Z]=le.vertexIndices[q];if(ue===Z)continue;let W=Z;Z<ue&&(W+=C);for(let $=ue;$<W;$++){let ce=$%C,oe=($+1)%C;if(!N.continuous[ce]||!N.continuous[oe]){le.vertexIndices[q]=[ue,ce],le.vertexIndices.splice(q+1,0,[oe,Z]),le.vertices.splice((q+1)*2,0,le.vertices[q*2],le.vertices[q*2+1]);break}}}J.push({bevelI:U,angle:O,size:j,boundary:le,reverseMap:he,insetPoints:H})}let Y=(U,O,j)=>{let H=0,X=U.boundary.vertexIndices.length;for(;H<X&&j(U.boundary.vertexIndices[O]);)O=(O+1)%X,H++;return H},F=v.length;for(let U=1;U<J.length;U++){let O=J[U-1],j=J[U],H=O.boundary.vertexIndices.length,X=j.boundary.vertexIndices.length;if(!H||!X)break;let V=N.concave.length,he=0,ie=av(he,C);for(;!O.boundary.vertexIndices.filter(ie).length||!j.boundary.vertexIndices.filter(ie).length;)he++,ie=av(he,C);let le=O.boundary.vertexIndices.findIndex(ie),q=j.boundary.vertexIndices.findIndex(ie);do le=(le+1)%H;while(ie(O.boundary.vertexIndices[le]));do q=(q+1)%X;while(ie(j.boundary.vertexIndices[q]));he=(he+1)%C;let ue=he,Z=this.buildBevelVert(N,O,(le-1+H)%H),W=this.buildBevelVert(N,j,(q-1+X)%X),$=Z,ce=W,oe,me,ve=!1;do{ie=av(he,C);let ge=Y(O,le,ie),Le=Y(j,q,ie),ke=ve;if(ve=!1,ge&&!Le){for(let L=0;L<ge;L++)oe=this.buildBevelVert(N,O,(le+L)%H,L/(ge-1)),v.push($.topN,oe.topP,ce.topN),v.push(oe.bottomP,$.bottomN,ce.bottomN),$=oe;ve=!0}else if(!ge&&Le)for(let L=0;L<Le;L++)me=this.buildBevelVert(N,j,(q+L)%X,L/(Le-1)),v.push(ce.topN,$.topP,me.topP),v.push($.bottomP,ce.bottomN,me.bottomP),ce=me;else if(ge&&Le)if(oe=this.buildBevelVert(N,O,le,0),me=this.buildBevelVert(N,j,q,0),ke?(v.push($.topN,me.topP,ce.topN),v.push($.topN,oe.topP,me.topP),v.push(me.bottomP,$.bottomN,ce.bottomN),v.push(me.bottomP,oe.bottomP,$.bottomN)):(v.push(ce.topN,$.topN,oe.topP),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,$.bottomN,ce.bottomN),v.push(oe.bottomP,ce.bottomN,me.bottomP)),$=oe,ce=me,ge===Le)for(let L=1;L<ge;L++)oe=this.buildBevelVert(N,O,(le+L)%H,L/(ge-1)),me=this.buildBevelVert(N,j,(q+L)%X,L/(Le-1)),v.push($.topN,oe.topP,ce.topN),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,$.bottomN,ce.bottomN),v.push(oe.bottomP,ce.bottomN,me.bottomP),$=oe,ce=me;else if(ge>Le){let L=ge/Le,P=0;for(let re=1;re<ge;re++)oe=this.buildBevelVert(N,O,(le+re)%H,re/(ge-1)),v.push($.topN,oe.topP,ce.topN),v.push(oe.bottomP,$.bottomN,ce.bottomN),$=oe,re>(P+1)*L&&(P++,me=this.buildBevelVert(N,j,(q+P)%X,P/(Le-1)),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,ce.bottomN,me.bottomP),ce=me)}else{let L=Le/ge,P=0;for(let re=1;re<Le;re++)me=this.buildBevelVert(N,j,(q+re)%X,re/(Le-1)),v.push(ce.topN,oe.topP,me.topP),v.push(oe.bottomP,ce.bottomN,me.bottomP),ce=me,re>(P+1)*L&&(P++,oe=this.buildBevelVert(N,O,(le+P)%H,P/(ge-1)),v.push($.topN,oe.topP,ce.topN),v.push(oe.bottomP,$.bottomN,ce.bottomN),$=oe)}le=(le+ge)%H,q=(q+Le)%X,he=(he+1)%V}while(he!==ue)}{let U=J[0];for(let O=0,j=U.boundary.vertexCount;O<j;O++){let H=this.buildBevelVert(N,U,O),X=this.buildBevelVert(N,U,(O+1)%j);v.push(X.topP,H.topN,H.bottomN),v.push(X.topP,H.bottomN,X.bottomP)}}if(x){let U=[];for(let O=v.length-1;O>=F+2;O-=3){let j=v[O-2],H=v[O-1],X=v[O-0];U.push(X,H,j)}v.splice(F,v.length-F,...U)}if(x){let U=[];for(let O=J[J.length-1].boundary.vertices.length-1;O>=1;O-=2){let j=J[J.length-1].boundary.vertices[O-1],H=J[J.length-1].boundary.vertices[O-0];U.push(j,H)}y.push(U)}if(!x){let U=J[J.length-1],O=Xo({windingRule:J.length>1?Zt.POSITIVE:Zt.ODD,elementType:Tr.POLYGONS,vertexSize:2,strict:!0,contours:[U.insetPoints,...y]});if(!O)throw new Error("Error generating geometry for surface");Object.assign(this,{capStartIndex:v.length});for(let j=0;j<O.elementCount*3;j+=3){let H=this.buildSurfaceVert(O,O.elements[j+0]),X=this.buildSurfaceVert(O,O.elements[j+1]),V=this.buildSurfaceVert(O,O.elements[j+2]);v.push(H.top,X.top,V.top),v.push(V.bottom,X.bottom,H.bottom)}}this.vertexCache={}}this._buffer.shrink();let w=new Ve(Uint32Array.from(v),1),b=new Ve(this._buffer.positions,3),S=new Ve(this._buffer.normals,3),T=new Ve(this._buffer.uvs,2);b.needsUpdate=!0,S.needsUpdate=!0,T.needsUpdate=!0,w.needsUpdate=!0,this.setAttribute("position",b),this.setAttribute("normal",S),this.setAttribute("uv",T),this.setIndex(w)}buildSurfaceVert(t,r){let n=r.toString();if(n in this.vertexCache)return this.vertexCache[n];let s=t.vertices[r*2+0],o=t.vertices[r*2+1],a=(s-this._minX)/this._width,l=(o-this._minY)/this._height,c=this._buffer.get(2),h=c*3,u=c*2,f={top:c+0,bottom:c+1};return this._buffer.positions[h+0]=s,this._buffer.positions[h+1]=o,this._buffer.positions[h+2]=this._depth,this._buffer.normals[h+0]=0,this._buffer.normals[h+1]=0,this._buffer.normals[h+2]=1,this._buffer.uvs[u+0]=a,this._buffer.uvs[u+1]=l,this._buffer.positions[h+3]=s,this._buffer.positions[h+4]=o,this._buffer.positions[h+5]=0,this._buffer.normals[h+3]=0,this._buffer.normals[h+4]=0,this._buffer.normals[h+5]=-1,this._buffer.uvs[u+2]=a,this._buffer.uvs[u+3]=l,this.vertexCache[n]=f,f}buildBevelVert(t,r,n,s=1){let o=`${r.bevelI}:${n}`;if(o in this.vertexCache)return this.vertexCache[o];let[a,l]=r.boundary.vertexIndices[n],c,h,u,f;a!==l?(h=a,c=l,f=!1,u=t.continuous[h]&&t.continuous[c]):(c=a,h=(c-1+t.count)%t.count,f=t.concave[c]&&r.bevelI>0,u=t.continuous[c]||f);let d=Math.cos(r.angle),p=Math.sin(r.angle),m=n*2,g=c*2,v=h*2,y=r.boundary.vertices[m+0],w=r.boundary.vertices[m+1],b=(1-p)*this._bevelSize,S=(y-this._minX)/this._width,T=(w-this._minY)/this._height,A=t.normals[g+0],x=t.normals[g+1],_=t.normals[v+0],E=t.normals[v+1];if(f){let k=_-A,G=E-x;A=A+k*(1-s),x=x+G*(1-s);let K=Math.sqrt(A*A+x*x);A/=K,x/=K}let C=this._buffer.get(u?2:4),I=C*3,N=C*2,R={i:n,fi:c,topP:C+0,topN:C+0,bottomP:C+1,bottomN:C+1};return this._buffer.positions[I+0]=y,this._buffer.positions[I+1]=w,this._buffer.positions[I+2]=this._depth-b,this._buffer.normals[I+0]=A*d,this._buffer.normals[I+1]=x*d,this._buffer.normals[I+2]=p,this._buffer.uvs[N+0]=S,this._buffer.uvs[N+1]=T,this._buffer.positions[I+3]=y,this._buffer.positions[I+4]=w,this._buffer.positions[I+5]=b,this._buffer.normals[I+3]=A*d,this._buffer.normals[I+4]=x*d,this._buffer.normals[I+5]=-p,this._buffer.uvs[N+2]=T,this._buffer.uvs[N+3]=S,u||(C+=2,I+=6,N+=4,R.topP=C+0,R.bottomP=C+1,this._buffer.positions[I+0]=y,this._buffer.positions[I+1]=w,this._buffer.positions[I+2]=this._depth-b,this._buffer.normals[I+0]=_*d,this._buffer.normals[I+1]=E*d,this._buffer.normals[I+2]=p,this._buffer.uvs[N+0]=S,this._buffer.uvs[N+1]=T,this._buffer.positions[I+3]=y,this._buffer.positions[I+4]=w,this._buffer.positions[I+5]=b,this._buffer.normals[I+3]=_*d,this._buffer.normals[I+4]=E*d,this._buffer.normals[I+5]=-p,this._buffer.uvs[N+2]=T,this._buffer.uvs[N+3]=S),this.vertexCache[o]=R,R}clone(){let t=new Bl(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegmentsInput);return t.userData=Mh(this.userData),t}};var Hr=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var c,h,u,f,d,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3},i.parameters),r=Math.abs(t.width),n=Math.abs((h=t.height)!=null?h:t.width),s=Math.abs((u=t.depth)!=null?u:0),o=(f=i.shape)!=null?f:e==null?void 0:e.shape,a=(d=o==null?void 0:o.roundness)!=null?d:t.roundness;o!==void 0&&(o instanceof Tt?(o.width!==r||o.height!==n)&&o.applySize(r,n):o=new Tt(r,n).fromJSON(o),((p=i.parameters)==null?void 0:p.roundness)!==void 0&&((m=i.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Tt(r,n);return{parameters:Object.assign(t,{width:r,height:n,depth:s,roundness:a}),shape:l}}static build(i){let{depth:e,extrudeBevelSize:t,extrudeBevelSegments:r,subdivisions:n,roundness:s}=i.parameters;i.shape.roundness=s;let o;return e<=0?o=new Rl(i.shape,n):o=new Bl(i.shape,e,t,n,r),Object.assign(o,{userData:xe(se({},i),{type:"VectorGeometry"})})}};var f1=Math.PI*2,d1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,spikes:64,angle:360,innerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e,height:t,spikes:r,angle:n,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}=i.parameters,c=i.shape,h=e*.5,u=t*.5,f=lF(c,h,u,n*Math.PI/180,r,s);c.isClosed=!0,c.update();let d=Hr.create({shape:c,parameters:{subdivisions:f,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(d,{userData:xe(se({},i),{type:"EllipseGeometry"})})}};function lF(i,e,t,r,n,s){if(r>=f1)return n>30||n%4===0?(hF(i,e,t,s),Math.round(n/4)):u1(i,r,n,e,t,s);let o={x:0,y:t},a=r+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=o1({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:r>Math.PI,sweepFlag:!0});return n>30||n%c.length===0?cF(i,o.x,o.y,c,n,e,t,s):u1(i,r,n,e,t,s)}function cF(i,e,t,r,n,s,o,a){let l=Math.round(n/r.length);i.addPoint(Nl(e,t));for(let c=0,h=r.length;c<h;c++){let u=r[c],f=i.points[c],d=Nl(u.x,u.y);f.controls[1].position.set(u.x1,u.y1),d.controls[0].position.set(u.x2,u.y2),i.addPoint(d)}return a>0?p1(i,s,o,a):i.addPoint(Nl(0,0)),l}function u1(i,e,t,r,n,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*r,h=Math.cos(l)*n;i.addPoint(Nl(c,h))}return e<f1?s>0?p1(i,r,n,s):i.addPoint(Nl(0,0)):(i.removePoint(i.points[i.points.length-1]),s>0&&m1(i,r,n,s)),1}function hF(i,e,t,r=0,n=0,s=0){let o=.5522847498,a=e*o,l=t*o;i.addPoint(dp(n-e,s,n-e,s-l,n-e,s+l)),i.addPoint(dp(n,s+t,n-a,s+t,n+a,s+t)),i.addPoint(dp(n+e,s,n+e,s+l,n+e,s-l)),i.addPoint(dp(n,s-t,n+a,s-t,n-a,s-t)),r>0&&m1(i,e,t,r)}function Nl(i,e){return new fi(et.generateUUID(),new B(i,e))}function dp(i,e,t,r,n,s){let o=Nl(i,e);return o.controls[0].position.set(t,r),o.controls[1].position.set(n,s),o}function p1(i,e,t,r){g1(i,e,t,r).forEach(s=>i.addPoint(s))}function m1(i,e,t,r){let n=g1(i,e,t,r),s=new Tt;n.forEach(o=>s.addPoint(o)),s.isClosed=!0,i.shapeHoles.push(s)}function g1(i,e,t,r){let n=r*e/100,s=n*(Math.abs(t)/Math.abs(e)),o=new B(n/e,s/t),a=i.points.map(l=>{let c=l.clone();return c.uuid=et.generateUUID(),c}).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),h=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(h),l.controls[1].position.copy(c)}),a}var y1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},i.parameters),r=Math.abs(t.width),n=Math.abs((l=t.height)!=null?l:r),s=Math.abs((c=t.depth)!=null?c:r),o=Math.abs(Math.min(r,s))/2;return{parameters:Object.assign(t,{width:r,height:n,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(i){let{width:e,height:t,depth:r,radius:n,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:h,cornerSegments:u}=i.parameters,f=new jh(!1,e,t,r,n,s,o,a,l,c,h,u);return Object.assign(f,{userData:xe(se({},i),{type:"HelixGeometry"})})}},jh=class extends De{constructor(e=!0,t=1,r=1,n=1,s=1,o=1,a=1,l=1,c=1,h=1,u=1,f=1){super();let d=e&&o===1;d&&(f=0),u>100&&(u=100);let p=()=>new M,m=new M,g=p(),v=p(),y=p(),w,b,S,T,A,x,_,E,C=p(),I=p(),N=p(),R=p(),k=p(),G=p(),K=p(),J=p(),Y=r-2*l+.001,F=Y/o,U=Math.ceil(a*o),O=U+1,j=Y/U,H=-Y/2,X=h+1,V=2*Math.PI/h,he=Math.PI/2/f,ie=.01,le=Math.min((1-u/100)*l,l-ie),q=l-le,ue=0,Z=2,W=f*Z+Z,$=X*W/Z,ce=$+X*O,oe=X*(O+W),[me,ve,ge]=[3,3,2].map(Ee=>Array(oe*Ee).fill(0)),Le=[],ke=s-l;function L(Ee,z){let Me=Math.PI/2;x=z*j,E=2*Math.PI*(x%F)/F+Me,x+=H,_=Math.sin(E)*ke,A=Math.cos(E)*ke,e?Ee.set(A,_,x):Ee.set(A,x,_)}L(m,-1e-10),L(g,0),C.copy(m),L(m,1);let P=m.distanceTo(g),re=q+le,ye=P*U+2*re,Se=le,Ie=ye-re;for(let Ee=0;Ee<=U;Ee++){L(v,Ee),J.subVectors(v,C).normalize(),C.copy(v),G.copy(v).setComponent(+e+1,0).normalize(),K.crossVectors(J,G).normalize();let z=Ee===0,Me=Ee===U,Pe=z?3*Math.PI/2:he,Ze=z?Se:Ie,Oe=z?X:ce,Qe=z?0:oe-X,_e=J.clone().multiplyScalar(z?-q:q).add(v),$e=J.clone().multiplyScalar(z?-1:1).normalize();for(let lt=0;lt<X;lt++){let dt=lt*V;if(I.addVectors(m.copy(G).multiplyScalar(l*Math.cos(dt)),g.copy(K).multiplyScalar(l*Math.sin(dt))),N.copy(I).normalize(),z||Me){d||(ue=Qe+lt,[0,1,2].forEach(Ut=>{me[ue*3+Ut]=_e.getComponent(Ut),ve[ue*3+Ut]=$e.getComponent(Ut)}),ge[ue*2]=+Me,ge[ue*2+1]=lt/h),g.copy(N).multiplyScalar(le),y.addVectors(v,g);for(let Ut=0;Ut<f;Ut++){let Ur=Ut*he+Pe;R.addVectors(m.copy(J).multiplyScalar(q*Math.sin(Ur)),g.copy(N).multiplyScalar(q*Math.cos(Ur))),k.copy(R).normalize(),g.addVectors(y,R),R.normalize(),ue=Oe+Ut*X+lt,[0,1,2].forEach(Nn=>{me[ue*3+Nn]=g.getComponent(Nn),ve[ue*3+Nn]=k.getComponent(Nn)});let ia=+z+Math.sin(Ur);ge[ue*2]=(Ze+q*ia)/ye,ge[ue*2+1]=lt/h}}g.addVectors(v,I),ue=$+Ee*X+lt,[0,1,2].forEach(Ut=>{me[ue*3+Ut]=g.getComponent(Ut),ve[ue*3+Ut]=N.getComponent(Ut)}),ge[ue*2]=(re+Ee*P)/ye,ge[ue*2+1]=lt/h}}let Fe=O+2*f+Z,fe=1,[rt,st]=d?[fe,fe+O-1]:[0,Fe-1];for(let Ee=rt;Ee<=st-1;Ee++){let z=d&&Ee===st-1;for(let Me=0;Me<X-1;Me++)w=Ee*X+Me,b=w+1,S=(z?Me:w)+X,T=(z?Me+1:b)+X,Ee===0?Le.push(b,T,S):Ee===Fe-2?Le.push(w,b,S):Le.push(w,b,S,b,T,S)}this.setIndex(Le),this.setAttribute("position",new Te(me,3)),this.setAttribute("normal",new Te(ve,3)),this.setAttribute("uv",new Te(ge,2))}};var v1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,detail:0,corner:0,cornerSides:4},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,detail:n,corner:s,cornerSides:o}=i.parameters,a=n===0&&s!==0?new qh(e*.5,s,o):new Va(e*.5,n);return a.scale(1,t/e,r/e),Object.assign(a,{userData:xe(se({},i),{type:"IcosahedronGeometry"})})}},qh=class extends oo{constructor(e=1,t=.2,r=4){let n=(1+Math.sqrt(5))/2,s=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],o=[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],a="IcosahedronGeometry";super(s,o,a,e,t,r),this.type=a}static fromJSON(e){return new qh(e.radius,e.corner,e.cornerSides)}};var x1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s,o,a;((n=(r=i.parameters)==null?void 0:r.points)!=null?n:[]).forEach(l=>{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(i){let{points:e,segments:t,verticalSegments:r}=i.parameters,n=new rn;n.moveTo(e[0].x,e[0].y),n.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new Ua(n.extractPoints(r).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:xe(se({},i),{type:"LatheGeometry"})})}};var Oi=new Ae,lv=new ot,pp=new M,lo=class extends Yt{constructor(){super(),this.uuid=et.generateUUID(),this.name="",this.type="Geometry",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.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Ft().getNormalMatrix(e);for(let r=0,n=this.vertices.length;r<n;r++)this.vertices[r].applyMatrix4(e);for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r];s.normal.applyMatrix3(t).normalize();for(let o=0,a=s.vertexNormals.length;o<a;o++)s.vertexNormals[o].applyMatrix3(t).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(e){return Oi.makeRotationX(e),this.applyMatrix4(Oi),this}rotateY(e){return Oi.makeRotationY(e),this.applyMatrix4(Oi),this}rotateZ(e){return Oi.makeRotationZ(e),this.applyMatrix4(Oi),this}translate(e,t,r){return Oi.makeTranslation(e,t,r),this.applyMatrix4(Oi),this}scale(e,t,r){return Oi.makeScale(e,t,r),this.applyMatrix4(Oi),this}lookAt(e){return lv.lookAt(e),lv.updateMatrix(),this.applyMatrix4(lv.matrix),this}fromBufferGeometry(e){let t=this,r=e.index!==null?e.index:void 0,n=e.attributes;if(n.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;let s=n.position,o=n.normal,a=n.color,l=n.uv,c=n.uv2;c!==void 0&&(this.faceVertexUvs[1]=[]);for(let f=0;f<s.count;f++)t.vertices.push(new M().fromBufferAttribute(s,f)),a!==void 0&&t.colors.push(new be().fromBufferAttribute(a,f));function h(f,d,p,m){let g=a===void 0?[]:[t.colors[f].clone(),t.colors[d].clone(),t.colors[p].clone()],v=o===void 0?[]:[new M().fromBufferAttribute(o,f),new M().fromBufferAttribute(o,d),new M().fromBufferAttribute(o,p)],y=new Ol(f,d,p,v,g,m);t.faces.push(y),l!==void 0&&t.faceVertexUvs[0].push([new B().fromBufferAttribute(l,f),new B().fromBufferAttribute(l,d),new B().fromBufferAttribute(l,p)]),c!==void 0&&t.faceVertexUvs[1].push([new B().fromBufferAttribute(c,f),new B().fromBufferAttribute(c,d),new B().fromBufferAttribute(c,p)])}let u=e.groups;if(u.length>0)for(let f=0;f<u.length;f++){let d=u[f],p=d.start,m=d.count;for(let g=p,v=p+m;g<v;g+=3)r!==void 0?h(r.getX(g),r.getX(g+1),r.getX(g+2),d.materialIndex):h(g,g+1,g+2,d.materialIndex)}else if(r!==void 0)for(let f=0;f<r.count;f+=3)h(r.getX(f),r.getX(f+1),r.getX(f+2));else for(let f=0;f<s.count;f+=3)h(f,f+1,f+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pp).negate(),this.translate(pp.x,pp.y,pp.z),this}normalize(){this.computeBoundingSphere();let e=this.boundingSphere.center,t=this.boundingSphere.radius,r=t===0?1:1/t,n=new Ae;return n.set(r,0,0,-r*e.x,0,r,0,-r*e.y,0,0,r,-r*e.z,0,0,0,1),this.applyMatrix4(n),this}computeFaceNormals(){let e=new M,t=new M;for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r],o=this.vertices[s.a],a=this.vertices[s.b],l=this.vertices[s.c];e.subVectors(l,a),t.subVectors(o,a),e.cross(t),e.normalize(),s.normal.copy(e)}}computeVertexNormals(e=!0){let t=new Array(this.vertices.length);for(let r=0,n=this.vertices.length;r<n;r++)t[r]=new M;if(e){let r=new M,n=new M;for(let s=0,o=this.faces.length;s<o;s++){let a=this.faces[s],l=this.vertices[a.a],c=this.vertices[a.b],h=this.vertices[a.c];r.subVectors(h,c),n.subVectors(l,c),r.cross(n),t[a.a].add(r),t[a.b].add(r),t[a.c].add(r)}}else{this.computeFaceNormals();for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r];t[s.a].add(s.normal),t[s.b].add(s.normal),t[s.c].add(s.normal)}}for(let r=0,n=this.vertices.length;r<n;r++)t[r].normalize();for(let r=0,n=this.faces.length;r<n;r++){let s=this.faces[r],o=s.vertexNormals;o.length===3?(o[0].copy(t[s.a]),o[1].copy(t[s.b]),o[2].copy(t[s.c])):(o[0]=t[s.a].clone(),o[1]=t[s.b].clone(),o[2]=t[s.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e<t;e++){let r=this.faces[e],n=r.vertexNormals;n.length===3?(n[0].copy(r.normal),n[1].copy(r.normal),n[2].copy(r.normal)):(n[0]=r.normal.clone(),n[1]=r.normal.clone(),n[2]=r.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,r=this.faces.length;t<r;t++){let n=this.faces[t];n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(let s=0,o=n.vertexNormals.length;s<o;s++)n.__originalVertexNormals[s]?n.__originalVertexNormals[s].copy(n.vertexNormals[s]):n.__originalVertexNormals[s]=n.vertexNormals[s].clone()}let e=new lo;e.faces=this.faces;for(let t=0,r=this.morphTargets.length;t<r;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];let s=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals;for(let a=0,l=this.faces.length;a<l;a++){let c=new M,h={a:new M,b:new M,c:new M};s.push(c),o.push(h)}}let n=this.morphNormals[t];e.vertices=this.morphTargets[t].vertices,e.computeFaceNormals(),e.computeVertexNormals();for(let s=0,o=this.faces.length;s<o;s++){let a=this.faces[s],l=n.faceNormals[s],c=n.vertexNormals[s];l.copy(a.normal),c.a.copy(a.vertexNormals[0]),c.b.copy(a.vertexNormals[1]),c.c.copy(a.vertexNormals[2])}}for(let t=0,r=this.faces.length;t<r;t++){let n=this.faces[t];n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals}}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Kt),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Lr),this.boundingSphere.setFromPoints(this.vertices)}merge(e,t,r=0){if(!(e&&e.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}let n,s=this.vertices.length,o=this.vertices,a=e.vertices,l=this.faces,c=e.faces,h=this.colors,u=e.colors;t!==void 0&&(n=new Ft().getNormalMatrix(t));for(let f=0,d=a.length;f<d;f++){let m=a[f].clone();t!==void 0&&m.applyMatrix4(t),o.push(m)}for(let f=0,d=u.length;f<d;f++)h.push(u[f].clone());for(let f=0,d=c.length;f<d;f++){let p=c[f],m,g,v=p.vertexNormals,y=p.vertexColors,w=new Ol(p.a+s,p.b+s,p.c+s);w.normal.copy(p.normal),n!==void 0&&w.normal.applyMatrix3(n).normalize();for(let b=0,S=v.length;b<S;b++)m=v[b].clone(),n!==void 0&&m.applyMatrix3(n).normalize(),w.vertexNormals.push(m);w.color.copy(p.color);for(let b=0,S=y.length;b<S;b++)g=y[b],w.vertexColors.push(g.clone());w.materialIndex=p.materialIndex+r,l.push(w)}for(let f=0,d=e.faceVertexUvs.length;f<d;f++){let p=e.faceVertexUvs[f];this.faceVertexUvs[f]===void 0&&(this.faceVertexUvs[f]=[]);for(let m=0,g=p.length;m<g;m++){let v=p[m],y=[];for(let w=0,b=v.length;w<b;w++)y.push(v[w].clone());this.faceVertexUvs[f].push(y)}}}mergeMesh(e){if(!(e&&e.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)}mergeVertices(e=4){let t={},r=[],n=[],s=Math.pow(10,e);for(let l=0,c=this.vertices.length;l<c;l++){let h=this.vertices[l],u=Math.round(h.x*s)+"_"+Math.round(h.y*s)+"_"+Math.round(h.z*s);t[u]===void 0?(t[u]=l,r.push(this.vertices[l]),n[l]=r.length-1):n[l]=n[t[u]]}let o=[];for(let l=0,c=this.faces.length;l<c;l++){let h=this.faces[l];h.a=n[h.a],h.b=n[h.b],h.c=n[h.c];let u=[h.a,h.b,h.c];for(let f=0;f<3;f++)if(u[f]===u[(f+1)%3]){o.push(l);break}}for(let l=o.length-1;l>=0;l--){let c=o[l];this.faces.splice(c,1);for(let h=0,u=this.faceVertexUvs.length;h<u;h++)this.faceVertexUvs[h].splice(c,1)}let a=this.vertices.length-r.length;return this.vertices=r,a}setFromPoints(e){this.vertices=[];for(let t=0,r=e.length;t<r;t++){let n=e[t];this.vertices.push(new M(n.x,n.y,n.z||0))}return this}sortFacesByMaterialIndex(){let e=this.faces,t=e.length;for(let l=0;l<t;l++)e[l]._id=l;function r(l,c){return l.materialIndex-c.materialIndex}e.sort(r);let n=this.faceVertexUvs[0],s=this.faceVertexUvs[1],o,a;n&&n.length===t&&(o=[]),s&&s.length===t&&(a=[]);for(let l=0;l<t;l++){let c=e[l]._id;o&&o.push(n[c]),a&&a.push(s[c])}o&&(this.faceVertexUvs[0]=o),a&&(this.faceVertexUvs[1]=a)}toJSON(){let e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),this.parameters!==void 0){let p=this.parameters;for(let m in p)p[m]!==void 0&&(e[m]=p[m]);return e}let t=[];for(let p=0;p<this.vertices.length;p++){let m=this.vertices[p];t.push(m.x,m.y,m.z)}let r=[],n=[],s={},o=[],a={},l=[],c={};for(let p=0;p<this.faces.length;p++){let m=this.faces[p],g=!0,v=!1,y=this.faceVertexUvs[0][p]!==void 0,w=m.normal.length()>0,b=m.vertexNormals.length>0,S=m.color.r!==1||m.color.g!==1||m.color.b!==1,T=m.vertexColors.length>0,A=0;if(A=h(A,0,0),A=h(A,1,g),A=h(A,2,v),A=h(A,3,y),A=h(A,4,w),A=h(A,5,b),A=h(A,6,S),A=h(A,7,T),r.push(A),r.push(m.a,m.b,m.c),r.push(m.materialIndex),y){let x=this.faceVertexUvs[0][p];r.push(d(x[0]),d(x[1]),d(x[2]))}if(w&&r.push(u(m.normal)),b){let x=m.vertexNormals;r.push(u(x[0]),u(x[1]),u(x[2]))}if(S&&r.push(f(m.color)),T){let x=m.vertexColors;r.push(f(x[0]),f(x[1]),f(x[2]))}}function h(p,m,g){return g?p|1<<m:p&~(1<<m)}function u(p){let m=p.x.toString()+p.y.toString()+p.z.toString();return s[m]!==void 0||(s[m]=n.length/3,n.push(p.x,p.y,p.z)),s[m]}function f(p){let m=p.r.toString()+p.g.toString()+p.b.toString();return a[m]!==void 0||(a[m]=o.length,o.push(p.getHex())),a[m]}function d(p){let m=p.x.toString()+p.y.toString();return c[m]!==void 0||(c[m]=l.length/2,l.push(p.x,p.y)),c[m]}return e.data={},e.data.vertices=t,e.data.normals=n,o.length>0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=r,e}clone(){return new lo().copy(this)}copy(e){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=e.name;let t=e.vertices;for(let f=0,d=t.length;f<d;f++)this.vertices.push(t[f].clone());let r=e.colors;for(let f=0,d=r.length;f<d;f++)this.colors.push(r[f].clone());let n=e.faces;for(let f=0,d=n.length;f<d;f++)this.faces.push(n[f].clone());for(let f=0,d=e.faceVertexUvs.length;f<d;f++){let p=e.faceVertexUvs[f];this.faceVertexUvs[f]===void 0&&(this.faceVertexUvs[f]=[]);for(let m=0,g=p.length;m<g;m++){let v=p[m],y=[];for(let w=0,b=v.length;w<b;w++){let S=v[w];y.push(S.clone())}this.faceVertexUvs[f].push(y)}}let s=e.morphTargets;for(let f=0,d=s.length;f<d;f++){let p={};if(p.name=s[f].name,s[f].vertices!==void 0){p.vertices=[];for(let m=0,g=s[f].vertices.length;m<g;m++)p.vertices.push(s[f].vertices[m].clone())}if(s[f].normals!==void 0){p.normals=[];for(let m=0,g=s[f].normals.length;m<g;m++)p.normals.push(s[f].normals[m].clone())}this.morphTargets.push(p)}let o=e.morphNormals;for(let f=0,d=o.length;f<d;f++){let p={};if(o[f].vertexNormals!==void 0){p.vertexNormals=[];for(let m=0,g=o[f].vertexNormals.length;m<g;m++){let v=o[f].vertexNormals[m],y={};y.a=v.a.clone(),y.b=v.b.clone(),y.c=v.c.clone(),p.vertexNormals.push(y)}}if(o[f].faceNormals!==void 0){p.faceNormals=[];for(let m=0,g=o[f].faceNormals.length;m<g;m++)p.faceNormals.push(o[f].faceNormals[m].clone())}this.morphNormals.push(p)}let a=e.skinWeights;for(let f=0,d=a.length;f<d;f++)this.skinWeights.push(a[f].clone());let l=e.skinIndices;for(let f=0,d=l.length;f<d;f++)this.skinIndices.push(l[f].clone());let c=e.lineDistances;for(let f=0,d=c.length;f<d;f++)this.lineDistances.push(c[f]);let h=e.boundingBox;h!==null&&(this.boundingBox=h.clone());let u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}toBufferGeometry(){let e=new cv().fromGeometry(this),t=new De,r=new Float32Array(e.vertices.length*3);if(t.setAttribute("position",new Ve(r,3).copyVector3sArray(e.vertices)),e.normals.length>0){let n=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Ve(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let n=new Float32Array(e.colors.length*3);t.setAttribute("color",new Ve(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let n=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Ve(n,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let n=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Ve(n,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let n in e.morphTargets){let s=[],o=e.morphTargets[n];for(let a=0,l=o.length;a<l;a++){let c=o[a],h=new Te(c.data.length*3,3);h.name=c.name,s.push(h.copyVector3sArray(c.data))}t.morphAttributes[n]=s}if(e.skinIndices.length>0){let n=new Te(e.skinIndices.length*4,4);t.setAttribute("skinIndex",n.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let n=new Te(e.skinWeights.length*4,4);t.setAttribute("skinWeight",n.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new De,r=e.geometry;if(e.isPoints||e.isLine){let n=new Te(r.vertices.length*3,3),s=new Te(r.colors.length*3,3);if(t.setAttribute("position",n.copyVector3sArray(r.vertices)),t.setAttribute("color",s.copyColorsArray(r.colors)),r.lineDistances&&r.lineDistances.length===r.vertices.length){let o=new Te(r.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(r.lineDistances))}r.boundingSphere!==null&&(t.boundingSphere=r.boundingSphere.clone()),r.boundingBox!==null&&(t.boundingBox=r.boundingBox.clone())}else e.isMesh&&(t=r.toBufferGeometry());return t}};lo.prototype.isGeometry=!0;var cv=class{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(e){let t=[],r,n,s,o=e.faces;for(n=0;n<o.length;n++){let a=o[n];a.materialIndex!==s&&(s=a.materialIndex,r!==void 0&&(r.count=n*3-r.start,t.push(r)),r={start:n*3,materialIndex:s})}r!==void 0&&(r.count=n*3-r.start,t.push(r)),this.groups=t}fromGeometry(e){let t=e.faces,r=e.vertices,n=e.faceVertexUvs,s=n[0]&&n[0].length>0,o=n[1]&&n[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let v=0;v<l;v++)c[v]={name:a[v].name,data:[]};this.morphTargets.position=c}let h=e.morphNormals,u=h.length,f;if(u>0){f=[];for(let v=0;v<u;v++)f[v]={name:h[v].name,data:[]};this.morphTargets.normal=f}let d=e.skinIndices,p=e.skinWeights,m=d.length===r.length,g=p.length===r.length;r.length>0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let v=0;v<t.length;v++){let y=t[v];this.vertices.push(r[y.a],r[y.b],r[y.c]);let w=y.vertexNormals;if(w.length===3)this.normals.push(w[0],w[1],w[2]);else{let S=y.normal;this.normals.push(S,S,S)}let b=y.vertexColors;if(b.length===3)this.colors.push(b[0],b[1],b[2]);else{let S=y.color;this.colors.push(S,S,S)}if(s===!0){let S=n[0][v];S!==void 0?this.uvs.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",v),this.uvs.push(new B,new B,new B))}if(o===!0){let S=n[1][v];S!==void 0?this.uvs2.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",v),this.uvs2.push(new B,new B,new B))}for(let S=0;S<l;S++){let T=a[S].vertices;c[S].data.push(T[y.a],T[y.b],T[y.c])}for(let S=0;S<u;S++){let T=h[S].vertexNormals[v];f[S].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[y.a],d[y.b],d[y.c]),g&&this.skinWeights.push(p[y.a],p[y.b],p[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}},Ol=class{constructor(e,t,r,n,s,o=0){this.a=e,this.b=t,this.c=r,this.normal=n&&n.isVector3?n:new M,this.vertexNormals=Array.isArray(n)?n:[],this.color=s&&s.isColor?s:new be,this.vertexColors=Array.isArray(s)?s:[],this.materialIndex=o}clone(){return new this.constructor().copy(this)}copy(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(let t=0,r=e.vertexNormals.length;t<r;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(let t=0,r=e.vertexColors.length;t<r;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}};var uF=["a","b","c"];function fF(i,e){switch(e){case"c":return i.c;case"b":return i.b;case"a":default:return i.a}}function hv(i,e,t){let r=Math.min(i,e),n=Math.max(i,e),s=r+"_"+n;return t.get(s)}function uv(i,e,t,r,n,s){let o=Math.min(i,e),a=Math.max(i,e),l=o+"_"+a,c;if(r.has(l))c=r.get(l);else{let h=t[o],u=t[a];c={a:h,b:u,newEdge:null,faces:[]},r.set(l,c)}c.faces.push(n),s[i].edges.push(c),s[e].edges.push(c)}function dF(i,e,t,r){let n,s,o;for(n=0,s=i.length;n<s;n++)t[n]={edges:[]};for(n=0,s=e.length;n<s;n++)o=e[n],uv(o.a,o.b,i,r,o,t),uv(o.b,o.c,i,r,o,t),uv(o.c,o.a,i,r,o,t)}function mp(i,e,t,r,n){i.push(new Ol(e,t,r,void 0,void 0,n))}function Fl(i,e){return Math.abs(e-i)/2+Math.min(i,e)}function gp(i,e,t,r){i.push([e.clone(),t.clone(),r.clone()])}var yp=class{constructor(e=1){this.subdivisions=e}modify(e){e instanceof De?e=new lo().fromBufferGeometry(e):e=e.clone(),e.mergeVertices();let t=this.subdivisions;for(;t-- >0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,r,n,s,o,a,l=e.vertices,c=e.faces,h=e.faceVertexUvs[0],u=h!==void 0&&h.length>0,f=[],d=new Map;dF(l,c,f,d);let p=[],m,g,v,y,w,b,S;for(let ie of Array.from(d.keys())){for(g=d.get(ie),v=new M,w=3/8,b=1/8,S=g.faces.length,S!=2&&(w=.5,b=0,S!=1),v.addVectors(g.a,g.b).multiplyScalar(w),t.set(0,0,0),o=0;o<S;o++){for(y=g.faces[o],a=0;a<3&&(m=l[fF(y,uF[a])],!(m!==g.a&&m!==g.b));a++);m&&t.add(m)}t.multiplyScalar(b),v.add(t),g.newEdge=p.length,p.push(v)}let T,A,x,_,E,C,I,N=[];for(n=0,s=l.length;n<s;n++){for(C=l[n],E=f[n].edges,r=E.length,r==3?T=3/16:r>3&&(T=3/(8*r)),A=1-r*Number(T),x=T,r<=2&&(r==2?(A=3/4,x=1/8):r==1||r==0),I=C.clone().multiplyScalar(A),t.set(0,0,0),o=0;o<r;o++)_=E[o],m=_.a!==C?_.a:_.b,t.add(m);t.multiplyScalar(Number(x)),I.add(t),N.push(I)}let R=N.concat(p),k=N.length,G,K,J,Y=[],F=[],U,O,j,H,X=new B,V=new B,he=new B;for(n=0,s=c.length;n<s;n++)y=c[n],G=Number(hv(y.a,y.b,d).newEdge)+k,K=Number(hv(y.b,y.c,d).newEdge)+k,J=Number(hv(y.c,y.a,d).newEdge)+k,mp(Y,G,K,J,y.materialIndex),mp(Y,y.a,G,J,y.materialIndex),mp(Y,y.b,K,G,y.materialIndex),mp(Y,y.c,J,K,y.materialIndex),u&&(U=h[n],O=U[0],j=U[1],H=U[2],X.set(Fl(O.x,j.x),Fl(O.y,j.y)),V.set(Fl(j.x,H.x),Fl(j.y,H.y)),he.set(Fl(O.x,H.x),Fl(O.y,H.y)),gp(F,X,V,he),gp(F,O,X,he),gp(F,j,V,X),gp(F,H,he,V));e.vertices=R,e.faces=Y,u&&(e.faceVertexUvs[0]=F)}};var _r=new M,b1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var s,o;let t=(o=(s=i.geometry)!=null?s:e==null?void 0:e.geometry)!=null?o:new De().copy(new vn(100,100,100)),r;e===void 0?(t.computeBoundingBox(),t.boundingBox.getSize(_r),r={width:_r.x,height:_r.y,depth:_r.z,subdivisions:0}):r=e.parameters;let n=se(se({},r),i.parameters);return{parameters:{width:Math.abs(n.width),height:Math.abs(n.height),depth:Math.abs(n.depth),subdivisions:Math.abs(n.subdivisions)},geometry:t}}static build(i){var l;let{width:e,height:t,depth:r,subdivisions:n}=i.parameters,s=(l=i.geometry)!=null?l:new De().copy(new vn(100,100,100)),o=s.userData.parameters;o===void 0?(s.computeBoundingBox(),s.boundingBox.getSize(_r)):_r.set(o.width,o.height,o.depth),(e!==_r.x||t!==_r.y||r!==_r.z)&&s.scale(_r.x===0?1:e/_r.x,_r.y===0?1:t/_r.y,_r.z===0?1:r/_r.z);let a=s.originalGeometry;return n>0?(a===void 0||(o==null?void 0:o.subdivisions)!==n)&&(a===void 0&&(a=s),s=new yp(n).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0,s.getAttribute("normal")===void 0&&s.computeVertexNormals()),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete i.geometry,Object.assign(s,{userData:xe(se({},i),{type:"NonParametricGeometry"})})}static loadFromUrl(i,e,t){new Ws(t).load(i,n=>{let s=this.normalizeInputs({geometry:n});n.boundingBox.getSize(_r);let o=100/_r.x;Object.assign(s.parameters,{width:100,height:_r.y*o,depth:_r.z*o}),e(this.build(s))})}};var w1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:3},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e,height:t,spikes:r,cornerRadius:n,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a}=i.parameters,l=i.shape,c=e*.5,h=t*.5,u=0,f=0,d=2*Math.PI/r;for(let m=0;m<r;m++){let g=d*m,v=u+Math.sin(g)*c,y=f+Math.cos(g)*h;l.addPoint(l.createPoint(v,y))}l.isClosed=!0;for(let m=0,g=l.points.length;m<g;m++)l.points[m].roundness=n;l.roundness=n,l.update();let p=Hr.create({shape:l,parameters:{roundness:n,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a}});return Object.assign(p,{userData:xe(se({},i),{type:"PolygonGeometry"})})}};var S1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,radialSegments:4,heightSegments:1,cornerRadius:0,cornerSegments:8,openEnded:!1},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,radialSegments:n,heightSegments:s,openEnded:o,cornerRadius:a,cornerSegments:l}=i.parameters,c=new dv(e*.5,t,n,s,o,a,l);return c.scale(1,1,r/e),Object.assign(c,{userData:xe(se({},i),{type:"PyramidGeometry"})})}};function Yh(i,e,t){t.x=i.x*e.x,t.y=i.y,t.z=i.x*e.y}function fv(i,e,t,r,n,s){let o=e.clone().sub(i),a=t.clone().sub(i),l=o.angleTo(a);if(o.normalize(),a.normalize(),r===n){let c=o.add(a).normalize();s.copy(i).addScaledVector(c,r/Math.sin(l/2))}else{let c=o.angleTo(a);s.copy(i),s.addScaledVector(o,n/Math.sin(c)),s.addScaledVector(a,r/Math.sin(c))}}function pF(i,e,t){let r=i.clone().sub(e),n=t.clone().sub(e);return r.projectOnVector(n),r.add(e)}var dv=class extends De{constructor(e=.5,t=1,r=4,n=1,s=!1,o=0,a=4){super(),r=Math.floor(Math.max(3,r)),n=Math.floor(n),a=Math.floor(a);let l=[],c=[],h=[],u=[],f=0,d=t/2,p=Math.PI/r,m=e*Math.cos(Math.PI/r),g=2*Math.PI/r,v=(r-2)*Math.PI/r,y=Math.PI-v,w=new M(0,-d,0),b=new M(0,d,0),S=new B(e,-d),T=new B(m,-d),A=new B(0,b.y).sub(T),x=new B(0,b.y).sub(S),_=new B(A.y,-A.x).normalize(),E=new B(x.y,-x.x).normalize(),I=e*Math.cos(Math.PI/r)*Math.tan((Math.PI-A.angle())/2)-1e-8;o=Math.min(o,I);let N;{let F=new M(_.x,_.y,0),U=new M(Math.cos(g)*F.x,F.y,Math.sin(g)*F.x);N=F.angleTo(U)}let R=o/Math.tan((Math.PI-A.angle())/2),k=o/Math.tan((Math.PI-N)/2),G=new M;if(!s){c.push(w.x,w.y,w.z),h.push(0,-1,0),u.push(0,0);let F=f++,U=[],O=S.clone(),j=R/Math.cos(Math.PI/r);O.x-=j;for(let H=0;H<r;H++){let X=H/r*Math.PI*2+p,V=new B(Math.sin(X),Math.cos(X));Yh(O,V,G),c.push(G.x,G.y,G.z),h.push(0,-1,0),u.push(0,0),U.push(f++)}for(let H=0;H<U.length;H++)l.push(U[H],F,U[(H+1)%U.length])}let K=[];{let F=new M,U=new M,O=new M,j=new M,H=new M,X=new M;for(let V=0;V<r;V++){let he=V/r*Math.PI*2+p,ie=(V+.5)/r*Math.PI*2+p,le=(V+1)/r*Math.PI*2+p,q=new B(Math.sin(he),Math.cos(he)),ue=new B(Math.sin(ie),Math.cos(ie)),Z=new B(Math.sin(le),Math.cos(le));Yh(S,q,U),Yh(S,Z,O),Yh(_,ue,F),fv(b,U,O,k,k,j),c.push(j.x,j.y,j.z),fv(U,b,O,k,R,H),c.push(H.x,H.y,H.z),fv(O,U,b,R,k,X),c.push(X.x,X.y,X.z),h.push(F.x,F.y,F.z),h.push(F.x,F.y,F.z),h.push(F.x,F.y,F.z),u.push(0,0),u.push(0,0),u.push(0,0);let W=f++,$=f++,ce=f++;if(l.push(W,$,ce),o>0){{let ve=U.clone().add(O).multiplyScalar(.5),ge=b.clone().sub(ve).normalize(),ke=w.clone().sub(ve).normalize().add(ge).normalize().multiplyScalar(-1),L=X.clone().sub(H);J(ve,L,ke,A.angle())}let oe,me;{let ve=new M;Yh(E,Z,ve);let ge=X.clone().add(j).multiplyScalar(.5);ge=pF(ge,O,b);let Le=X.clone().sub(j);[oe,me]=J(ge,Le,ve,N,j.y)}{let ve=oe,ge=ve.clone().setY(0).normalize(),Le=new M(0,-1,0),ke=ge.clone().cross(Le);Y(ve,ge,Le,ke)}K.concat(me);{let ve=A.angle(),ge=Math.PI-ve,Le=b.clone();Le.y-=o/Math.sin(ve-Math.PI/2);let ke=new M,L=[];for(let re=0;re<a;re++){let ye=[],Se=Math.PI/2-ge*re/a,Ie=Math.cos(Se),Fe=Math.sin(Se),fe=ie;for(let rt=0;rt<=re;rt++){let st=Math.cos(fe),Ee=Math.sin(fe);F.x=Ie*Ee,F.y=Fe,F.z=Ie*st,ke.copy(Le).addScaledVector(F,o),c.push(ke.x,ke.y,ke.z),h.push(F.x,F.y,F.z),u.push(0,0),ye.push(f++),fe+=Math.PI*2/re/r}L.push(ye)}me.reverse(),L.push(me);let P=L.length-1;for(let re=0;re<P;re++){let ye=L[re],Se=L[re+1],Ie=ye.length-1;l.push(Se[1],ye[0],Se[0]);for(let Fe=1;Fe<=Ie;Fe++)l.push(ye[Fe],ye[Fe-1],Se[Fe]),l.push(Se[Fe+1],ye[Fe],Se[Fe])}}}}}this.setIndex(l),this.setAttribute("position",new Te(c,3)),this.setAttribute("normal",new Te(h,3)),this.setAttribute("uv",new Te(u,2));function J(F,U,O,j,H){let X=-j/2,V=(Math.PI-j)/2,he=U.clone().normalize().cross(O);F.addScaledVector(O,-o/Math.sin(V));let ie=new M,le=new M,q=1,ue=f,Z=[];for(let W=0;W<=a;W++){let $=X+W/a*j;le.set(0,0,0),le.addScaledVector(he,Math.sin($)),le.addScaledVector(O,Math.cos($));for(let ce=0;ce<=q;ce++){let oe=ce/q-.5;if(ie.copy(F),ie.addScaledVector(U,oe),ie.addScaledVector(le,o),H!=null){let me=Math.max(0,ie.y-H);ie.addScaledVector(U,-me/U.y)}c.push(ie.x,ie.y,ie.z),h.push(le.x,le.y,le.z),u.push(0,0),ce===0&&Z.push(f),f++}}for(let W=0;W<a;W++)for(let $=0;$<q;$++){let ce=ue+$+(q+1)*W,oe=ce+(q+1),me=oe+1,ve=ce+1;l.push(ce,oe,ve),l.push(oe,me,ve)}return[F.clone().addScaledVector(U,.5),Z]}function Y(F,U,O,j){let H=Math.PI/2,X=x.angle()-H,V=[],he=new M,ie=new M;for(let q=0;q<=a;q++){let ue=[],Z=q/a;for(let W=0;W<=q;W++){let ce=((q?W/q:0)-.5)*y,oe=Math.cos(ce),me=Math.sin(ce),ve=Math.atan(Math.tan(X)*oe),ge=(H+ve)*Z,Le=Math.cos(ge),ke=Math.sin(ge);he.set(0,0,0),he.addScaledVector(U,ke*oe),he.addScaledVector(O,Le),he.addScaledVector(j,ke*me),ie.copy(F).addScaledVector(he,o),c.push(ie.x,ie.y,ie.z),h.push(he.x,he.y,he.z),u.push(0,0),ue.push(f++)}V.push(ue)}let le=V.length-1;for(let q=0;q<le;q++){let ue=V[q],Z=V[q+1],W=ue.length-1;l.push(ue[0],Z[1],Z[0]);for(let $=1;$<=W;$++)l.push(ue[$-1],ue[$],Z[$]),l.push(ue[$],Z[$+1],Z[$])}}}};var vp=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var s,o,a,l;let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,depth:0,cornerRadius:[0,0,0,0],cornerType:1,extrudeBevelSize:0,extrudeBevelSegments:1},i.parameters),r=Object.assign((o=e==null?void 0:e.ui)!=null?o:{enabledIndieCorners:!1},i.ui);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((a=t.height)!=null?a:t.width),depth:Math.abs((l=t.depth)!=null?l:0)}),ui:r}}static build(i){let e=i.shape,{width:t,height:r,cornerRadius:n,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}=i.parameters,c={x:t*.5,y:r*.5},h={x:-c.x,y:-c.y},u={x:c.x,y:c.y};function f(b,S,T){return S>t&&T>r?Math.min(b*t/S,b*r/T):S>t?b*t/S:T>r?b*r/T:b}let d=[];d[0]=n[0]===0?0:f(n[0],n[0]+n[3],n[0]+n[1]),d[1]=n[1]===0?0:f(n[1],n[1]+n[2],n[1]+n[0]),d[2]=n[2]===0?0:f(n[2],n[2]+n[1],n[2]+n[3]),d[3]=n[3]===0?0:f(n[3],n[3]+n[0],n[3]+n[2]);let p=h.x,m=u.x,g=u.y,v=h.y;e.addPoint(e.createPoint(p,g)),e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(m,v)),e.addPoint(e.createPoint(p,v)),e.isClosed=!0;let y=!0;for(let b=0,S=e.points.length;b<S;b++)e.points[b].roundness=d[b],b>0&&d[b]!==d[b-1]&&(y=!1);y&&(e.roundness=d[0]),e.useCubicForRoundedCorners=s!==1,e.update();let w=Hr.create({shape:e,parameters:{depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(w,{userData:xe(se({},i),{type:"RectangleGeometry"})})}};var M1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e=100,height:t=e,depth:r=e,widthSegments:n=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=i.parameters,h=new Ro(.5*e,n,s,o,a,l,c);return h.scale(1,t/e,r/e),Object.assign(h,{userData:xe(se({},i),{type:"SphereGeometry"})})}};var A1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,depth:0,widthSegments:8,heightSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:0})}}static build(i){let{width:e=100,height:t=e,widthSegments:r=8,heightSegments:n=8}=i.parameters,s=new is(e,t,r,n);return s.scale(1,1,1),Object.assign(s,{userData:xe(se({},i),{type:"PlaneGeometry"})})}};var T1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,angle:90,cornerRadius:24,cornerSegments:8},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(i){let{width:e,height:t,depth:r,angle:n,cornerRadius:s,cornerSegments:o}=i.parameters,a=new pv(e,t,r,n,s,o);return Object.assign(a,{userData:xe(se({},i),{type:"BackdropGeometry"})})}},pv=class extends De{constructor(e=1,t=1,r=1,n=90,s=10,o=24){super(),this.type="BackdropGeometry";let a=[],l=[],c=[];s==0&&(o=1),o=Math.max(1,Math.floor(o)),s=Math.min(s,100),n=Math.min(179,n),n*=Math.PI/180;let h=[],u=(he=0,ie=0,le=0)=>new M(he,ie,le),f=u(),d=u(),[p,m,g]=[t/2,e/2,r/2],v=-m,y=+m,[w,b,S]=[u(v,-p,+g),u(v,-p,-g),u(v,+p,-g)],[T,A]=[he=>Math.sin(he),he=>Math.cos(he)],x=(he,ie=!1)=>Math.sin(he-Math.PI/(1+ +ie)),_=(he,ie=!1)=>Math.cos(he-Math.PI/(1+ +ie));S.y=T(n)*t-p;let E=A(n)*t-g;n<=Math.PI/2?S.z=E:b.z=Math.min(b.z-E-g,w.z-.001),f.subVectors(w,b),d.subVectors(S,b);let C=Math.min(f.length(),d.length())*s/100,I=C*Math.tan(n/2),N=C/Math.cos(n/2),R=f.clone().normalize().add(d.normalize()).setLength(N).add(b);f.set(0,x(n,!0),_(n,!0)),h.push([S,f.clone()]);let k=(Math.PI-n)/o;for(let he=0;he<=o;he++){let ie=Math.PI/2+n+he*k;f.set(0,T(ie)*I,A(ie)*I),f.add(R),d.set(0,x(ie),_(ie)),h.push([f.clone(),d.clone()])}h.push([w,u(0,1,0)]);let G=Math.sin(k/2)*I*2,K=h.length-1,J=h[0][0].distanceTo(h[1][0]),Y=h[K-1][0].distanceTo(h[K][0]),F=J+G*o+Y;h[0].push(1);for(let he=0;he<=o;he++)h[he+1].push(1-(J+he*G)/F);h[K].push(0);let[U,O,j]=h[0],H,X,V;for(let he=1;he<h.length;he++)[H,X,V]=h[he],a.push(v,U.y,U.z,v,H.y,H.z,y,U.y,U.z,y,U.y,U.z,v,H.y,H.z,y,H.y,H.z),l.push(0,O.y,O.z,0,X.y,X.z,0,O.y,O.z,0,O.y,O.z,0,X.y,X.z,0,X.y,X.z),c.push(0,j,0,V,1,j,1,j,0,V,1,V),[U,O,j]=[H,X,V];this.setAttribute("position",new Te(a,3)),this.setAttribute("normal",new Te(l,3)),this.setAttribute("uv",new Te(c,2))}};var _1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeBevelSize:0,extrudeBevelSegments:1},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e,height:t,innerRadiusPercent:r,spikes:n,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c}=i.parameters,h=i.shape,u=e*.5,f=t*.5,d=0,p=0,m=o*Math.PI/360/n,g=Math.PI/2*3*-1,v=u*r/100,y=f*r/100;if(n===3&&r===50){m=2*Math.PI/n;for(let b=0;b<n;b++){let S=m*b,T=d+Math.sin(S)*u,A=p+Math.cos(S)*f;h.addPoint(h.createPoint(T,A))}}else for(let b=0;b<n;b++){let S=d+Math.cos(g)*u,T=p+Math.sin(g)*f;h.addPoint(h.createPoint(S,T)),g+=m,S=d+Math.cos(g)*v,T=p+Math.sin(g)*y,b<=n,h.addPoint(h.createPoint(S,T)),g+=m}h.isClosed=!0;for(let b=0,S=h.points.length;b<S;b++)h.points[b].roundness=s;h.roundness=s,h.update();let w=Hr.create({shape:h,parameters:{roundness:s,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c}});return Object.assign(w,{userData:xe(se({},i),{type:"StarGeometry"})})}};var xp=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,depth:0},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:0)})}}static build(i){let{width:e,height:t}=i.parameters,r=new is(e,t);return Object.assign(r,{userData:xe(se({},i),{type:"TextFrameGeometry"})})}};var E1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var o,a,l;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:32,tubularSegments:64,arc:Math.PI*2,cornerRadius:30,cornerSegments:8},i.parameters),r=Math.abs(t.width),n=Math.abs((a=t.height)!=null?a:t.width),s=Math.abs((l=t.depth)!=null?l:t.width*.25);return{parameters:Object.assign(t,{width:r,height:n,depth:s})}}static build(i){let{width:e,height:t,depth:r,radialSegments:n,tubularSegments:s,arc:o,cornerRadius:a,cornerSegments:l}=i.parameters,c=mF(e,t,r,e*.5,o,s,0,0,n,a,l);return c.scale(1,t/e,1),Object.assign(c,{userData:xe(se({},i),{type:"TorusGeometry"})})}};function mF(i,e,t,r,n,s,o,a,l,c,h){return[e,t]=[t,e],o=e/2,n/=2*Math.PI,n==1&&(c=0),new jh(!0,i,e,t,r,n,s,o,a,l,c,h)}var C1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var r,n,s,o;let t=Object.assign({},(r=e==null?void 0:e.parameters)!=null?r:{width:100,tubularSegments:64,radialSegments:32,p:2,q:3},i.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((n=t.height)!=null?n:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width),tube:(o=t.tube)!=null?o:t.width*.125})}}static build(i){let{width:e,tube:t,tubularSegments:r,radialSegments:n,p:s,q:o}=i.parameters,a=e*.5;a!==t&&(a-=t);let l=new Ha(a,t,r,n,s,o);return Object.assign(l,{userData:xe(se({},i),{type:"TorusKnotGeometry"})})}};var P1=class{static create(i){return this.build(this.normalizeInputs(i))}static normalizeInputs(i,e){var n,s,o;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1,isRect:!1},i.parameters);return{shape:i.shape&&i.shape instanceof Tt?i.shape:new Tt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs((o=t.depth)!=null?o:0)})}}static build(i){let{width:e=100,height:t,cornerRadius:r,depth:n,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a}=i.parameters,l=i.shape,c=e*.5,h=t*.5;a?(l.addPoint(l.createPoint(-c,h)),l.addPoint(l.createPoint(c,-h)),l.addPoint(l.createPoint(-c,-h))):(l.addPoint(l.createPoint(0,h)),l.addPoint(l.createPoint(c,-h)),l.addPoint(l.createPoint(-c,-h))),l.isClosed=!0;for(let f=0,d=l.points.length;f<d;f++)l.points[f].roundness=r;l.roundness=r,l.update();let u=Hr.create({shape:l,parameters:{roundness:r,depth:n,extrudeBevelSize:s,extrudeBevelSegments:o}});return Object.assign(u,{userData:xe(se({},i),{type:"TriangleGeometry"})})}};var Xh={};_x(Xh,{addBarycentricAttribute:()=>vF,fixUvs:()=>bF,loadFromUrl:()=>xF,resizeGeometry:()=>yF,roundShapePolygon:()=>gF});var D1=function(i,e){let t=e.x-i.x,r=e.y-i.y,n=Math.sqrt(t*t+r*r),s=t/n,o=r/n,a=Math.atan2(o,s);return{x:t,y:r,len:n,nx:s,ny:o,ang:a}},gF=(i,e,t)=>{let r,n,s,o,a,l,c,h,u,f,d,p,m,g,v=e.length;for(o=e[v-2],i.curves=[],r=1;r<v-1;r++){a=e[r%v],l=e[(r+1)%v];let y=D1(a,o),w=D1(a,l);c=y.nx*w.ny-y.ny*w.nx,h=y.nx*w.nx-y.ny*-w.ny,d=Math.asin(c),u=1,f=!1,h<0?d<0?d=Math.PI+d:(d=Math.PI-d,u=-1,f=!0):d>0&&(u=-1,f=!0),p=d/2,g=Math.abs(Math.cos(p)*t/Math.sin(p)),g>Math.min(y.len/2,w.len/2)?(g=Math.min(y.len/2,w.len/2),m=Math.abs(g*Math.sin(p)/Math.cos(p))):m=t,n=a.x+w.nx*g,s=a.y+w.ny*g,n+=-w.ny*m*u,s+=w.nx*m*u,i.absarc(n,s,m,y.ang+Math.PI/2*u,w.ang-Math.PI/2*u,f),o=a,a=l}i.closePath()},yF=(i,{width:e,height:t,depth:r})=>{e=Math.abs(e),t=Math.abs(t),r=Math.abs(r);let n=i.userData.parameters,s,o,a;e===0?(e=n.width,s=1):s=e/n.width,t===0?(t=n.height,o=1):o=t/n.height,r===0?(r=n.depth,a=1):a=r/n.depth,i.scale(s,o,a),n.width=e,n.height=t,n.depth=r},vF=(i,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],r=i.attributes.position,n=new Float32Array(r.count*3);for(let s=0,o=r.count;s<o;s++)t[s%3].toArray(n,s*3);i.setAttribute(e,new Te(n,3))},xF=i=>new Promise(e=>{new Ws().load(i,r=>e(r))}),bF=(i,e,t)=>{let r=i.getAttribute("uv");if(r)for(let n=0;n<r.count;n++){let s=r.getX(n),o=r.getY(n);r.setXY(n,(s+e/2)/e,1-(o-t/2)/t*-1)}};var wF,bp=new Promise(i=>{wF=i});var Qh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var We=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=et.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,r){return r=r!=null?r:{},this.analyze(e,r),this.flow(e,t,r)}flow(e,t,r){r=r!=null?r:{},e.addFlow(r.slot,r.cache,r.context);let n={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),n}build(e,t,r){t=t!=null?t:this.getType(e,t);let n=e.getNodeData(r!=null?r:this);return e.analyzing&&this.appendDepsNode(e,n,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,r)}updateFrame(e){}generateReadonly(e,t,r,n,s,o){return""}generate(e,t,r,n,s){return""}parse(e,t,r,n){}appendDepsNode(e,t,r){t.deps=(t.deps||0)+1;let n=e.getTypeLength(r);(n>(t.outputMax||0)||this.getType(e,r))&&(t.outputMax=n,t.output=r)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,r;for(t in this)r=this[t],r instanceof We&&(e+='"'+t+'":'+r.getHash()+",");if(this.hashProperties)for(let n=0;n<this.hashProperties.length;n++)t=this.hashProperties[n],r=this[t],e+='"'+t+'":"'+String(r)+'",';return e+='"id":"'+this.uuid+'"}',e}copy(e){return this.name=e.name,e.type&&(this.type=e.type),e.frameId&&(this.frameId=e.frameId),e.hashProperties&&(this.hashProperties=e.hashProperties.map(t=>t)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let r={};return r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=r),r}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var mv=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,r){r=r!==void 0?r:!0,this.keywords[e]={callback:t,cache:r}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},Er=new mv;var Ye=class extends We{constructor(t,r){super(t);this.scope="";r=r!=null?r:{},this.shared=r.shared!==void 0?r.shared:!0,this.unique=r.unique!==void 0?r.unique:!1}build(t,r,n,s){if(r=r!=null?r:this.getType(t),this.getShared(t,r)){let o=this.getUnique(t,r);o&&this.uuid===void 0&&(this.uuid=et.generateUUID()),n=t.getUUID(n!=null?n:this.getUUID(),!o);let a=t.getNodeData(n),l=a.output||this.getType(t);if(t.analyzing)return(a.deps||0)>0||this.getLabel()?(this.appendDepsNode(t,a,r),this.generate(t,r,n)):super.build(t,r,n);if(o)return a.name=a.name||super.build(t,r,n),a.name;if(!this.getLabel()&&(!this.getShared(t,l)||t.context.ignoreCache||a.deps===1))return super.build(t,r,n);n=this.getUUID(!1);let c=this.getTemp(t,n);if(c)return t.format(c,l,r);{c=super.generate(t,r,n,a.output,s);let h=this.generate(t,l,n);return t.addNodeCode(c+" = "+h+";"),t.format(c,l,r)}}return super.build(t,r,n)}getShared(t,r){return r!=="sampler2D"&&r!=="samplerCube"&&this.shared}getUnique(t,r){return this.unique}setLabel(t){return this.label=t,this}getLabel(){return this.label}getUUID(t){let r=this.uuid;return typeof this.scope=="string"&&(r=this.scope+"-"+r),r}getTemp(t,r){r=r||this.uuid;let n=t.getVars()[r];return n?n.name:void 0}generate(t,r,n,s,o){return this.getShared(t,r)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,t.getTempVar(n,s!=null?s:this.getType(t),o,this.getLabel()).name}};var jt=class extends Ye{constructor(t,r){r=r!=null?r:{},r.shared=r.shared!==void 0?r.shared:!1;super(t,r);this.readonly=!1}setReadonly(t){return this.readonly=t,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(t){let r=super.createJSONNode(t);return this.readonly===!0&&(r.readonly=this.readonly),r}fromJSON(t,r){return super.fromJSON(t,r),t.readonly!==void 0&&this.setReadonly(t.readonly),this}generate(t,r,n,s,o,a){n=t.getUUID(n!=null?n:this.getUUID()),s=s!=null?s:this.getType(t);let l=t.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(t,r,n,s,o,a):t.isShader("vertex")?(l.vertex||(l.vertex=t.createVertexUniform(s,this,o,a,this.getLabel())),t.format(l.vertex.name,s,r)):(l.fragment||(l.fragment=t.createFragmentUniform(s,this,o,a,this.getLabel())),t.format(l.fragment.name,s,r))}copy(t){return super.copy(t),this.readonly=t.readonly,this}};var Nr=class extends jt{constructor(t=0,r){super("v2");this.nodeType="Vector2";this.value=t instanceof B?t:new B(t,r)}get x(){return this.value.x}set x(t){this.value.x=t}get y(){return this.value.y}set y(t){this.value.y=t}generateReadonly(t,r,n,s,o,a){return t.format("vec2("+this.value.x+", "+this.value.y+")",s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this}};var Or=class extends jt{constructor(t=0,r,n){super("v3");this.nodeType="Vector3";this.value=t instanceof M?t:new M(t,r,n)}get x(){return this.value.x}set x(t){this.value.x=t}get y(){return this.value.y}set y(t){this.value.y=t}get z(){return this.value.z}set z(t){this.value.z=t}generateReadonly(t,r,n,s,o,a){return t.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this}};var Wr=class extends be{constructor(t,r,n,s){super(t,r,n);this.isColorA=!0;this.a=s}setRGBA(t,r,n,s){super.setRGB(t,r,n),this.a=s}copy(t){return super.copy(t),this.a="a"in t?t.a:1,this}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}get x(){return this.r}get y(){return this.g}get z(){return this.b}get w(){return this.a}set x(t){this.r=t}set y(t){this.g=t}set z(t){this.b=t}set w(t){this.a=t}};var di=class extends jt{constructor(t){super("v4");this.nodeType="Vector4";this.value=t instanceof Wr?t:new Wr(t.r,t.g,t.b,t.a)}generateReadonly(t,r,n,s,o,a){return t.format("vec4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")",s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this}};var SF=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,L1=/[a-z_0-9]+/gi,Ne=class extends Ye{constructor(t,r,n,s,o){super(o);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=o===void 0,this.isInterface=!1,this.parse(t,r,n,s)}getShared(t,r){return!this.isMethod}getType(t){return t.getTypeByFormat(this.type)}getInputByName(t){if(this.inputs){let r=this.inputs.length;for(;r--;)if(this.inputs[r].name===t)return this.inputs[r]}}getIncludeByName(t){if(this.includes){let r=this.includes.length;for(;r--;)if(this.includes[r].name===t)return this.includes[r]}}generate(t,r,n,s,o){let a,l=0,c=this.src;if(this.includes)for(let u=0;u<this.includes.length;u++)t.include(this.includes[u],this);for(let u in this.extensions)t.extensions[u]=!0;let h=[];for(;a=L1.exec(this.src);)h.push(a);for(let u=0;u<h.length;u++){let f=h[u],d=f[0],p=this.isMethod?!this.getInputByName(d):!0,m=d;if(this.keywords[d]||this.useKeywords&&p&&Er.containsKeyword(d)){let g=this.keywords[d];if(!g){let v=Er.getKeywordData(d);v.cache&&(g=t.keywords[d]),g=g||Er.getKeyword(d,t),v.cache&&(t.keywords[d]=g)}m=g.build(t)}d!==m&&(c=c.substring(0,f.index+l)+m+c.substring(f.index+d.length+l),l+=m.length-d.length),this.getIncludeByName(m)===void 0&&Er.contains(m)&&t.include(Er.get(m))}return r==="source"?c:this.isMethod?(this.isInterface||t.include(this,void 0,c),this.name):t.format("( "+c+" )",this.getType(t),r)}parse(t,r,n,s){if(this.src=t||"",this.includes=r!=null?r:[],this.extensions=n!=null?n:{},this.keywords=s!=null?s:{},this.isMethod){let o=SF.exec(this.src);if(this.inputs=[],o&&o.length==4){this.type=o[1],this.name=o[2];let a=o[3].match(L1);if(a){let l=0;for(;l<a.length;){let c=a[l++],h;c==="in"||c==="out"||c==="inout"?h=a[l++]:(h=c,c="");let u=a[l++];this.inputs.push({name:u,type:h,qualifier:c})}}this.isInterface=this.src.indexOf("{")===-1}else this.type="",this.name=""}}copy(t){return super.copy(t),this.isMethod=t.isMethod,this.useKeywords=t.useKeywords,t.type!==void 0&&(this.type=t.type),this.parse(t.src,t.includes,t.extensions,t.keywords),this}toJSON(t){var n;let r=this.getJSONNode(t);if(!r){r=this.createJSONNode(t),r.src=this.src,r.isMethod=this.isMethod,r.useKeywords=this.useKeywords,this.isMethod||(r.type=this.type),r.extensions=JSON.parse(JSON.stringify(this.extensions));let s={};for(let o in this.keywords)s[o]=this.keywords[o].toJSON(t).uuid;if(r.keywords=s,(n=this.includes)!=null&&n.length){let o=[];for(let a=0;a<this.includes.length;a++)o.push(this.includes[a].toJSON(t).uuid);r.includes=o}r.isMethod=this.isMethod,r.inputs=this.inputs}return r.nodeType=this.nodeType,r}fromJSON(t,r){if(super.fromJSON(t,r),t.inputs!==void 0&&(this.inputs=t.inputs),t.isMethod!==void 0&&(this.isMethod=t.isMethod),t.src&&(this.src=t.src),t.isMethod&&(this.isMethod=t.isMethod),t.useKeywords&&(this.useKeywords=t.useKeywords),t.type&&(this.type=t.type),t.extensions&&(this.extensions=t.extensions),t.keywords&&r){this.keywords={};for(let n in t.keywords)this.keywords[n]=r.getNode(t.keywords[n])}return t.includes&&r&&(this.includes=t.includes.map(n=>r.getNode(n))),this}};var MF=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,gv=class extends Ye{constructor(t="",r){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(t||gv.PI,void 0,void 0,void 0,r)}getType(t){return t.getTypeByFormat(this.type)}parse(t,r,n,s,o){this.src=t||"";let a,l,c="",h=MF.exec(t);this.useDefine=o!=null?o:this.src.charAt(0)==="#",h&&h.length>1?(l=h[1],a=h[2],c=h[3]):(a=this.src,l="f"),this.name=a,this.type=l,this.value=c}build(t,r){if(r==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return t.include(this),t.format(this.name,this.getType(t),r)}generate(t,r,n,s,o){return t.format(this.name,this.getType(t),r)}copy(t){return super.copy(t),this.parse(t.src,void 0,void 0,void 0,t.useDefine),this}},wt=gv;wt.PI="PI",wt.PI2="PI2",wt.RECIPROCAL_PI="RECIPROCAL_PI",wt.RECIPROCAL_PI2="RECIPROCAL_PI2",wt.LOG2="LOG2",wt.EPSILON="EPSILON";var AF=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.|
|
|
2987
|
+
)*?)}`,"gim"),TF=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ul=class extends Ye{constructor(t=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(t)}getType(t){return t.getTypeByFormat(this.name)}getInputByName(t){let r=this.inputs.length;for(;r--;)if(this.inputs[r].name===t)return this.inputs[r]}generate(t,r,n,s,o){return r==="source"?this.src+";":t.format("( "+this.src+" )",this.getType(t),r)}parse(t=""){this.src=t,this.inputs=[];let r=AF.exec(t);if(r){let n=r[2],s;for(;s=TF.exec(n);)this.inputs.push({type:s[1],name:s[2]});this.name=r[1]}else this.name="";this.type=this.name}};var zl=class extends Ye{constructor(t){super("v2",{shared:!1});this.nodeType="UV";this.index=t!=null?t:0}generate(t,r){t.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",s=t.isShader("vertex")?"uv"+n:"vUv"+n;return t.format(s,this.getType(t),r)}copy(t){return super.copy(t),this.index=t.index,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.index=this.index),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.index&&(this.index=t.index),this}};Er.addKeyword("uv",function(){return new zl});Er.addKeyword("uv2",function(){return new zl(1)});var Qo=class extends Ye{constructor(t=new We,r){super("v4");this.nodeType="ColorSpace";this.factor=new We;this.input=t,this.method=r!=null?r:Qo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(t){switch(t){case gn:return["Linear"];case je:return["sRGB"];default:return[]}}generate(t,r){var l;let n=this.input.build(t,"v4"),s=this.getType(t),o=Qo.Nodes[this.method],a=t.include(o);if(a===Qo.LINEAR_TO_LINEAR)return t.format(n,s,r);if(((l=o.inputs)==null?void 0:l.length)===2){let c=this.factor.build(t,"f");return t.format(a+"( "+n+", "+c+" )",s,r)}else return t.format(a+"( "+n+" )",s,r)}fromEncoding(t){let r=Qo.getEncodingComponents(t);this.method="LinearTo"+r[0],this.factor=r[1]}fromDecoding(t){let r=Qo.getEncodingComponents(t);this.method=r[0]+"ToLinear",this.factor=r[1]}copy(t){return super.copy(t),this.input.copy(t.input),this.method=t.method,this.factor.copy(t.factor),this}},dn=Qo;dn.Nodes={LinearToLinear:new Ne(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(`
|
|
2988
2988
|
`)),sRGBToLinear:new Ne(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(`
|
|
2989
2989
|
`)),LinearTosRGB:new Ne(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(`
|
|
2990
|
-
`))},dn.LINEAR_TO_LINEAR="LinearToLinear",dn.SRGB_TO_LINEAR="sRGBToLinear",dn.LINEAR_TO_SRGB="LinearTosRGB";var Gt=class extends Ne{constructor(t="",r,n,s,o){super(t,o,s,n,r);this.nodeType="Expression"}};var Fi=class extends Pt{toJSON(e){let t=super.toJSON(e),r=e===void 0||typeof e=="string";if(this.image!==void 0&&!r){let n=this.image;if(Array.isArray(n)){e.images[n.uuid].url=[];for(let s=0;s<n.length;s++)e.images[n.uuid].url[s]=I1(n[s])}else e.images[n.uuid].url=I1(n)}return t}};function I1(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?TF(i):(console.warn("THREE.Texture: Unable to serialize Texture."),"")}var Gl;function TF(i){if(/^data:/i.test(i.src))return i.src;let e;if(i instanceof HTMLCanvasElement)e=i;else{Gl===void 0&&(Gl=document.createElement("canvas")),Gl.width=i.width,Gl.height=i.height;let r=Gl.getContext("2d");i instanceof ImageData?r.putImageData(i,0,0):r.drawImage(i,0,0,i.width,i.height),e=Gl}let t=i.src.startsWith("blob:")?i.fileName:i.src;return/\.jpe?g$/i.test(t)?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}var jr=class extends jt{constructor(t=new Fi,r,n,s){super("v4",{shared:!0});this.nodeType="Texture";this.value=t,this.uv=r!=null?r:new zl,this.bias=n,this.project=s!==void 0?s:!1}getTexture(t,r){return super.generate(t,r,this.value.uuid,"t")}generate(t,r){var u;if(r==="sampler2D")return this.getTexture(t,r);let n=this.getTexture(t,r),s=this.uv.build(t,this.project?"v4":"v2"),o=this.bias?this.bias.build(t,"f"):void 0;o===void 0&&t.context.bias&&(o=t.context.bias.setTexture(this).build(t,"f"));let a,l;this.project?a="texture2DProj":a=o?"tex2DBias":"tex2D",o?l=a+"( "+n+", "+s+", "+o+" )":l=a+"( "+n+", "+s+" )";let c={include:t.isShader("vertex"),ignoreCache:!0},h=this.getType(t);return t.addContext(c),this.colorSpace=(u=this.colorSpace)!=null?u:new dn(new Gt("",h)),this.colorSpace.fromDecoding(t.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(l),l=this.colorSpace.build(t,h),t.removeContext(),t.format(l,h,r)}copy(t){return super.copy(t),t.value.isRenderTargetTexture?this.value=t.value:this.value.copy(t.value),this.uv.copy(t.uv),t.bias?this.bias?this.bias.copy(t.bias):this.bias=t.bias.clone():this.bias=void 0,t.colorSpace?this.colorSpace?this.colorSpace.copy(t.colorSpace):this.colorSpace=t.colorSpace.clone():this.colorSpace=void 0,this.project=t.project,t.value.isRenderTargetTexture||(this.value.updateMatrix(),this.value.needsUpdate=!0),this}};var Be=class extends jt{constructor(t){super("f");this.nodeType="Float";this.value=t!=null?t:0}generateReadonly(t,r,n,s,o,a){return t.format(this.value+(this.value%1?"":".0"),s,r)}copy(t){return super.copy(t),this.value=t.value,this}};var Jh=class extends Ye{constructor(t,r){super();this.inputs=[];this.nodeType="FunctionCall";this.value=t,this.inputs=r!=null?r:[]}getFunction(){return this.value}getType(t){return this.value.getType(t)}generate(t,r,n,s,o){s=this.getType(t);let a=this.value,l=a.build(t,r)+"( ",c=[];if(a.inputs){for(let h=0;h<a.inputs.length;h++){let u=a.inputs[h],f=this.inputs[h]||this.inputs[u.name];c.push(f.build(t,t.getTypeByFormat(u.type)))}l+=c.join(", ")+" )"}return t.format(l,s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this.inputs=t.inputs.map(r=>r.clone()),this}toJSON(t){var n;let r=this.getJSONNode(t);if(!r){let s=this.value;if(r=this.createJSONNode(t),r.value=this.value.toJSON(t).uuid,(n=s.inputs)!=null&&n.length){r.inputs={};for(let o=0;o<s.inputs.length;o++){let a=s.inputs[o],l=this.inputs[o];r.inputs[a.name]=l.toJSON(t).uuid}}}return r}};var yv=class extends Ye{constructor(t=new We,r=new We,n=yv.ADD){super();this.nodeType="Operator";this.type=t.type,this.a=t,this.b=r,this.op=n}getType(t){let r=this.a.getType(t),n=this.b.getType(t);return t.isTypeMatrix(r)?"v4":t.getTypeLength(n)>t.getTypeLength(r)?n:r}generate(t,r){let n=this.getType(t);this.type=n;let s=this.a.build(t,n),o=this.b.build(t,n);return t.format("( "+s+" "+this.op+" "+o+" )",n,r)}copy(t){return super.copy(t),this.a.copy(t.a),this.b.copy(t.b),this.op=t.op,this}},Mn=yv;Mn.ADD="+",Mn.SUB="-",Mn.MUL="*",Mn.DIV="/";var Nt=class extends Ye{constructor(t=new We,r=Nt.ABS,n,s){super();this.nodeType="Math";this.a=t,typeof r!="string"?this.b=r:s=r,typeof n!="string"?this.c=n:s=n,this.method=s,this.hashProperties=["method"]}getNumInputs(t){switch(this.method){case Nt.MIX:case Nt.CLAMP:case Nt.REFRACT:case Nt.SMOOTHSTEP:case Nt.FACEFORWARD:return 3;case Nt.MIN:case Nt.MAX:case Nt.MOD:case Nt.STEP:case Nt.REFLECT:case Nt.DISTANCE:case Nt.DOT:case Nt.CROSS:case Nt.POW:return 2;default:return 1}}getInputType(t){let r=t.getTypeLength(this.a.getType(t)),n=this.b?t.getTypeLength(this.b.getType(t)):0,s=this.c?t.getTypeLength(this.c.getType(t)):0;return r>n&&r>s?this.a.getType(t):n>s?this.b.getType(t):this.c.getType(t)}getType(t){switch(this.method){case Nt.LENGTH:case Nt.DISTANCE:case Nt.DOT:return"f";case Nt.CROSS:return"v3"}return this.getInputType(t)}generate(t,r){let n,s,o,a=this.a?t.getTypeLength(this.a.getType(t)):0,l=this.b?t.getTypeLength(this.b.getType(t)):0,c=this.c?t.getTypeLength(this.c.getType(t)):0,h=this.getInputType(t),u=this.getType(t);switch(this.type=u,this.method){case Nt.NEGATE:return t.format("( -"+this.a.build(t,h)+" )",h,r);case Nt.INVERT:return t.format("( 1.0 - "+this.a.build(t,h)+" )",h,r);case Nt.CROSS:n=this.a.build(t,"v3"),s=this.b.build(t,"v3");break;case Nt.STEP:n=this.a.build(t,a===1?"f":h),s=this.b.build(t,h);break;case Nt.MIN:case Nt.MAX:case Nt.MOD:n=this.a.build(t,h),s=this.b.build(t,l===1?"f":h);break;case Nt.REFRACT:n=this.a.build(t,h),s=this.b.build(t,h),o=this.c.build(t,"f");break;case Nt.MIX:n=this.a.build(t,h),s=this.b.build(t,h),o=this.c.build(t,c===1?"f":h);break;default:n=this.a.build(t,h),this.b&&(s=this.b.build(t,h)),this.c&&(o=this.c.build(t,h));break}let f=[];f.push(n),s&&f.push(s),o&&f.push(o);let d=this.getNumInputs(t);if(f.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${f.length}.`);return t.format(this.method+"( "+f.join(", ")+" )",u,r)}copy(t){return super.copy(t),this.a.copy(t.a),this.b=t.b instanceof We?t.b.clone():t.b,this.c=t.c instanceof We?t.c.clone():t.c,this.method=t.method,this}},tt=Nt;tt.RAD="radians",tt.DEG="degrees",tt.EXP="exp",tt.EXP2="exp2",tt.LOG="log",tt.LOG2="log2",tt.SQRT="sqrt",tt.INV_SQRT="inversesqrt",tt.FLOOR="floor",tt.CEIL="ceil",tt.NORMALIZE="normalize",tt.FRACT="fract",tt.SATURATE="saturate",tt.SIN="sin",tt.COS="cos",tt.TAN="tan",tt.ASIN="asin",tt.ACOS="acos",tt.ARCTAN="atan",tt.ABS="abs",tt.SIGN="sign",tt.LENGTH="length",tt.NEGATE="negate",tt.INVERT="invert",tt.MIN="min",tt.MAX="max",tt.MOD="mod",tt.STEP="step",tt.REFLECT="reflect",tt.DISTANCE="distance",tt.DOT="dot",tt.CROSS="cross",tt.POW="pow",tt.MIX="mix",tt.CLAMP="clamp",tt.REFRACT="refract",tt.SMOOTHSTEP="smoothstep",tt.FACEFORWARD="faceforward";var kl=class extends Ye{constructor(t=new We,r=new We,n=new We){super("v4");this.nodeType="TextureCubeUV";this.value=t,this.uv=r,this.bias=n}bilinearCubeUV(t,r,n,s){var c,h,u,f;let o=new Jh(kl.Nodes.bilinearCubeUV,[r,n,s]);this.colorSpaceTL=(c=this.colorSpaceTL)!=null?c:new dn(new Gt("","v4")),this.colorSpaceTL.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(o.build(t)+".tl"),this.colorSpaceTR=(h=this.colorSpaceTR)!=null?h:new dn(new Gt("","v4")),this.colorSpaceTR.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(o.build(t)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new dn(new Gt("","v4")),this.colorSpaceBL.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(o.build(t)+".bl"),this.colorSpaceBR=(f=this.colorSpaceBR)!=null?f:new dn(new Gt("","v4")),this.colorSpaceBR.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(o.build(t)+".br");let a={include:t.isShader("vertex"),ignoreCache:!0};t.addContext(a),this.colorSpaceTLExp=new Gt(this.colorSpaceTL.build(t,"v4"),"v4"),this.colorSpaceTRExp=new Gt(this.colorSpaceTR.build(t,"v4"),"v4"),this.colorSpaceBLExp=new Gt(this.colorSpaceBL.build(t,"v4"),"v4"),this.colorSpaceBRExp=new Gt(this.colorSpaceBR.build(t,"v4"),"v4"),t.removeContext();let l=new Gt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return l.keywords.cubeUV_TL=this.colorSpaceTLExp,l.keywords.cubeUV_TR=this.colorSpaceTRExp,l.keywords.cubeUV_BL=this.colorSpaceBLExp,l.keywords.cubeUV_BR=this.colorSpaceBRExp,l.keywords.cubeUV=o,l}generate(t,r){if(t.isShader("fragment")){let n=this.uv,s=this.bias||t.context.roughness,o=new Jh(kl.Nodes.roughnessToMip,[s]),a=new tt(o,kl.Nodes.m0,kl.Nodes.cubeUV_maxMipLevel,tt.CLAMP),l=new tt(a,tt.FLOOR),c=new tt(a,tt.FRACT),h=this.bilinearCubeUV(t,this.value,n,l),u=this.bilinearCubeUV(t,this.value,n,new Mn(l,new Be(1).setReadonly(!0),Mn.ADD)),f=new tt(h,u,c,tt.MIX);return t.format(f.build(t),"v4",r)}else return console.warn("TextureCubeUVNode is not compatible with "+t.shader+" shader."),t.format("vec4( 0.0 )",this.getType(t),r)}copy(t){return super.copy(t),this.uv.copy(t.uv),this.bias.copy(t.bias),this.value.copy(t.value),t.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(t.colorSpaceTL):this.colorSpaceTL=t.colorSpaceTL.clone():this.colorSpaceTL=void 0,t.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(t.colorSpaceTR):this.colorSpaceTR=t.colorSpaceTR.clone():this.colorSpaceTR=void 0,t.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(t.colorSpaceBL):this.colorSpaceBL=t.colorSpaceBL.clone():this.colorSpaceBL=void 0,t.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(t.colorSpaceBR):this.colorSpaceBR=t.colorSpaceBR.clone():this.colorSpaceBR=void 0,t.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(t.colorSpaceTLExp):this.colorSpaceTLExp=t.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,t.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(t.colorSpaceTRExp):this.colorSpaceTRExp=t.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,t.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(t.colorSpaceBLExp):this.colorSpaceBLExp=t.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,t.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(t.colorSpaceBRExp):this.colorSpaceBRExp=t.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}},Vl=kl;Vl.Nodes=function(){let t=new Ul(`struct TextureCubeUVData {
|
|
2990
|
+
`))},dn.LINEAR_TO_LINEAR="LinearToLinear",dn.SRGB_TO_LINEAR="sRGBToLinear",dn.LINEAR_TO_SRGB="LinearTosRGB";var Gt=class extends Ne{constructor(t="",r,n,s,o){super(t,o,s,n,r);this.nodeType="Expression"}};var Fi=class extends Pt{toJSON(e){let t=super.toJSON(e),r=e===void 0||typeof e=="string";if(this.image!==void 0&&!r){let n=this.image;if(Array.isArray(n)){e.images[n.uuid].url=[];for(let s=0;s<n.length;s++)e.images[n.uuid].url[s]=I1(n[s])}else e.images[n.uuid].url=I1(n)}return t}};function I1(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?_F(i):(console.warn("THREE.Texture: Unable to serialize Texture."),"")}var Gl;function _F(i){if(/^data:/i.test(i.src))return i.src;let e;if(i instanceof HTMLCanvasElement)e=i;else{Gl===void 0&&(Gl=document.createElement("canvas")),Gl.width=i.width,Gl.height=i.height;let r=Gl.getContext("2d");i instanceof ImageData?r.putImageData(i,0,0):r.drawImage(i,0,0,i.width,i.height),e=Gl}let t=i.src.startsWith("blob:")?i.fileName:i.src;return/\.jpe?g$/i.test(t)?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}var jr=class extends jt{constructor(t=new Fi,r,n,s){super("v4",{shared:!0});this.nodeType="Texture";this.value=t,this.uv=r!=null?r:new zl,this.bias=n,this.project=s!==void 0?s:!1}getTexture(t,r){return super.generate(t,r,this.value.uuid,"t")}generate(t,r){var u;if(r==="sampler2D")return this.getTexture(t,r);let n=this.getTexture(t,r),s=this.uv.build(t,this.project?"v4":"v2"),o=this.bias?this.bias.build(t,"f"):void 0;o===void 0&&t.context.bias&&(o=t.context.bias.setTexture(this).build(t,"f"));let a,l;this.project?a="texture2DProj":a=o?"tex2DBias":"tex2D",o?l=a+"( "+n+", "+s+", "+o+" )":l=a+"( "+n+", "+s+" )";let c={include:t.isShader("vertex"),ignoreCache:!0},h=this.getType(t);return t.addContext(c),this.colorSpace=(u=this.colorSpace)!=null?u:new dn(new Gt("",h)),this.colorSpace.fromDecoding(t.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(l),l=this.colorSpace.build(t,h),t.removeContext(),t.format(l,h,r)}copy(t){return super.copy(t),t.value.isRenderTargetTexture?this.value=t.value:this.value.copy(t.value),this.uv.copy(t.uv),t.bias?this.bias?this.bias.copy(t.bias):this.bias=t.bias.clone():this.bias=void 0,t.colorSpace?this.colorSpace?this.colorSpace.copy(t.colorSpace):this.colorSpace=t.colorSpace.clone():this.colorSpace=void 0,this.project=t.project,t.value.isRenderTargetTexture||(this.value.updateMatrix(),this.value.needsUpdate=!0),this}};var Be=class extends jt{constructor(t){super("f");this.nodeType="Float";this.value=t!=null?t:0}generateReadonly(t,r,n,s,o,a){return t.format(this.value+(this.value%1?"":".0"),s,r)}copy(t){return super.copy(t),this.value=t.value,this}};var Jh=class extends Ye{constructor(t,r){super();this.inputs=[];this.nodeType="FunctionCall";this.value=t,this.inputs=r!=null?r:[]}getFunction(){return this.value}getType(t){return this.value.getType(t)}generate(t,r,n,s,o){s=this.getType(t);let a=this.value,l=a.build(t,r)+"( ",c=[];if(a.inputs){for(let h=0;h<a.inputs.length;h++){let u=a.inputs[h],f=this.inputs[h]||this.inputs[u.name];c.push(f.build(t,t.getTypeByFormat(u.type)))}l+=c.join(", ")+" )"}return t.format(l,s,r)}copy(t){return super.copy(t),this.value.copy(t.value),this.inputs=t.inputs.map(r=>r.clone()),this}toJSON(t){var n;let r=this.getJSONNode(t);if(!r){let s=this.value;if(r=this.createJSONNode(t),r.value=this.value.toJSON(t).uuid,(n=s.inputs)!=null&&n.length){r.inputs={};for(let o=0;o<s.inputs.length;o++){let a=s.inputs[o],l=this.inputs[o];r.inputs[a.name]=l.toJSON(t).uuid}}}return r}};var yv=class extends Ye{constructor(t=new We,r=new We,n=yv.ADD){super();this.nodeType="Operator";this.type=t.type,this.a=t,this.b=r,this.op=n}getType(t){let r=this.a.getType(t),n=this.b.getType(t);return t.isTypeMatrix(r)?"v4":t.getTypeLength(n)>t.getTypeLength(r)?n:r}generate(t,r){let n=this.getType(t);this.type=n;let s=this.a.build(t,n),o=this.b.build(t,n);return t.format("( "+s+" "+this.op+" "+o+" )",n,r)}copy(t){return super.copy(t),this.a.copy(t.a),this.b.copy(t.b),this.op=t.op,this}},Mn=yv;Mn.ADD="+",Mn.SUB="-",Mn.MUL="*",Mn.DIV="/";var Nt=class extends Ye{constructor(t=new We,r=Nt.ABS,n,s){super();this.nodeType="Math";this.a=t,typeof r!="string"?this.b=r:s=r,typeof n!="string"?this.c=n:s=n,this.method=s,this.hashProperties=["method"]}getNumInputs(t){switch(this.method){case Nt.MIX:case Nt.CLAMP:case Nt.REFRACT:case Nt.SMOOTHSTEP:case Nt.FACEFORWARD:return 3;case Nt.MIN:case Nt.MAX:case Nt.MOD:case Nt.STEP:case Nt.REFLECT:case Nt.DISTANCE:case Nt.DOT:case Nt.CROSS:case Nt.POW:return 2;default:return 1}}getInputType(t){let r=t.getTypeLength(this.a.getType(t)),n=this.b?t.getTypeLength(this.b.getType(t)):0,s=this.c?t.getTypeLength(this.c.getType(t)):0;return r>n&&r>s?this.a.getType(t):n>s?this.b.getType(t):this.c.getType(t)}getType(t){switch(this.method){case Nt.LENGTH:case Nt.DISTANCE:case Nt.DOT:return"f";case Nt.CROSS:return"v3"}return this.getInputType(t)}generate(t,r){let n,s,o,a=this.a?t.getTypeLength(this.a.getType(t)):0,l=this.b?t.getTypeLength(this.b.getType(t)):0,c=this.c?t.getTypeLength(this.c.getType(t)):0,h=this.getInputType(t),u=this.getType(t);switch(this.type=u,this.method){case Nt.NEGATE:return t.format("( -"+this.a.build(t,h)+" )",h,r);case Nt.INVERT:return t.format("( 1.0 - "+this.a.build(t,h)+" )",h,r);case Nt.CROSS:n=this.a.build(t,"v3"),s=this.b.build(t,"v3");break;case Nt.STEP:n=this.a.build(t,a===1?"f":h),s=this.b.build(t,h);break;case Nt.MIN:case Nt.MAX:case Nt.MOD:n=this.a.build(t,h),s=this.b.build(t,l===1?"f":h);break;case Nt.REFRACT:n=this.a.build(t,h),s=this.b.build(t,h),o=this.c.build(t,"f");break;case Nt.MIX:n=this.a.build(t,h),s=this.b.build(t,h),o=this.c.build(t,c===1?"f":h);break;default:n=this.a.build(t,h),this.b&&(s=this.b.build(t,h)),this.c&&(o=this.c.build(t,h));break}let f=[];f.push(n),s&&f.push(s),o&&f.push(o);let d=this.getNumInputs(t);if(f.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${f.length}.`);return t.format(this.method+"( "+f.join(", ")+" )",u,r)}copy(t){return super.copy(t),this.a.copy(t.a),this.b=t.b instanceof We?t.b.clone():t.b,this.c=t.c instanceof We?t.c.clone():t.c,this.method=t.method,this}},tt=Nt;tt.RAD="radians",tt.DEG="degrees",tt.EXP="exp",tt.EXP2="exp2",tt.LOG="log",tt.LOG2="log2",tt.SQRT="sqrt",tt.INV_SQRT="inversesqrt",tt.FLOOR="floor",tt.CEIL="ceil",tt.NORMALIZE="normalize",tt.FRACT="fract",tt.SATURATE="saturate",tt.SIN="sin",tt.COS="cos",tt.TAN="tan",tt.ASIN="asin",tt.ACOS="acos",tt.ARCTAN="atan",tt.ABS="abs",tt.SIGN="sign",tt.LENGTH="length",tt.NEGATE="negate",tt.INVERT="invert",tt.MIN="min",tt.MAX="max",tt.MOD="mod",tt.STEP="step",tt.REFLECT="reflect",tt.DISTANCE="distance",tt.DOT="dot",tt.CROSS="cross",tt.POW="pow",tt.MIX="mix",tt.CLAMP="clamp",tt.REFRACT="refract",tt.SMOOTHSTEP="smoothstep",tt.FACEFORWARD="faceforward";var kl=class extends Ye{constructor(t=new We,r=new We,n=new We){super("v4");this.nodeType="TextureCubeUV";this.value=t,this.uv=r,this.bias=n}bilinearCubeUV(t,r,n,s){var c,h,u,f;let o=new Jh(kl.Nodes.bilinearCubeUV,[r,n,s]);this.colorSpaceTL=(c=this.colorSpaceTL)!=null?c:new dn(new Gt("","v4")),this.colorSpaceTL.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(o.build(t)+".tl"),this.colorSpaceTR=(h=this.colorSpaceTR)!=null?h:new dn(new Gt("","v4")),this.colorSpaceTR.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(o.build(t)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new dn(new Gt("","v4")),this.colorSpaceBL.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(o.build(t)+".bl"),this.colorSpaceBR=(f=this.colorSpaceBR)!=null?f:new dn(new Gt("","v4")),this.colorSpaceBR.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(o.build(t)+".br");let a={include:t.isShader("vertex"),ignoreCache:!0};t.addContext(a),this.colorSpaceTLExp=new Gt(this.colorSpaceTL.build(t,"v4"),"v4"),this.colorSpaceTRExp=new Gt(this.colorSpaceTR.build(t,"v4"),"v4"),this.colorSpaceBLExp=new Gt(this.colorSpaceBL.build(t,"v4"),"v4"),this.colorSpaceBRExp=new Gt(this.colorSpaceBR.build(t,"v4"),"v4"),t.removeContext();let l=new Gt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return l.keywords.cubeUV_TL=this.colorSpaceTLExp,l.keywords.cubeUV_TR=this.colorSpaceTRExp,l.keywords.cubeUV_BL=this.colorSpaceBLExp,l.keywords.cubeUV_BR=this.colorSpaceBRExp,l.keywords.cubeUV=o,l}generate(t,r){if(t.isShader("fragment")){let n=this.uv,s=this.bias||t.context.roughness,o=new Jh(kl.Nodes.roughnessToMip,[s]),a=new tt(o,kl.Nodes.m0,kl.Nodes.cubeUV_maxMipLevel,tt.CLAMP),l=new tt(a,tt.FLOOR),c=new tt(a,tt.FRACT),h=this.bilinearCubeUV(t,this.value,n,l),u=this.bilinearCubeUV(t,this.value,n,new Mn(l,new Be(1).setReadonly(!0),Mn.ADD)),f=new tt(h,u,c,tt.MIX);return t.format(f.build(t),"v4",r)}else return console.warn("TextureCubeUVNode is not compatible with "+t.shader+" shader."),t.format("vec4( 0.0 )",this.getType(t),r)}copy(t){return super.copy(t),this.uv.copy(t.uv),this.bias.copy(t.bias),this.value.copy(t.value),t.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(t.colorSpaceTL):this.colorSpaceTL=t.colorSpaceTL.clone():this.colorSpaceTL=void 0,t.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(t.colorSpaceTR):this.colorSpaceTR=t.colorSpaceTR.clone():this.colorSpaceTR=void 0,t.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(t.colorSpaceBL):this.colorSpaceBL=t.colorSpaceBL.clone():this.colorSpaceBL=void 0,t.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(t.colorSpaceBR):this.colorSpaceBR=t.colorSpaceBR.clone():this.colorSpaceBR=void 0,t.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(t.colorSpaceTLExp):this.colorSpaceTLExp=t.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,t.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(t.colorSpaceTRExp):this.colorSpaceTRExp=t.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,t.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(t.colorSpaceBLExp):this.colorSpaceBLExp=t.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,t.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(t.colorSpaceBRExp):this.colorSpaceBRExp=t.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}},Vl=kl;Vl.Nodes=function(){let t=new Ul(`struct TextureCubeUVData {
|
|
2991
2991
|
vec4 tl;
|
|
2992
2992
|
vec4 tr;
|
|
2993
2993
|
vec4 br;
|
|
@@ -3066,7 +3066,7 @@ void main() {
|
|
|
3066
3066
|
mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25
|
|
3067
3067
|
}
|
|
3068
3068
|
return mip;
|
|
3069
|
-
}`,_);return{bilinearCubeUV:c,roughnessToMip:E,m0:f,cubeUV_maxMipLevel:r}}();var Jo=class extends Ye{constructor(t){super("v3");this.nodeType="Normal";this.scope=t!=null?t:Jo.VIEW}getShared(){return this.scope===Jo.WORLD}build(t,r,n,s){let o=t.context[this.scope+"Normal"];return o?o.build(t,r,n,s):super.build(t,r,n)}generate(t,r,n,s,o){let a;switch(this.scope){case Jo.VIEW:t.isShader("vertex")?a="transformedNormal":a="geometryNormal";break;case Jo.LOCAL:t.isShader("vertex")?a="objectNormal":(t.requires.normal=!0,a="vObjectNormal");break;case Jo.WORLD:t.isShader("vertex")?a="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(t.requires.worldNormal=!0,a="vWNormal");break}return t.format(a,this.getType(t),r)}copy(t){return super.copy(t),this.scope=t.scope,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.scope=this.scope),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.scope&&(this.scope=t.scope),this}},Fr=Jo;Fr.LOCAL="local",Fr.WORLD="world",Fr.VIEW="view",Fr.NORMAL="normal";Er.addKeyword("viewNormal",function(){return new Fr(Fr.VIEW)});Er.addKeyword("localNormal",function(){return new Fr(Fr.NORMAL)});Er.addKeyword("worldNormal",function(){return new Fr(Fr.WORLD)});var Ui=class extends Ye{constructor(t){super("v3");this.nodeType="Position";this.scope=t!=null?t:Ui.LOCAL}getType(){switch(this.scope){case Ui.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case Ui.LOCAL:case Ui.WORLD:return!1}return!0}generate(t,r,n,s,o){let a;switch(this.scope){case Ui.LOCAL:t.isShader("vertex")?a="transformed":(t.requires.position=!0,a="vPosition");break;case Ui.WORLD:if(t.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";t.requires.worldPosition=!0,a="vWPosition";break;case Ui.VIEW:a=t.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case Ui.PROJECTION:a=t.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return t.format(a,this.getType(),r)}copy(t){return super.copy(t),this.scope=t.scope,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.scope=this.scope),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.scope&&(this.scope=t.scope),this}},qr=Ui;qr.LOCAL="local",qr.WORLD="world",qr.VIEW="view",qr.PROJECTION="projection";Er.addKeyword("position",function(){return new qr});Er.addKeyword("worldPosition",function(){return new qr(qr.WORLD)});Er.addKeyword("viewPosition",function(){return new qr(qr.VIEW)});var pi=class extends Ye{constructor(t){super("v3");this.nodeType="Reflect";this.scope=t!=null?t:pi.CUBE}getUnique(t){return!t.context.viewNormal}getType(){switch(this.scope){case pi.SPHERE:return"v2"}return this.type}generate(t,r){let n=this.getUnique(t);if(t.isShader("fragment")){let s;switch(this.scope){case pi.VECTOR:{let o=new Fr(Fr.VIEW),a=t.context.roughness,l=o.build(t,"v3"),c=new qr(qr.VIEW).build(t,"v3"),h=a?a.build(t,"f"):void 0,u=`reflect( -normalize( ${c} ), ${l} )`;h&&(u=`normalize( mix( ${u}, ${l}, ${h} * ${h} ) )`);let f=`inverseTransformDirection( ${u}, viewMatrix )`;n?(t.addNodeCode(`vec3 reflectVec = ${f};`),s="reflectVec"):s=f;break}case pi.CUBE:{let o=new pi(pi.VECTOR).build(t,"v3"),a="vec3( -"+o+".x, "+o+".yz )";n?(t.addNodeCode(`vec3 reflectCubeVec = ${a};`),s="reflectCubeVec"):s=a;break}case pi.SPHERE:{let o=new pi(pi.VECTOR).build(t,"v3"),a="normalize( ( viewMatrix * vec4( "+o+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(t.addNodeCode(`vec2 reflectSphereVec = ${a};`),s="reflectSphereVec"):s=a;break}}return t.format(s,this.getType(),r)}else return console.warn("ReflectNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.type,r)}copy(t){return super.copy(t),this.scope=t.scope,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.scope=this.scope),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.scope&&(this.scope=t.scope),this}},zi=pi;zi.CUBE="cube",zi.SPHERE="sphere",zi.VECTOR="vector";var wp=class extends Ye{constructor(t=new jr,r,n){super("v4");this.nodeType="TextureCube";this.value=t,this.radianceNode=new Vl(this.value,r!=null?r:new zi(zi.VECTOR),n),this.irradianceNode=new Vl(this.value,new Fr(Fr.WORLD),new Be(1).setReadonly(!0))}generate(t,r){return t.isShader("fragment")?(t.require("irradiance"),t.context.bias&&t.context.bias.setTexture(this.value),(t.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(t,r)):(console.warn("TextureCubeNode is not compatible with "+t.shader+" shader."),t.format("vec4( 0.0 )",this.getType(t),r))}copy(t){return super.copy(t),this.value.copy(t.value),this.radianceNode.copy(t.radianceNode),this.irradianceNode.copy(t.irradianceNode),this}};var Sp=class extends jt{constructor(t=new Fs,r,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=t,this.uv=r!=null?r:new zi,this.bias=n}getTexture(t,r){return super.generate(t,r,this.value.uuid,"tc")}generate(t,r){var h,u;if(r==="samplerCube")return this.getTexture(t,r);let n=this.getTexture(t,r),s=(h=this.uv)==null?void 0:h.build(t,"v3"),o=this.bias?this.bias.build(t,"f"):void 0;o===void 0&&t.context.bias&&(o=t.context.bias.setTexture(this).build(t,"f"));let a;o?a="texCubeBias( "+n+", "+s+", "+o+" )":a="texCube( "+n+", "+s+" )";let l={include:t.isShader("vertex"),ignoreCache:!0},c=this.getType(t);return t.addContext(l),this.colorSpace=(u=this.colorSpace)!=null?u:new dn(new Gt("",c)),this.colorSpace.fromDecoding(t.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(a),a=this.colorSpace.build(t,c),t.removeContext(),t.format(a,c,r)}copy(t){return super.copy(t),this.value.copy(t.value),t.uv?this.uv?this.uv.copy(t.uv):this.uv=t.uv.clone():this.uv=void 0,t.bias?this.bias?this.bias.copy(t.bias):this.bias=t.bias.clone():this.bias=void 0,this}};var R1=["x","y","z","w"],
|
|
3069
|
+
}`,_);return{bilinearCubeUV:c,roughnessToMip:E,m0:f,cubeUV_maxMipLevel:r}}();var Jo=class extends Ye{constructor(t){super("v3");this.nodeType="Normal";this.scope=t!=null?t:Jo.VIEW}getShared(){return this.scope===Jo.WORLD}build(t,r,n,s){let o=t.context[this.scope+"Normal"];return o?o.build(t,r,n,s):super.build(t,r,n)}generate(t,r,n,s,o){let a;switch(this.scope){case Jo.VIEW:t.isShader("vertex")?a="transformedNormal":a="geometryNormal";break;case Jo.LOCAL:t.isShader("vertex")?a="objectNormal":(t.requires.normal=!0,a="vObjectNormal");break;case Jo.WORLD:t.isShader("vertex")?a="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(t.requires.worldNormal=!0,a="vWNormal");break}return t.format(a,this.getType(t),r)}copy(t){return super.copy(t),this.scope=t.scope,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.scope=this.scope),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.scope&&(this.scope=t.scope),this}},Fr=Jo;Fr.LOCAL="local",Fr.WORLD="world",Fr.VIEW="view",Fr.NORMAL="normal";Er.addKeyword("viewNormal",function(){return new Fr(Fr.VIEW)});Er.addKeyword("localNormal",function(){return new Fr(Fr.NORMAL)});Er.addKeyword("worldNormal",function(){return new Fr(Fr.WORLD)});var Ui=class extends Ye{constructor(t){super("v3");this.nodeType="Position";this.scope=t!=null?t:Ui.LOCAL}getType(){switch(this.scope){case Ui.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case Ui.LOCAL:case Ui.WORLD:return!1}return!0}generate(t,r,n,s,o){let a;switch(this.scope){case Ui.LOCAL:t.isShader("vertex")?a="transformed":(t.requires.position=!0,a="vPosition");break;case Ui.WORLD:if(t.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";t.requires.worldPosition=!0,a="vWPosition";break;case Ui.VIEW:a=t.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case Ui.PROJECTION:a=t.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return t.format(a,this.getType(),r)}copy(t){return super.copy(t),this.scope=t.scope,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.scope=this.scope),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.scope&&(this.scope=t.scope),this}},qr=Ui;qr.LOCAL="local",qr.WORLD="world",qr.VIEW="view",qr.PROJECTION="projection";Er.addKeyword("position",function(){return new qr});Er.addKeyword("worldPosition",function(){return new qr(qr.WORLD)});Er.addKeyword("viewPosition",function(){return new qr(qr.VIEW)});var pi=class extends Ye{constructor(t){super("v3");this.nodeType="Reflect";this.scope=t!=null?t:pi.CUBE}getUnique(t){return!t.context.viewNormal}getType(){switch(this.scope){case pi.SPHERE:return"v2"}return this.type}generate(t,r){let n=this.getUnique(t);if(t.isShader("fragment")){let s;switch(this.scope){case pi.VECTOR:{let o=new Fr(Fr.VIEW),a=t.context.roughness,l=o.build(t,"v3"),c=new qr(qr.VIEW).build(t,"v3"),h=a?a.build(t,"f"):void 0,u=`reflect( -normalize( ${c} ), ${l} )`;h&&(u=`normalize( mix( ${u}, ${l}, ${h} * ${h} ) )`);let f=`inverseTransformDirection( ${u}, viewMatrix )`;n?(t.addNodeCode(`vec3 reflectVec = ${f};`),s="reflectVec"):s=f;break}case pi.CUBE:{let o=new pi(pi.VECTOR).build(t,"v3"),a="vec3( -"+o+".x, "+o+".yz )";n?(t.addNodeCode(`vec3 reflectCubeVec = ${a};`),s="reflectCubeVec"):s=a;break}case pi.SPHERE:{let o=new pi(pi.VECTOR).build(t,"v3"),a="normalize( ( viewMatrix * vec4( "+o+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(t.addNodeCode(`vec2 reflectSphereVec = ${a};`),s="reflectSphereVec"):s=a;break}}return t.format(s,this.getType(),r)}else return console.warn("ReflectNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.type,r)}copy(t){return super.copy(t),this.scope=t.scope,this}toJSON(t){let r=this.getJSONNode(t);return r||(r=this.createJSONNode(t),r.scope=this.scope),r.nodeType=this.nodeType,r}fromJSON(t,r){return super.fromJSON(t,r),t.scope&&(this.scope=t.scope),this}},zi=pi;zi.CUBE="cube",zi.SPHERE="sphere",zi.VECTOR="vector";var wp=class extends Ye{constructor(t=new jr,r,n){super("v4");this.nodeType="TextureCube";this.value=t,this.radianceNode=new Vl(this.value,r!=null?r:new zi(zi.VECTOR),n),this.irradianceNode=new Vl(this.value,new Fr(Fr.WORLD),new Be(1).setReadonly(!0))}generate(t,r){return t.isShader("fragment")?(t.require("irradiance"),t.context.bias&&t.context.bias.setTexture(this.value),(t.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(t,r)):(console.warn("TextureCubeNode is not compatible with "+t.shader+" shader."),t.format("vec4( 0.0 )",this.getType(t),r))}copy(t){return super.copy(t),this.value.copy(t.value),this.radianceNode.copy(t.radianceNode),this.irradianceNode.copy(t.irradianceNode),this}};var Sp=class extends jt{constructor(t=new Fs,r,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=t,this.uv=r!=null?r:new zi,this.bias=n}getTexture(t,r){return super.generate(t,r,this.value.uuid,"tc")}generate(t,r){var h,u;if(r==="samplerCube")return this.getTexture(t,r);let n=this.getTexture(t,r),s=(h=this.uv)==null?void 0:h.build(t,"v3"),o=this.bias?this.bias.build(t,"f"):void 0;o===void 0&&t.context.bias&&(o=t.context.bias.setTexture(this).build(t,"f"));let a;o?a="texCubeBias( "+n+", "+s+", "+o+" )":a="texCube( "+n+", "+s+" )";let l={include:t.isShader("vertex"),ignoreCache:!0},c=this.getType(t);return t.addContext(l),this.colorSpace=(u=this.colorSpace)!=null?u:new dn(new Gt("",c)),this.colorSpace.fromDecoding(t.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(a),a=this.colorSpace.build(t,c),t.removeContext(),t.format(a,c,r)}copy(t){return super.copy(t),this.value.copy(t.value),t.uv?this.uv?this.uv.copy(t.uv):this.uv=t.uv.clone():this.uv=void 0,t.bias?this.bias?this.bias.copy(t.bias):this.bias=t.bias.clone():this.bias=void 0,this}};var R1=["x","y","z","w"],EF=["float","vec2","vec3","vec4"],CF={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},PF={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Mp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,r){return t.deps.length-r.deps.length}return function(r,n){let s=this.getIncludes(r,n);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a<s.length;a++)s[a].src&&(o+=s[a].src+`
|
|
3070
3070
|
`);return o}}();this.slots=[],this.caches=[],this.contexts=[],this.keywords={},this.nodeData={},this.fragmentVariables={},this.requires={uv:[],color:[],lights:!1,fog:!1,transparent:!1,irradiance:!1,position:!1,worldPosition:!1,normal:!1,worldNormal:!1,vWorldViewDir:!1,modelMatrix:!1,viewMatrix:!1,projectionMatrix:!1},this.includes={consts:[],functions:[],structs:[]},this.attributes={},this.prefixCode=["#ifdef TEXTURE_LOD_EXT"," #define texCube(a, b) textureCube(a, b)"," #define texCubeBias(a, b, c) textureCubeLodEXT(a, b, c)"," #define tex2D(a, b) texture2D(a, b)"," #define tex2DBias(a, b, c) texture2DLodEXT(a, b, c)","#else"," #define texCube(a, b) textureCube(a, b)"," #define texCubeBias(a, b, c) textureCube(a, b, c)"," #define tex2D(a, b) texture2D(a, b)"," #define tex2DBias(a, b, c) texture2D(a, b, c)","#endif",`
|
|
3071
3071
|
// NOTE: Include Spline's blending modes. This could be part of BlendNode
|
|
3072
3072
|
#define SPE_BLENDING_NORMAL 0
|
|
@@ -3111,7 +3111,7 @@ void main() {
|
|
|
3111
3111
|
`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,r,n="varying",s="V",o=""){let a=this.getVars(n),l=a[e];if(!l){let c=a.length;l={name:r||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,r,n){return this.getVar(e,t,r,this.shader,"T",n)}getAttribute(e,t){if(!this.attributes[e]){let r=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(r.name+" = "+e+";"),this.attributes[e]={varying:r,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(`
|
|
3112
3112
|
`)}getVarListCode(e,t){t=t!=null?t:"";let r="";for(let n=0,s=e.length;n<s;++n){let o=e[n],a=o.type,l=o.name,c=o.size,h=this.getFormatByType(a);if(h===void 0)throw new Error("Node pars "+h+" not found.");h.includes("[]")?r+=t+" "+h.substring(0,h.length-2)+" "+l+`[${c}];
|
|
3113
3113
|
`:r+=t+" "+h+" "+l+`;
|
|
3114
|
-
`}return r}getVars(e){return this.inputs.vars[e!=null?e:this.shader]}getNodeData(e){let t=e instanceof We?e.uuid:e;return this.nodeData[t]=this.nodeData[t]||{}}createUniform(e,t,r,n,s,o){if(t.includes("[]")){let a=this.inputs.arrayUniforms,l=a.list.length,c=new Qh({type:t,size:r.size,name:n||"nodeUA"+l+(o?"_"+o:""),node:r,needsUpdate:s});return a.list.push(c),a[e].push(c),a[e][c.name]=c,this.uniforms[c.name]=c,c}else{let a=this.inputs.uniforms,l=a.list.length,c=new Qh({type:t,name:n||"nodeU"+l+(o?"_"+o:""),node:r,needsUpdate:s});return a.list.push(c),a[e].push(c),a[e][c.name]=c,this.uniforms[c.name]=c,c}}createVertexUniform(e,t,r,n,s){return this.createUniform("vertex",e,t,r,n,s)}createFragmentUniform(e,t,r,n,s){return this.createUniform("fragment",e,t,r,n,s)}include(e,t,r){var o;let n;if(e=typeof e=="string"?Er.get(e):e,this.context.include===!1)return e.name;e instanceof Ne?n=this.includes.functions:e instanceof wt?n=this.includes.consts:e instanceof Ul&&(n=this.includes.structs);let s=n[this.shader]=n[this.shader]||[];if(e){let a=s[e.name];if(a||(a=s[e.name]={node:e,deps:[]},s.push(a),a.src=e.build(this,"source")),e instanceof Ne&&t&&s[t.name]&&s[t.name].deps.indexOf(e)===-1&&(s[t.name].deps.push(e),(o=e.includes)!=null&&o.length)){let l=0;do this.include(e.includes[l++],t);while(l<e.includes.length)}return r&&(a.src=r),e.name}else throw new Error("Include not found.")}colorToVectorProperties(e){return e.replace("r","x").replace("g","y").replace("b","z").replace("a","w")}colorToVector(e){return e.replace(/c/g,"v3")}getIncludes(e,t){return this.includes[e][t||this.shader]}getConstructorFromLength(e){return
|
|
3114
|
+
`}return r}getVars(e){return this.inputs.vars[e!=null?e:this.shader]}getNodeData(e){let t=e instanceof We?e.uuid:e;return this.nodeData[t]=this.nodeData[t]||{}}createUniform(e,t,r,n,s,o){if(t.includes("[]")){let a=this.inputs.arrayUniforms,l=a.list.length,c=new Qh({type:t,size:r.size,name:n||"nodeUA"+l+(o?"_"+o:""),node:r,needsUpdate:s});return a.list.push(c),a[e].push(c),a[e][c.name]=c,this.uniforms[c.name]=c,c}else{let a=this.inputs.uniforms,l=a.list.length,c=new Qh({type:t,name:n||"nodeU"+l+(o?"_"+o:""),node:r,needsUpdate:s});return a.list.push(c),a[e].push(c),a[e][c.name]=c,this.uniforms[c.name]=c,c}}createVertexUniform(e,t,r,n,s){return this.createUniform("vertex",e,t,r,n,s)}createFragmentUniform(e,t,r,n,s){return this.createUniform("fragment",e,t,r,n,s)}include(e,t,r){var o;let n;if(e=typeof e=="string"?Er.get(e):e,this.context.include===!1)return e.name;e instanceof Ne?n=this.includes.functions:e instanceof wt?n=this.includes.consts:e instanceof Ul&&(n=this.includes.structs);let s=n[this.shader]=n[this.shader]||[];if(e){let a=s[e.name];if(a||(a=s[e.name]={node:e,deps:[]},s.push(a),a.src=e.build(this,"source")),e instanceof Ne&&t&&s[t.name]&&s[t.name].deps.indexOf(e)===-1&&(s[t.name].deps.push(e),(o=e.includes)!=null&&o.length)){let l=0;do this.include(e.includes[l++],t);while(l<e.includes.length)}return r&&(a.src=r),e.name}else throw new Error("Include not found.")}colorToVectorProperties(e){return e.replace("r","x").replace("g","y").replace("b","z").replace("a","w")}colorToVector(e){return e.replace(/c/g,"v3")}getIncludes(e,t){return this.includes[e][t||this.shader]}getConstructorFromLength(e){return EF[e-1]}isTypeMatrix(e){return/^m/.test(e)}getTypeLength(e){return e==="f"?1:parseInt(this.colorToVector(e).substr(1))}getTypeFromLength(e){return e===1?"f":"v"+e}findNode(...e){for(let t=0;t<arguments.length;t++){let r=e[t];if(r!=null&&r.isNode)return r}}resolve(...e){for(let t=0;t<arguments.length;t++){let r=e[t];if(r!==void 0){if(r.isNode)return r;if(r.isTexture)switch(r.mapping){case Rs:case Bs:return new Sp(r);case Ya:return new wp(new jr(r));default:return new jr(r)}else{if(r.isVector2)return new Nr(r);if(r.isVector3)return new Or(r);if(r.isVector4)return new di(r)}}}}format(e,t,r){switch(this.colorToVector(r+" <- "+t)){case"f <- v2":return e+".x";case"f <- v3":return e+".x";case"f <- v4":return e+".x";case"f <- i":case"f <- b":return"float( "+e+" )";case"v2 <- f":return"vec2( "+e+" )";case"v2 <- v3":return e+".xy";case"v2 <- v4":return e+".xy";case"v2 <- i":case"v2 <- b":return"vec2( float( "+e+" ) )";case"v3 <- f":return"vec3( "+e+" )";case"v3 <- v2":return"vec3( "+e+", 0.0 )";case"v3 <- v4":return e+".xyz";case"v3 <- i":case"v3 <- b":return"vec2( float( "+e+" ) )";case"v4 <- f":return"vec4( "+e+" )";case"v4 <- v2":return"vec4( "+e+", 0.0, 1.0 )";case"v4 <- v3":return"vec4( "+e+", 1.0 )";case"v4 <- i":case"v4 <- b":return"vec4( float( "+e+" ) )";case"i <- f":case"i <- b":return"int( "+e+" )";case"i <- v2":return"int( "+e+".x )";case"i <- v3":return"int( "+e+".x )";case"i <- v4":return"int( "+e+".x )";case"b <- f":return"( "+e+" != 0.0 )";case"b <- v2":return"( "+e+" != vec2( 0.0 ) )";case"b <- v3":return"( "+e+" != vec3( 0.0 ) )";case"b <- v4":return"( "+e+" != vec4( 0.0 ) )";case"b <- i":return"( "+e+" != 0 )"}return e}getTypeByFormat(e){return CF[e]||e}getFormatByType(e){return PF[e]||e}getUUID(e,t){return t=t!==void 0?t:!0,t&&this.cache&&(e=this.cache+"-"+e),e}getElementByIndex(e){return R1[e]}getIndexByElement(e){return R1.indexOf(e)}isShader(e){return this.shader===e}setShader(e){return this.shader=e,this}mergeDefines(e){for(let t in e)this.defines[t]=e[t];return this.defines}mergeUniform(e){for(let t in e)this.uniforms[t]=e[t];return this.uniforms}getTextureEncodingFromMap(e){let t;return e?e.isTexture&&(t=e.encoding):t=gn,t===gn&&this.context.gamma&&(t=je),t}};var Kh=class extends We{constructor(t=new We){super("v4");this.nodeType="Raw";this.value=t}generate(t){let r=this.value.analyzeAndFlow(t,this.type),n=r.code+`
|
|
3115
3115
|
`;return t.isShader("vertex")?n+="gl_Position = "+r.result+";":n+="gl_FragColor = "+r.result+";",n}copy(t){return super.copy(t),this.value.copy(t.value),this}};var Ot=class extends jt{constructor(t=0,r,n,s){super("c");this.nodeType="Color";this.value=t instanceof Wr?t:new Wr(t||0,r,n,s)}setRGBA(t){this.value.setRGBA(t.r,t.g,t.b,t.a)}generate(t,r,n,s,o,a){n=t.getUUID(n!=null?n:this.getUUID()),s=s!=null?s:this.getType(t);let l=t.getNodeData(n),c=this.getReadonly()&&this.generateReadonly!==void 0;if(this.alpha){let h=this.alpha.build(t,"f");t.addFragmentNodeCode(`accumAlpha += ( 1.0 - accumAlpha ) * ${h};`)}return c?this.generateReadonly(t,r,n,s,o,a):t.isShader("vertex")?(l.vertex||(l.vertex=t.createVertexUniform(s,this,o,a,this.getLabel())),t.format(l.vertex.name,s,r)):(l.fragment||(l.fragment=t.createFragmentUniform(s,this,o,a,this.getLabel())),t.format(l.fragment.name,s,r))}generateReadonly(t,r,n,s,o,a){return t.format("vec3("+this.value.r+", "+this.value.g+", "+this.value.b+")",s,r)}};var ht=class extends jt{constructor(t){super("i");this.nodeType="Int";this.value=Math.floor(t!=null?t:0)}generateReadonly(t,r,n,s,o,a){return t.format(this.value.toString(),s,r)}copy(t){return super.copy(t),this.value=t.value,this}};var $t=class{constructor(e,t,r,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};if(this.id=e,this.uuid=t,r){this.type=r.type;for(let s in r)s!=="type"&&s!=="calpha"&&(this.uniforms[`f${this.id}_${s}`]=r[s]);for(let s in n)this.defines[s]=n[s]}}copy(e){this.id=e.id,this.type=e.type,this.defines=se({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new $t(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=se({},e.defines);for(let r in e.uniforms)this.uniforms[r]=t.getNode(e.uniforms[r]);if(e.type==="texture"){if(!(`f${this.id}_textureSize`in this.uniforms)){let r=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Or(r.width,r.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Nr(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new ht(0)),`f${e.id}_side`in this.uniforms||(this.uniforms[`f${e.id}_side`]=new ht(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new ht(0))}else e.type==="noise"?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new ht(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Or(-1,-1,-1))):e.type==="depth"&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Be(1)));return this}toJSON(e){let t={};for(let n in this.uniforms)t[n]=this.uniforms[n].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let r=this.getName(t);r!==void 0&&e.uniforms[`f${e.id}_${r}`]&&r!=="transmissionDepthMap"&&r!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${r}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let r=`f${this.id}_${e}`;this.hasValueByKey(r)&&t!==void 0&&(this.uniforms[r].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let r=this.getName(t);if(r===void 0)continue;let s=this.uniforms[`f${this.id}_${r}`].value;s!==void 0&&(Array.isArray(s)?e[r]=s.map(o=>o.clone?o.clone():o):e[r]=s.clone?s.clone():s)}return e}getName(e){let r=/f\d+_(.*)/.exec(e);if(r&&r.length>1)return r[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let r=this.getName(t);r&&e.push(r)}return e}isEqual(e){for(let t in e.uniforms){let r=e.getName(t);if(!r)return!1;let n=this.getValue(r),s=e.uniforms[t].value;if(s.value instanceof Pt){if(n.image!==s.image)return!1}else if(Array.isArray(s)){let o=n;for(let a=0,l=o.length;a<l;++a)if(o[a]!==s[a])return!1}else{let o=n;if(o.equals){if(!o.equals(s))return!1}else if(n!==s)return!1}}return!0}dispose(){}};function B1(i){let e=i instanceof $t?i.type:i;return e==="texture"||e==="displace_map"||e==="matcap"}var Zh=class extends jt{constructor(t){super("b");this.nodeType="Bool";this.value=t!=null?t:!1}generateReadonly(t,r,n,s){return t.format(this.value?"true":"false",s,r)}copy(t){return super.copy(t),this.value=t.value,this}};var ps=class extends jt{constructor(t=1,r){super("v4[]");this.nodeType="Vector4Array";this.size=t,this.value=Array.isArray(r)?r:r instanceof Je?new Array(t).fill(r):new Array(t).fill(new Je(0))}copy(t){return super.copy(t),this.value=t.value.map(r=>r.clone()),this}};var Ko=class extends jt{constructor(t=1,r){super("f[]");this.nodeType="FloatArray";this.size=t,this.value=Array.isArray(r)?r:typeof r=="number"?new Array(t).fill(r):new Array(t).fill(0)}copy(t){return super.copy(t),this.size=t.size,this.value=[...t.value],this}};var Hl=class extends jt{constructor(t){super("m3");this.nodeType="Matrix3";this.value=t!=null?t:new Ft}generateReadonly(t,r,n,s,o,a){return t.format("mat3("+this.value.elements.join(", ")+")",s,r)}copy(t){return super.copy(t),this.elements=t.elements,this}get elements(){return this.value.elements}set elements(t){this.value.fromArray(t)}};var eu=class extends Ye{constructor(t=new jr,r,n,s,o,a,l,c,h){super("v3");this.nodeType="CustomTexture";this.firstTime=!0,this.texture=t,this.textureSize=r,this.crop=n,this.projection=s,this.axis=o,this.side=a,this.size=l,this.mat=new Hl(this.texture.value.matrix),this.alpha=c,this.mode=h,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,r){t.require("position"),t.require("normal"),t.require("uv"),t.requires.uv=[!0],t.extensions.shaderTextureLOD=!0,t.extensions.derivatives=!0;let n=`g${this.uuid.toString().replace(/-/g,"")}`,s;switch(this.projection.value){case 3:s=t.include(eu.Nodes.cylindrical);break;case 2:s=t.include(eu.Nodes.spherical);break;case 1:let a=["vec3(1.0, 0.0, 0.0)","vec3(0.0, 1.0, 0.0)","vec3(0.0, 0.0, 1.0)"][this.axis.value],l=new Ne(`
|
|
3116
3116
|
vec3 ${n}_planarTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) {
|
|
3117
3117
|
|
|
@@ -3923,9 +3923,9 @@ vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat
|
|
|
3923
3923
|
outgoingLight = spe_blend( diffuseColor, outgoingLight, ${l.result}, ${c.result} );
|
|
3924
3924
|
}
|
|
3925
3925
|
`),h&&d.push(h.code,`outgoingLight = spe_blend(outgoingLight, ${h.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),r=d.join(`
|
|
3926
|
-
`)}return r}copy(t){return super.copy(t),t.color&&(this.color=t.color.clone()),this.roughness=t.roughness.clone(),this.metalness=t.metalness.clone(),t.position&&(this.position=t.position.clone()),t.afterColor&&(this.afterColor=t.afterColor.clone()),t.alpha&&(this.alpha=t.alpha.clone()),t.reflectivity&&(this.reflectivity=t.reflectivity.clone()),t.shadingAlpha&&(this.shadingAlpha=t.shadingAlpha.clone()),t.shadingBlend&&(this.shadingBlend=t.shadingBlend.clone()),this}};var Rp=class extends Rn{constructor(t=new Ip,r){super(t,t,r);this.type="StandardNodeMaterial",this.fragment=t}get color(){return this.fragment.color}set color(t){this.fragment.color=t}get afterColor(){return this.fragment.afterColor}set afterColor(t){this.fragment.afterColor=t}get alpha(){return this.fragment.alpha}set alpha(t){this.fragment.alpha=t}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(t){this.fragment.shadingAlpha=t}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(t){this.fragment.shadingBlend=t}get position(){return this.fragment.position}set position(t){this.fragment.position=t}get roughness(){return this.fragment.roughness}set roughness(t){this.fragment.roughness=t}get metalness(){return this.fragment.metalness}set metalness(t){this.fragment.metalness=t}get reflectivity(){return this.fragment.reflectivity}set reflectivity(t){this.fragment.reflectivity=t}};var Xl=class extends Rp{constructor(e,t,r){super(t,e),this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=r!=null?r:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Zr){let t=e.userData.layers,r=e.fragment;super.copy(e);let n=r.clone();this.fragment=n,this.vertex=n;let s=t.clone(this);this.userData.layers=s,n.shadingAlpha.value=r.shadingAlpha.value,n.shadingBlend.value=r.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,r){let n=r.getNode(t.vertex),s=new Xl(void 0,n);return s.fromJSON(t,r),s}dispose(){super.dispose()}};function pr(i,e){let t;if(typeof i=="string"){let r=e==null?void 0:e.getColor(i);r?t=r:(console.warn("Tried to create color layer params with a color key that does not exist in the assets manager"),t=new Wr(0,0,0,0))}else return"a"in i?new Wr(i.r,i.g,i.b,i.a):new Wr(i.r,i.g,i.b,1);return t}function Bp(i,e){switch(i.data.type){case"light":return gi(i);case"fresnel":return DF(i,e);case"gradient":return LF(i);case"depth":return IF(i);case"normal":return RF(i);case"noise":return BF(i,e);case"texture":return NF(i,e);case"rainbow":return OF(i);case"transmission":return FF(i,e);case"matcap":return UF(i,e);case"displace":return zF(i);case"color":default:return PF(i,e)}}function O1(i){return{type:i.data.type}}function gi(i){let{alpha:e,mode:t}=i.data;return xe(se({},O1(i)),{alpha:e,mode:t})}function PF(i,e){return xe(se({},gi(i)),{color:pr(i.data.color,e)})}function DF(i,e){let{bias:t,scale:r,intensity:n,factor:s,color:o}=i.data;return xe(se({},gi(i)),{color:pr(o,e),bias:t,scale:r,intensity:n,factor:s})}function LF(i){let{gradientType:e,smooth:t,colors:r,steps:n,angle:s,offset:o,morph:a}=i.data;return xe(se({},gi(i)),{gradientType:e,smooth:t,colors:r.map(l=>new Je(l[0],l[1],l[2],l[3])),num:r.length,steps:n,offset:new B(...o),morph:new B(...a),angle:s})}function IF(i){let{gradientType:e,near:t,far:r,isVector:n,isWorldSpace:s,origin:o,direction:a,colors:l,steps:c,smooth:h,num:u}=i.data;return xe(se({},gi(i)),{gradientType:e,near:t,far:r,isVector:n,isWorldSpace:s,origin:new M(...o),direction:a?new M(...a):new M(1,0,0),num:u,colors:l.map(f=>new Je(f[0],f[1],f[2],f[3])),steps:c,smooth:h})}function RF(i){let{cnormal:e}=i.data;return xe(se({},gi(i)),{cnormal:new M(e[0],e[1],e[2])})}function BF(i,e){let{data:t}=i;return xe(se({},gi(i)),{scale:t.scale,move:t.move,fA:new B(...t.fA),fB:new B(...t.fB),size:new M(...t.size),distortion:new B(...t.distortion),colorA:pr(t.colorA,e),colorB:pr(t.colorB,e),colorC:pr(t.colorC,e),colorD:pr(t.colorD,e),noiseType:t.noiseType})}function NF(i,e){let{projection:t,axis:r,side:n,crop:s,size:o}=i.data,{image:a,wrapping:l,repeat:c,offset:h}=i.data.texture,u=new Pt,f;if(typeof a=="string")f=e==null?void 0:e.getImage(a);else{let d=new Image;d.src=co(a.data),d.onload=()=>{e!=null&&e.onImageLoad&&(e==null||e.onImageLoad())},f=d}return u.image=f,u.repeat.set(c[0],c[1]),u.offset.set(h[0],h[1]),u.wrapS=u.wrapT=l,xe(se({},gi(i)),{texture:u,mat:new Ft().setUvTransform(h[0],h[1],c[0],c[1],0,0,0),crop:s,projection:t,axis:["x","y","z"].indexOf(r),side:[2,0,1].indexOf(n),size:o})}function OF(i){let{data:e}=i;return xe(se({},gi(i)),{filmThickness:e.filmThickness,movement:e.movement,wavelengths:new M(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new M(...e.offset)})}function FF(i,e){let{data:t}=i;return xe(se({},gi(i)),{thickness:t.thickness,ior:t.ior,roughness:t.roughness,transmissionSamplerMap:e.transmissionSamplerMap,transmissionDepthMap:e.transmissionDepthMap})}function UF(i,e){let t=new Pt,{image:r}=i.data.texture,n;if(typeof r=="string")n=e==null?void 0:e.getImage(r);else{let o=new Image;o.src=co(r.data),o.onload=()=>{e!=null&&e.onImageLoad&&(e==null||e.onImageLoad())},n=o}t.image=n;let s=16777215;return xe(se({},gi(i)),{color:s,texture:t})}function zF(i){let{data:e}=i,t=xe(se({},O1(i)),{intensity:e.intensity});if(e.displacementType==="noise")return xe(se({},t),{offset:new M(...e.offset),scale:e.scale,movement:e.movement,noiseType:e.noiseType});{let r=new Pt,n=new Ft().setUvTransform(0,0,1,1,0,0,0);return xe(se({},t),{texture:r,mat:n,crop:e.crop})}}function Np(i,e,t){if(t.type==="displace"&&(i==="intensity"||i==="visible")){let r=e.uniforms[`f${e.id}_intensity`];return r?(r.value=t.intensity*(t.visible?1:0),r):void 0}if(t.type!=="displace"&&(i==="alpha"||i==="visible")){let r=e.uniforms[`f${e.id}_alpha`];return r?(r.value=t.alpha*(t.visible?1:0),r):void 0}}var Ql;(e=>{function i(t){return new be(t.x,t.y,t.z).getHex()}e.getHex=i})(Ql||(Ql={}));var F1;(e=>{function i(t){return new Je(t.r,t.g,t.b,t.a)}e.getThreeVector4=i})(F1||(F1={}));var U1;(t=>{function i(r,n){r.setRGB(n.r,n.g,n.b)}t.setThreeColor=i;function e(r){return new be(r.r,r.g,r.b).getHex()}t.getHex=e})(U1||(U1={}));function uu(i,e){return typeof i=="string"?e.getMaterialOrDeletedPlaceholder(i):_v(i,e)}function z1(i,e){return i.map(t=>uu(t,e))}function _v(i,e){var o,a;let t=(o=i.layers)!=null?o:ui.defaultTwoLayerData("phong").layers,r=GF(t),n;switch(r.category){case"basic":n=new Yr;break;case"lambert":{n=new ql;break}case"toon":{n=new Yl;break}case"physical":n=new Xl;break;case"phong":default:{n=new pn;break}}n.name=(a=i.name)!=null?a:"Untitled Material";let s=n.userData.layers;kF(s);for(let l=t.length-1;l>=0;l--)VF(s,t[l],e);switch(r.category){case"basic":break;case"lambert":{let h=n,f=pr(r.emissive,e);f instanceof be?h.emissive.value=f:h.emissive.value.setHex(Ql.getHex(f));break}case"toon":{let h=n,u=r;h.shininess.value=u.shininess;let f=pr(u.specular,e);f instanceof be?h.specular.value=f:h.specular.value.setHex(Ql.getHex(f));break}case"physical":let l=n,c=r;l.metalness.value=c.metalness,l.roughness.value=c.roughness,l.reflectivity.value=c.reflectivity;break;case"phong":default:{let h=n,u=r;h.shininess.value=u.shininess;let f=pr(u.specular,e);f instanceof be?h.specular.value=f:h.specular.value.setHex(Ql.getHex(f));break}}return s.blendColors(),s.blendAfterColors(),s.blendPositions(),n}function GF(i){for(let e of i)if(e.data.type==="light")return e.data;return{type:"light",category:"basic",visible:!0,alpha:1,mode:0}}function kF(i){for(let e of i.getLayers())i.removeLayer(e.id)}function VF(i,e,t){let r=Bp(e,t);r.type==="transmission"&&(r.transmissionSamplerMap=t==null?void 0:t.transmissionSamplerMap,r.transmissionDepthMap=t==null?void 0:t.transmissionDepthMap);let n=i.addLayer(r);n.uuid=e.id;for(let s in e.data)Np(s,n,e.data)}var Zo=i=>"isEntity"in i,er=i=>"isAbstractMesh"in i,Lt=i=>i!==null&&i.isBooleanMesh,G1=i=>i.objectType==="CombinedCamera",k1=i=>Zo(i)&&(i.objectType==="LightDirectional"||i.objectType==="LightSpot"||i.objectType==="LightPoint");var ms=i=>"objectHelper"in i;function Ev(i,e){var r;let t=!1;e.position&&(i.position.fromArray(e.position),t=!0),e.rotation&&(i.rotation.fromArray(e.rotation),t=!0),e.scale&&(t=!0,i.scale.fromArray(e.scale)),e.hiddenMatrix!==void 0&&"hiddenMatrix"in i&&(t=!0,i.hiddenMatrix.fromArray((r=e.hiddenMatrix)!=null?r:Di.identity)),t&&(i.updateMatrix(),Lt(i.parent)&&er(i)&&i.invalidateDownstreamBooleanData(!0).recomputeBoolean()),e.position&&e.rotation&&e.scale&&e.hiddenMatrix!==void 0&&i.updateWorldMatrix(!1,!0),i.objectType==="CombinedCamera"&&(e.isUpVectorFlipped!==void 0&&(i.isUpVectorFlipped=e.isUpVectorFlipped),i.updateUp())}function HF(i,e){Ev(i,e),e.name!==void 0&&(i.name=e.name),e.visible!==void 0&&(i.isEntity?i.visibility=e.visible:i.visible=e.visible)}function V1(i,e,t){HF(i,e),e.color!==void 0&&(i.color=pr(e.color,t)),e.intensity!==void 0&&(i.intensity=e.intensity),e.shadows!==void 0&&!(i instanceof Hs)&&(i.castShadow=e.shadows),i.shadow&&!(i instanceof Hs)&&e.depth!==void 0&&(i.shadow.camera.far=e.depth,i.shadow.needsUpdate=!0),e.helper!==void 0&&ms(i)&&(i.enableHelper=e.helper,i.gizmos.shadowmap.visible=e.helper)}function H1(i,e){i.shadow.camera.right=e/2,i.shadow.camera.left=-e/2,i.shadow.camera.top=e/2,i.shadow.camera.bottom=-e/2,i.shadow.needsUpdate=!0}var Jl=new Kt,Xr=new M,Ge=new M,wr=new Ae;function WF(i,e,t=0,r=e.count){let n=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let h=t;h<r;h++){let u=e.getX(h),f=e.getY(h),d=e.getZ(h);u<n&&(n=u),f<s&&(s=f),d<o&&(o=d),u>a&&(a=u),f>l&&(l=f),d>c&&(c=d)}return i.min.set(n,s,o),i.max.set(a,l,c),i}var W1=(i,e,t,r)=>{var n;if(er(i)){let s=i.geometry.userData.parameters,o=i.geometry.getAttribute("position");i.geometry.userData.type==="SubdivGeometry"?Xr.copy(i.originalGeometry.boundingSphere.center):o!==void 0&&(WF(Jl,o,i.geometry.drawRange.start,i.geometry.drawRange.count<1/0?i.geometry.drawRange.count:o.count),Jl.getCenter(Xr)),i.forceComputeSize?Jl.getSize(Ge).multiplyScalar(.5):Ge.set(s.width,s.height,(n=s.depth)!=null?n:0).multiplyScalar(.5)}else if(ms(i)&&r===!0){let s=i.geometryHelper.getAttribute("position");Jl.setFromArray(s.array),Jl.getCenter(Xr),Jl.getSize(Ge).multiplyScalar(.5)}else Xr.setScalar(0),Ge.setScalar(0);wr.copy(e).multiply(i.matrixWorld),Ge.x===0&&Ge.y===0&&Ge.z===0?t.push(new M(Xr.x,Xr.y,Xr.z).applyMatrix4(wr)):t.push(new M(-Ge.x,Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(-Ge.x,-Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,-Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(-Ge.x,Ge.y,-Ge.z).add(Xr).applyMatrix4(wr),new M(-Ge.x,-Ge.y,-Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,-Ge.y,-Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,Ge.y,-Ge.z).add(Xr).applyMatrix4(wr))},fu=class extends Kt{constructor(){super(...arguments);this.matrix=new Ae;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(r=>r.clone()),this.faces=t.faces.map(r=>r.clone()),this.edges=t.edges.map(r=>r.clone()),this.centerEdges=t.centerEdges.map(r=>r.clone()),this}setFromObjectSize(t,r=!1){t.updateWorldMatrix(!1,r),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let n=new Ae().copy(t.matrixWorld).invert();return this.expandByObjectSize(t,n,r)}expandByObjectSize(t,r,n=!1){let s=[];return n===!0?t.traverseEntity(o=>{o.visible&&W1(o,r,s,t.enableHelper===!0)}):W1(t,r,s,t.enableHelper===!0),this.setFromPoints(s)}getCenter(t){return t=super.getCenter(t),t.applyMatrix4(this.matrix),t}getPositionToCenter(t){return t=super.getCenter(t),t.applyMatrix4(wr.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(Ge).multiplyScalar(.5),this.getCenter(Xr),wr.copy(this.matrix).setPosition(Xr),this.vertices=[new M(-Ge.x,Ge.y,Ge.z).applyMatrix4(wr),new M(-Ge.x,-Ge.y,Ge.z).applyMatrix4(wr),new M(Ge.x,-Ge.y,Ge.z).applyMatrix4(wr),new M(Ge.x,Ge.y,Ge.z).applyMatrix4(wr),new M(-Ge.x,Ge.y,-Ge.z).applyMatrix4(wr),new M(-Ge.x,-Ge.y,-Ge.z).applyMatrix4(wr),new M(Ge.x,-Ge.y,-Ge.z).applyMatrix4(wr),new M(Ge.x,Ge.y,-Ge.z).applyMatrix4(wr)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new Jr(this.vertices[0],this.vertices[3]),new Jr(this.vertices[1],this.vertices[2]),new Jr(this.vertices[5],this.vertices[6]),new Jr(this.vertices[4],this.vertices[7]),new Jr(this.vertices[0],this.vertices[1]),new Jr(this.vertices[3],this.vertices[2]),new Jr(this.vertices[7],this.vertices[6]),new Jr(this.vertices[4],this.vertices[5]),new Jr(this.vertices[0],this.vertices[4]),new Jr(this.vertices[1],this.vertices[5]),new Jr(this.vertices[2],this.vertices[6]),new Jr(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(t=>t.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function du(i){let e=[];for(let t in i){let r=i[t];delete r.metadata,e.push(r)}return e}function jF(i){let e=[];for(let t in i)e.push(i[t]);return e}var Op=i=>class extends i{hasEntityChild(){return this.children.some(t=>Zo(t))}isDescendantOf(t){t instanceof ot&&(t=t.uuid);let r=this;for(;r.parent;){if(r.parent.uuid===t)return!0;r=r.parent}return!1}attach(t,r){this.updateWorldMatrix(!0,!1);let n=new Ae().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),n.multiply(t.parent.matrixWorld)),Zo(t)?t.hiddenMatrix.premultiply(n):t.applyMatrix4(n),t.updateWorldMatrix(!1,!1),this.add(t),r!==void 0&&(this.children.pop(),this.children.splice(r,0,t)),this}copy(t,r=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),r===!0)for(let n=0;n<t.children.length;n++){let s=t.children[n];this.add(s.clone())}return this}toJSON(t){let r=t===void 0,n={object:{uuid:"",objectType:""}};t===void 0&&(t={geometries:{},materials:{},textures:{},images:{},interactionStates:{},nodes:{}},n.metadata={version:1.5,type:"Object",generator:"Object3D.toJSON"});let s={uuid:this.uuid,objectType:this.type};if(this.name!==""&&(s.name=this.name),s.matrix=this.matrix.toArray(),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),s.layers=this.layers.mask,JSON.stringify(this.userData)!=="{}"&&(s.userData=this.userData),this.children.length>0){s.children=[];for(let o of this.children)(Zo(o)||o instanceof bn)&&s.children.push(o.toJSON(t).object)}if(r){let o=du(t.geometries),a=du(t.materials),l=du(t.textures),c=du(t.images),h=du(t.interactionStates),u=jF(t.nodes);o.length>0&&(n.geometries=o),a.length>0&&(n.materials=a),l.length>0&&(n.textures=l),c.length>0&&(n.images=c),h.length>0&&(n.interactionStates=h),u.length>0&&(n.nodes=u)}return n.object=s,n}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var Xn=i=>"isEntity"in i,j1=i=>"isAbstractMesh"in i,Qn=i=>class extends Op(i){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new Ae;this._singleBBox=new fu;this._recursiveBBox=new fu;this.singleBBoxNeedsUpdate=!0;this.recursiveBBoxNeedsUpdate=!0;this.forceComputeSize=!1}set visibility(r){this.visible=r;for(let n of this.children)Xn(n)&&n.traverseEntity(s=>{ms(s)&&s.visible&&(s.objectHelper.visible=r)})}get visibility(){return this.visible}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}resetBBoxNeedsUpdate(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.traverseAncestors(r=>{Xn(r)&&(r.singleBBoxNeedsUpdate=!0,r.recursiveBBoxNeedsUpdate=!0)}),this.traverseEntity(r=>{r.singleBBoxNeedsUpdate=!0,r.recursiveBBoxNeedsUpdate=!0})}traverseEntity(r){r(this);for(let n of this.children)Xn(n)&&n.traverseEntity(r)}updateMatrixWorld(r){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||r)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,r=!0);for(let n of this.children)n.updateMatrixWorld(r)}updateWorldMatrix(r,n){let s=this.parent;if(r&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let o of this.children)o.updateWorldMatrix(!1,!0)}shallowClone(r){return new this.constructor().shallowCopy(this,r)}shallowCopy(r,n=!0){if(super.copy(r,!1),this.raycastLock=r.raycastLock,this.scaleLock=r.scaleLock,this.hiddenMatrix.copy(r.hiddenMatrix),n===!0)for(let s of r.children)Xn(s)&&this.add(s.shallowClone());return this}clone(r){return new this.constructor().copy(this,r)}copy(r,n=!0){if(super.copy(r,!1),this.raycastLock=r.raycastLock,this.scaleLock=r.scaleLock,this.hiddenMatrix.copy(r.hiddenMatrix),n===!0)for(let s of r.children)Xn(s)&&this.add(s.clone());return this}keepChildrenMatrixWorld(){let r=new Ae,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),r.copy(this.matrixWorld).invert(),r.multiply(n);for(let s of this.children)Xn(s)&&s.hiddenMatrix.premultiply(r)}toJSON(r){let n=super.toJSON(r),s=n.object;return this.raycastLock===!0&&(s.raycastLock=!0),this.scaleLock===!0&&(s.scaleLock=!0),s.hiddenMatrix=this.hiddenMatrix.toArray(),n}fromJSON(r){return super.fromJSON(r),r.raycastLock!==void 0&&(this.raycastLock=r.raycastLock),r.scaleLock!==void 0&&(this.scaleLock=r.scaleLock),this.hiddenMatrix.fromArray(r.hiddenMatrix),this}fromObject3D(r){let n=r.children;return r.children=[],Object.assign(r,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new Ae}),this.copy(r),r.children=n,this}toObjectTransformState(r=[]){this.updateWorldMatrix(!0,!1);let n={position:this.position.toArray(),rotation:[this.rotation.x,this.rotation.y,this.rotation.z],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};return wl(n,r)}fromObjectTransformState(r){return r.position&&this.position.fromArray(r.position),r.rotation&&this.rotation.fromArray(r.rotation),r.scale&&this.scale.fromArray(r.scale),r.hiddenMatrix&&this.hiddenMatrix.fromArray(r.hiddenMatrix),this.updateMatrix(),this}toState(r=[]){let n=se({name:this.name,visible:this.visible,raycastLock:this.raycastLock},this.toObjectTransformState(r));return wl(n,r)}fromState(r,n){return r.name&&(this.name=r.name),r.raycastLock!==void 0&&(this.raycastLock=r.raycastLock),r.type!=="OrthographicCamera"&&r.type!=="PerspectiveCamera"&&(this.matrixAutoUpdate=!1),r.visible!==void 0&&(this.visibility=r.visible),this.fromObjectTransformState(r),this}};var pu=class extends ot{constructor(t,r={}){super();this.object=t;let n=t.recursiveBBox.getSize(new M),s=.1;this.parameters=Fd.defaultData(n.toArray(),s),Vo(this.parameters,r),this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let t of this.children)t.material=this.object.material}setHideBase(t){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let r of this.object.material)r.visible=!0;if(t){let r=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=r}else for(let r of this.children)r.material=this.object.material}for(let r of this.object.material)r.visible=!t}else{if(this.children.length>0)if(this.object.material.visible=!0,t){let r=this.object.material.clone();for(let n of this.children)n.material=r}else for(let r of this.children)r.material=this.object.material;this.object.material.visible=!t}this.parameters.hideBase=t}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}this.children.forEach(t=>t.updateMatrix())}_updateCount(){let t=this.parameters.type==="grid"?this.parameters.grid.count[0]*this.parameters.grid.count[1]*this.parameters.grid.count[2]:this.parameters.count;if(this.children.length!==t)if(this.children.length<t)for(let r=0,n=t-this.children.length;r<n;++r){let s=this.object.shallowClone(!1);s.visible=!0,this.add(s),this.parameters.hideBase&&this.setHideBase(!0)}else for(let r=0,n=this.children.length-t;r<n;++r)this.remove(this.children[0])}_updateRadial(t){let r=t.radial,n=r.start*et.DEG2RAD,s=r.end*et.DEG2RAD,o=n-s,a=new yn(r.rotation[0]*et.DEG2RAD,r.rotation[1]*et.DEG2RAD,r.rotation[2]*et.DEG2RAD),l;switch(r.axis){case"z":l=new M(0,0,1);break;case"y":l=new M(0,1,0);break;default:case"x":l=new M(1,0,0);break}for(let[c,h]of this.children.entries()){h.hiddenMatrix.identity(),h.scale.x=r.scale[0],h.scale.y=r.scale[1],h.scale.z=r.scale[2],h.position.setScalar(0);let u=o/t.count*c-n;switch(r.axis){case"x":h.rotation.set(0,u,0);break;case"y":h.rotation.set(0,0,u);break;case"z":h.rotation.set(u,0,0);break}h.translateOnAxis(l,r.radius),h.position.x+=r.position[0],h.position.y+=r.position[1],h.position.z+=r.position[2],r.alignment===!0?(h.rotation.x+=a.x,h.rotation.y+=a.y,h.rotation.z+=a.z):h.rotation.copy(a)}}_updateLinear(t){if(t.type!=="linear")throw new Error;let r=t.linear,n=new yn(r.rotation[0]*et.DEG2RAD,r.rotation[1]*et.DEG2RAD,r.rotation[2]*et.DEG2RAD);for(let[s,o]of this.children.entries())o.hiddenMatrix.identity(),o.scale.x=1+(r.scale[0]-1)*s,o.scale.y=1+(r.scale[1]-1)*s,o.scale.z=1+(r.scale[2]-1)*s,o.rotation.x=n.x*s,o.rotation.y=n.y*s,o.rotation.z=n.z*s,o.position.x=r.position[0]*s,o.position.y=r.position[1]*s,o.position.z=r.position[2]*s}_updateGrid(t){let r=0,n=t.grid;if(n.useCenter===!0){let s={x:n.count[0]%2===0?2:1,y:n.count[1]%2===0?2:1,z:n.count[2]%2===0?2:1},o=new M(n.size[0]*(n.count[0]-s.x)*.5,n.size[1]*(n.count[1]-s.y)*.5,n.size[2]*(n.count[2]-s.z)*.5);for(let a=0;a<n.count[0];a++)for(let l=0;l<n.count[1];l++)for(let c=0;c<n.count[2];c++){let h=this.children[r++];h.hiddenMatrix.identity(),h.scale.setScalar(1),h.rotation.set(0,0,0),h.position.x=n.size[0]*a-o.x,h.position.y=n.size[1]*l-o.y,h.position.z=n.size[2]*c-o.z}}else for(let s=0;s<n.count[0];s++)for(let o=0;o<n.count[1];o++)for(let a=0;a<n.count[2];a++){let l=this.children[r++];l.hiddenMatrix.identity(),l.scale.setScalar(1),l.rotation.set(0,0,0),l.position.x=n.size[0]*s,l.position.y=-n.size[1]*o,l.position.z=-n.size[2]*a}}fromJSON(t){return this}toJSON(){return{}}fromClonerState(t){return t.hideBase!==void 0&&this.setHideBase(t.hideBase),Vo(this.parameters,t),this.update(),this}};var kt=class extends Qn(Vt){constructor(t,r){super(t,r);this.isAbstractMesh=!0;this.isBooleanMesh=!1;this.booleanMeshSetAddress=-1;this.booleanWasTransformed=!1;this.booleanMatrixInvOld=new Ae;this.booleanExclude=null;Array.isArray(r)&&(this.selectedMaterial=0,t.groups.length===0&&t.addGroup(0,t.getAttribute("position").count,0))}get cloner(){return this._cloner}set cloner(t){this._cloner&&this.remove(this._cloner),t&&this.add(t),this._cloner=t}getSelectedMaterial(t){return Array.isArray(this.material)?(this.selectedMaterial===void 0&&(this.selectedMaterial=t!=null?t:0),this.material[t!=null?t:this.selectedMaterial]):this.material}setSelectedMaterial(t,r){Array.isArray(this.material)?(this.selectedMaterial===void 0&&(this.selectedMaterial=r!=null?r:0),r=r!=null?r:this.selectedMaterial,this.material[r].dispose(),this.material[r]=t):(this.material.dispose(),this.material=t)}updateGeometry(t){let r=this.geometry,n=Cv[r.userData.type],s=this.objectType==="NonParametric"?Object.assign({},r.userData,{geometry:r}):r.userData,o=n.build(n.normalizeInputs(t,s)),a=r.uuid;if(this.geometry.dispose(),this.geometry=o,this.geometry.uuid=a,this.geometry.computeBoundingSphere(),this.cloner)for(let l of this.cloner.children)l.geometry=this.geometry}resizeGeometry(t,r,n){Xh.resizeGeometry(this.geometry,{width:t,height:r,depth:n})}shallowClone(t){return new this.constructor(this.geometry,this.material).shallowCopy(this,t)}clone(t){let r=this.objectType==="NonParametric"?Object.assign({},this.geometry.userData,{geometry:this.geometry.clone()}):this.geometry.userData,n=mu(r),s=Array.isArray(this.material)?this.material.map(o=>o.clone()):this.material.clone();return new this.constructor(n,s).copy(this,t)}copy(t,r=!0){return super.copy(t,r),t.cloner&&(this.cloner=new pu(t,t.cloner.parameters),this.add(this.cloner)),this}setFromClonerState(t){t===null?this.cloner=void 0:(this.cloner===void 0&&(this.cloner=new pu(this)),this.cloner.fromClonerState(t))}fromState(t,r){var n,s,o;return super.fromState(t),t.type==="Mesh"&&(this.setFromClonerState(t.cloner),this.castShadow=(n=t.castShadow)!=null?n:!0,this.receiveShadow=(s=t.receiveShadow)!=null?s:!0,this.booleanExclude=(o=t.booleanExclude)!=null?o:null),this}freeBooleanPointer(){this.booleanMeshSetAddress!==-1&&(Jn.freeMeshSet(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Lt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)er(t)&&(t.freeBooleanPointer(),Lt(t)&&t.invalidateUpstreamBooleanData())}};var qF=new M(0,0,1),q1=new M,Y1=new M,X1=new Ft,ho=class extends kt{constructor(t=Hr.create({}),r=new Yr({side:or})){var n;super(t,r);this.recursiveSelection=!1;this.objectType="VectorObject";this.eventDispatcher=new Yt;this._onShapeUpdate=()=>{this.updateGeometry({}),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=t.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(t){let r=super.toJSON(t);return r.object.objectType="VectorObject",r}fromState(t){return super.fromState(t),this.shape.update(),this}setHelperVisibility(){}updateGeometry(t){if(super.updateGeometry(t),"userData"in this.geometry){let r=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:r})}}setShape(t){var r,n;this.shape&&((r=this.shape.eventDispatcher)==null||r.removeEventListener("update",this._onShapeUpdate)),this.shape=t,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(t,r){super.updateWorldMatrix(t,r),X1.getNormalMatrix(this.matrixWorld),q1.copy(qF).applyMatrix3(X1).normalize(),Y1.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(q1,Y1)}clone(t){let r=this.shape.clone(),n=this.material.clone(),s=this.geometry.userData,o=Hr.create(Object.assign({},s,{shape:r})),a=new ho(o,n).copy(this,t);return a.shape=r,r.update(),a}raycast(t,r){kt.prototype.raycast.call(this,t,r)}};function Fp(i,e){return YF(i)}function YF(i){let e={parameters:i,type:i.type};if(i.type==="VectorGeometry"){let r=Tt.createFromState(i.shape,i.width,i.height);e.shape=r}else i.type==="NonParametricGeometry"&&(i.data.groups&&i.data.groups.forEach(r=>{var n;return r.materialIndex=Math.max((n=r.materialIndex)!=null?n:0,0)}),e.geometry=new Ws().parse(i));let t;try{t=mu(e)}catch(r){console.error(r)}if(!t){let r=Tt.createFromState(El.defaultData(),100,100);e.shape=r,t=mu(e)}return t}var Ke;bp.then(i=>{Ke=i});var Q1=new Float32Array([10,10,0,-10,10,0,-10,-10,0,10,-10,0]),J1=new Uint32Array([0,1,2,3]),K1=new Uint8Array([4]),Kn=class{static build(i,e,t,r,n){var c,h;let s,o,a,l=(h=(c=i==null?void 0:i.phongAngle)!=null?c:e==null?void 0:e.phongAngle)!=null?h:35;if(r===!1&&(l=-1),i.positionWASM!==void 0){t&&t!==0&&(Ke.free_bvh(t),Ke.free_subdivision_surface(t));try{s=Kn.allocate(i,n)}catch(u){console.error(u,i),s=Kn.allocate({positionWASM:Q1,indexWASM:J1,verticesPerFaceWASM:K1},n)}Ke.set_destination_refinement_level(s,0),o=Kn.buildLevel(s,!0,l)}else s=t,i.phongAngle!==void 0&&(o=Kn.buildLevel(s,!0,l));return i.subdivisions!==void 0&&(Ke.set_destination_refinement_level(s,i.subdivisions),i.subdivisions>0?a=Kn.buildLevel(s,!1,l):a=null),{subdivPointer:s,originalGeometry:o,subdividedGeometry:a}}static primitiveToQuads(i,e){i.widthSegments>16&&(i.widthSegments=16),i.heightSegments>16&&(i.heightSegments=16),i.depthSegments>16&&(i.depthSegments=16),i.radialSegments>16&&(i.radialSegments=16),i.type==="DodecahedronGeometry"&&(i.detail=0);let t=i.shape!==void 0?e.geometry:Fp(i),r,n,s,o;return{positions:r,triIndices:o}=Iv(t.getAttribute("position"),t.getIndex()),{indices:n,verticesPerFace:s}=Rv(r,o,t),{positions:r,indices:n,verticesPerFace:s}}static allocate(i,e){var b;let t,r,n,s=[],o=[];i.positionWASM&&i.positionWASM.length>0?(t=i.positionWASM,r=i.indexWASM,n=i.verticesPerFaceWASM):(t=Q1,r=J1,n=K1);let a=t.length,l=r.length,c=n.length,h=t.length+s.length+o.length,u=r.length+n.length,f=h*Float32Array.BYTES_PER_ELEMENT+u*Uint32Array.BYTES_PER_ELEMENT,d=h*Float32Array.BYTES_PER_ELEMENT,p=u*Uint32Array.BYTES_PER_ELEMENT,m=Ke._malloc(f),g=new Float32Array(Ke.HEAPF32.buffer,m,h),v=new Uint32Array(Ke.HEAPU32.buffer,m+d,u);g.set(t,0),g.set(s,t.length),g.set(o,t.length+s.length),v.set(r,0),v.set(n,r.length);let y;(b=i==null?void 0:i.scaleBaked)!=null&&b.some(S=>S!==1)&&(y=new Ae().makeScale(...i.scaleBaked)),e&&(y?y.premultiply(e):y=e);let w=y?Ke.alloc_subdivision_surface2(m,a,m+d,l,m+d+r.length*Uint32Array.BYTES_PER_ELEMENT,c,y.elements):Ke.alloc_subdivision_surface(m,a,m+d,l,m+d+r.length*Uint32Array.BYTES_PER_ELEMENT,c);return Ke._free(m),w}static buildLevel(i,e,t,r,n){let s=n?Ke.get_mesh_data2(i,e?Ke.Level.CONTROL:Ke.Level.REFINED,t,n.elements):Ke.get_mesh_data(i,e?Ke.Level.CONTROL:Ke.Level.REFINED,t),o=8,a=Ke.HEAPU32.subarray(s>>2,(s>>2)+o),l=a.subarray(4,4+4),c=0,h=Ke.HEAPU32[a[c]>>2],u=Ke.HEAPF32.subarray(h>>2,(h>>2)+l[c]);c++;let f=Ke.HEAPU32[a[c]>>2],d=Ke.HEAPF32.subarray(f>>2,(f>>2)+l[c]);c++;let p=Ke.HEAPU32[a[c]>>2],m=Ke.HEAPU32.subarray(p>>2,(p>>2)+l[c]);c++;let g=Ke.HEAPU32[a[c]>>2],v=Ke.HEAPU32.subarray(g>>2,(g>>2)+l[c]);if(c++,r===void 0){let y=new De;if(y.setIndex(new Os(v,1)),y.setAttribute("position",new Te(u,3)),y.setAttribute("normal",new Te(d,3)),e){y.setAttribute("faceMap",new Os(m,1));let w=new Float32Array(d.length/3*4).fill(0);y.setAttribute("color",new Ve(w,4))}return Ke.free_mesh_data(s),y.userData.type="SubdivGeometry",y}r.getAttribute("position").copyArray(u),r.getAttribute("normal").copyArray(d),r.attributes.position.needsUpdate=!0,r.attributes.normal.needsUpdate=!0,Ke.free_mesh_data(s)}static buildControlCageWireframe(i,e,t){let r=Ke.get_wireframe_data_for_base_level(i),n=4,s=Ke.HEAPU32.subarray(r>>2,(r>>2)+n),o=s.subarray(2,2+2),a=0,l=Ke.HEAPU32[s[a]>>2],c=Ke.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let h=Ke.HEAPU32[s[a]>>2],u=Ke.HEAPU32.subarray(h>>2,(h>>2)+o[a]);if(e===void 0){let f=new De;f.setAttribute("position",new Te(c,3));let d=new Float32Array(c.length);for(let p=0,m=c.length;p<m;)d[p++]=t.r,d[p++]=t.g,d[p++]=t.b;return f.setAttribute("color",new Ve(d,3)),f.setIndex(new Os(u,1)),Ke.free_wireframe_data_for_base_level(r),f}e.getAttribute("position").copyArray(c),e.attributes.position.needsUpdate=!0,Ke.free_wireframe_data_for_base_level(r)}static updateCollabMesh(i,e,t){e||Ke.set_destination_refinement_level(i,1);let r=t?Ke.get_topological_data2(i,e?Ke.Level.CONTROL:Ke.Level.REFINED,t.elements):Ke.get_topological_data(i,e?Ke.Level.CONTROL:Ke.Level.REFINED),n=6,s=Ke.HEAPU32.subarray(r>>2,(r>>2)+n),o=s.subarray(3,3+3),a=0,l=Ke.HEAPU32[s[a]>>2],c=new Float32Array(Ke.HEAPF32.subarray(l>>2,(l>>2)+o[a]));a++;let h=Ke.HEAPU32[s[a]>>2],u=new Uint32Array(Ke.HEAPU32.subarray(h>>2,(h>>2)+o[a]));a++;let f=Ke.HEAPU32[s[a]>>2],d=new Uint8Array(Ke.HEAPU32.subarray(f>>2,(f>>2)+o[a]));return Ke.free_topological_data(r),{positions:c,indices:u,verticesPerFace:d}}};var Z1=["getX","getY","getZ"];function Iv(i,e){let t={},r=e?e.count:i.count,n=0,s=[],o=[],a=1e4;for(let c=0;c<r;c++){let h=e?e.getX(c):c,u="";for(let f=0;f<3;f++)u+=`${~~(i[Z1[f]](h)*a)},`;if(u in t)s.push(t[u]);else{for(let f=0;f<3;f++)o.push(i[Z1[f]](h));t[u]=n,s.push(n),n++}}let l=[];for(let c=0;c<s.length;c+=3)s[c]===s[c+1]||s[c]===s[c+2]||s[c+1]===s[c+2]||l.push(s[c],s[c+1],s[c+2]);return{positions:o,triIndices:l}}var Up=new M,Pv=new M,Dv=new M,Lv=new M;function Rv(i,e,t){var s;let r=[],n=[];if(t.userData.shape!==void 0&&t.userData.parameters.depth===0){let o=t.userData.shape.extractShapePointsToFlatArray([]),a=0;for(let c=0;c<o.length;c+=2)a+=(o[c]-o[(c===0?o.length:c)-2])*(o[c+1]+o[(c===0?o.length:c)-1]);i.length=0;let l=0;if(a<0)for(let c=0;c<o.length;c+=2)i.push(o[c],o[c+1],0),r.push(l++);else for(let c=o.length-2;c>=0;c-=2)i.push(o[c],o[c+1],0),r.push(l++);return n.push(l),{indices:r,verticesPerFace:n}}for(let o=0,a=(s=t.capStartIndex)!=null?s:e.length;o<a;)if(e[o+1]===e[o+3]&&e[o+2]===e[o+5]||e[o+0]===e[o+3]&&e[o+2]===e[o+4]){Up.set(i[e[o]*3],i[e[o]*3+1],i[e[o]*3+2]),Pv.set(i[e[o+1]*3],i[e[o+1]*3+1],i[e[o+1]*3+2]),Dv.set(i[e[o+4]*3],i[e[o+4]*3+1],i[e[o+4]*3+2]),Lv.set(i[e[o+5]*3],i[e[o+5]*3+1],i[e[o+5]*3+2]),Pv.sub(Up).normalize(),Dv.sub(Up).normalize(),Lv.sub(Up).normalize();let l=Pv.cross(Dv).dot(Lv);Math.abs(l)>.005?(r.push(e[o],e[o+1],e[o+2]),n.push(3),o+=3):(r.push(e[o],e[o+1],e[o+4],e[o+5]),n.push(4),o+=6)}else r.push(e[o],e[o+1],e[o+2]),n.push(3),o+=3;if(t.capStartIndex!==void 0){let o=[],a=[],l=0;for(let c=0,h=0;c<i.length;c+=3,h++)i[c+2]===0&&(o.push(h),l++),i[c+2]===t.userData.parameters.depth&&a.push(h);if(t.userData.parameters.extrudeBevelSize===0){let c=a[0];a[0]=a[1],a[1]=c}o.reverse(),r.push(...o,...a),n.push(l,l)}return{indices:r,verticesPerFace:n}}var Jn={};_x(Jn,{calcBoolean:()=>JF,calcBooleanTopological:()=>QF,freeMeshSet:()=>$F,getMeshSet:()=>KF,transformMeshSet:()=>ZF});var eA,tA=new Promise(i=>{eA=i}),$1=!1;async function rA(){if($1)return;let e=!1?".":"https://unpkg.com/@splinetool/boolean-wasm@0.9.59/build",[t,r]=await Promise.all([import("./boolean.js"),fetch(`${e}/boolean.wasm`).then(o=>o.arrayBuffer())]),s=await t.default({wasmBinary:r});eA(s),$1=!0}var gt,Kl;tA.then(i=>gt=i);function XF(i,e){let t,{positions:r,triIndices:n}=Iv(i.getAttribute("position"),i.getIndex()),s;if(e){let{indices:o,verticesPerFace:a}=Rv(r,n,i);s=a.length,t=[];for(let l=0,c=0;l<s;l++){t.push(a[l]);for(let h=0;h<a[l];h++)t.push(o[c++])}}else{let o=n.length;t=Array(o+o/3),s=0;for(let a=0,l=0;l<t.length;)t[l++]=3,s++,t[l++]=n[a++],t[l++]=n[a++],t[l++]=n[a++]}return{positions:r,faceIndices:t,nFaces:s}}function nA(i){let e=i.length,t=e*Uint32Array.BYTES_PER_ELEMENT,r=e*Float32Array.BYTES_PER_ELEMENT,n=Number.isInteger(i[0])?t:r,s=gt._malloc(n);return(Number.isInteger(i[0])?new Uint32Array(gt.HEAPU32.buffer,s,e):new Float32Array(gt.HEAPF32.buffer,s,e)).set(i,0),s}function iA(i){switch(i){case 0:return gt.OP.UNION;case 1:return gt.OP.INTERSECTION;case 2:return gt.OP.A_MINUS_B;case 3:return gt.OP.B_MINUS_A;case 4:return gt.OP.SYMMETRIC_DIFFERENCE;case 5:return gt.OP.ALL;default:throw new Error("Unknown boolean operation "+i)}}function QF(i,e){Kl===void 0&&(Kl=gt.init_csg());let t=nA(i),r=gt.csg_calc_topological(Kl,t,i.length,iA(e));gt._free(t);let n=6,s=gt.HEAPU32.subarray(r>>2,(r>>2)+n),o=s.subarray(3,3+3),a=0,l=gt.HEAPU32[s[a]>>2],c=new Float32Array(gt.HEAPF32.subarray(l>>2,(l>>2)+o[a]));a++;let h=gt.HEAPU32[s[a]>>2],u=new Uint32Array(gt.HEAPU32.subarray(h>>2,(h>>2)+o[a]));a++;let f=gt.HEAPU32[s[a]>>2],d=new Uint8Array(gt.HEAPU32.subarray(f>>2,(f>>2)+o[a]));return gt.free_mesh_data(r),{positions:c,indices:u,verticesPerFace:d}}function JF(i,e,t,r){Kl===void 0&&(Kl=gt.init_csg());let n=nA(i),s=gt.csg_calc(Kl,n,i.length,r,iA(e));gt._free(n);let o=5,a=gt.HEAPU32.subarray(s>>2,(s>>2)+o),l=a.subarray(2,2+3),c=0,h=gt.HEAPU32[a[c]>>2],u=gt.HEAPF32.subarray(h>>2,(h>>2)+l[c]);c++;let f=gt.HEAPU32[a[c]>>2],d=gt.HEAPF32.subarray(f>>2,(f>>2)+l[c]);c++;let p=l[c];t.setAttribute("position",new Te(u,3)),t.setAttribute("normal",new Te(d,3));let m=gt.HEAPF32.subarray((s>>2)+5,(s>>2)+5+6);return t.boundingSphere===null&&(t.boundingSphere=new Lr),t.boundingSphere.center.set(m[0],m[1],m[2]),t.boundingSphere.radius=(m[3]**2+m[4]**2+m[5]**2)**.5,t.userData.parameters={width:m[3]*2,height:m[4]*2,depth:m[5]*2},gt.free_mesh_data(s),p}function KF(i,e){if(gt===void 0)return-1;let t,r,n;if(e&&i.userData.positions!==void 0){let m=i.userData;n=m.verticesPerFace.length,t=m.positions,r=Array(m.verticesPerFace.reduce((g,v)=>g+v,0)+n);for(let g=0,v=0,y=0;g<m.verticesPerFace.length;g++){r[y++]=m.verticesPerFace[g];for(let w=0;w<m.verticesPerFace[g];w++)r[y++]=m.indices[v++]}}else({positions:t,faceIndices:r,nFaces:n}=XF(i,e));let s=t.length,o=r.length,a=t.length,l=r.length,c=a*Float32Array.BYTES_PER_ELEMENT+l*Uint32Array.BYTES_PER_ELEMENT,h=a*Float32Array.BYTES_PER_ELEMENT,u=l*Uint32Array.BYTES_PER_ELEMENT,f=gt._malloc(c),d=new Float32Array(gt.HEAPF32.buffer,f,a),p=new Uint32Array(gt.HEAPU32.buffer,f+h,l);return d.set(t,0),p.set(r,0),gt.get_csg_mesh(f,s,f+h,o,n)}function ZF(i,e){gt.transform_csg_mesh(i,e.elements)}function $F(i){gt.free_csg_mesh(i)}var Cv={ConeGeometry:HM,CubeGeometry:WM,CylinderGeometry:VM,DodecahedronGeometry:jM,EllipseGeometry:d1,HelixGeometry:y1,IcosahedronGeometry:v1,LatheGeometry:x1,NonParametricGeometry:b1,PolygonGeometry:w1,PyramidGeometry:S1,RectangleGeometry:vp,SphereGeometry:M1,PlaneGeometry:A1,BackdropGeometry:T1,StarGeometry:_1,TextFrameGeometry:xp,TorusGeometry:E1,TorusKnotGeometry:C1,TriangleGeometry:P1,VectorGeometry:Hr},mu=i=>Cv[i.type].create(i);var sA=new Ae;function Bv(i){let e=!1;return i.scene.objects.traverse((t,r)=>{var n;((n=r.geometry)==null?void 0:n.type)==="BooleanGeometry"&&(e=!0)}),e}var zp=class extends kt{constructor(t=new De,r=new pn){super(t,r);this.booleanOp=2;this.phongAngle=35;this.meshSetAddresses=[];this.needsTransformForDownstream=!1;this.isBooleanMesh=!0,this.castShadow=!0,this.receiveShadow=!0,this.geometry.userData.parameters={width:0,height:0,depth:0},this.onAfterRender=this.recomputeBoolean.bind(this)}reInit(){this.isBooleanMesh=!0,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry.userData.parameters={width:0,height:0,depth:0},this.onAfterRender=this.recomputeBoolean.bind(this)}recomputeBoolean(t){var n;if(this.booleanMeshSetAddress!==-1)return;for(let s=0;s<this.children.length;s++){let o=this.children[s];Lt(o)&&o.recomputeBoolean(t===!0)}this.meshSetAddresses=[];for(let s=0;s<this.children.length;s++){let o=this.children[s];if(j1(o)&&o.booleanExclude===!1&&((n=o.geometry.attributes.position)==null?void 0:n.count)>0&&o.geometry.drawRange.count>0){if(o.booleanMeshSetAddress===-1){if(o.booleanMeshSetAddress=Jn.getMeshSet(o.geometry,t===!0),o.booleanMeshSetAddress===-1)return;Jn.transformMeshSet(o.booleanMeshSetAddress,o.matrix),o.booleanMatrixInvOld.copy(o.matrix).invert(),o.booleanWasTransformed=!1}else Lt(o)&&o.needsTransformForDownstream===!0?(Jn.transformMeshSet(o.booleanMeshSetAddress,o.matrix),o.needsTransformForDownstream=!1):o.booleanWasTransformed===!0&&(sA.multiplyMatrices(o.matrix,o.booleanMatrixInvOld),Jn.transformMeshSet(o.booleanMeshSetAddress,sA),o.booleanMatrixInvOld.copy(o.matrix).invert(),o.booleanWasTransformed=!1);this.meshSetAddresses.push(o.booleanMeshSetAddress)}}if(this.meshSetAddresses.length===0){this.geometry.setDrawRange(0,0);return}if(t===!0)return Jn.calcBooleanTopological(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new De,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=Jn.calcBoolean(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(s){this.booleanMeshSetAddress=0,console.error(s)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0}toJSON(t){let r=super.toJSON(t);return r.object.objectType="Mesh3D",r}updateGeometry(t){let r=t.parameters;r.operation!==void 0&&(this.booleanOp=r.operation),r.phongAngle!==void 0&&(this.phongAngle=r.phongAngle),this.invalidateDownstreamBooleanData().recomputeBoolean()}};var Gi=i=>{var e;return e=class extends i{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new vn(30,30,30),e};var Gp=new oi,Nv=new Lr,oA=new Ae,ki=(i,e,t,r,n=!1)=>{let s=e,o=i.matrixWorld;if(s.boundingSphere===null&&s.computeBoundingSphere(),Nv.copy(s.boundingSphere),Nv.applyMatrix4(o),t.ray.intersectsSphere(Nv)===!1||(oA.copy(o).invert(),Gp.copy(t.ray).applyMatrix4(oA),s.boundingBox!==null&&Gp.intersectsBox(s.boundingBox)===!1))return;let a,l,c,h,u=s.index,f=s.attributes.position,d=s.drawRange,p,m;if(n===!1){let v=Math.max(0,d.start),y=Math.min(u.count,d.start+d.count);for(p=v,m=y;p<m;p+=3)if(l=u.getX(p),c=u.getX(p+1),h=u.getX(p+2),a=g(i,t,Gp,f,l,c,h),a){a.faceIndex=Math.floor(p/3),r.push(a);return}}else{let y=s.attributes.position,w=new M,b=new M,S=new M,T=new M,A=2,_=1/((i.scale.x+i.scale.y+i.scale.z)/3),E=_*_,C=Math.max(0,d.start),I=Math.min(y.count,d.start+d.count);for(let N=C,R=I-1;N<R;N+=A){if(w.fromBufferAttribute(y,N),b.fromBufferAttribute(y,N+1),Gp.distanceSqToSegment(w,b,T,S)>E)continue;T.applyMatrix4(i.matrixWorld);let G=t.ray.origin.distanceTo(T);G<t.near||G>t.far||r.push({distance:G,point:S.clone().applyMatrix4(i.matrixWorld),object:i})}}function g(v,y,w,b,S,T,A){let x=new M,_=new M,E=new M,C=new M,I=new M;if(x.fromBufferAttribute(b,S),_.fromBufferAttribute(b,T),E.fromBufferAttribute(b,A),w.intersectTriangle(x,_,E,!1,C)===null)return null;I.copy(C),I.applyMatrix4(v.matrixWorld);let R=y.ray.origin.distanceTo(I);return R<y.near||R>y.far?null:{faceIndex:1,distance:R,point:I.clone(),object:v}}};var kp=new M,Zn=new Gn,Ov=class extends li{constructor(t){let r=new De,n=new kr({color:16777215,vertexColors:!0,toneMapped:!1}),s=[],o=[],a={},l=new be(15711266),c=new be(15711266),h=new be(2857471);u("n1","n2",l),u("n2","n4",l),u("n4","n3",l),u("n3","n1",l),u("f1","f2",l),u("f2","f4",l),u("f4","f3",l),u("f3","f1",l),u("n1","f1",l),u("n2","f2",l),u("n3","f3",l),u("n4","f4",l),u("p","n1",c),u("p","n2",c),u("p","n3",c),u("p","n4",c),u("u1","u2",h),u("u2","u3",h),u("u3","u1",h);function u(d,p,m){f(d,m),f(p,m)}function f(d,p){s.push(0,0,0),o.push(p.r,p.g,p.b),a[d]===void 0&&(a[d]=[]),a[d].push(s.length/3-1)}r.setAttribute("position",new Te(s,3)),r.setAttribute("color",new Te(o,3));super(r,n);this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}update(){let t=this.geometry,r=this.pointMap,n=!0;Zn.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let s=1,o=1,a=n?.8:1e-4;yi("n1",r,t,Zn,-s,-o,a),yi("n2",r,t,Zn,s,-o,a),yi("n3",r,t,Zn,-s,o,a),yi("n4",r,t,Zn,s,o,a);let l=a;yi("f1",r,t,Zn,-s,-o,l),yi("f2",r,t,Zn,s,-o,l),yi("f3",r,t,Zn,-s,o,l),yi("f4",r,t,Zn,s,o,l);let c=l,h=.5;yi("u1",r,t,Zn,s*.7*h,o*1.1,c),yi("u2",r,t,Zn,-s*.7*h,o*1.1,c),yi("u3",r,t,Zn,0,o*(1.1+.9*h),c),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function yi(i,e,t,r,n,s,o){kp.set(n,s,o).unproject(r);let a=e[i];if(a!==void 0){let l=t.getAttribute("position");for(let c=0,h=a.length;c<h;c++)l.setXYZ(a[c],kp.x,kp.y,kp.z)}}var Vp=class extends Gi(Ov){constructor(t){super(t);this.object=t;this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,r){ki(this.object,this.geometry,t,r,!0)}};var Zl=class extends Gi(Xf){constructor(t,r=15,n=10066329){super(t,r,n);this.object=t;this.name=`DirectionalLightHelper: ${t.uuid}`}raycast(t,r){ki(this.object,Zl.geometryHelper,t,r)}};var $l=class extends Gi(Qf){constructor(t,r=15){super(r);this.object=t;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}raycast(t,r){ki(this.object,$l.geometryHelper,t,r)}update(){}};var ec=class extends Gi(Yf){constructor(t,r=15,n=6710886){super(t,r,n);this.object=t;this.name=`PointLightHelper: ${t.uuid}`}raycast(t,r){ki(this.object,ec.geometryHelper,t,r)}};var Hp=class extends Gi(qf){constructor(t,r=6710886){super(t,r);this.object=t;this.name=`SpotLightHelper: ${t.uuid}`}raycast(t,r){ki(this.object,Hp.geometryHelper,t,r)}update(){if(this.object!==void 0){let t=Hp._vector,r=this.object.distance?this.object.distance:1e3,n=r*Math.tan(this.object.angle);this.cone.scale.set(n,n,r),t.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(t);let s=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let o=0,a=this.cone.material.length;o<a;o++)this.cone.material[o].color.set(s);else this.cone.material.color.set(s)}}},gu=Hp;gu._vector=new M;var Vi=(i,e)=>class extends i{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let s of this.children)Xn(s)&&s.traverseEntity(o=>{ms(o)&&o.visible&&(o.objectHelper.visible=n)})}raycast(n,s){this.objectHelper.raycast(n,s)}copy(n,s=!0){return super.copy(n,s),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let s=super.toJSON(n),o=s.object;return o.enableHelper=this.enableHelper,s}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}fromLightState(n,s){if(this.objectType==="LightDirectional"||this.objectType==="LightPoint"||this.objectType==="LightSpot"){let o=this;n.color!==void 0&&(o.color=pr(n.color,s)),n.intensity!==void 0&&(o.intensity=n.intensity),n.depth!==void 0&&(o.shadow.camera.far=n.depth,o.shadow.needsUpdate=!0),n.shadows!==void 0&&(this.castShadow=n.shadows),n.helper!==void 0&&(this.enableHelper=n.helper,o.gizmos.shadowmap.visible=n.helper)}return this}};var tc=new M,Fv=new M,Bn=class extends Vi(Qn(Gn),Vp){constructor(t=window.innerWidth,r=window.innerHeight,n=45,s,o=1e5){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Wo.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=t,this.height=r,this.orthoCamera=new Co(t*-.5,t*.5,r*.5,r*-.5,s!=null?s:-5e4,o),this.perspCamera=new sr(n,t/r,s!=null?s:50,o),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}static createFromState(t,r){let n=new Bn().fromState(r);return n.enableHelper=!0,n.objectHelper.update(),n.uuid=t,n}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}setNear(t,r){t==="PerspectiveCamera"?this.perspCamera.near=r:this.orthoCamera.near=r}setZoom(t,r){r>=0&&(t==="PerspectiveCamera"?this.perspCamera.zoom=r:this.orthoCamera.zoom=r)}set cameraType(t){t==="PerspectiveCamera"?this.toPerspective():t==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(t){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t){super.lookAt(t),this.getWorldPosition(tc),this.targetOffset=tc.distanceTo(t)}getTarget(t=new M){return this.getWorldDirection(Fv),this.getWorldPosition(tc),Fv.multiplyScalar(this.targetOffset),t.copy(tc).add(Fv),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(tc),tc.distanceTo(t)}updateUp(){let t=this.getWorldQuaternion(new zt),r=new M(0,0,1).applyQuaternion(t),n=new M().copy(ot.DefaultUp);this.isUpVectorFlipped&&n.negate(),n.applyQuaternion(t);let s=new M().copy(ot.DefaultUp).projectOnPlane(r),o=new M().crossVectors(s,n).dot(r)>=0?1:-1;this.angleOffsetFromUp=s.angleTo(n)*o}getViewFrontToObject(t){let r=t.getWorldPosition(new M),s=t.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:r.clone().add(s),target:r}}getViewToObject(t){let r=t.getWorldPosition(new M),s=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:r.clone().sub(s),target:r}}setViewplaneSize(t,r){this.left=-t*.5,this.right=t*.5,this.top=r*.5,this.bottom=-r*.5,this.aspect=t/r,this.updateProjectionMatrix()}toOrthographic(t){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||t===!0)&&this.objectHelper.update()}toPerspective(t){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||t===!0)&&this.objectHelper.update()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,r,n,s,o,a){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(t,r,n,s,o,a):this.orthoCamera.setViewOffset(t,r,n,s,o,a)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(t){this._cameraType==="PerspectiveCamera"?this.toPerspective(t):this._cameraType==="OrthographicCamera"&&this.toOrthographic(t)}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,r){super.updateWorldMatrix(t,r),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,r){return super.copy(t,r),this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=t.view===null?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=t.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(t){let r={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(t),this.name="",this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=r.near,this.orthoCamera.far=r.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,r}fromJSON(t){var r;if(super.fromJSON(t),this.cameraType=t.cameraType,t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset),t.orbitControlsTarget!==void 0){let n=this.getWorldPosition(new M),s=new M().fromArray(t.orbitControlsTarget);this.targetOffset=s.distanceTo(n)}else t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset);return this.isUpVectorFlipped=!1,this.angleOffsetFromUp=(r=t.angleOffsetFromUp)!=null?r:0,t.left!==void 0&&(this.left=t.left),t.right!==void 0&&(this.right=t.right),t.top!==void 0&&(this.top=t.top),t.bottom!==void 0&&(this.bottom=t.bottom),t.view!==void 0&&(this.view=Object.assign({},t.view)),t.zoomOrtho!==void 0&&(this.orthoCamera.zoom=t.zoomOrtho),t.nearOrtho!==void 0&&(this.orthoCamera.near=t.nearOrtho),t.far!==void 0&&(this.far=t.far),t.aspect!==void 0&&(this.aspect=t.aspect),t.fov!==void 0&&(this.fov=t.fov),t.focus!==void 0&&(this.focus=t.focus),t.filmGauge!==void 0&&(this.filmGauge=t.filmGauge),t.filmOffset!==void 0&&(this.filmOffset=t.filmOffset),t.zoomPersp!==void 0&&(this.perspCamera.zoom=t.zoomPersp),t.nearPersp!==void 0&&(this.perspCamera.near=t.nearPersp),this.updateProjectionMatrix(),this}toCameraState(t=[]){let r={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return wl(r,t)}fromCameraState(t){let{orthographic:r,perspective:n}=t;return t.type!==void 0&&(this.cameraType=t.type),t.far!==void 0&&(this.far=t.far),r!==void 0&&(r.near!==void 0&&(this.orthoCamera.near=r.near),r.zoom!==void 0&&(this.orthoCamera.zoom=r.zoom)),n!==void 0&&(n.near!==void 0&&(this.perspCamera.near=n.near),n.fov!==void 0&&(this.perspCamera.fov=n.fov),n.zoom!==void 0&&(this.perspCamera.zoom=n.zoom)),t.up!==void 0&&this.up.fromArray(t.up),t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset),t.isUpVectorFlipped!==void 0&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix(),this}toState(t){return xe(se(se({},super.toState(t)),this.toCameraState(t)),{type:this.cameraType})}fromState(t){return super.fromState(t),this.fromCameraState(t),this}};var gs=class extends Vi(Qn(ts),$l){constructor(){super(...arguments);this.objectType="EmptyObject"}static createFromState(t,r){let n=new gs().fromState(r);return n.uuid=t,n.enableHelper=!0,n.objectHelper.update(),n}toJSON(t){let r=super.toJSON(t);return r.object.objectType="EmptyObject",r}};var rc=class extends Vi(Qn(hh),Zl){constructor(...t){super(...t);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let s=new Hn(this.shadow.camera);s.visible=!1,this._gizmos.shadowmap=s,this.update()}static createFromState(t,r,n){let s=new rc().fromState(r,n);return s.uuid=t,s}get gizmos(){return this._gizmos}showGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!0)}}hideGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&r.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(t,r=!0){return super.copy(t,r),this.color.copy(t.color),this.intensity=t.intensity,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),r}fromJSON(t){var s;super.fromJSON(t),this.color.set(t.color),this.intensity=t.intensity,this.shadow.normalBias=(s=t.shadow.normalBias)!=null?s:0,this.shadow.radius=t.shadow.radius,this.shadow.mapSize.fromArray(t.shadow.mapSize);let r=this.shadow.camera,n=t.shadow.camera;return r.near=n.near,r.far=n.far,r.zoom=n.zoom,r.left=n.left,r.right=n.right,r.top=n.top,r.bottom=n.bottom,n.view!==void 0&&(r.view=Object.assign({},n.view)),this}fromDirectionalLightState(t,r){let n=t.depth!==void 0&&t.depth!==this.shadow.camera.far||t.size!==void 0&&t.size/2!==this.shadow.camera.right;return super.fromLightState(t,r),t.size!==void 0&&H1(this,t.size),n&&this.update(),this}fromState(t,r){return super.fromState(t),this.fromDirectionalLightState(t,r),this}};var nc=class extends Vi(Qn(ch),ec){constructor(...t){super(...t);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let s=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),o=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),a=new Kt(s,o),l=new Fo(a,new be(16755200));l.visible=!1,this._gizmos.shadowmap=l,this.update()}static createFromState(t,r,n){let s=new nc().fromState(r,n);return s.uuid=t,s}get gizmos(){return this._gizmos}showGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Fo&&(r.visible=!0)}}hideGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Fo&&(r.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let t in this._gizmos){let r=this._gizmos[t];if(r instanceof Fo){let n=this.shadow.camera,s=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),o=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);r.box.set(s,o),r.updateMatrixWorld(!0)}}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(t,r=!0){return super.copy(t,r),this.color.copy(t.color),this.intensity=t.intensity,this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),r}fromJSON(t){var s,o;super.fromJSON(t),this.color.set(t.color),this.intensity=t.intensity,this.distance=t.distance,this.decay=t.decay,this.shadow.normalBias=(s=t.shadow.normalBias)!=null?s:0,this.shadow.radius=t.shadow.radius,this.shadow.mapSize.fromArray((o=t.shadow.mapSize)!=null?o:[512,512]),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null);let r=this.shadow.camera,n=t.shadow.camera;return r.near=n.near,r.far=n.far,r.zoom=n.zoom,r.fov=n.fov,r.focus=n.focus,r.aspect=n.aspect,r.filmGauge=n.filmGauge,r.filmOffset=n.filmOffset,n.view!==void 0&&(r.view=Object.assign({},n.view)),this}fromPointLightState(t,r){return super.fromLightState(t,r),t.distance!==void 0&&(this.distance=t.distance),t.decay!==void 0&&(this.decay=t.decay),t.shadowRadius!==void 0&&(this.shadow.radius=t.shadowRadius),t.shadowResolution!==void 0&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null)),this}fromState(t,r){return super.fromState(t),this.fromPointLightState(t,r),this}};var aA=new M,lA=new M,cA=new zt,ic=class extends Vi(Qn(lh),gu){constructor(...t){super(...t);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=et.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let s=new Hn(this.shadow.camera);s.visible=!1,this._gizmos.shadowmap=s,this.update()}static createFromState(t,r,n){let s=new ic().fromState(r,n);return s.uuid=t,s}get gizmos(){return this._gizmos}showGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!0)}}hideGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&r.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),lA.setFromMatrixPosition(this.matrixWorld),cA.setFromRotationMatrix(this.matrixWorld),aA.copy(this.up).applyQuaternion(cA).negate().multiplyScalar(this.distance),this.target.position.copy(lA).add(aA),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(t,r=!0){return super.copy(t,r),this.color.copy(t.color),this.intensity=t.intensity,this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),r}fromJSON(t){var s;super.fromJSON(t),this.color.set(t.color),this.intensity=t.intensity,this.distance=t.distance,this.angle=t.angle,this.decay=t.decay,this.penumbra=t.penumbra,this.shadow.normalBias=(s=t.shadow.normalBias)!=null?s:0,this.shadow.radius=t.shadow.radius,this.shadow.mapSize.fromArray(t.shadow.mapSize);let r=this.shadow.camera,n=t.shadow.camera;return r.near=n.near,r.far=n.far,r.zoom=n.zoom,r.fov=n.fov,r.focus=n.focus,r.aspect=n.aspect,r.filmGauge=n.filmGauge,r.filmOffset=n.filmOffset,n.view!==void 0&&(r.view=Object.assign({},n.view)),this}fromSpotLightState(t,r){return super.fromLightState(t,r),t.distance!==void 0&&(this.distance=t.distance),t.decay!==void 0&&(this.decay=t.decay),t.angle!==void 0&&(this.angle=t.angle),t.penumbra!==void 0&&(this.penumbra=t.penumbra),this}fromState(t,r){return super.fromState(t),this.fromSpotLightState(t,r),this}};var hA=i=>i.tagName==="VIDEO",$o=class{static resize(e,t,r){let n=e/t,s;if(!r.image)return;let o=r.image;hA(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,n>s&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1*s/n):r.repeat.set(1,1*s/n)),n<s&&(r.imageType=="WEBCAM"?r.repeat.set(1*n/s*-1,1):r.repeat.set(1*n/s,1)),n==s&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1):r.repeat.set(1,1))}static resizeTextureLayer(e,t,r){let n=e/t,s=r.image!==void 0?r.image.width/r.image.height:1,o;n>s?o={x:1,y:s/n}:n<s?o={x:n/s,y:1}:o={x:1,y:1},r.repeat.set(o.x,o.y),r.updateMatrix()}static resizeTextureLayers(e,t,r){let n=r.userData.layers,s=n.getLayers();for(let o=0;o<s.length;o++){let a=s[o];B1(a)&&($o.resizeTextureLayer(e,t,a.uniforms[`f${a.id}_texture`].value),n.updateLayerUniform())}}static resizeComplex(e,t,r,n){let s=e/t,o,a=r.image;hA(a)?o=a.videoWidth/a.videoHeight:o=a.width/a.height,n.geometry.type.includes("Shape")?(s>o&&(r.imageType=="WEBCAM"?r.repeat.set(1/e*-1,1/t*o/s):r.repeat.set(1/e,1/t*o/s)),s<o&&(r.imageType=="WEBCAM"?r.repeat.set(1/e*s/o*-1,1/t):r.repeat.set(1/e*s/o,1/t)),s==o&&(r.imageType=="WEBCAM"?r.repeat.set(1/e*-1,1/t):r.repeat.set(1/e,1/t))):(s>o&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1*o/s):r.repeat.set(1,1*o/s)),s<o&&(r.imageType=="WEBCAM"?r.repeat.set(1*s/o*-1,1):r.repeat.set(1*s/o,1)),s==o&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1):r.repeat.set(1,1)))}};var sc=class extends kt{constructor(t,r=new Yr){super(t,r);this.objectType="Mesh2D";this.castShadow=!0,this.receiveShadow=!0}updateGeometry(t){super.updateGeometry(t),this.material.userData.layers&&$o.resizeTextureLayers(this.geometry.userData.parameters.width,this.geometry.userData.parameters.height,this.material)}resizeGeometry(t,r){super.resizeGeometry(t,r,0),this.material.userData.layers&&$o.resizeTextureLayers(this.geometry.userData.parameters.width,this.geometry.userData.parameters.height,this.material)}toJSON(t){let r=super.toJSON(t);return r.object.objectType="Mesh2D",r}clone(){let t=super.clone();return t.updateGeometry({}),t}static fromTexture(t){let r,n;if(t instanceof th){let a=t.image;r=a.videoWidth*.5,n=a.videoHeight*.5}else{let a=t.image;r=a.width*.5,n=a.height*.5}let s=vp.create({parameters:{width:r,height:n}}),o=new Yr;return o.layersList.changeLayer(0,{type:"texture",texture:t}),o.layersList.moveLayer(0,1),o.dispose(),new sc(s,o)}};var oc=class extends kt{constructor(t,r=new pn){super(t,r);this.objectType="Mesh3D";this.castShadow=!0,this.receiveShadow=!0}toJSON(t){let r=super.toJSON(t);return r.object.objectType="Mesh3D",r}};var ac=class extends oc{constructor(t,r=new pn){super(t,r);this.objectType="NonParametric"}toJSON(t){let r=super.toJSON(t);return r.object.objectType="NonParametric",r}};var Wp=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=this,o=new as(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){let l;try{l=JSON.parse(a)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),l=JSON.parse(a.substring(65,a.length-2))}let c=s.parse(l);t&&t(c)},r,n)}parse(e){return new jp(e)}},jp=class{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){let r=[],n=tU(e,t,this.data);for(let s=0,o=n.length;s<o;s++)Array.prototype.push.apply(r,n[s].toShapes());return r}};function tU(i,e,t){let r=Array.from(i),n=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*n,o=[],a=0,l=0;for(let c=0;c<r.length;c++){let h=r[c];if(h===`
|
|
3927
|
-
`)a=0,l-=s;else{let u=
|
|
3928
|
-
`),l=0;this.userData.textFrame.textLines=a.map((c,h)=>{let u=new uo(l,r.lineHeight,r.fontSize);return u.message=c.split("").map(f=>{let d={char:f,fontFamily:n,letterSpacing:r.letterSpacing,fontSize:r.fontSize,LOD:16},p=o.clone();p.color=r.hexColor,p.opacity=r.opacity;let m=new mn(d,p);return u.addChar3D(m,s),this.charContainer.add(m),m}),l+=u.maxCharSize*u.lineHeight,u}),this.textFullUpdate(),this.checkOverFlow()}clearText(){let t=this.userData.textFrame.textLines;for(;this.charContainer.children.length;){let r=this.charContainer.children[0];this.charContainer.remove(r)}for(;t.length;)t.pop()}raycast(t,r){let n=[];if(super.raycast(t,n),n.length>0){r.push(n[0]);return}let s=[];for(let o=0,a=this.charContainer.children.length;o<a;++o)if(this.charContainer.children[o]instanceof mn&&(t.intersectObject(this.charContainer.children[o],!1,s),s.length>0)){s[0].object=this,r.push(s[0]);return}}updateGeometry(t){var h,u,f,d;let r=this.userData,n=this.geometry.userData,s=n.parameters.width,o=n.parameters.height,a=(u=(h=t.parameters)==null?void 0:h.width)!=null?u:s,l=(d=(f=t.parameters)==null?void 0:f.height)!=null?d:o,c=r.textFrame;super.updateGeometry(t),c.maxLineSize=a,c.textOrigin.set(-.5*a,.5*l,0),l!==o?(this.checkOverFlow(),this.checkCapacity()):a!==s&&(s<a?this.checkCapacity():s>a&&this.checkOverFlow())}checkOverFlow(t=0){let r=this.userData,n=r.textFrame.textOrigin,s=r.textFrame.textLines;for(let o=t;o<s.length;o++){s[o].updateYLinePos(this.getNewLinePosition(o)),s[o].fullUpdate(n);let a=[];for(;s[o].checkOverFlow(r.textFrame.maxLineSize);)s[o].containSpaceOverFlow()?a.unshift(s[o].getWord(s[o].message.length-1,-1)):a.unshift(s[o].popChar());if(a.length>0){s[o+1]===void 0?(s[o].isEndLine(!1),this.createTextLine()):s[o].endLine&&(this.createTextLine(o+1),s[o].isEndLine(!1),s[o+1].isEndLine(!0));let l=0;for(let c=0;c<a.length;c+=1)for(let h=0;h<a[c].length;h+=1)s[o+1].addChar3D(a[c][h],n,l),l+=1;s[o+1].fullUpdate(n)}s[o].fullUpdate(n)}this.textFullUpdate(t)}checkCapacity(t=0){let r=this.userData,n=r.textFrame.textOrigin,s=r.textFrame.maxLineSize,o=r.textFrame.textLines;for(let a=t;a<o.length;a+=1)if(o[a].updateYLinePos(this.getNewLinePosition(a)),o[a].fullUpdate(n),!!o[a-1])for(;!o[a-1].endLine;){let l,c=o[a-1].spaceLeft(s);if(o[a].wordSize(0,1)<=c){o[a].containSpace()?l=o[a].getWord(0,1):l=o[a].popChar(0);for(let h=0;h<l.length;h+=1)l[h]&&o[a-1].addChar3D(l[h],n)}else{o[a].isEmpty()?(o[a].endLine&&o[a-1].isEndLine(!0),o.splice(a,1),a-=1):(o[a].updateYLinePos(this.getNewLinePosition(a)),o[a].fullUpdate(n));break}}this.textFullUpdate(t)}createTextLine(t=this.userData.textFrame.textLines.length){let n=this.userData.textFrame;n.textLines.splice(t,0,new uo(this.getNewLinePosition(t),n.lineHeight,n.fontSize))}textFullUpdate(t=0){let n=this.userData.textFrame,s=n.textLines,o=this.getVerticalAlignmentOffSet();for(let a=t;a<s.length;a++)s[a].updateYLinePos(this.getNewLinePosition(a)),s[a].fullUpdate(n.textOrigin),s[a].alignText(n.textOrigin,n.maxLineSize,n.horizontalAlignment,n.verticalAlignment,o)}getVerticalAlignmentOffSet(){switch(this.userData.textFrame.verticalAlignment){case 1:return 0;case 2:return this.getRemainingVerticalSpace()/2;case 3:return this.getRemainingVerticalSpace();default:return 0}}getRemainingVerticalSpace(){let r=this.userData.textFrame.textLines;return this.geometry.userData.parameters.height-this.getNewLinePosition(r.length)}getNewLinePosition(t){let n=this.userData.textFrame.textLines,s=0;for(let o=0;o<t;o+=1)s+=n[o].maxCharSize*n[o].lineHeight;return s}updateColor(t){var s;let r=this.userData;r.textFrame.hexColor=t;let n=r.textFrame.textLines;for(let o=0;o<n.length;o++){let a=n[o].message;for(let l=0;l<a.length;l++){let c=a[l].material;(s=c.color)!=null&&s.isColor&&(c.color=t)}}}updateOpacity(t){let r=this.userData;r.textFrame.opacity=t;let n=r.textFrame.textLines;for(let s=0;s<n.length;s++){let o=n[s].message;for(let a=0;a<o.length;a++){let l=o[a].material;l.opacity=t}}}updateVisible(t){let r=this.userData;r.textFrame.visible=t;let n=r.textFrame.textLines;for(let s=0;s<n.length;s++){let o=n[s].message;for(let a=0;a<o.length;a++){let l=o[a].material;l.visible=t}}}async updateFontFamily(t){await mn.loadFont(t);let n=this.userData.textFrame,s=n.textLines;n.fontFamily=t;for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)a[l].updateFontFamily(t)}this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateFontSize(t){let n=this.userData.textFrame,s=n.textLines,o=n.fontSize;n.fontSize=t;for(let a=0;a<s.length;a++)s[a].updateFontSize(t);this.textFullUpdate(),t>o?this.checkOverFlow():t<o&&this.checkCapacity()}async updateTextTransform(t){let n=this.userData.textFrame;await mn.loadFont(n.fontFamily);let s=n.textLines;switch(n.textTransform=t,t){case 2:for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)s[o].message[l].updateChar(a[l].char.toUpperCase())}break;case 3:for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)s[o].message[l].updateChar(a[l].char.toLowerCase())}break;default:for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)s[o].message[l].updateChar(a[l].originalChar)}}this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateLetterSpacing(t){let r=this.userData,n=r.textFrame.textLines;r.textFrame.letterSpacing=t;for(let s=0;s<n.length;s++){let o=n[s].message;for(let a=0;a<o.length;a++)o[a].updateLetterSpacing(t)}this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateLOD(t){let r=this.userData;r.textFrame.LOD=t;let n=r.textFrame.textLines;for(let s=0;s<n.length;s++);this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateLineHeight(t){let r=this.userData,n=r.textFrame.textLines;r.textFrame.lineHeight=t;for(let s=0;s<n.length;s++)n[s].updatelineHeight(t);this.textFullUpdate()}updateVerticalAlignment(t){let r=this.userData;r.textFrame.verticalAlignment=t,this.textFullUpdate()}updateHorizontalAlignment(t){let r=this.userData;r.textFrame.horizontalAlignment=t,this.textFullUpdate()}toJSON(t){let r=super.toJSON(t),n=r.object;n.objectType="TextFrame";let o=this.userData.textFrame.textLines.map(a=>{let l=a.message.map(c=>({char:c.char,originalChar:c.originalChar,fontFamily:c.fontFamily,letterSpacing:c.letterSpacing,fontSize:c.fontSize,LOD:c.LOD}));return{align:a.align,endLine:a.endLine,lineHeight:a.lineHeight,maxCharSize:a.maxCharSize,yLinePos:a.yLinePos,message:l}});return n.userData.textFrame.textLinesData=o,r}async fromJSONasync(t){if(super.fromJSON(t),t.userData!==void 0){let r=t.userData.textFrame;await mn.loadFont(r.fontFamily),r.textOrigin=new M(r.textOrigin.x,r.textOrigin.y,r.textOrigin.z);let n=new zn({color:r.hexColor,opacity:r.opacity,visible:r.visible,transparent:!0,side:or});r.textLinesData&&(r.textLines=r.textLinesData.map((s,o)=>{let a=new uo(Number(s.yLinePos),Number(s.lineHeight),Number(s.maxCharSize)),l=s.message.map((c,h)=>{if(c.char===void 0){let d=r.textLines[o].message[h];if("geometries"in d){let p=d.geometries[0].userData.parameters;Object.assign(c,{LOD:p.lod,char:p.char,fontFamily:p.fontFamily,fontSize:p.fontSize,letterSpacing:p.letterSpacing,originalChar:p.char})}}let u={char:c.char,fontFamily:c.fontFamily,letterSpacing:Number(c.letterSpacing),fontSize:Number(c.fontSize),LOD:c.LOD},f=new mn(u,n.clone());return a.addChar3D(f,r.textOrigin),this.charContainer.add(f),f});return a.message=l,a}),this.userData.textFrame=r),this.textFullUpdate()}return this}fromTextFrameData(t,r){if(t.color!==void 0){let n=pr(t.color,r);this.updateColor(n),this.updateOpacity(n.a)}t.alpha!==void 0&&this.updateOpacity(t.alpha),t.font!==void 0&&this.updateFontFamily(t.font),t.horizontalAlign!==void 0&&this.updateHorizontalAlignment(t.horizontalAlign),t.verticalAlign!==void 0&&this.updateVerticalAlignment(t.verticalAlign),t.textTransform!==void 0&&this.updateTextTransform(t.textTransform),t.fontSize!==void 0&&this.updateFontSize(t.fontSize),t.lineHeight!==void 0&&this.updateLineHeight(t.lineHeight),t.letterSpacing!==void 0&&this.updateLetterSpacing(t.letterSpacing),t.text!==void 0&&t.text!==""&&this.updateText(t.text),(t.width!==void 0||t.height!==void 0)&&this.updateGeometry({parameters:{width:t.width,height:t.height}})}fromState(t,r){return super.fromState(t),this.fromTextFrameData(t,r),this}convertToVector(){let{fontFamily:t,hexColor:r}=this.userData.textFrame,n=new gs;n.name="Text Shape";let s=mn.fontCache[t];for(let o of this.charContainer.children)o instanceof mn&&s.generateShapes(o.char,1).forEach(a=>{let l=new Tt().fromShape(a);l.applyScale(o.scale.x,o.scale.y);let c=Hr.create({shape:l}),h=new Yr({side:or});h.color=r;let u=new ho(c,h);u.name=o.char,u.position.copy(o.position),u.rotation.copy(o.rotation),n.attach(u)});return n}},ea=Uv;ea.VerticalAlign=ky,ea.HorizontalAlign=Gy,ea.TextTransform=Vy;var pA=HT(fA());var zv;bp.then(i=>{zv=i});var mA=new Ae,nU=new Ae,iU=new Ae,vi=new Kt,fo=new M,sU=new Ae,oU=new Ae,po=class extends kt{constructor(t,r,n,s=new pn){super(n!=null?n:r,s);this.subdivPointer=t;this.originalGeometry=r;this.subdividedGeometry=n;this.objectType="SubdivObject";this.hiddenMatrixOld=new Ae;this.smoothShading=!0;this.phongAngle=35;this.matrixWorldRigid=new Ae;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1}static createFromState(t,r,n){let{subdivPointer:s,originalGeometry:o,subdividedGeometry:a}=Kn.build(r.geometry,void 0,void 0,!r.flatShading),l=uu(r.material,n),c=new po(s,o,a||void 0,l);return r.geometry.phongAngle!==void 0&&(c.phongAngle=r.geometry.phongAngle),c.calcBoundingBox(),c.freeSubdivPointer(),c.uuid=t,c.fromState(r),c}shallowClone(t){return new ac(this.geometry,this.material).shallowCopy(this,t)}toJSON(t){let r=super.toJSON(t);return r.object.objectType="SubdivObject",r}buildFromStore(t,r){var a,l,c;let{originalGeometry:n,subdividedGeometry:s,subdivPointer:o}=Kn.build(t,r,this.subdivPointer,this.smoothShading,this.shearScale);if(t.phongAngle!==void 0&&(this.phongAngle=t.phongAngle),this.subdivPointer=o,n!==void 0&&((a=this.originalGeometry)==null||a.dispose(),this.originalGeometry=n),s!==void 0&&((l=this.subdividedGeometry)==null||l.dispose(),this.subdividedGeometry=s!=null?s:void 0),this.geometry=(c=this.subdividedGeometry)!=null?c:this.originalGeometry,this.cloner)for(let h of this.cloner.children)h.geometry=this.geometry;t.width&&(this.geometry.userData.parameters={width:t.width,height:t.height,depth:t.depth})}updateMesh(t=!1){Kn.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,t?this.shearScaleInv:void 0),this.subdividedGeometry&&Kn.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,t?this.shearScaleInv:void 0)}updateTopology(){var t;this.originalGeometry.dispose(),this.originalGeometry=Kn.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=Kn.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.geometry=(t=this.subdividedGeometry)!=null?t:this.originalGeometry}raycast(t,r){var n;this.geometry=this.originalGeometry,kt.prototype.raycast.call(this,t,r),this.geometry=(n=this.subdividedGeometry)!=null?n:this.originalGeometry}updateMatrixWorldSVD(){let t=this.matrixWorld.elements,r=[[t[0],t[4],t[8]],[t[1],t[5],t[9]],[t[2],t[6],t[10]]],{u:n,v:s,q:o}=(0,pA.SVD)(r),a=mA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),l=nU.set(s[0][0],s[0][1],s[0][2],0,s[1][0],s[1][1],s[1][2],0,s[2][0],s[2][1],s[2][2],0,0,0,0,1),c=iU.copy(l).transpose();this.shearScale=sU.makeScale(o[0],o[1],o[2]).multiply(c).premultiply(l),this.shearScaleInv=oU.copy(this.shearScale).invert(),this.matrixWorldRigid.multiplyMatrices(a,c),o.every(h=>Math.abs(o[0]-h)<.01)&&(this.shearScale=void 0,this.shearScaleInv=void 0)}activateSVDCompensation(){this.shearScale!==void 0&&(this.matrixAutoUpdate=!1,this.matrix.copy(this.matrixWorldRigid).copyPosition(this.matrixWorld),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}deactivateSVDCompensation(){this.shearScale!==void 0&&(this.shearScale=void 0,this.shearScaleInv=void 0,this.matrixAutoUpdate=!0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}calcBoundingBox(){let t=this.originalGeometry;t.boundingSphere===null&&(t.boundingSphere=new Lr);let r=t.attributes.position,n=t.boundingSphere.center;vi.setFromBufferAttribute(r),vi.getCenter(n),t.boundingSphere.radius=n.distanceTo(vi.max),isNaN(t.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),vi.getSize(fo);let s={width:fo.x,height:fo.y,depth:fo.z};return this.geometry.userData.parameters=s,s}updateBoundingBox(t){let r=this.originalGeometry;vi.min.set(t[0],t[2],t[4]),vi.max.set(t[1],t[3],t[5]),this.shearScaleInv&&(vi.min.applyMatrix4(this.shearScaleInv),vi.max.applyMatrix4(this.shearScaleInv)),r.boundingSphere===null&&(r.boundingSphere=new Lr);let n=r.boundingSphere.center;vi.getCenter(n),r.boundingSphere.radius=n.distanceTo(vi.max),isNaN(r.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),vi.getSize(fo);let s={width:fo.x,height:fo.y,depth:fo.z};return this.geometry.userData.parameters=s,s}freeSubdivPointer(){this.subdivPointer&&(zv.free_bvh(this.subdivPointer),zv.free_subdivision_surface(this.subdivPointer),this.subdivPointer=0)}updateGeometry(t){this.geometry.userData.scale||(this.geometry.userData.scale=Array(3)),this.geometry.userData.scale[0]=this.geometry.userData.parameters.width===0?1:t.parameters.width/this.geometry.userData.parameters.width,this.geometry.userData.scale[1]=this.geometry.userData.parameters.height===0?1:t.parameters.height/this.geometry.userData.parameters.height,this.geometry.userData.scale[2]=this.geometry.userData.parameters.depth===0?1:t.parameters.depth/this.geometry.userData.parameters.depth,dA(this.originalGeometry.attributes,...this.geometry.userData.scale),this.originalGeometry.attributes.position.needsUpdate=!0,this.originalGeometry.attributes.normal.needsUpdate=!0,this.subdividedGeometry&&(dA(this.subdividedGeometry.attributes,...this.subdividedGeometry.userData.scale),this.subdividedGeometry.attributes.position.needsUpdate=!0,this.subdividedGeometry.attributes.normal.needsUpdate=!0),this.geometry.userData.parameters=se({},t.parameters)}};function dA(i,e,t,r){let n=i.position.array,s=i.normal.array,o=mA.makeScale(e,t,r).invert().elements,a,l,c;for(var h=0,u=n.length;h<u;h+=3)n[h]*=e,n[h+1]*=t,n[h+2]*=r,a=s[h],l=s[h+1],c=s[h+2],s[h]=o[0]*a+o[4]*l+o[8]*c,s[h+1]=o[1]*a+o[5]*l+o[9]*c,s[h+2]=o[2]*a+o[6]*l+o[10]*c}function gA(i,e){e.flatShading!==void 0&&(i.flatShading=e.flatShading,i.needsUpdate=!0),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.side!==void 0&&(e.side===0?i.side=si:e.side===1?i.side=Dr:i.side=or)}function aU(i,e){if(Array.isArray(i.material))for(let t of i.material)gA(t,e);else{let t=i.material;gA(t,e)}i.objectType==="SubdivObject"&&e.flatShading!==void 0&&(i.material.flatShading=!1,i.smoothShading=!e.flatShading,i.updateMesh())}function yA(i,e,t){let r;if(e.geometry.type==="SubdivGeometry")r=po.createFromState(i,e,t);else{let n=e.geometry.type==="BooleanGeometry"?new De:Fp(e.geometry,t),s="materials"in e?z1(e.materials,t):uu(e.material,t);sp.is2DParametricMesh(n.userData.type)?r=new sc(n,s):(n==null?void 0:n.userData.type)==="VectorGeometry"?r=new ho(n,s):e.geometry.type==="NonParametricGeometry"?r=new ac(n,s):e.geometry.type==="BooleanGeometry"?(r=new zp(void 0,s),r.booleanOp=e.geometry.operation,e.geometry.phongAngle!==void 0&&(r.phongAngle=e.geometry.phongAngle)):r=new oc(n,s),r.uuid=i,r.fromState(e)}return aU(r,e),r}function vA(i,e,t){return e.type==="Mesh"?yA(i,e,t):e.type==="TextFrame"?ea.createFromState(i,e,t):e.type==="Empty"?gs.createFromState(i,e):e.type==="PointLight"?nc.createFromState(i,e,t):e.type==="SpotLight"?ic.createFromState(i,e,t):e.type==="DirectionalLight"?rc.createFromState(i,e,t):eo.is(e.type)?Bn.createFromState(i,e):(console.error(e),new gs)}function lU(i,e){e.uniforms[`f${e.id}_transmissionSamplerMap`].value=i.texture,e.uniforms[`f${e.id}_transmissionDepthMap`].value=i.depthTexture}function xA(i,e,t){if(!t.userData.layers)return!1;let r=!1,n=t.userData.layers.getLayersOfType("transmission");return n.length>0?(e.layers.set(3),r=!0,i!==void 0&&n.forEach(s=>lU(i,s))):e.layers.set(0),r}function bA(i,e){let t=!1;return e.traverseEntity(r=>{if(r instanceof kt)if(Array.isArray(r.material))for(let n=0;n<r.material.length;n++)xA(i,r,r.material[n])&&(t=!0);else xA(i,r,r.material)&&(t=!0)}),t}function wA(i,e){"material"in i&&cU(i.material,e),"geometry"in i&&i.geometry.dispose()}function cU(i,e){$S(i).forEach(t=>{e.isSharedMaterial(t)||t.dispose()})}var SA=new M,Gv=class extends Op(on){constructor(t,r){super();this.objectType="Scene";this.alpha=1;this.backupFog=new Po(16777215,.1,2e3);this.fogUseBGColor=!1;this.wireframeState=!1;this.needsTransmissionDirty=!0;this._needsTransmission=!1;this._color=new be(1,0,0);this.bgColor=new be(1,1,1);this.entityByUuid={};this.ambientLight=new Hs(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.personalCamera=this.createPersonalCamera(),this.activeCamera=this.personalCamera,this.sharedAssetManager=r,this.init(t,r)}needsTransmission(t){return this.needsTransmissionDirty&&(this._needsTransmission=bA(t,this),t!==void 0&&(this.needsTransmissionDirty=!1)),this._needsTransmission}find(t){if(t===""||t===void 0)return;let r=this.entityByUuid[t];return r===void 0?this.getObjectByProperty("uuid",t):r}get color(){return this._color}set color(t){this.fogUseBGColor===!0&&this.backupFog.color.copy(t),this._color.copy(t)}get enableFog(){return this.fog!==null}set enableFog(t){this.fog=t===!0?this.backupFog:null}init(t,r){if(this.createChildrenObjects(t.objects,this,r),this.personalCamera.removeFromParent(),this.add(this.personalCamera),this.ambientLight.removeFromParent(),this.add(this.ambientLight),this.setBackgroundColor(pr(t.backgroundColor,r)),this.updateFog(t.fog,r),this.updateAmbientLight(t.environment.ambientLight,r),this.activeCamera=this.personalCamera,t.publish.playCamera!==null){let n=this.find(t.publish.playCamera);n instanceof Bn&&this.switchActiveCamera(n)}this.traverse(n=>{Lt(n)&&n.recomputeBoolean()})}clearScene(t){this.traverseEntity(r=>{wA(r,t)});for(let r of this.children)Xn(r)&&r.removeFromParent()}resetAfterClear(t,r){this.init(t,r)}createPersonalCamera(){let t=Bn.createFromState(Gv.PERSONAL_CAMERA_ID,xe(se({},ap.defaultData),{name:"Personal Camera"}));return t.enableHelper=!1,t.objectHelper.visible=!1,delete t.isEntity,this.registerObjectCreatedInLegacy(t),t}raycast(t){let r=[],n=s=>{for(let o of s.children)Xn(o)&&!o.raycastLock&&o.visible&&((er(o)||ms(o)&&o.enableHelper&&o.objectHelper.parent)&&t.intersectObject(o,!1,r),n(o))};return n(this),r}traverseEntity(t){for(let r of this.children)Xn(r)&&r.traverseEntity(t)}updateFog(t,r){this.enableFog=t.enabled,this.fogUseBGColor=t.useBackgroundColor,t.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=pr(t.color,r),this.backupFog.near=t.near,this.backupFog.far=t.far}toJSON(t){return{}}fromJSON(t){return this}dispose(){this.clearScene(this.sharedAssetManager),this.sharedAssetManager.dispose()}updateAmbientLight(t,r){V1(this.ambientLight,t,r),t.groundColor!==void 0&&(this.ambientLight.groundColor=pr(t.groundColor,r)),t.enabled!==void 0&&(this.ambientLight.visible=t.enabled)}switchActiveCamera(t){this.activeCamera!==this.personalCamera&&(this.activeCamera.enableHelper=!0),this.activeCamera=t,t.enableHelper=!1}setBackgroundColor(t){this.bgColor=t,this.alpha=t.a}createChildrenObjects(t,r,n){for(let s of t)this.createChildObject(s.id,s.data,s.children,r,n)}registerObjectCreatedInLegacy(t){this.entityByUuid[t.uuid]=t}unregisterObject(t){delete this.entityByUuid[t.uuid];for(let r of t.children)this.unregisterObject(r)}createChildObject(t,r,n,s,o){let a=vA(t,r,o);return a&&(this.entityByUuid[t]=a,s.add(a),Lt(s)&&er(a)&&(a.prevBooleanObjectParent=s),this.createChildrenObjects(n,a,o)),a}getCenter(t){let r=[];for(let s=0,o=t.length;s<o;++s){let{id:a,recursive:l}=t[s],c=this.find(a),h=l?c.recursiveBBox:c.singleBBox;r.push(...h.vertices)}let n=new Kt;return n.setFromPoints(r),n.getCenter(SA),SA}copyMatrixWorld(t,r){if(t===null){r.identity();return}let n=this.find(t);n?r.copy(n.matrixWorld):r.identity()}copyParentMatrixWorld(t,r){var s;if(t===null){r.identity();return}let n=(s=this.find(t))==null?void 0:s.parent;n?r.copy(n.matrixWorld):r.identity()}traverseMaterial(t){this.traverseEntity(r=>{if(r instanceof kt)if(Array.isArray(r.material))for(let n=0;n<r.material.length;n++)t(r.material[n]);else t(r.material)})}updateCanvasSize(t,r){this.activeCamera.setViewplaneSize(t,r);let n,s;t>=r?(n=r/t,s=1):(n=1,s=t/r),this.traverseMaterial(o=>{o.layersList.getLayersOfType("transmission").forEach(l=>{l.uniforms[`f${l.id}_aspectRatio`].value.x=n,l.uniforms[`f${l.id}_aspectRatio`].value.y=s})})}},yu=Gv;yu.PERSONAL_CAMERA_ID="f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera";var PA={RED:0,GREEN:1,BLUE:2,ALPHA:3};var vu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var hU=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
3926
|
+
`)}return r}copy(t){return super.copy(t),t.color&&(this.color=t.color.clone()),this.roughness=t.roughness.clone(),this.metalness=t.metalness.clone(),t.position&&(this.position=t.position.clone()),t.afterColor&&(this.afterColor=t.afterColor.clone()),t.alpha&&(this.alpha=t.alpha.clone()),t.reflectivity&&(this.reflectivity=t.reflectivity.clone()),t.shadingAlpha&&(this.shadingAlpha=t.shadingAlpha.clone()),t.shadingBlend&&(this.shadingBlend=t.shadingBlend.clone()),this}};var Rp=class extends Rn{constructor(t=new Ip,r){super(t,t,r);this.type="StandardNodeMaterial",this.fragment=t}get color(){return this.fragment.color}set color(t){this.fragment.color=t}get afterColor(){return this.fragment.afterColor}set afterColor(t){this.fragment.afterColor=t}get alpha(){return this.fragment.alpha}set alpha(t){this.fragment.alpha=t}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(t){this.fragment.shadingAlpha=t}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(t){this.fragment.shadingBlend=t}get position(){return this.fragment.position}set position(t){this.fragment.position=t}get roughness(){return this.fragment.roughness}set roughness(t){this.fragment.roughness=t}get metalness(){return this.fragment.metalness}set metalness(t){this.fragment.metalness=t}get reflectivity(){return this.fragment.reflectivity}set reflectivity(t){this.fragment.reflectivity=t}};var Xl=class extends Rp{constructor(e,t,r){super(t,e),this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=r!=null?r:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Zr){let t=e.userData.layers,r=e.fragment;super.copy(e);let n=r.clone();this.fragment=n,this.vertex=n;let s=t.clone(this);this.userData.layers=s,n.shadingAlpha.value=r.shadingAlpha.value,n.shadingBlend.value=r.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,r){let n=r.getNode(t.vertex),s=new Xl(void 0,n);return s.fromJSON(t,r),s}dispose(){super.dispose()}};function pr(i,e){let t;if(typeof i=="string"){let r=e==null?void 0:e.getColor(i);r?t=r:(console.warn("Tried to create color layer params with a color key that does not exist in the assets manager"),t=new Wr(0,0,0,0))}else return"a"in i?new Wr(i.r,i.g,i.b,i.a):new Wr(i.r,i.g,i.b,1);return t}function Bp(i,e){switch(i.data.type){case"light":return gi(i);case"fresnel":return LF(i,e);case"gradient":return IF(i);case"depth":return RF(i);case"normal":return BF(i);case"noise":return NF(i,e);case"texture":return OF(i,e);case"rainbow":return FF(i);case"transmission":return UF(i,e);case"matcap":return zF(i,e);case"displace":return GF(i);case"color":default:return DF(i,e)}}function O1(i){return{type:i.data.type}}function gi(i){let{alpha:e,mode:t}=i.data;return xe(se({},O1(i)),{alpha:e,mode:t})}function DF(i,e){return xe(se({},gi(i)),{color:pr(i.data.color,e)})}function LF(i,e){let{bias:t,scale:r,intensity:n,factor:s,color:o}=i.data;return xe(se({},gi(i)),{color:pr(o,e),bias:t,scale:r,intensity:n,factor:s})}function IF(i){let{gradientType:e,smooth:t,colors:r,steps:n,angle:s,offset:o,morph:a}=i.data;return xe(se({},gi(i)),{gradientType:e,smooth:t,colors:r.map(l=>new Je(l[0],l[1],l[2],l[3])),num:r.length,steps:n,offset:new B(...o),morph:new B(...a),angle:s})}function RF(i){let{gradientType:e,near:t,far:r,isVector:n,isWorldSpace:s,origin:o,direction:a,colors:l,steps:c,smooth:h,num:u}=i.data;return xe(se({},gi(i)),{gradientType:e,near:t,far:r,isVector:n,isWorldSpace:s,origin:new M(...o),direction:a?new M(...a):new M(1,0,0),num:u,colors:l.map(f=>new Je(f[0],f[1],f[2],f[3])),steps:c,smooth:h})}function BF(i){let{cnormal:e}=i.data;return xe(se({},gi(i)),{cnormal:new M(e[0],e[1],e[2])})}function NF(i,e){let{data:t}=i;return xe(se({},gi(i)),{scale:t.scale,move:t.move,fA:new B(...t.fA),fB:new B(...t.fB),size:new M(...t.size),distortion:new B(...t.distortion),colorA:pr(t.colorA,e),colorB:pr(t.colorB,e),colorC:pr(t.colorC,e),colorD:pr(t.colorD,e),noiseType:t.noiseType})}function OF(i,e){let{projection:t,axis:r,side:n,crop:s,size:o}=i.data,{image:a,wrapping:l,repeat:c,offset:h}=i.data.texture,u=new Pt,f;if(typeof a=="string")f=e==null?void 0:e.getImage(a);else{let d=new Image;d.src=co(a.data),d.onload=()=>{e!=null&&e.onImageLoad&&(e==null||e.onImageLoad())},f=d}return u.image=f,u.repeat.set(c[0],c[1]),u.offset.set(h[0],h[1]),u.wrapS=u.wrapT=l,xe(se({},gi(i)),{texture:u,mat:new Ft().setUvTransform(h[0],h[1],c[0],c[1],0,0,0),crop:s,projection:t,axis:["x","y","z"].indexOf(r),side:[2,0,1].indexOf(n),size:o})}function FF(i){let{data:e}=i;return xe(se({},gi(i)),{filmThickness:e.filmThickness,movement:e.movement,wavelengths:new M(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new M(...e.offset)})}function UF(i,e){let{data:t}=i;return xe(se({},gi(i)),{thickness:t.thickness,ior:t.ior,roughness:t.roughness,transmissionSamplerMap:e.transmissionSamplerMap,transmissionDepthMap:e.transmissionDepthMap})}function zF(i,e){let t=new Pt,{image:r}=i.data.texture,n;if(typeof r=="string")n=e==null?void 0:e.getImage(r);else{let o=new Image;o.src=co(r.data),o.onload=()=>{e!=null&&e.onImageLoad&&(e==null||e.onImageLoad())},n=o}t.image=n;let s=16777215;return xe(se({},gi(i)),{color:s,texture:t})}function GF(i){let{data:e}=i,t=xe(se({},O1(i)),{intensity:e.intensity});if(e.displacementType==="noise")return xe(se({},t),{offset:new M(...e.offset),scale:e.scale,movement:e.movement,noiseType:e.noiseType});{let r=new Pt,n=new Ft().setUvTransform(0,0,1,1,0,0,0);return xe(se({},t),{texture:r,mat:n,crop:e.crop})}}function Np(i,e,t){if(t.type==="displace"&&(i==="intensity"||i==="visible")){let r=e.uniforms[`f${e.id}_intensity`];return r?(r.value=t.intensity*(t.visible?1:0),r):void 0}if(t.type!=="displace"&&(i==="alpha"||i==="visible")){let r=e.uniforms[`f${e.id}_alpha`];return r?(r.value=t.alpha*(t.visible?1:0),r):void 0}}var Ql;(e=>{function i(t){return new be(t.x,t.y,t.z).getHex()}e.getHex=i})(Ql||(Ql={}));var F1;(e=>{function i(t){return new Je(t.r,t.g,t.b,t.a)}e.getThreeVector4=i})(F1||(F1={}));var U1;(t=>{function i(r,n){r.setRGB(n.r,n.g,n.b)}t.setThreeColor=i;function e(r){return new be(r.r,r.g,r.b).getHex()}t.getHex=e})(U1||(U1={}));function uu(i,e){return typeof i=="string"?e.getMaterialOrDeletedPlaceholder(i):_v(i,e)}function z1(i,e){return i.map(t=>uu(t,e))}function _v(i,e){var o,a;let t=(o=i.layers)!=null?o:ui.defaultTwoLayerData("phong").layers,r=kF(t),n;switch(r.category){case"basic":n=new Yr;break;case"lambert":{n=new ql;break}case"toon":{n=new Yl;break}case"physical":n=new Xl;break;case"phong":default:{n=new pn;break}}n.name=(a=i.name)!=null?a:"Untitled Material";let s=n.userData.layers;VF(s);for(let l=t.length-1;l>=0;l--)HF(s,t[l],e);switch(r.category){case"basic":break;case"lambert":{let h=n,f=pr(r.emissive,e);f instanceof be?h.emissive.value=f:h.emissive.value.setHex(Ql.getHex(f));break}case"toon":{let h=n,u=r;h.shininess.value=u.shininess;let f=pr(u.specular,e);f instanceof be?h.specular.value=f:h.specular.value.setHex(Ql.getHex(f));break}case"physical":let l=n,c=r;l.metalness.value=c.metalness,l.roughness.value=c.roughness,l.reflectivity.value=c.reflectivity;break;case"phong":default:{let h=n,u=r;h.shininess.value=u.shininess;let f=pr(u.specular,e);f instanceof be?h.specular.value=f:h.specular.value.setHex(Ql.getHex(f));break}}return s.blendColors(),s.blendAfterColors(),s.blendPositions(),n}function kF(i){for(let e of i)if(e.data.type==="light")return e.data;return{type:"light",category:"basic",visible:!0,alpha:1,mode:0}}function VF(i){for(let e of i.getLayers())i.removeLayer(e.id)}function HF(i,e,t){let r=Bp(e,t);r.type==="transmission"&&(r.transmissionSamplerMap=t==null?void 0:t.transmissionSamplerMap,r.transmissionDepthMap=t==null?void 0:t.transmissionDepthMap);let n=i.addLayer(r);n.uuid=e.id;for(let s in e.data)Np(s,n,e.data)}var Zo=i=>"isEntity"in i,er=i=>"isAbstractMesh"in i,Lt=i=>i!==null&&i.isBooleanMesh,G1=i=>i.objectType==="CombinedCamera",k1=i=>Zo(i)&&(i.objectType==="LightDirectional"||i.objectType==="LightSpot"||i.objectType==="LightPoint");var ms=i=>"objectHelper"in i;function Ev(i,e){var r;let t=!1;e.position&&(i.position.fromArray(e.position),t=!0),e.rotation&&(i.rotation.fromArray(e.rotation),t=!0),e.scale&&(t=!0,i.scale.fromArray(e.scale)),e.hiddenMatrix!==void 0&&"hiddenMatrix"in i&&(t=!0,i.hiddenMatrix.fromArray((r=e.hiddenMatrix)!=null?r:Di.identity)),t&&(i.updateMatrix(),Lt(i.parent)&&er(i)&&i.invalidateDownstreamBooleanData(!0).recomputeBoolean()),e.position&&e.rotation&&e.scale&&e.hiddenMatrix!==void 0&&i.updateWorldMatrix(!1,!0),i.objectType==="CombinedCamera"&&(e.isUpVectorFlipped!==void 0&&(i.isUpVectorFlipped=e.isUpVectorFlipped),i.updateUp())}function WF(i,e){Ev(i,e),e.name!==void 0&&(i.name=e.name),e.visible!==void 0&&(i.isEntity?i.visibility=e.visible:i.visible=e.visible)}function V1(i,e,t){WF(i,e),e.color!==void 0&&(i.color=pr(e.color,t)),e.intensity!==void 0&&(i.intensity=e.intensity),e.shadows!==void 0&&!(i instanceof Hs)&&(i.castShadow=e.shadows),i.shadow&&!(i instanceof Hs)&&e.depth!==void 0&&(i.shadow.camera.far=e.depth,i.shadow.needsUpdate=!0),e.helper!==void 0&&ms(i)&&(i.enableHelper=e.helper,i.gizmos.shadowmap.visible=e.helper)}function H1(i,e){i.shadow.camera.right=e/2,i.shadow.camera.left=-e/2,i.shadow.camera.top=e/2,i.shadow.camera.bottom=-e/2,i.shadow.needsUpdate=!0}var Jl=new Kt,Xr=new M,Ge=new M,wr=new Ae;function jF(i,e,t=0,r=e.count){let n=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let h=t;h<r;h++){let u=e.getX(h),f=e.getY(h),d=e.getZ(h);u<n&&(n=u),f<s&&(s=f),d<o&&(o=d),u>a&&(a=u),f>l&&(l=f),d>c&&(c=d)}return i.min.set(n,s,o),i.max.set(a,l,c),i}var W1=(i,e,t,r)=>{var n;if(er(i)){let s=i.geometry.userData.parameters,o=i.geometry.getAttribute("position");i.geometry.userData.type==="SubdivGeometry"?Xr.copy(i.originalGeometry.boundingSphere.center):o!==void 0&&(jF(Jl,o,i.geometry.drawRange.start,i.geometry.drawRange.count<1/0?i.geometry.drawRange.count:o.count),Jl.getCenter(Xr)),i.forceComputeSize?Jl.getSize(Ge).multiplyScalar(.5):Ge.set(s.width,s.height,(n=s.depth)!=null?n:0).multiplyScalar(.5)}else if(ms(i)&&r===!0){let s=i.geometryHelper.getAttribute("position");Jl.setFromArray(s.array),Jl.getCenter(Xr),Jl.getSize(Ge).multiplyScalar(.5)}else Xr.setScalar(0),Ge.setScalar(0);wr.copy(e).multiply(i.matrixWorld),Ge.x===0&&Ge.y===0&&Ge.z===0?t.push(new M(Xr.x,Xr.y,Xr.z).applyMatrix4(wr)):t.push(new M(-Ge.x,Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(-Ge.x,-Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,-Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,Ge.y,Ge.z).add(Xr).applyMatrix4(wr),new M(-Ge.x,Ge.y,-Ge.z).add(Xr).applyMatrix4(wr),new M(-Ge.x,-Ge.y,-Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,-Ge.y,-Ge.z).add(Xr).applyMatrix4(wr),new M(Ge.x,Ge.y,-Ge.z).add(Xr).applyMatrix4(wr))},fu=class extends Kt{constructor(){super(...arguments);this.matrix=new Ae;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(r=>r.clone()),this.faces=t.faces.map(r=>r.clone()),this.edges=t.edges.map(r=>r.clone()),this.centerEdges=t.centerEdges.map(r=>r.clone()),this}setFromObjectSize(t,r=!1){t.updateWorldMatrix(!1,r),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let n=new Ae().copy(t.matrixWorld).invert();return this.expandByObjectSize(t,n,r)}expandByObjectSize(t,r,n=!1){let s=[];return n===!0?t.traverseEntity(o=>{o.visible&&W1(o,r,s,t.enableHelper===!0)}):W1(t,r,s,t.enableHelper===!0),this.setFromPoints(s)}getCenter(t){return t=super.getCenter(t),t.applyMatrix4(this.matrix),t}getPositionToCenter(t){return t=super.getCenter(t),t.applyMatrix4(wr.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(Ge).multiplyScalar(.5),this.getCenter(Xr),wr.copy(this.matrix).setPosition(Xr),this.vertices=[new M(-Ge.x,Ge.y,Ge.z).applyMatrix4(wr),new M(-Ge.x,-Ge.y,Ge.z).applyMatrix4(wr),new M(Ge.x,-Ge.y,Ge.z).applyMatrix4(wr),new M(Ge.x,Ge.y,Ge.z).applyMatrix4(wr),new M(-Ge.x,Ge.y,-Ge.z).applyMatrix4(wr),new M(-Ge.x,-Ge.y,-Ge.z).applyMatrix4(wr),new M(Ge.x,-Ge.y,-Ge.z).applyMatrix4(wr),new M(Ge.x,Ge.y,-Ge.z).applyMatrix4(wr)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new Jr(this.vertices[0],this.vertices[3]),new Jr(this.vertices[1],this.vertices[2]),new Jr(this.vertices[5],this.vertices[6]),new Jr(this.vertices[4],this.vertices[7]),new Jr(this.vertices[0],this.vertices[1]),new Jr(this.vertices[3],this.vertices[2]),new Jr(this.vertices[7],this.vertices[6]),new Jr(this.vertices[4],this.vertices[5]),new Jr(this.vertices[0],this.vertices[4]),new Jr(this.vertices[1],this.vertices[5]),new Jr(this.vertices[2],this.vertices[6]),new Jr(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(t=>t.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function du(i){let e=[];for(let t in i){let r=i[t];delete r.metadata,e.push(r)}return e}function qF(i){let e=[];for(let t in i)e.push(i[t]);return e}var Op=i=>class extends i{hasEntityChild(){return this.children.some(t=>Zo(t))}isDescendantOf(t){t instanceof ot&&(t=t.uuid);let r=this;for(;r.parent;){if(r.parent.uuid===t)return!0;r=r.parent}return!1}attach(t,r){this.updateWorldMatrix(!0,!1);let n=new Ae().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),n.multiply(t.parent.matrixWorld)),Zo(t)?t.hiddenMatrix.premultiply(n):t.applyMatrix4(n),t.updateWorldMatrix(!1,!1),this.add(t),r!==void 0&&(this.children.pop(),this.children.splice(r,0,t)),this}copy(t,r=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),r===!0)for(let n=0;n<t.children.length;n++){let s=t.children[n];this.add(s.clone())}return this}toJSON(t){let r=t===void 0,n={object:{uuid:"",objectType:""}};t===void 0&&(t={geometries:{},materials:{},textures:{},images:{},interactionStates:{},nodes:{}},n.metadata={version:1.5,type:"Object",generator:"Object3D.toJSON"});let s={uuid:this.uuid,objectType:this.type};if(this.name!==""&&(s.name=this.name),s.matrix=this.matrix.toArray(),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),s.layers=this.layers.mask,JSON.stringify(this.userData)!=="{}"&&(s.userData=this.userData),this.children.length>0){s.children=[];for(let o of this.children)(Zo(o)||o instanceof bn)&&s.children.push(o.toJSON(t).object)}if(r){let o=du(t.geometries),a=du(t.materials),l=du(t.textures),c=du(t.images),h=du(t.interactionStates),u=qF(t.nodes);o.length>0&&(n.geometries=o),a.length>0&&(n.materials=a),l.length>0&&(n.textures=l),c.length>0&&(n.images=c),h.length>0&&(n.interactionStates=h),u.length>0&&(n.nodes=u)}return n.object=s,n}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var Xn=i=>"isEntity"in i,j1=i=>"isAbstractMesh"in i,Qn=i=>class extends Op(i){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new Ae;this._singleBBox=new fu;this._recursiveBBox=new fu;this.singleBBoxNeedsUpdate=!0;this.recursiveBBoxNeedsUpdate=!0;this.forceComputeSize=!1}set visibility(r){this.visible=r;for(let n of this.children)Xn(n)&&n.traverseEntity(s=>{ms(s)&&s.visible&&(s.objectHelper.visible=r)})}get visibility(){return this.visible}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}resetBBoxNeedsUpdate(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.traverseAncestors(r=>{Xn(r)&&(r.singleBBoxNeedsUpdate=!0,r.recursiveBBoxNeedsUpdate=!0)}),this.traverseEntity(r=>{r.singleBBoxNeedsUpdate=!0,r.recursiveBBoxNeedsUpdate=!0})}traverseEntity(r){r(this);for(let n of this.children)Xn(n)&&n.traverseEntity(r)}updateMatrixWorld(r){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||r)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,r=!0);for(let n of this.children)n.updateMatrixWorld(r)}updateWorldMatrix(r,n){let s=this.parent;if(r&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let o of this.children)o.updateWorldMatrix(!1,!0)}shallowClone(r){return new this.constructor().shallowCopy(this,r)}shallowCopy(r,n=!0){if(super.copy(r,!1),this.raycastLock=r.raycastLock,this.scaleLock=r.scaleLock,this.hiddenMatrix.copy(r.hiddenMatrix),n===!0)for(let s of r.children)Xn(s)&&this.add(s.shallowClone());return this}clone(r){return new this.constructor().copy(this,r)}copy(r,n=!0){if(super.copy(r,!1),this.raycastLock=r.raycastLock,this.scaleLock=r.scaleLock,this.hiddenMatrix.copy(r.hiddenMatrix),n===!0)for(let s of r.children)Xn(s)&&this.add(s.clone());return this}keepChildrenMatrixWorld(){let r=new Ae,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),r.copy(this.matrixWorld).invert(),r.multiply(n);for(let s of this.children)Xn(s)&&s.hiddenMatrix.premultiply(r)}toJSON(r){let n=super.toJSON(r),s=n.object;return this.raycastLock===!0&&(s.raycastLock=!0),this.scaleLock===!0&&(s.scaleLock=!0),s.hiddenMatrix=this.hiddenMatrix.toArray(),n}fromJSON(r){return super.fromJSON(r),r.raycastLock!==void 0&&(this.raycastLock=r.raycastLock),r.scaleLock!==void 0&&(this.scaleLock=r.scaleLock),this.hiddenMatrix.fromArray(r.hiddenMatrix),this}fromObject3D(r){let n=r.children;return r.children=[],Object.assign(r,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new Ae}),this.copy(r),r.children=n,this}toObjectTransformState(r=[]){this.updateWorldMatrix(!0,!1);let n={position:this.position.toArray(),rotation:[this.rotation.x,this.rotation.y,this.rotation.z],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};return wl(n,r)}fromObjectTransformState(r){return r.position&&this.position.fromArray(r.position),r.rotation&&this.rotation.fromArray(r.rotation),r.scale&&this.scale.fromArray(r.scale),r.hiddenMatrix&&this.hiddenMatrix.fromArray(r.hiddenMatrix),this.updateMatrix(),this}toState(r=[]){let n=se({name:this.name,visible:this.visible,raycastLock:this.raycastLock},this.toObjectTransformState(r));return wl(n,r)}fromState(r,n){return r.name&&(this.name=r.name),r.raycastLock!==void 0&&(this.raycastLock=r.raycastLock),r.type!=="OrthographicCamera"&&r.type!=="PerspectiveCamera"&&(this.matrixAutoUpdate=!1),r.visible!==void 0&&(this.visibility=r.visible),this.fromObjectTransformState(r),this}};var pu=class extends ot{constructor(t,r={}){super();this.object=t;let n=t.recursiveBBox.getSize(new M),s=.1;this.parameters=Fd.defaultData(n.toArray(),s),Vo(this.parameters,r),this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let t of this.children)t.material=this.object.material}setHideBase(t){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let r of this.object.material)r.visible=!0;if(t){let r=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=r}else for(let r of this.children)r.material=this.object.material}for(let r of this.object.material)r.visible=!t}else{if(this.children.length>0)if(this.object.material.visible=!0,t){let r=this.object.material.clone();for(let n of this.children)n.material=r}else for(let r of this.children)r.material=this.object.material;this.object.material.visible=!t}this.parameters.hideBase=t}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}this.children.forEach(t=>t.updateMatrix())}_updateCount(){let t=this.parameters.type==="grid"?this.parameters.grid.count[0]*this.parameters.grid.count[1]*this.parameters.grid.count[2]:this.parameters.count;if(this.children.length!==t)if(this.children.length<t)for(let r=0,n=t-this.children.length;r<n;++r){let s=this.object.shallowClone(!1);s.visible=!0,this.add(s),this.parameters.hideBase&&this.setHideBase(!0)}else for(let r=0,n=this.children.length-t;r<n;++r)this.remove(this.children[0])}_updateRadial(t){let r=t.radial,n=r.start*et.DEG2RAD,s=r.end*et.DEG2RAD,o=n-s,a=new yn(r.rotation[0]*et.DEG2RAD,r.rotation[1]*et.DEG2RAD,r.rotation[2]*et.DEG2RAD),l;switch(r.axis){case"z":l=new M(0,0,1);break;case"y":l=new M(0,1,0);break;default:case"x":l=new M(1,0,0);break}for(let[c,h]of this.children.entries()){h.hiddenMatrix.identity(),h.scale.x=r.scale[0],h.scale.y=r.scale[1],h.scale.z=r.scale[2],h.position.setScalar(0);let u=o/t.count*c-n;switch(r.axis){case"x":h.rotation.set(0,u,0);break;case"y":h.rotation.set(0,0,u);break;case"z":h.rotation.set(u,0,0);break}h.translateOnAxis(l,r.radius),h.position.x+=r.position[0],h.position.y+=r.position[1],h.position.z+=r.position[2],r.alignment===!0?(h.rotation.x+=a.x,h.rotation.y+=a.y,h.rotation.z+=a.z):h.rotation.copy(a)}}_updateLinear(t){if(t.type!=="linear")throw new Error;let r=t.linear,n=new yn(r.rotation[0]*et.DEG2RAD,r.rotation[1]*et.DEG2RAD,r.rotation[2]*et.DEG2RAD);for(let[s,o]of this.children.entries())o.hiddenMatrix.identity(),o.scale.x=1+(r.scale[0]-1)*s,o.scale.y=1+(r.scale[1]-1)*s,o.scale.z=1+(r.scale[2]-1)*s,o.rotation.x=n.x*s,o.rotation.y=n.y*s,o.rotation.z=n.z*s,o.position.x=r.position[0]*s,o.position.y=r.position[1]*s,o.position.z=r.position[2]*s}_updateGrid(t){let r=0,n=t.grid;if(n.useCenter===!0){let s={x:n.count[0]%2===0?2:1,y:n.count[1]%2===0?2:1,z:n.count[2]%2===0?2:1},o=new M(n.size[0]*(n.count[0]-s.x)*.5,n.size[1]*(n.count[1]-s.y)*.5,n.size[2]*(n.count[2]-s.z)*.5);for(let a=0;a<n.count[0];a++)for(let l=0;l<n.count[1];l++)for(let c=0;c<n.count[2];c++){let h=this.children[r++];h.hiddenMatrix.identity(),h.scale.setScalar(1),h.rotation.set(0,0,0),h.position.x=n.size[0]*a-o.x,h.position.y=n.size[1]*l-o.y,h.position.z=n.size[2]*c-o.z}}else for(let s=0;s<n.count[0];s++)for(let o=0;o<n.count[1];o++)for(let a=0;a<n.count[2];a++){let l=this.children[r++];l.hiddenMatrix.identity(),l.scale.setScalar(1),l.rotation.set(0,0,0),l.position.x=n.size[0]*s,l.position.y=-n.size[1]*o,l.position.z=-n.size[2]*a}}fromJSON(t){return this}toJSON(){return{}}fromClonerState(t){return t.hideBase!==void 0&&this.setHideBase(t.hideBase),Vo(this.parameters,t),this.update(),this}};var kt=class extends Qn(Vt){constructor(t,r){super(t,r);this.isAbstractMesh=!0;this.isBooleanMesh=!1;this.booleanMeshSetAddress=-1;this.booleanWasTransformed=!1;this.booleanMatrixInvOld=new Ae;this.booleanExclude=null;Array.isArray(r)&&(this.selectedMaterial=0,t.groups.length===0&&t.addGroup(0,t.getAttribute("position").count,0))}get cloner(){return this._cloner}set cloner(t){this._cloner&&this.remove(this._cloner),t&&this.add(t),this._cloner=t}getSelectedMaterial(t){return Array.isArray(this.material)?(this.selectedMaterial===void 0&&(this.selectedMaterial=t!=null?t:0),this.material[t!=null?t:this.selectedMaterial]):this.material}setSelectedMaterial(t,r){Array.isArray(this.material)?(this.selectedMaterial===void 0&&(this.selectedMaterial=r!=null?r:0),r=r!=null?r:this.selectedMaterial,this.material[r].dispose(),this.material[r]=t):(this.material.dispose(),this.material=t)}updateGeometry(t){let r=this.geometry,n=Cv[r.userData.type],s=this.objectType==="NonParametric"?Object.assign({},r.userData,{geometry:r}):r.userData,o=n.build(n.normalizeInputs(t,s)),a=r.uuid;if(this.geometry.dispose(),this.geometry=o,this.geometry.uuid=a,this.geometry.computeBoundingSphere(),this.cloner)for(let l of this.cloner.children)l.geometry=this.geometry}resizeGeometry(t,r,n){Xh.resizeGeometry(this.geometry,{width:t,height:r,depth:n})}shallowClone(t){return new this.constructor(this.geometry,this.material).shallowCopy(this,t)}clone(t){let r=this.objectType==="NonParametric"?Object.assign({},this.geometry.userData,{geometry:this.geometry.clone()}):this.geometry.userData,n=mu(r),s=Array.isArray(this.material)?this.material.map(o=>o.clone()):this.material.clone();return new this.constructor(n,s).copy(this,t)}copy(t,r=!0){return super.copy(t,r),t.cloner&&(this.cloner=new pu(t,t.cloner.parameters),this.add(this.cloner)),this}setFromClonerState(t){t===null?this.cloner=void 0:(this.cloner===void 0&&(this.cloner=new pu(this)),this.cloner.fromClonerState(t))}fromState(t,r){var n,s,o;return super.fromState(t),t.type==="Mesh"&&(this.setFromClonerState(t.cloner),this.castShadow=(n=t.castShadow)!=null?n:!0,this.receiveShadow=(s=t.receiveShadow)!=null?s:!0,this.booleanExclude=(o=t.booleanExclude)!=null?o:null),this}freeBooleanPointer(){this.booleanMeshSetAddress!==-1&&(Jn.freeMeshSet(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Lt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)er(t)&&(t.freeBooleanPointer(),Lt(t)&&t.invalidateUpstreamBooleanData())}};var YF=new M(0,0,1),q1=new M,Y1=new M,X1=new Ft,ho=class extends kt{constructor(t=Hr.create({}),r=new Yr({side:or})){var n;super(t,r);this.recursiveSelection=!1;this.objectType="VectorObject";this.eventDispatcher=new Yt;this._onShapeUpdate=()=>{this.updateGeometry({}),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=t.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(t){let r=super.toJSON(t);return r.object.objectType="VectorObject",r}fromState(t){return super.fromState(t),this.shape.update(),this}setHelperVisibility(){}updateGeometry(t){if(super.updateGeometry(t),"userData"in this.geometry){let r=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:r})}}setShape(t){var r,n;this.shape&&((r=this.shape.eventDispatcher)==null||r.removeEventListener("update",this._onShapeUpdate)),this.shape=t,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(t,r){super.updateWorldMatrix(t,r),X1.getNormalMatrix(this.matrixWorld),q1.copy(YF).applyMatrix3(X1).normalize(),Y1.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(q1,Y1)}clone(t){let r=this.shape.clone(),n=this.material.clone(),s=this.geometry.userData,o=Hr.create(Object.assign({},s,{shape:r})),a=new ho(o,n).copy(this,t);return a.shape=r,r.update(),a}raycast(t,r){kt.prototype.raycast.call(this,t,r)}};function Fp(i,e){return XF(i)}function XF(i){let e={parameters:i,type:i.type};if(i.type==="VectorGeometry"){let r=Tt.createFromState(i.shape,i.width,i.height);e.shape=r}else i.type==="NonParametricGeometry"&&(i.data.groups&&i.data.groups.forEach(r=>{var n;return r.materialIndex=Math.max((n=r.materialIndex)!=null?n:0,0)}),e.geometry=new Ws().parse(i));let t;try{t=mu(e)}catch(r){console.error(r)}if(!t){let r=Tt.createFromState(El.defaultData(),100,100);e.shape=r,t=mu(e)}return t}var Ke;bp.then(i=>{Ke=i});var Q1=new Float32Array([10,10,0,-10,10,0,-10,-10,0,10,-10,0]),J1=new Uint32Array([0,1,2,3]),K1=new Uint8Array([4]),Kn=class{static build(i,e,t,r,n){var c,h;let s,o,a,l=(h=(c=i==null?void 0:i.phongAngle)!=null?c:e==null?void 0:e.phongAngle)!=null?h:35;if(r===!1&&(l=-1),i.positionWASM!==void 0){t&&t!==0&&(Ke.free_bvh(t),Ke.free_subdivision_surface(t));try{s=Kn.allocate(i,n)}catch(u){console.error(u,i),s=Kn.allocate({positionWASM:Q1,indexWASM:J1,verticesPerFaceWASM:K1},n)}Ke.set_destination_refinement_level(s,0),o=Kn.buildLevel(s,!0,l)}else s=t,i.phongAngle!==void 0&&(o=Kn.buildLevel(s,!0,l));return i.subdivisions!==void 0&&(Ke.set_destination_refinement_level(s,i.subdivisions),i.subdivisions>0?a=Kn.buildLevel(s,!1,l):a=null),{subdivPointer:s,originalGeometry:o,subdividedGeometry:a}}static primitiveToQuads(i,e){i.widthSegments>16&&(i.widthSegments=16),i.heightSegments>16&&(i.heightSegments=16),i.depthSegments>16&&(i.depthSegments=16),i.radialSegments>16&&(i.radialSegments=16),i.type==="DodecahedronGeometry"&&(i.detail=0);let t=i.shape!==void 0?e.geometry:Fp(i),r,n,s,o;return{positions:r,triIndices:o}=Iv(t.getAttribute("position"),t.getIndex()),{indices:n,verticesPerFace:s}=Rv(r,o,t),{positions:r,indices:n,verticesPerFace:s}}static allocate(i,e){var b;let t,r,n,s=[],o=[];i.positionWASM&&i.positionWASM.length>0?(t=i.positionWASM,r=i.indexWASM,n=i.verticesPerFaceWASM):(t=Q1,r=J1,n=K1);let a=t.length,l=r.length,c=n.length,h=t.length+s.length+o.length,u=r.length+n.length,f=h*Float32Array.BYTES_PER_ELEMENT+u*Uint32Array.BYTES_PER_ELEMENT,d=h*Float32Array.BYTES_PER_ELEMENT,p=u*Uint32Array.BYTES_PER_ELEMENT,m=Ke._malloc(f),g=new Float32Array(Ke.HEAPF32.buffer,m,h),v=new Uint32Array(Ke.HEAPU32.buffer,m+d,u);g.set(t,0),g.set(s,t.length),g.set(o,t.length+s.length),v.set(r,0),v.set(n,r.length);let y;(b=i==null?void 0:i.scaleBaked)!=null&&b.some(S=>S!==1)&&(y=new Ae().makeScale(...i.scaleBaked)),e&&(y?y.premultiply(e):y=e);let w=y?Ke.alloc_subdivision_surface2(m,a,m+d,l,m+d+r.length*Uint32Array.BYTES_PER_ELEMENT,c,y.elements):Ke.alloc_subdivision_surface(m,a,m+d,l,m+d+r.length*Uint32Array.BYTES_PER_ELEMENT,c);return Ke._free(m),w}static buildLevel(i,e,t,r,n){let s=n?Ke.get_mesh_data2(i,e?Ke.Level.CONTROL:Ke.Level.REFINED,t,n.elements):Ke.get_mesh_data(i,e?Ke.Level.CONTROL:Ke.Level.REFINED,t),o=8,a=Ke.HEAPU32.subarray(s>>2,(s>>2)+o),l=a.subarray(4,4+4),c=0,h=Ke.HEAPU32[a[c]>>2],u=Ke.HEAPF32.subarray(h>>2,(h>>2)+l[c]);c++;let f=Ke.HEAPU32[a[c]>>2],d=Ke.HEAPF32.subarray(f>>2,(f>>2)+l[c]);c++;let p=Ke.HEAPU32[a[c]>>2],m=Ke.HEAPU32.subarray(p>>2,(p>>2)+l[c]);c++;let g=Ke.HEAPU32[a[c]>>2],v=Ke.HEAPU32.subarray(g>>2,(g>>2)+l[c]);if(c++,r===void 0){let y=new De;if(y.setIndex(new Os(v,1)),y.setAttribute("position",new Te(u,3)),y.setAttribute("normal",new Te(d,3)),e){y.setAttribute("faceMap",new Os(m,1));let w=new Float32Array(d.length/3*4).fill(0);y.setAttribute("color",new Ve(w,4))}return Ke.free_mesh_data(s),y.userData.type="SubdivGeometry",y}r.getAttribute("position").copyArray(u),r.getAttribute("normal").copyArray(d),r.attributes.position.needsUpdate=!0,r.attributes.normal.needsUpdate=!0,Ke.free_mesh_data(s)}static buildControlCageWireframe(i,e,t){let r=Ke.get_wireframe_data_for_base_level(i),n=4,s=Ke.HEAPU32.subarray(r>>2,(r>>2)+n),o=s.subarray(2,2+2),a=0,l=Ke.HEAPU32[s[a]>>2],c=Ke.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let h=Ke.HEAPU32[s[a]>>2],u=Ke.HEAPU32.subarray(h>>2,(h>>2)+o[a]);if(e===void 0){let f=new De;f.setAttribute("position",new Te(c,3));let d=new Float32Array(c.length);for(let p=0,m=c.length;p<m;)d[p++]=t.r,d[p++]=t.g,d[p++]=t.b;return f.setAttribute("color",new Ve(d,3)),f.setIndex(new Os(u,1)),Ke.free_wireframe_data_for_base_level(r),f}e.getAttribute("position").copyArray(c),e.attributes.position.needsUpdate=!0,Ke.free_wireframe_data_for_base_level(r)}static updateCollabMesh(i,e,t){e||Ke.set_destination_refinement_level(i,1);let r=t?Ke.get_topological_data2(i,e?Ke.Level.CONTROL:Ke.Level.REFINED,t.elements):Ke.get_topological_data(i,e?Ke.Level.CONTROL:Ke.Level.REFINED),n=6,s=Ke.HEAPU32.subarray(r>>2,(r>>2)+n),o=s.subarray(3,3+3),a=0,l=Ke.HEAPU32[s[a]>>2],c=new Float32Array(Ke.HEAPF32.subarray(l>>2,(l>>2)+o[a]));a++;let h=Ke.HEAPU32[s[a]>>2],u=new Uint32Array(Ke.HEAPU32.subarray(h>>2,(h>>2)+o[a]));a++;let f=Ke.HEAPU32[s[a]>>2],d=new Uint8Array(Ke.HEAPU32.subarray(f>>2,(f>>2)+o[a]));return Ke.free_topological_data(r),{positions:c,indices:u,verticesPerFace:d}}};var Z1=["getX","getY","getZ"];function Iv(i,e){let t={},r=e?e.count:i.count,n=0,s=[],o=[],a=1e4;for(let c=0;c<r;c++){let h=e?e.getX(c):c,u="";for(let f=0;f<3;f++)u+=`${~~(i[Z1[f]](h)*a)},`;if(u in t)s.push(t[u]);else{for(let f=0;f<3;f++)o.push(i[Z1[f]](h));t[u]=n,s.push(n),n++}}let l=[];for(let c=0;c<s.length;c+=3)s[c]===s[c+1]||s[c]===s[c+2]||s[c+1]===s[c+2]||l.push(s[c],s[c+1],s[c+2]);return{positions:o,triIndices:l}}var Up=new M,Pv=new M,Dv=new M,Lv=new M;function Rv(i,e,t){var s;let r=[],n=[];if(t.userData.shape!==void 0&&t.userData.parameters.depth===0){let o=t.userData.shape.extractShapePointsToFlatArray([]),a=0;for(let c=0;c<o.length;c+=2)a+=(o[c]-o[(c===0?o.length:c)-2])*(o[c+1]+o[(c===0?o.length:c)-1]);i.length=0;let l=0;if(a<0)for(let c=0;c<o.length;c+=2)i.push(o[c],o[c+1],0),r.push(l++);else for(let c=o.length-2;c>=0;c-=2)i.push(o[c],o[c+1],0),r.push(l++);return n.push(l),{indices:r,verticesPerFace:n}}for(let o=0,a=(s=t.capStartIndex)!=null?s:e.length;o<a;)if(e[o+1]===e[o+3]&&e[o+2]===e[o+5]||e[o+0]===e[o+3]&&e[o+2]===e[o+4]){Up.set(i[e[o]*3],i[e[o]*3+1],i[e[o]*3+2]),Pv.set(i[e[o+1]*3],i[e[o+1]*3+1],i[e[o+1]*3+2]),Dv.set(i[e[o+4]*3],i[e[o+4]*3+1],i[e[o+4]*3+2]),Lv.set(i[e[o+5]*3],i[e[o+5]*3+1],i[e[o+5]*3+2]),Pv.sub(Up).normalize(),Dv.sub(Up).normalize(),Lv.sub(Up).normalize();let l=Pv.cross(Dv).dot(Lv);Math.abs(l)>.005?(r.push(e[o],e[o+1],e[o+2]),n.push(3),o+=3):(r.push(e[o],e[o+1],e[o+4],e[o+5]),n.push(4),o+=6)}else r.push(e[o],e[o+1],e[o+2]),n.push(3),o+=3;if(t.capStartIndex!==void 0){let o=[],a=[],l=0;for(let c=0,h=0;c<i.length;c+=3,h++)i[c+2]===0&&(o.push(h),l++),i[c+2]===t.userData.parameters.depth&&a.push(h);if(t.userData.parameters.extrudeBevelSize===0){let c=a[0];a[0]=a[1],a[1]=c}o.reverse(),r.push(...o,...a),n.push(l,l)}return{indices:r,verticesPerFace:n}}var Jn={};_x(Jn,{calcBoolean:()=>KF,calcBooleanTopological:()=>JF,freeMeshSet:()=>eU,getMeshSet:()=>ZF,transformMeshSet:()=>$F});var eA,tA=new Promise(i=>{eA=i}),$1=!1;async function rA(){if($1)return;let e=!1?".":"https://unpkg.com/@splinetool/boolean-wasm@0.9.62/build",[t,r]=await Promise.all([import("./boolean.js"),fetch(`${e}/boolean.wasm`).then(o=>o.arrayBuffer())]),s=await t.default({wasmBinary:r});eA(s),$1=!0}var gt,Kl;tA.then(i=>gt=i);function QF(i,e){let t,{positions:r,triIndices:n}=Iv(i.getAttribute("position"),i.getIndex()),s;if(e){let{indices:o,verticesPerFace:a}=Rv(r,n,i);s=a.length,t=[];for(let l=0,c=0;l<s;l++){t.push(a[l]);for(let h=0;h<a[l];h++)t.push(o[c++])}}else{let o=n.length;t=Array(o+o/3),s=0;for(let a=0,l=0;l<t.length;)t[l++]=3,s++,t[l++]=n[a++],t[l++]=n[a++],t[l++]=n[a++]}return{positions:r,faceIndices:t,nFaces:s}}function nA(i){let e=i.length,t=e*Uint32Array.BYTES_PER_ELEMENT,r=e*Float32Array.BYTES_PER_ELEMENT,n=Number.isInteger(i[0])?t:r,s=gt._malloc(n);return(Number.isInteger(i[0])?new Uint32Array(gt.HEAPU32.buffer,s,e):new Float32Array(gt.HEAPF32.buffer,s,e)).set(i,0),s}function iA(i){switch(i){case 0:return gt.OP.UNION;case 1:return gt.OP.INTERSECTION;case 2:return gt.OP.A_MINUS_B;case 3:return gt.OP.B_MINUS_A;case 4:return gt.OP.SYMMETRIC_DIFFERENCE;case 5:return gt.OP.ALL;default:throw new Error("Unknown boolean operation "+i)}}function JF(i,e){Kl===void 0&&(Kl=gt.init_csg());let t=nA(i),r=gt.csg_calc_topological(Kl,t,i.length,iA(e));gt._free(t);let n=6,s=gt.HEAPU32.subarray(r>>2,(r>>2)+n),o=s.subarray(3,3+3),a=0,l=gt.HEAPU32[s[a]>>2],c=new Float32Array(gt.HEAPF32.subarray(l>>2,(l>>2)+o[a]));a++;let h=gt.HEAPU32[s[a]>>2],u=new Uint32Array(gt.HEAPU32.subarray(h>>2,(h>>2)+o[a]));a++;let f=gt.HEAPU32[s[a]>>2],d=new Uint8Array(gt.HEAPU32.subarray(f>>2,(f>>2)+o[a]));return gt.free_mesh_data(r),{positions:c,indices:u,verticesPerFace:d}}function KF(i,e,t,r){Kl===void 0&&(Kl=gt.init_csg());let n=nA(i),s=gt.csg_calc(Kl,n,i.length,r,iA(e));gt._free(n);let o=5,a=gt.HEAPU32.subarray(s>>2,(s>>2)+o),l=a.subarray(2,2+3),c=0,h=gt.HEAPU32[a[c]>>2],u=gt.HEAPF32.subarray(h>>2,(h>>2)+l[c]);c++;let f=gt.HEAPU32[a[c]>>2],d=gt.HEAPF32.subarray(f>>2,(f>>2)+l[c]);c++;let p=l[c];t.setAttribute("position",new Te(u,3)),t.setAttribute("normal",new Te(d,3));let m=gt.HEAPF32.subarray((s>>2)+5,(s>>2)+5+6);return t.boundingSphere===null&&(t.boundingSphere=new Lr),t.boundingSphere.center.set(m[0],m[1],m[2]),t.boundingSphere.radius=(m[3]**2+m[4]**2+m[5]**2)**.5,t.userData.parameters={width:m[3]*2,height:m[4]*2,depth:m[5]*2},gt.free_mesh_data(s),p}function ZF(i,e){if(gt===void 0)return-1;let t,r,n;if(e&&i.userData.positions!==void 0){let m=i.userData;n=m.verticesPerFace.length,t=m.positions,r=Array(m.verticesPerFace.reduce((g,v)=>g+v,0)+n);for(let g=0,v=0,y=0;g<m.verticesPerFace.length;g++){r[y++]=m.verticesPerFace[g];for(let w=0;w<m.verticesPerFace[g];w++)r[y++]=m.indices[v++]}}else({positions:t,faceIndices:r,nFaces:n}=QF(i,e));let s=t.length,o=r.length,a=t.length,l=r.length,c=a*Float32Array.BYTES_PER_ELEMENT+l*Uint32Array.BYTES_PER_ELEMENT,h=a*Float32Array.BYTES_PER_ELEMENT,u=l*Uint32Array.BYTES_PER_ELEMENT,f=gt._malloc(c),d=new Float32Array(gt.HEAPF32.buffer,f,a),p=new Uint32Array(gt.HEAPU32.buffer,f+h,l);return d.set(t,0),p.set(r,0),gt.get_csg_mesh(f,s,f+h,o,n)}function $F(i,e){gt.transform_csg_mesh(i,e.elements)}function eU(i){gt.free_csg_mesh(i)}var Cv={ConeGeometry:HM,CubeGeometry:WM,CylinderGeometry:VM,DodecahedronGeometry:jM,EllipseGeometry:d1,HelixGeometry:y1,IcosahedronGeometry:v1,LatheGeometry:x1,NonParametricGeometry:b1,PolygonGeometry:w1,PyramidGeometry:S1,RectangleGeometry:vp,SphereGeometry:M1,PlaneGeometry:A1,BackdropGeometry:T1,StarGeometry:_1,TextFrameGeometry:xp,TorusGeometry:E1,TorusKnotGeometry:C1,TriangleGeometry:P1,VectorGeometry:Hr},mu=i=>Cv[i.type].create(i);var sA=new Ae;function Bv(i){let e=!1;return i.scene.objects.traverse((t,r)=>{var n;((n=r.geometry)==null?void 0:n.type)==="BooleanGeometry"&&(e=!0)}),e}var zp=class extends kt{constructor(t=new De,r=new pn){super(t,r);this.booleanOp=2;this.phongAngle=35;this.meshSetAddresses=[];this.needsTransformForDownstream=!1;this.isBooleanMesh=!0,this.castShadow=!0,this.receiveShadow=!0,this.geometry.userData.parameters={width:0,height:0,depth:0},this.onAfterRender=this.recomputeBoolean.bind(this)}reInit(){this.isBooleanMesh=!0,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry.userData.parameters={width:0,height:0,depth:0},this.onAfterRender=this.recomputeBoolean.bind(this)}recomputeBoolean(t){var n;if(this.booleanMeshSetAddress!==-1)return;for(let s=0;s<this.children.length;s++){let o=this.children[s];Lt(o)&&o.recomputeBoolean(t===!0)}this.meshSetAddresses=[];for(let s=0;s<this.children.length;s++){let o=this.children[s];if(j1(o)&&o.booleanExclude===!1&&((n=o.geometry.attributes.position)==null?void 0:n.count)>0&&o.geometry.drawRange.count>0){if(o.booleanMeshSetAddress===-1){if(o.booleanMeshSetAddress=Jn.getMeshSet(o.geometry,t===!0),o.booleanMeshSetAddress===-1)return;Jn.transformMeshSet(o.booleanMeshSetAddress,o.matrix),o.booleanMatrixInvOld.copy(o.matrix).invert(),o.booleanWasTransformed=!1}else Lt(o)&&o.needsTransformForDownstream===!0?(Jn.transformMeshSet(o.booleanMeshSetAddress,o.matrix),o.needsTransformForDownstream=!1):o.booleanWasTransformed===!0&&(sA.multiplyMatrices(o.matrix,o.booleanMatrixInvOld),Jn.transformMeshSet(o.booleanMeshSetAddress,sA),o.booleanMatrixInvOld.copy(o.matrix).invert(),o.booleanWasTransformed=!1);this.meshSetAddresses.push(o.booleanMeshSetAddress)}}if(this.meshSetAddresses.length===0){this.geometry.setDrawRange(0,0);return}if(t===!0)return Jn.calcBooleanTopological(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new De,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=Jn.calcBoolean(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(s){this.booleanMeshSetAddress=0,console.error(s)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0}toJSON(t){let r=super.toJSON(t);return r.object.objectType="Mesh3D",r}updateGeometry(t){let r=t.parameters;r.operation!==void 0&&(this.booleanOp=r.operation),r.phongAngle!==void 0&&(this.phongAngle=r.phongAngle),this.invalidateDownstreamBooleanData().recomputeBoolean()}};var Gi=i=>{var e;return e=class extends i{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new vn(30,30,30),e};var Gp=new oi,Nv=new Lr,oA=new Ae,ki=(i,e,t,r,n=!1)=>{let s=e,o=i.matrixWorld;if(s.boundingSphere===null&&s.computeBoundingSphere(),Nv.copy(s.boundingSphere),Nv.applyMatrix4(o),t.ray.intersectsSphere(Nv)===!1||(oA.copy(o).invert(),Gp.copy(t.ray).applyMatrix4(oA),s.boundingBox!==null&&Gp.intersectsBox(s.boundingBox)===!1))return;let a,l,c,h,u=s.index,f=s.attributes.position,d=s.drawRange,p,m;if(n===!1){let v=Math.max(0,d.start),y=Math.min(u.count,d.start+d.count);for(p=v,m=y;p<m;p+=3)if(l=u.getX(p),c=u.getX(p+1),h=u.getX(p+2),a=g(i,t,Gp,f,l,c,h),a){a.faceIndex=Math.floor(p/3),r.push(a);return}}else{let y=s.attributes.position,w=new M,b=new M,S=new M,T=new M,A=2,_=1/((i.scale.x+i.scale.y+i.scale.z)/3),E=_*_,C=Math.max(0,d.start),I=Math.min(y.count,d.start+d.count);for(let N=C,R=I-1;N<R;N+=A){if(w.fromBufferAttribute(y,N),b.fromBufferAttribute(y,N+1),Gp.distanceSqToSegment(w,b,T,S)>E)continue;T.applyMatrix4(i.matrixWorld);let G=t.ray.origin.distanceTo(T);G<t.near||G>t.far||r.push({distance:G,point:S.clone().applyMatrix4(i.matrixWorld),object:i})}}function g(v,y,w,b,S,T,A){let x=new M,_=new M,E=new M,C=new M,I=new M;if(x.fromBufferAttribute(b,S),_.fromBufferAttribute(b,T),E.fromBufferAttribute(b,A),w.intersectTriangle(x,_,E,!1,C)===null)return null;I.copy(C),I.applyMatrix4(v.matrixWorld);let R=y.ray.origin.distanceTo(I);return R<y.near||R>y.far?null:{faceIndex:1,distance:R,point:I.clone(),object:v}}};var kp=new M,Zn=new Gn,Ov=class extends li{constructor(t){let r=new De,n=new kr({color:16777215,vertexColors:!0,toneMapped:!1}),s=[],o=[],a={},l=new be(15711266),c=new be(15711266),h=new be(2857471);u("n1","n2",l),u("n2","n4",l),u("n4","n3",l),u("n3","n1",l),u("f1","f2",l),u("f2","f4",l),u("f4","f3",l),u("f3","f1",l),u("n1","f1",l),u("n2","f2",l),u("n3","f3",l),u("n4","f4",l),u("p","n1",c),u("p","n2",c),u("p","n3",c),u("p","n4",c),u("u1","u2",h),u("u2","u3",h),u("u3","u1",h);function u(d,p,m){f(d,m),f(p,m)}function f(d,p){s.push(0,0,0),o.push(p.r,p.g,p.b),a[d]===void 0&&(a[d]=[]),a[d].push(s.length/3-1)}r.setAttribute("position",new Te(s,3)),r.setAttribute("color",new Te(o,3));super(r,n);this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}update(){let t=this.geometry,r=this.pointMap,n=!0;Zn.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let s=1,o=1,a=n?.8:1e-4;yi("n1",r,t,Zn,-s,-o,a),yi("n2",r,t,Zn,s,-o,a),yi("n3",r,t,Zn,-s,o,a),yi("n4",r,t,Zn,s,o,a);let l=a;yi("f1",r,t,Zn,-s,-o,l),yi("f2",r,t,Zn,s,-o,l),yi("f3",r,t,Zn,-s,o,l),yi("f4",r,t,Zn,s,o,l);let c=l,h=.5;yi("u1",r,t,Zn,s*.7*h,o*1.1,c),yi("u2",r,t,Zn,-s*.7*h,o*1.1,c),yi("u3",r,t,Zn,0,o*(1.1+.9*h),c),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function yi(i,e,t,r,n,s,o){kp.set(n,s,o).unproject(r);let a=e[i];if(a!==void 0){let l=t.getAttribute("position");for(let c=0,h=a.length;c<h;c++)l.setXYZ(a[c],kp.x,kp.y,kp.z)}}var Vp=class extends Gi(Ov){constructor(t){super(t);this.object=t;this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,r){ki(this.object,this.geometry,t,r,!0)}};var Zl=class extends Gi(Xf){constructor(t,r=15,n=10066329){super(t,r,n);this.object=t;this.name=`DirectionalLightHelper: ${t.uuid}`}raycast(t,r){ki(this.object,Zl.geometryHelper,t,r)}};var $l=class extends Gi(Qf){constructor(t,r=15){super(r);this.object=t;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}raycast(t,r){ki(this.object,$l.geometryHelper,t,r)}update(){}};var ec=class extends Gi(Yf){constructor(t,r=15,n=6710886){super(t,r,n);this.object=t;this.name=`PointLightHelper: ${t.uuid}`}raycast(t,r){ki(this.object,ec.geometryHelper,t,r)}};var Hp=class extends Gi(qf){constructor(t,r=6710886){super(t,r);this.object=t;this.name=`SpotLightHelper: ${t.uuid}`}raycast(t,r){ki(this.object,Hp.geometryHelper,t,r)}update(){if(this.object!==void 0){let t=Hp._vector,r=this.object.distance?this.object.distance:1e3,n=r*Math.tan(this.object.angle);this.cone.scale.set(n,n,r),t.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(t);let s=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let o=0,a=this.cone.material.length;o<a;o++)this.cone.material[o].color.set(s);else this.cone.material.color.set(s)}}},gu=Hp;gu._vector=new M;var Vi=(i,e)=>class extends i{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let s of this.children)Xn(s)&&s.traverseEntity(o=>{ms(o)&&o.visible&&(o.objectHelper.visible=n)})}raycast(n,s){this.objectHelper.raycast(n,s)}copy(n,s=!0){return super.copy(n,s),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let s=super.toJSON(n),o=s.object;return o.enableHelper=this.enableHelper,s}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}fromLightState(n,s){if(this.objectType==="LightDirectional"||this.objectType==="LightPoint"||this.objectType==="LightSpot"){let o=this;n.color!==void 0&&(o.color=pr(n.color,s)),n.intensity!==void 0&&(o.intensity=n.intensity),n.depth!==void 0&&(o.shadow.camera.far=n.depth,o.shadow.needsUpdate=!0),n.shadows!==void 0&&(this.castShadow=n.shadows),n.helper!==void 0&&(this.enableHelper=n.helper,o.gizmos.shadowmap.visible=n.helper)}return this}};var tc=new M,Fv=new M,Bn=class extends Vi(Qn(Gn),Vp){constructor(t=window.innerWidth,r=window.innerHeight,n=45,s,o=1e5){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Wo.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=t,this.height=r,this.orthoCamera=new Co(t*-.5,t*.5,r*.5,r*-.5,s!=null?s:-5e4,o),this.perspCamera=new sr(n,t/r,s!=null?s:50,o),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}static createFromState(t,r){let n=new Bn().fromState(r);return n.enableHelper=!0,n.objectHelper.update(),n.uuid=t,n}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}setNear(t,r){t==="PerspectiveCamera"?this.perspCamera.near=r:this.orthoCamera.near=r}setZoom(t,r){r>=0&&(t==="PerspectiveCamera"?this.perspCamera.zoom=r:this.orthoCamera.zoom=r)}set cameraType(t){t==="PerspectiveCamera"?this.toPerspective():t==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(t){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t){super.lookAt(t),this.getWorldPosition(tc),this.targetOffset=tc.distanceTo(t)}getTarget(t=new M){return this.getWorldDirection(Fv),this.getWorldPosition(tc),Fv.multiplyScalar(this.targetOffset),t.copy(tc).add(Fv),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(tc),tc.distanceTo(t)}updateUp(){let t=this.getWorldQuaternion(new zt),r=new M(0,0,1).applyQuaternion(t),n=new M().copy(ot.DefaultUp);this.isUpVectorFlipped&&n.negate(),n.applyQuaternion(t);let s=new M().copy(ot.DefaultUp).projectOnPlane(r),o=new M().crossVectors(s,n).dot(r)>=0?1:-1;this.angleOffsetFromUp=s.angleTo(n)*o}getViewFrontToObject(t){let r=t.getWorldPosition(new M),s=t.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:r.clone().add(s),target:r}}getViewToObject(t){let r=t.getWorldPosition(new M),s=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:r.clone().sub(s),target:r}}setViewplaneSize(t,r){this.left=-t*.5,this.right=t*.5,this.top=r*.5,this.bottom=-r*.5,this.aspect=t/r,this.updateProjectionMatrix()}toOrthographic(t){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||t===!0)&&this.objectHelper.update()}toPerspective(t){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||t===!0)&&this.objectHelper.update()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,r,n,s,o,a){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(t,r,n,s,o,a):this.orthoCamera.setViewOffset(t,r,n,s,o,a)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(t){this._cameraType==="PerspectiveCamera"?this.toPerspective(t):this._cameraType==="OrthographicCamera"&&this.toOrthographic(t)}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,r){super.updateWorldMatrix(t,r),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,r){return super.copy(t,r),this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=t.view===null?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=t.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(t){let r={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(t),this.name="",this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=r.near,this.orthoCamera.far=r.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,r}fromJSON(t){var r;if(super.fromJSON(t),this.cameraType=t.cameraType,t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset),t.orbitControlsTarget!==void 0){let n=this.getWorldPosition(new M),s=new M().fromArray(t.orbitControlsTarget);this.targetOffset=s.distanceTo(n)}else t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset);return this.isUpVectorFlipped=!1,this.angleOffsetFromUp=(r=t.angleOffsetFromUp)!=null?r:0,t.left!==void 0&&(this.left=t.left),t.right!==void 0&&(this.right=t.right),t.top!==void 0&&(this.top=t.top),t.bottom!==void 0&&(this.bottom=t.bottom),t.view!==void 0&&(this.view=Object.assign({},t.view)),t.zoomOrtho!==void 0&&(this.orthoCamera.zoom=t.zoomOrtho),t.nearOrtho!==void 0&&(this.orthoCamera.near=t.nearOrtho),t.far!==void 0&&(this.far=t.far),t.aspect!==void 0&&(this.aspect=t.aspect),t.fov!==void 0&&(this.fov=t.fov),t.focus!==void 0&&(this.focus=t.focus),t.filmGauge!==void 0&&(this.filmGauge=t.filmGauge),t.filmOffset!==void 0&&(this.filmOffset=t.filmOffset),t.zoomPersp!==void 0&&(this.perspCamera.zoom=t.zoomPersp),t.nearPersp!==void 0&&(this.perspCamera.near=t.nearPersp),this.updateProjectionMatrix(),this}toCameraState(t=[]){let r={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return wl(r,t)}fromCameraState(t){let{orthographic:r,perspective:n}=t;return t.type!==void 0&&(this.cameraType=t.type),t.far!==void 0&&(this.far=t.far),r!==void 0&&(r.near!==void 0&&(this.orthoCamera.near=r.near),r.zoom!==void 0&&(this.orthoCamera.zoom=r.zoom)),n!==void 0&&(n.near!==void 0&&(this.perspCamera.near=n.near),n.fov!==void 0&&(this.perspCamera.fov=n.fov),n.zoom!==void 0&&(this.perspCamera.zoom=n.zoom)),t.up!==void 0&&this.up.fromArray(t.up),t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset),t.isUpVectorFlipped!==void 0&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix(),this}toState(t){return xe(se(se({},super.toState(t)),this.toCameraState(t)),{type:this.cameraType})}fromState(t){return super.fromState(t),this.fromCameraState(t),this}};var gs=class extends Vi(Qn(ts),$l){constructor(){super(...arguments);this.objectType="EmptyObject"}static createFromState(t,r){let n=new gs().fromState(r);return n.uuid=t,n.enableHelper=!0,n.objectHelper.update(),n}toJSON(t){let r=super.toJSON(t);return r.object.objectType="EmptyObject",r}};var rc=class extends Vi(Qn(hh),Zl){constructor(...t){super(...t);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let s=new Hn(this.shadow.camera);s.visible=!1,this._gizmos.shadowmap=s,this.update()}static createFromState(t,r,n){let s=new rc().fromState(r,n);return s.uuid=t,s}get gizmos(){return this._gizmos}showGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!0)}}hideGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&r.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(t,r=!0){return super.copy(t,r),this.color.copy(t.color),this.intensity=t.intensity,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),r}fromJSON(t){var s;super.fromJSON(t),this.color.set(t.color),this.intensity=t.intensity,this.shadow.normalBias=(s=t.shadow.normalBias)!=null?s:0,this.shadow.radius=t.shadow.radius,this.shadow.mapSize.fromArray(t.shadow.mapSize);let r=this.shadow.camera,n=t.shadow.camera;return r.near=n.near,r.far=n.far,r.zoom=n.zoom,r.left=n.left,r.right=n.right,r.top=n.top,r.bottom=n.bottom,n.view!==void 0&&(r.view=Object.assign({},n.view)),this}fromDirectionalLightState(t,r){let n=t.depth!==void 0&&t.depth!==this.shadow.camera.far||t.size!==void 0&&t.size/2!==this.shadow.camera.right;return super.fromLightState(t,r),t.size!==void 0&&H1(this,t.size),n&&this.update(),this}fromState(t,r){return super.fromState(t),this.fromDirectionalLightState(t,r),this}};var nc=class extends Vi(Qn(ch),ec){constructor(...t){super(...t);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let s=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),o=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),a=new Kt(s,o),l=new Fo(a,new be(16755200));l.visible=!1,this._gizmos.shadowmap=l,this.update()}static createFromState(t,r,n){let s=new nc().fromState(r,n);return s.uuid=t,s}get gizmos(){return this._gizmos}showGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Fo&&(r.visible=!0)}}hideGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Fo&&(r.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let t in this._gizmos){let r=this._gizmos[t];if(r instanceof Fo){let n=this.shadow.camera,s=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),o=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);r.box.set(s,o),r.updateMatrixWorld(!0)}}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(t,r=!0){return super.copy(t,r),this.color.copy(t.color),this.intensity=t.intensity,this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),r}fromJSON(t){var s,o;super.fromJSON(t),this.color.set(t.color),this.intensity=t.intensity,this.distance=t.distance,this.decay=t.decay,this.shadow.normalBias=(s=t.shadow.normalBias)!=null?s:0,this.shadow.radius=t.shadow.radius,this.shadow.mapSize.fromArray((o=t.shadow.mapSize)!=null?o:[512,512]),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null);let r=this.shadow.camera,n=t.shadow.camera;return r.near=n.near,r.far=n.far,r.zoom=n.zoom,r.fov=n.fov,r.focus=n.focus,r.aspect=n.aspect,r.filmGauge=n.filmGauge,r.filmOffset=n.filmOffset,n.view!==void 0&&(r.view=Object.assign({},n.view)),this}fromPointLightState(t,r){return super.fromLightState(t,r),t.distance!==void 0&&(this.distance=t.distance),t.decay!==void 0&&(this.decay=t.decay),t.shadowRadius!==void 0&&(this.shadow.radius=t.shadowRadius),t.shadowResolution!==void 0&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null)),this}fromState(t,r){return super.fromState(t),this.fromPointLightState(t,r),this}};var aA=new M,lA=new M,cA=new zt,ic=class extends Vi(Qn(lh),gu){constructor(...t){super(...t);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=et.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let s=new Hn(this.shadow.camera);s.visible=!1,this._gizmos.shadowmap=s,this.update()}static createFromState(t,r,n){let s=new ic().fromState(r,n);return s.uuid=t,s}get gizmos(){return this._gizmos}showGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!0)}}hideGizmos(){for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&(r.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this._gizmos){let r=this._gizmos[t];r instanceof Hn&&r.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),lA.setFromMatrixPosition(this.matrixWorld),cA.setFromRotationMatrix(this.matrixWorld),aA.copy(this.up).applyQuaternion(cA).negate().multiplyScalar(this.distance),this.target.position.copy(lA).add(aA),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(t,r=!0){return super.copy(t,r),this.color.copy(t.color),this.intensity=t.intensity,this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let r=super.toJSON(t),n=r.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),r}fromJSON(t){var s;super.fromJSON(t),this.color.set(t.color),this.intensity=t.intensity,this.distance=t.distance,this.angle=t.angle,this.decay=t.decay,this.penumbra=t.penumbra,this.shadow.normalBias=(s=t.shadow.normalBias)!=null?s:0,this.shadow.radius=t.shadow.radius,this.shadow.mapSize.fromArray(t.shadow.mapSize);let r=this.shadow.camera,n=t.shadow.camera;return r.near=n.near,r.far=n.far,r.zoom=n.zoom,r.fov=n.fov,r.focus=n.focus,r.aspect=n.aspect,r.filmGauge=n.filmGauge,r.filmOffset=n.filmOffset,n.view!==void 0&&(r.view=Object.assign({},n.view)),this}fromSpotLightState(t,r){return super.fromLightState(t,r),t.distance!==void 0&&(this.distance=t.distance),t.decay!==void 0&&(this.decay=t.decay),t.angle!==void 0&&(this.angle=t.angle),t.penumbra!==void 0&&(this.penumbra=t.penumbra),this}fromState(t,r){return super.fromState(t),this.fromSpotLightState(t,r),this}};var hA=i=>i.tagName==="VIDEO",$o=class{static resize(e,t,r){let n=e/t,s;if(!r.image)return;let o=r.image;hA(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,n>s&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1*s/n):r.repeat.set(1,1*s/n)),n<s&&(r.imageType=="WEBCAM"?r.repeat.set(1*n/s*-1,1):r.repeat.set(1*n/s,1)),n==s&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1):r.repeat.set(1,1))}static resizeTextureLayer(e,t,r){let n=e/t,s=r.image!==void 0?r.image.width/r.image.height:1,o;n>s?o={x:1,y:s/n}:n<s?o={x:n/s,y:1}:o={x:1,y:1},r.repeat.set(o.x,o.y),r.updateMatrix()}static resizeTextureLayers(e,t,r){let n=r.userData.layers,s=n.getLayers();for(let o=0;o<s.length;o++){let a=s[o];B1(a)&&($o.resizeTextureLayer(e,t,a.uniforms[`f${a.id}_texture`].value),n.updateLayerUniform())}}static resizeComplex(e,t,r,n){let s=e/t,o,a=r.image;hA(a)?o=a.videoWidth/a.videoHeight:o=a.width/a.height,n.geometry.type.includes("Shape")?(s>o&&(r.imageType=="WEBCAM"?r.repeat.set(1/e*-1,1/t*o/s):r.repeat.set(1/e,1/t*o/s)),s<o&&(r.imageType=="WEBCAM"?r.repeat.set(1/e*s/o*-1,1/t):r.repeat.set(1/e*s/o,1/t)),s==o&&(r.imageType=="WEBCAM"?r.repeat.set(1/e*-1,1/t):r.repeat.set(1/e,1/t))):(s>o&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1*o/s):r.repeat.set(1,1*o/s)),s<o&&(r.imageType=="WEBCAM"?r.repeat.set(1*s/o*-1,1):r.repeat.set(1*s/o,1)),s==o&&(r.imageType=="WEBCAM"?r.repeat.set(-1,1):r.repeat.set(1,1)))}};var sc=class extends kt{constructor(t,r=new Yr){super(t,r);this.objectType="Mesh2D";this.castShadow=!0,this.receiveShadow=!0}updateGeometry(t){super.updateGeometry(t),this.material.userData.layers&&$o.resizeTextureLayers(this.geometry.userData.parameters.width,this.geometry.userData.parameters.height,this.material)}resizeGeometry(t,r){super.resizeGeometry(t,r,0),this.material.userData.layers&&$o.resizeTextureLayers(this.geometry.userData.parameters.width,this.geometry.userData.parameters.height,this.material)}toJSON(t){let r=super.toJSON(t);return r.object.objectType="Mesh2D",r}clone(){let t=super.clone();return t.updateGeometry({}),t}static fromTexture(t){let r,n;if(t instanceof th){let a=t.image;r=a.videoWidth*.5,n=a.videoHeight*.5}else{let a=t.image;r=a.width*.5,n=a.height*.5}let s=vp.create({parameters:{width:r,height:n}}),o=new Yr;return o.layersList.changeLayer(0,{type:"texture",texture:t}),o.layersList.moveLayer(0,1),o.dispose(),new sc(s,o)}};var oc=class extends kt{constructor(t,r=new pn){super(t,r);this.objectType="Mesh3D";this.castShadow=!0,this.receiveShadow=!0}toJSON(t){let r=super.toJSON(t);return r.object.objectType="Mesh3D",r}};var ac=class extends oc{constructor(t,r=new pn){super(t,r);this.objectType="NonParametric"}toJSON(t){let r=super.toJSON(t);return r.object.objectType="NonParametric",r}};var Wp=class extends cn{constructor(e){super(e)}load(e,t,r,n){let s=this,o=new as(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){let l;try{l=JSON.parse(a)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),l=JSON.parse(a.substring(65,a.length-2))}let c=s.parse(l);t&&t(c)},r,n)}parse(e){return new jp(e)}},jp=class{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){let r=[],n=rU(e,t,this.data);for(let s=0,o=n.length;s<o;s++)Array.prototype.push.apply(r,n[s].toShapes());return r}};function rU(i,e,t){let r=Array.from(i),n=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*n,o=[],a=0,l=0;for(let c=0;c<r.length;c++){let h=r[c];if(h===`
|
|
3927
|
+
`)a=0,l-=s;else{let u=nU(h,n,a,l,t);a+=u.offsetX,o.push(u.path)}}return o}function nU(i,e,t,r,n){let s=n.glyphs[i]||n.glyphs["?"];if(!s){console.error('THREE.Font: character "'+i+'" does not exists in font family '+n.familyName+".");return}let o=new Jf,a,l,c,h,u,f,d,p;if(s.o){let m=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let g=0,v=m.length;g<v;)switch(m[g++]){case"m":a=m[g++]*e+t,l=m[g++]*e+r,o.moveTo(a,l);break;case"l":a=m[g++]*e+t,l=m[g++]*e+r,o.lineTo(a,l);break;case"q":c=m[g++]*e+t,h=m[g++]*e+r,u=m[g++]*e+t,f=m[g++]*e+r,o.quadraticCurveTo(u,f,c,h);break;case"b":c=m[g++]*e+t,h=m[g++]*e+r,u=m[g++]*e+t,f=m[g++]*e+r,d=m[g++]*e+t,p=m[g++]*e+r,o.bezierCurveTo(u,f,d,p,c,h);break}}return{offsetX:s.ha*e,path:o}}jp.prototype.isFont=!0;var mr=class extends Vt{constructor({char:t,originalChar:r,fontFamily:n,letterSpacing:s,fontSize:o,LOD:a=16},l=new zn({color:0,opacity:1,visible:!0,transparent:!0,side:or})){let c=mr.loadChar(t,n,a);super(c.geometry,l);this.char=t,this.originalChar=r!=null?r:t,this.fontFamily=n,this.letterSpacing=s,this.fontSize=o,this.LOD=a,this.resolution=c.resolution,this.glyphsHa=c.glyphsHa,this.localPosition=new B,this.charSize=0,this.geometry.userData={type:"CharacterGeometry",parameters:{char:this.char,fontFamily:this.fontFamily,letterSpacing:this.letterSpacing,fontSize:this.fontSize,lod:this.LOD,resolution:this.resolution,charSize:this.charSize,localPosition:this.localPosition}},this.updateFontSize(this.fontSize)}static get FONTS_PATH(){return mr._fontPath}static set FONTS_PATH(t){mr._fontPath=t}updatePosition(t,r){this.localPosition.copy(t);let n=new M(this.localPosition.x,-this.localPosition.y,0);this.position.copy(n).add(r)}updateFontSize(t){let r=t/this.resolution;this.fontSize=t,this.scale.set(this.fontSize,this.fontSize,1),this.charSize=this.glyphsHa*r*this.letterSpacing}updateFontFamily(t){if(this.fontFamily===t)return;this.fontFamily=t;let r=mr.loadChar(this.char,t,this.LOD);this.geometry=r.geometry,this.resolution=r.resolution,this.glyphsHa=r.glyphsHa,this.geometry.userData={type:"CharacterGeometry",parameters:{char:this.char,fontFamily:this.fontFamily,letterSpacing:this.letterSpacing,fontSize:this.fontSize,lod:this.LOD,resolution:this.resolution,charSize:this.charSize,localPosition:this.localPosition}},this.updateFontSize(this.fontSize)}updateChar(t){if(this.char===t)return;this.char=t;let r=mr.loadChar(t,this.fontFamily,this.LOD);this.geometry=r.geometry,this.resolution=r.resolution,this.glyphsHa=r.glyphsHa,this.geometry.userData={type:"CharacterGeometry",parameters:{char:this.char,fontFamily:this.fontFamily,letterSpacing:this.letterSpacing,fontSize:this.fontSize,lod:this.LOD,resolution:this.resolution,charSize:this.charSize,localPosition:this.localPosition}},this.updateFontSize(this.fontSize)}updateLetterSpacing(t){this.letterSpacing!==t&&(this.letterSpacing=t,this.updateFontSize(this.fontSize))}updateLOD(t){if(this.LOD===t)return;this.LOD=t;let r=mr.loadChar(this.char,this.fontFamily,this.LOD);this.geometry=r.geometry,this.resolution=r.resolution,this.glyphsHa=r.glyphsHa,this.geometry.userData={type:"CharacterGeometry",parameters:{char:this.char,fontFamily:this.fontFamily,letterSpacing:this.letterSpacing,fontSize:this.fontSize,lod:this.LOD,resolution:this.resolution,charSize:this.charSize,localPosition:this.localPosition}},this.updateFontSize(this.fontSize)}clone(){let t={char:this.char,originalChar:this.originalChar,fontFamily:this.fontFamily,letterSpacing:this.letterSpacing,fontSize:this.fontSize,LOD:this.LOD};return new mr(t).copy(this)}static loadFont(t){return new Promise(function(r,n){mr.fontCache[t]?r(mr.fontCache[t]):new Wp().load(mr.FONTS_PATH+t+".json",o=>{mr.fontCache[t]=o,r(o)},void 0,n)})}static loadChar(t,r,n){if(mr.charCache[t]){if(mr.charCache[t][n]&&mr.charCache[t][n].fontFamily===r)return mr.charCache[t][n]}else mr.charCache[t]={};let s=mr.fontCache[r],o=s.generateShapes(t,1);return mr.charCache[t][n]={geometry:new Io(o,n),fontFamily:r,resolution:s.data.resolution,glyphsHa:s.data.glyphs[t].ha},mr.charCache[t][n]}},mn=mr;mn.charCache={},mn.fontCache={},mn._fontPath="/_assets/_fonts/";var qp=new B,uo=class{constructor(e,t,r){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=r,this.nextChar3DPos=new B(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=1}addChar3D(e,t,r=this.message.length){this.message.splice(r,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let r=t,n=this.message.length;r<n;r+=1)this.message[r].updatePosition(this.nextChar3DPos,e),this.nextChar3DPos.x+=this.message[r].charSize}checkOverFlow(e){let t,r=this.message.length-1;if(r<=0)return!1;for(;r>=0;){if(this.message[r].char!==" "){t=this.message[r];break}r-=1}return!!(r>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],r=!0,n;for(n=e;n>=0;n-=1)if(this.message[n].char===" "){r=!1,t.length===0&&(n-=1,t.splice(0,0,this.message[n]));break}else t.splice(0,0,this.message[n]);return r?t=[]:this.message.splice(n+1,t.length),t}getWord(e=0,t=1){let r=[],n=e;for(n=e;;n+=t){if(!this.message[n]||this.message[n].char===" "){r.length===0&&this.message[n]&&(r.push(this.message[n]),this.message.splice(n,1));break}t>0?(r.push(this.message[n]),this.message.splice(n,1),n-=t):(r.splice(0,0,this.message[n]),this.message.splice(n,1))}return r}getWordAtIndex(e){let t=[];for(let r=e;r<this.message.length&&this.message[r].char!==" ";r++)t.push(this.message[r]);for(let r=e-1;r>=0&&this.message[r].char!==" ";r--)t.splice(0,0,this.message[r]);return t}wordSize(e=0,t=-1){let r=0,n=e;for(;n>=0&&n<this.message.length;){if(this.message[n].char===" "){r===0&&(r=this.message[n].charSize);break}r+=this.message[n].charSize,n+=t}return(n<0||n>=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:r===0?999999999:r}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,r=this.message.length-1){for(let n=t;n<=r;n+=1)this.message[n].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t<this.message.length;t++)this.message[t].char===" "&&(e+=1);return e}alignText(e,t,r,n,s){switch(r){case 1:this.leftAlign(e,s);break;case 3:this.centerAlign(this.spaceLeft(t),e,s);break;case 2:this.rightAlign(this.spaceLeft(t),e,s);break;case 4:this.justifyAlign(this.spaceLeft(t),e,s);break}}offsetCharacters(e,t,r){qp.set(t,r);let n=this.message.length;for(let s=0;s<n;s++)this.message[s].updatePosition(this.message[s].localPosition.add(qp),e)}leftAlign(e,t){this.align=1,this.offsetCharacters(e,0,t)}centerAlign(e,t,r){this.align=3,this.offsetCharacters(t,e/2,r)}rightAlign(e,t,r){this.align=2,this.offsetCharacters(t,e,r)}justifyAlign(e,t,r){if(this.align=4,this.endLine){this.offsetCharacters(t,0,r);return}let n=this.countSpaces();if(n===0){this.offsetCharacters(t,0,r);return}let s=e/n,o=0;for(let a=0;a<this.message.length;a++)this.message[a].char===" "&&(o+=s),qp.set(o,r),this.message[a].updatePosition(this.message[a].localPosition.add(qp),t)}clone(){let e=new uo(this.yLinePos,this.lineHeight,this.maxCharSize);e.nextChar3DPos=this.nextChar3DPos.clone(),e.align=this.align,e.endLine=this.endLine;for(let t=0;t<this.message.length;t++)e.message.push(this.message[t].clone());return e}};var Uv=class extends kt{constructor(t,r=new Yr({transparent:!0,opacity:1,visible:!1,side:or})){super(t,r);this.objectType="TextFrame";this.charContainer=new ot,this.add(this.charContainer),this.material.visible=!1,this._geometryUserData=t.userData,this.userData.textFrame={hexColor:null,opacity:1,visible:!0,text:"",fontSize:16,lineHeight:1.5,letterSpacing:1,fontFamily:"roboto_regular",textTransform:1,horizontalAlignment:1,verticalAlignment:1,LOD:16,maxLineSize:this._geometryUserData.parameters.width,textOrigin:new M(this._geometryUserData.parameters.width*-.5,this._geometryUserData.parameters.height*.5,0),textLines:[]},this.createTextLine()}static createFromState(t,r,n){let s=xp.create({parameters:{width:r.width,height:r.height}}),o=new Uv(s).fromState(r,n);return o.uuid=t,o}async updateText(t){this.clearText();let r=this.userData.textFrame,n=r.fontFamily;await mn.loadFont(n),r.text=t;let s=r.textOrigin,o=new zn({visible:r.visible,transparent:!0,side:or}),a=t.split(`
|
|
3928
|
+
`),l=0;this.userData.textFrame.textLines=a.map((c,h)=>{let u=new uo(l,r.lineHeight,r.fontSize);return u.message=c.split("").map(f=>{let d={char:f,fontFamily:n,letterSpacing:r.letterSpacing,fontSize:r.fontSize,LOD:16},p=o.clone();p.color=r.hexColor,p.opacity=r.opacity;let m=new mn(d,p);return u.addChar3D(m,s),this.charContainer.add(m),m}),l+=u.maxCharSize*u.lineHeight,u}),this.textFullUpdate(),this.checkOverFlow()}clearText(){let t=this.userData.textFrame.textLines;for(;this.charContainer.children.length;){let r=this.charContainer.children[0];this.charContainer.remove(r)}for(;t.length;)t.pop()}raycast(t,r){let n=[];if(super.raycast(t,n),n.length>0){r.push(n[0]);return}let s=[];for(let o=0,a=this.charContainer.children.length;o<a;++o)if(this.charContainer.children[o]instanceof mn&&(t.intersectObject(this.charContainer.children[o],!1,s),s.length>0)){s[0].object=this,r.push(s[0]);return}}updateGeometry(t){var h,u,f,d;let r=this.userData,n=this.geometry.userData,s=n.parameters.width,o=n.parameters.height,a=(u=(h=t.parameters)==null?void 0:h.width)!=null?u:s,l=(d=(f=t.parameters)==null?void 0:f.height)!=null?d:o,c=r.textFrame;super.updateGeometry(t),c.maxLineSize=a,c.textOrigin.set(-.5*a,.5*l,0),l!==o?(this.checkOverFlow(),this.checkCapacity()):a!==s&&(s<a?this.checkCapacity():s>a&&this.checkOverFlow())}checkOverFlow(t=0){let r=this.userData,n=r.textFrame.textOrigin,s=r.textFrame.textLines;for(let o=t;o<s.length;o++){s[o].updateYLinePos(this.getNewLinePosition(o)),s[o].fullUpdate(n);let a=[];for(;s[o].checkOverFlow(r.textFrame.maxLineSize);)s[o].containSpaceOverFlow()?a.unshift(s[o].getWord(s[o].message.length-1,-1)):a.unshift(s[o].popChar());if(a.length>0){s[o+1]===void 0?(s[o].isEndLine(!1),this.createTextLine()):s[o].endLine&&(this.createTextLine(o+1),s[o].isEndLine(!1),s[o+1].isEndLine(!0));let l=0;for(let c=0;c<a.length;c+=1)for(let h=0;h<a[c].length;h+=1)s[o+1].addChar3D(a[c][h],n,l),l+=1;s[o+1].fullUpdate(n)}s[o].fullUpdate(n)}this.textFullUpdate(t)}checkCapacity(t=0){let r=this.userData,n=r.textFrame.textOrigin,s=r.textFrame.maxLineSize,o=r.textFrame.textLines;for(let a=t;a<o.length;a+=1)if(o[a].updateYLinePos(this.getNewLinePosition(a)),o[a].fullUpdate(n),!!o[a-1])for(;!o[a-1].endLine;){let l,c=o[a-1].spaceLeft(s);if(o[a].wordSize(0,1)<=c){o[a].containSpace()?l=o[a].getWord(0,1):l=o[a].popChar(0);for(let h=0;h<l.length;h+=1)l[h]&&o[a-1].addChar3D(l[h],n)}else{o[a].isEmpty()?(o[a].endLine&&o[a-1].isEndLine(!0),o.splice(a,1),a-=1):(o[a].updateYLinePos(this.getNewLinePosition(a)),o[a].fullUpdate(n));break}}this.textFullUpdate(t)}createTextLine(t=this.userData.textFrame.textLines.length){let n=this.userData.textFrame;n.textLines.splice(t,0,new uo(this.getNewLinePosition(t),n.lineHeight,n.fontSize))}textFullUpdate(t=0){let n=this.userData.textFrame,s=n.textLines,o=this.getVerticalAlignmentOffSet();for(let a=t;a<s.length;a++)s[a].updateYLinePos(this.getNewLinePosition(a)),s[a].fullUpdate(n.textOrigin),s[a].alignText(n.textOrigin,n.maxLineSize,n.horizontalAlignment,n.verticalAlignment,o)}getVerticalAlignmentOffSet(){switch(this.userData.textFrame.verticalAlignment){case 1:return 0;case 2:return this.getRemainingVerticalSpace()/2;case 3:return this.getRemainingVerticalSpace();default:return 0}}getRemainingVerticalSpace(){let r=this.userData.textFrame.textLines;return this.geometry.userData.parameters.height-this.getNewLinePosition(r.length)}getNewLinePosition(t){let n=this.userData.textFrame.textLines,s=0;for(let o=0;o<t;o+=1)s+=n[o].maxCharSize*n[o].lineHeight;return s}updateColor(t){var s;let r=this.userData;r.textFrame.hexColor=t;let n=r.textFrame.textLines;for(let o=0;o<n.length;o++){let a=n[o].message;for(let l=0;l<a.length;l++){let c=a[l].material;(s=c.color)!=null&&s.isColor&&(c.color=t)}}}updateOpacity(t){let r=this.userData;r.textFrame.opacity=t;let n=r.textFrame.textLines;for(let s=0;s<n.length;s++){let o=n[s].message;for(let a=0;a<o.length;a++){let l=o[a].material;l.opacity=t}}}updateVisible(t){let r=this.userData;r.textFrame.visible=t;let n=r.textFrame.textLines;for(let s=0;s<n.length;s++){let o=n[s].message;for(let a=0;a<o.length;a++){let l=o[a].material;l.visible=t}}}async updateFontFamily(t){await mn.loadFont(t);let n=this.userData.textFrame,s=n.textLines;n.fontFamily=t;for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)a[l].updateFontFamily(t)}this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateFontSize(t){let n=this.userData.textFrame,s=n.textLines,o=n.fontSize;n.fontSize=t;for(let a=0;a<s.length;a++)s[a].updateFontSize(t);this.textFullUpdate(),t>o?this.checkOverFlow():t<o&&this.checkCapacity()}async updateTextTransform(t){let n=this.userData.textFrame;await mn.loadFont(n.fontFamily);let s=n.textLines;switch(n.textTransform=t,t){case 2:for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)s[o].message[l].updateChar(a[l].char.toUpperCase())}break;case 3:for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)s[o].message[l].updateChar(a[l].char.toLowerCase())}break;default:for(let o=0;o<s.length;o++){let a=s[o].message;for(let l=0;l<a.length;l++)s[o].message[l].updateChar(a[l].originalChar)}}this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateLetterSpacing(t){let r=this.userData,n=r.textFrame.textLines;r.textFrame.letterSpacing=t;for(let s=0;s<n.length;s++){let o=n[s].message;for(let a=0;a<o.length;a++)o[a].updateLetterSpacing(t)}this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateLOD(t){let r=this.userData;r.textFrame.LOD=t;let n=r.textFrame.textLines;for(let s=0;s<n.length;s++);this.textFullUpdate(),this.checkOverFlow(),this.checkCapacity()}updateLineHeight(t){let r=this.userData,n=r.textFrame.textLines;r.textFrame.lineHeight=t;for(let s=0;s<n.length;s++)n[s].updatelineHeight(t);this.textFullUpdate()}updateVerticalAlignment(t){let r=this.userData;r.textFrame.verticalAlignment=t,this.textFullUpdate()}updateHorizontalAlignment(t){let r=this.userData;r.textFrame.horizontalAlignment=t,this.textFullUpdate()}toJSON(t){let r=super.toJSON(t),n=r.object;n.objectType="TextFrame";let o=this.userData.textFrame.textLines.map(a=>{let l=a.message.map(c=>({char:c.char,originalChar:c.originalChar,fontFamily:c.fontFamily,letterSpacing:c.letterSpacing,fontSize:c.fontSize,LOD:c.LOD}));return{align:a.align,endLine:a.endLine,lineHeight:a.lineHeight,maxCharSize:a.maxCharSize,yLinePos:a.yLinePos,message:l}});return n.userData.textFrame.textLinesData=o,r}async fromJSONasync(t){if(super.fromJSON(t),t.userData!==void 0){let r=t.userData.textFrame;await mn.loadFont(r.fontFamily),r.textOrigin=new M(r.textOrigin.x,r.textOrigin.y,r.textOrigin.z);let n=new zn({color:r.hexColor,opacity:r.opacity,visible:r.visible,transparent:!0,side:or});r.textLinesData&&(r.textLines=r.textLinesData.map((s,o)=>{let a=new uo(Number(s.yLinePos),Number(s.lineHeight),Number(s.maxCharSize)),l=s.message.map((c,h)=>{if(c.char===void 0){let d=r.textLines[o].message[h];if("geometries"in d){let p=d.geometries[0].userData.parameters;Object.assign(c,{LOD:p.lod,char:p.char,fontFamily:p.fontFamily,fontSize:p.fontSize,letterSpacing:p.letterSpacing,originalChar:p.char})}}let u={char:c.char,fontFamily:c.fontFamily,letterSpacing:Number(c.letterSpacing),fontSize:Number(c.fontSize),LOD:c.LOD},f=new mn(u,n.clone());return a.addChar3D(f,r.textOrigin),this.charContainer.add(f),f});return a.message=l,a}),this.userData.textFrame=r),this.textFullUpdate()}return this}fromTextFrameData(t,r){if(t.color!==void 0){let n=pr(t.color,r);this.updateColor(n),this.updateOpacity(n.a)}t.alpha!==void 0&&this.updateOpacity(t.alpha),t.font!==void 0&&this.updateFontFamily(t.font),t.horizontalAlign!==void 0&&this.updateHorizontalAlignment(t.horizontalAlign),t.verticalAlign!==void 0&&this.updateVerticalAlignment(t.verticalAlign),t.textTransform!==void 0&&this.updateTextTransform(t.textTransform),t.fontSize!==void 0&&this.updateFontSize(t.fontSize),t.lineHeight!==void 0&&this.updateLineHeight(t.lineHeight),t.letterSpacing!==void 0&&this.updateLetterSpacing(t.letterSpacing),t.text!==void 0&&t.text!==""&&this.updateText(t.text),(t.width!==void 0||t.height!==void 0)&&this.updateGeometry({parameters:{width:t.width,height:t.height}})}fromState(t,r){return super.fromState(t),this.fromTextFrameData(t,r),this}convertToVector(){let{fontFamily:t,hexColor:r}=this.userData.textFrame,n=new gs;n.name="Text Shape";let s=mn.fontCache[t];for(let o of this.charContainer.children)o instanceof mn&&s.generateShapes(o.char,1).forEach(a=>{let l=new Tt().fromShape(a);l.applyScale(o.scale.x,o.scale.y);let c=Hr.create({shape:l}),h=new Yr({side:or});h.color=r;let u=new ho(c,h);u.name=o.char,u.position.copy(o.position),u.rotation.copy(o.rotation),n.attach(u)});return n}},ea=Uv;ea.VerticalAlign=ky,ea.HorizontalAlign=Gy,ea.TextTransform=Vy;var pA=HT(fA());var zv;bp.then(i=>{zv=i});var mA=new Ae,iU=new Ae,sU=new Ae,vi=new Kt,fo=new M,oU=new Ae,aU=new Ae,po=class extends kt{constructor(t,r,n,s=new pn){super(n!=null?n:r,s);this.subdivPointer=t;this.originalGeometry=r;this.subdividedGeometry=n;this.objectType="SubdivObject";this.hiddenMatrixOld=new Ae;this.smoothShading=!0;this.phongAngle=35;this.matrixWorldRigid=new Ae;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1}static createFromState(t,r,n){let{subdivPointer:s,originalGeometry:o,subdividedGeometry:a}=Kn.build(r.geometry,void 0,void 0,!r.flatShading),l=uu(r.material,n),c=new po(s,o,a||void 0,l);return r.geometry.phongAngle!==void 0&&(c.phongAngle=r.geometry.phongAngle),c.calcBoundingBox(),c.freeSubdivPointer(),c.uuid=t,c.fromState(r),c}shallowClone(t){return new ac(this.geometry,this.material).shallowCopy(this,t)}toJSON(t){let r=super.toJSON(t);return r.object.objectType="SubdivObject",r}buildFromStore(t,r){var a,l,c;let{originalGeometry:n,subdividedGeometry:s,subdivPointer:o}=Kn.build(t,r,this.subdivPointer,this.smoothShading,this.shearScale);if(t.phongAngle!==void 0&&(this.phongAngle=t.phongAngle),this.subdivPointer=o,n!==void 0&&((a=this.originalGeometry)==null||a.dispose(),this.originalGeometry=n),s!==void 0&&((l=this.subdividedGeometry)==null||l.dispose(),this.subdividedGeometry=s!=null?s:void 0),this.geometry=(c=this.subdividedGeometry)!=null?c:this.originalGeometry,this.cloner)for(let h of this.cloner.children)h.geometry=this.geometry;t.width&&(this.geometry.userData.parameters={width:t.width,height:t.height,depth:t.depth})}updateMesh(t=!1){Kn.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,t?this.shearScaleInv:void 0),this.subdividedGeometry&&Kn.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,t?this.shearScaleInv:void 0)}updateTopology(){var t;this.originalGeometry.dispose(),this.originalGeometry=Kn.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=Kn.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.geometry=(t=this.subdividedGeometry)!=null?t:this.originalGeometry}raycast(t,r){var n;this.geometry=this.originalGeometry,kt.prototype.raycast.call(this,t,r),this.geometry=(n=this.subdividedGeometry)!=null?n:this.originalGeometry}updateMatrixWorldSVD(){let t=this.matrixWorld.elements,r=[[t[0],t[4],t[8]],[t[1],t[5],t[9]],[t[2],t[6],t[10]]],{u:n,v:s,q:o}=(0,pA.SVD)(r),a=mA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),l=iU.set(s[0][0],s[0][1],s[0][2],0,s[1][0],s[1][1],s[1][2],0,s[2][0],s[2][1],s[2][2],0,0,0,0,1),c=sU.copy(l).transpose();this.shearScale=oU.makeScale(o[0],o[1],o[2]).multiply(c).premultiply(l),this.shearScaleInv=aU.copy(this.shearScale).invert(),this.matrixWorldRigid.multiplyMatrices(a,c),o.every(h=>Math.abs(o[0]-h)<.01)&&(this.shearScale=void 0,this.shearScaleInv=void 0)}activateSVDCompensation(){this.shearScale!==void 0&&(this.matrixAutoUpdate=!1,this.matrix.copy(this.matrixWorldRigid).copyPosition(this.matrixWorld),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}deactivateSVDCompensation(){this.shearScale!==void 0&&(this.shearScale=void 0,this.shearScaleInv=void 0,this.matrixAutoUpdate=!0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}calcBoundingBox(){let t=this.originalGeometry;t.boundingSphere===null&&(t.boundingSphere=new Lr);let r=t.attributes.position,n=t.boundingSphere.center;vi.setFromBufferAttribute(r),vi.getCenter(n),t.boundingSphere.radius=n.distanceTo(vi.max),isNaN(t.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),vi.getSize(fo);let s={width:fo.x,height:fo.y,depth:fo.z};return this.geometry.userData.parameters=s,s}updateBoundingBox(t){let r=this.originalGeometry;vi.min.set(t[0],t[2],t[4]),vi.max.set(t[1],t[3],t[5]),this.shearScaleInv&&(vi.min.applyMatrix4(this.shearScaleInv),vi.max.applyMatrix4(this.shearScaleInv)),r.boundingSphere===null&&(r.boundingSphere=new Lr);let n=r.boundingSphere.center;vi.getCenter(n),r.boundingSphere.radius=n.distanceTo(vi.max),isNaN(r.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),vi.getSize(fo);let s={width:fo.x,height:fo.y,depth:fo.z};return this.geometry.userData.parameters=s,s}freeSubdivPointer(){this.subdivPointer&&(zv.free_bvh(this.subdivPointer),zv.free_subdivision_surface(this.subdivPointer),this.subdivPointer=0)}updateGeometry(t){this.geometry.userData.scale||(this.geometry.userData.scale=Array(3)),this.geometry.userData.scale[0]=this.geometry.userData.parameters.width===0?1:t.parameters.width/this.geometry.userData.parameters.width,this.geometry.userData.scale[1]=this.geometry.userData.parameters.height===0?1:t.parameters.height/this.geometry.userData.parameters.height,this.geometry.userData.scale[2]=this.geometry.userData.parameters.depth===0?1:t.parameters.depth/this.geometry.userData.parameters.depth,dA(this.originalGeometry.attributes,...this.geometry.userData.scale),this.originalGeometry.attributes.position.needsUpdate=!0,this.originalGeometry.attributes.normal.needsUpdate=!0,this.subdividedGeometry&&(dA(this.subdividedGeometry.attributes,...this.subdividedGeometry.userData.scale),this.subdividedGeometry.attributes.position.needsUpdate=!0,this.subdividedGeometry.attributes.normal.needsUpdate=!0),this.geometry.userData.parameters=se({},t.parameters)}};function dA(i,e,t,r){let n=i.position.array,s=i.normal.array,o=mA.makeScale(e,t,r).invert().elements,a,l,c;for(var h=0,u=n.length;h<u;h+=3)n[h]*=e,n[h+1]*=t,n[h+2]*=r,a=s[h],l=s[h+1],c=s[h+2],s[h]=o[0]*a+o[4]*l+o[8]*c,s[h+1]=o[1]*a+o[5]*l+o[9]*c,s[h+2]=o[2]*a+o[6]*l+o[10]*c}function gA(i,e){e.flatShading!==void 0&&(i.flatShading=e.flatShading,i.needsUpdate=!0),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.side!==void 0&&(e.side===0?i.side=si:e.side===1?i.side=Dr:i.side=or)}function lU(i,e){if(Array.isArray(i.material))for(let t of i.material)gA(t,e);else{let t=i.material;gA(t,e)}i.objectType==="SubdivObject"&&e.flatShading!==void 0&&(i.material.flatShading=!1,i.smoothShading=!e.flatShading,i.updateMesh())}function yA(i,e,t){let r;if(e.geometry.type==="SubdivGeometry")r=po.createFromState(i,e,t);else{let n=e.geometry.type==="BooleanGeometry"?new De:Fp(e.geometry,t),s="materials"in e?z1(e.materials,t):uu(e.material,t);sp.is2DParametricMesh(n.userData.type)?r=new sc(n,s):(n==null?void 0:n.userData.type)==="VectorGeometry"?r=new ho(n,s):e.geometry.type==="NonParametricGeometry"?r=new ac(n,s):e.geometry.type==="BooleanGeometry"?(r=new zp(void 0,s),r.booleanOp=e.geometry.operation,e.geometry.phongAngle!==void 0&&(r.phongAngle=e.geometry.phongAngle)):r=new oc(n,s),r.uuid=i,r.fromState(e)}return lU(r,e),r}function vA(i,e,t){return e.type==="Mesh"?yA(i,e,t):e.type==="TextFrame"?ea.createFromState(i,e,t):e.type==="Empty"?gs.createFromState(i,e):e.type==="PointLight"?nc.createFromState(i,e,t):e.type==="SpotLight"?ic.createFromState(i,e,t):e.type==="DirectionalLight"?rc.createFromState(i,e,t):eo.is(e.type)?Bn.createFromState(i,e):(console.error(e),new gs)}function cU(i,e){e.uniforms[`f${e.id}_transmissionSamplerMap`].value=i.texture,e.uniforms[`f${e.id}_transmissionDepthMap`].value=i.depthTexture}function xA(i,e,t){if(!t.userData.layers)return!1;let r=!1,n=t.userData.layers.getLayersOfType("transmission");return n.length>0?(e.layers.set(3),r=!0,i!==void 0&&n.forEach(s=>cU(i,s))):e.layers.set(0),r}function bA(i,e){let t=!1;return e.traverseEntity(r=>{if(r instanceof kt)if(Array.isArray(r.material))for(let n=0;n<r.material.length;n++)xA(i,r,r.material[n])&&(t=!0);else xA(i,r,r.material)&&(t=!0)}),t}function wA(i,e){"material"in i&&hU(i.material,e),"geometry"in i&&i.geometry.dispose()}function hU(i,e){$S(i).forEach(t=>{e.isSharedMaterial(t)||t.dispose()})}var SA=new M,Gv=class extends Op(on){constructor(t,r){super();this.objectType="Scene";this.alpha=1;this.backupFog=new Po(16777215,.1,2e3);this.fogUseBGColor=!1;this.wireframeState=!1;this.needsTransmissionDirty=!0;this._needsTransmission=!1;this._color=new be(1,0,0);this.bgColor=new be(1,1,1);this.entityByUuid={};this.ambientLight=new Hs(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.personalCamera=this.createPersonalCamera(),this.activeCamera=this.personalCamera,this.sharedAssetManager=r,this.init(t,r)}needsTransmission(t){return this.needsTransmissionDirty&&(this._needsTransmission=bA(t,this),t!==void 0&&(this.needsTransmissionDirty=!1)),this._needsTransmission}find(t){if(t===""||t===void 0)return;let r=this.entityByUuid[t];return r===void 0?this.getObjectByProperty("uuid",t):r}get color(){return this._color}set color(t){this.fogUseBGColor===!0&&this.backupFog.color.copy(t),this._color.copy(t)}get enableFog(){return this.fog!==null}set enableFog(t){this.fog=t===!0?this.backupFog:null}init(t,r){if(this.createChildrenObjects(t.objects,this,r),this.personalCamera.removeFromParent(),this.add(this.personalCamera),this.ambientLight.removeFromParent(),this.add(this.ambientLight),this.setBackgroundColor(pr(t.backgroundColor,r)),this.updateFog(t.fog,r),this.updateAmbientLight(t.environment.ambientLight,r),this.activeCamera=this.personalCamera,t.publish.playCamera!==null){let n=this.find(t.publish.playCamera);n instanceof Bn&&this.switchActiveCamera(n)}this.traverse(n=>{Lt(n)&&n.recomputeBoolean()})}clearScene(t){this.traverseEntity(r=>{wA(r,t)});for(let r of this.children)Xn(r)&&r.removeFromParent()}resetAfterClear(t,r){this.init(t,r)}createPersonalCamera(){let t=Bn.createFromState(Gv.PERSONAL_CAMERA_ID,xe(se({},ap.defaultData),{name:"Personal Camera"}));return t.enableHelper=!1,t.objectHelper.visible=!1,delete t.isEntity,this.registerObjectCreatedInLegacy(t),t}raycast(t){let r=[],n=s=>{for(let o of s.children)Xn(o)&&!o.raycastLock&&o.visible&&((er(o)||ms(o)&&o.enableHelper&&o.objectHelper.parent)&&t.intersectObject(o,!1,r),n(o))};return n(this),r}traverseEntity(t){for(let r of this.children)Xn(r)&&r.traverseEntity(t)}updateFog(t,r){this.enableFog=t.enabled,this.fogUseBGColor=t.useBackgroundColor,t.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=pr(t.color,r),this.backupFog.near=t.near,this.backupFog.far=t.far}toJSON(t){return{}}fromJSON(t){return this}dispose(){this.clearScene(this.sharedAssetManager),this.sharedAssetManager.dispose()}updateAmbientLight(t,r){V1(this.ambientLight,t,r),t.groundColor!==void 0&&(this.ambientLight.groundColor=pr(t.groundColor,r)),t.enabled!==void 0&&(this.ambientLight.visible=t.enabled)}switchActiveCamera(t){this.activeCamera!==this.personalCamera&&(this.activeCamera.enableHelper=!0),this.activeCamera=t,t.enableHelper=!1}setBackgroundColor(t){this.bgColor=t,this.alpha=t.a}createChildrenObjects(t,r,n){for(let s of t)this.createChildObject(s.id,s.data,s.children,r,n)}registerObjectCreatedInLegacy(t){this.entityByUuid[t.uuid]=t}unregisterObject(t){delete this.entityByUuid[t.uuid];for(let r of t.children)this.unregisterObject(r)}createChildObject(t,r,n,s,o){let a=vA(t,r,o);return a&&(this.entityByUuid[t]=a,s.add(a),Lt(s)&&er(a)&&(a.prevBooleanObjectParent=s),this.createChildrenObjects(n,a,o)),a}getCenter(t){let r=[];for(let s=0,o=t.length;s<o;++s){let{id:a,recursive:l}=t[s],c=this.find(a),h=l?c.recursiveBBox:c.singleBBox;r.push(...h.vertices)}let n=new Kt;return n.setFromPoints(r),n.getCenter(SA),SA}copyMatrixWorld(t,r){if(t===null){r.identity();return}let n=this.find(t);n?r.copy(n.matrixWorld):r.identity()}copyParentMatrixWorld(t,r){var s;if(t===null){r.identity();return}let n=(s=this.find(t))==null?void 0:s.parent;n?r.copy(n.matrixWorld):r.identity()}traverseMaterial(t){this.traverseEntity(r=>{if(r instanceof kt)if(Array.isArray(r.material))for(let n=0;n<r.material.length;n++)t(r.material[n]);else t(r.material)})}updateCanvasSize(t,r){this.activeCamera.setViewplaneSize(t,r);let n,s;t>=r?(n=r/t,s=1):(n=1,s=t/r),this.traverseMaterial(o=>{o.layersList.getLayersOfType("transmission").forEach(l=>{l.uniforms[`f${l.id}_aspectRatio`].value.x=n,l.uniforms[`f${l.id}_aspectRatio`].value.y=s})})}},yu=Gv;yu.PERSONAL_CAMERA_ID="f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera";var PA={RED:0,GREEN:1,BLUE:2,ALPHA:3};var vu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var uU=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
3929
3929
|
uniform mediump sampler2D inputBuffer;
|
|
3930
3930
|
#else
|
|
3931
3931
|
uniform lowp sampler2D inputBuffer;
|
|
@@ -3953,7 +3953,7 @@ vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*ke
|
|
|
3953
3953
|
#else
|
|
3954
3954
|
vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;
|
|
3955
3955
|
#endif
|
|
3956
|
-
}}`,Xp=class extends Mt{constructor(i=!1,e=!1){super({name:"BokehMaterial",defines:{PASS:i?"2":"1"},uniforms:{kernel64:new Ce(null),kernel16:new Ce(null),inputBuffer:new Ce(null),cocBuffer:new Ce(null),texelSize:new Ce(new B),scale:new Ce(1)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:
|
|
3956
|
+
}}`,Xp=class extends Mt{constructor(i=!1,e=!1){super({name:"BokehMaterial",defines:{PASS:i?"2":"1"},uniforms:{kernel64:new Ce(null),kernel16:new Ce(null),inputBuffer:new Ce(null),cocBuffer:new Ce(null),texelSize:new Ce(new B),scale:new Ce(1)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:uU,vertexShader:vu}),this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}set cocBuffer(i){this.uniforms.cocBuffer.value=i}setCoCBuffer(i){this.uniforms.cocBuffer.value=i}get scale(){return this.uniforms.scale.value}set scale(i){this.uniforms.scale.value=i}getScale(i){return this.uniforms.scale.value=i}setScale(i){this.uniforms.scale.value=i}generateKernel(){let i=2.39996323,e=new Float32Array(128),t=new Float32Array(32),r=0,n=0;for(let a=0;a<80;++a){let l=a*i,c=Math.sqrt(a)/Math.sqrt(80),h=c*Math.cos(l),u=c*Math.sin(l);a%5===0?(t[n++]=h,t[n++]=u):(e[r++]=h,e[r++]=u)}let s=[],o=[];for(let a=0;a<128;)s.push(new Je(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Je(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e)}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}};function MA(i,e,t){return i*(e-t)-e}function jv(i,e,t){return Math.min(Math.max((i+e)/(e-t),0),1)}var fU=`#include <common>
|
|
3957
3957
|
#include <packing>
|
|
3958
3958
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
3959
3959
|
uniform highp sampler2D depthBuffer;
|
|
@@ -3972,7 +3972,7 @@ float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDept
|
|
|
3972
3972
|
#else
|
|
3973
3973
|
float linearDepth=depth;
|
|
3974
3974
|
#endif
|
|
3975
|
-
float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,
|
|
3975
|
+
float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,dU=class extends Mt{constructor(i){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ce(null),focusDistance:new Ce(0),focusRange:new Ce(0),cameraNear:new Ce(.3),cameraFar:new Ce(1e3)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:fU,vertexShader:vu}),this.toneMapped=!1,this.uniforms.focalLength=this.uniforms.focusRange,this.adoptCameraSettings(i)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(i){this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=Ir){this.depthBuffer=i,this.depthPacking=e}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(i){this.uniforms.focusDistance.value=i}get worldFocusDistance(){return-MA(this.focusDistance,this.near,this.far)}set worldFocusDistance(i){this.focusDistance=jv(-i,this.near,this.far)}getFocusDistance(i){this.uniforms.focusDistance.value=i}setFocusDistance(i){this.uniforms.focusDistance.value=i}get focalLength(){return this.focusRange}set focalLength(i){this.focusRange=i}get focusRange(){return this.uniforms.focusRange.value}set focusRange(i){this.uniforms.focusRange.value=i}get worldFocusRange(){return-MA(this.focusRange,this.near,this.far)}set worldFocusRange(i){this.focusRange=jv(-i,this.near,this.far)}getFocalLength(i){return this.focusRange}setFocalLength(i){this.focusRange=i}adoptCameraSettings(i){i&&(this.uniforms.cameraNear.value=i.near,this.uniforms.cameraFar.value=i.far,i instanceof sr?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},pU=`#include <common>
|
|
3976
3976
|
#include <dithering_pars_fragment>
|
|
3977
3977
|
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
3978
3978
|
uniform mediump sampler2D inputBuffer;
|
|
@@ -3982,14 +3982,14 @@ uniform lowp sampler2D inputBuffer;
|
|
|
3982
3982
|
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;
|
|
3983
3983
|
#include <encodings_fragment>
|
|
3984
3984
|
#include <dithering_fragment>
|
|
3985
|
-
}`,
|
|
3985
|
+
}`,mU="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",AA=class extends Mt{constructor(i=new B){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new Ce(null),texelSize:new Ce(new B),halfTexelSize:new Ce(new B),kernel:new Ce(0),scale:new Ce(1)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:pU,vertexShader:mU}),this.toneMapped=!1,this.setTexelSize(i.x,i.y)}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.inputBuffer=i}get scale(){return this.uniforms.scale.value}set scale(i){this.uniforms.scale.value=i}getScale(){return this.uniforms.scale.value}setScale(i){this.uniforms.scale.value=i}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(i){this.uniforms.kernel.value=i}setKernel(i){this.kernel=i}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e),this.uniforms.halfTexelSize.value.set(i,e).multiplyScalar(.5)}setSize(i,e){let t=this.uniforms;t.texelSize.value.set(1/i,1/e),t.halfTexelSize.value.copy(t.texelSize.value).multiplyScalar(.5)}},gU=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
3986
3986
|
uniform mediump sampler2D inputBuffer;
|
|
3987
3987
|
#else
|
|
3988
3988
|
uniform lowp sampler2D inputBuffer;
|
|
3989
3989
|
#endif
|
|
3990
3990
|
uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;
|
|
3991
3991
|
#include <encodings_fragment>
|
|
3992
|
-
}`,
|
|
3992
|
+
}`,yU=class extends Mt{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new Ce(null),opacity:new Ce(1)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:gU,vertexShader:vu}),this.toneMapped=!1}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}getOpacity(i){return this.uniforms.opacity.value}setOpacity(i){this.uniforms.opacity.value=i}};var vU=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;
|
|
3993
3993
|
#if EDGE_DETECTION_MODE != 0
|
|
3994
3994
|
varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;
|
|
3995
3995
|
#endif
|
|
@@ -4033,7 +4033,7 @@ float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=li
|
|
|
4033
4033
|
#elif EDGE_DETECTION_MODE == 2
|
|
4034
4034
|
vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);
|
|
4035
4035
|
#endif
|
|
4036
|
-
}`,
|
|
4036
|
+
}`,xU=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;
|
|
4037
4037
|
#if EDGE_DETECTION_MODE != 0
|
|
4038
4038
|
varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;
|
|
4039
4039
|
#endif
|
|
@@ -4041,7 +4041,7 @@ void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+t
|
|
|
4041
4041
|
#if EDGE_DETECTION_MODE != 0
|
|
4042
4042
|
vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);
|
|
4043
4043
|
#endif
|
|
4044
|
-
gl_Position=vec4(position.xy,1.0,1.0);}`,Jp={DEPTH:0,LUMA:1,COLOR:2},Yv={DISABLED:0,DEPTH:1,CUSTOM:2},
|
|
4044
|
+
gl_Position=vec4(position.xy,1.0,1.0);}`,Jp={DEPTH:0,LUMA:1,COLOR:2},Yv={DISABLED:0,DEPTH:1,CUSTOM:2},bU=class extends Mt{constructor(i=new B,e=Jp.COLOR){super({name:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ce(null),depthBuffer:new Ce(null),predicationBuffer:new Ce(null),texelSize:new Ce(i)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:vU,vertexShader:xU}),this.toneMapped=!1,this.edgeDetectionMode=e}set depthBuffer(i){this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=Ir){this.depthBuffer=i,this.depthPacking=e}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(i){this.defines.EDGE_DETECTION_MODE=i.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(i){this.edgeDetectionMode=i}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(i){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=i.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(i){this.localContrastAdaptationFactor=i}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(i){this.defines.EDGE_THRESHOLD=i.toFixed("6"),this.defines.DEPTH_THRESHOLD=(i*.1).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(i){this.edgeDetectionThreshold=i}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(i){this.defines.PREDICATION_MODE=i.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(i){this.predicationMode=i}set predicationBuffer(i){this.uniforms.predicationBuffer.value=i}setPredicationBuffer(i){this.uniforms.predicationBuffer.value=i}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(i){this.defines.PREDICATION_THRESHOLD=i.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(i){this.predicationThreshold=i}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(i){this.defines.PREDICATION_SCALE=i.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(i){this.predicationScale=i}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(i){this.defines.PREDICATION_STRENGTH=i.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(i){this.predicationStrength=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},wU=`#include <common>
|
|
4045
4045
|
#include <packing>
|
|
4046
4046
|
#include <dithering_pars_fragment>
|
|
4047
4047
|
#define packFloatToRGBA(v) packDepthToRGBA(v)
|
|
@@ -4077,7 +4077,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
|
4077
4077
|
#include <encodings_fragment>
|
|
4078
4078
|
#endif
|
|
4079
4079
|
#include <dithering_fragment>
|
|
4080
|
-
}`,
|
|
4080
|
+
}`,SU="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",xi={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},qv=class extends Mt{constructor(i,e,t,r,n=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Uo.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ce(null),depthBuffer:new Ce(null),resolution:new Ce(new B),texelSize:new Ce(new B),cameraNear:new Ce(.3),cameraFar:new Ce(1e3),aspect:new Ce(1),time:new Ce(0)},blending:Ht,depthWrite:!1,depthTest:!1,dithering:n}),this.toneMapped=!1,i&&this.setShaderParts(i),e&&this.setDefines(e),t&&this.setUniforms(t),this.adoptCameraSettings(r)}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(i){this.uniforms.depthBuffer.value=i}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=Ir){this.depthBuffer=i,this.depthPacking=e}setShaderParts(i){return this.fragmentShader=wU.replace(xi.FRAGMENT_HEAD,i.get(xi.FRAGMENT_HEAD)).replace(xi.FRAGMENT_MAIN_UV,i.get(xi.FRAGMENT_MAIN_UV)).replace(xi.FRAGMENT_MAIN_IMAGE,i.get(xi.FRAGMENT_MAIN_IMAGE)),this.vertexShader=SU.replace(xi.VERTEX_HEAD,i.get(xi.VERTEX_HEAD)).replace(xi.VERTEX_MAIN_SUPPORT,i.get(xi.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(i){for(let e of i.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(i){for(let e of i.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(i){this.extensions={};for(let e of i)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(i){this.encodeOutput!==i&&(i?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(i){return this.encodeOutput}setOutputEncodingEnabled(i){this.encodeOutput=i}get time(){return this.uniforms.time.value}set time(i){this.uniforms.time.value=i}setDeltaTime(i){this.uniforms.time.value+=i}adoptCameraSettings(i){i&&(this.uniforms.cameraNear.value=i.near,this.uniforms.cameraFar.value=i.far,i instanceof sr?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(i,e){let t=this.uniforms;t.resolution.value.set(i,e),t.texelSize.value.set(1/i,1/e),t.aspect.value=i/e}static get Section(){return xi}};var MU=`#include <common>
|
|
4081
4081
|
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
4082
4082
|
uniform mediump sampler2D inputBuffer;
|
|
4083
4083
|
#else
|
|
@@ -4099,7 +4099,7 @@ gl_FragColor=vec4(texel.rgb*l,l);
|
|
|
4099
4099
|
#else
|
|
4100
4100
|
gl_FragColor=vec4(l);
|
|
4101
4101
|
#endif
|
|
4102
|
-
}`,
|
|
4102
|
+
}`,AU=class extends Mt{constructor(i=!1,e=null){super({name:"LuminanceMaterial",uniforms:{inputBuffer:new Ce(null),threshold:new Ce(0),smoothing:new Ce(1),range:new Ce(null)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:MU,vertexShader:vu}),this.toneMapped=!1,this.colorOutput=i,this.luminanceRange=e}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get threshold(){return this.uniforms.threshold.value}set threshold(i){this.smoothing>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=i}getThreshold(){return this.threshold}setThreshold(i){this.threshold=i}get smoothing(){return this.uniforms.smoothing.value}set smoothing(i){this.threshold>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=i}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(i){this.smoothing=i}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(i){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(i){i?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(i){return this.colorOutput}setColorOutputEnabled(i){this.colorOutput=i}get useRange(){return this.luminanceRange!==null}set useRange(i){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(i){i!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=i,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(i){this.luminanceRange=i}},TU=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
4103
4103
|
uniform mediump sampler2D inputBuffer;
|
|
4104
4104
|
#else
|
|
4105
4105
|
uniform lowp sampler2D inputBuffer;
|
|
@@ -4139,7 +4139,7 @@ gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);
|
|
|
4139
4139
|
#else
|
|
4140
4140
|
gl_FragColor=mask*texture2D(inputBuffer,vUv);
|
|
4141
4141
|
#endif
|
|
4142
|
-
}`,DA={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2},
|
|
4142
|
+
}`,DA={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2},_U=class extends Mt{constructor(i=null){super({name:"MaskMaterial",uniforms:{maskTexture:new Ce(i),inputBuffer:new Ce(null),strength:new Ce(1)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:TU,vertexShader:vu}),this.toneMapped=!1,this.setColorChannel(PA.RED),this.setMaskFunction(DA.DISCARD)}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}set maskTexture(i){this.uniforms.maskTexture.value=i,delete this.defines.MASK_PRECISION_HIGH,i.type!==qt&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(i){this.maskTexture=i}set colorChannel(i){this.defines.COLOR_CHANNEL=i.toFixed(0),this.needsUpdate=!0}setColorChannel(i){this.colorChannel=i}set maskFunction(i){this.defines.MASK_FUNCTION=i.toFixed(0),this.needsUpdate=!0}setMaskFunction(i){this.maskFunction=i}get inverted(){return this.defines.INVERTED!==void 0}set inverted(i){this.inverted&&!i?delete this.defines.INVERTED:i&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(i){this.inverted=i}get strength(){return this.uniforms.strength.value}set strength(i){this.uniforms.strength.value=i}getStrength(){return this.strength}setStrength(i){this.strength=i}};var EU=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)
|
|
4143
4143
|
#if __VERSION__ < 300
|
|
4144
4144
|
#define round(v) floor(v + 0.5)
|
|
4145
4145
|
#endif
|
|
@@ -4164,7 +4164,7 @@ vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOf
|
|
|
4164
4164
|
#if !defined(DISABLE_DIAG_DETECTION)
|
|
4165
4165
|
}else{e.r=0.0;}
|
|
4166
4166
|
#endif
|
|
4167
|
-
}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,EU="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",CU=class extends Mt{constructor(i=new B,e=new B){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ce(null),searchTexture:new Ce(null),areaTexture:new Ce(null),resolution:new Ce(e),texelSize:new Ce(i)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:_U,vertexShader:EU}),this.toneMapped=!1}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(i){this.uniforms.searchTexture.value=i}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(i){this.uniforms.areaTexture.value=i}setLookupTextures(i,e){this.searchTexture=i,this.areaTexture=e}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(i){let e=Math.min(Math.max(i,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(i){this.orthogonalSearchSteps=i}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(i){let e=Math.min(Math.max(i,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(i){this.diagonalSearchSteps=i}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(i){i?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(i){this.diagonalDetection=i}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(i){let e=Math.min(Math.max(i,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(i){this.cornerRounding=i}get cornerDetection(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerDetection(i){i?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(i){this.cornerDetection=i}setSize(i,e){let t=this.uniforms;t.texelSize.value.set(1/i,1/e),t.resolution.value.set(i,e)}};var PU=new Gn,mo=null;function DU(){if(mo===null){let i=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);mo=new De,mo.setAttribute!==void 0?(mo.setAttribute("position",new Ve(i,3)),mo.setAttribute("uv",new Ve(e,2))):(mo.addAttribute("position",new Ve(i,3)),mo.addAttribute("uv",new Ve(e,2)))}return mo}var ys=class{constructor(i="Pass",e=new on,t=PU){this.name=i,this.renderer=null,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(i){if(this.rtt===i){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!i}}setRenderer(i){this.renderer=i}isEnabled(){return this.enabled}setEnabled(i){this.enabled=i}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(i){let e=this.screen;e!==null?e.material=i:(e=new Vt(DU(),i),e.frustumCulled=!1,this.scene===null&&(this.scene=new on),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(i){this.fullscreenMaterial=i}getDepthTexture(){return null}setDepthTexture(i,e=Ir){}render(i,e,t,r,n){throw new Error("Render method not implemented!")}setSize(i,e){}initialize(i,e,t){}dispose(){for(let i of Object.keys(this)){let e=this[i];if(e!==null&&typeof e.dispose=="function"){if(e instanceof on||e===this.renderer)continue;this[i].dispose()}}}},Xv=class extends ys{constructor(i,e=!0){super("CopyPass"),this.fullscreenMaterial=new gU,this.needsSwap=!1,this.renderTarget=i,i===void 0&&(this.renderTarget=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(i){this.autoResize=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(i){this.autoResize=i}render(i,e,t,r,n){this.fullscreenMaterial.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){this.autoResize&&this.renderTarget.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==qt?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":i.outputEncoding===je&&(this.renderTarget.texture.encoding=je))}};var LU=class extends ys{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(i,e,t,r,n){let s=i.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},kv=new be,Qv=class extends ys{constructor(i=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=i,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(i,e,t){this.color=i,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(i){this.overrideClearColor=i}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(i){this.overrideClearAlpha=i}render(i,e,t,r,n){let s=this.overrideClearColor,o=this.overrideClearAlpha,a=i.getClearAlpha(),l=s!==null,c=o>=0;l?(kv.copy(i.getClearColor(kv)),i.setClearColor(s,c?o:a)):c&&i.setClearAlpha(o),i.setRenderTarget(this.renderToScreen?null:e),i.clear(this.color,this.depth,this.stencil),l?i.setClearColor(kv,a):c&&i.setClearAlpha(a)}},go=-1,bi=class extends Yt{constructor(i,e=go,t=go,r=1){super(),this.resizable=i,this.base=new B(1,1),this.preferred=new B(e,t),this.target=this.preferred,this.s=r}get width(){let{base:i,preferred:e,scale:t}=this,r;return e.width!==go?r=e.width:e.height!==go?r=Math.round(e.height*(i.width/Math.max(i.height,1))):r=Math.round(i.width*t),r}set width(i){this.preferredWidth=i}get height(){let{base:i,preferred:e,scale:t}=this,r;return e.height!==go?r=e.height:e.width!==go?r=Math.round(e.width/Math.max(i.width/Math.max(i.height,1),1)):r=Math.round(i.height*t),r}set height(i){this.preferredHeight=i}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(i){this.s!==i&&(this.s=i,this.preferred.setScalar(go),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(i){this.scale=i}get baseWidth(){return this.base.width}set baseWidth(i){this.base.width!==i&&(this.base.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(i){this.base.width!==i&&(this.base.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(i){this.base.height!==i&&(this.base.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(i){this.baseHeight=i}setBaseSize(i,e){(this.base.width!==i||this.base.height!==e)&&(this.base.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(i){this.preferred.width!==i&&(this.preferred.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(i){this.preferredWidth=i}get preferredHeight(){return this.preferred.height}set preferredHeight(i){this.preferred.height!==i&&(this.preferred.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(i){this.preferredHeight=i}setPreferredSize(i,e){(this.preferred.width!==i||this.preferred.height!==e)&&(this.preferred.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(i){this.base.set(i.getBaseWidth(),i.getBaseHeight()),this.preferred.set(i.getPreferredWidth(),i.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return go}},Vv=!1,TA=class{constructor(i=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(i),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case or:t=this.materialsFlatShadedDoubleSide;break;case Dr:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case or:t=this.materialsDoubleSide;break;case Dr:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(i){if(this.disposeMaterials(),this.material=i,i!==null){let e=this.materials=[i.clone(),i.clone(),i.clone()];for(let t of e)t.uniforms=Object.assign({},i.uniforms),t.side=si;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.side=Dr,r}),this.materialsDoubleSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.side=or,r}),this.materialsFlatShaded=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.flatShading=!0,r}),this.materialsFlatShadedBackSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.flatShading=!0,r.side=Dr,r}),this.materialsFlatShadedDoubleSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.flatShading=!0,r.side=or,r})}}render(i,e,t){let r=i.shadowMap.enabled;if(i.shadowMap.enabled=!1,Vv){let n=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),i.render(e,t);for(let s of n)s[0].material=s[1];this.meshCount!==n.size&&n.clear()}else{let n=e.overrideMaterial;e.overrideMaterial=this.material,i.render(e,t),e.overrideMaterial=n}i.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){let i=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of i)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Vv}static set workaroundEnabled(i){Vv=i}},Jv=class extends ys{constructor(i,e,t=null){super("RenderPass",i,e),this.needsSwap=!1,this.clearPass=new Qv,this.overrideMaterialManager=t===null?null:new TA(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}get renderToScreen(){return super.renderToScreen}set renderToScreen(i){super.renderToScreen=i,this.clearPass.renderToScreen=i}get overrideMaterial(){let i=this.overrideMaterialManager;return i!==null?i.material:null}set overrideMaterial(i){let e=this.overrideMaterialManager;i!==null?e!==null?e.setMaterial(i):this.overrideMaterialManager=new TA(i):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(i){this.overrideMaterial=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getSelection(){return this.selection}setSelection(i){this.selection=i}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(i){this.ignoreBackground=i}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(i){this.skipShadowMapUpdate=i}getClearPass(){return this.clearPass}render(i,e,t,r,n){let s=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,c=s.background,h=i.shadowMap.autoUpdate,u=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(i.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(i,e),i.setRenderTarget(u),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(i,s,o):i.render(s,o),o.layers.mask=l,s.background=c,i.shadowMap.autoUpdate=h}};var lae=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var vt={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},IU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",RU="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",BU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",NU="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",OU="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",FU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",UU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",zU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",GU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",kU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",VU="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",HU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",WU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",jU="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",qU="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",YU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",XU="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",QU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",JU=new Map([[vt.SKIP,null],[vt.ADD,IU],[vt.ALPHA,RU],[vt.AVERAGE,BU],[vt.COLOR_BURN,NU],[vt.COLOR_DODGE,OU],[vt.DARKEN,FU],[vt.DIFFERENCE,UU],[vt.EXCLUSION,zU],[vt.LIGHTEN,GU],[vt.MULTIPLY,kU],[vt.DIVIDE,VU],[vt.NEGATION,HU],[vt.NORMAL,WU],[vt.OVERLAY,jU],[vt.REFLECT,qU],[vt.SCREEN,YU],[vt.SOFT_LIGHT,XU],[vt.SUBTRACT,QU]]),KU=class extends Yt{constructor(i,e=1){super(),this.f=i,this.opacity=new Ce(e)}getOpacity(){return this.opacity.value}setOpacity(i){this.opacity.value=i}get blendFunction(){return this.f}set blendFunction(i){this.f=i,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(i){this.blendFunction=i}getShaderCode(){return JU.get(this.blendFunction)}},Hi={NONE:0,DEPTH:1,CONVOLUTION:2};var Wi=class extends Yt{constructor(i,e,{attributes:t=Hi.NONE,blendFunction:r=vt.SCREEN,defines:n=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=i,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=n,this.uniforms=s,this.extensions=o,this.blendMode=new KU(r),this.blendMode.addEventListener("change",l=>this.setChanged())}getName(){return this.name}setRenderer(i){this.renderer=i}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(i){this.attributes=i,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(i){this.fragmentShader=i,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(i){this.vertexShader=i,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(i,e=Ir){}update(i,e,t){}setSize(i,e){}initialize(i,e,t){}dispose(){for(let i of Object.keys(this)){let e=this[i];if(e!==null&&typeof e.dispose=="function"){if(e instanceof on||e===this.renderer)continue;this[i].dispose()}}}};function _A(i,e,t){for(let r of e){let n="$1"+i+r.charAt(0).toUpperCase()+r.slice(1),s=new RegExp("([^\\.])(\\b"+r+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(s,n))}}function ZU(i,e,t,r,n,s,o){let a=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),l=a.get("fragment")!==void 0&&/mainImage/.test(a.get("fragment")),c=a.get("fragment")!==void 0&&/mainUv/.test(a.get("fragment")),h=[],u=[],f=!1,d=!1;if(a.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(c&&(o&Hi.CONVOLUTION)!==0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!l&&!c)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{let p=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,m=qv.Section;if(c){let v=` ${i}MainUv(UV);
|
|
4167
|
+
}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,CU="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",PU=class extends Mt{constructor(i=new B,e=new B){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ce(null),searchTexture:new Ce(null),areaTexture:new Ce(null),resolution:new Ce(e),texelSize:new Ce(i)},blending:Ht,depthWrite:!1,depthTest:!1,fragmentShader:EU,vertexShader:CU}),this.toneMapped=!1}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(i){this.uniforms.searchTexture.value=i}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(i){this.uniforms.areaTexture.value=i}setLookupTextures(i,e){this.searchTexture=i,this.areaTexture=e}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(i){let e=Math.min(Math.max(i,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(i){this.orthogonalSearchSteps=i}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(i){let e=Math.min(Math.max(i,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(i){this.diagonalSearchSteps=i}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(i){i?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(i){this.diagonalDetection=i}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(i){let e=Math.min(Math.max(i,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(i){this.cornerRounding=i}get cornerDetection(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerDetection(i){i?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(i){this.cornerDetection=i}setSize(i,e){let t=this.uniforms;t.texelSize.value.set(1/i,1/e),t.resolution.value.set(i,e)}};var DU=new Gn,mo=null;function LU(){if(mo===null){let i=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);mo=new De,mo.setAttribute!==void 0?(mo.setAttribute("position",new Ve(i,3)),mo.setAttribute("uv",new Ve(e,2))):(mo.addAttribute("position",new Ve(i,3)),mo.addAttribute("uv",new Ve(e,2)))}return mo}var ys=class{constructor(i="Pass",e=new on,t=DU){this.name=i,this.renderer=null,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(i){if(this.rtt===i){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!i}}setRenderer(i){this.renderer=i}isEnabled(){return this.enabled}setEnabled(i){this.enabled=i}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(i){let e=this.screen;e!==null?e.material=i:(e=new Vt(LU(),i),e.frustumCulled=!1,this.scene===null&&(this.scene=new on),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(i){this.fullscreenMaterial=i}getDepthTexture(){return null}setDepthTexture(i,e=Ir){}render(i,e,t,r,n){throw new Error("Render method not implemented!")}setSize(i,e){}initialize(i,e,t){}dispose(){for(let i of Object.keys(this)){let e=this[i];if(e!==null&&typeof e.dispose=="function"){if(e instanceof on||e===this.renderer)continue;this[i].dispose()}}}},Xv=class extends ys{constructor(i,e=!0){super("CopyPass"),this.fullscreenMaterial=new yU,this.needsSwap=!1,this.renderTarget=i,i===void 0&&(this.renderTarget=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(i){this.autoResize=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(i){this.autoResize=i}render(i,e,t,r,n){this.fullscreenMaterial.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){this.autoResize&&this.renderTarget.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==qt?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":i.outputEncoding===je&&(this.renderTarget.texture.encoding=je))}};var IU=class extends ys{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(i,e,t,r,n){let s=i.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},kv=new be,Qv=class extends ys{constructor(i=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=i,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(i,e,t){this.color=i,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(i){this.overrideClearColor=i}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(i){this.overrideClearAlpha=i}render(i,e,t,r,n){let s=this.overrideClearColor,o=this.overrideClearAlpha,a=i.getClearAlpha(),l=s!==null,c=o>=0;l?(kv.copy(i.getClearColor(kv)),i.setClearColor(s,c?o:a)):c&&i.setClearAlpha(o),i.setRenderTarget(this.renderToScreen?null:e),i.clear(this.color,this.depth,this.stencil),l?i.setClearColor(kv,a):c&&i.setClearAlpha(a)}},go=-1,bi=class extends Yt{constructor(i,e=go,t=go,r=1){super(),this.resizable=i,this.base=new B(1,1),this.preferred=new B(e,t),this.target=this.preferred,this.s=r}get width(){let{base:i,preferred:e,scale:t}=this,r;return e.width!==go?r=e.width:e.height!==go?r=Math.round(e.height*(i.width/Math.max(i.height,1))):r=Math.round(i.width*t),r}set width(i){this.preferredWidth=i}get height(){let{base:i,preferred:e,scale:t}=this,r;return e.height!==go?r=e.height:e.width!==go?r=Math.round(e.width/Math.max(i.width/Math.max(i.height,1),1)):r=Math.round(i.height*t),r}set height(i){this.preferredHeight=i}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(i){this.s!==i&&(this.s=i,this.preferred.setScalar(go),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(i){this.scale=i}get baseWidth(){return this.base.width}set baseWidth(i){this.base.width!==i&&(this.base.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(i){this.base.width!==i&&(this.base.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(i){this.base.height!==i&&(this.base.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(i){this.baseHeight=i}setBaseSize(i,e){(this.base.width!==i||this.base.height!==e)&&(this.base.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(i){this.preferred.width!==i&&(this.preferred.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(i){this.preferredWidth=i}get preferredHeight(){return this.preferred.height}set preferredHeight(i){this.preferred.height!==i&&(this.preferred.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(i){this.preferredHeight=i}setPreferredSize(i,e){(this.preferred.width!==i||this.preferred.height!==e)&&(this.preferred.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(i){this.base.set(i.getBaseWidth(),i.getBaseHeight()),this.preferred.set(i.getPreferredWidth(),i.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return go}},Vv=!1,TA=class{constructor(i=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(i),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case or:t=this.materialsFlatShadedDoubleSide;break;case Dr:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case or:t=this.materialsDoubleSide;break;case Dr:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(i){if(this.disposeMaterials(),this.material=i,i!==null){let e=this.materials=[i.clone(),i.clone(),i.clone()];for(let t of e)t.uniforms=Object.assign({},i.uniforms),t.side=si;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.side=Dr,r}),this.materialsDoubleSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.side=or,r}),this.materialsFlatShaded=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.flatShading=!0,r}),this.materialsFlatShadedBackSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.flatShading=!0,r.side=Dr,r}),this.materialsFlatShadedDoubleSide=e.map(t=>{let r=t.clone();return r.uniforms=Object.assign({},i.uniforms),r.flatShading=!0,r.side=or,r})}}render(i,e,t){let r=i.shadowMap.enabled;if(i.shadowMap.enabled=!1,Vv){let n=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),i.render(e,t);for(let s of n)s[0].material=s[1];this.meshCount!==n.size&&n.clear()}else{let n=e.overrideMaterial;e.overrideMaterial=this.material,i.render(e,t),e.overrideMaterial=n}i.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){let i=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of i)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Vv}static set workaroundEnabled(i){Vv=i}},Jv=class extends ys{constructor(i,e,t=null){super("RenderPass",i,e),this.needsSwap=!1,this.clearPass=new Qv,this.overrideMaterialManager=t===null?null:new TA(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}get renderToScreen(){return super.renderToScreen}set renderToScreen(i){super.renderToScreen=i,this.clearPass.renderToScreen=i}get overrideMaterial(){let i=this.overrideMaterialManager;return i!==null?i.material:null}set overrideMaterial(i){let e=this.overrideMaterialManager;i!==null?e!==null?e.setMaterial(i):this.overrideMaterialManager=new TA(i):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(i){this.overrideMaterial=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getSelection(){return this.selection}setSelection(i){this.selection=i}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(i){this.ignoreBackground=i}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(i){this.skipShadowMapUpdate=i}getClearPass(){return this.clearPass}render(i,e,t,r,n){let s=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,c=s.background,h=i.shadowMap.autoUpdate,u=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(i.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(i,e),i.setRenderTarget(u),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(i,s,o):i.render(s,o),o.layers.mask=l,s.background=c,i.shadowMap.autoUpdate=h}};var lae=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var vt={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},RU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",BU="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",NU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",OU="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",FU="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",UU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",zU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",GU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",kU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",VU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",HU="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",WU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",jU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",qU="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",YU="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",XU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",QU="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",JU="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",KU=new Map([[vt.SKIP,null],[vt.ADD,RU],[vt.ALPHA,BU],[vt.AVERAGE,NU],[vt.COLOR_BURN,OU],[vt.COLOR_DODGE,FU],[vt.DARKEN,UU],[vt.DIFFERENCE,zU],[vt.EXCLUSION,GU],[vt.LIGHTEN,kU],[vt.MULTIPLY,VU],[vt.DIVIDE,HU],[vt.NEGATION,WU],[vt.NORMAL,jU],[vt.OVERLAY,qU],[vt.REFLECT,YU],[vt.SCREEN,XU],[vt.SOFT_LIGHT,QU],[vt.SUBTRACT,JU]]),ZU=class extends Yt{constructor(i,e=1){super(),this.f=i,this.opacity=new Ce(e)}getOpacity(){return this.opacity.value}setOpacity(i){this.opacity.value=i}get blendFunction(){return this.f}set blendFunction(i){this.f=i,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(i){this.blendFunction=i}getShaderCode(){return KU.get(this.blendFunction)}},Hi={NONE:0,DEPTH:1,CONVOLUTION:2};var Wi=class extends Yt{constructor(i,e,{attributes:t=Hi.NONE,blendFunction:r=vt.SCREEN,defines:n=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=i,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=n,this.uniforms=s,this.extensions=o,this.blendMode=new ZU(r),this.blendMode.addEventListener("change",l=>this.setChanged())}getName(){return this.name}setRenderer(i){this.renderer=i}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(i){this.attributes=i,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(i){this.fragmentShader=i,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(i){this.vertexShader=i,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(i,e=Ir){}update(i,e,t){}setSize(i,e){}initialize(i,e,t){}dispose(){for(let i of Object.keys(this)){let e=this[i];if(e!==null&&typeof e.dispose=="function"){if(e instanceof on||e===this.renderer)continue;this[i].dispose()}}}};function _A(i,e,t){for(let r of e){let n="$1"+i+r.charAt(0).toUpperCase()+r.slice(1),s=new RegExp("([^\\.])(\\b"+r+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(s,n))}}function $U(i,e,t,r,n,s,o){let a=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),l=a.get("fragment")!==void 0&&/mainImage/.test(a.get("fragment")),c=a.get("fragment")!==void 0&&/mainUv/.test(a.get("fragment")),h=[],u=[],f=!1,d=!1;if(a.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(c&&(o&Hi.CONVOLUTION)!==0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!l&&!c)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{let p=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,m=qv.Section;if(c){let v=` ${i}MainUv(UV);
|
|
4168
4168
|
`;t.set(m.FRAGMENT_MAIN_UV,t.get(m.FRAGMENT_MAIN_UV)+v),f=!0}if(a.get("vertex")!==null&&/mainSupport/.test(a.get("vertex"))){let v=` ${i}MainSupport(`;v+=/mainSupport *\([\w\s]*?uv\s*?\)/.test(a.get("vertex"))?`vUv);
|
|
4169
4169
|
`:`);
|
|
4170
4170
|
`,t.set(m.VERTEX_MAIN_SUPPORT,t.get(m.VERTEX_MAIN_SUPPORT)+v),h=h.concat([...a.get("vertex").matchAll(/(?:varying\s+\w+\s+(\w*))/g)].map(y=>y[1])),u=u.concat(h).concat([...a.get("vertex").matchAll(p)].map(y=>y[1]))}u=u.concat([...a.get("fragment").matchAll(p)].map(v=>v[1])),u=u.concat([...e.defines.keys()].map(v=>v.replace(/\([\w\s,]*\)/g,""))),u=u.concat([...e.uniforms.keys()]),e.uniforms.forEach((v,y)=>s.set(i+y.charAt(0).toUpperCase()+y.slice(1),v)),e.defines.forEach((v,y)=>n.set(i+y.charAt(0).toUpperCase()+y.slice(1),v)),_A(i,u,n),_A(i,u,a);let g=e.blendMode;if(r.set(g.blendFunction,g),l){let v=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=`${i}MainImage(color0, UV, `;(o&Hi.DEPTH)!==0&&v.test(a.get("fragment"))&&(y+="depth, ",d=!0),y+=`color1);
|
|
@@ -4174,32 +4174,32 @@ vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOf
|
|
|
4174
4174
|
|
|
4175
4175
|
`,t.set(m.FRAGMENT_HEAD,t.get(m.FRAGMENT_HEAD)+y)}t.set(m.FRAGMENT_HEAD,t.get(m.FRAGMENT_HEAD)+a.get("fragment")+`
|
|
4176
4176
|
`),a.get("vertex")!==null&&t.set(m.VERTEX_HEAD,t.get(m.VERTEX_HEAD)+a.get("vertex")+`
|
|
4177
|
-
`)}return{varyings:h,transformedUv:f,readDepth:d}}var Kp=class extends ys{constructor(i,...e){super("EffectPass"),this.fullscreenMaterial=new qv(null,null,null,i),this.effects=e.sort((t,r)=>r.attributes-t.attributes),this.skipRendering=!1,this.uniformCount=0,this.varyingCount=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(i){this.fullscreenMaterial.encodeOutput=i}get dithering(){return this.fullscreenMaterial.dithering}set dithering(i){let e=this.fullscreenMaterial;e.dithering=i,e.needsUpdate=!0}verifyResources(){let i=this.renderer.capabilities,e=Math.min(i.maxFragmentUniforms,i.maxVertexUniforms);this.uniformCount>e&&console.warn("The current rendering context doesn't support more than "+e+" uniforms, but "+this.uniformCount+" were defined"),e=i.maxVaryings,this.varyingCount>e&&console.warn("The current rendering context doesn't support more than "+e+" varyings, but "+this.varyingCount+" were defined")}updateMaterial(){let i=qv.Section,e=new Map([[i.FRAGMENT_HEAD,""],[i.FRAGMENT_MAIN_UV,""],[i.FRAGMENT_MAIN_IMAGE,""],[i.VERTEX_HEAD,""],[i.VERTEX_MAIN_SUPPORT,""]]),t=new Map,r=new Map,n=new Map,s=new Set,o=0,a=0,l=0,c=!1,h=!1;for(let f of this.effects)if(f.blendMode.blendFunction===vt.SKIP)l|=f.getAttributes()&Hi.DEPTH;else if((l&f.getAttributes()&Hi.CONVOLUTION)!==0)console.error("Convolution effects cannot be merged",f);else{l|=f.getAttributes();let d="e"+o++,p
|
|
4177
|
+
`)}return{varyings:h,transformedUv:f,readDepth:d}}var Kp=class extends ys{constructor(i,...e){super("EffectPass"),this.fullscreenMaterial=new qv(null,null,null,i),this.effects=e.sort((t,r)=>r.attributes-t.attributes),this.skipRendering=!1,this.uniformCount=0,this.varyingCount=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(i){this.fullscreenMaterial.encodeOutput=i}get dithering(){return this.fullscreenMaterial.dithering}set dithering(i){let e=this.fullscreenMaterial;e.dithering=i,e.needsUpdate=!0}verifyResources(){let i=this.renderer.capabilities,e=Math.min(i.maxFragmentUniforms,i.maxVertexUniforms);this.uniformCount>e&&console.warn("The current rendering context doesn't support more than "+e+" uniforms, but "+this.uniformCount+" were defined"),e=i.maxVaryings,this.varyingCount>e&&console.warn("The current rendering context doesn't support more than "+e+" varyings, but "+this.varyingCount+" were defined")}updateMaterial(){let i=qv.Section,e=new Map([[i.FRAGMENT_HEAD,""],[i.FRAGMENT_MAIN_UV,""],[i.FRAGMENT_MAIN_IMAGE,""],[i.VERTEX_HEAD,""],[i.VERTEX_MAIN_SUPPORT,""]]),t=new Map,r=new Map,n=new Map,s=new Set,o=0,a=0,l=0,c=!1,h=!1;for(let f of this.effects)if(f.blendMode.blendFunction===vt.SKIP)l|=f.getAttributes()&Hi.DEPTH;else if((l&f.getAttributes()&Hi.CONVOLUTION)!==0)console.error("Convolution effects cannot be merged",f);else{l|=f.getAttributes();let d="e"+o++,p=$U(d,f,e,t,r,n,l);if(a+=p.varyings.length,c=c||p.transformedUv,h=h||p.readDepth,f.extensions!==null)for(let m of f.extensions)s.add(m)}let u=/\bblend\b/g;for(let f of t.values()){let d=f.getShaderCode().replace(u,`blend${f.blendFunction}`);e.set(i.FRAGMENT_HEAD,e.get(i.FRAGMENT_HEAD)+d+`
|
|
4178
4178
|
`)}if((l&Hi.DEPTH)!==0){if(h){let f=`float depth = readDepth(UV);
|
|
4179
4179
|
|
|
4180
4180
|
`;e.set(i.FRAGMENT_MAIN_IMAGE,f+e.get(i.FRAGMENT_MAIN_IMAGE))}this.needsDepthTexture=this.getDepthTexture()===null}else this.needsDepthTexture=!1;if(c){let f=`vec2 transformedUv = vUv;
|
|
4181
4181
|
`;e.set(i.FRAGMENT_MAIN_UV,f+e.get(i.FRAGMENT_MAIN_UV)),r.set("UV","transformedUv")}else r.set("UV","vUv");e.forEach((f,d,p)=>p.set(d,f.trim().replace(/^#/,`
|
|
4182
|
-
#`))),this.uniformCount=n.size,this.varyingCount=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderParts(e).setExtensions(s).setUniforms(n).setDefines(r)}recompile(){this.updateMaterial(),this.verifyResources()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(i,e=Ir){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e;for(let t of this.effects)t.setDepthTexture(i,e)}render(i,e,t,r,n){for(let s of this.effects)s.update(i,e,r);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=r,i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}}setSize(i,e){this.fullscreenMaterial.setSize(i,e);for(let t of this.effects)t.setSize(i,e)}initialize(i,e,t){this.renderer=i;for(let r of this.effects)r.initialize(i,e,t),r.addEventListener("change",n=>this.handleEvent(n));this.updateMaterial(),this.verifyResources(),t!==void 0&&t!==qt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let i of this.effects)i.dispose()}handleEvent(i){switch(i.type){case"change":this.recompile();break}}},$U=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],LA=class extends ys{constructor({resolutionScale:i=.5,width:e=bi.AUTO_SIZE,height:t=bi.AUTO_SIZE,kernelSize:r=Kv.LARGE}={}){super("KawaseBlurPass"),this.renderTargetA=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let n=this.resolution=new bi(this,e,t,i);n.addEventListener("change",s=>this.setSize(n.baseWidth,n.baseHeight)),this.blurMaterial=new AA,this.ditheredBlurMaterial=new AA,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=r}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get scale(){return this.blurMaterial.scale}set scale(i){this.blurMaterial.scale=i}getScale(){return this.blurMaterial.scale}setScale(i){this.blurMaterial.scale=i}getKernelSize(){return this.kernelSize}setKernelSize(i){this.kernelSize=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,r,n){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=$U[this.kernelSize],h=this.blurMaterial,u=e,f,d;for(this.fullscreenMaterial=h,f=0,d=c.length-1;f<d;++f){let p=(f&1)===0?a:l;h.kernel=c[f],h.inputBuffer=u.texture,i.setRenderTarget(p),i.render(s,o),u=p}this.dithering&&(h=this.ditheredBlurMaterial,this.fullscreenMaterial=h),h.kernel=c[f],h.inputBuffer=u.texture,i.setRenderTarget(this.renderToScreen?null:t),i.render(s,o)}setSize(i,e){let t=this.resolution;t.setBaseSize(i,e);let r=t.width,n=t.height;this.renderTargetA.setSize(r,n),this.renderTargetB.setSize(r,n),this.blurMaterial.setSize(r,n),this.ditheredBlurMaterial.setSize(r,n)}initialize(i,e,t){t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,t!==qt?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):i.outputEncoding===je&&(this.renderTargetA.texture.encoding=je,this.renderTargetB.texture.encoding=je))}static get AUTO_SIZE(){return bi.AUTO_SIZE}};var ez=class extends ys{constructor({width:i=bi.AUTO_SIZE,height:e=bi.AUTO_SIZE,renderTarget:t,luminanceRange:r,colorOutput:n}={}){super("LuminancePass"),this.fullscreenMaterial=new MU(n,r),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1);let s=this.resolution=new bi(this,i,e);s.addEventListener("change",o=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(i,e,t,r,n){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){let t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}initialize(i,e,t){t!==void 0&&t!==qt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},tz=class extends ys{constructor(i,e){super("MaskPass",i,e),this.needsSwap=!1,this.clearPass=new Qv(!1,!1,!0),this.inverse=!1}get inverted(){return this.inverse}set inverted(i){this.inverse=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(i){this.inverted=i}render(i,e,t,r,n){let s=i.getContext(),o=i.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,h=this.inverted?0:1,u=1-h;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,h,4294967295),o.stencil.setClear(u),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(i,null):(c.render(i,e),c.render(i,t))),this.renderToScreen?(i.setRenderTarget(null),i.render(a,l)):(i.setRenderTarget(e),i.render(a,l),i.setRenderTarget(t),i.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var yo=class extends ys{constructor(i,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=i,this.inputBufferUniform=null,this.setInput(e)}setInput(i){if(this.inputBufferUniform=null,this.fullscreenMaterial!==null){let e=this.fullscreenMaterial.uniforms;e!==void 0&&e[i]!==void 0&&(this.inputBufferUniform=e[i])}}render(i,e,t,r,n){this.inputBufferUniform!==null&&e!==null&&(this.inputBufferUniform.value=e.texture),i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}initialize(i,e,t){t!==void 0&&t!==qt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Hv=1/1e3,rz=1e3,nz=class{constructor(){this.previousTime=0,this.currentTime=0,this.delta=0,this.fixedDelta=1e3/60,this.elapsed=0,this.timescale=1,this.fixedDeltaEnabled=!1,this.autoReset=!1}setFixedDeltaEnabled(i){return this.fixedDeltaEnabled=i,this}isAutoResetEnabled(i){return this.autoReset}setAutoResetEnabled(i){return typeof document<"u"&&document.hidden!==void 0&&(i?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this.autoReset=i),this}getDelta(){return this.delta*Hv}getFixedDelta(){return this.fixedDelta*Hv}setFixedDelta(i){return this.fixedDelta=i*rz,this}getElapsed(){return this.elapsed*Hv}getTimescale(){return this.timescale}setTimescale(i){return this.timescale=i,this}update(i){return this.fixedDeltaEnabled?this.delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=i!==void 0?i:performance.now(),this.delta=this.currentTime-this.previousTime),this.delta*=this.timescale,this.elapsed+=this.delta,this}reset(){return this.delta=0,this.elapsed=0,this.currentTime=performance.now(),this}handleEvent(i){document.hidden||(this.currentTime=performance.now())}dispose(){this.setAutoResetEnabled(!1)}},IA=class{constructor(i=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:r=0,frameBufferType:n}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,n,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Xv,this.depthTexture=null,this.passes=[],this.timer=new nz,this.autoRenderToScreen=!0,this.setRenderer(i)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(i){let e=this.inputBuffer,t=this.multisampling;t>0&&i>0?(this.inputBuffer.samples=i,this.outputBuffer.samples=i,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==i&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,i),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(i){if(this.renderer=i,i!==null){let e=i.getSize(new B),t=i.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===qt&&i.outputEncoding===je&&(this.inputBuffer.texture.encoding=je,this.outputBuffer.texture.encoding=je,this.inputBuffer.dispose(),this.outputBuffer.dispose()),i.autoClear=!1,this.setSize(e.width,e.height);for(let n of this.passes)n.initialize(i,t,r)}}replaceRenderer(i,e=!0){let t=this.renderer,r=t.domElement.parentNode;return this.setRenderer(i),e&&r!==null&&(r.removeChild(t.domElement),r.appendChild(i.domElement)),t}createDepthTexture(){let i=this.depthTexture=new ai;return this.inputBuffer.depthTexture=i,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(i.format=Ns,i.type=Ls):i.type=La,i}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let i of this.passes)i.setDepthTexture(null)}}createBuffer(i,e,t,r){let n=this.renderer,s=n===null?new B:n.getDrawingBufferSize(new B),o={minFilter:ct,magFilter:ct,stencilBuffer:e,depthBuffer:i,type:t},a;return r>0?(a=Number(Uo.replace(/\D+/g,""))<138?new Kf(s.width,s.height,o):new mt(s.width,s.height,o),a.ignoreDepthForMultisampleCopy=!1,a.samples=r):a=new mt(s.width,s.height,o),t===qt&&n!==null&&n.outputEncoding===je&&(a.texture.encoding=je),a.texture.name="EffectComposer.Buffer",a.texture.generateMipmaps=!1,a}addPass(i,e){let t=this.passes,r=this.renderer,n=r.getDrawingBufferSize(new B),s=r.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(i.setRenderer(r),i.setSize(n.width,n.height),i.initialize(r,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),i.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,i):t.push(i),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),i.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(i of t)i.setDepthTexture(a)}else i.setDepthTexture(this.depthTexture)}removePass(i){let e=this.passes,t=e.indexOf(i);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(i.getDepthTexture()===this.depthTexture&&i.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(i.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let i=this.passes;this.deleteDepthTexture(),i.length>0&&(this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!1),this.passes=[])}render(i){let e=this.renderer,t=this.copyPass,r=this.inputBuffer,n=this.outputBuffer,s=!1,o,a,l;i===void 0&&(i=this.timer.update().getDelta());for(let c of this.passes)c.enabled&&(c.render(e,r,n,i,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,r,n,i,s),a.setFunc(o.EQUAL,1,4294967295)),l=r,r=n,n=l),c instanceof tz?s=!0:c instanceof LU&&(s=!1))}setSize(i,e,t){let r=this.renderer;if(i===void 0||e===void 0){let s=r.getSize(new B);i=s.width,e=s.height}r.setSize(i,e,t);let n=r.getDrawingBufferSize(new B);this.inputBuffer.setSize(n.width,n.height),this.outputBuffer.setSize(n.width,n.height);for(let s of this.passes)s.setSize(n.width,n.height)}reset(){let i=this.timer.isAutoResetEnabled();this.dispose(),this.autoRenderToScreen=!0,this.timer.setAutoResetEnabled(i)}dispose(){for(let i of this.passes)i.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}};var Kv={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5};var iz=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
4182
|
+
#`))),this.uniformCount=n.size,this.varyingCount=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderParts(e).setExtensions(s).setUniforms(n).setDefines(r)}recompile(){this.updateMaterial(),this.verifyResources()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(i,e=Ir){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e;for(let t of this.effects)t.setDepthTexture(i,e)}render(i,e,t,r,n){for(let s of this.effects)s.update(i,e,r);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=r,i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}}setSize(i,e){this.fullscreenMaterial.setSize(i,e);for(let t of this.effects)t.setSize(i,e)}initialize(i,e,t){this.renderer=i;for(let r of this.effects)r.initialize(i,e,t),r.addEventListener("change",n=>this.handleEvent(n));this.updateMaterial(),this.verifyResources(),t!==void 0&&t!==qt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let i of this.effects)i.dispose()}handleEvent(i){switch(i.type){case"change":this.recompile();break}}},ez=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],LA=class extends ys{constructor({resolutionScale:i=.5,width:e=bi.AUTO_SIZE,height:t=bi.AUTO_SIZE,kernelSize:r=Kv.LARGE}={}){super("KawaseBlurPass"),this.renderTargetA=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let n=this.resolution=new bi(this,e,t,i);n.addEventListener("change",s=>this.setSize(n.baseWidth,n.baseHeight)),this.blurMaterial=new AA,this.ditheredBlurMaterial=new AA,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=r}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get scale(){return this.blurMaterial.scale}set scale(i){this.blurMaterial.scale=i}getScale(){return this.blurMaterial.scale}setScale(i){this.blurMaterial.scale=i}getKernelSize(){return this.kernelSize}setKernelSize(i){this.kernelSize=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,r,n){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=ez[this.kernelSize],h=this.blurMaterial,u=e,f,d;for(this.fullscreenMaterial=h,f=0,d=c.length-1;f<d;++f){let p=(f&1)===0?a:l;h.kernel=c[f],h.inputBuffer=u.texture,i.setRenderTarget(p),i.render(s,o),u=p}this.dithering&&(h=this.ditheredBlurMaterial,this.fullscreenMaterial=h),h.kernel=c[f],h.inputBuffer=u.texture,i.setRenderTarget(this.renderToScreen?null:t),i.render(s,o)}setSize(i,e){let t=this.resolution;t.setBaseSize(i,e);let r=t.width,n=t.height;this.renderTargetA.setSize(r,n),this.renderTargetB.setSize(r,n),this.blurMaterial.setSize(r,n),this.ditheredBlurMaterial.setSize(r,n)}initialize(i,e,t){t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,t!==qt?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):i.outputEncoding===je&&(this.renderTargetA.texture.encoding=je,this.renderTargetB.texture.encoding=je))}static get AUTO_SIZE(){return bi.AUTO_SIZE}};var tz=class extends ys{constructor({width:i=bi.AUTO_SIZE,height:e=bi.AUTO_SIZE,renderTarget:t,luminanceRange:r,colorOutput:n}={}){super("LuminancePass"),this.fullscreenMaterial=new AU(n,r),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1);let s=this.resolution=new bi(this,i,e);s.addEventListener("change",o=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(i,e,t,r,n){let s=this.fullscreenMaterial;s.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){let t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}initialize(i,e,t){t!==void 0&&t!==qt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},rz=class extends ys{constructor(i,e){super("MaskPass",i,e),this.needsSwap=!1,this.clearPass=new Qv(!1,!1,!0),this.inverse=!1}get inverted(){return this.inverse}set inverted(i){this.inverse=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(i){this.inverted=i}render(i,e,t,r,n){let s=i.getContext(),o=i.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,h=this.inverted?0:1,u=1-h;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,h,4294967295),o.stencil.setClear(u),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(i,null):(c.render(i,e),c.render(i,t))),this.renderToScreen?(i.setRenderTarget(null),i.render(a,l)):(i.setRenderTarget(e),i.render(a,l),i.setRenderTarget(t),i.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var yo=class extends ys{constructor(i,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=i,this.inputBufferUniform=null,this.setInput(e)}setInput(i){if(this.inputBufferUniform=null,this.fullscreenMaterial!==null){let e=this.fullscreenMaterial.uniforms;e!==void 0&&e[i]!==void 0&&(this.inputBufferUniform=e[i])}}render(i,e,t,r,n){this.inputBufferUniform!==null&&e!==null&&(this.inputBufferUniform.value=e.texture),i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}initialize(i,e,t){t!==void 0&&t!==qt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Hv=1/1e3,nz=1e3,iz=class{constructor(){this.previousTime=0,this.currentTime=0,this.delta=0,this.fixedDelta=1e3/60,this.elapsed=0,this.timescale=1,this.fixedDeltaEnabled=!1,this.autoReset=!1}setFixedDeltaEnabled(i){return this.fixedDeltaEnabled=i,this}isAutoResetEnabled(i){return this.autoReset}setAutoResetEnabled(i){return typeof document<"u"&&document.hidden!==void 0&&(i?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this.autoReset=i),this}getDelta(){return this.delta*Hv}getFixedDelta(){return this.fixedDelta*Hv}setFixedDelta(i){return this.fixedDelta=i*nz,this}getElapsed(){return this.elapsed*Hv}getTimescale(){return this.timescale}setTimescale(i){return this.timescale=i,this}update(i){return this.fixedDeltaEnabled?this.delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=i!==void 0?i:performance.now(),this.delta=this.currentTime-this.previousTime),this.delta*=this.timescale,this.elapsed+=this.delta,this}reset(){return this.delta=0,this.elapsed=0,this.currentTime=performance.now(),this}handleEvent(i){document.hidden||(this.currentTime=performance.now())}dispose(){this.setAutoResetEnabled(!1)}},IA=class{constructor(i=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:r=0,frameBufferType:n}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,n,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Xv,this.depthTexture=null,this.passes=[],this.timer=new iz,this.autoRenderToScreen=!0,this.setRenderer(i)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(i){let e=this.inputBuffer,t=this.multisampling;t>0&&i>0?(this.inputBuffer.samples=i,this.outputBuffer.samples=i,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==i&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,i),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(i){if(this.renderer=i,i!==null){let e=i.getSize(new B),t=i.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===qt&&i.outputEncoding===je&&(this.inputBuffer.texture.encoding=je,this.outputBuffer.texture.encoding=je,this.inputBuffer.dispose(),this.outputBuffer.dispose()),i.autoClear=!1,this.setSize(e.width,e.height);for(let n of this.passes)n.initialize(i,t,r)}}replaceRenderer(i,e=!0){let t=this.renderer,r=t.domElement.parentNode;return this.setRenderer(i),e&&r!==null&&(r.removeChild(t.domElement),r.appendChild(i.domElement)),t}createDepthTexture(){let i=this.depthTexture=new ai;return this.inputBuffer.depthTexture=i,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(i.format=Ns,i.type=Ls):i.type=La,i}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let i of this.passes)i.setDepthTexture(null)}}createBuffer(i,e,t,r){let n=this.renderer,s=n===null?new B:n.getDrawingBufferSize(new B),o={minFilter:ct,magFilter:ct,stencilBuffer:e,depthBuffer:i,type:t},a;return r>0?(a=Number(Uo.replace(/\D+/g,""))<138?new Kf(s.width,s.height,o):new mt(s.width,s.height,o),a.ignoreDepthForMultisampleCopy=!1,a.samples=r):a=new mt(s.width,s.height,o),t===qt&&n!==null&&n.outputEncoding===je&&(a.texture.encoding=je),a.texture.name="EffectComposer.Buffer",a.texture.generateMipmaps=!1,a}addPass(i,e){let t=this.passes,r=this.renderer,n=r.getDrawingBufferSize(new B),s=r.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(i.setRenderer(r),i.setSize(n.width,n.height),i.initialize(r,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),i.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,i):t.push(i),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),i.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(i of t)i.setDepthTexture(a)}else i.setDepthTexture(this.depthTexture)}removePass(i){let e=this.passes,t=e.indexOf(i);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(i.getDepthTexture()===this.depthTexture&&i.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(i.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let i=this.passes;this.deleteDepthTexture(),i.length>0&&(this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!1),this.passes=[])}render(i){let e=this.renderer,t=this.copyPass,r=this.inputBuffer,n=this.outputBuffer,s=!1,o,a,l;i===void 0&&(i=this.timer.update().getDelta());for(let c of this.passes)c.enabled&&(c.render(e,r,n,i,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,r,n,i,s),a.setFunc(o.EQUAL,1,4294967295)),l=r,r=n,n=l),c instanceof rz?s=!0:c instanceof IU&&(s=!1))}setSize(i,e,t){let r=this.renderer;if(i===void 0||e===void 0){let s=r.getSize(new B);i=s.width,e=s.height}r.setSize(i,e,t);let n=r.getDrawingBufferSize(new B);this.inputBuffer.setSize(n.width,n.height),this.outputBuffer.setSize(n.width,n.height);for(let s of this.passes)s.setSize(n.width,n.height)}reset(){let i=this.timer.isAutoResetEnabled();this.dispose(),this.autoRenderToScreen=!0,this.timer.setAutoResetEnabled(i)}dispose(){for(let i of this.passes)i.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}};var Kv={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5};var sz=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
4183
4183
|
uniform mediump sampler2D map;
|
|
4184
4184
|
#else
|
|
4185
4185
|
uniform lowp sampler2D map;
|
|
4186
4186
|
#endif
|
|
4187
|
-
uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,RA=class extends Wi{constructor({blendFunction:i=vt.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:r=.5,intensity:n=1,width:s=bi.AUTO_SIZE,height:o=bi.AUTO_SIZE,kernelSize:a=Kv.LARGE}={}){super("BloomEffect",
|
|
4187
|
+
uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,RA=class extends Wi{constructor({blendFunction:i=vt.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:r=.5,intensity:n=1,width:s=bi.AUTO_SIZE,height:o=bi.AUTO_SIZE,kernelSize:a=Kv.LARGE}={}){super("BloomEffect",sz,{blendFunction:i,uniforms:new Map([["map",new Ce(null)],["intensity",new Ce(n)]])}),this.renderTarget=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.luminancePass=new tz({renderTarget:this.renderTarget,colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothingFactor=t,this.blurPass=new LA({resolutionScale:r,width:s,height:o,kernelSize:a});let l=this.blurPass.getResolution();l.addEventListener("change",c=>this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get dithering(){return this.blurPass.dithering}set dithering(i){this.blurPass.dithering=i}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(i){this.blurPass.kernelSize=i}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(i){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(i){this.uniforms.get("intensity").value=i}getIntensity(){return this.intensity}setIntensity(i){this.intensity=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}update(i,e,t){let r=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(i,e,r),this.blurPass.render(i,r,r)):this.blurPass.render(i,e,r)}setSize(i,e){let t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.luminancePass.resolution.copy(t)}initialize(i,e,t){this.blurPass.initialize(i,e,t),t!==void 0&&(this.renderTarget.texture.type=t,i.outputEncoding===je&&(this.renderTarget.texture.encoding=je))}};var oz="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",BA=class extends Wi{constructor({blendFunction:i=vt.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",oz,{blendFunction:i,uniforms:new Map([["brightness",new Ce(e)],["contrast",new Ce(t)]])})}get brightness(){return this.uniforms.get("brightness").value}set brightness(i){this.uniforms.get("brightness").value=i}getBrightness(i){return this.brightness}setBrightness(i){this.brightness=i}get contrast(){return this.uniforms.get("contrast").value}set contrast(i){this.uniforms.get("contrast").value=i}getContrast(i){return this.contrast}setContrast(i){this.contrast=i}},az="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",NA=class extends Wi{constructor(i=vt.NORMAL){super("ColorAverageEffect",az,{blendFunction:i})}};var lz="varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}",cz="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vUvR=uv+shift;vUvB=uv-shift;}",OA=class extends Wi{constructor({blendFunction:i=vt.NORMAL,offset:e=new B(.001,5e-4)}={}){super("ChromaticAberrationEffect",lz,{vertexShader:cz,blendFunction:i,attributes:Hi.CONVOLUTION,uniforms:new Map([["offset",new Ce(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(i){this.uniforms.get("offset").value=i}getOffset(){return this.offset}setOffset(i){this.offset=i}};var hz=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
4188
4188
|
uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;
|
|
4189
4189
|
#else
|
|
4190
4190
|
uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;
|
|
4191
4191
|
#endif
|
|
4192
|
-
uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,FA=class extends Wi{constructor(i,{blendFunction:e=vt.NORMAL,worldFocusDistance:t,worldFocusRange:r,focusDistance:n=0,focalLength:s=.1,focusRange:o=s,bokehScale:a=1,width:l=bi.AUTO_SIZE,height:c=bi.AUTO_SIZE}={}){super("DepthOfFieldEffect",
|
|
4192
|
+
uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,FA=class extends Wi{constructor(i,{blendFunction:e=vt.NORMAL,worldFocusDistance:t,worldFocusRange:r,focusDistance:n=0,focalLength:s=.1,focusRange:o=s,bokehScale:a=1,width:l=bi.AUTO_SIZE,height:c=bi.AUTO_SIZE}={}){super("DepthOfFieldEffect",hz,{blendFunction:e,attributes:Hi.DEPTH,uniforms:new Map([["nearColorBuffer",new Ce(null)],["farColorBuffer",new Ce(null)],["nearCoCBuffer",new Ce(null)],["scale",new Ce(1)]])}),this.camera=i,this.renderTarget=new mt(1,1,{minFilter:ct,magFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new yo(new dU(i));let h=this.cocMaterial;h.focusDistance=n,h.focusRange=o,t!==void 0&&(h.worldFocusDistance=t),r!==void 0&&(h.worldFocusRange=r),this.blurPass=new LA({kernelSize:Kv.MEDIUM,width:l,height:c});let u=this.blurPass.getResolution();u.addEventListener("change",d=>this.setSize(u.getBaseWidth(),u.getBaseHeight())),this.maskPass=new yo(new _U(this.renderTargetCoC.texture));let f=this.maskPass.fullscreenMaterial;f.maskFunction=DA.MULTIPLY,f.colorChannel=PA.GREEN,this.bokehNearBasePass=new yo(new Xp(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new yo(new Xp(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new yo(new Xp(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new yo(new Xp(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null,this.bokehScale=a}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}get resolution(){return this.blurPass.getResolution()}getResolution(){return this.blurPass.getResolution()}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(i){let e=[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];for(let t of e)t.fullscreenMaterial.setScale(i);this.maskPass.fullscreenMaterial.setStrength(i),this.uniforms.get("scale").value=i}getBokehScale(){return this.bokehScale}setBokehScale(i){this.bokehScale=i}getTarget(){return this.target}setTarget(i){this.target=i}calculateFocusDistance(i){let e=this.camera,t=e.position.distanceTo(i);return jv(-t,e.near,e.far)}setDepthTexture(i,e=Ir){this.circleOfConfusionMaterial.depthBuffer=i,this.circleOfConfusionMaterial.depthPacking=e}update(i,e,t){let r=this.renderTarget,n=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked;if(this.target!==null){let a=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.focusDistance=a}this.cocPass.render(i,null,n),this.blurPass.render(i,n,s),this.maskPass.render(i,e,o),this.bokehFarBasePass.render(i,o,r),this.bokehFarFillPass.render(i,r,this.renderTargetFar),this.bokehNearBasePass.render(i,e,r),this.bokehNearFillPass.render(i,r,this.renderTargetNear)}setSize(i,e){let t=this.resolution;t.setBaseSize(i,e);let r=t.width,n=t.height,s=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];s.push(this.renderTargetCoC,this.renderTargetMasked),s.forEach(a=>a.setSize(i,e)),s=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],s.forEach(a=>a.setSize(r,n)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.fullscreenMaterial.setSize(r,n))}initialize(i,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(n=>n.initialize(i,e,t)),this.blurPass.initialize(i,e,qt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t,i.outputEncoding===je&&(this.renderTarget.texture.encoding=je,this.renderTargetNear.texture.encoding=je,this.renderTargetFar.texture.encoding=je,this.renderTargetMasked.texture.encoding=je))}};var bae=new M,wae=new Ae;var uz="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",UA=class extends Wi{constructor({blendFunction:i=vt.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",uz,{blendFunction:i,uniforms:new Map([["hue",new Ce(new M)],["saturation",new Ce(t)]])}),this.hue=e}get saturation(){return this.uniforms.get("saturation").value}set saturation(i){this.uniforms.get("saturation").value=i}getSaturation(){return this.saturation}setSaturation(i){this.saturation=i}get hue(){let i=this.uniforms.get("hue").value;return Math.acos((i.x*3-1)/2)}set hue(i){let e=Math.sin(i),t=Math.cos(i);this.uniforms.get("hue").value.set((2*t+1)/3,(-Math.sqrt(3)*e-t+1)/3,(Math.sqrt(3)*e-t+1)/3)}getHue(){return this.hue}setHue(i){this.hue=i}};var Aae=new be;var fz=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time));
|
|
4193
4193
|
#ifdef PREMULTIPLY
|
|
4194
4194
|
outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a);
|
|
4195
4195
|
#else
|
|
4196
4196
|
outputColor=vec4(noise,inputColor.a);
|
|
4197
4197
|
#endif
|
|
4198
|
-
}`,zA=class extends Wi{constructor({blendFunction:i=vt.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",uz,{blendFunction:i}),this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(i){this.premultiply!==i&&(i?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(i){this.premultiply=i}};var fz="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",GA=class extends Wi{constructor(i=30){super("PixelationEffect",fz,{uniforms:new Map([["active",new Ce(!1)],["d",new Ce(new B)]])}),this.resolution=new B,this.d=0,this.granularity=i}get granularity(){return this.d}set granularity(i){let e=Math.floor(i);e%2>0&&(e+=1),this.d=e,this.uniforms.get("active").value=e>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(i){this.granularity=i}setSize(i,e){this.resolution.set(i,e),this.uniforms.get("d").value.setScalar(this.d).divide(this.resolution)}};var Eae=Math.PI*.5,Cae=new M,Pae=new M;var EA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",CA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw7cqimr+zFM/ZLnZF64cgL8BYD+AWwB8x/dlWuWagHiYL984AJ/0RWBy1AE4AizyM1yxYAcTigW55xMbAkxEiwEdkJ/ZCQxPAiOHgBECc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xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",dz="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",pz="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",ta={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},kA=class extends Wi{constructor({preset:i=ta.MEDIUM,edgeDetectionMode:e=Jp.COLOR,predicationMode:t=Yv.DISABLED}={}){super("SMAAEffect",dz,{vertexShader:pz,blendFunction:vt.NORMAL,attributes:Hi.CONVOLUTION|Hi.DEPTH,uniforms:new Map([["weightMap",new Ce(null)]])});let r,n;arguments.length>1&&(r=arguments[0],n=arguments[1],arguments.length>2&&(i=arguments[2]),arguments.length>3&&(e=arguments[3])),this.renderTargetEdges=new mt(1,1,{minFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new Qv(!0,!1,!1),this.clearPass.overrideClearColor=new be(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new yo(new xU),this.edgeDetectionMaterial.edgeDetectionMode=e,this.edgeDetectionMaterial.predicationMode=t,this.weightsPass=new yo(new CU);let s=new No;s.onLoad=()=>{let o=new Pt(r);o.name="SMAA.Search",o.magFilter=hr,o.minFilter=hr,o.generateMipmaps=!1,o.needsUpdate=!0,o.flipY=!0,this.weightsMaterial.searchTexture=o;let a=new Pt(n);a.name="SMAA.Area",a.magFilter=ct,a.minFilter=ct,a.generateMipmaps=!1,a.needsUpdate=!0,a.flipY=!1,this.weightsMaterial.areaTexture=a,this.dispatchEvent({type:"load"})},s.itemStart("search"),s.itemStart("area"),r!==void 0&&n!==void 0?(s.itemEnd("search"),s.itemEnd("area")):typeof Image<"u"&&(r=new Image,n=new Image,r.addEventListener("load",()=>s.itemEnd("search")),n.addEventListener("load",()=>s.itemEnd("area")),r.src=EA,n.src=CA),this.applyPreset(i)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(i){this.edgeDetectionMaterial.edgeDetectionThreshold=i}setOrthogonalSearchSteps(i){this.weightsMaterial.orthogonalSearchSteps=i}applyPreset(i){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(i){case ta.LOW:e.edgeDetectionThreshold=.15,t.orthogonalSearchSteps=4,t.diagonalDetection=!1,t.cornerDetection=!1;break;case ta.MEDIUM:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=8,t.diagonalDetection=!1,t.cornerDetection=!1;break;case ta.HIGH:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=16,t.diagonalSearchSteps=8,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break;case ta.ULTRA:e.edgeDetectionThreshold=.05,t.orthogonalSearchSteps=32,t.diagonalSearchSteps=16,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break}}setDepthTexture(i,e=Ir){this.edgeDetectionMaterial.depthBuffer=i,this.edgeDetectionMaterial.depthPacking=e}update(i,e,t){this.clearPass.render(i,this.renderTargetEdges),this.edgeDetectionPass.render(i,e,this.renderTargetEdges),this.weightsPass.render(i,this.renderTargetEdges,this.renderTargetWeights)}setSize(i,e){this.edgeDetectionMaterial.setSize(i,e),this.weightsMaterial.setSize(i,e),this.renderTargetEdges.setSize(i,e),this.renderTargetWeights.setSize(i,e)}dispose(){let{searchTexture:i,areaTexture:e}=this.weightsMaterial;i!==null&&e!==null&&(i.dispose(),e.dispose()),super.dispose()}static get searchImageDataURL(){return EA}static get areaImageDataURL(){return CA}};var mz=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;
|
|
4198
|
+
}`,zA=class extends Wi{constructor({blendFunction:i=vt.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",fz,{blendFunction:i}),this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(i){this.premultiply!==i&&(i?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(i){this.premultiply=i}};var dz="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",GA=class extends Wi{constructor(i=30){super("PixelationEffect",dz,{uniforms:new Map([["active",new Ce(!1)],["d",new Ce(new B)]])}),this.resolution=new B,this.d=0,this.granularity=i}get granularity(){return this.d}set granularity(i){let e=Math.floor(i);e%2>0&&(e+=1),this.d=e,this.uniforms.get("active").value=e>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(i){this.granularity=i}setSize(i,e){this.resolution.set(i,e),this.uniforms.get("d").value.setScalar(this.d).divide(this.resolution)}};var Eae=Math.PI*.5,Cae=new M,Pae=new M;var EA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",CA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+P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vPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",pz="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",mz="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",ta={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},kA=class extends Wi{constructor({preset:i=ta.MEDIUM,edgeDetectionMode:e=Jp.COLOR,predicationMode:t=Yv.DISABLED}={}){super("SMAAEffect",pz,{vertexShader:mz,blendFunction:vt.NORMAL,attributes:Hi.CONVOLUTION|Hi.DEPTH,uniforms:new Map([["weightMap",new Ce(null)]])});let r,n;arguments.length>1&&(r=arguments[0],n=arguments[1],arguments.length>2&&(i=arguments[2]),arguments.length>3&&(e=arguments[3])),this.renderTargetEdges=new mt(1,1,{minFilter:ct,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new Qv(!0,!1,!1),this.clearPass.overrideClearColor=new be(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new yo(new bU),this.edgeDetectionMaterial.edgeDetectionMode=e,this.edgeDetectionMaterial.predicationMode=t,this.weightsPass=new yo(new PU);let s=new No;s.onLoad=()=>{let o=new Pt(r);o.name="SMAA.Search",o.magFilter=hr,o.minFilter=hr,o.generateMipmaps=!1,o.needsUpdate=!0,o.flipY=!0,this.weightsMaterial.searchTexture=o;let a=new Pt(n);a.name="SMAA.Area",a.magFilter=ct,a.minFilter=ct,a.generateMipmaps=!1,a.needsUpdate=!0,a.flipY=!1,this.weightsMaterial.areaTexture=a,this.dispatchEvent({type:"load"})},s.itemStart("search"),s.itemStart("area"),r!==void 0&&n!==void 0?(s.itemEnd("search"),s.itemEnd("area")):typeof Image<"u"&&(r=new Image,n=new Image,r.addEventListener("load",()=>s.itemEnd("search")),n.addEventListener("load",()=>s.itemEnd("area")),r.src=EA,n.src=CA),this.applyPreset(i)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(i){this.edgeDetectionMaterial.edgeDetectionThreshold=i}setOrthogonalSearchSteps(i){this.weightsMaterial.orthogonalSearchSteps=i}applyPreset(i){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(i){case ta.LOW:e.edgeDetectionThreshold=.15,t.orthogonalSearchSteps=4,t.diagonalDetection=!1,t.cornerDetection=!1;break;case ta.MEDIUM:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=8,t.diagonalDetection=!1,t.cornerDetection=!1;break;case ta.HIGH:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=16,t.diagonalSearchSteps=8,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break;case ta.ULTRA:e.edgeDetectionThreshold=.05,t.orthogonalSearchSteps=32,t.diagonalSearchSteps=16,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break}}setDepthTexture(i,e=Ir){this.edgeDetectionMaterial.depthBuffer=i,this.edgeDetectionMaterial.depthPacking=e}update(i,e,t){this.clearPass.render(i,this.renderTargetEdges),this.edgeDetectionPass.render(i,e,this.renderTargetEdges),this.weightsPass.render(i,this.renderTargetEdges,this.renderTargetWeights)}setSize(i,e){this.edgeDetectionMaterial.setSize(i,e),this.weightsMaterial.setSize(i,e),this.renderTargetEdges.setSize(i,e),this.renderTargetWeights.setSize(i,e)}dispose(){let{searchTexture:i,areaTexture:e}=this.weightsMaterial;i!==null&&e!==null&&(i.dispose(),e.dispose()),super.dispose()}static get searchImageDataURL(){return EA}static get areaImageDataURL(){return CA}};var gz=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;
|
|
4199
4199
|
#if VIGNETTE_TECHNIQUE == 0
|
|
4200
4200
|
float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));
|
|
4201
4201
|
#else
|
|
4202
4202
|
vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));
|
|
4203
4203
|
#endif
|
|
4204
|
-
outputColor=vec4(color,inputColor.a);}`,Qp={DEFAULT:0,ESKIL:1},VA=class extends Wi{constructor({blendFunction:i=vt.NORMAL,technique:e=Qp.DEFAULT,eskil:t=!1,offset:r=.5,darkness:n=.5}={}){super("VignetteEffect",mz,{blendFunction:i,defines:new Map([["VIGNETTE_TECHNIQUE",e.toFixed(0)]]),uniforms:new Map([["offset",new Ce(r)],["darkness",new Ce(n)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(i){this.technique!==i&&(this.defines.set("VIGNETTE_TECHNIQUE",i.toFixed(0)),this.setChanged())}get eskil(){return this.technique===Qp.ESKIL}set eskil(i){this.technique=i?Qp.ESKIL:Qp.DEFAULT}getTechnique(){return this.technique}setTechnique(i){this.technique=i}get offset(){return this.uniforms.get("offset").value}set offset(i){this.uniforms.get("offset").value=i}getOffset(){return this.offset}setOffset(i){this.offset=i}get darkness(){return this.uniforms.get("darkness").value}set darkness(i){this.uniforms.get("darkness").value=i}getDarkness(){return this.darkness}setDarkness(i){this.darkness=i}},Iae=[new Float32Array(3),new Float32Array(3)],Rae=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Bae=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var Nae=[new Float32Array(2),new Float32Array(2)];var Oae=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Fae=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],Uae=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],zae=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Gae=new Map([[$r(0,0,0,0),new Float32Array([0,0,0,0])],[$r(0,0,0,1),new Float32Array([0,0,0,1])],[$r(0,0,1,0),new Float32Array([0,0,1,0])],[$r(0,0,1,1),new Float32Array([0,0,1,1])],[$r(0,1,0,0),new Float32Array([0,1,0,0])],[$r(0,1,0,1),new Float32Array([0,1,0,1])],[$r(0,1,1,0),new Float32Array([0,1,1,0])],[$r(0,1,1,1),new Float32Array([0,1,1,1])],[$r(1,0,0,0),new Float32Array([1,0,0,0])],[$r(1,0,0,1),new Float32Array([1,0,0,1])],[$r(1,0,1,0),new Float32Array([1,0,1,0])],[$r(1,0,1,1),new Float32Array([1,0,1,1])],[$r(1,1,0,0),new Float32Array([1,1,0,0])],[$r(1,1,0,1),new Float32Array([1,1,0,1])],[$r(1,1,1,0),new Float32Array([1,1,1,0])],[$r(1,1,1,1),new Float32Array([1,1,1,1])]]);function Wv(i,e,t){return i+(e-i)*t}function $r(i,e,t,r){let n=Wv(i,e,.75),s=Wv(t,r,1-.25);return Wv(n,s,1-.125)}var gr=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(r){this.effect.blendMode.opacity.value=r},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(r){this.effect.blendMode.setBlendFunction(Number(r))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=vt.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=se({},this),r=Object.getPrototypeOf(this),n=Object.getOwnPropertyNames(r);for(let s of n){let o=Object.getOwnPropertyDescriptor(r,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var lc=class extends gr{constructor(){super(RA),this.blendFunction=vt.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var cc=class extends gr{constructor(){super(BA)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var hc=class extends gr{constructor(){super(OA),this.effect.offset=new B(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var uc=class extends gr{constructor(){super(NA)}};var fc=class extends gr{constructor(){super(UA);this._hue=0}set hue(t){this._hue=t,this.effect.setHue(t)}get hue(){return this._hue}set saturation(t){this.effect.uniforms.get("saturation").value=t}get saturation(){return this.effect.uniforms.get("saturation").value}};var dc=class extends gr{constructor(){super(zA),this.blendFunction=vt.OVERLAY}};var pc=class extends gr{constructor(){super(VA)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var mc=class extends gr{constructor(e){super(FA,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var gc=class extends gr{constructor(){super(GA)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function HA(i,e){return e&&e.enabled&&i.push(e.effect),i}var xu=class extends Yt{constructor(){super();this._scene=new on;this._camera=new Bn;this.effects=new Map;this.loadingManager=new No;this.renderPass=new Jv;this._renderToScreen=!0;this._hasSmaa=!1;this.clock=new Wf,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new lc),this.effects.set("chromaticAberration",new hc),this.effects.set("vignette",new pc),this.effects.set("noise",new dc),this.effects.set("colorAverage",new uc),this.effects.set("hueSaturation",new fc),this.effects.set("brightnessContrast",new cc),this.effects.set("depthOfField",new mc),this.effects.set("pixelation",new gc)}get scene(){return this._scene}set scene(t){this._scene=t}get camera(){return this._camera}set camera(t){this._camera=t}_initSmaa(){if(!this.effectComposer)return;let t=this.effectComposer.passes.length,r=new kA({preset:ta.ULTRA,edgeDetectionMode:Jp.COLOR}),n=()=>{r.removeEventListener("load",n),this.dispatchEvent({type:"smaaloaded"})};r.addEventListener("load",n),r.edgeDetectionMaterial.setPredicationMode(Yv.DEPTH),r.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),r.edgeDetectionMaterial.setPredicationThreshold(.002),r.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Kp(this.camera,r),t),this._hasSmaa=!0}_initPasses(){if(!this.effectComposer||!this.renderer)return;let t;if(this.effectComposer.removeAllPasses(),this._hasSmaa=!1,this.renderPass=new Jv(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let r=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(HA,[]),n=[this.effects.get("pixelation")].reduce(HA,[]);n.length>0&&this.effectComposer.addPass(new Kp(this.camera,...n)),this.effectComposer.addPass(new Kp(this.camera,...r))}else this.effectComposer.addPass(this.renderPass),(ZS||Ho)&&this._initSmaa();if(t)return t}reinit(){if(!this.renderer)return Promise.all([]);this.effectComposer=new IA(this.renderer),this._initPasses()}init({renderer:t,camera:r,scene:n}){this.renderer=t,this.scene=n,this.camera=r,this._initCopyPass(),this.reinit()}_initCopyPass(){if(this._savePass)return;let t=new B;this.renderer.getDrawingBufferSize(t),this._rt=new mt(t.x,t.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:Ia,wrapT:Ia}),this._rt.samples=this.renderer.capabilities.isWebGL2?4:0,this._savePass=new Xv(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(t){var n,s;let r=this.effectComposer;!r||(t===!0?((n=this.renderer)!=null&&n.capabilities.isWebGL2&&(r.multisampling=0),r.removePass(this._savePass),r.passes[r.passes.length-1].renderToScreen=!0,r.autoRenderToScreen=!0):(((s=this.renderer)==null?void 0:s.capabilities.isWebGL2)&&!this._hasSmaa&&(r.multisampling=4),r.autoRenderToScreen=!1,r.passes[r.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,this.enabled||(this._savePass.needsDepthTexture=!0),r.addPass(this._savePass)),this._renderToScreen=t)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(t){t&&(Object.keys(t).forEach(r=>{let n=t[r],s=this.effects.get(r);Object.keys(n).forEach(o=>{s[o]=n[o]})}),this.enabled=t.enabled)}toJSON(){let t={};return this.effects.forEach((r,n)=>{t[n]=r.toJSON()},t),se({enabled:this.enabled},t)}render(){var t;(t=this.effectComposer)==null||t.render(this.clock.getDelta())}setScissor(t,r,n,s){if(!this.effectComposer||!this.renderer)return;t instanceof Je?(this.effectComposer.inputBuffer.scissor.set(t.x,t.y,t.z,t.w),this.effectComposer.outputBuffer.scissor.set(t.x,t.y,t.z,t.w)):(this.effectComposer.inputBuffer.scissor.set(t,r,n,s),this.effectComposer.outputBuffer.scissor.set(t,r,n,s));let o=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(o),this.effectComposer.outputBuffer.scissor.multiplyScalar(o),this.renderer.setScissor(t,r,n,s)}setScissorTest(t){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=t,this.effectComposer.outputBuffer.scissorTest=t,this.renderer.setScissorTest(t))}setViewport(t,r,n,s){!this.effectComposer||(t instanceof Je?(this.effectComposer.inputBuffer.viewport.copy(t),this.effectComposer.outputBuffer.viewport.copy(t)):(this.effectComposer.inputBuffer.viewport.set(t,r,n,s),this.effectComposer.outputBuffer.viewport.set(t,r,n,s)))}resize(t,r,n){var s,o;if((s=this.effectComposer)==null||s.setSize(t,r,n),this._rt){let a=((o=this.renderer)==null?void 0:o.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(t*a,r*a)}}dispose(){var t;this._listeners=void 0,(t=this.effectComposer)==null||t.dispose()}};var Zp=class extends yu{constructor(t,r){super(t,r);this.postprocessing=new xu;this.initPostprocessing(t.postprocessing)}resetAfterClear(t,r){super.resetAfterClear(t,r),this.initPostprocessing(t.postprocessing)}initPostprocessing(t){let s=t,{enabled:r}=s,n=Tx(s,["enabled"]);for(let o of Object.entries(n)){let a=o[1],l=this.postprocessing.effects.get(o[0]);if(l){l.enabled=a.enabled;for(let[c,h]of Object.entries(a))l[c]=h}}this.postprocessing.enabled=r,this.postprocessing.reinit()}dispose(){super.dispose(),this.postprocessing.dispose()}switchActiveCamera(t){super.switchActiveCamera(t),this.postprocessing&&(this.postprocessing.camera=t)}};var Zv=new WeakMap,$p=class extends cn{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,n){let s=new as(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let s={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let r=JSON.stringify(t);if(Zv.has(e)){let l=Zv.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(n=l,new Promise((c,h)=>{n._callbacks[s]={resolve:c,reject:h},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{n&&s&&this._releaseTask(n,s)}),Zv.set(e,{key:r,promise:a}),a}_createGeometry(e){let t=new De;e.index&&t.setIndex(new Ve(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let n=e.attributes[r],s=n.name,o=n.array,a=n.itemSize;t.setAttribute(s,new Ve(o,a))}return t}_loadLibrary(e,t){let r=new as(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((n,s)=>{r.load(e,n,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(r=>{let n=r[0];e||(this.decoderConfig.wasmBinary=r[1]);let s=yz.toString(),o=["/* draco decoder */",n,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
4205
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(s){let o=s.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,s){return n._taskLoad>s._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}};function yz(){let i,e;onmessage=function(o){let a=o.data;switch(a.type){case"init":i=a.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":let l=a.buffer,c=a.taskConfig;e.then(h=>{let u=h.draco,f=new u.Decoder,d=new u.DecoderBuffer;d.Init(new Int8Array(l),l.byteLength);try{let p=t(u,f,d,c),m=p.attributes.map(g=>g.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{u.destroy(d),u.destroy(f)}});break}};function t(o,a,l,c){let h=c.attributeIDs,u=c.attributeTypes,f,d,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)f=new o.Mesh,d=a.DecodeBufferToMesh(l,f);else if(p===o.POINT_CLOUD)f=new o.PointCloud,d=a.DecodeBufferToPointCloud(l,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());let m={index:null,attributes:[]};for(let g in h){let v=self[u[g]],y,w;if(c.useUniqueIDs)w=h[g],y=a.GetAttributeByUniqueId(f,w);else{if(w=a.GetAttributeId(f,o[h[g]]),w===-1)continue;y=a.GetAttribute(f,w)}m.attributes.push(n(o,a,f,g,v,y))}return p===o.TRIANGULAR_MESH&&(m.index=r(o,a,f)),o.destroy(f),m}function r(o,a,l){let h=l.num_faces()*3,u=h*4,f=o._malloc(u);a.GetTrianglesUInt32Array(l,u,f);let d=new Uint32Array(o.HEAPF32.buffer,f,h).slice();return o._free(f),{array:d,itemSize:1}}function n(o,a,l,c,h,u){let f=u.num_components(),p=l.num_points()*f,m=p*h.BYTES_PER_ELEMENT,g=s(o,h),v=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,u,g,m,v);let y=new h(o.HEAPF32.buffer,v,p).slice();return o._free(v),{name:c,array:y,itemSize:f}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var vo;function vz(){return vo||(vo=new $p,vo.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload()),vo.decoderPending}async function xz(i){if(vo){let e={attributeIDs:vo.defaultAttributeIDs,attributeTypes:vo.defaultAttributeTypes,useUniqueIDs:!1},t;try{t=await vo.decodeGeometry(new Int8Array(i).buffer,e)}catch(r){console.error(r)}if(t)return{index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map(([r,n])=>({name:r,itemSize:n.itemSize,array:n.array}))}}return null}async function WA(i){let[e,t]=Ay(ep.deserialize(new Uint8Array(i))),r=[];e.scene.objects.traverse((n,s)=>{s.type==="Mesh"&&s.geometry.type==="NonParametricGeometry"&&s.geometry.data.draco!==void 0&&r.push(s)}),r.length&&await vz();for(let n of r){let s=await xz(_y(n.geometry.data.draco));if(s){s.index&&(n.geometry.data.index={array:s.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let o={};s.attributes.forEach(({name:a,array:l,itemSize:c})=>{o[a]={array:l,itemSize:c,type:"Float32Array",normalized:!1}}),n.geometry.data.attributes=o,n.geometry.data.draco=void 0}}return t.result().data}var JA={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},rx={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},bz=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],tm={CSS:{},springs:{}};function ji(i,e,t){return Math.min(Math.max(i,e),t)}function bu(i,e){return i.indexOf(e)>-1}function $v(i,e){return i.apply(null,e)}var Xe={arr:function(i){return Array.isArray(i)},obj:function(i){return bu(Object.prototype.toString.call(i),"Object")},pth:function(i){return Xe.obj(i)&&i.hasOwnProperty("totalLength")},svg:function(i){return i instanceof SVGElement},inp:function(i){return i instanceof HTMLInputElement},dom:function(i){return!("isNode"in i)&&(i.nodeType||Xe.svg(i))},str:function(i){return typeof i=="string"},fnc:function(i){return typeof i=="function"},und:function(i){return typeof i>"u"},hex:function(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)},rgb:function(i){return/^rgb/.test(i)},hsl:function(i){return/^hsl/.test(i)},col:function(i){return Xe.hex(i)||Xe.rgb(i)||Xe.hsl(i)},key:function(i){return!JA.hasOwnProperty(i)&&!rx.hasOwnProperty(i)&&i!=="targets"&&i!=="keyframes"}};function KA(i){var e=/\(([^)]+)\)/.exec(i);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function ZA(i,e){var t=KA(i),r=ji(Xe.und(t[0])?1:t[0],.1,100),n=ji(Xe.und(t[1])?100:t[1],.1,100),s=ji(Xe.und(t[2])?10:t[2],.1,100),o=ji(Xe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),c=l<1?a*Math.sqrt(1-l*l):0,h=1,u=l<1?(l*a+-o)/c:-o+a;function f(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(h*Math.cos(c*m)+u*Math.sin(c*m)):m=(h+u*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function d(){var p=tm.springs[i];if(p)return p;for(var m=1/6,g=0,v=0;;)if(g+=m,f(g)===1){if(v++,v>=16)break}else v=0;var y=g*m*1e3;return tm.springs[i]=y,y}return e?f:d}function wz(i){return i===void 0&&(i=10),function(e){return Math.ceil(ji(e,1e-6,1)*i)*(1/i)}}var Sz=function(){var i=11,e=1/(i-1);function t(h,u){return 1-3*u+3*h}function r(h,u){return 3*u-6*h}function n(h){return 3*h}function s(h,u,f){return((t(u,f)*h+r(u,f))*h+n(u))*h}function o(h,u,f){return 3*t(u,f)*h*h+2*r(u,f)*h+n(u)}function a(h,u,f,d,p){var m,g,v=0;do g=u+(f-u)/2,m=s(g,d,p)-h,m>0?f=g:u=g;while(Math.abs(m)>1e-7&&++v<10);return g}function l(h,u,f,d){for(var p=0;p<4;++p){var m=o(u,f,d);if(m===0)return u;var g=s(u,f,d)-h;u-=g/m}return u}function c(h,u,f,d){if(!(0<=h&&h<=1&&0<=f&&f<=1))return;var p=new Float32Array(i);if(h!==u||f!==d)for(var m=0;m<i;++m)p[m]=s(m*e,h,f);function g(v){for(var y=0,w=1,b=i-1;w!==b&&p[w]<=v;++w)y+=e;--w;var S=(v-p[w])/(p[w+1]-p[w]),T=y+S*e,A=o(T,h,f);return A>=.001?l(v,T,h,f):A===0?T:a(v,y,y+e,h,f)}return function(v){return h===u&&f===d||v===0||v===1?v:s(g(v),u,d)}}return c}(),$A=function(){var i={linear:function(){return function(r){return r}}},e={Sine:function(){return function(r){return 1-Math.cos(r*Math.PI/2)}},Circ:function(){return function(r){return 1-Math.sqrt(1-r*r)}},Back:function(){return function(r){return r*r*(3*r-2)}},Bounce:function(){return function(r){for(var n,s=4;r<((n=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((n*3-2)/22-r,2)}},Elastic:function(r,n){r===void 0&&(r=1),n===void 0&&(n=.5);var s=ji(r,1,10),o=ji(n,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(r,n){e[r]=function(){return function(s){return Math.pow(s,n+2)}}}),Object.keys(e).forEach(function(r){var n=e[r];i["easeIn"+r]=n,i["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},i["easeInOut"+r]=function(s,o){return function(a){return a<.5?n(s,o)(a*2)/2:1-n(s,o)(a*-2+2)/2}}}),i}();function nx(i,e){if(Xe.fnc(i))return i;var t=i.split("(")[0],r=$A[t],n=KA(i);switch(t){case"spring":return ZA(i,e);case"cubicBezier":return $v(Sz,n);case"steps":return $v(wz,n);default:return $v(r,n)}}function eT(i){try{var e=document.querySelectorAll(i);return e}catch{return}}function rm(i,e){for(var t=i.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s<t;s++)if(s in i){var o=i[s];e.call(r,o,s,i)&&n.push(o)}return n}function nm(i){return i.reduce(function(e,t){return e.concat(Xe.arr(t)?nm(t):t)},[])}function jA(i){return Xe.arr(i)?i:(Xe.str(i)&&(i=eT(i)||i),i instanceof NodeList||i instanceof HTMLCollection?[].slice.call(i):[i])}function ix(i,e){return i.some(function(t){return t===e})}function sx(i){var e={};for(var t in i)e[t]=i[t];return e}function ex(i,e){var t=sx(i);for(var r in i)t[r]=e.hasOwnProperty(r)?e[r]:i[r];return t}function im(i,e){var t=sx(i);for(var r in e)t[r]=Xe.und(i[r])?e[r]:i[r];return t}function Mz(i){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(i);return e?"rgba("+e[1]+",1)":i}function Az(i){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,t=i.replace(e,function(a,l,c,h){return l+l+c+c+h+h}),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),n=parseInt(r[1],16),s=parseInt(r[2],16),o=parseInt(r[3],16);return"rgba("+n+","+s+","+o+",1)"}function Tz(i){var e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(i)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(i),t=parseInt(e[1],10)/360,r=parseInt(e[2],10)/100,n=parseInt(e[3],10)/100,s=e[4]||1;function o(f,d,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?f+(d-f)*6*p:p<1/2?d:p<2/3?f+(d-f)*(2/3-p)*6:f}var a,l,c;if(r==0)a=l=c=n;else{var h=n<.5?n*(1+r):n+r-n*r,u=2*n-h;a=o(u,h,t+1/3),l=o(u,h,t),c=o(u,h,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function _z(i){if(Xe.rgb(i))return Mz(i);if(Xe.hex(i))return Az(i);if(Xe.hsl(i))return Tz(i)}function vs(i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(i);if(e)return e[1]}function Ez(i){if(bu(i,"translate")||i==="perspective")return"px";if(bu(i,"rotate")||bu(i,"skew"))return"deg"}function tx(i,e){return Xe.fnc(i)?i(e.target,e.id,e.total):i}function qi(i,e){return i.getAttribute(e)}function ox(i,e,t){var r=vs(e);if(ix([t,"deg","rad","turn"],r))return e;var n=tm.CSS[e+t];if(!Xe.und(n))return n;var s=100,o=document.createElement(i.tagName),a=i.parentNode&&i.parentNode!==document?i.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return tm.CSS[e+t]=c,c}function tT(i,e,t){if(e in i.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=i.style[e]||getComputedStyle(i).getPropertyValue(r)||"0";return t?ox(i,n,t):n}}function ax(i,e){if(Xe.dom(i)&&!Xe.inp(i)&&(qi(i,e)||Xe.svg(i)&&i[e]))return"attribute";if(Xe.dom(i)&&ix(bz,e))return"transform";if(Xe.dom(i)&&e!=="transform"&&tT(i,e))return"css";if(i[e]!=null)return"object"}function rT(i){if(!!Xe.dom(i)){for(var e=i.style.transform||"",t=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=t.exec(e);)r.set(n[1],n[2]);return r}}function Cz(i,e,t,r){var n=bu(e,"scale")?1:0+Ez(e),s=rT(i).get(e)||n;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),r?ox(i,s,r):s}function lx(i,e,t,r){switch(ax(i,e)){case"transform":return Cz(i,e,r,t);case"css":return tT(i,e,t);case"attribute":return qi(i,e);default:return i[e]||0}}function cx(i,e){var t=/^(\*=|\+=|-=)/.exec(i);if(!t)return i;var r=vs(i)||0,n=parseFloat(e),s=parseFloat(i.replace(t[0],""));switch(t[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function nT(i,e){if(Xe.col(i))return _z(i);if(/\s/g.test(i))return i;var t=vs(i),r=t?i.substr(0,i.length-t.length):i;return e?r+e:r}function hx(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Pz(i){return Math.PI*2*qi(i,"r")}function Dz(i){return qi(i,"width")*2+qi(i,"height")*2}function Lz(i){return hx({x:qi(i,"x1"),y:qi(i,"y1")},{x:qi(i,"x2"),y:qi(i,"y2")})}function iT(i){for(var e=i.points,t=0,r,n=0;n<e.numberOfItems;n++){var s=e.getItem(n);n>0&&(t+=hx(r,s)),r=s}return t}function Iz(i){var e=i.points;return iT(i)+hx(e.getItem(e.numberOfItems-1),e.getItem(0))}function sT(i){if(i.getTotalLength)return i.getTotalLength();switch(i.tagName.toLowerCase()){case"circle":return Pz(i);case"rect":return Dz(i);case"line":return Lz(i);case"polyline":return iT(i);case"polygon":return Iz(i)}}function Rz(i){var e=sT(i);return i.setAttribute("stroke-dasharray",e),e}function Bz(i){for(var e=i.parentNode;Xe.svg(e)&&Xe.svg(e.parentNode);)e=e.parentNode;return e}function oT(i,e){var t=e||{},r=t.el||Bz(i),n=r.getBoundingClientRect(),s=qi(r,"viewBox"),o=n.width,a=n.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function Nz(i,e){var t=Xe.str(i)?eT(i)[0]:i,r=e||100;return function(n){return{property:n,el:t,svg:oT(t),totalLength:sT(t)*(r/100)}}}function Oz(i,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return i.el.getPointAtLength(l)}var r=oT(i.el,i.svg),n=t(),s=t(-1),o=t(1);switch(i.property){case"x":return(n.x-r.x)*r.w;case"y":return(n.y-r.y)*r.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function qA(i,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=nT(Xe.pth(i)?i.totalLength:i,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:Xe.str(i)||e?r.split(t):[]}}function aT(i){var e=i?nm(Xe.arr(i)?i.map(jA):jA(i)):[];return rm(e,function(t,r,n){return n.indexOf(t)===r})}function lT(i){var e=aT(i);return e.map(function(t,r){return{target:t,id:r,total:e.length,transforms:{list:rT(t)}}})}function Fz(i,e){var t=sx(e);if(/^spring/.test(t.easing)&&(t.duration=ZA(t.easing)),Xe.arr(i)){var r=i.length,n=r===2&&!Xe.obj(i[0]);n?i={value:i}:Xe.fnc(e.duration)||(t.duration=e.duration/r)}var s=Xe.arr(i)?i:[i];return s.map(function(o,a){var l=Xe.obj(o)&&!Xe.pth(o)?o:{value:o};return Xe.und(l.delay)&&(l.delay=a?0:e.delay),Xe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return im(o,t)})}function Uz(i){for(var e=rm(nm(i.map(function(s){return Object.keys(s)})),function(s){return Xe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},r=function(s){var o=e[s];t[o]=i.map(function(a){var l={};for(var c in a)Xe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},n=0;n<e.length;n++)r(n);return t}function zz(i,e){var t=[],r=e.keyframes;r&&(e=im(Uz(r),e));for(var n in e)Xe.key(n)&&t.push({name:n,tweens:Fz(e[n],i)});return t}function Gz(i,e){var t={};for(var r in i){var n=tx(i[r],e);Xe.arr(n)&&(n=n.map(function(s){return tx(s,e)}),n.length===1&&(n=n[0])),t[r]=n}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}function kz(i,e){var t;return i.tweens.map(function(r){var n=Gz(r,e),s=n.value,o=Xe.arr(s)?s[1]:s,a=vs(o),l=lx(e.target,i.name,a,e),c=t?t.to.original:l,h=Xe.arr(s)?s[0]:c,u=vs(h)||vs(l),f=a||u;return Xe.und(o)&&(o=c),n.from=qA(h,f),n.to=qA(cx(o,h),f),n.start=t?t.end:0,n.end=n.start+n.delay+n.duration+n.endDelay,n.easing=nx(n.easing,n.duration),n.isPath=Xe.pth(s),n.isColor=Xe.col(n.from.original),n.isColor&&(n.round=1),t=n,n})}var cT={css:function(i,e,t){return i.style[e]=t},attribute:function(i,e,t){return i.setAttribute(e,t)},object:function(i,e,t){return i[e]=t},transform:function(i,e,t,r,n){if(r.list.set(e,t),e===r.last||n){var s="";r.list.forEach(function(o,a){s+=a+"("+o+") "}),i.style.transform=s}}};function hT(i,e){var t=lT(i);t.forEach(function(r){for(var n in e){var s=tx(e[n],r),o=r.target,a=vs(s),l=lx(o,n,a,r),c=a||vs(l),h=cx(nT(s,c),l),u=ax(o,n);cT[u](o,n,h,r.transforms,!0)}})}function Vz(i,e){var t=ax(i.target,e.name);if(t){var r=kz(e,i),n=r[r.length-1];return{type:t,property:e.name,animatable:i,tweens:r,duration:n.end,delay:r[0].delay,endDelay:n.endDelay}}}function Hz(i,e){return rm(nm(i.map(function(t){return e.map(function(r){return Vz(t,r)})})),function(t){return!Xe.und(t)})}function uT(i,e){var t=i.length,r=function(s){return s.timelineOffset?s.timelineOffset:0},n={};return n.duration=t?Math.max.apply(Math,i.map(function(s){return r(s)+s.duration})):e.duration,n.delay=t?Math.min.apply(Math,i.map(function(s){return r(s)+s.delay})):e.delay,n.endDelay=t?n.duration-Math.max.apply(Math,i.map(function(s){return r(s)+s.duration-s.endDelay})):e.endDelay,n}var YA=0;function Wz(i){var e=ex(JA,i),t=ex(rx,i),r=zz(t,i),n=lT(i.targets),s=Hz(n,r),o=uT(s,t),a=YA;return YA++,im(e,{id:a,children:[],animatables:n,animations:s,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}var Tn=[],XA=[],em,jz=function(){function i(){em=requestAnimationFrame(e)}function e(t){var r=Tn.length;if(r){for(var n=0;n<r;){var s=Tn[n];if(!s.paused)s.tick(t);else{var o=Tn.indexOf(s);o>-1&&(Tn.splice(o,1),r=Tn.length)}n++}i()}else em=cancelAnimationFrame(em)}return i}();function qz(){document.hidden?(Tn.forEach(function(i){return i.pause()}),XA=Tn.slice(0),Sr.running=Tn=[]):XA.forEach(function(i){return i.play()})}typeof document<"u"&&document.addEventListener("visibilitychange",qz);function Sr(i){i===void 0&&(i={});var e=0,t=0,r=0,n,s=0,o=null;function a(w){var b=window.Promise&&new Promise(function(S){return o=S});return w.finished=b,b}var l=Wz(i),c=a(l);function h(){var w=l.direction;w!=="alternate"&&(l.direction=w!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(b){return b.reversed=l.reversed})}function u(w){return l.reversed?l.duration-w:w}function f(){e=0,t=u(l.currentTime)*(1/Sr.speed)}function d(w,b){b&&b.seek(w-b.timelineOffset)}function p(w){if(l.reversePlayback)for(var S=s;S--;)d(w,n[S]);else for(var b=0;b<s;b++)d(w,n[b])}function m(w){var b=0,S=l.animations,T=S.length;for(l.reversePlayback===!0&&l.rewind===!1&&(w=l.duration+l.delay-l.endDelay-w);b<T;){var A=S[b],x=A.animatable,_=A.tweens,E=_.length-1,C=_[E];E&&(C=rm(_,function(ie){return w<ie.end})[0]||C);for(var I=ji(w-C.start-C.delay,0,C.duration)/C.duration,N=isNaN(I)?1:C.easing(I),R=C.to.strings,k=C.round,G=[],K=C.to.numbers.length,J=void 0,Y=0;Y<K;Y++){var F=void 0;if(l.reversePlayback===!0&&l.rewind===!1)var U=C.to.numbers[Y],O=C.from.numbers[Y]||0;else var O=C.to.numbers[Y],U=C.from.numbers[Y]||0;C.isPath?F=Oz(C.value,N*O):F=U+N*(O-U),k&&(C.isColor&&Y>2||(F=Math.round(F*k)/k)),G.push(F)}var j=R.length;if(!j)J=G[0];else{J=R[0];for(var H=0;H<j;H++){var X=R[H],V=R[H+1],he=G[H];isNaN(he)||(V?J+=he+V:J+=he+" ")}}cT[A.type](x.target,A.property,J,x.transforms),A.currentValue=J,b++}}function g(w){l[w]&&!l.passThrough&&l[w](l)}function v(){l.remaining&&l.remaining!==!0&&l.remaining--}function y(w){var b=l.duration,S=l.delay,T=b-l.endDelay,A=u(w);l.progress=ji(A/b*100,0,100),l.reversePlayback=A<l.currentTime,n&&p(A),!l.began&&l.currentTime>=0&&(l.began=!0,g("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,g("loopBegin")),A<=S&&l.currentTime!==0&&(m(0),g("change")),(A>=T&&l.currentTime!==b||!b)&&(m(b),g("change")),A>S&&A<T?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,g("changeBegin")),g("change"),m(A)):l.changeBegan?(l.changeCompleted=!0,l.changeBegan=!1,g("change"),g("changeComplete")):l.began&&A>T&&(g("change"),g("changeComplete")),l.currentTime=ji(A,0,b),l.began&&g("update"),w>=b&&(t=0,v(),l.remaining?(e=r,g("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&h()):(l.paused=!0,l.completed||(l.completed=!0,g("loopComplete"),g("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var w=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=w==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||w==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(w,b){return hT(w,b),l},l.tick=function(w){r=w,e||(e=r),y((r+(t-e))*Sr.speed)},l.seek=function(w){y(u(w))},l.pause=function(){l.paused=!0,f()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,Tn.push(l),f(),em||jz())},l.reverse=function(){h(),l.completed=!l.reversed,f()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function QA(i,e){for(var t=e.length;t--;)ix(i,e[t].animatable.target)&&e.splice(t,1)}function Yz(i){for(var e=aT(i),t=Tn.length;t--;){var r=Tn[t],n=r.animations,s=r.children;QA(e,n);for(var o=s.length;o--;){var a=s[o],l=a.animations;QA(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!n.length&&!s.length&&r.pause()}}function Xz(i,e){e===void 0&&(e={});var t=e.direction||"normal",r=e.easing?nx(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",h=Xe.arr(i),u=parseFloat(h?i[0]:i),f=h?parseFloat(i[1]):0,d=vs(h?i[1]:i)||0,p=e.start||0+(h?u:0),m=[],g=0;return function(v,y,w){if(a&&(o=0),l&&(o=(w-1)/2),c&&(o=w-1),!m.length){for(var b=0;b<w;b++){if(!n)m.push(Math.abs(o-b));else{var S=l?(n[0]-1)/2:o%n[0],T=l?(n[1]-1)/2:Math.floor(o/n[0]),A=b%n[0],x=Math.floor(b/n[0]),_=S-A,E=T-x,C=Math.sqrt(_*_+E*E);s==="x"&&(C=-_),s==="y"&&(C=-E),m.push(C)}g=Math.max.apply(Math,m)}r&&(m=m.map(function(N){return r(N/g)*g})),t==="reverse"&&(m=m.map(function(N){return s?N<0?N*-1:-N:Math.abs(g-N)}))}var I=h?(f-u)/g:u;return p+I*(Math.round(m[y]*100)/100)+d}}function Qz(i){i===void 0&&(i={});var e=Sr(i);return e.duration=0,e.add=function(t,r){var n=Tn.indexOf(e),s=e.children;n>-1&&Tn.splice(n,1);function o(f){f.passThrough=!0}for(var a=0;a<s.length;a++)o(s[a]);var l=im(t,ex(rx,i));l.targets=l.targets||i.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=Xe.und(r)?c:cx(r,c),o(e),l.rewind=e.rewind,e.seek(l.timelineOffset);var h=Sr(l);o(h),s.push(h);var u=uT(s,i);return e.delay=u.delay,e.endDelay=u.endDelay,e.duration=u.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}Sr.version="3.2.0";Sr.speed=1;Sr.running=Tn;Sr.remove=Yz;Sr.get=lx;Sr.set=hT;Sr.convertPx=ox;Sr.path=Nz;Sr.setDashoffset=Rz;Sr.stagger=Xz;Sr.timeline=Qz;Sr.easing=nx;Sr.penner=$A;Sr.random=function(i,e){return Math.floor(Math.random()*(e-i+1))+i};var fT=Sr;function dT(i,e,t){var n,s;let r=i.cameraType==="OrthographicCamera"?(n=e.orthographic)==null?void 0:n.zoom:(s=e.perspective)==null?void 0:s.zoom;if(r!==void 0){let o=i.zoom;o!==r&&t.push({change:a=>{i.zoom=et.lerp(o,r,a),i.updateProjectionMatrix()}})}if(e.targetOffset!==void 0){let o=i.targetOffset,a=e.targetOffset;o!==a&&t.push({change:l=>{i.targetOffset=et.lerp(o,a,l)}})}}function pT(i,e,t){if(e.width!==void 0&&e.height!==void 0&&e.depth!==void 0){let{width:r,height:n,depth:s}=i.geometry.userData.parameters,o=[r,n,s],a=[e.width,e.height,e.depth];!br.isEqual(o,a)&&!Lt(i)&&t.push({change:l=>{let[c,h,u]=br.lerp(o,a,l);i.updateGeometry({parameters:{width:c,height:h,depth:u}}),i.invalidateDownstreamBooleanData()}})}}function mT(i,e,t,r){if(e.intensity!==void 0){let n=i.intensity,s=e.intensity;n!==s&&t.push({change:o=>{i.intensity=et.lerp(n,s,o)}})}if(e.color!==void 0){let n=i.color.clone(),s=typeof e.color=="string"?r.getColor(e.color):e.color;if(!Ar.equals(n,s)){let o=n.clone();i.color=o,t.push({change:a=>{let{r:l,g:c,b:h}=Ar.lerp(n,s,a);o.setRGB(l,c,h)}})}}}function gT(i,e,t,r){var s,o;let n=i.layersList.head;for(;n;){let a=e.layers.data(n.uuid);if(a&&((s=n.visible)!=null?s:!0)&&((o=a.visible)!=null?o:!0)){let l=n.getNames().filter(c=>!CM.some(h=>c.includes(h)));for(let c of l)try{let h=n.getValue(c);if(c==="steps")tG(n,a,c,t);else if(c==="colors")rG(n,a,c,t);else if(typeof h=="number")Jz(n,a,c,t);else{if(typeof h=="boolean")continue;"isVector2"in h?Kz(n,a,c,t):"isVector3"in h?Zz(n,a,c,t):"isColorA"in h?eG(n,a,c,t,r):"isColor"in h?$z(n,a,c,t,r):"isTexture"in h&&nG(n,a,c,t)}}catch(h){console.error(`animateMaterial: unexpected material layer for ${c}`,h)}}n=n.next}}function Jz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];n!==s&&r.push({change:o=>{i.setValue(t,et.lerp(n,s,o))}})}function Kz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];us.isEqual(s,o)||r.push({change:a=>{n.fromArray(us.lerp(s,o,a))}})}function Zz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];br.isEqual(s,o)||r.push({change:a=>{n.fromArray(br.lerp(s,o,a))}})}function $z(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Ar.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:h,g:u,b:f}=Ar.lerp(s,a,c);l.setRGB(h,u,f)}})}function eG(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Ln.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:h,g:u,b:f,a:d}=Ln.lerp(s,a,c);l.setRGBA(h,u,f,d)}})}function tG(i,e,t="steps",r){if(!i.hasValue(t)||!(t in e))return;let n=[...i.getValue(t)],s=e[t];for(let o=0;o<n.length;++o){let a=n[o],l=s[o];a!==l&&r.push({change:c=>{n[o]=et.lerp(a,l,c),i.setValue("steps",n)}})}}function rG(i,e,t="colors",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];for(let o=0;o<n.length;++o){let a=n[o].toArray(),l=s[o];Ph.isEqual(a,l)||r.push({change:c=>{n[o].fromArray(Ph.lerp(a,l,c))}})}}function nG(i,e,t="texture",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue("texture"),s=e[t],o=n.repeat.toArray(),a=n.offset.toArray(),l=s.repeat,c=s.offset;(!us.isEqual(o,l)||!us.isEqual(a,c))&&r.push({change:h=>{n.repeat.fromArray(us.lerp(o,l,h)),n.offset.fromArray(us.lerp(a,c,h)),n.updateMatrix(),n.needsUpdate=!0}})}function yT(i,e,t,r){if(r===0)return t.copy(i);if(r===1)return t.copy(e);let n=i.w*e.w+i.x*e.x+i.y*e.y+i.z*e.z;if(n>=1)return t.copy(i);let s=1-n*n;if(s<=Number.EPSILON){let h=1-r;return t.w=h*i.w+r*e.w,t.x=h*i.x+r*e.x,t.y=h*i.y+r*e.y,t.z=h*i.z+r*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,n),l=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o;return t.w=i.w*l+e.w*c,t.x=i.x*l+e.x*c,t.y=i.y*l+e.y*c,t.z=i.z*l+e.z*c,t}function vT(i,e,t=0){let r=Array.isArray(i.material)?i.material[t]:i.material,n;return"materials"in e?n=e.materials[t]:"material"in e&&(n=e.material),[r,n]}var ux=new M,fx=new M,xT=new zt,iG=new yn,sG=new Ae;function bT(i,e,t,r){if(t.position!==void 0){let n=i.position.toArray(),s=t.position;br.isEqual(n,s)||r.push({change:o=>{i.position.fromArray(br.lerp(n,s,o)),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}if(t.scale!==void 0){let n=i.scale.toArray(),s=t.scale;br.isEqual(n,s)||r.push({change:o=>{i.scale.fromArray(br.lerp(n,s,o)),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}oG(i,e,t,r),aG(i,t,r)}function oG(i,e,t,r){if(t.rotation===void 0)return;let n=ux.setFromEuler(i.rotation).toArray(),s=t.rotation;if(br.isEqual(n,s))return;if(br.sub(t.rotation,e?e.rotation:i.rotation).every(a=>Math.abs(a)<2*Math.PI)){let a=i.quaternion.clone(),l=new zt().setFromEuler(iG.set(t.rotation[0],t.rotation[1],t.rotation[2]));r.push({change:c=>{yT(a,l,i.quaternion,c),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}else r.push({change:a=>{i.rotation.setFromVector3(fx.fromArray(br.lerp(n,s,a))),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}function aG(i,e,t){if(e.hiddenMatrix!==void 0&&!Di.isEqual(i.hiddenMatrix.toArray(),e.hiddenMatrix)){let r=new M,n=new zt,s=new M;i.hiddenMatrix.decompose(r,n,s);let o=new M,a=new zt,l=new M;sG.fromArray(e.hiddenMatrix).decompose(o,a,l),t.push({change:c=>{xT.slerpQuaternions(n,a,c),ux.lerpVectors(r,o,c),fx.lerpVectors(s,l,c),i.hiddenMatrix.compose(ux,xT,fx),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}}function wT(i,e,t,r){let n=[];if((i.visible||Lt(i.parent))&&bT(i,e==null?void 0:e.objectState,t.objectState,n),er(i)){if((i.visible||Lt(i.parent))&&"geometry"in t.objectState&&pT(i,t.objectState.geometry,n),i.visible&&("material"in t.objectState||"materials"in t.objectState)){let[s,o]=vT(i,t.objectState,i.selectedMaterial);s&&o&&typeof o!="string"&&gT(s,o,n,r)}}else i.visible&&k1(i)?mT(i,t.objectState,n,r):G1(i)&&dT(i,t.objectState,n);return n.length?{change:s=>{n.forEach(o=>{o.change&&o.change(s)})}}:void 0}function lG(i,e,t){switch(i){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 5:let{control1:r,control2:n}=e!=null?e:se({},Od.defaultData);return`cubicBezier( ${r[0]}, ${r[1]}, ${n[0]}, ${n[1]} )`;case 6:let{mass:s,stiffness:o,damping:a,velocity:l}=t!=null?t:se({},Nd.defaultData);return`spring( ${s}, ${o}, ${a}, ${l} )`}}var sm=class{constructor(e,t){this.object=e;this.sharedAssets=t;this.uuid=et.generateUUID();this.states=[];this.events={};this.animatingState=0;this._scrollCounter=null}get fromState(){return this._fromState}get animation(){return this._animation}start(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._scrollCounter=null),this.states.length>1&&(this.states[0].execute(this.object,this.sharedAssets),this._toState=this.states[0],this._fromState=void 0)}end(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0),this.states.length>1&&this.states[0].execute(this.object,this.sharedAssets),this._toState=void 0,this._fromState=void 0}seek(e,t,r,n,s){var o;this._scrollCounter===null&&(this.animate(e,n,s),this._scrollCounter=0),this._scrollCounter+=t,this._scrollCounter=Math.min(Math.max(this._scrollCounter,0),r),(o=this._animation)==null||o.seek(this._scrollCounter/r*(n.duration?n.duration:1))}animate(e,t,r){var n,s,o,a,l,c,h;if(this._fromState===e&&((n=this._animation)==null?void 0:n.reversed)){let u=(o=(s=this._animation)==null?void 0:s.currentTime)!=null?o:0;(a=this._animation)==null||a.reset(),(l=this._animation)==null||l.seek(u),(c=this._animation)==null||c.play()}else if(this._toState!==e){this._animation!==void 0&&this._animation.pause(),this.animatingState=0,this._fromState=this._toState,this._toState=e;let u=wT(this.object,this._fromState,e,this.sharedAssets);if(!u)return;let f={t:0};this._animation=fT({autoplay:!1,loop:t.repeat?!0:t.cycle?1:!1,direction:t.cycle?"alternate":"normal",rewind:t.rewind,delay:t.startDelay,endDelay:t.endDelay,duration:t.duration,easing:lG(t.easing,t.cubicControls,t.springParameters),targets:f,t:1,change:()=>{u.change&&u.change(f.t),r!=null&&r.change&&r.change(f.t)},loopBegin:d=>{if(this.animatingState===0){this.animatingState=1;return}d.reversed?(this._toState=this._fromState,this._fromState=e):(this._fromState=this._toState,this._toState=e)}}),t.autoplay?t.startOnceDelay>0?setTimeout(()=>{var d;return(d=this._animation)==null?void 0:d.play()},t.startOnceDelay):(h=this._animation)==null||h.play():this._animation.finished.then(()=>{this._animation=void 0,this.animatingState=0})}}emitEvent(e){var t;if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let r=this.events[e];if(r){for(let n of r)if("targets"in n)for(let{object:s,state:o,params:a}of n.targets)(t=s.interaction)==null||t.animate(o,a)}}}emitEventReverse(e){if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let t=this.events[e];if(t){for(let r of t)if("targets"in r)for(let{object:n,params:s}of r.targets){let o=n.interaction;(o==null?void 0:o._fromState)!==void 0&&o.animate(o._fromState,s)}}}}};var yc=class{static create(e,t){var r,n,s,o,a,l;if(e.object){let c=t.find(e.object);if(c!=null&&c.interaction){let h=e.state?c.interaction.states.find(u=>u.uuid===e.state):c.interaction.states[0];if(h){let u=(r=e.delay)!=null?r:0,f={cycle:(n=e.cycle)!=null?n:!1,rewind:(s=e.rewind)!=null?s:!1,repeat:(o=e.repeat)!=null?o:!1,duration:(a=e.duration)!=null?a:1e3,startOnceDelay:e.delayDirection==="start-once"?u:0,startDelay:e.delayDirection==="start"||!e.delayDirection?u:0,endDelay:e.delayDirection==="end"||!e.delayDirection?u:0,easing:(l=e.easing)!=null?l:4,autoplay:!0};if(e.easing===5){let d=e;f.cubicControls={control1:[...d.control1],control2:[...d.control2]}}if(e.easing===6){let d=e;f.springParameters={mass:d.mass,stiffness:d.stiffness,damping:d.damping,velocity:d.velocity}}return new yc(c,h,f)}}}}constructor(e,t,r){this.object=e,this.state=t,this.params=r}};var dx=new Map,wu={url:"head",time:0,data:null,next:null,prev:null},vc={url:"tail",time:1/0,data:null,next:null,prev:null};wu.next=vc;vc.prev=wu;var ST=0;function co(i){if(typeof i=="string")return i;let e=Date.now(),t=dx.get(i);return t===void 0?(t={url:URL.createObjectURL(new Blob([i])),data:i,time:e,next:null,prev:null},dx.set(i,t)):(t.time=e,t.prev.next=t.next,t.next.prev=t.prev),t.prev=vc.prev,t.next=vc,vc.prev.next=t,vc.prev=t,e-ST>1e3*10&&(ST=e+1e3,setTimeout(()=>{let r=Date.now(),n=wu.next;for(;n.time<r-1e3*10;)URL.revokeObjectURL(n.url),dx.delete(n.data),n=n.next,n.prev=wu,wu.next=n},900)),t.url}var MT=new Yr,ra=class extends Wr{},om=class{constructor(e){this.materials={};this.images={};this.colors={};this.transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:js,magFilter:ct,wrapS:Pr,wrapT:Pr}),this.transmissionRenderTarget.depthTexture=new ai(2048,2048),this.reset(e)}reset(e){for(let[t,r]of Object.entries(e.images))this.addImage(t,r.data);for(let[t,r]of Object.entries(e.colors))this.addColor(t,r);for(let[t,r]of Object.entries(e.materials))this.addMaterial(t,_v(r,this))}get transmissionSamplerMap(){return this.transmissionRenderTarget.texture}get transmissionDepthMap(){return this.transmissionRenderTarget.depthTexture}addMaterial(e,t){t.uuid=e,this.materials[e]=t}deleteMaterial(e){this.materials[e]&&(this.materials[e].dispose(),delete this.materials[e])}isSharedMaterial(e){return e.uuid in this.materials||e===MT}getMaterial(e){let t=this.materials[e];return t}getMaterialOrDeletedPlaceholder(e){var t;return(t=this.materials[e])!=null?t:MT}getMaterials(){return this.materials}addImage(e,t){if(this.images[e])return this.images[e].onload=()=>{this.onImageLoad&&this.onImageLoad()},this.images[e].src=co(t),!0;{let r=new Image;return r.src=co(t),r.onload=()=>{this.onImageLoad&&this.onImageLoad()},this.images[e]=r,!1}}deleteImage(e){this.images[e]&&delete this.images[e]}getDefaultImage(){return this.images.image_0}getImage(e){return this.images[e]}getImages(){return this.images}addColor(e,t){return this.colors[e]?("a"in t?this.colors[e].setRGBA(t.r,t.g,t.b,t.a):this.colors[e].setRGBA(t.r,t.g,t.b,1),!0):("a"in t?this.colors[e]=new ra(t.r,t.g,t.b,t.a):this.colors[e]=new ra(t.r,t.g,t.b,1),!1)}updateColor(e,t){var r,n,s,o;if(this.colors[e]){let a=this.colors[e];return this.colors[e].r=(r=t.r)!=null?r:a.r,this.colors[e].g=(n=t.g)!=null?n:a.g,this.colors[e].b=(s=t.b)!=null?s:a.b,this.colors[e].a=(o=t.a)!=null?o:a.a,!0}return!1}deleteColor(e){this.colors[e]&&delete this.colors[e]}getColor(e){return this.colors[e]}dispose(){Object.keys(this.materials).forEach(t=>this.deleteMaterial(t)),this.transmissionRenderTarget.depthTexture.dispose(),this.transmissionRenderTarget.dispose(),this.onImageLoad=void 0}};function cG(i,e){switch(i.type){case"noise":return e==="noiseType";case"texture":return e==="projection"||e==="axis"||e==="side";case"displace":return e==="noiseType";case"depth":return e==="num"||e==="smooth"||e==="isWorldSpace"||e==="gradientType";default:return!1}}function px(i,e,t,r,n){var o;let s=!1;for(let[a,l]of Object.entries(i)){if(!a||l===void 0||Np(a,t,n))continue;t.visible=n.visible;let c=t.uniforms[`f${t.id}_${a}`];if(!!c)switch(c.constructor){case Ot:if(typeof l=="string"){let h=e.getColor(l);h&&(c.value=h);break}else{let h=l;c.value instanceof ra?c.value=new Wr(h.r,h.g,h.b,h.a):c.setRGBA(h);break}case di:if(typeof l=="string"){let h=e.getColor(l);h&&(c.value=h);break}else{let h=l;c.value instanceof ra?c.value=new Wr(h.r,h.g,h.b,h.a):c.value.setRGBA(h.r,h.g,h.b,h.a);break}case Nr:{let h=l;c.value.setX(h[0]),c.value.setY(h[1]);break}case Or:{let h=l;c.value.setX(h[0]),c.value.setY(h[1]),c.value.setZ(h[2]);break}case jr:{let h=l;if("image"in h){let u=h.image;if(typeof u=="string"){let f=e.getImage(u);f&&(c.value.image=f)}else{let f=new Image;f.src=co(u.data),c.value.image=f}}"wrapping"in h&&(c.value.wrapS=c.value.wrapT=h.wrapping),"repeat"in h&&c.value.repeat.fromArray(h.repeat),"offset"in h&&c.value.offset.fromArray(h.offset),c.value.needsUpdate=!0;break}case ps:{l.forEach((h,u)=>{c.value[u].setX(h[0]),c.value[u].setY(h[1]),c.value[u].setZ(h[2]),c.value[u].setW(h[3])});break}default:{s=s||cG(t,a),c.value=l;break}}}if(s&&n){let a=Bp({id:"0",fi:0,data:n},e);(o=r.userData.layers)==null||o.changeLayer(t.id,se({},a)),r.dispose(),r.needsUpdate=!0}}var mx=new M,AT=new Gr,TT=new Ae,Su={type:"follow",normal:new M,raycaster:new io},xc;(t=>{function i(r){if(r.type===10)return{type:"follow"}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){!r||!n||!s||(o&&o("follow",r.uuid),AT.setFromNormalAndCoplanarPoint(n,r.getWorldPosition(mx)),s.ray.intersectPlane(AT,mx),r.position.copy(mx),r.parent!==null&&r.position.applyMatrix4(TT.copy(r.parent.matrixWorld).invert()),r.position.applyMatrix4(TT.copy(r.hiddenMatrix).invert()),r.updateMatrix(),er(r)&&Lt(r.parent)&&r.invalidateDownstreamBooleanData(!0),a&&a())}t.listener=e})(xc||(xc={}));var gx=new M,_T=new Gr,Mu={type:"lookAt",normal:new M,raycaster:new io},bc;(t=>{function i(r){if(r.type===9&&r.distance)return{type:"lookAt",distance:r.distance}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){var c,h,u;if(!((h=(c=r==null?void 0:r.interaction)==null?void 0:c.events.lookAt)!=null&&h.length)||!n||!s)return;o&&o("lookAt",r.uuid);let l=r.interaction.events.lookAt[0].distance;_T.set(n,-l),s.ray.intersectPlane(_T,gx),r.lookAt(gx),r.updateMatrix(),(u=r.interaction.animation)==null||u.finished.then(()=>{r.lookAt(gx),r.updateMatrix(),er(r)&&Lt(r.parent)&&r.invalidateDownstreamBooleanData(!0)}),er(r)&&Lt(r.parent)&&r.invalidateDownstreamBooleanData(!0),a&&a()}t.listener=e})(bc||(bc={}));var yx={type:"start"},wc;(t=>{function i(r){if(r.type===7)return{type:"start",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){var a,l;if(!((l=(a=r==null?void 0:r.interaction)==null?void 0:a.events.start)!=null&&l.length))return;n&&n("start",r.uuid);let o={change:s};r.interaction.events.start.forEach(c=>{c.targets.forEach(({object:h,state:u,params:f})=>{var d;return(d=h.interaction)==null?void 0:d.animate(u,f,o)})})}t.listener=e})(wc||(wc={}));var am={type:"scroll"},Sc;(t=>{function i(r){if(!(r.type!==11||r.steps===void 0))return{type:"scroll",targets:[],steps:r.steps}}t.create=i;function e({target:r,deltaY:n,begin:s,change:o}){var c,h;if(!((h=(c=r==null?void 0:r.interaction)==null?void 0:c.events.scroll)!=null&&h.length)||!n)return;s&&s("scroll",r.uuid);let a={change:o},l=n>0?1:-1;r.interaction.events.scroll.forEach(u=>{u.targets.forEach(({object:f,state:d,params:p})=>{var g;let m=xe(se({},p),{autoplay:!1});(g=f.interaction)==null||g.seek(d,l,u.steps,m,a)})})}t.listener=e})(Sc||(Sc={}));var Ac={type:"mouseHover"},Mc;(t=>{function i(r){if(r.type===2)return{type:"mouseHover",targets:[]}}t.create=i;function e({target:r,begin:n,change:s,enter:o}){var l,c;if(!((c=(l=r==null?void 0:r.interaction)==null?void 0:l.events.mouseHover)!=null&&c.length)||o===void 0)return;n&&n("mouseHover",r.uuid);let a={change:s};o?r.interaction.events.mouseHover.forEach(h=>{h.targets.forEach(({object:u,state:f,params:d})=>{var p;(p=u.interaction)==null||p.animate(f,d,a)})}):r.interaction.events.mouseHover.forEach(h=>{h.targets.forEach(({object:u,params:f})=>{let d=u.interaction;(d==null?void 0:d.fromState)!==void 0&&d.animate(d.fromState,f,a)})})}t.listener=e})(Mc||(Mc={}));var vx={type:"mouseDown"},xx={type:"mouseUp"},lm={type:"keyDown"},cm={type:"keyUp"},xs;(t=>{function i(r){var o,a;let n,s;if(r.type===0)n={type:"mousedown"},s="mouseDown";else if(r.type===1)n={type:"mouseup"},s="mouseUp";else if(r.type===5){if(!r.key)return;n={type:"keydown",key:r.key},s="keyDown"}else if(r.type===6){if(!r.key)return;n={type:"keyup",key:r.key},s="keyUp"}else return;return{type:s,domEvent:n,targets:[],url:(o=r.url)!=null?o:void 0,toggle:(a=r.toggle)!=null?a:!1,enable:!1}}t.create=i;function e({target:r,interactionEvents:n,type:s,begin:o,change:a}){var c;if(!r)return;n||(n=(c=r.interaction)==null?void 0:c.events[s]),o&&o(s,r.uuid);let l={change:a};n.forEach(h=>{if(h.toggle){h.enable=!h.enable;for(let{object:u,state:f,params:d}of h.targets){let p=u.interaction;if(p!==void 0){let m=xe(se({},d),{cycle:!1,rewind:!1,repeat:!1});h.enable?p.animate(f,m,l):p.fromState!==void 0&&p.animate(p.fromState,m,l)}}}else h.targets.forEach(({object:u,state:f,params:d})=>{var p;return(p=u.interaction)==null?void 0:p.animate(f,d,l)});h.url&&(Ho?window.location.assign(h.url):window.open(h.url,"_blank"))})}t.listener=e})(xs||(xs={}));function hG(i){let e,{type:t}=i;return t===10?e=xc.create(i):t===0||t===1||t===5||t===6?e=xs.create(i):t===9?e=bc.create(i):t===2?e=Mc.create(i):t===11?e=Sc.create(i):t===7&&(e=wc.create(i)),e}function ET(i,e,t){let r=[];i.objects.traverse((n,s)=>{let o=e.find(n);if(delete o.interaction,!s.visible&&!Lt(o.parent)||s.states===void 0)return;let a=new sm(o,t),l=a.states;l.push(na.create(n,s));for(let h of s.states){let u=Fh.patch(s,h.data);l.push(na.create(h.id,u))}let c=a.events;if(s.events)for(let{data:h}of s.events){let u=hG(h);if(!u)continue;let f=u.type;c[f]?c[f].push(u):c[f]=[u],"targets"in h&&r.push([h,u])}(l.length>0||Object.keys(c).length>0)&&(o.interaction=a)});for(let[n,s]of r)if("targets"in n&&"targets"in s)for(let{data:o}of n.targets){let a=yc.create(o,e);a&&s.targets.push(a)}}function CT(i,e,t,r,n=!1){if(!n&&e.states.length===0)return;let s=t===null?e:Fh.patch(e,e.states.data(t));if(Ev(i,s),i instanceof kt&&s.type==="Mesh"){if(i instanceof po?i.buildFromStore(s.geometry):i.updateGeometry({parameters:s.geometry}),i.freeBooleanPointer(),Lt(i.parent)&&i.parent.invalidateDownstreamBooleanData().recomputeBoolean(),"material"in s){if(i.material instanceof Array)return;if(typeof s.material!="string"){let a=s.material.layers;for(let l of a){let c=i.material.userData.layers.getLayerByUuid(l.id);px(l.data,r,c,i.material,l.data)}}}else if("materials"in s){if(!(i.material instanceof Array))return;var o=0;for(let a of s.materials){if(typeof a!="string"){let l=a.layers;for(let c of l){let h=i.material[o].userData.layers.getLayerByUuid(c.id);px(c.data,r,h,i.material[o],c.data)}}o++}}}else if(s.type==="DirectionalLight")i.fromDirectionalLightState(s,r);else if(s.type==="PointLight")i.fromPointLightState(s,r);else if(s.type==="SpotLight")i.fromSpotLightState(s,r);else if(i instanceof Bn&&eo.is(s.type)){let a=s;i.setZoom("PerspectiveCamera",a.perspective.zoom),i.setZoom("OrthographicCamera",a.orthographic.zoom),i.isUpVectorFlipped=a.isUpVectorFlipped,i.targetOffset=a.targetOffset}}var na=class{constructor(e){this.objectState=e;this.uuid=et.generateUUID()}static create(e,t){let r=new na(t);return r.uuid=e,r}execute(e,t){CT(e,this.objectState,null,t,!0)}};var Yi=new io,$n=new M,bx={follow:xc.listener,keyDown:xs.listener,keyUp:xs.listener,lookAt:bc.listener,mouseDown:xs.listener,mouseUp:xs.listener,mouseHover:Mc.listener,scroll:Sc.listener,start:wc.listener},PT={follow:Su,keyDown:lm,keyUp:cm,lookAt:Mu,mouseDown:vx,mouseUp:xx,mouseHover:Ac,scroll:am,start:yx};function uG(i){if(i.style.transform!==""){let e=getComputedStyle(i).getPropertyValue("transform");if(e!=="none"){let t=e.replace("matrix(","").split(",");return{x:parseFloat(t[0]),y:parseFloat(t[3])}}}return{x:1,y:1}}function DT(i){let e=i.getViewport(new Je),t=uG(i.domElement);return{left:e.x*t.x,top:e.y*t.y,width:e.z*t.x,height:e.w*t.y}}function wx(i,e){if(er(e)){if(!e.raycastLock&&e.visible){let t=i.intersectObject(e,!1);return t.length?t[0]:void 0}}else if(e.objectType==="EmptyObject")return LT(i,e)}function LT(i,e){if(er(e)&&!e.raycastLock&&e.visible){let t=i.intersectObject(e,!1);if(t.length)return t[0]}for(let t of e.children)if(Zo(t)){let r=LT(i,t);if(r)return r}}var hm=class{constructor(e,t,r,n){this.isEnable=!1;this.splineEvents={};this._map={};this._prevObjects=[];this._onMouseDown=e=>{Yi.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseDownEvent(e)};this._onMouseUp=e=>{Yi.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseUpEvent(e)};this._onMouseMove=e=>{Yi.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseHoverEvent(e),this._handleLookAtEvent(e),this._handleFollowEvent(e)};this._onTouchStart=e=>{e.touches.length===1&&(Yi.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseDownEvent(e),this._handleMouseHoverEvent(e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onTouchEnd=e=>{this._handleMouseUpEvent(e),this._handleMouseHoverEvent(e,!0)};this._onTouchMove=e=>{e.touches.length===1&&(Yi.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseHoverEvent(e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onWheel=e=>{this._handleWheelEvent(e)};this._onKeyDown=e=>{this._handleKeyDownEvent(e)};this._onKeyUp=e=>{this._handleKeyUpEvent(e)};this._renderer=e,this._domElement=e.domElement,this._camera=r,this._scene=t,this._app=n,this._domRect=this._domElement.getBoundingClientRect(),this._viewRect=DT(e)}activate(){var e,t,r,n,s,o,a,l,c,h,u,f,d,p,m,g,v,y;this.isEnable=!0,this._map={},this._scene.traverseEntity(w=>{w.interaction!==void 0&&(w.interaction.start(),Object.keys(w.interaction.events).forEach(b=>{let S=b;this._addDOMCustomEvent(S,w),(w.visible||S!=="mouseDown"&&S!=="mouseUp"&&S!=="mouseHover")&&this._addSPEEvent(S,w)}))}),Rd?((((e=this._map.mouseDown)==null?void 0:e.length)||((t=this._map.mouseHover)==null?void 0:t.length)||((r=this._map.lookAt)==null?void 0:r.length)||((n=this._map.follow)==null?void 0:n.length))&&this._domElement.addEventListener("touchstart",this._onTouchStart),(((s=this._map.mouseUp)==null?void 0:s.length)||((o=this._map.mouseHover)==null?void 0:o.length))&&this._domElement.addEventListener("touchend",this._onTouchEnd),(((a=this._map.mouseHover)==null?void 0:a.length)||((l=this._map.lookAt)==null?void 0:l.length)||((c=this._map.follow)==null?void 0:c.length))&&this._domElement.addEventListener("touchmove",this._onTouchMove)):((h=this._map.mouseDown)!=null&&h.length&&this._domElement.addEventListener("pointerdown",this._onMouseDown),(u=this._map.mouseUp)!=null&&u.length&&this._domElement.addEventListener("pointerup",this._onMouseUp),(((f=this._map.mouseHover)==null?void 0:f.length)||((d=this._map.lookAt)==null?void 0:d.length)||((p=this._map.follow)==null?void 0:p.length))&&this._domElement.addEventListener("pointermove",this._onMouseMove)),(m=this._map.scroll)!=null&&m.length&&this._domElement.addEventListener("wheel",this._onWheel),(g=this._map.keyDown)!=null&&g.length&&document.addEventListener("keydown",this._onKeyDown),(v=this._map.keyUp)!=null&&v.length&&document.addEventListener("keyup",this._onKeyUp),(y=this._map.start)!=null&&y.length&&this._handleStartEvent(),this.resize()}deactivate(){this._scene.traverseEntity(e=>{if(!e.interaction)return;e.interaction.end();let t=e;Object.keys(bx).forEach(r=>{let n=r;t.removeEventListener(n,bx[n])})}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),this._domElement.removeEventListener("wheel",this._onWheel),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{var t;(t=e.interaction)==null||t.start()}),this._handleStartEvent()}resize(){this._domRect=this._domElement.getBoundingClientRect(),this._viewRect=DT(this._renderer)}_getPointer(e,t){let r=this._domRect,n=this._viewRect,s=r.height-n.height,o=(e-n.left-r.left)*(r.width/n.width),a=(t-s+n.top-r.top)*(r.height/n.height);return{x:o/r.width*2-1,y:-(a/r.height)*2+1}}_handleStartEvent(){var e;(e=this._map.start)==null||e.forEach(t=>{t.dispatchEvent(yx)})}_handleWheelEvent(e){var t;(t=this._map.scroll)!=null&&t.length&&(am.deltaY=e.deltaY,this._map.scroll.forEach(r=>{r.dispatchEvent(am)}))}_handleMouseDownEvent(e){var t;(t=this._map.mouseDown)==null||t.forEach(r=>{wx(Yi,r)&&r.dispatchEvent(vx)})}_handleMouseUpEvent(e){var t;(t=this._map.mouseUp)==null||t.forEach(r=>{wx(Yi,r)&&r.dispatchEvent(xx)})}_handleMouseHoverEvent(e,t=!1){var n;let r=[];t||(n=this._map.mouseHover)==null||n.forEach(s=>{wx(Yi,s)&&r.push(s)}),this._prevObjects.length&&(Ac.enter=!1,this._prevObjects.forEach(s=>{r.includes(s)||s.dispatchEvent(Ac)})),r.length&&(Ac.enter=!0,r.forEach(s=>{s.dispatchEvent(Ac)})),this._prevObjects=r}_handleLookAtEvent(e){var t;(t=this._map.lookAt)!=null&&t.length&&(Mu.normal=$n,Mu.raycaster=Yi,this._map.lookAt.forEach(r=>{r.dispatchEvent(Mu)}))}_handleFollowEvent(e){this._map.follow&&(Su.normal=$n,Su.raycaster=Yi,this._map.follow.forEach(t=>t.dispatchEvent(Su)))}_handleKeyDownEvent(e){var t;(t=this._map.keyDown)==null||t.forEach(r=>{var n,s,o;lm.interactionEvents=(o=(s=(n=r.interaction)==null?void 0:n.events)==null?void 0:s.keyDown)==null?void 0:o.filter(a=>a.domEvent.type==="keydown"&&a.domEvent.key===e.key),r.dispatchEvent(lm)})}_handleKeyUpEvent(e){var t;(t=this._map.keyUp)==null||t.forEach(r=>{var n,s,o;cm.interactionEvents=(o=(s=(n=r.interaction)==null?void 0:n.events)==null?void 0:s.keyUp)==null?void 0:o.filter(a=>a.domEvent.type==="keyup"&&a.domEvent.key===e.key),r.dispatchEvent(cm)})}_addSPEEvent(e,t){var r;!t.interaction||(PT[e].begin=this._dispatchDOMCustomEvent.bind(this),PT[e].change=this._app.requestRender.bind(this),(r=t.interaction.events[e])!=null&&r.length&&(t.addEventListener(e,bx[e]),this._map[e]===void 0?this._map[e]=[t]:this._map[e].push(t)))}_addDOMCustomEvent(e,t){if(e){let r=new CustomEvent(e,{bubbles:!0});Object.defineProperty(r,"target",{writable:!1,value:{id:t.uuid,name:t.name}}),this.splineEvents[e]?this.splineEvents[e][t.uuid]=r:this.splineEvents[e]={[t.uuid]:r}}}_dispatchDOMCustomEvent(e,t){var n;let r=(n=this.splineEvents[e])==null?void 0:n[t];r&&this._domElement.dispatchEvent(r)}};var um=class{constructor(e,t,r,n,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new B().copy(r),this._editorSize=new B().copy(n),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y,!1)}updateViewportForImageExport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y;this._aspect=e/t,this._camera.zoom*=Math.min(r/e,n/t),this._renderer.setViewport(0,0,e,t)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y,s=0,o=0,a=e,l=t;e<r&&(s=(r-e)*.5,s=-s,a=r),t<n&&(o=(n-t)*.5,o=-o,l=n),this._aspect=a/l,this._renderer.setViewport(s,o,a,l)}updateCamera(){if(!!this._camera)if(this._camera.cameraType==="PerspectiveCamera"){let e=this._frameSize.y,t=this._editorSize.y,r=this._fov;if(e>t){let n=fG(e,1080,2160,1,15)/100;r*=e/t,r*=1-n}this._camera.aspect=this._aspect,this._camera.fov=r,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t,!1)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function fG(i,e,t,r,n){return(i-e)/(t-e)*(n-r)+r}var fm=class{constructor(e){this.sharedAssets=new om(e.shared),this.scene=new Zp(e.scene,this.sharedAssets),this.scene.switchActiveCamera(this.scene.activeCamera)}reset(e,t){this.scene.clearScene(this.sharedAssets),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}dispose(){this.scene.dispose()}};var dm=class{constructor({x:e=10,y:t=10}){this._startTime=0;let r=document.getElementById("spe-perfs");r?this.element=r:(this.element=document.createElement("div"),document.body.appendChild(this.element),this.element.style.position="absolute",this.element.style.zIndex="10000",this.element.style.fontFamily="monospace",this.element.style.background="black",this.element.style.color="white",this.element.style.padding="10px",this.element.style.opacity="0.5",this.element.style.fontSize="11px",this.element.setAttribute("id","spe-perfs")),this.element.style.left=`${e}px`,this.element.style.top=`${t}px`}dispose(){var e;(e=this.element.parentElement)==null||e.removeChild(this.element)}start(){this._startTime=performance.now()}end(){let t=performance.now()-this._startTime;this.element.innerHTML=t.toFixed(3)+" ms"}};function dG(i){let e;if(!!i.index)for(let t=0;t<i.index.array.length;t+=3)e=i.index.array[t],i.index.array[t]=i.index.array[t+2],i.index.array[t+2]=e}function Sx(i){return i==="SubdivObject"||i==="NonParametric"?i:"Mesh"}function pG(i,e){let t={};return i.traverseEntity(r=>{var c;if(r.type!=="Mesh"||!("material"in r)||!r.visible||!(r instanceof kt)||Array.isArray(r.material)||r&&r.interaction&&r.interaction.states.length>0)return;let n=r.parent;for(;n;){if(n instanceof kt&&n.interaction&&n.interaction.states.length>1)return;n=n.parent}let s=r.material.uuid,o=e.shared.materials[s];if(o){if(!ui.isMergable(o))return}else{let h=(c=e.scene.objects.get(r.uuid))==null?void 0:c.data;if(h&&"material"in h&&typeof h.material!="string"){if(!ui.isMergable(h.material))return;s=ui.getHash(h.material)}}t[s]||(t[s]={});let l=t[s][Sx(r.objectType)];if(l){if(l.push(r),r.cloner)for(let h of r.cloner.children)l.push(h)}else if(t[s][Sx(r.objectType)]=[r],r.cloner)for(let h of r.cloner.children)t[s][Sx(r.objectType)].push(h)}),t}function mG(i){let e=0;return Object.values(i).forEach(t=>{Object.values(t).forEach(r=>{let n=r.length;n>e&&(e=n)})}),e}function IT(i,e){let t=pG(e,i),r=mG(t),n=new Array(r),s=0,o=new Array(r),a=0,l=new Array(r),c=0,h=new Array(r),u=0;for(let f of Object.values(t))for(let d of Object.values(f)){if(a=0,c=0,d.forEach(m=>{m instanceof kt&&(o[a++]=m.geometry.clone(),l[c++]=m)}),c<2)continue;for(let m=0;m<c;m++)l[m].updateWorldMatrix(!0,!1),o[m].applyMatrix4(l[m].matrixWorld),l[m].matrixWorld.determinant()<0&&dG(o[m]);let p=BM(o.slice(0,a),!1);if(p){let m;switch(d[0].objectType){case"SubdivObject":{console.warn("Turning subdiv object into mesh"),m=new Vt(p,l[0].material);break}default:{m=new Vt(p,l[0].material);break}}m.castShadow=l[0].castShadow,m.receiveShadow=l[0].receiveShadow,e.add(m);let g=v=>{u=0;for(let y of v)y.children&&g(y.children),y instanceof kt&&(Array.isArray(y.material)||t[y.material.uuid]&&t[y.material.uuid][y.objectType]&&t[y.material.uuid][y.objectType].length>1||(h[u++]=y));for(let y=0;y<u;y++)e.attach(h[y])};for(let v=0;v<c;v++){let y=l[v];g(y.children),n[s++]=y}}}for(let f=0;f<s;f++)n[f].removeFromParent()}var gG=new B,RT="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.",BT=class{constructor(e,{autoRender:t=!1}={}){this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this._proxyObjectCache=new Map;this._skipRender=!0;this.autoRender=!1;this.disposed=!1;this.requestRender=()=>{this._skipRender=!1};this.render=()=>{var e,t,r;!this._renderer||(this._rafId=requestAnimationFrame(this.render),(e=this._perfs)==null||e.start(),!(!this.autoRender&&this._skipRender)&&(this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this._skipRender=!this._controls.update():this._skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._transmissionRenderTarget&&(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3)),(t=this._scene.postprocessing)!=null&&t.enabled?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera))),(r=this._perfs)==null||r.end()))};this.resize=Ah(()=>{var e,t,r,n,s;!this._renderer||(this._viewportMode===1&&this._frameView&&(this._frameView.frameSize=gG.set(this._viewportWidth,this._viewportHeight)),(e=this._frameView)==null||e.updateRenderer(),(t=this._scene)!=null&&t.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight,!1),this._viewportMode!==1&&((r=this._frameView)==null||r.updateViewport()),this._camera&&((n=this._frameView)==null||n.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()),(s=this._playmode)==null||s.resize(),this.requestRender())},10);this.canvas=e,this.autoRender=t,window.location.search.includes("perfs")&&(this._perfs=new dm({x:10,y:10}))}async load(e){e.endsWith(".spline")?console.warn(RT+" The .spline files are only meant to be used by the Editor."):e.endsWith(".splinecode")||console.warn(RT);let r=await(await fetch(e)).arrayBuffer();await this.start(r)}async start(e){var f;if(this.disposed)return;let t=await WA(e);Bv(t)&&await rA();let r=new fm(t);if(window.location.search.includes("merge-geometries")){let d=performance.now();IT(t,r.scene);let p=performance.now();console.log("Merged geometries in ",p-d," ms")}this._scene=r.scene,Bv(t)&&this._scene.traverse(d=>{Lt(d)&&d.recomputeBoolean()}),this._sharedAssetsManager=r.sharedAssets,this._sharedAssetsManager.onImageLoad=()=>{this.requestRender()},ET(t.scene,this._scene,this._sharedAssetsManager),this._camera=this._scene.activeCamera;let n=Object.values(t.frames)[0],s,o;if(n)if(n.preset==="fullscreen"){this._viewportMode=1;let{width:d,height:p}=window.getComputedStyle(this.canvas);this.canvas.parentElement&&(d==="300px"||d==="auto")?(this._viewportWidth=this.canvas.parentElement.clientWidth,this.canvas.style.width="100%",s=this.canvas.style.width):this._viewportWidth=this.canvas.clientWidth,this.canvas.parentElement&&(p==="150px"||p==="auto")?(this._viewportHeight=this.canvas.parentElement.clientHeight,this.canvas.style.height="100%",o=this.canvas.style.height):this._viewportHeight=this.canvas.clientHeight}else this._viewportMode=2,this._viewportWidth=n.size[0],this._viewportHeight=n.size[1],s=this._viewportWidth+"px",o=this._viewportHeight+"px";(f=this._scene.postprocessing)!=null&&f.enabled?(this._renderer=new Dt({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene}),this._scene.postprocessing.addEventListener("smaaloaded",this.requestRender)):this._renderer=new Dt({canvas:this.canvas,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),s&&(this.canvas.style.width=s),o&&(this.canvas.style.height=o),this._scene.needsTransmission(void 0)&&(this._transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:js,magFilter:ct,wrapS:Pr,wrapT:Pr}),this._transmissionRenderTarget.depthTexture=new ai(2048,2048),this._scene.needsTransmission(this._transmissionRenderTarget)),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight,!1),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=Zg,this._renderer.setClearColor(this._scene.bgColor,this._scene.alpha),this._frameView=new um(this._renderer,this._camera,new B(this._viewportWidth,this._viewportHeight),new B(window.innerWidth,window.innerHeight)),this._publishData=t.scene.publish;let{enableRotate:a,enablePan:l,enableZoom:c,autoRotate:h,hoverRotatePanMode:u}=this._publishData.orbitControls;(a||l||c||h||u!==0)&&(this._camera.interaction===void 0||this._camera.interaction.states.length<=1)&&(this._controls=new lp(this._camera,this._renderer.domElement),this._controls.fromJSON(this._publishData.orbitControls),this._controls.useKeyEvents=!1,this._controls.addEventListener("change",this.requestRender),this._controls.addEventListener("start",this.requestRender)),this._playmode=new hm(this._renderer,this._scene,this._camera,this),this.resize(),this.render(),this.canvas.parentElement&&(await JS(300),this._resizeObserver=new ResizeObserver(()=>{this._viewportWidth=this.canvas.clientWidth,this._viewportHeight=this.canvas.clientHeight,this.resize()}),this._resizeObserver.observe(this.canvas.parentElement))}findObjectById(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByProperty("uuid",e);return this._createProxyObject(t)}findObjectByName(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByName(e);return this._createProxyObject(t)}getSplineEvents(){var e;return(e=this._playmode)==null?void 0:e.splineEvents}emitEvent(e,t){let r=this.findObjectById(t);r==null||r.emitEvent(e)}emitEventReverse(e,t){let r=this.findObjectById(t);r==null||r.emitEventReverse(e)}addEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.addEventListener(e,t)}removeEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.removeEventListener(e,t)}setZoom(e){var t;(t=this._controls)==null||t.zoomOut(e)}setSize(e,t){this._viewportWidth=e,this._viewportHeight=t,this._viewportMode=2,this.resize()}dispose(){var e,t,r,n,s,o,a;this.disposed=!0,(e=this._playmode)==null||e.deactivate(),(t=this._scene)==null||t.dispose(),this._rafId&&cancelAnimationFrame(this._rafId),this._proxyObjectCache.forEach(l=>{py.unsubscribe(l)}),(r=this._renderer)==null||r.dispose(),(n=this._transmissionRenderTarget)==null||n.dispose(),(o=(s=this._transmissionRenderTarget)==null?void 0:s.depthTexture)==null||o.dispose(),(a=this._sharedAssetsManager)==null||a.dispose(),this._resizeObserver&&this._resizeObserver.disconnect()}_createProxyObject(e){if(e==null)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);let t={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,emitEvent(n){var s;(s=e.interaction)==null||s.emitEvent(n)},emitEventReverse(n){var s;(s=e.interaction)==null||s.emitEventReverse(n)}},r=py(t,(n,s)=>{var a;typeof e[n]!="object"&&((a=Object.getOwnPropertyDescriptor(e,n))==null?void 0:a.writable)&&(e[n]=s),this.requestRender(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,r),r}};export{BT as Application};
|
|
4204
|
+
outputColor=vec4(color,inputColor.a);}`,Qp={DEFAULT:0,ESKIL:1},VA=class extends Wi{constructor({blendFunction:i=vt.NORMAL,technique:e=Qp.DEFAULT,eskil:t=!1,offset:r=.5,darkness:n=.5}={}){super("VignetteEffect",gz,{blendFunction:i,defines:new Map([["VIGNETTE_TECHNIQUE",e.toFixed(0)]]),uniforms:new Map([["offset",new Ce(r)],["darkness",new Ce(n)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(i){this.technique!==i&&(this.defines.set("VIGNETTE_TECHNIQUE",i.toFixed(0)),this.setChanged())}get eskil(){return this.technique===Qp.ESKIL}set eskil(i){this.technique=i?Qp.ESKIL:Qp.DEFAULT}getTechnique(){return this.technique}setTechnique(i){this.technique=i}get offset(){return this.uniforms.get("offset").value}set offset(i){this.uniforms.get("offset").value=i}getOffset(){return this.offset}setOffset(i){this.offset=i}get darkness(){return this.uniforms.get("darkness").value}set darkness(i){this.uniforms.get("darkness").value=i}getDarkness(){return this.darkness}setDarkness(i){this.darkness=i}},Iae=[new Float32Array(3),new Float32Array(3)],Rae=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Bae=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var Nae=[new Float32Array(2),new Float32Array(2)];var Oae=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Fae=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],Uae=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],zae=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Gae=new Map([[$r(0,0,0,0),new Float32Array([0,0,0,0])],[$r(0,0,0,1),new Float32Array([0,0,0,1])],[$r(0,0,1,0),new Float32Array([0,0,1,0])],[$r(0,0,1,1),new Float32Array([0,0,1,1])],[$r(0,1,0,0),new Float32Array([0,1,0,0])],[$r(0,1,0,1),new Float32Array([0,1,0,1])],[$r(0,1,1,0),new Float32Array([0,1,1,0])],[$r(0,1,1,1),new Float32Array([0,1,1,1])],[$r(1,0,0,0),new Float32Array([1,0,0,0])],[$r(1,0,0,1),new Float32Array([1,0,0,1])],[$r(1,0,1,0),new Float32Array([1,0,1,0])],[$r(1,0,1,1),new Float32Array([1,0,1,1])],[$r(1,1,0,0),new Float32Array([1,1,0,0])],[$r(1,1,0,1),new Float32Array([1,1,0,1])],[$r(1,1,1,0),new Float32Array([1,1,1,0])],[$r(1,1,1,1),new Float32Array([1,1,1,1])]]);function Wv(i,e,t){return i+(e-i)*t}function $r(i,e,t,r){let n=Wv(i,e,.75),s=Wv(t,r,1-.25);return Wv(n,s,1-.125)}var gr=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(r){this.effect.blendMode.opacity.value=r},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(r){this.effect.blendMode.setBlendFunction(Number(r))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=vt.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=se({},this),r=Object.getPrototypeOf(this),n=Object.getOwnPropertyNames(r);for(let s of n){let o=Object.getOwnPropertyDescriptor(r,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var lc=class extends gr{constructor(){super(RA),this.blendFunction=vt.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var cc=class extends gr{constructor(){super(BA)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var hc=class extends gr{constructor(){super(OA),this.effect.offset=new B(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var uc=class extends gr{constructor(){super(NA)}};var fc=class extends gr{constructor(){super(UA);this._hue=0}set hue(t){this._hue=t,this.effect.setHue(t)}get hue(){return this._hue}set saturation(t){this.effect.uniforms.get("saturation").value=t}get saturation(){return this.effect.uniforms.get("saturation").value}};var dc=class extends gr{constructor(){super(zA),this.blendFunction=vt.OVERLAY}};var pc=class extends gr{constructor(){super(VA)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var mc=class extends gr{constructor(e){super(FA,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var gc=class extends gr{constructor(){super(GA)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function HA(i,e){return e&&e.enabled&&i.push(e.effect),i}var xu=class extends Yt{constructor(){super();this._scene=new on;this._camera=new Bn;this.effects=new Map;this.loadingManager=new No;this.renderPass=new Jv;this._renderToScreen=!0;this._hasSmaa=!1;this.clock=new Wf,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new lc),this.effects.set("chromaticAberration",new hc),this.effects.set("vignette",new pc),this.effects.set("noise",new dc),this.effects.set("colorAverage",new uc),this.effects.set("hueSaturation",new fc),this.effects.set("brightnessContrast",new cc),this.effects.set("depthOfField",new mc),this.effects.set("pixelation",new gc)}get scene(){return this._scene}set scene(t){this._scene=t}get camera(){return this._camera}set camera(t){this._camera=t}_initSmaa(){if(!this.effectComposer)return;let t=this.effectComposer.passes.length,r=new kA({preset:ta.ULTRA,edgeDetectionMode:Jp.COLOR}),n=()=>{r.removeEventListener("load",n),this.dispatchEvent({type:"smaaloaded"})};r.addEventListener("load",n),r.edgeDetectionMaterial.setPredicationMode(Yv.DEPTH),r.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),r.edgeDetectionMaterial.setPredicationThreshold(.002),r.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Kp(this.camera,r),t),this._hasSmaa=!0}_initPasses(){if(!this.effectComposer||!this.renderer)return;let t;if(this.effectComposer.removeAllPasses(),this._hasSmaa=!1,this.renderPass=new Jv(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let r=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(HA,[]),n=[this.effects.get("pixelation")].reduce(HA,[]);n.length>0&&this.effectComposer.addPass(new Kp(this.camera,...n)),this.effectComposer.addPass(new Kp(this.camera,...r))}else this.effectComposer.addPass(this.renderPass),(KS||Ho)&&ZS<15.5&&this._initSmaa();if(t)return t}reinit(){if(!this.renderer)return Promise.all([]);this.effectComposer=new IA(this.renderer),this._initPasses()}init({renderer:t,camera:r,scene:n}){this.renderer=t,this.scene=n,this.camera=r,this._initCopyPass(),this.reinit()}_initCopyPass(){if(this._savePass)return;let t=new B;this.renderer.getDrawingBufferSize(t),this._rt=new mt(t.x,t.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:Ia,wrapT:Ia}),this._rt.samples=this.renderer.capabilities.isWebGL2?4:0,this._savePass=new Xv(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(t){var n,s;let r=this.effectComposer;!r||(t===!0?((n=this.renderer)!=null&&n.capabilities.isWebGL2&&(r.multisampling=0),r.removePass(this._savePass),r.passes[r.passes.length-1].renderToScreen=!0,r.autoRenderToScreen=!0):(((s=this.renderer)==null?void 0:s.capabilities.isWebGL2)&&!this._hasSmaa&&(r.multisampling=4),r.autoRenderToScreen=!1,r.passes[r.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,this.enabled||(this._savePass.needsDepthTexture=!0),r.addPass(this._savePass)),this._renderToScreen=t)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(t){t&&(Object.keys(t).forEach(r=>{let n=t[r],s=this.effects.get(r);Object.keys(n).forEach(o=>{s[o]=n[o]})}),this.enabled=t.enabled)}toJSON(){let t={};return this.effects.forEach((r,n)=>{t[n]=r.toJSON()},t),se({enabled:this.enabled},t)}render(){var t;(t=this.effectComposer)==null||t.render(this.clock.getDelta())}setScissor(t,r,n,s){if(!this.effectComposer||!this.renderer)return;t instanceof Je?(this.effectComposer.inputBuffer.scissor.set(t.x,t.y,t.z,t.w),this.effectComposer.outputBuffer.scissor.set(t.x,t.y,t.z,t.w)):(this.effectComposer.inputBuffer.scissor.set(t,r,n,s),this.effectComposer.outputBuffer.scissor.set(t,r,n,s));let o=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(o),this.effectComposer.outputBuffer.scissor.multiplyScalar(o),this.renderer.setScissor(t,r,n,s)}setScissorTest(t){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=t,this.effectComposer.outputBuffer.scissorTest=t,this.renderer.setScissorTest(t))}setViewport(t,r,n,s){!this.effectComposer||(t instanceof Je?(this.effectComposer.inputBuffer.viewport.copy(t),this.effectComposer.outputBuffer.viewport.copy(t)):(this.effectComposer.inputBuffer.viewport.set(t,r,n,s),this.effectComposer.outputBuffer.viewport.set(t,r,n,s)))}resize(t,r,n){var s,o;if((s=this.effectComposer)==null||s.setSize(t,r,n),this._rt){let a=((o=this.renderer)==null?void 0:o.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(t*a,r*a)}}dispose(){var t;this._listeners=void 0,(t=this.effectComposer)==null||t.dispose()}};var Zp=class extends yu{constructor(t,r){super(t,r);this.postprocessing=new xu;this.initPostprocessing(t.postprocessing)}resetAfterClear(t,r){super.resetAfterClear(t,r),this.initPostprocessing(t.postprocessing)}initPostprocessing(t){let s=t,{enabled:r}=s,n=Tx(s,["enabled"]);for(let o of Object.entries(n)){let a=o[1],l=this.postprocessing.effects.get(o[0]);if(l){l.enabled=a.enabled;for(let[c,h]of Object.entries(a))l[c]=h}}this.postprocessing.enabled=r,this.postprocessing.reinit()}dispose(){super.dispose(),this.postprocessing.dispose()}switchActiveCamera(t){super.switchActiveCamera(t),this.postprocessing&&(this.postprocessing.camera=t)}};var Zv=new WeakMap,$p=class extends cn{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,n){let s=new as(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let s={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let r=JSON.stringify(t);if(Zv.has(e)){let l=Zv.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(n=l,new Promise((c,h)=>{n._callbacks[s]={resolve:c,reject:h},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{n&&s&&this._releaseTask(n,s)}),Zv.set(e,{key:r,promise:a}),a}_createGeometry(e){let t=new De;e.index&&t.setIndex(new Ve(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let n=e.attributes[r],s=n.name,o=n.array,a=n.itemSize;t.setAttribute(s,new Ve(o,a))}return t}_loadLibrary(e,t){let r=new as(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((n,s)=>{r.load(e,n,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(r=>{let n=r[0];e||(this.decoderConfig.wasmBinary=r[1]);let s=vz.toString(),o=["/* draco decoder */",n,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
4205
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(s){let o=s.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,s){return n._taskLoad>s._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}};function vz(){let i,e;onmessage=function(o){let a=o.data;switch(a.type){case"init":i=a.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":let l=a.buffer,c=a.taskConfig;e.then(h=>{let u=h.draco,f=new u.Decoder,d=new u.DecoderBuffer;d.Init(new Int8Array(l),l.byteLength);try{let p=t(u,f,d,c),m=p.attributes.map(g=>g.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{u.destroy(d),u.destroy(f)}});break}};function t(o,a,l,c){let h=c.attributeIDs,u=c.attributeTypes,f,d,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)f=new o.Mesh,d=a.DecodeBufferToMesh(l,f);else if(p===o.POINT_CLOUD)f=new o.PointCloud,d=a.DecodeBufferToPointCloud(l,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());let m={index:null,attributes:[]};for(let g in h){let v=self[u[g]],y,w;if(c.useUniqueIDs)w=h[g],y=a.GetAttributeByUniqueId(f,w);else{if(w=a.GetAttributeId(f,o[h[g]]),w===-1)continue;y=a.GetAttribute(f,w)}m.attributes.push(n(o,a,f,g,v,y))}return p===o.TRIANGULAR_MESH&&(m.index=r(o,a,f)),o.destroy(f),m}function r(o,a,l){let h=l.num_faces()*3,u=h*4,f=o._malloc(u);a.GetTrianglesUInt32Array(l,u,f);let d=new Uint32Array(o.HEAPF32.buffer,f,h).slice();return o._free(f),{array:d,itemSize:1}}function n(o,a,l,c,h,u){let f=u.num_components(),p=l.num_points()*f,m=p*h.BYTES_PER_ELEMENT,g=s(o,h),v=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,u,g,m,v);let y=new h(o.HEAPF32.buffer,v,p).slice();return o._free(v),{name:c,array:y,itemSize:f}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var vo;function xz(){return vo||(vo=new $p,vo.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload()),vo.decoderPending}async function bz(i){if(vo){let e={attributeIDs:vo.defaultAttributeIDs,attributeTypes:vo.defaultAttributeTypes,useUniqueIDs:!1},t;try{t=await vo.decodeGeometry(new Int8Array(i).buffer,e)}catch(r){console.error(r)}if(t)return{index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map(([r,n])=>({name:r,itemSize:n.itemSize,array:n.array}))}}return null}async function WA(i){let[e,t]=Ay(ep.deserialize(new Uint8Array(i))),r=[];e.scene.objects.traverse((n,s)=>{s.type==="Mesh"&&s.geometry.type==="NonParametricGeometry"&&s.geometry.data.draco!==void 0&&r.push(s)}),r.length&&await xz();for(let n of r){let s=await bz(_y(n.geometry.data.draco));if(s){s.index&&(n.geometry.data.index={array:s.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let o={};s.attributes.forEach(({name:a,array:l,itemSize:c})=>{o[a]={array:l,itemSize:c,type:"Float32Array",normalized:!1}}),n.geometry.data.attributes=o,n.geometry.data.draco=void 0}}return t.result().data}var JA={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},rx={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},wz=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],tm={CSS:{},springs:{}};function ji(i,e,t){return Math.min(Math.max(i,e),t)}function bu(i,e){return i.indexOf(e)>-1}function $v(i,e){return i.apply(null,e)}var Xe={arr:function(i){return Array.isArray(i)},obj:function(i){return bu(Object.prototype.toString.call(i),"Object")},pth:function(i){return Xe.obj(i)&&i.hasOwnProperty("totalLength")},svg:function(i){return i instanceof SVGElement},inp:function(i){return i instanceof HTMLInputElement},dom:function(i){return!("isNode"in i)&&(i.nodeType||Xe.svg(i))},str:function(i){return typeof i=="string"},fnc:function(i){return typeof i=="function"},und:function(i){return typeof i>"u"},hex:function(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)},rgb:function(i){return/^rgb/.test(i)},hsl:function(i){return/^hsl/.test(i)},col:function(i){return Xe.hex(i)||Xe.rgb(i)||Xe.hsl(i)},key:function(i){return!JA.hasOwnProperty(i)&&!rx.hasOwnProperty(i)&&i!=="targets"&&i!=="keyframes"}};function KA(i){var e=/\(([^)]+)\)/.exec(i);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function ZA(i,e){var t=KA(i),r=ji(Xe.und(t[0])?1:t[0],.1,100),n=ji(Xe.und(t[1])?100:t[1],.1,100),s=ji(Xe.und(t[2])?10:t[2],.1,100),o=ji(Xe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),c=l<1?a*Math.sqrt(1-l*l):0,h=1,u=l<1?(l*a+-o)/c:-o+a;function f(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(h*Math.cos(c*m)+u*Math.sin(c*m)):m=(h+u*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function d(){var p=tm.springs[i];if(p)return p;for(var m=1/6,g=0,v=0;;)if(g+=m,f(g)===1){if(v++,v>=16)break}else v=0;var y=g*m*1e3;return tm.springs[i]=y,y}return e?f:d}function Sz(i){return i===void 0&&(i=10),function(e){return Math.ceil(ji(e,1e-6,1)*i)*(1/i)}}var Mz=function(){var i=11,e=1/(i-1);function t(h,u){return 1-3*u+3*h}function r(h,u){return 3*u-6*h}function n(h){return 3*h}function s(h,u,f){return((t(u,f)*h+r(u,f))*h+n(u))*h}function o(h,u,f){return 3*t(u,f)*h*h+2*r(u,f)*h+n(u)}function a(h,u,f,d,p){var m,g,v=0;do g=u+(f-u)/2,m=s(g,d,p)-h,m>0?f=g:u=g;while(Math.abs(m)>1e-7&&++v<10);return g}function l(h,u,f,d){for(var p=0;p<4;++p){var m=o(u,f,d);if(m===0)return u;var g=s(u,f,d)-h;u-=g/m}return u}function c(h,u,f,d){if(!(0<=h&&h<=1&&0<=f&&f<=1))return;var p=new Float32Array(i);if(h!==u||f!==d)for(var m=0;m<i;++m)p[m]=s(m*e,h,f);function g(v){for(var y=0,w=1,b=i-1;w!==b&&p[w]<=v;++w)y+=e;--w;var S=(v-p[w])/(p[w+1]-p[w]),T=y+S*e,A=o(T,h,f);return A>=.001?l(v,T,h,f):A===0?T:a(v,y,y+e,h,f)}return function(v){return h===u&&f===d||v===0||v===1?v:s(g(v),u,d)}}return c}(),$A=function(){var i={linear:function(){return function(r){return r}}},e={Sine:function(){return function(r){return 1-Math.cos(r*Math.PI/2)}},Circ:function(){return function(r){return 1-Math.sqrt(1-r*r)}},Back:function(){return function(r){return r*r*(3*r-2)}},Bounce:function(){return function(r){for(var n,s=4;r<((n=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((n*3-2)/22-r,2)}},Elastic:function(r,n){r===void 0&&(r=1),n===void 0&&(n=.5);var s=ji(r,1,10),o=ji(n,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(r,n){e[r]=function(){return function(s){return Math.pow(s,n+2)}}}),Object.keys(e).forEach(function(r){var n=e[r];i["easeIn"+r]=n,i["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},i["easeInOut"+r]=function(s,o){return function(a){return a<.5?n(s,o)(a*2)/2:1-n(s,o)(a*-2+2)/2}}}),i}();function nx(i,e){if(Xe.fnc(i))return i;var t=i.split("(")[0],r=$A[t],n=KA(i);switch(t){case"spring":return ZA(i,e);case"cubicBezier":return $v(Mz,n);case"steps":return $v(Sz,n);default:return $v(r,n)}}function eT(i){try{var e=document.querySelectorAll(i);return e}catch{return}}function rm(i,e){for(var t=i.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s<t;s++)if(s in i){var o=i[s];e.call(r,o,s,i)&&n.push(o)}return n}function nm(i){return i.reduce(function(e,t){return e.concat(Xe.arr(t)?nm(t):t)},[])}function jA(i){return Xe.arr(i)?i:(Xe.str(i)&&(i=eT(i)||i),i instanceof NodeList||i instanceof HTMLCollection?[].slice.call(i):[i])}function ix(i,e){return i.some(function(t){return t===e})}function sx(i){var e={};for(var t in i)e[t]=i[t];return e}function ex(i,e){var t=sx(i);for(var r in i)t[r]=e.hasOwnProperty(r)?e[r]:i[r];return t}function im(i,e){var t=sx(i);for(var r in e)t[r]=Xe.und(i[r])?e[r]:i[r];return t}function Az(i){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(i);return e?"rgba("+e[1]+",1)":i}function Tz(i){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,t=i.replace(e,function(a,l,c,h){return l+l+c+c+h+h}),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),n=parseInt(r[1],16),s=parseInt(r[2],16),o=parseInt(r[3],16);return"rgba("+n+","+s+","+o+",1)"}function _z(i){var e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(i)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(i),t=parseInt(e[1],10)/360,r=parseInt(e[2],10)/100,n=parseInt(e[3],10)/100,s=e[4]||1;function o(f,d,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?f+(d-f)*6*p:p<1/2?d:p<2/3?f+(d-f)*(2/3-p)*6:f}var a,l,c;if(r==0)a=l=c=n;else{var h=n<.5?n*(1+r):n+r-n*r,u=2*n-h;a=o(u,h,t+1/3),l=o(u,h,t),c=o(u,h,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function Ez(i){if(Xe.rgb(i))return Az(i);if(Xe.hex(i))return Tz(i);if(Xe.hsl(i))return _z(i)}function vs(i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(i);if(e)return e[1]}function Cz(i){if(bu(i,"translate")||i==="perspective")return"px";if(bu(i,"rotate")||bu(i,"skew"))return"deg"}function tx(i,e){return Xe.fnc(i)?i(e.target,e.id,e.total):i}function qi(i,e){return i.getAttribute(e)}function ox(i,e,t){var r=vs(e);if(ix([t,"deg","rad","turn"],r))return e;var n=tm.CSS[e+t];if(!Xe.und(n))return n;var s=100,o=document.createElement(i.tagName),a=i.parentNode&&i.parentNode!==document?i.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return tm.CSS[e+t]=c,c}function tT(i,e,t){if(e in i.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=i.style[e]||getComputedStyle(i).getPropertyValue(r)||"0";return t?ox(i,n,t):n}}function ax(i,e){if(Xe.dom(i)&&!Xe.inp(i)&&(qi(i,e)||Xe.svg(i)&&i[e]))return"attribute";if(Xe.dom(i)&&ix(wz,e))return"transform";if(Xe.dom(i)&&e!=="transform"&&tT(i,e))return"css";if(i[e]!=null)return"object"}function rT(i){if(!!Xe.dom(i)){for(var e=i.style.transform||"",t=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=t.exec(e);)r.set(n[1],n[2]);return r}}function Pz(i,e,t,r){var n=bu(e,"scale")?1:0+Cz(e),s=rT(i).get(e)||n;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),r?ox(i,s,r):s}function lx(i,e,t,r){switch(ax(i,e)){case"transform":return Pz(i,e,r,t);case"css":return tT(i,e,t);case"attribute":return qi(i,e);default:return i[e]||0}}function cx(i,e){var t=/^(\*=|\+=|-=)/.exec(i);if(!t)return i;var r=vs(i)||0,n=parseFloat(e),s=parseFloat(i.replace(t[0],""));switch(t[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function nT(i,e){if(Xe.col(i))return Ez(i);if(/\s/g.test(i))return i;var t=vs(i),r=t?i.substr(0,i.length-t.length):i;return e?r+e:r}function hx(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Dz(i){return Math.PI*2*qi(i,"r")}function Lz(i){return qi(i,"width")*2+qi(i,"height")*2}function Iz(i){return hx({x:qi(i,"x1"),y:qi(i,"y1")},{x:qi(i,"x2"),y:qi(i,"y2")})}function iT(i){for(var e=i.points,t=0,r,n=0;n<e.numberOfItems;n++){var s=e.getItem(n);n>0&&(t+=hx(r,s)),r=s}return t}function Rz(i){var e=i.points;return iT(i)+hx(e.getItem(e.numberOfItems-1),e.getItem(0))}function sT(i){if(i.getTotalLength)return i.getTotalLength();switch(i.tagName.toLowerCase()){case"circle":return Dz(i);case"rect":return Lz(i);case"line":return Iz(i);case"polyline":return iT(i);case"polygon":return Rz(i)}}function Bz(i){var e=sT(i);return i.setAttribute("stroke-dasharray",e),e}function Nz(i){for(var e=i.parentNode;Xe.svg(e)&&Xe.svg(e.parentNode);)e=e.parentNode;return e}function oT(i,e){var t=e||{},r=t.el||Nz(i),n=r.getBoundingClientRect(),s=qi(r,"viewBox"),o=n.width,a=n.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function Oz(i,e){var t=Xe.str(i)?eT(i)[0]:i,r=e||100;return function(n){return{property:n,el:t,svg:oT(t),totalLength:sT(t)*(r/100)}}}function Fz(i,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return i.el.getPointAtLength(l)}var r=oT(i.el,i.svg),n=t(),s=t(-1),o=t(1);switch(i.property){case"x":return(n.x-r.x)*r.w;case"y":return(n.y-r.y)*r.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function qA(i,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=nT(Xe.pth(i)?i.totalLength:i,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:Xe.str(i)||e?r.split(t):[]}}function aT(i){var e=i?nm(Xe.arr(i)?i.map(jA):jA(i)):[];return rm(e,function(t,r,n){return n.indexOf(t)===r})}function lT(i){var e=aT(i);return e.map(function(t,r){return{target:t,id:r,total:e.length,transforms:{list:rT(t)}}})}function Uz(i,e){var t=sx(e);if(/^spring/.test(t.easing)&&(t.duration=ZA(t.easing)),Xe.arr(i)){var r=i.length,n=r===2&&!Xe.obj(i[0]);n?i={value:i}:Xe.fnc(e.duration)||(t.duration=e.duration/r)}var s=Xe.arr(i)?i:[i];return s.map(function(o,a){var l=Xe.obj(o)&&!Xe.pth(o)?o:{value:o};return Xe.und(l.delay)&&(l.delay=a?0:e.delay),Xe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return im(o,t)})}function zz(i){for(var e=rm(nm(i.map(function(s){return Object.keys(s)})),function(s){return Xe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},r=function(s){var o=e[s];t[o]=i.map(function(a){var l={};for(var c in a)Xe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},n=0;n<e.length;n++)r(n);return t}function Gz(i,e){var t=[],r=e.keyframes;r&&(e=im(zz(r),e));for(var n in e)Xe.key(n)&&t.push({name:n,tweens:Uz(e[n],i)});return t}function kz(i,e){var t={};for(var r in i){var n=tx(i[r],e);Xe.arr(n)&&(n=n.map(function(s){return tx(s,e)}),n.length===1&&(n=n[0])),t[r]=n}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}function Vz(i,e){var t;return i.tweens.map(function(r){var n=kz(r,e),s=n.value,o=Xe.arr(s)?s[1]:s,a=vs(o),l=lx(e.target,i.name,a,e),c=t?t.to.original:l,h=Xe.arr(s)?s[0]:c,u=vs(h)||vs(l),f=a||u;return Xe.und(o)&&(o=c),n.from=qA(h,f),n.to=qA(cx(o,h),f),n.start=t?t.end:0,n.end=n.start+n.delay+n.duration+n.endDelay,n.easing=nx(n.easing,n.duration),n.isPath=Xe.pth(s),n.isColor=Xe.col(n.from.original),n.isColor&&(n.round=1),t=n,n})}var cT={css:function(i,e,t){return i.style[e]=t},attribute:function(i,e,t){return i.setAttribute(e,t)},object:function(i,e,t){return i[e]=t},transform:function(i,e,t,r,n){if(r.list.set(e,t),e===r.last||n){var s="";r.list.forEach(function(o,a){s+=a+"("+o+") "}),i.style.transform=s}}};function hT(i,e){var t=lT(i);t.forEach(function(r){for(var n in e){var s=tx(e[n],r),o=r.target,a=vs(s),l=lx(o,n,a,r),c=a||vs(l),h=cx(nT(s,c),l),u=ax(o,n);cT[u](o,n,h,r.transforms,!0)}})}function Hz(i,e){var t=ax(i.target,e.name);if(t){var r=Vz(e,i),n=r[r.length-1];return{type:t,property:e.name,animatable:i,tweens:r,duration:n.end,delay:r[0].delay,endDelay:n.endDelay}}}function Wz(i,e){return rm(nm(i.map(function(t){return e.map(function(r){return Hz(t,r)})})),function(t){return!Xe.und(t)})}function uT(i,e){var t=i.length,r=function(s){return s.timelineOffset?s.timelineOffset:0},n={};return n.duration=t?Math.max.apply(Math,i.map(function(s){return r(s)+s.duration})):e.duration,n.delay=t?Math.min.apply(Math,i.map(function(s){return r(s)+s.delay})):e.delay,n.endDelay=t?n.duration-Math.max.apply(Math,i.map(function(s){return r(s)+s.duration-s.endDelay})):e.endDelay,n}var YA=0;function jz(i){var e=ex(JA,i),t=ex(rx,i),r=Gz(t,i),n=lT(i.targets),s=Wz(n,r),o=uT(s,t),a=YA;return YA++,im(e,{id:a,children:[],animatables:n,animations:s,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}var Tn=[],XA=[],em,qz=function(){function i(){em=requestAnimationFrame(e)}function e(t){var r=Tn.length;if(r){for(var n=0;n<r;){var s=Tn[n];if(!s.paused)s.tick(t);else{var o=Tn.indexOf(s);o>-1&&(Tn.splice(o,1),r=Tn.length)}n++}i()}else em=cancelAnimationFrame(em)}return i}();function Yz(){document.hidden?(Tn.forEach(function(i){return i.pause()}),XA=Tn.slice(0),Sr.running=Tn=[]):XA.forEach(function(i){return i.play()})}typeof document<"u"&&document.addEventListener("visibilitychange",Yz);function Sr(i){i===void 0&&(i={});var e=0,t=0,r=0,n,s=0,o=null;function a(w){var b=window.Promise&&new Promise(function(S){return o=S});return w.finished=b,b}var l=jz(i),c=a(l);function h(){var w=l.direction;w!=="alternate"&&(l.direction=w!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(b){return b.reversed=l.reversed})}function u(w){return l.reversed?l.duration-w:w}function f(){e=0,t=u(l.currentTime)*(1/Sr.speed)}function d(w,b){b&&b.seek(w-b.timelineOffset)}function p(w){if(l.reversePlayback)for(var S=s;S--;)d(w,n[S]);else for(var b=0;b<s;b++)d(w,n[b])}function m(w){var b=0,S=l.animations,T=S.length;for(l.reversePlayback===!0&&l.rewind===!1&&(w=l.duration+l.delay-l.endDelay-w);b<T;){var A=S[b],x=A.animatable,_=A.tweens,E=_.length-1,C=_[E];E&&(C=rm(_,function(ie){return w<ie.end})[0]||C);for(var I=ji(w-C.start-C.delay,0,C.duration)/C.duration,N=isNaN(I)?1:C.easing(I),R=C.to.strings,k=C.round,G=[],K=C.to.numbers.length,J=void 0,Y=0;Y<K;Y++){var F=void 0;if(l.reversePlayback===!0&&l.rewind===!1)var U=C.to.numbers[Y],O=C.from.numbers[Y]||0;else var O=C.to.numbers[Y],U=C.from.numbers[Y]||0;C.isPath?F=Fz(C.value,N*O):F=U+N*(O-U),k&&(C.isColor&&Y>2||(F=Math.round(F*k)/k)),G.push(F)}var j=R.length;if(!j)J=G[0];else{J=R[0];for(var H=0;H<j;H++){var X=R[H],V=R[H+1],he=G[H];isNaN(he)||(V?J+=he+V:J+=he+" ")}}cT[A.type](x.target,A.property,J,x.transforms),A.currentValue=J,b++}}function g(w){l[w]&&!l.passThrough&&l[w](l)}function v(){l.remaining&&l.remaining!==!0&&l.remaining--}function y(w){var b=l.duration,S=l.delay,T=b-l.endDelay,A=u(w);l.progress=ji(A/b*100,0,100),l.reversePlayback=A<l.currentTime,n&&p(A),!l.began&&l.currentTime>=0&&(l.began=!0,g("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,g("loopBegin")),A<=S&&l.currentTime!==0&&(m(0),g("change")),(A>=T&&l.currentTime!==b||!b)&&(m(b),g("change")),A>S&&A<T?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,g("changeBegin")),g("change"),m(A)):l.changeBegan?(l.changeCompleted=!0,l.changeBegan=!1,g("change"),g("changeComplete")):l.began&&A>T&&(g("change"),g("changeComplete")),l.currentTime=ji(A,0,b),l.began&&g("update"),w>=b&&(t=0,v(),l.remaining?(e=r,g("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&h()):(l.paused=!0,l.completed||(l.completed=!0,g("loopComplete"),g("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var w=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=w==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||w==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(w,b){return hT(w,b),l},l.tick=function(w){r=w,e||(e=r),y((r+(t-e))*Sr.speed)},l.seek=function(w){y(u(w))},l.pause=function(){l.paused=!0,f()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,Tn.push(l),f(),em||qz())},l.reverse=function(){h(),l.completed=!l.reversed,f()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function QA(i,e){for(var t=e.length;t--;)ix(i,e[t].animatable.target)&&e.splice(t,1)}function Xz(i){for(var e=aT(i),t=Tn.length;t--;){var r=Tn[t],n=r.animations,s=r.children;QA(e,n);for(var o=s.length;o--;){var a=s[o],l=a.animations;QA(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!n.length&&!s.length&&r.pause()}}function Qz(i,e){e===void 0&&(e={});var t=e.direction||"normal",r=e.easing?nx(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",h=Xe.arr(i),u=parseFloat(h?i[0]:i),f=h?parseFloat(i[1]):0,d=vs(h?i[1]:i)||0,p=e.start||0+(h?u:0),m=[],g=0;return function(v,y,w){if(a&&(o=0),l&&(o=(w-1)/2),c&&(o=w-1),!m.length){for(var b=0;b<w;b++){if(!n)m.push(Math.abs(o-b));else{var S=l?(n[0]-1)/2:o%n[0],T=l?(n[1]-1)/2:Math.floor(o/n[0]),A=b%n[0],x=Math.floor(b/n[0]),_=S-A,E=T-x,C=Math.sqrt(_*_+E*E);s==="x"&&(C=-_),s==="y"&&(C=-E),m.push(C)}g=Math.max.apply(Math,m)}r&&(m=m.map(function(N){return r(N/g)*g})),t==="reverse"&&(m=m.map(function(N){return s?N<0?N*-1:-N:Math.abs(g-N)}))}var I=h?(f-u)/g:u;return p+I*(Math.round(m[y]*100)/100)+d}}function Jz(i){i===void 0&&(i={});var e=Sr(i);return e.duration=0,e.add=function(t,r){var n=Tn.indexOf(e),s=e.children;n>-1&&Tn.splice(n,1);function o(f){f.passThrough=!0}for(var a=0;a<s.length;a++)o(s[a]);var l=im(t,ex(rx,i));l.targets=l.targets||i.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=Xe.und(r)?c:cx(r,c),o(e),l.rewind=e.rewind,e.seek(l.timelineOffset);var h=Sr(l);o(h),s.push(h);var u=uT(s,i);return e.delay=u.delay,e.endDelay=u.endDelay,e.duration=u.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}Sr.version="3.2.0";Sr.speed=1;Sr.running=Tn;Sr.remove=Xz;Sr.get=lx;Sr.set=hT;Sr.convertPx=ox;Sr.path=Oz;Sr.setDashoffset=Bz;Sr.stagger=Qz;Sr.timeline=Jz;Sr.easing=nx;Sr.penner=$A;Sr.random=function(i,e){return Math.floor(Math.random()*(e-i+1))+i};var fT=Sr;function dT(i,e,t){var n,s;let r=i.cameraType==="OrthographicCamera"?(n=e.orthographic)==null?void 0:n.zoom:(s=e.perspective)==null?void 0:s.zoom;if(r!==void 0){let o=i.zoom;o!==r&&t.push({change:a=>{i.zoom=et.lerp(o,r,a),i.updateProjectionMatrix()}})}if(e.targetOffset!==void 0){let o=i.targetOffset,a=e.targetOffset;o!==a&&t.push({change:l=>{i.targetOffset=et.lerp(o,a,l)}})}}function pT(i,e,t){if(e.width!==void 0&&e.height!==void 0&&e.depth!==void 0){let{width:r,height:n,depth:s}=i.geometry.userData.parameters,o=[r,n,s],a=[e.width,e.height,e.depth];!br.isEqual(o,a)&&!Lt(i)&&t.push({change:l=>{let[c,h,u]=br.lerp(o,a,l);i.updateGeometry({parameters:{width:c,height:h,depth:u}}),i.invalidateDownstreamBooleanData()}})}}function mT(i,e,t,r){if(e.intensity!==void 0){let n=i.intensity,s=e.intensity;n!==s&&t.push({change:o=>{i.intensity=et.lerp(n,s,o)}})}if(e.color!==void 0){let n=i.color.clone(),s=typeof e.color=="string"?r.getColor(e.color):e.color;if(!Ar.equals(n,s)){let o=n.clone();i.color=o,t.push({change:a=>{let{r:l,g:c,b:h}=Ar.lerp(n,s,a);o.setRGB(l,c,h)}})}}}function gT(i,e,t,r){var s,o;let n=i.layersList.head;for(;n;){let a=e.layers.data(n.uuid);if(a&&((s=n.visible)!=null?s:!0)&&((o=a.visible)!=null?o:!0)){let l=n.getNames().filter(c=>!CM.some(h=>c.includes(h)));for(let c of l)try{let h=n.getValue(c);if(c==="steps")rG(n,a,c,t);else if(c==="colors")nG(n,a,c,t);else if(typeof h=="number")Kz(n,a,c,t);else{if(typeof h=="boolean")continue;"isVector2"in h?Zz(n,a,c,t):"isVector3"in h?$z(n,a,c,t):"isColorA"in h?tG(n,a,c,t,r):"isColor"in h?eG(n,a,c,t,r):"isTexture"in h&&iG(n,a,c,t)}}catch(h){console.error(`animateMaterial: unexpected material layer for ${c}`,h)}}n=n.next}}function Kz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];n!==s&&r.push({change:o=>{i.setValue(t,et.lerp(n,s,o))}})}function Zz(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];us.isEqual(s,o)||r.push({change:a=>{n.fromArray(us.lerp(s,o,a))}})}function $z(i,e,t,r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=n.toArray(),o=e[t];br.isEqual(s,o)||r.push({change:a=>{n.fromArray(br.lerp(s,o,a))}})}function eG(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Ar.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:h,g:u,b:f}=Ar.lerp(s,a,c);l.setRGB(h,u,f)}})}function tG(i,e,t,r,n){if(!i.hasValue(t)||!(t in e))return;let s=i.getValue(t).clone(),o=e[t],a=typeof o=="string"?n.getColor(o):o;if(Ln.equals(s,a))return;let l=s.clone();i.setValue(t,l),r.push({change:c=>{let{r:h,g:u,b:f,a:d}=Ln.lerp(s,a,c);l.setRGBA(h,u,f,d)}})}function rG(i,e,t="steps",r){if(!i.hasValue(t)||!(t in e))return;let n=[...i.getValue(t)],s=e[t];for(let o=0;o<n.length;++o){let a=n[o],l=s[o];a!==l&&r.push({change:c=>{n[o]=et.lerp(a,l,c),i.setValue("steps",n)}})}}function nG(i,e,t="colors",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue(t),s=e[t];for(let o=0;o<n.length;++o){let a=n[o].toArray(),l=s[o];Ph.isEqual(a,l)||r.push({change:c=>{n[o].fromArray(Ph.lerp(a,l,c))}})}}function iG(i,e,t="texture",r){if(!i.hasValue(t)||!(t in e))return;let n=i.getValue("texture"),s=e[t],o=n.repeat.toArray(),a=n.offset.toArray(),l=s.repeat,c=s.offset;(!us.isEqual(o,l)||!us.isEqual(a,c))&&r.push({change:h=>{n.repeat.fromArray(us.lerp(o,l,h)),n.offset.fromArray(us.lerp(a,c,h)),n.updateMatrix(),n.needsUpdate=!0}})}function yT(i,e,t,r){if(r===0)return t.copy(i);if(r===1)return t.copy(e);let n=i.w*e.w+i.x*e.x+i.y*e.y+i.z*e.z;if(n>=1)return t.copy(i);let s=1-n*n;if(s<=Number.EPSILON){let h=1-r;return t.w=h*i.w+r*e.w,t.x=h*i.x+r*e.x,t.y=h*i.y+r*e.y,t.z=h*i.z+r*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,n),l=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o;return t.w=i.w*l+e.w*c,t.x=i.x*l+e.x*c,t.y=i.y*l+e.y*c,t.z=i.z*l+e.z*c,t}function vT(i,e,t=0){let r=Array.isArray(i.material)?i.material[t]:i.material,n;return"materials"in e?n=e.materials[t]:"material"in e&&(n=e.material),[r,n]}var ux=new M,fx=new M,xT=new zt,sG=new yn,oG=new Ae;function bT(i,e,t,r){if(t.position!==void 0){let n=i.position.toArray(),s=t.position;br.isEqual(n,s)||r.push({change:o=>{i.position.fromArray(br.lerp(n,s,o)),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}if(t.scale!==void 0){let n=i.scale.toArray(),s=t.scale;br.isEqual(n,s)||r.push({change:o=>{i.scale.fromArray(br.lerp(n,s,o)),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}aG(i,e,t,r),lG(i,t,r)}function aG(i,e,t,r){if(t.rotation===void 0)return;let n=ux.setFromEuler(i.rotation).toArray(),s=t.rotation;if(br.isEqual(n,s))return;if(br.sub(t.rotation,e?e.rotation:i.rotation).every(a=>Math.abs(a)<2*Math.PI)){let a=i.quaternion.clone(),l=new zt().setFromEuler(sG.set(t.rotation[0],t.rotation[1],t.rotation[2]));r.push({change:c=>{yT(a,l,i.quaternion,c),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}else r.push({change:a=>{i.rotation.setFromVector3(fx.fromArray(br.lerp(n,s,a))),i.updateMatrix(),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}function lG(i,e,t){if(e.hiddenMatrix!==void 0&&!Di.isEqual(i.hiddenMatrix.toArray(),e.hiddenMatrix)){let r=new M,n=new zt,s=new M;i.hiddenMatrix.decompose(r,n,s);let o=new M,a=new zt,l=new M;oG.fromArray(e.hiddenMatrix).decompose(o,a,l),t.push({change:c=>{xT.slerpQuaternions(n,a,c),ux.lerpVectors(r,o,c),fx.lerpVectors(s,l,c),i.hiddenMatrix.compose(ux,xT,fx),er(i)&&Lt(i.parent)&&i.invalidateDownstreamBooleanData(!0)}})}}function wT(i,e,t,r){let n=[];if((i.visible||Lt(i.parent))&&bT(i,e==null?void 0:e.objectState,t.objectState,n),er(i)){if((i.visible||Lt(i.parent))&&"geometry"in t.objectState&&pT(i,t.objectState.geometry,n),i.visible&&("material"in t.objectState||"materials"in t.objectState)){let[s,o]=vT(i,t.objectState,i.selectedMaterial);s&&o&&typeof o!="string"&&gT(s,o,n,r)}}else i.visible&&k1(i)?mT(i,t.objectState,n,r):G1(i)&&dT(i,t.objectState,n);return n.length?{change:s=>{n.forEach(o=>{o.change&&o.change(s)})}}:void 0}function cG(i,e,t){switch(i){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 5:let{control1:r,control2:n}=e!=null?e:se({},Od.defaultData);return`cubicBezier( ${r[0]}, ${r[1]}, ${n[0]}, ${n[1]} )`;case 6:let{mass:s,stiffness:o,damping:a,velocity:l}=t!=null?t:se({},Nd.defaultData);return`spring( ${s}, ${o}, ${a}, ${l} )`}}var sm=class{constructor(e,t){this.object=e;this.sharedAssets=t;this.uuid=et.generateUUID();this.states=[];this.events={};this.animatingState=0;this._scrollCounter=null}get fromState(){return this._fromState}get animation(){return this._animation}start(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._scrollCounter=null),this.states.length>1&&(this.states[0].execute(this.object,this.sharedAssets),this._toState=this.states[0],this._fromState=void 0)}end(){this._animation!==void 0&&(this._animation.pause(),this._animation=void 0),this.states.length>1&&this.states[0].execute(this.object,this.sharedAssets),this._toState=void 0,this._fromState=void 0}seek(e,t,r,n,s){var o;this._scrollCounter===null&&(this.animate(e,n,s),this._scrollCounter=0),this._scrollCounter+=t,this._scrollCounter=Math.min(Math.max(this._scrollCounter,0),r),(o=this._animation)==null||o.seek(this._scrollCounter/r*(n.duration?n.duration:1))}animate(e,t,r){var n,s,o,a,l,c,h;if(this._fromState===e&&((n=this._animation)==null?void 0:n.reversed)){let u=(o=(s=this._animation)==null?void 0:s.currentTime)!=null?o:0;(a=this._animation)==null||a.reset(),(l=this._animation)==null||l.seek(u),(c=this._animation)==null||c.play()}else if(this._toState!==e){this._animation!==void 0&&this._animation.pause(),this.animatingState=0,this._fromState=this._toState,this._toState=e;let u=wT(this.object,this._fromState,e,this.sharedAssets);if(!u)return;let f={t:0};this._animation=fT({autoplay:!1,loop:t.repeat?!0:t.cycle?1:!1,direction:t.cycle?"alternate":"normal",rewind:t.rewind,delay:t.startDelay,endDelay:t.endDelay,duration:t.duration,easing:cG(t.easing,t.cubicControls,t.springParameters),targets:f,t:1,change:()=>{u.change&&u.change(f.t),r!=null&&r.change&&r.change(f.t)},loopBegin:d=>{if(this.animatingState===0){this.animatingState=1;return}d.reversed?(this._toState=this._fromState,this._fromState=e):(this._fromState=this._toState,this._toState=e)}}),t.autoplay?t.startOnceDelay>0?setTimeout(()=>{var d;return(d=this._animation)==null?void 0:d.play()},t.startOnceDelay):(h=this._animation)==null||h.play():this._animation.finished.then(()=>{this._animation=void 0,this.animatingState=0})}}emitEvent(e){var t;if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let r=this.events[e];if(r){for(let n of r)if("targets"in n)for(let{object:s,state:o,params:a}of n.targets)(t=s.interaction)==null||t.animate(o,a)}}}emitEventReverse(e){if(e==="keyDown"||e==="keyUp"||e==="mouseDown"||e==="mouseUp"||e==="mouseHover"||e==="scroll"||e==="start"){let t=this.events[e];if(t){for(let r of t)if("targets"in r)for(let{object:n,params:s}of r.targets){let o=n.interaction;(o==null?void 0:o._fromState)!==void 0&&o.animate(o._fromState,s)}}}}};var yc=class{static create(e,t){var r,n,s,o,a,l;if(e.object){let c=t.find(e.object);if(c!=null&&c.interaction){let h=e.state?c.interaction.states.find(u=>u.uuid===e.state):c.interaction.states[0];if(h){let u=(r=e.delay)!=null?r:0,f={cycle:(n=e.cycle)!=null?n:!1,rewind:(s=e.rewind)!=null?s:!1,repeat:(o=e.repeat)!=null?o:!1,duration:(a=e.duration)!=null?a:1e3,startOnceDelay:e.delayDirection==="start-once"?u:0,startDelay:e.delayDirection==="start"||!e.delayDirection?u:0,endDelay:e.delayDirection==="end"||!e.delayDirection?u:0,easing:(l=e.easing)!=null?l:4,autoplay:!0};if(e.easing===5){let d=e;f.cubicControls={control1:[...d.control1],control2:[...d.control2]}}if(e.easing===6){let d=e;f.springParameters={mass:d.mass,stiffness:d.stiffness,damping:d.damping,velocity:d.velocity}}return new yc(c,h,f)}}}}constructor(e,t,r){this.object=e,this.state=t,this.params=r}};var dx=new Map,wu={url:"head",time:0,data:null,next:null,prev:null},vc={url:"tail",time:1/0,data:null,next:null,prev:null};wu.next=vc;vc.prev=wu;var ST=0;function co(i){if(typeof i=="string")return i;let e=Date.now(),t=dx.get(i);return t===void 0?(t={url:URL.createObjectURL(new Blob([i])),data:i,time:e,next:null,prev:null},dx.set(i,t)):(t.time=e,t.prev.next=t.next,t.next.prev=t.prev),t.prev=vc.prev,t.next=vc,vc.prev.next=t,vc.prev=t,e-ST>1e3*10&&(ST=e+1e3,setTimeout(()=>{let r=Date.now(),n=wu.next;for(;n.time<r-1e3*10;)URL.revokeObjectURL(n.url),dx.delete(n.data),n=n.next,n.prev=wu,wu.next=n},900)),t.url}var MT=new Yr,ra=class extends Wr{},om=class{constructor(e){this.materials={};this.images={};this.colors={};this.transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:js,magFilter:ct,wrapS:Pr,wrapT:Pr}),this.transmissionRenderTarget.depthTexture=new ai(2048,2048),this.reset(e)}reset(e){for(let[t,r]of Object.entries(e.images))this.addImage(t,r.data);for(let[t,r]of Object.entries(e.colors))this.addColor(t,r);for(let[t,r]of Object.entries(e.materials))this.addMaterial(t,_v(r,this))}get transmissionSamplerMap(){return this.transmissionRenderTarget.texture}get transmissionDepthMap(){return this.transmissionRenderTarget.depthTexture}addMaterial(e,t){t.uuid=e,this.materials[e]=t}deleteMaterial(e){this.materials[e]&&(this.materials[e].dispose(),delete this.materials[e])}isSharedMaterial(e){return e.uuid in this.materials||e===MT}getMaterial(e){let t=this.materials[e];return t}getMaterialOrDeletedPlaceholder(e){var t;return(t=this.materials[e])!=null?t:MT}getMaterials(){return this.materials}addImage(e,t){if(this.images[e])return this.images[e].onload=()=>{this.onImageLoad&&this.onImageLoad()},this.images[e].src=co(t),!0;{let r=new Image;return r.src=co(t),r.onload=()=>{this.onImageLoad&&this.onImageLoad()},this.images[e]=r,!1}}deleteImage(e){this.images[e]&&delete this.images[e]}getDefaultImage(){return this.images.image_0}getImage(e){return this.images[e]}getImages(){return this.images}addColor(e,t){return this.colors[e]?("a"in t?this.colors[e].setRGBA(t.r,t.g,t.b,t.a):this.colors[e].setRGBA(t.r,t.g,t.b,1),!0):("a"in t?this.colors[e]=new ra(t.r,t.g,t.b,t.a):this.colors[e]=new ra(t.r,t.g,t.b,1),!1)}updateColor(e,t){var r,n,s,o;if(this.colors[e]){let a=this.colors[e];return this.colors[e].r=(r=t.r)!=null?r:a.r,this.colors[e].g=(n=t.g)!=null?n:a.g,this.colors[e].b=(s=t.b)!=null?s:a.b,this.colors[e].a=(o=t.a)!=null?o:a.a,!0}return!1}deleteColor(e){this.colors[e]&&delete this.colors[e]}getColor(e){return this.colors[e]}dispose(){Object.keys(this.materials).forEach(t=>this.deleteMaterial(t)),this.transmissionRenderTarget.depthTexture.dispose(),this.transmissionRenderTarget.dispose(),this.onImageLoad=void 0}};function hG(i,e){switch(i.type){case"noise":return e==="noiseType";case"texture":return e==="projection"||e==="axis"||e==="side";case"displace":return e==="noiseType";case"depth":return e==="num"||e==="smooth"||e==="isWorldSpace"||e==="gradientType";default:return!1}}function px(i,e,t,r,n){var o;let s=!1;for(let[a,l]of Object.entries(i)){if(!a||l===void 0||Np(a,t,n))continue;t.visible=n.visible;let c=t.uniforms[`f${t.id}_${a}`];if(!!c)switch(c.constructor){case Ot:if(typeof l=="string"){let h=e.getColor(l);h&&(c.value=h);break}else{let h=l;c.value instanceof ra?c.value=new Wr(h.r,h.g,h.b,h.a):c.setRGBA(h);break}case di:if(typeof l=="string"){let h=e.getColor(l);h&&(c.value=h);break}else{let h=l;c.value instanceof ra?c.value=new Wr(h.r,h.g,h.b,h.a):c.value.setRGBA(h.r,h.g,h.b,h.a);break}case Nr:{let h=l;c.value.setX(h[0]),c.value.setY(h[1]);break}case Or:{let h=l;c.value.setX(h[0]),c.value.setY(h[1]),c.value.setZ(h[2]);break}case jr:{let h=l;if("image"in h){let u=h.image;if(typeof u=="string"){let f=e.getImage(u);f&&(c.value.image=f)}else{let f=new Image;f.src=co(u.data),c.value.image=f}}"wrapping"in h&&(c.value.wrapS=c.value.wrapT=h.wrapping),"repeat"in h&&c.value.repeat.fromArray(h.repeat),"offset"in h&&c.value.offset.fromArray(h.offset),c.value.needsUpdate=!0;break}case ps:{l.forEach((h,u)=>{c.value[u].setX(h[0]),c.value[u].setY(h[1]),c.value[u].setZ(h[2]),c.value[u].setW(h[3])});break}default:{s=s||hG(t,a),c.value=l;break}}}if(s&&n){let a=Bp({id:"0",fi:0,data:n},e);(o=r.userData.layers)==null||o.changeLayer(t.id,se({},a)),r.dispose(),r.needsUpdate=!0}}var mx=new M,AT=new Gr,TT=new Ae,Su={type:"follow",normal:new M,raycaster:new io},xc;(t=>{function i(r){if(r.type===10)return{type:"follow"}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){!r||!n||!s||(o&&o("follow",r.uuid),AT.setFromNormalAndCoplanarPoint(n,r.getWorldPosition(mx)),s.ray.intersectPlane(AT,mx),r.position.copy(mx),r.parent!==null&&r.position.applyMatrix4(TT.copy(r.parent.matrixWorld).invert()),r.position.applyMatrix4(TT.copy(r.hiddenMatrix).invert()),r.updateMatrix(),er(r)&&Lt(r.parent)&&r.invalidateDownstreamBooleanData(!0),a&&a())}t.listener=e})(xc||(xc={}));var gx=new M,_T=new Gr,Mu={type:"lookAt",normal:new M,raycaster:new io},bc;(t=>{function i(r){if(r.type===9&&r.distance)return{type:"lookAt",distance:r.distance}}t.create=i;function e({target:r,normal:n,raycaster:s,begin:o,change:a}){var c,h,u;if(!((h=(c=r==null?void 0:r.interaction)==null?void 0:c.events.lookAt)!=null&&h.length)||!n||!s)return;o&&o("lookAt",r.uuid);let l=r.interaction.events.lookAt[0].distance;_T.set(n,-l),s.ray.intersectPlane(_T,gx),r.lookAt(gx),r.updateMatrix(),(u=r.interaction.animation)==null||u.finished.then(()=>{r.lookAt(gx),r.updateMatrix(),er(r)&&Lt(r.parent)&&r.invalidateDownstreamBooleanData(!0)}),er(r)&&Lt(r.parent)&&r.invalidateDownstreamBooleanData(!0),a&&a()}t.listener=e})(bc||(bc={}));var yx={type:"start"},wc;(t=>{function i(r){if(r.type===7)return{type:"start",targets:[]}}t.create=i;function e({target:r,begin:n,change:s}){var a,l;if(!((l=(a=r==null?void 0:r.interaction)==null?void 0:a.events.start)!=null&&l.length))return;n&&n("start",r.uuid);let o={change:s};r.interaction.events.start.forEach(c=>{c.targets.forEach(({object:h,state:u,params:f})=>{var d;return(d=h.interaction)==null?void 0:d.animate(u,f,o)})})}t.listener=e})(wc||(wc={}));var am={type:"scroll"},Sc;(t=>{function i(r){if(!(r.type!==11||r.steps===void 0))return{type:"scroll",targets:[],steps:r.steps}}t.create=i;function e({target:r,deltaY:n,begin:s,change:o}){var c,h;if(!((h=(c=r==null?void 0:r.interaction)==null?void 0:c.events.scroll)!=null&&h.length)||!n)return;s&&s("scroll",r.uuid);let a={change:o},l=n>0?1:-1;r.interaction.events.scroll.forEach(u=>{u.targets.forEach(({object:f,state:d,params:p})=>{var g;let m=xe(se({},p),{autoplay:!1});(g=f.interaction)==null||g.seek(d,l,u.steps,m,a)})})}t.listener=e})(Sc||(Sc={}));var Ac={type:"mouseHover"},Mc;(t=>{function i(r){if(r.type===2)return{type:"mouseHover",targets:[]}}t.create=i;function e({target:r,begin:n,change:s,enter:o}){var l,c;if(!((c=(l=r==null?void 0:r.interaction)==null?void 0:l.events.mouseHover)!=null&&c.length)||o===void 0)return;n&&n("mouseHover",r.uuid);let a={change:s};o?r.interaction.events.mouseHover.forEach(h=>{h.targets.forEach(({object:u,state:f,params:d})=>{var p;(p=u.interaction)==null||p.animate(f,d,a)})}):r.interaction.events.mouseHover.forEach(h=>{h.targets.forEach(({object:u,params:f})=>{let d=u.interaction;(d==null?void 0:d.fromState)!==void 0&&d.animate(d.fromState,f,a)})})}t.listener=e})(Mc||(Mc={}));var vx={type:"mouseDown"},xx={type:"mouseUp"},lm={type:"keyDown"},cm={type:"keyUp"},xs;(t=>{function i(r){var o,a;let n,s;if(r.type===0)n={type:"mousedown"},s="mouseDown";else if(r.type===1)n={type:"mouseup"},s="mouseUp";else if(r.type===5){if(!r.key)return;n={type:"keydown",key:r.key},s="keyDown"}else if(r.type===6){if(!r.key)return;n={type:"keyup",key:r.key},s="keyUp"}else return;return{type:s,domEvent:n,targets:[],url:(o=r.url)!=null?o:void 0,toggle:(a=r.toggle)!=null?a:!1,enable:!1}}t.create=i;function e({target:r,interactionEvents:n,type:s,begin:o,change:a}){var c;if(!r)return;n||(n=(c=r.interaction)==null?void 0:c.events[s]),o&&o(s,r.uuid);let l={change:a};n.forEach(h=>{if(h.toggle){h.enable=!h.enable;for(let{object:u,state:f,params:d}of h.targets){let p=u.interaction;if(p!==void 0){let m=xe(se({},d),{cycle:!1,rewind:!1,repeat:!1});h.enable?p.animate(f,m,l):p.fromState!==void 0&&p.animate(p.fromState,m,l)}}}else h.targets.forEach(({object:u,state:f,params:d})=>{var p;return(p=u.interaction)==null?void 0:p.animate(f,d,l)});h.url&&(Ho?window.location.assign(h.url):window.open(h.url,"_blank"))})}t.listener=e})(xs||(xs={}));function uG(i){let e,{type:t}=i;return t===10?e=xc.create(i):t===0||t===1||t===5||t===6?e=xs.create(i):t===9?e=bc.create(i):t===2?e=Mc.create(i):t===11?e=Sc.create(i):t===7&&(e=wc.create(i)),e}function ET(i,e,t){let r=[];i.objects.traverse((n,s)=>{let o=e.find(n);if(delete o.interaction,!s.visible&&!Lt(o.parent)||s.states===void 0)return;let a=new sm(o,t),l=a.states;l.push(na.create(n,s));for(let h of s.states){let u=Fh.patch(s,h.data);l.push(na.create(h.id,u))}let c=a.events;if(s.events)for(let{data:h}of s.events){let u=uG(h);if(!u)continue;let f=u.type;c[f]?c[f].push(u):c[f]=[u],"targets"in h&&r.push([h,u])}(l.length>0||Object.keys(c).length>0)&&(o.interaction=a)});for(let[n,s]of r)if("targets"in n&&"targets"in s)for(let{data:o}of n.targets){let a=yc.create(o,e);a&&s.targets.push(a)}}function CT(i,e,t,r,n=!1){if(!n&&e.states.length===0)return;let s=t===null?e:Fh.patch(e,e.states.data(t));if(Ev(i,s),i instanceof kt&&s.type==="Mesh"){if(i instanceof po?i.buildFromStore(s.geometry):i.updateGeometry({parameters:s.geometry}),i.freeBooleanPointer(),Lt(i.parent)&&i.parent.invalidateDownstreamBooleanData().recomputeBoolean(),"material"in s){if(i.material instanceof Array)return;if(typeof s.material!="string"){let a=s.material.layers;for(let l of a){let c=i.material.userData.layers.getLayerByUuid(l.id);px(l.data,r,c,i.material,l.data)}}}else if("materials"in s){if(!(i.material instanceof Array))return;var o=0;for(let a of s.materials){if(typeof a!="string"){let l=a.layers;for(let c of l){let h=i.material[o].userData.layers.getLayerByUuid(c.id);px(c.data,r,h,i.material[o],c.data)}}o++}}}else if(s.type==="DirectionalLight")i.fromDirectionalLightState(s,r);else if(s.type==="PointLight")i.fromPointLightState(s,r);else if(s.type==="SpotLight")i.fromSpotLightState(s,r);else if(i instanceof Bn&&eo.is(s.type)){let a=s;i.setZoom("PerspectiveCamera",a.perspective.zoom),i.setZoom("OrthographicCamera",a.orthographic.zoom),i.isUpVectorFlipped=a.isUpVectorFlipped,i.targetOffset=a.targetOffset}}var na=class{constructor(e){this.objectState=e;this.uuid=et.generateUUID()}static create(e,t){let r=new na(t);return r.uuid=e,r}execute(e,t){CT(e,this.objectState,null,t,!0)}};var Yi=new io,$n=new M,bx={follow:xc.listener,keyDown:xs.listener,keyUp:xs.listener,lookAt:bc.listener,mouseDown:xs.listener,mouseUp:xs.listener,mouseHover:Mc.listener,scroll:Sc.listener,start:wc.listener},PT={follow:Su,keyDown:lm,keyUp:cm,lookAt:Mu,mouseDown:vx,mouseUp:xx,mouseHover:Ac,scroll:am,start:yx};function fG(i){if(i.style.transform!==""){let e=getComputedStyle(i).getPropertyValue("transform");if(e!=="none"){let t=e.replace("matrix(","").split(",");return{x:parseFloat(t[0]),y:parseFloat(t[3])}}}return{x:1,y:1}}function DT(i){let e=i.getViewport(new Je),t=fG(i.domElement);return{left:e.x*t.x,top:e.y*t.y,width:e.z*t.x,height:e.w*t.y}}function wx(i,e){if(er(e)){if(!e.raycastLock&&e.visible){let t=i.intersectObject(e,!1);return t.length?t[0]:void 0}}else if(e.objectType==="EmptyObject")return LT(i,e)}function LT(i,e){if(er(e)&&!e.raycastLock&&e.visible){let t=i.intersectObject(e,!1);if(t.length)return t[0]}for(let t of e.children)if(Zo(t)){let r=LT(i,t);if(r)return r}}var hm=class{constructor(e,t,r,n){this.isEnable=!1;this.splineEvents={};this._map={};this._prevObjects=[];this._onMouseDown=e=>{Yi.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseDownEvent(e)};this._onMouseUp=e=>{Yi.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseUpEvent(e)};this._onMouseMove=e=>{Yi.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseHoverEvent(e),this._handleLookAtEvent(e),this._handleFollowEvent(e)};this._onTouchStart=e=>{e.touches.length===1&&(Yi.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseDownEvent(e),this._handleMouseHoverEvent(e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onTouchEnd=e=>{this._handleMouseUpEvent(e),this._handleMouseHoverEvent(e,!0)};this._onTouchMove=e=>{e.touches.length===1&&(Yi.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection($n),$n.negate(),this._handleMouseHoverEvent(e),this._handleLookAtEvent(e),this._handleFollowEvent(e))};this._onWheel=e=>{this._handleWheelEvent(e)};this._onKeyDown=e=>{this._handleKeyDownEvent(e)};this._onKeyUp=e=>{this._handleKeyUpEvent(e)};this._renderer=e,this._domElement=e.domElement,this._camera=r,this._scene=t,this._app=n,this._domRect=this._domElement.getBoundingClientRect(),this._viewRect=DT(e)}activate(){var e,t,r,n,s,o,a,l,c,h,u,f,d,p,m,g,v,y;this.isEnable=!0,this._map={},this._scene.traverseEntity(w=>{w.interaction!==void 0&&(w.interaction.start(),Object.keys(w.interaction.events).forEach(b=>{let S=b;this._addDOMCustomEvent(S,w),(w.visible||S!=="mouseDown"&&S!=="mouseUp"&&S!=="mouseHover")&&this._addSPEEvent(S,w)}))}),Rd?((((e=this._map.mouseDown)==null?void 0:e.length)||((t=this._map.mouseHover)==null?void 0:t.length)||((r=this._map.lookAt)==null?void 0:r.length)||((n=this._map.follow)==null?void 0:n.length))&&this._domElement.addEventListener("touchstart",this._onTouchStart),(((s=this._map.mouseUp)==null?void 0:s.length)||((o=this._map.mouseHover)==null?void 0:o.length))&&this._domElement.addEventListener("touchend",this._onTouchEnd),(((a=this._map.mouseHover)==null?void 0:a.length)||((l=this._map.lookAt)==null?void 0:l.length)||((c=this._map.follow)==null?void 0:c.length))&&this._domElement.addEventListener("touchmove",this._onTouchMove)):((h=this._map.mouseDown)!=null&&h.length&&this._domElement.addEventListener("pointerdown",this._onMouseDown),(u=this._map.mouseUp)!=null&&u.length&&this._domElement.addEventListener("pointerup",this._onMouseUp),(((f=this._map.mouseHover)==null?void 0:f.length)||((d=this._map.lookAt)==null?void 0:d.length)||((p=this._map.follow)==null?void 0:p.length))&&this._domElement.addEventListener("pointermove",this._onMouseMove)),(m=this._map.scroll)!=null&&m.length&&this._domElement.addEventListener("wheel",this._onWheel),(g=this._map.keyDown)!=null&&g.length&&document.addEventListener("keydown",this._onKeyDown),(v=this._map.keyUp)!=null&&v.length&&document.addEventListener("keyup",this._onKeyUp),(y=this._map.start)!=null&&y.length&&this._handleStartEvent(),this.resize()}deactivate(){this._scene.traverseEntity(e=>{if(!e.interaction)return;e.interaction.end();let t=e;Object.keys(bx).forEach(r=>{let n=r;t.removeEventListener(n,bx[n])})}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),this._domElement.removeEventListener("wheel",this._onWheel),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{var t;(t=e.interaction)==null||t.start()}),this._handleStartEvent()}resize(){this._domRect=this._domElement.getBoundingClientRect(),this._viewRect=DT(this._renderer)}_getPointer(e,t){let r=this._domRect,n=this._viewRect,s=r.height-n.height,o=(e-n.left-r.left)*(r.width/n.width),a=(t-s+n.top-r.top)*(r.height/n.height);return{x:o/r.width*2-1,y:-(a/r.height)*2+1}}_handleStartEvent(){var e;(e=this._map.start)==null||e.forEach(t=>{t.dispatchEvent(yx)})}_handleWheelEvent(e){var t;(t=this._map.scroll)!=null&&t.length&&(am.deltaY=e.deltaY,this._map.scroll.forEach(r=>{r.dispatchEvent(am)}))}_handleMouseDownEvent(e){var t;(t=this._map.mouseDown)==null||t.forEach(r=>{wx(Yi,r)&&r.dispatchEvent(vx)})}_handleMouseUpEvent(e){var t;(t=this._map.mouseUp)==null||t.forEach(r=>{wx(Yi,r)&&r.dispatchEvent(xx)})}_handleMouseHoverEvent(e,t=!1){var n;let r=[];t||(n=this._map.mouseHover)==null||n.forEach(s=>{wx(Yi,s)&&r.push(s)}),this._prevObjects.length&&(Ac.enter=!1,this._prevObjects.forEach(s=>{r.includes(s)||s.dispatchEvent(Ac)})),r.length&&(Ac.enter=!0,r.forEach(s=>{s.dispatchEvent(Ac)})),this._prevObjects=r}_handleLookAtEvent(e){var t;(t=this._map.lookAt)!=null&&t.length&&(Mu.normal=$n,Mu.raycaster=Yi,this._map.lookAt.forEach(r=>{r.dispatchEvent(Mu)}))}_handleFollowEvent(e){this._map.follow&&(Su.normal=$n,Su.raycaster=Yi,this._map.follow.forEach(t=>t.dispatchEvent(Su)))}_handleKeyDownEvent(e){var t;(t=this._map.keyDown)==null||t.forEach(r=>{var n,s,o;lm.interactionEvents=(o=(s=(n=r.interaction)==null?void 0:n.events)==null?void 0:s.keyDown)==null?void 0:o.filter(a=>a.domEvent.type==="keydown"&&a.domEvent.key===e.key),r.dispatchEvent(lm)})}_handleKeyUpEvent(e){var t;(t=this._map.keyUp)==null||t.forEach(r=>{var n,s,o;cm.interactionEvents=(o=(s=(n=r.interaction)==null?void 0:n.events)==null?void 0:s.keyUp)==null?void 0:o.filter(a=>a.domEvent.type==="keyup"&&a.domEvent.key===e.key),r.dispatchEvent(cm)})}_addSPEEvent(e,t){var r;!t.interaction||(PT[e].begin=this._dispatchDOMCustomEvent.bind(this),PT[e].change=this._app.requestRender.bind(this),(r=t.interaction.events[e])!=null&&r.length&&(t.addEventListener(e,bx[e]),this._map[e]===void 0?this._map[e]=[t]:this._map[e].push(t)))}_addDOMCustomEvent(e,t){if(e){let r=new CustomEvent(e,{bubbles:!0});Object.defineProperty(r,"target",{writable:!1,value:{id:t.uuid,name:t.name}}),this.splineEvents[e]?this.splineEvents[e][t.uuid]=r:this.splineEvents[e]={[t.uuid]:r}}}_dispatchDOMCustomEvent(e,t){var n;let r=(n=this.splineEvents[e])==null?void 0:n[t];r&&this._domElement.dispatchEvent(r)}};var um=class{constructor(e,t,r,n,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new B().copy(r),this._editorSize=new B().copy(n),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y,!1)}updateViewportForImageExport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y;this._aspect=e/t,this._camera.zoom*=Math.min(r/e,n/t),this._renderer.setViewport(0,0,e,t)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,r=this._editorSize.x,n=this._editorSize.y,s=0,o=0,a=e,l=t;e<r&&(s=(r-e)*.5,s=-s,a=r),t<n&&(o=(n-t)*.5,o=-o,l=n),this._aspect=a/l,this._renderer.setViewport(s,o,a,l)}updateCamera(){if(!!this._camera)if(this._camera.cameraType==="PerspectiveCamera"){let e=this._frameSize.y,t=this._editorSize.y,r=this._fov;if(e>t){let n=dG(e,1080,2160,1,15)/100;r*=e/t,r*=1-n}this._camera.aspect=this._aspect,this._camera.fov=r,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t,!1)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function dG(i,e,t,r,n){return(i-e)/(t-e)*(n-r)+r}var fm=class{constructor(e){this.sharedAssets=new om(e.shared),this.scene=new Zp(e.scene,this.sharedAssets),this.scene.switchActiveCamera(this.scene.activeCamera)}reset(e,t){this.scene.clearScene(this.sharedAssets),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}dispose(){this.scene.dispose()}};var dm=class{constructor({x:e=10,y:t=10}){this._startTime=0;let r=document.getElementById("spe-perfs");r?this.element=r:(this.element=document.createElement("div"),document.body.appendChild(this.element),this.element.style.position="absolute",this.element.style.zIndex="10000",this.element.style.fontFamily="monospace",this.element.style.background="black",this.element.style.color="white",this.element.style.padding="10px",this.element.style.opacity="0.5",this.element.style.fontSize="11px",this.element.setAttribute("id","spe-perfs")),this.element.style.left=`${e}px`,this.element.style.top=`${t}px`}dispose(){var e;(e=this.element.parentElement)==null||e.removeChild(this.element)}start(){this._startTime=performance.now()}end(){let t=performance.now()-this._startTime;this.element.innerHTML=t.toFixed(3)+" ms"}};function pG(i){let e;if(!!i.index)for(let t=0;t<i.index.array.length;t+=3)e=i.index.array[t],i.index.array[t]=i.index.array[t+2],i.index.array[t+2]=e}function Sx(i){return i==="SubdivObject"||i==="NonParametric"?i:"Mesh"}function mG(i,e){let t={};return i.traverseEntity(r=>{var c;if(r.type!=="Mesh"||!("material"in r)||!r.visible||!(r instanceof kt)||Array.isArray(r.material)||r&&r.interaction&&r.interaction.states.length>0)return;let n=r.parent;for(;n;){if(n instanceof kt&&n.interaction&&n.interaction.states.length>1)return;n=n.parent}let s=r.material.uuid,o=e.shared.materials[s];if(o){if(!ui.isMergable(o))return}else{let h=(c=e.scene.objects.get(r.uuid))==null?void 0:c.data;if(h&&"material"in h&&typeof h.material!="string"){if(!ui.isMergable(h.material))return;s=ui.getHash(h.material)}}t[s]||(t[s]={});let l=t[s][Sx(r.objectType)];if(l){if(l.push(r),r.cloner)for(let h of r.cloner.children)l.push(h)}else if(t[s][Sx(r.objectType)]=[r],r.cloner)for(let h of r.cloner.children)t[s][Sx(r.objectType)].push(h)}),t}function gG(i){let e=0;return Object.values(i).forEach(t=>{Object.values(t).forEach(r=>{let n=r.length;n>e&&(e=n)})}),e}function IT(i,e){let t=mG(e,i),r=gG(t),n=new Array(r),s=0,o=new Array(r),a=0,l=new Array(r),c=0,h=new Array(r),u=0;for(let f of Object.values(t))for(let d of Object.values(f)){if(a=0,c=0,d.forEach(m=>{m instanceof kt&&(o[a++]=m.geometry.clone(),l[c++]=m)}),c<2)continue;for(let m=0;m<c;m++)l[m].updateWorldMatrix(!0,!1),o[m].applyMatrix4(l[m].matrixWorld),l[m].matrixWorld.determinant()<0&&pG(o[m]);let p=BM(o.slice(0,a),!1);if(p){let m;switch(d[0].objectType){case"SubdivObject":{console.warn("Turning subdiv object into mesh"),m=new Vt(p,l[0].material);break}default:{m=new Vt(p,l[0].material);break}}m.castShadow=l[0].castShadow,m.receiveShadow=l[0].receiveShadow,e.add(m);let g=v=>{u=0;for(let y of v)y.children&&g(y.children),y instanceof kt&&(Array.isArray(y.material)||t[y.material.uuid]&&t[y.material.uuid][y.objectType]&&t[y.material.uuid][y.objectType].length>1||(h[u++]=y));for(let y=0;y<u;y++)e.attach(h[y])};for(let v=0;v<c;v++){let y=l[v];g(y.children),n[s++]=y}}}for(let f=0;f<s;f++)n[f].removeFromParent()}var yG=new B,RT="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.",BT=class{constructor(e,{autoRender:t=!1}={}){this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this._proxyObjectCache=new Map;this._skipRender=!0;this.autoRender=!1;this.disposed=!1;this.requestRender=()=>{this._skipRender=!1};this.render=()=>{var e,t,r;!this._renderer||(this._rafId=requestAnimationFrame(this.render),(e=this._perfs)==null||e.start(),!(!this.autoRender&&this._skipRender)&&(this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this._skipRender=!this._controls.update():this._skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._transmissionRenderTarget&&(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3)),(t=this._scene.postprocessing)!=null&&t.enabled?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera))),(r=this._perfs)==null||r.end()))};this.resize=Ah(()=>{var e,t,r,n,s;!this._renderer||(this._viewportMode===1&&this._frameView&&(this._frameView.frameSize=yG.set(this._viewportWidth,this._viewportHeight)),(e=this._frameView)==null||e.updateRenderer(),(t=this._scene)!=null&&t.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight,!1),this._viewportMode!==1&&((r=this._frameView)==null||r.updateViewport()),this._camera&&((n=this._frameView)==null||n.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()),(s=this._playmode)==null||s.resize(),this.requestRender())},10);this.canvas=e,this.autoRender=t,window.location.search.includes("perfs")&&(this._perfs=new dm({x:10,y:10}))}async load(e){e.endsWith(".spline")?console.warn(RT+" The .spline files are only meant to be used by the Editor."):e.endsWith(".splinecode")||console.warn(RT);let r=await(await fetch(e)).arrayBuffer();await this.start(r)}async start(e){var f;if(this.disposed)return;let t=await WA(e);Bv(t)&&await rA();let r=new fm(t);if(window.location.search.includes("merge-geometries")){let d=performance.now();IT(t,r.scene);let p=performance.now();console.log("Merged geometries in ",p-d," ms")}this._scene=r.scene,Bv(t)&&this._scene.traverse(d=>{Lt(d)&&d.recomputeBoolean()}),this._sharedAssetsManager=r.sharedAssets,this._sharedAssetsManager.onImageLoad=()=>{this.requestRender()},ET(t.scene,this._scene,this._sharedAssetsManager),this._camera=this._scene.activeCamera;let n=Object.values(t.frames)[0],s,o;if(n)if(n.preset==="fullscreen"){this._viewportMode=1;let{width:d,height:p}=window.getComputedStyle(this.canvas);this.canvas.parentElement&&(d==="300px"||d==="auto")?(this._viewportWidth=this.canvas.parentElement.clientWidth||300,this.canvas.style.width="100%",s=this.canvas.style.width):this._viewportWidth=this.canvas.clientWidth,this.canvas.parentElement&&(p==="150px"||p==="auto")?(this._viewportHeight=this.canvas.parentElement.clientHeight||150,this.canvas.style.height="100%",o=this.canvas.style.height):this._viewportHeight=this.canvas.clientHeight}else this._viewportMode=2,this._viewportWidth=n.size[0],this._viewportHeight=n.size[1],s=this._viewportWidth+"px",o=this._viewportHeight+"px";(f=this._scene.postprocessing)!=null&&f.enabled?(this._renderer=new Dt({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene}),this._scene.postprocessing.addEventListener("smaaloaded",this.requestRender)):this._renderer=new Dt({canvas:this.canvas,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),s&&(this.canvas.style.width=s),o&&(this.canvas.style.height=o),this._scene.needsTransmission(void 0)&&(this._transmissionRenderTarget=new mt(2048,2048,{generateMipmaps:!0,minFilter:js,magFilter:ct,wrapS:Pr,wrapT:Pr}),this._transmissionRenderTarget.depthTexture=new ai(2048,2048),this._scene.needsTransmission(this._transmissionRenderTarget)),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight,!1),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=Zg,this._renderer.setClearColor(this._scene.bgColor,this._scene.alpha),this._frameView=new um(this._renderer,this._camera,new B(this._viewportWidth,this._viewportHeight),new B(window.innerWidth,window.innerHeight)),this._publishData=t.scene.publish;let{enableRotate:a,enablePan:l,enableZoom:c,autoRotate:h,hoverRotatePanMode:u}=this._publishData.orbitControls;if((a||l||c||h||u!==0)&&(this._camera.interaction===void 0||this._camera.interaction.states.length<=1)&&(this._controls=new lp(this._camera,this._renderer.domElement),this._controls.fromJSON(this._publishData.orbitControls),this._controls.useKeyEvents=!1,this._controls.addEventListener("change",this.requestRender),this._controls.addEventListener("start",this.requestRender)),this._playmode=new hm(this._renderer,this._scene,this._camera,this),this.resize(),this.render(),this.canvas.parentElement){let d=!0;this._resizeObserver=new ResizeObserver(()=>{if(d){d=!1;return}this._viewportWidth=this.canvas.clientWidth,this._viewportHeight=this.canvas.clientHeight,this.resize()}),this._resizeObserver.observe(this.canvas.parentElement)}}findObjectById(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByProperty("uuid",e);return this._createProxyObject(t)}findObjectByName(e){var r;let t=(r=this._scene)==null?void 0:r.getObjectByName(e);return this._createProxyObject(t)}getSplineEvents(){var e;return(e=this._playmode)==null?void 0:e.splineEvents}emitEvent(e,t){let r=this.findObjectById(t);r==null||r.emitEvent(e)}emitEventReverse(e,t){let r=this.findObjectById(t);r==null||r.emitEventReverse(e)}addEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.addEventListener(e,t)}removeEventListener(e,t){var r;(r=this._renderer)==null||r.domElement.removeEventListener(e,t)}setZoom(e){var t;(t=this._controls)==null||t.zoomOut(e)}setSize(e,t){this._viewportWidth=e,this._viewportHeight=t,this._viewportMode=2,this.resize()}dispose(){var e,t,r,n,s,o,a;this.disposed=!0,(e=this._playmode)==null||e.deactivate(),(t=this._scene)==null||t.dispose(),this._rafId&&cancelAnimationFrame(this._rafId),this._proxyObjectCache.forEach(l=>{py.unsubscribe(l)}),(r=this._renderer)==null||r.dispose(),(n=this._transmissionRenderTarget)==null||n.dispose(),(o=(s=this._transmissionRenderTarget)==null?void 0:s.depthTexture)==null||o.dispose(),(a=this._sharedAssetsManager)==null||a.dispose(),this._resizeObserver&&this._resizeObserver.disconnect(),this.canvas.style.width="",this.canvas.style.height=""}_createProxyObject(e){if(e==null)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);let t={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,emitEvent(n){var s;(s=e.interaction)==null||s.emitEvent(n)},emitEventReverse(n){var s;(s=e.interaction)==null||s.emitEventReverse(n)}},r=py(t,(n,s)=>{var a;typeof e[n]!="object"&&((a=Object.getOwnPropertyDescriptor(e,n))==null?void 0:a.writable)&&(e[n]=s),this.requestRender(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,r),r}};export{BT as Application};
|