@needle-tools/engine 4.1.0-beta.8 → 4.1.0-beta.9

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/gltf-progressive.js +148 -150
  3. package/dist/gltf-progressive.light.js +148 -150
  4. package/dist/gltf-progressive.light.min.js +6 -6
  5. package/dist/gltf-progressive.light.umd.cjs +7 -7
  6. package/dist/gltf-progressive.min.js +6 -6
  7. package/dist/gltf-progressive.umd.cjs +7 -7
  8. package/dist/needle-engine.bundle.js +4018 -4003
  9. package/dist/needle-engine.bundle.light.js +4018 -4003
  10. package/dist/needle-engine.bundle.light.min.js +109 -109
  11. package/dist/needle-engine.bundle.light.umd.cjs +115 -115
  12. package/dist/needle-engine.bundle.min.js +109 -109
  13. package/dist/needle-engine.bundle.umd.cjs +109 -109
  14. package/dist/needle-engine.d.ts +4 -0
  15. package/dist/needle-engine.js +2 -2
  16. package/dist/needle-engine.light.d.ts +13 -9
  17. package/dist/needle-engine.light.js +2 -2
  18. package/dist/needle-engine.light.min.js +1 -1
  19. package/dist/needle-engine.min.js +1 -1
  20. package/dist/postprocessing.js +1 -1
  21. package/dist/postprocessing.light.js +1 -1
  22. package/dist/postprocessing.light.min.js +1 -1
  23. package/dist/postprocessing.min.js +1 -1
  24. package/dist/three-examples.js +1 -1
  25. package/dist/three-examples.light.js +1 -1
  26. package/dist/three-examples.light.min.js +1 -1
  27. package/dist/three-examples.min.js +1 -1
  28. package/dist/three-mesh-ui.js +1 -1
  29. package/dist/three-mesh-ui.light.js +1 -1
  30. package/dist/three-mesh-ui.light.min.js +1 -1
  31. package/dist/three-mesh-ui.min.js +1 -1
  32. package/dist/three.js +14 -14
  33. package/dist/three.light.js +14 -14
  34. package/dist/three.light.min.js +1 -1
  35. package/dist/three.min.js +1 -1
  36. package/dist/vendor.js +1 -1
  37. package/dist/vendor.light.js +1 -1
  38. package/dist/vendor.light.min.js +1 -1
  39. package/dist/vendor.min.js +1 -1
  40. package/lib/engine/engine_gameobject.d.ts +0 -12
  41. package/lib/engine/engine_gameobject.js +0 -13
  42. package/lib/engine/engine_gameobject.js.map +1 -1
  43. package/lib/engine/engine_types.d.ts +5 -0
  44. package/lib/engine/engine_types.js +6 -0
  45. package/lib/engine/engine_types.js.map +1 -1
  46. package/lib/engine/export/gltf/Writers.js.map +1 -1
  47. package/lib/engine/export/gltf/index.js +11 -1
  48. package/lib/engine/export/gltf/index.js.map +1 -1
  49. package/lib/engine/export/utils.d.ts +2 -0
  50. package/lib/engine/export/utils.js +8 -0
  51. package/lib/engine/export/utils.js.map +1 -0
  52. package/lib/engine/extensions/NEEDLE_gameobject_data.js +1 -1
  53. package/lib/engine/extensions/NEEDLE_gameobject_data.js.map +1 -1
  54. package/lib/engine/js-extensions/Object3D.d.ts +5 -1
  55. package/lib/engine/js-extensions/Object3D.js.map +1 -1
  56. package/lib/engine-components/Component.d.ts +1 -2
  57. package/lib/engine-components/Component.js +3 -3
  58. package/lib/engine-components/Component.js.map +1 -1
  59. package/lib/engine-components/ContactShadows.d.ts +1 -1
  60. package/lib/engine-components/ContactShadows.js +7 -0
  61. package/lib/engine-components/ContactShadows.js.map +1 -1
  62. package/lib/engine-components/export/gltf/GltfExport.js +23 -4
  63. package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
  64. package/package.json +2 -2
  65. package/src/engine/engine_gameobject.ts +0 -13
  66. package/src/engine/engine_types.ts +6 -0
  67. package/src/engine/export/gltf/Writers.ts +0 -1
  68. package/src/engine/export/gltf/index.ts +13 -3
  69. package/src/engine/export/index.ts +1 -1
  70. package/src/engine/export/utils.ts +10 -0
  71. package/src/engine/extensions/NEEDLE_gameobject_data.ts +1 -2
  72. package/src/engine/js-extensions/Object3D.ts +6 -1
  73. package/src/engine-components/Component.ts +4 -4
  74. package/src/engine-components/ContactShadows.ts +11 -2
  75. package/src/engine-components/export/gltf/GltfExport.ts +26 -6
