@albi_scando/as-design-system-threejs-lib 1.1.2 → 1.1.3

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.
@@ -30657,7 +30657,7 @@ class sn extends HTMLElement {
30657
30657
  }
30658
30658
  return;
30659
30659
  }
30660
- t === sn.selectedAttribute && this.selectLanguage(i);
30660
+ t === sn.selectedAttribute && (this._selectedId = i, this._isInitialized && (this._previewId = this._selectedId, this._rotateToId(this._selectedId), this._syncBarMenuToId(this._selectedId)));
30661
30661
  }
30662
30662
  }
30663
30663
  // ─────────────────────────────────────────────────────────────────────────
@@ -30845,7 +30845,7 @@ class sn extends HTMLElement {
30845
30845
  randomSeed: Math.random()
30846
30846
  });
30847
30847
  });
30848
- const n = e != null && t.includes(e) ? e : t[0];
30848
+ const n = this._selectedId !== null && t.includes(this._selectedId) ? this._selectedId : e != null && t.includes(e) ? e : t[0];
30849
30849
  this._selectedId = n, this._previewId = n;
30850
30850
  const r = this._languages.find((o) => o.id === n);
30851
30851
  if (r === void 0) {
@@ -3952,7 +3952,7 @@ void main() {
3952
3952
 
3953
3953
  }
3954
3954
 
3955
- }`;class BI{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const i=new rc(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new cn({vertexShader:OI,fragmentShader:FI,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Ii(new lr(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class UI extends wn{constructor(t,e){super();const i=this;let n=null,r=1,a=null,o="local-floor",h=1,l=null,A=null,c=null,u=null,d=null,p=null;const m=new BI,g={},f=e.getContextAttributes();let M=null,S=null;const v=[],T=[],_=new Nt;let w=null;const P=new ke;P.viewport=new ce;const E=new ke;E.viewport=new ce;const x=[P,E],b=new Uf;let z=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let ot=v[j];return ot===void 0&&(ot=new Al,v[j]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(j){let ot=v[j];return ot===void 0&&(ot=new Al,v[j]=ot),ot.getGripSpace()},this.getHand=function(j){let ot=v[j];return ot===void 0&&(ot=new Al,v[j]=ot),ot.getHandSpace()};function U(j){const ot=T.indexOf(j.inputSource);if(ot===-1)return;const nt=v[ot];nt!==void 0&&(nt.update(j.inputSource,j.frame,l||a),nt.dispatchEvent({type:j.type,data:j.inputSource}))}function W(){n.removeEventListener("select",U),n.removeEventListener("selectstart",U),n.removeEventListener("selectend",U),n.removeEventListener("squeeze",U),n.removeEventListener("squeezestart",U),n.removeEventListener("squeezeend",U),n.removeEventListener("end",W),n.removeEventListener("inputsourceschange",Y);for(let j=0;j<v.length;j++){const ot=T[j];ot!==null&&(T[j]=null,v[j].disconnect(ot))}z=null,F=null,m.reset();for(const j in g)delete g[j];t.setRenderTarget(M),d=null,u=null,c=null,n=null,S=null,te.stop(),i.isPresenting=!1,t.setPixelRatio(w),t.setSize(_.width,_.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(j){r=j,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){o=j,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(j){l=j},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return c},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(j){if(n=j,n!==null){if(M=t.getRenderTarget(),n.addEventListener("select",U),n.addEventListener("selectstart",U),n.addEventListener("selectend",U),n.addEventListener("squeeze",U),n.addEventListener("squeezestart",U),n.addEventListener("squeezeend",U),n.addEventListener("end",W),n.addEventListener("inputsourceschange",Y),f.xrCompatible!==!0&&await e.makeXRCompatible(),w=t.getPixelRatio(),t.getSize(_),typeof XRWebGLBinding<"u"&&(c=new XRWebGLBinding(n,e)),c!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let nt=null,bt=null,_t=null;f.depth&&(_t=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,nt=f.stencil?Ks:qs,bt=f.stencil?Qs:Tn);const Dt={colorFormat:e.RGBA8,depthFormat:_t,scaleFactor:r};u=c.createProjectionLayer(Dt),n.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),S=new Pn(u.textureWidth,u.textureHeight,{format:di,type:xi,depthTexture:new vA(u.textureWidth,u.textureHeight,bt,void 0,void 0,void 0,void 0,void 0,void 0,nt),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const nt={antialias:f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(n,e,nt),n.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),S=new Pn(d.framebufferWidth,d.framebufferHeight,{format:di,type:xi,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(h),l=null,a=await n.requestReferenceSpace(o),te.setContext(n),te.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(n!==null)return n.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function Y(j){for(let ot=0;ot<j.removed.length;ot++){const nt=j.removed[ot],bt=T.indexOf(nt);bt>=0&&(T[bt]=null,v[bt].disconnect(nt))}for(let ot=0;ot<j.added.length;ot++){const nt=j.added[ot];let bt=T.indexOf(nt);if(bt===-1){for(let Dt=0;Dt<v.length;Dt++)if(Dt>=T.length){T.push(nt),bt=Dt;break}else if(T[Dt]===null){T[Dt]=nt,bt=Dt;break}if(bt===-1)break}const _t=v[bt];_t&&_t.connect(nt)}}const $=new O,H=new O;function rt(j,ot,nt){$.setFromMatrixPosition(ot.matrixWorld),H.setFromMatrixPosition(nt.matrixWorld);const bt=$.distanceTo(H),_t=ot.projectionMatrix.elements,Dt=nt.projectionMatrix.elements,fe=_t[14]/(_t[10]-1),Yt=_t[14]/(_t[10]+1),R=(_t[9]+1)/_t[5],ie=(_t[9]-1)/_t[5],yt=(_t[8]-1)/_t[0],jt=(Dt[8]+1)/Dt[0],Et=fe*yt,ae=fe*jt,ft=bt/(-yt+jt),zt=ft*-yt;if(ot.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(zt),j.translateZ(ft),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert(),_t[10]===-1)j.projectionMatrix.copy(ot.projectionMatrix),j.projectionMatrixInverse.copy(ot.projectionMatrixInverse);else{const ye=fe+ft,ge=Yt+ft,y=Et-zt,I=ae+(bt-zt),B=R*Yt/ge*ye,Z=ie*Yt/ge*ye;j.projectionMatrix.makePerspective(y,I,B,Z,ye,ge),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}}function ht(j,ot){ot===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(ot.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(n===null)return;let ot=j.near,nt=j.far;m.texture!==null&&(m.depthNear>0&&(ot=m.depthNear),m.depthFar>0&&(nt=m.depthFar)),b.near=E.near=P.near=ot,b.far=E.far=P.far=nt,(z!==b.near||F!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),z=b.near,F=b.far),b.layers.mask=j.layers.mask|6,P.layers.mask=b.layers.mask&3,E.layers.mask=b.layers.mask&5;const bt=j.parent,_t=b.cameras;ht(b,bt);for(let Dt=0;Dt<_t.length;Dt++)ht(_t[Dt],bt);_t.length===2?rt(b,P,E):b.projectionMatrix.copy(P.projectionMatrix),mt(j,b,bt)};function mt(j,ot,nt){nt===null?j.matrix.copy(ot.matrixWorld):(j.matrix.copy(nt.matrixWorld),j.matrix.invert(),j.matrix.multiply(ot.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(ot.projectionMatrix),j.projectionMatrixInverse.copy(ot.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=Hr*2*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}this.getCamera=function(){return b},this.getFoveation=function(){if(!(u===null&&d===null))return h},this.setFoveation=function(j){h=j,u!==null&&(u.fixedFoveation=j),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=j)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(b)},this.getCameraTexture=function(j){return g[j]};let Ut=null;function re(j,ot){if(A=ot.getViewerPose(l||a),p=ot,A!==null){const nt=A.views;d!==null&&(t.setRenderTargetFramebuffer(S,d.framebuffer),t.setRenderTarget(S));let bt=!1;nt.length!==b.cameras.length&&(b.cameras.length=0,bt=!0);for(let Yt=0;Yt<nt.length;Yt++){const R=nt[Yt];let ie=null;if(d!==null)ie=d.getViewport(R);else{const jt=c.getViewSubImage(u,R);ie=jt.viewport,Yt===0&&(t.setRenderTargetTextures(S,jt.colorTexture,jt.depthStencilTexture),t.setRenderTarget(S))}let yt=x[Yt];yt===void 0&&(yt=new ke,yt.layers.enable(Yt),yt.viewport=new ce,x[Yt]=yt),yt.matrix.fromArray(R.transform.matrix),yt.matrix.decompose(yt.position,yt.quaternion,yt.scale),yt.projectionMatrix.fromArray(R.projectionMatrix),yt.projectionMatrixInverse.copy(yt.projectionMatrix).invert(),yt.viewport.set(ie.x,ie.y,ie.width,ie.height),Yt===0&&(b.matrix.copy(yt.matrix),b.matrix.decompose(b.position,b.quaternion,b.scale)),bt===!0&&b.cameras.push(yt)}const _t=n.enabledFeatures;if(_t&&_t.includes("depth-sensing")&&n.depthUsage=="gpu-optimized"&&c){const Yt=c.getDepthInformation(nt[0]);Yt&&Yt.isValid&&Yt.texture&&m.init(Yt,n.renderState)}if(_t&&_t.includes("camera-access")&&(t.state.unbindTexture(),c))for(let Yt=0;Yt<nt.length;Yt++){const R=nt[Yt].camera;if(R){let ie=g[R];ie||(ie=new rc,g[R]=ie);const yt=c.getCameraImage(R);ie.sourceTexture=yt}}}for(let nt=0;nt<v.length;nt++){const bt=T[nt],_t=v[nt];bt!==null&&_t!==void 0&&_t.update(bt,ot,l||a)}Ut&&Ut(j,ot),ot.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:ot}),p=null}const te=new RA;te.setAnimationLoop(re),this.setAnimationLoop=function(j){Ut=j},this.dispose=function(){}}}const Gn=new Si,zI=new de;function kI(s,t){function e(g,f){g.matrixAutoUpdate===!0&&g.updateMatrix(),f.value.copy(g.matrix)}function i(g,f){f.color.getRGB(g.fogColor.value,dA(s)),f.isFog?(g.fogNear.value=f.near,g.fogFar.value=f.far):f.isFogExp2&&(g.fogDensity.value=f.density)}function n(g,f,M,S,v){f.isMeshBasicMaterial||f.isMeshLambertMaterial?r(g,f):f.isMeshToonMaterial?(r(g,f),c(g,f)):f.isMeshPhongMaterial?(r(g,f),A(g,f)):f.isMeshStandardMaterial?(r(g,f),u(g,f),f.isMeshPhysicalMaterial&&d(g,f,v)):f.isMeshMatcapMaterial?(r(g,f),p(g,f)):f.isMeshDepthMaterial?r(g,f):f.isMeshDistanceMaterial?(r(g,f),m(g,f)):f.isMeshNormalMaterial?r(g,f):f.isLineBasicMaterial?(a(g,f),f.isLineDashedMaterial&&o(g,f)):f.isPointsMaterial?h(g,f,M,S):f.isSpriteMaterial?l(g,f):f.isShadowMaterial?(g.color.value.copy(f.color),g.opacity.value=f.opacity):f.isShaderMaterial&&(f.uniformsNeedUpdate=!1)}function r(g,f){g.opacity.value=f.opacity,f.color&&g.diffuse.value.copy(f.color),f.emissive&&g.emissive.value.copy(f.emissive).multiplyScalar(f.emissiveIntensity),f.map&&(g.map.value=f.map,e(f.map,g.mapTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.bumpMap&&(g.bumpMap.value=f.bumpMap,e(f.bumpMap,g.bumpMapTransform),g.bumpScale.value=f.bumpScale,f.side===Ue&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,e(f.normalMap,g.normalMapTransform),g.normalScale.value.copy(f.normalScale),f.side===Ue&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,e(f.displacementMap,g.displacementMapTransform),g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap,e(f.emissiveMap,g.emissiveMapTransform)),f.specularMap&&(g.specularMap.value=f.specularMap,e(f.specularMap,g.specularMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);const M=t.get(f),S=M.envMap,v=M.envMapRotation;S&&(g.envMap.value=S,Gn.copy(v),Gn.x*=-1,Gn.y*=-1,Gn.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Gn.y*=-1,Gn.z*=-1),g.envMapRotation.value.setFromMatrix4(zI.makeRotationFromEuler(Gn)),g.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=f.reflectivity,g.ior.value=f.ior,g.refractionRatio.value=f.refractionRatio),f.lightMap&&(g.lightMap.value=f.lightMap,g.lightMapIntensity.value=f.lightMapIntensity,e(f.lightMap,g.lightMapTransform)),f.aoMap&&(g.aoMap.value=f.aoMap,g.aoMapIntensity.value=f.aoMapIntensity,e(f.aoMap,g.aoMapTransform))}function a(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,f.map&&(g.map.value=f.map,e(f.map,g.mapTransform))}function o(g,f){g.dashSize.value=f.dashSize,g.totalSize.value=f.dashSize+f.gapSize,g.scale.value=f.scale}function h(g,f,M,S){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.size.value=f.size*M,g.scale.value=S*.5,f.map&&(g.map.value=f.map,e(f.map,g.uvTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest)}function l(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.rotation.value=f.rotation,f.map&&(g.map.value=f.map,e(f.map,g.mapTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest)}function A(g,f){g.specular.value.copy(f.specular),g.shininess.value=Math.max(f.shininess,1e-4)}function c(g,f){f.gradientMap&&(g.gradientMap.value=f.gradientMap)}function u(g,f){g.metalness.value=f.metalness,f.metalnessMap&&(g.metalnessMap.value=f.metalnessMap,e(f.metalnessMap,g.metalnessMapTransform)),g.roughness.value=f.roughness,f.roughnessMap&&(g.roughnessMap.value=f.roughnessMap,e(f.roughnessMap,g.roughnessMapTransform)),f.envMap&&(g.envMapIntensity.value=f.envMapIntensity)}function d(g,f,M){g.ior.value=f.ior,f.sheen>0&&(g.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),g.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(g.sheenColorMap.value=f.sheenColorMap,e(f.sheenColorMap,g.sheenColorMapTransform)),f.sheenRoughnessMap&&(g.sheenRoughnessMap.value=f.sheenRoughnessMap,e(f.sheenRoughnessMap,g.sheenRoughnessMapTransform))),f.clearcoat>0&&(g.clearcoat.value=f.clearcoat,g.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(g.clearcoatMap.value=f.clearcoatMap,e(f.clearcoatMap,g.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,e(f.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(g.clearcoatNormalMap.value=f.clearcoatNormalMap,e(f.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===Ue&&g.clearcoatNormalScale.value.negate())),f.dispersion>0&&(g.dispersion.value=f.dispersion),f.iridescence>0&&(g.iridescence.value=f.iridescence,g.iridescenceIOR.value=f.iridescenceIOR,g.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(g.iridescenceMap.value=f.iridescenceMap,e(f.iridescenceMap,g.iridescenceMapTransform)),f.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=f.iridescenceThicknessMap,e(f.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),f.transmission>0&&(g.transmission.value=f.transmission,g.transmissionSamplerMap.value=M.texture,g.transmissionSamplerSize.value.set(M.width,M.height),f.transmissionMap&&(g.transmissionMap.value=f.transmissionMap,e(f.transmissionMap,g.transmissionMapTransform)),g.thickness.value=f.thickness,f.thicknessMap&&(g.thicknessMap.value=f.thicknessMap,e(f.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=f.attenuationDistance,g.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(g.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(g.anisotropyMap.value=f.anisotropyMap,e(f.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=f.specularIntensity,g.specularColor.value.copy(f.specularColor),f.specularColorMap&&(g.specularColorMap.value=f.specularColorMap,e(f.specularColorMap,g.specularColorMapTransform)),f.specularIntensityMap&&(g.specularIntensityMap.value=f.specularIntensityMap,e(f.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,f){f.matcap&&(g.matcap.value=f.matcap)}function m(g,f){const M=t.get(f).light;g.referencePosition.value.setFromMatrixPosition(M.matrixWorld),g.nearDistance.value=M.shadow.camera.near,g.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function GI(s,t,e,i){let n={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function h(M,S){const v=S.program;i.uniformBlockBinding(M,v)}function l(M,S){let v=n[M.id];v===void 0&&(p(M),v=A(M),n[M.id]=v,M.addEventListener("dispose",g));const T=S.program;i.updateUBOMapping(M,T);const _=t.render.frame;r[M.id]!==_&&(u(M),r[M.id]=_)}function A(M){const S=c();M.__bindingPointIndex=S;const v=s.createBuffer(),T=M.__size,_=M.usage;return s.bindBuffer(s.UNIFORM_BUFFER,v),s.bufferData(s.UNIFORM_BUFFER,T,_),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,S,v),v}function c(){for(let M=0;M<o;M++)if(a.indexOf(M)===-1)return a.push(M),M;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(M){const S=n[M.id],v=M.uniforms,T=M.__cache;s.bindBuffer(s.UNIFORM_BUFFER,S);for(let _=0,w=v.length;_<w;_++){const P=Array.isArray(v[_])?v[_]:[v[_]];for(let E=0,x=P.length;E<x;E++){const b=P[E];if(d(b,_,E,T)===!0){const z=b.__offset,F=Array.isArray(b.value)?b.value:[b.value];let U=0;for(let W=0;W<F.length;W++){const Y=F[W],$=m(Y);typeof Y=="number"||typeof Y=="boolean"?(b.__data[0]=Y,s.bufferSubData(s.UNIFORM_BUFFER,z+U,b.__data)):Y.isMatrix3?(b.__data[0]=Y.elements[0],b.__data[1]=Y.elements[1],b.__data[2]=Y.elements[2],b.__data[3]=0,b.__data[4]=Y.elements[3],b.__data[5]=Y.elements[4],b.__data[6]=Y.elements[5],b.__data[7]=0,b.__data[8]=Y.elements[6],b.__data[9]=Y.elements[7],b.__data[10]=Y.elements[8],b.__data[11]=0):(Y.toArray(b.__data,U),U+=$.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,z,b.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function d(M,S,v,T){const _=M.value,w=S+"_"+v;if(T[w]===void 0)return typeof _=="number"||typeof _=="boolean"?T[w]=_:T[w]=_.clone(),!0;{const P=T[w];if(typeof _=="number"||typeof _=="boolean"){if(P!==_)return T[w]=_,!0}else if(P.equals(_)===!1)return P.copy(_),!0}return!1}function p(M){const S=M.uniforms;let v=0;const T=16;for(let w=0,P=S.length;w<P;w++){const E=Array.isArray(S[w])?S[w]:[S[w]];for(let x=0,b=E.length;x<b;x++){const z=E[x],F=Array.isArray(z.value)?z.value:[z.value];for(let U=0,W=F.length;U<W;U++){const Y=F[U],$=m(Y),H=v%T,rt=H%$.boundary,ht=H+rt;v+=rt,ht!==0&&T-ht<$.storage&&(v+=T-ht),z.__data=new Float32Array($.storage/Float32Array.BYTES_PER_ELEMENT),z.__offset=v,v+=$.storage}}}const _=v%T;return _>0&&(v+=T-_),M.__size=v,M.__cache={},this}function m(M){const S={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(S.boundary=4,S.storage=4):M.isVector2?(S.boundary=8,S.storage=8):M.isVector3||M.isColor?(S.boundary=16,S.storage=12):M.isVector4?(S.boundary=16,S.storage=16):M.isMatrix3?(S.boundary=48,S.storage=48):M.isMatrix4?(S.boundary=64,S.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),S}function g(M){const S=M.target;S.removeEventListener("dispose",g);const v=a.indexOf(S.__bindingPointIndex);a.splice(v,1),s.deleteBuffer(n[S.id]),delete n[S.id],delete r[S.id]}function f(){for(const M in n)s.deleteBuffer(n[M]);a=[],n={},r={}}return{bind:h,update:l,dispose:f}}class ac{constructor(t={}){const{canvas:e=Kd(),context:i=null,depth:n=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:l=!1,powerPreference:A="default",failIfMajorPerformanceCaveat:c=!1,reversedDepthBuffer:u=!1}=t;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=a;const p=new Uint32Array(4),m=new Int32Array(4);let g=null,f=null;const M=[],S=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=sn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let T=!1;this._outputColorSpace=Pe;let _=0,w=0,P=null,E=-1,x=null;const b=new ce,z=new ce;let F=null;const U=new Wt(0);let W=0,Y=e.width,$=e.height,H=1,rt=null,ht=null;const mt=new ce(0,0,Y,$),Ut=new ce(0,0,Y,$);let re=!1;const te=new dl;let j=!1,ot=!1;const nt=new de,bt=new O,_t=new ce,Dt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let fe=!1;function Yt(){return P===null?H:1}let R=i;function ie(C,L){return e.getContext(C,L)}try{const C={alpha:!0,depth:n,stencil:r,antialias:o,premultipliedAlpha:h,preserveDrawingBuffer:l,powerPreference:A,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Xa}`),e.addEventListener("webglcontextlost",st,!1),e.addEventListener("webglcontextrestored",dt,!1),e.addEventListener("webglcontextcreationerror",q,!1),R===null){const L="webgl2";if(R=ie(L,C),R===null)throw ie(L)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let yt,jt,Et,ae,ft,zt,ye,ge,y,I,B,Z,Q,X,xt,it,It,Ct,tt,ct,wt,vt,lt,Ft;function D(){yt=new Kp(R),yt.init(),vt=new NI(R,yt),jt=new Yp(R,yt,t,vt),Et=new DI(R,yt),jt.reversedDepthBuffer&&u&&Et.buffers.depth.setReversed(!0),ae=new em(R),ft=new CI,zt=new LI(R,yt,Et,ft,jt,vt,ae),ye=new Zp(v),ge=new qp(v),y=new Gf(R),lt=new Vp(R,y),I=new $p(R,y,ae,lt),B=new nm(R,I,y,ae),tt=new im(R,jt,zt),it=new Xp(ft),Z=new II(v,ye,ge,yt,jt,lt,it),Q=new kI(v,ft),X=new xI,xt=new _I(yt),Ct=new Hp(v,ye,ge,Et,B,d,h),It=new RI(v,B,jt),Ft=new GI(R,ae,jt,Et),ct=new Wp(R,yt,ae),wt=new tm(R,yt,ae),ae.programs=Z.programs,v.capabilities=jt,v.extensions=yt,v.properties=ft,v.renderLists=X,v.shadowMap=It,v.state=Et,v.info=ae}D();const et=new UI(v,R);this.xr=et,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const C=yt.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=yt.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(C){C!==void 0&&(H=C,this.setSize(Y,$,!1))},this.getSize=function(C){return C.set(Y,$)},this.setSize=function(C,L,k=!0){if(et.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=C,$=L,e.width=Math.floor(C*H),e.height=Math.floor(L*H),k===!0&&(e.style.width=C+"px",e.style.height=L+"px"),this.setViewport(0,0,C,L)},this.getDrawingBufferSize=function(C){return C.set(Y*H,$*H).floor()},this.setDrawingBufferSize=function(C,L,k){Y=C,$=L,H=k,e.width=Math.floor(C*k),e.height=Math.floor(L*k),this.setViewport(0,0,C,L)},this.getCurrentViewport=function(C){return C.copy(b)},this.getViewport=function(C){return C.copy(mt)},this.setViewport=function(C,L,k,G){C.isVector4?mt.set(C.x,C.y,C.z,C.w):mt.set(C,L,k,G),Et.viewport(b.copy(mt).multiplyScalar(H).round())},this.getScissor=function(C){return C.copy(Ut)},this.setScissor=function(C,L,k,G){C.isVector4?Ut.set(C.x,C.y,C.z,C.w):Ut.set(C,L,k,G),Et.scissor(z.copy(Ut).multiplyScalar(H).round())},this.getScissorTest=function(){return re},this.setScissorTest=function(C){Et.setScissorTest(re=C)},this.setOpaqueSort=function(C){rt=C},this.setTransparentSort=function(C){ht=C},this.getClearColor=function(C){return C.copy(Ct.getClearColor())},this.setClearColor=function(){Ct.setClearColor(...arguments)},this.getClearAlpha=function(){return Ct.getClearAlpha()},this.setClearAlpha=function(){Ct.setClearAlpha(...arguments)},this.clear=function(C=!0,L=!0,k=!0){let G=0;if(C){let N=!1;if(P!==null){const K=P.texture.format;N=K===uo||K===co||K===Ao}if(N){const K=P.texture.type,At=K===xi||K===Tn||K===js||K===Qs||K===lo||K===ho,gt=Ct.getClearColor(),ut=Ct.getClearAlpha(),Tt=gt.r,Pt=gt.g,St=gt.b;At?(p[0]=Tt,p[1]=Pt,p[2]=St,p[3]=ut,R.clearBufferuiv(R.COLOR,0,p)):(m[0]=Tt,m[1]=Pt,m[2]=St,m[3]=ut,R.clearBufferiv(R.COLOR,0,m))}else G|=R.COLOR_BUFFER_BIT}L&&(G|=R.DEPTH_BUFFER_BIT),k&&(G|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(G)},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",st,!1),e.removeEventListener("webglcontextrestored",dt,!1),e.removeEventListener("webglcontextcreationerror",q,!1),Ct.dispose(),X.dispose(),xt.dispose(),ft.dispose(),ye.dispose(),ge.dispose(),B.dispose(),lt.dispose(),Ft.dispose(),Z.dispose(),et.dispose(),et.removeEventListener("sessionstart",bi),et.removeEventListener("sessionend",dc),Hn.stop()};function st(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),T=!0}function dt(){console.log("THREE.WebGLRenderer: Context Restored."),T=!1;const C=ae.autoReset,L=It.enabled,k=It.autoUpdate,G=It.needsUpdate,N=It.type;D(),ae.autoReset=C,It.enabled=L,It.autoUpdate=k,It.needsUpdate=G,It.type=N}function q(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function J(C){const L=C.target;L.removeEventListener("dispose",J),pt(L)}function pt(C){Lt(C),ft.remove(C)}function Lt(C){const L=ft.get(C).programs;L!==void 0&&(L.forEach(function(k){Z.releaseProgram(k)}),C.isShaderMaterial&&Z.releaseShaderCache(C))}this.renderBufferDirect=function(C,L,k,G,N,K){L===null&&(L=Dt);const At=N.isMesh&&N.matrixWorld.determinant()<0,gt=hC(C,L,k,G,N);Et.setMaterial(G,At);let ut=k.index,Tt=1;if(G.wireframe===!0){if(ut=I.getWireframeAttribute(k),ut===void 0)return;Tt=2}const Pt=k.drawRange,St=k.attributes.position;let Gt=Pt.start*Tt,$t=(Pt.start+Pt.count)*Tt;K!==null&&(Gt=Math.max(Gt,K.start*Tt),$t=Math.min($t,(K.start+K.count)*Tt)),ut!==null?(Gt=Math.max(Gt,0),$t=Math.min($t,ut.count)):St!=null&&(Gt=Math.max(Gt,0),$t=Math.min($t,St.count));const ue=$t-Gt;if(ue<0||ue===1/0)return;lt.setup(N,G,gt,k,ut);let se,ee=ct;if(ut!==null&&(se=y.get(ut),ee=wt,ee.setIndex(se)),N.isMesh)G.wireframe===!0?(Et.setLineWidth(G.wireframeLinewidth*Yt()),ee.setMode(R.LINES)):ee.setMode(R.TRIANGLES);else if(N.isLine){let Mt=G.linewidth;Mt===void 0&&(Mt=1),Et.setLineWidth(Mt*Yt()),N.isLineSegments?ee.setMode(R.LINES):N.isLineLoop?ee.setMode(R.LINE_LOOP):ee.setMode(R.LINE_STRIP)}else N.isPoints?ee.setMode(R.POINTS):N.isSprite&&ee.setMode(R.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)ds("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),ee.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if(yt.get("WEBGL_multi_draw"))ee.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const Mt=N._multiDrawStarts,oe=N._multiDrawCounts,Zt=N._multiDrawCount,Je=ut?y.get(ut).bytesPerElement:1,Ns=ft.get(G).currentProgram.getUniforms();for(let Qe=0;Qe<Zt;Qe++)Ns.setValue(R,"_gl_DrawID",Qe),ee.render(Mt[Qe]/Je,oe[Qe])}else if(N.isInstancedMesh)ee.renderInstances(Gt,ue,N.count);else if(k.isInstancedBufferGeometry){const Mt=k._maxInstanceCount!==void 0?k._maxInstanceCount:1/0,oe=Math.min(k.instanceCount,Mt);ee.renderInstances(Gt,ue,oe)}else ee.render(Gt,ue)};function ne(C,L,k){C.transparent===!0&&C.side===Fi&&C.forceSinglePass===!1?(C.side=Ue,C.needsUpdate=!0,fa(C,L,k),C.side=en,C.needsUpdate=!0,fa(C,L,k),C.side=Fi):fa(C,L,k)}this.compile=function(C,L,k=null){k===null&&(k=C),f=xt.get(k),f.init(L),S.push(f),k.traverseVisible(function(N){N.isLight&&N.layers.test(L.layers)&&(f.pushLight(N),N.castShadow&&f.pushShadow(N))}),C!==k&&C.traverseVisible(function(N){N.isLight&&N.layers.test(L.layers)&&(f.pushLight(N),N.castShadow&&f.pushShadow(N))}),f.setupLights();const G=new Set;return C.traverse(function(N){if(!(N.isMesh||N.isPoints||N.isLine||N.isSprite))return;const K=N.material;if(K)if(Array.isArray(K))for(let At=0;At<K.length;At++){const gt=K[At];ne(gt,k,N),G.add(gt)}else ne(K,k,N),G.add(K)}),f=S.pop(),G},this.compileAsync=function(C,L,k=null){const G=this.compile(C,L,k);return new Promise(N=>{function K(){if(G.forEach(function(At){ft.get(At).currentProgram.isReady()&&G.delete(At)}),G.size===0){N(C);return}setTimeout(K,10)}yt.get("KHR_parallel_shader_compile")!==null?K():setTimeout(K,10)})};let Jt=null;function Wi(C){Jt&&Jt(C)}function bi(){Hn.stop()}function dc(){Hn.start()}const Hn=new RA;Hn.setAnimationLoop(Wi),typeof self<"u"&&Hn.setContext(self),this.setAnimationLoop=function(C){Jt=C,et.setAnimationLoop(C),C===null?Hn.stop():Hn.start()},et.addEventListener("sessionstart",bi),et.addEventListener("sessionend",dc),this.render=function(C,L){if(L!==void 0&&L.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),L.parent===null&&L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),et.enabled===!0&&et.isPresenting===!0&&(et.cameraAutoUpdate===!0&&et.updateCamera(L),L=et.getCamera()),C.isScene===!0&&C.onBeforeRender(v,C,L,P),f=xt.get(C,S.length),f.init(L),S.push(f),nt.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse),te.setFromProjectionMatrix(nt,Ei,L.reversedDepth),ot=this.localClippingEnabled,j=it.init(this.clippingPlanes,ot),g=X.get(C,M.length),g.init(),M.push(g),et.enabled===!0&&et.isPresenting===!0){const K=v.xr.getDepthSensingMesh();K!==null&&Tl(K,L,-1/0,v.sortObjects)}Tl(C,L,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(rt,ht),fe=et.enabled===!1||et.isPresenting===!1||et.hasDepthSensing()===!1,fe&&Ct.addToRenderList(g,C),this.info.render.frame++,j===!0&&it.beginShadows();const k=f.state.shadowsArray;It.render(k,C,L),j===!0&&it.endShadows(),this.info.autoReset===!0&&this.info.reset();const G=g.opaque,N=g.transmissive;if(f.setupLights(),L.isArrayCamera){const K=L.cameras;if(N.length>0)for(let At=0,gt=K.length;At<gt;At++){const ut=K[At];gc(G,N,C,ut)}fe&&Ct.render(C);for(let At=0,gt=K.length;At<gt;At++){const ut=K[At];fc(g,C,ut,ut.viewport)}}else N.length>0&&gc(G,N,C,L),fe&&Ct.render(C),fc(g,C,L);P!==null&&w===0&&(zt.updateMultisampleRenderTarget(P),zt.updateRenderTargetMipmap(P)),C.isScene===!0&&C.onAfterRender(v,C,L),lt.resetDefaultState(),E=-1,x=null,S.pop(),S.length>0?(f=S[S.length-1],j===!0&&it.setGlobalState(v.clippingPlanes,f.state.camera)):f=null,M.pop(),M.length>0?g=M[M.length-1]:g=null};function Tl(C,L,k,G){if(C.visible===!1)return;if(C.layers.test(L.layers)){if(C.isGroup)k=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(L);else if(C.isLight)f.pushLight(C),C.castShadow&&f.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||te.intersectsSprite(C)){G&&_t.setFromMatrixPosition(C.matrixWorld).applyMatrix4(nt);const At=B.update(C),gt=C.material;gt.visible&&g.push(C,At,gt,k,_t.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||te.intersectsObject(C))){const At=B.update(C),gt=C.material;if(G&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),_t.copy(C.boundingSphere.center)):(At.boundingSphere===null&&At.computeBoundingSphere(),_t.copy(At.boundingSphere.center)),_t.applyMatrix4(C.matrixWorld).applyMatrix4(nt)),Array.isArray(gt)){const ut=At.groups;for(let Tt=0,Pt=ut.length;Tt<Pt;Tt++){const St=ut[Tt],Gt=gt[St.materialIndex];Gt&&Gt.visible&&g.push(C,At,Gt,k,_t.z,St)}}else gt.visible&&g.push(C,At,gt,k,_t.z,null)}}const K=C.children;for(let At=0,gt=K.length;At<gt;At++)Tl(K[At],L,k,G)}function fc(C,L,k,G){const N=C.opaque,K=C.transmissive,At=C.transparent;f.setupLightsView(k),j===!0&&it.setGlobalState(v.clippingPlanes,k),G&&Et.viewport(b.copy(G)),N.length>0&&da(N,L,k),K.length>0&&da(K,L,k),At.length>0&&da(At,L,k),Et.buffers.depth.setTest(!0),Et.buffers.depth.setMask(!0),Et.buffers.color.setMask(!0),Et.setPolygonOffset(!1)}function gc(C,L,k,G){if((k.isScene===!0?k.overrideMaterial:null)!==null)return;f.state.transmissionRenderTarget[G.id]===void 0&&(f.state.transmissionRenderTarget[G.id]=new Pn(1,1,{generateMipmaps:!0,type:yt.has("EXT_color_buffer_half_float")||yt.has("EXT_color_buffer_float")?Js:xi,minFilter:_n,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Xt.workingColorSpace}));const K=f.state.transmissionRenderTarget[G.id],At=G.viewport||b;K.setSize(At.z*v.transmissionResolutionScale,At.w*v.transmissionResolutionScale);const gt=v.getRenderTarget(),ut=v.getActiveCubeFace(),Tt=v.getActiveMipmapLevel();v.setRenderTarget(K),v.getClearColor(U),W=v.getClearAlpha(),W<1&&v.setClearColor(16777215,.5),v.clear(),fe&&Ct.render(k);const Pt=v.toneMapping;v.toneMapping=sn;const St=G.viewport;if(G.viewport!==void 0&&(G.viewport=void 0),f.setupLightsView(G),j===!0&&it.setGlobalState(v.clippingPlanes,G),da(C,k,G),zt.updateMultisampleRenderTarget(K),zt.updateRenderTargetMipmap(K),yt.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let $t=0,ue=L.length;$t<ue;$t++){const se=L[$t],ee=se.object,Mt=se.geometry,oe=se.material,Zt=se.group;if(oe.side===Fi&&ee.layers.test(G.layers)){const Je=oe.side;oe.side=Ue,oe.needsUpdate=!0,pc(ee,k,G,Mt,oe,Zt),oe.side=Je,oe.needsUpdate=!0,Gt=!0}}Gt===!0&&(zt.updateMultisampleRenderTarget(K),zt.updateRenderTargetMipmap(K))}v.setRenderTarget(gt,ut,Tt),v.setClearColor(U,W),St!==void 0&&(G.viewport=St),v.toneMapping=Pt}function da(C,L,k){const G=L.isScene===!0?L.overrideMaterial:null;for(let N=0,K=C.length;N<K;N++){const At=C[N],gt=At.object,ut=At.geometry,Tt=At.group;let Pt=At.material;Pt.allowOverride===!0&&G!==null&&(Pt=G),gt.layers.test(k.layers)&&pc(gt,L,k,ut,Pt,Tt)}}function pc(C,L,k,G,N,K){C.onBeforeRender(v,L,k,G,N,K),C.modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),N.onBeforeRender(v,L,k,G,C,K),N.transparent===!0&&N.side===Fi&&N.forceSinglePass===!1?(N.side=Ue,N.needsUpdate=!0,v.renderBufferDirect(k,L,G,N,C,K),N.side=en,N.needsUpdate=!0,v.renderBufferDirect(k,L,G,N,C,K),N.side=Fi):v.renderBufferDirect(k,L,G,N,C,K),C.onAfterRender(v,L,k,G,N,K)}function fa(C,L,k){L.isScene!==!0&&(L=Dt);const G=ft.get(C),N=f.state.lights,K=f.state.shadowsArray,At=N.state.version,gt=Z.getParameters(C,N.state,K,L,k),ut=Z.getProgramCacheKey(gt);let Tt=G.programs;G.environment=C.isMeshStandardMaterial?L.environment:null,G.fog=L.fog,G.envMap=(C.isMeshStandardMaterial?ge:ye).get(C.envMap||G.environment),G.envMapRotation=G.environment!==null&&C.envMap===null?L.environmentRotation:C.envMapRotation,Tt===void 0&&(C.addEventListener("dispose",J),Tt=new Map,G.programs=Tt);let Pt=Tt.get(ut);if(Pt!==void 0){if(G.currentProgram===Pt&&G.lightsStateVersion===At)return Ic(C,gt),Pt}else gt.uniforms=Z.getUniforms(C),C.onBeforeCompile(gt,v),Pt=Z.acquireProgram(gt,ut),Tt.set(ut,Pt),G.uniforms=gt.uniforms;const St=G.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(St.clippingPlanes=it.uniform),Ic(C,gt),G.needsLights=cC(C),G.lightsStateVersion=At,G.needsLights&&(St.ambientLightColor.value=N.state.ambient,St.lightProbe.value=N.state.probe,St.directionalLights.value=N.state.directional,St.directionalLightShadows.value=N.state.directionalShadow,St.spotLights.value=N.state.spot,St.spotLightShadows.value=N.state.spotShadow,St.rectAreaLights.value=N.state.rectArea,St.ltc_1.value=N.state.rectAreaLTC1,St.ltc_2.value=N.state.rectAreaLTC2,St.pointLights.value=N.state.point,St.pointLightShadows.value=N.state.pointShadow,St.hemisphereLights.value=N.state.hemi,St.directionalShadowMap.value=N.state.directionalShadowMap,St.directionalShadowMatrix.value=N.state.directionalShadowMatrix,St.spotShadowMap.value=N.state.spotShadowMap,St.spotLightMatrix.value=N.state.spotLightMatrix,St.spotLightMap.value=N.state.spotLightMap,St.pointShadowMap.value=N.state.pointShadowMap,St.pointShadowMatrix.value=N.state.pointShadowMatrix),G.currentProgram=Pt,G.uniformsList=null,Pt}function mc(C){if(C.uniformsList===null){const L=C.currentProgram.getUniforms();C.uniformsList=ha.seqWithValue(L.seq,C.uniforms)}return C.uniformsList}function Ic(C,L){const k=ft.get(C);k.outputColorSpace=L.outputColorSpace,k.batching=L.batching,k.batchingColor=L.batchingColor,k.instancing=L.instancing,k.instancingColor=L.instancingColor,k.instancingMorph=L.instancingMorph,k.skinning=L.skinning,k.morphTargets=L.morphTargets,k.morphNormals=L.morphNormals,k.morphColors=L.morphColors,k.morphTargetsCount=L.morphTargetsCount,k.numClippingPlanes=L.numClippingPlanes,k.numIntersection=L.numClipIntersection,k.vertexAlphas=L.vertexAlphas,k.vertexTangents=L.vertexTangents,k.toneMapping=L.toneMapping}function hC(C,L,k,G,N){L.isScene!==!0&&(L=Dt),zt.resetTextureUnits();const K=L.fog,At=G.isMeshStandardMaterial?L.environment:null,gt=P===null?v.outputColorSpace:P.isXRRenderTarget===!0?P.texture.colorSpace:cs,ut=(G.isMeshStandardMaterial?ge:ye).get(G.envMap||At),Tt=G.vertexColors===!0&&!!k.attributes.color&&k.attributes.color.itemSize===4,Pt=!!k.attributes.tangent&&(!!G.normalMap||G.anisotropy>0),St=!!k.morphAttributes.position,Gt=!!k.morphAttributes.normal,$t=!!k.morphAttributes.color;let ue=sn;G.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(ue=v.toneMapping);const se=k.morphAttributes.position||k.morphAttributes.normal||k.morphAttributes.color,ee=se!==void 0?se.length:0,Mt=ft.get(G),oe=f.state.lights;if(j===!0&&(ot===!0||C!==x)){const Le=C===x&&G.id===E;it.setState(G,C,Le)}let Zt=!1;G.version===Mt.__version?(Mt.needsLights&&Mt.lightsStateVersion!==oe.state.version||Mt.outputColorSpace!==gt||N.isBatchedMesh&&Mt.batching===!1||!N.isBatchedMesh&&Mt.batching===!0||N.isBatchedMesh&&Mt.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&Mt.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&Mt.instancing===!1||!N.isInstancedMesh&&Mt.instancing===!0||N.isSkinnedMesh&&Mt.skinning===!1||!N.isSkinnedMesh&&Mt.skinning===!0||N.isInstancedMesh&&Mt.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&Mt.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&Mt.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&Mt.instancingMorph===!1&&N.morphTexture!==null||Mt.envMap!==ut||G.fog===!0&&Mt.fog!==K||Mt.numClippingPlanes!==void 0&&(Mt.numClippingPlanes!==it.numPlanes||Mt.numIntersection!==it.numIntersection)||Mt.vertexAlphas!==Tt||Mt.vertexTangents!==Pt||Mt.morphTargets!==St||Mt.morphNormals!==Gt||Mt.morphColors!==$t||Mt.toneMapping!==ue||Mt.morphTargetsCount!==ee)&&(Zt=!0):(Zt=!0,Mt.__version=G.version);let Je=Mt.currentProgram;Zt===!0&&(Je=fa(G,L,N));let Ns=!1,Qe=!1,Ar=!1;const le=Je.getUniforms(),ii=Mt.uniforms;if(Et.useProgram(Je.program)&&(Ns=!0,Qe=!0,Ar=!0),G.id!==E&&(E=G.id,Qe=!0),Ns||x!==C){Et.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),le.setValue(R,"projectionMatrix",C.projectionMatrix),le.setValue(R,"viewMatrix",C.matrixWorldInverse);const He=le.map.cameraPosition;He!==void 0&&He.setValue(R,bt.setFromMatrixPosition(C.matrixWorld)),jt.logarithmicDepthBuffer&&le.setValue(R,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(G.isMeshPhongMaterial||G.isMeshToonMaterial||G.isMeshLambertMaterial||G.isMeshBasicMaterial||G.isMeshStandardMaterial||G.isShaderMaterial)&&le.setValue(R,"isOrthographic",C.isOrthographicCamera===!0),x!==C&&(x=C,Qe=!0,Ar=!0)}if(N.isSkinnedMesh){le.setOptional(R,N,"bindMatrix"),le.setOptional(R,N,"bindMatrixInverse");const Le=N.skeleton;Le&&(Le.boneTexture===null&&Le.computeBoneTexture(),le.setValue(R,"boneTexture",Le.boneTexture,zt))}N.isBatchedMesh&&(le.setOptional(R,N,"batchingTexture"),le.setValue(R,"batchingTexture",N._matricesTexture,zt),le.setOptional(R,N,"batchingIdTexture"),le.setValue(R,"batchingIdTexture",N._indirectTexture,zt),le.setOptional(R,N,"batchingColorTexture"),N._colorsTexture!==null&&le.setValue(R,"batchingColorTexture",N._colorsTexture,zt));const ni=k.morphAttributes;if((ni.position!==void 0||ni.normal!==void 0||ni.color!==void 0)&&tt.update(N,k,Je),(Qe||Mt.receiveShadow!==N.receiveShadow)&&(Mt.receiveShadow=N.receiveShadow,le.setValue(R,"receiveShadow",N.receiveShadow)),G.isMeshGouraudMaterial&&G.envMap!==null&&(ii.envMap.value=ut,ii.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),G.isMeshStandardMaterial&&G.envMap===null&&L.environment!==null&&(ii.envMapIntensity.value=L.environmentIntensity),Qe&&(le.setValue(R,"toneMappingExposure",v.toneMappingExposure),Mt.needsLights&&AC(ii,Ar),K&&G.fog===!0&&Q.refreshFogUniforms(ii,K),Q.refreshMaterialUniforms(ii,G,H,$,f.state.transmissionRenderTarget[C.id]),ha.upload(R,mc(Mt),ii,zt)),G.isShaderMaterial&&G.uniformsNeedUpdate===!0&&(ha.upload(R,mc(Mt),ii,zt),G.uniformsNeedUpdate=!1),G.isSpriteMaterial&&le.setValue(R,"center",N.center),le.setValue(R,"modelViewMatrix",N.modelViewMatrix),le.setValue(R,"normalMatrix",N.normalMatrix),le.setValue(R,"modelMatrix",N.matrixWorld),G.isShaderMaterial||G.isRawShaderMaterial){const Le=G.uniformsGroups;for(let He=0,wl=Le.length;He<wl;He++){const Vn=Le[He];Ft.update(Vn,Je),Ft.bind(Vn,Je)}}return Je}function AC(C,L){C.ambientLightColor.needsUpdate=L,C.lightProbe.needsUpdate=L,C.directionalLights.needsUpdate=L,C.directionalLightShadows.needsUpdate=L,C.pointLights.needsUpdate=L,C.pointLightShadows.needsUpdate=L,C.spotLights.needsUpdate=L,C.spotLightShadows.needsUpdate=L,C.rectAreaLights.needsUpdate=L,C.hemisphereLights.needsUpdate=L}function cC(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return w},this.getRenderTarget=function(){return P},this.setRenderTargetTextures=function(C,L,k){const G=ft.get(C);G.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,G.__autoAllocateDepthBuffer===!1&&(G.__useRenderToTexture=!1),ft.get(C.texture).__webglTexture=L,ft.get(C.depthTexture).__webglTexture=G.__autoAllocateDepthBuffer?void 0:k,G.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,L){const k=ft.get(C);k.__webglFramebuffer=L,k.__useDefaultFramebuffer=L===void 0};const uC=R.createFramebuffer();this.setRenderTarget=function(C,L=0,k=0){P=C,_=L,w=k;let G=!0,N=null,K=!1,At=!1;if(C){const ut=ft.get(C);if(ut.__useDefaultFramebuffer!==void 0)Et.bindFramebuffer(R.FRAMEBUFFER,null),G=!1;else if(ut.__webglFramebuffer===void 0)zt.setupRenderTarget(C);else if(ut.__hasExternalTextures)zt.rebindTextures(C,ft.get(C.texture).__webglTexture,ft.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const St=C.depthTexture;if(ut.__boundDepthTexture!==St){if(St!==null&&ft.has(St)&&(C.width!==St.image.width||C.height!==St.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");zt.setupDepthRenderbuffer(C)}}const Tt=C.texture;(Tt.isData3DTexture||Tt.isDataArrayTexture||Tt.isCompressedArrayTexture)&&(At=!0);const Pt=ft.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(Pt[L])?N=Pt[L][k]:N=Pt[L],K=!0):C.samples>0&&zt.useMultisampledRTT(C)===!1?N=ft.get(C).__webglMultisampledFramebuffer:Array.isArray(Pt)?N=Pt[k]:N=Pt,b.copy(C.viewport),z.copy(C.scissor),F=C.scissorTest}else b.copy(mt).multiplyScalar(H).floor(),z.copy(Ut).multiplyScalar(H).floor(),F=re;if(k!==0&&(N=uC),Et.bindFramebuffer(R.FRAMEBUFFER,N)&&G&&Et.drawBuffers(C,N),Et.viewport(b),Et.scissor(z),Et.setScissorTest(F),K){const ut=ft.get(C.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+L,ut.__webglTexture,k)}else if(At){const ut=L;for(let Tt=0;Tt<C.textures.length;Tt++){const Pt=ft.get(C.textures[Tt]);R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0+Tt,Pt.__webglTexture,k,ut)}}else if(C!==null&&k!==0){const ut=ft.get(C.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,ut.__webglTexture,k)}E=-1},this.readRenderTargetPixels=function(C,L,k,G,N,K,At,gt=0){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ut=ft.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&At!==void 0&&(ut=ut[At]),ut){Et.bindFramebuffer(R.FRAMEBUFFER,ut);try{const Tt=C.textures[gt],Pt=Tt.format,St=Tt.type;if(!jt.textureFormatReadable(Pt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!jt.textureTypeReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}L>=0&&L<=C.width-G&&k>=0&&k<=C.height-N&&(C.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+gt),R.readPixels(L,k,G,N,vt.convert(Pt),vt.convert(St),K))}finally{const Tt=P!==null?ft.get(P).__webglFramebuffer:null;Et.bindFramebuffer(R.FRAMEBUFFER,Tt)}}},this.readRenderTargetPixelsAsync=async function(C,L,k,G,N,K,At,gt=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ut=ft.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&At!==void 0&&(ut=ut[At]),ut)if(L>=0&&L<=C.width-G&&k>=0&&k<=C.height-N){Et.bindFramebuffer(R.FRAMEBUFFER,ut);const Tt=C.textures[gt],Pt=Tt.format,St=Tt.type;if(!jt.textureFormatReadable(Pt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!jt.textureTypeReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Gt=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,Gt),R.bufferData(R.PIXEL_PACK_BUFFER,K.byteLength,R.STREAM_READ),C.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+gt),R.readPixels(L,k,G,N,vt.convert(Pt),vt.convert(St),0);const $t=P!==null?ft.get(P).__webglFramebuffer:null;Et.bindFramebuffer(R.FRAMEBUFFER,$t);const ue=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await $d(R,ue,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,Gt),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,K),R.deleteBuffer(Gt),R.deleteSync(ue),K}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,L=null,k=0){const G=Math.pow(2,-k),N=Math.floor(C.image.width*G),K=Math.floor(C.image.height*G),At=L!==null?L.x:0,gt=L!==null?L.y:0;zt.setTexture2D(C,0),R.copyTexSubImage2D(R.TEXTURE_2D,k,0,0,At,gt,N,K),Et.unbindTexture()};const dC=R.createFramebuffer(),fC=R.createFramebuffer();this.copyTextureToTexture=function(C,L,k=null,G=null,N=0,K=null){K===null&&(N!==0?(ds("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),K=N,N=0):K=0);let At,gt,ut,Tt,Pt,St,Gt,$t,ue;const se=C.isCompressedTexture?C.mipmaps[K]:C.image;if(k!==null)At=k.max.x-k.min.x,gt=k.max.y-k.min.y,ut=k.isBox3?k.max.z-k.min.z:1,Tt=k.min.x,Pt=k.min.y,St=k.isBox3?k.min.z:0;else{const ni=Math.pow(2,-N);At=Math.floor(se.width*ni),gt=Math.floor(se.height*ni),C.isDataArrayTexture?ut=se.depth:C.isData3DTexture?ut=Math.floor(se.depth*ni):ut=1,Tt=0,Pt=0,St=0}G!==null?(Gt=G.x,$t=G.y,ue=G.z):(Gt=0,$t=0,ue=0);const ee=vt.convert(L.format),Mt=vt.convert(L.type);let oe;L.isData3DTexture?(zt.setTexture3D(L,0),oe=R.TEXTURE_3D):L.isDataArrayTexture||L.isCompressedArrayTexture?(zt.setTexture2DArray(L,0),oe=R.TEXTURE_2D_ARRAY):(zt.setTexture2D(L,0),oe=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,L.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,L.unpackAlignment);const Zt=R.getParameter(R.UNPACK_ROW_LENGTH),Je=R.getParameter(R.UNPACK_IMAGE_HEIGHT),Ns=R.getParameter(R.UNPACK_SKIP_PIXELS),Qe=R.getParameter(R.UNPACK_SKIP_ROWS),Ar=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,se.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,se.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Tt),R.pixelStorei(R.UNPACK_SKIP_ROWS,Pt),R.pixelStorei(R.UNPACK_SKIP_IMAGES,St);const le=C.isDataArrayTexture||C.isData3DTexture,ii=L.isDataArrayTexture||L.isData3DTexture;if(C.isDepthTexture){const ni=ft.get(C),Le=ft.get(L),He=ft.get(ni.__renderTarget),wl=ft.get(Le.__renderTarget);Et.bindFramebuffer(R.READ_FRAMEBUFFER,He.__webglFramebuffer),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,wl.__webglFramebuffer);for(let Vn=0;Vn<ut;Vn++)le&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ft.get(C).__webglTexture,N,St+Vn),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ft.get(L).__webglTexture,K,ue+Vn)),R.blitFramebuffer(Tt,Pt,At,gt,Gt,$t,At,gt,R.DEPTH_BUFFER_BIT,R.NEAREST);Et.bindFramebuffer(R.READ_FRAMEBUFFER,null),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(N!==0||C.isRenderTargetTexture||ft.has(C)){const ni=ft.get(C),Le=ft.get(L);Et.bindFramebuffer(R.READ_FRAMEBUFFER,dC),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,fC);for(let He=0;He<ut;He++)le?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ni.__webglTexture,N,St+He):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,ni.__webglTexture,N),ii?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Le.__webglTexture,K,ue+He):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Le.__webglTexture,K),N!==0?R.blitFramebuffer(Tt,Pt,At,gt,Gt,$t,At,gt,R.COLOR_BUFFER_BIT,R.NEAREST):ii?R.copyTexSubImage3D(oe,K,Gt,$t,ue+He,Tt,Pt,At,gt):R.copyTexSubImage2D(oe,K,Gt,$t,Tt,Pt,At,gt);Et.bindFramebuffer(R.READ_FRAMEBUFFER,null),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else ii?C.isDataTexture||C.isData3DTexture?R.texSubImage3D(oe,K,Gt,$t,ue,At,gt,ut,ee,Mt,se.data):L.isCompressedArrayTexture?R.compressedTexSubImage3D(oe,K,Gt,$t,ue,At,gt,ut,ee,se.data):R.texSubImage3D(oe,K,Gt,$t,ue,At,gt,ut,ee,Mt,se):C.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,K,Gt,$t,At,gt,ee,Mt,se.data):C.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,K,Gt,$t,se.width,se.height,ee,se.data):R.texSubImage2D(R.TEXTURE_2D,K,Gt,$t,At,gt,ee,Mt,se);R.pixelStorei(R.UNPACK_ROW_LENGTH,Zt),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,Je),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Ns),R.pixelStorei(R.UNPACK_SKIP_ROWS,Qe),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Ar),K===0&&L.generateMipmaps&&R.generateMipmap(oe),Et.unbindTexture()},this.copyTextureToTexture3D=function(C,L,k=null,G=null,N=0){return ds('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(C,L,k,G,N)},this.initRenderTarget=function(C){ft.get(C).__webglFramebuffer===void 0&&zt.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?zt.setTextureCube(C,0):C.isData3DTexture?zt.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?zt.setTexture2DArray(C,0):zt.setTexture2D(C,0),Et.unbindTexture()},this.resetState=function(){_=0,w=0,P=null,Et.reset(),lt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ei}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Xt._getDrawingBufferColorSpace(t),e.unpackColorSpace=Xt._getUnpackColorSpace()}}const oc={type:"change"},bl={type:"start"},lc={type:"end"},ca=new qh,hc=new dn,HI=Math.cos(70*qd.DEG2RAD),ve=new O,Ge=2*Math.PI,Kt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},_l=1e-6;class VI extends zf{constructor(t,e=null){super(t,e),this.state=Kt.NONE,this.target=new O,this.cursor=new O,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:rs.ROTATE,MIDDLE:rs.DOLLY,RIGHT:rs.PAN},this.touches={ONE:as.ROTATE,TWO:as.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O,this._lastQuaternion=new Rn,this._lastTargetPosition=new O,this._quat=new Rn().setFromUnitVectors(t.up,new O(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new TA,this._sphericalDelta=new TA,this._scale=1,this._panOffset=new O,this._rotateStart=new Nt,this._rotateEnd=new Nt,this._rotateDelta=new Nt,this._panStart=new Nt,this._panEnd=new Nt,this._panDelta=new Nt,this._dollyStart=new Nt,this._dollyEnd=new Nt,this._dollyDelta=new Nt,this._dollyDirection=new O,this._mouse=new Nt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=YI.bind(this),this._onPointerDown=WI.bind(this),this._onPointerUp=XI.bind(this),this._onContextMenu=$I.bind(this),this._onMouseWheel=JI.bind(this),this._onKeyDown=QI.bind(this),this._onTouchStart=qI.bind(this),this._onTouchMove=KI.bind(this),this._onMouseDown=ZI.bind(this),this._onMouseMove=jI.bind(this),this._interceptControlDown=tC.bind(this),this._interceptControlUp=eC.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(oc),this.update(),this.state=Kt.NONE}update(t=null){const e=this.object.position;ve.copy(e).sub(this.target),ve.applyQuaternion(this._quat),this._spherical.setFromVector3(ve),this.autoRotate&&this.state===Kt.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(i)&&isFinite(n)&&(i<-Math.PI?i+=Ge:i>Math.PI&&(i-=Ge),n<-Math.PI?n+=Ge:n>Math.PI&&(n-=Ge),i<=n?this._spherical.theta=Math.max(i,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+n)/2?Math.max(i,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(ve.setFromSpherical(this._spherical),ve.applyQuaternion(this._quatInverse),e.copy(this.target).add(ve),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=ve.length();a=this._clampDistance(o*this._scale);const h=o-a;this.object.position.addScaledVector(this._dollyDirection,h),this.object.updateMatrixWorld(),r=!!h}else if(this.object.isOrthographicCamera){const o=new O(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const h=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=h!==this.object.zoom;const l=new O(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=ve.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(ca.origin.copy(this.object.position),ca.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ca.direction))<HI?this.object.lookAt(this.target):(hc.setFromNormalAndCoplanarPoint(this.object.up,this.target),ca.intersectPlane(hc,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>_l||8*(1-this._lastQuaternion.dot(this.object.quaternion))>_l||this._lastTargetPosition.distanceToSquared(this.target)>_l?(this.dispatchEvent(oc),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ge/60*this.autoRotateSpeed*t:Ge/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){ve.setFromMatrixColumn(e,0),ve.multiplyScalar(-t),this._panOffset.add(ve)}_panUp(t,e){this.screenSpacePanning===!0?ve.setFromMatrixColumn(e,1):(ve.setFromMatrixColumn(e,0),ve.crossVectors(this.object.up,ve)),ve.multiplyScalar(t),this._panOffset.add(ve)}_pan(t,e){const i=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;ve.copy(n).sub(this.target);let r=ve.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/i.clientHeight,this.object.matrix),this._panUp(2*e*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),n=t-i.left,r=e-i.top,a=i.width,o=i.height;this._mouse.x=n/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Ge*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ge*this._rotateDelta.y/e.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)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._rotateStart.set(i,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panStart.set(i,n)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(i*i+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),n=.5*(t.pageX+i.x),r=.5*(t.pageY+i.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Ge*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ge*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panEnd.set(i,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(i*i+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new Nt,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,i={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:i.deltaY*=16;break;case 2:i.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(i.deltaY*=10),i}}function WI(s){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(s.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(s)&&(this._addPointer(s),s.pointerType==="touch"?this._onTouchStart(s):this._onMouseDown(s)))}function YI(s){this.enabled!==!1&&(s.pointerType==="touch"?this._onTouchMove(s):this._onMouseMove(s))}function XI(s){switch(this._removePointer(s),this._pointers.length){case 0:this.domElement.releasePointerCapture(s.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(lc),this.state=Kt.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function ZI(s){let t;switch(s.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case rs.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(s),this.state=Kt.DOLLY;break;case rs.ROTATE:if(s.ctrlKey||s.metaKey||s.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(s),this.state=Kt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(s),this.state=Kt.ROTATE}break;case rs.PAN:if(s.ctrlKey||s.metaKey||s.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(s),this.state=Kt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(s),this.state=Kt.PAN}break;default:this.state=Kt.NONE}this.state!==Kt.NONE&&this.dispatchEvent(bl)}function jI(s){switch(this.state){case Kt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(s);break;case Kt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(s);break;case Kt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(s);break}}function JI(s){this.enabled===!1||this.enableZoom===!1||this.state!==Kt.NONE||(s.preventDefault(),this.dispatchEvent(bl),this._handleMouseWheel(this._customWheelEvent(s)),this.dispatchEvent(lc))}function QI(s){this.enabled!==!1&&this._handleKeyDown(s)}function qI(s){switch(this._trackPointer(s),this._pointers.length){case 1:switch(this.touches.ONE){case as.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(s),this.state=Kt.TOUCH_ROTATE;break;case as.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(s),this.state=Kt.TOUCH_PAN;break;default:this.state=Kt.NONE}break;case 2:switch(this.touches.TWO){case as.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(s),this.state=Kt.TOUCH_DOLLY_PAN;break;case as.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(s),this.state=Kt.TOUCH_DOLLY_ROTATE;break;default:this.state=Kt.NONE}break;default:this.state=Kt.NONE}this.state!==Kt.NONE&&this.dispatchEvent(bl)}function KI(s){switch(this._trackPointer(s),this.state){case Kt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(s),this.update();break;case Kt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(s),this.update();break;case Kt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(s),this.update();break;case Kt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(s),this.update();break;default:this.state=Kt.NONE}}function $I(s){this.enabled!==!1&&s.preventDefault()}function tC(s){s.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function eC(s){s.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Ac={LANGUAGE_CHANGE_CONFIRMED:ga.LANGUAGE_CHANGE_CONFIRMED},iC={languages:[],selected:void 0};class fn extends HTMLElement{static textureLoader=new xA;static languagesAttribute="languages";static selectedAttribute="selected";static get observedAttributes(){return[fn.languagesAttribute,fn.selectedAttribute]}_shadowRoot;_renderer;_scene;_camera;_container;_canvas;_controls;_resizeObserver;_clock=new _A;_lastTime=0;_lights=[];_spotlight;_flagsGroup;_wind=null;_circleRadius=5;_cameraLookAtY=2;_targetGroupRotation=0;_currentGroupRotation=0;_unwrappedGroupRotation=0;_animationFrameId=0;_introCameraStartPosition=new O(0,5,10);_introCameraEndPosition=new O(0,5,10);_introCameraElapsed=0;_introCameraMoveDuration=2.2;_introCameraHoldDuration=.4;_isIntroCameraAnimating=!1;_isIntroCameraHolding=!1;_languages=[];_selectedId=null;_previewId=null;_menuContainer;_menuIntroStartScale=.72;_barMenu;_languageButtons=[];_confirmationDialog;_isInitialized=!1;_isInitializing=!1;constructor(t){super(),this._shadowRoot=this.attachShadow({mode:"open"});const{languages:e,selected:i}={...iC,...t};e.length>0&&this._initializeComponent(e,i)}_indexOfId(t){return this._languages.findIndex(e=>e.id===t)}_idOfIndex(t){return this._languages[t]?.id??null}attributeChangedCallback(t,e,i){if(!(e===i||i==null)){if(t===fn.languagesAttribute){if(this._isInitialized||this._isInitializing)return;try{const n=JSON.parse(i),r=this.getAttribute(fn.selectedAttribute);Array.isArray(n)&&n.length>0&&this._initializeComponent(n,r)}catch(n){console.error("LanguagePickerComponent: Error parsing languages attribute",n)}return}t===fn.selectedAttribute&&this.selectLanguage(i)}}connectedCallback(){this._isInitialized&&this._animationFrameId===0&&(this._animationFrameId=requestAnimationFrame(this._animate))}disconnectedCallback(){cancelAnimationFrame(this._animationFrameId),this._animationFrameId=0,this._languages.forEach(t=>{t.flagGroup?.destroy(),this._scene.remove(t.object)}),this._lights.forEach(t=>{t.dispose()}),this._scene.clear(),this._renderer.dispose(),this._resizeObserver.disconnect()}selectLanguage(t){if(this._isInitialized){if(!this._languages.some(e=>e.id===t)){console.warn(`LanguagePickerComponent: Language '${t}' not found`);return}t!==this._selectedId&&(this._selectedId=t,this._previewId=t,this._rotateToId(t),this._syncBarMenuToId(t))}}_applyPreview(t){this._previewId=t,this._rotateToId(t),this._syncBarMenuToId(t)}addLanguage(t){}addLocales(t){}removeLanguage(t){}removeLocales(t){}_rotateToId(t){const e=this._languages.find(r=>r.id===t);if(e===void 0)return;const i=2*Math.PI;let n=e.angle;for(;Math.abs(n-this._unwrappedGroupRotation)>Math.PI;)n+=n<this._unwrappedGroupRotation?i:-i;this._targetGroupRotation=n,this._unwrappedGroupRotation=n,this._controls.enabled=!1}_syncBarMenuToId(t){const e=this._indexOfId(t);e!==-1&&this._barMenu.scrollToButton(e)}_initializeComponent(t,e){if(!(this._isInitialized||this._isInitializing)){if(t.length===0){console.warn("LanguagePickerComponent: No languages provided");return}this._isInitializing=!0,this._setupScene(),this._setupUI(),this._setupFlags(t,e),this._setupConfirmationDialog(),this._listenToBarMenuNavigation(),this._isInitialized=!0,this._isInitializing=!1,this.isConnected&&this._animationFrameId===0&&(this._animationFrameId=requestAnimationFrame(this._animate))}}_listenToBarMenuNavigation(){new MutationObserver(()=>{const e=this._barMenu.getAllButtons();for(let i=0;i<e.length;i++){const n=window.getComputedStyle(e[i]);if(n.display!=="none"&&n.visibility!=="hidden"&&n.opacity!=="0"){const a=this._idOfIndex(i);if(a===null)return;a!==this._previewId&&this._applyPreview(a);break}}}).observe(this._barMenu,{attributes:!0,subtree:!0,attributeFilter:["style","class"]})}_setupScene(){this._container=document.createElement("div"),this._container.style.width="100%",this._container.style.height="100%",this._container.style.position="relative",this._container.style.overflow="hidden",this._canvas=document.createElement("canvas"),this._canvas.style.width="100%",this._canvas.style.height="100%",this._canvas.style.display="block",this._container.appendChild(this._canvas),this._scene=new IA,this._scene.background=new Wt(1710618),this._scene.fog=new cl(1710618,8,50),this._camera=new ke(45,1,.1,100),this._camera.position.set(0,5,10),this._camera.lookAt(0,2,0),this._scene.add(this._camera),this._renderer=new ac({antialias:!0,canvas:this._canvas,alpha:!0}),this._renderer.debug.checkShaderErrors=!0,this._renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this._renderer.shadowMap.enabled=!1,this._controls=new VI(this._camera,this._canvas),this._controls.enableDamping=!0,this._controls.dampingFactor=.05,this._controls.autoRotate=!1,this._controls.enableRotate=!1,this._controls.enablePan=!1,this._controls.enableZoom=!1,this._controls.target.set(0,this._cameraLookAtY,0);const t=new Bf(16777215,.3);this._scene.add(t),this._lights.push(t);const e=new bA(14674943,3);e.position.set(10,20,10),this._scene.add(e),this._lights.push(e);const i=new bA(11329439,.15);i.position.set(0,-1,0),this._scene.add(i),this._lights.push(i),this._spotlight=new Of(16777215,150),this._spotlight.angle=Math.PI/6,this._spotlight.penumbra=.3,this._spotlight.decay=2,this._spotlight.distance=30,this._scene.add(this._spotlight),this._scene.add(this._spotlight.target),this._lights.push(this._spotlight);const n=new Ii(new lr(100,100),new Tf({color:1710618,roughness:.8,metalness:.2}));n.rotation.x=-Math.PI/2,n.receiveShadow=!0,this._scene.add(n);const r=()=>{const a=this._container.clientWidth,o=this._container.clientHeight;a===0||o===0||(this._camera.aspect=a/o,this._camera.updateProjectionMatrix(),this._renderer.setSize(a,o,!1))};this._resizeObserver=new ResizeObserver(r),this._resizeObserver.observe(this._container),r(),this._wind=new Ni.Wind({speed:8,direction:new O(1,0,0)}),this._flagsGroup=new or,this._scene.add(this._flagsGroup),this._shadowRoot.appendChild(this._container)}_setupUI(){this._barMenu=document.createElement(Kc.selector),this._barMenu.visibleButtons=1,this._barMenu.cyclicalNavigation=!0,this._menuContainer=document.createElement("div"),Object.assign(this._menuContainer.style,{position:"absolute",bottom:"25%",left:"50%",zIndex:"9999",pointerEvents:"auto",transformOrigin:"center bottom"}),this._setMenuIntroScale(1),this._menuContainer.appendChild(this._barMenu),this._shadowRoot.appendChild(this._menuContainer);const t=document.createElement("style");t.textContent=":host { display: block; width: 100%; height: 100%; }",this._shadowRoot.appendChild(t)}_setupFlags(t,e){const i=t.length;this._circleRadius=Math.max(5,3+i*.5),this._cameraLookAtY=this._circleRadius*.4,t.forEach((o,h)=>{const l=-(h/i*Math.PI*2),A=-Math.sin(l)*this._circleRadius,c=Math.cos(l)*this._circleRadius,u=Ni.buildFlag(),d=Ni.buildFlagpole({flagpoleType:Ni.FLAG_POLE_TYPE.VERTICAL},u),p=new Ni.FlagGroup({flagpole:d,flag:u});p.object.position.set(A,0,c);const m=pa.get(o)?.isoCode,g=m!=null?Wn[m]:void 0;g!=null&&fn.textureLoader.load(g,f=>{p.setTexture(f)},void 0,()=>{console.warn(`LanguagePickerComponent: Failed to load texture for ${o}`)}),this._flagsGroup.add(p.object),this._languages.push({id:o,flagGroup:p,object:p.object,angle:l,wind:null,windPhase:Math.random()*Math.PI*2,randomSeed:Math.random()})});const n=e!=null&&t.includes(e)?e:t[0];this._selectedId=n,this._previewId=n;const r=this._languages.find(o=>o.id===n);if(r===void 0){console.error(`LanguagePickerComponent: Initial language '${n}' not found`);return}this._targetGroupRotation=r.angle,this._currentGroupRotation=r.angle,this._unwrappedGroupRotation=r.angle,this._flagsGroup.rotation.y=r.angle;const a=this._computeIntroCameraEndPosition();this._introCameraEndPosition.copy(a),this._introCameraStartPosition.set(0,a.y+this._circleRadius*3.1,a.z+this._circleRadius*4.6),this._camera.position.copy(this._introCameraStartPosition),this._controls.target.set(0,this._cameraLookAtY,0),this._controls.update(),this._introCameraElapsed=0,this._isIntroCameraHolding=!0,this._isIntroCameraAnimating=!0,this._setMenuIntroScale(0),this._spotlight.position.set(0,8,this._circleRadius),this._spotlight.target.position.set(0,0,this._circleRadius),this._spotlight.target.updateMatrixWorld()}_computeIntroCameraEndPosition(){const t=new ps().setFromObject(this._flagsGroup),e=new O,i=new O;t.getSize(e),t.getCenter(i);const n=t.min.y,r=Math.max(e.x,e.y,e.z)*.5,a=this._camera.fov*Math.PI/180,o=this._camera.aspect>0?this._camera.aspect:1,h=2*Math.atan(Math.tan(a*.5)*o),l=Math.max(r/Math.tan(a*.5),r/Math.tan(h*.5))*1.05,A=n+e.y*.25;this._cameraLookAtY=A+e.y*.06;const c=A+Math.max(e.y*.8,this._circleRadius*.28),u=i.z+l+this._circleRadius*.01;return new O(0,c,u)}_setupConfirmationDialog(){this._confirmationDialog=document.createElement(Yn.selector),this._confirmationDialog.id="confirmation-dialog",this._shadowRoot.appendChild(this._confirmationDialog),this._confirmationDialog.addEventListener(Yn.COMPONENT_CUSTOM_MESSAGES.CONFIRMATION_DIALOG_CONFIRM,this._handleConfirmation),this._languages.forEach(t=>{const e=document.createElement(kc.selector);e.textContent=pa.get(t.id)?.autonyms??t.id,e.addEventListener(ma.CLICK,()=>{const i=pa.get(t.id);i!==void 0&&(this._applyPreview(t.id),this._confirmationDialog.value=i.id,this._confirmationDialog.headline="Switch language?",this._confirmationDialog.text=`Switch to ${i.language.toLowerCase()}?`,this._confirmationDialog.showModal())}),this._languageButtons.push(e),this._barMenu.appendChild(e)})}_handleConfirmation=()=>{const t=this._confirmationDialog.value;t!==void 0&&t!==this._selectedId&&this.dispatchEvent(new CustomEvent(Ac.LANGUAGE_CHANGE_CONFIRMED,{detail:{value:t},bubbles:!0,composed:!0}))};_animate=()=>{this._animationFrameId=requestAnimationFrame(this._animate);try{if(!this._isInitialized||this._camera==null||this._renderer==null)return;const t=this._clock.getElapsedTime(),e=t-this._lastTime;this._lastTime=t,this._wind?.update(),this._languages.forEach((i,n)=>{if(i.flagGroup==null)return;i.windPhase+=e*(.5+i.randomSeed*1.5),Ni.applyGravityToCloth(i.flagGroup.flag.cloth,i.flagGroup.flag.object),this._wind!=null&&Ni.applyWindForceToCloth(i.flagGroup.flag.cloth,this._wind,i.flagGroup.flag.object,{randomizeAmount:.6,randomSeed:i.randomSeed});const r=new Ni.Wind({speed:.3+Math.sin(i.windPhase)*.2,direction:new O(Math.sin(i.windPhase+n)*.5,Math.cos(i.windPhase*.7),Math.sin(i.windPhase*.5+n)).normalize()});Ni.applyWindForceToCloth(i.flagGroup.flag.cloth,r,i.flagGroup.flag.object,{randomizeAmount:.5,randomSeed:i.randomSeed*2}),i.flagGroup.simulate(e),i.flagGroup.render()}),this._updateGroupRotation(),this._updateIntroCamera(e),this._controls.update(),this._renderer.render(this._scene,this._camera)}catch(t){console.error("Animation loop error:",t),cancelAnimationFrame(this._animationFrameId)}};_updateGroupRotation(){if(this._flagsGroup==null)return;const t=this._targetGroupRotation-this._currentGroupRotation;this._currentGroupRotation+=t*.1,this._flagsGroup.rotation.y=this._currentGroupRotation,Math.abs(t)<.01&&(this._controls.enabled=!0)}_updateIntroCamera(t){if(!this._isIntroCameraAnimating)return;if(this._isIntroCameraHolding){this._introCameraElapsed+=t,this._camera.position.copy(this._introCameraStartPosition),this._controls.target.set(0,this._cameraLookAtY,0),this._setMenuIntroScale(0),this._introCameraElapsed>=this._introCameraHoldDuration&&(this._isIntroCameraHolding=!1,this._introCameraElapsed=0);return}this._introCameraElapsed+=t;const e=Math.min(1,this._introCameraElapsed/this._introCameraMoveDuration),i=e*e*(3-2*e),n=1-Math.pow(1-e,4);this._camera.position.set(0,this._introCameraStartPosition.y+(this._introCameraEndPosition.y-this._introCameraStartPosition.y)*n,this._introCameraStartPosition.z+(this._introCameraEndPosition.z-this._introCameraStartPosition.z)*i),this._controls.target.set(0,this._cameraLookAtY,0),this._setMenuIntroScale(i),e>=1&&(this._isIntroCameraAnimating=!1,this._camera.position.copy(this._introCameraEndPosition),this._setMenuIntroScale(1))}_setMenuIntroScale(t){if(this._menuContainer==null)return;const e=Math.min(1,Math.max(0,t)),i=this._menuIntroStartScale+(1-this._menuIntroStartScale)*e;this._menuContainer.style.transform=`translateX(-50%) scale(${i})`}}const nC=Object.freeze(Object.defineProperty({__proto__:null,COMPONENT_CUSTOM_MESSAGES:Ac,LanguagePickerComponent:fn,selector:"as-language-picker"},Symbol.toStringTag,{value:"Module"})),sC=`<section class="root">
3955
+ }`;class BI{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const i=new rc(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new cn({vertexShader:OI,fragmentShader:FI,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Ii(new lr(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class UI extends wn{constructor(t,e){super();const i=this;let n=null,r=1,a=null,o="local-floor",h=1,l=null,A=null,c=null,u=null,d=null,p=null;const m=new BI,g={},f=e.getContextAttributes();let M=null,S=null;const v=[],T=[],_=new Nt;let w=null;const P=new ke;P.viewport=new ce;const E=new ke;E.viewport=new ce;const x=[P,E],b=new Uf;let z=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let ot=v[j];return ot===void 0&&(ot=new Al,v[j]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(j){let ot=v[j];return ot===void 0&&(ot=new Al,v[j]=ot),ot.getGripSpace()},this.getHand=function(j){let ot=v[j];return ot===void 0&&(ot=new Al,v[j]=ot),ot.getHandSpace()};function U(j){const ot=T.indexOf(j.inputSource);if(ot===-1)return;const nt=v[ot];nt!==void 0&&(nt.update(j.inputSource,j.frame,l||a),nt.dispatchEvent({type:j.type,data:j.inputSource}))}function W(){n.removeEventListener("select",U),n.removeEventListener("selectstart",U),n.removeEventListener("selectend",U),n.removeEventListener("squeeze",U),n.removeEventListener("squeezestart",U),n.removeEventListener("squeezeend",U),n.removeEventListener("end",W),n.removeEventListener("inputsourceschange",Y);for(let j=0;j<v.length;j++){const ot=T[j];ot!==null&&(T[j]=null,v[j].disconnect(ot))}z=null,F=null,m.reset();for(const j in g)delete g[j];t.setRenderTarget(M),d=null,u=null,c=null,n=null,S=null,te.stop(),i.isPresenting=!1,t.setPixelRatio(w),t.setSize(_.width,_.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(j){r=j,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){o=j,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(j){l=j},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return c},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(j){if(n=j,n!==null){if(M=t.getRenderTarget(),n.addEventListener("select",U),n.addEventListener("selectstart",U),n.addEventListener("selectend",U),n.addEventListener("squeeze",U),n.addEventListener("squeezestart",U),n.addEventListener("squeezeend",U),n.addEventListener("end",W),n.addEventListener("inputsourceschange",Y),f.xrCompatible!==!0&&await e.makeXRCompatible(),w=t.getPixelRatio(),t.getSize(_),typeof XRWebGLBinding<"u"&&(c=new XRWebGLBinding(n,e)),c!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let nt=null,bt=null,_t=null;f.depth&&(_t=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,nt=f.stencil?Ks:qs,bt=f.stencil?Qs:Tn);const Dt={colorFormat:e.RGBA8,depthFormat:_t,scaleFactor:r};u=c.createProjectionLayer(Dt),n.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),S=new Pn(u.textureWidth,u.textureHeight,{format:di,type:xi,depthTexture:new vA(u.textureWidth,u.textureHeight,bt,void 0,void 0,void 0,void 0,void 0,void 0,nt),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const nt={antialias:f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(n,e,nt),n.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),S=new Pn(d.framebufferWidth,d.framebufferHeight,{format:di,type:xi,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(h),l=null,a=await n.requestReferenceSpace(o),te.setContext(n),te.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(n!==null)return n.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function Y(j){for(let ot=0;ot<j.removed.length;ot++){const nt=j.removed[ot],bt=T.indexOf(nt);bt>=0&&(T[bt]=null,v[bt].disconnect(nt))}for(let ot=0;ot<j.added.length;ot++){const nt=j.added[ot];let bt=T.indexOf(nt);if(bt===-1){for(let Dt=0;Dt<v.length;Dt++)if(Dt>=T.length){T.push(nt),bt=Dt;break}else if(T[Dt]===null){T[Dt]=nt,bt=Dt;break}if(bt===-1)break}const _t=v[bt];_t&&_t.connect(nt)}}const $=new O,H=new O;function rt(j,ot,nt){$.setFromMatrixPosition(ot.matrixWorld),H.setFromMatrixPosition(nt.matrixWorld);const bt=$.distanceTo(H),_t=ot.projectionMatrix.elements,Dt=nt.projectionMatrix.elements,fe=_t[14]/(_t[10]-1),Yt=_t[14]/(_t[10]+1),R=(_t[9]+1)/_t[5],ie=(_t[9]-1)/_t[5],yt=(_t[8]-1)/_t[0],jt=(Dt[8]+1)/Dt[0],Et=fe*yt,ae=fe*jt,ft=bt/(-yt+jt),zt=ft*-yt;if(ot.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(zt),j.translateZ(ft),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert(),_t[10]===-1)j.projectionMatrix.copy(ot.projectionMatrix),j.projectionMatrixInverse.copy(ot.projectionMatrixInverse);else{const ye=fe+ft,ge=Yt+ft,y=Et-zt,I=ae+(bt-zt),B=R*Yt/ge*ye,Z=ie*Yt/ge*ye;j.projectionMatrix.makePerspective(y,I,B,Z,ye,ge),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}}function ht(j,ot){ot===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(ot.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(n===null)return;let ot=j.near,nt=j.far;m.texture!==null&&(m.depthNear>0&&(ot=m.depthNear),m.depthFar>0&&(nt=m.depthFar)),b.near=E.near=P.near=ot,b.far=E.far=P.far=nt,(z!==b.near||F!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),z=b.near,F=b.far),b.layers.mask=j.layers.mask|6,P.layers.mask=b.layers.mask&3,E.layers.mask=b.layers.mask&5;const bt=j.parent,_t=b.cameras;ht(b,bt);for(let Dt=0;Dt<_t.length;Dt++)ht(_t[Dt],bt);_t.length===2?rt(b,P,E):b.projectionMatrix.copy(P.projectionMatrix),mt(j,b,bt)};function mt(j,ot,nt){nt===null?j.matrix.copy(ot.matrixWorld):(j.matrix.copy(nt.matrixWorld),j.matrix.invert(),j.matrix.multiply(ot.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(ot.projectionMatrix),j.projectionMatrixInverse.copy(ot.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=Hr*2*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}this.getCamera=function(){return b},this.getFoveation=function(){if(!(u===null&&d===null))return h},this.setFoveation=function(j){h=j,u!==null&&(u.fixedFoveation=j),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=j)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(b)},this.getCameraTexture=function(j){return g[j]};let Ut=null;function re(j,ot){if(A=ot.getViewerPose(l||a),p=ot,A!==null){const nt=A.views;d!==null&&(t.setRenderTargetFramebuffer(S,d.framebuffer),t.setRenderTarget(S));let bt=!1;nt.length!==b.cameras.length&&(b.cameras.length=0,bt=!0);for(let Yt=0;Yt<nt.length;Yt++){const R=nt[Yt];let ie=null;if(d!==null)ie=d.getViewport(R);else{const jt=c.getViewSubImage(u,R);ie=jt.viewport,Yt===0&&(t.setRenderTargetTextures(S,jt.colorTexture,jt.depthStencilTexture),t.setRenderTarget(S))}let yt=x[Yt];yt===void 0&&(yt=new ke,yt.layers.enable(Yt),yt.viewport=new ce,x[Yt]=yt),yt.matrix.fromArray(R.transform.matrix),yt.matrix.decompose(yt.position,yt.quaternion,yt.scale),yt.projectionMatrix.fromArray(R.projectionMatrix),yt.projectionMatrixInverse.copy(yt.projectionMatrix).invert(),yt.viewport.set(ie.x,ie.y,ie.width,ie.height),Yt===0&&(b.matrix.copy(yt.matrix),b.matrix.decompose(b.position,b.quaternion,b.scale)),bt===!0&&b.cameras.push(yt)}const _t=n.enabledFeatures;if(_t&&_t.includes("depth-sensing")&&n.depthUsage=="gpu-optimized"&&c){const Yt=c.getDepthInformation(nt[0]);Yt&&Yt.isValid&&Yt.texture&&m.init(Yt,n.renderState)}if(_t&&_t.includes("camera-access")&&(t.state.unbindTexture(),c))for(let Yt=0;Yt<nt.length;Yt++){const R=nt[Yt].camera;if(R){let ie=g[R];ie||(ie=new rc,g[R]=ie);const yt=c.getCameraImage(R);ie.sourceTexture=yt}}}for(let nt=0;nt<v.length;nt++){const bt=T[nt],_t=v[nt];bt!==null&&_t!==void 0&&_t.update(bt,ot,l||a)}Ut&&Ut(j,ot),ot.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:ot}),p=null}const te=new RA;te.setAnimationLoop(re),this.setAnimationLoop=function(j){Ut=j},this.dispose=function(){}}}const Gn=new Si,zI=new de;function kI(s,t){function e(g,f){g.matrixAutoUpdate===!0&&g.updateMatrix(),f.value.copy(g.matrix)}function i(g,f){f.color.getRGB(g.fogColor.value,dA(s)),f.isFog?(g.fogNear.value=f.near,g.fogFar.value=f.far):f.isFogExp2&&(g.fogDensity.value=f.density)}function n(g,f,M,S,v){f.isMeshBasicMaterial||f.isMeshLambertMaterial?r(g,f):f.isMeshToonMaterial?(r(g,f),c(g,f)):f.isMeshPhongMaterial?(r(g,f),A(g,f)):f.isMeshStandardMaterial?(r(g,f),u(g,f),f.isMeshPhysicalMaterial&&d(g,f,v)):f.isMeshMatcapMaterial?(r(g,f),p(g,f)):f.isMeshDepthMaterial?r(g,f):f.isMeshDistanceMaterial?(r(g,f),m(g,f)):f.isMeshNormalMaterial?r(g,f):f.isLineBasicMaterial?(a(g,f),f.isLineDashedMaterial&&o(g,f)):f.isPointsMaterial?h(g,f,M,S):f.isSpriteMaterial?l(g,f):f.isShadowMaterial?(g.color.value.copy(f.color),g.opacity.value=f.opacity):f.isShaderMaterial&&(f.uniformsNeedUpdate=!1)}function r(g,f){g.opacity.value=f.opacity,f.color&&g.diffuse.value.copy(f.color),f.emissive&&g.emissive.value.copy(f.emissive).multiplyScalar(f.emissiveIntensity),f.map&&(g.map.value=f.map,e(f.map,g.mapTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.bumpMap&&(g.bumpMap.value=f.bumpMap,e(f.bumpMap,g.bumpMapTransform),g.bumpScale.value=f.bumpScale,f.side===Ue&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,e(f.normalMap,g.normalMapTransform),g.normalScale.value.copy(f.normalScale),f.side===Ue&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,e(f.displacementMap,g.displacementMapTransform),g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap,e(f.emissiveMap,g.emissiveMapTransform)),f.specularMap&&(g.specularMap.value=f.specularMap,e(f.specularMap,g.specularMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);const M=t.get(f),S=M.envMap,v=M.envMapRotation;S&&(g.envMap.value=S,Gn.copy(v),Gn.x*=-1,Gn.y*=-1,Gn.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Gn.y*=-1,Gn.z*=-1),g.envMapRotation.value.setFromMatrix4(zI.makeRotationFromEuler(Gn)),g.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=f.reflectivity,g.ior.value=f.ior,g.refractionRatio.value=f.refractionRatio),f.lightMap&&(g.lightMap.value=f.lightMap,g.lightMapIntensity.value=f.lightMapIntensity,e(f.lightMap,g.lightMapTransform)),f.aoMap&&(g.aoMap.value=f.aoMap,g.aoMapIntensity.value=f.aoMapIntensity,e(f.aoMap,g.aoMapTransform))}function a(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,f.map&&(g.map.value=f.map,e(f.map,g.mapTransform))}function o(g,f){g.dashSize.value=f.dashSize,g.totalSize.value=f.dashSize+f.gapSize,g.scale.value=f.scale}function h(g,f,M,S){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.size.value=f.size*M,g.scale.value=S*.5,f.map&&(g.map.value=f.map,e(f.map,g.uvTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest)}function l(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.rotation.value=f.rotation,f.map&&(g.map.value=f.map,e(f.map,g.mapTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest)}function A(g,f){g.specular.value.copy(f.specular),g.shininess.value=Math.max(f.shininess,1e-4)}function c(g,f){f.gradientMap&&(g.gradientMap.value=f.gradientMap)}function u(g,f){g.metalness.value=f.metalness,f.metalnessMap&&(g.metalnessMap.value=f.metalnessMap,e(f.metalnessMap,g.metalnessMapTransform)),g.roughness.value=f.roughness,f.roughnessMap&&(g.roughnessMap.value=f.roughnessMap,e(f.roughnessMap,g.roughnessMapTransform)),f.envMap&&(g.envMapIntensity.value=f.envMapIntensity)}function d(g,f,M){g.ior.value=f.ior,f.sheen>0&&(g.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),g.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(g.sheenColorMap.value=f.sheenColorMap,e(f.sheenColorMap,g.sheenColorMapTransform)),f.sheenRoughnessMap&&(g.sheenRoughnessMap.value=f.sheenRoughnessMap,e(f.sheenRoughnessMap,g.sheenRoughnessMapTransform))),f.clearcoat>0&&(g.clearcoat.value=f.clearcoat,g.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(g.clearcoatMap.value=f.clearcoatMap,e(f.clearcoatMap,g.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,e(f.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(g.clearcoatNormalMap.value=f.clearcoatNormalMap,e(f.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===Ue&&g.clearcoatNormalScale.value.negate())),f.dispersion>0&&(g.dispersion.value=f.dispersion),f.iridescence>0&&(g.iridescence.value=f.iridescence,g.iridescenceIOR.value=f.iridescenceIOR,g.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(g.iridescenceMap.value=f.iridescenceMap,e(f.iridescenceMap,g.iridescenceMapTransform)),f.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=f.iridescenceThicknessMap,e(f.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),f.transmission>0&&(g.transmission.value=f.transmission,g.transmissionSamplerMap.value=M.texture,g.transmissionSamplerSize.value.set(M.width,M.height),f.transmissionMap&&(g.transmissionMap.value=f.transmissionMap,e(f.transmissionMap,g.transmissionMapTransform)),g.thickness.value=f.thickness,f.thicknessMap&&(g.thicknessMap.value=f.thicknessMap,e(f.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=f.attenuationDistance,g.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(g.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(g.anisotropyMap.value=f.anisotropyMap,e(f.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=f.specularIntensity,g.specularColor.value.copy(f.specularColor),f.specularColorMap&&(g.specularColorMap.value=f.specularColorMap,e(f.specularColorMap,g.specularColorMapTransform)),f.specularIntensityMap&&(g.specularIntensityMap.value=f.specularIntensityMap,e(f.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,f){f.matcap&&(g.matcap.value=f.matcap)}function m(g,f){const M=t.get(f).light;g.referencePosition.value.setFromMatrixPosition(M.matrixWorld),g.nearDistance.value=M.shadow.camera.near,g.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function GI(s,t,e,i){let n={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function h(M,S){const v=S.program;i.uniformBlockBinding(M,v)}function l(M,S){let v=n[M.id];v===void 0&&(p(M),v=A(M),n[M.id]=v,M.addEventListener("dispose",g));const T=S.program;i.updateUBOMapping(M,T);const _=t.render.frame;r[M.id]!==_&&(u(M),r[M.id]=_)}function A(M){const S=c();M.__bindingPointIndex=S;const v=s.createBuffer(),T=M.__size,_=M.usage;return s.bindBuffer(s.UNIFORM_BUFFER,v),s.bufferData(s.UNIFORM_BUFFER,T,_),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,S,v),v}function c(){for(let M=0;M<o;M++)if(a.indexOf(M)===-1)return a.push(M),M;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(M){const S=n[M.id],v=M.uniforms,T=M.__cache;s.bindBuffer(s.UNIFORM_BUFFER,S);for(let _=0,w=v.length;_<w;_++){const P=Array.isArray(v[_])?v[_]:[v[_]];for(let E=0,x=P.length;E<x;E++){const b=P[E];if(d(b,_,E,T)===!0){const z=b.__offset,F=Array.isArray(b.value)?b.value:[b.value];let U=0;for(let W=0;W<F.length;W++){const Y=F[W],$=m(Y);typeof Y=="number"||typeof Y=="boolean"?(b.__data[0]=Y,s.bufferSubData(s.UNIFORM_BUFFER,z+U,b.__data)):Y.isMatrix3?(b.__data[0]=Y.elements[0],b.__data[1]=Y.elements[1],b.__data[2]=Y.elements[2],b.__data[3]=0,b.__data[4]=Y.elements[3],b.__data[5]=Y.elements[4],b.__data[6]=Y.elements[5],b.__data[7]=0,b.__data[8]=Y.elements[6],b.__data[9]=Y.elements[7],b.__data[10]=Y.elements[8],b.__data[11]=0):(Y.toArray(b.__data,U),U+=$.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,z,b.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function d(M,S,v,T){const _=M.value,w=S+"_"+v;if(T[w]===void 0)return typeof _=="number"||typeof _=="boolean"?T[w]=_:T[w]=_.clone(),!0;{const P=T[w];if(typeof _=="number"||typeof _=="boolean"){if(P!==_)return T[w]=_,!0}else if(P.equals(_)===!1)return P.copy(_),!0}return!1}function p(M){const S=M.uniforms;let v=0;const T=16;for(let w=0,P=S.length;w<P;w++){const E=Array.isArray(S[w])?S[w]:[S[w]];for(let x=0,b=E.length;x<b;x++){const z=E[x],F=Array.isArray(z.value)?z.value:[z.value];for(let U=0,W=F.length;U<W;U++){const Y=F[U],$=m(Y),H=v%T,rt=H%$.boundary,ht=H+rt;v+=rt,ht!==0&&T-ht<$.storage&&(v+=T-ht),z.__data=new Float32Array($.storage/Float32Array.BYTES_PER_ELEMENT),z.__offset=v,v+=$.storage}}}const _=v%T;return _>0&&(v+=T-_),M.__size=v,M.__cache={},this}function m(M){const S={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(S.boundary=4,S.storage=4):M.isVector2?(S.boundary=8,S.storage=8):M.isVector3||M.isColor?(S.boundary=16,S.storage=12):M.isVector4?(S.boundary=16,S.storage=16):M.isMatrix3?(S.boundary=48,S.storage=48):M.isMatrix4?(S.boundary=64,S.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),S}function g(M){const S=M.target;S.removeEventListener("dispose",g);const v=a.indexOf(S.__bindingPointIndex);a.splice(v,1),s.deleteBuffer(n[S.id]),delete n[S.id],delete r[S.id]}function f(){for(const M in n)s.deleteBuffer(n[M]);a=[],n={},r={}}return{bind:h,update:l,dispose:f}}class ac{constructor(t={}){const{canvas:e=Kd(),context:i=null,depth:n=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:l=!1,powerPreference:A="default",failIfMajorPerformanceCaveat:c=!1,reversedDepthBuffer:u=!1}=t;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=a;const p=new Uint32Array(4),m=new Int32Array(4);let g=null,f=null;const M=[],S=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=sn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let T=!1;this._outputColorSpace=Pe;let _=0,w=0,P=null,E=-1,x=null;const b=new ce,z=new ce;let F=null;const U=new Wt(0);let W=0,Y=e.width,$=e.height,H=1,rt=null,ht=null;const mt=new ce(0,0,Y,$),Ut=new ce(0,0,Y,$);let re=!1;const te=new dl;let j=!1,ot=!1;const nt=new de,bt=new O,_t=new ce,Dt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let fe=!1;function Yt(){return P===null?H:1}let R=i;function ie(C,L){return e.getContext(C,L)}try{const C={alpha:!0,depth:n,stencil:r,antialias:o,premultipliedAlpha:h,preserveDrawingBuffer:l,powerPreference:A,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Xa}`),e.addEventListener("webglcontextlost",st,!1),e.addEventListener("webglcontextrestored",dt,!1),e.addEventListener("webglcontextcreationerror",q,!1),R===null){const L="webgl2";if(R=ie(L,C),R===null)throw ie(L)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let yt,jt,Et,ae,ft,zt,ye,ge,y,I,B,Z,Q,X,xt,it,It,Ct,tt,ct,wt,vt,lt,Ft;function D(){yt=new Kp(R),yt.init(),vt=new NI(R,yt),jt=new Yp(R,yt,t,vt),Et=new DI(R,yt),jt.reversedDepthBuffer&&u&&Et.buffers.depth.setReversed(!0),ae=new em(R),ft=new CI,zt=new LI(R,yt,Et,ft,jt,vt,ae),ye=new Zp(v),ge=new qp(v),y=new Gf(R),lt=new Vp(R,y),I=new $p(R,y,ae,lt),B=new nm(R,I,y,ae),tt=new im(R,jt,zt),it=new Xp(ft),Z=new II(v,ye,ge,yt,jt,lt,it),Q=new kI(v,ft),X=new xI,xt=new _I(yt),Ct=new Hp(v,ye,ge,Et,B,d,h),It=new RI(v,B,jt),Ft=new GI(R,ae,jt,Et),ct=new Wp(R,yt,ae),wt=new tm(R,yt,ae),ae.programs=Z.programs,v.capabilities=jt,v.extensions=yt,v.properties=ft,v.renderLists=X,v.shadowMap=It,v.state=Et,v.info=ae}D();const et=new UI(v,R);this.xr=et,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const C=yt.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=yt.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(C){C!==void 0&&(H=C,this.setSize(Y,$,!1))},this.getSize=function(C){return C.set(Y,$)},this.setSize=function(C,L,k=!0){if(et.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=C,$=L,e.width=Math.floor(C*H),e.height=Math.floor(L*H),k===!0&&(e.style.width=C+"px",e.style.height=L+"px"),this.setViewport(0,0,C,L)},this.getDrawingBufferSize=function(C){return C.set(Y*H,$*H).floor()},this.setDrawingBufferSize=function(C,L,k){Y=C,$=L,H=k,e.width=Math.floor(C*k),e.height=Math.floor(L*k),this.setViewport(0,0,C,L)},this.getCurrentViewport=function(C){return C.copy(b)},this.getViewport=function(C){return C.copy(mt)},this.setViewport=function(C,L,k,G){C.isVector4?mt.set(C.x,C.y,C.z,C.w):mt.set(C,L,k,G),Et.viewport(b.copy(mt).multiplyScalar(H).round())},this.getScissor=function(C){return C.copy(Ut)},this.setScissor=function(C,L,k,G){C.isVector4?Ut.set(C.x,C.y,C.z,C.w):Ut.set(C,L,k,G),Et.scissor(z.copy(Ut).multiplyScalar(H).round())},this.getScissorTest=function(){return re},this.setScissorTest=function(C){Et.setScissorTest(re=C)},this.setOpaqueSort=function(C){rt=C},this.setTransparentSort=function(C){ht=C},this.getClearColor=function(C){return C.copy(Ct.getClearColor())},this.setClearColor=function(){Ct.setClearColor(...arguments)},this.getClearAlpha=function(){return Ct.getClearAlpha()},this.setClearAlpha=function(){Ct.setClearAlpha(...arguments)},this.clear=function(C=!0,L=!0,k=!0){let G=0;if(C){let N=!1;if(P!==null){const K=P.texture.format;N=K===uo||K===co||K===Ao}if(N){const K=P.texture.type,At=K===xi||K===Tn||K===js||K===Qs||K===lo||K===ho,gt=Ct.getClearColor(),ut=Ct.getClearAlpha(),Tt=gt.r,Pt=gt.g,St=gt.b;At?(p[0]=Tt,p[1]=Pt,p[2]=St,p[3]=ut,R.clearBufferuiv(R.COLOR,0,p)):(m[0]=Tt,m[1]=Pt,m[2]=St,m[3]=ut,R.clearBufferiv(R.COLOR,0,m))}else G|=R.COLOR_BUFFER_BIT}L&&(G|=R.DEPTH_BUFFER_BIT),k&&(G|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(G)},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",st,!1),e.removeEventListener("webglcontextrestored",dt,!1),e.removeEventListener("webglcontextcreationerror",q,!1),Ct.dispose(),X.dispose(),xt.dispose(),ft.dispose(),ye.dispose(),ge.dispose(),B.dispose(),lt.dispose(),Ft.dispose(),Z.dispose(),et.dispose(),et.removeEventListener("sessionstart",bi),et.removeEventListener("sessionend",dc),Hn.stop()};function st(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),T=!0}function dt(){console.log("THREE.WebGLRenderer: Context Restored."),T=!1;const C=ae.autoReset,L=It.enabled,k=It.autoUpdate,G=It.needsUpdate,N=It.type;D(),ae.autoReset=C,It.enabled=L,It.autoUpdate=k,It.needsUpdate=G,It.type=N}function q(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function J(C){const L=C.target;L.removeEventListener("dispose",J),pt(L)}function pt(C){Lt(C),ft.remove(C)}function Lt(C){const L=ft.get(C).programs;L!==void 0&&(L.forEach(function(k){Z.releaseProgram(k)}),C.isShaderMaterial&&Z.releaseShaderCache(C))}this.renderBufferDirect=function(C,L,k,G,N,K){L===null&&(L=Dt);const At=N.isMesh&&N.matrixWorld.determinant()<0,gt=hC(C,L,k,G,N);Et.setMaterial(G,At);let ut=k.index,Tt=1;if(G.wireframe===!0){if(ut=I.getWireframeAttribute(k),ut===void 0)return;Tt=2}const Pt=k.drawRange,St=k.attributes.position;let Gt=Pt.start*Tt,$t=(Pt.start+Pt.count)*Tt;K!==null&&(Gt=Math.max(Gt,K.start*Tt),$t=Math.min($t,(K.start+K.count)*Tt)),ut!==null?(Gt=Math.max(Gt,0),$t=Math.min($t,ut.count)):St!=null&&(Gt=Math.max(Gt,0),$t=Math.min($t,St.count));const ue=$t-Gt;if(ue<0||ue===1/0)return;lt.setup(N,G,gt,k,ut);let se,ee=ct;if(ut!==null&&(se=y.get(ut),ee=wt,ee.setIndex(se)),N.isMesh)G.wireframe===!0?(Et.setLineWidth(G.wireframeLinewidth*Yt()),ee.setMode(R.LINES)):ee.setMode(R.TRIANGLES);else if(N.isLine){let Mt=G.linewidth;Mt===void 0&&(Mt=1),Et.setLineWidth(Mt*Yt()),N.isLineSegments?ee.setMode(R.LINES):N.isLineLoop?ee.setMode(R.LINE_LOOP):ee.setMode(R.LINE_STRIP)}else N.isPoints?ee.setMode(R.POINTS):N.isSprite&&ee.setMode(R.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)ds("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),ee.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if(yt.get("WEBGL_multi_draw"))ee.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const Mt=N._multiDrawStarts,oe=N._multiDrawCounts,Zt=N._multiDrawCount,Je=ut?y.get(ut).bytesPerElement:1,Ns=ft.get(G).currentProgram.getUniforms();for(let Qe=0;Qe<Zt;Qe++)Ns.setValue(R,"_gl_DrawID",Qe),ee.render(Mt[Qe]/Je,oe[Qe])}else if(N.isInstancedMesh)ee.renderInstances(Gt,ue,N.count);else if(k.isInstancedBufferGeometry){const Mt=k._maxInstanceCount!==void 0?k._maxInstanceCount:1/0,oe=Math.min(k.instanceCount,Mt);ee.renderInstances(Gt,ue,oe)}else ee.render(Gt,ue)};function ne(C,L,k){C.transparent===!0&&C.side===Fi&&C.forceSinglePass===!1?(C.side=Ue,C.needsUpdate=!0,fa(C,L,k),C.side=en,C.needsUpdate=!0,fa(C,L,k),C.side=Fi):fa(C,L,k)}this.compile=function(C,L,k=null){k===null&&(k=C),f=xt.get(k),f.init(L),S.push(f),k.traverseVisible(function(N){N.isLight&&N.layers.test(L.layers)&&(f.pushLight(N),N.castShadow&&f.pushShadow(N))}),C!==k&&C.traverseVisible(function(N){N.isLight&&N.layers.test(L.layers)&&(f.pushLight(N),N.castShadow&&f.pushShadow(N))}),f.setupLights();const G=new Set;return C.traverse(function(N){if(!(N.isMesh||N.isPoints||N.isLine||N.isSprite))return;const K=N.material;if(K)if(Array.isArray(K))for(let At=0;At<K.length;At++){const gt=K[At];ne(gt,k,N),G.add(gt)}else ne(K,k,N),G.add(K)}),f=S.pop(),G},this.compileAsync=function(C,L,k=null){const G=this.compile(C,L,k);return new Promise(N=>{function K(){if(G.forEach(function(At){ft.get(At).currentProgram.isReady()&&G.delete(At)}),G.size===0){N(C);return}setTimeout(K,10)}yt.get("KHR_parallel_shader_compile")!==null?K():setTimeout(K,10)})};let Jt=null;function Wi(C){Jt&&Jt(C)}function bi(){Hn.stop()}function dc(){Hn.start()}const Hn=new RA;Hn.setAnimationLoop(Wi),typeof self<"u"&&Hn.setContext(self),this.setAnimationLoop=function(C){Jt=C,et.setAnimationLoop(C),C===null?Hn.stop():Hn.start()},et.addEventListener("sessionstart",bi),et.addEventListener("sessionend",dc),this.render=function(C,L){if(L!==void 0&&L.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),L.parent===null&&L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),et.enabled===!0&&et.isPresenting===!0&&(et.cameraAutoUpdate===!0&&et.updateCamera(L),L=et.getCamera()),C.isScene===!0&&C.onBeforeRender(v,C,L,P),f=xt.get(C,S.length),f.init(L),S.push(f),nt.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse),te.setFromProjectionMatrix(nt,Ei,L.reversedDepth),ot=this.localClippingEnabled,j=it.init(this.clippingPlanes,ot),g=X.get(C,M.length),g.init(),M.push(g),et.enabled===!0&&et.isPresenting===!0){const K=v.xr.getDepthSensingMesh();K!==null&&Tl(K,L,-1/0,v.sortObjects)}Tl(C,L,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(rt,ht),fe=et.enabled===!1||et.isPresenting===!1||et.hasDepthSensing()===!1,fe&&Ct.addToRenderList(g,C),this.info.render.frame++,j===!0&&it.beginShadows();const k=f.state.shadowsArray;It.render(k,C,L),j===!0&&it.endShadows(),this.info.autoReset===!0&&this.info.reset();const G=g.opaque,N=g.transmissive;if(f.setupLights(),L.isArrayCamera){const K=L.cameras;if(N.length>0)for(let At=0,gt=K.length;At<gt;At++){const ut=K[At];gc(G,N,C,ut)}fe&&Ct.render(C);for(let At=0,gt=K.length;At<gt;At++){const ut=K[At];fc(g,C,ut,ut.viewport)}}else N.length>0&&gc(G,N,C,L),fe&&Ct.render(C),fc(g,C,L);P!==null&&w===0&&(zt.updateMultisampleRenderTarget(P),zt.updateRenderTargetMipmap(P)),C.isScene===!0&&C.onAfterRender(v,C,L),lt.resetDefaultState(),E=-1,x=null,S.pop(),S.length>0?(f=S[S.length-1],j===!0&&it.setGlobalState(v.clippingPlanes,f.state.camera)):f=null,M.pop(),M.length>0?g=M[M.length-1]:g=null};function Tl(C,L,k,G){if(C.visible===!1)return;if(C.layers.test(L.layers)){if(C.isGroup)k=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(L);else if(C.isLight)f.pushLight(C),C.castShadow&&f.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||te.intersectsSprite(C)){G&&_t.setFromMatrixPosition(C.matrixWorld).applyMatrix4(nt);const At=B.update(C),gt=C.material;gt.visible&&g.push(C,At,gt,k,_t.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||te.intersectsObject(C))){const At=B.update(C),gt=C.material;if(G&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),_t.copy(C.boundingSphere.center)):(At.boundingSphere===null&&At.computeBoundingSphere(),_t.copy(At.boundingSphere.center)),_t.applyMatrix4(C.matrixWorld).applyMatrix4(nt)),Array.isArray(gt)){const ut=At.groups;for(let Tt=0,Pt=ut.length;Tt<Pt;Tt++){const St=ut[Tt],Gt=gt[St.materialIndex];Gt&&Gt.visible&&g.push(C,At,Gt,k,_t.z,St)}}else gt.visible&&g.push(C,At,gt,k,_t.z,null)}}const K=C.children;for(let At=0,gt=K.length;At<gt;At++)Tl(K[At],L,k,G)}function fc(C,L,k,G){const N=C.opaque,K=C.transmissive,At=C.transparent;f.setupLightsView(k),j===!0&&it.setGlobalState(v.clippingPlanes,k),G&&Et.viewport(b.copy(G)),N.length>0&&da(N,L,k),K.length>0&&da(K,L,k),At.length>0&&da(At,L,k),Et.buffers.depth.setTest(!0),Et.buffers.depth.setMask(!0),Et.buffers.color.setMask(!0),Et.setPolygonOffset(!1)}function gc(C,L,k,G){if((k.isScene===!0?k.overrideMaterial:null)!==null)return;f.state.transmissionRenderTarget[G.id]===void 0&&(f.state.transmissionRenderTarget[G.id]=new Pn(1,1,{generateMipmaps:!0,type:yt.has("EXT_color_buffer_half_float")||yt.has("EXT_color_buffer_float")?Js:xi,minFilter:_n,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Xt.workingColorSpace}));const K=f.state.transmissionRenderTarget[G.id],At=G.viewport||b;K.setSize(At.z*v.transmissionResolutionScale,At.w*v.transmissionResolutionScale);const gt=v.getRenderTarget(),ut=v.getActiveCubeFace(),Tt=v.getActiveMipmapLevel();v.setRenderTarget(K),v.getClearColor(U),W=v.getClearAlpha(),W<1&&v.setClearColor(16777215,.5),v.clear(),fe&&Ct.render(k);const Pt=v.toneMapping;v.toneMapping=sn;const St=G.viewport;if(G.viewport!==void 0&&(G.viewport=void 0),f.setupLightsView(G),j===!0&&it.setGlobalState(v.clippingPlanes,G),da(C,k,G),zt.updateMultisampleRenderTarget(K),zt.updateRenderTargetMipmap(K),yt.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let $t=0,ue=L.length;$t<ue;$t++){const se=L[$t],ee=se.object,Mt=se.geometry,oe=se.material,Zt=se.group;if(oe.side===Fi&&ee.layers.test(G.layers)){const Je=oe.side;oe.side=Ue,oe.needsUpdate=!0,pc(ee,k,G,Mt,oe,Zt),oe.side=Je,oe.needsUpdate=!0,Gt=!0}}Gt===!0&&(zt.updateMultisampleRenderTarget(K),zt.updateRenderTargetMipmap(K))}v.setRenderTarget(gt,ut,Tt),v.setClearColor(U,W),St!==void 0&&(G.viewport=St),v.toneMapping=Pt}function da(C,L,k){const G=L.isScene===!0?L.overrideMaterial:null;for(let N=0,K=C.length;N<K;N++){const At=C[N],gt=At.object,ut=At.geometry,Tt=At.group;let Pt=At.material;Pt.allowOverride===!0&&G!==null&&(Pt=G),gt.layers.test(k.layers)&&pc(gt,L,k,ut,Pt,Tt)}}function pc(C,L,k,G,N,K){C.onBeforeRender(v,L,k,G,N,K),C.modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),N.onBeforeRender(v,L,k,G,C,K),N.transparent===!0&&N.side===Fi&&N.forceSinglePass===!1?(N.side=Ue,N.needsUpdate=!0,v.renderBufferDirect(k,L,G,N,C,K),N.side=en,N.needsUpdate=!0,v.renderBufferDirect(k,L,G,N,C,K),N.side=Fi):v.renderBufferDirect(k,L,G,N,C,K),C.onAfterRender(v,L,k,G,N,K)}function fa(C,L,k){L.isScene!==!0&&(L=Dt);const G=ft.get(C),N=f.state.lights,K=f.state.shadowsArray,At=N.state.version,gt=Z.getParameters(C,N.state,K,L,k),ut=Z.getProgramCacheKey(gt);let Tt=G.programs;G.environment=C.isMeshStandardMaterial?L.environment:null,G.fog=L.fog,G.envMap=(C.isMeshStandardMaterial?ge:ye).get(C.envMap||G.environment),G.envMapRotation=G.environment!==null&&C.envMap===null?L.environmentRotation:C.envMapRotation,Tt===void 0&&(C.addEventListener("dispose",J),Tt=new Map,G.programs=Tt);let Pt=Tt.get(ut);if(Pt!==void 0){if(G.currentProgram===Pt&&G.lightsStateVersion===At)return Ic(C,gt),Pt}else gt.uniforms=Z.getUniforms(C),C.onBeforeCompile(gt,v),Pt=Z.acquireProgram(gt,ut),Tt.set(ut,Pt),G.uniforms=gt.uniforms;const St=G.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(St.clippingPlanes=it.uniform),Ic(C,gt),G.needsLights=cC(C),G.lightsStateVersion=At,G.needsLights&&(St.ambientLightColor.value=N.state.ambient,St.lightProbe.value=N.state.probe,St.directionalLights.value=N.state.directional,St.directionalLightShadows.value=N.state.directionalShadow,St.spotLights.value=N.state.spot,St.spotLightShadows.value=N.state.spotShadow,St.rectAreaLights.value=N.state.rectArea,St.ltc_1.value=N.state.rectAreaLTC1,St.ltc_2.value=N.state.rectAreaLTC2,St.pointLights.value=N.state.point,St.pointLightShadows.value=N.state.pointShadow,St.hemisphereLights.value=N.state.hemi,St.directionalShadowMap.value=N.state.directionalShadowMap,St.directionalShadowMatrix.value=N.state.directionalShadowMatrix,St.spotShadowMap.value=N.state.spotShadowMap,St.spotLightMatrix.value=N.state.spotLightMatrix,St.spotLightMap.value=N.state.spotLightMap,St.pointShadowMap.value=N.state.pointShadowMap,St.pointShadowMatrix.value=N.state.pointShadowMatrix),G.currentProgram=Pt,G.uniformsList=null,Pt}function mc(C){if(C.uniformsList===null){const L=C.currentProgram.getUniforms();C.uniformsList=ha.seqWithValue(L.seq,C.uniforms)}return C.uniformsList}function Ic(C,L){const k=ft.get(C);k.outputColorSpace=L.outputColorSpace,k.batching=L.batching,k.batchingColor=L.batchingColor,k.instancing=L.instancing,k.instancingColor=L.instancingColor,k.instancingMorph=L.instancingMorph,k.skinning=L.skinning,k.morphTargets=L.morphTargets,k.morphNormals=L.morphNormals,k.morphColors=L.morphColors,k.morphTargetsCount=L.morphTargetsCount,k.numClippingPlanes=L.numClippingPlanes,k.numIntersection=L.numClipIntersection,k.vertexAlphas=L.vertexAlphas,k.vertexTangents=L.vertexTangents,k.toneMapping=L.toneMapping}function hC(C,L,k,G,N){L.isScene!==!0&&(L=Dt),zt.resetTextureUnits();const K=L.fog,At=G.isMeshStandardMaterial?L.environment:null,gt=P===null?v.outputColorSpace:P.isXRRenderTarget===!0?P.texture.colorSpace:cs,ut=(G.isMeshStandardMaterial?ge:ye).get(G.envMap||At),Tt=G.vertexColors===!0&&!!k.attributes.color&&k.attributes.color.itemSize===4,Pt=!!k.attributes.tangent&&(!!G.normalMap||G.anisotropy>0),St=!!k.morphAttributes.position,Gt=!!k.morphAttributes.normal,$t=!!k.morphAttributes.color;let ue=sn;G.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(ue=v.toneMapping);const se=k.morphAttributes.position||k.morphAttributes.normal||k.morphAttributes.color,ee=se!==void 0?se.length:0,Mt=ft.get(G),oe=f.state.lights;if(j===!0&&(ot===!0||C!==x)){const Le=C===x&&G.id===E;it.setState(G,C,Le)}let Zt=!1;G.version===Mt.__version?(Mt.needsLights&&Mt.lightsStateVersion!==oe.state.version||Mt.outputColorSpace!==gt||N.isBatchedMesh&&Mt.batching===!1||!N.isBatchedMesh&&Mt.batching===!0||N.isBatchedMesh&&Mt.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&Mt.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&Mt.instancing===!1||!N.isInstancedMesh&&Mt.instancing===!0||N.isSkinnedMesh&&Mt.skinning===!1||!N.isSkinnedMesh&&Mt.skinning===!0||N.isInstancedMesh&&Mt.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&Mt.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&Mt.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&Mt.instancingMorph===!1&&N.morphTexture!==null||Mt.envMap!==ut||G.fog===!0&&Mt.fog!==K||Mt.numClippingPlanes!==void 0&&(Mt.numClippingPlanes!==it.numPlanes||Mt.numIntersection!==it.numIntersection)||Mt.vertexAlphas!==Tt||Mt.vertexTangents!==Pt||Mt.morphTargets!==St||Mt.morphNormals!==Gt||Mt.morphColors!==$t||Mt.toneMapping!==ue||Mt.morphTargetsCount!==ee)&&(Zt=!0):(Zt=!0,Mt.__version=G.version);let Je=Mt.currentProgram;Zt===!0&&(Je=fa(G,L,N));let Ns=!1,Qe=!1,Ar=!1;const le=Je.getUniforms(),ii=Mt.uniforms;if(Et.useProgram(Je.program)&&(Ns=!0,Qe=!0,Ar=!0),G.id!==E&&(E=G.id,Qe=!0),Ns||x!==C){Et.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),le.setValue(R,"projectionMatrix",C.projectionMatrix),le.setValue(R,"viewMatrix",C.matrixWorldInverse);const He=le.map.cameraPosition;He!==void 0&&He.setValue(R,bt.setFromMatrixPosition(C.matrixWorld)),jt.logarithmicDepthBuffer&&le.setValue(R,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(G.isMeshPhongMaterial||G.isMeshToonMaterial||G.isMeshLambertMaterial||G.isMeshBasicMaterial||G.isMeshStandardMaterial||G.isShaderMaterial)&&le.setValue(R,"isOrthographic",C.isOrthographicCamera===!0),x!==C&&(x=C,Qe=!0,Ar=!0)}if(N.isSkinnedMesh){le.setOptional(R,N,"bindMatrix"),le.setOptional(R,N,"bindMatrixInverse");const Le=N.skeleton;Le&&(Le.boneTexture===null&&Le.computeBoneTexture(),le.setValue(R,"boneTexture",Le.boneTexture,zt))}N.isBatchedMesh&&(le.setOptional(R,N,"batchingTexture"),le.setValue(R,"batchingTexture",N._matricesTexture,zt),le.setOptional(R,N,"batchingIdTexture"),le.setValue(R,"batchingIdTexture",N._indirectTexture,zt),le.setOptional(R,N,"batchingColorTexture"),N._colorsTexture!==null&&le.setValue(R,"batchingColorTexture",N._colorsTexture,zt));const ni=k.morphAttributes;if((ni.position!==void 0||ni.normal!==void 0||ni.color!==void 0)&&tt.update(N,k,Je),(Qe||Mt.receiveShadow!==N.receiveShadow)&&(Mt.receiveShadow=N.receiveShadow,le.setValue(R,"receiveShadow",N.receiveShadow)),G.isMeshGouraudMaterial&&G.envMap!==null&&(ii.envMap.value=ut,ii.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),G.isMeshStandardMaterial&&G.envMap===null&&L.environment!==null&&(ii.envMapIntensity.value=L.environmentIntensity),Qe&&(le.setValue(R,"toneMappingExposure",v.toneMappingExposure),Mt.needsLights&&AC(ii,Ar),K&&G.fog===!0&&Q.refreshFogUniforms(ii,K),Q.refreshMaterialUniforms(ii,G,H,$,f.state.transmissionRenderTarget[C.id]),ha.upload(R,mc(Mt),ii,zt)),G.isShaderMaterial&&G.uniformsNeedUpdate===!0&&(ha.upload(R,mc(Mt),ii,zt),G.uniformsNeedUpdate=!1),G.isSpriteMaterial&&le.setValue(R,"center",N.center),le.setValue(R,"modelViewMatrix",N.modelViewMatrix),le.setValue(R,"normalMatrix",N.normalMatrix),le.setValue(R,"modelMatrix",N.matrixWorld),G.isShaderMaterial||G.isRawShaderMaterial){const Le=G.uniformsGroups;for(let He=0,wl=Le.length;He<wl;He++){const Vn=Le[He];Ft.update(Vn,Je),Ft.bind(Vn,Je)}}return Je}function AC(C,L){C.ambientLightColor.needsUpdate=L,C.lightProbe.needsUpdate=L,C.directionalLights.needsUpdate=L,C.directionalLightShadows.needsUpdate=L,C.pointLights.needsUpdate=L,C.pointLightShadows.needsUpdate=L,C.spotLights.needsUpdate=L,C.spotLightShadows.needsUpdate=L,C.rectAreaLights.needsUpdate=L,C.hemisphereLights.needsUpdate=L}function cC(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return w},this.getRenderTarget=function(){return P},this.setRenderTargetTextures=function(C,L,k){const G=ft.get(C);G.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,G.__autoAllocateDepthBuffer===!1&&(G.__useRenderToTexture=!1),ft.get(C.texture).__webglTexture=L,ft.get(C.depthTexture).__webglTexture=G.__autoAllocateDepthBuffer?void 0:k,G.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,L){const k=ft.get(C);k.__webglFramebuffer=L,k.__useDefaultFramebuffer=L===void 0};const uC=R.createFramebuffer();this.setRenderTarget=function(C,L=0,k=0){P=C,_=L,w=k;let G=!0,N=null,K=!1,At=!1;if(C){const ut=ft.get(C);if(ut.__useDefaultFramebuffer!==void 0)Et.bindFramebuffer(R.FRAMEBUFFER,null),G=!1;else if(ut.__webglFramebuffer===void 0)zt.setupRenderTarget(C);else if(ut.__hasExternalTextures)zt.rebindTextures(C,ft.get(C.texture).__webglTexture,ft.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const St=C.depthTexture;if(ut.__boundDepthTexture!==St){if(St!==null&&ft.has(St)&&(C.width!==St.image.width||C.height!==St.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");zt.setupDepthRenderbuffer(C)}}const Tt=C.texture;(Tt.isData3DTexture||Tt.isDataArrayTexture||Tt.isCompressedArrayTexture)&&(At=!0);const Pt=ft.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(Pt[L])?N=Pt[L][k]:N=Pt[L],K=!0):C.samples>0&&zt.useMultisampledRTT(C)===!1?N=ft.get(C).__webglMultisampledFramebuffer:Array.isArray(Pt)?N=Pt[k]:N=Pt,b.copy(C.viewport),z.copy(C.scissor),F=C.scissorTest}else b.copy(mt).multiplyScalar(H).floor(),z.copy(Ut).multiplyScalar(H).floor(),F=re;if(k!==0&&(N=uC),Et.bindFramebuffer(R.FRAMEBUFFER,N)&&G&&Et.drawBuffers(C,N),Et.viewport(b),Et.scissor(z),Et.setScissorTest(F),K){const ut=ft.get(C.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+L,ut.__webglTexture,k)}else if(At){const ut=L;for(let Tt=0;Tt<C.textures.length;Tt++){const Pt=ft.get(C.textures[Tt]);R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0+Tt,Pt.__webglTexture,k,ut)}}else if(C!==null&&k!==0){const ut=ft.get(C.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,ut.__webglTexture,k)}E=-1},this.readRenderTargetPixels=function(C,L,k,G,N,K,At,gt=0){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ut=ft.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&At!==void 0&&(ut=ut[At]),ut){Et.bindFramebuffer(R.FRAMEBUFFER,ut);try{const Tt=C.textures[gt],Pt=Tt.format,St=Tt.type;if(!jt.textureFormatReadable(Pt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!jt.textureTypeReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}L>=0&&L<=C.width-G&&k>=0&&k<=C.height-N&&(C.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+gt),R.readPixels(L,k,G,N,vt.convert(Pt),vt.convert(St),K))}finally{const Tt=P!==null?ft.get(P).__webglFramebuffer:null;Et.bindFramebuffer(R.FRAMEBUFFER,Tt)}}},this.readRenderTargetPixelsAsync=async function(C,L,k,G,N,K,At,gt=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ut=ft.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&At!==void 0&&(ut=ut[At]),ut)if(L>=0&&L<=C.width-G&&k>=0&&k<=C.height-N){Et.bindFramebuffer(R.FRAMEBUFFER,ut);const Tt=C.textures[gt],Pt=Tt.format,St=Tt.type;if(!jt.textureFormatReadable(Pt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!jt.textureTypeReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Gt=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,Gt),R.bufferData(R.PIXEL_PACK_BUFFER,K.byteLength,R.STREAM_READ),C.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+gt),R.readPixels(L,k,G,N,vt.convert(Pt),vt.convert(St),0);const $t=P!==null?ft.get(P).__webglFramebuffer:null;Et.bindFramebuffer(R.FRAMEBUFFER,$t);const ue=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await $d(R,ue,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,Gt),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,K),R.deleteBuffer(Gt),R.deleteSync(ue),K}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,L=null,k=0){const G=Math.pow(2,-k),N=Math.floor(C.image.width*G),K=Math.floor(C.image.height*G),At=L!==null?L.x:0,gt=L!==null?L.y:0;zt.setTexture2D(C,0),R.copyTexSubImage2D(R.TEXTURE_2D,k,0,0,At,gt,N,K),Et.unbindTexture()};const dC=R.createFramebuffer(),fC=R.createFramebuffer();this.copyTextureToTexture=function(C,L,k=null,G=null,N=0,K=null){K===null&&(N!==0?(ds("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),K=N,N=0):K=0);let At,gt,ut,Tt,Pt,St,Gt,$t,ue;const se=C.isCompressedTexture?C.mipmaps[K]:C.image;if(k!==null)At=k.max.x-k.min.x,gt=k.max.y-k.min.y,ut=k.isBox3?k.max.z-k.min.z:1,Tt=k.min.x,Pt=k.min.y,St=k.isBox3?k.min.z:0;else{const ni=Math.pow(2,-N);At=Math.floor(se.width*ni),gt=Math.floor(se.height*ni),C.isDataArrayTexture?ut=se.depth:C.isData3DTexture?ut=Math.floor(se.depth*ni):ut=1,Tt=0,Pt=0,St=0}G!==null?(Gt=G.x,$t=G.y,ue=G.z):(Gt=0,$t=0,ue=0);const ee=vt.convert(L.format),Mt=vt.convert(L.type);let oe;L.isData3DTexture?(zt.setTexture3D(L,0),oe=R.TEXTURE_3D):L.isDataArrayTexture||L.isCompressedArrayTexture?(zt.setTexture2DArray(L,0),oe=R.TEXTURE_2D_ARRAY):(zt.setTexture2D(L,0),oe=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,L.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,L.unpackAlignment);const Zt=R.getParameter(R.UNPACK_ROW_LENGTH),Je=R.getParameter(R.UNPACK_IMAGE_HEIGHT),Ns=R.getParameter(R.UNPACK_SKIP_PIXELS),Qe=R.getParameter(R.UNPACK_SKIP_ROWS),Ar=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,se.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,se.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Tt),R.pixelStorei(R.UNPACK_SKIP_ROWS,Pt),R.pixelStorei(R.UNPACK_SKIP_IMAGES,St);const le=C.isDataArrayTexture||C.isData3DTexture,ii=L.isDataArrayTexture||L.isData3DTexture;if(C.isDepthTexture){const ni=ft.get(C),Le=ft.get(L),He=ft.get(ni.__renderTarget),wl=ft.get(Le.__renderTarget);Et.bindFramebuffer(R.READ_FRAMEBUFFER,He.__webglFramebuffer),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,wl.__webglFramebuffer);for(let Vn=0;Vn<ut;Vn++)le&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ft.get(C).__webglTexture,N,St+Vn),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ft.get(L).__webglTexture,K,ue+Vn)),R.blitFramebuffer(Tt,Pt,At,gt,Gt,$t,At,gt,R.DEPTH_BUFFER_BIT,R.NEAREST);Et.bindFramebuffer(R.READ_FRAMEBUFFER,null),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(N!==0||C.isRenderTargetTexture||ft.has(C)){const ni=ft.get(C),Le=ft.get(L);Et.bindFramebuffer(R.READ_FRAMEBUFFER,dC),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,fC);for(let He=0;He<ut;He++)le?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,ni.__webglTexture,N,St+He):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,ni.__webglTexture,N),ii?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Le.__webglTexture,K,ue+He):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Le.__webglTexture,K),N!==0?R.blitFramebuffer(Tt,Pt,At,gt,Gt,$t,At,gt,R.COLOR_BUFFER_BIT,R.NEAREST):ii?R.copyTexSubImage3D(oe,K,Gt,$t,ue+He,Tt,Pt,At,gt):R.copyTexSubImage2D(oe,K,Gt,$t,Tt,Pt,At,gt);Et.bindFramebuffer(R.READ_FRAMEBUFFER,null),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else ii?C.isDataTexture||C.isData3DTexture?R.texSubImage3D(oe,K,Gt,$t,ue,At,gt,ut,ee,Mt,se.data):L.isCompressedArrayTexture?R.compressedTexSubImage3D(oe,K,Gt,$t,ue,At,gt,ut,ee,se.data):R.texSubImage3D(oe,K,Gt,$t,ue,At,gt,ut,ee,Mt,se):C.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,K,Gt,$t,At,gt,ee,Mt,se.data):C.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,K,Gt,$t,se.width,se.height,ee,se.data):R.texSubImage2D(R.TEXTURE_2D,K,Gt,$t,At,gt,ee,Mt,se);R.pixelStorei(R.UNPACK_ROW_LENGTH,Zt),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,Je),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Ns),R.pixelStorei(R.UNPACK_SKIP_ROWS,Qe),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Ar),K===0&&L.generateMipmaps&&R.generateMipmap(oe),Et.unbindTexture()},this.copyTextureToTexture3D=function(C,L,k=null,G=null,N=0){return ds('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(C,L,k,G,N)},this.initRenderTarget=function(C){ft.get(C).__webglFramebuffer===void 0&&zt.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?zt.setTextureCube(C,0):C.isData3DTexture?zt.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?zt.setTexture2DArray(C,0):zt.setTexture2D(C,0),Et.unbindTexture()},this.resetState=function(){_=0,w=0,P=null,Et.reset(),lt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ei}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Xt._getDrawingBufferColorSpace(t),e.unpackColorSpace=Xt._getUnpackColorSpace()}}const oc={type:"change"},bl={type:"start"},lc={type:"end"},ca=new qh,hc=new dn,HI=Math.cos(70*qd.DEG2RAD),ve=new O,Ge=2*Math.PI,Kt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},_l=1e-6;class VI extends zf{constructor(t,e=null){super(t,e),this.state=Kt.NONE,this.target=new O,this.cursor=new O,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:rs.ROTATE,MIDDLE:rs.DOLLY,RIGHT:rs.PAN},this.touches={ONE:as.ROTATE,TWO:as.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O,this._lastQuaternion=new Rn,this._lastTargetPosition=new O,this._quat=new Rn().setFromUnitVectors(t.up,new O(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new TA,this._sphericalDelta=new TA,this._scale=1,this._panOffset=new O,this._rotateStart=new Nt,this._rotateEnd=new Nt,this._rotateDelta=new Nt,this._panStart=new Nt,this._panEnd=new Nt,this._panDelta=new Nt,this._dollyStart=new Nt,this._dollyEnd=new Nt,this._dollyDelta=new Nt,this._dollyDirection=new O,this._mouse=new Nt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=YI.bind(this),this._onPointerDown=WI.bind(this),this._onPointerUp=XI.bind(this),this._onContextMenu=$I.bind(this),this._onMouseWheel=JI.bind(this),this._onKeyDown=QI.bind(this),this._onTouchStart=qI.bind(this),this._onTouchMove=KI.bind(this),this._onMouseDown=ZI.bind(this),this._onMouseMove=jI.bind(this),this._interceptControlDown=tC.bind(this),this._interceptControlUp=eC.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(oc),this.update(),this.state=Kt.NONE}update(t=null){const e=this.object.position;ve.copy(e).sub(this.target),ve.applyQuaternion(this._quat),this._spherical.setFromVector3(ve),this.autoRotate&&this.state===Kt.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(i)&&isFinite(n)&&(i<-Math.PI?i+=Ge:i>Math.PI&&(i-=Ge),n<-Math.PI?n+=Ge:n>Math.PI&&(n-=Ge),i<=n?this._spherical.theta=Math.max(i,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+n)/2?Math.max(i,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(ve.setFromSpherical(this._spherical),ve.applyQuaternion(this._quatInverse),e.copy(this.target).add(ve),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=ve.length();a=this._clampDistance(o*this._scale);const h=o-a;this.object.position.addScaledVector(this._dollyDirection,h),this.object.updateMatrixWorld(),r=!!h}else if(this.object.isOrthographicCamera){const o=new O(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const h=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=h!==this.object.zoom;const l=new O(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=ve.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(ca.origin.copy(this.object.position),ca.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ca.direction))<HI?this.object.lookAt(this.target):(hc.setFromNormalAndCoplanarPoint(this.object.up,this.target),ca.intersectPlane(hc,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>_l||8*(1-this._lastQuaternion.dot(this.object.quaternion))>_l||this._lastTargetPosition.distanceToSquared(this.target)>_l?(this.dispatchEvent(oc),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ge/60*this.autoRotateSpeed*t:Ge/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){ve.setFromMatrixColumn(e,0),ve.multiplyScalar(-t),this._panOffset.add(ve)}_panUp(t,e){this.screenSpacePanning===!0?ve.setFromMatrixColumn(e,1):(ve.setFromMatrixColumn(e,0),ve.crossVectors(this.object.up,ve)),ve.multiplyScalar(t),this._panOffset.add(ve)}_pan(t,e){const i=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;ve.copy(n).sub(this.target);let r=ve.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/i.clientHeight,this.object.matrix),this._panUp(2*e*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),n=t-i.left,r=e-i.top,a=i.width,o=i.height;this._mouse.x=n/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Ge*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ge*this._rotateDelta.y/e.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)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ge*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._rotateStart.set(i,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panStart.set(i,n)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(i*i+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),n=.5*(t.pageX+i.x),r=.5*(t.pageY+i.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Ge*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ge*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panEnd.set(i,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(i*i+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new Nt,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,i={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:i.deltaY*=16;break;case 2:i.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(i.deltaY*=10),i}}function WI(s){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(s.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(s)&&(this._addPointer(s),s.pointerType==="touch"?this._onTouchStart(s):this._onMouseDown(s)))}function YI(s){this.enabled!==!1&&(s.pointerType==="touch"?this._onTouchMove(s):this._onMouseMove(s))}function XI(s){switch(this._removePointer(s),this._pointers.length){case 0:this.domElement.releasePointerCapture(s.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(lc),this.state=Kt.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function ZI(s){let t;switch(s.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case rs.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(s),this.state=Kt.DOLLY;break;case rs.ROTATE:if(s.ctrlKey||s.metaKey||s.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(s),this.state=Kt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(s),this.state=Kt.ROTATE}break;case rs.PAN:if(s.ctrlKey||s.metaKey||s.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(s),this.state=Kt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(s),this.state=Kt.PAN}break;default:this.state=Kt.NONE}this.state!==Kt.NONE&&this.dispatchEvent(bl)}function jI(s){switch(this.state){case Kt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(s);break;case Kt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(s);break;case Kt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(s);break}}function JI(s){this.enabled===!1||this.enableZoom===!1||this.state!==Kt.NONE||(s.preventDefault(),this.dispatchEvent(bl),this._handleMouseWheel(this._customWheelEvent(s)),this.dispatchEvent(lc))}function QI(s){this.enabled!==!1&&this._handleKeyDown(s)}function qI(s){switch(this._trackPointer(s),this._pointers.length){case 1:switch(this.touches.ONE){case as.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(s),this.state=Kt.TOUCH_ROTATE;break;case as.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(s),this.state=Kt.TOUCH_PAN;break;default:this.state=Kt.NONE}break;case 2:switch(this.touches.TWO){case as.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(s),this.state=Kt.TOUCH_DOLLY_PAN;break;case as.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(s),this.state=Kt.TOUCH_DOLLY_ROTATE;break;default:this.state=Kt.NONE}break;default:this.state=Kt.NONE}this.state!==Kt.NONE&&this.dispatchEvent(bl)}function KI(s){switch(this._trackPointer(s),this.state){case Kt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(s),this.update();break;case Kt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(s),this.update();break;case Kt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(s),this.update();break;case Kt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(s),this.update();break;default:this.state=Kt.NONE}}function $I(s){this.enabled!==!1&&s.preventDefault()}function tC(s){s.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function eC(s){s.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Ac={LANGUAGE_CHANGE_CONFIRMED:ga.LANGUAGE_CHANGE_CONFIRMED},iC={languages:[],selected:void 0};class fn extends HTMLElement{static textureLoader=new xA;static languagesAttribute="languages";static selectedAttribute="selected";static get observedAttributes(){return[fn.languagesAttribute,fn.selectedAttribute]}_shadowRoot;_renderer;_scene;_camera;_container;_canvas;_controls;_resizeObserver;_clock=new _A;_lastTime=0;_lights=[];_spotlight;_flagsGroup;_wind=null;_circleRadius=5;_cameraLookAtY=2;_targetGroupRotation=0;_currentGroupRotation=0;_unwrappedGroupRotation=0;_animationFrameId=0;_introCameraStartPosition=new O(0,5,10);_introCameraEndPosition=new O(0,5,10);_introCameraElapsed=0;_introCameraMoveDuration=2.2;_introCameraHoldDuration=.4;_isIntroCameraAnimating=!1;_isIntroCameraHolding=!1;_languages=[];_selectedId=null;_previewId=null;_menuContainer;_menuIntroStartScale=.72;_barMenu;_languageButtons=[];_confirmationDialog;_isInitialized=!1;_isInitializing=!1;constructor(t){super(),this._shadowRoot=this.attachShadow({mode:"open"});const{languages:e,selected:i}={...iC,...t};e.length>0&&this._initializeComponent(e,i)}_indexOfId(t){return this._languages.findIndex(e=>e.id===t)}_idOfIndex(t){return this._languages[t]?.id??null}attributeChangedCallback(t,e,i){if(!(e===i||i==null)){if(t===fn.languagesAttribute){if(this._isInitialized||this._isInitializing)return;try{const n=JSON.parse(i),r=this.getAttribute(fn.selectedAttribute);Array.isArray(n)&&n.length>0&&this._initializeComponent(n,r)}catch(n){console.error("LanguagePickerComponent: Error parsing languages attribute",n)}return}t===fn.selectedAttribute&&(this._selectedId=i,this._isInitialized&&(this._previewId=this._selectedId,this._rotateToId(this._selectedId),this._syncBarMenuToId(this._selectedId)))}}connectedCallback(){this._isInitialized&&this._animationFrameId===0&&(this._animationFrameId=requestAnimationFrame(this._animate))}disconnectedCallback(){cancelAnimationFrame(this._animationFrameId),this._animationFrameId=0,this._languages.forEach(t=>{t.flagGroup?.destroy(),this._scene.remove(t.object)}),this._lights.forEach(t=>{t.dispose()}),this._scene.clear(),this._renderer.dispose(),this._resizeObserver.disconnect()}selectLanguage(t){if(this._isInitialized){if(!this._languages.some(e=>e.id===t)){console.warn(`LanguagePickerComponent: Language '${t}' not found`);return}t!==this._selectedId&&(this._selectedId=t,this._previewId=t,this._rotateToId(t),this._syncBarMenuToId(t))}}_applyPreview(t){this._previewId=t,this._rotateToId(t),this._syncBarMenuToId(t)}addLanguage(t){}addLocales(t){}removeLanguage(t){}removeLocales(t){}_rotateToId(t){const e=this._languages.find(r=>r.id===t);if(e===void 0)return;const i=2*Math.PI;let n=e.angle;for(;Math.abs(n-this._unwrappedGroupRotation)>Math.PI;)n+=n<this._unwrappedGroupRotation?i:-i;this._targetGroupRotation=n,this._unwrappedGroupRotation=n,this._controls.enabled=!1}_syncBarMenuToId(t){const e=this._indexOfId(t);e!==-1&&this._barMenu.scrollToButton(e)}_initializeComponent(t,e){if(!(this._isInitialized||this._isInitializing)){if(t.length===0){console.warn("LanguagePickerComponent: No languages provided");return}this._isInitializing=!0,this._setupScene(),this._setupUI(),this._setupFlags(t,e),this._setupConfirmationDialog(),this._listenToBarMenuNavigation(),this._isInitialized=!0,this._isInitializing=!1,this.isConnected&&this._animationFrameId===0&&(this._animationFrameId=requestAnimationFrame(this._animate))}}_listenToBarMenuNavigation(){new MutationObserver(()=>{const e=this._barMenu.getAllButtons();for(let i=0;i<e.length;i++){const n=window.getComputedStyle(e[i]);if(n.display!=="none"&&n.visibility!=="hidden"&&n.opacity!=="0"){const a=this._idOfIndex(i);if(a===null)return;a!==this._previewId&&this._applyPreview(a);break}}}).observe(this._barMenu,{attributes:!0,subtree:!0,attributeFilter:["style","class"]})}_setupScene(){this._container=document.createElement("div"),this._container.style.width="100%",this._container.style.height="100%",this._container.style.position="relative",this._container.style.overflow="hidden",this._canvas=document.createElement("canvas"),this._canvas.style.width="100%",this._canvas.style.height="100%",this._canvas.style.display="block",this._container.appendChild(this._canvas),this._scene=new IA,this._scene.background=new Wt(1710618),this._scene.fog=new cl(1710618,8,50),this._camera=new ke(45,1,.1,100),this._camera.position.set(0,5,10),this._camera.lookAt(0,2,0),this._scene.add(this._camera),this._renderer=new ac({antialias:!0,canvas:this._canvas,alpha:!0}),this._renderer.debug.checkShaderErrors=!0,this._renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this._renderer.shadowMap.enabled=!1,this._controls=new VI(this._camera,this._canvas),this._controls.enableDamping=!0,this._controls.dampingFactor=.05,this._controls.autoRotate=!1,this._controls.enableRotate=!1,this._controls.enablePan=!1,this._controls.enableZoom=!1,this._controls.target.set(0,this._cameraLookAtY,0);const t=new Bf(16777215,.3);this._scene.add(t),this._lights.push(t);const e=new bA(14674943,3);e.position.set(10,20,10),this._scene.add(e),this._lights.push(e);const i=new bA(11329439,.15);i.position.set(0,-1,0),this._scene.add(i),this._lights.push(i),this._spotlight=new Of(16777215,150),this._spotlight.angle=Math.PI/6,this._spotlight.penumbra=.3,this._spotlight.decay=2,this._spotlight.distance=30,this._scene.add(this._spotlight),this._scene.add(this._spotlight.target),this._lights.push(this._spotlight);const n=new Ii(new lr(100,100),new Tf({color:1710618,roughness:.8,metalness:.2}));n.rotation.x=-Math.PI/2,n.receiveShadow=!0,this._scene.add(n);const r=()=>{const a=this._container.clientWidth,o=this._container.clientHeight;a===0||o===0||(this._camera.aspect=a/o,this._camera.updateProjectionMatrix(),this._renderer.setSize(a,o,!1))};this._resizeObserver=new ResizeObserver(r),this._resizeObserver.observe(this._container),r(),this._wind=new Ni.Wind({speed:8,direction:new O(1,0,0)}),this._flagsGroup=new or,this._scene.add(this._flagsGroup),this._shadowRoot.appendChild(this._container)}_setupUI(){this._barMenu=document.createElement(Kc.selector),this._barMenu.visibleButtons=1,this._barMenu.cyclicalNavigation=!0,this._menuContainer=document.createElement("div"),Object.assign(this._menuContainer.style,{position:"absolute",bottom:"25%",left:"50%",zIndex:"9999",pointerEvents:"auto",transformOrigin:"center bottom"}),this._setMenuIntroScale(1),this._menuContainer.appendChild(this._barMenu),this._shadowRoot.appendChild(this._menuContainer);const t=document.createElement("style");t.textContent=":host { display: block; width: 100%; height: 100%; }",this._shadowRoot.appendChild(t)}_setupFlags(t,e){const i=t.length;this._circleRadius=Math.max(5,3+i*.5),this._cameraLookAtY=this._circleRadius*.4,t.forEach((o,h)=>{const l=-(h/i*Math.PI*2),A=-Math.sin(l)*this._circleRadius,c=Math.cos(l)*this._circleRadius,u=Ni.buildFlag(),d=Ni.buildFlagpole({flagpoleType:Ni.FLAG_POLE_TYPE.VERTICAL},u),p=new Ni.FlagGroup({flagpole:d,flag:u});p.object.position.set(A,0,c);const m=pa.get(o)?.isoCode,g=m!=null?Wn[m]:void 0;g!=null&&fn.textureLoader.load(g,f=>{p.setTexture(f)},void 0,()=>{console.warn(`LanguagePickerComponent: Failed to load texture for ${o}`)}),this._flagsGroup.add(p.object),this._languages.push({id:o,flagGroup:p,object:p.object,angle:l,wind:null,windPhase:Math.random()*Math.PI*2,randomSeed:Math.random()})});const n=this._selectedId!==null&&t.includes(this._selectedId)?this._selectedId:e!=null&&t.includes(e)?e:t[0];this._selectedId=n,this._previewId=n;const r=this._languages.find(o=>o.id===n);if(r===void 0){console.error(`LanguagePickerComponent: Initial language '${n}' not found`);return}this._targetGroupRotation=r.angle,this._currentGroupRotation=r.angle,this._unwrappedGroupRotation=r.angle,this._flagsGroup.rotation.y=r.angle;const a=this._computeIntroCameraEndPosition();this._introCameraEndPosition.copy(a),this._introCameraStartPosition.set(0,a.y+this._circleRadius*3.1,a.z+this._circleRadius*4.6),this._camera.position.copy(this._introCameraStartPosition),this._controls.target.set(0,this._cameraLookAtY,0),this._controls.update(),this._introCameraElapsed=0,this._isIntroCameraHolding=!0,this._isIntroCameraAnimating=!0,this._setMenuIntroScale(0),this._spotlight.position.set(0,8,this._circleRadius),this._spotlight.target.position.set(0,0,this._circleRadius),this._spotlight.target.updateMatrixWorld()}_computeIntroCameraEndPosition(){const t=new ps().setFromObject(this._flagsGroup),e=new O,i=new O;t.getSize(e),t.getCenter(i);const n=t.min.y,r=Math.max(e.x,e.y,e.z)*.5,a=this._camera.fov*Math.PI/180,o=this._camera.aspect>0?this._camera.aspect:1,h=2*Math.atan(Math.tan(a*.5)*o),l=Math.max(r/Math.tan(a*.5),r/Math.tan(h*.5))*1.05,A=n+e.y*.25;this._cameraLookAtY=A+e.y*.06;const c=A+Math.max(e.y*.8,this._circleRadius*.28),u=i.z+l+this._circleRadius*.01;return new O(0,c,u)}_setupConfirmationDialog(){this._confirmationDialog=document.createElement(Yn.selector),this._confirmationDialog.id="confirmation-dialog",this._shadowRoot.appendChild(this._confirmationDialog),this._confirmationDialog.addEventListener(Yn.COMPONENT_CUSTOM_MESSAGES.CONFIRMATION_DIALOG_CONFIRM,this._handleConfirmation),this._languages.forEach(t=>{const e=document.createElement(kc.selector);e.textContent=pa.get(t.id)?.autonyms??t.id,e.addEventListener(ma.CLICK,()=>{const i=pa.get(t.id);i!==void 0&&(this._applyPreview(t.id),this._confirmationDialog.value=i.id,this._confirmationDialog.headline="Switch language?",this._confirmationDialog.text=`Switch to ${i.language.toLowerCase()}?`,this._confirmationDialog.showModal())}),this._languageButtons.push(e),this._barMenu.appendChild(e)})}_handleConfirmation=()=>{const t=this._confirmationDialog.value;t!==void 0&&t!==this._selectedId&&this.dispatchEvent(new CustomEvent(Ac.LANGUAGE_CHANGE_CONFIRMED,{detail:{value:t},bubbles:!0,composed:!0}))};_animate=()=>{this._animationFrameId=requestAnimationFrame(this._animate);try{if(!this._isInitialized||this._camera==null||this._renderer==null)return;const t=this._clock.getElapsedTime(),e=t-this._lastTime;this._lastTime=t,this._wind?.update(),this._languages.forEach((i,n)=>{if(i.flagGroup==null)return;i.windPhase+=e*(.5+i.randomSeed*1.5),Ni.applyGravityToCloth(i.flagGroup.flag.cloth,i.flagGroup.flag.object),this._wind!=null&&Ni.applyWindForceToCloth(i.flagGroup.flag.cloth,this._wind,i.flagGroup.flag.object,{randomizeAmount:.6,randomSeed:i.randomSeed});const r=new Ni.Wind({speed:.3+Math.sin(i.windPhase)*.2,direction:new O(Math.sin(i.windPhase+n)*.5,Math.cos(i.windPhase*.7),Math.sin(i.windPhase*.5+n)).normalize()});Ni.applyWindForceToCloth(i.flagGroup.flag.cloth,r,i.flagGroup.flag.object,{randomizeAmount:.5,randomSeed:i.randomSeed*2}),i.flagGroup.simulate(e),i.flagGroup.render()}),this._updateGroupRotation(),this._updateIntroCamera(e),this._controls.update(),this._renderer.render(this._scene,this._camera)}catch(t){console.error("Animation loop error:",t),cancelAnimationFrame(this._animationFrameId)}};_updateGroupRotation(){if(this._flagsGroup==null)return;const t=this._targetGroupRotation-this._currentGroupRotation;this._currentGroupRotation+=t*.1,this._flagsGroup.rotation.y=this._currentGroupRotation,Math.abs(t)<.01&&(this._controls.enabled=!0)}_updateIntroCamera(t){if(!this._isIntroCameraAnimating)return;if(this._isIntroCameraHolding){this._introCameraElapsed+=t,this._camera.position.copy(this._introCameraStartPosition),this._controls.target.set(0,this._cameraLookAtY,0),this._setMenuIntroScale(0),this._introCameraElapsed>=this._introCameraHoldDuration&&(this._isIntroCameraHolding=!1,this._introCameraElapsed=0);return}this._introCameraElapsed+=t;const e=Math.min(1,this._introCameraElapsed/this._introCameraMoveDuration),i=e*e*(3-2*e),n=1-Math.pow(1-e,4);this._camera.position.set(0,this._introCameraStartPosition.y+(this._introCameraEndPosition.y-this._introCameraStartPosition.y)*n,this._introCameraStartPosition.z+(this._introCameraEndPosition.z-this._introCameraStartPosition.z)*i),this._controls.target.set(0,this._cameraLookAtY,0),this._setMenuIntroScale(i),e>=1&&(this._isIntroCameraAnimating=!1,this._camera.position.copy(this._introCameraEndPosition),this._setMenuIntroScale(1))}_setMenuIntroScale(t){if(this._menuContainer==null)return;const e=Math.min(1,Math.max(0,t)),i=this._menuIntroStartScale+(1-this._menuIntroStartScale)*e;this._menuContainer.style.transform=`translateX(-50%) scale(${i})`}}const nC=Object.freeze(Object.defineProperty({__proto__:null,COMPONENT_CUSTOM_MESSAGES:Ac,LanguagePickerComponent:fn,selector:"as-language-picker"},Symbol.toStringTag,{value:"Module"})),sC=`<section class="root">
3956
3956
  <canvas></canvas>
3957
3957
  <header-body-footer-dialog class="dialog-details">
3958
3958
  <section slot="header" class="header">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@albi_scando/as-design-system-threejs-lib",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A library of reusable, strongly typed threejs Web Components built with TypeScript, designed for creating consistent and maintainable user interfaces.",
5
5
  "type": "module",
6
6
  "files": [