@@ -3871,4 +3871,4 @@ ${e.tab}if ( ${u} ) {
3871
3871
  `}}class cT{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.startTime=null,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let i=e.get(t);return i===void 0&&(i={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,i)),i}updateBeforeNode(e){const t=e.getUpdateBeforeType(),i=e.updateReference(this);if(t===je.FRAME){const{frameMap:r}=this._getMaps(this.updateBeforeMap,i);r.get(i)!==this.frameId&&e.updateBefore(this)!==!1&&r.set(i,this.frameId)}else if(t===je.RENDER){const{renderMap:r}=this._getMaps(this.updateBeforeMap,i);r.get(i)!==this.renderId&&e.updateBefore(this)!==!1&&r.set(i,this.renderId)}else t===je.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),i=e.updateReference(this);if(t===je.FRAME){const{frameMap:r}=this._getMaps(this.updateAfterMap,i);r.get(i)!==this.frameId&&e.updateAfter(this)!==!1&&r.set(i,this.frameId)}else if(t===je.RENDER){const{renderMap:r}=this._getMaps(this.updateAfterMap,i);r.get(i)!==this.renderId&&e.updateAfter(this)!==!1&&r.set(i,this.renderId)}else t===je.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),i=e.updateReference(this);if(t===je.FRAME){const{frameMap:r}=this._getMaps(this.updateMap,i);r.get(i)!==this.frameId&&e.update(this)!==!1&&r.set(i,this.frameId)}else if(t===je.RENDER){const{renderMap:r}=this._getMaps(this.updateMap,i);r.get(i)!==this.renderId&&e.update(this)!==!1&&r.set(i,this.renderId)}else t===je.OBJECT&&e.update(this)}update(){this.frameId++,this.lastTime===void 0&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class Bg{constructor(e,t,i=null,r="",s=!1){this.type=e,this.name=t,this.count=i,this.qualifier=r,this.isConst=s}}Bg.isNodeFunctionInput=!0;class C3 extends qe{static get type(){return"StructTypeNode"}constructor(e){super(),this.types=e,this.isStructTypeNode=!0}getMemberTypes(){return this.types}}class zg extends qe{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}setup(e){super.setup(e);const t=this.members,i=[];for(let r=0;r<t.length;r++)i.push(t[r].getNodeType(e));this.nodeType=e.getStructTypeFromNode(new C3(i)).name}generate(e,t){const i=e.getOutputStructName(),r=this.members,s=i!==""?i+".":"";for(let a=0;a<r.length;a++){const o=r[a].build(e,t);e.addLineFlowCode(`${s}m${a} = ${o}`,this)}return i}}const R3=K(zg);function kg(n,e){for(let t=0;t<n.length;t++)if(n[t].name===e)return t;return-1}class uT extends zg{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.isMRTNode=!0}has(e){return this.outputNodes[e]!==void 0}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes};return gd(t)}setup(e){const t=this.outputNodes,i=e.renderer.getRenderTarget(),r=[],s=i.textures;for(const a in t){const o=kg(s,a);r[o]=ae(t[a])}return this.members=r,super.setup(e)}}const gd=K(uT);class hT extends qe{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let i=this._candidateFnCall;if(i===null){let r=null,s=-1;for(const a of this.functionNodes){const o=a.shaderNode.layout;if(o===null)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const l=o.inputs;if(t.length===l.length){let c=0;for(let u=0;u<t.length;u++){const h=t[u],d=l[u];h.getNodeType(e)===d.type?c++:c=0}c>s&&(r=a,s=c)}}this._candidateFnCall=i=r(...t)}return i}}const I3=K(hT),Di=n=>(...e)=>I3(n,...e);class Si extends Ks{static get type(){return"TimerNode"}constructor(e=Si.LOCAL,t=1,i=0){super(i),this.scope=e,this.scale=t,this.updateType=je.FRAME}update(e){const t=this.scope,i=this.scale;t===Si.LOCAL?this.value+=e.deltaTime*i:t===Si.DELTA?this.value=e.deltaTime*i:t===Si.FRAME?this.value=e.frameId:this.value=e.time*i}serialize(e){super.serialize(e),e.scope=this.scope,e.scale=this.scale}deserialize(e){super.deserialize(e),this.scope=e.scope,this.scale=e.scale}}Si.LOCAL="local",Si.GLOBAL="global",Si.DELTA="delta",Si.FRAME="frame";const Hg=(n,e=0)=>G(new Si(Si.LOCAL,n,e)),L3=(n,e=0)=>G(new Si(Si.GLOBAL,n,e)),P3=(n,e=0)=>G(new Si(Si.DELTA,n,e)),D3=ge(Si,Si.FRAME).toUint();class gi extends qe{static get type(){return"OscNode"}constructor(e=gi.SINE,t=Hg()){super(),this.method=e,this.timeNode=t}getNodeType(e){return this.timeNode.getNodeType(e)}setup(){const e=this.method,t=G(this.timeNode);let i=null;return e===gi.SINE?i=t.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5):e===gi.SQUARE?i=t.fract().round():e===gi.TRIANGLE?i=t.add(.5).fract().mul(2).sub(1).abs():e===gi.SAWTOOTH&&(i=t.fract()),i}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}gi.SINE="sine",gi.SQUARE="square",gi.TRIANGLE="triangle",gi.SAWTOOTH="sawtooth";const U3=K(gi,gi.SINE),O3=K(gi,gi.SQUARE),F3=K(gi,gi.TRIANGLE),V3=K(gi,gi.SAWTOOTH);class dT extends qe{static get type(){return"SpriteSheetUVNode"}constructor(e,t=nt(),i=E(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=i}setup(){const{frameNode:e,uvNode:t,countNode:i}=this,{width:r,height:s}=i,a=e.mod(r.mul(s)).floor(),o=a.mod(r),l=s.sub(a.add(1).div(r).ceil()),c=i.reciprocal(),u=z(o,l);return t.add(u).mul(c)}}const B3=K(dT);class pT extends as{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}setup(e){return e.isAvailable("storageBuffer")===!1&&this.node.bufferObject===!0&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let i;const r=e.context.assign;if(e.isAvailable("storageBuffer")===!1?this.node.bufferObject===!0&&r!==!0?i=e.generatePBO(this):i=this.node.build(e):i=super.generate(e),r!==!0){const s=this.getNodeType(e);i=e.format(i,s,t)}return i}}const z3=K(pT);class mT extends qe{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,i=null,r=E(1),s=Zt,a=ur){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=i,this.scaleNode=r,this.positionNode=s,this.normalNode=a}setup(){const{textureXNode:e,textureYNode:t,textureZNode:i,scaleNode:r,positionNode:s,normalNode:a}=this;let o=a.abs().normalize();o=o.div(o.dot(D(1)));const l=s.yz.mul(r),c=s.zx.mul(r),u=s.xy.mul(r),h=e.value,d=t!==null?t.value:h,p=i!==null?i.value:h,m=yt(h,l).mul(o.x),v=yt(d,c).mul(o.y),f=yt(p,u).mul(o.z);return zt(m,v,f)}}const fT=K(mT),k3=(...n)=>fT(...n),Mo=new ln,ca=new N,bo=new N,Gg=new N,dc=new Re,vd=new N(0,0,-1),Dn=new st,pc=new N,yd=new N,mc=new st,xd=new J,gT=new ui,H3=ps.flipX();let Wg=!1;class vT extends dn{static get type(){return"ReflectorNode"}constructor(e={}){super(gT.texture,H3);const{target:t=new _t,resolution:i=1,generateMipmaps:r=!1,bounces:s=!0}=e;this.target=t,this.resolution=i,this.generateMipmaps=r,this.bounces=s,this.updateBeforeType=s?je.RENDER:je.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new WeakMap}_updateResolution(e,t){const i=this.resolution;t.getDrawingBufferSize(xd),e.setSize(Math.round(xd.width*i),Math.round(xd.height*i))}setup(e){return this._updateResolution(gT,e.renderer),super.setup(e)}getTextureNode(){return this.textureNode}getVirtualCamera(e){let t=this.virtualCameras.get(e);return t===void 0&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return t===void 0&&(t=new ui(0,0,{type:wi}),this.generateMipmaps===!0&&(t.texture.minFilter=F0,t.texture.generateMipmaps=!0),this.renderTargets.set(e,t)),t}updateBefore(e){if(this.bounces===!1&&Wg)return!1;Wg=!0;const{scene:t,camera:i,renderer:r,material:s}=e,{target:a}=this,o=this.getVirtualCamera(i),l=this.getRenderTarget(o);if(r.getDrawingBufferSize(xd),this._updateResolution(l,r),bo.setFromMatrixPosition(a.matrixWorld),Gg.setFromMatrixPosition(i.matrixWorld),dc.extractRotation(a.matrixWorld),ca.set(0,0,1),ca.applyMatrix4(dc),pc.subVectors(bo,Gg),pc.dot(ca)>0)return;pc.reflect(ca).negate(),pc.add(bo),dc.extractRotation(i.matrixWorld),vd.set(0,0,-1),vd.applyMatrix4(dc),vd.add(Gg),yd.subVectors(bo,vd),yd.reflect(ca).negate(),yd.add(bo),o.coordinateSystem=i.coordinateSystem,o.position.copy(pc),o.up.set(0,1,0),o.up.applyMatrix4(dc),o.up.reflect(ca),o.lookAt(yd),o.near=i.near,o.far=i.far,o.updateMatrixWorld(),o.projectionMatrix.copy(i.projectionMatrix),Mo.setFromNormalAndCoplanarPoint(ca,bo),Mo.applyMatrix4(o.matrixWorldInverse),Dn.set(Mo.normal.x,Mo.normal.y,Mo.normal.z,Mo.constant);const c=o.projectionMatrix;mc.x=(Math.sign(Dn.x)+c.elements[8])/c.elements[0],mc.y=(Math.sign(Dn.y)+c.elements[9])/c.elements[5],mc.z=-1,mc.w=(1+c.elements[10])/c.elements[14],Dn.multiplyScalar(1/Dn.dot(mc));const u=0;c.elements[2]=Dn.x,c.elements[6]=Dn.y,c.elements[10]=Dn.z-u,c.elements[14]=Dn.w,this.value=l.texture,s.visible=!1;const h=r.getRenderTarget(),d=r.getMRT();r.setMRT(null),r.setRenderTarget(l),r.render(t,o),r.setMRT(d),r.setRenderTarget(h),s.visible=!0,Wg=!1}}const G3=n=>G(new vT(n)),jg=new Ds(-1,1,1,-1,0,1);class W3 extends ct{constructor(e=!1){super();const t=e===!1?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new De([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new De(t,2))}}const j3=new W3;class fn extends Ft{constructor(e=null){super(j3,e),this.camera=jg,this.isQuadMesh=!0}renderAsync(e){return e.renderAsync(this,jg)}render(e){e.render(this,jg)}}const X3=new J;class yT extends dn{static get type(){return"RTTNode"}constructor(e,t=null,i=null,r={type:wi}){const s=new ui(t,i,r);super(s.texture,nt()),this.node=e,this.width=t,this.height=i,this.renderTarget=s,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this.updateMap=new WeakMap,this._rttNode=null,this._quadMesh=new fn(new bt),this.updateBeforeType=je.RENDER}get autoSize(){return this.width===null}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const i=e*this.pixelRatio,r=t*this.pixelRatio;this.renderTarget.setSize(i,r),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(this.textureNeedsUpdate===!1&&this.autoUpdate===!1)return;if(this.textureNeedsUpdate=!1,this.autoSize===!0){this.pixelRatio=e.getPixelRatio();const i=e.getSize(X3);this.setSize(i.width,i.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new dn(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const xT=(n,...e)=>G(new yT(G(n),...e)),Zi=(n,...e)=>n.isTextureNode?n:xT(n,...e);class _T extends Gf{static get type(){return"VertexColorNode"}constructor(e=0){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e),i=e.hasGeometryAttribute(t);let r;return i===!0?r=super.generate(e):r=e.generateConst(this.nodeType,new st(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const q3=(...n)=>G(new _T(...n));class MT extends qe{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const Y3=ge(MT);class sn extends qe{static get type(){return"SceneNode"}constructor(e=sn.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,i=this.scene!==null?this.scene:e.scene;let r;return t===sn.BACKGROUND_BLURRINESS?r=fi("backgroundBlurriness","float",i):t===sn.BACKGROUND_INTENSITY?r=fi("backgroundIntensity","float",i):console.error("THREE.SceneNode: Unknown scope:",t),r}}sn.BACKGROUND_BLURRINESS="backgroundBlurriness",sn.BACKGROUND_INTENSITY="backgroundIntensity";const $3=ge(sn,sn.BACKGROUND_BLURRINESS),J3=ge(sn,sn.BACKGROUND_INTENSITY),bT={Uniform:"uniform",Storage:"storage",ReadOnlyStorage:"read-only-storage"},Xg={WriteOnly:"write-only",ReadOnly:"read-only",ReadWrite:"read-write"};class qg extends $h{static get type(){return"StorageBufferNode"}constructor(e,t,i=0){super(e,t,i),this.isStorageBufferNode=!0,this.access=bT.Storage,this.isAtomic=!1,this.bufferObject=!1,this.bufferCount=i,this._attribute=null,this._varying=null,this.global=!0,e.isStorageBufferAttribute!==!0&&e.isStorageInstancedBufferAttribute!==!0&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(this.bufferCount===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return"storageBuffer"}element(e){return z3(this,e)}setBufferObject(e){return this.bufferObject=e,this}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(bT.ReadOnlyStorage)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}generate(e){if(e.isAvailable("storageBuffer"))return super.generate(e);const t=this.getNodeType(e);this._attribute===null&&(this._attribute=$l(this.value),this._varying=Ii(this._attribute));const i=this._varying.build(e,t);return e.registerTransform(i,this._attribute),i}}const K3=(n,e,t)=>G(new qg(n,e,t)),Z3=(n,e,t)=>G(new qg(n,e,t).setBufferObject(!0));class TT extends dn{static get type(){return"StorageTextureNode"}constructor(e,t,i=null){super(e,t),this.storeNode=i,this.isStorageTextureNode=!0,this.access=Xg.WriteOnly}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);t.storeNode=this.storeNode}setAccess(e){return this.access=e,this}generate(e,t){let i;return this.storeNode!==null?i=this.generateStore(e):i=super.generate(e,t),i}toReadOnly(){return this.setAccess(Xg.ReadOnly)}toWriteOnly(){return this.setAccess(Xg.WriteOnly)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:i,storeNode:r}=t,s=super.generate(e,"property"),a=i.build(e,"uvec2"),o=r.build(e,"vec4"),l=e.generateTextureStore(e,s,a,o);e.addLineFlowCode(l,this)}}const ST=K(TT),Q3=(n,e,t)=>{const i=ST(n,e,t);return t!==null&&i.append(),i};class wT extends Ql{static get type(){return"UserDataNode"}constructor(e,t,i=null){super(e,t,i),this.userData=i}updateReference(e){return this.reference=this.userData!==null?this.userData:e.object.userData,this.reference}}const eD=(n,e,t)=>G(new wT(n,e,t));class ET extends pt{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const tD=K(ET);let Yg=null;class AT extends lc{static get type(){return"ViewportSharedTextureNode"}constructor(e=ps,t=null){Yg===null&&(Yg=new pm),super(e,t,Yg)}updateReference(){return this}}const iD=K(AT),rD=new J;class NT extends dn{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class CT extends NT{static get type(){return"PassMultipleTextureNode"}constructor(e,t,i=!1){super(e,null),this.textureName=t,this.previousTexture=i}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class Ti extends pt{static get type(){return"PassNode"}constructor(e,t,i,r={}){super("vec4"),this.scope=e,this.scene=t,this.camera=i,this.options=r,this._pixelRatio=1,this._width=1,this._height=1;const s=new Fs;s.isRenderTargetTexture=!0,s.name="depth";const a=new ui(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:wi,...r});a.texture.name="output",a.depthTexture=s,this.renderTarget=a,this.updateBeforeType=je.FRAME,this._textures={output:a.texture,depth:s},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=fe(0),this._cameraFar=fe(0),this._mrt=null,this.isPassNode=!0}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.isRenderTargetTexture=!0,t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),t.isRenderTargetTexture=!0,this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const i=this._textures[e],r=this.renderTarget.textures.indexOf(i);this.renderTarget.textures[r]=t,this._textures[e]=t,this._previousTextures[e]=i,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(this._textureNodes[e]=t=G(new CT(this,e)),this._textureNodes[e].updateTexture()),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),this._previousTextureNodes[e]=t=G(new CT(this,e,!0)),this._previousTextureNodes[e].updateTexture()),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const i=this._cameraNear,r=this._cameraFar;this._viewZNodes[e]=t=cg(this.getTextureNode(e),i,r)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const i=this._cameraNear,r=this._cameraFar,s=this.getViewZNode(e);this._linearDepthNodes[e]=t=cc(s,i,r)}return t}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,e.backend.isWebGLBackend===!0&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===Ti.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:i,camera:r}=this;this._pixelRatio=t.getPixelRatio();const s=t.getSize(rD);this.setSize(s.width,s.height);const a=t.getRenderTarget(),o=t.getMRT();this._cameraNear.value=r.near,this._cameraFar.value=r.far;for(const l in this._previousTextures)this.toggleTexture(l);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(i,r),t.setRenderTarget(a),t.setMRT(o)}setSize(e,t){this._width=e,this._height=t;const i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget.setSize(i,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}Ti.COLOR="color",Ti.DEPTH="depth";const nD=(n,e,t)=>G(new Ti(Ti.COLOR,n,e,t)),To=(n,e)=>G(new NT(n,e)),sD=(n,e)=>G(new Ti(Ti.DEPTH,n,e)),RT=new fn,IT=new fn;class LT extends pt{static get type(){return"GaussianBlurNode"}constructor(e,t=null,i=2){super("vec4"),this.textureNode=e,this.directionNode=t,this.sigma=i,this._invSize=fe(new J),this._passDirection=fe(new J),this._horizontalRT=new ui,this._horizontalRT.texture.name="GaussianBlurNode.horizontal",this._verticalRT=new ui,this._verticalRT.texture.name="GaussianBlurNode.vertical",this._textureNode=To(this,this._verticalRT.texture),this.updateBeforeType=je.RENDER,this.resolution=new J(1,1)}setSize(e,t){e=Math.max(Math.round(e*this.resolution.x),1),t=Math.max(Math.round(t*this.resolution.y),1),this._invSize.value.set(1/e,1/t),this._horizontalRT.setSize(e,t),this._verticalRT.setSize(e,t)}updateBefore(e){const{renderer:t}=e,i=this.textureNode,r=i.value,s=t.getRenderTarget(),a=t.getMRT(),o=i.value;RT.material=this._material,IT.material=this._material,this.setSize(r.image.width,r.image.height);const l=r.type;this._horizontalRT.texture.type=l,this._verticalRT.texture.type=l,t.setMRT(null),t.setRenderTarget(this._horizontalRT),this._passDirection.value.set(1,0),RT.render(t),i.value=this._horizontalRT.texture,t.setRenderTarget(this._verticalRT),this._passDirection.value.set(0,1),IT.render(t),t.setRenderTarget(s),t.setMRT(a),i.value=o}getTextureNode(){return this._textureNode}setup(e){const t=this.textureNode;if(t.isTextureNode!==!0)return console.error("GaussianBlurNode requires a TextureNode."),ae();const i=t.uvNode||nt(),r=z(this.directionNode||1),s=c=>t.uv(c),a=U(()=>{const c=3+2*this.sigma,u=this._getCoefficients(c),h=this._invSize,d=r.mul(this._passDirection),p=E(u[0]).toVar(),m=ae(s(i).mul(p)).toVar();for(let v=1;v<c;v++){const f=E(v),g=E(u[v]),x=z(d.mul(h.mul(f))).toVar(),y=ae(s(i.add(x))),_=ae(s(i.sub(x)));m.addAssign(y.add(_).mul(g)),p.addAssign(lt(2,g))}return m.div(p)}),o=this._material||(this._material=new bt);o.fragmentNode=a().context(e.getSharedContext()),o.name="Gaussian_blur",o.needsUpdate=!0;const l=e.getNodeProperties(this);return l.textureNode=t,this._textureNode}dispose(){this._horizontalRT.dispose(),this._verticalRT.dispose()}_getCoefficients(e){const t=[];for(let i=0;i<e;i++)t.push(.39894*Math.exp(-.5*i*i/(e*e))/e);return t}}const aD=(n,e,t)=>G(new LT(Zi(n),e,t)),$g=new J,PT=new fn;class DT extends pt{static get type(){return"AfterImageNode"}constructor(e,t=.96){super(e),this.textureNode=e,this.textureNodeOld=yt(),this.damp=fe(t),this._compRT=new ui,this._compRT.texture.name="AfterImageNode.comp",this._oldRT=new ui,this._oldRT.texture.name="AfterImageNode.old",this._textureNode=To(this,this._compRT.texture),this.updateBeforeType=je.RENDER}getTextureNode(){return this._textureNode}setSize(e,t){this._compRT.setSize(e,t),this._oldRT.setSize(e,t)}updateBefore(e){const{renderer:t}=e,i=this.textureNode,r=i.value.type;this._compRT.texture.type=r,this._oldRT.texture.type=r,t.getDrawingBufferSize($g),this.setSize($g.x,$g.y);const s=t.getRenderTarget(),a=i.value;this.textureNodeOld.value=this._oldRT.texture,t.setRenderTarget(this._compRT),PT.render(t);const o=this._oldRT;this._oldRT=this._compRT,this._compRT=o,t.setRenderTarget(s),i.value=a}setup(e){const t=this.textureNode,i=this.textureNodeOld,r=t.uvNode||nt();i.uvNode=r;const s=u=>t.uv(u),a=U(([u,h])=>{const d=E(h).toVar(),p=ae(u).toVar();return ft(jl(p.sub(d)),0)}),o=U(()=>{const u=ae(i),h=ae(s(r));return u.mulAssign(this.damp.mul(a(u,.1))),ft(h,u)}),l=this._materialComposed||(this._materialComposed=new bt);l.name="AfterImage",l.fragmentNode=o(),PT.material=l;const c=e.getNodeProperties(this);return c.textureNode=t,this._textureNode}dispose(){this._compRT.dispose(),this._oldRT.dispose()}}const oD=(n,e)=>G(new DT(Zi(n),e)),lD=U(([n])=>Ui(n.rgb)),cD=U(([n,e=E(1)])=>e.mix(Ui(n.rgb),n.rgb)),uD=U(([n,e=E(1)])=>{const t=zt(n.r,n.g,n.b).div(3),i=n.r.max(n.g.max(n.b)),r=i.sub(t).mul(e).mul(-3);return rt(n.rgb,i,r)}),hD=U(([n,e=E(1)])=>{const t=D(.57735,.57735,.57735),i=e.cos();return D(n.rgb.mul(i).add(t.cross(n.rgb).mul(e.sin()).add(t.mul(qt(t,n.rgb).mul(i.oneMinus())))))}),dD=new N,Ui=(n,e=D(...vt.getLuminanceCoefficients(dD)))=>qt(n,e),UT=(n,e)=>rt(D(0),n,Ui(n).sub(e).max(0)),OT=new fn;class FT extends pt{static get type(){return"AnamorphicNode"}constructor(e,t,i,r){super("vec4"),this.textureNode=e,this.tresholdNode=t,this.scaleNode=i,this.colorNode=D(.1,0,1),this.samples=r,this.resolution=new J(1,1),this._renderTarget=new ui,this._renderTarget.texture.name="anamorphic",this._invSize=fe(new J),this._textureNode=To(this,this._renderTarget.texture),this.updateBeforeType=je.RENDER}getTextureNode(){return this._textureNode}setSize(e,t){this._invSize.value.set(1/e,1/t),e=Math.max(Math.round(e*this.resolution.x),1),t=Math.max(Math.round(t*this.resolution.y),1),this._renderTarget.setSize(e,t)}updateBefore(e){const{renderer:t}=e,i=this.textureNode,r=i.value;this._renderTarget.texture.type=r.type;const s=t.getRenderTarget(),a=i.value;OT.material=this._material,this.setSize(r.image.width,r.image.height),t.setRenderTarget(this._renderTarget),OT.render(t),t.setRenderTarget(s),i.value=a}setup(e){const t=this.textureNode,i=t.uvNode||nt(),r=l=>t.uv(l),s=U(()=>{const l=this.samples,c=Math.floor(l/2),u=D(0).toVar();return gt({start:-c,end:c},({i:h})=>{const d=E(h).abs().div(c).oneMinus(),p=z(i.x.add(this._invSize.x.mul(h).mul(this.scaleNode)),i.y),m=r(p),v=UT(m,this.tresholdNode).mul(d);u.addAssign(v)}),u.mul(this.colorNode)}),a=this._material||(this._material=new bt);a.name="Anamorphic",a.fragmentNode=s();const o=e.getNodeProperties(this);return o.textureNode=t,this._textureNode}dispose(){this._renderTarget.dispose()}}const pD=(n,e=.9,t=3,i=32)=>G(new FT(Zi(n),G(e),G(t),i));class VT extends pt{static get type(){return"SobelOperatorNode"}constructor(e){super(),this.textureNode=e,this.updateBeforeType=je.RENDER,this._invSize=fe(new J)}updateBefore(){const e=this.textureNode.value;this._invSize.value.set(1/e.image.width,1/e.image.height)}setup(){const{textureNode:e}=this,t=e.uvNode||nt(),i=r=>e.uv(r);return U(()=>{const r=this._invSize,s=yi(-1,-2,-1,0,0,0,1,2,1),a=yi(-1,0,1,-2,0,2,-1,0,1),o=Ui(i(t.add(r.mul(z(-1,-1)))).xyz),l=Ui(i(t.add(r.mul(z(-1,0)))).xyz),c=Ui(i(t.add(r.mul(z(-1,1)))).xyz),u=Ui(i(t.add(r.mul(z(0,-1)))).xyz),h=Ui(i(t.add(r.mul(z(0,0)))).xyz),d=Ui(i(t.add(r.mul(z(0,1)))).xyz),p=Ui(i(t.add(r.mul(z(1,-1)))).xyz),m=Ui(i(t.add(r.mul(z(1,0)))).xyz),v=Ui(i(t.add(r.mul(z(1,1)))).xyz),f=zt(s[0][0].mul(o),s[1][0].mul(u),s[2][0].mul(p),s[0][1].mul(l),s[1][1].mul(h),s[2][1].mul(m),s[0][2].mul(c),s[1][2].mul(d),s[2][2].mul(v)),g=zt(a[0][0].mul(o),a[1][0].mul(u),a[2][0].mul(p),a[0][1].mul(l),a[1][1].mul(h),a[2][1].mul(m),a[0][2].mul(c),a[1][2].mul(d),a[2][2].mul(v)),x=f.mul(f).add(g.mul(g)).sqrt();return ae(D(x),1)})()}}const mD=n=>G(new VT(Zi(n)));class BT extends pt{static get type(){return"DepthOfFieldNode"}constructor(e,t,i,r,s){super(),this.textureNode=e,this.viewZNode=t,this.focusNode=i,this.apertureNode=r,this.maxblurNode=s,this._aspect=fe(0),this.updateBeforeType=je.RENDER}updateBefore(){const e=this.textureNode.value;this._aspect.value=e.image.width/e.image.height}setup(){const e=this.textureNode,t=e.uvNode||nt(),i=r=>e.uv(r);return U(()=>{const r=z(1,this._aspect),s=this.focusNode.add(this.viewZNode),a=z(li(s.mul(this.apertureNode),this.maxblurNode.negate(),this.maxblurNode)),o=a.mul(.9),l=a.mul(.7),c=a.mul(.4);let u=ae(0);return u=u.add(i(t)),u=u.add(i(t.add(z(0,.4).mul(r).mul(a)))),u=u.add(i(t.add(z(.15,.37).mul(r).mul(a)))),u=u.add(i(t.add(z(.29,.29).mul(r).mul(a)))),u=u.add(i(t.add(z(-.37,.15).mul(r).mul(a)))),u=u.add(i(t.add(z(.4,0).mul(r).mul(a)))),u=u.add(i(t.add(z(.37,-.15).mul(r).mul(a)))),u=u.add(i(t.add(z(.29,-.29).mul(r).mul(a)))),u=u.add(i(t.add(z(-.15,-.37).mul(r).mul(a)))),u=u.add(i(t.add(z(0,-.4).mul(r).mul(a)))),u=u.add(i(t.add(z(-.15,.37).mul(r).mul(a)))),u=u.add(i(t.add(z(-.29,.29).mul(r).mul(a)))),u=u.add(i(t.add(z(.37,.15).mul(r).mul(a)))),u=u.add(i(t.add(z(-.4,0).mul(r).mul(a)))),u=u.add(i(t.add(z(-.37,-.15).mul(r).mul(a)))),u=u.add(i(t.add(z(-.29,-.29).mul(r).mul(a)))),u=u.add(i(t.add(z(.15,-.37).mul(r).mul(a)))),u=u.add(i(t.add(z(.15,.37).mul(r).mul(o)))),u=u.add(i(t.add(z(-.37,.15).mul(r).mul(o)))),u=u.add(i(t.add(z(.37,-.15).mul(r).mul(o)))),u=u.add(i(t.add(z(-.15,-.37).mul(r).mul(o)))),u=u.add(i(t.add(z(-.15,.37).mul(r).mul(o)))),u=u.add(i(t.add(z(.37,.15).mul(r).mul(o)))),u=u.add(i(t.add(z(-.37,-.15).mul(r).mul(o)))),u=u.add(i(t.add(z(.15,-.37).mul(r).mul(o)))),u=u.add(i(t.add(z(.29,.29).mul(r).mul(l)))),u=u.add(i(t.add(z(.4,0).mul(r).mul(l)))),u=u.add(i(t.add(z(.29,-.29).mul(r).mul(l)))),u=u.add(i(t.add(z(0,-.4).mul(r).mul(l)))),u=u.add(i(t.add(z(-.29,.29).mul(r).mul(l)))),u=u.add(i(t.add(z(-.4,0).mul(r).mul(l)))),u=u.add(i(t.add(z(-.29,-.29).mul(r).mul(l)))),u=u.add(i(t.add(z(0,.4).mul(r).mul(l)))),u=u.add(i(t.add(z(.29,.29).mul(r).mul(c)))),u=u.add(i(t.add(z(.4,0).mul(r).mul(c)))),u=u.add(i(t.add(z(.29,-.29).mul(r).mul(c)))),u=u.add(i(t.add(z(0,-.4).mul(r).mul(c)))),u=u.add(i(t.add(z(-.29,.29).mul(r).mul(c)))),u=u.add(i(t.add(z(-.4,0).mul(r).mul(c)))),u=u.add(i(t.add(z(-.29,-.29).mul(r).mul(c)))),u=u.add(i(t.add(z(0,.4).mul(r).mul(c)))),u=u.div(41),u.a=1,ae(u)})()}}const fD=(n,e,t=1,i=.025,r=1)=>G(new BT(Zi(n),G(e),G(t),G(i),G(r)));class zT extends pt{static get type(){return"DotScreenNode"}constructor(e,t=new J(.5,.5),i=1.57,r=1){super("vec4"),this.inputNode=e,this.center=fe(t),this.angle=fe(i),this.scale=fe(r)}setup(){const e=this.inputNode,t=U(()=>{const i=Ci(this.angle),r=br(this.angle),s=nt().mul(go).sub(this.center),a=z(r.mul(s.x).sub(i.mul(s.y)),i.mul(s.x).add(r.mul(s.y))).mul(this.scale);return Ci(a.x).mul(Ci(a.y)).mul(4)});return U(()=>{const i=e,r=zt(i.r,i.g,i.b).div(3);return ae(D(r.mul(10).sub(5).add(t())),i.a)})()}}const gD=(n,e,t,i)=>G(new zT(G(n),e,t,i));class kT extends pt{static get type(){return"RGBShiftNode"}constructor(e,t=.005,i=0){super("vec4"),this.textureNode=e,this.amount=fe(t),this.angle=fe(i)}setup(){const{textureNode:e}=this,t=e.uvNode||nt(),i=r=>e.uv(r);return U(()=>{const r=z(br(this.angle),Ci(this.angle)).mul(this.amount),s=i(t.add(r)),a=i(t),o=i(t.sub(r));return ae(s.r,a.g,o.b,a.a)})()}}const vD=(n,e,t)=>G(new kT(Zi(n),e,t));class HT extends pt{static get type(){return"FilmNode"}constructor(e,t=null,i=null){super(),this.inputNode=e,this.intensityNode=t,this.uvNode=i}setup(){const e=this.uvNode||nt();return U(()=>{const t=this.inputNode.rgb,i=Uf(us(e.add(Hg())));let r=t.add(t.mul(li(i.add(.1),0,1)));return this.intensityNode!==null&&(r=rt(t,r,this.intensityNode)),ae(r,this.inputNode.a)})()}}const yD=K(HT);class GT extends pt{static get type(){return"Lut3DNode"}constructor(e,t,i,r){super(),this.inputNode=e,this.lutNode=t,this.size=fe(i),this.intensityNode=r}setup(){const{inputNode:e,lutNode:t}=this,i=r=>t.uv(r);return U(()=>{const r=e,s=E(1).div(this.size),a=E(.5).div(this.size),o=D(a).add(r.rgb.mul(E(1).sub(s))),l=ae(i(o).rgb,r.a);return ae(rt(r,l,this.intensityNode))})()}}const xD=(n,e,t,i)=>G(new GT(G(n),G(e),t,G(i))),WT=new fn,jT=new xe,_D=new J;class XT extends pt{static get type(){return"GTAONode"}constructor(e,t,i){super(),this.depthNode=e,this.normalNode=t,this.radius=fe(.25),this.resolution=fe(new J),this.thickness=fe(1),this.distanceExponent=fe(1),this.distanceFallOff=fe(1),this.scale=fe(1),this.noiseNode=yt(MD()),this.cameraProjectionMatrix=fe(i.projectionMatrix),this.cameraProjectionMatrixInverse=fe(i.projectionMatrixInverse),this.SAMPLES=fe(16),this._aoRenderTarget=new ui,this._aoRenderTarget.texture.name="GTAONode.AO",this._material=null,this._textureNode=To(this,this._aoRenderTarget.texture),this.updateBeforeType=je.FRAME}getTextureNode(){return this._textureNode}setSize(e,t){this.resolution.value.set(e,t),this._aoRenderTarget.setSize(e,t)}updateBefore(e){const{renderer:t}=e,i=t.getDrawingBufferSize(_D),r=t.getRenderTarget(),s=t.getMRT();t.getClearColor(jT);const a=t.getClearAlpha();WT.material=this._material,this.setSize(i.width,i.height),t.setMRT(null),t.setClearColor(16777215,1),t.setRenderTarget(this._aoRenderTarget),WT.render(t),t.setRenderTarget(r),t.setMRT(s),t.setClearColor(jT,a)}setup(e){const t=nt(),i=c=>this.depthNode.uv(c).x,r=c=>this.noiseNode.uv(c),s=U(([c])=>{const u=this.cameraProjectionMatrix.mul(ae(c,1));let h=u.xy.div(u.w).mul(.5).add(.5).toVar();h=z(h.x,h.y.oneMinus());const d=i(h);return D(h,d)}),a=U(([c,u])=>{c=z(c.x,c.y.oneMinus()).mul(2).sub(1);const h=ae(D(c,u),1),d=ae(this.cameraProjectionMatrixInverse.mul(h));return d.xyz.div(d.w)}),o=U(()=>{const c=i(t);c.greaterThanEqual(1).discard();const u=a(t,c),h=this.normalNode.rgb.normalize(),d=this.radius,p=ds(this.noiseNode,0);let m=z(t.x,t.y.oneMinus());m=m.mul(this.resolution.div(p));const v=r(m),f=v.xyz.mul(2).sub(1),g=D(f.xy,0).normalize(),x=D(g.y.mul(-1),g.x,0),y=yi(g,x,D(0,0,1)),_=this.SAMPLES.lessThan(30).select(3,5),I=zt(this.SAMPLES,_.sub(1)).div(_),b=E(0).toVar();return gt({start:P(0),end:_,type:"int",condition:"<"},({i:w})=>{const C=E(w).div(E(_)).mul(ta),H=ae(br(C),Ci(C),0,zt(.5,lt(.5,v.w)));H.xyz=Mr(y.mul(H.xyz));const M=Mr(u.xyz.negate()),T=Mr(co(H.xyz,M)),k=co(T,M),j=Mr(h.sub(T.mul(qt(h,T)))),Y=co(j,T),re=z(qt(M,Y),qt(M,Y.negate())).toVar();gt({end:I,type:"int",name:"j",condition:"<"},({j:at})=>{const et=H.xyz.mul(d).mul(H.w).mul(Ji(Qr(E(at).add(1),E(I)),this.distanceExponent)),ie=s(u.add(et)),le=a(ie.xy,ie.z).sub(u);Le(It(le.z).lessThan(this.thickness),()=>{const Ye=qt(M,Mr(le));re.x.addAssign(ft(0,lt(Ye.sub(re.x),rt(1,E(2).div(E(at).add(2)),this.distanceFallOff))))});const Te=s(u.sub(et)),Se=a(Te.xy,Te.z).sub(u);Le(It(Se.z).lessThan(this.thickness),()=>{const Ye=qt(M,Mr(Se));re.y.addAssign(ft(0,lt(Ye.sub(re.y),rt(1,E(2).div(E(at).add(2)),this.distanceFallOff))))})});const $=en(Pt(1,re.mul(re))),he=qt(j,k),Q=qt(j,M),ye=lt(.5,zh(re.y).sub(zh(re.x)).add($.x.mul(re.x).sub($.y.mul(re.y)))),be=lt(.5,Pt(2,re.x.mul(re.x)).sub(re.y.mul(re.y))),Ve=he.mul(ye).add(Q.mul(be));b.addAssign(Ve)}),b.assign(li(b.div(_),0,1)),b.assign(Ji(b,this.scale)),ae(D(b),1)}),l=this._material||(this._material=new bt);return l.fragmentNode=o().context(e.getSharedContext()),l.name="GTAO",l.needsUpdate=!0,this._textureNode}dispose(){this._aoRenderTarget.dispose()}}function MD(n=5){const e=Math.floor(n)%2===0?Math.floor(n)+1:Math.floor(n),t=bD(e),i=t.length,r=new Uint8Array(i*4);for(let a=0;a<i;++a){const o=t[a],l=2*Math.PI*o/i,c=new N(Math.cos(l),Math.sin(l),0).normalize();r[a*4]=(c.x*.5+.5)*255,r[a*4+1]=(c.y*.5+.5)*255,r[a*4+2]=127,r[a*4+3]=255}const s=new Ur(r,e,e);return s.wrapS=Gn,s.wrapT=Gn,s.needsUpdate=!0,s}function bD(n){const e=Math.floor(n)%2===0?Math.floor(n)+1:Math.floor(n),t=e*e,i=Array(t).fill(0);let r=Math.floor(e/2),s=e-1;for(let a=1;a<=t;){if(r===-1&&s===e?(s=e-2,r=0):(s===e&&(s=0),r<0&&(r=e-1)),i[r*e+s]!==0){s-=2,r++;continue}else i[r*e+s]=a++;s++,r--}return i}const TD=(n,e,t)=>G(new XT(G(n),G(e),t));class qT extends pt{static get type(){return"DenoiseNode"}constructor(e,t,i,r,s){super(),this.textureNode=e,this.depthNode=t,this.normalNode=i,this.noiseNode=r,this.cameraProjectionMatrixInverse=fe(s.projectionMatrixInverse),this.lumaPhi=fe(5),this.depthPhi=fe(5),this.normalPhi=fe(5),this.radius=fe(5),this.index=fe(0),this._resolution=fe(new J),this._sampleVectors=mn(SD(16,2,1)),this.updateBeforeType=je.RENDER}updateBefore(){const e=this.textureNode.value;this._resolution.value.set(e.image.width,e.image.height)}setup(){const e=nt(),t=c=>this.textureNode.uv(c),i=c=>this.depthNode.uv(c).x,r=c=>this.normalNode.uv(c),s=c=>this.noiseNode.uv(c),a=U(([c,u])=>{c=z(c.x,c.y.oneMinus()).mul(2).sub(1);const h=ae(D(c,u),1),d=ae(this.cameraProjectionMatrixInverse.mul(h));return d.xyz.div(d.w)}),o=U(([c,u,h,d])=>{const p=t(d),m=i(d),v=r(d).rgb.normalize(),f=p.rgb,g=a(d,m),x=qt(u,v).toVar(),y=Ji(ft(x,0),this.normalPhi).toVar(),_=It(Ui(f).sub(Ui(c))).toVar(),I=ft(E(1).sub(_.div(this.lumaPhi)),0).toVar(),b=It(qt(h.sub(g),u)).toVar(),w=ft(E(1).sub(b.div(this.depthPhi)),0),C=I.mul(w).mul(y);return ae(f.mul(C),C)}),l=U(([c])=>{const u=i(c),h=r(c).rgb.normalize(),d=t(c);Le(u.greaterThanEqual(1).or(qt(h,h).equal(0)),()=>d);const p=D(d.rgb),m=a(c,u),v=ds(this.noiseNode,0);let f=z(c.x,c.y.oneMinus());f=f.mul(this._resolution.div(v));const g=s(f),x=Ci(g.element(this.index.mod(4).mul(2).mul(ta))),y=br(g.element(this.index.mod(4).mul(2).mul(ta))),_=z(x,y),I=Fl(_.x,_.y.negate(),_.x,_.y),b=E(1).toVar(),w=D(d.rgb).toVar();return gt({start:P(0),end:P(16),type:"int",condition:"<"},({i:C})=>{const H=this._sampleVectors.element(C).toVar(),M=I.mul(H.xy.mul(E(1).add(H.z.mul(this.radius.sub(1))))).div(this._resolution).toVar(),T=c.add(M).toVar(),k=o(p,h,m,T);w.addAssign(k.xyz),b.addAssign(k.w)}),Le(b.greaterThan(E(0)),()=>{w.divAssign(b)}),ae(w,d.a)}).setLayout({name:"denoise",type:"vec4",inputs:[{name:"uv",type:"vec2"}]});return U(()=>l(e))()}}function SD(n,e,t){const i=wD(n,e,t),r=[];for(let s=0;s<n;s++){const a=i[s];r.push(a)}return r}function wD(n,e,t){const i=[];for(let r=0;r<n;r++){const s=2*Math.PI*e*r/n,a=Math.pow(r/(n-1),t);i.push(new N(Math.cos(s),Math.sin(s),a))}return i}const ED=(n,e,t,i,r)=>G(new qT(Zi(n),G(e),G(t),G(i),r));class YT extends pt{static get type(){return"FXAANode"}constructor(e){super(),this.textureNode=e,this.updateBeforeType=je.RENDER,this._invSize=fe(new J)}updateBefore(){const e=this.textureNode.value;this._invSize.value.set(1/e.image.width,1/e.image.height)}setup(){const e=this.textureNode.bias(-100),t=e.uvNode||nt(),i=l=>e.uv(l),r=(l,c,u)=>e.uv(l.add(c.mul(u))),s=P(5),a=U(([l,c])=>{const u=ae(c).toVar(),h=ae(l).toVar(),d=ae(It(h.sub(u))).toVar();return ft(ft(ft(d.r,d.g),d.b),d.a)}),o=U(([l,c,u,h])=>{const d=i(l).toVar(),p=r(l,z(0,-1),c.xy).toVar(),m=r(l,z(1,0),c.xy).toVar(),v=r(l,z(0,1),c.xy).toVar(),f=r(l,z(-1,0),c.xy).toVar(),g=a(d,v).toVar(),x=a(d,p).toVar(),y=a(d,m).toVar(),_=a(d,f).toVar(),I=ft(g,ft(x,ft(y,_))).toVar();Le(I.lessThan(u),()=>d);const b=Pt(g.add(x),y.add(_)).toVar();b.mulAssign(h),Le(It(b).lessThan(.3),()=>{const Ve=y.greaterThan(_).select(1,-1).toVar(),at=x.greaterThan(g).select(1,-1).toVar(),et=z(Ve,at).toVar(),ie=r(l,z(et.x,et.y),c.xy),le=a(d,ie).toVar(),Te=r(l,z(et.x.negate(),et.y.negate()),c.xy),Se=a(d,Te).toVar();b.assign(Se.sub(le)),b.mulAssign(h),Le(It(b).lessThan(.3),()=>{const Ye=v.add(p).add(m).add(f);return rt(d,Ye.mul(.25),.4)})});const w=z().toVar();Le(b.lessThanEqual(0),()=>{v.assign(f),p.assign(m),w.x.assign(0),w.y.assign(c.y)}).Else(()=>{w.x.assign(c.x),w.y.assign(0)});const C=a(d,v).toVar(),H=a(d,p).toVar();Le(C.lessThanEqual(H),()=>{v.assign(p)});const M=P(0).toVar(),T=P(0).toVar(),k=E(0).toVar(),j=E(0).toVar(),Y=z(l).toVar(),re=z(l).toVar(),$=P(0).toVar(),he=P(0).toVar();gt(s,({i:Ve})=>{const at=Ve.add(1).toVar();Le(M.equal(0),()=>{k.addAssign(at),Y.assign(l.add(w.mul(k)));const et=i(Y.xy),ie=a(et,d).toVar(),le=a(et,v).toVar();Le(ie.greaterThan(le),()=>{M.assign(1)}),$.assign(Ve)}),Le(T.equal(0),()=>{j.addAssign(at),re.assign(l.sub(w.mul(j)));const et=i(re.xy),ie=a(et,d).toVar(),le=a(et,v).toVar();Le(ie.greaterThan(le),()=>{T.assign(1)}),he.assign(Ve)}),Le(M.equal(1).or(T.equal(1)),()=>{td()})}),Le(M.equal(0).and(T.equal(0)),()=>d);const Q=E(1).toVar(),ye=E(1).toVar();Le(M.equal(1),()=>{Q.assign(E($).div(E(s.sub(1))))}),Le(T.equal(1),()=>{ye.assign(E(he).div(E(s.sub(1))))});const be=xi(Q,ye);return be.assign(Ji(be,.5)),be.assign(E(1).sub(be)),rt(d,v,be.mul(.5))}).setLayout({name:"FxaaPixelShader",type:"vec4",inputs:[{name:"uv",type:"vec2"},{name:"fxaaQualityRcpFrame",type:"vec2"},{name:"fxaaQualityEdgeThreshold",type:"float"},{name:"fxaaQualityinvEdgeThreshold",type:"float"}]});return U(()=>{const l=E(.2),c=E(1).div(l);return o(t,this._invSize,l,c)})()}}const AD=n=>G(new YT(Zi(n))),ua=new fn,ND=new xe(0,0,0),$T=new xe,CD=new J,RD=new J(1,0),ID=new J(0,1);class JT extends pt{static get type(){return"BloomNode"}constructor(e,t=1,i=0,r=0){super(),this.inputNode=e,this.strength=fe(t),this.radius=fe(i),this.threshold=fe(r),this.smoothWidth=fe(.01),this._renderTargetsHorizontal=[],this._renderTargetsVertical=[],this._nMips=5,this._renderTargetBright=new ui(1,1,{type:wi}),this._renderTargetBright.texture.name="UnrealBloomPass.bright",this._renderTargetBright.texture.generateMipmaps=!1;for(let s=0;s<this._nMips;s++){const a=new ui(1,1,{type:wi});a.texture.name="UnrealBloomPass.h"+s,a.texture.generateMipmaps=!1,this._renderTargetsHorizontal.push(a);const o=new ui(1,1,{type:wi});o.texture.name="UnrealBloomPass.v"+s,o.texture.generateMipmaps=!1,this._renderTargetsVertical.push(o)}this._compositeMaterial=null,this._highPassFilterMaterial=null,this._separableBlurMaterials=[],this._textureNodeBright=yt(this._renderTargetBright.texture),this._textureNodeBlur0=yt(this._renderTargetsVertical[0].texture),this._textureNodeBlur1=yt(this._renderTargetsVertical[1].texture),this._textureNodeBlur2=yt(this._renderTargetsVertical[2].texture),this._textureNodeBlur3=yt(this._renderTargetsVertical[3].texture),this._textureNodeBlur4=yt(this._renderTargetsVertical[4].texture),this._textureOutput=To(this,this._renderTargetsHorizontal[0].texture),this.updateBeforeType=je.FRAME}getTextureNode(){return this._textureOutput}setSize(e,t){let i=Math.round(e/2),r=Math.round(t/2);this._renderTargetBright.setSize(i,r);for(let s=0;s<this._nMips;s++)this._renderTargetsHorizontal[s].setSize(i,r),this._renderTargetsVertical[s].setSize(i,r),this._separableBlurMaterials[s].invSize.value.set(1/i,1/r),i=Math.round(i/2),r=Math.round(r/2)}updateBefore(e){const{renderer:t}=e,i=t.getDrawingBufferSize(CD);this.setSize(i.width,i.height);const r=t.getRenderTarget(),s=t.getMRT();t.getClearColor($T);const a=t.getClearAlpha();this.setSize(i.width,i.height),t.setMRT(null),t.setClearColor(ND,0),t.setRenderTarget(this._renderTargetBright),ua.material=this._highPassFilterMaterial,ua.render(t);let o=this._renderTargetBright;for(let l=0;l<this._nMips;l++)ua.material=this._separableBlurMaterials[l],this._separableBlurMaterials[l].colorTexture.value=o.texture,this._separableBlurMaterials[l].direction.value=RD,t.setRenderTarget(this._renderTargetsHorizontal[l]),t.clear(),ua.render(t),this._separableBlurMaterials[l].colorTexture.value=this._renderTargetsHorizontal[l].texture,this._separableBlurMaterials[l].direction.value=ID,t.setRenderTarget(this._renderTargetsVertical[l]),t.clear(),ua.render(t),o=this._renderTargetsVertical[l];t.setRenderTarget(this._renderTargetsHorizontal[0]),t.clear(),ua.material=this._compositeMaterial,ua.render(t),t.setRenderTarget(r),t.setMRT(s),t.setClearColor($T,a)}setup(e){const t=U(()=>{const l=this.inputNode,c=Ui(l.rgb),u=Ki(this.threshold,this.threshold.add(this.smoothWidth),c);return rt(ae(0),l,u)});this._highPassFilterMaterial=this._highPassFilterMaterial||new bt,this._highPassFilterMaterial.fragmentNode=t().context(e.getSharedContext()),this._highPassFilterMaterial.name="Bloom_highPass",this._highPassFilterMaterial.needsUpdate=!0;const i=[3,5,7,9,11];for(let l=0;l<this._nMips;l++)this._separableBlurMaterials.push(this._getSeperableBlurMaterial(e,i[l]));const r=mn([1,.8,.6,.4,.2]),s=mn([new N(1,1,1),new N(1,1,1),new N(1,1,1),new N(1,1,1),new N(1,1,1)]),a=U(([l,c])=>{const u=E(1.2).sub(l);return rt(l,u,c)}).setLayout({name:"lerpBloomFactor",type:"float",inputs:[{name:"factor",type:"float"},{name:"radius",type:"float"}]}),o=U(()=>{const l=a(r.element(0),this.radius).mul(ae(s.element(0),1)).mul(this._textureNodeBlur0),c=a(r.element(1),this.radius).mul(ae(s.element(1),1)).mul(this._textureNodeBlur1),u=a(r.element(2),this.radius).mul(ae(s.element(2),1)).mul(this._textureNodeBlur2),h=a(r.element(3),this.radius).mul(ae(s.element(3),1)).mul(this._textureNodeBlur3),d=a(r.element(4),this.radius).mul(ae(s.element(4),1)).mul(this._textureNodeBlur4);return l.add(c).add(u).add(h).add(d).mul(this.strength)});return this._compositeMaterial=this._compositeMaterial||new bt,this._compositeMaterial.fragmentNode=o().context(e.getSharedContext()),this._compositeMaterial.name="Bloom_comp",this._compositeMaterial.needsUpdate=!0,this._textureOutput}dispose(){for(let e=0;e<this._renderTargetsHorizontal.length;e++)this._renderTargetsHorizontal[e].dispose();for(let e=0;e<this._renderTargetsVertical.length;e++)this._renderTargetsVertical[e].dispose();this._renderTargetBright.dispose()}_getSeperableBlurMaterial(e,t){const i=[];for(let d=0;d<t;d++)i.push(.39894*Math.exp(-.5*d*d/(t*t))/t);const r=yt(),s=mn(i),a=fe(new J),o=fe(new J(.5,.5)),l=nt(),c=d=>r.uv(d),u=U(()=>{const d=s.element(0).toVar(),p=c(l).rgb.mul(d).toVar();return gt({start:P(1),end:P(t),type:"int",condition:"<"},({i:m})=>{const v=E(m),f=s.element(m),g=o.mul(a).mul(v),x=c(l.add(g)).rgb,y=c(l.sub(g)).rgb;p.addAssign(zt(x,y).mul(f)),d.addAssign(E(2).mul(f))}),ae(p.div(d),1)}),h=new bt;return h.fragmentNode=u().context(e.getSharedContext()),h.name="Bloom_seperable",h.needsUpdate=!0,h.colorTexture=r,h.direction=o,h.invSize=a,h}}const LD=(n,e,t,i)=>G(new JT(G(n),e,t,i));class KT extends pt{static get type(){return"TransitionNode"}constructor(e,t,i,r,s,a){super(),this.textureNodeA=e,this.textureNodeB=t,this.mixTextureNode=i,this.mixRatioNode=r,this.thresholdNode=s,this.useTextureNode=a}setup(){const{textureNodeA:e,textureNodeB:t,mixTextureNode:i,mixRatioNode:r,thresholdNode:s,useTextureNode:a}=this,o=l=>{const c=l.uvNode||nt();return l.uv(c)};return U(()=>{const l=o(e),c=o(t),u=ae().toVar();return Le(a.equal(P(1)),()=>{const h=o(i),d=r.mul(s.mul(2).add(1)).sub(s),p=li(Pt(h.r,d).mul(E(1).div(s)),0,1);u.assign(rt(l,c,p))}).Else(()=>{u.assign(rt(c,l,r))}),u})()}}const PD=(n,e,t,i=0,r=.1,s=0)=>G(new KT(Zi(n),Zi(e),Zi(t),G(i),G(r),G(s)));class DD extends pt{static get type(){return"PixelationNode"}constructor(e,t,i,r,s,a){super(),this.textureNode=e,this.depthNode=t,this.normalNode=i,this.pixelSize=r,this.normalEdgeStrength=s,this.depthEdgeStrength=a,this._resolution=fe(new st),this.updateBeforeType=je.RENDER}updateBefore(){const e=this.textureNode.value,t=e.image.width,i=e.image.height;this._resolution.value.set(t,i,1/t,1/i)}setup(){const{textureNode:e,depthNode:t,normalNode:i}=this,r=e.uvNode||nt(),s=t.uvNode||nt(),a=i.uvNode||nt(),o=()=>e.uv(r),l=(p,m)=>t.uv(s.add(z(p,m).mul(this._resolution.zw))).r,c=(p,m)=>i.uv(a.add(z(p,m).mul(this._resolution.zw))).rgb.normalize(),u=p=>{const m=ar("float","diff");return m.addAssign(li(l(1,0).sub(p))),m.addAssign(li(l(-1,0).sub(p))),m.addAssign(li(l(0,1).sub(p))),m.addAssign(li(l(0,-1).sub(p))),cs(Ki(.01,.02,m).mul(2)).div(2)},h=(p,m,v,f)=>{const g=l(p,m).sub(v),x=c(p,m),y=D(1,1,1),_=qt(f.sub(x),y),I=li(Ki(-.01,.01,_),0,1),b=li(jl(g.mul(.25).add(.0025)),0,1);return E(1).sub(qt(f,x)).mul(b).mul(I)},d=(p,m)=>{const v=ar("float","indicator");return v.addAssign(h(0,-1,p,m)),v.addAssign(h(0,1,p,m)),v.addAssign(h(-1,0,p,m)),v.addAssign(h(1,0,p,m)),Xl(.1,v)};return U(()=>{const p=o(),m=ar("float","depth"),v=ar("vec3","normal");Le(this.depthEdgeStrength.greaterThan(0).or(this.normalEdgeStrength.greaterThan(0)),()=>{m.assign(l(0,0)),v.assign(c(0,0))});const f=ar("float","dei");Le(this.depthEdgeStrength.greaterThan(0),()=>{f.assign(u(m))});const g=ar("float","nei");Le(this.normalEdgeStrength.greaterThan(0),()=>{g.assign(d(m,v))});const x=f.greaterThan(0).select(E(1).sub(f.mul(this.depthEdgeStrength)),g.mul(this.normalEdgeStrength).add(1));return p.mul(x)})()}}const UD=(n,e,t,i=6,r=.3,s=.4)=>G(new DD(Zi(n),Zi(e),Zi(t),G(i),G(r),G(s)));class ZT extends Ti{static get type(){return"PixelationPassNode"}constructor(e,t,i=6,r=.3,s=.4){super("color",e,t,{minFilter:$t,magFilter:$t}),this.pixelSize=i,this.normalEdgeStrength=r,this.depthEdgeStrength=s,this.isPixelationPassNode=!0,this._mrt=gd({output:_f,normal:hr})}setSize(e,t){const i=this.pixelSize.value?this.pixelSize.value:this.pixelSize,r=Math.floor(e/i),s=Math.floor(t/i);super.setSize(r,s)}setup(){const e=super.getTextureNode("output"),t=super.getTextureNode("depth"),i=super.getTextureNode("normal");return UD(e,t,i,this.pixelSize,this.normalEdgeStrength,this.depthEdgeStrength)}}const OD=(n,e,t,i,r)=>G(new ZT(n,e,t,i,r)),FD=new J;class QT extends Ti{static get type(){return"SSAAPassNode"}constructor(e,t){super(Ti.COLOR,e,t),this.isSSAAPassNode=!0,this.sampleLevel=4,this.unbiased=!0,this.clearColor=new xe(0),this.clearAlpha=0,this._currentClearColor=new xe,this.sampleWeight=fe(1),this.sampleRenderTarget=null,this._quadMesh=new fn}updateBefore(e){const{renderer:t}=e,{scene:i,camera:r}=this;this._pixelRatio=t.getPixelRatio();const s=t.getSize(FD);this.setSize(s.width,s.height),this.sampleRenderTarget.setSize(this.renderTarget.width,this.renderTarget.height),t.getClearColor(this._currentClearColor);const a=t.getClearAlpha(),o=t.getRenderTarget(),l=t.getMRT(),c=t.autoClear;this._cameraNear.value=r.near,this._cameraFar.value=r.far,t.setMRT(this.getMRT()),t.autoClear=!1;const u=VD[Math.max(0,Math.min(this.sampleLevel,5))],h=1/u.length,d=1/32,p={fullWidth:this.renderTarget.width,fullHeight:this.renderTarget.height,offsetX:0,offsetY:0,width:this.renderTarget.width,height:this.renderTarget.height},m=Object.assign({},r.view);m.enabled&&Object.assign(p,m);for(let v=0;v<u.length;v++){const f=u[v];if(r.setViewOffset&&r.setViewOffset(p.fullWidth,p.fullHeight,p.offsetX+f[0]*.0625,p.offsetY+f[1]*.0625,p.width,p.height),this.sampleWeight.value=h,this.unbiased){const g=-.5+(v+.5)/u.length;this.sampleWeight.value+=d*g}t.setClearColor(this.clearColor,this.clearAlpha),t.setRenderTarget(this.sampleRenderTarget),t.clear(),t.render(i,r),t.setRenderTarget(this.renderTarget),v===0&&(t.setClearColor(0,0),t.clear()),this._quadMesh.render(t)}t.copyTextureToTexture(this.sampleRenderTarget.depthTexture,this.renderTarget.depthTexture),r.setViewOffset&&m.enabled?r.setViewOffset(m.fullWidth,m.fullHeight,m.offsetX,m.offsetY,m.width,m.height):r.clearViewOffset&&r.clearViewOffset(),t.setRenderTarget(o),t.setMRT(l),t.autoClear=c,t.setClearColor(this._currentClearColor,a)}setup(e){this.sampleRenderTarget===null&&(this.sampleRenderTarget=this.renderTarget.clone());let t;const i=this.getMRT();if(i!==null){const r={};for(const s in i.outputNodes){const a=kg(this.sampleRenderTarget.textures,s);a>=0&&(r[s]=yt(this.sampleRenderTarget.textures[a]).mul(this.sampleWeight))}t=gd(r)}else t=yt(this.sampleRenderTarget.texture).mul(this.sampleWeight);return this._quadMesh.material=new bt,this._quadMesh.material.fragmentNode=t,this._quadMesh.material.transparent=!0,this._quadMesh.material.depthTest=!1,this._quadMesh.material.depthWrite=!1,this._quadMesh.material.premultipliedAlpha=!0,this._quadMesh.material.blending=No,this._quadMesh.material.normals=!1,this._quadMesh.material.name="SSAA",super.setup(e)}dispose(){super.dispose(),this.sampleRenderTarget!==null&&this.sampleRenderTarget.dispose()}}const VD=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]],BD=(n,e)=>G(new QT(n,e)),zD=new J;class eS extends Ti{static get type(){return"StereoPassNode"}constructor(e,t){super(Ti.COLOR,e,t),this.isStereoPassNode=!0,this.stereo=new km,this.stereo.aspect=.5}updateBefore(e){const{renderer:t}=e,{scene:i,camera:r,stereo:s,renderTarget:a}=this;this._pixelRatio=t.getPixelRatio(),s.cameraL.coordinateSystem=t.coordinateSystem,s.cameraR.coordinateSystem=t.coordinateSystem,s.update(r);const o=t.getSize(zD);this.setSize(o.width,o.height);const l=t.autoClear;t.autoClear=!1;const c=t.getRenderTarget(),u=t.getMRT();this._cameraNear.value=r.near,this._cameraFar.value=r.far;for(const h in this._previousTextures)this.toggleTexture(h);t.setRenderTarget(a),t.setMRT(this._mrt),t.clear(),a.scissorTest=!0,a.scissor.set(0,0,a.width/2,a.height),a.viewport.set(0,0,a.width/2,a.height),t.render(i,s.cameraL),a.scissor.set(a.width/2,0,a.width/2,a.height),a.viewport.set(a.width/2,0,a.width/2,a.height),t.render(i,s.cameraR),a.scissorTest=!1,t.setRenderTarget(c),t.setMRT(u),t.autoClear=l}}const kD=(n,e)=>G(new eS(n,e)),HD=new J,tS=new fn;class iS extends Ti{static get type(){return"StereoCompositePassNode"}constructor(e,t){super(Ti.COLOR,e,t),this.isStereoCompositePassNode=!0,this.stereo=new km;const i={minFilter:Lt,magFilter:$t,type:wi};this._renderTargetL=new ui(1,1,i),this._renderTargetR=new ui(1,1,i),this._mapLeft=yt(this._renderTargetL.texture),this._mapRight=yt(this._renderTargetR.texture),this._material=null}updateStereoCamera(e){this.stereo.cameraL.coordinateSystem=e,this.stereo.cameraR.coordinateSystem=e,this.stereo.update(this.camera)}setSize(e,t){super.setSize(e,t),this._renderTargetL.setSize(this.renderTarget.width,this.renderTarget.height),this._renderTargetR.setSize(this.renderTarget.width,this.renderTarget.height)}updateBefore(e){const{renderer:t}=e,{scene:i,stereo:r,renderTarget:s}=this;this._pixelRatio=t.getPixelRatio(),this.updateStereoCamera(t.coordinateSystem);const a=t.getSize(HD);this.setSize(a.width,a.height);const o=t.getRenderTarget();t.setRenderTarget(this._renderTargetL),t.render(i,r.cameraL),t.setRenderTarget(this._renderTargetR),t.render(i,r.cameraR),t.setRenderTarget(s),tS.material=this._material,tS.render(t),t.setRenderTarget(o)}dispose(){super.dispose(),this._renderTargetL.dispose(),this._renderTargetR.dispose(),this._material!==null&&this._material.dispose()}}class rS extends iS{static get type(){return"AnaglyphPassNode"}constructor(e,t){super(e,t),this.isAnaglyphPassNode=!0,this._colorMatrixLeft=fe(new Ke().fromArray([.4561,-.0400822,-.0152161,.500484,-.0378246,-.0205971,.176381,-.0157589,-.00546856])),this._colorMatrixRight=fe(new Ke().fromArray([-.0434706,.378476,-.0721527,-.0879388,.73364,-.112961,-.00155529,-.0184503,1.2264]))}setup(e){const t=nt(),i=U(()=>{const s=this._mapLeft.uv(t),a=this._mapRight.uv(t),o=li(this._colorMatrixLeft.mul(s.rgb).add(this._colorMatrixRight.mul(a.rgb)));return ae(o.rgb,ft(s.a,a.a))}),r=this._material||(this._material=new bt);return r.fragmentNode=i().context(e.getSharedContext()),r.name="Anaglyph",r.needsUpdate=!0,super.setup(e)}}const GD=(n,e)=>G(new rS(n,e));class nS extends iS{static get type(){return"ParallaxBarrierPassNode"}constructor(e,t){super(e,t),this.isParallaxBarrierPassNode=!0}setup(e){const t=nt(),i=U(()=>{const s=ae().toVar();return Le(kh(vo.y,2).greaterThan(1),()=>{s.assign(this._mapLeft.uv(t))}).Else(()=>{s.assign(this._mapRight.uv(t))}),s}),r=this._material||(this._material=new bt);return r.fragmentNode=i().context(e.getSharedContext()),r.needsUpdate=!0,super.setup(e)}}const WD=(n,e)=>G(new nS(n,e));class sS extends Ti{static get type(){return"ToonOutlinePassNode"}constructor(e,t,i,r,s){super(Ti.COLOR,e,t),this.colorNode=i,this.thicknessNode=r,this.alphaNode=s,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,i=t.getRenderObjectFunction();t.setRenderObjectFunction((r,s,a,o,l,c,u)=>{if((l.isMeshToonMaterial||l.isMeshToonNodeMaterial)&&l.wireframe===!1){const h=this._getOutlineMaterial(l);t.renderObject(r,s,a,o,h,c,u)}t.renderObject(r,s,a,o,l,c,u)}),super.updateBefore(e),t.setRenderObjectFunction(i)}_createMaterial(){const e=new bt;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=si;const t=ur.negate(),i=lr.mul(pn),r=E(1),s=i.mul(ae(Zt,1)),a=i.mul(ae(Zt.add(t),1)),o=Mr(s.sub(a));return e.vertexNode=s.add(o.mul(this.thicknessNode).mul(s.w).mul(r)),e.colorNode=ae(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return t===void 0&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const jD=(n,e,t=new xe(0,0,0),i=.003,r=1)=>G(new sS(n,e,G(t),G(i),G(r)));class aS extends qe{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outpuType=null,this.events=new vr,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return this.outputType!==null}set value(e){this._value!==e&&(this._cache&&this.inputType==="URL"&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&this._cache===null&&this.inputType==="URL"&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&e.value!==null&&e.value!==void 0&&((this.inputType==="URL"||this.inputType==="String")&&typeof e.value=="string"||this.inputType==="Number"&&typeof e.value=="number"||this.inputType==="Vector2"&&e.value.isVector2||this.inputType==="Vector3"&&e.value.isVector3||this.inputType==="Vector4"&&e.value.isVector4||this.inputType==="Color"&&e.value.isColor||this.inputType==="Matrix3"&&e.value.isMatrix3||this.inputType==="Matrix4"&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:E()}serialize(e){super.serialize(e),this.value!==null?this.inputType==="ArrayBuffer"?e.value=Qm(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;e.value!==null&&(e.inputType==="ArrayBuffer"?t=ef(e.value):e.inputType==="Texture"?t=e.meta.textures[e.value]:t=e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const _d=K(aS);class oS extends Map{get(e,t=null,...i){if(this.has(e))return super.get(e);if(t!==null){const r=t(...i);return this.set(e,r),r}}}class XD{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Md=new oS;class lS extends qe{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new oS,this._output=_d(),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const i=this._outputs;return i[e]===void 0?i[e]=_d(t):i[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const i=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),i[e]=t,i[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),i[e]=t,i[e].events.addEventListener("refresh",this.onRefresh)):i[e]===void 0?(i[e]=_d(t),i[e].events.addEventListener("refresh",this.onRefresh)):i[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const i=this.getObject()[e];if(typeof i=="function")return i(...t)}async callAsync(e,...t){const i=this.getObject()[e];if(typeof i=="function")return i.constructor.name==="AsyncFunction"?await i(...t):i(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){e!==null?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),this._object!==null)return this._object;const e=()=>this.refresh(),t=(c,u)=>this.setOutput(c,u),i=new XD(this),r=Md.get("THREE"),s=Md.get("TSL"),a=this.getMethod(this.codeNode),o=[i,this._local,Md,e,t,r,s];this._object=a(...o);const l=this._object.layout;if(l&&(l.cache===!1&&this._local.clear(),this._output.outputType=l.outputType||null,Array.isArray(l.elements)))for(const c of l.elements){const u=c.id||c.name;c.inputType&&(this.getParameter(u)===void 0&&this.setParameter(u,null),this.getParameter(u).inputType=c.inputType),c.outputType&&(this.getOutput(u)===void 0&&this.setOutput(u,null),this.getOutput(u).outputType=c.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const t in this.parameters){let i=this.parameters[t];i.isScriptableNode&&(i=i.getDefaultOutput()),i.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:E()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),this._method!==null)return this._method;const e=["parameters","local","global","refresh","setOutput","THREE","TSL"],t=["layout","init","main","dispose"].join(", "),i="var "+t+`; var output = {};
3872
3872
  `,r=`
3873
3873
  return { ...output, `+t+" };",s=i+this.codeNode.code+r;return this._method=new Function(...e,s),this._method}dispose(){this._method!==null&&(this._object&&typeof this._object.dispose=="function"&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[Wx(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const i in this.parameters)t.push(this.parameters[i].getCacheKey(e));return jx(t)}set needsUpdate(e){e===!0&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return this.codeNode===null?this:(this._needsOutputUpdate===!0&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value,this)}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const qD=K(lS);class bd extends qe{static get type(){return"FogNode"}constructor(e,t){super("float"),this.isFogNode=!0,this.colorNode=e,this.factorNode=t}getViewZNode(e){let t;const i=e.context.getViewZ;return i!==void 0&&(t=i(this)),(t||Pi.z).negate()}setup(){return this.factorNode}}const YD=K(bd);class cS extends bd{static get type(){return"FogRangeNode"}constructor(e,t,i){super(e),this.isFogRangeNode=!0,this.nearNode=t,this.farNode=i}setup(e){const t=this.getViewZNode(e);return Ki(this.nearNode,this.farNode,t)}}const $D=K(cS);class uS extends bd{static get type(){return"FogExp2Node"}constructor(e,t){super(e),this.isFogExp2Node=!0,this.densityNode=t}setup(e){const t=this.getViewZNode(e),i=this.densityNode;return i.mul(i,t,t).negate().exp().oneMinus()}}const JD=K(uS);let ha=null,da=null;class hS extends qe{static get type(){return"RangeNode"}constructor(e=E(),t=E()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Ln(this.minNode.value)),i=e.getTypeLength(Ln(this.maxNode.value));return t>i?t:i}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let i=null;if(t.count>1){const r=this.minNode.value,s=this.maxNode.value,a=e.getTypeLength(Ln(r)),o=e.getTypeLength(Ln(s));ha=ha||new st,da=da||new st,ha.setScalar(0),da.setScalar(0),a===1?ha.setScalar(r):r.isColor?ha.set(r.r,r.g,r.b):ha.set(r.x,r.y,r.z||0,r.w||0),o===1?da.setScalar(s):s.isColor?da.set(s.r,s.g,s.b):da.set(s.x,s.y,s.z||0,s.w||0);const l=4,c=l*t.count,u=new Float32Array(c);for(let d=0;d<c;d++){const p=d%l,m=ha.getComponent(p),v=da.getComponent(p);u[d]=cu.lerp(m,v,Math.random())}const h=this.getNodeType(e);if(t.count<=4096)i=Zl(u,"vec4",t.count).element(nc).convert(h);else{const d=new Nn(u,4);e.geometry.setAttribute("__range"+this.id,d),i=Gh(d).convert(h)}}else i=E(0);return i}}const KD=K(hS),ZD=U(({depthTexture:n,shadowCoord:e})=>yt(n,e.xy).compare(e.z)),QD=U(({depthTexture:n,shadowCoord:e,shadow:t})=>{const i=(v,f)=>yt(n,v).compare(f),r=fi("mapSize","vec2",t).setGroup(xt),s=fi("radius","float",t).setGroup(xt),a=z(1).div(r),o=a.x.negate().mul(s),l=a.y.negate().mul(s),c=a.x.mul(s),u=a.y.mul(s),h=o.div(2),d=l.div(2),p=c.div(2),m=u.div(2);return zt(i(e.xy.add(z(o,l)),e.z),i(e.xy.add(z(0,l)),e.z),i(e.xy.add(z(c,l)),e.z),i(e.xy.add(z(h,d)),e.z),i(e.xy.add(z(0,d)),e.z),i(e.xy.add(z(p,d)),e.z),i(e.xy.add(z(o,0)),e.z),i(e.xy.add(z(h,0)),e.z),i(e.xy,e.z),i(e.xy.add(z(p,0)),e.z),i(e.xy.add(z(c,0)),e.z),i(e.xy.add(z(h,m)),e.z),i(e.xy.add(z(0,m)),e.z),i(e.xy.add(z(p,m)),e.z),i(e.xy.add(z(o,u)),e.z),i(e.xy.add(z(0,u)),e.z),i(e.xy.add(z(c,u)),e.z)).mul(1/17)}),eU=U(({depthTexture:n,shadowCoord:e,shadow:t})=>{const i=(u,h)=>yt(n,u).compare(h),r=fi("mapSize","vec2",t).setGroup(xt),s=z(1).div(r),a=s.x,o=s.y,l=e.xy,c=us(l.mul(r).add(.5));return l.subAssign(c.mul(s)),zt(i(l,e.z),i(l.add(z(a,0)),e.z),i(l.add(z(0,o)),e.z),i(l.add(s),e.z),rt(i(l.add(z(a.negate(),0)),e.z),i(l.add(z(a.mul(2),0)),e.z),c.x),rt(i(l.add(z(a.negate(),o)),e.z),i(l.add(z(a.mul(2),o)),e.z),c.x),rt(i(l.add(z(0,o.negate())),e.z),i(l.add(z(0,o.mul(2))),e.z),c.y),rt(i(l.add(z(a,o.negate())),e.z),i(l.add(z(a,o.mul(2))),e.z),c.y),rt(rt(i(l.add(z(a.negate(),o.negate())),e.z),i(l.add(z(a.mul(2),o.negate())),e.z),c.x),rt(i(l.add(z(a.negate(),o.mul(2))),e.z),i(l.add(z(a.mul(2),o.mul(2))),e.z),c.x),c.y)).mul(1/9)}),tU=U(({depthTexture:n,shadowCoord:e})=>{const t=E(1).toVar(),i=yt(n).uv(e.xy).rg,r=Xl(e.z,i.x);return Le(r.notEqual(E(1)),()=>{const s=e.z.sub(i.x),a=ft(0,i.y.mul(i.y));let o=a.div(a.add(s.mul(s)));o=li(Pt(o,.3).div(.95-.3)),t.assign(li(ft(r,o)))}),t}),iU=U(({samples:n,radius:e,size:t,shadowPass:i})=>{const r=E(0).toVar(),s=E(0).toVar(),a=n.lessThanEqual(E(1)).select(E(0),E(2).div(n.sub(1))),o=n.lessThanEqual(E(1)).select(E(0),E(-1));gt({start:P(0),end:P(n),type:"int",condition:"<"},({i:c})=>{const u=o.add(E(c).mul(a)),h=i.uv(zt(vo.xy,z(0,u).mul(e)).div(t)).x;r.addAssign(h),s.addAssign(h.mul(h))}),r.divAssign(n),s.divAssign(n);const l=en(s.sub(r.mul(r)));return z(r,l)}),rU=U(({samples:n,radius:e,size:t,shadowPass:i})=>{const r=E(0).toVar(),s=E(0).toVar(),a=n.lessThanEqual(E(1)).select(E(0),E(2).div(n.sub(1))),o=n.lessThanEqual(E(1)).select(E(0),E(-1));gt({start:P(0),end:P(n),type:"int",condition:"<"},({i:c})=>{const u=o.add(E(c).mul(a)),h=i.uv(zt(vo.xy,z(u,0).mul(e)).div(t));r.addAssign(h.x),s.addAssign(zt(h.y.mul(h.y),h.x.mul(h.x)))}),r.divAssign(n),s.divAssign(n);const l=en(s.sub(r.mul(r)));return z(r,l)}),nU=[ZD,QD,eU,tU];let So=null;const Td=new fn;class ms extends na{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.updateType=je.FRAME,this.light=e,this.color=new xe,this.colorNode=fe(this.color).setGroup(xt),this.baseColorNode=null,this.shadowMap=null,this.shadowNode=null,this.shadowColorNode=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this.isAnalyticLightNode=!0}getCacheKey(){return Jm(super.getCacheKey(),this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}setupShadow(e){const{object:t,renderer:i}=e;if(i.shadowMap.enabled===!1)return;let r=this.shadowColorNode;if(r===null){So===null&&(So=new bt,So.fragmentNode=ae(0,0,0,1),So.isShadowNodeMaterial=!0,So.name="ShadowMaterial");const s=i.shadowMap.type,a=this.light.shadow,o=new Fs;o.compareFunction=dp;const l=e.createRenderTarget(a.mapSize.width,a.mapSize.height);if(l.depthTexture=o,a.camera.updateProjectionMatrix(),s===rr){o.compareFunction=null,this.vsmShadowMapVertical=e.createRenderTarget(a.mapSize.width,a.mapSize.height,{format:xa,type:wi}),this.vsmShadowMapHorizontal=e.createRenderTarget(a.mapSize.width,a.mapSize.height,{format:xa,type:wi});const y=yt(o),_=yt(this.vsmShadowMapVertical.texture),I=fi("blurSamples","float",a).setGroup(xt),b=fi("radius","float",a).setGroup(xt),w=fi("mapSize","vec2",a).setGroup(xt);let C=this.vsmMaterialVertical||(this.vsmMaterialVertical=new bt);C.fragmentNode=iU({samples:I,radius:b,size:w,shadowPass:y}).context(e.getSharedContext()),C.name="VSMVertical",C=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new bt),C.fragmentNode=rU({samples:I,radius:b,size:w,shadowPass:_}).context(e.getSharedContext()),C.name="VSMHorizontal"}const c=fi("intensity","float",a).setGroup(xt),u=fi("bias","float",a).setGroup(xt),h=fi("normalBias","float",a).setGroup(xt),d=t.material.shadowPositionNode||jh;let p=fe(a.matrix).setGroup(xt).mul(d.add(qh.mul(h)));p=p.xyz.div(p.w);let m=p.z.add(u);i.coordinateSystem===ws&&(m=m.mul(2).sub(1)),p=D(p.x,p.y.oneMinus(),m);const v=p.x.greaterThanEqual(0).and(p.x.lessThanEqual(1)).and(p.y.greaterThanEqual(0)).and(p.y.lessThanEqual(1)).and(p.z.lessThanEqual(1)),f=a.filterNode||nU[i.shadowMap.type]||null;if(f===null)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const g=yt(l.texture,p),x=v.select(f({depthTexture:s===rr?this.vsmShadowMapHorizontal.texture:o,shadowCoord:p,shadow:a}),E(1));this.shadowMap=l,this.light.shadow.map=l,this.shadowNode=x,this.shadowColorNode=r=this.colorNode.mul(rt(1,x.rgb.mix(g,1),c.mul(g.a))),this.baseColorNode=this.colorNode}this.colorNode=r,this.updateBeforeType=je.RENDER}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):this.shadowNode!==null&&this.disposeShadow()}updateShadow(e){const{shadowMap:t,light:i}=this,{renderer:r,scene:s,camera:a}=e,o=r.shadowMap.type,l=t.depthTexture.version;this._depthVersionCached=l;const c=s.overrideMaterial;s.overrideMaterial=So,t.setSize(i.shadow.mapSize.width,i.shadow.mapSize.height),i.shadow.updateMatrices(i),i.shadow.camera.layers.mask=a.layers.mask;const u=r.getRenderTarget(),h=r.getRenderObjectFunction();r.setRenderObjectFunction((d,...p)=>{(d.castShadow===!0||d.receiveShadow&&o===rr)&&r.renderObject(d,...p)}),r.setRenderTarget(t),r.render(s,i.shadow.camera),r.setRenderObjectFunction(h),i.isPointLight!==!0&&o===rr&&this.vsmPass(e,i),r.setRenderTarget(u),s.overrideMaterial=c}vsmPass(e,t){const{renderer:i}=e;this.vsmShadowMapVertical.setSize(t.shadow.mapSize.width,t.shadow.mapSize.height),this.vsmShadowMapHorizontal.setSize(t.shadow.mapSize.width,t.shadow.mapSize.height),i.setRenderTarget(this.vsmShadowMapVertical),Td.material=this.vsmMaterialVertical,Td.render(i),i.setRenderTarget(this.vsmShadowMapHorizontal),Td.material=this.vsmMaterialHorizontal,Td.render(i)}disposeShadow(){this.shadowMap.dispose(),this.shadowMap=null,this.vsmShadowMapVertical!==null&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),this.vsmShadowMapHorizontal!==null&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),this.shadowNode=null,this.shadowColorNode=null,this.baseColorNode=null,this.updateBeforeType=je.NONE}updateBefore(e){const t=this.light.shadow;(t.needsUpdate||t.autoUpdate)&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const Jg=U(n=>{const{lightDistance:e,cutoffDistance:t,decayExponent:i}=n,r=e.pow(i).max(.01).reciprocal();return t.greaterThan(0).select(r.mul(e.div(t).pow4().oneMinus().clamp().pow2()),r)});let Sd;function Kg(n){Sd=Sd||new WeakMap;let e=Sd.get(n);return e===void 0&&Sd.set(n,e={}),e}function Zg(n){const e=Kg(n);return e.position||(e.position=fe(new N).setGroup(xt).onRenderUpdate((t,i)=>i.value.setFromMatrixPosition(n.matrixWorld)))}function dS(n){const e=Kg(n);return e.targetPosition||(e.targetPosition=fe(new N).setGroup(xt).onRenderUpdate((t,i)=>i.value.setFromMatrixPosition(n.target.matrixWorld)))}function wd(n){const e=Kg(n);return e.viewPosition||(e.viewPosition=fe(new N).setGroup(xt).onRenderUpdate(({camera:t},i)=>{i.value=i.value||new N,i.value.setFromMatrixPosition(n.matrixWorld),i.value.applyMatrix4(t.matrixWorldInverse)}))}const Qg=n=>cr.transformDirection(Zg(n).sub(dS(n))),sU=U(([n])=>{const e=n.toUint().mul(747796405).add(2891336453),t=e.shiftRight(e.shiftRight(28).add(4)).bitXor(e).mul(277803737);return t.shiftRight(22).bitXor(t).toFloat().mul(1/2**32)}),e0=(n,e)=>Ji(lt(4,n.mul(Pt(1,n))),e),aU=(n,e)=>n.lessThan(.5)?e0(n.mul(2),e).div(2):Pt(1,e0(lt(Pt(1,n),2),e).div(2)),oU=(n,e,t)=>Ji(Qr(Ji(n,e),zt(Ji(n,e),Ji(Pt(1,n),t))),1/e),lU=(n,e)=>Ci(ta.mul(e.mul(n).sub(1))).div(ta.mul(e.mul(n).sub(1))),gn=U(([n])=>n.fract().sub(.5).abs()).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),pS=U(([n])=>D(gn(n.z.add(gn(n.y.mul(1)))),gn(n.z.add(gn(n.x.mul(1)))),gn(n.y.add(gn(n.x.mul(1)))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),cU=U(([n,e,t])=>{const i=D(n).toVar(),r=E(1.4).toVar(),s=E(0).toVar(),a=D(i).toVar();return gt({start:E(0),end:E(3),type:"float",condition:"<="},()=>{const o=D(pS(a.mul(2))).toVar();i.addAssign(o.add(t.mul(E(.1).mul(e)))),a.mulAssign(1.8),r.mulAssign(1.5),i.mulAssign(1.2);const l=E(gn(i.z.add(gn(i.x.add(gn(i.y)))))).toVar();s.addAssign(l.div(r)),a.addAssign(.14)}),s}).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"p",type:"vec3"},{name:"spd",type:"float"},{name:"time",type:"float"}]}),uU=U(([n,e,t=z(.5)])=>Eg(n.sub(t),e).add(t)),hU=U(([n,e,t=z(.5)])=>{const i=n.sub(t),r=i.dot(i),s=r.mul(r).mul(e);return n.add(i.mul(s))}),dU=U(({position:n=null,horizontal:e=!0,vertical:t=!1})=>{let i;n!==null?(i=Br.toVar(),i[3][0]=n.x,i[3][1]=n.y,i[3][2]=n.z):i=Br;const r=cr.mul(i);return Pl(e)&&(r[0][0]=Br[0].length(),r[0][1]=0,r[0][2]=0),Pl(t)&&(r[1][0]=0,r[1][1]=Br[1].length(),r[1][2]=0),r[2][0]=0,r[2][1]=0,r[2][2]=1,lr.mul(r).mul(Zt)}),pU=U(([n=null])=>{const e=id();return id(lg(n)).sub(e).lessThan(0).select(ps,n)}),mS=new WeakMap;class mU extends pt{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.updateType=je.OBJECT,this.updateAfterType=je.OBJECT,this.previousModelWorldMatrix=fe(new Re),this.previousProjectionMatrix=fe(new Re).setGroup(xt),this.previousCameraViewMatrix=fe(new Re)}update({frameId:e,camera:t,object:i}){const r=gS(i);this.previousModelWorldMatrix.value.copy(r);const s=fS(t);s.frameId!==e&&(s.frameId=e,s.previousProjectionMatrix===void 0?(s.previousProjectionMatrix=new Re,s.previousCameraViewMatrix=new Re,s.currentProjectionMatrix=new Re,s.currentCameraViewMatrix=new Re,s.previousProjectionMatrix.copy(t.projectionMatrix),s.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(s.previousProjectionMatrix.copy(s.currentProjectionMatrix),s.previousCameraViewMatrix.copy(s.currentCameraViewMatrix)),s.currentProjectionMatrix.copy(t.projectionMatrix),s.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(s.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(s.previousCameraViewMatrix))}updateAfter({object:e}){gS(e).copy(e.matrixWorld)}setup(){const e=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),t=lr.mul(pn).mul(Zt),i=this.previousProjectionMatrix.mul(e).mul(Wh),r=t.xy.div(t.w),s=i.xy.div(i.w);return Pt(r,s)}}function fS(n){let e=mS.get(n);return e===void 0&&(e={},mS.set(n,e)),e}function gS(n,e=0){const t=fS(n);let i=t[e];return i===void 0&&(t[e]=i=new Re),i}const fU=ge(mU),gU=U(([n,e])=>xi(1,n.oneMinus().div(e)).oneMinus()).setLayout({name:"burnBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),vU=U(([n,e])=>xi(n.div(e.oneMinus()),1)).setLayout({name:"dodgeBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),yU=U(([n,e])=>n.oneMinus().mul(e.oneMinus()).oneMinus()).setLayout({name:"screenBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),xU=U(([n,e])=>rt(n.mul(2).mul(e),n.oneMinus().mul(2).mul(e.oneMinus()).oneMinus(),Xl(.5,n))).setLayout({name:"overlayBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),_U=U(([n,e,t=P(16)])=>{const i=o=>n.uv(o),r=nt(),s=i(r).toVar(),a=E(t);return gt({start:P(1),end:t,type:"int",condition:"<="},({i:o})=>{const l=e.mul(E(o).div(a.sub(1)).sub(.5));s.addAssign(i(r.add(l)))}),s.divAssign(a),s}),MU=U(([n,e=1])=>{const t=n,i=Ui(t.rgb),r=D(i),s=xi(1,ft(0,E(10).mul(i.sub(.45)))),a=r.mul(t.rgb).mul(2),o=E(2).mul(r.oneMinus()).mul(t.rgb.oneMinus()).oneMinus(),l=rt(a,o,s),c=t.a.mul(e),u=c.mul(l.rgb);return u.addAssign(t.rgb.mul(c.oneMinus())),ae(u,t.a)}),bU=U(([n])=>{const e=D(n);return ae(qt(e,D(.393,.769,.189)),qt(e,D(.349,.686,.168)),qt(e,D(.272,.534,.131)),n.a)}),vS=U(([n])=>{const e=n.mul(.9478672986).add(.0521327014).pow(2.4),t=n.mul(.0773993808),i=n.lessThanEqual(.04045);return rt(e,t,i)}).setLayout({name:"sRGBToLinearSRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),yS=U(([n])=>{const e=n.pow(.41666).mul(1.055).sub(.055),t=n.mul(12.92),i=n.lessThanEqual(.0031308);return rt(e,t,i)}).setLayout({name:"linearSRGBTosRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),xS=U(([n,e])=>n.mul(e).clamp()).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),_S=U(([n,e])=>(n=n.mul(e),n.div(n.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),MS=U(([n,e])=>{n=n.mul(e),n=n.sub(.004).max(0);const t=n.mul(n.mul(6.2).add(.5)),i=n.mul(n.mul(6.2).add(1.7)).add(.06);return t.div(i).pow(2.2)}).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),TU=U(([n])=>{const e=n.mul(n.add(.0245786)).sub(90537e-9),t=n.mul(n.add(.432951).mul(.983729)).add(.238081);return e.div(t)}),bS=U(([n,e])=>{const t=yi(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),i=yi(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return n=n.mul(e).div(.6),n=t.mul(n),n=TU(n),n=i.mul(n),n.clamp()}).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),SU=yi(D(1.6605,-.1246,-.0182),D(-.5876,1.1329,-.1006),D(-.0728,-.0083,1.1187)),wU=yi(D(.6274,.0691,.0164),D(.3293,.9195,.088),D(.0433,.0113,.8956)),EU=U(([n])=>{const e=D(n).toVar(),t=D(e.mul(e)).toVar(),i=D(t.mul(t)).toVar();return E(15.5).mul(i.mul(t)).sub(lt(40.14,i.mul(e))).add(lt(31.96,i).sub(lt(6.868,t.mul(e))).add(lt(.4298,t).add(lt(.1191,e).sub(.00232))))}),TS=U(([n,e])=>{const t=D(n).toVar(),i=yi(D(.856627153315983,.137318972929847,.11189821299995),D(.0951212405381588,.761241990602591,.0767994186031903),D(.0482516061458583,.101439036467562,.811302368396859)),r=yi(D(1.1271005818144368,-.1413297634984383,-.14132976349843826),D(-.11060664309660323,1.157823702216272,-.11060664309660294),D(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=E(-12.47393),a=E(4.026069);return t.mulAssign(e),t.assign(wU.mul(t)),t.assign(i.mul(t)),t.assign(ft(t,1e-10)),t.assign(Wl(t)),t.assign(t.sub(s).div(a.sub(s))),t.assign(li(t,0,1)),t.assign(EU(t)),t.assign(r.mul(t)),t.assign(Ji(ft(D(0),t),D(2.2))),t.assign(SU.mul(t)),t.assign(li(t,0,1)),t}).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),SS=U(([n,e])=>{const t=E(.76),i=E(.15);n=n.mul(e);const r=xi(n.r,xi(n.g,n.b)),s=Ri(r.lessThan(.08),r.sub(lt(6.25,r.mul(r))),.04);n.subAssign(s);const a=ft(n.r,ft(n.g,n.b));Le(a.lessThan(t),()=>n);const o=Pt(1,t),l=Pt(1,o.mul(o).div(a.add(o.sub(t))));n.mulAssign(l.div(a));const c=Pt(1,Qr(1,i.mul(a.sub(l)).add(1)));return rt(n,D(l),c)}).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class AU extends qe{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}getNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){e.hasBuiltin(this._builtinName)}generate(e,t){const i=this.getBuiltinName(e),r=this.getNodeType(e);return e.shaderStage==="compute"?e.format(i,r,t):(console.warn(`ComputeBuiltinNode: Compute built-in value ${i} can not be accessed in the ${e.shaderStage} stage`),e.generateConst(r))}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const Ed=(n,e)=>G(new AU(n,e)),NU=Ed("numWorkgroups","uvec3"),CU=Ed("workgroupId","uvec3"),RU=Ed("localId","uvec3"),IU=Ed("subgroupSize","uint");class LU extends qe{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:i}=e;i.backend.isWebGLBackend===!0?e.addFlowCode(` // ${t}Barrier
3874
- `):e.addLineFlowCode(`${t}Barrier()`,this)}}const t0=K(LU),PU=()=>t0("workgroup").append(),DU=()=>t0("storage").append(),UU=()=>t0("texture").append();class OU extends as{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let i;const r=e.context.assign;if(i=super.generate(e),r!==!0){const s=this.getNodeType(e);i=e.format(i,s,t)}return i}}class FU extends qe{constructor(e,t,i=0){super(t),this.bufferType=t,this.bufferCount=i,this.isWorkgroupInfoNode=!0,this.scope=e}label(e){return this.name=e,this}getHash(){return this.uuid}setScope(e){return this.scope=e,this}getInputType(){return`${this.scope}Array`}element(e){return G(new OU(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const VU=(n,e)=>G(new FU("Workgroup",n,e));class Mi extends pt{static get type(){return"AtomicFunctionNode"}constructor(e,t,i,r=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=i,this.storeNode=r}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,i=this.getNodeType(e),r=this.getInputType(e),s=this.pointerNode,a=this.valueNode,o=[];o.push(`&${s.build(e,r)}`),o.push(a.build(e,r));const l=`${e.getMethod(t,i)}( ${o.join(", ")} )`;if(this.storeNode!==null){const c=this.storeNode.build(e,r);e.addLineFlowCode(`${c} = ${l}`,this)}else e.addLineFlowCode(l,this)}}Mi.ATOMIC_LOAD="atomicLoad",Mi.ATOMIC_STORE="atomicStore",Mi.ATOMIC_ADD="atomicAdd",Mi.ATOMIC_SUB="atomicSub",Mi.ATOMIC_MAX="atomicMax",Mi.ATOMIC_MIN="atomicMin",Mi.ATOMIC_AND="atomicAnd",Mi.ATOMIC_OR="atomicOr",Mi.ATOMIC_XOR="atomicXor";const BU=K(Mi),Un=(n,e,t,i)=>{const r=BU(n,e,t,i);return r.append(),r},zU=(n,e,t=null)=>Un(Mi.ATOMIC_STORE,n,e,t),kU=(n,e,t=null)=>Un(Mi.ATOMIC_ADD,n,e,t),HU=(n,e,t=null)=>Un(Mi.ATOMIC_SUB,n,e,t),GU=(n,e,t=null)=>Un(Mi.ATOMIC_MAX,n,e,t),WU=(n,e,t=null)=>Un(Mi.ATOMIC_MIN,n,e,t),jU=(n,e,t=null)=>Un(Mi.ATOMIC_AND,n,e,t),XU=(n,e,t=null)=>Un(Mi.ATOMIC_OR,n,e,t),qU=(n,e,t=null)=>Un(Mi.ATOMIC_XOR,n,e,t),YU=U(([n=nt()])=>{const e=n.mul(2),t=e.x.floor(),i=e.y.floor();return t.add(i).mod(2).sign()}),fc=U(([n,e,t])=>{const i=E(t).toVar(),r=E(e).toVar(),s=os(n).toVar();return Ri(s,r,i)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),Ad=U(([n,e])=>{const t=os(e).toVar(),i=E(n).toVar();return Ri(t,i.negate(),i)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),ii=U(([n])=>{const e=E(n).toVar();return P(cs(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),kt=U(([n,e])=>{const t=E(n).toVar();return e.assign(ii(t)),t.sub(E(e))}),$U=U(([n,e,t,i,r,s])=>{const a=E(s).toVar(),o=E(r).toVar(),l=E(i).toVar(),c=E(t).toVar(),u=E(e).toVar(),h=E(n).toVar(),d=E(Pt(1,o)).toVar();return Pt(1,a).mul(h.mul(d).add(u.mul(o))).add(a.mul(c.mul(d).add(l.mul(o))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),JU=U(([n,e,t,i,r,s])=>{const a=E(s).toVar(),o=E(r).toVar(),l=D(i).toVar(),c=D(t).toVar(),u=D(e).toVar(),h=D(n).toVar(),d=E(Pt(1,o)).toVar();return Pt(1,a).mul(h.mul(d).add(u.mul(o))).add(a.mul(c.mul(d).add(l.mul(o))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),wS=Di([$U,JU]),KU=U(([n,e,t,i,r,s,a,o,l,c,u])=>{const h=E(u).toVar(),d=E(c).toVar(),p=E(l).toVar(),m=E(o).toVar(),v=E(a).toVar(),f=E(s).toVar(),g=E(r).toVar(),x=E(i).toVar(),y=E(t).toVar(),_=E(e).toVar(),I=E(n).toVar(),b=E(Pt(1,p)).toVar(),w=E(Pt(1,d)).toVar();return E(Pt(1,h)).toVar().mul(w.mul(I.mul(b).add(_.mul(p))).add(d.mul(y.mul(b).add(x.mul(p))))).add(h.mul(w.mul(g.mul(b).add(f.mul(p))).add(d.mul(v.mul(b).add(m.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ZU=U(([n,e,t,i,r,s,a,o,l,c,u])=>{const h=E(u).toVar(),d=E(c).toVar(),p=E(l).toVar(),m=D(o).toVar(),v=D(a).toVar(),f=D(s).toVar(),g=D(r).toVar(),x=D(i).toVar(),y=D(t).toVar(),_=D(e).toVar(),I=D(n).toVar(),b=E(Pt(1,p)).toVar(),w=E(Pt(1,d)).toVar();return E(Pt(1,h)).toVar().mul(w.mul(I.mul(b).add(_.mul(p))).add(d.mul(y.mul(b).add(x.mul(p))))).add(h.mul(w.mul(g.mul(b).add(f.mul(p))).add(d.mul(v.mul(b).add(m.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ES=Di([KU,ZU]),QU=U(([n,e,t])=>{const i=E(t).toVar(),r=E(e).toVar(),s=_e(n).toVar(),a=_e(s.bitAnd(_e(7))).toVar(),o=E(fc(a.lessThan(_e(4)),r,i)).toVar(),l=E(lt(2,fc(a.lessThan(_e(4)),i,r))).toVar();return Ad(o,os(a.bitAnd(_e(1)))).add(Ad(l,os(a.bitAnd(_e(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),eO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=E(e).toVar(),o=_e(n).toVar(),l=_e(o.bitAnd(_e(15))).toVar(),c=E(fc(l.lessThan(_e(8)),a,s)).toVar(),u=E(fc(l.lessThan(_e(4)),s,fc(l.equal(_e(12)).or(l.equal(_e(14))),a,r))).toVar();return Ad(c,os(l.bitAnd(_e(1)))).add(Ad(u,os(l.bitAnd(_e(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),bi=Di([QU,eO]),tO=U(([n,e,t])=>{const i=E(t).toVar(),r=E(e).toVar(),s=lo(n).toVar();return D(bi(s.x,r,i),bi(s.y,r,i),bi(s.z,r,i))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),iO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=E(e).toVar(),o=lo(n).toVar();return D(bi(o.x,a,s,r),bi(o.y,a,s,r),bi(o.z,a,s,r))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),zr=Di([tO,iO]),rO=U(([n])=>{const e=E(n).toVar();return lt(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),nO=U(([n])=>{const e=E(n).toVar();return lt(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),sO=U(([n])=>{const e=D(n).toVar();return lt(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),AS=Di([rO,sO]),aO=U(([n])=>{const e=D(n).toVar();return lt(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),NS=Di([nO,aO]),Sr=U(([n,e])=>{const t=P(e).toVar(),i=_e(n).toVar();return i.shiftLeft(t).bitOr(i.shiftRight(P(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),CS=U(([n,e,t])=>{n.subAssign(t),n.bitXorAssign(Sr(t,P(4))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Sr(n,P(6))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Sr(e,P(8))),e.addAssign(n),n.subAssign(t),n.bitXorAssign(Sr(t,P(16))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Sr(n,P(19))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Sr(e,P(4))),e.addAssign(n)}),gc=U(([n,e,t])=>{const i=_e(t).toVar(),r=_e(e).toVar(),s=_e(n).toVar();return i.bitXorAssign(r),i.subAssign(Sr(r,P(14))),s.bitXorAssign(i),s.subAssign(Sr(i,P(11))),r.bitXorAssign(s),r.subAssign(Sr(s,P(25))),i.bitXorAssign(r),i.subAssign(Sr(r,P(16))),s.bitXorAssign(i),s.subAssign(Sr(i,P(4))),r.bitXorAssign(s),r.subAssign(Sr(s,P(14))),i.bitXorAssign(r),i.subAssign(Sr(r,P(24))),i}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Gi=U(([n])=>{const e=_e(n).toVar();return E(e).div(E(_e(P(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),vn=U(([n])=>{const e=E(n).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),oO=U(([n])=>{const e=P(n).toVar(),t=_e(_e(1)).toVar(),i=_e(_e(P(3735928559)).add(t.shiftLeft(_e(2))).add(_e(13))).toVar();return gc(i.add(_e(e)),i,i)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),lO=U(([n,e])=>{const t=P(e).toVar(),i=P(n).toVar(),r=_e(_e(2)).toVar(),s=_e().toVar(),a=_e().toVar(),o=_e().toVar();return s.assign(a.assign(o.assign(_e(P(3735928559)).add(r.shiftLeft(_e(2))).add(_e(13))))),s.addAssign(_e(i)),a.addAssign(_e(t)),gc(s,a,o)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),cO=U(([n,e,t])=>{const i=P(t).toVar(),r=P(e).toVar(),s=P(n).toVar(),a=_e(_e(3)).toVar(),o=_e().toVar(),l=_e().toVar(),c=_e().toVar();return o.assign(l.assign(c.assign(_e(P(3735928559)).add(a.shiftLeft(_e(2))).add(_e(13))))),o.addAssign(_e(s)),l.addAssign(_e(r)),c.addAssign(_e(i)),gc(o,l,c)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),uO=U(([n,e,t,i])=>{const r=P(i).toVar(),s=P(t).toVar(),a=P(e).toVar(),o=P(n).toVar(),l=_e(_e(4)).toVar(),c=_e().toVar(),u=_e().toVar(),h=_e().toVar();return c.assign(u.assign(h.assign(_e(P(3735928559)).add(l.shiftLeft(_e(2))).add(_e(13))))),c.addAssign(_e(o)),u.addAssign(_e(a)),h.addAssign(_e(s)),CS(c,u,h),c.addAssign(_e(r)),gc(c,u,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),hO=U(([n,e,t,i,r])=>{const s=P(r).toVar(),a=P(i).toVar(),o=P(t).toVar(),l=P(e).toVar(),c=P(n).toVar(),u=_e(_e(5)).toVar(),h=_e().toVar(),d=_e().toVar(),p=_e().toVar();return h.assign(d.assign(p.assign(_e(P(3735928559)).add(u.shiftLeft(_e(2))).add(_e(13))))),h.addAssign(_e(c)),d.addAssign(_e(l)),p.addAssign(_e(o)),CS(h,d,p),h.addAssign(_e(a)),d.addAssign(_e(s)),gc(h,d,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Ct=Di([oO,lO,cO,uO,hO]),dO=U(([n,e])=>{const t=P(e).toVar(),i=P(n).toVar(),r=_e(Ct(i,t)).toVar(),s=lo().toVar();return s.x.assign(r.bitAnd(P(255))),s.y.assign(r.shiftRight(P(8)).bitAnd(P(255))),s.z.assign(r.shiftRight(P(16)).bitAnd(P(255))),s}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),pO=U(([n,e,t])=>{const i=P(t).toVar(),r=P(e).toVar(),s=P(n).toVar(),a=_e(Ct(s,r,i)).toVar(),o=lo().toVar();return o.x.assign(a.bitAnd(P(255))),o.y.assign(a.shiftRight(P(8)).bitAnd(P(255))),o.z.assign(a.shiftRight(P(16)).bitAnd(P(255))),o}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),kr=Di([dO,pO]),mO=U(([n])=>{const e=z(n).toVar(),t=P().toVar(),i=P().toVar(),r=E(kt(e.x,t)).toVar(),s=E(kt(e.y,i)).toVar(),a=E(vn(r)).toVar(),o=E(vn(s)).toVar(),l=E(wS(bi(Ct(t,i),r,s),bi(Ct(t.add(P(1)),i),r.sub(1),s),bi(Ct(t,i.add(P(1))),r,s.sub(1)),bi(Ct(t.add(P(1)),i.add(P(1))),r.sub(1),s.sub(1)),a,o)).toVar();return AS(l)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),fO=U(([n])=>{const e=D(n).toVar(),t=P().toVar(),i=P().toVar(),r=P().toVar(),s=E(kt(e.x,t)).toVar(),a=E(kt(e.y,i)).toVar(),o=E(kt(e.z,r)).toVar(),l=E(vn(s)).toVar(),c=E(vn(a)).toVar(),u=E(vn(o)).toVar(),h=E(ES(bi(Ct(t,i,r),s,a,o),bi(Ct(t.add(P(1)),i,r),s.sub(1),a,o),bi(Ct(t,i.add(P(1)),r),s,a.sub(1),o),bi(Ct(t.add(P(1)),i.add(P(1)),r),s.sub(1),a.sub(1),o),bi(Ct(t,i,r.add(P(1))),s,a,o.sub(1)),bi(Ct(t.add(P(1)),i,r.add(P(1))),s.sub(1),a,o.sub(1)),bi(Ct(t,i.add(P(1)),r.add(P(1))),s,a.sub(1),o.sub(1)),bi(Ct(t.add(P(1)),i.add(P(1)),r.add(P(1))),s.sub(1),a.sub(1),o.sub(1)),l,c,u)).toVar();return NS(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),i0=Di([mO,fO]),gO=U(([n])=>{const e=z(n).toVar(),t=P().toVar(),i=P().toVar(),r=E(kt(e.x,t)).toVar(),s=E(kt(e.y,i)).toVar(),a=E(vn(r)).toVar(),o=E(vn(s)).toVar(),l=D(wS(zr(kr(t,i),r,s),zr(kr(t.add(P(1)),i),r.sub(1),s),zr(kr(t,i.add(P(1))),r,s.sub(1)),zr(kr(t.add(P(1)),i.add(P(1))),r.sub(1),s.sub(1)),a,o)).toVar();return AS(l)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),vO=U(([n])=>{const e=D(n).toVar(),t=P().toVar(),i=P().toVar(),r=P().toVar(),s=E(kt(e.x,t)).toVar(),a=E(kt(e.y,i)).toVar(),o=E(kt(e.z,r)).toVar(),l=E(vn(s)).toVar(),c=E(vn(a)).toVar(),u=E(vn(o)).toVar(),h=D(ES(zr(kr(t,i,r),s,a,o),zr(kr(t.add(P(1)),i,r),s.sub(1),a,o),zr(kr(t,i.add(P(1)),r),s,a.sub(1),o),zr(kr(t.add(P(1)),i.add(P(1)),r),s.sub(1),a.sub(1),o),zr(kr(t,i,r.add(P(1))),s,a,o.sub(1)),zr(kr(t.add(P(1)),i,r.add(P(1))),s.sub(1),a,o.sub(1)),zr(kr(t,i.add(P(1)),r.add(P(1))),s,a.sub(1),o.sub(1)),zr(kr(t.add(P(1)),i.add(P(1)),r.add(P(1))),s.sub(1),a.sub(1),o.sub(1)),l,c,u)).toVar();return NS(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),r0=Di([gO,vO]),yO=U(([n])=>{const e=E(n).toVar(),t=P(ii(e)).toVar();return Gi(Ct(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),xO=U(([n])=>{const e=z(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar();return Gi(Ct(t,i))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),_O=U(([n])=>{const e=D(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar();return Gi(Ct(t,i,r))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),MO=U(([n])=>{const e=ae(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar(),s=P(ii(e.w)).toVar();return Gi(Ct(t,i,r,s))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),bO=Di([yO,xO,_O,MO]),TO=U(([n])=>{const e=E(n).toVar(),t=P(ii(e)).toVar();return D(Gi(Ct(t,P(0))),Gi(Ct(t,P(1))),Gi(Ct(t,P(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),SO=U(([n])=>{const e=z(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar();return D(Gi(Ct(t,i,P(0))),Gi(Ct(t,i,P(1))),Gi(Ct(t,i,P(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),wO=U(([n])=>{const e=D(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar();return D(Gi(Ct(t,i,r,P(0))),Gi(Ct(t,i,r,P(1))),Gi(Ct(t,i,r,P(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),EO=U(([n])=>{const e=ae(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar(),s=P(ii(e.w)).toVar();return D(Gi(Ct(t,i,r,s,P(0))),Gi(Ct(t,i,r,s,P(1))),Gi(Ct(t,i,r,s,P(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),RS=Di([TO,SO,wO,EO]),Nd=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar(),l=E(0).toVar(),c=E(1).toVar();return gt(a,()=>{l.addAssign(c.mul(i0(o))),c.mulAssign(r),o.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IS=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar(),l=D(0).toVar(),c=E(1).toVar();return gt(a,()=>{l.addAssign(c.mul(r0(o))),c.mulAssign(r),o.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),AO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar();return z(Nd(o,a,s,r),Nd(o.add(D(P(19),P(193),P(17))),a,s,r))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),NO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar(),l=D(IS(o,a,s,r)).toVar(),c=E(Nd(o.add(D(P(19),P(193),P(17))),a,s,r)).toVar();return ae(l,c)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CO=U(([n,e,t,i,r,s,a])=>{const o=P(a).toVar(),l=E(s).toVar(),c=P(r).toVar(),u=P(i).toVar(),h=P(t).toVar(),d=P(e).toVar(),p=z(n).toVar(),m=D(RS(z(d.add(u),h.add(c)))).toVar(),v=z(m.x,m.y).toVar();v.subAssign(.5),v.mulAssign(l),v.addAssign(.5);const f=z(z(E(d),E(h)).add(v)).toVar(),g=z(f.sub(p)).toVar();return Le(o.equal(P(2)),()=>It(g.x).add(It(g.y))),Le(o.equal(P(3)),()=>ft(It(g.x),It(g.y))),qt(g,g)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),RO=U(([n,e,t,i,r,s,a,o,l])=>{const c=P(l).toVar(),u=E(o).toVar(),h=P(a).toVar(),d=P(s).toVar(),p=P(r).toVar(),m=P(i).toVar(),v=P(t).toVar(),f=P(e).toVar(),g=D(n).toVar(),x=D(RS(D(f.add(p),v.add(d),m.add(h)))).toVar();x.subAssign(.5),x.mulAssign(u),x.addAssign(.5);const y=D(D(E(f),E(v),E(m)).add(x)).toVar(),_=D(y.sub(g)).toVar();return Le(c.equal(P(2)),()=>It(_.x).add(It(_.y)).add(It(_.z))),Le(c.equal(P(3)),()=>ft(ft(It(_.x),It(_.y)),It(_.z))),qt(_,_)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),wo=Di([CO,RO]),IO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=z(n).toVar(),a=P().toVar(),o=P().toVar(),l=z(kt(s.x,a),kt(s.y,o)).toVar(),c=E(1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:u})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:h})=>{const d=E(wo(l,u,h,a,o,r,i)).toVar();c.assign(xi(c,d))})}),Le(i.equal(P(0)),()=>{c.assign(en(c))}),c}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),LO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=z(n).toVar(),a=P().toVar(),o=P().toVar(),l=z(kt(s.x,a),kt(s.y,o)).toVar(),c=z(1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:u})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:h})=>{const d=E(wo(l,u,h,a,o,r,i)).toVar();Le(d.lessThan(c.x),()=>{c.y.assign(c.x),c.x.assign(d)}).ElseIf(d.lessThan(c.y),()=>{c.y.assign(d)})})}),Le(i.equal(P(0)),()=>{c.assign(en(c))}),c}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),PO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=z(n).toVar(),a=P().toVar(),o=P().toVar(),l=z(kt(s.x,a),kt(s.y,o)).toVar(),c=D(1e6,1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:u})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:h})=>{const d=E(wo(l,u,h,a,o,r,i)).toVar();Le(d.lessThan(c.x),()=>{c.z.assign(c.y),c.y.assign(c.x),c.x.assign(d)}).ElseIf(d.lessThan(c.y),()=>{c.z.assign(c.y),c.y.assign(d)}).ElseIf(d.lessThan(c.z),()=>{c.z.assign(d)})})}),Le(i.equal(P(0)),()=>{c.assign(en(c))}),c}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=D(n).toVar(),a=P().toVar(),o=P().toVar(),l=P().toVar(),c=D(kt(s.x,a),kt(s.y,o),kt(s.z,l)).toVar(),u=E(1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:h})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:d})=>{gt({start:-1,end:P(1),name:"z",condition:"<="},({z:p})=>{const m=E(wo(c,h,d,p,a,o,l,r,i)).toVar();u.assign(xi(u,m))})})}),Le(i.equal(P(0)),()=>{u.assign(en(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UO=Di([IO,DO]),OO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=D(n).toVar(),a=P().toVar(),o=P().toVar(),l=P().toVar(),c=D(kt(s.x,a),kt(s.y,o),kt(s.z,l)).toVar(),u=z(1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:h})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:d})=>{gt({start:-1,end:P(1),name:"z",condition:"<="},({z:p})=>{const m=E(wo(c,h,d,p,a,o,l,r,i)).toVar();Le(m.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(m)}).ElseIf(m.lessThan(u.y),()=>{u.y.assign(m)})})})}),Le(i.equal(P(0)),()=>{u.assign(en(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),FO=Di([LO,OO]),VO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=D(n).toVar(),a=P().toVar(),o=P().toVar(),l=P().toVar(),c=D(kt(s.x,a),kt(s.y,o),kt(s.z,l)).toVar(),u=D(1e6,1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:h})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:d})=>{gt({start:-1,end:P(1),name:"z",condition:"<="},({z:p})=>{const m=E(wo(c,h,d,p,a,o,l,r,i)).toVar();Le(m.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(m)}).ElseIf(m.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(m)}).ElseIf(m.lessThan(u.z),()=>{u.z.assign(m)})})})}),Le(i.equal(P(0)),()=>{u.assign(en(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),BO=Di([PO,VO]),zO=U(([n])=>{const e=n.y,t=n.z,i=D().toVar();return Le(e.lessThan(1e-4),()=>{i.assign(D(t,t,t))}).Else(()=>{let r=n.x;r=r.sub(cs(r)).mul(6).toVar();const s=P(If(r)),a=r.sub(E(s)),o=t.mul(e.oneMinus()),l=t.mul(e.mul(a).oneMinus()),c=t.mul(e.mul(a.oneMinus()).oneMinus());Le(s.equal(P(0)),()=>{i.assign(D(t,c,o))}).ElseIf(s.equal(P(1)),()=>{i.assign(D(l,t,o))}).ElseIf(s.equal(P(2)),()=>{i.assign(D(o,t,c))}).ElseIf(s.equal(P(3)),()=>{i.assign(D(o,l,t))}).ElseIf(s.equal(P(4)),()=>{i.assign(D(c,o,t))}).Else(()=>{i.assign(D(t,o,l))})}),i}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),kO=U(([n])=>{const e=D(n).toVar(),t=E(e.x).toVar(),i=E(e.y).toVar(),r=E(e.z).toVar(),s=E(xi(t,xi(i,r))).toVar(),a=E(ft(t,ft(i,r))).toVar(),o=E(a.sub(s)).toVar(),l=E().toVar(),c=E().toVar(),u=E().toVar();return u.assign(a),Le(a.greaterThan(0),()=>{c.assign(o.div(a))}).Else(()=>{c.assign(0)}),Le(c.lessThanEqual(0),()=>{l.assign(0)}).Else(()=>{Le(t.greaterThanEqual(a),()=>{l.assign(i.sub(r).div(o))}).ElseIf(i.greaterThanEqual(a),()=>{l.assign(zt(2,r.sub(t).div(o)))}).Else(()=>{l.assign(zt(4,t.sub(i).div(o)))}),l.mulAssign(1/6),Le(l.lessThan(0),()=>{l.addAssign(1)})}),D(l,c,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),HO=U(([n])=>{const e=D(n).toVar(),t=mf(Ef(e,D(.04045))).toVar(),i=D(e.div(12.92)).toVar(),r=D(Ji(ft(e.add(D(.055)),D(0)).div(1.055),D(2.4))).toVar();return rt(i,r,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),LS=(n,e)=>{n=E(n),e=E(e);const t=z(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return Ki(n.sub(t),n.add(t),e)},PS=(n,e,t,i)=>rt(n,e,t[i].clamp()),GO=(n,e,t=nt())=>PS(n,e,t,"x"),WO=(n,e,t=nt())=>PS(n,e,t,"y"),DS=(n,e,t,i,r)=>rt(n,e,LS(t,i[r])),jO=(n,e,t,i=nt())=>DS(n,e,t,i,"x"),XO=(n,e,t,i=nt())=>DS(n,e,t,i,"y"),qO=(n=1,e=0,t=nt())=>t.mul(n).add(e),YO=(n,e=1)=>(n=E(n),n.abs().pow(e).mul(n.sign())),$O=(n,e=1,t=.5)=>E(n).sub(t).mul(e).add(t),JO=(n=nt(),e=1,t=0)=>i0(n.convert("vec2|vec3")).mul(e).add(t),KO=(n=nt(),e=1,t=0)=>r0(n.convert("vec2|vec3")).mul(e).add(t),ZO=(n=nt(),e=1,t=0)=>(n=n.convert("vec2|vec3"),ae(r0(n),i0(n.add(z(19,73)))).mul(e).add(t)),QO=(n=nt(),e=1)=>UO(n.convert("vec2|vec3"),e,P(1)),eF=(n=nt(),e=1)=>FO(n.convert("vec2|vec3"),e,P(1)),tF=(n=nt(),e=1)=>BO(n.convert("vec2|vec3"),e,P(1)),iF=(n=nt())=>bO(n.convert("vec2|vec3")),rF=(n=nt(),e=3,t=2,i=.5,r=1)=>Nd(n,P(e),t,i).mul(r),nF=(n=nt(),e=3,t=2,i=.5,r=1)=>AO(n,P(e),t,i).mul(r),sF=(n=nt(),e=3,t=2,i=.5,r=1)=>IS(n,P(e),t,i).mul(r),aF=(n=nt(),e=3,t=2,i=.5,r=1)=>NO(n,P(e),t,i).mul(r),US=U(([n,e])=>{const t=n.x,i=n.y,r=n.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(2*.511664).mul(i)),s=s.add(e.element(2).mul(2*.511664).mul(r)),s=s.add(e.element(3).mul(2*.511664).mul(t)),s=s.add(e.element(4).mul(2*.429043).mul(t).mul(i)),s=s.add(e.element(5).mul(2*.429043).mul(i).mul(r)),s=s.add(e.element(6).mul(r.mul(r).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(2*.429043).mul(t).mul(r)),s=s.add(e.element(8).mul(.429043).mul(lt(t,t).sub(lt(i,i)))),s});class OS extends ms{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=fe(0).setGroup(xt),this.decayExponentNode=fe(0).setGroup(xt)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setup(e){const{colorNode:t,cutoffDistanceNode:i,decayExponentNode:r,light:s}=this,a=e.context.lightingModel,o=wd(s).sub(Pi),l=o.normalize(),c=o.length(),u=Jg({lightDistance:c,cutoffDistance:i,decayExponent:r}),h=t.mul(u),d=e.context.reflectedLight;a.direct({lightDirection:l,lightColor:h,reflectedLight:d},e.stack,e)}}class FS extends ms{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,i=this.colorNode,r=Qg(this.light),s=e.context.reflectedLight;t.direct({lightDirection:r,lightColor:i,reflectedLight:s},e.stack,e)}}const n0=new Re,Cd=new Re;let vc=null;class VS extends ms{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=fe(new N).setGroup(xt),this.halfWidth=fe(new N).setGroup(xt)}update(e){super.update(e);const{light:t}=this,i=e.camera.matrixWorldInverse;Cd.identity(),n0.copy(t.matrixWorld),n0.premultiply(i),Cd.extractRotation(n0),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(Cd),this.halfHeight.value.applyMatrix4(Cd)}setup(e){super.setup(e);let t,i;e.isAvailable("float32Filterable")?(t=yt(vc.LTC_FLOAT_1),i=yt(vc.LTC_FLOAT_2)):(t=yt(vc.LTC_HALF_1),i=yt(vc.LTC_HALF_2));const{colorNode:r,light:s}=this,a=e.context.lightingModel,o=wd(s),l=e.context.reflectedLight;a.directRectArea({lightColor:r,lightPosition:o,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:l,ltc_1:t,ltc_2:i},e.stack,e)}static setLTC(e){vc=e}}class s0 extends ms{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=fe(0).setGroup(xt),this.penumbraCosNode=fe(0).setGroup(xt),this.cutoffDistanceNode=fe(0).setGroup(xt),this.decayExponentNode=fe(0).setGroup(xt)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:i}=this;return Ki(t,i,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:i,cutoffDistanceNode:r,decayExponentNode:s,light:a}=this,o=wd(a).sub(Pi),l=o.normalize(),c=l.dot(Qg(a)),u=this.getSpotAttenuation(c),h=o.length(),d=Jg({lightDistance:h,cutoffDistance:r,decayExponent:s}),p=i.mul(u).mul(d),m=e.context.reflectedLight;t.direct({lightDirection:l,lightColor:p,reflectedLight:m},e.stack,e)}}class BS extends s0{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let i=null;if(t&&t.isTexture===!0){const r=e.acos().mul(1/Math.PI);i=yt(t,z(r,0),0).r}else i=super.getSpotAttenuation(e);return i}}class zS extends ms{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class kS extends ms{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=Zg(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=fe(new xe).setGroup(xt)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:i,lightDirectionNode:r}=this,s=hr.dot(r).mul(.5).add(.5),a=rt(i,t,s);e.context.irradiance.addAssign(a)}}class HS extends ms{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let i=0;i<9;i++)t.push(new N);this.lightProbe=mn(t)}update(e){const{light:t}=this;super.update(e);for(let i=0;i<9;i++)this.lightProbe.array[i].copy(t.sh.coefficients[i]).multiplyScalar(t.intensity)}setup(e){const t=US(qh,this.lightProbe);e.context.irradiance.addAssign(t)}}class oF{parseFunction(){console.warn("Abstract function.")}}class GS{constructor(e,t,i="",r=""){this.type=e,this.inputs=t,this.name=i,this.precision=r}getCode(){console.warn("Abstract function.")}}GS.isNodeFunction=!0;const lF=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,cF=/[a-z_0-9]+/ig,WS="#pragma main",uF=n=>{n=n.trim();const e=n.indexOf(WS),t=e!==-1?n.slice(e+WS.length):n,i=t.match(lF);if(i!==null&&i.length===5){const r=i[4],s=[];let a=null;for(;(a=cF.exec(r))!==null;)s.push(a);const o=[];let l=0;for(;l<s.length;){const m=s[l][0]==="const";m===!0&&l++;let v=s[l][0];v==="in"||v==="out"||v==="inout"?l++:v="";const f=s[l++][0];let g=Number.parseInt(s[l][0]);Number.isNaN(g)===!1?l++:g=null;const x=s[l++][0];o.push(new Bg(f,x,g,v,m))}const c=t.substring(i[0].length),u=i[3]!==void 0?i[3]:"",h=i[2],d=i[1]!==void 0?i[1]:"",p=e!==-1?n.slice(0,e):"";return{type:h,inputs:o,name:u,precision:d,inputsCode:r,blockCode:c,headerCode:p}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class hF extends GS{constructor(e){const{type:t,inputs:i,name:r,precision:s,inputsCode:a,blockCode:o,headerCode:l}=uF(e);super(t,i,r,s),this.inputsCode=a,this.blockCode=o,this.headerCode=l}getCode(e=this.name){let t;const i=this.blockCode;if(i!==""){const{type:r,inputsCode:s,headerCode:a,precision:o}=this;let l=`${r} ${e} ( ${s.trim()} )`;o!==""&&(l=`${o} ${l}`),t=a+l+i}else t="";return t}}class jS extends oF{parseFunction(e){return new hF(e)}}class dF{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const i=this.getMaterialNodeClass(e.type);if(i!==null){t=new i;for(const r in e)t[r]=e[r]}return t}addColorSpace(e,t){this.addType(e,t,this.colorSpaceNodes)}getColorSpaceFunction(e){return this.colorSpaceNodes.get(e)||null}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t.name,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,i){if(i.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);i.set(t,e)}addClass(e,t,i){if(i.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);i.set(t,e)}}class pF extends Cl{constructor(e,t,i,r,s,a){super(e,t,i,r,s,a),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class XS extends dF{constructor(){super(),this.addLight(OS,yh),this.addLight(FS,xh),this.addLight(VS,Vm),this.addLight(s0,Cl),this.addLight(zS,_h),this.addLight(kS,vh),this.addLight(HS,Bm),this.addLight(BS,pF),this.addToneMapping(xS,Nc),this.addToneMapping(_S,Cc),this.addToneMapping(MS,Qd),this.addToneMapping(bS,Rc),this.addToneMapping(TS,Ic),this.addToneMapping(SS,Lc),this.addColorSpace(yS,Hh(nr,Fi)),this.addColorSpace(vS,Hh(Fi,nr))}}if(typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Vn}})),typeof window<"u"){try{import.meta&&(window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:import.meta.url,revision:Vn}))}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Vn),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Vn}const mF=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Rc,AONode:Yb,AddEquation:Bn,AddOperation:Zd,AdditiveAnimationBlendMode:lp,AdditiveBlending:No,AfterImageNode:DT,AgXToneMapping:Ic,AlphaFormat:ip,AlwaysCompare:ov,AlwaysDepth:Ro,AlwaysStencilFunc:ou,AmbientLight:_h,AmbientLightNode:zS,AnaglyphPassNode:rS,AnalyticLightNode:ms,AnamorphicNode:FT,AnimationAction:yx,AnimationClip:no,AnimationLoader:DI,AnimationMixer:xx,AnimationObjectGroup:QI,AnimationUtils:RI,ArcCurve:Py,ArrayCamera:$p,ArrayElementNode:as,ArrowHelper:p2,AssignNode:p_,AttachedBindMode:ep,AttributeNode:Gf,Audio:Gm,AudioAnalyser:GI,AudioContext:Th,AudioListener:mx,AudioLoader:cx,AxesHelper:zx,BRDF_GGX:mg,BRDF_Lambert:sa,BackSide:si,BasicDepthPacking:cp,BasicEnvironmentNode:rd,BasicNodeLibrary:XS,BasicShadowMap:ew,BatchNode:Vb,BatchedMesh:lm,BloomNode:JT,Bone:Wu,BooleanKeyframeTrack:Gs,Box2:s2,Box3:Bi,Box3Helper:Vx,BoxGeometry:yn,BoxHelper:Fx,Break:td,BufferAttribute:wt,BufferAttributeNode:bM,BufferGeometry:ct,BufferGeometryLoader:nx,BufferNode:$h,BumpMapNode:nb,BypassNode:AM,ByteType:Uc,Cache:Rn,CacheNode:EM,Camera:ul,CameraHelper:Ox,CanvasTexture:Ly,CapsuleGeometry:Id,CatmullRomCurve3:Dy,CineonToneMapping:Qd,CircleGeometry:Ld,ClampToEdgeWrapping:gr,Clock:Hm,CodeNode:Rg,Color:xe,ColorKeyframeTrack:fh,ColorManagement:vt,ColorSpaceNode:Yl,CompressedArrayTexture:Ry,CompressedCubeTexture:Iy,CompressedTexture:_l,CompressedTextureLoader:UI,ComputeNode:SM,ConeGeometry:Pd,ConstNode:Fr,ConstantAlphaFactor:P0,ConstantColorFactor:I0,ContextNode:Of,Continue:TL,Controls:Hx,ConvertNode:af,CubeCamera:Cu,CubeReflectionMapping:fr,CubeRefractionMapping:Ar,CubeTexture:Is,CubeTextureLoader:OI,CubeTextureNode:JM,CubeUVReflectionMapping:xs,CubicBezierCurve:ym,CubicBezierCurve3:Oy,CubicInterpolant:$y,CullFaceBack:Wd,CullFaceFront:y0,CullFaceFrontBack:QS,CullFaceNone:v0,Curve:Or,CurvePath:Vy,CustomBlending:$d,CustomToneMapping:U0,CylinderGeometry:ma,Cylindrical:n2,DFGApprox:fg,D_GGX:d1,Data3DTexture:hu,DataArrayTexture:rl,DataTexture:Ur,DataTextureLoader:Zy,DataUtils:wv,DecrementStencilOp:j0,DecrementWrapStencilOp:q0,DefaultLoadingManager:Dm,DenoiseNode:qT,DepthFormat:Xn,DepthOfFieldNode:BT,DepthStencilFormat:qn,DepthTexture:Fs,DetachedBindMode:O0,DirectionalLight:xh,DirectionalLightHelper:Ux,DirectionalLightNode:FS,Discard:LM,DiscreteInterpolant:Jy,DisplayP3ColorSpace:Jo,DodecahedronGeometry:Dd,DotScreenNode:zT,DoubleSide:Gr,DstAlphaFactor:E0,DstColorFactor:N0,DynamicCopyUsage:dw,DynamicDrawUsage:Ss,DynamicReadUsage:cw,EPSILON:P_,EdgesGeometry:Sm,EllipseCurve:eh,EnvironmentNode:V1,EqualCompare:rv,EqualDepth:Lo,EqualStencilFunc:K0,EquirectUVNode:s1,EquirectangularReflectionMapping:kn,EquirectangularRefractionMapping:Hn,Euler:dr,EventDispatcher:vr,ExpressionNode:IM,ExtrudeGeometry:_c,FXAANode:YT,F_Schlick:yo,FileLoader:Kr,FilmNode:HT,Float16BufferAttribute:Ev,Float32BufferAttribute:De,FloatType:Oi,Fn:U,Fog:Kp,FogExp2:Rd,FogExp2Node:uS,FogNode:bd,FogRangeNode:cS,FramebufferTexture:pm,FrontFacingNode:kM,FrontSide:an,Frustum:Ha,FunctionCallNode:f_,FunctionNode:Ig,FunctionOverloadingNode:hT,GLBufferAttribute:r2,GLSL1:mw,GLSL3:lu,GLSLNodeParser:jS,GTAONode:XT,GaussianBlurNode:LT,GreaterCompare:nv,GreaterDepth:Do,GreaterEqualCompare:av,GreaterEqualDepth:Po,GreaterEqualStencilFunc:tv,GreaterStencilFunc:Q0,GridHelper:Lx,Group:Vs,HalfFloatType:wi,HemisphereLight:vh,HemisphereLightHelper:u2,HemisphereLightNode:kS,IESSpotLightNode:BS,INFINITY:V2,IcosahedronGeometry:Ud,If:Le,ImageBitmapLoader:lx,ImageLoader:Nl,ImageUtils:mv,IncrementStencilOp:W0,IncrementWrapStencilOp:X0,IndexNode:Bt,InstanceNode:Ob,InstancedBufferAttribute:Nn,InstancedBufferGeometry:zm,InstancedInterleavedBuffer:Xm,InstancedMesh:nm,InstancedPointsNodeMaterial:VL,Int16BufferAttribute:Zw,Int32BufferAttribute:Qw,Int8BufferAttribute:$w,IntType:Ms,InterleavedBuffer:Xa,InterleavedBufferAttribute:On,Interpolant:eo,InterpolateDiscrete:Ta,InterpolateLinear:Yo,InterpolateSmooth:su,InvertStencilOp:Y0,IrradianceNode:Kb,JoinNode:Xx,KeepStencilOp:Yn,KeyframeTrack:Jr,LOD:em,LatheGeometry:xc,Layers:al,LessCompare:dp,LessDepth:Io,LessEqualCompare:pp,LessEqualDepth:zn,LessEqualStencilFunc:Z0,LessStencilFunc:J0,Light:ns,LightProbe:Bm,LightProbeNode:HS,LightingContextNode:$b,LightingModel:hc,LightingNode:na,LightsNode:Xb,Line:Cn,Line2NodeMaterial:WL,Line3:Ax,LineBasicMaterial:Ni,LineBasicNodeMaterial:zL,LineCurve:xm,LineCurve3:Fy,LineDashedMaterial:mh,LineDashedNodeMaterial:HL,LineLoop:um,LineSegments:$r,LinearDisplayP3ColorSpace:Sa,LinearFilter:Lt,LinearInterpolant:Pm,LinearMipMapLinearFilter:F0,LinearMipMapNearestFilter:rw,LinearMipmapLinearFilter:ji,LinearMipmapNearestFilter:Wn,LinearSRGBColorSpace:nr,LinearToneMapping:Nc,LinearTransfer:Ko,Loader:Hi,LoaderUtils:Mh,LoadingManager:gh,Loop:gt,LoopNode:Hb,LoopOnce:ap,LoopPingPong:V0,LoopRepeat:op,LuminanceAlphaFormat:np,LuminanceFormat:Bc,Lut3DNode:GT,MOUSE:f0,MRTNode:uT,MatcapUVNode:H1,Material:hi,MaterialLoader:Tc,MaterialNode:Z,MaterialReferenceNode:KM,MathUtils:cu,Matrix2:a0,Matrix3:Ke,Matrix4:Re,MaxEquation:Jd,MaxMipLevelNode:OM,Mesh:Ft,MeshBasicMaterial:Yr,MeshBasicNodeMaterial:QL,MeshDepthMaterial:Fu,MeshDistanceMaterial:qp,MeshLambertMaterial:ph,MeshLambertNodeMaterial:nP,MeshMatcapMaterial:Rm,MeshMatcapNodeMaterial:HP,MeshNormalMaterial:dh,MeshNormalNodeMaterial:qL,MeshPhongMaterial:hh,MeshPhongNodeMaterial:aP,MeshPhysicalMaterial:uh,MeshPhysicalNodeMaterial:k1,MeshSSSNodeMaterial:OP,MeshStandardMaterial:Al,MeshStandardNodeMaterial:z1,MeshToonMaterial:Cm,MeshToonNodeMaterial:zP,MinEquation:M0,MirroredRepeatWrapping:va,MixOperation:Kd,ModelNode:tn,ModelViewProjectionNode:Pb,MorphNode:Wb,MultiplyBlending:Yd,MultiplyOperation:ga,NearestFilter:$t,NearestMipMapLinearFilter:iw,NearestMipMapNearestFilter:tw,NearestMipmapLinearFilter:Mn,NearestMipmapNearestFilter:Dc,NeutralToneMapping:Lc,NeverCompare:iv,NeverDepth:Co,NeverStencilFunc:$0,NoBlending:Er,NoColorSpace:Cr,NoToneMapping:mr,Node:qe,NodeAttribute:Ag,NodeBuilder:lT,NodeCache:hd,NodeCode:K1,NodeFrame:cT,NodeFunctionInput:Bg,NodeLoader:q1,NodeMaterial:bt,NodeMaterialLoader:Y1,NodeMaterialObserver:Gx,NodeObjectLoader:ZP,NodeShaderStage:tf,NodeType:v2,NodeUniform:$1,NodeUpdateType:je,NodeUtils:g2,NodeVar:Ng,NodeVarying:J1,NormalAnimationBlendMode:au,NormalBlending:_n,NormalMapNode:rb,NotEqualCompare:sv,NotEqualDepth:Uo,NotEqualStencilFunc:ev,NumberKeyframeTrack:to,Object3D:_t,Object3DNode:St,ObjectLoader:sx,ObjectSpaceNormalMap:hp,OctahedronGeometry:Eo,OneFactor:T0,OneMinusConstantAlphaFactor:D0,OneMinusConstantColorFactor:L0,OneMinusDstAlphaFactor:A0,OneMinusDstColorFactor:C0,OneMinusSrcAlphaFactor:Ac,OneMinusSrcColorFactor:w0,OrthographicCamera:Ds,OscNode:gi,OutputStructNode:zg,P3Primaries:Qo,PCFShadowMap:jd,PCFSoftShadowMap:Xd,PI:ta,PI2:B2,PMREMGenerator:Gp,PMREMNode:U1,ParallaxBarrierPassNode:nS,ParameterNode:Cg,PassNode:Ti,Path:Tl,PerspectiveCamera:di,PhongLightingModel:dg,PhysicalLightingModel:ad,PixelationPassNode:ZT,Plane:ln,PlaneGeometry:pa,PlaneHelper:d2,PointLight:yh,PointLightHelper:l2,PointLightNode:OS,PointUVNode:MT,Points:dm,PointsMaterial:Za,PointsNodeMaterial:WP,PolarGridHelper:h2,PolyhedronGeometry:fs,PositionalAudio:gx,PosterizeNode:ET,PropertyBinding:Tt,PropertyMixer:vx,PropertyNode:Et,QuadraticBezierCurve:_m,QuadraticBezierCurve3:Mm,Quaternion:qi,QuaternionKeyframeTrack:io,QuaternionLinearInterpolant:Ky,RED_GREEN_RGTC2_Format:ru,RED_RGTC1_Format:sp,REVISION:Vn,RGBADepthPacking:up,RGBAFormat:Ei,RGBAIntegerFormat:Vo,RGBA_ASTC_10x10_Format:Kc,RGBA_ASTC_10x5_Format:Yc,RGBA_ASTC_10x6_Format:$c,RGBA_ASTC_10x8_Format:Jc,RGBA_ASTC_12x10_Format:Zc,RGBA_ASTC_12x12_Format:Qc,RGBA_ASTC_4x4_Format:Xo,RGBA_ASTC_5x4_Format:Hc,RGBA_ASTC_5x5_Format:Gc,RGBA_ASTC_6x5_Format:Wc,RGBA_ASTC_6x6_Format:qo,RGBA_ASTC_8x5_Format:jc,RGBA_ASTC_8x6_Format:Xc,RGBA_ASTC_8x8_Format:qc,RGBA_BPTC_Format:ba,RGBA_ETC2_EAC_Format:jo,RGBA_PVRTC_2BPPV1_Format:kc,RGBA_PVRTC_4BPPV1_Format:Ho,RGBA_S3TC_DXT1_Format:_a,RGBA_S3TC_DXT3_Format:zo,RGBA_S3TC_DXT5_Format:Ma,RGBDepthPacking:sw,RGBFormat:rp,RGBIntegerFormat:nw,RGBShiftNode:kT,RGB_BPTC_SIGNED_Format:eu,RGB_BPTC_UNSIGNED_Format:tu,RGB_ETC1_Format:Go,RGB_ETC2_Format:Wo,RGB_PVRTC_2BPPV1_Format:zc,RGB_PVRTC_4BPPV1_Format:ko,RGB_S3TC_DXT1_Format:Bo,RGDepthPacking:aw,RGFormat:xa,RGIntegerFormat:Fo,RTTNode:yT,RangeNode:hS,RawShaderMaterial:Nm,Ray:Cs,Raycaster:bx,Rec709Primaries:Zo,RectAreaLight:Vm,RectAreaLightNode:VS,RedFormat:Oo,RedIntegerFormat:ya,ReferenceNode:Ql,ReflectorNode:vT,ReinhardToneMapping:Cc,RemapNode:Hf,RenderOutputNode:PM,RenderTarget:ui,RendererReferenceNode:vM,RepeatWrapping:Gn,ReplaceStencilOp:G0,Return:W2,ReverseSubtractEquation:_0,RingGeometry:Mc,RotateNode:W1,SIGNED_RED_GREEN_RGTC2_Format:nu,SIGNED_RED_RGTC1_Format:iu,SRGBColorSpace:Fi,SRGBTransfer:Ot,SSAAPassNode:QT,Scene:Vu,SceneNode:sn,Schlick_to_F0:m1,ScreenNode:ri,ScriptableNode:lS,ScriptableValueNode:aS,SetNode:qx,ShaderChunk:dt,ShaderLib:Dr,ShaderMaterial:Pr,ShaderNode:Dl,ShadowMaterial:ch,ShadowNodeMaterial:$P,Shape:rs,ShapeGeometry:Od,ShapePath:kx,ShapeUtils:nn,ShortType:Oc,Skeleton:yc,SkeletonHelper:o2,SkinnedMesh:rm,SkinningNode:ng,SobelOperatorNode:VT,Source:$n,Sphere:Ai,SphereGeometry:Ao,Spherical:Sx,SphericalHarmonics3:rx,SplineCurve:bm,SplitNode:Rh,SpotLight:Cl,SpotLightHelper:a2,SpotLightNode:s0,Sprite:Qp,SpriteMaterial:dl,SpriteNodeMaterial:XP,SpriteSheetUVNode:dT,SrcAlphaFactor:Ec,SrcAlphaSaturateFactor:R0,SrcColorFactor:S0,StackNode:Q1,StaticCopyUsage:hw,StaticDrawUsage:wa,StaticReadUsage:lw,StereoCamera:km,StereoPassNode:eS,StorageArrayElementNode:pT,StorageBufferNode:qg,StorageTextureNode:TT,StreamCopyUsage:pw,StreamDrawUsage:ow,StreamReadUsage:uw,StringKeyframeTrack:Ws,SubtractEquation:x0,SubtractiveBlending:qd,TBNViewMatrix:ra,TOUCH:g0,TangentSpaceNormalMap:on,TempNode:pt,TetrahedronGeometry:Fd,Texture:Wt,Texture3DNode:j1,TextureLoader:Qy,TextureNode:dn,TextureSizeNode:UM,TextureUtils:UR,TimerNode:Si,ToneMappingNode:xM,ToonOutlinePassNode:sS,TorusGeometry:bc,TorusKnotGeometry:Vd,TransitionNode:KT,Triangle:er,TriangleFanDrawMode:k0,TriangleStripDrawMode:z0,TrianglesDrawMode:B0,TriplanarTexturesNode:mT,TubeGeometry:Bd,UVMapping:Pc,Uint16BufferAttribute:Mu,Uint32BufferAttribute:Pp,Uint8BufferAttribute:Jw,Uint8ClampedBufferAttribute:Kw,Uniform:_x,UniformArrayNode:Yf,UniformGroupNode:ff,UniformNode:Ks,UniformsGroup:i2,UniformsLib:Me,UniformsUtils:Op,UnsignedByteType:Wr,UnsignedInt248Type:jn,UnsignedInt5999Type:tp,UnsignedIntType:Nr,UnsignedShort4444Type:Fc,UnsignedShort5551Type:Vc,UnsignedShortType:_s,UserDataNode:wT,VSMShadowMap:rr,V_GGX_SmithCorrelated:h1,VarNode:uM,VaryingNode:hM,Vector2:J,Vector3:N,Vector4:st,VectorKeyframeTrack:ro,VertexColorNode:_T,VideoTexture:Cy,ViewportDepthNode:Qi,ViewportDepthTextureNode:t1,ViewportSharedTextureNode:AT,ViewportTextureNode:lc,VolumeNodeMaterial:KP,WebGL3DRenderTarget:Bw,WebGLArrayRenderTarget:Vw,WebGLCoordinateSystem:Rr,WebGLCubeRenderTarget:Ru,WebGLMultipleRenderTargets:m2,WebGLRenderTarget:Ir,WebGLRenderer:ly,WebGLUtils:oy,WebGPUCoordinateSystem:ws,WireframeGeometry:Am,WrapAroundEnding:$o,ZeroCurvatureEnding:bs,ZeroFactor:b0,ZeroSlopeEnding:Ts,ZeroStencilOp:H0,abs:It,acesFilmicToneMapping:bS,acos:zh,add:zt,addMethodChaining:te,addNodeElement:j2,afterImage:oD,agxToneMapping:TS,all:Af,alphaT:Oh,anaglyphPass:GD,anamorphic:pD,and:b_,anisotropy:ls,anisotropyB:Qs,anisotropyT:zl,any:D_,ao:TD,append:t_,arrayBuffer:D2,asin:z_,assign:m_,atan:k_,atan2:J_,atomicAdd:kU,atomicAnd:jU,atomicFunc:Un,atomicMax:GU,atomicMin:WU,atomicOr:XU,atomicStore:zU,atomicSub:HU,atomicXor:qU,attenuationColor:Tf,attenuationDistance:bf,attribute:_i,backgroundBlurriness:$3,backgroundIntensity:J3,batch:Bb,billboarding:dU,bitAnd:E_,bitNot:A_,bitOr:N_,bitXor:C_,bitangentGeometry:hL,bitangentLocal:dL,bitangentView:QM,bitangentWorld:pL,bitcast:z2,bleach:MU,bloom:LD,blur:P1,bool:os,buffer:Zl,bufferAttribute:$l,bumpMap:sb,burn:gU,bvec2:n_,bvec3:mf,bvec4:l_,bypass:NM,cache:Jl,call:g_,cameraFar:ho,cameraLogDepth:VM,cameraNear:uo,cameraNormalMatrix:$2,cameraPosition:Wf,cameraProjectionMatrix:lr,cameraProjectionMatrixInverse:q2,cameraViewMatrix:cr,cameraWorldMatrix:Y2,cbrt:rM,ceil:Rf,checker:YU,cineonToneMapping:MS,clamp:li,clearcoat:Ph,clearcoatRoughness:Bl,code:dd,color:i_,colorSpaceToWorking:zf,colorToDirection:jL,compute:wM,cond:lM,context:Ff,convert:u_,convertToTexture:Zi,cos:br,createCanvasElement:uv,cross:co,cubeTexture:Yh,dFdx:W_,dFdy:j_,dashSize:ea,defaultBuildStages:nf,defaultShaderStages:rf,defined:Pl,degrees:F_,denoise:ED,densityFog:JD,depth:ug,depthPass:sD,difference:Q_,diffuseColor:Nt,directionToColor:n1,dispersion:Sf,distance:Z_,div:Qr,dodge:vU,dof:fD,dot:qt,dotScreen:gD,drawIndex:Ub,dynamicBufferAttribute:TM,element:c_,emissive:vf,equal:v_,equals:U_,equirectUV:hg,exp:Nf,exp2:Bh,expression:hs,faceDirection:Kl,faceForward:sM,film:yD,float:E,floor:cs,fog:YD,fract:us,frameGroup:O2,frameId:D3,frontFacing:HM,fwidth:Y_,fxaa:AD,gain:aU,gapSize:Hl,gaussianBlur:aD,getColorSpaceMethod:Hh,getConstNodeType:e_,getCurrentStack:pf,getDirection:I1,getDistanceAttenuation:Jg,getGeometryRoughness:u1,getRoughness:pg,getShIrradianceAt:US,getTextureIndex:kg,global:Md,glsl:r3,glslFn:n3,grayscale:lD,greaterThan:Ef,greaterThanEqual:M_,hash:sU,highPrecisionModelNormalViewMatrix:aL,highPrecisionModelViewMatrix:sL,hue:hD,instance:Fb,instanceIndex:nc,instancedBufferAttribute:Gh,instancedDynamicBufferAttribute:kf,int:P,inverseSqrt:V_,invocationLocalIndex:ML,invocationSubgroupIndex:_L,ior:Gl,iridescence:Uh,iridescenceIOR:yf,iridescenceThickness:xf,ivec2:un,ivec3:s_,ivec4:a_,js:t3,label:cM,length:ia,lengthSq:Pf,lessThan:x_,lessThanEqual:__,lightPosition:Zg,lightTargetDirection:Qg,lightTargetPosition:dS,lightViewPosition:wd,lightingContext:Jb,lights:qb,linearDepth:id,linearSRGBTosRGB:yS,linearToneMapping:xS,localId:RU,log:Cf,log2:Wl,loop:SL,luminance:Ui,lut3D:xD,mat2:Fl,mat3:yi,mat4:Js,matcapUV:G1,materialAOMap:Lb,materialAlphaTest:ob,materialAnisotropy:Mb,materialAnisotropyVector:fo,materialAttenuationColor:Cb,materialAttenuationDistance:Nb,materialClearcoat:fb,materialClearcoatNormal:vb,materialClearcoatRoughness:gb,materialColor:mo,materialDispersion:Ib,materialEmissive:cb,materialIOR:Ab,materialIridescence:bb,materialIridescenceIOR:Tb,materialIridescenceThickness:Sb,materialLightMap:ig,materialLineDashOffset:tg,materialLineDashSize:Qf,materialLineGapSize:eg,materialLineScale:Qh,materialLineWidth:ed,materialMetalness:pb,materialNormal:mb,materialOpacity:Kh,materialPointWidth:Rb,materialReference:rn,materialReflectivity:Zh,materialRefractionRatio:jM,materialRotation:yb,materialRoughness:db,materialSheen:xb,materialSheenRoughness:_b,materialShininess:lb,materialSpecular:ub,materialSpecularColor:hb,materialSpecularIntensity:Zf,materialSpecularStrength:rc,materialThickness:Eb,materialTransmission:wb,max:ft,maxMipLevel:FM,metalness:Vl,min:xi,mix:rt,mixElement:aM,mod:kh,modInt:wf,modelDirection:tL,modelNormalMatrix:BM,modelPosition:iL,modelScale:rL,modelViewMatrix:pn,modelViewPosition:nL,modelViewProjection:rg,modelWorldMatrix:Br,modelWorldMatrixInverse:zM,morphReference:jb,motionBlur:_U,mrt:gd,mul:lt,mx_aastep:LS,mx_cell_noise_float:iF,mx_contrast:$O,mx_fractal_noise_float:rF,mx_fractal_noise_vec2:nF,mx_fractal_noise_vec3:sF,mx_fractal_noise_vec4:aF,mx_hsvtorgb:zO,mx_noise_float:JO,mx_noise_vec3:KO,mx_noise_vec4:ZO,mx_ramplr:GO,mx_ramptb:WO,mx_rgbtohsv:kO,mx_safepower:YO,mx_splitlr:jO,mx_splittb:XO,mx_srgb_texture_to_lin_rec709:HO,mx_transform_uv:qO,mx_worley_noise_float:QO,mx_worley_noise_vec2:eF,mx_worley_noise_vec3:tF,negate:H_,neutralToneMapping:SS,nodeArray:$s,nodeImmutable:ge,nodeObject:G,nodeObjects:Ul,nodeProxy:K,normalFlat:GM,normalGeometry:Xh,normalLocal:ur,normalMap:Kf,normalView:hr,normalWorld:qh,normalize:Mr,not:S_,notEqual:y_,numWorkgroups:NU,objectDirection:J2,objectGroup:d_,objectPosition:Z2,objectScale:Q2,objectViewPosition:eL,objectWorldMatrix:K2,oneMinus:G_,or:T_,orthographicDepthToViewZ:PL,oscSawtooth:V3,oscSine:U3,oscSquare:O3,oscTriangle:F3,output:_f,outputStruct:R3,overlay:xU,overloadingFn:Di,parabola:e0,parallaxBarrierPass:WD,parallaxDirection:tb,parallaxUV:fL,parameter:e3,pass:nD,passTexture:To,pcurve:oU,perspectiveDepthToViewZ:cg,pixelationPass:OD,pmremTexture:O1,pointUV:Y3,pointWidth:F2,positionGeometry:Li,positionLocal:Zt,positionPrevious:Wh,positionView:Pi,positionViewDirection:Vt,positionWorld:jh,positionWorldDirection:jf,posterize:tD,pow:Ji,pow2:Lf,pow3:eM,pow4:tM,property:ar,radians:O_,rand:Uf,range:KD,rangeFog:$D,reciprocal:q_,reference:fi,referenceBuffer:$f,reflect:K_,reflectVector:YM,reflectView:XM,reflector:G3,refract:Df,refractVector:$M,refractView:qM,reinhardToneMapping:_S,remainder:L_,remap:CM,remapClamp:RM,renderGroup:xt,renderOutput:DM,rendererReference:yM,rgbShift:vD,rotate:Eg,rotateUV:uU,roughness:hn,round:X_,rtt:xT,sRGBToLinearSRGB:vS,sampler:X2,saturate:nM,saturation:cD,screen:yU,screenCoordinate:vo,screenSize:go,screenUV:ps,scriptable:qD,scriptableValue:_d,select:Ri,sepia:bU,setCurrentStack:Ol,shaderStages:sf,sharedUniformGroup:gf,sheen:Zs,sheenRoughness:Dh,shiftLeft:R_,shiftRight:I_,shininess:Fh,sign:jl,sin:Ci,sinc:lU,skinning:bL,skinningReference:kb,smoothstep:Ki,smoothstepElement:oM,sobel:mD,specularColor:or,specularF90:kl,spherizeUV:hU,split:U2,spritesheetUV:B3,sqrt:en,ssaaPass:BD,stack:pd,step:Xl,stereoPass:kD,storage:K3,storageBarrier:DU,storageObject:Z3,storageTexture:ST,string:P2,sub:Pt,subgroupIndex:xL,subgroupSize:IU,tan:B_,tangentGeometry:Jh,tangentLocal:ec,tangentView:tc,tangentWorld:ZM,temp:Vf,texture:yt,texture3D:X1,textureBarrier:UU,textureBicubic:T1,textureCubeUV:L1,textureLoad:Vr,textureSize:ds,textureStore:Q3,thickness:Mf,threshold:UT,timerDelta:P3,timerGlobal:L3,timerLocal:Hg,toOutputColorSpace:pM,toWorkingColorSpace:mM,toneMapping:_M,toneMappingExposure:MM,toonOutlinePass:jD,transformDirection:iM,transformNormal:WM,transformNormalToView:qf,transformedBentNormalView:ib,transformedBitangentView:eb,transformedBitangentWorld:mL,transformedClearcoatNormalView:po,transformedNormalView:Yt,transformedNormalWorld:Xf,transformedTangentView:Jf,transformedTangentWorld:uL,transition:PD,transmission:Vh,transpose:$_,tri:gn,tri3:pS,triNoise3D:cU,triplanarTexture:k3,triplanarTextures:fT,trunc:If,tslFn:L2,uint:_e,uniform:fe,uniformArray:mn,uniformGroup:h_,uniforms:lL,userData:eD,uv:nt,uvec2:r_,uvec3:lo,uvec4:o_,varying:Ii,varyingProperty:Zr,vec2:z,vec3:D,vec4:ae,vectorComponents:so,velocity:fU,vertexColor:q3,vertexIndex:Db,vibrance:uD,viewZToOrthographicDepth:cc,viewZToPerspectiveDepth:i1,viewport:Pn,viewportBottomLeft:IL,viewportCoordinate:Qb,viewportDepthTexture:lg,viewportLinearDepth:DL,viewportMipTexture:e1,viewportResolution:CL,viewportSafeUV:pU,viewportSharedTexture:iD,viewportSize:Zb,viewportTexture:LL,viewportTopLeft:RL,viewportUV:NL,wgsl:i3,wgslFn:s3,workgroupArray:VU,workgroupBarrier:PU,workgroupId:CU,workingToColorSpace:fM,xor:w_},Symbol.toStringTag,{value:"Module"}));export{rm as $,zx as A,ct as B,Hm as C,Gr as D,dr as E,Kp as F,Lx as G,Cn as H,wt as I,ma as J,Sm as K,al as L,Ft as M,$r as N,_t as O,pa as P,qi as Q,Cs as R,Ai as S,Wt as T,_x as U,N as V,ly as W,Ni as X,ln as Y,bx as Z,$p as _,hi as a,Lo as a$,On as a0,yc as a1,Wu as a2,$n as a3,Ru as a4,Cu as a5,no as a6,Tt as a7,nr as a8,dt as a9,Jd as aA,_h as aB,vh as aC,Y0 as aD,q0 as aE,X0 as aF,j0 as aG,W0 as aH,G0 as aI,H0 as aJ,Yn as aK,ou as aL,tv as aM,ev as aN,Q0 as aO,Z0 as aP,K0 as aQ,J0 as aR,$0 as aS,Nm as aT,lu as aU,Ro as aV,Po as aW,Do as aX,zn as aY,Io as aZ,Uo as a_,Me as aa,Kr as ab,Ur as ac,Ei as ad,kn as ae,Fi as af,mr as ag,Xd as ah,XS as ai,Ir as aj,Fs as ak,$t as al,op as am,ap as an,xx as ao,_l as ap,an as aq,Ha as ar,Ds as as,mx as at,gx as au,cx as av,vr as aw,si as ax,Fu as ay,$d as az,Qy as b,nm as b$,lm as b0,uh as b1,Wr as b2,Lt as b3,Mc as b4,Ax as b5,No as b6,Fx as b7,Cl as b8,Ux as b9,jn as bA,Nr as bB,Vn as bC,Cr as bD,Bc as bE,Gn as bF,Oi as bG,hu as bH,gr as bI,up as bJ,gh as bK,ji as bL,Hi as bM,Co as bN,Oo as bO,xa as bP,Xn as bQ,qe as bR,cT as bS,lT as bT,jS as bU,hr as bV,rf as bW,B0 as bX,k0 as bY,z0 as bZ,Mh as b_,Ox as ba,em as bb,er as bc,_n as bd,Lc as be,Ic as bf,Rc as bg,Cc as bh,Nc as bi,wi as bj,Cy as bk,Is as bl,Iy as bm,Hn as bn,ro as bo,io as bp,Gm as bq,va as br,Op as bs,Dr as bt,dh as bu,Th as bv,ul as bw,cp as bx,Er as by,qn as bz,Re as c,Nn as c0,lx as c1,Xa as c2,Za as c3,um as c4,dm as c5,Yo as c6,vt as c7,Dc as c8,Wn as c9,ph as cA,Mu as cB,nn as cC,Dm as cD,f0 as cE,g0 as cF,Sx as cG,Ly as cH,zm as cI,Xm as cJ,Am as cK,fh as cL,Ss as cM,Ms as cN,_s as cO,Uc as cP,Oc as cQ,Vo as cR,Fo as cS,ya as cT,Mn as ca,Ta as cb,to as cc,eo as cd,Ry as ce,Xo as cf,ba as cg,jo as ch,Ho as ci,Ma as cj,Go as ck,Wo as cl,ko as cm,_a as cn,Jo as co,Sa as cp,qo as cq,kx as cr,De as cs,Eo as ct,bc as cu,Hx as cv,Zy as cw,wv as cx,Or as cy,hh as cz,Bi as d,Al as e,mF as f,J as g,st as h,di as i,Vu as j,Pr as k,xe as l,ch as m,Vx as n,Ke as o,cu as p,Yr as q,Vs as r,Ao as s,yn as t,dl as u,Qp as v,rs as w,_c as x,xh as y,yh as z};
3874
+ `):e.addLineFlowCode(`${t}Barrier()`,this)}}const t0=K(LU),PU=()=>t0("workgroup").append(),DU=()=>t0("storage").append(),UU=()=>t0("texture").append();class OU extends as{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let i;const r=e.context.assign;if(i=super.generate(e),r!==!0){const s=this.getNodeType(e);i=e.format(i,s,t)}return i}}class FU extends qe{constructor(e,t,i=0){super(t),this.bufferType=t,this.bufferCount=i,this.isWorkgroupInfoNode=!0,this.scope=e}label(e){return this.name=e,this}getHash(){return this.uuid}setScope(e){return this.scope=e,this}getInputType(){return`${this.scope}Array`}element(e){return G(new OU(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const VU=(n,e)=>G(new FU("Workgroup",n,e));class Mi extends pt{static get type(){return"AtomicFunctionNode"}constructor(e,t,i,r=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=i,this.storeNode=r}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,i=this.getNodeType(e),r=this.getInputType(e),s=this.pointerNode,a=this.valueNode,o=[];o.push(`&${s.build(e,r)}`),o.push(a.build(e,r));const l=`${e.getMethod(t,i)}( ${o.join(", ")} )`;if(this.storeNode!==null){const c=this.storeNode.build(e,r);e.addLineFlowCode(`${c} = ${l}`,this)}else e.addLineFlowCode(l,this)}}Mi.ATOMIC_LOAD="atomicLoad",Mi.ATOMIC_STORE="atomicStore",Mi.ATOMIC_ADD="atomicAdd",Mi.ATOMIC_SUB="atomicSub",Mi.ATOMIC_MAX="atomicMax",Mi.ATOMIC_MIN="atomicMin",Mi.ATOMIC_AND="atomicAnd",Mi.ATOMIC_OR="atomicOr",Mi.ATOMIC_XOR="atomicXor";const BU=K(Mi),Un=(n,e,t,i)=>{const r=BU(n,e,t,i);return r.append(),r},zU=(n,e,t=null)=>Un(Mi.ATOMIC_STORE,n,e,t),kU=(n,e,t=null)=>Un(Mi.ATOMIC_ADD,n,e,t),HU=(n,e,t=null)=>Un(Mi.ATOMIC_SUB,n,e,t),GU=(n,e,t=null)=>Un(Mi.ATOMIC_MAX,n,e,t),WU=(n,e,t=null)=>Un(Mi.ATOMIC_MIN,n,e,t),jU=(n,e,t=null)=>Un(Mi.ATOMIC_AND,n,e,t),XU=(n,e,t=null)=>Un(Mi.ATOMIC_OR,n,e,t),qU=(n,e,t=null)=>Un(Mi.ATOMIC_XOR,n,e,t),YU=U(([n=nt()])=>{const e=n.mul(2),t=e.x.floor(),i=e.y.floor();return t.add(i).mod(2).sign()}),fc=U(([n,e,t])=>{const i=E(t).toVar(),r=E(e).toVar(),s=os(n).toVar();return Ri(s,r,i)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),Ad=U(([n,e])=>{const t=os(e).toVar(),i=E(n).toVar();return Ri(t,i.negate(),i)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),ii=U(([n])=>{const e=E(n).toVar();return P(cs(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),kt=U(([n,e])=>{const t=E(n).toVar();return e.assign(ii(t)),t.sub(E(e))}),$U=U(([n,e,t,i,r,s])=>{const a=E(s).toVar(),o=E(r).toVar(),l=E(i).toVar(),c=E(t).toVar(),u=E(e).toVar(),h=E(n).toVar(),d=E(Pt(1,o)).toVar();return Pt(1,a).mul(h.mul(d).add(u.mul(o))).add(a.mul(c.mul(d).add(l.mul(o))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),JU=U(([n,e,t,i,r,s])=>{const a=E(s).toVar(),o=E(r).toVar(),l=D(i).toVar(),c=D(t).toVar(),u=D(e).toVar(),h=D(n).toVar(),d=E(Pt(1,o)).toVar();return Pt(1,a).mul(h.mul(d).add(u.mul(o))).add(a.mul(c.mul(d).add(l.mul(o))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),wS=Di([$U,JU]),KU=U(([n,e,t,i,r,s,a,o,l,c,u])=>{const h=E(u).toVar(),d=E(c).toVar(),p=E(l).toVar(),m=E(o).toVar(),v=E(a).toVar(),f=E(s).toVar(),g=E(r).toVar(),x=E(i).toVar(),y=E(t).toVar(),_=E(e).toVar(),I=E(n).toVar(),b=E(Pt(1,p)).toVar(),w=E(Pt(1,d)).toVar();return E(Pt(1,h)).toVar().mul(w.mul(I.mul(b).add(_.mul(p))).add(d.mul(y.mul(b).add(x.mul(p))))).add(h.mul(w.mul(g.mul(b).add(f.mul(p))).add(d.mul(v.mul(b).add(m.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ZU=U(([n,e,t,i,r,s,a,o,l,c,u])=>{const h=E(u).toVar(),d=E(c).toVar(),p=E(l).toVar(),m=D(o).toVar(),v=D(a).toVar(),f=D(s).toVar(),g=D(r).toVar(),x=D(i).toVar(),y=D(t).toVar(),_=D(e).toVar(),I=D(n).toVar(),b=E(Pt(1,p)).toVar(),w=E(Pt(1,d)).toVar();return E(Pt(1,h)).toVar().mul(w.mul(I.mul(b).add(_.mul(p))).add(d.mul(y.mul(b).add(x.mul(p))))).add(h.mul(w.mul(g.mul(b).add(f.mul(p))).add(d.mul(v.mul(b).add(m.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ES=Di([KU,ZU]),QU=U(([n,e,t])=>{const i=E(t).toVar(),r=E(e).toVar(),s=_e(n).toVar(),a=_e(s.bitAnd(_e(7))).toVar(),o=E(fc(a.lessThan(_e(4)),r,i)).toVar(),l=E(lt(2,fc(a.lessThan(_e(4)),i,r))).toVar();return Ad(o,os(a.bitAnd(_e(1)))).add(Ad(l,os(a.bitAnd(_e(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),eO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=E(e).toVar(),o=_e(n).toVar(),l=_e(o.bitAnd(_e(15))).toVar(),c=E(fc(l.lessThan(_e(8)),a,s)).toVar(),u=E(fc(l.lessThan(_e(4)),s,fc(l.equal(_e(12)).or(l.equal(_e(14))),a,r))).toVar();return Ad(c,os(l.bitAnd(_e(1)))).add(Ad(u,os(l.bitAnd(_e(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),bi=Di([QU,eO]),tO=U(([n,e,t])=>{const i=E(t).toVar(),r=E(e).toVar(),s=lo(n).toVar();return D(bi(s.x,r,i),bi(s.y,r,i),bi(s.z,r,i))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),iO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=E(e).toVar(),o=lo(n).toVar();return D(bi(o.x,a,s,r),bi(o.y,a,s,r),bi(o.z,a,s,r))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),zr=Di([tO,iO]),rO=U(([n])=>{const e=E(n).toVar();return lt(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),nO=U(([n])=>{const e=E(n).toVar();return lt(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),sO=U(([n])=>{const e=D(n).toVar();return lt(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),AS=Di([rO,sO]),aO=U(([n])=>{const e=D(n).toVar();return lt(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),NS=Di([nO,aO]),Sr=U(([n,e])=>{const t=P(e).toVar(),i=_e(n).toVar();return i.shiftLeft(t).bitOr(i.shiftRight(P(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),CS=U(([n,e,t])=>{n.subAssign(t),n.bitXorAssign(Sr(t,P(4))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Sr(n,P(6))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Sr(e,P(8))),e.addAssign(n),n.subAssign(t),n.bitXorAssign(Sr(t,P(16))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Sr(n,P(19))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Sr(e,P(4))),e.addAssign(n)}),gc=U(([n,e,t])=>{const i=_e(t).toVar(),r=_e(e).toVar(),s=_e(n).toVar();return i.bitXorAssign(r),i.subAssign(Sr(r,P(14))),s.bitXorAssign(i),s.subAssign(Sr(i,P(11))),r.bitXorAssign(s),r.subAssign(Sr(s,P(25))),i.bitXorAssign(r),i.subAssign(Sr(r,P(16))),s.bitXorAssign(i),s.subAssign(Sr(i,P(4))),r.bitXorAssign(s),r.subAssign(Sr(s,P(14))),i.bitXorAssign(r),i.subAssign(Sr(r,P(24))),i}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Gi=U(([n])=>{const e=_e(n).toVar();return E(e).div(E(_e(P(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),vn=U(([n])=>{const e=E(n).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),oO=U(([n])=>{const e=P(n).toVar(),t=_e(_e(1)).toVar(),i=_e(_e(P(3735928559)).add(t.shiftLeft(_e(2))).add(_e(13))).toVar();return gc(i.add(_e(e)),i,i)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),lO=U(([n,e])=>{const t=P(e).toVar(),i=P(n).toVar(),r=_e(_e(2)).toVar(),s=_e().toVar(),a=_e().toVar(),o=_e().toVar();return s.assign(a.assign(o.assign(_e(P(3735928559)).add(r.shiftLeft(_e(2))).add(_e(13))))),s.addAssign(_e(i)),a.addAssign(_e(t)),gc(s,a,o)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),cO=U(([n,e,t])=>{const i=P(t).toVar(),r=P(e).toVar(),s=P(n).toVar(),a=_e(_e(3)).toVar(),o=_e().toVar(),l=_e().toVar(),c=_e().toVar();return o.assign(l.assign(c.assign(_e(P(3735928559)).add(a.shiftLeft(_e(2))).add(_e(13))))),o.addAssign(_e(s)),l.addAssign(_e(r)),c.addAssign(_e(i)),gc(o,l,c)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),uO=U(([n,e,t,i])=>{const r=P(i).toVar(),s=P(t).toVar(),a=P(e).toVar(),o=P(n).toVar(),l=_e(_e(4)).toVar(),c=_e().toVar(),u=_e().toVar(),h=_e().toVar();return c.assign(u.assign(h.assign(_e(P(3735928559)).add(l.shiftLeft(_e(2))).add(_e(13))))),c.addAssign(_e(o)),u.addAssign(_e(a)),h.addAssign(_e(s)),CS(c,u,h),c.addAssign(_e(r)),gc(c,u,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),hO=U(([n,e,t,i,r])=>{const s=P(r).toVar(),a=P(i).toVar(),o=P(t).toVar(),l=P(e).toVar(),c=P(n).toVar(),u=_e(_e(5)).toVar(),h=_e().toVar(),d=_e().toVar(),p=_e().toVar();return h.assign(d.assign(p.assign(_e(P(3735928559)).add(u.shiftLeft(_e(2))).add(_e(13))))),h.addAssign(_e(c)),d.addAssign(_e(l)),p.addAssign(_e(o)),CS(h,d,p),h.addAssign(_e(a)),d.addAssign(_e(s)),gc(h,d,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Ct=Di([oO,lO,cO,uO,hO]),dO=U(([n,e])=>{const t=P(e).toVar(),i=P(n).toVar(),r=_e(Ct(i,t)).toVar(),s=lo().toVar();return s.x.assign(r.bitAnd(P(255))),s.y.assign(r.shiftRight(P(8)).bitAnd(P(255))),s.z.assign(r.shiftRight(P(16)).bitAnd(P(255))),s}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),pO=U(([n,e,t])=>{const i=P(t).toVar(),r=P(e).toVar(),s=P(n).toVar(),a=_e(Ct(s,r,i)).toVar(),o=lo().toVar();return o.x.assign(a.bitAnd(P(255))),o.y.assign(a.shiftRight(P(8)).bitAnd(P(255))),o.z.assign(a.shiftRight(P(16)).bitAnd(P(255))),o}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),kr=Di([dO,pO]),mO=U(([n])=>{const e=z(n).toVar(),t=P().toVar(),i=P().toVar(),r=E(kt(e.x,t)).toVar(),s=E(kt(e.y,i)).toVar(),a=E(vn(r)).toVar(),o=E(vn(s)).toVar(),l=E(wS(bi(Ct(t,i),r,s),bi(Ct(t.add(P(1)),i),r.sub(1),s),bi(Ct(t,i.add(P(1))),r,s.sub(1)),bi(Ct(t.add(P(1)),i.add(P(1))),r.sub(1),s.sub(1)),a,o)).toVar();return AS(l)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),fO=U(([n])=>{const e=D(n).toVar(),t=P().toVar(),i=P().toVar(),r=P().toVar(),s=E(kt(e.x,t)).toVar(),a=E(kt(e.y,i)).toVar(),o=E(kt(e.z,r)).toVar(),l=E(vn(s)).toVar(),c=E(vn(a)).toVar(),u=E(vn(o)).toVar(),h=E(ES(bi(Ct(t,i,r),s,a,o),bi(Ct(t.add(P(1)),i,r),s.sub(1),a,o),bi(Ct(t,i.add(P(1)),r),s,a.sub(1),o),bi(Ct(t.add(P(1)),i.add(P(1)),r),s.sub(1),a.sub(1),o),bi(Ct(t,i,r.add(P(1))),s,a,o.sub(1)),bi(Ct(t.add(P(1)),i,r.add(P(1))),s.sub(1),a,o.sub(1)),bi(Ct(t,i.add(P(1)),r.add(P(1))),s,a.sub(1),o.sub(1)),bi(Ct(t.add(P(1)),i.add(P(1)),r.add(P(1))),s.sub(1),a.sub(1),o.sub(1)),l,c,u)).toVar();return NS(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),i0=Di([mO,fO]),gO=U(([n])=>{const e=z(n).toVar(),t=P().toVar(),i=P().toVar(),r=E(kt(e.x,t)).toVar(),s=E(kt(e.y,i)).toVar(),a=E(vn(r)).toVar(),o=E(vn(s)).toVar(),l=D(wS(zr(kr(t,i),r,s),zr(kr(t.add(P(1)),i),r.sub(1),s),zr(kr(t,i.add(P(1))),r,s.sub(1)),zr(kr(t.add(P(1)),i.add(P(1))),r.sub(1),s.sub(1)),a,o)).toVar();return AS(l)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),vO=U(([n])=>{const e=D(n).toVar(),t=P().toVar(),i=P().toVar(),r=P().toVar(),s=E(kt(e.x,t)).toVar(),a=E(kt(e.y,i)).toVar(),o=E(kt(e.z,r)).toVar(),l=E(vn(s)).toVar(),c=E(vn(a)).toVar(),u=E(vn(o)).toVar(),h=D(ES(zr(kr(t,i,r),s,a,o),zr(kr(t.add(P(1)),i,r),s.sub(1),a,o),zr(kr(t,i.add(P(1)),r),s,a.sub(1),o),zr(kr(t.add(P(1)),i.add(P(1)),r),s.sub(1),a.sub(1),o),zr(kr(t,i,r.add(P(1))),s,a,o.sub(1)),zr(kr(t.add(P(1)),i,r.add(P(1))),s.sub(1),a,o.sub(1)),zr(kr(t,i.add(P(1)),r.add(P(1))),s,a.sub(1),o.sub(1)),zr(kr(t.add(P(1)),i.add(P(1)),r.add(P(1))),s.sub(1),a.sub(1),o.sub(1)),l,c,u)).toVar();return NS(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),r0=Di([gO,vO]),yO=U(([n])=>{const e=E(n).toVar(),t=P(ii(e)).toVar();return Gi(Ct(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),xO=U(([n])=>{const e=z(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar();return Gi(Ct(t,i))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),_O=U(([n])=>{const e=D(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar();return Gi(Ct(t,i,r))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),MO=U(([n])=>{const e=ae(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar(),s=P(ii(e.w)).toVar();return Gi(Ct(t,i,r,s))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),bO=Di([yO,xO,_O,MO]),TO=U(([n])=>{const e=E(n).toVar(),t=P(ii(e)).toVar();return D(Gi(Ct(t,P(0))),Gi(Ct(t,P(1))),Gi(Ct(t,P(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),SO=U(([n])=>{const e=z(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar();return D(Gi(Ct(t,i,P(0))),Gi(Ct(t,i,P(1))),Gi(Ct(t,i,P(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),wO=U(([n])=>{const e=D(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar();return D(Gi(Ct(t,i,r,P(0))),Gi(Ct(t,i,r,P(1))),Gi(Ct(t,i,r,P(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),EO=U(([n])=>{const e=ae(n).toVar(),t=P(ii(e.x)).toVar(),i=P(ii(e.y)).toVar(),r=P(ii(e.z)).toVar(),s=P(ii(e.w)).toVar();return D(Gi(Ct(t,i,r,s,P(0))),Gi(Ct(t,i,r,s,P(1))),Gi(Ct(t,i,r,s,P(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),RS=Di([TO,SO,wO,EO]),Nd=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar(),l=E(0).toVar(),c=E(1).toVar();return gt(a,()=>{l.addAssign(c.mul(i0(o))),c.mulAssign(r),o.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IS=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar(),l=D(0).toVar(),c=E(1).toVar();return gt(a,()=>{l.addAssign(c.mul(r0(o))),c.mulAssign(r),o.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),AO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar();return z(Nd(o,a,s,r),Nd(o.add(D(P(19),P(193),P(17))),a,s,r))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),NO=U(([n,e,t,i])=>{const r=E(i).toVar(),s=E(t).toVar(),a=P(e).toVar(),o=D(n).toVar(),l=D(IS(o,a,s,r)).toVar(),c=E(Nd(o.add(D(P(19),P(193),P(17))),a,s,r)).toVar();return ae(l,c)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CO=U(([n,e,t,i,r,s,a])=>{const o=P(a).toVar(),l=E(s).toVar(),c=P(r).toVar(),u=P(i).toVar(),h=P(t).toVar(),d=P(e).toVar(),p=z(n).toVar(),m=D(RS(z(d.add(u),h.add(c)))).toVar(),v=z(m.x,m.y).toVar();v.subAssign(.5),v.mulAssign(l),v.addAssign(.5);const f=z(z(E(d),E(h)).add(v)).toVar(),g=z(f.sub(p)).toVar();return Le(o.equal(P(2)),()=>It(g.x).add(It(g.y))),Le(o.equal(P(3)),()=>ft(It(g.x),It(g.y))),qt(g,g)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),RO=U(([n,e,t,i,r,s,a,o,l])=>{const c=P(l).toVar(),u=E(o).toVar(),h=P(a).toVar(),d=P(s).toVar(),p=P(r).toVar(),m=P(i).toVar(),v=P(t).toVar(),f=P(e).toVar(),g=D(n).toVar(),x=D(RS(D(f.add(p),v.add(d),m.add(h)))).toVar();x.subAssign(.5),x.mulAssign(u),x.addAssign(.5);const y=D(D(E(f),E(v),E(m)).add(x)).toVar(),_=D(y.sub(g)).toVar();return Le(c.equal(P(2)),()=>It(_.x).add(It(_.y)).add(It(_.z))),Le(c.equal(P(3)),()=>ft(ft(It(_.x),It(_.y)),It(_.z))),qt(_,_)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),wo=Di([CO,RO]),IO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=z(n).toVar(),a=P().toVar(),o=P().toVar(),l=z(kt(s.x,a),kt(s.y,o)).toVar(),c=E(1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:u})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:h})=>{const d=E(wo(l,u,h,a,o,r,i)).toVar();c.assign(xi(c,d))})}),Le(i.equal(P(0)),()=>{c.assign(en(c))}),c}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),LO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=z(n).toVar(),a=P().toVar(),o=P().toVar(),l=z(kt(s.x,a),kt(s.y,o)).toVar(),c=z(1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:u})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:h})=>{const d=E(wo(l,u,h,a,o,r,i)).toVar();Le(d.lessThan(c.x),()=>{c.y.assign(c.x),c.x.assign(d)}).ElseIf(d.lessThan(c.y),()=>{c.y.assign(d)})})}),Le(i.equal(P(0)),()=>{c.assign(en(c))}),c}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),PO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=z(n).toVar(),a=P().toVar(),o=P().toVar(),l=z(kt(s.x,a),kt(s.y,o)).toVar(),c=D(1e6,1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:u})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:h})=>{const d=E(wo(l,u,h,a,o,r,i)).toVar();Le(d.lessThan(c.x),()=>{c.z.assign(c.y),c.y.assign(c.x),c.x.assign(d)}).ElseIf(d.lessThan(c.y),()=>{c.z.assign(c.y),c.y.assign(d)}).ElseIf(d.lessThan(c.z),()=>{c.z.assign(d)})})}),Le(i.equal(P(0)),()=>{c.assign(en(c))}),c}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=D(n).toVar(),a=P().toVar(),o=P().toVar(),l=P().toVar(),c=D(kt(s.x,a),kt(s.y,o),kt(s.z,l)).toVar(),u=E(1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:h})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:d})=>{gt({start:-1,end:P(1),name:"z",condition:"<="},({z:p})=>{const m=E(wo(c,h,d,p,a,o,l,r,i)).toVar();u.assign(xi(u,m))})})}),Le(i.equal(P(0)),()=>{u.assign(en(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UO=Di([IO,DO]),OO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=D(n).toVar(),a=P().toVar(),o=P().toVar(),l=P().toVar(),c=D(kt(s.x,a),kt(s.y,o),kt(s.z,l)).toVar(),u=z(1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:h})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:d})=>{gt({start:-1,end:P(1),name:"z",condition:"<="},({z:p})=>{const m=E(wo(c,h,d,p,a,o,l,r,i)).toVar();Le(m.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(m)}).ElseIf(m.lessThan(u.y),()=>{u.y.assign(m)})})})}),Le(i.equal(P(0)),()=>{u.assign(en(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),FO=Di([LO,OO]),VO=U(([n,e,t])=>{const i=P(t).toVar(),r=E(e).toVar(),s=D(n).toVar(),a=P().toVar(),o=P().toVar(),l=P().toVar(),c=D(kt(s.x,a),kt(s.y,o),kt(s.z,l)).toVar(),u=D(1e6,1e6,1e6).toVar();return gt({start:-1,end:P(1),name:"x",condition:"<="},({x:h})=>{gt({start:-1,end:P(1),name:"y",condition:"<="},({y:d})=>{gt({start:-1,end:P(1),name:"z",condition:"<="},({z:p})=>{const m=E(wo(c,h,d,p,a,o,l,r,i)).toVar();Le(m.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(m)}).ElseIf(m.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(m)}).ElseIf(m.lessThan(u.z),()=>{u.z.assign(m)})})})}),Le(i.equal(P(0)),()=>{u.assign(en(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),BO=Di([PO,VO]),zO=U(([n])=>{const e=n.y,t=n.z,i=D().toVar();return Le(e.lessThan(1e-4),()=>{i.assign(D(t,t,t))}).Else(()=>{let r=n.x;r=r.sub(cs(r)).mul(6).toVar();const s=P(If(r)),a=r.sub(E(s)),o=t.mul(e.oneMinus()),l=t.mul(e.mul(a).oneMinus()),c=t.mul(e.mul(a.oneMinus()).oneMinus());Le(s.equal(P(0)),()=>{i.assign(D(t,c,o))}).ElseIf(s.equal(P(1)),()=>{i.assign(D(l,t,o))}).ElseIf(s.equal(P(2)),()=>{i.assign(D(o,t,c))}).ElseIf(s.equal(P(3)),()=>{i.assign(D(o,l,t))}).ElseIf(s.equal(P(4)),()=>{i.assign(D(c,o,t))}).Else(()=>{i.assign(D(t,o,l))})}),i}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),kO=U(([n])=>{const e=D(n).toVar(),t=E(e.x).toVar(),i=E(e.y).toVar(),r=E(e.z).toVar(),s=E(xi(t,xi(i,r))).toVar(),a=E(ft(t,ft(i,r))).toVar(),o=E(a.sub(s)).toVar(),l=E().toVar(),c=E().toVar(),u=E().toVar();return u.assign(a),Le(a.greaterThan(0),()=>{c.assign(o.div(a))}).Else(()=>{c.assign(0)}),Le(c.lessThanEqual(0),()=>{l.assign(0)}).Else(()=>{Le(t.greaterThanEqual(a),()=>{l.assign(i.sub(r).div(o))}).ElseIf(i.greaterThanEqual(a),()=>{l.assign(zt(2,r.sub(t).div(o)))}).Else(()=>{l.assign(zt(4,t.sub(i).div(o)))}),l.mulAssign(1/6),Le(l.lessThan(0),()=>{l.addAssign(1)})}),D(l,c,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),HO=U(([n])=>{const e=D(n).toVar(),t=mf(Ef(e,D(.04045))).toVar(),i=D(e.div(12.92)).toVar(),r=D(Ji(ft(e.add(D(.055)),D(0)).div(1.055),D(2.4))).toVar();return rt(i,r,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),LS=(n,e)=>{n=E(n),e=E(e);const t=z(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return Ki(n.sub(t),n.add(t),e)},PS=(n,e,t,i)=>rt(n,e,t[i].clamp()),GO=(n,e,t=nt())=>PS(n,e,t,"x"),WO=(n,e,t=nt())=>PS(n,e,t,"y"),DS=(n,e,t,i,r)=>rt(n,e,LS(t,i[r])),jO=(n,e,t,i=nt())=>DS(n,e,t,i,"x"),XO=(n,e,t,i=nt())=>DS(n,e,t,i,"y"),qO=(n=1,e=0,t=nt())=>t.mul(n).add(e),YO=(n,e=1)=>(n=E(n),n.abs().pow(e).mul(n.sign())),$O=(n,e=1,t=.5)=>E(n).sub(t).mul(e).add(t),JO=(n=nt(),e=1,t=0)=>i0(n.convert("vec2|vec3")).mul(e).add(t),KO=(n=nt(),e=1,t=0)=>r0(n.convert("vec2|vec3")).mul(e).add(t),ZO=(n=nt(),e=1,t=0)=>(n=n.convert("vec2|vec3"),ae(r0(n),i0(n.add(z(19,73)))).mul(e).add(t)),QO=(n=nt(),e=1)=>UO(n.convert("vec2|vec3"),e,P(1)),eF=(n=nt(),e=1)=>FO(n.convert("vec2|vec3"),e,P(1)),tF=(n=nt(),e=1)=>BO(n.convert("vec2|vec3"),e,P(1)),iF=(n=nt())=>bO(n.convert("vec2|vec3")),rF=(n=nt(),e=3,t=2,i=.5,r=1)=>Nd(n,P(e),t,i).mul(r),nF=(n=nt(),e=3,t=2,i=.5,r=1)=>AO(n,P(e),t,i).mul(r),sF=(n=nt(),e=3,t=2,i=.5,r=1)=>IS(n,P(e),t,i).mul(r),aF=(n=nt(),e=3,t=2,i=.5,r=1)=>NO(n,P(e),t,i).mul(r),US=U(([n,e])=>{const t=n.x,i=n.y,r=n.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(2*.511664).mul(i)),s=s.add(e.element(2).mul(2*.511664).mul(r)),s=s.add(e.element(3).mul(2*.511664).mul(t)),s=s.add(e.element(4).mul(2*.429043).mul(t).mul(i)),s=s.add(e.element(5).mul(2*.429043).mul(i).mul(r)),s=s.add(e.element(6).mul(r.mul(r).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(2*.429043).mul(t).mul(r)),s=s.add(e.element(8).mul(.429043).mul(lt(t,t).sub(lt(i,i)))),s});class OS extends ms{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=fe(0).setGroup(xt),this.decayExponentNode=fe(0).setGroup(xt)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setup(e){const{colorNode:t,cutoffDistanceNode:i,decayExponentNode:r,light:s}=this,a=e.context.lightingModel,o=wd(s).sub(Pi),l=o.normalize(),c=o.length(),u=Jg({lightDistance:c,cutoffDistance:i,decayExponent:r}),h=t.mul(u),d=e.context.reflectedLight;a.direct({lightDirection:l,lightColor:h,reflectedLight:d},e.stack,e)}}class FS extends ms{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,i=this.colorNode,r=Qg(this.light),s=e.context.reflectedLight;t.direct({lightDirection:r,lightColor:i,reflectedLight:s},e.stack,e)}}const n0=new Re,Cd=new Re;let vc=null;class VS extends ms{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=fe(new N).setGroup(xt),this.halfWidth=fe(new N).setGroup(xt)}update(e){super.update(e);const{light:t}=this,i=e.camera.matrixWorldInverse;Cd.identity(),n0.copy(t.matrixWorld),n0.premultiply(i),Cd.extractRotation(n0),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(Cd),this.halfHeight.value.applyMatrix4(Cd)}setup(e){super.setup(e);let t,i;e.isAvailable("float32Filterable")?(t=yt(vc.LTC_FLOAT_1),i=yt(vc.LTC_FLOAT_2)):(t=yt(vc.LTC_HALF_1),i=yt(vc.LTC_HALF_2));const{colorNode:r,light:s}=this,a=e.context.lightingModel,o=wd(s),l=e.context.reflectedLight;a.directRectArea({lightColor:r,lightPosition:o,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:l,ltc_1:t,ltc_2:i},e.stack,e)}static setLTC(e){vc=e}}class s0 extends ms{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=fe(0).setGroup(xt),this.penumbraCosNode=fe(0).setGroup(xt),this.cutoffDistanceNode=fe(0).setGroup(xt),this.decayExponentNode=fe(0).setGroup(xt)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:i}=this;return Ki(t,i,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:i,cutoffDistanceNode:r,decayExponentNode:s,light:a}=this,o=wd(a).sub(Pi),l=o.normalize(),c=l.dot(Qg(a)),u=this.getSpotAttenuation(c),h=o.length(),d=Jg({lightDistance:h,cutoffDistance:r,decayExponent:s}),p=i.mul(u).mul(d),m=e.context.reflectedLight;t.direct({lightDirection:l,lightColor:p,reflectedLight:m},e.stack,e)}}class BS extends s0{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let i=null;if(t&&t.isTexture===!0){const r=e.acos().mul(1/Math.PI);i=yt(t,z(r,0),0).r}else i=super.getSpotAttenuation(e);return i}}class zS extends ms{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class kS extends ms{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=Zg(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=fe(new xe).setGroup(xt)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:i,lightDirectionNode:r}=this,s=hr.dot(r).mul(.5).add(.5),a=rt(i,t,s);e.context.irradiance.addAssign(a)}}class HS extends ms{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let i=0;i<9;i++)t.push(new N);this.lightProbe=mn(t)}update(e){const{light:t}=this;super.update(e);for(let i=0;i<9;i++)this.lightProbe.array[i].copy(t.sh.coefficients[i]).multiplyScalar(t.intensity)}setup(e){const t=US(qh,this.lightProbe);e.context.irradiance.addAssign(t)}}class oF{parseFunction(){console.warn("Abstract function.")}}class GS{constructor(e,t,i="",r=""){this.type=e,this.inputs=t,this.name=i,this.precision=r}getCode(){console.warn("Abstract function.")}}GS.isNodeFunction=!0;const lF=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,cF=/[a-z_0-9]+/ig,WS="#pragma main",uF=n=>{n=n.trim();const e=n.indexOf(WS),t=e!==-1?n.slice(e+WS.length):n,i=t.match(lF);if(i!==null&&i.length===5){const r=i[4],s=[];let a=null;for(;(a=cF.exec(r))!==null;)s.push(a);const o=[];let l=0;for(;l<s.length;){const m=s[l][0]==="const";m===!0&&l++;let v=s[l][0];v==="in"||v==="out"||v==="inout"?l++:v="";const f=s[l++][0];let g=Number.parseInt(s[l][0]);Number.isNaN(g)===!1?l++:g=null;const x=s[l++][0];o.push(new Bg(f,x,g,v,m))}const c=t.substring(i[0].length),u=i[3]!==void 0?i[3]:"",h=i[2],d=i[1]!==void 0?i[1]:"",p=e!==-1?n.slice(0,e):"";return{type:h,inputs:o,name:u,precision:d,inputsCode:r,blockCode:c,headerCode:p}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class hF extends GS{constructor(e){const{type:t,inputs:i,name:r,precision:s,inputsCode:a,blockCode:o,headerCode:l}=uF(e);super(t,i,r,s),this.inputsCode=a,this.blockCode=o,this.headerCode=l}getCode(e=this.name){let t;const i=this.blockCode;if(i!==""){const{type:r,inputsCode:s,headerCode:a,precision:o}=this;let l=`${r} ${e} ( ${s.trim()} )`;o!==""&&(l=`${o} ${l}`),t=a+l+i}else t="";return t}}class jS extends oF{parseFunction(e){return new hF(e)}}class dF{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const i=this.getMaterialNodeClass(e.type);if(i!==null){t=new i;for(const r in e)t[r]=e[r]}return t}addColorSpace(e,t){this.addType(e,t,this.colorSpaceNodes)}getColorSpaceFunction(e){return this.colorSpaceNodes.get(e)||null}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t.name,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,i){if(i.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);i.set(t,e)}addClass(e,t,i){if(i.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);i.set(t,e)}}class pF extends Cl{constructor(e,t,i,r,s,a){super(e,t,i,r,s,a),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class XS extends dF{constructor(){super(),this.addLight(OS,yh),this.addLight(FS,xh),this.addLight(VS,Vm),this.addLight(s0,Cl),this.addLight(zS,_h),this.addLight(kS,vh),this.addLight(HS,Bm),this.addLight(BS,pF),this.addToneMapping(xS,Nc),this.addToneMapping(_S,Cc),this.addToneMapping(MS,Qd),this.addToneMapping(bS,Rc),this.addToneMapping(TS,Ic),this.addToneMapping(SS,Lc),this.addColorSpace(yS,Hh(nr,Fi)),this.addColorSpace(vS,Hh(Fi,nr))}}if(typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Vn}})),typeof window<"u"){try{import.meta&&(window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:import.meta.url,revision:Vn}))}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Vn),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Vn}const mF=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Rc,AONode:Yb,AddEquation:Bn,AddOperation:Zd,AdditiveAnimationBlendMode:lp,AdditiveBlending:No,AfterImageNode:DT,AgXToneMapping:Ic,AlphaFormat:ip,AlwaysCompare:ov,AlwaysDepth:Ro,AlwaysStencilFunc:ou,AmbientLight:_h,AmbientLightNode:zS,AnaglyphPassNode:rS,AnalyticLightNode:ms,AnamorphicNode:FT,AnimationAction:yx,AnimationClip:no,AnimationLoader:DI,AnimationMixer:xx,AnimationObjectGroup:QI,AnimationUtils:RI,ArcCurve:Py,ArrayCamera:$p,ArrayElementNode:as,ArrowHelper:p2,AssignNode:p_,AttachedBindMode:ep,AttributeNode:Gf,Audio:Gm,AudioAnalyser:GI,AudioContext:Th,AudioListener:mx,AudioLoader:cx,AxesHelper:zx,BRDF_GGX:mg,BRDF_Lambert:sa,BackSide:si,BasicDepthPacking:cp,BasicEnvironmentNode:rd,BasicNodeLibrary:XS,BasicShadowMap:ew,BatchNode:Vb,BatchedMesh:lm,BloomNode:JT,Bone:Wu,BooleanKeyframeTrack:Gs,Box2:s2,Box3:Bi,Box3Helper:Vx,BoxGeometry:yn,BoxHelper:Fx,Break:td,BufferAttribute:wt,BufferAttributeNode:bM,BufferGeometry:ct,BufferGeometryLoader:nx,BufferNode:$h,BumpMapNode:nb,BypassNode:AM,ByteType:Uc,Cache:Rn,CacheNode:EM,Camera:ul,CameraHelper:Ox,CanvasTexture:Ly,CapsuleGeometry:Id,CatmullRomCurve3:Dy,CineonToneMapping:Qd,CircleGeometry:Ld,ClampToEdgeWrapping:gr,Clock:Hm,CodeNode:Rg,Color:xe,ColorKeyframeTrack:fh,ColorManagement:vt,ColorSpaceNode:Yl,CompressedArrayTexture:Ry,CompressedCubeTexture:Iy,CompressedTexture:_l,CompressedTextureLoader:UI,ComputeNode:SM,ConeGeometry:Pd,ConstNode:Fr,ConstantAlphaFactor:P0,ConstantColorFactor:I0,ContextNode:Of,Continue:TL,Controls:Hx,ConvertNode:af,CubeCamera:Cu,CubeReflectionMapping:fr,CubeRefractionMapping:Ar,CubeTexture:Is,CubeTextureLoader:OI,CubeTextureNode:JM,CubeUVReflectionMapping:xs,CubicBezierCurve:ym,CubicBezierCurve3:Oy,CubicInterpolant:$y,CullFaceBack:Wd,CullFaceFront:y0,CullFaceFrontBack:QS,CullFaceNone:v0,Curve:Or,CurvePath:Vy,CustomBlending:$d,CustomToneMapping:U0,CylinderGeometry:ma,Cylindrical:n2,DFGApprox:fg,D_GGX:d1,Data3DTexture:hu,DataArrayTexture:rl,DataTexture:Ur,DataTextureLoader:Zy,DataUtils:wv,DecrementStencilOp:j0,DecrementWrapStencilOp:q0,DefaultLoadingManager:Dm,DenoiseNode:qT,DepthFormat:Xn,DepthOfFieldNode:BT,DepthStencilFormat:qn,DepthTexture:Fs,DetachedBindMode:O0,DirectionalLight:xh,DirectionalLightHelper:Ux,DirectionalLightNode:FS,Discard:LM,DiscreteInterpolant:Jy,DisplayP3ColorSpace:Jo,DodecahedronGeometry:Dd,DotScreenNode:zT,DoubleSide:Gr,DstAlphaFactor:E0,DstColorFactor:N0,DynamicCopyUsage:dw,DynamicDrawUsage:Ss,DynamicReadUsage:cw,EPSILON:P_,EdgesGeometry:Sm,EllipseCurve:eh,EnvironmentNode:V1,EqualCompare:rv,EqualDepth:Lo,EqualStencilFunc:K0,EquirectUVNode:s1,EquirectangularReflectionMapping:kn,EquirectangularRefractionMapping:Hn,Euler:dr,EventDispatcher:vr,ExpressionNode:IM,ExtrudeGeometry:_c,FXAANode:YT,F_Schlick:yo,FileLoader:Kr,FilmNode:HT,Float16BufferAttribute:Ev,Float32BufferAttribute:De,FloatType:Oi,Fn:U,Fog:Kp,FogExp2:Rd,FogExp2Node:uS,FogNode:bd,FogRangeNode:cS,FramebufferTexture:pm,FrontFacingNode:kM,FrontSide:an,Frustum:Ha,FunctionCallNode:f_,FunctionNode:Ig,FunctionOverloadingNode:hT,GLBufferAttribute:r2,GLSL1:mw,GLSL3:lu,GLSLNodeParser:jS,GTAONode:XT,GaussianBlurNode:LT,GreaterCompare:nv,GreaterDepth:Do,GreaterEqualCompare:av,GreaterEqualDepth:Po,GreaterEqualStencilFunc:tv,GreaterStencilFunc:Q0,GridHelper:Lx,Group:Vs,HalfFloatType:wi,HemisphereLight:vh,HemisphereLightHelper:u2,HemisphereLightNode:kS,IESSpotLightNode:BS,INFINITY:V2,IcosahedronGeometry:Ud,If:Le,ImageBitmapLoader:lx,ImageLoader:Nl,ImageUtils:mv,IncrementStencilOp:W0,IncrementWrapStencilOp:X0,IndexNode:Bt,InstanceNode:Ob,InstancedBufferAttribute:Nn,InstancedBufferGeometry:zm,InstancedInterleavedBuffer:Xm,InstancedMesh:nm,InstancedPointsNodeMaterial:VL,Int16BufferAttribute:Zw,Int32BufferAttribute:Qw,Int8BufferAttribute:$w,IntType:Ms,InterleavedBuffer:Xa,InterleavedBufferAttribute:On,Interpolant:eo,InterpolateDiscrete:Ta,InterpolateLinear:Yo,InterpolateSmooth:su,InvertStencilOp:Y0,IrradianceNode:Kb,JoinNode:Xx,KeepStencilOp:Yn,KeyframeTrack:Jr,LOD:em,LatheGeometry:xc,Layers:al,LessCompare:dp,LessDepth:Io,LessEqualCompare:pp,LessEqualDepth:zn,LessEqualStencilFunc:Z0,LessStencilFunc:J0,Light:ns,LightProbe:Bm,LightProbeNode:HS,LightingContextNode:$b,LightingModel:hc,LightingNode:na,LightsNode:Xb,Line:Cn,Line2NodeMaterial:WL,Line3:Ax,LineBasicMaterial:Ni,LineBasicNodeMaterial:zL,LineCurve:xm,LineCurve3:Fy,LineDashedMaterial:mh,LineDashedNodeMaterial:HL,LineLoop:um,LineSegments:$r,LinearDisplayP3ColorSpace:Sa,LinearFilter:Lt,LinearInterpolant:Pm,LinearMipMapLinearFilter:F0,LinearMipMapNearestFilter:rw,LinearMipmapLinearFilter:ji,LinearMipmapNearestFilter:Wn,LinearSRGBColorSpace:nr,LinearToneMapping:Nc,LinearTransfer:Ko,Loader:Hi,LoaderUtils:Mh,LoadingManager:gh,Loop:gt,LoopNode:Hb,LoopOnce:ap,LoopPingPong:V0,LoopRepeat:op,LuminanceAlphaFormat:np,LuminanceFormat:Bc,Lut3DNode:GT,MOUSE:f0,MRTNode:uT,MatcapUVNode:H1,Material:hi,MaterialLoader:Tc,MaterialNode:Z,MaterialReferenceNode:KM,MathUtils:cu,Matrix2:a0,Matrix3:Ke,Matrix4:Re,MaxEquation:Jd,MaxMipLevelNode:OM,Mesh:Ft,MeshBasicMaterial:Yr,MeshBasicNodeMaterial:QL,MeshDepthMaterial:Fu,MeshDistanceMaterial:qp,MeshLambertMaterial:ph,MeshLambertNodeMaterial:nP,MeshMatcapMaterial:Rm,MeshMatcapNodeMaterial:HP,MeshNormalMaterial:dh,MeshNormalNodeMaterial:qL,MeshPhongMaterial:hh,MeshPhongNodeMaterial:aP,MeshPhysicalMaterial:uh,MeshPhysicalNodeMaterial:k1,MeshSSSNodeMaterial:OP,MeshStandardMaterial:Al,MeshStandardNodeMaterial:z1,MeshToonMaterial:Cm,MeshToonNodeMaterial:zP,MinEquation:M0,MirroredRepeatWrapping:va,MixOperation:Kd,ModelNode:tn,ModelViewProjectionNode:Pb,MorphNode:Wb,MultiplyBlending:Yd,MultiplyOperation:ga,NearestFilter:$t,NearestMipMapLinearFilter:iw,NearestMipMapNearestFilter:tw,NearestMipmapLinearFilter:Mn,NearestMipmapNearestFilter:Dc,NeutralToneMapping:Lc,NeverCompare:iv,NeverDepth:Co,NeverStencilFunc:$0,NoBlending:Er,NoColorSpace:Cr,NoToneMapping:mr,Node:qe,NodeAttribute:Ag,NodeBuilder:lT,NodeCache:hd,NodeCode:K1,NodeFrame:cT,NodeFunctionInput:Bg,NodeLoader:q1,NodeMaterial:bt,NodeMaterialLoader:Y1,NodeMaterialObserver:Gx,NodeObjectLoader:ZP,NodeShaderStage:tf,NodeType:v2,NodeUniform:$1,NodeUpdateType:je,NodeUtils:g2,NodeVar:Ng,NodeVarying:J1,NormalAnimationBlendMode:au,NormalBlending:_n,NormalMapNode:rb,NotEqualCompare:sv,NotEqualDepth:Uo,NotEqualStencilFunc:ev,NumberKeyframeTrack:to,Object3D:_t,Object3DNode:St,ObjectLoader:sx,ObjectSpaceNormalMap:hp,OctahedronGeometry:Eo,OneFactor:T0,OneMinusConstantAlphaFactor:D0,OneMinusConstantColorFactor:L0,OneMinusDstAlphaFactor:A0,OneMinusDstColorFactor:C0,OneMinusSrcAlphaFactor:Ac,OneMinusSrcColorFactor:w0,OrthographicCamera:Ds,OscNode:gi,OutputStructNode:zg,P3Primaries:Qo,PCFShadowMap:jd,PCFSoftShadowMap:Xd,PI:ta,PI2:B2,PMREMGenerator:Gp,PMREMNode:U1,ParallaxBarrierPassNode:nS,ParameterNode:Cg,PassNode:Ti,Path:Tl,PerspectiveCamera:di,PhongLightingModel:dg,PhysicalLightingModel:ad,PixelationPassNode:ZT,Plane:ln,PlaneGeometry:pa,PlaneHelper:d2,PointLight:yh,PointLightHelper:l2,PointLightNode:OS,PointUVNode:MT,Points:dm,PointsMaterial:Za,PointsNodeMaterial:WP,PolarGridHelper:h2,PolyhedronGeometry:fs,PositionalAudio:gx,PosterizeNode:ET,PropertyBinding:Tt,PropertyMixer:vx,PropertyNode:Et,QuadraticBezierCurve:_m,QuadraticBezierCurve3:Mm,Quaternion:qi,QuaternionKeyframeTrack:io,QuaternionLinearInterpolant:Ky,RED_GREEN_RGTC2_Format:ru,RED_RGTC1_Format:sp,REVISION:Vn,RGBADepthPacking:up,RGBAFormat:Ei,RGBAIntegerFormat:Vo,RGBA_ASTC_10x10_Format:Kc,RGBA_ASTC_10x5_Format:Yc,RGBA_ASTC_10x6_Format:$c,RGBA_ASTC_10x8_Format:Jc,RGBA_ASTC_12x10_Format:Zc,RGBA_ASTC_12x12_Format:Qc,RGBA_ASTC_4x4_Format:Xo,RGBA_ASTC_5x4_Format:Hc,RGBA_ASTC_5x5_Format:Gc,RGBA_ASTC_6x5_Format:Wc,RGBA_ASTC_6x6_Format:qo,RGBA_ASTC_8x5_Format:jc,RGBA_ASTC_8x6_Format:Xc,RGBA_ASTC_8x8_Format:qc,RGBA_BPTC_Format:ba,RGBA_ETC2_EAC_Format:jo,RGBA_PVRTC_2BPPV1_Format:kc,RGBA_PVRTC_4BPPV1_Format:Ho,RGBA_S3TC_DXT1_Format:_a,RGBA_S3TC_DXT3_Format:zo,RGBA_S3TC_DXT5_Format:Ma,RGBDepthPacking:sw,RGBFormat:rp,RGBIntegerFormat:nw,RGBShiftNode:kT,RGB_BPTC_SIGNED_Format:eu,RGB_BPTC_UNSIGNED_Format:tu,RGB_ETC1_Format:Go,RGB_ETC2_Format:Wo,RGB_PVRTC_2BPPV1_Format:zc,RGB_PVRTC_4BPPV1_Format:ko,RGB_S3TC_DXT1_Format:Bo,RGDepthPacking:aw,RGFormat:xa,RGIntegerFormat:Fo,RTTNode:yT,RangeNode:hS,RawShaderMaterial:Nm,Ray:Cs,Raycaster:bx,Rec709Primaries:Zo,RectAreaLight:Vm,RectAreaLightNode:VS,RedFormat:Oo,RedIntegerFormat:ya,ReferenceNode:Ql,ReflectorNode:vT,ReinhardToneMapping:Cc,RemapNode:Hf,RenderOutputNode:PM,RenderTarget:ui,RendererReferenceNode:vM,RepeatWrapping:Gn,ReplaceStencilOp:G0,Return:W2,ReverseSubtractEquation:_0,RingGeometry:Mc,RotateNode:W1,SIGNED_RED_GREEN_RGTC2_Format:nu,SIGNED_RED_RGTC1_Format:iu,SRGBColorSpace:Fi,SRGBTransfer:Ot,SSAAPassNode:QT,Scene:Vu,SceneNode:sn,Schlick_to_F0:m1,ScreenNode:ri,ScriptableNode:lS,ScriptableValueNode:aS,SetNode:qx,ShaderChunk:dt,ShaderLib:Dr,ShaderMaterial:Pr,ShaderNode:Dl,ShadowMaterial:ch,ShadowNodeMaterial:$P,Shape:rs,ShapeGeometry:Od,ShapePath:kx,ShapeUtils:nn,ShortType:Oc,Skeleton:yc,SkeletonHelper:o2,SkinnedMesh:rm,SkinningNode:ng,SobelOperatorNode:VT,Source:$n,Sphere:Ai,SphereGeometry:Ao,Spherical:Sx,SphericalHarmonics3:rx,SplineCurve:bm,SplitNode:Rh,SpotLight:Cl,SpotLightHelper:a2,SpotLightNode:s0,Sprite:Qp,SpriteMaterial:dl,SpriteNodeMaterial:XP,SpriteSheetUVNode:dT,SrcAlphaFactor:Ec,SrcAlphaSaturateFactor:R0,SrcColorFactor:S0,StackNode:Q1,StaticCopyUsage:hw,StaticDrawUsage:wa,StaticReadUsage:lw,StereoCamera:km,StereoPassNode:eS,StorageArrayElementNode:pT,StorageBufferNode:qg,StorageTextureNode:TT,StreamCopyUsage:pw,StreamDrawUsage:ow,StreamReadUsage:uw,StringKeyframeTrack:Ws,SubtractEquation:x0,SubtractiveBlending:qd,TBNViewMatrix:ra,TOUCH:g0,TangentSpaceNormalMap:on,TempNode:pt,TetrahedronGeometry:Fd,Texture:Wt,Texture3DNode:j1,TextureLoader:Qy,TextureNode:dn,TextureSizeNode:UM,TextureUtils:UR,TimerNode:Si,ToneMappingNode:xM,ToonOutlinePassNode:sS,TorusGeometry:bc,TorusKnotGeometry:Vd,TransitionNode:KT,Triangle:er,TriangleFanDrawMode:k0,TriangleStripDrawMode:z0,TrianglesDrawMode:B0,TriplanarTexturesNode:mT,TubeGeometry:Bd,UVMapping:Pc,Uint16BufferAttribute:Mu,Uint32BufferAttribute:Pp,Uint8BufferAttribute:Jw,Uint8ClampedBufferAttribute:Kw,Uniform:_x,UniformArrayNode:Yf,UniformGroupNode:ff,UniformNode:Ks,UniformsGroup:i2,UniformsLib:Me,UniformsUtils:Op,UnsignedByteType:Wr,UnsignedInt248Type:jn,UnsignedInt5999Type:tp,UnsignedIntType:Nr,UnsignedShort4444Type:Fc,UnsignedShort5551Type:Vc,UnsignedShortType:_s,UserDataNode:wT,VSMShadowMap:rr,V_GGX_SmithCorrelated:h1,VarNode:uM,VaryingNode:hM,Vector2:J,Vector3:N,Vector4:st,VectorKeyframeTrack:ro,VertexColorNode:_T,VideoTexture:Cy,ViewportDepthNode:Qi,ViewportDepthTextureNode:t1,ViewportSharedTextureNode:AT,ViewportTextureNode:lc,VolumeNodeMaterial:KP,WebGL3DRenderTarget:Bw,WebGLArrayRenderTarget:Vw,WebGLCoordinateSystem:Rr,WebGLCubeRenderTarget:Ru,WebGLMultipleRenderTargets:m2,WebGLRenderTarget:Ir,WebGLRenderer:ly,WebGLUtils:oy,WebGPUCoordinateSystem:ws,WireframeGeometry:Am,WrapAroundEnding:$o,ZeroCurvatureEnding:bs,ZeroFactor:b0,ZeroSlopeEnding:Ts,ZeroStencilOp:H0,abs:It,acesFilmicToneMapping:bS,acos:zh,add:zt,addMethodChaining:te,addNodeElement:j2,afterImage:oD,agxToneMapping:TS,all:Af,alphaT:Oh,anaglyphPass:GD,anamorphic:pD,and:b_,anisotropy:ls,anisotropyB:Qs,anisotropyT:zl,any:D_,ao:TD,append:t_,arrayBuffer:D2,asin:z_,assign:m_,atan:k_,atan2:J_,atomicAdd:kU,atomicAnd:jU,atomicFunc:Un,atomicMax:GU,atomicMin:WU,atomicOr:XU,atomicStore:zU,atomicSub:HU,atomicXor:qU,attenuationColor:Tf,attenuationDistance:bf,attribute:_i,backgroundBlurriness:$3,backgroundIntensity:J3,batch:Bb,billboarding:dU,bitAnd:E_,bitNot:A_,bitOr:N_,bitXor:C_,bitangentGeometry:hL,bitangentLocal:dL,bitangentView:QM,bitangentWorld:pL,bitcast:z2,bleach:MU,bloom:LD,blur:P1,bool:os,buffer:Zl,bufferAttribute:$l,bumpMap:sb,burn:gU,bvec2:n_,bvec3:mf,bvec4:l_,bypass:NM,cache:Jl,call:g_,cameraFar:ho,cameraLogDepth:VM,cameraNear:uo,cameraNormalMatrix:$2,cameraPosition:Wf,cameraProjectionMatrix:lr,cameraProjectionMatrixInverse:q2,cameraViewMatrix:cr,cameraWorldMatrix:Y2,cbrt:rM,ceil:Rf,checker:YU,cineonToneMapping:MS,clamp:li,clearcoat:Ph,clearcoatRoughness:Bl,code:dd,color:i_,colorSpaceToWorking:zf,colorToDirection:jL,compute:wM,cond:lM,context:Ff,convert:u_,convertToTexture:Zi,cos:br,createCanvasElement:uv,cross:co,cubeTexture:Yh,dFdx:W_,dFdy:j_,dashSize:ea,defaultBuildStages:nf,defaultShaderStages:rf,defined:Pl,degrees:F_,denoise:ED,densityFog:JD,depth:ug,depthPass:sD,difference:Q_,diffuseColor:Nt,directionToColor:n1,dispersion:Sf,distance:Z_,div:Qr,dodge:vU,dof:fD,dot:qt,dotScreen:gD,drawIndex:Ub,dynamicBufferAttribute:TM,element:c_,emissive:vf,equal:v_,equals:U_,equirectUV:hg,exp:Nf,exp2:Bh,expression:hs,faceDirection:Kl,faceForward:sM,film:yD,float:E,floor:cs,fog:YD,fract:us,frameGroup:O2,frameId:D3,frontFacing:HM,fwidth:Y_,fxaa:AD,gain:aU,gapSize:Hl,gaussianBlur:aD,getColorSpaceMethod:Hh,getConstNodeType:e_,getCurrentStack:pf,getDirection:I1,getDistanceAttenuation:Jg,getGeometryRoughness:u1,getRoughness:pg,getShIrradianceAt:US,getTextureIndex:kg,global:Md,glsl:r3,glslFn:n3,grayscale:lD,greaterThan:Ef,greaterThanEqual:M_,hash:sU,highPrecisionModelNormalViewMatrix:aL,highPrecisionModelViewMatrix:sL,hue:hD,instance:Fb,instanceIndex:nc,instancedBufferAttribute:Gh,instancedDynamicBufferAttribute:kf,int:P,inverseSqrt:V_,invocationLocalIndex:ML,invocationSubgroupIndex:_L,ior:Gl,iridescence:Uh,iridescenceIOR:yf,iridescenceThickness:xf,ivec2:un,ivec3:s_,ivec4:a_,js:t3,label:cM,length:ia,lengthSq:Pf,lessThan:x_,lessThanEqual:__,lightPosition:Zg,lightTargetDirection:Qg,lightTargetPosition:dS,lightViewPosition:wd,lightingContext:Jb,lights:qb,linearDepth:id,linearSRGBTosRGB:yS,linearToneMapping:xS,localId:RU,log:Cf,log2:Wl,loop:SL,luminance:Ui,lut3D:xD,mat2:Fl,mat3:yi,mat4:Js,matcapUV:G1,materialAOMap:Lb,materialAlphaTest:ob,materialAnisotropy:Mb,materialAnisotropyVector:fo,materialAttenuationColor:Cb,materialAttenuationDistance:Nb,materialClearcoat:fb,materialClearcoatNormal:vb,materialClearcoatRoughness:gb,materialColor:mo,materialDispersion:Ib,materialEmissive:cb,materialIOR:Ab,materialIridescence:bb,materialIridescenceIOR:Tb,materialIridescenceThickness:Sb,materialLightMap:ig,materialLineDashOffset:tg,materialLineDashSize:Qf,materialLineGapSize:eg,materialLineScale:Qh,materialLineWidth:ed,materialMetalness:pb,materialNormal:mb,materialOpacity:Kh,materialPointWidth:Rb,materialReference:rn,materialReflectivity:Zh,materialRefractionRatio:jM,materialRotation:yb,materialRoughness:db,materialSheen:xb,materialSheenRoughness:_b,materialShininess:lb,materialSpecular:ub,materialSpecularColor:hb,materialSpecularIntensity:Zf,materialSpecularStrength:rc,materialThickness:Eb,materialTransmission:wb,max:ft,maxMipLevel:FM,metalness:Vl,min:xi,mix:rt,mixElement:aM,mod:kh,modInt:wf,modelDirection:tL,modelNormalMatrix:BM,modelPosition:iL,modelScale:rL,modelViewMatrix:pn,modelViewPosition:nL,modelViewProjection:rg,modelWorldMatrix:Br,modelWorldMatrixInverse:zM,morphReference:jb,motionBlur:_U,mrt:gd,mul:lt,mx_aastep:LS,mx_cell_noise_float:iF,mx_contrast:$O,mx_fractal_noise_float:rF,mx_fractal_noise_vec2:nF,mx_fractal_noise_vec3:sF,mx_fractal_noise_vec4:aF,mx_hsvtorgb:zO,mx_noise_float:JO,mx_noise_vec3:KO,mx_noise_vec4:ZO,mx_ramplr:GO,mx_ramptb:WO,mx_rgbtohsv:kO,mx_safepower:YO,mx_splitlr:jO,mx_splittb:XO,mx_srgb_texture_to_lin_rec709:HO,mx_transform_uv:qO,mx_worley_noise_float:QO,mx_worley_noise_vec2:eF,mx_worley_noise_vec3:tF,negate:H_,neutralToneMapping:SS,nodeArray:$s,nodeImmutable:ge,nodeObject:G,nodeObjects:Ul,nodeProxy:K,normalFlat:GM,normalGeometry:Xh,normalLocal:ur,normalMap:Kf,normalView:hr,normalWorld:qh,normalize:Mr,not:S_,notEqual:y_,numWorkgroups:NU,objectDirection:J2,objectGroup:d_,objectPosition:Z2,objectScale:Q2,objectViewPosition:eL,objectWorldMatrix:K2,oneMinus:G_,or:T_,orthographicDepthToViewZ:PL,oscSawtooth:V3,oscSine:U3,oscSquare:O3,oscTriangle:F3,output:_f,outputStruct:R3,overlay:xU,overloadingFn:Di,parabola:e0,parallaxBarrierPass:WD,parallaxDirection:tb,parallaxUV:fL,parameter:e3,pass:nD,passTexture:To,pcurve:oU,perspectiveDepthToViewZ:cg,pixelationPass:OD,pmremTexture:O1,pointUV:Y3,pointWidth:F2,positionGeometry:Li,positionLocal:Zt,positionPrevious:Wh,positionView:Pi,positionViewDirection:Vt,positionWorld:jh,positionWorldDirection:jf,posterize:tD,pow:Ji,pow2:Lf,pow3:eM,pow4:tM,property:ar,radians:O_,rand:Uf,range:KD,rangeFog:$D,reciprocal:q_,reference:fi,referenceBuffer:$f,reflect:K_,reflectVector:YM,reflectView:XM,reflector:G3,refract:Df,refractVector:$M,refractView:qM,reinhardToneMapping:_S,remainder:L_,remap:CM,remapClamp:RM,renderGroup:xt,renderOutput:DM,rendererReference:yM,rgbShift:vD,rotate:Eg,rotateUV:uU,roughness:hn,round:X_,rtt:xT,sRGBToLinearSRGB:vS,sampler:X2,saturate:nM,saturation:cD,screen:yU,screenCoordinate:vo,screenSize:go,screenUV:ps,scriptable:qD,scriptableValue:_d,select:Ri,sepia:bU,setCurrentStack:Ol,shaderStages:sf,sharedUniformGroup:gf,sheen:Zs,sheenRoughness:Dh,shiftLeft:R_,shiftRight:I_,shininess:Fh,sign:jl,sin:Ci,sinc:lU,skinning:bL,skinningReference:kb,smoothstep:Ki,smoothstepElement:oM,sobel:mD,specularColor:or,specularF90:kl,spherizeUV:hU,split:U2,spritesheetUV:B3,sqrt:en,ssaaPass:BD,stack:pd,step:Xl,stereoPass:kD,storage:K3,storageBarrier:DU,storageObject:Z3,storageTexture:ST,string:P2,sub:Pt,subgroupIndex:xL,subgroupSize:IU,tan:B_,tangentGeometry:Jh,tangentLocal:ec,tangentView:tc,tangentWorld:ZM,temp:Vf,texture:yt,texture3D:X1,textureBarrier:UU,textureBicubic:T1,textureCubeUV:L1,textureLoad:Vr,textureSize:ds,textureStore:Q3,thickness:Mf,threshold:UT,timerDelta:P3,timerGlobal:L3,timerLocal:Hg,toOutputColorSpace:pM,toWorkingColorSpace:mM,toneMapping:_M,toneMappingExposure:MM,toonOutlinePass:jD,transformDirection:iM,transformNormal:WM,transformNormalToView:qf,transformedBentNormalView:ib,transformedBitangentView:eb,transformedBitangentWorld:mL,transformedClearcoatNormalView:po,transformedNormalView:Yt,transformedNormalWorld:Xf,transformedTangentView:Jf,transformedTangentWorld:uL,transition:PD,transmission:Vh,transpose:$_,tri:gn,tri3:pS,triNoise3D:cU,triplanarTexture:k3,triplanarTextures:fT,trunc:If,tslFn:L2,uint:_e,uniform:fe,uniformArray:mn,uniformGroup:h_,uniforms:lL,userData:eD,uv:nt,uvec2:r_,uvec3:lo,uvec4:o_,varying:Ii,varyingProperty:Zr,vec2:z,vec3:D,vec4:ae,vectorComponents:so,velocity:fU,vertexColor:q3,vertexIndex:Db,vibrance:uD,viewZToOrthographicDepth:cc,viewZToPerspectiveDepth:i1,viewport:Pn,viewportBottomLeft:IL,viewportCoordinate:Qb,viewportDepthTexture:lg,viewportLinearDepth:DL,viewportMipTexture:e1,viewportResolution:CL,viewportSafeUV:pU,viewportSharedTexture:iD,viewportSize:Zb,viewportTexture:LL,viewportTopLeft:RL,viewportUV:NL,wgsl:i3,wgslFn:s3,workgroupArray:VU,workgroupBarrier:PU,workgroupId:CU,workingToColorSpace:fM,xor:w_},Symbol.toStringTag,{value:"Module"}));export{rm as $,zx as A,ct as B,Hm as C,Gr as D,dr as E,Kp as F,Lx as G,Cn as H,wt as I,ma as J,Sm as K,al as L,Ft as M,$r as N,_t as O,pa as P,qi as Q,Cs as R,Ai as S,Wt as T,_x as U,N as V,ly as W,Ni as X,ln as Y,bx as Z,$p as _,Qy as a,Lo as a$,On as a0,yc as a1,Wu as a2,$n as a3,Ru as a4,Cu as a5,no as a6,Tt as a7,nr as a8,dt as a9,Jd as aA,_h as aB,vh as aC,Y0 as aD,q0 as aE,X0 as aF,j0 as aG,W0 as aH,G0 as aI,H0 as aJ,Yn as aK,ou as aL,tv as aM,ev as aN,Q0 as aO,Z0 as aP,K0 as aQ,J0 as aR,$0 as aS,Nm as aT,lu as aU,Ro as aV,Po as aW,Do as aX,zn as aY,Io as aZ,Uo as a_,Me as aa,Kr as ab,Ur as ac,Ei as ad,kn as ae,Fi as af,mr as ag,Xd as ah,XS as ai,Ir as aj,Fs as ak,$t as al,op as am,ap as an,xx as ao,_l as ap,an as aq,Ha as ar,Ds as as,mx as at,gx as au,cx as av,vr as aw,si as ax,Fu as ay,$d as az,Re as b,nm as b$,lm as b0,uh as b1,Wr as b2,Lt as b3,Mc as b4,Ax as b5,No as b6,Fx as b7,Cl as b8,Ux as b9,jn as bA,Nr as bB,Vn as bC,Cr as bD,Bc as bE,Gn as bF,Oi as bG,hu as bH,gr as bI,up as bJ,gh as bK,ji as bL,Hi as bM,Co as bN,Oo as bO,xa as bP,Xn as bQ,qe as bR,cT as bS,lT as bT,jS as bU,hr as bV,rf as bW,B0 as bX,k0 as bY,z0 as bZ,Mh as b_,Ox as ba,em as bb,er as bc,_n as bd,Lc as be,Ic as bf,Rc as bg,Cc as bh,Nc as bi,wi as bj,Cy as bk,Is as bl,Iy as bm,Hn as bn,ro as bo,io as bp,Gm as bq,va as br,Op as bs,Dr as bt,dh as bu,Th as bv,ul as bw,cp as bx,Er as by,qn as bz,Bi as c,Nn as c0,lx as c1,Xa as c2,Za as c3,um as c4,dm as c5,Yo as c6,vt as c7,Dc as c8,Wn as c9,ph as cA,Mu as cB,nn as cC,Dm as cD,f0 as cE,g0 as cF,Sx as cG,Ly as cH,zm as cI,Xm as cJ,Am as cK,fh as cL,Ss as cM,Ms as cN,_s as cO,Uc as cP,Oc as cQ,Vo as cR,Fo as cS,ya as cT,Mn as ca,Ta as cb,to as cc,eo as cd,Ry as ce,Xo as cf,ba as cg,jo as ch,Ho as ci,Ma as cj,Go as ck,Wo as cl,ko as cm,_a as cn,Jo as co,Sa as cp,qo as cq,kx as cr,De as cs,Eo as ct,bc as cu,Hx as cv,Zy as cw,wv as cx,Or as cy,hh as cz,Al as d,mF as e,J as f,st as g,di as h,Vu as i,Pr as j,xe as k,ch as l,Vx as m,hi as n,Ke as o,cu as p,Yr as q,Vs as r,Ao as s,yn as t,dl as u,Qp as v,rs as w,_c as x,xh as y,yh as z};