diff --git a/example/bundle/assets/B3DMLoader-s-i-FwTx.js b/example/bundle/assets/B3DMLoader-s-i-FwTx.js new file mode 100644 index 00000000..70a30990 --- /dev/null +++ b/example/bundle/assets/B3DMLoader-s-i-FwTx.js @@ -0,0 +1 @@ +import{r as B,F as m,B as y}from"./readMagicBytes-Da5ueiou.js";import{L}from"./LoaderBase-CVSPpjX2.js";import{j as w,bm as x}from"./three.module-_fL2BuBc.js";import{G as U}from"./GLTFLoader-CFm4138C.js";class C extends L{parse(s){const t=new DataView(s),T=B(t);console.assert(T==="b3dm");const u=t.getUint32(4,!0);console.assert(u===1);const h=t.getUint32(8,!0);console.assert(h===s.byteLength);const o=t.getUint32(12,!0),a=t.getUint32(16,!0),n=t.getUint32(20,!0),r=t.getUint32(24,!0),b=28,e=s.slice(b,b+o+a),g=new m(e,0,o,a),c=b+o+a,i=s.slice(c,c+n+r),l=new y(i,g.getData("BATCH_LENGTH"),0,n,r),f=c+n+r,d=new Uint8Array(s,f,h-f);return{version:u,featureTable:g,batchTable:l,glbBytes:d}}}class j extends C{constructor(s=x){super(),this.manager=s,this.adjustmentTransform=new w}parse(s){const t=super.parse(s),T=t.glbBytes.slice().buffer;return new Promise((u,h)=>{const o=this.manager,a=this.fetchOptions,n=o.getHandler("path.gltf")||new U(o);a.credentials==="include"&&a.mode==="cors"&&n.setCrossOrigin("use-credentials"),"credentials"in a&&n.setWithCredentials(a.credentials==="include"),a.headers&&n.setRequestHeader(a.headers);let r=this.workingPath;!/[\\/]$/.test(r)&&r.length&&(r+="/");const b=this.adjustmentTransform;n.parse(T,r,e=>{const{batchTable:g,featureTable:c}=t,{scene:i}=e,l=c.getData("RTC_CENTER");l&&(i.position.x+=l[0],i.position.y+=l[1],i.position.z+=l[2]),e.scene.updateMatrix(),e.scene.matrix.multiply(b),e.scene.matrix.decompose(e.scene.position,e.scene.quaternion,e.scene.scale),e.batchTable=g,e.featureTable=c,i.batchTable=g,i.featureTable=c,u(e)},h)})}}export{j as B}; diff --git a/example/bundle/assets/CMPTLoader-DW6cWF_V.js b/example/bundle/assets/CMPTLoader-DW6cWF_V.js new file mode 100644 index 00000000..4876dead --- /dev/null +++ b/example/bundle/assets/CMPTLoader-DW6cWF_V.js @@ -0,0 +1 @@ +import{j as g,bm as w,G as L}from"./three.module-_fL2BuBc.js";import{L as P}from"./LoaderBase-CVSPpjX2.js";import{r as d}from"./readMagicBytes-Da5ueiou.js";import{B as T}from"./B3DMLoader-s-i-FwTx.js";import{P as b}from"./PNTSLoader-ClFH5U_K.js";import{W as y,I as M}from"./I3DMLoader-QCOT_FZM.js";class k extends P{parse(s){const n=new DataView(s),h=d(n);console.assert(h==="cmpt",'CMPTLoader: The magic bytes equal "cmpt".');const p=n.getUint32(4,!0);console.assert(p===1,'CMPTLoader: The version listed in the header is "1".');const l=n.getUint32(8,!0);console.assert(l===s.byteLength,"CMPTLoader: The contents buffer length listed in the header matches the file.");const c=n.getUint32(12,!0),i=[];let o=16;for(let r=0;r{const o=new L;return i.forEach(r=>{o.add(r.scene)}),{tiles:i,scene:o}})}}export{V as C}; diff --git a/example/bundle/assets/CameraTransition-CM6KQSA4.js b/example/bundle/assets/CameraTransition-CM6KQSA4.js new file mode 100644 index 00000000..dd5bfbb0 --- /dev/null +++ b/example/bundle/assets/CameraTransition-CM6KQSA4.js @@ -0,0 +1 @@ +import{u as P,r as o,g as b,a as R,h as W,j as r,i as _}from"./extends-BiwV-o27.js";import{S as F,O as D,k as L,j as z,aK as A,an as O}from"./three.module-_fL2BuBc.js";import{c as k}from"./EnvironmentControls-CJG7lPg-.js";import{C as G}from"./CameraTransitionManager-CKH8Mdl-.js";const h=new L,C=new L,v=new L,y=new z,S=new z,M=new z,E=new O,w={};function q(s,f,a,i){S.copy(a.matrixWorld).invert(),E.origin.copy(s.position),E.direction.set(0,0,-1).transformDirection(s.matrixWorld),E.applyMatrix4(S),k(E,f,v),v.applyMatrix4(a.matrixWorld),C.set(0,0,-1).transformDirection(s.matrixWorld);const m=v.sub(s.position).dot(C);return i.copy(s.position).addScaledVector(C,m),i}function B(s){const{defaultScene:f,defaultCamera:a,overrideRenderLoop:i=!0,renderPriority:m=1}=s,n=o.useMemo(()=>new D,[]),[x,p,l,u]=P(c=>[c.set,c.size,c.gl,c.scene]);o.useEffect(()=>{x({camera:n})},[x,n]),o.useEffect(()=>{n.left=-p.width/2,n.right=p.width/2,n.top=p.height/2,n.bottom=-p.height/2,n.near=0,n.far=2e3,n.position.z=n.far/2,n.updateProjectionMatrix()},[n,p]),R(()=>{i&&l.render(f,a);const c=l.autoClear;l.autoClear=!1,l.clearDepth(),l.render(u,n),l.autoClear=c},m)}function T(){const s=o.useRef();return o.useEffect(()=>{const a=s.current.attributes.position;for(let i=0,m=a.count;i0&&(h.x=0,a.setXYZ(i,...h))}),r.jsx("boxGeometry",{ref:s})}function V({northColor:s=15684432,southColor:f=16777215}){const[a,i]=o.useState(),m=o.useRef();return o.useEffect(()=>{i(m.current)},[]),r.jsxs("group",{scale:.5,ref:m,children:[r.jsx("ambientLight",{intensity:1}),r.jsx("directionalLight",{position:[0,2,3],intensity:3,target:a}),r.jsx("directionalLight",{position:[0,-2,-3],intensity:3,target:a}),r.jsxs("mesh",{children:[r.jsx("sphereGeometry",{}),r.jsx("meshBasicMaterial",{color:0,opacity:.3,transparent:!0,side:A})]}),r.jsxs("group",{scale:[.5,1,.15],children:[r.jsxs("mesh",{"position-y":.5,children:[r.jsx(T,{}),r.jsx("meshStandardMaterial",{color:s})]}),r.jsxs("mesh",{"position-y":-.5,"rotation-x":Math.PI,children:[r.jsx(T,{}),r.jsx("meshStandardMaterial",{color:f})]})]})]})}function Z({children:s,overrideRenderLoop:f,mode:a="3d",margin:i=10,scale:m=35,visible:n=!0,...x}){const[p,l,u]=P(t=>[t.camera,t.scene,t.size]),c=o.useContext(b),g=o.useRef(null),e=o.useMemo(()=>new F,[]);return R(()=>{if(c===null||g.current===null)return null;const{ellipsoid:t}=c,d=g.current;if(y.copy(c.group.matrixWorld).invert(),q(p,t,c.group,v).applyMatrix4(y),t.getPositionToCartographic(v,w),t.getRotationMatrixFromAzElRoll(w.lat,w.lon,0,0,0,M).premultiply(c.group.matrixWorld),M.invert(),y.copy(p.matrixWorld).premultiply(M),a.toLowerCase()==="3d")d.quaternion.setFromRotationMatrix(y).invert();else if(h.set(0,1,0).transformDirection(y).normalize(),h.z=0,h.normalize(),h.length()===0)d.quaternion.identity();else{const j=C.set(0,1,0).angleTo(h);C.cross(h).normalize(),d.quaternion.setFromAxisAngle(C,-j)}}),s||(s=r.jsx(V,{})),n?W(r.jsxs(r.Fragment,{children:[r.jsx("group",{ref:g,scale:m,position:[u.width/2-i-m/2,-u.height/2+i+m/2,0],...x,children:s}),r.jsx(B,{defaultCamera:p,defaultScene:l,overrideRenderLoop:f,renderPriority:10})]}),e,{events:{priority:10}}):null}const H=o.forwardRef(function(f,a){const{mode:i="perspective",perspectiveCamera:m,orthographicCamera:n,...x}=f,[p,l,u,c,g]=P(t=>[t.set,t.invalidate,t.controls,t.camera,t.size]),e=o.useMemo(()=>{const t=new G;return t.autoSync=!1,c.isOrthographicCamera?(t.orthographicCamera.copy(c),t.mode="orthographic"):t.perspectiveCamera.copy(c),t.syncCameras(),t.mode=i,t},[]);o.useEffect(()=>{const{perspectiveCamera:t,orthographicCamera:d}=e,j=g.width/g.height;t.aspect=j,t.updateProjectionMatrix(),d.left=-d.top*j,d.right=-d.left,t.updateProjectionMatrix()},[e,g]),o.useEffect(()=>{a&&(a instanceof Function?a(e):a.current=e)},[e,a]),o.useEffect(()=>{const t=({camera:d})=>{p(()=>({camera:d}))};return p(()=>({camera:e.camera})),e.addEventListener("camera-change",t),()=>{e.removeEventListener("camera-change",t)}},[e,p]),o.useEffect(()=>{const t=e.perspectiveCamera,d=e.orthographicCamera;return e.perspectiveCamera=m||t,e.orthographicCamera=n||d,p(()=>({camera:e.camera})),()=>{e.perspectiveCamera=t,e.orthographicCamera=d}},[m,n,e,p]),o.useEffect(()=>{i!==e.mode&&(u&&u.isEnvironmentControls?(u.getPivotPoint(e.fixedPoint),e.syncCameras(),u.adjustCamera(e.perspectiveCamera),u.adjustCamera(e.orthographicCamera)):(e.fixedPoint.set(0,0,-1).transformDirection(e.camera.matrixWorld).multiplyScalar(50).add(e.camera.position),e.syncCameras()),e.toggle(),l())},[i,e,l,u]),o.useEffect(()=>{const t=()=>l();return e.addEventListener("transition-start",t),e.addEventListener("change",t),e.addEventListener("transition-end",t),()=>{e.removeEventListener("transition-start",t),e.removeEventListener("change",t),e.removeEventListener("transition-end",t)}},[e,l]),_(e,x),R(()=>{e.update(),u&&(u.enabled=!e.animating),e.animating&&l()},-1)});export{Z as C,H as a}; diff --git a/example/bundle/assets/CameraTransitionManager-CKH8Mdl-.js b/example/bundle/assets/CameraTransitionManager-CKH8Mdl-.js new file mode 100644 index 00000000..6000f8c8 --- /dev/null +++ b/example/bundle/assets/CameraTransitionManager-CKH8Mdl-.js @@ -0,0 +1 @@ +import{k as g,O as y,aE as M,a as v,s as x,i as h}from"./three.module-_fL2BuBc.js";const e=new g,s=new g,d=new y,P=new g;class T extends M{get animating(){return this._alpha!==0&&this._alpha!==1}get camera(){return this._alpha===0?this.perspectiveCamera:this._alpha===1?this.orthographicCamera:this.transitionCamera}get mode(){return this._target===0?"perspective":"orthographic"}set mode(o){if(o===this.mode)return;const a=this.camera;o==="perspective"?(this._target=0,this._alpha=0):(this._target=1,this._alpha=1),this.dispatchEvent({type:"camera-change",camera:this.camera,prevCamera:a})}constructor(o=new v,a=new y){super(),this.perspectiveCamera=o,this.orthographicCamera=a,this.transitionCamera=new v,this.orthographicPositionalZoom=!0,this.orthographicOffset=50,this.fixedPoint=new g,this.duration=200,this.autoSync=!0,this._target=0,this._alpha=0,this._clock=new x}toggle(){this._target=this._target===1?0:1,this._clock.getDelta()}update(){this.autoSync&&this.syncCameras();const{perspectiveCamera:o,orthographicCamera:a,transitionCamera:t,camera:p}=this,m=this._clock.getDelta()*1e3;if(this._alpha!==this._target){const n=Math.sign(this._target-this._alpha)*m/this.duration;this._alpha=h.clamp(this._alpha+n,0,1),this.dispatchEvent({type:"change"})}const c=p;let i=null;this._alpha===0?i=o:this._alpha===1?i=a:(i=t,this._updateTransitionCamera()),c!==i&&(i===t&&this.dispatchEvent({type:"transition-start"}),this.dispatchEvent({type:"camera-change",camera:i,prevCamera:c}),c===t&&this.dispatchEvent({type:"transition-end"}))}syncCameras(){const o=this._getFromCamera(),{perspectiveCamera:a,orthographicCamera:t,transitionCamera:p,fixedPoint:r}=this;if(e.set(0,0,-1).transformDirection(o.matrixWorld).normalize(),o.isPerspectiveCamera){if(this.orthographicPositionalZoom)t.position.copy(a.position).addScaledVector(e,-this.orthographicOffset),t.rotation.copy(a.rotation),t.updateMatrixWorld();else{const l=s.subVectors(r,t.position).dot(e),n=s.subVectors(r,a.position).dot(e);s.copy(a.position).addScaledVector(e,n),t.rotation.copy(a.rotation),t.position.copy(s).addScaledVector(e,-l),t.updateMatrixWorld()}const m=Math.abs(s.subVectors(a.position,r).dot(e)),c=2*Math.tan(h.DEG2RAD*a.fov*.5)*m,i=t.top-t.bottom;t.zoom=i/c,t.updateProjectionMatrix()}else{const m=Math.abs(s.subVectors(t.position,r).dot(e)),i=(t.top-t.bottom)/t.zoom*.5/Math.tan(h.DEG2RAD*a.fov*.5);a.rotation.copy(t.rotation),a.position.copy(t.position).addScaledVector(e,m).addScaledVector(e,-i),a.updateMatrixWorld(),this.orthographicPositionalZoom&&(t.position.copy(a.position).addScaledVector(e,-this.orthographicOffset),t.updateMatrixWorld())}p.position.copy(a.position),p.rotation.copy(a.rotation)}_getTransitionDirection(){return Math.sign(this._target-this._alpha)}_getToCamera(){const o=this._getTransitionDirection();return o===0?this._target===0?this.perspectiveCamera:this.orthographicCamera:o>0?this.orthographicCamera:this.perspectiveCamera}_getFromCamera(){const o=this._getTransitionDirection();return o===0?this._target===0?this.perspectiveCamera:this.orthographicCamera:o>0?this.perspectiveCamera:this.orthographicCamera}_updateTransitionCamera(){const{perspectiveCamera:o,orthographicCamera:a,transitionCamera:t,fixedPoint:p}=this,r=this._alpha;e.set(0,0,-1).transformDirection(a.matrixWorld).normalize(),d.copy(a),d.position.addScaledVector(e,a.near),a.far-=a.near,a.near=0,e.set(0,0,-1).transformDirection(o.matrixWorld).normalize();const m=Math.abs(s.subVectors(o.position,p).dot(e)),c=2*Math.tan(h.DEG2RAD*o.fov*.5)*m,i=h.lerp(o.fov,1,r),l=c*.5/Math.tan(h.DEG2RAD*i*.5),n=P.lerpVectors(o.position,d.position,r);n.addScaledVector(e,Math.abs(s.subVectors(n,p).dot(e))-l);const C=s.subVectors(o.position,n).dot(e),f=s.subVectors(d.position,n).dot(e),_=h.lerp(C+o.near,f+d.near,r),u=h.lerp(C+o.far,f+d.far,r),D=Math.max(u,0)-Math.max(_,0);t.aspect=o.aspect,t.fov=i,t.near=Math.max(_,D*1e-5),t.far=u,t.position.copy(n),t.rotation.copy(o.rotation),t.updateProjectionMatrix(),t.updateMatrixWorld()}}export{T as C}; diff --git a/example/bundle/assets/CesiumIonAuthPlugin-3uWD2B4J.js b/example/bundle/assets/CesiumIonAuthPlugin-3uWD2B4J.js new file mode 100644 index 00000000..0f903543 --- /dev/null +++ b/example/bundle/assets/CesiumIonAuthPlugin-3uWD2B4J.js @@ -0,0 +1 @@ +import{G as o}from"./GoogleCloudAuthPlugin-BapiqItz.js";class l{constructor({apiToken:e,assetId:i=null,autoRefreshToken:t=!1}){this.name="CESIUM_ION_AUTH_PLUGIN",this.apiToken=e,this.assetId=i,this.autoRefreshToken=t,this.tiles=null,this.endpointURL=null,this._bearerToken=null,this._tileSetVersion=-1,this._tokenRefreshPromise=null,this._attributions=[]}init(e){this.assetId!==null&&(e.rootURL=`https://api.cesium.com/v1/assets/${this.assetId}/endpoint`),this.tiles=e,this.endpointURL=e.rootURL,e.resetFailedTiles()}loadRootTileSet(){return this._refreshToken().then(()=>this.tiles.loadRootTileSet())}preprocessURL(e){return e=new URL(e),/^http/.test(e.protocol)&&this._tileSetVersion!=-1&&e.searchParams.append("v",this._tileSetVersion),e.toString()}fetchData(e,i){return this.tiles.getPluginByName("GOOGLE_CLOUD_AUTH_PLUGIN")!==null?null:Promise.resolve().then(async()=>{this._tokenRefreshPromise!==null&&(await this._tokenRefreshPromise,e=this.preprocessURL(e));const s=await fetch(e,i);return s.status>=400&&s.status<=499&&this.autoRefreshToken?(await this._refreshToken(i),fetch(this.preprocessURL(e),i)):s})}getAttributions(e){this.tiles.visibleTiles.size>0&&e.push(...this._attributions)}_refreshToken(e){if(this._tokenRefreshPromise===null){const i=new URL(this.endpointURL);i.searchParams.append("access_token",this.apiToken),this._tokenRefreshPromise=fetch(i,e).then(t=>{if(!t.ok)throw new Error(`CesiumIonAuthPlugin: Failed to load data with error code ${t.status}`);return t.json()}).then(t=>{const s=this.tiles;if("externalType"in t){const r=new URL(t.options.url);s.rootURL=t.options.url,s.registerPlugin(new o({apiToken:r.searchParams.get("key")}))}else{if(s.rootURL=t.url,s.fetchOptions.headers=s.fetchOptions.headers||{},s.fetchOptions.headers.Authorization=`Bearer ${t.accessToken}`,i.searchParams.has("v")&&this._tileSetVersion===-1){const r=new URL(t.url);this._tileSetVersion=r.searchParams.get("v")}this._bearerToken=t.accessToken,t.attributions&&(this._attributions=t.attributions.map(r=>({value:r.html,type:"html",collapsible:r.collapsible})))}return this._tokenRefreshPromise=null,t})}return this._tokenRefreshPromise}}export{l as C}; diff --git a/example/bundle/assets/DRACOLoader-BZaFS3O1.js b/example/bundle/assets/DRACOLoader-BZaFS3O1.js new file mode 100644 index 00000000..67518673 --- /dev/null +++ b/example/bundle/assets/DRACOLoader-BZaFS3O1.js @@ -0,0 +1,2 @@ +import{t as C,F as L,a2 as _,a3 as P,ah as D,ai as T,C as R,aY as I}from"./three.module-_fL2BuBc.js";const w=new WeakMap;class x extends C{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,o,s,r){const n=new L(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,t=>{this.parse(t,o,r)},s,r)}parse(e,o,s=()=>{}){this.decodeDracoFile(e,o,null,null,_,s).catch(s)}decodeDracoFile(e,o,s,r,n=P,t=()=>{}){const i={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:n};return this.decodeGeometry(e,i).then(o).catch(t)}decodeGeometry(e,o){const s=JSON.stringify(o);if(w.has(e)){const a=w.get(e);if(a.key===s)return a.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const n=this.workerNextTaskID++,t=e.byteLength,i=this._getWorker(n,t).then(a=>(r=a,new Promise((h,d)=>{r._callbacks[n]={resolve:h,reject:d},r.postMessage({type:"decode",id:n,taskConfig:o,buffer:e},[e])}))).then(a=>this._createGeometry(a.geometry));return i.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),w.set(e,{key:s,promise:i}),i}_createGeometry(e){const o=new D;e.index&&o.setIndex(new T(e.index.array,1));for(let s=0;s{s.load(e,r,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",o=[];return e?o.push(this._loadLibrary("draco_decoder.js","text")):(o.push(this._loadLibrary("draco_wasm_wrapper.js","text")),o.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(o).then(s=>{const r=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const n=S.toString(),t=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([t]))}),this.decoderPending}_getWorker(e,o){return this._initDecoder().then(()=>{if(this.workerPool.lengthn._taskLoad?-1:1});const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=o,s._taskLoad+=o,s})}_releaseTask(e,o){e._taskLoad-=e._taskCosts[o],delete e._callbacks[o],delete e._taskCosts[o]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const u=d.draco,c=new u.Decoder;try{const l=o(u,c,new Int8Array(a),h),f=l.attributes.map(y=>y.array.buffer);l.index&&f.push(l.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:l},f)}catch(l){console.error(l),self.postMessage({type:"error",id:i.id,error:l.message})}finally{u.destroy(c)}});break}};function o(t,i,a,h){const d=h.attributeIDs,u=h.attributeTypes;let c,l;const f=i.GetEncodedGeometryType(a);if(f===t.TRIANGULAR_MESH)c=new t.Mesh,l=i.DecodeArrayToMesh(a,a.byteLength,c);else if(f===t.POINT_CLOUD)c=new t.PointCloud,l=i.DecodeArrayToPointCloud(a,a.byteLength,c);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!l.ok()||c.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const y={index:null,attributes:[]};for(const p in d){const m=self[u[p]];let g,b;if(h.useUniqueIDs)b=d[p],g=i.GetAttributeByUniqueId(c,b);else{if(b=i.GetAttributeId(c,t[d[p]]),b===-1)continue;g=i.GetAttribute(c,b)}const A=r(t,i,c,p,m,g);p==="color"&&(A.vertexColorSpace=h.vertexColorSpace),y.attributes.push(A)}return f===t.TRIANGULAR_MESH&&(y.index=s(t,i,c)),t.destroy(c),y}function s(t,i,a){const d=a.num_faces()*3,u=d*4,c=t._malloc(u);i.GetTrianglesUInt32Array(a,u,c);const l=new Uint32Array(t.HEAPF32.buffer,c,d).slice();return t._free(c),{array:l,itemSize:1}}function r(t,i,a,h,d,u){const c=u.num_components(),f=a.num_points()*c,y=f*d.BYTES_PER_ELEMENT,p=n(t,d),m=t._malloc(y);i.GetAttributeDataArrayForAllPoints(a,u,p,y,m);const g=new d(t.HEAPF32.buffer,m,f).slice();return t._free(m),{name:h,array:g,itemSize:c}}function n(t,i){switch(i){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32}}}export{x as D}; diff --git a/example/bundle/assets/DebugTilesPlugin-Bz8-pW4a.js b/example/bundle/assets/DebugTilesPlugin-Bz8-pW4a.js new file mode 100644 index 00000000..d1a69148 --- /dev/null +++ b/example/bundle/assets/DebugTilesPlugin-Bz8-pW4a.js @@ -0,0 +1 @@ +import{G as b,af as H,M as S,f as A,d as O,C as I}from"./three.module-_fL2BuBc.js";import{S as N,a as k}from"./EllipsoidRegionHelper-B2BBEUen.js";const x=Symbol("ORIGINAL_MATERIAL"),M=Symbol("HAS_RANDOM_COLOR"),C=Symbol("HAS_RANDOM_NODE_COLOR"),E=Symbol("LOAD_TIME"),T=new O,G=()=>{},R={};function v(p){if(!R[p]){const r=Math.random(),e=.5+Math.random()*.5,t=.375+Math.random()*.25;R[p]=new I().setHSL(r,e,t)}return R[p]}const _=0,w=1,P=2,U=3,W=4,F=5,V=6,L=7,B=8,z=9,y=10;class J{constructor(r){r={displayBoxBounds:!1,displaySphereBounds:!1,displayRegionBounds:!1,colorMode:_,maxDebugDepth:-1,maxDebugDistance:-1,maxDebugError:-1,customColorCallback:null,...r},this.name="DEBUG_TILES_PLUGIN",this.tiles=null,this.extremeDebugDepth=-1,this.extremeDebugError=-1,this.boxGroup=null,this.sphereGroup=null,this.regionGroup=null,this.displayBoxBounds=r.displayBoxBounds,this.displaySphereBounds=r.displaySphereBounds,this.displayRegionBounds=r.displayRegionBounds,this.colorMode=r.colorMode,this.maxDebugDepth=r.maxDebugDepth,this.maxDebugDistance=r.maxDebugDistance,this.maxDebugError=r.maxDebugError,this.customColorCallback=r.customColorCallback,this.getDebugColor=(e,t)=>{t.setRGB(e,e,e)}}init(r){this.tiles=r;const e=r.group;this.boxGroup=new b,this.boxGroup.name="DebugTilesRenderer.boxGroup",e.add(this.boxGroup),this.boxGroup.updateMatrixWorld(),this.sphereGroup=new b,this.sphereGroup.name="DebugTilesRenderer.sphereGroup",e.add(this.sphereGroup),this.sphereGroup.updateMatrixWorld(),this.regionGroup=new b,this.regionGroup.name="DebugTilesRenderer.regionGroup",e.add(this.regionGroup),this.regionGroup.updateMatrixWorld(),this._onLoadTileSetCB=()=>{this._initExtremes()},this._onLoadModelCB=({scene:t,tile:a})=>{this._onLoadModel(t,a)},this._onDisposeModelCB=({tile:t})=>{this._onDisposeModel(t)},this._onUpdateAfterCB=()=>{this._onUpdateAfter()},this._onTileVisibilityChangeCB=({scene:t,tile:a,visible:h})=>{this._onTileVisibilityChange(a,h)},r.addEventListener("load-tile-set",this._onLoadTileSetCB),r.addEventListener("load-model",this._onLoadModelCB),r.addEventListener("dispose-model",this._onDisposeModelCB),r.addEventListener("update-after",this._onUpdateAfterCB),r.addEventListener("tile-visibility-change",this._onTileVisibilityChangeCB),r.traverse(t=>{t.cached.scene&&this._onLoadModel(t.cached.scene,t)}),r.visibleTiles.forEach(t=>{this._onTileVisibilityChange(t,!0)})}getTileInformationFromActiveObject(r){let e=null;return this.tiles.activeTiles.forEach(a=>{if(e)return!0;const h=a.cached.scene;h&&h.traverse(n=>{n===r&&(e=a)})}),e?{distanceToCamera:e.__distanceFromCamera,geometricError:e.geometricError,screenSpaceError:e.__error,depth:e.__depth,isLeaf:e.__isLeaf}:null}_initExtremes(){let r=-1;this.tiles.traverse(t=>{r=Math.max(r,t.__depth)});let e=-1;this.tiles.traverse(t=>{e=Math.max(e,t.geometricError)}),this.extremeDebugDepth=r,this.extremeDebugError=e}_onUpdateAfter(){const r=this.tiles;if(!r.root)return;this.boxGroup.visible=this.displayBoxBounds,this.sphereGroup.visible=this.displaySphereBounds,this.regionGroup.visible=this.displayRegionBounds;let e=-1;this.maxDebugDepth===-1?e=this.extremeDebugDepth:e=this.maxDebugDepth;let t=-1;this.maxDebugError===-1?t=this.extremeDebugError:t=this.maxDebugError;let a=-1;this.maxDebugDistance===-1?(r.getBoundingSphere(T),a=T.radius):a=this.maxDebugDistance;const h=this.errorTarget,n=this.colorMode,d=r.visibleTiles;let o;n===y&&(o=Array.from(d).sort((s,D)=>s[E]-D[E])),d.forEach(s=>{const D=s.cached.scene;let u,c,m;n===L&&(u=Math.random(),c=.5+Math.random()*.5,m=.375+Math.random()*.25),D.traverse(i=>{n===B&&(u=Math.random(),c=.5+Math.random()*.5,m=.375+Math.random()*.25);const f=i.material;if(f){const g=i[x];if(n===_&&f!==g)i.material.dispose(),i.material=i[x];else if(n!==_&&f===g)if(i.isPoints){const l=new H;l.size=g.size,l.sizeAttenuation=g.sizeAttenuation,i.material=l}else i.material=new S,i.material.flatShading=!0;switch(n!==L&&delete i.material[M],n!==B&&delete i.material[C],n){case W:{const l=s.__depth/e;this.getDebugColor(l,i.material.color);break}case F:{const l=s.__depthFromRenderedParent/e;this.getDebugColor(l,i.material.color);break}case w:{const l=s.__error/h;l>1?i.material.color.setRGB(1,0,0):this.getDebugColor(l,i.material.color);break}case P:{const l=Math.min(s.geometricError/t,1);this.getDebugColor(l,i.material.color);break}case U:{const l=Math.min(s.__distanceFromCamera/a,1);this.getDebugColor(l,i.material.color);break}case V:{!s.children||s.children.length===0?this.getDebugColor(1,i.material.color):this.getDebugColor(0,i.material.color);break}case B:{i.material[C]||(i.material.color.setHSL(u,c,m),i.material[C]=!0);break}case L:{i.material[M]||(i.material.color.setHSL(u,c,m),i.material[M]=!0);break}case z:{this.customColorCallback?this.customColorCallback(s,i):console.warn("DebugTilesRenderer: customColorCallback not defined");break}case y:{const l=o.indexOf(s);this.getDebugColor(l/(o.length-1),i.material.color);break}}}})})}_onTileVisibilityChange(r,e){const t=r.cached,a=this.sphereGroup,h=this.boxGroup,n=this.regionGroup,d=t.boxHelperGroup,o=t.sphereHelper,s=t.regionHelper;e?(d&&(h.add(d),d.updateMatrixWorld(!0)),o&&(a.add(o),o.updateMatrixWorld(!0)),s&&(n.add(s),s.updateMatrixWorld(!0))):(d&&h.remove(d),o&&a.remove(o),s&&n.remove(s))}_onLoadModel(r,e){e[E]=performance.now();const t=this.tiles,a=e.cached,{sphere:h,obb:n,region:d}=a.boundingVolume;if(n){const o=new b;o.name="DebugTilesRenderer.boxHelperGroup",o.matrix.copy(n.transform),o.matrixAutoUpdate=!1;const s=new A(n.box,v(e.__depth));s.raycast=G,o.add(s),a.boxHelperGroup=o,t.visibleTiles.has(e)&&this.displayBoxBounds&&(this.boxGroup.add(o),o.updateMatrixWorld(!0))}if(h){const o=new N(h,v(e.__depth));o.raycast=G,a.sphereHelper=o,t.visibleTiles.has(e)&&this.displaySphereBounds&&(this.sphereGroup.add(o),o.updateMatrixWorld(!0))}if(d){const o=new k(d,v(e.__depth));o.raycast=G;const s=new O;d.getBoundingSphere(s),o.position.copy(s.center),s.center.multiplyScalar(-1),o.geometry.translate(...s.center),a.regionHelper=o,t.visibleTiles.has(e)&&this.displayRegionBounds&&(this.regionGroup.add(o),o.updateMatrixWorld(!0))}r.traverse(o=>{const s=o.material;s&&(o[x]=s)})}_onDisposeModel(r){const e=r.cached;e.boxHelperGroup&&(e.boxHelperGroup.children[0].geometry.dispose(),delete e.boxHelperGroup),e.sphereHelper&&(e.sphereHelper.geometry.dispose(),delete e.sphereHelper),e.regionHelper&&(e.regionHelper.geometry.dispose(),delete e.regionHelper)}dispose(){const r=this.tiles;r.removeEventListener("load-tile-set",this._onLoadTileSetCB),r.removeEventListener("load-model",this._onLoadModelCB),r.removeEventListener("dispose-model",this._onDisposeModelCB),r.removeEventListener("update-after",this._onUpdateAfterCB),this.colorMode=_,this._onUpdateAfter(),r.traverse(e=>{this._onDisposeModel(e)}),this.boxGroup.removeFromParent(),this.sphereGroup.removeFromParent(),this.regionGroup.removeFromParent()}}export{z as C,U as D,P as G,V as I,y as L,_ as N,F as R,w as S,W as a,L as b,B as c,J as d}; diff --git a/example/bundle/assets/Ellipsoid-CKpUFSOi.js b/example/bundle/assets/Ellipsoid-CKpUFSOi.js new file mode 100644 index 00000000..70019c4f --- /dev/null +++ b/example/bundle/assets/Ellipsoid-CKpUFSOi.js @@ -0,0 +1 @@ +import{k as l,i as R,as as W,j,d as K,an as Q,bl as tt}from"./three.module-_fL2BuBc.js";const d=new W,U=new l,et={};function it(r){const{x:t,y:e,z:i}=r;r.x=i,r.y=t,r.z=e}function ot(r){return-(r-Math.PI/2)}function B(r){return-r+Math.PI/2}function st(r,t,e={}){return d.theta=t,d.phi=B(r),U.setFromSpherical(d),d.setFromVector3(U),e.lat=ot(d.phi),e.lon=d.theta,e}function X(r,t="E",e="W"){const i=r<0?e:t;r=Math.abs(r);const o=~~r,s=(r-o)*60,n=~~s,y=~~((s-n)*60);return`${o}° ${n}' ${y}" ${i}`}function lt(r,t,e=!1){const i=st(r,t,et);let o,s;return e?(o=`${(R.RAD2DEG*i.lat).toFixed(4)}°`,s=`${(R.RAD2DEG*i.lon).toFixed(4)}°`):(o=X(R.RAD2DEG*i.lat,"N","S"),s=X(R.RAD2DEG*i.lon,"E","W")),`${o} ${s}`}const Y=new W,m=new l,c=new l,w=new l,nt=new l,p=new j,u=new j,A=new K,a=new tt,Z=new l,b=new l,T=new l,D=new l,G=new Q,rt=1e-12,at=.1,V=0,L=1,O=2;class ut{constructor(t=1,e=1,i=1){this.radius=new l(t,e,i)}intersectRay(t,e){return p.makeScale(...this.radius).invert(),A.center.set(0,0,0),A.radius=1,G.copy(t).applyMatrix4(p),G.intersectSphere(A,e)?(p.makeScale(...this.radius),e.applyMatrix4(p),e):null}getEastNorthUpFrame(t,e,i){return this.getEastNorthUpAxes(t,e,Z,b,T,D),i.makeBasis(Z,b,T).setPosition(D)}getEastNorthUpAxes(t,e,i,o,s,n=D){this.getCartographicToPosition(t,e,0,n),this.getCartographicToNormal(t,e,s),i.set(-n.y,n.x,0).normalize(),o.crossVectors(s,i).normalize()}getNorthernTangent(t,e,i,o=nt){return console.log("Ellipsoid: getNorthernTangent has been deprecated. Use getEastNorthUpAxes instead."),this.getEastNorthUpAxes(t,e,o,i,T),o.multiplyScalar(-1),i}getAzElRollFromRotationMatrix(t,e,i,o,s=V){return s===L?(a.set(-Math.PI/2,0,0,"XYZ"),u.makeRotationFromEuler(a).premultiply(i)):s===O?(a.set(-Math.PI/2,0,Math.PI,"XYZ"),u.makeRotationFromEuler(a).premultiply(i)):u.copy(i),this.getEastNorthUpFrame(t,e,p).invert(),u.premultiply(p),a.setFromRotationMatrix(u,"ZXY"),o.azimuth=-a.z,o.elevation=a.x,o.roll=a.y,o}getRotationMatrixFromAzElRoll(t,e,i,o,s,n,h=V){return this.getEastNorthUpFrame(t,e,p),a.set(o,s,-i,"ZXY"),n.makeRotationFromEuler(a).premultiply(p).setPosition(0,0,0),h===L?(a.set(Math.PI/2,0,0,"XYZ"),u.makeRotationFromEuler(a),n.multiply(u)):h===O&&(a.set(-Math.PI/2,0,Math.PI,"XYZ"),u.makeRotationFromEuler(a),n.multiply(u)),n}getCartographicToPosition(t,e,i,o){this.getCartographicToNormal(t,e,m);const s=this.radius;c.copy(m),c.x*=s.x**2,c.y*=s.y**2,c.z*=s.z**2;const n=Math.sqrt(m.dot(c));return c.divideScalar(n),o.copy(c).addScaledVector(m,i)}getPositionToCartographic(t,e){this.getPositionToSurfacePoint(t,c),this.getPositionToNormal(t,m);const i=w.subVectors(t,c);return e.lon=Math.atan2(m.y,m.x),e.lat=Math.asin(m.z),e.height=Math.sign(i.dot(t))*i.length(),e}getCartographicToNormal(t,e,i){return Y.set(1,B(t),e),i.setFromSpherical(Y).normalize(),it(i),i}getPositionToNormal(t,e){const i=this.radius;return e.copy(t),e.x/=i.x**2,e.y/=i.y**2,e.z/=i.z**2,e.normalize(),e}getPositionToSurfacePoint(t,e){const i=this.radius,o=1/i.x**2,s=1/i.y**2,n=1/i.z**2,h=t.x*t.x*o,y=t.y*t.y*s,z=t.z*t.z*n,v=h+y+z,f=Math.sqrt(1/v),S=c.copy(t).multiplyScalar(f);if(vrt);return e.set(t.x*M,t.y*E,t.z*x)}calculateHorizonDistance(t,e){const i=this.calculateEffectiveRadius(t);return Math.sqrt(2*i*e+e**2)}calculateEffectiveRadius(t){const e=this.radius.x,o=1-this.radius.z**2/e**2,s=t*R.DEG2RAD,n=Math.sin(s)**2;return e/Math.sqrt(1-o*n)}getPositionElevation(t){this.getPositionToSurfacePoint(t,c);const e=w.subVectors(t,c);return Math.sign(e.dot(t))*e.length()}copy(t){return this.radius.copy(t.radius),this}clone(){return new this.constructor().copy(this)}}export{L as C,ut as E,O,lt as t}; diff --git a/example/bundle/assets/EllipsoidRegion-CVV0HJli.js b/example/bundle/assets/EllipsoidRegion-CVV0HJli.js new file mode 100644 index 00000000..c6e7cbae --- /dev/null +++ b/example/bundle/assets/EllipsoidRegion-CVV0HJli.js @@ -0,0 +1 @@ +import{k as f,j as R,i as p}from"./three.module-_fL2BuBc.js";import{E as C}from"./Ellipsoid-CKpUFSOi.js";const l=Math.PI,u=l/2,m=new f,c=new f,h=new f,y=new R;let d=0;const w=[];function T(M=!1){return M?(w[d]||(w[d]=new f),d++,w[d-1]):new f}function I(){d=0}class A extends C{constructor(i,t,o,n=-u,e=u,g=0,E=2*l,a=0,s=0){super(i,t,o),this.latStart=n,this.latEnd=e,this.lonStart=g,this.lonEnd=E,this.heightStart=a,this.heightEnd=s}_getPoints(i=!1){const{latStart:t,latEnd:o,lonStart:n,lonEnd:e,heightStart:g,heightEnd:E}=this,a=p.mapLinear(.5,0,1,t,o),s=p.mapLinear(.5,0,1,n,e),r=Math.floor(n/u)*u,k=[[-l/2,0],[l/2,0],[0,r],[0,r+l/2],[0,r+l],[0,r+3*l/2],[t,e],[o,e],[t,n],[o,n],[0,n],[0,e],[a,s],[t,s],[o,s],[a,n],[a,e]],B=[],V=k.length;for(let P=0;P<=1;P++){const v=p.mapLinear(P,0,1,g,E);for(let L=0,F=V;L=t&&_<=o&&S>=n&&S<=e){const x=T(i);B.push(x),this.getCartographicToPosition(_,S,v,x)}}}return B}getBoundingBox(i,t){I();const{latStart:o,latEnd:n,lonStart:e,lonEnd:g}=this;if(n-o.1&&(l.z>0&&w.multiplyScalar(-1),f.setXYZ(r,...w))}return u}class T extends S{constructor(t=new I,e=16776960){super(),this.ellipsoidRegion=t,this.material.color.set(e),this.update()}update(){const t=L(this.ellipsoidRegion);this.geometry.dispose(),this.geometry=new z(t,80)}dispose(){this.geometry.dispose(),this.material.dispose()}}class k extends N{constructor(t=new I,e=16776960){super(),this.ellipsoidRegion=t,this.material.color.set(e),this.update()}update(){this.geometry.dispose();const t=L(this.ellipsoidRegion),{lonStart:e,lonEnd:a}=this;a-e>=2*Math.PI?(t.groups.splice(2,2),this.geometry=H(t)):this.geometry=t}dispose(){this.geometry.dispose(),this.material.dispose()}}export{k as E,F as S,T as a}; diff --git a/example/bundle/assets/Environment-JXyVb9Rj.js b/example/bundle/assets/Environment-JXyVb9Rj.js new file mode 100644 index 00000000..22aaab77 --- /dev/null +++ b/example/bundle/assets/Environment-JXyVb9Rj.js @@ -0,0 +1,119 @@ +import{u as er,r as oe,p as cr,a as Ft,h as Ut,e as Ot,_ as Nt,q as Br}from"./extends-BiwV-o27.js";import{g as wr,b2 as Dt,b as Er,aL as Bt,p as kt,b3 as Pr,$ as Se,a0 as Ue,b4 as Ge,x as Re,aO as He,z as rr,a6 as Lt,aR as Be,S as Hr,O as Pt,b5 as zr,aD as Gr,b6 as ur,W as Ht,o as zt,a3 as gr,b7 as Gt,b8 as Zt,b9 as Wt,aC as $t,_ as fr,n as Xt,F as lr,t as Yt,L as Vt,ba as kr,a2 as qt,k as Ke,aP as Kt,bb as Jt,ab as Qt,bc as jt,bd as ea}from"./three.module-_fL2BuBc.js";var ye=Uint8Array,ke=Uint16Array,mr=Uint32Array,Zr=new ye([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Wr=new ye([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ra=new ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$r=function(i,t){for(var n=new ke(31),c=0;c<31;++c)n[c]=t+=1<>>1|(j&21845)<<1;De=(De&52428)>>>2|(De&13107)<<2,De=(De&61680)>>>4|(De&3855)<<4,_r[j]=((De&65280)>>>8|(De&255)<<8)>>>1}var je=function(i,t,n){for(var c=i.length,u=0,v=new ke(t);u>>f]=m}else for(g=new ke(c),u=0;u>>15-i[u]);return g},ar=new ye(288);for(var j=0;j<144;++j)ar[j]=8;for(var j=144;j<256;++j)ar[j]=9;for(var j=256;j<280;++j)ar[j]=7;for(var j=280;j<288;++j)ar[j]=8;var Vr=new ye(32);for(var j=0;j<32;++j)Vr[j]=5;var ia=je(ar,9,1),oa=je(Vr,5,1),dr=function(i){for(var t=i[0],n=1;nt&&(t=i[n]);return t},be=function(i,t,n){var c=t/8|0;return(i[c]|i[c+1]<<8)>>(t&7)&n},pr=function(i,t){var n=t/8|0;return(i[n]|i[n+1]<<8|i[n+2]<<16)>>(t&7)},sa=function(i){return(i/8|0)+(i&7&&1)},la=function(i,t,n){(n==null||n>i.length)&&(n=i.length);var c=new(i instanceof ke?ke:i instanceof mr?mr:ye)(n-t);return c.set(i.subarray(t,n)),c},ca=function(i,t,n){var c=i.length;if(!c||n&&!n.l&&c<5)return t||new ye(0);var u=!t||n,v=!n||n.i;n||(n={}),t||(t=new ye(c*3));var h=function(X){var xe=t.length;if(X>xe){var Ae=new ye(Math.max(xe*2,X));Ae.set(t),t=Ae}},g=n.f||0,f=n.p||0,m=n.b||0,x=n.l,T=n.d,b=n.m,U=n.n,W=c*8;do{if(!x){n.f=g=be(i,f,1);var ee=be(i,f+1,3);if(f+=3,ee)if(ee==1)x=ia,T=oa,b=9,U=5;else if(ee==2){var le=be(i,f,31)+257,ce=be(i,f+10,15)+4,z=le+be(i,f+5,31)+1;f+=14;for(var L=new ye(z),te=new ye(19),S=0;S>>4;if(k<16)L[S++]=k;else{var G=0,A=0;for(k==16?(A=3+be(i,f,3),f+=2,G=L[S-1]):k==17?(A=3+be(i,f,7),f+=3):k==18&&(A=11+be(i,f,127),f+=7);A--;)L[S++]=G}}var ae=L.subarray(0,le),N=L.subarray(le);b=dr(ae),U=dr(N),x=je(ae,b,1),T=je(N,U,1)}else throw"invalid block type";else{var k=sa(f)+4,D=i[k-4]|i[k-3]<<8,re=k+D;if(re>c){if(v)throw"unexpected EOF";break}u&&h(m+D),t.set(i.subarray(k,re),m),n.b=m+=D,n.p=f=re*8;continue}if(f>W){if(v)throw"unexpected EOF";break}}u&&h(m+131072);for(var Me=(1<>>4;if(f+=G&15,f>W){if(v)throw"unexpected EOF";break}if(!G)throw"invalid length/literal";if(J<256)t[m++]=J;else if(J==256){Ie=f,x=null;break}else{var Oe=J-254;if(J>264){var S=J-257,ne=Zr[S];Oe=be(i,f,(1<>>4;if(!ve)throw"invalid distance";f+=ve&15;var N=na[Te];if(Te>3){var ne=Wr[Te];N+=pr(i,f)&(1<W){if(v)throw"unexpected EOF";break}u&&h(m+131072);for(var We=m+Oe;m>>4>7||(i[0]<<8|i[1])%31)throw"invalid zlib data";if(i[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function or(i,t){return ca((ha(i),i.subarray(2,-4)),t)}var va=typeof TextDecoder<"u"&&new TextDecoder,da=0;try{va.decode(ua,{stream:!0}),da=1}catch{}const pa=i=>i&&i.isCubeTexture;class ga extends wr{constructor(t,n){var c,u;const v=pa(t),g=((u=v?(c=t.image[0])==null?void 0:c.width:t.image.width)!=null?u:1024)/4,f=Math.floor(Math.log2(g)),m=Math.pow(2,f),x=3*Math.max(m,16*7),T=4*m,b=[v?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/x}`,`#define CUBEUV_TEXEL_HEIGHT ${1/T}`,`#define CUBEUV_MAX_MIP ${f}.0`],U=` + varying vec3 vWorldPosition; + void main() + { + vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); + vWorldPosition = worldPosition.xyz; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + } + `,W=b.join(` +`)+` + #define ENVMAP_TYPE_CUBE_UV + varying vec3 vWorldPosition; + uniform float radius; + uniform float height; + uniform float angle; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube map; + #else + uniform sampler2D map; + #endif + // From: https://www.shadertoy.com/view/4tsBD7 + float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) + { + float d = dot ( rd, n ); + + if( d > 0.0 ) { return 1e6; } + + vec3 o = ro - c; + float t = - dot( n, o ) / d; + vec3 q = o + rd * t; + + return ( dot( q, q ) < r * r ) ? t : 1e6; + } + // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm + float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) + { + vec3 oc = ro - ce; + float b = dot( oc, rd ); + float c = dot( oc, oc ) - ra * ra; + float h = b * b - c; + + if( h < 0.0 ) { return -1.0; } + + h = sqrt( h ); + + return - b + h; + } + vec3 project() + { + vec3 p = normalize( vWorldPosition ); + vec3 camPos = cameraPosition; + camPos.y -= height; + float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); + if( intersection > 0.0 ) { + + vec3 h = vec3( 0.0, - height, 0.0 ); + float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); + p = ( camPos + min( intersection, intersection2 ) * p ) / radius; + } else { + p = vec3( 0.0, 1.0, 0.0 ); + } + return p; + } + #include + #include + void main() + { + vec3 projectedWorldPosition = project(); + + #ifdef ENVMAP_TYPE_CUBE + vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; + #else + vec3 direction = normalize( projectedWorldPosition ); + vec2 uv = equirectUv( direction ); + vec3 outcolor = texture2D( map, uv ).rgb; + #endif + gl_FragColor = vec4( outcolor, 1.0 ); + #include + #include <${parseInt(kt.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}> + } + `,ee={map:{value:t},height:{value:(n==null?void 0:n.height)||15},radius:{value:(n==null?void 0:n.radius)||100}},k=new Dt(1,16),D=new Er({uniforms:ee,fragmentShader:W,vertexShader:U,side:Bt});super(k,D)}set radius(t){this.material.uniforms.radius.value=t}get radius(){return this.material.uniforms.radius.value}set height(t){this.material.uniforms.height.value=t}get height(){return this.material.uniforms.height.value}}class fa extends Pr{constructor(t){super(t),this.type=Se}parse(t){const h=function(S,I){switch(S){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(I||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(I||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(I||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(I||""))}},x=` +`,T=function(S,I,H){I=I||1024;let P=S.pos,G=-1,A=0,ae="",N=String.fromCharCode.apply(null,new Uint16Array(S.subarray(P,P+128)));for(;0>(G=N.indexOf(x))&&A=S.byteLength||!(ae=T(S)))&&h(1,"no header found"),(N=ae.match(I))||h(3,"bad initial token"),A.valid|=1,A.programtype=N[1],A.string+=ae+` +`;ae=T(S),ae!==!1;){if(A.string+=ae+` +`,ae.charAt(0)==="#"){A.comments+=ae+` +`;continue}if((N=ae.match(H))&&(A.gamma=parseFloat(N[1])),(N=ae.match($))&&(A.exposure=parseFloat(N[1])),(N=ae.match(P))&&(A.valid|=2,A.format=N[1]),(N=ae.match(G))&&(A.valid|=4,A.height=parseInt(N[1],10),A.width=parseInt(N[2],10)),A.valid&2&&A.valid&4)break}return A.valid&2||h(3,"missing format specifier"),A.valid&4||h(3,"missing image size specifier"),A},U=function(S,I,H){const $=I;if($<8||$>32767||S[0]!==2||S[1]!==2||S[2]&128)return new Uint8Array(S);$!==(S[2]<<8|S[3])&&h(3,"wrong scanline width");const P=new Uint8Array(4*I*H);P.length||h(4,"unable to allocate buffer space");let G=0,A=0;const ae=4*$,N=new Uint8Array(4),Me=new Uint8Array(ae);let Le=H;for(;Le>0&&AS.byteLength&&h(1),N[0]=S[A++],N[1]=S[A++],N[2]=S[A++],N[3]=S[A++],(N[0]!=2||N[1]!=2||(N[2]<<8|N[3])!=$)&&h(3,"bad rgbe scanline format");let Ie=0,J;for(;Ie128;if(ne&&(J-=128),(J===0||Ie+J>ae)&&h(3,"bad scanline data"),ne){const ve=S[A++];for(let Te=0;Te>3]&1<<(o&7))&&(r[a++]=o);for(var s=a-1;a<65536;)r[a++]=0;return s}function $(e){for(var r=0;r<16384;r++)e[r]={},e[r].len=0,e[r].lit=0,e[r].p=null}const P={l:0,c:0,lc:0};function G(e,r,a,o,s){for(;a>a&(1<0;--r){var o=a+A[r]>>1;A[r]=a,a=o}for(var r=0;r<65537;++r){var s=e[r];s>0&&(e[r]=s|A[s]++<<6)}}function N(e,r,a,o,s,l,p){for(var d=a,E=0,w=0;s<=l;s++){if(d.value-a.value>o)return!1;G(6,E,w,e,d);var y=P.l;if(E=P.c,w=P.lc,p[s]=y,y==63){if(d.value-a.value>o)throw"Something wrong with hufUnpackEncTable";G(8,E,w,e,d);var _=P.l+6;if(E=P.c,w=P.lc,s+_>l+1)throw"Something wrong with hufUnpackEncTable";for(;_--;)p[s++]=0;s--}else if(y>=59){var _=y-59+2;if(s+_>l+1)throw"Something wrong with hufUnpackEncTable";for(;_--;)p[s++]=0;s--}}ae(p)}function Me(e){return e&63}function Le(e){return e>>6}function Ie(e,r,a,o){for(;r<=a;r++){var s=Le(e[r]),l=Me(e[r]);if(s>>l)throw"Invalid table entry";if(l>14){var p=o[s>>l-14];if(p.len)throw"Invalid table entry";if(p.lit++,p.p){var d=p.p;p.p=new Array(p.lit);for(var E=0;E0;E--){var p=o[(s<<14-l)+w];if(p.len||p.p)throw"Invalid table entry";p.len=l,p.lit=r,w++}}return!0}const J={c:0,lc:0};function Oe(e,r,a,o){e=e<<8|Nr(a,o),r+=8,J.c=e,J.lc=r}const ne={c:0,lc:0};function ve(e,r,a,o,s,l,p,d,E,w){if(e==r){o<8&&(Oe(a,o,s,p),a=J.c,o=J.lc),o-=8;var y=a>>o,y=new Uint8Array([y])[0];if(E.value+y>w)return!1;for(var _=d[E.value-1];y-- >0;)d[E.value++]=_}else if(E.value32767?r-65536:r}const X={a:0,b:0};function xe(e,r){var a=We(e),o=We(r),s=o,l=a+(s&1)+(s>>1),p=l,d=l-s;X.a=p,X.b=d}function Ae(e,r){var a=Te(e),o=Te(r),s=a-(o>>1)&65535,l=o+s-32768&65535;X.a=l,X.b=s}function rt(e,r,a,o,s,l,p){for(var d=p<16384,E=a>s?s:a,w=1,y;w<=E;)w<<=1;for(w>>=1,y=w,w>>=1;w>=1;){for(var _=0,se=_+l*(s-y),C=l*w,R=l*y,F=o*w,O=o*y,Y,q,ue,ge;_<=se;_+=R){for(var K=_,Ce=_+o*(a-y);K<=Ce;K+=O){var Q=K+F,he=K+C,Fe=he+F;d?(xe(e[K+r],e[he+r]),Y=X.a,ue=X.b,xe(e[Q+r],e[Fe+r]),q=X.a,ge=X.b,xe(Y,q),e[K+r]=X.a,e[Q+r]=X.b,xe(ue,ge),e[he+r]=X.a,e[Fe+r]=X.b):(Ae(e[K+r],e[he+r]),Y=X.a,ue=X.b,Ae(e[Q+r],e[Fe+r]),q=X.a,ge=X.b,Ae(Y,q),e[K+r]=X.a,e[Q+r]=X.b,Ae(ue,ge),e[he+r]=X.a,e[Fe+r]=X.b)}if(a&w){var he=K+C;d?xe(e[K+r],e[he+r]):Ae(e[K+r],e[he+r]),Y=X.a,e[he+r]=X.b,e[K+r]=Y}}if(s&w)for(var K=_,Ce=_+o*(a-y);K<=Ce;K+=O){var Q=K+F;d?xe(e[K+r],e[Q+r]):Ae(e[K+r],e[Q+r]),Y=X.a,e[Q+r]=X.b,e[K+r]=Y}y=w,w>>=1}return _}function tt(e,r,a,o,s,l,p,d,E,w){for(var y=0,_=0,se=d,C=Math.trunc(s.value+(l+7)/8);s.value=14;){var R=y>>_-14&16383,F=r[R];if(F.len)_-=F.len,ve(F.lit,p,y,_,a,o,s,E,w,se),y=ne.c,_=ne.lc;else{if(!F.p)throw"hufDecode issues";var O;for(O=0;O=Y&&Le(e[F.p[O]])==(y>>_-Y&(1<>=q,_-=q;_>0;){var F=r[y<<14-_&16383];if(F.len)_-=F.len,ve(F.lit,p,y,_,a,o,s,E,w,se),y=ne.c,_=ne.lc;else throw"hufDecode issues"}return!0}function Rr(e,r,a,o,s,l){var p={value:0},d=a.value,E=fe(r,a),w=fe(r,a);a.value+=4;var y=fe(r,a);if(a.value+=4,E<0||E>=65537||w<0||w>=65537)throw"Something wrong with HUF_ENCSIZE";var _=new Array(65537),se=new Array(16384);$(se);var C=o-(a.value-d);if(N(e,r,a,C,E,w,_),y>8*(o-(a.value-d)))throw"Something wrong with hufUncompress";Ie(_,E,w,se),tt(_,se,e,r,a,y,w,l,s,p)}function at(e,r,a){for(var o=0;ol||(r[s++]=e[a++],s>l));)r[s++]=e[o++]}function Fr(e){for(var r=e.byteLength,a=new Array,o=0,s=new DataView(e);r>0;){var l=s.getInt8(o++);if(l<0){var p=-l;r-=p+1;for(var d=0;d>8==255?s+=o&255:(a[s]=o,s++),e.value++}function ot(e,r){r[0]=M(e[0]),r[1]=M(e[1]),r[2]=M(e[5]),r[3]=M(e[6]),r[4]=M(e[14]),r[5]=M(e[15]),r[6]=M(e[27]),r[7]=M(e[28]),r[8]=M(e[2]),r[9]=M(e[4]),r[10]=M(e[7]),r[11]=M(e[13]),r[12]=M(e[16]),r[13]=M(e[26]),r[14]=M(e[29]),r[15]=M(e[42]),r[16]=M(e[3]),r[17]=M(e[8]),r[18]=M(e[12]),r[19]=M(e[17]),r[20]=M(e[25]),r[21]=M(e[30]),r[22]=M(e[41]),r[23]=M(e[43]),r[24]=M(e[9]),r[25]=M(e[11]),r[26]=M(e[18]),r[27]=M(e[24]),r[28]=M(e[31]),r[29]=M(e[40]),r[30]=M(e[44]),r[31]=M(e[53]),r[32]=M(e[10]),r[33]=M(e[19]),r[34]=M(e[23]),r[35]=M(e[32]),r[36]=M(e[39]),r[37]=M(e[45]),r[38]=M(e[52]),r[39]=M(e[54]),r[40]=M(e[20]),r[41]=M(e[22]),r[42]=M(e[33]),r[43]=M(e[38]),r[44]=M(e[46]),r[45]=M(e[51]),r[46]=M(e[55]),r[47]=M(e[60]),r[48]=M(e[21]),r[49]=M(e[34]),r[50]=M(e[37]),r[51]=M(e[47]),r[52]=M(e[50]),r[53]=M(e[56]),r[54]=M(e[59]),r[55]=M(e[61]),r[56]=M(e[35]),r[57]=M(e[36]),r[58]=M(e[48]),r[59]=M(e[49]),r[60]=M(e[57]),r[61]=M(e[58]),r[62]=M(e[62]),r[63]=M(e[63])}function st(e){const r=.5*Math.cos(.7853975),a=.5*Math.cos(3.14159/16),o=.5*Math.cos(3.14159/8),s=.5*Math.cos(3*3.14159/16),l=.5*Math.cos(5*3.14159/16),p=.5*Math.cos(3*3.14159/8),d=.5*Math.cos(7*3.14159/16);for(var E=new Array(4),w=new Array(4),y=new Array(4),_=new Array(4),se=0;se<8;++se){var C=se*8;E[0]=o*e[C+2],E[1]=p*e[C+2],E[2]=o*e[C+6],E[3]=p*e[C+6],w[0]=a*e[C+1]+s*e[C+3]+l*e[C+5]+d*e[C+7],w[1]=s*e[C+1]-d*e[C+3]-a*e[C+5]-l*e[C+7],w[2]=l*e[C+1]-a*e[C+3]+d*e[C+5]+s*e[C+7],w[3]=d*e[C+1]-l*e[C+3]+s*e[C+5]-a*e[C+7],y[0]=r*(e[C+0]+e[C+4]),y[3]=r*(e[C+0]-e[C+4]),y[1]=E[0]+E[3],y[2]=E[1]-E[2],_[0]=y[0]+y[1],_[1]=y[3]+y[2],_[2]=y[3]-y[2],_[3]=y[0]-y[1],e[C+0]=_[0]+w[0],e[C+1]=_[1]+w[1],e[C+2]=_[2]+w[2],e[C+3]=_[3]+w[3],e[C+4]=_[3]-w[3],e[C+5]=_[2]-w[2],e[C+6]=_[1]-w[1],e[C+7]=_[0]-w[0]}for(var R=0;R<8;++R)E[0]=o*e[16+R],E[1]=p*e[16+R],E[2]=o*e[48+R],E[3]=p*e[48+R],w[0]=a*e[8+R]+s*e[24+R]+l*e[40+R]+d*e[56+R],w[1]=s*e[8+R]-d*e[24+R]-a*e[40+R]-l*e[56+R],w[2]=l*e[8+R]-a*e[24+R]+d*e[40+R]+s*e[56+R],w[3]=d*e[8+R]-l*e[24+R]+s*e[40+R]-a*e[56+R],y[0]=r*(e[R]+e[32+R]),y[3]=r*(e[R]-e[32+R]),y[1]=E[0]+E[3],y[2]=E[1]-E[2],_[0]=y[0]+y[1],_[1]=y[3]+y[2],_[2]=y[3]-y[2],_[3]=y[0]-y[1],e[0+R]=_[0]+w[0],e[8+R]=_[1]+w[1],e[16+R]=_[2]+w[2],e[24+R]=_[3]+w[3],e[32+R]=_[3]-w[3],e[40+R]=_[2]-w[2],e[48+R]=_[1]-w[1],e[56+R]=_[0]-w[0]}function lt(e){for(var r=0;r<64;++r){var a=e[0][r],o=e[1][r],s=e[2][r];e[0][r]=a+1.5747*s,e[1][r]=a-.1873*o-.4682*s,e[2][r]=a+1.8556*o}}function ct(e,r,a){for(var o=0;o<64;++o)r[a+o]=Ge.toHalfFloat(ut(e[o]))}function ut(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(I,Math.abs(e)-1)}function Ur(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function ht(e){var r=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),a=new Uint8Array(Fr(r)),o=new Uint8Array(a.length);return xr(a),Ar(a,o),new DataView(o.buffer)}function vr(e){var r=e.array.slice(e.offset.value,e.offset.value+e.size),a=or(r),o=new Uint8Array(a.length);return xr(a),Ar(a,o),new DataView(o.buffer)}function vt(e){for(var r=e.viewer,a={value:e.offset.value},o=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),s=new Uint8Array(8192),l=0,p=new Array(e.channels),d=0;d=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(E<=w)for(var d=0;d0;){var d=nr(r.buffer,a),E=ze(r,a),w=E>>2&3,y=(E>>4)-1,_=new Int8Array([y])[0],se=ze(r,a);l.push({name:d,index:_,type:se,compression:w}),p-=d.length+3}for(var C=Ve.channels,R=new Array(e.channels),F=0;F=0&&(q.idx[ge.index]=ue),O.offset=ue)}if(s.acCompressedSize>0)switch(s.acCompression){case 0:var Q=new Uint16Array(s.totalAcUncompressedCount);Rr(e.array,r,a,s.acCompressedSize,Q,s.totalAcUncompressedCount);break;case 1:var K=e.array.slice(a.value,a.value+s.totalAcUncompressedCount),Ce=or(K),Q=new Uint16Array(Ce.buffer);a.value+=s.totalAcUncompressedCount;break}if(s.dcCompressedSize>0){var he={array:e.array,offset:a,size:s.dcCompressedSize},Fe=new Uint16Array(vr(he).buffer);a.value+=s.dcCompressedSize}if(s.rleRawSize>0){var K=e.array.slice(a.value,a.value+s.rleCompressedSize),Ce=or(K),qe=Fr(Ce.buffer);a.value+=s.rleCompressedSize}for(var we=0,V=new Array(R.length),F=0;F>10,a=e&1023;return(e>>15?-1:1)*(r?r===31?a?NaN:1/0:Math.pow(2,r-15)*(1+a/1024):6103515625e-14*(a/1024))}function Xe(e,r){var a=e.getUint16(r.value,!0);return r.value+=2,a}function _t(e,r){return M(Xe(e,r))}function wt(e,r,a,o){for(var s=a.value,l=[];a.valueB.height?B.height-r:B.scanlineBlockSize;const o=B.size=B.height)break;for(let p=0;p{let c;switch(i){case fr:c=new Uint8ClampedArray(t*n*4);break;case Se:c=new Uint16Array(t*n*4);break;case $t:c=new Uint32Array(t*n*4);break;case Wt:c=new Int8Array(t*n*4);break;case Zt:c=new Int16Array(t*n*4);break;case Gt:c=new Int32Array(t*n*4);break;case Ue:c=new Float32Array(t*n*4);break;default:throw new Error("Unsupported data type")}return c};let sr;const Ea=(i,t,n,c)=>{if(sr!==void 0)return sr;const u=new Gr(1,1,c);t.setRenderTarget(u);const v=new wr(new zr,new Xt({color:16777215}));t.render(v,n),t.setRenderTarget(null);const h=qr(i,u.width,u.height);return t.readRenderTargetPixels(u,0,0,u.width,u.height,h),u.dispose(),v.geometry.dispose(),v.material.dispose(),sr=h[0]!==0,sr};class yr{constructor(t){var n,c,u,v,h,g,f,m,x,T,b,U,W,ee,k,D;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(le){throw this._renderer.setRenderTarget(null),le}this._renderer.setRenderTarget(null)},this._width=t.width,this._height=t.height,this._type=t.type,this._colorSpace=t.colorSpace;const re={format:rr,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((n=t.renderTargetOptions)===null||n===void 0?void 0:n.anisotropy)!==void 0?(c=t.renderTargetOptions)===null||c===void 0?void 0:c.anisotropy:1,generateMipmaps:((u=t.renderTargetOptions)===null||u===void 0?void 0:u.generateMipmaps)!==void 0?(v=t.renderTargetOptions)===null||v===void 0?void 0:v.generateMipmaps:!1,magFilter:((h=t.renderTargetOptions)===null||h===void 0?void 0:h.magFilter)!==void 0?(g=t.renderTargetOptions)===null||g===void 0?void 0:g.magFilter:Re,minFilter:((f=t.renderTargetOptions)===null||f===void 0?void 0:f.minFilter)!==void 0?(m=t.renderTargetOptions)===null||m===void 0?void 0:m.minFilter:Re,samples:((x=t.renderTargetOptions)===null||x===void 0?void 0:x.samples)!==void 0?(T=t.renderTargetOptions)===null||T===void 0?void 0:T.samples:void 0,wrapS:((b=t.renderTargetOptions)===null||b===void 0?void 0:b.wrapS)!==void 0?(U=t.renderTargetOptions)===null||U===void 0?void 0:U.wrapS:Be,wrapT:((W=t.renderTargetOptions)===null||W===void 0?void 0:W.wrapT)!==void 0?(ee=t.renderTargetOptions)===null||ee===void 0?void 0:ee.wrapT:Be};if(this._material=t.material,t.renderer?this._renderer=t.renderer:(this._renderer=yr.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Hr,this._camera=new Pt,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!Ea(this._type,this._renderer,this._camera,re)){let le;switch(this._type){case Se:le=this._renderer.extensions.has("EXT_color_buffer_float")?Ue:void 0;break}le!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Ue}`),this._type=le):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new wr(new zr,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Gr(this.width,this.height,re),this._renderTarget.texture.mapping=((k=t.renderTargetOptions)===null||k===void 0?void 0:k.mapping)!==void 0?(D=t.renderTargetOptions)===null||D===void 0?void 0:D.mapping:ur}static instantiateRenderer(){const t=new Ht;return t.setSize(128,128),t}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const t=qr(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,t),t}toDataTexture(t){const n=new zt(this.toArray(),this.width,this.height,rr,this._type,(t==null?void 0:t.mapping)||ur,(t==null?void 0:t.wrapS)||Be,(t==null?void 0:t.wrapT)||Be,(t==null?void 0:t.magFilter)||Re,(t==null?void 0:t.minFilter)||Re,(t==null?void 0:t.anisotropy)||1,gr);return n.generateMipmaps=(t==null?void 0:t.generateMipmaps)!==void 0?t==null?void 0:t.generateMipmaps:!1,n}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(t){this.disposeOnDemandRenderer(),t&&this.renderTarget.dispose(),this.material instanceof Er&&Object.values(this.material.uniforms).forEach(n=>{n.value instanceof He&&n.value.dispose()}),Object.values(this.material).forEach(n=>{n instanceof He&&n.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(t){this._width=t,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(t){this._height=t,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(t){this._renderTarget=t,this._width=t.width,this._height=t.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const ya=` +varying vec2 vUv; + +void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); +} +`,Sa=` +// min half float value +#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) +// max half float value +#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) + +uniform sampler2D sdr; +uniform sampler2D gainMap; +uniform vec3 gamma; +uniform vec3 offsetHdr; +uniform vec3 offsetSdr; +uniform vec3 gainMapMin; +uniform vec3 gainMapMax; +uniform float weightFactor; + +varying vec2 vUv; + +void main() { + vec3 rgb = texture2D( sdr, vUv ).rgb; + vec3 recovery = texture2D( gainMap, vUv ).rgb; + vec3 logRecovery = pow( recovery, gamma ); + vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; + vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; + vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); + gl_FragColor = vec4( clampedHdrColor , 1.0 ); +} +`;class Ma extends Er{constructor({gamma:t,offsetHdr:n,offsetSdr:c,gainMapMin:u,gainMapMax:v,maxDisplayBoost:h,hdrCapacityMin:g,hdrCapacityMax:f,sdr:m,gainMap:x}){super({name:"GainMapDecoderMaterial",vertexShader:ya,fragmentShader:Sa,uniforms:{sdr:{value:m},gainMap:{value:x},gamma:{value:new Ke(1/t[0],1/t[1],1/t[2])},offsetHdr:{value:new Ke().fromArray(n)},offsetSdr:{value:new Ke().fromArray(c)},gainMapMin:{value:new Ke().fromArray(u)},gainMapMax:{value:new Ke().fromArray(v)},weightFactor:{value:(Math.log2(h)-g)/(f-g)}},blending:Kt,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=h,this._hdrCapacityMin=g,this._hdrCapacityMax=f,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(t){this.uniforms.sdr.value=t}get gainMap(){return this.uniforms.gainMap.value}set gainMap(t){this.uniforms.gainMap.value=t}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(t){this.uniforms.offsetHdr.value.fromArray(t)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(t){this.uniforms.offsetSdr.value.fromArray(t)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(t){this.uniforms.gainMapMin.value.fromArray(t)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(t){this.uniforms.gainMapMax.value.fromArray(t)}get gamma(){const t=this.uniforms.gamma.value;return[1/t.x,1/t.y,1/t.z]}set gamma(t){const n=this.uniforms.gamma.value;n.x=1/t[0],n.y=1/t[1],n.z=1/t[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(t){this._hdrCapacityMin=t,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(t){this._hdrCapacityMax=t,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(t){this._maxDisplayBoost=Math.max(1,Math.min(65504,t)),this.calculateWeight()}calculateWeight(){const t=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,t))}}class Kr extends Error{}class Jr extends Error{}const Qe=(i,t,n)=>{var c;let u;const v=(c=i.attributes.getNamedItem(t))===null||c===void 0?void 0:c.nodeValue;if(v)u=v;else{const h=i.getElementsByTagName(t)[0];if(h){const g=h.getElementsByTagName("rdf:li");if(g.length===3)u=Array.from(g).map(f=>f.innerHTML);else throw new Error(`Gainmap metadata contains an array of items for ${t} but its length is not 3`)}else{if(n)return n;throw new Error(`Can't find ${t} in gainmap metadata`)}}return u},Ia=i=>{var t,n;let c;typeof TextDecoder<"u"?c=new TextDecoder().decode(i):c=i.toString();let u=c.indexOf("",u);c.slice(u,h+10);const g=c.slice(u,h+10);try{const m=v.parseFromString(g,"text/xml").getElementsByTagName("rdf:Description")[0],x=Qe(m,"hdrgm:GainMapMin","0"),T=Qe(m,"hdrgm:GainMapMax"),b=Qe(m,"hdrgm:Gamma","1"),U=Qe(m,"hdrgm:OffsetSDR","0.015625"),W=Qe(m,"hdrgm:OffsetHDR","0.015625");let ee=(t=m.attributes.getNamedItem("hdrgm:HDRCapacityMin"))===null||t===void 0?void 0:t.nodeValue;ee||(ee="0");const k=(n=m.attributes.getNamedItem("hdrgm:HDRCapacityMax"))===null||n===void 0?void 0:n.nodeValue;if(!k)throw new Error("Incomplete gainmap metadata");return{gainMapMin:Array.isArray(x)?x.map(D=>parseFloat(D)):[parseFloat(x),parseFloat(x),parseFloat(x)],gainMapMax:Array.isArray(T)?T.map(D=>parseFloat(D)):[parseFloat(T),parseFloat(T),parseFloat(T)],gamma:Array.isArray(b)?b.map(D=>parseFloat(D)):[parseFloat(b),parseFloat(b),parseFloat(b)],offsetSdr:Array.isArray(U)?U.map(D=>parseFloat(D)):[parseFloat(U),parseFloat(U),parseFloat(U)],offsetHdr:Array.isArray(W)?W.map(D=>parseFloat(D)):[parseFloat(W),parseFloat(W),parseFloat(W)],hdrCapacityMin:parseFloat(ee),hdrCapacityMax:parseFloat(k)}}catch{}u=c.indexOf("{const u=this.options.debug,v=new DataView(t.buffer);if(v.getUint16(0)!==65496){c(new Error("Not a valid jpeg"));return}const h=v.byteLength;let g=2,f=0,m;for(;g250){c(new Error(`Found no marker after ${f} loops 😵`));return}if(v.getUint8(g)!==255){c(new Error(`Not a valid marker at offset 0x${g.toString(16)}, found: 0x${v.getUint8(g).toString(16)}`));return}if(m=v.getUint8(g+1),u&&console.log(`Marker: ${m.toString(16)}`),m===226){u&&console.log("Found APP2 marker (0xffe2)");const x=g+4;if(v.getUint32(x)===1297106432){const T=x+4;let b;if(v.getUint16(T)===18761)b=!1;else if(v.getUint16(T)===19789)b=!0;else{c(new Error("No valid endianness marker found in TIFF header"));return}if(v.getUint16(T+2,!b)!==42){c(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const U=v.getUint32(T+4,!b);if(U<8){c(new Error("Not valid TIFF data! (First offset less than 8)"));return}const W=T+U,ee=v.getUint16(W,!b),k=W+2;let D=0;for(let z=k;z{const t=Ia(i);if(!t)throw new Jr("Gain map XMP metadata not found");const c=await new ba({extractFII:!0,extractNonFII:!0}).extract(i);if(c.length!==2)throw new Kr("Gain map recovery image not found");return{sdr:new Uint8Array(await c[0].arrayBuffer()),gainMap:new Uint8Array(await c[1].arrayBuffer()),metadata:t}},Lr=i=>new Promise((t,n)=>{const c=document.createElement("img");c.onload=()=>{t(c)},c.onerror=u=>{n(u)},c.src=URL.createObjectURL(i)});class Qr extends Yt{constructor(t,n){super(n),t&&(this._renderer=t),this._internalLoadingManager=new Vt}setRenderer(t){return this._renderer=t,this}setRenderTargetOptions(t){return this._renderTargetOptions=t,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const t=new Ma({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new He,sdr:new He});return new yr({width:16,height:16,type:Se,colorSpace:gr,material:t,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(t,n,c,u){const v=u?new Blob([u],{type:"image/jpeg"}):void 0,h=new Blob([c],{type:"image/jpeg"});let g,f,m=!1;if(typeof createImageBitmap>"u"){const b=await Promise.all([v?Lr(v):Promise.resolve(void 0),Lr(h)]);f=b[0],g=b[1],m=!0}else{const b=await Promise.all([v?createImageBitmap(v,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(h,{imageOrientation:"flipY"})]);f=b[0],g=b[1]}const x=new He(f||new ImageData(2,2),ur,Be,Be,Re,kr,rr,fr,1,gr);x.flipY=m,x.needsUpdate=!0;const T=new He(g,ur,Be,Be,Re,kr,rr,fr,1,qt);T.flipY=m,T.needsUpdate=!0,t.width=g.width,t.height=g.height,t.material.gainMap=x,t.material.sdr=T,t.material.gainMapMin=n.gainMapMin,t.material.gainMapMax=n.gainMapMax,t.material.offsetHdr=n.offsetHdr,t.material.offsetSdr=n.offsetSdr,t.material.gamma=n.gamma,t.material.hdrCapacityMin=n.hdrCapacityMin,t.material.hdrCapacityMax=n.hdrCapacityMax,t.material.maxDisplayBoost=Math.pow(2,n.hdrCapacityMax),t.material.needsUpdate=!0,t.render()}}class Ca extends Qr{load([t,n,c],u,v,h){const g=this.prepareQuadRenderer();let f,m,x;const T=async()=>{if(f&&m&&x){try{await this.render(g,x,f,m)}catch(I){this.manager.itemError(t),this.manager.itemError(n),this.manager.itemError(c),typeof h=="function"&&h(I),g.disposeOnDemandRenderer();return}typeof u=="function"&&u(g),this.manager.itemEnd(t),this.manager.itemEnd(n),this.manager.itemEnd(c),g.disposeOnDemandRenderer()}};let b=!0,U=0,W=0,ee=!0,k=0,D=0,re=!0,le=0,ce=0;const z=()=>{if(typeof v=="function"){const I=U+k+le,H=W+D+ce,$=b&&ee&&re;v(new ProgressEvent("progress",{lengthComputable:$,loaded:H,total:I}))}};this.manager.itemStart(t),this.manager.itemStart(n),this.manager.itemStart(c);const L=new lr(this._internalLoadingManager);L.setResponseType("arraybuffer"),L.setRequestHeader(this.requestHeader),L.setPath(this.path),L.setWithCredentials(this.withCredentials),L.load(t,async I=>{if(typeof I=="string")throw new Error("Invalid sdr buffer");f=I,await T()},I=>{b=I.lengthComputable,W=I.loaded,U=I.total,z()},I=>{this.manager.itemError(t),typeof h=="function"&&h(I)});const te=new lr(this._internalLoadingManager);te.setResponseType("arraybuffer"),te.setRequestHeader(this.requestHeader),te.setPath(this.path),te.setWithCredentials(this.withCredentials),te.load(n,async I=>{if(typeof I=="string")throw new Error("Invalid gainmap buffer");m=I,await T()},I=>{ee=I.lengthComputable,D=I.loaded,k=I.total,z()},I=>{this.manager.itemError(n),typeof h=="function"&&h(I)});const S=new lr(this._internalLoadingManager);return S.setRequestHeader(this.requestHeader),S.setPath(this.path),S.setWithCredentials(this.withCredentials),S.load(c,async I=>{if(typeof I!="string")throw new Error("Invalid metadata string");x=JSON.parse(I),await T()},I=>{re=I.lengthComputable,ce=I.loaded,le=I.total,z()},I=>{this.manager.itemError(c),typeof h=="function"&&h(I)}),g}}class Ra extends Qr{load(t,n,c,u){const v=this.prepareQuadRenderer(),h=new lr(this._internalLoadingManager);return h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setPath(this.path),h.setWithCredentials(this.withCredentials),this.manager.itemStart(t),h.load(t,async g=>{if(typeof g=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const f=new Uint8Array(g);let m,x,T;try{const b=await Ta(f);m=b.sdr,x=b.gainMap,T=b.metadata}catch(b){if(b instanceof Jr||b instanceof Kr)console.warn(`Failure to reconstruct an HDR image from ${t}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),T={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},m=f;else throw b}try{await this.render(v,T,m,x)}catch(b){this.manager.itemError(t),typeof u=="function"&&u(b),v.disposeOnDemandRenderer();return}typeof n=="function"&&n(v),this.manager.itemEnd(t),v.disposeOnDemandRenderer()},c,g=>{this.manager.itemError(t),typeof u=="function"&&u(g)}),v}}const tr={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},jr="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Ze=i=>Array.isArray(i),Sr=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function hr({files:i=Sr,path:t="",preset:n=void 0,encoding:c=void 0,extensions:u}={}){let v=null,h=!1;n&&(Mr(n),i=tr[n],t=jr),h=Ze(i);const{extension:g,isCubemap:f}=Ir(i);if(v=br(g),!v)throw new Error("useEnvironment: Unrecognized file extension: "+i);const m=er(U=>U.gl);oe.useLayoutEffect(()=>{if(g!=="webp"&&g!=="jpg"&&g!=="jpeg")return;function U(){cr.clear(v,h?[i]:i)}m.domElement.addEventListener("webglcontextlost",U,{once:!0})},[i,m.domElement]);const x=cr(v,h?[i]:i,U=>{(g==="webp"||g==="jpg"||g==="jpeg")&&U.setRenderer(m),U.setPath==null||U.setPath(t),u&&u(U)});let T=h?x[0]:x;if(g==="jpg"||g==="jpeg"||g==="webp"){var b;T=(b=T.renderTarget)==null?void 0:b.texture}return T.mapping=f?Jt:Qt,"colorSpace"in T?T.colorSpace=c??f?"srgb":"srgb-linear":T.encoding=c??f?wa:_a,T}const xa={files:Sr,path:"",preset:void 0,extensions:void 0};hr.preload=i=>{const t={...xa,...i};let{files:n,path:c=""}=t;const{preset:u,extensions:v}=t;u&&(Mr(u),n=tr[u],c=jr);const{extension:h}=Ir(n);if(h==="webp"||h==="jpg"||h==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const g=br(h);if(!g)throw new Error("useEnvironment: Unrecognized file extension: "+n);cr.preload(g,Ze(n)?[n]:n,f=>{f.setPath==null||f.setPath(c),v&&v(f)})};const Aa={files:Sr,preset:void 0};hr.clear=i=>{const t={...Aa,...i};let{files:n}=t;const{preset:c}=t;c&&(Mr(c),n=tr[c]);const{extension:u}=Ir(n),v=br(u);if(!v)throw new Error("useEnvironment: Unrecognized file extension: "+n);cr.clear(v,Ze(n)?[n]:n)};function Mr(i){if(!(i in tr))throw new Error("Preset must be one of: "+Object.keys(tr).join(", "))}function Ir(i){var t;const n=Ze(i)&&i.length===6,c=Ze(i)&&i.length===3&&i.some(h=>h.endsWith("json")),u=Ze(i)?i[0]:i;return{extension:n?"cube":c?"webp":u.startsWith("data:application/exr")?"exr":u.startsWith("data:application/hdr")?"hdr":u.startsWith("data:image/jpeg")?"jpg":(t=u.split(".").pop())==null||(t=t.split("?"))==null||(t=t.shift())==null?void 0:t.toLowerCase(),isCubemap:n,isGainmap:c}}function br(i){return i==="cube"?jt:i==="hdr"?fa:i==="exr"?ma:i==="jpg"||i==="jpeg"?Ra:i==="webp"?Ca:null}const Fa=i=>i.current&&i.current.isScene,Ua=i=>Fa(i)?i.current:i;function Tr(i,t,n,c,u={}){var v,h,g,f;u={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...u};const m=Ua(t||n),x=m.background,T=m.environment,b={backgroundBlurriness:m.backgroundBlurriness,backgroundIntensity:m.backgroundIntensity,backgroundRotation:(v=(h=m.backgroundRotation)==null||h.clone==null?void 0:h.clone())!==null&&v!==void 0?v:[0,0,0],environmentIntensity:m.environmentIntensity,environmentRotation:(g=(f=m.environmentRotation)==null||f.clone==null?void 0:f.clone())!==null&&g!==void 0?g:[0,0,0]};return i!=="only"&&(m.environment=c),i&&(m.background=c),Br(m,u),()=>{i!=="only"&&(m.environment=T),i&&(m.background=x),Br(m,b)}}function Cr({scene:i,background:t=!1,map:n,...c}){const u=er(v=>v.scene);return oe.useLayoutEffect(()=>{if(n)return Tr(t,i,u,n,c)}),null}function et({background:i=!1,scene:t,blur:n,backgroundBlurriness:c,backgroundIntensity:u,backgroundRotation:v,environmentIntensity:h,environmentRotation:g,...f}){const m=hr(f),x=er(T=>T.scene);return oe.useLayoutEffect(()=>Tr(i,t,x,m,{backgroundBlurriness:n??c,backgroundIntensity:u,backgroundRotation:v,environmentIntensity:h,environmentRotation:g})),null}function Oa({children:i,near:t=.1,far:n=1e3,resolution:c=256,frames:u=1,map:v,background:h=!1,blur:g,backgroundBlurriness:f,backgroundIntensity:m,backgroundRotation:x,environmentIntensity:T,environmentRotation:b,scene:U,files:W,path:ee,preset:k=void 0,extensions:D}){const re=er(S=>S.gl),le=er(S=>S.scene),ce=oe.useRef(null),[z]=oe.useState(()=>new Hr),L=oe.useMemo(()=>{const S=new ea(c);return S.texture.type=Se,S},[c]);oe.useLayoutEffect(()=>{if(u===1){const S=re.autoClear;re.autoClear=!0,ce.current.update(re,z),re.autoClear=S}return Tr(h,U,le,L.texture,{backgroundBlurriness:g??f,backgroundIntensity:m,backgroundRotation:x,environmentIntensity:T,environmentRotation:b})},[i,z,L.texture,U,le,h,u,re]);let te=1;return Ft(()=>{if(u===1/0||teOt({GroundProjectedEnvImpl:ga}),[]);const g=oe.useMemo(()=>[h],[h]),f=(t=i.ground)==null?void 0:t.height,m=(n=i.ground)==null?void 0:n.radius,x=(c=(u=i.ground)==null?void 0:u.scale)!==null&&c!==void 0?c:1e3;return oe.createElement(oe.Fragment,null,oe.createElement(Cr,Nt({},i,{map:h})),oe.createElement("groundProjectedEnvImpl",{args:g,scale:x,height:f,radius:m}))}function ka(i){return i.ground?oe.createElement(Na,i):i.map?oe.createElement(Cr,i):i.children?oe.createElement(Oa,i):oe.createElement(et,i)}export{ka as E}; diff --git a/example/bundle/assets/EnvironmentControls-CJG7lPg-.js b/example/bundle/assets/EnvironmentControls-CJG7lPg-.js new file mode 100644 index 00000000..d1c7a676 --- /dev/null +++ b/example/bundle/assets/EnvironmentControls-CJG7lPg-.js @@ -0,0 +1,45 @@ +import{g as at,b5 as ct,b as ht,V as S,j as ot,an as lt,k as P,ao as nt,aE as pt,R as dt,s as ut,Q as rt,i as mt}from"./three.module-_fL2BuBc.js";class ft extends at{constructor(){super(new ct(0,0),new Pt),this.renderOrder=1/0}onBeforeRender(t){const e=this.material.uniforms;t.getSize(e.resolution.value)}updateMatrixWorld(){this.matrixWorld.makeTranslation(this.position)}dispose(){this.geometry.dispose(),this.material.dispose()}}class Pt extends ht{constructor(){super({depthWrite:!1,depthTest:!1,transparent:!0,uniforms:{resolution:{value:new S},size:{value:15},thickness:{value:2},opacity:{value:1}},vertexShader:` + + uniform float pixelRatio; + uniform float size; + uniform float thickness; + uniform vec2 resolution; + varying vec2 vUv; + + void main() { + + vUv = uv; + + float aspect = resolution.x / resolution.y; + vec2 offset = uv * 2.0 - vec2( 1.0 ); + offset.y *= aspect; + + vec4 screenPoint = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + screenPoint.xy += offset * ( size + thickness ) * screenPoint.w / resolution.x; + + gl_Position = screenPoint; + + } + `,fragmentShader:` + + uniform float size; + uniform float thickness; + uniform float opacity; + + varying vec2 vUv; + void main() { + + float ht = 0.5 * thickness; + float planeDim = size + thickness; + float offset = ( planeDim - ht - 2.0 ) / planeDim; + float texelThickness = ht / planeDim; + + vec2 vec = vUv * 2.0 - vec2( 1.0 ); + float dist = abs( length( vec ) - offset ); + float fw = fwidth( dist ) * 0.5; + float a = smoothstep( texelThickness - fw, texelThickness + fw, dist ); + + gl_FragColor = vec4( 1, 1, 1, opacity * ( 1.0 - a ) ); + + } + `})}}const Q=new S,Y=new S;class vt{constructor(){this.domElement=null,this.buttons=0,this.pointerType=null,this.pointerOrder=[],this.previousPositions={},this.pointerPositions={},this.startPositions={},this.pointerSetThisFrame={},this.hoverPosition=new S,this.hoverSet=!1}reset(){this.buttons=0,this.pointerType=null,this.pointerOrder=[],this.previousPositions={},this.pointerPositions={},this.startPositions={},this.pointerSetThisFrame={},this.hoverPosition=new S,this.hoverSet=!1}updateFrame(){const{previousPositions:t,pointerPositions:e}=this;for(const i in e)t[i].copy(e[i])}setHoverEvent(t){(t.pointerType==="mouse"||t.type==="wheel")&&(this.getAdjustedPointer(t,this.hoverPosition),this.hoverSet=!0)}getLatestPoint(t){return this.pointerType!==null?(this.getCenterPoint(t),t):this.hoverSet?(t.copy(this.hoverPosition),t):null}getAdjustedPointer(t,e){const s=(this.domElement?this.domElement:t.target).getBoundingClientRect(),n=t.clientX-s.left,a=t.clientY-s.top;e.set(n,a)}addPointer(t){const e=t.pointerId,i=new S;this.getAdjustedPointer(t,i),this.pointerOrder.push(e),this.pointerPositions[e]=i,this.previousPositions[e]=i.clone(),this.startPositions[e]=i.clone(),this.getPointerCount()===1&&(this.pointerType=t.pointerType,this.buttons=t.buttons)}updatePointer(t){const e=t.pointerId;return e in this.pointerPositions?(this.getAdjustedPointer(t,this.pointerPositions[e]),!0):!1}deletePointer(t){const e=t.pointerId,i=this.pointerOrder;i.splice(i.indexOf(e),1),delete this.pointerPositions[e],delete this.previousPositions[e],delete this.startPositions[e],this.getPointerCount.length===0&&(this.buttons=0,this.pointerType=null)}getPointerCount(){return this.pointerOrder.length}getCenterPoint(t,e=this.pointerPositions){const i=this.pointerOrder;if(this.getPointerCount()===1||this.getPointerType()==="mouse"){const s=i[0];return t.copy(e[s]),t}else if(this.getPointerCount()===2){const s=this.pointerOrder[0],n=this.pointerOrder[1],a=e[s],d=e[n];return t.addVectors(a,d).multiplyScalar(.5),t}return null}getPreviousCenterPoint(t){return this.getCenterPoint(t,this.previousPositions)}getStartCenterPoint(t){return this.getCenterPoint(t,this.startPositions)}getMoveDistance(){return this.getCenterPoint(Q),this.getPreviousCenterPoint(Y),Q.sub(Y).length()}getTouchPointerDistance(t=this.pointerPositions){if(this.getPointerCount()<=1||this.getPointerType()==="mouse")return 0;const{pointerOrder:e}=this,i=e[0],s=e[1],n=t[i],a=t[s];return n.distanceTo(a)}getPreviousTouchPointerDistance(){return this.getTouchPointerDistance(this.previousPositions)}getStartTouchPointerDistance(){return this.getTouchPointerDistance(this.startPositions)}getPointerType(){return this.pointerType}isPointerTouch(){return this.getPointerType()==="touch"}getPointerButtons(){return this.buttons}isLeftClicked(){return!!(this.buttons&1)}isRightClicked(){return!!(this.buttons&2)}}const x=new ot,$=new lt,q=new P;function A(p,t,e){return e.makeTranslation(-p.x,-p.y,-p.z),x.makeRotationFromQuaternion(t),e.premultiply(x),x.makeTranslation(p.x,p.y,p.z),e.premultiply(x),e}function R(p,t,e,i){i.x=(p-e.offsetLeft)/e.clientWidth*2-1,i.y=-((t-e.offsetTop)/e.clientHeight)*2+1,i.isVector3&&(i.z=0)}function Dt(p,t,e){return t.intersectRay(p,e)?e:(x.makeScale(...t.radius).invert(),$.copy(p).applyMatrix4(x),q.set(0,0,0),$.closestPointToPoint(q,e).normalize(),x.makeScale(...t.radius),e.applyMatrix4(x))}function Mt(p,t,e){const i=p.origin.length(),s=Math.acos(t/i);e.copy(p.origin).multiplyScalar(-1).normalize();const n=q.crossVectors(e,p.direction).normalize();e.multiplyScalar(-1).applyAxisAngle(n,-s).normalize().multiplyScalar(t)}function W(p,t,e){const{origin:i,direction:s}=p.ray;i.set(t.x,t.y,-1).unproject(e),s.set(t.x,t.y,1).unproject(e).sub(i),p.near=0,p.far=s.length(),p.camera=e,s.normalize()}const _=0,E=1,b=2,I=3,V=4,F=.05,Z=.025,gt=1e-4,yt=.01,D=new ot,U=new P,y=new P,j=new P,X=new P,z=new P,M=new rt,J=new nt,f=new P,H=new P,B=new P,St=new rt,L=new S,u=new S,K=new S,T=new S,N=new S,tt=new S,et={type:"change"},it={type:"start"},st={type:"end"};class xt extends pt{get enabled(){return this._enabled}set enabled(t){t!==this.enabled&&(this._enabled=t,this.resetState(),this.pointerTracker.reset(),this.enabled||(this.dragInertia.set(0,0,0),this.rotationInertia.set(0,0)))}constructor(t=null,e=null,i=null,s=null){super(),this.isEnvironmentControls=!0,this.domElement=null,this.camera=null,this.scene=null,this.tilesRenderer=null,this._enabled=!0,this.cameraRadius=5,this.rotationSpeed=1,this.minAltitude=0,this.maxAltitude=.45*Math.PI,this.minDistance=10,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.zoomSpeed=1,this.adjustHeight=!0,this.enableDamping=!1,this.dampingFactor=.15,this.reorientOnDrag=!0,this.scaleZoomOrientationAtEdges=!1,this.state=_,this.pointerTracker=new vt,this.needsUpdate=!1,this.actionHeightOffset=0,this.pivotPoint=new P,this.zoomDirectionSet=!1,this.zoomPointSet=!1,this.zoomDirection=new P,this.zoomPoint=new P,this.zoomDelta=0,this.rotationInertia=new S,this.dragInertia=new P,this.pivotMesh=new ft,this.pivotMesh.raycast=()=>{},this.pivotMesh.scale.setScalar(.25),this.raycaster=new dt,this.raycaster.firstHitOnly=!0,this.up=new P(0,1,0),this.clock=new ut,this.fallbackPlane=new nt(new P(0,1,0),0),this.useFallbackPlane=!0,this._detachCallback=null,this._upInitialized=!1,this._lastUsedState=_,this._zoomPointWasSet=!1,this._tilesOnChangeCallback=()=>this.zoomPointSet=!1,i&&this.attach(i),e&&this.setCamera(e),t&&this.setScene(t),s&&this.setTilesRenderer(s)}setScene(t){this.scene=t}setCamera(t){this.camera=t,this._upInitialized=!1,this.zoomDirectionSet=!1,this.zoomPointSet=!1,this.needsUpdate=!0,this.raycaster.camera=t,this.resetState()}setTilesRenderer(t){this.tilesRenderer&&this.tilesRenderer.removeEventListener("tile-visibility-change",this._tilesOnChangeCallback),this.tilesRenderer=t,this.tilesRenderer!==null&&(this.tilesRenderer.addEventListener("tile-visibility-change",this._tilesOnChangeCallback),this.scene===null&&this.setScene(this.tilesRenderer.group))}attach(t){if(this.domElement)throw new Error("EnvironmentControls: Controls already attached to element");this.domElement=t,this.pointerTracker.domElement=t,t.style.touchAction="none";let e=!1;const i=o=>{o.preventDefault()},s=o=>{o.key==="Shift"&&(e=!0)},n=o=>{o.key==="Shift"&&(e=!1)},a=o=>{o.preventDefault();const{camera:c,raycaster:l,domElement:C,up:k,pivotMesh:w,pointerTracker:g}=this;if(g.addPointer(o),this.needsUpdate=!0,g.isPointerTouch()){if(w.visible=!1,g.getPointerCount()===0)C.setPointerCapture(o.pointerId);else if(g.getPointerCount()>2){this.resetState();return}}g.getCenterPoint(u),R(u.x,u.y,C,u),W(l,u,c);const G=Math.abs(l.ray.direction.dot(k));if(G{o.preventDefault(),this.zoomDirectionSet=!1,this.zoomPointSet=!1,this.state!==_&&(this.needsUpdate=!0);const{pointerTracker:c}=this;c.setHoverEvent(o),c.updatePointer(o)&&(c.isPointerTouch()&&c.getPointerCount()===2&&(d||(d=!0,queueMicrotask(()=>{d=!1,c.getCenterPoint(N);const l=c.getStartTouchPointerDistance(),C=c.getTouchPointerDistance(),k=C-l;if(this.state===_||this.state===V){c.getCenterPoint(N),c.getStartCenterPoint(tt);const w=2*window.devicePixelRatio,g=N.distanceTo(tt);(Math.abs(k)>w||g>w)&&(Math.abs(k)>g?(this.setState(I),this.zoomDirectionSet=!1):this.setState(b))}if(this.state===I){const w=c.getPreviousTouchPointerDistance();this.zoomDelta+=C-w}else this.state===b&&(this.pivotMesh.visible=this.enabled)}))),this.dispatchEvent(et))},h=o=>{const{pointerTracker:c}=this;c.deletePointer(o),c.getPointerType()==="touch"&&c.getPointerCount()===0&&t.releasePointerCapture(o.pointerId),this.resetState(),this.needsUpdate=!0},v=o=>{o.preventDefault();const{pointerTracker:c}=this;c.setHoverEvent(o),c.updatePointer(o),this.dispatchEvent(it);let l;switch(o.deltaMode){case 2:l=o.deltaY*100;break;case 1:l=o.deltaY*16;break;case 0:l=o.deltaY;break}const C=Math.sign(l),k=Math.log(Math.abs(l)+1);this.zoomDelta-=3*C*k,this.needsUpdate=!0,this._lastUsedState=I,this.dispatchEvent(st)},r=o=>{const{pointerTracker:c}=this;e=!1,o.buttons!==c.getPointerButtons()&&(c.deletePointer(o),this.resetState())};t.addEventListener("contextmenu",i),t.addEventListener("keydown",s),t.addEventListener("keyup",n),t.addEventListener("pointerdown",a),t.addEventListener("pointermove",m),t.addEventListener("pointerup",h),t.addEventListener("wheel",v,{passive:!1}),t.addEventListener("pointerenter",r),this._detachCallback=()=>{t.removeEventListener("contextmenu",i),t.removeEventListener("keydown",s),t.removeEventListener("keyup",n),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",m),t.removeEventListener("pointerup",h),t.removeEventListener("wheel",v),t.removeEventListener("pointerenter",r)}}getUpDirection(t,e){e.copy(this.up)}getCameraUpDirection(t){this.getUpDirection(this.camera.position,t)}getPivotPoint(t){return this._lastUsedState===I?this._zoomPointWasSet?(t.copy(this.zoomPoint),t):null:this._lastUsedState===b||this._lastUsedState===E?(t.copy(this.pivotPoint),t):null}detach(){this.domElement=null,this._detachCallback&&(this._detachCallback(),this._detachCallback=null,this.pointerTracker.reset())}resetState(){this.state!==_&&this.dispatchEvent(st),this.state=_,this.pivotMesh.removeFromParent(),this.pivotMesh.visible=this.enabled,this.actionHeightOffset=0}setState(t=this.state,e=!0){this.state!==t&&(this.state===_&&e&&this.dispatchEvent(it),this.pivotMesh.visible=this.enabled,this.dragInertia.set(0,0,0),this.rotationInertia.set(0,0),this.state=t,t!==_&&t!==V&&(this._lastUsedState=t))}update(t=Math.min(this.clock.getDelta(),64/1e3)){if(!this.enabled||!this.camera||t===0)return;const{camera:e,cameraRadius:i,pivotPoint:s,up:n,state:a,adjustHeight:d}=this;e.updateMatrixWorld(),this.getCameraUpDirection(f),this._upInitialized||(this._upInitialized=!0,this.up.copy(f));const m=this._inertiaNeedsUpdate();if(this.needsUpdate||m){const r=this.zoomDelta;(a===I||r!==0)&&(this._updateZoom(),this.rotationInertia.set(0,0),this.dragInertia.set(0,0,0)),this._updatePosition(t),this._updateRotation(t),(a!==_||r!==0||m)&&this.dispatchEvent(et),this.needsUpdate=!1}m&&this._updateInertiaDamping(t);const h=e.isOrthographicCamera?null:d&&this._getPointBelowCamera()||null,v=e.isOrthographicCamera?s:h&&h.point||null;if(this.getCameraUpDirection(f),this._setFrame(f,v),(this.state===E||this.state===b)&&this.actionHeightOffset!==0){const{actionHeightOffset:r}=this;e.position.addScaledVector(n,-r),s.addScaledVector(n,-r),h&&(h.distance-=r)}if(this.actionHeightOffset=0,h){const r=h.distance;if(r0?1/Math.abs(c):c;l*=v,l>1?hi.zoom*l&&(l=1),i.zoom*=l,i.updateProjectionMatrix(),o&&(R(u.x,u.y,d,B),B.unproject(i),i.position.sub(B).add(H),i.updateMatrixWorld())}else{this._updateZoomDirection();const o=y.copy(e);if(this.zoomPointSet||this._updateZoomPoint()){const c=t.distanceTo(i.position);if(r<0){const l=Math.min(0,c-n);r=r*c*v*.0025,r=Math.max(r,l)}else{const l=Math.max(0,c-s);r=r*Math.max(c-s,0)*v*.0025,r=Math.min(r,l)}i.position.addScaledVector(e,r),i.updateMatrixWorld()}else{const c=this._getPointBelowCamera();if(c){const l=c.distance;o.set(0,0,-1).transformDirection(i.matrixWorld),i.position.addScaledVector(o,r*l*.01),i.updateMatrixWorld()}}}}_updateZoomDirection(){if(this.zoomDirectionSet)return;const{domElement:t,raycaster:e,camera:i,zoomDirection:s,pointerTracker:n}=this;n.getLatestPoint(u),R(u.x,u.y,t,H),W(e,H,i),s.copy(e.ray.direction).normalize(),this.zoomDirectionSet=!0}_updateZoomPoint(){const{camera:t,zoomDirectionSet:e,zoomDirection:i,raycaster:s,zoomPoint:n,pointerTracker:a,domElement:d}=this;if(this._zoomPointWasSet=!1,!e)return!1;t.isOrthographicCamera&&a.getLatestPoint(L)?(R(L.x,L.y,d,L),W(s,L,t)):(s.ray.origin.copy(t.position),s.ray.direction.copy(i),s.near=0,s.far=1/0);const m=this._raycast(s);return m?(n.copy(m.point),this.zoomPointSet=!0,this._zoomPointWasSet=!0,!0):!1}_getPointBelowCamera(t=this.camera.position,e=this.up){const{raycaster:i}=this;i.ray.direction.copy(e).multiplyScalar(-1),i.ray.origin.copy(t).addScaledVector(e,1e5),i.near=0,i.far=1/0;const s=this._raycast(i);return s&&(s.distance-=1e5),s}_updatePosition(t){const{raycaster:e,camera:i,pivotPoint:s,up:n,pointerTracker:a,domElement:d,state:m,dragInertia:h,enableDamping:v}=this;if(m===E){if(a.getCenterPoint(u),R(u.x,u.y,d,u),J.setFromNormalAndCoplanarPoint(n,s),W(e,u,i),Math.abs(e.ray.direction.dot(n))0?(h=Math.min(r-n-.01,h),h=Math.max(0,h)):(h=Math.max(r-a,h),h=Math.min(0,h)),M.setFromAxisAngle(f,m),A(i,M,D),s.matrixWorld.premultiply(D),z.set(-1,0,0).transformDirection(s.matrixWorld),M.setFromAxisAngle(z,h),A(i,M,D),s.matrixWorld.premultiply(D),s.matrixWorld.decompose(s.position,s.quaternion,y)}_setFrame(t,e){const{up:i,camera:s,state:n,zoomPoint:a,zoomDirectionSet:d,zoomPointSet:m,reorientOnDrag:h,scaleZoomOrientationAtEdges:v}=this;s.updateMatrixWorld(),M.setFromUnitVectors(i,t);const r=n;if(d&&(m||this._updateZoomPoint())){if(this.getUpDirection(a,y),v){let o=Math.max(y.dot(i)-.6,0)/.4;o=mt.mapLinear(o,0,.5,0,1),o=Math.min(o,1),s.isOrthographicCamera&&(o*=.1),M.slerp(St,1-o)}A(a,M,D),s.matrixWorld.premultiply(D),s.matrixWorld.decompose(s.position,s.quaternion,y),this.zoomDirectionSet=!1,this._updateZoomDirection()}else r===E&&h&&e&&(A(e,M,D),s.matrixWorld.premultiply(D),s.matrixWorld.decompose(s.position,s.quaternion,y));i.copy(t),s.updateMatrixWorld()}_raycast(t){const{scene:e,useFallbackPlane:i,fallbackPlane:s}=this,n=t.intersectObject(e)[0]||null;if(n)return n;if(i){const a=s;if(t.ray.intersectPlane(a,y))return{point:y.clone(),distance:t.ray.origin.distanceTo(y)}}return null}}export{E as D,xt as E,_ as N,R as a,Mt as b,Dt as c,A as m,W as s}; diff --git a/example/bundle/assets/GLTFExtensionLoader-BffG-g_T.js b/example/bundle/assets/GLTFExtensionLoader-BffG-g_T.js new file mode 100644 index 00000000..919586a3 --- /dev/null +++ b/example/bundle/assets/GLTFExtensionLoader-BffG-g_T.js @@ -0,0 +1 @@ +import{bm as l}from"./three.module-_fL2BuBc.js";import{G as d}from"./GLTFLoader-CFm4138C.js";import{L as p}from"./LoaderBase-CVSPpjX2.js";let u=class{constructor(){this.name="CESIUM_RTC"}afterRoot(e){if(e.parser.json.extensions&&e.parser.json.extensions.CESIUM_RTC){const{center:t}=e.parser.json.extensions.CESIUM_RTC;t&&(e.scene.position.x+=t[0],e.scene.position.y+=t[1],e.scene.position.z+=t[2])}}};class h extends u{constructor(...e){super(...e),console.warn('GLTFCesiumRTCExtension: Plugins should now be imported from "3d-tiles-renderer/plugins" path.')}}class T extends p{constructor(e=l){super(),this.manager=e}parse(e){return new Promise((t,a)=>{const o=this.manager,n=this.fetchOptions;let s=o.getHandler("path.gltf")||o.getHandler("path.glb");s||(s=new d(o),s.register(()=>new h)),n.credentials==="include"&&n.mode==="cors"&&s.setCrossOrigin("use-credentials"),"credentials"in n&&s.setWithCredentials(n.credentials==="include"),n.headers&&s.setRequestHeader(n.headers);let r=s.resourcePath||s.path||this.workingPath;!/[\\/]$/.test(r)&&r.length&&(r+="/"),s.parse(e,r,c=>{t(c)},a)})}}export{T as G,u as a}; diff --git a/example/bundle/assets/GLTFExtensionsPlugin-DuLOiCt_.js b/example/bundle/assets/GLTFExtensionsPlugin-DuLOiCt_.js new file mode 100644 index 00000000..d1dc7226 --- /dev/null +++ b/example/bundle/assets/GLTFExtensionsPlugin-DuLOiCt_.js @@ -0,0 +1,16 @@ +import{G as fe}from"./GLTFLoader-CFm4138C.js";import{j as he,aZ as de,r as re,k as me,V as T,O as pe,g as ye,ah as xe,aw as v,W as Te,aD as z,b as Ae,a_ as we,a$ as ge,b0 as Ee,p as ne,b1 as be,F as Ie}from"./three.module-_fL2BuBc.js";import{a as _e}from"./GLTFExtensionLoader-BffG-g_T.js";class B{constructor(e,s,t,r){B.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,s,t,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,s=0){for(let t=0;t<4;t++)this.elements[t]=e[t+s];return this}set(e,s,t,r){const n=this.elements;return n[0]=e,n[1]=t,n[2]=s,n[3]=r,this}}function y(i,e,s){return i&&e in i?i[e]:s}function ie(i){return i!=="BOOLEAN"&&i!=="STRING"&&i!=="ENUM"}function Ne(i){return/^FLOAT/.test(i)}function S(i){return/^VEC/.test(i)}function D(i){return/^MATRIX/.test(i)}function oe(i,e,s,t=null){return D(s)||S(s)?t.fromArray(i,e):i[e]}function U(i){const{type:e,componentType:s}=i;switch(e){case"SCALAR":return s==="INT64"?0n:0;case"VEC2":return new T;case"VEC3":return new me;case"VEC4":return new re;case"MAT2":return new B;case"MAT3":return new de;case"MAT4":return new he;case"BOOLEAN":return!1;case"STRING":return"";case"ENUM":return 0}}function k(i,e){if(e==null)return!1;switch(i){case"SCALAR":return typeof e=="number"||typeof e=="bigint";case"VEC2":return e.isVector2;case"VEC3":return e.isVector3;case"VEC4":return e.isVector4;case"MAT2":return e.isMatrix2;case"MAT3":return e.isMatrix3;case"MAT4":return e.isMatrix4;case"BOOLEAN":return typeof e=="boolean";case"STRING":return typeof e=="string";case"ENUM":return typeof e=="number"||typeof e=="bigint"}throw new Error("ClassProperty: invalid type.")}function O(i,e=null){switch(i){case"INT8":return Int8Array;case"INT16":return Int16Array;case"INT32":return Int32Array;case"INT64":return BigInt64Array;case"UINT8":return Uint8Array;case"UINT16":return Uint16Array;case"UINT32":return Uint32Array;case"UINT64":return BigUint64Array;case"FLOAT32":return Float32Array;case"FLOAT64":return Float64Array}switch(e){case"BOOLEAN":return Uint8Array;case"STRING":return Uint8Array}throw new Error("ClassProperty: invalid type.")}function Oe(i,e=null){if(i.array){e=e&&Array.isArray(e)?e:[],e.length=i.count;for(let t=0,r=e.length;to.value===r);return n===null?"":n.name}}adjustValueScaleOffset(e){return ie(this.type)?Re(this,e):e}}class G{constructor(e,s={},t={},r=null){this.definition=e,this.class=s[e.class],this.className=e.class,this.enums=t,this.data=r,this.name="name"in e?e.name:null,this.properties=null}getPropertyNames(){return Object.keys(this.class.properties)}includesData(e){return!!this.definition.properties[e]}dispose(){}_initProperties(e=M){const s={};for(const t in this.class.properties)s[t]=new e(this.enums,this.class.properties[t],this.definition.properties[t]);this.properties=s}}class Ve extends M{constructor(e,s,t=null){super(e,s,t),this.attribute=t.attribute}}class Me extends G{constructor(...e){super(...e),this.isPropertyAttributeAccessor=!0,this._initProperties(Ve)}getData(e,s,t={}){const r=this.properties;C(r,t);for(const n in r)t[n]=this.getPropertyValue(n,e,s,t[n]);return t}getPropertyValue(e,s,t,r=null){if(s>=this.count)throw new Error("PropertyAttributeAccessor: Requested index is outside the range of the buffer.");const n=this.properties[e],o=n.type;if(n){if(!this.definition.properties[e])return n.resolveDefault(r)}else throw new Error("PropertyAttributeAccessor: Requested class property does not exist.");r=n.shapeToProperty(r);const a=t.getAttribute(n.attribute.toLowerCase());if(D(o)){const c=r.elements;for(let f=0,m=c.length;f>h&1)===1}return r}getPropertyValue(e,s,t=null){if(s>=this.count)throw new Error("PropertyTableAccessor: Requested index is outside the range of the table.");const r=this.properties[e];if(r){if(!this.definition.properties[e])return r.resolveDefault(t)}else throw new Error("PropertyTableAccessor: Requested property does not exist.");const n=r.array,o=this.data,a=r.getArrayLengthFromId(o,s);if(t=r.shapeToProperty(t,a),n)for(let c=0,f=t.length;c=165,Ge=parseInt(ne)>=166,_=new be,X=new re,F=new T,g=new class{constructor(){this._renderer=new Te,this._target=new z(1,1),this._texTarget=new z,this._quad=new je(new Ae({blending:we,blendDst:ge,blendSrc:Ee,uniforms:{map:{value:null},pixel:{value:new T}},vertexShader:` + void main() { + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + } + `,fragmentShader:` + uniform sampler2D map; + uniform ivec2 pixel; + + void main() { + + gl_FragColor = texelFetch( map, pixel, 0 ); + + } + `}))}increaseSizeTo(i){this._target.setSize(Math.max(this._target.width,i),1)}readDataAsync(i){const{_renderer:e,_target:s}=this;return q?e.readRenderTargetPixelsAsync(s,0,0,i.length/4,1,i):Promise.resolve().then(()=>this.readData(i))}readData(i){const{_renderer:e,_target:s}=this;e.readRenderTargetPixels(s,0,0,i.length/4,1,i)}renderPixelToTarget(i,e,s){const{_quad:t,_renderer:r,_target:n,_texTarget:o}=this;if(Ge)_.min.copy(e),_.max.copy(e),_.max.x+=1,_.max.y+=1,r.initRenderTarget(n),r.copyTextureToTexture(i,n.texture,_,s,0);else{const a=r.autoClear,c=r.getRenderTarget(),f=r.getScissorTest();r.getScissor(X),o.setSize(i.image.width,i.image.height),r.setRenderTarget(o),F.set(0,0),q?r.copyTextureToTexture(i,o.texture,null,F):r.copyTextureToTexture(F,i,o.texture),t.material.uniforms.map.value=o.texture,t.material.uniforms.pixel.value.copy(e),r.setRenderTarget(n),r.setScissorTest(!0),r.setScissor(s.x,s.y,1,1),r.autoClear=!1,t.render(r),r.setScissorTest(f),r.setScissor(X),r.setRenderTarget(c),r.autoClear=a,o.dispose()}}},$=new T,H=new T,Q=new T;function ve(i,e){return e===0?i.getAttribute("uv"):i.getAttribute(`uv${e}`)}function ae(i,e,s=new Array(3)){let t=3*e,r=3*e+1,n=3*e+2;return i.index&&(t=i.index.getX(t),r=i.index.getX(r),n=i.index.getX(n)),s[0]=t,s[1]=r,s[2]=n,s}function ce(i,e,s,t,r){const[n,o,a]=t,c=ve(i,e);$.fromBufferAttribute(c,n),H.fromBufferAttribute(c,o),Q.fromBufferAttribute(c,a),r.set(0,0,0).addScaledVector($,s.x).addScaledVector(H,s.y).addScaledVector(Q,s.z)}function ue(i,e,s,t){const r=i.x-Math.floor(i.x),n=i.y-Math.floor(i.y),o=Math.floor(r*e%e),a=Math.floor(n*s%s);return t.set(o,a),t}const W=new T,Z=new T,K=new T;class ze extends M{constructor(e,s,t=null){super(e,s,t),this.channels=y(t,"channels",[0]),this.index=y(t,"index",null),this.texCoord=y(t,"texCoord",null),this.valueLength=parseInt(this.type.replace(/[^0-9]/g,""))||1}readDataFromBuffer(e,s,t=null){const r=this.type;if(r==="BOOLEAN"||r==="STRING")throw new Error("PropertyTextureAccessor: BOOLEAN and STRING types not supported.");return oe(e,s*this.valueLength,r,t)}}class ke extends G{constructor(...e){super(...e),this.isPropertyTextureAccessor=!0,this._asyncRead=!1,this._initProperties(ze)}getData(e,s,t,r={}){const n=this.properties;C(n,r);const o=Object.keys(n),a=o.map(c=>r[c]);return this.getPropertyValuesAtTexel(o,e,s,t,a),o.forEach((c,f)=>r[c]=a[f]),r}async getDataAsync(e,s,t,r={}){const n=this.properties;C(n,r);const o=Object.keys(n),a=o.map(c=>r[c]);return await this.getPropertyValuesAtTexelAsync(o,e,s,t,a),o.forEach((c,f)=>r[c]=a[f]),r}getPropertyValuesAtTexelAsync(...e){this._asyncRead=!0;const s=this.getPropertyValuesAtTexel(...e);return this._asyncRead=!1,s}getPropertyValuesAtTexel(e,s,t,r,n=[]){for(;n.length(u.call(this),n));return g.readData(m),u.call(this),n;function u(){for(let l=0,d=e.length;lm[4*l+b]),w=h.componentType,L=O(w,x),P=new L(A);if(new Uint8Array(P.buffer).set(E),h.array){const b=n[l];for(let I=0,le=b.length;I{e&&(e.dispose(),e.image instanceof ImageBitmap&&e.image.close())})}}class J{constructor(e,s,t,r=null,n=null){const{schema:o,propertyTables:a=[],propertyTextures:c=[],propertyAttributes:f=[]}=e,{enums:m,classes:u}=o,l=a.map(h=>new Pe(h,u,m,t));let d=[],p=[];r&&(r.propertyTextures&&(d=r.propertyTextures.map(h=>new ke(c[h],u,m,s))),r.propertyAttributes&&(p=r.propertyAttributes.map(h=>new Me(f[h],u,m)))),this.schema=o,this.tableAccessors=l,this.textureAccessors=d,this.attributeAccessors=p,this.object=n,this.textures=s,this.nodeMetadata=r}getPropertyTableData(e,s,t=null){if(!Array.isArray(e)||!Array.isArray(s))t=t||{},t=this.tableAccessors[e].getData(s,t);else{t=t||[];const r=Math.min(e.length,s.length);t.length=r;for(let n=0;nt)),Array.isArray(e))return e.map(s=>{const t=this.tableAccessors[s];return{name:t.name,className:t.definition.class}});{const s=this.tableAccessors[e];return{name:s.name,className:s.definition.class}}}getPropertyTextureData(e,s,t=[]){const r=this.textureAccessors;t.length=r.length;for(let n=0;n{t[o]=f});n.push(c)}return await Promise.all(n),t}getPropertyTextureInfo(){return this.textureAccessors}getPropertyAttributeData(e,s=[]){const t=this.attributeAccessors;s.length=t.length;for(let r=0;r({name:e.name,className:e.definition.class}))}dispose(){this.textureAccessors.forEach(e=>e.dispose()),this.tableAccessors.forEach(e=>e.dispose()),this.attributeAccessors.forEach(e=>e.dispose())}}const N="EXT_structural_metadata";function qe(i,e=[]){var r;const s=((r=i.json.textures)==null?void 0:r.length)||0,t=new Array(s).fill(null);return e.forEach(({properties:n})=>{for(const o in n){const{index:a}=n[o];t[a]===null&&(t[a]=i.loadTexture(a))}}),Promise.all(t)}function Xe(i,e=[]){var r;const s=((r=i.json.bufferViews)==null?void 0:r.length)||0,t=new Array(s).fill(null);return e.forEach(({properties:n})=>{for(const o in n){const{values:a,arrayOffsets:c,stringOffsets:f}=n[o];t[a]===null&&(t[a]=i.loadBufferView(a)),t[c]===null&&(t[c]=i.loadBufferView(c)),t[f]===null&&(t[f]=i.loadBufferView(f))}}),Promise.all(t)}class $e{constructor(e){this.parser=e,this.name=N}async afterRoot({scene:e,parser:s}){const t=s.json.extensionsUsed;if(!t||!t.includes(N))return;let r=null,n=s.json.extensions[N];if(n.schemaUri){const{manager:f,path:m,requestHeader:u,crossOrigin:l}=s.options,d=new URL(n.schemaUri,m).toString(),p=new Ie(f);p.setCrossOrigin(l),p.setResponseType("json"),p.setRequestHeader(u),r=p.loadAsync(d).then(h=>{n={...n,schema:h}})}const[o,a]=await Promise.all([qe(s,n.propertyTextures),Xe(s,n.propertyTables),r]),c=new J(n,o,a);e.userData.structuralMetadata=c,e.traverse(f=>{if(s.associations.has(f)){const{meshes:m,primitives:u}=s.associations.get(f),l=s.json.meshes[m].primitives[u];if(l&&l.extensions&&l.extensions[N]){const d=l.extensions[N];f.userData.structuralMetadata=new J(n,o,a,d,f)}else f.userData.structuralMetadata=c}})}}const Y=new T,ee=new T,te=new T;function He(i){return i.x>i.y&&i.x>i.z?0:i.y>i.z?1:2}class Qe{constructor(e,s,t){this.geometry=e,this.textures=s,this.data=t,this._asyncRead=!1,this.featureIds=t.featureIds.map(r=>{const{texture:n,...o}=r,a={label:null,propertyTable:null,nullFeatureId:null,...o};return n&&(a.texture={texCoord:0,channels:[0],...n}),a})}getTextures(){return this.textures}getFeatureInfo(){return this.featureIds}getFeaturesAsync(...e){this._asyncRead=!0;const s=this.getFeatures(...e);return this._asyncRead=!1,s}getFeatures(e,s){const{geometry:t,textures:r,featureIds:n}=this,o=new Array(n.length).fill(null),a=n.length;g.increaseSizeTo(a);const c=ae(t,e),f=c[He(s)];for(let l=0,d=n.length;l(u(),o));return g.readData(m),u(),o;function u(){const l=new Uint32Array(1);for(let d=0,p=n.length;dm[4*d+L]);new Uint8Array(l.buffer).set(E);const w=l[0];w!==x&&(o[d]=w)}}}}dispose(){this.textures.forEach(e=>{e&&(e.dispose(),e.image instanceof ImageBitmap&&e.image.close())})}}const V="EXT_mesh_features";function se(i,e,s){i.traverse(t=>{if(e.associations.has(t)){const{meshes:r,primitives:n}=e.associations.get(t),o=e.json.meshes[r].primitives[n];o&&o.extensions&&o.extensions[V]&&s(t,o.extensions[V])}})}class We{constructor(e){this.parser=e,this.name=V}async afterRoot({scene:e,parser:s}){var a;const t=s.json.extensionsUsed;if(!t||!t.includes(V))return;const r=((a=s.json.textures)==null?void 0:a.length)||0,n=new Array(r).fill(null);se(e,s,(c,{featureIds:f})=>{f.forEach(m=>{if(m.texture&&n[m.texture.index]===null){const u=m.texture.index;n[u]=s.loadTexture(u)}})});const o=await Promise.all(n);se(e,s,(c,f)=>{c.userData.meshFeatures=new Qe(c.geometry,o,f)})}}class Ye{constructor(e){e={metadata:!0,rtc:!0,plugins:[],dracoLoader:null,ktxLoader:null,meshoptDecoder:null,autoDispose:!0,...e},this.tiles=null,this.metadata=e.metadata,this.rtc=e.rtc,this.plugins=e.plugins,this.dracoLoader=e.dracoLoader,this.ktxLoader=e.ktxLoader,this.meshoptDecoder=e.meshoptDecoder,this._gltfRegex=/\.(gltf|glb)$/g,this._dracoRegex=/\.drc$/g,this._loader=null}init(e){const s=new fe(e.manager);this.dracoLoader&&(s.setDRACOLoader(this.dracoLoader),e.manager.addHandler(this._dracoRegex,this.dracoLoader)),this.ktxLoader&&s.setKTX2Loader(this.ktxLoader),this.meshoptDecoder&&s.setMeshoptDecoder(this.meshoptDecoder),this.rtc&&s.register(()=>new _e),this.metadata&&(s.register(()=>new $e),s.register(()=>new We)),this.plugins.forEach(t=>s.register(t)),e.manager.addHandler(this._gltfRegex,s),this.tiles=e,this._loader=s}dispose(){this.tiles.manager.removeHandler(this._gltfRegex),this.tiles.manager.removeHandler(this._dracoRegex),this.autoDispose&&(this.ktxLoader.dispose(),this.dracoLoader.dispose())}}export{je as F,Ye as G}; diff --git a/example/bundle/assets/GLTFLoader-CFm4138C.js b/example/bundle/assets/GLTFLoader-CFm4138C.js new file mode 100644 index 00000000..22e50113 --- /dev/null +++ b/example/bundle/assets/GLTFLoader-CFm4138C.js @@ -0,0 +1 @@ +import{bo as Ee,bp as W,bq as le,k as M,ai as v,t as _e,br as G,F as fe,C as D,a3 as O,bs as Le,bt as be,D as Me,n as B,a2 as U,aW as N,V as he,bn as Se,bu as we,at as de,ad as ye,ac as Ne,aT as Ie,x as Y,y as pe,bv as Q,aG as me,af as Oe,aN as K,aj as Ce,M as Ae,aL as Fe,bw as De,ah as Pe,bx as ke,g as He,ag as Be,ay as Ge,by as Ue,bz as ve,G as V,a as je,i as Ke,O as Ve,bA as Xe,bB as ze,bC as qe,bD as ge,aY as ee,j,Q as Te,bE as We,bF as Ye,bG as Qe,aR as Ze,bH as Je,bI as $e,aM as et,aU as tt,aO as te,bJ as ne,bK as se,bL as re,B as nt,d as st,bM as rt}from"./three.module-_fL2BuBc.js";function Ut(f){let t=0;for(const i in f.attributes){const n=f.getAttribute(i);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}const e=f.getIndex();return t+=e?e.count*e.itemSize*e.array.BYTES_PER_ELEMENT:0,t}function ie(f,t){if(t===Ee)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===W||t===le){let e=f.getIndex();if(e===null){const s=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;oe&&o.add($)}o.normalize(),m.setXYZ(A+_,o.x,o.y,o.z)}}return l.setAttribute("normal",m),l}class jt extends _e{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new ut(e)}),this.register(function(e){return new lt(e)}),this.register(function(e){return new xt(e)}),this.register(function(e){return new Rt(e)}),this.register(function(e){return new Et(e)}),this.register(function(e){return new ht(e)}),this.register(function(e){return new dt(e)}),this.register(function(e){return new pt(e)}),this.register(function(e){return new mt(e)}),this.register(function(e){return new ct(e)}),this.register(function(e){return new At(e)}),this.register(function(e){return new ft(e)}),this.register(function(e){return new Tt(e)}),this.register(function(e){return new gt(e)}),this.register(function(e){return new ot(e)}),this.register(function(e){return new _t(e)}),this.register(function(e){return new Lt(e)})}load(t,e,i,n){const r=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const c=G.extractUrlBase(t);s=G.resolveURL(c,this.path)}else s=G.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),r.manager.itemError(t),r.manager.itemEnd(t)},o=new fe(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{r.parse(c,s,function(l){e(l),r.manager.itemEnd(t)},a)}catch(l){a(l)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let r;const s={},a={},o=new TextDecoder;if(typeof t=="string")r=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===xe){try{s[T.KHR_BINARY_GLTF]=new bt(t)}catch(u){n&&n(u);return}r=JSON.parse(s[T.KHR_BINARY_GLTF].content)}else r=JSON.parse(o.decode(t));else r=t;if(r.asset===void 0||r.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Ht(r,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(s),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,r){i.parse(t,e,n,r)})}}function it(){let f={};return{get:function(t){return f[t]},add:function(t,e){f[t]=e},remove:function(t){delete f[t]},removeAll:function(){f={}}}}const T={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ot{constructor(t){this.parser=t,this.name=T.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,s)}}class Rt{constructor(t){this.parser=t,this.name=T.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;const s=r.extensions[e],a=n.images[s.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,s.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class Et{constructor(t){this.parser=t,this.name=T.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;const s=r.extensions[e],a=n.images[s.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,s.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class _t{constructor(t){this.name=T.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],r=this.parser.getDependency("buffer",n.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const o=n.byteOffset||0,c=n.byteLength||0,l=n.count,u=n.byteStride,h=new Uint8Array(a,o,c);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(l,u,h,n.mode,n.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(l*u);return s.decodeGltfBuffer(new Uint8Array(d),l,u,h,n.mode,n.filter),d})})}else return null}}class Lt{constructor(t){this.name=T.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==y.TRIANGLES&&c.mode!==y.TRIANGLE_STRIP&&c.mode!==y.TRIANGLE_FAN&&c.mode!==void 0)return null;const s=i.extensions[this.name].attributes,a=[],o={};for(const c in s)a.push(this.parser.getDependency("accessor",s[c]).then(l=>(o[c]=l,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const l=c.pop(),u=l.isGroup?l.children:[l],h=c[0].count,d=[];for(const m of u){const g=new j,p=new M,A=new Te,R=new M(1,1,1),E=new Se(m.geometry,m.material,h);for(let x=0;x0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const kt=new j;class Ht{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new it,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,n=-1,r=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,r=a.indexOf("Firefox")>-1,s=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||r&&s<98?this.textureLoader=new ye(this.options.manager):this.textureLoader=new Ne(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new fe(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(s){const a={scene:s[0][n.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:n.asset,parser:i,userData:{}};return F(r,a,n),I(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,r=e.length;n{const o=this.associations.get(s);o!=null&&this.associations.set(a,o);for(const[c,l]of s.children.entries())r(l,a.children[c])};return r(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i=2&&p.setY(w,b[L*o+1]),o>=3&&p.setZ(w,b[L*o+2]),o>=4&&p.setW(w,b[L*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}p.normalized=m}return p})}loadTexture(t){const e=this.json,i=this.options,r=e.textures[t].source,s=e.images[r];let a=this.textureLoader;if(s.uri){const o=i.manager.getHandler(s.uri);o!==null&&(a=o)}return this.loadTextureImage(t,r,a)}loadTextureImage(t,e,i){const n=this,r=this.json,s=r.textures[t],a=r.images[e],o=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(l){l.flipY=!1,l.name=s.name||a.name||"",l.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(l.name=a.uri);const h=(r.samplers||{})[s.sampler]||{};return l.magFilter=ae[h.magFilter]||Y,l.minFilter=ae[h.minFilter]||pe,l.wrapS=ce[h.wrapS]||Q,l.wrapT=ce[h.wrapT]||Q,l.generateMipmaps=!l.isCompressedTexture&&l.minFilter!==me&&l.minFilter!==Y,n.associations.set(l,{textures:t}),l}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,r=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());const s=n.images[t],a=self.URL||self.webkitURL;let o=s.uri||"",c=!1;if(s.bufferView!==void 0)o=i.getDependency("bufferView",s.bufferView).then(function(u){c=!0;const h=new Blob([u],{type:s.mimeType});return o=a.createObjectURL(h),o});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const l=Promise.resolve(o).then(function(u){return new Promise(function(h,d){let m=h;e.isImageBitmapLoader===!0&&(m=function(g){const p=new te(g);p.needsUpdate=!0,h(p)}),e.load(G.resolveURL(u,r.path),m,void 0,d)})}).then(function(u){return c===!0&&a.revokeObjectURL(o),I(u,s),u.userData.mimeType=s.mimeType||Pt(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),u});return this.sourceCache[t]=l,l}assignTexture(t,e,i,n){const r=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(s=s.clone(),s.channel=i.texCoord),r.extensions[T.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[T.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=r.associations.get(s);s=r.extensions[T.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),r.associations.set(s,o)}}return n!==void 0&&(s.colorSpace=n),t[e]=s,s})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,r=e.attributes.color!==void 0,s=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new Oe,K.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new Ce,K.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||r||s){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),r&&(o.vertexColors=!0),s&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return Ae}loadMaterial(t){const e=this,i=this.json,n=this.extensions,r=i.materials[t];let s;const a={},o=r.extensions||{},c=[];if(o[T.KHR_MATERIALS_UNLIT]){const u=n[T.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),c.push(u.extendParams(a,r,e))}else{const u=r.pbrMetallicRoughness||{};if(a.color=new D(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const h=u.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],O),a.opacity=h[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",u.baseColorTexture,U)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),s=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(t,a)})))}r.doubleSided===!0&&(a.side=Fe);const l=r.alphaMode||z.OPAQUE;if(l===z.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===z.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&s!==B&&(c.push(e.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new he(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;a.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&s!==B&&(c.push(e.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&s!==B){const u=r.emissiveFactor;a.emissive=new D().setRGB(u[0],u[1],u[2],O)}return r.emissiveTexture!==void 0&&s!==B&&c.push(e.assignTexture(a,"emissiveMap",r.emissiveTexture,U)),Promise.all(c).then(function(){const u=new s(a);return r.name&&(u.name=r.name),I(u,r),e.associations.set(u,{materials:t}),r.extensions&&F(n,u,r),u})}createUniqueName(t){const e=De.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function r(a){return i[T.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return ue(o,a,e)})}const s=[];for(let a=0,o=t.length;a0&&Ft(A,r),A.name=e.createUniqueName(r.name||"mesh_"+t),I(A,r),p.extensions&&F(n,A,p),e.assignFinalMaterial(A),u.push(A)}for(let d=0,m=u.length;d1?l=new V:c.length===1?l=c[0]:l=new de,l!==c[0])for(let u=0,h=c.length;u{const u=new Map;for(const[h,d]of n.associations)(h instanceof K||h instanceof te)&&u.set(h,d);return l.traverse(h=>{const d=n.associations.get(h);d!=null&&u.set(h,d)}),u};return n.associations=c(r),r})}_createAnimationTracks(t,e,i,n,r){const s=[],a=t.name?t.name:t.uuid,o=[];C[r.path]===C.weights?t.traverse(function(h){h.morphTargetInfluences&&o.push(h.name?h.name:h.uuid)}):o.push(a);let c;switch(C[r.path]){case C.weights:c=se;break;case C.rotation:c=re;break;case C.position:case C.scale:c=ne;break;default:switch(i.itemSize){case 1:c=se;break;case 2:case 3:default:c=ne;break}break}const l=n.interpolation!==void 0?It[n.interpolation]:ge,u=this._getArrayFromAccessor(i);for(let h=0,d=o.length;hl.size),s=y(l=>l.viewport),f=typeof n=="number"?n:o.width*s.dpr,i=o.height*s.dpr,r=(typeof n=="number"?u:n)||{},{samples:c=0,depth:g,...p}=r,m=e.useMemo(()=>{const l=new X(f,i,{minFilter:O,magFilter:O,type:Y,...p});return g&&(l.depthTexture=new B(f,i,V)),l.samples=c,l},[]);return e.useLayoutEffect(()=>{m.setSize(f,i),c&&(m.samples=c)},[c,m,f,i]),e.useEffect(()=>()=>m.dispose(),[]),m}const $=n=>typeof n=="function",ee=e.forwardRef(({envMap:n,resolution:d=256,frames:u=1/0,children:o,makeDefault:s,...f},i)=>{const r=y(({set:t})=>t),c=y(({camera:t})=>t),g=y(({size:t})=>t),p=e.useRef(null);e.useImperativeHandle(i,()=>p.current,[]);const m=e.useRef(null),l=U(d);e.useLayoutEffect(()=>{f.manual||p.current.updateProjectionMatrix()},[g,f]),e.useLayoutEffect(()=>{p.current.updateProjectionMatrix()}),e.useLayoutEffect(()=>{if(s){const t=c;return r(()=>({camera:p.current})),()=>r(()=>({camera:t}))}},[p,s,r]);let h=0,E=null;const a=$(o);return S(t=>{a&&(u===1/0||h{i=o.autoClear,u===1&&(o.autoClear=!0,o.render(n,d)),o.autoClear=!1,o.clearDepth(),o.render(s,f),o.autoClear=i},u),e.createElement("group",{onPointerOver:()=>null})}function ne({children:n,renderPriority:d=1}){const{scene:u,camera:o}=y(),[s]=e.useState(()=>new Z);return e.createElement(e.Fragment,null,Q(e.createElement(e.Fragment,null,n,e.createElement(te,{defaultScene:u,defaultCamera:o,renderPriority:d})),s,{events:{priority:d+1}}))}const G=e.createContext({}),re=()=>e.useContext(G),oe=2*Math.PI,H=new J,I=new K,[v,R]=[new A,new A],L=new P,k=new P,ae=n=>"minPolarAngle"in n,q=n=>"getTarget"in n,ie=({alignment:n="bottom-right",margin:d=[80,80],renderPriority:u=1,onUpdate:o,onTarget:s,children:f})=>{const i=y(x=>x.size),r=y(x=>x.camera),c=y(x=>x.controls),g=y(x=>x.invalidate),p=e.useRef(null),m=e.useRef(null),l=e.useRef(!1),h=e.useRef(0),E=e.useRef(new P(0,0,0)),a=e.useRef(new P(0,0,0));e.useEffect(()=>{a.current.copy(r.up)},[r]);const t=e.useCallback(x=>{l.current=!0,(c||s)&&(E.current=(s==null?void 0:s())||(q(c)?c.getTarget(E.current):c==null?void 0:c.target)),h.current=r.position.distanceTo(L),v.copy(r.quaternion),k.copy(x).multiplyScalar(h.current).add(L),H.lookAt(k),R.copy(H.quaternion),g()},[c,r,s,g]);S((x,T)=>{if(m.current&&p.current){var b;if(l.current)if(v.angleTo(R)<.01)l.current=!1,ae(c)&&r.up.copy(a.current);else{const _=T*oe;v.rotateTowards(R,_),r.position.set(0,0,1).applyQuaternion(v).multiplyScalar(h.current).add(E.current),r.up.set(0,1,0).applyQuaternion(v).normalize(),r.quaternion.copy(v),q(c)&&c.setPosition(r.position.x,r.position.y,r.position.z),o?o():c&&c.update(T),g()}I.copy(r.matrix).invert(),(b=p.current)==null||b.quaternion.setFromRotationMatrix(I)}});const j=e.useMemo(()=>({tweenCamera:t}),[t]),[F,z]=d,D=n.endsWith("-center")?0:n.endsWith("-left")?-i.width/2+F:i.width/2-F,W=n.startsWith("center-")?0:n.startsWith("top-")?i.height/2-z:-i.height/2+z;return e.createElement(ne,{renderPriority:u},e.createElement(G.Provider,{value:j},e.createElement(ee,{makeDefault:!0,ref:m,position:[0,0,200]}),e.createElement("group",{ref:p,position:[D,W,0]},f)))};function M({scale:n=[.8,.05,.05],color:d,rotation:u}){return e.createElement("group",{rotation:u},e.createElement("mesh",{position:[.4,0,0]},e.createElement("boxGeometry",{args:n}),e.createElement("meshBasicMaterial",{color:d,toneMapped:!1})))}function w({onClick:n,font:d,disabled:u,arcStyle:o,label:s,labelColor:f,axisHeadScale:i=1,...r}){const c=y(a=>a.gl),g=e.useMemo(()=>{const a=document.createElement("canvas");a.width=64,a.height=64;const t=a.getContext("2d");return t.beginPath(),t.arc(32,32,16,0,2*Math.PI),t.closePath(),t.fillStyle=o,t.fill(),s&&(t.font=d,t.textAlign="center",t.fillStyle=f,t.fillText(s,32,41)),new N(a)},[o,s,f,d]),[p,m]=e.useState(!1),l=(s?1:.75)*(p?1.2:1)*i,h=a=>{a.stopPropagation(),m(!0)},E=a=>{a.stopPropagation(),m(!1)};return e.createElement("sprite",C({scale:l,onPointerOver:u?void 0:h,onPointerOut:u?void 0:n||E},r),e.createElement("spriteMaterial",{map:g,"map-anisotropy":c.capabilities.getMaxAnisotropy()||1,alphaTest:.3,opacity:s?1:.75,toneMapped:!1}))}const le=({hideNegativeAxes:n,hideAxisHeads:d,disabled:u,font:o="18px Inter var, Arial, sans-serif",axisColors:s=["#ff2060","#20df80","#2080ff"],axisHeadScale:f=1,axisScale:i,labels:r=["X","Y","Z"],labelColor:c="#000",onClick:g,...p})=>{const[m,l,h]=s,{tweenCamera:E}=re(),a={font:o,disabled:u,labelColor:c,onClick:g,axisHeadScale:f,onPointerDown:u?void 0:t=>{E(t.object.position),t.stopPropagation()}};return e.createElement("group",C({scale:40},p),e.createElement(M,{color:m,rotation:[0,0,0],scale:i}),e.createElement(M,{color:l,rotation:[0,0,Math.PI/2],scale:i}),e.createElement(M,{color:h,rotation:[0,-Math.PI/2,0],scale:i}),!d&&e.createElement(e.Fragment,null,e.createElement(w,C({arcStyle:m,position:[1,0,0],label:r[0]},a)),e.createElement(w,C({arcStyle:l,position:[0,1,0],label:r[1]},a)),e.createElement(w,C({arcStyle:h,position:[0,0,1],label:r[2]},a)),!n&&e.createElement(e.Fragment,null,e.createElement(w,C({arcStyle:m,position:[-1,0,0]},a)),e.createElement(w,C({arcStyle:l,position:[0,-1,0]},a)),e.createElement(w,C({arcStyle:h,position:[0,0,-1]},a)))))};export{ie as G,le as a,U as u}; diff --git a/example/bundle/assets/GlobeControls-5ygGpakr.js b/example/bundle/assets/GlobeControls-5ygGpakr.js new file mode 100644 index 00000000..a3336f26 --- /dev/null +++ b/example/bundle/assets/GlobeControls-5ygGpakr.js @@ -0,0 +1 @@ +import{j as S,k as _,an as A,V as F,Q as G,i as l}from"./three.module-_fL2BuBc.js";import{E as N,c as z,N as Z,D as j,m as w,a as H,s as L,b as q}from"./EnvironmentControls-CJG7lPg-.js";import{E as k}from"./Ellipsoid-CKpUFSOi.js";const p=new S,C=new S,f=new _,s=new _,y=new _,c=new _,R=new _,v=new _,V=new _,u=new G,b=new _,D=new _,E={},g=new A,T=new k,P=new F,Q=400;class X extends N{get ellipsoid(){return this.tilesRenderer?this.tilesRenderer.ellipsoid:null}get tilesGroup(){return this.tilesRenderer?this.tilesRenderer.group:null}constructor(t=null,o=null,i=null,e=null){super(t,o,i),this.isGlobeControls=!0,this._dragMode=0,this._rotationMode=0,this.maxZoom=.01,this.useFallbackPlane=!1,this.reorientOnDrag=!1,this.dragQuaternion=new G,this.setTilesRenderer(e)}setScene(t){t===null&&this.tilesRenderer!==null?super.setScene(this.tilesRenderer.group):super.setScene(t)}getPivotPoint(t){const{camera:o,tilesGroup:i,ellipsoid:e}=this;return c.set(0,0,-1).transformDirection(o.matrixWorld),p.copy(i.matrixWorld).invert(),g.origin.copy(o.position),g.direction.copy(c),g.applyMatrix4(p),z(g,e,s),s.applyMatrix4(i.matrixWorld),(super.getPivotPoint(t)===null||t.distanceTo(g.origin)>s.distanceTo(g.origin))&&t.copy(s),t}getVectorToCenter(t){const{tilesGroup:o,camera:i}=this;return t.setFromMatrixPosition(o.matrixWorld).sub(i.position)}getDistanceToCenter(){return this.getVectorToCenter(s).length()}getUpDirection(t,o){const{tilesGroup:i,ellipsoid:e}=this;p.copy(i.matrixWorld).invert(),s.copy(t).applyMatrix4(p),e.getPositionToNormal(s,o),o.transformDirection(i.matrixWorld)}getCameraUpDirection(t){const{tilesGroup:o,ellipsoid:i,camera:e}=this;e.isOrthographicCamera?(this._getVirtualOrthoCameraPosition(s),p.copy(o.matrixWorld).invert(),s.applyMatrix4(p),i.getPositionToNormal(s,t),t.transformDirection(o.matrixWorld)):this.getUpDirection(e.position,t)}update(t=Math.min(this.clock.getDelta(),64/1e3)){if(!this.enabled||!this.tilesGroup||!this.camera||t===0)return;const{camera:o,pivotMesh:i}=this;this._isNearControls()?this.scaleZoomOrientationAtEdges=this.zoomDelta<0:(this.state!==Z&&this._dragMode!==1&&this._rotationMode!==1&&(i.visible=!1),this.scaleZoomOrientationAtEdges=!1),super.update(t),this.adjustCamera(o)}adjustCamera(t){super.adjustCamera(t);const{tilesGroup:o,ellipsoid:i}=this;if(t.isPerspectiveCamera){const e=s.setFromMatrixPosition(o.matrixWorld).sub(t.position).length(),r=Math.max(...i.radius),a=.25*r,n=l.clamp((e-r)/a,0,1),h=l.lerp(1,1e3,n);t.near=Math.max(h,e-r-a);const m=p.copy(o.matrixWorld).invert();f.copy(t.position).applyMatrix4(m),i.getPositionToCartographic(f,E);const d=Math.max(i.getPositionElevation(f),Q),x=i.calculateHorizonDistance(E.lat,d);t.far=x*2.5+.1,t.updateProjectionMatrix()}else{this._getVirtualOrthoCameraPosition(t.position,t),t.updateMatrixWorld(),p.copy(t.matrixWorld).invert(),s.setFromMatrixPosition(o.matrixWorld).applyMatrix4(p);const e=-s.z;t.near=e-Math.max(...i.radius)*1.1,t.far=e+.1,t.position.addScaledVector(c,t.near),t.far-=t.near,t.near=0,t.updateProjectionMatrix(),t.updateMatrixWorld()}}resetState(){super.resetState(),this._dragMode=0,this._rotationMode=0}_updatePosition(t){if(this.state!==j){const{enableDamping:o,tilesGroup:i,dragQuaternion:e,dragInertia:r,camera:a}=this;o&&(e.w===1&&(e.x!==0||e.y!==0||e.z!==0)&&(e.w=Math.min(e.w,1-1e-9)),y.setFromMatrixPosition(i.matrixWorld),u.identity().slerp(e,r.x*t),w(y,u,C),a.matrixWorld.premultiply(C),a.matrixWorld.decompose(a.position,a.quaternion,s))}else{this._dragMode===0&&(this._dragMode=this._isNearControls()?1:-1);const{raycaster:o,camera:i,pivotPoint:e,pointerTracker:r,domElement:a,tilesGroup:n}=this,h=f,m=v;r.getCenterPoint(P),H(P.x,P.y,a,P),L(o,P,i),p.copy(n.matrixWorld).invert(),o.ray.applyMatrix4(p);const d=s.copy(e).applyMatrix4(p).length();T.radius.setScalar(d),i.isPerspectiveCamera?T.intersectRay(o.ray,s)||q(o.ray,d,s):z(o.ray,T,s),s.applyMatrix4(n.matrixWorld),y.setFromMatrixPosition(n.matrixWorld),h.subVectors(e,y).normalize(),m.subVectors(s,y).normalize(),u.setFromUnitVectors(m,h),w(y,u,C),i.matrixWorld.premultiply(C),i.matrixWorld.decompose(i.position,i.quaternion,s);const{dragInertia:x,dragQuaternion:M}=this;r.getMoveDistance()/t<2*window.devicePixelRatio?(M.slerp(u,.5),x.set(1/t,0,0)):(M.copy(u),x.set(1/t,0,0))}this._alignCameraUp(this.up)}_updateRotation(...t){this._rotationMode===1||this._isNearControls()?(this._rotationMode=1,super._updateRotation(...t)):(this.pivotMesh.visible=!1,this._rotationMode=-1),this._alignCameraUp(this.up)}_updateZoom(){const{zoomDelta:t,ellipsoid:o,zoomSpeed:i,zoomPoint:e,camera:r,maxZoom:a}=this,n=l.clamp(l.mapLinear(Math.abs(t),0,20,0,1),0,1);if(this._isNearControls()||t>0){if(this._updateZoomDirection(),t<0&&(this.zoomPointSet||this._updateZoomPoint())){c.set(0,0,-1).transformDirection(r.matrixWorld).normalize(),D.copy(this.up).multiplyScalar(-1),this.getUpDirection(e,b);const h=l.clamp(l.mapLinear(-b.dot(D),1,.95,0,1),0,1),m=1-c.dot(D),d=r.isOrthographicCamera?.05:1,x=l.clamp(n*3,0,1),M=Math.min(h*m*d*x,.1);D.lerpVectors(c,D,M).normalize(),u.setFromUnitVectors(c,D),w(e,u,C),r.matrixWorld.premultiply(C),r.matrixWorld.decompose(r.position,r.quaternion,D),this.zoomDirection.subVectors(e,r.position).normalize()}super._updateZoom()}else if(r.isPerspectiveCamera){const h=this._getPerspectiveTransitionDistance(),m=this._getMaxPerspectiveDistance(),d=l.mapLinear(this.getDistanceToCenter(),h,m,0,1);this._tiltTowardsCenter(l.lerp(0,.4,d*n)),this._alignCameraUpToNorth(l.lerp(0,.2,d*n));const x=this.getDistanceToCenter()-o.radius.x,M=t*x*i*.0025,W=Math.max(M,Math.min(this.getDistanceToCenter()-m,0));this.getVectorToCenter(s).normalize(),this.camera.position.addScaledVector(s,W),this.camera.updateMatrixWorld(),this.zoomDelta=0}else{const h=this._getOrthographicTransitionZoom(),m=this._getMinOrthographicZoom(),d=l.mapLinear(r.zoom,h,m,0,1);this._tiltTowardsCenter(l.lerp(0,.4,d*n)),this._alignCameraUpToNorth(l.lerp(0,.2,d*n));const x=this.zoomDelta,M=Math.pow(.95,Math.abs(x*.05)),W=x>0?1/Math.abs(M):M,O=m/r.zoom,U=Math.max(W*i,Math.min(O,1));r.zoom=Math.min(a,r.zoom*U),r.updateProjectionMatrix(),this.zoomDelta=0,this.zoomDirectionSet=!1}}_alignCameraUpToNorth(t){const{tilesGroup:o}=this;V.set(0,0,1).transformDirection(o.matrixWorld),this._alignCameraUp(V,t)}_alignCameraUp(t,o=null){const{camera:i}=this;c.set(0,0,-1).transformDirection(i.matrixWorld),R.set(-1,0,0).transformDirection(i.matrixWorld),v.crossVectors(t,c),o===null&&(o=1-Math.abs(c.dot(t)),o=l.mapLinear(o,0,1,-.01,1),o=l.clamp(o,0,1)**2),v.lerp(R,1-o).normalize(),u.setFromUnitVectors(R,v),i.quaternion.premultiply(u),i.updateMatrixWorld()}_tiltTowardsCenter(t){const{camera:o,tilesGroup:i}=this;c.set(0,0,-1).transformDirection(o.matrixWorld).normalize(),s.setFromMatrixPosition(i.matrixWorld).sub(o.position).normalize(),s.lerp(c,1-t).normalize(),u.setFromUnitVectors(c,s),o.quaternion.premultiply(u),o.updateMatrixWorld()}_getPerspectiveTransitionDistance(){const{camera:t,ellipsoid:o}=this;if(!t.isPerspectiveCamera)throw new Error;const i=Math.max(...o.radius),e=2*Math.atan(Math.tan(l.DEG2RAD*t.fov*.5)*t.aspect),r=i/Math.tan(l.DEG2RAD*t.fov*.5),a=i/Math.tan(e*.5);return Math.max(r,a)}_getMaxPerspectiveDistance(){const{camera:t,ellipsoid:o}=this;if(!t.isPerspectiveCamera)throw new Error;const i=Math.max(...o.radius),e=2*Math.atan(Math.tan(l.DEG2RAD*t.fov*.5)*t.aspect),r=i/Math.tan(l.DEG2RAD*t.fov*.5),a=i/Math.tan(e*.5);return 2*Math.max(r,a)}_getOrthographicTransitionZoom(){const{camera:t,ellipsoid:o}=this;if(!t.isOrthographicCamera)throw new Error;const i=t.top-t.bottom,e=t.right-t.left,r=Math.max(i,e),n=2*Math.max(...o.radius);return 2*r/n}_getMinOrthographicZoom(){const{camera:t,ellipsoid:o}=this;if(!t.isOrthographicCamera)throw new Error;const i=t.top-t.bottom,e=t.right-t.left,r=Math.min(i,e),n=2*Math.max(...o.radius);return .7*r/n}_getVirtualOrthoCameraPosition(t,o=this.camera){const{tilesGroup:i,ellipsoid:e}=this;if(!o.isOrthographicCamera)throw new Error;p.copy(i.matrixWorld).invert(),g.origin.copy(o.position),g.direction.set(0,0,-1).transformDirection(o.matrixWorld),g.applyMatrix4(p),z(g,e,f),f.applyMatrix4(i.matrixWorld);const r=o.top-o.bottom,a=o.right-o.left,n=Math.max(r,a)/o.zoom;c.set(0,0,-1).transformDirection(o.matrixWorld);const h=f.sub(o.position).dot(c);t.copy(o.position).addScaledVector(c,h-n*4)}_isNearControls(){const{camera:t}=this;return t.isPerspectiveCamera?this.getDistanceToCenter()this._getOrthographicTransitionZoom()}}export{X as G}; diff --git a/example/bundle/assets/GoogleCloudAuthPlugin-BapiqItz.js b/example/bundle/assets/GoogleCloudAuthPlugin-BapiqItz.js new file mode 100644 index 00000000..c328a731 --- /dev/null +++ b/example/bundle/assets/GoogleCloudAuthPlugin-BapiqItz.js @@ -0,0 +1 @@ +import{t as h}from"./TilesRenderer-DkGmB3Pz.js";class u{constructor(){this.creditsCount={}}_adjustAttributions(t,e){const s=this.creditsCount,i=t.split(/;/g);for(let n=0,l=i.length;n{const i=e[1];return s[1]-i}).map(e=>e[0]).join("; ")}}function a(r){let t=null;return h(r,e=>{if(e.content&&e.content.uri){const[,s]=e.content.uri.split("?");return t=new URLSearchParams(s).get("session"),!0}return!1}),t}class d{constructor({apiToken:t,autoRefreshToken:e=!1,logoUrl:s=null,useRecommendedSettings:i=!0}){this.name="GOOGLE_CLOUD_AUTH_PLUGIN",this.apiToken=t,this.autoRefreshToken=e,this.useRecommendedSettings=i,this.logoUrl=s,this.sessionToken=null,this.tiles=null,this._onLoadCallback=null,this._visibilityChangeCallback=null,this._tokenRefreshPromise=null,this._attributionsManager=new u,this._logoAttribution={value:"",type:"image",collapsible:!1},this._attribution={value:"",type:"string",collapsible:!0}}init(t){t!=null&&(t.resetFailedTiles(),t.rootURL==null&&(t.rootURL="https://tile.googleapis.com/v1/3dtiles/root.json"),this.useRecommendedSettings&&(t.parseQueue.maxJobs=10,t.downloadQueue.maxJobs=30,t.errorTarget=40),this.tiles=t,this._onLoadCallback=({tileSet:e})=>{this.sessionToken=a(e.root),t.removeEventListener("load-tile-set",this._onLoadCallback)},this._visibilityChangeCallback=({tile:e,visible:s})=>{const i=e.cached.metadata.asset.copyright||"";s?this._attributionsManager.addAttributions(i):this._attributionsManager.removeAttributions(i)},t.addEventListener("load-tile-set",this._onLoadCallback),t.addEventListener("tile-visibility-change",this._visibilityChangeCallback))}getAttributions(t){this.tiles.visibleTiles.size>0&&(this.logoUrl&&(this._logoAttribution.value=this.logoUrl,t.push(this._logoAttribution)),this._attribution.value=this._attributionsManager.toString(),t.push(this._attribution))}preprocessURL(t){return t=new URL(t),/^http/.test(t.protocol)&&(t.searchParams.append("key",this.apiToken),this.sessionToken!==null&&t.searchParams.append("session",this.sessionToken)),t.toString()}dispose(){const{tiles:t}=this;t.removeEventListener("load-tile-set",this._onLoadCallback),t.removeEventListener("tile-visibility-change",this._visibilityChangeCallback)}async fetchData(t,e){this._tokenRefreshPromise!==null&&(await this._tokenRefreshPromise,t=this.preprocessURL(t));const s=await fetch(t,e);return s.status>=400&&s.status<=499&&this.autoRefreshToken?(await this._refreshToken(e),fetch(this.preprocessURL(t),e)):s}_refreshToken(t){if(this._tokenRefreshPromise===null){const e=new URL(this.tiles.rootURL);e.searchParams.append("key",this.apiToken),this._tokenRefreshPromise=fetch(e,t).then(s=>s.json()).then(s=>{this.sessionToken=a(s.root),this._tokenRefreshPromise=null})}return this._tokenRefreshPromise}}export{d as G}; diff --git a/example/bundle/assets/I3DMLoader-QCOT_FZM.js b/example/bundle/assets/I3DMLoader-QCOT_FZM.js new file mode 100644 index 00000000..2cea39d1 --- /dev/null +++ b/example/bundle/assets/I3DMLoader-QCOT_FZM.js @@ -0,0 +1 @@ +import{r as Z,F as J,B as q,a as K}from"./readMagicBytes-Da5ueiou.js";import{L as X}from"./LoaderBase-CVSPpjX2.js";import{j as y,bm as Y,k as g,bn as tt,Q}from"./three.module-_fL2BuBc.js";import{G as et}from"./GLTFLoader-CFm4138C.js";import{E as j}from"./Ellipsoid-CKpUFSOi.js";const Lt=-1,ht=0,ut=1,gt=2,ft=3,R=6378137,st=1/298.257223563,at=-(st*R-R),nt=1736*1e3,H=1738.1*1e3;class ot extends X{parse(o){const a=new DataView(o),s=Z(a);console.assert(s==="i3dm");const O=a.getUint32(4,!0);console.assert(O===1);const I=a.getUint32(8,!0);console.assert(I===o.byteLength);const S=a.getUint32(12,!0),U=a.getUint32(16,!0),i=a.getUint32(20,!0),f=a.getUint32(24,!0),m=a.getUint32(28,!0),L=32,M=o.slice(L,L+S+U),n=new J(M,0,S,U),e=L+S+U,T=o.slice(e,e+i+f),E=new q(T,n.getData("INSTANCES_LENGTH"),0,i,f),N=e+i+f,h=new Uint8Array(o,N,I-N);let A=null,p=null,b=null;if(m)A=h,p=Promise.resolve();else{const r=this.resolveExternalURL(K(h)),u=r.split(/[\\/]/g);u.pop(),b=u.join("/"),p=fetch(r,this.fetchOptions).then(c=>{if(!c.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${r}" with status ${c.status} : ${c.statusText}`);return c.arrayBuffer()}).then(c=>{A=new Uint8Array(c)})}return p.then(()=>({version:O,featureTable:n,batchTable:E,glbBytes:A,gltfWorkingPath:b}))}}const rt=new j(R,R,at),mt=new j(H,H,nt),W=new g,F=new g,P=new g,C=new g,x=new Q,_=new g,w=new y,V=new y,v=new g,k=new y,B=new Q,G={};class Et extends ot{constructor(o=Y){super(),this.manager=o,this.adjustmentTransform=new y,this.ellipsoid=rt.clone()}resolveExternalURL(o){return this.manager.resolveURL(super.resolveExternalURL(o))}parse(o){return super.parse(o).then(a=>{const{featureTable:s,batchTable:O}=a,I=a.glbBytes.slice().buffer;return new Promise((S,U)=>{const i=this.fetchOptions,f=this.manager,m=f.getHandler("path.gltf")||new et(f);i.credentials==="include"&&i.mode==="cors"&&m.setCrossOrigin("use-credentials"),"credentials"in i&&m.setWithCredentials(i.credentials==="include"),i.headers&&m.setRequestHeader(i.headers);let L=a.gltfWorkingPath??this.workingPath;/[\\/]$/.test(L)||(L+="/");const M=this.adjustmentTransform;m.parse(I,L,n=>{const e=s.getData("INSTANCES_LENGTH"),T=s.getData("POSITION",e,"FLOAT","VEC3"),E=s.getData("NORMAL_UP",e,"FLOAT","VEC3"),N=s.getData("NORMAL_RIGHT",e,"FLOAT","VEC3"),h=s.getData("SCALE_NON_UNIFORM",e,"FLOAT","VEC3"),A=s.getData("SCALE",e,"FLOAT","SCALAR"),p=s.getData("RTC_CENTER"),b=s.getData("EAST_NORTH_UP");["QUANTIZED_VOLUME_OFFSET","QUANTIZED_VOLUME_SCALE","POSITION_QUANTIZED","NORMAL_UP_OCT32P","NORMAL_RIGHT_OCT32P"].forEach(t=>{t in s.header&&console.warn(`I3DMLoader: Unsupported FeatureTable feature "${t}" detected.`)});const r=new g;for(let t=0;t{if(t.isMesh){c.push(t);const{geometry:d,material:D}=t,l=new tt(d,D,e);l.position.copy(r),p&&(l.position.x+=p[0],l.position.y+=p[1],l.position.z+=p[2]),u.push(l)}});for(let t=0;t{if(!r.ok)throw new Error(`Failed to load file "${t}" with status ${r.status} : ${r.statusText}`);return r.arrayBuffer()}).then(r=>(this.workingPath===""&&(this.workingPath=this.workingPathForURL(t)),this.parse(r)))}resolveExternalURL(t){return/^[^\\/]/.test(t)&&!/^http/.test(t)?this.workingPath+"/"+t:t}workingPathForURL(t){const r=t.split(/[\\/]/g);return r.pop(),r.join("/")+"/"}parse(t){throw new Error("LoaderBase: Parse not implemented.")}}export{n as L}; diff --git a/example/bundle/assets/OrbitControls-Ck5AM9Mk.js b/example/bundle/assets/OrbitControls-Ck5AM9Mk.js new file mode 100644 index 00000000..68228019 --- /dev/null +++ b/example/bundle/assets/OrbitControls-Ck5AM9Mk.js @@ -0,0 +1 @@ +import{an as S,ao as w,k as p,ap as O,aq as u,ar as _,Q as E,as as P,V as c,i as j}from"./three.module-_fL2BuBc.js";const D={type:"change"},b={type:"start"},M={type:"end"},f=new S,T=new w,A=Math.cos(70*j.DEG2RAD),n=new p,r=2*Math.PI,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},y=1e-6;class X extends O{constructor(t,e=null){super(t,e),this.state=o.NONE,this.enabled=!0,this.target=new p,this.cursor=new p,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:u.ROTATE,MIDDLE:u.DOLLY,RIGHT:u.PAN},this.touches={ONE:_.ROTATE,TWO:_.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new p,this._lastQuaternion=new E,this._lastTargetPosition=new p,this._quat=new E().setFromUnitVectors(t.up,new p(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new P,this._sphericalDelta=new P,this._scale=1,this._panOffset=new p,this._rotateStart=new c,this._rotateEnd=new c,this._rotateDelta=new c,this._panStart=new c,this._panEnd=new c,this._panDelta=new c,this._dollyStart=new c,this._dollyEnd=new c,this._dollyDelta=new c,this._dollyDirection=new p,this._mouse=new c,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=L.bind(this),this._onPointerDown=R.bind(this),this._onPointerUp=x.bind(this),this._onContextMenu=Z.bind(this),this._onMouseWheel=N.bind(this),this._onKeyDown=Y.bind(this),this._onTouchStart=I.bind(this),this._onTouchMove=U.bind(this),this._onMouseDown=C.bind(this),this._onMouseMove=k.bind(this),this._interceptControlDown=z.bind(this),this._interceptControlUp=K.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(D),this.update(),this.state=o.NONE}update(t=null){const e=this.object.position;n.copy(e).sub(this.target),n.applyQuaternion(this._quat),this._spherical.setFromVector3(n),this.autoRotate&&this.state===o.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,a=this.maxAzimuthAngle;isFinite(s)&&isFinite(a)&&(s<-Math.PI?s+=r:s>Math.PI&&(s-=r),a<-Math.PI?a+=r:a>Math.PI&&(a-=r),s<=a?this._spherical.theta=Math.max(s,Math.min(a,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+a)/2?Math.max(s,this._spherical.theta):Math.min(a,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let h=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const l=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),h=l!=this._spherical.radius}if(n.setFromSpherical(this._spherical),n.applyQuaternion(this._quatInverse),e.copy(this.target).add(n),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let l=null;if(this.object.isPerspectiveCamera){const d=n.length();l=this._clampDistance(d*this._scale);const m=d-l;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),h=!!m}else if(this.object.isOrthographicCamera){const d=new p(this._mouse.x,this._mouse.y,0);d.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),h=m!==this.object.zoom;const g=new p(this._mouse.x,this._mouse.y,0);g.unproject(this.object),this.object.position.sub(g).add(d),this.object.updateMatrixWorld(),l=n.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;l!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(l).add(this.object.position):(f.origin.copy(this.object.position),f.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(f.direction))y||8*(1-this._lastQuaternion.dot(this.object.quaternion))>y||this._lastTargetPosition.distanceToSquared(this.target)>y?(this.dispatchEvent(D),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?r/60*this.autoRotateSpeed*t:r/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){n.setFromMatrixColumn(e,0),n.multiplyScalar(-t),this._panOffset.add(n)}_panUp(t,e){this.screenSpacePanning===!0?n.setFromMatrixColumn(e,1):(n.setFromMatrixColumn(e,0),n.crossVectors(this.object.up,n)),n.multiplyScalar(t),this._panOffset.add(n)}_pan(t,e){const s=this.domElement;if(this.object.isPerspectiveCamera){const a=this.object.position;n.copy(a).sub(this.target);let h=n.length();h*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*h/s.clientHeight,this.object.matrix),this._panUp(2*e*h/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),a=t-s.left,h=e-s.top,l=s.width,d=s.height;this._mouse.x=a/l*2-1,this._mouse.y=-(h/d)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(r*this._rotateDelta.x/e.clientHeight),this._rotateUp(r*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(r*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(-r*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(r*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(-r*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),s=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._rotateStart.set(s,a)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),s=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._panStart.set(s,a)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),s=t.pageX-e.x,a=t.pageY-e.y,h=Math.sqrt(s*s+a*a);this._dollyStart.set(0,h)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),a=.5*(t.pageX+s.x),h=.5*(t.pageY+s.y);this._rotateEnd.set(a,h)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(r*this._rotateDelta.x/e.clientHeight),this._rotateUp(r*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),s=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._panEnd.set(s,a)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),s=t.pageX-e.x,a=t.pageY-e.y,h=Math.sqrt(s*s+a*a);this._dollyEnd.set(0,h),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const l=(t.pageX+e.x)*.5,d=(t.pageY+e.y)*.5;this._updateZoomParameters(l,d)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e>11,t=L>>5&63,o=L&31,g=Math.round(s/31*255),n=Math.round(t/63*255),c=Math.round(o/31*255);return[g,n,c]}const D={RGB:"color",POSITION:"position"};class Q extends x{constructor(s=w){super(),this.manager=s}parse(s){return super.parse(s).then(async t=>{const{featureTable:o,batchTable:g}=t,n=new G,c=o.header.extensions,l=new P;let a;if(c&&c["3DTILES_draco_point_compression"]){const{byteOffset:e,byteLength:u,properties:i}=c["3DTILES_draco_point_compression"],f=this.manager.getHandler("draco.drc");if(f==null)throw new Error("PNTSLoader: dracoLoader not available.");const b={};for(const p in i)if(p in D&&p in i){const S=D[p];b[S]=i[p]}const N={attributeIDs:b,attributeTypes:{position:"Float32Array",color:"Uint8Array"},useUniqueIDs:!0},B=o.getBuffer(e,u);a=await f.decodeGeometry(B,N),a.attributes.color&&(n.vertexColors=!0)}else{const e=o.getData("POINTS_LENGTH"),u=o.getData("POSITION",e,"FLOAT","VEC3"),i=o.getData("RGB",e,"UNSIGNED_BYTE","VEC3"),f=o.getData("RGBA",e,"UNSIGNED_BYTE","VEC4"),b=o.getData("RGB565",e,"UNSIGNED_SHORT","SCALAR"),N=o.getData("CONSTANT_RGBA",e,"UNSIGNED_BYTE","VEC4"),B=o.getData("POSITION_QUANTIZED",e,"UNSIGNED_SHORT","VEC3"),p=o.getData("QUANTIZED_VOLUME_SCALE",e,"FLOAT","VEC3"),S=o.getData("QUANTIZED_VOLUME_OFFSET",e,"FLOAT","VEC3");if(a=new m,B){const E=new Float32Array(e*3);for(let r=0;r{e in o.header&&console.warn(`PNTSLoader: Unsupported FeatureTable feature "${e}" detected.`)});const O=new V(a,n);O.position.copy(l),t.scene=O,t.scene.featureTable=o,t.scene.batchTable=g;const T=o.getData("RTC_CENTER");return T&&(t.scene.position.x+=T[0],t.scene.position.y+=T[1],t.scene.position.z+=T[2]),t})}}export{Q as P}; diff --git a/example/bundle/assets/TileCompressionPlugin-CHefINqs.js b/example/bundle/assets/TileCompressionPlugin-CHefINqs.js new file mode 100644 index 00000000..508750a2 --- /dev/null +++ b/example/bundle/assets/TileCompressionPlugin-CHefINqs.js @@ -0,0 +1 @@ +import{k as M,x as w,ai as I,i as z}from"./three.module-_fL2BuBc.js";const S=new M;function A(t,o){if(t.isInterleavedBufferAttribute||t.array instanceof o)return t;const f=o===Int8Array||o===Int16Array||o===Int32Array?-1:0,s=new o(t.count*t.itemSize),y=new I(s,t.itemSize,!0),d=t.itemSize,v=t.count;for(let c=0;c{if(r.material&&s){const a=r.material;for(const n in a){const e=a[n];e&&e.isTexture&&e.generateMipmaps&&(e.generateMipmaps=!1,e.minFilter=w)}}if(r.geometry){const a=r.geometry,n=a.attributes;if(d){const{uv:e,uv1:m,uv2:l,uv3:p}=n;e&&(n.uv=A(e,i)),m&&(n.uv1=A(m,i)),l&&(n.uv2=A(l,i)),p&&(n.uv3=A(p,i))}if(f&&!n.normals&&a.computeVertexNormals(),v&&n.normals&&(n.normals=A(n.normals,u)),c&&B(r,x),y&&a.index){const e=n.position.count,m=a.index,l=e>65535?Uint32Array:e>255?Uint16Array:Uint8Array;if(!(m.array instanceof l)){const p=new l(a.index.count);p.set(m.array);const b=new I(p,1);a.setIndex(b)}}}})}}export{N as T}; diff --git a/example/bundle/assets/TilesFadePlugin-oL7QwVsE.js b/example/bundle/assets/TilesFadePlugin-oL7QwVsE.js new file mode 100644 index 00000000..f5faa819 --- /dev/null +++ b/example/bundle/assets/TilesFadePlugin-oL7QwVsE.js @@ -0,0 +1,47 @@ +import{i as P,k as _,j as A,Q as y}from"./three.module-_fL2BuBc.js";const{clamp:p}=P;class I{constructor(){this.duration=250,this.fadeCount=0,this._lastTick=-1,this._fadeState=new Map,this._fadeParams=new WeakMap,this.onFadeComplete=null,this.onFadeStart=null,this.onFadeSetComplete=null,this.onFadeSetStart=null}prepareObject(e){e.traverse(a=>{a.material&&this.prepareMaterial(a.material)})}deleteObject(e){if(!e)return;this.completeFade(e);const a=this._fadeParams;e.traverse(t=>{const s=t.material;s&&(a.delete(s),s.onBeforeCompile=()=>{},s.needsUpdate=!0)})}prepareMaterial(e){const a=this._fadeParams;if(a.has(e))return;const t={fadeIn:{value:0},fadeOut:{value:0}};e.defines={FEATURE_FADE:0},e.onBeforeCompile=s=>{s.uniforms={...s.uniforms,...t},s.fragmentShader=s.fragmentShader.replace(/void main\(/,r=>` + #if FEATURE_FADE + + // adapted from https://www.shadertoy.com/view/Mlt3z8 + float bayerDither2x2( vec2 v ) { + + return mod( 3.0 * v.y + 2.0 * v.x, 4.0 ); + + } + + float bayerDither4x4( vec2 v ) { + + vec2 P1 = mod( v, 2.0 ); + vec2 P2 = floor( 0.5 * mod( v, 4.0 ) ); + return 4.0 * bayerDither2x2( P1 ) + bayerDither2x2( P2 ); + + } + + uniform float fadeIn; + uniform float fadeOut; + #endif + + ${r} + `).replace(/#include /,r=>` + + ${r} + + #if FEATURE_FADE + + float bayerValue = bayerDither4x4( floor( mod( gl_FragCoord.xy, 4.0 ) ) ); + float bayerBins = 16.0; + float dither = ( 0.5 + bayerValue ) / bayerBins; + if ( dither >= fadeIn ) { + + discard; + + } + + if ( dither < fadeOut ) { + + discard; + + } + + #endif + + `)},a.set(e,t)}guaranteeState(e){const a=this._fadeState;if(a.has(e))return!1;const t={fadeInTarget:0,fadeOutTarget:0,fadeIn:0,fadeOut:0};a.set(e,t);const s=this._fadeParams;return e.traverse(r=>{const o=r.material;if(o&&s.has(o)){const f=s.get(o);f.fadeIn.value=0,f.fadeOut.value=0}}),!0}completeFade(e){const a=this._fadeState;if(!a.has(e))return;const t=a.get(e).fadeOutTarget===0;a.delete(e),e.traverse(s=>{const r=s.material;r&&r.defines.FEATURE_FADE!==0&&(r.defines.FEATURE_FADE=0,r.needsUpdate=!0)}),this.fadeCount--,this.onFadeComplete&&this.onFadeComplete(e,t),this.fadeCount===0&&this.onFadeSetComplete&&this.onFadeSetComplete()}completeAllFades(){this._fadeState.forEach((e,a)=>{this.completeFade(a)})}forEachObject(e){this._fadeState.forEach((a,t)=>e(t))}fadeIn(e){const a=this.guaranteeState(e),t=this._fadeState.get(e);t.fadeInTarget=1,t.fadeOutTarget=0,t.fadeOut=0,a&&(this.fadeCount++,this.fadeCount===1&&this.onFadeSetStart&&this.onFadeSetStart(),this.onFadeStart&&this.onFadeStart(e))}fadeOut(e){const a=this.guaranteeState(e),t=this._fadeState.get(e);t.fadeOutTarget=1,a&&(t.fadeInTarget=1,t.fadeIn=1,this.fadeCount++,this.fadeCount===1&&this.onFadeSetStart&&this.onFadeSetStart(),this.onFadeStart&&this.onFadeStart(e))}isFading(e){return this._fadeState.has(e)}isFadingOut(e){const a=this._fadeState.get(e);return a&&a.fadeOutTarget===1}update(){const e=window.performance.now();this._lastTick===-1&&(this._lastTick=e);const a=p((e-this._lastTick)/this.duration,0,1);this._lastTick=e;const t=this._fadeState,s=this._fadeParams;t.forEach((r,o)=>{const{fadeOutTarget:f,fadeInTarget:h}=r;let{fadeOut:n,fadeIn:d}=r;const u=Math.sign(h-d);d=p(d+u*a,0,1);const m=Math.sign(f-n);n=p(n+m*a,0,1),r.fadeIn=d,r.fadeOut=n;const c=+(n!==f||d!==h);o.traverse(D=>{const l=D.material;if(l&&s.has(l)){const v=s.get(l);v.fadeIn.value=d,v.fadeOut.value=n,c!==l.defines.FEATURE_FADE&&(l.defines.FEATURE_FADE=c,l.needsUpdate=!0)}}),((n===1||n===0)&&(d===1||d===0)||n>=d)&&this.completeFade(o)})}}const F=Symbol("HAS_POPPED_IN"),T=new _,E=new _,M=new y,C=new y,S=new _;function U(i,e,a){i.visible=!0;const t=this._fadeManager;t.isFadingOut(i)&&this._fadingOutCount--,a?e.__depthFromRenderedParent===1?((e[F]||this.fadeRootTiles)&&this._fadeManager.fadeIn(i),e[F]=!0):this._fadeManager.fadeIn(i):(this._fadingOutCount++,t.fadeOut(i))}function O(i,e){this._fadeManager.prepareObject(i),this._tileMap.set(i,e)}function b(i){this._fadeManager.deleteObject(i),this._tileMap.delete(i)}function w(i,e){if(!e){const a=this._tileMap.get(i);this.tiles.invokeOnePlugin(t=>t!==this&&t.setTileVisible&&t.setTileVisible(a,!1)),this._fadingOutCount--}}function L(i){this._prevCameraTransforms.set(i,new A)}function x(i){this._prevCameraTransforms.delete(i)}function R(){const i=this._fadeManager,e=this.tiles;this._fadingBefore=i.fadeCount,this._displayActiveTiles=e.displayActiveTiles,e.displayActiveTiles=!0}function B(){const i=this._fadeManager,e=this._displayActiveTiles,a=this._fadingBefore,t=this.tiles,s=this._prevCameraTransforms,r=this._tileMap,o=t.lruCache,f=t.cameras;t.displayActiveTiles=e,i.update();const h=i.fadeCount;if(a!==0&&h!==0&&(t.dispatchEvent({type:"fade-change"}),t.dispatchEvent({type:"force-rerender"})),e||t.visibleTiles.forEach(n=>{const d=n.cached.scene;i.isFadingOut(d)?d.visible=!0:d.visible=n.__inFrustum}),this.maximumFadeOutTiles{if(!s.has(d))return;const u=d.matrixWorld,m=s.get(d);u.decompose(E,C,S),m.decompose(T,M,S);const c=C.angleTo(M),g=E.distanceTo(T);n=n&&(c>.25||g>.1)}),n&&i.completeAllFades()}f.forEach(n=>{s.get(n).copy(n.matrixWorld)}),i.forEachObject(n=>{o.markUsed(r.get(n))})}class N{get fadeDuration(){return this._fadeManager.duration}set fadeDuration(e){this._fadeManager.duration=Number(e)}get fadingTiles(){return this._fadeManager.fadeCount}constructor(e){e={maximumFadeOutTiles:50,fadeRootTiles:!1,fadeDuration:250,...e},this.name="FADE_TILES_PLUGIN",this.priority=-1,this.tiles=null,this._fadeManager=new I,this._prevCameraTransforms=null,this._tileMap=null,this._fadingOutCount=0,this.maximumFadeOutTiles=e.maximumFadeOutTiles,this.fadeRootTiles=e.fadeRootTiles,this.fadeDuration=e.fadeDuration}init(e){const a=this._fadeManager;a.onFadeSetStart=()=>{e.dispatchEvent({type:"fade-start"}),e.dispatchEvent({type:"force-rerender"})},a.onFadeSetComplete=()=>{e.dispatchEvent({type:"fade-end"}),e.dispatchEvent({type:"force-rerender"})},a.onFadeComplete=w.bind(this),this.tiles=e,this._fadeManager=a,this._tileMap=new Map,this._prevCameraTransforms=new Map,e.cameras.forEach(t=>{this._prevCameraTransforms.set(t,new A)}),e.forEachLoadedModel((t,s)=>{O.call(this,t,s)}),this._onLoadModel=t=>O.call(this,t.scene,t.tile),this._onDisposeModel=t=>b.call(this,t.scene),this._onAddCamera=t=>L.call(this,t.camera),this._onDeleteCamera=t=>x.call(this,t.camera),this._onUpdateBefore=()=>R.call(this),this._onUpdateAfter=()=>B.call(this),e.addEventListener("load-model",this._onLoadModel),e.addEventListener("dispose-model",this._onDisposeModel),e.addEventListener("add-camera",this._onAddCamera),e.addEventListener("delete-camera",this._onDeleteCamera),e.addEventListener("update-before",this._onUpdateBefore),e.addEventListener("update-after",this._onUpdateAfter)}setTileVisible(e,a){const t=e.cached.scene,s=this._fadeManager.isFading(t);if(U.call(this,t,e,a),s)return!0;const r=this._fadeManager.isFading(t);return!!(!a&&r)}dispose(){const e=this.tiles;this._fadeManager.completeAllFades(),e.removeEventListener("load-model",this._onLoadModel),e.removeEventListener("dispose-model",this._onDisposeModel),e.removeEventListener("add-camera",this._onAddCamera),e.removeEventListener("delete-camera",this._onDeleteCamera),e.removeEventListener("update-before",this._onUpdateBefore),e.removeEventListener("update-after",this._onUpdateAfter),e.forEachLoadedModel(a=>{this._fadeManager.deleteObject(a),this._tileMap.delete(a),a.visible=!0})}}export{N as T}; diff --git a/example/bundle/assets/TilesRenderer-DkGmB3Pz.js b/example/bundle/assets/TilesRenderer-DkGmB3Pz.js new file mode 100644 index 00000000..c221ec0e --- /dev/null +++ b/example/bundle/assets/TilesRenderer-DkGmB3Pz.js @@ -0,0 +1 @@ +import{F,a as V,U,b as B,P as $,W as Ae,I as Ie}from"./I3DMLoader-QCOT_FZM.js";import{B as Be}from"./B3DMLoader-s-i-FwTx.js";import{P as Ee}from"./PNTSLoader-ClFH5U_K.js";import{C as Ve}from"./CMPTLoader-DW6cWF_V.js";import{G as De}from"./GLTFExtensionLoader-BffG-g_T.js";import{j as w,G as Oe,an as me,k as y,p as _e,ao as Ne,B as ze,d as qe,aZ as We,bk as je,bj as Je,V as ge,aE as O,bl as Ge,L as Qe}from"./three.module-_fL2BuBc.js";import{r as $e}from"./readMagicBytes-Da5ueiou.js";import{E as He}from"./EllipsoidRegion-CVV0HJli.js";import{e as Ye}from"./GLTFLoader-CFm4138C.js";function ne(i){let e;try{e=new URL(i,"http://fakehost.com/")}catch{return null}const t=e.pathname.split("/").pop(),s=t.lastIndexOf(".");return s===-1||s===t.length-1?null:t.substring(s+1)}const ie=2**30;class Xe{get unloadPriorityCallback(){return this._unloadPriorityCallback}set unloadPriorityCallback(e){e.length===1?(console.warn('LRUCache: "unloadPriorityCallback" function has been changed to take two arguments.'),this._unloadPriorityCallback=(t,s)=>{const n=e(t),o=e(s);return no?1:0}):this._unloadPriorityCallback=e}constructor(){this.minSize=6e3,this.maxSize=8e3,this.minBytesSize=.3*ie,this.maxBytesSize=.4*ie,this.unloadPercent=.05,this.autoMarkUnused=!0,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.markUnusedQueued=!1,this.unloadingHandle=-1,this.cachedBytes=0,this.bytesMap=new Map,this.loadedSet=new Set,this._unloadPriorityCallback=null,this.computeMemoryUsageCallback=()=>null;const e=this.itemSet;this.defaultPriorityCallback=t=>e.get(t)}isFull(){return this.itemSet.size>=this.maxSize||this.cachedBytes>=this.maxBytesSize}getMemoryUsage(e){return this.bytesMap.get(e)??null}add(e,t){this.markUnusedQueued&&this.markAllUnused();const s=this.itemSet;if(s.has(e)||this.isFull())return!1;const n=this.usedSet,o=this.itemList,r=this.callbacks,a=this.bytesMap;o.push(e),n.add(e),s.set(e,Date.now()),r.set(e,t);const l=this.computeMemoryUsageCallback(e);return this.cachedBytes+=l||0,a.set(e,l),!0}has(e){return this.itemSet.has(e)}remove(e){const t=this.usedSet,s=this.itemSet,n=this.itemList,o=this.bytesMap,r=this.callbacks,a=this.loadedSet;if(s.has(e)){this.cachedBytes-=o.get(e)||0,o.delete(e),r.get(e)(e);const l=n.indexOf(e);return n.splice(l,1),t.delete(e),s.delete(e),r.delete(e),a.delete(e),!0}return!1}setLoaded(e,t){const{itemSet:s,loadedSet:n}=this;s.has(e)&&(t===!0?n.add(e):n.delete(e))}updateMemoryUsage(e){const t=this.itemSet,s=this.bytesMap;if(!t.has(e))return;this.cachedBytes-=s.get(e)||0;const n=this.computeMemoryUsageCallback(e);s.set(e,n),this.cachedBytes+=n}markUsed(e){this.markUnusedQueued&&this.markAllUnused();const t=this.itemSet,s=this.usedSet;t.has(e)&&!s.has(e)&&(t.set(e,Date.now()),s.add(e))}markUnused(e){const t=this.usedSet;t.has(e)&&t.delete(e)}markAllUnused(){this.usedSet.clear(),this.markUnusedQueued=!1,this.unloadingHandle!==-1&&(cancelAnimationFrame(this.unloadingHandle),this.unloadingHandle=-1)}unloadUnusedContent(){const{unloadPercent:e,minSize:t,maxSize:s,itemList:n,itemSet:o,usedSet:r,loadedSet:a,callbacks:l,bytesMap:c,minBytesSize:h,maxBytesSize:p}=this,f=n.length-r.size,m=n.length-a.size,d=Math.max(Math.min(n.length-t,f),0),_=this.cachedBytes-h,S=this.unloadPriorityCallback||this.defaultPriorityCallback;let g=!1;const A=d>0&&f>0||m&&n.length>s;if(f&&this.cachedBytes>h||m&&this.cachedBytes>p||A){n.sort((b,C)=>{const te=r.has(b),Le=r.has(C);if(te===Le){const se=a.has(b),Fe=a.has(C);return se===Fe?-S(b,C):se?1:-1}else return te?1:-1});const D=Math.max(t*e,d*e),I=Math.ceil(Math.min(D,f,d)),u=Math.max(e*_,e*h),L=Math.min(u,_);let x=0,T=0;for(;this.cachedBytes-T>p||n.length-x>s;){const b=n[x],C=c.get(b)||0;if(r.has(b)&&a.has(b)||this.cachedBytes-T-C=I)break;T+=C,x++}n.splice(0,x).forEach(b=>{this.cachedBytes-=c.get(b)||0,l.get(b)(b),c.delete(b),o.delete(b),l.delete(b),a.delete(b),r.delete(b)}),g=x0}g&&(this.unloadingHandle=requestAnimationFrame(()=>this.scheduleUnload()))}scheduleUnload(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.unloadUnusedContent(),this.autoMarkUnused&&(this.markUnusedQueued=!0)}))}}class oe{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")},this.schedulingCallback=e=>{requestAnimationFrame(e)},this._runjobs=()=>{this.tryRunJobs(),this.scheduled=!1}}sort(){const e=this.priorityCallback;this.items.sort(e)}add(e,t){return new Promise((s,n)=>{const o=(...l)=>t(...l).then(s).catch(n),r=this.items,a=this.callbacks;r.push(e),a.set(e,o),this.autoUpdate&&this.scheduleJobRun()})}remove(e){const t=this.items,s=this.callbacks,n=t.indexOf(e);n!==-1&&(t.splice(n,1),s.delete(e))}tryRunJobs(){this.sort();const e=this.items,t=this.callbacks,s=this.maxJobs;let n=this.currJobs;for(;s>n&&e.length>0;){n++;const o=e.pop(),r=t.get(o);t.delete(o),r(o).then(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}).catch(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})}this.currJobs=n}scheduleJobRun(){this.scheduled||(this.schedulingCallback(this._runjobs),this.scheduled=!0)}}function K(i){return i===V||i===F}function k(i,e){return i.__lastFrameVisited===e&&i.__used}function ee(i,e){i.__lastFrameVisited!==e.frameCount&&(i.__lastFrameVisited=e.frameCount,i.__used=!1,i.__inFrustum=!1,i.__isLeaf=!1,i.__visible=!1,i.__active=!1,i.__error=1/0,i.__distanceFromCamera=1/0,i.__childrenWereVisible=!1,i.__allChildrenLoaded=!1,i.__inFrustum=e.tileInView(i),e.calculateError(i))}function be(i,e){if(e.ensureChildrenArePreprocessed(i),ee(i,e),Z(i,e),!i.__hasRenderableContent){const t=i.children;for(let s=0,n=t.length;s0&&i.__depth+1>=e.maxDepth)}function xe(i,e=null,t=null,s=null,n=0){if(e&&e(i,s,n)){t&&t(i,s,n);return}const o=i.children;for(let r=0,a=o.length;rr.setTileVisible&&r.setTileVisible(i,n))),i.__wasSetActive=s,i.__wasSetVisible=n,i.__usedLastFrame=t;const o=i.children;for(let r=0,a=o.length;ri.__depthFromRenderedParent!==e.__depthFromRenderedParent?i.__depthFromRenderedParent>e.__depthFromRenderedParent?-1:1:i.__inFrustum!==e.__inFrustum?i.__inFrustum?1:-1:i.__used!==e.__used?i.__used?1:-1:i.__error!==e.__error?i.__error>e.__error?1:-1:i.__distanceFromCamera!==e.__distanceFromCamera?i.__distanceFromCamera>e.__distanceFromCamera?-1:1:0,Ke=(i,e)=>i.__depthFromRenderedParent!==e.__depthFromRenderedParent?i.__depthFromRenderedParent>e.__depthFromRenderedParent?1:-1:i.__loadingState!==e.__loadingState?i.__loadingState>e.__loadingState?-1:1:i.__lastFrameVisited!==e.__lastFrameVisited?i.__lastFrameVisited>e.__lastFrameVisited?-1:1:i.__hasUnrenderableContent!==e.__hasUnrenderableContent?i.__hasUnrenderableContent?-1:1:i.__error!==e.__error?i.__error>e.__error?-1:1:0;class et{get root(){const e=this.rootTileSet;return e?e.root:null}set loadSiblings(e){console.warn('TilesRenderer: "loadSiblings" option has been removed.')}set stopAtEmptyTiles(e){console.warn('TilesRenderer: "stopAtEmptyTiles" option has been removed.')}set preprocessURL(e){console.warn('TilesRendererBase: The "preprocessURL" callback has been deprecated. Use a plugin, instead.'),this._preprocessURL=e}get preprocessURL(){return this._preprocessURL}constructor(e=null){this.rootLoadingState=U,this.rootTileSet=null,this.rootURL=e,this.fetchOptions={},this.plugins=[],this.queuedTiles=[],this._preprocessURL=null;const t=new Xe;t.unloadPriorityCallback=Ke;const s=new oe;s.maxJobs=10,s.priorityCallback=ae;const n=new oe;n.maxJobs=1,n.priorityCallback=ae,this.lruCache=t,this.downloadQueue=s,this.parseQueue=n,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.displayActiveTiles=!1,this.maxDepth=1/0}registerPlugin(e){if(e[re]===!0)throw new Error("TilesRendererBase: A plugin can only be registered to a single tile set");const t=this.plugins,s=e.priority||0;let n=0;for(let o=0;os));o++);t.splice(n,0,e),e[re]=!0,e.init&&e.init(this)}unregisterPlugin(e){const t=this.plugins;if(typeof e=="string"&&(e=this.getPluginByName(name)),t.includes(e)){const s=t.indexOf(e);return t.splice(s,1),e.dispose&&e.dispose(),!0}return!1}getPluginByName(e){return this.plugins.find(t=>t.name===e)||null}traverse(e,t){this.root&&xe(this.root,(s,...n)=>(this.ensureChildrenArePreprocessed(s),e?e(s,...n):!1),t)}queueTileForDownload(e){this.queuedTiles.push(e)}update(){const e=this.stats,t=this.lruCache;if(this.rootLoadingState===U&&(this.rootLoadingState=B,this.invokeOnePlugin(o=>o.loadRootTileSet&&o.loadRootTileSet()).then(()=>this.rootLoadingState=V).catch(()=>this.rootLoadingState=F)),!this.root)return;const s=this.root;e.inFrustum=0,e.used=0,e.active=0,e.visible=0,this.frameCount++,Se(s,this),ve(s,this),Te(s,this),we(s,this);const n=this.queuedTiles;n.sort(t.unloadPriorityCallback);for(let o=0,r=n.length;o{t.__loadingState===F&&(t.__loadingState=U)}),e.failed=0)}dispose(){this.invokeAllPlugins(s=>{s!==this&&s.dispose&&s.dispose()});const e=this.lruCache,t=[];this.traverse(s=>(t.push(s),!1));for(let s=0,n=t.length;st.setTileVisible&&t.setTileVisible(e,!1)),e.__visible=!1),e.__active&&(this.setTileActive(e,!1),e.__active=!1)}preprocessNode(e,t,s=null){var n;if(e.content&&(!("uri"in e.content)&&"url"in e.content&&(e.content.uri=e.content.url,delete e.content.url),e.content.boundingVolume&&!("box"in e.content.boundingVolume||"sphere"in e.content.boundingVolume||"region"in e.content.boundingVolume)&&delete e.content.boundingVolume),e.parent=s,e.children=e.children||[],(n=e.content)!=null&&n.uri){const o=ne(e.content.uri);e.__hasContent=!0,e.__hasUnrenderableContent=!!(o&&/json$/.test(o)),e.__hasRenderableContent=!e.__hasUnrenderableContent}else e.__hasContent=!1,e.__hasUnrenderableContent=!1,e.__hasRenderableContent=!1;e.__distanceFromCamera=1/0,e.__error=1/0,e.__inFrustum=!1,e.__isLeaf=!1,e.__usedLastFrame=!1,e.__used=!1,e.__wasSetVisible=!1,e.__visible=!1,e.__childrenWereVisible=!1,e.__allChildrenLoaded=!1,e.__wasSetActive=!1,e.__active=!1,e.__loadingState=U,e.__loadIndex=0,e.__loadAbort=null,s===null?(e.__depth=0,e.__depthFromRenderedParent=0,e.refine=e.refine||"REPLACE"):(e.__depth=s.__depth+1,e.__depthFromRenderedParent=s.__depthFromRenderedParent+(e.__hasRenderableContent?1:0),e.refine=e.refine||s.refine),e.__basePath=t,e.__lastFrameVisited=-1,this.invokeAllPlugins(o=>{o!==this&&o.preprocessNode&&o.preprocessNode(e,t,s)})}setTileActive(e,t){}setTileVisible(e,t){}calculateError(e){return 0}tileInView(e){return!0}ensureChildrenArePreprocessed(e){const t=e.children;for(let s=0,n=t.length;sparseInt(l));console.assert(o<=1,"TilesRenderer: asset.version is expected to be a 1.x or a compatible version."),o===1&&r>0&&console.warn("TilesRenderer: tiles versions at 1.1 or higher have limited support. Some new extensions and features may not be supported.");let a=t.replace(/\/[^/]*\/?$/,"");a=new URL(a,window.location.href).toString(),this.preprocessNode(e.root,a,s)}loadRootTileSet(){let e=this.rootURL;this.invokeAllPlugins(s=>e=s.preprocessURL?s.preprocessURL(e,null):e);const t=this.invokeOnePlugin(s=>s.fetchData&&s.fetchData(e,this.fetchOptions)).then(s=>{if(s.ok)return s.json();throw new Error(`TilesRenderer: Failed to load tileset "${e}" with status ${s.status} : ${s.statusText}`)}).then(s=>{this.preprocessTileSet(s,e),this.rootTileSet=s});return t.catch(s=>{console.error(s),this.rootTileSet=null}),t}requestTileContents(e){if(e.__loadingState!==U)return;let t=!1,s=new URL(e.content.uri,e.__basePath+"/").toString();this.invokeAllPlugins(d=>s=d.preprocessURL?d.preprocessURL(s,e):s);const n=this.stats,o=this.lruCache,r=this.downloadQueue,a=this.parseQueue,l=ne(s);if(!o.add(e,d=>{d.__loadingState===B?(d.__loadAbort.abort(),d.__loadAbort=null):t?d.children.length=0:this.invokeAllPlugins(_=>{_.disposeTile&&_.disposeTile(d)}),d.__loadingState===B?n.downloading--:d.__loadingState===$&&n.parsing--,d.__loadingState=U,d.__loadIndex++,a.remove(d),r.remove(d)}))return;e.__loadIndex++;const h=e.__loadIndex,p=new AbortController,f=p.signal;n.downloading++,e.__loadAbort=p,e.__loadingState=B;const m=d=>{e.__loadIndex===h&&(d.name!=="AbortError"?(a.remove(e),r.remove(e),e.__loadingState===$?n.parsing--:e.__loadingState===B&&n.downloading--,n.failed++,console.error(`TilesRenderer : Failed to load tile at url "${e.content.uri}".`),console.error(d),e.__loadingState=F,o.setLoaded(e,!0)):o.remove(e))};return r.add(e,d=>d.__loadIndex!==h?Promise.resolve():this.invokeOnePlugin(_=>_.fetchData&&_.fetchData(s,{...this.fetchOptions,signal:f}))).then(d=>{if(e.__loadIndex===h){if(d.ok)return l==="json"?d.json():d.arrayBuffer();throw new Error(`Failed to load model with error code ${d.status}`)}}).then(d=>{if(e.__loadIndex===h)return n.downloading--,n.parsing++,e.__loadAbort=null,e.__loadingState=$,a.add(e,_=>_.__loadIndex!==h?Promise.resolve():l==="json"&&d.root?(this.preprocessTileSet(d,s,e),e.children.push(d.root),t=!0,Promise.resolve()):this.invokeOnePlugin(S=>S.parseTile&&S.parseTile(d,_,l,s)))}).then(()=>{e.__loadIndex===h&&(n.parsing--,e.__loadingState=V,o.setLoaded(e,!0),o.getMemoryUsage(e)===null&&(o.isFull()&&o.computeMemoryUsageCallback(e)>0?o.remove(e):o.updateMemoryUsage(e)))}).catch(m)}getAttributions(e=[]){return this.invokeAllPlugins(t=>t!==this&&t.getAttributions&&t.getAttributions(e)),e}invokeOnePlugin(e){const t=[...this.plugins,this];for(let s=0;sNumber.EPSILON){n=!0;break}}if(n){this.matrixWorld.copy(N);const o=this.children;for(let r=0,a=o.length;r{Object.getPrototypeOf(o).raycast.call(o,e,s)}):t.invokeOnePlugin(r=>r.raycastTile&&r.raycastTile(i,n,e,s))||e.intersectObject(n,!0,s)}function nt(i,e,t){Re(i,e,t,z),z.sort(Pe);const s=z[0]||null;return z.length=0,s}function Me(i,e,t,s=null){const{group:n,activeTiles:o}=i;i.ensureChildrenArePreprocessed(e),s===null&&(s=Ce,G.copy(n.matrixWorld).invert(),s.copy(t.ray).applyMatrix4(G));const r=[],a=e.children;for(let h=0,p=a.length;hc)break;const _=Me(i,d,t,s);if(_){const S=_.distance*_.distance;Snew y),this.planes=new Array(6).fill().map(()=>new Ne)}clampPoint(e,t){return t.copy(e).applyMatrix4(this.inverseTransform).clamp(this.box.min,this.box.max).applyMatrix4(this.transform)}distanceToPoint(e){return this.clampPoint(e,v).distanceTo(e)}containsPoint(e){return v.copy(e).applyMatrix4(this.inverseTransform),this.box.containsPoint(v)}intersectsRay(e){return j.copy(e).applyMatrix4(this.inverseTransform),j.intersectsBox(this.box)}intersectRay(e,t){return j.copy(e).applyMatrix4(this.inverseTransform),j.intersectBox(this.box,t)?(t.applyMatrix4(this.transform),t):null}update(){const{points:e,inverseTransform:t,transform:s,box:n}=this;t.copy(s).invert();const{min:o,max:r}=n;let a=0;for(let l=-1;l<=1;l+=2)for(let c=-1;c<=1;c+=2)for(let h=-1;h<=1;h+=2)e[a].set(l<0?o.x:r.x,c<0?o.y:r.y,h<0?o.z:r.z).applyMatrix4(s),a++;this.updatePlanes()}updatePlanes(){q.copy(this.box.min).applyMatrix4(this.transform),W.copy(this.box.max).applyMatrix4(this.transform),v.set(0,0,1).transformDirection(this.transform),this.planes[0].setFromNormalAndCoplanarPoint(v,q),this.planes[1].setFromNormalAndCoplanarPoint(v,W).negate(),v.set(0,1,0).transformDirection(this.transform),this.planes[2].setFromNormalAndCoplanarPoint(v,q),this.planes[3].setFromNormalAndCoplanarPoint(v,W).negate(),v.set(1,0,0).transformDirection(this.transform),this.planes[4].setFromNormalAndCoplanarPoint(v,q),this.planes[5].setFromNormalAndCoplanarPoint(v,W).negate()}intersectsFrustum(e){const{points:t}=this,{planes:s}=e;for(let n=0;n<6;n++){const o=s[n];let r=-1/0;for(let a=0;a<8;a++){const l=t[a],c=o.distanceToPoint(l);r=ro?n:o}intersectsFrustum(e){const t=this.obb||this.regionObb,s=this.sphere;return s&&!e.intersectsSphere(s)||t&&!t.intersectsFrustum(e)?!1:!!(s||t)}getOBB(e,t){const s=this.obb||this.regionObb;s?(e.copy(s.box),t.copy(s.transform)):(this.getAABB(e),t.identity())}getAABB(e){if(this.sphere)this.sphere.getBoundingBox(e);else{const t=this.obb||this.regionObb;e.copy(t.box).applyMatrix4(t.transform)}}getSphere(e){if(this.sphere)e.copy(this.sphere);else if(this.region)this.region.getBoundingSphere(e);else{const t=this.obb||this.regionObb;t.box.getBoundingSphere(e),e.applyMatrix4(t.transform)}}setObbData(e,t){const s=new le;P.set(e[3],e[4],e[5]),R.set(e[6],e[7],e[8]),M.set(e[9],e[10],e[11]);const n=P.length(),o=R.length(),r=M.length();P.normalize(),R.normalize(),M.normalize(),n===0&&P.crossVectors(R,M),o===0&&R.crossVectors(P,M),r===0&&M.crossVectors(P,R),s.transform.set(P.x,R.x,M.x,e[0],P.y,R.y,M.y,e[1],P.z,R.z,M.z,e[2],0,0,0,1).premultiply(t),s.box.min.set(-n,-o,-r),s.box.max.set(n,o,r),s.update(),this.obb=s}setSphereData(e,t,s,n,o){const r=new qe;r.center.set(e,t,s),r.radius=n,r.applyMatrix4(o),this.sphere=r}setRegionData(e,t,s,n,o,r,a){const l=new He(...e.radius,s,o,t,n,r,a),c=new le;l.getBoundingBox(c.box,c.transform),c.update(),this.region=l,this.regionObb=c}}const ot=new We;function rt(i,e,t,s){const n=ot.set(i.normal.x,i.normal.y,i.normal.z,e.normal.x,e.normal.y,e.normal.z,t.normal.x,t.normal.y,t.normal.z);return s.set(-i.constant,-e.constant,-t.constant),s.applyMatrix3(n.invert()),s}class at extends je{constructor(){super(),this.points=Array(8).fill().map(()=>new y)}setFromProjectionMatrix(e,t){super.setFromProjectionMatrix(e,t),this.calculateFrustumPoints()}calculateFrustumPoints(){const{planes:e,points:t}=this;[[e[0],e[3],e[4]],[e[1],e[3],e[4]],[e[0],e[2],e[4]],[e[1],e[2],e[4]],[e[0],e[3],e[5]],[e[1],e[3],e[5]],[e[0],e[2],e[5]],[e[1],e[2],e[5]]].forEach((n,o)=>{rt(n[0],n[1],n[2],t[o])})}}function lt(i){const{TextureUtils:e}=Je;if(!e)return 0;const t=new Set;let s=0;return i.traverse(n=>{if(n.geometry&&!t.has(n.geometry)&&(s+=Ye(n.geometry),t.add(n.geometry)),n.material){const o=n.material;for(const r in o){const a=o[r];if(a&&a.isTexture&&!t.has(a)){const{format:l,type:c,image:h}=a,{width:p,height:f}=h,m=e.getByteLength(p,f,l,c);s+=a.generateMipmaps?m*4/3:m,t.add(a)}}}}),s}const de=new w,ue=new Ge,fe=parseInt(_e)<165,Ue=Symbol("INITIAL_FRUSTUM_CULLED"),J=new w,Y=new w,E=new y,X=new ge,ct=new y(1,0,0),ht=new y(0,1,0);function pe(i,e){i.traverse(t=>{t.frustumCulled=t[Ue]&&e})}class dt extends et{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(e){this._autoDisableRendererCulling!==e&&(super._autoDisableRendererCulling=e,this.forEachLoadedModel(t=>{pe(t,!e)}))}constructor(...e){super(...e),this.group=new tt(this),this.ellipsoid=Ae.clone(),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this.optimizeRaycast=!0,this._upRotationMatrix=new w,this.lruCache.computeMemoryUsageCallback=s=>s.cached.bytesUsed??null,this._autoDisableRendererCulling=!0,this._loadingTiles=!1;const t=new Qe;if(t.setURLModifier(s=>this.preprocessURL?this.preprocessURL(s):s),this.manager=t,this._listeners={},fe){const s=this;this._overridenRaycast=function(n,o){s.optimizeRaycast||Object.getPrototypeOf(this).raycast.call(this,n,o)}}}addEventListener(...e){O.prototype.addEventListener.call(this,...e)}hasEventListener(...e){O.prototype.hasEventListener.call(this,...e)}removeEventListener(...e){O.prototype.removeEventListener.call(this,...e)}dispatchEvent(...e){O.prototype.dispatchEvent.call(this,...e)}getBounds(...e){return console.warn("TilesRenderer: getBounds has been renamed to getBoundingBox."),this.getBoundingBox(...e)}getOrientedBounds(...e){return console.warn("TilesRenderer: getOrientedBounds has been renamed to getOrientedBoundingBox."),this.getOrientedBoundingBox(...e)}getBoundingBox(e){if(!this.root)return!1;const t=this.root.cached.boundingVolume;return t?(t.getAABB(e),!0):!1}getOrientedBoundingBox(e,t){if(!this.root)return!1;const s=this.root.cached.boundingVolume;return s?(s.getOBB(e,t),!0):!1}getBoundingSphere(e){if(!this.root)return!1;const t=this.root.cached.boundingVolume;return t?(t.getSphere(e),!0):!1}forEachLoadedModel(e){this.traverse(t=>{const s=t.cached.scene;s&&e(s,t)})}raycast(e,t){if(this.root)if(e.firstHitOnly){const s=Me(this,this.root,e);s&&t.push(s)}else ke(this,this.root,e,t)}hasCamera(e){return this.cameraMap.has(e)}setCamera(e){const t=this.cameras,s=this.cameraMap;return s.has(e)?!1:(s.set(e,new ge),t.push(e),this.dispatchEvent({type:"add-camera",camera:e}),!0)}setResolution(e,t,s){const n=this.cameraMap;if(!n.has(e))return!1;const o=t.isVector2?t.x:t,r=t.isVector2?t.y:s,a=n.get(e);return(a.width!==o||a.height!==r)&&(a.set(o,r),this.dispatchEvent({type:"camera-resolution-change"})),!0}setResolutionFromRenderer(e,t){return t.getSize(X).multiplyScalar(t.getPixelRatio()),this.setResolution(e,X.x,X.y)}deleteCamera(e){const t=this.cameras,s=this.cameraMap;if(s.has(e)){const n=t.indexOf(e);return t.splice(n,1),s.delete(e),this.dispatchEvent({type:"delete-camera",camera:e}),!0}return!1}preprocessTileSet(e,t,s){super.preprocessTileSet(e,t,s),queueMicrotask(()=>{this.dispatchEvent({type:"load-tile-set",tileSet:e,url:t})})}loadRootTileSet(...e){return super.loadRootTileSet(...e).then(()=>{switch((this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y").toLowerCase()){case"x":this._upRotationMatrix.makeRotationAxis(ht,-Math.PI/2);break;case"y":this._upRotationMatrix.makeRotationAxis(ct,Math.PI/2);break}this.dispatchEvent({type:"load-content"})})}update(){let e=null;if(this.invokeAllPlugins(r=>{if(r.doTilesNeedUpdate){const a=r.doTilesNeedUpdate();e=e===null?a:e||a}}),e===!1){this.dispatchEvent({type:"update-before"}),this.dispatchEvent({type:"update-after"});return}this.dispatchEvent({type:"update-before"});const t=this.group,s=this.cameras,n=this.cameraMap,o=this.cameraInfo;if(s.length===0){console.warn("TilesRenderer: no cameras defined. Cannot update 3d tiles.");return}for(;o.length>s.length;)o.pop();for(;o.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let r=0,a=o.length;rL.scene);break}case"gltf":case"glb":{const u=new De(c);u.workingPath=a,u.fetchOptions=l,p=u.parse(e);break}default:console.warn(`TilesRenderer: Content type "${d}" not supported.`),p=Promise.resolve(null);break}const _=this.stats;this._loadingTiles===!1&&_.parsing+_.downloading>0&&(this.dispatchEvent({type:"tiles-load-start"}),this._loadingTiles=!0);const S=await p;let g,A;if(S.isObject3D?(g=S,A=null):(g=S.scene,A=S),await this.invokeAllPlugins(u=>u.processTileModel&&u.processTileModel(g,t)),o._loadIndex!==h)return;g.updateMatrix(),(d==="glb"||d==="gltf")&&g.matrix.multiply(m),g.matrix.premultiply(f),g.matrix.decompose(g.position,g.quaternion,g.scale),g.traverse(u=>{u[Ue]=u.frustumCulled}),pe(g,!this.autoDisableRendererCulling),fe&&g.traverse(u=>{u.raycast=this._overridenRaycast});const Q=[],D=[],I=[];g.traverse(u=>{if(u.geometry&&D.push(u.geometry),u.material){const L=u.material;Q.push(u.material);for(const x in L){const T=L[x];T&&T.isTexture&&I.push(T)}}}),o.materials=Q,o.geometry=D,o.textures=I,o.scene=g,o.metadata=A,o.bytesUsed=lt(g),this.dispatchEvent({type:"load-model",scene:g,tile:t}),this._loadingTiles===!0&&_.parsing+_.downloading===1&&(this.dispatchEvent({type:"tiles-load-end"}),this._loadingTiles=!1)}disposeTile(e){super.disposeTile(e);const t=e.cached;if(t.scene){const s=t.materials,n=t.geometry,o=t.textures,r=t.scene.parent;t.scene.traverse(a=>{a.userData.meshFeatures&&a.userData.meshFeatures.dispose(),a.userData.structuralMetadata&&a.userData.structuralMetadata.dispose()});for(let a=0,l=n.length;a{const t=Symbol(i);Object.defineProperty(dt.prototype,i,{get(){return this[t]||null},set(s){console.warn(`TilesRenderer: "${i}" has been deprecated in favor of the "${e}" event.`),this[t]&&this.removeEventListener(e,this[t]),this[t]=s,this.addEventListener(e,s)}})});export{Xe as L,oe as P,dt as T,xe as t}; diff --git a/example/bundle/assets/UpdateOnChangePlugin-UYN3BMUO.js b/example/bundle/assets/UpdateOnChangePlugin-UYN3BMUO.js new file mode 100644 index 00000000..cc3f86d4 --- /dev/null +++ b/example/bundle/assets/UpdateOnChangePlugin-UYN3BMUO.js @@ -0,0 +1 @@ +import{j as r}from"./three.module-_fL2BuBc.js";const a=new r;class l{constructor(){this.name="UPDATE_ON_CHANGE_PLUGIN",this.tiles=null,this.needsUpdate=!1,this.cameraMatrices=new Map}init(e){this.tiles=e,this._needsUpdateCallback=()=>{this.needsUpdate=!0},this._onCameraAdd=({camera:t})=>{this.needsUpdate=!0,this.cameraMatrices.set(t,new r)},this._onCameraDelete=({camera:t})=>{this.needsUpdate=!0,this.cameraMatrices.delete(t)},e.addEventListener("camera-resolution-change",this._needsUpdateCallback),e.addEventListener("load-content",this._needsUpdateCallback),e.addEventListener("add-camera",this._onCameraAdd),e.addEventListener("delete-camera",this._onCameraDelete),e.cameras.forEach(t=>{this._onCameraAdd({camera:t})})}doTilesNeedUpdate(){const e=this.tiles;let t=!1;this.cameraMatrices.forEach((s,n)=>{a.copy(e.group.matrixWorld).premultiply(n.matrixWorldInverse).premultiply(n.projectionMatrixInverse),t=t||!a.equals(s),s.copy(a)});const d=this.needsUpdate;return this.needsUpdate=!1,d||t}dispose(){const e=this.tiles;e.removeEventListener("camera-resolution-change",this._needsUpdateCallback),e.removeEventListener("content-load",this._needsUpdateCallback),e.removeEventListener("camera-add",this._onCameraAdd),e.removeEventListener("camera-delete",this._onCameraDelete)}}export{l as U}; diff --git a/example/bundle/assets/atmosphere-LeLRwlBp.js b/example/bundle/assets/atmosphere-LeLRwlBp.js new file mode 100644 index 00000000..9fba9b77 --- /dev/null +++ b/example/bundle/assets/atmosphere-LeLRwlBp.js @@ -0,0 +1,1552 @@ +import{V as b,_ as ve,a2 as j,az as sn,aA as on,aB as ln,aC as cn,aD as J,aE as or,a3 as gi,a4 as pi,aF as Ae,aG as ge,a0 as lr,aH as f,y as un,aI as dn,C as cr,S as Fr,aJ as mi,g as fn,x as pe,aK as ot,aL as lt,b as _,aM as hn,aN as Ai,aO as Je,L as vn,aP as $,p as Et,a as gn,ah as Tt,ai as qe,r as Gr,aQ as pn,$ as Vt,k as x,j as I,i as q,t as Ct,F as mn,a1 as xi,z as An,aR as Hr,o as xn,aS as wi,aT as kr,aU as Nt,d as ur,aV as wn,O as Dn}from"./three.module-_fL2BuBc.js";import{r as w,R as Yt,u as ze,a as $e,b as En,j as C,e as Tn,_ as Cn,c as Sn,C as yn,T as Bn,d as Me,G as Mn}from"./extends-BiwV-o27.js";import{D as Rn}from"./DRACOLoader-BZaFS3O1.js";import{u as In,T as Pn}from"./leva.esm-CLDXiY66.js";import{t as bn}from"./GLTFLoader-CFm4138C.js";import{G as Ln}from"./GoogleCloudAuthPlugin-BapiqItz.js";import{G as Un}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import{T as On}from"./TileCompressionPlugin-CHefINqs.js";import{U as Nn}from"./UpdateOnChangePlugin-UYN3BMUO.js";import{T as zn}from"./TilesFadePlugin-oL7QwVsE.js";import{C as Fn,a as Gn}from"./CameraTransition-CM6KQSA4.js";import"./EnvironmentControls-CJG7lPg-.js";import"./GlobeControls-5ygGpakr.js";import"./Ellipsoid-CKpUFSOi.js";import"./TilesRenderer-DkGmB3Pz.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./CameraTransitionManager-CKH8Mdl-.js";/** + * postprocessing v6.36.4 build Tue Nov 05 2024 + * https://github.com/pmndrs/postprocessing + * Copyright 2015-2024 Raoul van Rüschen + * @license Zlib + */var zt=1/1e3,Hn=1e3,kn=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(e){typeof document<"u"&&document.hidden!==void 0&&(e?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=e)}get delta(){return this._delta*zt}get fixedDelta(){return this._fixedDelta*zt}set fixedDelta(e){this._fixedDelta=e*Hn}get elapsed(){return this._elapsed*zt}update(e){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(e!==void 0?e:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},Qn=(()=>{const e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]),r=new Tt;return r.setAttribute("position",new qe(e,3)),r.setAttribute("uv",new qe(t,2)),r})(),Y=class Wt{static get fullscreenGeometry(){return Qn}constructor(t="Pass",r=new Fr,i=new mi){this.name=t,this.renderer=null,this.scene=r,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(t){if(this.rtt===t){const r=this.fullscreenMaterial;r!==null&&(r.needsUpdate=!0),this.rtt=!t}}set mainScene(t){}set mainCamera(t){}setRenderer(t){this.renderer=t}isEnabled(){return this.enabled}setEnabled(t){this.enabled=t}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(t){let r=this.screen;r!==null?r.material=t:(r=new fn(Wt.fullscreenGeometry,t),r.frustumCulled=!1,this.scene===null&&(this.scene=new Fr),this.scene.add(r),this.screen=r)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(t){this.fullscreenMaterial=t}getDepthTexture(){return null}setDepthTexture(t,r=Ae){}render(t,r,i,n,a){throw new Error("Render method not implemented!")}setSize(t,r){}initialize(t,r,i){}dispose(){for(const t of Object.keys(this)){const r=this[t];(r instanceof J||r instanceof Ai||r instanceof Je||r instanceof Wt)&&this[t].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},Vn=class extends Y{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(e,t,r,i,n){const a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},Yn=`#include +#include +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; +#include +#include +}`,dr="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",Di=class extends _{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new f(null),opacity:new f(1)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Yn,vertexShader:dr})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},Ei=class extends Y{constructor(e,t=!0){super("CopyPass"),this.fullscreenMaterial=new Di,this.needsSwap=!1,this.renderTarget=e,e===void 0&&(this.renderTarget=new J(1,1,{minFilter:pe,magFilter:pe,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,r,i,n){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,r){r!==void 0&&(this.renderTarget.texture.type=r,r!==ve?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":e!==null&&e.outputColorSpace===j&&(this.renderTarget.texture.colorSpace=j))}},Qr=new cr,fr=class extends Y{constructor(e=!0,t=!0,r=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=r,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,r){this.color=e,this.depth=t,this.stencil=r}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,r,i,n){const a=this.overrideClearColor,s=this.overrideClearAlpha,l=e.getClearAlpha(),o=a!==null,u=s>=0;o?(e.getClearColor(Qr),e.setClearColor(a,u?s:l)):u&&e.setClearAlpha(s),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),o?e.setClearColor(Qr,l):u&&e.setClearAlpha(l)}},Wn=class extends Y{constructor(e,t){super("MaskPass",e,t),this.needsSwap=!1,this.clearPass=new fr(!1,!1,!0),this.inverse=!1}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,r,i,n){const a=e.getContext(),s=e.state.buffers,l=this.scene,o=this.camera,u=this.clearPass,c=this.inverted?0:1,d=1-c;s.color.setMask(!1),s.depth.setMask(!1),s.color.setLocked(!0),s.depth.setLocked(!0),s.stencil.setTest(!0),s.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),s.stencil.setFunc(a.ALWAYS,c,4294967295),s.stencil.setClear(d),s.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?u.render(e,null):(u.render(e,t),u.render(e,r))),this.renderToScreen?(e.setRenderTarget(null),e.render(l,o)):(e.setRenderTarget(t),e.render(l,o),e.setRenderTarget(r),e.render(l,o)),s.color.setLocked(!1),s.depth.setLocked(!1),s.stencil.setLocked(!1),s.stencil.setFunc(a.EQUAL,1,4294967295),s.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),s.stencil.setLocked(!0)}},Xn=class{constructor(t=null,{depthBuffer:r=!0,stencilBuffer:i=!1,multisampling:n=0,frameBufferType:a}={}){this.renderer=null,this.inputBuffer=this.createBuffer(r,i,a,n),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Ei,this.depthTexture=null,this.passes=[],this.timer=new kn,this.autoRenderToScreen=!0,this.setRenderer(t)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(t){const r=this.inputBuffer,i=this.multisampling;i>0&&t>0?(this.inputBuffer.samples=t,this.outputBuffer.samples=t,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==t&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(r.depthBuffer,r.stencilBuffer,r.texture.type,t),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(t){if(this.renderer=t,t!==null){const r=t.getSize(new b),i=t.getContext().getContextAttributes().alpha,n=this.inputBuffer.texture.type;n===ve&&t.outputColorSpace===j&&(this.inputBuffer.texture.colorSpace=j,this.outputBuffer.texture.colorSpace=j,this.inputBuffer.dispose(),this.outputBuffer.dispose()),t.autoClear=!1,this.setSize(r.width,r.height);for(const a of this.passes)a.initialize(t,i,n)}}replaceRenderer(t,r=!0){const i=this.renderer,n=i.domElement.parentNode;return this.setRenderer(t),r&&n!==null&&(n.removeChild(i.domElement),n.appendChild(t.domElement)),i}createDepthTexture(){const t=this.depthTexture=new sn;return this.inputBuffer.depthTexture=t,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(t.format=on,t.type=ln):t.type=cn,t}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const t of this.passes)t.setDepthTexture(null)}}createBuffer(t,r,i,n){const a=this.renderer,s=a===null?new b:a.getDrawingBufferSize(new b),l={minFilter:pe,magFilter:pe,stencilBuffer:r,depthBuffer:t,type:i},o=new J(s.width,s.height,l);return n>0&&(o.ignoreDepthForMultisampleCopy=!1,o.samples=n),i===ve&&a!==null&&a.outputColorSpace===j&&(o.texture.colorSpace=j),o.texture.name="EffectComposer.Buffer",o.texture.generateMipmaps=!1,o}setMainScene(t){for(const r of this.passes)r.mainScene=t}setMainCamera(t){for(const r of this.passes)r.mainCamera=t}addPass(t,r){const i=this.passes,n=this.renderer,a=n.getDrawingBufferSize(new b),s=n.getContext().getContextAttributes().alpha,l=this.inputBuffer.texture.type;if(t.setRenderer(n),t.setSize(a.width,a.height),t.initialize(n,s,l),this.autoRenderToScreen&&(i.length>0&&(i[i.length-1].renderToScreen=!1),t.renderToScreen&&(this.autoRenderToScreen=!1)),r!==void 0?i.splice(r,0,t):i.push(t),this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!0),t.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const o=this.createDepthTexture();for(t of i)t.setDepthTexture(o)}else t.setDepthTexture(this.depthTexture)}removePass(t){const r=this.passes,i=r.indexOf(t);if(i!==-1&&r.splice(i,1).length>0){if(this.depthTexture!==null){const s=(o,u)=>o||u.needsDepthTexture;r.reduce(s,!1)||(t.getDepthTexture()===this.depthTexture&&t.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===r.length&&(t.renderToScreen=!1,r.length>0&&(r[r.length-1].renderToScreen=!0))}}removeAllPasses(){const t=this.passes;this.deleteDepthTexture(),t.length>0&&(this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!1),this.passes=[])}render(t){const r=this.renderer,i=this.copyPass;let n=this.inputBuffer,a=this.outputBuffer,s=!1,l,o,u;t===void 0&&(this.timer.update(),t=this.timer.getDelta());for(const c of this.passes)c.enabled&&(c.render(r,n,a,t,s),c.needsSwap&&(s&&(i.renderToScreen=c.renderToScreen,l=r.getContext(),o=r.state.buffers.stencil,o.setFunc(l.NOTEQUAL,1,4294967295),i.render(r,n,a,t,s),o.setFunc(l.EQUAL,1,4294967295)),u=n,n=a,a=u),c instanceof Wn?s=!0:c instanceof Vn&&(s=!1))}setSize(t,r,i){const n=this.renderer,a=n.getSize(new b);(t===void 0||r===void 0)&&(t=a.width,r=a.height),(a.width!==t||a.height!==r)&&n.setSize(t,r,i);const s=n.getDrawingBufferSize(new b);this.inputBuffer.setSize(s.width,s.height),this.outputBuffer.setSize(s.width,s.height);for(const l of this.passes)l.setSize(s.width,s.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const t of this.passes)t.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Y.fullscreenGeometry.dispose()}},Z={NONE:0,DEPTH:1,CONVOLUTION:2},y={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Kn=class{constructor(){this.shaderParts=new Map([[y.FRAGMENT_HEAD,null],[y.FRAGMENT_MAIN_UV,null],[y.FRAGMENT_MAIN_IMAGE,null],[y.VERTEX_HEAD,null],[y.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Z.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=gi}},Ft=!1,Vr=class{constructor(e=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=t=>{if(t.isMesh){let r;if(t.material.flatShading)switch(t.material.side){case lt:r=this.materialsFlatShadedDoubleSide;break;case ot:r=this.materialsFlatShadedBackSide;break;default:r=this.materialsFlatShaded;break}else switch(t.material.side){case lt:r=this.materialsDoubleSide;break;case ot:r=this.materialsBackSide;break;default:r=this.materials;break}this.originalMaterials.set(t,t.material),t.isSkinnedMesh?t.material=r[2]:t.isInstancedMesh?t.material=r[1]:t.material=r[0],++this.meshCount}}}cloneMaterial(e){if(!(e instanceof _))return e.clone();const t=e.uniforms,r=new Map;for(const n in t){const a=t[n].value;a.isRenderTargetTexture&&(t[n].value=null,r.set(n,a))}const i=e.clone();for(const n of r)t[n[0]].value=n[1],i.uniforms[n[0]].value=n[1];return i}setMaterial(e){if(this.disposeMaterials(),this.material=e,e!==null){const t=this.materials=[this.cloneMaterial(e),this.cloneMaterial(e),this.cloneMaterial(e)];for(const r of t)r.uniforms=Object.assign({},e.uniforms),r.side=hn;t[2].skinning=!0,this.materialsBackSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.side=ot,i}),this.materialsDoubleSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.side=lt,i}),this.materialsFlatShaded=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i.side=ot,i}),this.materialsFlatShadedDoubleSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i.side=lt,i})}}render(e,t,r){const i=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,Ft){const n=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,r);for(const a of n)a[0].material=a[1];this.meshCount!==n.size&&n.clear()}else{const n=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,r),t.overrideMaterial=n}e.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Ft}static set workaroundEnabled(e){Ft=e}},fe=-1,V=class extends or{constructor(e,t=fe,r=fe,i=1){super(),this.resizable=e,this.baseSize=new b(1,1),this.preferredSize=new b(t,r),this.target=this.preferredSize,this.s=i,this.effectiveSize=new b,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const e=this.baseSize,t=this.preferredSize,r=this.effectiveSize,i=this.scale;t.width!==fe?r.width=t.width:t.height!==fe?r.width=Math.round(t.height*(e.width/Math.max(e.height,1))):r.width=Math.round(e.width*i),t.height!==fe?r.height=t.height:t.width!==fe?r.height=Math.round(t.width/Math.max(e.width/Math.max(e.height,1),1)):r.height=Math.round(e.height*i)}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(fe),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.baseSize.width!==e||this.baseSize.height!==t)&&(this.baseSize.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferredSize.width!==e||this.preferredSize.height!==t)&&(this.preferredSize.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(e){this.s=e.scale,this.baseSize.set(e.baseWidth,e.baseHeight),this.preferredSize.set(e.preferredWidth,e.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return fe}},E={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},jn="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",Zn="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",Jn="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",qn="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",_n="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",$n="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",ea="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",ta="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",ra="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",ia="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",na="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",aa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",sa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",oa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",la="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",ca="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",ua="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",da="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",fa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",ha="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",va="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",ga="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",pa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",ma="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",Aa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",xa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",wa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Da="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",Ea="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",Ta="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",Ca="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",Sa="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",ya=new Map([[E.ADD,jn],[E.ALPHA,Zn],[E.AVERAGE,Jn],[E.COLOR,qn],[E.COLOR_BURN,_n],[E.COLOR_DODGE,$n],[E.DARKEN,ea],[E.DIFFERENCE,ta],[E.DIVIDE,ra],[E.DST,null],[E.EXCLUSION,ia],[E.HARD_LIGHT,na],[E.HARD_MIX,aa],[E.HUE,sa],[E.INVERT,oa],[E.INVERT_RGB,la],[E.LIGHTEN,ca],[E.LINEAR_BURN,ua],[E.LINEAR_DODGE,da],[E.LINEAR_LIGHT,fa],[E.LUMINOSITY,ha],[E.MULTIPLY,va],[E.NEGATION,ga],[E.NORMAL,pa],[E.OVERLAY,ma],[E.PIN_LIGHT,Aa],[E.REFLECT,xa],[E.SATURATION,wa],[E.SCREEN,Da],[E.SOFT_LIGHT,Ea],[E.SRC,Ta],[E.SUBTRACT,Ca],[E.VIVID_LIGHT,Sa]]),Ba=class extends or{constructor(e,t=1){super(),this._blendFunction=e,this.opacity=new f(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return ya.get(this.blendFunction)}},hr={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},Ma=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; +#include +}`,Ra="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",Ia=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],Pa=class extends _{constructor(e=new Gr){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new f(null),texelSize:new f(new Gr),scale:new f(1),kernel:new f(0)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ma,vertexShader:Ra}),this.setTexelSize(e.x,e.y),this.kernelSize=hr.MEDIUM}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get kernelSequence(){return Ia[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t,e*.5,t*.5)}setSize(e,t){const r=1/e,i=1/t;this.uniforms.texelSize.value.set(r,i,r*.5,i*.5)}},ba=class extends Y{constructor({kernelSize:e=hr.MEDIUM,resolutionScale:t=.5,width:r=V.AUTO_SIZE,height:i=V.AUTO_SIZE,resolutionX:n=r,resolutionY:a=i}={}){super("KawaseBlurPass"),this.renderTargetA=new J(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const s=this.resolution=new V(this,n,a,t);s.addEventListener("change",l=>this.setSize(s.baseWidth,s.baseHeight)),this._blurMaterial=new Pa,this._blurMaterial.kernelSize=e,this.copyMaterial=new Di}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(e){this._blurMaterial=e}get dithering(){return this.copyMaterial.dithering}set dithering(e){this.copyMaterial.dithering=e}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(e){this.blurMaterial.kernelSize=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,i,n){const a=this.scene,s=this.camera,l=this.renderTargetA,o=this.renderTargetB,u=this.blurMaterial,c=u.kernelSequence;let d=t;this.fullscreenMaterial=u;for(let v=0,g=c.length;v +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef RANGE +uniform vec2 range; +#elif defined(THRESHOLD) +uniform float threshold;uniform float smoothing; +#endif +varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb); +#ifdef RANGE +float low=step(range.x,l);float high=step(l,range.y);l*=low*high; +#elif defined(THRESHOLD) +l=smoothstep(threshold,threshold+smoothing,l)*l; +#endif +#ifdef COLOR +gl_FragColor=vec4(texel.rgb*clamp(l,0.0,1.0),l); +#else +gl_FragColor=vec4(l); +#endif +}`,Ua=class extends _{constructor(e=!1,t=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Et.replace(/\D+/g,"")},uniforms:{inputBuffer:new f(null),threshold:new f(0),smoothing:new f(1),range:new f(null)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:La,vertexShader:dr}),this.colorOutput=e,this.luminanceRange=t}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get threshold(){return this.uniforms.threshold.value}set threshold(e){this.smoothing>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=e}getThreshold(){return this.threshold}setThreshold(e){this.threshold=e}get smoothing(){return this.uniforms.smoothing.value}set smoothing(e){this.threshold>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=e}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(e){this.smoothing=e}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(e){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(e){e?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(e){return this.colorOutput}setColorOutputEnabled(e){this.colorOutput=e}get useRange(){return this.luminanceRange!==null}set useRange(e){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(e){e!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=e,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(e){this.luminanceRange=e}},Oa=class extends Y{constructor({renderTarget:e,luminanceRange:t,colorOutput:r,resolutionScale:i=1,width:n=V.AUTO_SIZE,height:a=V.AUTO_SIZE,resolutionX:s=n,resolutionY:l=a}={}){super("LuminancePass"),this.fullscreenMaterial=new Ua(r,t),this.needsSwap=!1,this.renderTarget=e,this.renderTarget===void 0&&(this.renderTarget=new J(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const o=this.resolution=new V(this,s,l,i);o.addEventListener("change",u=>this.setSize(o.baseWidth,o.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(e,t,r,i,n){const a=this.fullscreenMaterial;a.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height)}initialize(e,t,r){r!==void 0&&r!==ve&&(this.renderTarget.texture.type=r,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Na=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#define WEIGHT_INNER 0.125 +#define WEIGHT_OUTER 0.0555555 +varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; +#include +}`,za="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",Fa=class extends _{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new f(null),texelSize:new f(new b)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Na,vertexShader:za})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},Ga=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; +#else +uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; +#endif +uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); +#include +}`,Ha="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",ka=class extends _{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new f(null),supportBuffer:new f(null),texelSize:new f(new b),radius:new f(.85)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ga,vertexShader:Ha})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}set supportBuffer(e){this.uniforms.supportBuffer.value=e}get radius(){return this.uniforms.radius.value}set radius(e){this.uniforms.radius.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},Qa=class extends Y{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new J(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new Fa,this.upsamplingMaterial=new ka,this.resolution=new b}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(e){if(this.levels!==e){const t=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let r=0;r=0;--v){const g=c[v];o.setSize(d.width,d.height),o.inputBuffer=d.texture,o.supportBuffer=u[v].texture,e.setRenderTarget(g),e.render(a,s),d=g}}setSize(e,t){const r=this.resolution;r.set(e,t);let i=r.width,n=r.height;for(let a=0,s=this.downsamplingMipmaps.length;athis.setChanged()),this._inputColorSpace=gi,this._outputColorSpace=pi}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=Ae){}update(e,t,r){}setSize(e,t){}initialize(e,t,r){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof J||t instanceof Ai||t instanceof Je||t instanceof Y)&&this[e].dispose()}}},mt=class extends Y{constructor(e,t="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=e,this.input=t}setInput(e){this.input=e}render(e,t,r,i,n){const a=this.fullscreenMaterial.uniforms;t!==null&&a!==void 0&&a[this.input]!==void 0&&(a[this.input].value=t.texture),e.setRenderTarget(this.renderToScreen?null:r),e.render(this.scene,this.camera)}initialize(e,t,r){r!==void 0&&r!==ve&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},vr=class extends Y{constructor(e,t,r=null){super("RenderPass",e,t),this.needsSwap=!1,this.clearPass=new fr,this.overrideMaterialManager=r===null?null:new Vr(r),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){const e=this.overrideMaterialManager;return e!==null?e.material:null}set overrideMaterial(e){const t=this.overrideMaterialManager;e!==null?t!==null?t.setMaterial(e):this.overrideMaterialManager=new Vr(e):t!==null&&(t.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,r,i,n){const a=this.scene,s=this.camera,l=this.selection,o=s.layers.mask,u=a.background,c=e.shadowMap.autoUpdate,d=this.renderToScreen?null:t;l!==null&&s.layers.set(l.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(d),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(e,a,s):e.render(a,s),s.layers.mask=o,a.background=u,e.shadowMap.autoUpdate=c}},Ti={DEPTH:0,LUMA:1,COLOR:2},Va={DISABLED:0,DEPTH:1,CUSTOM:2},Ve={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},K={LINEAR:0,REINHARD:1,REINHARD2:2,REINHARD2_ADAPTIVE:3,UNCHARTED2:4,OPTIMIZED_CINEON:5,CINEON:5,ACES_FILMIC:6,AGX:7,NEUTRAL:8},Ya=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; +#if EDGE_DETECTION_MODE != 0 +varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; +#endif +#if EDGE_DETECTION_MODE == 1 +#include +#endif +#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} +#elif PREDICATION_MODE == 2 +uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} +#endif +#if PREDICATION_MODE != 0 +vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} +#endif +#if EDGE_DETECTION_MODE != 0 +uniform sampler2D inputBuffer; +#endif +void main(){ +#if EDGE_DETECTION_MODE == 0 +const vec2 threshold=vec2(DEPTH_THRESHOLD); +#elif PREDICATION_MODE != 0 +vec2 threshold=calculatePredicatedThreshold(); +#else +const vec2 threshold=vec2(EDGE_THRESHOLD); +#endif +#if EDGE_DETECTION_MODE == 0 +vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); +#elif EDGE_DETECTION_MODE == 1 +float l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); +#elif EDGE_DETECTION_MODE == 2 +vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); +#endif +}`,Wa=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; +#if EDGE_DETECTION_MODE != 0 +varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; +#endif +void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); +#if EDGE_DETECTION_MODE != 0 +vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); +#endif +gl_Position=vec4(position.xy,1.0,1.0);}`,Xa=class extends _{constructor(e=new b,t=Ti.COLOR){super({name:"EdgeDetectionMaterial",defines:{THREE_REVISION:Et.replace(/\D+/g,""),LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new f(null),depthBuffer:new f(null),predicationBuffer:new f(null),texelSize:new f(e)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ya,vertexShader:Wa}),this.edgeDetectionMode=t}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=Ae){this.depthBuffer=e,this.depthPacking=t}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(e){this.defines.EDGE_DETECTION_MODE=e.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(e){this.edgeDetectionMode=e}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(e){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=e.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(e){this.localContrastAdaptationFactor=e}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(e){this.defines.EDGE_THRESHOLD=e.toFixed("6"),this.defines.DEPTH_THRESHOLD=(e*.1).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(e){this.edgeDetectionThreshold=e}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(e){this.defines.PREDICATION_MODE=e.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(e){this.predicationMode=e}set predicationBuffer(e){this.uniforms.predicationBuffer.value=e}setPredicationBuffer(e){this.uniforms.predicationBuffer.value=e}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(e){this.defines.PREDICATION_THRESHOLD=e.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(e){this.predicationThreshold=e}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(e){this.defines.PREDICATION_SCALE=e.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(e){this.predicationScale=e}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(e){this.defines.PREDICATION_STRENGTH=e.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(e){this.predicationStrength=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},Ka=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) +#if __VERSION__ < 300 +#define round(v) floor(v + 0.5) +#endif +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ +#if !defined(DISABLE_CORNER_DETECTION) +vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); +#endif +}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ +#if !defined(DISABLE_CORNER_DETECTION) +vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); +#endif +}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ +#if !defined(DISABLE_DIAG_DETECTION) +weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ +#endif +vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); +#if !defined(DISABLE_DIAG_DETECTION) +}else{e.r=0.0;} +#endif +}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,ja="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",Za=class extends _{constructor(e=new b,t=new b){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new f(null),searchTexture:new f(null),areaTexture:new f(null),resolution:new f(t),texelSize:new f(e)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ka,vertexShader:ja})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(e){this.uniforms.searchTexture.value=e}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(e){this.uniforms.areaTexture.value=e}setLookupTextures(e,t){this.searchTexture=e,this.areaTexture=t}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(e){const t=Math.min(Math.max(e,0),112);this.defines.MAX_SEARCH_STEPS_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(e){this.orthogonalSearchSteps=e}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(e){const t=Math.min(Math.max(e,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(e){this.diagonalSearchSteps=e}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(e){e?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(e){this.diagonalDetection=e}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(e){const t=Math.min(Math.max(e,0),100);this.defines.CORNER_ROUNDING=t.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(t/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(e){this.cornerRounding=e}get cornerDetection(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerDetection(e){e?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(e){this.cornerDetection=e}setSize(e,t){const r=this.uniforms;r.texelSize.value.set(1/e,1/t),r.resolution.value.set(e,t)}},Yr="data:image/png;base64,iVBOR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XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",Ja="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",qa="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",_a=class extends we{constructor({blendFunction:e=E.SRC,preset:t=Ve.MEDIUM,edgeDetectionMode:r=Ti.COLOR,predicationMode:i=Va.DISABLED}={}){super("SMAAEffect",Ja,{vertexShader:qa,blendFunction:e,attributes:Z.CONVOLUTION|Z.DEPTH,uniforms:new Map([["weightMap",new f(null)]])});let n,a;arguments.length>1&&(n=arguments[0],a=arguments[1],arguments.length>2&&(t=arguments[2]),arguments.length>3&&(r=arguments[3])),this.renderTargetEdges=new J(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new fr(!0,!1,!1),this.clearPass.overrideClearColor=new cr(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new mt(new Xa),this.edgeDetectionMaterial.edgeDetectionMode=r,this.edgeDetectionMaterial.predicationMode=i,this.weightsPass=new mt(new Za);const s=new vn;s.onLoad=()=>{const l=new Je(n);l.name="SMAA.Search",l.magFilter=ge,l.minFilter=ge,l.generateMipmaps=!1,l.needsUpdate=!0,l.flipY=!0,this.weightsMaterial.searchTexture=l;const o=new Je(a);o.name="SMAA.Area",o.magFilter=pe,o.minFilter=pe,o.generateMipmaps=!1,o.needsUpdate=!0,o.flipY=!1,this.weightsMaterial.areaTexture=o,this.dispatchEvent({type:"load"})},s.itemStart("search"),s.itemStart("area"),n!==void 0&&a!==void 0?(s.itemEnd("search"),s.itemEnd("area")):typeof Image<"u"&&(n=new Image,a=new Image,n.addEventListener("load",()=>s.itemEnd("search")),a.addEventListener("load",()=>s.itemEnd("area")),n.src=Yr,a.src=Wr),this.applyPreset(t)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(e){this.edgeDetectionMaterial.edgeDetectionThreshold=e}setOrthogonalSearchSteps(e){this.weightsMaterial.orthogonalSearchSteps=e}applyPreset(e){const t=this.edgeDetectionMaterial,r=this.weightsMaterial;switch(e){case Ve.LOW:t.edgeDetectionThreshold=.15,r.orthogonalSearchSteps=4,r.diagonalDetection=!1,r.cornerDetection=!1;break;case Ve.MEDIUM:t.edgeDetectionThreshold=.1,r.orthogonalSearchSteps=8,r.diagonalDetection=!1,r.cornerDetection=!1;break;case Ve.HIGH:t.edgeDetectionThreshold=.1,r.orthogonalSearchSteps=16,r.diagonalSearchSteps=8,r.cornerRounding=25,r.diagonalDetection=!0,r.cornerDetection=!0;break;case Ve.ULTRA:t.edgeDetectionThreshold=.05,r.orthogonalSearchSteps=32,r.diagonalSearchSteps=16,r.cornerRounding=25,r.diagonalDetection=!0,r.cornerDetection=!0;break}}setDepthTexture(e,t=Ae){this.edgeDetectionMaterial.depthBuffer=e,this.edgeDetectionMaterial.depthPacking=t}update(e,t,r){this.clearPass.render(e,this.renderTargetEdges),this.edgeDetectionPass.render(e,t,this.renderTargetEdges),this.weightsPass.render(e,this.renderTargetEdges,this.renderTargetWeights)}setSize(e,t){this.edgeDetectionMaterial.setSize(e,t),this.weightsMaterial.setSize(e,t),this.renderTargetEdges.setSize(e,t),this.renderTargetWeights.setSize(e,t)}dispose(){const{searchTexture:e,areaTexture:t}=this.weightsMaterial;e!==null&&t!==null&&(e.dispose(),t.dispose()),super.dispose()}static get searchImageDataURL(){return Yr}static get areaImageDataURL(){return Wr}},$a=`#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +#ifdef DOWNSAMPLE_NORMALS +uniform lowp sampler2D normalBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(e,t=Ae){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,r,i,n){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height),this.fullscreenMaterial.setSize(e,t)}initialize(e,t,r){const i=e.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},is=`#include +#define packFloatToRGBA(v) packDepthToRGBA(v) +#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) +uniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv)); +#if __VERSION__ < 300 +float l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r; +#else +float l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r; +#endif +l0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`,ns=class extends _{constructor(){super({name:"AdaptiveLuminanceMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{luminanceBuffer0:new f(null),luminanceBuffer1:new f(null),minLuminance:new f(.01),deltaTime:new f(0),tau:new f(1)},extensions:{shaderTextureLOD:!0},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:is,vertexShader:dr})}set luminanceBuffer0(e){this.uniforms.luminanceBuffer0.value=e}setLuminanceBuffer0(e){this.uniforms.luminanceBuffer0.value=e}set luminanceBuffer1(e){this.uniforms.luminanceBuffer1.value=e}setLuminanceBuffer1(e){this.uniforms.luminanceBuffer1.value=e}set mipLevel1x1(e){this.defines.MIP_LEVEL_1X1=e.toFixed(1),this.needsUpdate=!0}setMipLevel1x1(e){this.mipLevel1x1=e}set deltaTime(e){this.uniforms.deltaTime.value=e}setDeltaTime(e){this.uniforms.deltaTime.value=e}get minLuminance(){return this.uniforms.minLuminance.value}set minLuminance(e){this.uniforms.minLuminance.value=e}getMinLuminance(){return this.uniforms.minLuminance.value}setMinLuminance(e){this.uniforms.minLuminance.value=e}get adaptationRate(){return this.uniforms.tau.value}set adaptationRate(e){this.uniforms.tau.value=e}getAdaptationRate(){return this.uniforms.tau.value}setAdaptationRate(e){this.uniforms.tau.value=e}},as=class extends Y{constructor(e,{minLuminance:t=.01,adaptationRate:r=1}={}){super("AdaptiveLuminancePass"),this.fullscreenMaterial=new ns,this.needsSwap=!1,this.renderTargetPrevious=new J(1,1,{minFilter:ge,magFilter:ge,depthBuffer:!1}),this.renderTargetPrevious.texture.name="Luminance.Previous";const i=this.fullscreenMaterial;i.luminanceBuffer0=this.renderTargetPrevious.texture,i.luminanceBuffer1=e,i.minLuminance=t,i.adaptationRate=r,this.renderTargetAdapted=this.renderTargetPrevious.clone(),this.renderTargetAdapted.texture.name="Luminance.Adapted",this.copyPass=new Ei(this.renderTargetPrevious,!1)}get texture(){return this.renderTargetAdapted.texture}getTexture(){return this.renderTargetAdapted.texture}set mipLevel1x1(e){this.fullscreenMaterial.mipLevel1x1=e}get adaptationRate(){return this.fullscreenMaterial.adaptationRate}set adaptationRate(e){this.fullscreenMaterial.adaptationRate=e}render(e,t,r,i,n){this.fullscreenMaterial.deltaTime=i,e.setRenderTarget(this.renderToScreen?null:this.renderTargetAdapted),e.render(this.scene,this.camera),this.copyPass.render(e,this.renderTargetAdapted)}},ss=`#include +uniform float whitePoint; +#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3 +uniform float middleGrey; +#if TONE_MAPPING_MODE == 3 +uniform lowp sampler2D luminanceBuffer; +#else +uniform float averageLuminance; +#endif +vec3 Reinhard2ToneMapping(vec3 color){color*=toneMappingExposure;float l=luminance(color); +#if TONE_MAPPING_MODE == 3 +float lumAvg=unpackRGBAToFloat(texture2D(luminanceBuffer,vec2(0.5))); +#else +float lumAvg=averageLuminance; +#endif +float lumScaled=(l*middleGrey)/max(lumAvg,1e-6);float lumCompressed=lumScaled*(1.0+lumScaled/(whitePoint*whitePoint));lumCompressed/=(1.0+lumScaled);return clamp(lumCompressed*color,0.0,1.0);} +#elif TONE_MAPPING_MODE == 4 +#define A 0.15 +#define B 0.50 +#define C 0.10 +#define D 0.20 +#define E 0.02 +#define F 0.30 +vec3 Uncharted2Helper(const in vec3 x){return((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}vec3 Uncharted2ToneMapping(vec3 color){color*=toneMappingExposure;return clamp(Uncharted2Helper(color)/Uncharted2Helper(vec3(whitePoint)),0.0,1.0);} +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){ +#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3 +outputColor=vec4(Reinhard2ToneMapping(inputColor.rgb),inputColor.a); +#elif TONE_MAPPING_MODE == 4 +outputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a); +#else +outputColor=vec4(toneMapping(inputColor.rgb),inputColor.a); +#endif +}`,os=class extends we{constructor({blendFunction:e=E.SRC,adaptive:t=!1,mode:r=t?K.REINHARD2_ADAPTIVE:K.AGX,resolution:i=256,maxLuminance:n=4,whitePoint:a=n,middleGrey:s=.6,minLuminance:l=.01,averageLuminance:o=1,adaptationRate:u=1}={}){super("ToneMappingEffect",ss,{blendFunction:e,uniforms:new Map([["luminanceBuffer",new f(null)],["maxLuminance",new f(n)],["whitePoint",new f(a)],["middleGrey",new f(s)],["averageLuminance",new f(o)]])}),this.renderTargetLuminance=new J(1,1,{minFilter:un,depthBuffer:!1}),this.renderTargetLuminance.texture.generateMipmaps=!0,this.renderTargetLuminance.texture.name="Luminance",this.luminancePass=new Oa({renderTarget:this.renderTargetLuminance}),this.adaptiveLuminancePass=new as(this.luminancePass.texture,{minLuminance:l,adaptationRate:u}),this.uniforms.get("luminanceBuffer").value=this.adaptiveLuminancePass.texture,this.resolution=i,this.mode=r}get mode(){return Number(this.defines.get("TONE_MAPPING_MODE"))}set mode(e){if(this.mode===e)return;const r=Et.replace(/\D+/g,"")>=168?"CineonToneMapping(texel)":"OptimizedCineonToneMapping(texel)";switch(this.defines.clear(),this.defines.set("TONE_MAPPING_MODE",e.toFixed(0)),e){case K.LINEAR:this.defines.set("toneMapping(texel)","LinearToneMapping(texel)");break;case K.REINHARD:this.defines.set("toneMapping(texel)","ReinhardToneMapping(texel)");break;case K.CINEON:case K.OPTIMIZED_CINEON:this.defines.set("toneMapping(texel)",r);break;case K.ACES_FILMIC:this.defines.set("toneMapping(texel)","ACESFilmicToneMapping(texel)");break;case K.AGX:this.defines.set("toneMapping(texel)","AgXToneMapping(texel)");break;case K.NEUTRAL:this.defines.set("toneMapping(texel)","NeutralToneMapping(texel)");break;default:this.defines.set("toneMapping(texel)","texel");break}this.adaptiveLuminancePass.enabled=e===K.REINHARD2_ADAPTIVE,this.setChanged()}getMode(){return this.mode}setMode(e){this.mode=e}get whitePoint(){return this.uniforms.get("whitePoint").value}set whitePoint(e){this.uniforms.get("whitePoint").value=e}get middleGrey(){return this.uniforms.get("middleGrey").value}set middleGrey(e){this.uniforms.get("middleGrey").value=e}get averageLuminance(){return this.uniforms.get("averageLuminance").value}set averageLuminance(e){this.uniforms.get("averageLuminance").value=e}get adaptiveLuminanceMaterial(){return this.adaptiveLuminancePass.fullscreenMaterial}getAdaptiveLuminanceMaterial(){return this.adaptiveLuminanceMaterial}get resolution(){return this.luminancePass.resolution.width}set resolution(e){const t=Math.max(0,Math.ceil(Math.log2(e))),r=Math.pow(2,t);this.luminancePass.resolution.setPreferredSize(r,r),this.adaptiveLuminanceMaterial.mipLevel1x1=t}getResolution(){return this.resolution}setResolution(e){this.resolution=e}get adaptive(){return this.mode===K.REINHARD2_ADAPTIVE}set adaptive(e){this.mode=e?K.REINHARD2_ADAPTIVE:K.REINHARD2}get adaptationRate(){return this.adaptiveLuminanceMaterial.adaptationRate}set adaptationRate(e){this.adaptiveLuminanceMaterial.adaptationRate=e}get distinction(){return console.warn(this.name,"distinction was removed."),1}set distinction(e){console.warn(this.name,"distinction was removed.")}update(e,t,r){this.adaptiveLuminancePass.enabled&&(this.luminancePass.render(e,t),this.adaptiveLuminancePass.render(e,null,null,r))}initialize(e,t,r){this.adaptiveLuminancePass.initialize(e,t,r)}},ls=`#include +#include +#include +#define packFloatToRGBA(v) packDepthToRGBA(v) +#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); +#else +return orthographicDepthToViewZ(depth,cameraNear,cameraFar); +#endif +}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; +#ifdef ENCODE_OUTPUT +#include +#endif +#include +}`,cs="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",Ci=class extends _{constructor(e,t,r,i,n=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Et.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new f(null),depthBuffer:new f(null),resolution:new f(new b),texelSize:new f(new b),cameraNear:new f(.3),cameraFar:new f(1e3),aspect:new f(1),time:new f(0)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:n}),e&&this.setShaderParts(e),t&&this.setDefines(t),r&&this.setUniforms(r),this.copyCameraSettings(i)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=Ae){this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){return this.fragmentShader=ls.replace(y.FRAGMENT_HEAD,e.get(y.FRAGMENT_HEAD)||"").replace(y.FRAGMENT_MAIN_UV,e.get(y.FRAGMENT_MAIN_UV)||"").replace(y.FRAGMENT_MAIN_IMAGE,e.get(y.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=cs.replace(y.VERTEX_HEAD,e.get(y.VERTEX_HEAD)||"").replace(y.VERTEX_MAIN_SUPPORT,e.get(y.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(e){for(const t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(const t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(const t of e)this.extensions[t]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof gn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){const r=this.uniforms;r.resolution.value.set(e,t),r.texelSize.value.set(1/e,1/t),r.aspect.value=e/t}static get Section(){return y}};function Xr(e,t,r){for(const i of t){const n="$1"+e+i.charAt(0).toUpperCase()+i.slice(1),a=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const s of r.entries())s[1]!==null&&r.set(s[0],s[1].replace(a,n))}}function us(e,t,r){let i=t.getFragmentShader(),n=t.getVertexShader();const a=i!==void 0&&/mainImage/.test(i),s=i!==void 0&&/mainUv/.test(i);if(r.attributes|=t.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${t.name})`);if(s&&r.attributes&Z.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!a&&!s)throw new Error(`Could not find mainImage or mainUv function (${t.name})`);{const l=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,o=r.shaderParts;let u=o.get(y.FRAGMENT_HEAD)||"",c=o.get(y.FRAGMENT_MAIN_UV)||"",d=o.get(y.FRAGMENT_MAIN_IMAGE)||"",v=o.get(y.VERTEX_HEAD)||"",g=o.get(y.VERTEX_MAIN_SUPPORT)||"";const p=new Set,m=new Set;if(s&&(c+=` ${e}MainUv(UV); +`,r.uvTransformation=!0),n!==null&&/mainSupport/.test(n)){const A=/mainSupport *\([\w\s]*?uv\s*?\)/.test(n);g+=` ${e}MainSupport(`,g+=A?`vUv); +`:`); +`;for(const D of n.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const M of D[1].split(/\s*,\s*/))r.varyings.add(M),p.add(M),m.add(M);for(const D of n.matchAll(l))m.add(D[1])}for(const A of i.matchAll(l))m.add(A[1]);for(const A of t.defines.keys())m.add(A.replace(/\([\w\s,]*\)/g,""));for(const A of t.uniforms.keys())m.add(A);m.delete("while"),m.delete("for"),m.delete("if"),t.uniforms.forEach((A,D)=>r.uniforms.set(e+D.charAt(0).toUpperCase()+D.slice(1),A)),t.defines.forEach((A,D)=>r.defines.set(e+D.charAt(0).toUpperCase()+D.slice(1),A));const B=new Map([["fragment",i],["vertex",n]]);Xr(e,m,r.defines),Xr(e,m,B),i=B.get("fragment"),n=B.get("vertex");const T=t.blendMode;if(r.blendModes.set(T.blendFunction,T),a){t.inputColorSpace!==null&&t.inputColorSpace!==r.colorSpace&&(d+=t.inputColorSpace===j?`color0 = sRGBTransferOETF(color0); + `:`color0 = sRGBToLinear(color0); + `),t.outputColorSpace!==pi?r.colorSpace=t.outputColorSpace:t.inputColorSpace!==null&&(r.colorSpace=t.inputColorSpace);const A=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;d+=`${e}MainImage(color0, UV, `,r.attributes&Z.DEPTH&&A.test(i)&&(d+="depth, ",r.readDepth=!0),d+=`color1); + `;const D=e+"BlendOpacity";r.uniforms.set(D,T.opacity),d+=`color0 = blend${T.blendFunction}(color0, color1, ${D}); + + `,u+=`uniform float ${D}; + +`}if(u+=i+` +`,n!==null&&(v+=n+` +`),o.set(y.FRAGMENT_HEAD,u),o.set(y.FRAGMENT_MAIN_UV,c),o.set(y.FRAGMENT_MAIN_IMAGE,d),o.set(y.VERTEX_HEAD,v),o.set(y.VERTEX_MAIN_SUPPORT,g),t.extensions!==null)for(const A of t.extensions)r.extensions.add(A)}}var ds=class extends Y{constructor(e,...t){super("EffectPass"),this.fullscreenMaterial=new Ci(null,null,null,e),this.listener=r=>this.handleEvent(r),this.effects=[],this.setEffects(t),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(e){for(const t of this.effects)t.mainScene=e}set mainCamera(e){this.fullscreenMaterial.copyCameraSettings(e);for(const t of this.effects)t.mainCamera=e}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(e){this.fullscreenMaterial.encodeOutput=e}get dithering(){return this.fullscreenMaterial.dithering}set dithering(e){const t=this.fullscreenMaterial;t.dithering=e,t.needsUpdate=!0}setEffects(e){for(const t of this.effects)t.removeEventListener("change",this.listener);this.effects=e.sort((t,r)=>r.attributes-t.attributes);for(const t of this.effects)t.addEventListener("change",this.listener)}updateMaterial(){const e=new Kn;let t=0;for(const s of this.effects)if(s.blendMode.blendFunction===E.DST)e.attributes|=s.getAttributes()&Z.DEPTH;else{if(e.attributes&s.getAttributes()&Z.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${s.name})`);us("e"+t++,s,e)}let r=e.shaderParts.get(y.FRAGMENT_HEAD),i=e.shaderParts.get(y.FRAGMENT_MAIN_IMAGE),n=e.shaderParts.get(y.FRAGMENT_MAIN_UV);const a=/\bblend\b/g;for(const s of e.blendModes.values())r+=s.getShaderCode().replace(a,`blend${s.blendFunction}`)+` +`;e.attributes&Z.DEPTH?(e.readDepth&&(i=`float depth = readDepth(UV); + + `+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,e.colorSpace===j&&(i+=`color0 = sRGBToLinear(color0); + `),e.uvTransformation?(n=`vec2 transformedUv = vUv; +`+n,e.defines.set("UV","transformedUv")):e.defines.set("UV","vUv"),e.shaderParts.set(y.FRAGMENT_HEAD,r),e.shaderParts.set(y.FRAGMENT_MAIN_IMAGE,i),e.shaderParts.set(y.FRAGMENT_MAIN_UV,n);for(const[s,l]of e.shaderParts)l!==null&&e.shaderParts.set(s,l.trim().replace(/^#/,` +#`));this.skipRendering=t===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e,t=Ae){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(const r of this.effects)r.setDepthTexture(e,t)}render(e,t,r,i,n){for(const a of this.effects)a.update(e,t,i);if(!this.skipRendering||this.renderToScreen){const a=this.fullscreenMaterial;a.inputBuffer=t.texture,a.time+=i*this.timeScale,e.setRenderTarget(this.renderToScreen?null:r),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(const r of this.effects)r.setSize(e,t)}initialize(e,t,r){this.renderer=e;for(const i of this.effects)i.initialize(e,t,r);this.updateMaterial(),r!==void 0&&r!==ve&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const e of this.effects)e.removeEventListener("change",this.listener),e.dispose()}handleEvent(e){switch(e.type){case"change":this.recompile();break}}},fs=class extends Y{constructor(e,t,{renderTarget:r,resolutionScale:i=1,width:n=V.AUTO_SIZE,height:a=V.AUTO_SIZE,resolutionX:s=n,resolutionY:l=a}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new vr(e,t,new dn);const o=this.renderPass;o.ignoreBackground=!0,o.skipShadowMapUpdate=!0;const u=o.getClearPass();u.overrideClearColor=new cr(7829503),u.overrideClearAlpha=1,this.renderTarget=r,this.renderTarget===void 0&&(this.renderTarget=new J(1,1,{minFilter:ge,magFilter:ge}),this.renderTarget.texture.name="NormalPass.Target");const c=this.resolution=new V(this,s,l,i);c.addEventListener("change",d=>this.setSize(c.baseWidth,c.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,i,n){const a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a,a)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height)}};let Ye;function hs(){var e;if(Ye!==void 0)return Ye;try{let t;const r=document.createElement("canvas");return Ye=!!(window.WebGL2RenderingContext&&(t=r.getContext("webgl2"))),t&&((e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext()),Ye}catch{return Ye=!1}}const Si=w.createContext(null),Kr=e=>(e.getAttributes()&Z.CONVOLUTION)===Z.CONVOLUTION,vs=Yt.memo(w.forwardRef(({children:e,camera:t,scene:r,resolutionScale:i,enabled:n=!0,renderPriority:a=1,autoClear:s=!0,depthBuffer:l,enableNormalPass:o,stencilBuffer:u,multisampling:c=8,frameBufferType:d=Vt},v)=>{const{gl:g,scene:p,camera:m,size:B}=ze(),T=r||p,A=t||m,[D,M,U]=w.useMemo(()=>{const F=hs(),G=new Xn(g,{depthBuffer:l,stencilBuffer:u,multisampling:c>0&&F?c:0,frameBufferType:d});G.addPass(new vr(T,A));let O=null,k=null;return o&&(k=new fs(T,A),k.enabled=!1,G.addPass(k),i!==void 0&&F&&(O=new rs({normalBuffer:k.texture,resolutionScale:i}),O.enabled=!1,G.addPass(O))),[G,k,O]},[A,g,l,u,c,d,T,o,i]);w.useEffect(()=>D==null?void 0:D.setSize(B.width,B.height),[D,B]),$e((F,G)=>{if(n){const O=g.autoClear;g.autoClear=s,u&&!s&&g.clearStencil(),D.render(G),g.autoClear=O}},n?a:0);const W=w.useRef(null),X=En(W);w.useLayoutEffect(()=>{const F=[];if(W.current&&X.current&&D){const G=X.current.objects;for(let O=0;O{for(const G of F)D==null||D.removePass(G);M&&(M.enabled=!1),U&&(U.enabled=!1)}},[D,e,A,M,U,X]),w.useEffect(()=>{const F=g.toneMapping;return g.toneMapping=pn,()=>{g.toneMapping=F}},[]);const ie=w.useMemo(()=>({composer:D,normalPass:M,downSamplingPass:U,resolutionScale:i,camera:A,scene:T}),[D,M,U,i,A,T]);return w.useImperativeHandle(v,()=>D,[D]),C.jsx(Si.Provider,{value:ie,children:C.jsx("group",{ref:W,children:e})})}));let gs=0;const jr=new WeakMap,yi=(e,t)=>Yt.forwardRef(function({blendFunction:i=void 0,opacity:n=void 0,...a},s){let l=jr.get(e);if(!l){const c=`@react-three/postprocessing/${e.name}-${gs++}`;Tn({[c]:e}),jr.set(e,l=c)}const o=ze(c=>c.camera),u=Yt.useMemo(()=>{var c,d;return[...(c=void 0)!=null?c:[],...(d=a.args)!=null?d:[{...t,...a}]]},[JSON.stringify(a)]);return C.jsx(l,{camera:o,"blendMode-blendFunction":i,"blendMode-opacity-value":n,...a,ref:s,args:u})}),ps=yi(_a),ms=w.forwardRef(function({blendFunction:t,adaptive:r,mode:i,resolution:n,maxLuminance:a,whitePoint:s,middleGrey:l,minLuminance:o,averageLuminance:u,adaptationRate:c,...d},v){const g=w.useMemo(()=>new os({blendFunction:t,adaptive:r,mode:i,resolution:n,maxLuminance:a,whitePoint:s,middleGrey:l,minLuminance:o,averageLuminance:u,adaptationRate:c}),[t,r,i,n,a,s,l,o,u,c]);return w.useEffect(()=>{g.dispose()},[g]),C.jsx("primitive",{...d,ref:v,object:g,attributes:Z.CONVOLUTION})});var As=Object.defineProperty,xs=(e,t,r)=>t in e?As(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t,r)=>xs(e,typeof t!="symbol"?t+"":t,r);const ws=new x;function Bi(e,t,r=new x,i){const{x:n,y:a,z:s}=e,l=t.x,o=t.y,u=t.z,c=n*n*l,d=a*a*o,v=s*s*u,g=c+d+v,p=Math.sqrt(1/g);if(!Number.isFinite(p))return;const m=ws.copy(e).multiplyScalar(p);if(g<((i==null?void 0:i.centerTolerance)??.1))return r.copy(m);const B=m.multiply(t).multiplyScalar(2);let T=(1-p)*e.length()/(B.length()/2),A=0,D,M,U,W;do{T-=A,D=1/(1+T*l),M=1/(1+T*o),U=1/(1+T*u);const X=D*D,ie=M*M,F=U*U,G=X*D,O=ie*M,k=F*U;W=c*X+d*ie+v*F-1,A=W/((c*G*l+d*O*o+v*k*u)*-2)}while(Math.abs(W)>1e-12);return r.set(n*D,a*M,s*U)}const ct=new x,Zr=new x,Jr=new x,Xt=class{constructor(t,r,i){Ie(this,"radii"),this.radii=new x(t,r,i)}get minimumRadius(){return Math.min(this.radii.x,this.radii.y,this.radii.z)}get maximumRadius(){return Math.max(this.radii.x,this.radii.y,this.radii.z)}reciprocalRadii(t=new x){const{x:r,y:i,z:n}=this.radii;return t.set(1/r,1/i,1/n)}reciprocalRadiiSquared(t=new x){const{x:r,y:i,z:n}=this.radii;return t.set(1/r**2,1/i**2,1/n**2)}projectOnSurface(t,r=new x,i){return Bi(t,this.reciprocalRadiiSquared(),r,i)}getSurfaceNormal(t,r=new x){return r.multiplyVectors(this.reciprocalRadiiSquared(ct),t).normalize()}getEastNorthUpVectors(t,r=new x,i=new x,n=new x){this.getSurfaceNormal(t,n),r.set(-t.y,t.x,0).normalize(),i.crossVectors(n,r).normalize()}getEastNorthUpFrame(t,r=new I){const i=ct,n=Zr,a=Jr;return this.getEastNorthUpVectors(t,i,n,a),r.makeBasis(i,n,a).setPosition(t)}getIntersection(t,r=new x){const i=this.reciprocalRadii(ct),n=Zr.copy(i).multiply(t.origin),a=Jr.copy(i).multiply(t.direction),s=n.lengthSq(),l=a.lengthSq(),o=n.dot(a),u=o**2-l*(s-1);if(s===1)return r.copy(t.origin);if(s>1){if(o>=0||u<0)return;const c=Math.sqrt(u),d=(-o-c)/l,v=(-o+c)/l;return t.at(Math.min(d,v),r)}if(s<1){const c=o**2-l*(s-1),d=Math.sqrt(c),v=(-o+d)/l;return t.at(v,r)}if(o<0)return t.at(-o/l,r)}getOsculatingSphereCenter(t,r,i=new x){const n=this.radii.x**2,a=ct.set(t.x/n,t.y/n,t.z/this.radii.z**2).normalize();return i.copy(a.multiplyScalar(-r).add(t))}};Ie(Xt,"WGS84",new Xt(6378137,6378137,6356752314245179e-9));let De=Xt;const ut=new x,qr=new x,Ke=class Kt{constructor(t=0,r=0,i=0){this.longitude=t,this.latitude=r,this.height=i}set(t,r,i){return this.longitude=t,this.latitude=r,i!=null&&(this.height=i),this}clone(){return new Kt(this.longitude,this.latitude,this.height)}copy(t){return this.longitude=t.longitude,this.latitude=t.latitude,this.height=t.height,this}equals(t){return t.longitude===this.longitude&&t.latitude===this.latitude&&t.height===this.height}setLongitude(t){return this.longitude=t,this}setLatitude(t){return this.latitude=t,this}setHeight(t){return this.height=t,this}normalize(){return this.longitudet in e?Ds(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,le=(e,t,r)=>Es(e,typeof t!="symbol"?t+"":t,r),Ts=`float reverseLogDepth(const float depth, const float near, const float far) { + #ifdef USE_LOGDEPTHBUF + float d = pow(2.0, depth * log2(far + 1.0)) - 1.0; + float a = far / (far - near); + float b = far * near / (near - far); + return a + b / d; + #else + return depth; + #endif +} + +float linearizeDepth(const float depth, const float near, const float far) { + float ndc = depth * 2.0 - 1.0; + return 2.0 * near * far / (far + near - ndc * (far - near)); +}`,Cs=`vec2 signNotZero(vec2 v) { + return vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0); +} + +vec2 packNormalToVec2(vec3 v) { + vec2 p = v.xy * (1.0 / (abs(v.x) + abs(v.y) + abs(v.z))); + return v.z <= 0.0 + ? (1.0 - abs(p.yx)) * signNotZero(p) + : p; +} + +vec3 unpackVec2ToNormal(vec2 e) { + vec3 v = vec3(e.xy, 1.0 - abs(e.x) - abs(e.y)); + if (v.z < 0.0) { + v.xy = (1.0 - abs(v.yx)) * signNotZero(v.xy); + } + return normalize(v); +}`,Ss=`vec3 screenToView( + const vec2 uv, + const float depth, + const float viewZ, + const mat4 projectionMatrix, + const mat4 inverseProjectionMatrix +) { + vec4 clip = vec4(vec3(uv, depth) * 2.0 - 1.0, 1.0); + float clipW = projectionMatrix[2][3] * viewZ + projectionMatrix[3][3]; + clip *= clipW; + return (inverseProjectionMatrix * clip).xyz; +}`,ys="Invariant failed";function Bs(e,t){if(!e)throw new Error(ys)}let Mi=class extends Ct{load(t,r,i,n){const a=new mn(this.manager);a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),a.load(t,s=>{Bs(s instanceof ArrayBuffer);try{r(s)}catch(l){n!=null?n(l):console.error(l),this.manager.itemError(t)}},i,n)}};var Ms=typeof global=="object"&&global&&global.Object===Object&&global,Rs=typeof self=="object"&&self&&self.Object===Object&&self,gr=Ms||Rs||Function("return this")(),me=gr.Symbol,Ri=Object.prototype,Is=Ri.hasOwnProperty,Ps=Ri.toString,We=me?me.toStringTag:void 0;function bs(e){var t=Is.call(e,We),r=e[We];try{e[We]=void 0;var i=!0}catch{}var n=Ps.call(e);return i&&(t?e[We]=r:delete e[We]),n}var Ls=Object.prototype,Us=Ls.toString;function Os(e){return Us.call(e)}var Ns="[object Null]",zs="[object Undefined]",_r=me?me.toStringTag:void 0;function pr(e){return e==null?e===void 0?zs:Ns:_r&&_r in Object(e)?bs(e):Os(e)}function mr(e){return e!=null&&typeof e=="object"}var Fs="[object Symbol]";function Ar(e){return typeof e=="symbol"||mr(e)&&pr(e)==Fs}function Gs(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r0){if(++t>=oo)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function fo(e){return function(){return e}}var xt=function(){try{var e=xr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),ho=xt?function(e,t){return xt(e,"toString",{configurable:!0,enumerable:!1,value:fo(t),writable:!0})}:ks,vo=uo(ho),go=9007199254740991,po=/^(?:0|[1-9]\d*)$/;function Pi(e,t){var r=typeof e;return t=t??go,!!t&&(r=="number"||r!="symbol"&&po.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Eo}var Co="[object Arguments]";function ii(e){return mr(e)&&pr(e)==Co}var Li=Object.prototype,So=Li.hasOwnProperty,yo=Li.propertyIsEnumerable,Ui=ii(function(){return arguments}())?ii:function(e){return mr(e)&&So.call(e,"callee")&&!yo.call(e,"callee")},Bo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mo=/^\w*$/;function Ro(e,t){if(et(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Ar(e)?!0:Mo.test(e)||!Bo.test(e)||t!=null&&e in Object(t)}var _e=xr(Object,"create");function Io(){this.__data__=_e?_e(null):{},this.size=0}function Po(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var bo="__lodash_hash_undefined__",Lo=Object.prototype,Uo=Lo.hasOwnProperty;function Oo(e){var t=this.__data__;if(_e){var r=t[e];return r===bo?void 0:r}return Uo.call(t,e)?t[e]:void 0}var No=Object.prototype,zo=No.hasOwnProperty;function Fo(e){var t=this.__data__;return _e?t[e]!==void 0:zo.call(t,e)}var Go="__lodash_hash_undefined__";function Ho(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_e&&t===void 0?Go:t,this}function Ee(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}function Ko(e,t){var r=this.__data__,i=St(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function ke(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t{try{r(this.parseTypedArray(s))}catch(l){n!=null?n(l):console.error(l),this.manager.itemError(t)}},i,n)}};class Oi extends Tl{constructor(){super(...arguments),le(this,"parseTypedArray",El)}}const Ni={format:An,wrapS:Hr,wrapT:Hr,minFilter:pe,magFilter:pe};class zi extends Ct{constructor(){super(...arguments),le(this,"parameters")}load(t,r,i,n){const a=new this.Texture,s=new this.TypedArrayLoader(this.manager);s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(t,l=>{a.image.data=l,Object.assign(a,this.parameters),a.needsUpdate=!0,r(a)},i,n)}}let ai=class extends zi{constructor(){super(...arguments),le(this,"Texture",xn),le(this,"TypedArrayLoader",Oi),le(this,"parameters",{...Ni,type:lr})}},Cl=class extends zi{constructor(){super(...arguments),le(this,"Texture",xi),le(this,"TypedArrayLoader",Oi),le(this,"parameters",{...Ni,type:lr})}};q.clamp;q.euclideanModulo;q.inverseLerp;q.lerp;const si=q.degToRad;q.radToDeg;q.isPowerOfTwo;q.ceilPowerOfTwo;q.floorPowerOfTwo;q.normalize;const oi=class Fi{constructor(t=0,r=0,i=0,n=0){this.west=t,this.south=r,this.east=i,this.north=n}get width(){let t=this.east;return tt in e?Ml(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L=(e,t,r)=>Rl(e,typeof t!="symbol"?t+"":t,r);const Il=["solarIrradiance","sunAngularRadius","bottomRadius","topRadius","rayleighScattering","mieScattering","miePhaseFunctionG","muSMinFloat","muSMinHalfFloat","skyRadianceToLuminance","sunRadianceToLuminance","luminousEfficiency"];function Pl(e,t){if(t!=null)for(const r of Il){const i=t[r];i!=null&&(e[r]instanceof x?e[r].copy(i):e[r]=i)}}const jt=class{constructor(t){L(this,"solarIrradiance",new x(1.474,1.8504,1.91198)),L(this,"sunAngularRadius",.004675),L(this,"bottomRadius",636e4),L(this,"topRadius",642e4),L(this,"rayleighScattering",new x(.005802,.013558,.0331)),L(this,"mieScattering",new x(.003996,.003996,.003996)),L(this,"miePhaseFunctionG",.8),L(this,"muSMinFloat",Math.cos(si(120))),L(this,"muSMinHalfFloat",Math.cos(si(102))),L(this,"skyRadianceToLuminance",new x(114974.916437,71305.954816,65310.548555)),L(this,"sunRadianceToLuminance",new x(98242.786222,69954.398112,66475.012354)),L(this,"luminousEfficiency",new x(.2126,.7152,.0722)),L(this,"skyRadianceToRelativeLuminance",new x),L(this,"sunRadianceToRelativeLuminance",new x),Pl(this,t);const r=this.luminousEfficiency.dot(this.skyRadianceToLuminance);this.skyRadianceToRelativeLuminance.copy(this.skyRadianceToLuminance).divideScalar(r),this.sunRadianceToRelativeLuminance.copy(this.sunRadianceToLuminance).divideScalar(r)}};L(jt,"DEFAULT",new jt);let Gi=jt;const Er=64,Tr=16,Cr=32,Sr=128,yr=32,Br=8,bl=Br*yr,Ll=Sr,Ul=Cr,Mr=256,Rr=64,Oe=1/1e3,Hi=100;var Ol=`uniform sampler2D normalBuffer; + +uniform mat4 projectionMatrix; +uniform mat4 inverseProjectionMatrix; +uniform mat4 inverseViewMatrix; +uniform float cameraHeight; +uniform vec3 sunDirection; +uniform vec3 moonDirection; +uniform float moonAngularRadius; +uniform float lunarRadianceScale; +uniform float irradianceScale; +uniform float idealSphereAlpha; + +varying vec3 vWorldPosition; +varying vec3 vWorldDirection; +varying vec3 vEllipsoidCenter; +varying vec3 vSkyEllipsoidCenter; +varying vec3 vEllipsoidRadiiSquared; + +vec3 readNormal(const vec2 uv) { + #ifdef OCT_ENCODED_NORMAL + return unpackVec2ToNormal(texture2D(normalBuffer, uv).xy); + #else + return 2.0 * texture2D(normalBuffer, uv).xyz - 1.0; + #endif +} + +void correctGeometricError(inout vec3 worldPosition, inout vec3 worldNormal) { + + vec3 normal = normalize(1.0 / vEllipsoidRadiiSquared * worldPosition); + vec3 position = u_bottom_radius * normal; + worldNormal = mix(worldNormal, normal, idealSphereAlpha); + worldPosition = mix(worldPosition, position, idealSphereAlpha); +} + +#if defined(SUN_IRRADIANCE) || defined(SKY_IRRADIANCE) +vec3 getSunSkyIrradiance( + const vec3 worldPosition, + const vec3 worldNormal, + const vec3 inputColor +) { + + + vec3 albedo = inputColor * irradianceScale * RECIPROCAL_PI; + vec3 skyIrradiance; + vec3 sunIrradiance = GetSunAndSkyIrradiance( + worldPosition - vEllipsoidCenter, + worldNormal, + sunDirection, + skyIrradiance + ); + #if defined(SUN_IRRADIANCE) && defined(SKY_IRRADIANCE) + return albedo * (sunIrradiance + skyIrradiance); + #elif defined(SUN_IRRADIANCE) + return albedo * sunIrradiance; + #elif defined(SKY_IRRADIANCE) + return albedo * skyIrradiance; + #endif +} +#endif + +#if defined(TRANSMITTANCE) || defined(INSCATTER) +void getTransmittanceInscatter( + const vec3 worldPosition, + const vec3 worldNormal, + inout vec3 radiance +) { + vec3 transmittance; + vec3 inscatter = GetSkyRadianceToPoint( + vWorldPosition - vEllipsoidCenter, + worldPosition - vEllipsoidCenter, + 0.0, + sunDirection, + transmittance + ); + #if defined(TRANSMITTANCE) + radiance = radiance * transmittance; + #endif + #if defined(INSCATTER) + radiance = radiance + inscatter; + #endif +} +#endif + +void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { + float depth = readDepth(uv); + if (depth >= 1.0 - 1e-7) { + #ifdef SKY + vec3 viewPosition = vWorldPosition - vSkyEllipsoidCenter; + vec3 rayDirection = normalize(vWorldDirection); + outputColor.rgb = getSkyRadiance( + viewPosition, + rayDirection, + sunDirection, + moonDirection, + moonAngularRadius, + lunarRadianceScale + ); + outputColor.a = 1.0; + #else + outputColor = inputColor; + #endif + return; + } + depth = reverseLogDepth(depth, cameraNear, cameraFar); + + + vec3 viewPosition = screenToView( + uv, + depth, + getViewZ(depth), + projectionMatrix, + inverseProjectionMatrix + ); + vec3 viewNormal; + #ifdef RECONSTRUCT_NORMAL + vec3 dx = dFdx(viewPosition); + vec3 dy = dFdy(viewPosition); + viewNormal = normalize(cross(dx, dy)); + #else + viewNormal = readNormal(uv); + #endif + + vec3 worldPosition = + (inverseViewMatrix * vec4(viewPosition, 1.0)).xyz * METER_TO_UNIT_LENGTH; + vec3 worldNormal = normalize(mat3(inverseViewMatrix) * viewNormal); + + #ifdef CORRECT_GEOMETRIC_ERROR + correctGeometricError(worldPosition, worldNormal); + #endif + + vec3 radiance; + #if defined(SUN_IRRADIANCE) || defined(SKY_IRRADIANCE) + radiance = getSunSkyIrradiance(worldPosition, worldNormal, inputColor.rgb); + #else + radiance = inputColor.rgb; + #endif + + #if defined(TRANSMITTANCE) || defined(INSCATTER) + getTransmittanceInscatter(worldPosition, worldNormal, radiance); + #endif + + outputColor = vec4(radiance, inputColor.a); +}`,Nl=`uniform mat4 inverseViewMatrix; +uniform mat4 inverseProjectionMatrix; +uniform vec3 cameraPosition; +uniform float cameraHeight; +uniform vec3 ellipsoidCenter; +uniform vec3 ellipsoidRadii; +uniform float idealSphereAlpha; + +varying vec3 vWorldPosition; +varying vec3 vWorldDirection; +varying vec3 vEllipsoidCenter; +varying vec3 vSkyEllipsoidCenter; +varying vec3 vEllipsoidRadiiSquared; + +void getCameraRay(out vec3 origin, out vec3 direction) { + bool isPerspective = inverseProjectionMatrix[2][3] != 0.0; + + if (isPerspective) { + + vec4 viewPosition = inverseProjectionMatrix * vec4(position, 1.0); + vec4 worldDirection = inverseViewMatrix * vec4(viewPosition.xyz, 0.0); + origin = cameraPosition; + direction = worldDirection.xyz; + } else { + + vec4 nearPoint = inverseProjectionMatrix * vec4(position.xy, -1.0, 1.0); + vec4 farPoint = inverseProjectionMatrix * vec4(position.xy, -0.9, 1.0); + nearPoint /= nearPoint.w; + farPoint /= farPoint.w; + + + vec4 worldDirection = + inverseViewMatrix * vec4(farPoint.xyz - nearPoint.xyz, 0.0); + vec4 worldOrigin = inverseViewMatrix * nearPoint; + + + direction = worldDirection.xyz; + origin = worldOrigin.xyz; + } +} + +void mainSupport() { + vec3 direction, origin; + getCameraRay(origin, direction); + vWorldPosition = origin * METER_TO_UNIT_LENGTH; + vWorldDirection = direction; + + vSkyEllipsoidCenter = ellipsoidCenter * METER_TO_UNIT_LENGTH; + #ifdef CORRECT_GEOMETRIC_ERROR + + + + vEllipsoidCenter = + mix(ellipsoidCenter, vec3(0.0), idealSphereAlpha) * METER_TO_UNIT_LENGTH; + #else + vEllipsoidCenter = vSkyEllipsoidCenter; + #endif + + vec3 radii = ellipsoidRadii * METER_TO_UNIT_LENGTH; + vEllipsoidRadiiSquared = radii * radii; +}`,Ir=`float ClampCosine(float mu) { + return clamp(mu, float(-1.0), float(1.0)); +} + +float ClampDistance(float d) { + return max(d, 0.0); +} + +float ClampRadius(float r) { + return clamp(r, u_bottom_radius, u_top_radius); +} + +float SafeSqrt(float a) { + return sqrt(max(a, 0.0)); +} + +float DistanceToTopAtmosphereBoundary(float r, float mu) { + float discriminant = r * r * (mu * mu - 1.0) + u_top_radius * u_top_radius; + return ClampDistance(-r * mu + SafeSqrt(discriminant)); +} + +float DistanceToBottomAtmosphereBoundary(float r, float mu) { + float discriminant = + r * r * (mu * mu - 1.0) + u_bottom_radius * u_bottom_radius; + return ClampDistance(-r * mu - SafeSqrt(discriminant)); +} + +bool RayIntersectsGround(float r, float mu) { + return mu < 0.0 && + r * r * (mu * mu - 1.0) + u_bottom_radius * u_bottom_radius >= 0.0; +} + +float GetTextureCoordFromUnitRange(float x, int texture_size) { + return 0.5 / float(texture_size) + x * (1.0 - 1.0 / float(texture_size)); +} + +float GetUnitRangeFromTextureCoord(float u, int texture_size) { + return (u - 0.5 / float(texture_size)) / (1.0 - 1.0 / float(texture_size)); +} + +vec2 GetTransmittanceTextureUvFromRMu(float r, float mu) { + float H = sqrt( + u_top_radius * u_top_radius - u_bottom_radius * u_bottom_radius + ); + float rho = SafeSqrt(r * r - u_bottom_radius * u_bottom_radius); + float d = DistanceToTopAtmosphereBoundary(r, mu); + float d_min = u_top_radius - r; + float d_max = rho + H; + float x_mu = (d - d_min) / (d_max - d_min); + float x_r = rho / H; + return vec2( + GetTextureCoordFromUnitRange(x_mu, TRANSMITTANCE_TEXTURE_WIDTH), + GetTextureCoordFromUnitRange(x_r, TRANSMITTANCE_TEXTURE_HEIGHT) + ); +} + +vec3 GetTransmittanceToTopAtmosphereBoundary( + const sampler2D u_transmittance_texture, + float r, + float mu +) { + vec2 uv = GetTransmittanceTextureUvFromRMu(r, mu); + return vec3(texture(u_transmittance_texture, uv)); +} + +vec3 GetTransmittance( + const sampler2D u_transmittance_texture, + float r, + float mu, + float d, + bool ray_r_mu_intersects_ground +) { + float r_d = ClampRadius(sqrt(d * d + 2.0 * r * mu * d + r * r)); + float mu_d = ClampCosine((r * mu + d) / r_d); + if (ray_r_mu_intersects_ground) { + return min( + GetTransmittanceToTopAtmosphereBoundary( + u_transmittance_texture, + r_d, + -mu_d + ) / + GetTransmittanceToTopAtmosphereBoundary( + u_transmittance_texture, + r, + -mu + ), + vec3(1.0) + ); + } else { + return min( + GetTransmittanceToTopAtmosphereBoundary(u_transmittance_texture, r, mu) / + GetTransmittanceToTopAtmosphereBoundary( + u_transmittance_texture, + r_d, + mu_d + ), + vec3(1.0) + ); + } +} + +vec3 GetTransmittanceToSun( + const sampler2D u_transmittance_texture, + float r, + float mu_s +) { + float sin_theta_h = u_bottom_radius / r; + float cos_theta_h = -sqrt(max(1.0 - sin_theta_h * sin_theta_h, 0.0)); + return GetTransmittanceToTopAtmosphereBoundary( + u_transmittance_texture, + r, + mu_s + ) * + smoothstep( + -sin_theta_h * u_sun_angular_radius, + sin_theta_h * u_sun_angular_radius, + mu_s - cos_theta_h + ); +} + +float DistanceToNearestAtmosphereBoundary( + float r, + float mu, + bool ray_r_mu_intersects_ground +) { + if (ray_r_mu_intersects_ground) { + return DistanceToBottomAtmosphereBoundary(r, mu); + } else { + return DistanceToTopAtmosphereBoundary(r, mu); + } +} + +float RayleighPhaseFunction(float nu) { + float k = 3.0 / (16.0 * PI); + return k * (1.0 + nu * nu); +} + +float MiePhaseFunction(float g, float nu) { + float k = 3.0 / (8.0 * PI) * (1.0 - g * g) / (2.0 + g * g); + return k * (1.0 + nu * nu) / pow(1.0 + g * g - 2.0 * g * nu, 1.5); +} + +vec4 GetScatteringTextureUvwzFromRMuMuSNu( + float r, + float mu, + float mu_s, + float nu, + bool ray_r_mu_intersects_ground +) { + float H = sqrt( + u_top_radius * u_top_radius - u_bottom_radius * u_bottom_radius + ); + float rho = SafeSqrt(r * r - u_bottom_radius * u_bottom_radius); + float u_r = GetTextureCoordFromUnitRange(rho / H, SCATTERING_TEXTURE_R_SIZE); + float r_mu = r * mu; + float discriminant = r_mu * r_mu - r * r + u_bottom_radius * u_bottom_radius; + float u_mu; + if (ray_r_mu_intersects_ground) { + float d = -r_mu - SafeSqrt(discriminant); + float d_min = r - u_bottom_radius; + float d_max = rho; + u_mu = + 0.5 - + 0.5 * + GetTextureCoordFromUnitRange( + d_max == d_min + ? 0.0 + : (d - d_min) / (d_max - d_min), + SCATTERING_TEXTURE_MU_SIZE / 2 + ); + } else { + float d = -r_mu + SafeSqrt(discriminant + H * H); + float d_min = u_top_radius - r; + float d_max = rho + H; + u_mu = + 0.5 + + 0.5 * + GetTextureCoordFromUnitRange( + (d - d_min) / (d_max - d_min), + SCATTERING_TEXTURE_MU_SIZE / 2 + ); + } + float d = DistanceToTopAtmosphereBoundary(u_bottom_radius, mu_s); + float d_min = u_top_radius - u_bottom_radius; + float d_max = H; + float a = (d - d_min) / (d_max - d_min); + float D = DistanceToTopAtmosphereBoundary(u_bottom_radius, u_mu_s_min); + float A = (D - d_min) / (d_max - d_min); + float u_mu_s = GetTextureCoordFromUnitRange( + max(1.0 - a / A, 0.0) / (1.0 + a), + SCATTERING_TEXTURE_MU_S_SIZE + ); + float u_nu = (nu + 1.0) / 2.0; + return vec4(u_nu, u_mu_s, u_mu, u_r); +} + +vec2 GetIrradianceTextureUvFromRMuS(float r, float mu_s) { + float x_r = (r - u_bottom_radius) / (u_top_radius - u_bottom_radius); + float x_mu_s = mu_s * 0.5 + 0.5; + return vec2( + GetTextureCoordFromUnitRange(x_mu_s, IRRADIANCE_TEXTURE_WIDTH), + GetTextureCoordFromUnitRange(x_r, IRRADIANCE_TEXTURE_HEIGHT) + ); +} + +const vec2 IRRADIANCE_TEXTURE_SIZE = vec2( + IRRADIANCE_TEXTURE_WIDTH, + IRRADIANCE_TEXTURE_HEIGHT +); + +vec3 GetIrradiance(const sampler2D u_irradiance_texture, float r, float mu_s) { + vec2 uv = GetIrradianceTextureUvFromRMuS(r, mu_s); + return vec3(texture(u_irradiance_texture, uv)); +} + +vec3 GetExtrapolatedSingleMieScattering(const vec4 scattering) { + if (scattering.r <= 0.0) { + return vec3(0.0); + } + return scattering.rgb * + scattering.a / + scattering.r * + (u_rayleigh_scattering.r / u_mie_scattering.r) * + (u_mie_scattering / u_rayleigh_scattering); +} + +vec3 GetCombinedScattering( + const sampler3D u_scattering_texture, + const sampler3D u_single_mie_scattering_texture, + float r, + float mu, + float mu_s, + float nu, + bool ray_r_mu_intersects_ground, + out vec3 single_mie_scattering +) { + vec4 uvwz = GetScatteringTextureUvwzFromRMuMuSNu( + r, + mu, + mu_s, + nu, + ray_r_mu_intersects_ground + ); + float tex_coord_x = uvwz.x * float(SCATTERING_TEXTURE_NU_SIZE - 1); + float tex_x = floor(tex_coord_x); + float lerp = tex_coord_x - tex_x; + vec3 uvw0 = vec3( + (tex_x + uvwz.y) / float(SCATTERING_TEXTURE_NU_SIZE), + uvwz.z, + uvwz.w + ); + vec3 uvw1 = vec3( + (tex_x + 1.0 + uvwz.y) / float(SCATTERING_TEXTURE_NU_SIZE), + uvwz.z, + uvwz.w + ); + vec4 combined_scattering = + texture(u_scattering_texture, uvw0) * (1.0 - lerp) + + texture(u_scattering_texture, uvw1) * lerp; + vec3 scattering = vec3(combined_scattering); + single_mie_scattering = GetExtrapolatedSingleMieScattering( + combined_scattering + ); + return scattering; +} + +vec3 GetSkyRadiance( + const sampler2D u_transmittance_texture, + const sampler3D u_scattering_texture, + const sampler3D u_single_mie_scattering_texture, + vec3 camera, + const vec3 view_ray, + float shadow_length, + const vec3 sun_direction, + out vec3 transmittance +) { + float r = length(camera); + float rmu = dot(camera, view_ray); + float distance_to_top_atmosphere_boundary = + -rmu - SafeSqrt(rmu * rmu - r * r + u_top_radius * u_top_radius); + if (distance_to_top_atmosphere_boundary > 0.0) { + camera = camera + view_ray * distance_to_top_atmosphere_boundary; + r = u_top_radius; + rmu += distance_to_top_atmosphere_boundary; + } else if (r > u_top_radius) { + transmittance = vec3(1.0); + return vec3(0.0); + } + float mu = rmu / r; + float mu_s = dot(camera, sun_direction) / r; + float nu = dot(view_ray, sun_direction); + bool ray_r_mu_intersects_ground = RayIntersectsGround(r, mu); + transmittance = ray_r_mu_intersects_ground + ? vec3(0.0) + : GetTransmittanceToTopAtmosphereBoundary(u_transmittance_texture, r, mu); + vec3 single_mie_scattering; + vec3 scattering; + if (shadow_length == 0.0) { + scattering = GetCombinedScattering( + u_scattering_texture, + u_single_mie_scattering_texture, + r, + mu, + mu_s, + nu, + ray_r_mu_intersects_ground, + single_mie_scattering + ); + } else { + float d = shadow_length; + float r_p = ClampRadius(sqrt(d * d + 2.0 * r * mu * d + r * r)); + float mu_p = (r * mu + d) / r_p; + float mu_s_p = (r * mu_s + d * nu) / r_p; + scattering = GetCombinedScattering( + u_scattering_texture, + u_single_mie_scattering_texture, + r_p, + mu_p, + mu_s_p, + nu, + ray_r_mu_intersects_ground, + single_mie_scattering + ); + vec3 shadow_transmittance = GetTransmittance( + u_transmittance_texture, + r, + mu, + shadow_length, + ray_r_mu_intersects_ground + ); + scattering = scattering * shadow_transmittance; + single_mie_scattering = single_mie_scattering * shadow_transmittance; + } + return scattering * RayleighPhaseFunction(nu) + + single_mie_scattering * MiePhaseFunction(u_mie_phase_function_g, nu); +} + +vec3 GetSkyRadianceToPoint( + const sampler2D u_transmittance_texture, + const sampler3D u_scattering_texture, + const sampler3D u_single_mie_scattering_texture, + vec3 camera, + const vec3 point, + float shadow_length, + const vec3 sun_direction, + out vec3 transmittance +) { + vec3 view_ray = normalize(point - camera); + float r = length(camera); + float rmu = dot(camera, view_ray); + float distance_to_top_atmosphere_boundary = + -rmu - sqrt(rmu * rmu - r * r + u_top_radius * u_top_radius); + if (distance_to_top_atmosphere_boundary > 0.0) { + camera = camera + view_ray * distance_to_top_atmosphere_boundary; + r = u_top_radius; + rmu += distance_to_top_atmosphere_boundary; + } + float mu = rmu / r; + float mu_s = dot(camera, sun_direction) / r; + float nu = dot(view_ray, sun_direction); + float d = length(point - camera); + bool ray_r_mu_intersects_ground = RayIntersectsGround(r, mu); + + + + + if (!ray_r_mu_intersects_ground) { + float mu_horiz = -SafeSqrt( + 1.0 - u_bottom_radius / r * (u_bottom_radius / r) + ); + mu = max(mu, mu_horiz + 0.004); + } + + transmittance = GetTransmittance( + u_transmittance_texture, + r, + mu, + d, + ray_r_mu_intersects_ground + ); + vec3 single_mie_scattering; + vec3 scattering = GetCombinedScattering( + u_scattering_texture, + u_single_mie_scattering_texture, + r, + mu, + mu_s, + nu, + ray_r_mu_intersects_ground, + single_mie_scattering + ); + d = max(d - shadow_length, 0.0); + float r_p = ClampRadius(sqrt(d * d + 2.0 * r * mu * d + r * r)); + float mu_p = (r * mu + d) / r_p; + float mu_s_p = (r * mu_s + d * nu) / r_p; + vec3 single_mie_scattering_p; + vec3 scattering_p = GetCombinedScattering( + u_scattering_texture, + u_single_mie_scattering_texture, + r_p, + mu_p, + mu_s_p, + nu, + ray_r_mu_intersects_ground, + single_mie_scattering_p + ); + vec3 shadow_transmittance = transmittance; + if (shadow_length > 0.0) { + shadow_transmittance = GetTransmittance( + u_transmittance_texture, + r, + mu, + d, + ray_r_mu_intersects_ground + ); + } + scattering = scattering - shadow_transmittance * scattering_p; + single_mie_scattering = + single_mie_scattering - shadow_transmittance * single_mie_scattering_p; + single_mie_scattering = GetExtrapolatedSingleMieScattering( + vec4(scattering, single_mie_scattering.r) + ); + single_mie_scattering = + single_mie_scattering * smoothstep(float(0.0), float(0.01), mu_s); + return scattering * RayleighPhaseFunction(nu) + + single_mie_scattering * MiePhaseFunction(u_mie_phase_function_g, nu); +} + +vec3 GetSunAndSkyIrradiance( + const sampler2D u_transmittance_texture, + const sampler2D u_irradiance_texture, + const vec3 point, + const vec3 normal, + const vec3 sun_direction, + out vec3 sky_irradiance +) { + float r = length(point); + float mu_s = dot(point, sun_direction) / r; + sky_irradiance = + GetIrradiance(u_irradiance_texture, r, mu_s) * + (1.0 + dot(normal, point) / r) * + 0.5; + return u_solar_irradiance * + GetTransmittanceToSun(u_transmittance_texture, r, mu_s) * + max(dot(normal, sun_direction), 0.0); +} + +vec3 GetSolarRadiance() { + vec3 radiance = + u_solar_irradiance / (PI * u_sun_angular_radius * u_sun_angular_radius); + #ifdef PHOTOMETRIC + radiance *= SUN_SPECTRAL_RADIANCE_TO_LUMINANCE; + #endif + return radiance; +} + +vec3 GetSkyRadiance( + vec3 camera, + vec3 view_ray, + float shadow_length, + vec3 sun_direction, + out vec3 transmittance +) { + vec3 radiance = GetSkyRadiance( + u_transmittance_texture, + u_scattering_texture, + u_single_mie_scattering_texture, + camera, + view_ray, + shadow_length, + sun_direction, + transmittance + ); + #ifdef PHOTOMETRIC + radiance *= SKY_SPECTRAL_RADIANCE_TO_LUMINANCE; + #endif + return radiance; +} + +vec3 GetSkyRadianceToPoint( + vec3 camera, + vec3 point, + float shadow_length, + vec3 sun_direction, + out vec3 transmittance +) { + vec3 inscatter = GetSkyRadianceToPoint( + u_transmittance_texture, + u_scattering_texture, + u_single_mie_scattering_texture, + camera, + point, + shadow_length, + sun_direction, + transmittance + ); + #ifdef PHOTOMETRIC + inscatter *= SKY_SPECTRAL_RADIANCE_TO_LUMINANCE; + #endif + return inscatter; +} + +vec3 GetSunAndSkyIrradiance( + vec3 p, + vec3 normal, + vec3 sun_direction, + out vec3 sky_irradiance +) { + vec3 sun_irradiance = GetSunAndSkyIrradiance( + u_transmittance_texture, + u_irradiance_texture, + p, + normal, + sun_direction, + sky_irradiance + ); + #ifdef PHOTOMETRIC + sun_irradiance *= SUN_SPECTRAL_RADIANCE_TO_LUMINANCE; + sky_irradiance *= SKY_SPECTRAL_RADIANCE_TO_LUMINANCE; + #endif + return sun_irradiance; +}`,Fe=`uniform vec3 u_solar_irradiance; +uniform float u_sun_angular_radius; +uniform float u_bottom_radius; +uniform float u_top_radius; +uniform vec3 u_rayleigh_scattering; +uniform vec3 u_mie_scattering; +uniform float u_mie_phase_function_g; +uniform float u_mu_s_min; + +uniform sampler2D u_transmittance_texture; +uniform sampler3D u_scattering_texture; +uniform sampler3D u_single_mie_scattering_texture; +uniform sampler2D u_irradiance_texture;`,ki=`vec3 getLunarRadiance(const float moonAngularRadius) { + + vec3 radiance = + u_solar_irradiance * + 0.000002 / + (PI * moonAngularRadius * moonAngularRadius); + #ifdef PHOTOMETRIC + radiance *= SUN_SPECTRAL_RADIANCE_TO_LUMINANCE; + #endif + return radiance; +} + +float intersectSphere(const vec3 ray, const vec3 point, const float radius) { + vec3 P = -point; + float PoR = dot(P, ray); + float D = dot(P, P) - radius * radius; + return -PoR - sqrt(PoR * PoR - D); +} + +float orenNayarDiffuse(const vec3 L, const vec3 V, const vec3 N) { + float NoL = dot(N, L); + float NoV = dot(N, V); + float s = dot(L, V) - NoL * NoV; + float t = mix(1.0, max(NoL, NoV), step(0.0, s)); + return max(0.0, NoL) * (0.62406015 + 0.41284404 * s / t); +} + +vec3 getSkyRadiance( + const vec3 viewPosition, + const vec3 rayDirection, + const vec3 sunDirection, + const vec3 moonDirection, + const float moonAngularRadius, + const float lunarRadianceScale +) { + vec3 transmittance; + vec3 radiance = GetSkyRadiance( + viewPosition, + rayDirection, + 0.0, + sunDirection, + transmittance + ); + + + #ifdef PERSPECTIVE_CAMERA + + #if defined(SUN) || defined(MOON) + vec3 ddx = dFdx(rayDirection); + vec3 ddy = dFdy(rayDirection); + float fragmentAngle = length(ddx + ddy) / length(rayDirection); + #endif + + #ifdef SUN + float viewDotSun = dot(rayDirection, sunDirection); + if (viewDotSun > cos(u_sun_angular_radius)) { + float angle = acos(clamp(viewDotSun, -1.0, 1.0)); + float antialias = smoothstep( + u_sun_angular_radius, + u_sun_angular_radius - fragmentAngle, + angle + ); + radiance += transmittance * GetSolarRadiance() * antialias; + } + #endif + + #ifdef MOON + float intersection = intersectSphere( + rayDirection, + moonDirection, + moonAngularRadius + ); + if (intersection > 0.0) { + vec3 normal = normalize(moonDirection - rayDirection * intersection); + float diffuse = orenNayarDiffuse(-sunDirection, rayDirection, normal); + float viewDotMoon = dot(rayDirection, moonDirection); + float angle = acos(clamp(viewDotMoon, -1.0, 1.0)); + float antialias = smoothstep( + moonAngularRadius, + moonAngularRadius - fragmentAngle, + angle + ); + radiance += + transmittance * + getLunarRadiance(moonAngularRadius) * + lunarRadianceScale * + diffuse * + antialias; + } + #endif + + #endif + + return radiance; +}`;const Ht=new x,zl=new Pe,Qi={blendFunction:E.NORMAL,octEncodedNormal:!1,reconstructNormal:!1,ellipsoid:De.WGS84,correctAltitude:!0,correctGeometricError:!0,photometric:!0,sunIrradiance:!1,skyIrradiance:!1,transmittance:!0,inscatter:!0,irradianceScale:1,sky:!1,sun:!0,moon:!0,moonAngularRadius:.0045,lunarRadianceScale:1};class Fl extends we{constructor(t=new mi,r,i=Gi.DEFAULT){const{blendFunction:n,normalBuffer:a=null,octEncodedNormal:s,reconstructNormal:l,irradianceTexture:o=null,scatteringTexture:u=null,transmittanceTexture:c=null,useHalfFloat:d,ellipsoid:v,correctAltitude:g,correctGeometricError:p,photometric:m,sunDirection:B,sunIrradiance:T,skyIrradiance:A,transmittance:D,inscatter:M,irradianceScale:U,sky:W,sun:X,moon:ie,moonDirection:F,moonAngularRadius:G,lunarRadianceScale:O}={...Qi,...r};super("AerialPerspectiveEffect",` + ${Fe} + ${Ir} + ${Sl} + ${yl} + ${Bl} + ${ki} + ${Ol} + `,{blendFunction:n,vertexShader:` + ${Fe} + ${Nl} + `,attributes:Z.DEPTH,uniforms:new Map([["u_solar_irradiance",new f(i.solarIrradiance)],["u_sun_angular_radius",new f(i.sunAngularRadius)],["u_bottom_radius",new f(i.bottomRadius*Oe)],["u_top_radius",new f(i.topRadius*Oe)],["u_rayleigh_scattering",new f(i.rayleighScattering)],["u_mie_scattering",new f(i.mieScattering)],["u_mie_phase_function_g",new f(i.miePhaseFunctionG)],["u_mu_s_min",new f(0)],["u_irradiance_texture",new f(o)],["u_scattering_texture",new f(u)],["u_single_mie_scattering_texture",new f(u)],["u_transmittance_texture",new f(c)],["normalBuffer",new f(a)],["projectionMatrix",new f(new I)],["inverseProjectionMatrix",new f(new I)],["inverseViewMatrix",new f(new I)],["cameraPosition",new f(new x)],["cameraHeight",new f(0)],["ellipsoidCenter",new f(new x)],["ellipsoidRadii",new f(new x)],["sunDirection",new f((B==null?void 0:B.clone())??new x)],["irradianceScale",new f(U)],["idealSphereAlpha",new f(0)],["moonDirection",new f((F==null?void 0:F.clone())??new x)],["moonAngularRadius",new f(G)],["lunarRadianceScale",new f(O)]]),defines:new Map([["TRANSMITTANCE_TEXTURE_WIDTH",`${Mr}`],["TRANSMITTANCE_TEXTURE_HEIGHT",`${Rr}`],["SCATTERING_TEXTURE_R_SIZE",`${Cr}`],["SCATTERING_TEXTURE_MU_SIZE",`${Sr}`],["SCATTERING_TEXTURE_MU_S_SIZE",`${yr}`],["SCATTERING_TEXTURE_NU_SIZE",`${Br}`],["IRRADIANCE_TEXTURE_WIDTH",`${Er}`],["IRRADIANCE_TEXTURE_HEIGHT",`${Tr}`],["METER_TO_UNIT_LENGTH",`float(${Oe})`],["SUN_SPECTRAL_RADIANCE_TO_LUMINANCE",`vec3(${i.sunRadianceToRelativeLuminance.toArray().join(",")})`],["SKY_SPECTRAL_RADIANCE_TO_LUMINANCE",`vec3(${i.skyRadianceToRelativeLuminance.toArray().join(",")})`]])}),L(this,"atmosphere"),L(this,"_ellipsoid"),L(this,"correctAltitude"),this.camera=t,this.camera=t,this.atmosphere=i,this.octEncodedNormal=s,this.reconstructNormal=l,this.useHalfFloat=d===!0,this.ellipsoid=v,this.correctAltitude=g,this.correctGeometricError=p,this.photometric=m,this.sunIrradiance=T,this.skyIrradiance=A,this.transmittance=D,this.inscatter=M,this.sky=W,this.sun=X,this.moon=ie}get mainCamera(){return this.camera}set mainCamera(t){this.camera=t}update(t,r,i){const n=this.uniforms,a=n.get("projectionMatrix"),s=n.get("inverseProjectionMatrix"),l=n.get("inverseViewMatrix"),o=this.camera;a.value.copy(o.projectionMatrix),s.value.copy(o.projectionMatrixInverse),l.value.copy(o.matrixWorld);const u=n.get("cameraPosition"),c=n.get("cameraHeight"),d=o.getWorldPosition(u.value);c.value=zl.setFromECEF(d).height;const v=n.get("idealSphereAlpha");Ht.set(0,this.ellipsoid.maximumRadius,-c.value).applyMatrix4(o.projectionMatrix);let g=q.mapLinear(Ht.y,41.5,13.8,0,1);g=q.clamp(g,0,1),v.value=g;const p=n.get("ellipsoidCenter");if(this.correctAltitude){const m=this.ellipsoid.projectOnSurface(d,Ht);m!=null&&this.ellipsoid.getOsculatingSphereCenter(m.lengthSq()",r).replace("#include ",i)}const Pr={useHalfFloat:!1,ellipsoid:De.WGS84,correctAltitude:!0,photometric:!0,renderTargetCount:1};class Vi extends wn{constructor(t,r=Gi.DEFAULT){const{irradianceTexture:i=null,scatteringTexture:n=null,transmittanceTexture:a=null,useHalfFloat:s,ellipsoid:l,correctAltitude:o,photometric:u,sunDirection:c,sunAngularRadius:d,renderTargetCount:v,...g}={...Pr,...t};super({toneMapped:!1,depthWrite:!1,depthTest:!1,...g,uniforms:{u_solar_irradiance:new f(r.solarIrradiance),u_sun_angular_radius:new f(d??r.sunAngularRadius),u_bottom_radius:new f(r.bottomRadius*Oe),u_top_radius:new f(r.topRadius*Oe),u_rayleigh_scattering:new f(r.rayleighScattering),u_mie_scattering:new f(r.mieScattering),u_mie_phase_function_g:new f(r.miePhaseFunctionG),u_mu_s_min:new f(0),u_irradiance_texture:new f(i),u_scattering_texture:new f(n),u_single_mie_scattering_texture:new f(n),u_transmittance_texture:new f(a),cameraPosition:new f(new x),ellipsoidCenter:new f(new x),sunDirection:new f((c==null?void 0:c.clone())??new x),...g.uniforms},defines:{PI:`${Math.PI}`,TRANSMITTANCE_TEXTURE_WIDTH:`${Mr}`,TRANSMITTANCE_TEXTURE_HEIGHT:`${Rr}`,SCATTERING_TEXTURE_R_SIZE:`${Cr}`,SCATTERING_TEXTURE_MU_SIZE:`${Sr}`,SCATTERING_TEXTURE_MU_S_SIZE:`${yr}`,SCATTERING_TEXTURE_NU_SIZE:`${Br}`,IRRADIANCE_TEXTURE_WIDTH:`${Er}`,IRRADIANCE_TEXTURE_HEIGHT:`${Tr}`,METER_TO_UNIT_LENGTH:`float(${Oe})`,SUN_SPECTRAL_RADIANCE_TO_LUMINANCE:`vec3(${r.sunRadianceToRelativeLuminance.toArray().join(",")})`,SKY_SPECTRAL_RADIANCE_TO_LUMINANCE:`vec3(${r.skyRadianceToRelativeLuminance.toArray().join(",")})`,...g.defines}}),L(this,"atmosphere"),L(this,"ellipsoid"),L(this,"correctAltitude"),L(this,"_renderTargetCount"),this.atmosphere=r,this.useHalfFloat=s,this.ellipsoid=l,this.correctAltitude=o,this.photometric=u,this.renderTargetCount=v}onBeforeCompile(t,r){t.fragmentShader=Hl(t.fragmentShader,this.renderTargetCount)}onBeforeRender(t,r,i,n,a,s){const l=this.uniforms,o=i.getWorldPosition(l.cameraPosition.value);if(this.correctAltitude){const u=this.ellipsoid.projectOnSurface(o,Gl);u!=null&&this.ellipsoid.getOsculatingSphereCenter(u.lengthSq() + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*//** + * @fileoverview Astronomy calculation library for browser scripting and Node.js. + * @author Don Cross + * @license MIT + */const kl=173.1446326846693,Ql=14959787069098932e-8,Ge=.017453292519943295,Vl=365.24217,li=new Date("2000-01-01T12:00:00Z"),ae=2*Math.PI,he=3600*(180/Math.PI),be=484813681109536e-20,Yl=180*60*60,Wl=2*Yl,Xl=6378.1366,Kl=Xl/Ql,jl=81.30056,br=.0002959122082855911,Zt=2825345909524226e-22,Jt=8459715185680659e-23,qt=1292024916781969e-23,_t=1524358900784276e-23;function kt(e){if(!Number.isFinite(e))throw console.trace(),`Value is not a finite number: ${e}`;return e}function Re(e){return e-Math.floor(e)}var R;(function(e){e.Sun="Sun",e.Moon="Moon",e.Mercury="Mercury",e.Venus="Venus",e.Earth="Earth",e.Mars="Mars",e.Jupiter="Jupiter",e.Saturn="Saturn",e.Uranus="Uranus",e.Neptune="Neptune",e.Pluto="Pluto",e.SSB="SSB",e.EMB="EMB",e.Star1="Star1",e.Star2="Star2",e.Star3="Star3",e.Star4="Star4",e.Star5="Star5",e.Star6="Star6",e.Star7="Star7",e.Star8="Star8"})(R||(R={}));const Zl=[R.Star1,R.Star2,R.Star3,R.Star4,R.Star5,R.Star6,R.Star7,R.Star8],Jl=[{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0}];function ql(e){const t=Zl.indexOf(e);return t>=0?Jl[t]:null}function Yi(e){const t=ql(e);return t&&t.dist>0?t:null}var ce;(function(e){e[e.From2000=0]="From2000",e[e.Into2000=1]="Into2000"})(ce||(ce={}));const Le={Mercury:[[[[4.40250710144,0,0],[.40989414977,1.48302034195,26087.9031415742],[.050462942,4.47785489551,52175.8062831484],[.00855346844,1.16520322459,78263.70942472259],[.00165590362,4.11969163423,104351.61256629678],[.00034561897,.77930768443,130439.51570787099],[7583476e-11,3.71348404924,156527.41884944518]],[[26087.90313685529,0,0],[.01131199811,6.21874197797,26087.9031415742],[.00292242298,3.04449355541,52175.8062831484],[.00075775081,6.08568821653,78263.70942472259],[.00019676525,2.80965111777,104351.61256629678]]],[[[.11737528961,1.98357498767,26087.9031415742],[.02388076996,5.03738959686,52175.8062831484],[.01222839532,3.14159265359,0],[.0054325181,1.79644363964,78263.70942472259],[.0012977877,4.83232503958,104351.61256629678],[.00031866927,1.58088495658,130439.51570787099],[7963301e-11,4.60972126127,156527.41884944518]],[[.00274646065,3.95008450011,26087.9031415742],[.00099737713,3.14159265359,0]]],[[[.39528271651,0,0],[.07834131818,6.19233722598,26087.9031415742],[.00795525558,2.95989690104,52175.8062831484],[.00121281764,6.01064153797,78263.70942472259],[.00021921969,2.77820093972,104351.61256629678],[4354065e-11,5.82894543774,130439.51570787099]],[[.0021734774,4.65617158665,26087.9031415742],[.00044141826,1.42385544001,52175.8062831484]]]],Venus:[[[[3.17614666774,0,0],[.01353968419,5.59313319619,10213.285546211],[.00089891645,5.30650047764,20426.571092422],[5477194e-11,4.41630661466,7860.4193924392],[3455741e-11,2.6996444782,11790.6290886588],[2372061e-11,2.99377542079,3930.2096962196],[1317168e-11,5.18668228402,26.2983197998],[1664146e-11,4.25018630147,1577.3435424478],[1438387e-11,4.15745084182,9683.5945811164],[1200521e-11,6.15357116043,30639.856638633]],[[10213.28554621638,0,0],[.00095617813,2.4640651111,10213.285546211],[7787201e-11,.6247848222,20426.571092422]]],[[[.05923638472,.26702775812,10213.285546211],[.00040107978,1.14737178112,20426.571092422],[.00032814918,3.14159265359,0]],[[.00287821243,1.88964962838,10213.285546211]]],[[[.72334820891,0,0],[.00489824182,4.02151831717,10213.285546211],[1658058e-11,4.90206728031,20426.571092422],[1378043e-11,1.12846591367,11790.6290886588],[1632096e-11,2.84548795207,7860.4193924392],[498395e-11,2.58682193892,9683.5945811164],[221985e-11,2.01346696541,19367.1891622328],[237454e-11,2.55136053886,15720.8387848784]],[[.00034551041,.89198706276,10213.285546211]]]],Earth:[[[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438]],[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828]],[[8721859e-11,1.07253635559,6283.0758499914]]],[[],[[.00227777722,3.4137662053,6283.0758499914],[3805678e-11,3.37063423795,12566.1516999828]]],[[[1.00013988784,0,0],[.01670699632,3.09846350258,6283.0758499914],[.00013956024,3.05524609456,12566.1516999828],[308372e-10,5.19846674381,77713.7714681205],[1628463e-11,1.17387558054,5753.3848848968],[1575572e-11,2.84685214877,7860.4193924392],[924799e-11,5.45292236722,11506.7697697936],[542439e-11,4.56409151453,3930.2096962196],[47211e-10,3.66100022149,5884.9268465832],[85831e-11,1.27079125277,161000.6857376741],[57056e-11,2.01374292245,83996.84731811189],[55736e-11,5.2415979917,71430.69561812909],[174844e-11,3.01193636733,18849.2275499742],[243181e-11,4.2734953079,11790.6290886588]],[[.00103018607,1.10748968172,6283.0758499914],[1721238e-11,1.06442300386,12566.1516999828]],[[4359385e-11,5.78455133808,6283.0758499914]]]],Mars:[[[[6.20347711581,0,0],[.18656368093,5.0503710027,3340.6124266998],[.01108216816,5.40099836344,6681.2248533996],[.00091798406,5.75478744667,10021.8372800994],[.00027744987,5.97049513147,3.523118349],[.00010610235,2.93958560338,2281.2304965106],[.00012315897,.84956094002,2810.9214616052],[8926784e-11,4.15697846427,.0172536522],[8715691e-11,6.11005153139,13362.4497067992],[6797556e-11,.36462229657,398.1490034082],[7774872e-11,3.33968761376,5621.8429232104],[3575078e-11,1.6618650571,2544.3144198834],[4161108e-11,.22814971327,2942.4634232916],[3075252e-11,.85696614132,191.4482661116],[2628117e-11,.64806124465,3337.0893083508],[2937546e-11,6.07893711402,.0673103028],[2389414e-11,5.03896442664,796.2980068164],[2579844e-11,.02996736156,3344.1355450488],[1528141e-11,1.14979301996,6151.533888305],[1798806e-11,.65634057445,529.6909650946],[1264357e-11,3.62275122593,5092.1519581158],[1286228e-11,3.06796065034,2146.1654164752],[1546404e-11,2.91579701718,1751.539531416],[1024902e-11,3.69334099279,8962.4553499102],[891566e-11,.18293837498,16703.062133499],[858759e-11,2.4009381194,2914.0142358238],[832715e-11,2.46418619474,3340.5951730476],[83272e-10,4.49495782139,3340.629680352],[712902e-11,3.66335473479,1059.3819301892],[748723e-11,3.82248614017,155.4203994342],[723861e-11,.67497311481,3738.761430108],[635548e-11,2.92182225127,8432.7643848156],[655162e-11,.48864064125,3127.3133312618],[550474e-11,3.81001042328,.9803210682],[55275e-10,4.47479317037,1748.016413067],[425966e-11,.55364317304,6283.0758499914],[415131e-11,.49662285038,213.299095438],[472167e-11,3.62547124025,1194.4470102246],[306551e-11,.38052848348,6684.7479717486],[312141e-11,.99853944405,6677.7017350506],[293198e-11,4.22131299634,20.7753954924],[302375e-11,4.48618007156,3532.0606928114],[274027e-11,.54222167059,3340.545116397],[281079e-11,5.88163521788,1349.8674096588],[231183e-11,1.28242156993,3870.3033917944],[283602e-11,5.7688543494,3149.1641605882],[236117e-11,5.75503217933,3333.498879699],[274033e-11,.13372524985,3340.6797370026],[299395e-11,2.78323740866,6254.6266625236]],[[3340.61242700512,0,0],[.01457554523,3.60433733236,3340.6124266998],[.00168414711,3.92318567804,6681.2248533996],[.00020622975,4.26108844583,10021.8372800994],[3452392e-11,4.7321039319,3.523118349],[2586332e-11,4.60670058555,13362.4497067992],[841535e-11,4.45864030426,2281.2304965106]],[[.00058152577,2.04961712429,3340.6124266998],[.00013459579,2.45738706163,6681.2248533996]]],[[[.03197134986,3.76832042431,3340.6124266998],[.00298033234,4.10616996305,6681.2248533996],[.00289104742,0,0],[.00031365539,4.4465105309,10021.8372800994],[34841e-9,4.7881254926,13362.4497067992]],[[.00217310991,6.04472194776,3340.6124266998],[.00020976948,3.14159265359,0],[.00012834709,1.60810667915,6681.2248533996]]],[[[1.53033488271,0,0],[.1418495316,3.47971283528,3340.6124266998],[.00660776362,3.81783443019,6681.2248533996],[.00046179117,4.15595316782,10021.8372800994],[8109733e-11,5.55958416318,2810.9214616052],[7485318e-11,1.77239078402,5621.8429232104],[5523191e-11,1.3643630377,2281.2304965106],[382516e-10,4.49407183687,13362.4497067992],[2306537e-11,.09081579001,2544.3144198834],[1999396e-11,5.36059617709,3337.0893083508],[2484394e-11,4.9254563992,2942.4634232916],[1960195e-11,4.74249437639,3344.1355450488],[1167119e-11,2.11260868341,5092.1519581158],[1102816e-11,5.00908403998,398.1490034082],[899066e-11,4.40791133207,529.6909650946],[992252e-11,5.83861961952,6151.533888305],[807354e-11,2.10217065501,1059.3819301892],[797915e-11,3.44839203899,796.2980068164],[740975e-11,1.49906336885,2146.1654164752]],[[.01107433345,2.03250524857,3340.6124266998],[.00103175887,2.37071847807,6681.2248533996],[128772e-9,0,0],[.0001081588,2.70888095665,10021.8372800994]],[[.00044242249,.47930604954,3340.6124266998],[8138042e-11,.86998389204,6681.2248533996]]]],Jupiter:[[[[.59954691494,0,0],[.09695898719,5.06191793158,529.6909650946],[.00573610142,1.44406205629,7.1135470008],[.00306389205,5.41734730184,1059.3819301892],[.00097178296,4.14264726552,632.7837393132],[.00072903078,3.64042916389,522.5774180938],[.00064263975,3.41145165351,103.0927742186],[.00039806064,2.29376740788,419.4846438752],[.00038857767,1.27231755835,316.3918696566],[.00027964629,1.7845459182,536.8045120954],[.0001358973,5.7748104079,1589.0728952838],[8246349e-11,3.5822792584,206.1855484372],[8768704e-11,3.63000308199,949.1756089698],[7368042e-11,5.0810119427,735.8765135318],[626315e-10,.02497628807,213.299095438],[6114062e-11,4.51319998626,1162.4747044078],[4905396e-11,1.32084470588,110.2063212194],[5305285e-11,1.30671216791,14.2270940016],[5305441e-11,4.18625634012,1052.2683831884],[4647248e-11,4.69958103684,3.9321532631],[3045023e-11,4.31676431084,426.598190876],[2609999e-11,1.56667394063,846.0828347512],[2028191e-11,1.06376530715,3.1813937377],[1764763e-11,2.14148655117,1066.49547719],[1722972e-11,3.88036268267,1265.5674786264],[1920945e-11,.97168196472,639.897286314],[1633223e-11,3.58201833555,515.463871093],[1431999e-11,4.29685556046,625.6701923124],[973272e-11,4.09764549134,95.9792272178]],[[529.69096508814,0,0],[.00489503243,4.2208293947,529.6909650946],[.00228917222,6.02646855621,7.1135470008],[.00030099479,4.54540782858,1059.3819301892],[.0002072092,5.45943156902,522.5774180938],[.00012103653,.16994816098,536.8045120954],[6067987e-11,4.42422292017,103.0927742186],[5433968e-11,3.98480737746,419.4846438752],[4237744e-11,5.89008707199,14.2270940016]],[[.00047233601,4.32148536482,7.1135470008],[.00030649436,2.929777887,529.6909650946],[.00014837605,3.14159265359,0]]],[[[.02268615702,3.55852606721,529.6909650946],[.00109971634,3.90809347197,1059.3819301892],[.00110090358,0,0],[8101428e-11,3.60509572885,522.5774180938],[6043996e-11,4.25883108339,1589.0728952838],[6437782e-11,.30627119215,536.8045120954]],[[.00078203446,1.52377859742,529.6909650946]]],[[[5.20887429326,0,0],[.25209327119,3.49108639871,529.6909650946],[.00610599976,3.84115365948,1059.3819301892],[.00282029458,2.57419881293,632.7837393132],[.00187647346,2.07590383214,522.5774180938],[.00086792905,.71001145545,419.4846438752],[.00072062974,.21465724607,536.8045120954],[.00065517248,5.9799588479,316.3918696566],[.00029134542,1.67759379655,103.0927742186],[.00030135335,2.16132003734,949.1756089698],[.00023453271,3.54023522184,735.8765135318],[.00022283743,4.19362594399,1589.0728952838],[.00023947298,.2745803748,7.1135470008],[.00013032614,2.96042965363,1162.4747044078],[970336e-10,1.90669633585,206.1855484372],[.00012749023,2.71550286592,1052.2683831884],[7057931e-11,2.18184839926,1265.5674786264],[6137703e-11,6.26418240033,846.0828347512],[2616976e-11,2.00994012876,1581.959348283]],[[.0127180152,2.64937512894,529.6909650946],[.00061661816,3.00076460387,1059.3819301892],[.00053443713,3.89717383175,522.5774180938],[.00031185171,4.88276958012,536.8045120954],[.00041390269,0,0]]]],Saturn:[[[[.87401354025,0,0],[.11107659762,3.96205090159,213.299095438],[.01414150957,4.58581516874,7.1135470008],[.00398379389,.52112032699,206.1855484372],[.00350769243,3.30329907896,426.598190876],[.00206816305,.24658372002,103.0927742186],[792713e-9,3.84007056878,220.4126424388],[.00023990355,4.66976924553,110.2063212194],[.00016573588,.43719228296,419.4846438752],[.00014906995,5.76903183869,316.3918696566],[.0001582029,.93809155235,632.7837393132],[.00014609559,1.56518472,3.9321532631],[.00013160301,4.44891291899,14.2270940016],[.00015053543,2.71669915667,639.897286314],[.00013005299,5.98119023644,11.0457002639],[.00010725067,3.12939523827,202.2533951741],[5863206e-11,.23656938524,529.6909650946],[5227757e-11,4.20783365759,3.1813937377],[6126317e-11,1.76328667907,277.0349937414],[5019687e-11,3.17787728405,433.7117378768],[459255e-10,.61977744975,199.0720014364],[4005867e-11,2.24479718502,63.7358983034],[2953796e-11,.98280366998,95.9792272178],[387367e-10,3.22283226966,138.5174968707],[2461186e-11,2.03163875071,735.8765135318],[3269484e-11,.77492638211,949.1756089698],[1758145e-11,3.2658010994,522.5774180938],[1640172e-11,5.5050445305,846.0828347512],[1391327e-11,4.02333150505,323.5054166574],[1580648e-11,4.37265307169,309.2783226558],[1123498e-11,2.83726798446,415.5524906121],[1017275e-11,3.71700135395,227.5261894396],[848642e-11,3.1915017083,209.3669421749]],[[213.2990952169,0,0],[.01297370862,1.82834923978,213.299095438],[.00564345393,2.88499717272,7.1135470008],[.00093734369,1.06311793502,426.598190876],[.00107674962,2.27769131009,206.1855484372],[.00040244455,2.04108104671,220.4126424388],[.00019941774,1.2795439047,103.0927742186],[.00010511678,2.7488034213,14.2270940016],[6416106e-11,.38238295041,639.897286314],[4848994e-11,2.43037610229,419.4846438752],[4056892e-11,2.92133209468,110.2063212194],[3768635e-11,3.6496533078,3.9321532631]],[[.0011644133,1.17988132879,7.1135470008],[.00091841837,.0732519584,213.299095438],[.00036661728,0,0],[.00015274496,4.06493179167,206.1855484372]]],[[[.04330678039,3.60284428399,213.299095438],[.00240348302,2.85238489373,426.598190876],[.00084745939,0,0],[.00030863357,3.48441504555,220.4126424388],[.00034116062,.57297307557,206.1855484372],[.0001473407,2.11846596715,639.897286314],[9916667e-11,5.79003188904,419.4846438752],[6993564e-11,4.7360468972,7.1135470008],[4807588e-11,5.43305312061,316.3918696566]],[[.00198927992,4.93901017903,213.299095438],[.00036947916,3.14159265359,0],[.00017966989,.5197943111,426.598190876]]],[[[9.55758135486,0,0],[.52921382865,2.39226219573,213.299095438],[.01873679867,5.2354960466,206.1855484372],[.01464663929,1.64763042902,426.598190876],[.00821891141,5.93520042303,316.3918696566],[.00547506923,5.0153261898,103.0927742186],[.0037168465,2.27114821115,220.4126424388],[.00361778765,3.13904301847,7.1135470008],[.00140617506,5.70406606781,632.7837393132],[.00108974848,3.29313390175,110.2063212194],[.00069006962,5.94099540992,419.4846438752],[.00061053367,.94037691801,639.897286314],[.00048913294,1.55733638681,202.2533951741],[.00034143772,.19519102597,277.0349937414],[.00032401773,5.47084567016,949.1756089698],[.00020936596,.46349251129,735.8765135318],[9796004e-11,5.20477537945,1265.5674786264],[.00011993338,5.98050967385,846.0828347512],[208393e-9,1.52102476129,433.7117378768],[.00015298404,3.0594381494,529.6909650946],[6465823e-11,.17732249942,1052.2683831884],[.00011380257,1.7310542704,522.5774180938],[3419618e-11,4.94550542171,1581.959348283]],[[.0618298134,.2584351148,213.299095438],[.00506577242,.71114625261,206.1855484372],[.00341394029,5.79635741658,426.598190876],[.00188491195,.47215589652,220.4126424388],[.00186261486,3.14159265359,0],[.00143891146,1.40744822888,7.1135470008]],[[.00436902572,4.78671677509,213.299095438]]]],Uranus:[[[[5.48129294297,0,0],[.09260408234,.89106421507,74.7815985673],[.01504247898,3.6271926092,1.4844727083],[.00365981674,1.89962179044,73.297125859],[.00272328168,3.35823706307,149.5631971346],[.00070328461,5.39254450063,63.7358983034],[.00068892678,6.09292483287,76.2660712756],[.00061998615,2.26952066061,2.9689454166],[.00061950719,2.85098872691,11.0457002639],[.0002646877,3.14152083966,71.8126531507],[.00025710476,6.11379840493,454.9093665273],[.0002107885,4.36059339067,148.0787244263],[.00017818647,1.74436930289,36.6485629295],[.00014613507,4.73732166022,3.9321532631],[.00011162509,5.8268179635,224.3447957019],[.0001099791,.48865004018,138.5174968707],[9527478e-11,2.95516862826,35.1640902212],[7545601e-11,5.236265824,109.9456887885],[4220241e-11,3.23328220918,70.8494453042],[40519e-9,2.277550173,151.0476698429],[3354596e-11,1.0654900738,4.4534181249],[2926718e-11,4.62903718891,9.5612275556],[349034e-10,5.48306144511,146.594251718],[3144069e-11,4.75199570434,77.7505439839],[2922333e-11,5.35235361027,85.8272988312],[2272788e-11,4.36600400036,70.3281804424],[2051219e-11,1.51773566586,.1118745846],[2148602e-11,.60745949945,38.1330356378],[1991643e-11,4.92437588682,277.0349937414],[1376226e-11,2.04283539351,65.2203710117],[1666902e-11,3.62744066769,380.12776796],[1284107e-11,3.11347961505,202.2533951741],[1150429e-11,.93343589092,3.1813937377],[1533221e-11,2.58594681212,52.6901980395],[1281604e-11,.54271272721,222.8603229936],[1372139e-11,4.19641530878,111.4301614968],[1221029e-11,.1990065003,108.4612160802],[946181e-11,1.19253165736,127.4717966068],[1150989e-11,4.17898916639,33.6796175129]],[[74.7815986091,0,0],[.00154332863,5.24158770553,74.7815985673],[.00024456474,1.71260334156,1.4844727083],[9258442e-11,.4282973235,11.0457002639],[8265977e-11,1.50218091379,63.7358983034],[915016e-10,1.41213765216,149.5631971346]]],[[[.01346277648,2.61877810547,74.7815985673],[623414e-9,5.08111189648,149.5631971346],[.00061601196,3.14159265359,0],[9963722e-11,1.61603805646,76.2660712756],[992616e-10,.57630380333,73.297125859]],[[.00034101978,.01321929936,74.7815985673]]],[[[19.21264847206,0,0],[.88784984413,5.60377527014,74.7815985673],[.03440836062,.32836099706,73.297125859],[.0205565386,1.7829515933,149.5631971346],[.0064932241,4.52247285911,76.2660712756],[.00602247865,3.86003823674,63.7358983034],[.00496404167,1.40139935333,454.9093665273],[.00338525369,1.58002770318,138.5174968707],[.00243509114,1.57086606044,71.8126531507],[.00190522303,1.99809394714,1.4844727083],[.00161858838,2.79137786799,148.0787244263],[.00143706183,1.38368544947,11.0457002639],[.00093192405,.17437220467,36.6485629295],[.00071424548,4.24509236074,224.3447957019],[.00089806014,3.66105364565,109.9456887885],[.00039009723,1.66971401684,70.8494453042],[.00046677296,1.39976401694,35.1640902212],[.00039025624,3.36234773834,277.0349937414],[.00036755274,3.88649278513,146.594251718],[.00030348723,.70100838798,151.0476698429],[.00029156413,3.180563367,77.7505439839],[.00022637073,.72518687029,529.6909650946],[.00011959076,1.7504339214,984.6003316219],[.00025620756,5.25656086672,380.12776796]],[[.01479896629,3.67205697578,74.7815985673]]]],Neptune:[[[[5.31188633046,0,0],[.0179847553,2.9010127389,38.1330356378],[.01019727652,.48580922867,1.4844727083],[.00124531845,4.83008090676,36.6485629295],[.00042064466,5.41054993053,2.9689454166],[.00037714584,6.09221808686,35.1640902212],[.00033784738,1.24488874087,76.2660712756],[.00016482741,7727998e-11,491.5579294568],[9198584e-11,4.93747051954,39.6175083461],[899425e-10,.27462171806,175.1660598002]],[[38.13303563957,0,0],[.00016604172,4.86323329249,1.4844727083],[.00015744045,2.27887427527,38.1330356378]]],[[[.03088622933,1.44104372644,38.1330356378],[.00027780087,5.91271884599,76.2660712756],[.00027623609,0,0],[.00015355489,2.52123799551,36.6485629295],[.00015448133,3.50877079215,39.6175083461]]],[[[30.07013205828,0,0],[.27062259632,1.32999459377,38.1330356378],[.01691764014,3.25186135653,36.6485629295],[.00807830553,5.18592878704,1.4844727083],[.0053776051,4.52113935896,35.1640902212],[.00495725141,1.5710564165,491.5579294568],[.00274571975,1.84552258866,175.1660598002],[.0001201232,1.92059384991,1021.2488945514],[.00121801746,5.79754470298,76.2660712756],[.00100896068,.3770272493,73.297125859],[.00135134092,3.37220609835,39.6175083461],[7571796e-11,1.07149207335,388.4651552382]]]]};function _l(e){var t,r,i,n,a,s,l;const o=2e3+(e-14)/Vl;return o<-500?(t=(o-1820)/100,-20+32*t*t):o<500?(t=o/100,r=t*t,i=t*r,n=r*r,a=r*i,s=i*i,10583.6-1014.41*t+33.78311*r-5.952053*i-.1798452*n+.022174192*a+.0090316521*s):o<1600?(t=(o-1e3)/100,r=t*t,i=t*r,n=r*r,a=r*i,s=i*i,1574.2-556.01*t+71.23472*r+.319781*i-.8503463*n-.005050998*a+.0083572073*s):o<1700?(t=o-1600,r=t*t,i=t*r,120-.9808*t-.01532*r+i/7129):o<1800?(t=o-1700,r=t*t,i=t*r,n=r*r,8.83+.1603*t-.0059285*r+13336e-8*i-n/1174e3):o<1860?(t=o-1800,r=t*t,i=t*r,n=r*r,a=r*i,s=i*i,l=i*n,13.72-.332447*t+.0068612*r+.0041116*i-37436e-8*n+121272e-10*a-1699e-10*s+875e-12*l):o<1900?(t=o-1860,r=t*t,i=t*r,n=r*r,a=r*i,7.62+.5737*t-.251754*r+.01680668*i-.0004473624*n+a/233174):o<1920?(t=o-1900,r=t*t,i=t*r,n=r*r,-2.79+1.494119*t-.0598939*r+.0061966*i-197e-6*n):o<1941?(t=o-1920,r=t*t,i=t*r,21.2+.84493*t-.0761*r+.0020936*i):o<1961?(t=o-1950,r=t*t,i=t*r,29.07+.407*t-r/233+i/2547):o<1986?(t=o-1975,r=t*t,i=t*r,45.45+1.067*t-r/260-i/718):o<2005?(t=o-2e3,r=t*t,i=t*r,n=r*r,a=r*i,63.86+.3345*t-.060374*r+.0017275*i+651814e-9*n+2373599e-11*a):o<2050?(t=o-2e3,62.92+.32217*t+.005589*t*t):o<2150?(t=(o-1820)/100,-20+32*t*t-.5628*(2150-o)):(t=(o-1820)/100,-20+32*t*t)}let $l=_l;function ci(e){return e+$l(e)/86400}let wt=class gt{constructor(t){if(t instanceof gt){this.date=t.date,this.ut=t.ut,this.tt=t.tt;return}const r=1e3*3600*24;if(t instanceof Date&&Number.isFinite(t.getTime())){this.date=t,this.ut=(t.getTime()-li.getTime())/r,this.tt=ci(this.ut);return}if(Number.isFinite(t)){this.date=new Date(li.getTime()+t*r),this.ut=t,this.tt=ci(this.ut);return}throw"Argument must be a Date object, an AstroTime object, or a numeric UTC Julian date."}static FromTerrestrialTime(t){let r=new gt(t);for(;;){const i=t-r.tt;if(Math.abs(i)<1e-12)return r;r=r.AddDays(i)}}toString(){return this.date.toISOString()}AddDays(t){return new gt(this.ut+t)}};function ye(e){return e instanceof wt?e:new wt(e)}function ec(e){function t(v){return v%Wl*be}const r=e.tt/36525,i=t(128710479305e-5+r*1295965810481e-4),n=t(335779.526232+r*17395272628478e-4),a=t(107226070369e-5+r*1602961601209e-3),s=t(450160.398036-r*69628905431e-4);let l=Math.sin(s),o=Math.cos(s),u=(-172064161-174666*r)*l+33386*o,c=(92052331+9086*r)*o+15377*l,d=2*(n-a+s);return l=Math.sin(d),o=Math.cos(d),u+=(-13170906-1675*r)*l-13696*o,c+=(5730336-3015*r)*o-4587*l,d=2*(n+s),l=Math.sin(d),o=Math.cos(d),u+=(-2276413-234*r)*l+2796*o,c+=(978459-485*r)*o+1374*l,d=2*s,l=Math.sin(d),o=Math.cos(d),u+=(2074554+207*r)*l-698*o,c+=(-897492+470*r)*o-291*l,l=Math.sin(i),o=Math.cos(i),u+=(1475877-3633*r)*l+11817*o,c+=(73871-184*r)*o-1924*l,{dpsi:-135e-6+u*1e-7,deps:388e-6+c*1e-7}}function Wi(e){var t=e.tt/36525,r=((((-434e-10*t-576e-9)*t+.0020034)*t-1831e-7)*t-46.836769)*t+84381.406;return r/3600}var dt;function Xi(e){if(!dt||Math.abs(dt.tt-e.tt)>1e-6){const t=ec(e),r=Wi(e),i=r+t.deps/3600;dt={tt:e.tt,dpsi:t.dpsi,deps:t.deps,ee:t.dpsi*Math.cos(r*Ge)/15,mobl:r,tobl:i}}return dt}function tc(e,t){const r=e*Ge,i=Math.cos(r),n=Math.sin(r);return[t[0],t[1]*i-t[2]*n,t[1]*n+t[2]*i]}function rc(e,t){return tc(Wi(e),t)}function ic(e){const t=e.tt/36525;function r(S,P){const z=[];let H;for(H=0;H<=P-S;++H)z.push(0);return{min:S,array:z}}function i(S,P,z,H){const Q=[];for(let de=0;de<=P-S;++de)Q.push(r(z,H));return{min:S,array:Q}}function n(S,P,z){const H=S.array[P-S.min];return H.array[z-H.min]}function a(S,P,z,H){const Q=S.array[P-S.min];Q.array[z-Q.min]=H}let s,l,o,u,c,d,v,g,p,m,B,T,A,D,M,U,W,X,ie,F,G,O,k,Qe=i(-6,6,1,4),tt=i(-6,6,1,4);function ue(S,P){return n(Qe,S,P)}function rt(S,P){return n(tt,S,P)}function it(S,P,z){return a(Qe,S,P,z)}function nt(S,P,z){return a(tt,S,P,z)}function Nr(S,P,z,H,Q){Q(S*z-P*H,P*z+S*H)}function N(S){return Math.sin(ae*S)}v=t*t,p=0,k=0,B=0,T=3422.7;var at=N(.19833+.05611*t),Pt=N(.27869+.04508*t),bt=N(.16827-.36903*t),Lt=N(.34734-5.37261*t),Ut=N(.10498-5.37899*t),st=N(.42681-.41855*t),nn=N(.14943-5.37511*t);for(X=.84*at+.31*Pt+14.27*bt+7.26*Lt+.28*Ut+.24*st,ie=2.94*at+.31*Pt+14.27*bt+9.34*Lt+1.12*Ut+.83*st,F=-6.4*at-1.89*st,G=.21*at+.31*Pt+14.27*bt-88.7*Lt-15.3*Ut+.24*st-1.86*nn,O=X-F,g=-3332e-9*N(.59734-5.37261*t)-539e-9*N(.35498-5.37899*t)-64e-9*N(.39943-5.37511*t),A=ae*Re(.60643382+1336.85522467*t-313e-8*v)+X/he,D=ae*Re(.37489701+1325.55240982*t+2565e-8*v)+ie/he,M=ae*Re(.99312619+99.99735956*t-44e-8*v)+F/he,U=ae*Re(.25909118+1342.2278298*t-892e-8*v)+G/he,W=ae*Re(.82736186+1236.85308708*t-397e-8*v)+O/he,c=1;c<=4;++c){switch(c){case 1:o=D,l=4,u=1.000002208;break;case 2:o=M,l=3,u=.997504612-.002495388*t;break;case 3:o=U,l=4,u=1.000002708+139.978*g;break;case 4:o=W,l=6,u=1;break;default:throw`Internal error: I = ${c}`}for(it(0,c,1),it(1,c,Math.cos(o)*u),nt(0,c,0),nt(1,c,Math.sin(o)*u),d=2;d<=l;++d)Nr(ue(d-1,c),rt(d-1,c),ue(1,c),rt(1,c),(S,P)=>(it(d,c,S),nt(d,c,P)));for(d=1;d<=l;++d)it(-d,c,ue(d,c)),nt(-d,c,-rt(d,c))}function zr(S,P,z,H){for(var Q={x:1,y:0},de=[0,S,P,z,H],ne=1;ne<=4;++ne)de[ne]!==0&&Nr(Q.x,Q.y,ue(de[ne],ne),rt(de[ne],ne),(Ot,Be)=>(Q.x=Ot,Q.y=Be));return Q}function h(S,P,z,H,Q,de,ne,Ot){var Be=zr(Q,de,ne,Ot);p+=S*Be.y,k+=P*Be.y,B+=z*Be.x,T+=H*Be.x}h(13.902,14.06,-.001,.2607,0,0,0,4),h(.403,-4.01,.394,.0023,0,0,0,3),h(2369.912,2373.36,.601,28.2333,0,0,0,2),h(-125.154,-112.79,-.725,-.9781,0,0,0,1),h(1.979,6.98,-.445,.0433,1,0,0,4),h(191.953,192.72,.029,3.0861,1,0,0,2),h(-8.466,-13.51,.455,-.1093,1,0,0,1),h(22639.5,22609.07,.079,186.5398,1,0,0,0),h(18.609,3.59,-.094,.0118,1,0,0,-1),h(-4586.465,-4578.13,-.077,34.3117,1,0,0,-2),h(3.215,5.44,.192,-.0386,1,0,0,-3),h(-38.428,-38.64,.001,.6008,1,0,0,-4),h(-.393,-1.43,-.092,.0086,1,0,0,-6),h(-.289,-1.59,.123,-.0053,0,1,0,4),h(-24.42,-25.1,.04,-.3,0,1,0,2),h(18.023,17.93,.007,.1494,0,1,0,1),h(-668.146,-126.98,-1.302,-.3997,0,1,0,0),h(.56,.32,-.001,-.0037,0,1,0,-1),h(-165.145,-165.06,.054,1.9178,0,1,0,-2),h(-1.877,-6.46,-.416,.0339,0,1,0,-4),h(.213,1.02,-.074,.0054,2,0,0,4),h(14.387,14.78,-.017,.2833,2,0,0,2),h(-.586,-1.2,.054,-.01,2,0,0,1),h(769.016,767.96,.107,10.1657,2,0,0,0),h(1.75,2.01,-.018,.0155,2,0,0,-1),h(-211.656,-152.53,5.679,-.3039,2,0,0,-2),h(1.225,.91,-.03,-.0088,2,0,0,-3),h(-30.773,-34.07,-.308,.3722,2,0,0,-4),h(-.57,-1.4,-.074,.0109,2,0,0,-6),h(-2.921,-11.75,.787,-.0484,1,1,0,2),h(1.267,1.52,-.022,.0164,1,1,0,1),h(-109.673,-115.18,.461,-.949,1,1,0,0),h(-205.962,-182.36,2.056,1.4437,1,1,0,-2),h(.233,.36,.012,-.0025,1,1,0,-3),h(-4.391,-9.66,-.471,.0673,1,1,0,-4),h(.283,1.53,-.111,.006,1,-1,0,4),h(14.577,31.7,-1.54,.2302,1,-1,0,2),h(147.687,138.76,.679,1.1528,1,-1,0,0),h(-1.089,.55,.021,0,1,-1,0,-1),h(28.475,23.59,-.443,-.2257,1,-1,0,-2),h(-.276,-.38,-.006,-.0036,1,-1,0,-3),h(.636,2.27,.146,-.0102,1,-1,0,-4),h(-.189,-1.68,.131,-.0028,0,2,0,2),h(-7.486,-.66,-.037,-.0086,0,2,0,0),h(-8.096,-16.35,-.74,.0918,0,2,0,-2),h(-5.741,-.04,0,-9e-4,0,0,2,2),h(.255,0,0,0,0,0,2,1),h(-411.608,-.2,0,-.0124,0,0,2,0),h(.584,.84,0,.0071,0,0,2,-1),h(-55.173,-52.14,0,-.1052,0,0,2,-2),h(.254,.25,0,-.0017,0,0,2,-3),h(.025,-1.67,0,.0031,0,0,2,-4),h(1.06,2.96,-.166,.0243,3,0,0,2),h(36.124,50.64,-1.3,.6215,3,0,0,0),h(-13.193,-16.4,.258,-.1187,3,0,0,-2),h(-1.187,-.74,.042,.0074,3,0,0,-4),h(-.293,-.31,-.002,.0046,3,0,0,-6),h(-.29,-1.45,.116,-.0051,2,1,0,2),h(-7.649,-10.56,.259,-.1038,2,1,0,0),h(-8.627,-7.59,.078,-.0192,2,1,0,-2),h(-2.74,-2.54,.022,.0324,2,1,0,-4),h(1.181,3.32,-.212,.0213,2,-1,0,2),h(9.703,11.67,-.151,.1268,2,-1,0,0),h(-.352,-.37,.001,-.0028,2,-1,0,-1),h(-2.494,-1.17,-.003,-.0017,2,-1,0,-2),h(.36,.2,-.012,-.0043,2,-1,0,-4),h(-1.167,-1.25,.008,-.0106,1,2,0,0),h(-7.412,-6.12,.117,.0484,1,2,0,-2),h(-.311,-.65,-.032,.0044,1,2,0,-4),h(.757,1.82,-.105,.0112,1,-2,0,2),h(2.58,2.32,.027,.0196,1,-2,0,0),h(2.533,2.4,-.014,-.0212,1,-2,0,-2),h(-.344,-.57,-.025,.0036,0,3,0,-2),h(-.992,-.02,0,0,1,0,2,2),h(-45.099,-.02,0,-.001,1,0,2,0),h(-.179,-9.52,0,-.0833,1,0,2,-2),h(-.301,-.33,0,.0014,1,0,2,-4),h(-6.382,-3.37,0,-.0481,1,0,-2,2),h(39.528,85.13,0,-.7136,1,0,-2,0),h(9.366,.71,0,-.0112,1,0,-2,-2),h(.202,.02,0,0,1,0,-2,-4),h(.415,.1,0,.0013,0,1,2,0),h(-2.152,-2.26,0,-.0066,0,1,2,-2),h(-1.44,-1.3,0,.0014,0,1,-2,2),h(.384,-.04,0,0,0,1,-2,-2),h(1.938,3.6,-.145,.0401,4,0,0,0),h(-.952,-1.58,.052,-.013,4,0,0,-2),h(-.551,-.94,.032,-.0097,3,1,0,0),h(-.482,-.57,.005,-.0045,3,1,0,-2),h(.681,.96,-.026,.0115,3,-1,0,0),h(-.297,-.27,.002,-9e-4,2,2,0,-2),h(.254,.21,-.003,0,2,-2,0,-2),h(-.25,-.22,.004,.0014,1,3,0,-2),h(-3.996,0,0,4e-4,2,0,2,0),h(.557,-.75,0,-.009,2,0,2,-2),h(-.459,-.38,0,-.0053,2,0,-2,2),h(-1.298,.74,0,4e-4,2,0,-2,0),h(.538,1.14,0,-.0141,2,0,-2,-2),h(.263,.02,0,0,1,1,2,0),h(.426,.07,0,-6e-4,1,1,-2,-2),h(-.304,.03,0,3e-4,1,-1,2,0),h(-.372,-.19,0,-.0027,1,-1,-2,2),h(.418,0,0,0,0,0,4,0),h(-.33,-.04,0,0,3,0,2,0);function te(S,P,z,H,Q){return S*zr(P,z,H,Q).y}m=0,m+=te(-526.069,0,0,1,-2),m+=te(-3.352,0,0,1,-4),m+=te(44.297,1,0,1,-2),m+=te(-6,1,0,1,-4),m+=te(20.599,-1,0,1,0),m+=te(-30.598,-1,0,1,-2),m+=te(-24.649,-2,0,1,0),m+=te(-2,-2,0,1,-2),m+=te(-22.571,0,1,1,-2),m+=te(10.985,0,-1,1,-2),p+=.82*N(.7736-62.5512*t)+.31*N(.0466-125.1025*t)+.35*N(.5785-25.1042*t)+.66*N(.4591+1335.8075*t)+.64*N(.313-91.568*t)+1.14*N(.148+1331.2898*t)+.21*N(.5918+1056.5859*t)+.44*N(.5784+1322.8595*t)+.24*N(.2275-5.7374*t)+.28*N(.2965+2.6929*t)+.33*N(.3132+6.3368*t),s=U+k/he;let an=(1.000002708+139.978*g)*(18518.511+1.189+B)*Math.sin(s)-6.24*Math.sin(3*s)+m;return{geo_eclip_lon:ae*Re((A+p/he)/ae),geo_eclip_lat:Math.PI/(180*3600)*an,distance_au:he*Kl/(.999953253*T)}}function nc(e,t){return[e.rot[0][0]*t[0]+e.rot[1][0]*t[1]+e.rot[2][0]*t[2],e.rot[0][1]*t[0]+e.rot[1][1]*t[1]+e.rot[2][1]*t[2],e.rot[0][2]*t[0]+e.rot[1][2]*t[1]+e.rot[2][2]*t[2]]}function ac(e,t,r){const i=Ki(t,r);return nc(i,e)}function Ki(e,t){const r=e.tt/36525;let i=84381.406,n=((((-951e-10*r+132851e-9)*r-.00114045)*r-1.0790069)*r+5038.481507)*r,a=((((3337e-10*r-467e-9)*r-.00772503)*r+.0512623)*r-.025754)*r+i,s=((((-56e-9*r+170663e-9)*r-.00121197)*r-2.3814292)*r+10.556403)*r;i*=be,n*=be,a*=be,s*=be;const l=Math.sin(i),o=Math.cos(i),u=Math.sin(-n),c=Math.cos(-n),d=Math.sin(-a),v=Math.cos(-a),g=Math.sin(s),p=Math.cos(s),m=p*c-u*g*v,B=p*u*o+g*v*c*o-l*g*d,T=p*u*l+g*v*c*l+o*g*d,A=-g*c-u*p*v,D=-g*u*o+p*v*c*o-l*p*d,M=-g*u*l+p*v*c*l+o*p*d,U=u*d,W=-d*c*o-l*v,X=-d*c*l+v*o;if(t===ce.Into2000)return new He([[m,B,T],[A,D,M],[U,W,X]]);if(t===ce.From2000)return new He([[m,A,U],[B,D,W],[T,M,X]]);throw"Invalid precess direction"}function sc(e){const t=.779057273264+.00273781191135448*e.ut,r=e.ut%1;let i=360*((t+r)%1);return i<0&&(i+=360),i}let ft;function oc(e){if(!ft||ft.tt!==e.tt){const t=e.tt/36525;let r=15*Xi(e).ee;const i=sc(e);let n=((r+.014506+((((-368e-10*t-29956e-9)*t-44e-8)*t+1.3915817)*t+4612.156534)*t)/3600+i)%360/15;n<0&&(n+=24),ft={tt:e.tt,st:n}}return ft.st}function lc(e){const t=ye(e);return oc(t)}function cc(e,t){const r=Xi(e),i=r.mobl*Ge,n=r.tobl*Ge,a=r.dpsi*be,s=Math.cos(i),l=Math.sin(i),o=Math.cos(n),u=Math.sin(n),c=Math.cos(a),d=Math.sin(a),v=c,g=-d*s,p=-d*l,m=d*o,B=c*s*o+l*u,T=c*l*o-s*u,A=d*u,D=c*s*u-l*o,M=c*l*u+s*o;if(t===ce.From2000)return new He([[v,m,A],[g,B,D],[p,T,M]]);if(t===ce.Into2000)return new He([[v,g,p],[m,B,T],[A,D,M]]);throw"Invalid precess direction"}class ee{constructor(t,r,i,n){this.x=t,this.y=r,this.z=i,this.t=n}Length(){return Math.hypot(this.x,this.y,this.z)}}class uc{constructor(t,r,i,n,a,s,l){this.x=t,this.y=r,this.z=i,this.vx=n,this.vy=a,this.vz=s,this.t=l}}class dc{constructor(t,r,i){this.lat=kt(t),this.lon=kt(r),this.dist=kt(i)}}class He{constructor(t){this.rot=t}}function $t(e){const t=ye(e),r=ic(t),i=r.distance_au*Math.cos(r.geo_eclip_lat),n=[i*Math.cos(r.geo_eclip_lon),i*Math.sin(r.geo_eclip_lon),r.distance_au*Math.sin(r.geo_eclip_lat)],a=rc(t,n),s=ac(a,t,ce.Into2000);return new ee(s[0],s[1],s[2],t)}function Ne(e,t,r){let i=1,n=0;for(let a of e){let s=0;for(let[o,u,c]of a)s+=o*Math.cos(u+t*c);let l=i*s;r&&(l%=ae),n+=l,i*=t}return n}function Qt(e,t){let r=1,i=0,n=0,a=0;for(let s of e){let l=0,o=0;for(let[u,c,d]of s){let v=c+t*d;l+=u*d*Math.sin(v),a>0&&(o+=u*Math.cos(v))}n+=a*i*o-r*l,i=r,r*=t,++a}return n}const je=365250,er=0,tr=1,rr=2;function ir(e){return new Te(e[0]+44036e-11*e[1]-190919e-12*e[2],-479966e-12*e[0]+.917482137087*e[1]-.397776982902*e[2],.397776982902*e[1]+.917482137087*e[2])}function ji(e,t,r){const i=r*Math.cos(t),n=Math.cos(e),a=Math.sin(e);return[i*n,i*a,r*Math.sin(t)]}function pt(e,t){const r=t.tt/je,i=Ne(e[er],r,!0),n=Ne(e[tr],r,!1),a=Ne(e[rr],r,!1),s=ji(i,n,a);return ir(s).ToAstroVector(t)}function fc(e,t){const r=t/je,i=Ne(e[er],r,!0),n=Ne(e[tr],r,!1),a=Ne(e[rr],r,!1),s=Qt(e[er],r),l=Qt(e[tr],r),o=Qt(e[rr],r),u=Math.cos(i),c=Math.sin(i),d=Math.cos(n),v=Math.sin(n),g=+(o*d*u)-a*v*u*l-a*d*c*s,p=+(o*d*c)-a*v*c*l+a*d*u*s,m=+(o*v)+a*d*l,B=ji(i,n,a),T=[g/je,p/je,m/je],A=ir(B),D=ir(T);return new Ce(t,A,D)}function ht(e,t,r,i){const n=i/(i+br),a=pt(Le[r],t);e.x+=n*a.x,e.y+=n*a.y,e.z+=n*a.z}function hc(e){const t=new ee(0,0,0,e);return ht(t,e,R.Jupiter,Zt),ht(t,e,R.Saturn,Jt),ht(t,e,R.Uranus,qt),ht(t,e,R.Neptune,_t),t}const nr=51,vc=29200,Ue=146,se=201,xe=[[-73e4,[-26.118207232108,-14.376168177825,3.384402515299],[.0016339372163656,-.0027861699588508,-.0013585880229445]],[-700800,[41.974905202127,-.448502952929,-12.770351505989],[.00073458569351457,.0022785014891658,.00048619778602049]],[-671600,[14.706930780744,44.269110540027,9.353698474772],[-.00210001479998,.00022295915939915,.00070143443551414]],[-642400,[-29.441003929957,-6.43016153057,6.858481011305],[.00084495803960544,-.0030783914758711,-.0012106305981192]],[-613200,[39.444396946234,-6.557989760571,-13.913760296463],[.0011480029005873,.0022400006880665,.00035168075922288]],[-584e3,[20.2303809507,43.266966657189,7.382966091923],[-.0019754081700585,.00053457141292226,.00075929169129793]],[-554800,[-30.65832536462,2.093818874552,9.880531138071],[61010603013347e-18,-.0031326500935382,-.00099346125151067]],[-525600,[35.737703251673,-12.587706024764,-14.677847247563],[.0015802939375649,.0021347678412429,.00019074436384343]],[-496400,[25.466295188546,41.367478338417,5.216476873382],[-.0018054401046468,.0008328308359951,.00080260156912107]],[-467200,[-29.847174904071,10.636426313081,12.297904180106],[-.00063257063052907,-.0029969577578221,-.00074476074151596]],[-438e3,[30.774692107687,-18.236637015304,-14.945535879896],[.0020113162005465,.0019353827024189,-20937793168297e-19]],[-408800,[30.243153324028,38.656267888503,2.938501750218],[-.0016052508674468,.0011183495337525,.00083333973416824]],[-379600,[-27.288984772533,18.643162147874,14.023633623329],[-.0011856388898191,-.0027170609282181,-.00049015526126399]],[-350400,[24.519605196774,-23.245756064727,-14.626862367368],[.0024322321483154,.0016062008146048,-.00023369181613312]],[-321200,[34.505274805875,35.125338586954,.557361475637],[-.0013824391637782,.0013833397561817,.00084823598806262]],[-292e3,[-23.275363915119,25.818514298769,15.055381588598],[-.0016062295460975,-.0023395961498533,-.00024377362639479]],[-262800,[17.050384798092,-27.180376290126,-13.608963321694],[.0028175521080578,.0011358749093955,-.00049548725258825]],[-233600,[38.093671910285,30.880588383337,-1.843688067413],[-.0011317697153459,.0016128814698472,.00084177586176055]],[-204400,[-18.197852930878,31.932869934309,15.438294826279],[-.0019117272501813,-.0019146495909842,-19657304369835e-18]],[-175200,[8.528924039997,-29.618422200048,-11.805400994258],[.0031034370787005,.0005139363329243,-.00077293066202546]],[-146e3,[40.94685725864,25.904973592021,-4.256336240499],[-.00083652705194051,.0018129497136404,.0008156422827306]],[-116800,[-12.326958895325,36.881883446292,15.217158258711],[-.0021166103705038,-.001481442003599,.00017401209844705]],[-87600,[-.633258375909,-30.018759794709,-9.17193287495],[.0032016994581737,-.00025279858672148,-.0010411088271861]],[-58400,[42.936048423883,20.344685584452,-6.588027007912],[-.00050525450073192,.0019910074335507,.00077440196540269]],[-29200,[-5.975910552974,40.61180995846,14.470131723673],[-.0022184202156107,-.0010562361130164,.00033652250216211]],[0,[-9.875369580774,-27.978926224737,-5.753711824704],[.0030287533248818,-.0011276087003636,-.0012651326732361]],[29200,[43.958831986165,14.214147973292,-8.808306227163],[-.00014717608981871,.0021404187242141,.00071486567806614]],[58400,[.67813676352,43.094461639362,13.243238780721],[-.0022358226110718,-.00063233636090933,.00047664798895648]],[87600,[-18.282602096834,-23.30503958666,-1.766620508028],[.0025567245263557,-.0019902940754171,-.0013943491701082]],[116800,[43.873338744526,7.700705617215,-10.814273666425],[.00023174803055677,.0022402163127924,.00062988756452032]],[146e3,[7.392949027906,44.382678951534,11.629500214854],[-.002193281545383,-.00021751799585364,.00059556516201114]],[175200,[-24.981690229261,-16.204012851426,2.466457544298],[.001819398914958,-.0026765419531201,-.0013848283502247]],[204400,[42.530187039511,.845935508021,-12.554907527683],[.00065059779150669,.0022725657282262,.00051133743202822]],[233600,[13.999526486822,44.462363044894,9.669418486465],[-.0021079296569252,.00017533423831993,.00069128485798076]],[262800,[-29.184024803031,-7.371243995762,6.493275957928],[.00093581363109681,-.0030610357109184,-.0012364201089345]],[292e3,[39.831980671753,-6.078405766765,-13.909815358656],[.0011117769689167,.0022362097830152,.00036230548231153]],[321200,[20.294955108476,43.417190420251,7.450091985932],[-.0019742157451535,.00053102050468554,.00075938408813008]],[350400,[-30.66999230216,2.318743558955,9.973480913858],[45605107450676e-18,-.0031308219926928,-.00099066533301924]],[379600,[35.626122155983,-12.897647509224,-14.777586508444],[.0016015684949743,.0021171931182284,.00018002516202204]],[408800,[26.133186148561,41.232139187599,5.00640132622],[-.0017857704419579,.00086046232702817,.00080614690298954]],[438e3,[-29.57674022923,11.863535943587,12.631323039872],[-.00072292830060955,-.0029587820140709,-.000708242964503]],[467200,[29.910805787391,-19.159019294,-15.013363865194],[.0020871080437997,.0018848372554514,-38528655083926e-18]],[496400,[31.375957451819,38.050372720763,2.433138343754],[-.0015546055556611,.0011699815465629,.00083565439266001]],[525600,[-26.360071336928,20.662505904952,14.414696258958],[-.0013142373118349,-.0026236647854842,-.00042542017598193]],[554800,[22.599441488648,-24.508879898306,-14.484045731468],[.0025454108304806,.0014917058755191,-.00030243665086079]],[584e3,[35.877864013014,33.894226366071,-.224524636277],[-.0012941245730845,.0014560427668319,.00084762160640137]],[613200,[-21.538149762417,28.204068269761,15.321973799534],[-.001731211740901,-.0021939631314577,-.0001631691327518]],[642400,[13.971521374415,-28.339941764789,-13.083792871886],[.0029334630526035,.00091860931752944,-.00059939422488627]],[671600,[39.526942044143,28.93989736011,-2.872799527539],[-.0010068481658095,.001702113288809,.00083578230511981]],[700800,[-15.576200701394,34.399412961275,15.466033737854],[-.0020098814612884,-.0017191109825989,70414782780416e-18]],[73e4,[4.24325283709,-30.118201690825,-10.707441231349],[.0031725847067411,.0001609846120227,-.00090672150593868]]];let Te=class oe{constructor(t,r,i){this.x=t,this.y=r,this.z=i}clone(){return new oe(this.x,this.y,this.z)}ToAstroVector(t){return new ee(this.x,this.y,this.z,t)}static zero(){return new oe(0,0,0)}quadrature(){return this.x*this.x+this.y*this.y+this.z*this.z}add(t){return new oe(this.x+t.x,this.y+t.y,this.z+t.z)}sub(t){return new oe(this.x-t.x,this.y-t.y,this.z-t.z)}incr(t){this.x+=t.x,this.y+=t.y,this.z+=t.z}decr(t){this.x-=t.x,this.y-=t.y,this.z-=t.z}mul(t){return new oe(t*this.x,t*this.y,t*this.z)}div(t){return new oe(this.x/t,this.y/t,this.z/t)}mean(t){return new oe((this.x+t.x)/2,(this.y+t.y)/2,(this.z+t.z)/2)}neg(){return new oe(-this.x,-this.y,-this.z)}};class Ce{constructor(t,r,i){this.tt=t,this.r=r,this.v=i}clone(){return new Ce(this.tt,this.r,this.v)}sub(t){return new Ce(this.tt,this.r.sub(t.r),this.v.sub(t.v))}}function gc(e){let[t,[r,i,n],[a,s,l]]=e;return new Ce(t,new Te(r,i,n),new Te(a,s,l))}function vt(e,t,r,i){const n=i/(i+br),a=fc(Le[r],t);return e.r.incr(a.r.mul(n)),e.v.incr(a.v.mul(n)),a}function Xe(e,t,r){const i=r.sub(e),n=i.quadrature();return i.mul(t/(n*Math.sqrt(n)))}class Lr{constructor(t){let r=new Ce(t,new Te(0,0,0),new Te(0,0,0));this.Jupiter=vt(r,t,R.Jupiter,Zt),this.Saturn=vt(r,t,R.Saturn,Jt),this.Uranus=vt(r,t,R.Uranus,qt),this.Neptune=vt(r,t,R.Neptune,_t),this.Jupiter.r.decr(r.r),this.Jupiter.v.decr(r.v),this.Saturn.r.decr(r.r),this.Saturn.v.decr(r.v),this.Uranus.r.decr(r.r),this.Uranus.v.decr(r.v),this.Neptune.r.decr(r.r),this.Neptune.v.decr(r.v),this.Sun=new Ce(t,r.r.mul(-1),r.v.mul(-1))}Acceleration(t){let r=Xe(t,br,this.Sun.r);return r.incr(Xe(t,Zt,this.Jupiter.r)),r.incr(Xe(t,Jt,this.Saturn.r)),r.incr(Xe(t,qt,this.Uranus.r)),r.incr(Xe(t,_t,this.Neptune.r)),r}}class Mt{constructor(t,r,i,n){this.tt=t,this.r=r,this.v=i,this.a=n}clone(){return new Mt(this.tt,this.r.clone(),this.v.clone(),this.a.clone())}}class Zi{constructor(t,r){this.bary=t,this.grav=r}}function Dt(e,t,r,i){return new Te(t.x+e*(r.x+e*i.x/2),t.y+e*(r.y+e*i.y/2),t.z+e*(r.z+e*i.z/2))}function ui(e,t,r){return new Te(t.x+e*r.x,t.y+e*r.y,t.z+e*r.z)}function ar(e,t){const r=e-t.tt,i=new Lr(e),n=Dt(r,t.r,t.v,t.a),a=i.Acceleration(n).mean(t.a),s=Dt(r,t.r,t.v,a),l=t.v.add(a.mul(r)),o=i.Acceleration(s),u=new Mt(e,s,l,o);return new Zi(i,u)}const pc=[];function Ji(e,t){const r=Math.floor(e);return r<0?0:r>=t?t-1:r}function sr(e){const t=gc(e),r=new Lr(t.tt),i=t.r.add(r.Sun.r),n=t.v.add(r.Sun.v),a=r.Acceleration(i),s=new Mt(t.tt,i,n,a);return new Zi(r,s)}function mc(e,t){const r=xe[0][0];if(txe[nr-1][0])return null;const i=Ji((t-r)/vc,nr-1);if(!e[i]){const a=e[i]=[];a[0]=sr(xe[i]).grav,a[se-1]=sr(xe[i+1]).grav;let s,l=a[0].tt;for(s=1;s0;--s)n[s]=ar(l-=Ue,n[s+1]).grav;for(s=se-2;s>0;--s){const o=s/(se-1);a[s].r=a[s].r.mul(1-o).add(n[s].r.mul(o)),a[s].v=a[s].v.mul(1-o).add(n[s].v.mul(o)),a[s].a=a[s].a.mul(1-o).add(n[s].a.mul(o))}}return e[i]}function di(e,t,r){let i=sr(e);const n=Math.ceil((t-i.grav.tt)/r);for(let a=0;a1)throw"Object is too distant for light-travel solver.";const l=t.AddDays(-s);if(i=Math.abs(l.tt-r.tt),i<1e-9)return a;r=l}throw`Light-travel time solver did not converge: dt = ${i}`}let wc=class{constructor(t,r,i,n){this.observerBody=t,this.targetBody=r,this.aberration=i,this.observerPos=n}Position(t){this.aberration&&(this.observerPos=Ze(this.observerBody,t));const r=Ze(this.targetBody,t);return new ee(r.x-this.observerPos.x,r.y-this.observerPos.y,r.z-this.observerPos.z,t)}};function Dc(e,t,r,i){const n=ye(e);if(Yi(r)){const l=Ze(r,n),o=Ze(t,n);return new ee(l.x-o.x,l.y-o.y,l.z-o.z,n)}let a;a=Ze(t,n);const s=new wc(t,r,i,a);return xc(l=>s.Position(l),n)}function Ec(e,t,r){const i=ye(t);switch(e){case R.Earth:return new ee(0,0,0,i);case R.Moon:return $t(i);default:const n=Dc(i,R.Earth,e,r);return n.t=i,n}}var fi;(function(e){e[e.Pericenter=0]="Pericenter",e[e.Apocenter=1]="Apocenter"})(fi||(fi={}));function qi(e,t){return new He([[t.rot[0][0]*e.rot[0][0]+t.rot[1][0]*e.rot[0][1]+t.rot[2][0]*e.rot[0][2],t.rot[0][1]*e.rot[0][0]+t.rot[1][1]*e.rot[0][1]+t.rot[2][1]*e.rot[0][2],t.rot[0][2]*e.rot[0][0]+t.rot[1][2]*e.rot[0][1]+t.rot[2][2]*e.rot[0][2]],[t.rot[0][0]*e.rot[1][0]+t.rot[1][0]*e.rot[1][1]+t.rot[2][0]*e.rot[1][2],t.rot[0][1]*e.rot[1][0]+t.rot[1][1]*e.rot[1][1]+t.rot[2][1]*e.rot[1][2],t.rot[0][2]*e.rot[1][0]+t.rot[1][2]*e.rot[1][1]+t.rot[2][2]*e.rot[1][2]],[t.rot[0][0]*e.rot[2][0]+t.rot[1][0]*e.rot[2][1]+t.rot[2][0]*e.rot[2][2],t.rot[0][1]*e.rot[2][0]+t.rot[1][1]*e.rot[2][1]+t.rot[2][1]*e.rot[2][2],t.rot[0][2]*e.rot[2][0]+t.rot[1][2]*e.rot[2][1]+t.rot[2][2]*e.rot[2][2]]])}function Tc(e,t){t=ye(t);const r=e.lat*Ge,i=e.lon*Ge,n=e.dist*Math.cos(r);return new ee(n*Math.cos(i),n*Math.sin(i),e.dist*Math.sin(r),t)}function Cc(e){e=ye(e);const t=Ki(e,ce.From2000),r=cc(e,ce.From2000);return qi(t,r)}var hi;(function(e){e.Penumbral="penumbral",e.Partial="partial",e.Annular="annular",e.Total="total"})(hi||(hi={}));var vi;(function(e){e[e.Invalid=0]="Invalid",e[e.Ascending=1]="Ascending",e[e.Descending=-1]="Descending"})(vi||(vi={}));function Sc(e){const t=Math.cos(e),r=Math.sin(e);return new He([[t,-r,0],[r,t,0],[0,0,1]])}function Ur(e){return e instanceof wt?e:new wt(e instanceof Date?e:new Date(e))}function yc(e,t=new I){const r=Ur(e),i=Cc(r),n=Sc(lc(r)*(-Math.PI/12)),{rot:a}=qi(i,n);return t.set(a[0][0],a[0][1],a[0][2],0,a[1][0],a[1][1],a[1][2],0,a[2][0],a[2][1],a[2][2],0,0,0,0,1)}function _i(e,t,r){const{x:i,y:n,z:a}=Ec(e,t,!1);return r.set(i,n,a).normalize()}function Bc(e,t=new x){return _i(R.Sun,Ur(e),t)}function Mc(e,t=new x){return _i(R.Moon,Ur(e),t)}function Rc(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i0&&(n=n.replace(/^[\/]+/,"")),i0?"?":"")+s.join("&"),a}function Ic(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),Rc(e)}class Pc extends Ct{constructor(){super(...arguments),L(this,"useHalfFloat",!1)}load(t,r,i,n){const a={},s=(l,{Loader:o,width:u,height:c,depth:d,suffix:v=""})=>{const g=new o(this.manager);g.setRequestHeader(this.requestHeader),g.setPath(this.path),g.setWithCredentials(this.withCredentials),g.load(Ic(t,`${l}${v}.bin`),p=>{p.image.width=u,p.image.height=c,p instanceof xi&&d!=null&&(p.image.depth=d),this.useHalfFloat&&(p.internalFormat="RGBA16F"),a[`${l}Texture`]=p,a.irradianceTexture!=null&&a.scatteringTexture!=null&&a.transmittanceTexture!=null&&r(a)},i,n)};s("irradiance",{Loader:ai,width:Er,height:Tr}),s("scattering",{Loader:Cl,width:bl,height:Ll,depth:Ul,suffix:this.useHalfFloat?"":"_float"}),s("transmittance",{Loader:ai,width:Mr,height:Rr})}}De.WGS84;var bc=`uniform vec3 sunDirection; +uniform vec3 moonDirection; +uniform float moonAngularRadius; +uniform float lunarRadianceScale; + +in vec3 vWorldPosition; +in vec3 vWorldDirection; +in vec3 vEllipsoidCenter; + +layout(location = 0) out vec4 outputColor; + +#include + +void main() { + vec3 viewPosition = vWorldPosition - vEllipsoidCenter; + vec3 rayDirection = normalize(vWorldDirection); + + outputColor.rgb = getSkyRadiance( + viewPosition, + rayDirection, + sunDirection, + moonDirection, + moonAngularRadius, + lunarRadianceScale + ); + outputColor.a = 1.0; + + #include +}`,Lc=`uniform mat4 inverseProjectionMatrix; +uniform mat4 inverseViewMatrix; +uniform vec3 cameraPosition; +uniform vec3 ellipsoidCenter; + +layout(location = 0) in vec3 position; + +out vec3 vWorldPosition; +out vec3 vWorldDirection; +out vec3 vEllipsoidCenter; + +void getCameraRay(out vec3 origin, out vec3 direction) { + bool isPerspective = inverseProjectionMatrix[2][3] != 0.0; + + if (isPerspective) { + + vec4 viewPosition = inverseProjectionMatrix * vec4(position, 1.0); + vec4 worldDirection = inverseViewMatrix * vec4(viewPosition.xyz, 0.0); + origin = cameraPosition; + direction = worldDirection.xyz; + } else { + + vec4 nearPoint = inverseProjectionMatrix * vec4(position.xy, -1.0, 1.0); + vec4 farPoint = inverseProjectionMatrix * vec4(position.xy, -0.9, 1.0); + nearPoint /= nearPoint.w; + farPoint /= farPoint.w; + + + vec4 worldDirection = + inverseViewMatrix * vec4(farPoint.xyz - nearPoint.xyz, 0.0); + vec4 worldOrigin = inverseViewMatrix * nearPoint; + + + direction = worldDirection.xyz; + origin = worldOrigin.xyz; + } +} + +void main() { + vec3 direction, origin; + getCameraRay(origin, direction); + + vWorldPosition = origin.xyz * METER_TO_UNIT_LENGTH; + vWorldDirection = direction.xyz; + vEllipsoidCenter = ellipsoidCenter * METER_TO_UNIT_LENGTH; + + gl_Position = vec4(position.xy, 1.0, 1.0); +}`;const $i={...Pr,sun:!0,moon:!0,moonAngularRadius:.0045,lunarRadianceScale:1};class Uc extends Vi{constructor(t){const{sun:r,moon:i,moonDirection:n,moonAngularRadius:a,lunarRadianceScale:s,...l}={...$i,...t};super({glslVersion:wi,vertexShader:` + precision highp float; + precision highp sampler3D; + ${Fe} + ${Lc} + `,fragmentShader:` + precision highp float; + precision highp sampler3D; + ${Fe} + ${Ir} + ${ki} + ${bc} + `,...l,uniforms:{inverseProjectionMatrix:new f(new I),inverseViewMatrix:new f(new I),moonDirection:new f((n==null?void 0:n.clone())??new x),moonAngularRadius:new f(a),lunarRadianceScale:new f(s),...l.uniforms},defines:{PERSPECTIVE_CAMERA:"1"},depthTest:!0}),this.sun=r,this.moon=i}onBeforeRender(t,r,i,n,a,s){super.onBeforeRender(t,r,i,n,a,s);const l=this.uniforms;l.inverseProjectionMatrix.value.copy(i.projectionMatrixInverse),l.inverseViewMatrix.value.copy(i.matrixWorld);const o=i.isPerspectiveCamera===!0;this.defines.PERSPECTIVE_CAMERA!=null!==o&&(o?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}get sun(){return this.defines.SUN!=null}set sun(t){t!==this.sun&&(t?this.defines.SUN="1":delete this.defines.SUN,this.needsUpdate=!0)}get moon(){return this.defines.MOON!=null}set moon(t){t!==this.moon&&(t?this.defines.MOON="1":delete this.defines.MOON,this.needsUpdate=!0)}get moonDirection(){return this.uniforms.moonDirection.value}get moonAngularRadius(){return this.uniforms.moonAngularRadius.value}set moonAngularRadius(t){this.uniforms.moonAngularRadius.value=t}get lunarRadianceScale(){return this.uniforms.lunarRadianceScale.value}set lunarRadianceScale(t){this.uniforms.lunarRadianceScale.value=t}}class Oc extends Tt{constructor(t){super();const r=new Int16Array(t),i=new Uint8Array(t),n=new kr(r,5),a=new kr(i,10);this.setAttribute("position",new Nt(n,3,0,!0)),this.setAttribute("magnitude",new Nt(a,1,6,!0)),this.setAttribute("color",new Nt(a,3,7,!0)),this.boundingSphere=new ur(new x,1)}}var Nc=`uniform vec3 sunDirection; + +in vec3 vWorldPosition; +in vec3 vWorldDirection; +in vec3 vEllipsoidCenter; + +layout(location = 0) out vec4 outputColor; + +#include + +in vec3 vColor; + +void main() { + #ifndef PERSPECTIVE_CAMERA + outputColor = vec4(0.0); + discard; + #endif + + #ifdef BACKGROUND + vec3 viewDirection = normalize(vWorldDirection); + vec3 transmittance; + vec3 radiance = GetSkyRadiance( + vWorldPosition - vEllipsoidCenter, + viewDirection, + 0.0, + sunDirection, + transmittance + ); + radiance += transmittance * vColor; + outputColor = vec4(radiance, 1.0); + #else + outputColor = vec4(vColor, 1.0); + #endif + + #include +}`,zc=`#define saturate(x) clamp(x, 0.0, 1.0) + +uniform mat4 projectionMatrix; +uniform mat4 modelViewMatrix; +uniform mat4 viewMatrix; +uniform mat4 matrixWorld; +uniform vec3 cameraPosition; +uniform float cameraFar; +uniform vec3 ellipsoidCenter; +uniform float pointSize; +uniform vec2 magnitudeRange; +uniform float radianceScale; + +layout(location = 0) in vec3 position; +layout(location = 1) in float magnitude; +layout(location = 2) in vec3 color; + +out vec3 vWorldPosition; +out vec3 vWorldDirection; +out vec3 vEllipsoidCenter; +out vec3 vColor; + +void main() { + + float m = mix(magnitudeRange.x, magnitudeRange.y, magnitude); + vec3 v = pow(vec3(10.0), -vec3(magnitudeRange, m) / 2.5); + vColor = vec3(radianceScale * color); + vColor *= saturate((v.z - v.y) / (v.x - v.y)); + + #ifdef BACKGROUND + vec3 worldDirection = normalize(matrixWorld * vec4(position, 1.0)).xyz; + vWorldDirection = worldDirection; + vWorldPosition = cameraPosition * METER_TO_UNIT_LENGTH; + vEllipsoidCenter = ellipsoidCenter * METER_TO_UNIT_LENGTH; + gl_Position = + projectionMatrix * + viewMatrix * + vec4(cameraPosition + worldDirection * cameraFar, 1.0); + #else + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + #endif + + gl_PointSize = pointSize; +}`;const en={...Pr,pointSize:1,radianceScale:1,background:!0};class Fc extends Vi{constructor(t){const{pointSize:r,radianceScale:i,background:n,...a}={...en,...t};super({glslVersion:wi,vertexShader:` + precision highp float; + precision highp sampler3D; + ${Fe} + ${zc} + `,fragmentShader:` + precision highp float; + precision highp sampler3D; + ${Fe} + ${Ir} + ${Nc} + `,...a,uniforms:{projectionMatrix:new f(new I),modelViewMatrix:new f(new I),viewMatrix:new f(new I),matrixWorld:new f(new I),cameraFar:new f(0),pointSize:new f(0),magnitudeRange:new f(new b(-2,8)),radianceScale:new f(i),...a.uniforms},defines:{PERSPECTIVE_CAMERA:"1"}}),L(this,"pointSize"),this.pointSize=r,this.background=n}onBeforeRender(t,r,i,n,a,s){super.onBeforeRender(t,r,i,n,a,s);const l=this.uniforms;l.projectionMatrix.value.copy(i.projectionMatrix),l.modelViewMatrix.value.copy(i.modelViewMatrix),l.viewMatrix.value.copy(i.matrixWorldInverse),l.matrixWorld.value.copy(a.matrixWorld),l.cameraFar.value=i.far,l.pointSize.value=this.pointSize*t.getPixelRatio();const o=i.isPerspectiveCamera===!0;this.defines.PERSPECTIVE_CAMERA!=null!==o&&(o?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}get magnitudeRange(){return this.uniforms.magnitudeScale.value}get radianceScale(){return this.uniforms.radianceScale.value}set radianceScale(t){this.uniforms.radianceScale.value=t}get background(){return this.defines.BACKGROUND!=null}set background(t){t!==this.background&&(t?this.defines.BACKGROUND="1":delete this.defines.BACKGROUND,this.needsUpdate=!0)}}De.WGS84;function Gc(){const e=new Tt,t=new Float32Array([-1,-1,3,-1,-1,3]);return e.boundingSphere=new ur,e.boundingSphere.set(new x,1/0),e.setAttribute("position",new qe(t,2)),e}const Hc=w.forwardRef(function({children:t,...r},i){const n=w.useMemo(Gc,[]);return w.createElement("mesh",Cn({ref:i,geometry:n,frustumCulled:!1},r),t)}),Rt=w.createContext({}),kc=w.forwardRef(function({textures:e,useHalfFloat:t,ellipsoid:r=De.WGS84,correctAltitude:i=!0,photometric:n=!0,date:a,children:s},l){const o=w.useRef({sunDirection:new x,moonDirection:new x,rotationMatrix:new I}),u=ze(({gl:m})=>m);t==null&&(t=u.getContext().getExtension("OES_texture_float_linear")==null);const[c,d]=w.useState(typeof e!="string"?e:void 0);w.useEffect(()=>{if(typeof e=="string"){const m=new Pc;m.useHalfFloat=t,(async()=>{d(await m.loadAsync(e))})().catch(B=>{console.error(B)})}else e!=null?d(e):d(void 0)},[e,t]);const v=w.useMemo(()=>({textures:c,useHalfFloat:t,ellipsoid:r,correctAltitude:i,photometric:n,transientProps:o.current}),[c,t,r,i,n]),g=w.useMemo(()=>{const{sunDirection:m,moonDirection:B,rotationMatrix:T}=o.current;return A=>{yc(A,T),Bc(A,m).applyMatrix4(T),Mc(A,B).applyMatrix4(T)}},[]),p=a!=null&&!isNaN(+a)?+a:void 0;return w.useEffect(()=>{p!=null&&g(p)},[p,g]),w.useImperativeHandle(l,()=>({...o.current,textures:c,updateByDate:g}),[c,g]),C.jsx(Rt.Provider,{value:v,children:s})});function Or(e){const{irradianceTexture:t,scatteringTexture:r,transmittanceTexture:i,useHalfFloat:n,ellipsoid:a,correctAltitude:s,photometric:l,sunDirection:o,sunAngularRadius:u,renderTargetCount:c,...d}=e;return[{irradianceTexture:t,scatteringTexture:r,transmittanceTexture:i,useHalfFloat:n,ellipsoid:a,correctAltitude:s,photometric:l,sunDirection:o,sunAngularRadius:u,renderTargetCount:c},d]}const Qc=w.forwardRef(function(e,t){const{textures:r,transientProps:i,...n}=w.useContext(Rt),[a,{blendFunction:s,...l}]=Or({...Qi,...n,...r,...e}),o=w.useContext(Si),{normalPass:u,camera:c}=o,d="geometryPass"in o&&o.geometryPass instanceof vr&&"geometryTexture"in o.geometryPass&&o.geometryPass.geometryTexture instanceof Je?o.geometryPass.geometryTexture:void 0,v=w.useMemo(()=>new Fl(void 0,{blendFunction:s}),[s]);return w.useEffect(()=>()=>{v.dispose()},[v]),$e(()=>{i!=null&&(v.sunDirection.copy(i.sunDirection),v.moonDirection.copy(i.moonDirection))}),C.jsx("primitive",{ref:t,object:v,mainCamera:c,normalBuffer:d??(u==null?void 0:u.texture)??null,...a,...l,octEncodedNormal:d!=null})}),Vc=w.forwardRef(function(e,t){const{textures:r,transientProps:i,...n}=w.useContext(Rt),[a,{sun:s,moon:l,moonDirection:o,moonAngularRadius:u,lunarRadianceScale:c,...d}]=Or({...$i,...n,...r,...e}),v=w.useMemo(()=>new Uc,[]);return w.useEffect(()=>()=>{v.dispose()},[v]),$e(()=>{i!=null&&(v.sunDirection.copy(i.sunDirection),v.moonDirection.copy(i.moonDirection))}),C.jsx(Hc,{renderOrder:Hi,...d,ref:t,children:C.jsx("primitive",{object:v,...a,sun:s,moon:l,moonDirection:o,moonAngularRadius:u,lunarRadianceScale:c})})});function Yc(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}const Wc=w.forwardRef(function({data:e,...t},r){const{textures:i,transientProps:n,...a}=w.useContext(Rt),[s,{pointSize:l,radianceScale:o,background:u,...c}]=Or({...en,...a,...i,...t}),[d,v]=w.useState(typeof e!="string"?e:void 0);w.useEffect(()=>{if(typeof e=="string"){const T=new Mi;(async()=>{v(await T.loadAsync(e))})().catch(A=>{console.error(A)})}else e!=null?v(e):v(void 0)},[e]);const g=w.useMemo(()=>d!=null?new Oc(d):void 0,[d]);w.useEffect(()=>()=>{g==null||g.dispose()},[g]);const p=w.useMemo(()=>new Fc,[]);w.useEffect(()=>()=>{p.dispose()},[p]);const m=w.useRef(null);$e(({camera:T})=>{var A;n!=null&&T.isPerspectiveCamera===!0&&(p.sunDirection.copy(n.sunDirection),(A=m.current)==null||A.setRotationFromMatrix(n.rotationMatrix))});const B=ze(({camera:T})=>T);return g==null||B.isPerspectiveCamera!==!0?null:C.jsxs("points",{ref:Yc([m,r]),frustumCulled:!1,renderOrder:Hi+1,...c,children:[C.jsx("primitive",{object:g}),C.jsx("primitive",{object:p,...s,pointSize:l,radianceScale:o,background:u,depthTest:!0,depthWrite:!1})]})});var Xc=Object.defineProperty,Kc=(e,t,r)=>t in e?Xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,re=(e,t,r)=>Kc(e,typeof t!="symbol"?t+"":t,r),jc=`#define DITHERING + +#include + +void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { + outputColor = vec4(dithering(inputColor.rgb), inputColor.a); +}`;const Zc={blendFunction:E.NORMAL};class Jc extends we{constructor(t){const{blendFunction:r}={...Zc,...t};super("DitheringEffect",jc,{blendFunction:r})}}var qc=`#include + +uniform sampler2D inputBuffer; + +uniform float thresholdLevel; +uniform float thresholdRange; + +in vec2 vCenterUv1; +in vec2 vCenterUv2; +in vec2 vCenterUv3; +in vec2 vCenterUv4; +in vec2 vRowUv1; +in vec2 vRowUv2; +in vec2 vRowUv3; +in vec2 vRowUv4; +in vec2 vRowUv5; +in vec2 vRowUv6; +in vec2 vRowUv7; +in vec2 vRowUv8; +in vec2 vRowUv9; + +float clampToBorder(const vec2 uv) { + return float(uv.x >= 0.0 && uv.x <= 1.0 && uv.y >= 0.0 && uv.y <= 1.0); +} + +void main() { + vec3 color = 0.125 * texture2D(inputBuffer, vec2(vRowUv5)).rgb; + vec4 weight = + 0.03125 * + vec4( + clampToBorder(vRowUv1), + clampToBorder(vRowUv3), + clampToBorder(vRowUv7), + clampToBorder(vRowUv9) + ); + color += weight.x * texture2D(inputBuffer, vec2(vRowUv1)).rgb; + color += weight.y * texture2D(inputBuffer, vec2(vRowUv3)).rgb; + color += weight.z * texture2D(inputBuffer, vec2(vRowUv7)).rgb; + color += weight.w * texture2D(inputBuffer, vec2(vRowUv9)).rgb; + + weight = + 0.0625 * + vec4( + clampToBorder(vRowUv2), + clampToBorder(vRowUv4), + clampToBorder(vRowUv6), + clampToBorder(vRowUv8) + ); + color += weight.x * texture2D(inputBuffer, vec2(vRowUv2)).rgb; + color += weight.y * texture2D(inputBuffer, vec2(vRowUv4)).rgb; + color += weight.z * texture2D(inputBuffer, vec2(vRowUv6)).rgb; + color += weight.w * texture2D(inputBuffer, vec2(vRowUv8)).rgb; + + weight = + 0.125 * + vec4( + clampToBorder(vRowUv2), + clampToBorder(vRowUv4), + clampToBorder(vRowUv6), + clampToBorder(vRowUv8) + ); + color += weight.x * texture2D(inputBuffer, vec2(vCenterUv1)).rgb; + color += weight.y * texture2D(inputBuffer, vec2(vCenterUv2)).rgb; + color += weight.z * texture2D(inputBuffer, vec2(vCenterUv3)).rgb; + color += weight.w * texture2D(inputBuffer, vec2(vCenterUv4)).rgb; + + + + if (any(isnan(color))) { + gl_FragColor = vec4(vec3(0.0), 1.0); + return; + } + + float l = luminance(color); + float scale = saturate( + smoothstep(thresholdLevel, thresholdLevel + thresholdRange, l) + ); + gl_FragColor = vec4(color * scale, 1.0); +}`,_c=`uniform vec2 texelSize; + +out vec2 vCenterUv1; +out vec2 vCenterUv2; +out vec2 vCenterUv3; +out vec2 vCenterUv4; +out vec2 vRowUv1; +out vec2 vRowUv2; +out vec2 vRowUv3; +out vec2 vRowUv4; +out vec2 vRowUv5; +out vec2 vRowUv6; +out vec2 vRowUv7; +out vec2 vRowUv8; +out vec2 vRowUv9; + +void main() { + vec2 uv = position.xy * 0.5 + 0.5; + vCenterUv1 = uv + texelSize * vec2(-1.0, 1.0); + vCenterUv2 = uv + texelSize * vec2(1.0, 1.0); + vCenterUv3 = uv + texelSize * vec2(-1.0, -1.0); + vCenterUv4 = uv + texelSize * vec2(1.0, -1.0); + vRowUv1 = uv + texelSize * vec2(-2.0, 2.0); + vRowUv2 = uv + texelSize * vec2(0.0, 2.0); + vRowUv3 = uv + texelSize * vec2(2.0, 2.0); + vRowUv4 = uv + texelSize * vec2(-2.0, 0.0); + vRowUv5 = uv + texelSize; + vRowUv6 = uv + texelSize * vec2(2.0, 0.0); + vRowUv7 = uv + texelSize * vec2(-2.0, -2.0); + vRowUv8 = uv + texelSize * vec2(0.0, -2.0); + vRowUv9 = uv + texelSize * vec2(2.0, -2.0); + + gl_Position = vec4(position.xy, 1.0, 1.0); +}`;const $c={thresholdLevel:10,thresholdRange:1};let eu=class extends _{constructor(t){const{inputBuffer:r=null,thresholdLevel:i,thresholdRange:n,...a}={...$c,...t};super({name:"DownsampleThresholdMaterial",fragmentShader:qc,vertexShader:_c,uniforms:{inputBuffer:new f(r),texelSize:new f(new b),thresholdLevel:new f(i),thresholdRange:new f(n)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1,...a})}setSize(t,r){this.uniforms.texelSize.value.set(1/t,1/r)}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(t){this.uniforms.inputBuffer.value=t}get thresholdLevel(){return this.uniforms.thresholdLevel.value}set thresholdLevel(t){this.uniforms.thresholdLevel.value=t}get thresholdRange(){return this.uniforms.thresholdRange.value}set thresholdRange(t){this.uniforms.thresholdRange.value=t}};var tu=`#include + +#define SQRT_2 (0.7071067811865476) + +uniform sampler2D inputBuffer; + +uniform vec2 texelSize; +uniform float ghostAmount; +uniform float haloAmount; +uniform float chromaticAberration; + +in vec2 vUv; +in vec2 vAspectRatio; + +vec3 sampleGhost(const vec2 direction, const vec3 color, const float offset) { + vec2 suv = clamp(1.0 - vUv + direction * offset, 0.0, 1.0); + vec3 result = texture2D(inputBuffer, suv).rgb * color; + + + float d = clamp(length(0.5 - suv) / (0.5 * SQRT_2), 0.0, 1.0); + result *= pow(1.0 - d, 3.0); + return result; +} + +vec4 sampleGhosts(float amount) { + vec3 color = vec3(0.0); + vec2 direction = vUv - 0.5; + color += sampleGhost(direction, vec3(0.8, 0.8, 1.0), -5.0); + color += sampleGhost(direction, vec3(1.0, 0.8, 0.4), -1.5); + color += sampleGhost(direction, vec3(0.9, 1.0, 0.8), -0.4); + color += sampleGhost(direction, vec3(1.0, 0.8, 0.4), -0.2); + color += sampleGhost(direction, vec3(0.9, 0.7, 0.7), -0.1); + color += sampleGhost(direction, vec3(0.5, 1.0, 0.4), 0.7); + color += sampleGhost(direction, vec3(0.5, 0.5, 0.5), 1.0); + color += sampleGhost(direction, vec3(1.0, 1.0, 0.6), 2.5); + color += sampleGhost(direction, vec3(0.5, 0.8, 1.0), 10.0); + return vec4(color * amount, 1.0); +} + +float cubicRingMask(const float x, const float radius, const float thickness) { + float v = min(abs(x - radius) / thickness, 1.0); + return 1.0 - v * v * (3.0 - 2.0 * v); +} + +vec3 sampleHalo(const float radius) { + vec2 direction = normalize((vUv - 0.5) / vAspectRatio) * vAspectRatio; + vec3 offset = vec3(texelSize.x * chromaticAberration) * vec3(-1.0, 0.0, 1.0); + vec2 suv = fract(1.0 - vUv + direction * radius); + vec3 result = vec3( + texture2D(inputBuffer, suv + direction * offset.r).r, + texture2D(inputBuffer, suv + direction * offset.g).g, + texture2D(inputBuffer, suv + direction * offset.b).b + ); + + + vec2 wuv = (vUv - vec2(0.5, 0.0)) / vAspectRatio + vec2(0.5, 0.0); + float d = saturate(distance(wuv, vec2(0.5))); + result *= cubicRingMask(d, 0.45, 0.25); + return result; +} + +vec4 sampleHalos(const float amount) { + vec3 color = vec3(0.0); + color += sampleHalo(0.3); + return vec4(color, 1.0) * amount; +} + +void main() { + gl_FragColor += sampleGhosts(ghostAmount); + gl_FragColor += sampleHalos(haloAmount); +}`,ru=`uniform vec2 texelSize; + +out vec2 vUv; +out vec2 vAspectRatio; + +void main() { + vUv = position.xy * 0.5 + 0.5; + vAspectRatio = vec2(texelSize.x / texelSize.y, 1.0); + gl_Position = vec4(position.xy, 1.0, 1.0); +}`;const iu={ghostAmount:.001,haloAmount:.001,chromaticAberration:10};class nu extends _{constructor(t){const{inputBuffer:r=null,ghostAmount:i,haloAmount:n,chromaticAberration:a}={...iu,...t};super({name:"LensFlareFeaturesMaterial",fragmentShader:tu,vertexShader:ru,uniforms:{inputBuffer:new f(r),texelSize:new f(new b),ghostAmount:new f(i),haloAmount:new f(n),chromaticAberration:new f(a)},blending:$,toneMapped:!1,depthWrite:!1,depthTest:!1})}setSize(t,r){const i=this.uniforms.texelSize;i.value.x=1/t,i.value.y=1/r}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(t){this.uniforms.inputBuffer.value=t}get ghostAmount(){return this.uniforms.ghostAmount.value}set ghostAmount(t){this.uniforms.ghostAmount.value=t}get haloAmount(){return this.uniforms.haloAmount.value}set haloAmount(t){this.uniforms.haloAmount.value=t}get chromaticAberration(){return this.uniforms.chromaticAberration.value}set chromaticAberration(t){this.uniforms.chromaticAberration.value=t}}var au=`uniform sampler2D bloomBuffer; +uniform sampler2D featuresBuffer; +uniform float intensity; + +void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { + vec3 bloom = texture2D(bloomBuffer, uv).rgb; + vec3 features = texture2D(featuresBuffer, uv).rgb; + outputColor = vec4( + inputColor.rgb + (bloom + features) * intensity, + inputColor.a + ); +}`;const tn={blendFunction:E.NORMAL,resolutionScale:.5,width:V.AUTO_SIZE,height:V.AUTO_SIZE,intensity:.005};let su=class extends we{constructor(t){const{blendFunction:r,resolutionScale:i,width:n,height:a,resolutionX:s=n,resolutionY:l=a,intensity:o}={...tn,...t};super("LensFlareEffect",au,{blendFunction:r,attributes:Z.CONVOLUTION,uniforms:new Map([["bloomBuffer",new f(null)],["featuresBuffer",new f(null)],["intensity",new f(1)]])}),re(this,"resolution"),re(this,"renderTarget1"),re(this,"renderTarget2"),re(this,"thresholdMaterial"),re(this,"thresholdPass"),re(this,"blurPass"),re(this,"preBlurPass"),re(this,"featuresMaterial"),re(this,"featuresPass"),re(this,"onResolutionChange",()=>{this.setSize(this.resolution.baseWidth,this.resolution.baseHeight)}),this.renderTarget1=new J(1,1,{depthBuffer:!1,stencilBuffer:!1,type:Vt}),this.renderTarget1.texture.name="LensFlare.Target1",this.renderTarget2=new J(1,1,{depthBuffer:!1,stencilBuffer:!1,type:Vt}),this.renderTarget2.texture.name="LensFlare.Target2",this.thresholdMaterial=new eu,this.thresholdPass=new mt(this.thresholdMaterial),this.blurPass=new Qa,this.blurPass.levels=8,this.preBlurPass=new ba({kernelSize:hr.SMALL}),this.featuresMaterial=new nu,this.featuresPass=new mt(this.featuresMaterial),this.uniforms.get("bloomBuffer").value=this.blurPass.texture,this.uniforms.get("featuresBuffer").value=this.renderTarget1.texture,this.resolution=new V(this,s,l,i),this.resolution.addEventListener("change",this.onResolutionChange),this.intensity=o}initialize(t,r,i){this.thresholdPass.initialize(t,r,i),this.blurPass.initialize(t,r,i),this.preBlurPass.initialize(t,r,i),this.featuresPass.initialize(t,r,i)}update(t,r,i){this.thresholdPass.render(t,r,this.renderTarget1),this.blurPass.render(t,this.renderTarget1,null),this.preBlurPass.render(t,this.renderTarget1,this.renderTarget2),this.featuresPass.render(t,this.renderTarget2,this.renderTarget1)}setSize(t,r){const i=this.resolution;i.setBaseSize(t,r),this.renderTarget1.setSize(i.width,i.height),this.renderTarget2.setSize(i.width,i.height),this.thresholdMaterial.setSize(i.width,i.height),this.blurPass.setSize(i.width,i.height),this.preBlurPass.setSize(i.width,i.height),this.featuresMaterial.setSize(i.width,i.height)}get intensity(){return this.uniforms.get("intensity").value}set intensity(t){this.uniforms.get("intensity").value=t}get thresholdLevel(){return this.thresholdMaterial.thresholdLevel}set thresholdLevel(t){this.thresholdMaterial.thresholdLevel=t}get thresholdRange(){return this.thresholdMaterial.thresholdRange}set thresholdRange(t){this.thresholdMaterial.thresholdRange=t}};const ou=yi(Jc),lu=w.forwardRef(function(e,t){const{blendFunction:r,...i}={...tn,...e},n=w.useMemo(()=>new su,[]);return w.useEffect(()=>()=>{n.dispose()},[n]),C.jsx("primitive",{ref:t,object:n,...i})}),It=new Tt;It.setAttribute("position",new qe(new Float32Array([-1,-1,3,-1,-1,3]),2));It.setAttribute("uv",new qe(new Float32Array([0,0,2,0,0,2]),2));It.boundingSphere=new ur;It.computeBoundingSphere=function(){};new Dn;new I,new I,new I,new I,new I,new x,new b,new b;new I,new I,new I,new I,new x,new b,new x(0,0,0);new I,new I,new I,new I,new x,new b;new b,new I,new I;var rn="5L7pP4UXrOIr/VZ1G3f6p89FIWU7lqc7J3DPxKjJUXODJoHQzf/aNVM+ABlvhXeBGN7iC0WkmTjEaAqOItBfBdaK5KSGV1ET5SOKl3x9JOX5w2sAl6+6KjDhVUHgbqq7DZ5EeYzbdSNxtrQLW/KkPJoOTG4u5CBUZkCKHniY9l7DUgjuz708zG1HIC8qfohi1vPjPH9Lq47ksjRrjwXD4MlVCjdAqYFGodQ8tRmHkOfq4wVRIAHvoavPHvN1lpk3X4Y1yzAPGe8S9KBs3crc4GwlU1dEOXiWol/mgQqxkNqB1xd04+0Bmpwj0GcCc4NUi+c731FUxjvaexCkCJ0qhrJJ++htWqetNC4NewClu8aFRSwrqiJEGe+qtTg4CYCHaF1wJI0sy/ZBQAI0qAMyBvVjWZlv2pdkCaro9eWDLK5I4mbb8E4d7hZr9dDJiTJm6Bmb5S+2F7yal/JPdeLUfwq7jmVLaQfhv4tWMJAt7V4sG9LuAv2oPJgSj1nnlBvPibfHM2TrlWHwGCLGxW/5Jm2TotaDL+pHDM5pn1r0UuTZ24N8S5k68bLHW9tfD+2k4zGev23ExJb4YTRKWrj82N5LjJ26lj1BkGZ0CsXLGGELoPaYQomjTqPxYqhfwOwDliNGVqux9ffuybqOKgsbB51B1GbZfG8vHDBE2J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jf7k9GlRnp3mF/c1AV+JjvUsnZrsybEOQJg/dn/9eJkyykQHjbF56zgcPX6DdMG03WKUMlYz+uOZ+5DZy9E9MZOZ9GMoLFdrIPPQQLjv+GlCMpoyHPXkzIODjHAID2PrnaRpqWVHh0rnieDILKq+Emrd5RnjgE9pDUXWTmHaKuqqYlcgEz4zbi46dbWrAAFBjsQq1rLHIiPJEcwFLCOY4JNlXRXQJqCUKXk2d1RSBGzDP6HDSpo863BhVRFFF6uIpjQV7j5ebFe3UkkO/+coIo2BTAcgBqOtQ134s9a4QJvofuqBYMGOBMsWZ+sn/2AOxDx6SfAnDFGw==";Uint8Array.from(atob(rn),e=>e.charCodeAt(0));Uint8Array.from(atob(rn),e=>e.charCodeAt(0));class cu{processTileModel(t){t.traverse(r=>{r.geometry&&(r.geometry=bn(r.geometry,q.degToRad(30)))})}}const uu=new Rn().setDecoderPath("https://www.gstatic.com/draco/v1/decoders/");function du(){const e={apiToken:{value:localStorage.getItem("google-token")||"put-your-api-key-here",onChange:l=>localStorage.setItem("google-token",l),transient:!1},ortho:!1},t=ze(({camera:l})=>l),r=ze(({gl:l})=>l);r.toneMappingExposure=10;const i=w.useRef(null),n=w.useRef(null);$e(()=>{var o;(o=i.current)==null||o.updateByDate(Date.now());const l=n.current;l!=null&&l.passes.forEach(u=>{u.fullscreenMaterial instanceof Ci&&u.fullscreenMaterial.adoptCameraSettings(t)})}),window.CAMERA=t;const{apiToken:a,ortho:s}=In(e);return C.jsxs(C.Fragment,{children:[C.jsxs(Bn,{children:[C.jsx(Me,{plugin:Ln,args:{apiToken:a}}),C.jsx(Me,{plugin:Un,dracoLoader:uu}),C.jsx(Me,{plugin:On}),C.jsx(Me,{plugin:Nn}),C.jsx(Me,{plugin:zn}),C.jsx(Me,{plugin:cu}),C.jsx(Mn,{enableDamping:!0}),C.jsx(Pn,{}),C.jsx(Fn,{overrideRenderLoop:!1})]}),C.jsxs(kc,{ref:i,textures:"https://takram-design-engineering.github.io/three-geospatial/atmosphere",children:[C.jsx(Vc,{}),C.jsx(Wc,{data:"https://takram-design-engineering.github.io/three-geospatial/atmosphere/stars.bin"}),C.jsxs(vs,{ref:n,multisampling:0,enableNormalPass:!0,children:[C.jsx(Qc,{sunIrradiance:!0,skyIrradiance:!0,irradianceScale:2/Math.PI}),C.jsx(lu,{}),C.jsx(ms,{mode:K.AGX}),C.jsx(ps,{}),C.jsx(ou,{})]})]}),C.jsx(Gn,{mode:s?"orthographic":"perspective"})]})}Sn(document.getElementById("root")).render(C.jsx(w.StrictMode,{children:C.jsx(yn,{frameloop:"demand",camera:{position:[0,1.5*1e7,0],rotation:[-Math.PI/2,0,Math.PI]},style:{width:"100%",height:"100%",position:"absolute",margin:0,left:0,top:0},flat:!0,children:C.jsx(du,{})})})); diff --git a/example/bundle/assets/b3dmExample-Bp6f5GIT.js b/example/bundle/assets/b3dmExample-Bp6f5GIT.js new file mode 100644 index 00000000..53b85f6b --- /dev/null +++ b/example/bundle/assets/b3dmExample-Bp6f5GIT.js @@ -0,0 +1,20 @@ +import{S as M,W as D,P as L,a as T,D as P,A as R,G as F,b as _,C as A,U as E,B as H,c as I,R as W,V as j}from"./three.module-_fL2BuBc.js";import{O as G}from"./OrbitControls-Ck5AM9Mk.js";import{B as z}from"./B3DMLoader-s-i-FwTx.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";let s,m,c,t,f,r,b,a,d,u;$();C();function O(i){const e={...i};return e.uniforms={highlightedBatchId:{value:-1},highlightColor:{value:new A(16761095).convertSRGBToLinear()},...E.clone(i.uniforms)},e.extensions={derivatives:!0},e.lights=!0,e.vertexShader=` + attribute float _batchid; + varying float batchid; + `+e.vertexShader.replace(/#include /,` + #include + batchid = _batchid; + `),e.fragmentShader=` + varying float batchid; + uniform float highlightedBatchId; + uniform vec3 highlightColor; + `+e.fragmentShader.replace(/vec4 diffuseColor = vec4\( diffuse, opacity \);/,` + vec4 diffuseColor = + abs( batchid - highlightedBatchId ) < 0.5 ? + vec4( highlightColor, opacity ) : + vec4( diffuse, opacity ); + `),e}function $(){u=document.getElementById("info"),c=new M,t=new D({antialias:!0}),t.setPixelRatio(window.devicePixelRatio),t.setSize(window.innerWidth,window.innerHeight),t.setClearColor(1383455),t.shadowMap.enabled=!0,t.shadowMap.type=L,document.body.appendChild(t.domElement),s=new T(60,window.innerWidth/window.innerHeight,1,4e3),s.position.set(400,400,400),m=new G(s,t.domElement),m.screenSpacePanning=!1,m.minDistance=1,m.maxDistance=2e3,r=new P(16777215,1.25),r.position.set(1,2,3).multiplyScalar(40),r.castShadow=!0,r.shadow.bias=-.01,r.shadow.mapSize.setScalar(2048);const i=r.shadow.camera;i.left=-200,i.bottom=-200,i.right=200,i.top=200,i.updateProjectionMatrix(),c.add(r);const e=new R(16777215,.05);c.add(e),f=new F,c.add(f),new z().loadAsync("https://raw.githubusercontent.com/CesiumGS/cesium/main/Apps/SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tile.b3dm").then(h=>{console.log(h),d=h.scene,f.add(d);const n=new H;n.setFromObject(d),n.getCenter(f.position).multiplyScalar(-1),d.traverse(o=>{o.isMesh&&(o.material=new _(O(I.standard)))})}),b=new W,a=new j,y(),window.addEventListener("resize",y,!1),t.domElement.addEventListener("mousemove",U,!1)}function U(i){const e=this.getBoundingClientRect();a.x=i.clientX-e.x,a.y=i.clientY-e.y,a.x=a.x/e.width*2-1,a.y=-(a.y/e.height)*2+1,b.setFromCamera(a,s);const h=b.intersectObject(c,!0);let n=-1;if(h.length){const{face:o,object:p}=h[0],v=p.geometry.getAttribute("_batchid");if(v){let l=p;for(;!l.batchTable;)l=l.parent;const B=l.batchTable;n=v.getX(o.a);const w=B.getDataFromId(n);u.innerText=`_batchid : ${n} +Area : ${w.height.toFixed(3)} +Height : ${w.height.toFixed(3)} +`;const g=w["3DTILES_batch_table_hierarchy"];for(const x in g)for(const S in g[x])u.innerText+=`${S} : ${g[x][S]} +`}}else u.innerText="";d&&d.traverse(o=>{o.isMesh&&(o.material.uniforms.highlightedBatchId.value=n)})}function y(){s.aspect=window.innerWidth/window.innerHeight,t.setPixelRatio(window.devicePixelRatio),t.setSize(window.innerWidth,window.innerHeight),s.updateProjectionMatrix()}function C(){requestAnimationFrame(C),V()}function V(){t.render(c,s)} diff --git a/example/bundle/assets/basic-BZdGCdeT.js b/example/bundle/assets/basic-BZdGCdeT.js new file mode 100644 index 00000000..523b2e1b --- /dev/null +++ b/example/bundle/assets/basic-BZdGCdeT.js @@ -0,0 +1,217 @@ +import{i as j,b as k,U as I,aQ as E,aK as F,aM as B,aW as z,C as A}from"./three.module-_fL2BuBc.js";import{r as c,e as O,a as b,_ as U,c as P,j as n,C as N,T as G,d as L,E as V}from"./extends-BiwV-o27.js";import{T as $}from"./TilesFadePlugin-oL7QwVsE.js";import{E as K}from"./Environment-JXyVb9Rj.js";import{u as w,G as H,a as W}from"./GizmoViewport-DdGPEc5i.js";import"./EnvironmentControls-CJG7lPg-.js";import"./GlobeControls-5ygGpakr.js";import"./Ellipsoid-CKpUFSOi.js";import"./TilesRenderer-DkGmB3Pz.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";function X(m,t,r,e){const s=class extends k{constructor(v={}){const f=Object.entries(m);super({uniforms:f.reduce((l,[u,x])=>{const d=I.clone({[u]:{value:x}});return{...l,...d}},{}),vertexShader:t,fragmentShader:r}),this.key="",f.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:u=>this.uniforms[l].value=u})),Object.assign(this,v)}};return s.key=j.generateUUID(),s}const Q=X({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");class Y extends z{constructor(t=6,r=!1){super(),this.uniforms={chromaticAberration:{value:.05},transmission:{value:0},_transmission:{value:1},transmissionMap:{value:null},roughness:{value:0},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:1/0},attenuationColor:{value:new A("white")},anisotropicBlur:{value:.1},time:{value:0},distortion:{value:0},distortionScale:{value:.5},temporalDistortion:{value:0},buffer:{value:null}},this.onBeforeCompile=e=>{e.uniforms={...e.uniforms,...this.uniforms},this.anisotropy>0&&(e.defines.USE_ANISOTROPY=""),r?e.defines.USE_SAMPLER="":e.defines.USE_TRANSMISSION="",e.fragmentShader=` + uniform float chromaticAberration; + uniform float anisotropicBlur; + uniform float time; + uniform float distortion; + uniform float distortionScale; + uniform float temporalDistortion; + uniform sampler2D buffer; + + vec3 random3(vec3 c) { + float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); + vec3 r; + r.z = fract(512.0*j); + j *= .125; + r.x = fract(512.0*j); + j *= .125; + r.y = fract(512.0*j); + return r-0.5; + } + + uint hash( uint x ) { + x += ( x << 10u ); + x ^= ( x >> 6u ); + x += ( x << 3u ); + x ^= ( x >> 11u ); + x += ( x << 15u ); + return x; + } + + // Compound versions of the hashing algorithm I whipped together. + uint hash( uvec2 v ) { return hash( v.x ^ hash(v.y) ); } + uint hash( uvec3 v ) { return hash( v.x ^ hash(v.y) ^ hash(v.z) ); } + uint hash( uvec4 v ) { return hash( v.x ^ hash(v.y) ^ hash(v.z) ^ hash(v.w) ); } + + // Construct a float with half-open range [0:1] using low 23 bits. + // All zeroes yields 0.0, all ones yields the next smallest representable value below 1.0. + float floatConstruct( uint m ) { + const uint ieeeMantissa = 0x007FFFFFu; // binary32 mantissa bitmask + const uint ieeeOne = 0x3F800000u; // 1.0 in IEEE binary32 + m &= ieeeMantissa; // Keep only mantissa bits (fractional part) + m |= ieeeOne; // Add fractional part to 1.0 + float f = uintBitsToFloat( m ); // Range [1:2] + return f - 1.0; // Range [0:1] + } + + // Pseudo-random value in half-open range [0:1]. + float randomBase( float x ) { return floatConstruct(hash(floatBitsToUint(x))); } + float randomBase( vec2 v ) { return floatConstruct(hash(floatBitsToUint(v))); } + float randomBase( vec3 v ) { return floatConstruct(hash(floatBitsToUint(v))); } + float randomBase( vec4 v ) { return floatConstruct(hash(floatBitsToUint(v))); } + float rand(float seed) { + float result = randomBase(vec3(gl_FragCoord.xy, seed)); + return result; + } + + const float F3 = 0.3333333; + const float G3 = 0.1666667; + + float snoise(vec3 p) { + vec3 s = floor(p + dot(p, vec3(F3))); + vec3 x = p - s + dot(s, vec3(G3)); + vec3 e = step(vec3(0.0), x - x.yzx); + vec3 i1 = e*(1.0 - e.zxy); + vec3 i2 = 1.0 - e.zxy*(1.0 - e); + vec3 x1 = x - i1 + G3; + vec3 x2 = x - i2 + 2.0*G3; + vec3 x3 = x - 1.0 + 3.0*G3; + vec4 w, d; + w.x = dot(x, x); + w.y = dot(x1, x1); + w.z = dot(x2, x2); + w.w = dot(x3, x3); + w = max(0.6 - w, 0.0); + d.x = dot(random3(s), x); + d.y = dot(random3(s + i1), x1); + d.z = dot(random3(s + i2), x2); + d.w = dot(random3(s + 1.0), x3); + w *= w; + w *= w; + d *= w; + return dot(d, vec4(52.0)); + } + + float snoiseFractal(vec3 m) { + return 0.5333333* snoise(m) + +0.2666667* snoise(2.0*m) + +0.1333333* snoise(4.0*m) + +0.0666667* snoise(8.0*m); + } +`+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ",` + #ifdef USE_TRANSMISSION + // Transmission code is based on glTF-Sampler-Viewer + // https://github.com/KhronosGroup/glTF-Sample-Viewer + uniform float _transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + // Direction of refracted light. + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + // Compute rotation-independant scaling of the model matrix. + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + // The thickness is specified in local space. + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and + // an IOR of 1.5 results in the default amount of microfacet refraction. + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + #ifdef USE_SAMPLER + #ifdef texture2DLodEXT + return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod); + #else + return texture2D(transmissionSamplerMap, fragCoord.xy, framebufferLod); + #endif + #else + return texture2D(buffer, fragCoord.xy); + #endif + } + vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + // Attenuation distance is +∞, i.e. the transmitted color is not attenuated at all. + return radiance; + } else { + // Compute light attenuation using Beer's law. + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law + return transmittance * radiance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + // Sample framebuffer to get pixel the refracted ray hits. + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); + // Get the specular component. + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); + } + #endif +`),e.fragmentShader=e.fragmentShader.replace("#include ",` + // Improve the refraction to use the world pos + material.transmission = _transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vUv ).g; + #endif + + vec3 pos = vWorldPosition; + float runningSeed = 0.0; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec3 transmission = vec3(0.0); + float transmissionR, transmissionB, transmissionG; + float randomCoords = rand(runningSeed++); + float thickness_smear = thickness * max(pow(roughnessFactor, 0.33), anisotropicBlur); + vec3 distortionNormal = vec3(0.0); + vec3 temporalOffset = vec3(time, -time, -time) * temporalDistortion; + if (distortion > 0.0) { + distortionNormal = distortion * vec3(snoiseFractal(vec3((pos * distortionScale + temporalOffset))), snoiseFractal(vec3(pos.zxy * distortionScale - temporalOffset)), snoiseFractal(vec3(pos.yxz * distortionScale + temporalOffset))); + } + for (float i = 0.0; i < ${t}.0; i ++) { + vec3 sampleNorm = normalize(n + roughnessFactor * roughnessFactor * 2.0 * normalize(vec3(rand(runningSeed++) - 0.5, rand(runningSeed++) - 0.5, rand(runningSeed++) - 0.5)) * pow(rand(runningSeed++), 0.33) + distortionNormal); + transmissionR = getIBLVolumeRefraction( + sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness + thickness_smear * (i + randomCoords) / float(${t}), + material.attenuationColor, material.attenuationDistance + ).r; + transmissionG = getIBLVolumeRefraction( + sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior * (1.0 + chromaticAberration * (i + randomCoords) / float(${t})) , material.thickness + thickness_smear * (i + randomCoords) / float(${t}), + material.attenuationColor, material.attenuationDistance + ).g; + transmissionB = getIBLVolumeRefraction( + sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior * (1.0 + 2.0 * chromaticAberration * (i + randomCoords) / float(${t})), material.thickness + thickness_smear * (i + randomCoords) / float(${t}), + material.attenuationColor, material.attenuationDistance + ).b; + transmission.r += transmissionR; + transmission.g += transmissionG; + transmission.b += transmissionB; + } + transmission /= ${t}.0; + totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); +`)},Object.keys(this.uniforms).forEach(e=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:s=>this.uniforms[e].value=s}))}}const q=c.forwardRef(({buffer:m,transmissionSampler:t=!1,backside:r=!1,side:e=B,transmission:s=1,thickness:h=0,backsideThickness:v=0,backsideEnvMapIntensity:f=1,samples:l=10,resolution:u,backsideResolution:x,background:d,anisotropy:T,anisotropicBlur:g,...D},R)=>{O({MeshTransmissionMaterial:Y});const i=c.useRef(null),[_]=c.useState(()=>new Q),M=w(x||u),p=w(u);let S,C,y,a;return b(o=>{i.current.time=o.clock.getElapsedTime(),i.current.buffer===p.texture&&!t&&(a=i.current.__r3f.parent,a&&(y=o.gl.toneMapping,S=o.scene.background,C=i.current.envMapIntensity,o.gl.toneMapping=E,d&&(o.scene.background=d),a.material=_,r&&(o.gl.setRenderTarget(M),o.gl.render(o.scene,o.camera),a.material=i.current,a.material.buffer=M.texture,a.material.thickness=v,a.material.side=F,a.material.envMapIntensity=f),o.gl.setRenderTarget(p),o.gl.render(o.scene,o.camera),a.material=i.current,a.material.thickness=h,a.material.side=e,a.material.buffer=p.texture,a.material.envMapIntensity=C,o.scene.background=S,o.gl.setRenderTarget(null),o.gl.toneMapping=y))}),c.useImperativeHandle(R,()=>i.current,[]),c.createElement("meshTransmissionMaterial",U({args:[l,t],ref:i},D,{buffer:m||p.texture,_transmission:s,anisotropicBlur:g??T,transmission:t?s:0,thickness:h,side:e}))}),J="https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize_tileset.json";function Z(m){const t=c.useRef();return b(()=>{const r=t.current;r.rotation.x=Math.sin(window.performance.now()*5e-4)*2,r.rotation.y=Math.cos(window.performance.now()*.0015)}),n.jsxs("mesh",{...m,ref:t,children:[n.jsx("icosahedronGeometry",{}),n.jsx(q,{thickness:1.5,chromaticAberration:.25,color:8445674})]})}function ee(){return n.jsxs(N,{camera:{position:[12,7.5,12]},style:{width:"100%",height:"100%",position:"absolute",margin:0,left:0,top:0},children:[n.jsx("group",{"rotation-x":Math.PI/2,children:n.jsxs(G,{url:J,children:[n.jsx(L,{plugin:$,fadeDuration:500}),n.jsx(Z,{position:[0,-4,-4],scale:2})]})}),n.jsx(V,{enableDamping:!0,maxDistance:50}),n.jsx(K,{preset:"sunset",background:!0,backgroundBlurriness:.9,environmentIntensity:1}),n.jsx(H,{alignment:"bottom-right",children:n.jsx(W,{})})]})}P(document.getElementById("root")).render(n.jsx(c.StrictMode,{children:n.jsx(ee,{})})); diff --git a/example/bundle/assets/cmptExample-DljP8JLt.js b/example/bundle/assets/cmptExample-DljP8JLt.js new file mode 100644 index 00000000..ecc035c7 --- /dev/null +++ b/example/bundle/assets/cmptExample-DljP8JLt.js @@ -0,0 +1 @@ +import{S as m,W as c,P as l,a as p,D as f,A as h}from"./three.module-_fL2BuBc.js";import{O as u}from"./OrbitControls-Ck5AM9Mk.js";import{C as g}from"./CMPTLoader-DW6cWF_V.js";import"./LoaderBase-CVSPpjX2.js";import"./readMagicBytes-Da5ueiou.js";import"./B3DMLoader-s-i-FwTx.js";import"./GLTFLoader-CFm4138C.js";import"./PNTSLoader-ClFH5U_K.js";import"./I3DMLoader-QCOT_FZM.js";import"./Ellipsoid-CKpUFSOi.js";let n,o,a,e,i;P();d();function P(){a=new m,e=new c({antialias:!0}),e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),e.setClearColor(1383455),e.shadowMap.enabled=!0,e.shadowMap.type=l,document.body.appendChild(e.domElement),n=new p(60,window.innerWidth/window.innerHeight,1,4e3),n.position.set(400,400,400),o=new u(n,e.domElement),o.screenSpacePanning=!1,o.minDistance=1,o.maxDistance=2e3,i=new f(16777215,1.25),i.position.set(1,2,3).multiplyScalar(40),i.castShadow=!0,i.shadow.bias=-.01,i.shadow.mapSize.setScalar(2048);const t=i.shadow.camera;t.left=-200,t.bottom=-200,t.right=200,t.top=200,t.updateProjectionMatrix(),a.add(i);const s=new h(16777215,.05);a.add(s),new g().loadAsync("...").then(w=>{console.log(w)}),r(),window.addEventListener("resize",r,!1)}function r(){n.aspect=window.innerWidth/window.innerHeight,e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),n.updateProjectionMatrix()}function d(){requestAnimationFrame(d),S()}function S(){e.render(a,n)} diff --git a/example/bundle/assets/customMaterial-BO0ErFgn.js b/example/bundle/assets/customMaterial-BO0ErFgn.js new file mode 100644 index 00000000..7544a3ff --- /dev/null +++ b/example/bundle/assets/customMaterial-BO0ErFgn.js @@ -0,0 +1,70 @@ +import{S as k,W as F,P as L,a as R,O as z,D as E,A as T,G as W,M as I,b as v,B as V,d as G}from"./three.module-_fL2BuBc.js";import{O as H}from"./OrbitControls-Ck5AM9Mk.js";import{g as A}from"./lil-gui.module.min-Bc0DeA9g.js";import{S as D}from"./stats.module--VATS4Kh.js";import{T as N}from"./TilesRenderer-DkGmB3Pz.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";let n,c,p,o,t,a,m,h,f,d,s,w;const g=0,x=1,y=2,S=3,l={material:g,orthographic:!1,rebuild:M},O={vertexShader:` + varying vec3 wPosition; + void main() { + + #include + #include + wPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz; + + } + `,fragmentShader:` + varying vec3 wPosition; + void main() { + + float minVal = - 30.0; + float maxVal = 30.0; + + float val = ( wPosition.y - minVal ) / ( maxVal - minVal ); + + vec4 color1 = vec4( 0.149, 0.196, 0.219, 1.0 ) * 0.5; + vec4 color2 = vec4( 1.0 ); + + gl_FragColor = mix( color1, color2, val ); + + } + `},_={extensions:{derivatives:!0},vertexShader:` + varying vec3 wPosition; + varying vec3 vViewPosition; + void main() { + + #include + #include + wPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz; + vViewPosition = - mvPosition.xyz; + + } + `,fragmentShader:` + varying vec3 wPosition; + varying vec3 vViewPosition; + void main() { + + // lighting + vec3 fdx = vec3( dFdx( wPosition.x ), dFdx( wPosition.y ), dFdx( wPosition.z ) ); + vec3 fdy = vec3( dFdy( wPosition.x ), dFdy( wPosition.y ), dFdy( wPosition.z ) ); + vec3 worldNormal = normalize( cross( fdx, fdy ) ); + + float lighting = + 0.4 + + clamp( dot( worldNormal, vec3( 1.0, 1.0, 1.0 ) ), 0.0, 1.0 ) * 0.5 + + clamp( dot( worldNormal, vec3( - 1.0, 1.0, - 1.0 ) ), 0.0, 1.0 ) * 0.3; + + // thickness scale + float upwardness = dot( worldNormal, vec3( 0.0, 1.0, 0.0 ) ); + float yInv = clamp( 1.0 - abs( upwardness ), 0.0, 1.0 ); + float thicknessScale = pow( yInv, 0.4 ); + thicknessScale *= 0.25 + 0.5 * ( vViewPosition.z + 1.0 ) / 2.0; + + // thickness + float thickness = 0.01 * thicknessScale; + float thickness2 = thickness / 2.0; + float m = mod( wPosition.y, 3.0 ); + + // soften edge + float center = thickness2; + float dist = clamp( abs( m - thickness2 ) / thickness2, 0.0, 1.0 ); + + vec4 topoColor = vec4( 0.149, 0.196, 0.219, 1.0 ) * 0.5; + gl_FragColor = mix( topoColor * lighting, vec4( lighting ), dist ); + + } + `};$();b();function P(i){const r=parseFloat(l.material);i.traverse(e=>{if(e.isMesh)switch(e.material.dispose(),r){case g:e.material=e.originalMaterial,e.material.side=2,e.receiveShadow=!1,e.castShadow=!1;break;case x:e.material=new v(O),e.material.side=2,e.receiveShadow=!1,e.castShadow=!1;break;case y:e.material=new v(_),e.material.side=2,e.material.flatShading=!0,e.receiveShadow=!1,e.castShadow=!1;break;case S:e.material=new I,e.material.side=2,e.receiveShadow=!0,e.castShadow=!0}})}function j({scene:i}){i.traverse(r=>{r.isMesh&&(r.originalMaterial=r.material)}),P(i)}function B({scene:i}){i.traverse(r=>{r.isMesh&&r.material.dispose()})}function M(){t&&(t.group.parent.remove(t.group),t.dispose());const i=window.location.hash.replace(/^#/,"")||"../data/tileset.json";t=new N(i),t.errorTarget=2,t.addEventListener("load-model",j),t.addEventListener("dispose-model",B),m.add(t.group)}function $(){p=new k,o=new F({antialias:!0}),o.setPixelRatio(window.devicePixelRatio),o.setSize(window.innerWidth,window.innerHeight),o.setClearColor(1383455),o.shadowMap.enabled=!0,o.shadowMap.type=L,document.body.appendChild(o.domElement),n=new R(60,window.innerWidth/window.innerHeight,1,4e3),n.position.set(400,400,400),a=new z,c=new H(n,o.domElement),c.screenSpacePanning=!1,c.minDistance=1,c.maxDistance=2e3,d=new E(16777215,1.25),d.position.set(1,2,3).multiplyScalar(40),d.castShadow=!0,d.shadow.bias=-.01,d.shadow.mapSize.setScalar(2048);const i=d.shadow.camera;i.left=-200,i.bottom=-200,i.right=200,i.top=200,i.updateProjectionMatrix(),p.add(d);const r=new T(16777215,.05);p.add(r),h=new V,f=new G,m=new W,p.add(m),M(),u(),window.addEventListener("resize",u,!1);const e=new A;e.width=300,e.add(l,"orthographic"),e.add(l,"material",{DEFAULT:g,GRADIENT:x,TOPOGRAPHIC_LINES:y,LIGHTING:S}).onChange(()=>{t.forEachLoadedModel(P)}),e.add(l,"rebuild"),e.open(),w=new D,w.showPanel(0),document.body.appendChild(w.dom),s=document.createElement("div"),s.style.position="absolute",s.style.top=0,s.style.left=0,s.style.color="white",s.style.width="100%",s.style.textAlign="center",s.style.padding="5px",s.style.pointerEvents="none",s.style.lineHeight="1.5em",document.body.appendChild(s)}function u(){n.aspect=window.innerWidth/window.innerHeight,o.setPixelRatio(window.devicePixelRatio),o.setSize(window.innerWidth,window.innerHeight),n.updateProjectionMatrix(),C()}function C(){a.position.copy(n.position),a.rotation.copy(n.rotation);const i=n.position.distanceTo(c.target)/2,r=window.innerWidth/window.innerHeight;a.left=-r*i,a.right=r*i,a.bottom=-i,a.top=i,a.near=n.near,a.far=n.far,a.updateProjectionMatrix()}function b(){requestAnimationFrame(b),l.orthographic?(t.deleteCamera(n),t.setCamera(a),t.setResolutionFromRenderer(a,o)):(t.deleteCamera(a),t.setCamera(n),t.setResolutionFromRenderer(n,o)),m.rotation.set(0,0,0),l.up==="-Z"&&(m.rotation.x=Math.PI/2),m.updateMatrixWorld(!0),t.getBoundingBox(h)?(h.getCenter(t.group.position),t.group.position.multiplyScalar(-1)):t.getBoundingSphere(f)&&(t.group.position.copy(f.center),t.group.position.multiplyScalar(-1)),window.tiles=t,n.updateMatrixWorld(),a.updateMatrixWorld(),t.update(),q(),w.update()}function q(){C(),s.innerText=`Geometries: ${o.info.memory.geometries} Textures: ${o.info.memory.textures} Programs: ${o.info.programs.length} `,o.render(p,l.orthographic?a:n)} diff --git a/example/bundle/assets/ellipsoid-ClBaMkIj.js b/example/bundle/assets/ellipsoid-ClBaMkIj.js new file mode 100644 index 00000000..b3c7b468 --- /dev/null +++ b/example/bundle/assets/ellipsoid-ClBaMkIj.js @@ -0,0 +1 @@ +import{S as C,W as M,a as E,G as x,e as S,d as v,f as B,B as I,D as L,A as W,g as G,h as z}from"./three.module-_fL2BuBc.js";import{E as y,a as F,S as O}from"./EllipsoidRegionHelper-B2BBEUen.js";import{O as A}from"./OrbitControls-Ck5AM9Mk.js";import{g as D}from"./lil-gui.module.min-Bc0DeA9g.js";import"./EllipsoidRegion-CVV0HJli.js";import"./Ellipsoid-CKpUFSOi.js";let l,w,p,o,r,P,c,u,e,g,f,a;const t=[];let m;const s={displaySphereHelper:!1,displayBoxHelper:!1,displayPoints:!1};q();b();function q(){p=new C,o=new M({antialias:!0}),o.setPixelRatio(window.devicePixelRatio),o.setSize(window.innerWidth,window.innerHeight),o.setClearColor(1383455),o.shadowMap.enabled=!0,document.body.appendChild(o.domElement),l=new E(60,window.innerWidth/window.innerHeight,.1,100),l.position.set(3,1.5,1),r=new x,r.rotation.x=-Math.PI/2,p.add(r),m=new x,r.add(m),e=new y,e.material=new S({polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),e.ellipsoidRegion.radius.z=.95,e.ellipsoidRegion.heightStart=-.05,e.ellipsoidRegion.heightEnd=.05,e.ellipsoidRegion.latStart=0,e.ellipsoidRegion.latEnd=Math.PI/4,e.ellipsoidRegion.lonStart=0,e.ellipsoidRegion.lonEnd=Math.PI/4,g=new y,g.material=new S({opacity:.1,transparent:!0,depthWrite:!1}),f=new F(e.ellipsoidRegion),f.material.color.set(1383455).convertSRGBToLinear(),c=new O(new v),a=new x,u=new B(new I),a.add(u),r.add(e,g,f,c,a),n(),w=new A(l,o.domElement),w.screenSpacePanning=!1,w.minDistance=1,w.maxDistance=2e3,P=new L(16777215,1.25),P.position.set(1,2,3).multiplyScalar(40),p.add(P);const h=new W(16777215,.15);p.add(h);const i=new D;i.add(s,"displayBoxHelper"),i.add(s,"displaySphereHelper"),i.add(s,"displayPoints");const R=i.addFolder("radius");R.add(e.ellipsoidRegion.radius,"x",.1,2).onChange(n),R.add(e.ellipsoidRegion.radius,"y",.1,2).onChange(n),R.add(e.ellipsoidRegion.radius,"z",.1,2).onChange(n);const d=i.addFolder("region");d.add(e.ellipsoidRegion,"latStart",-Math.PI/2,Math.PI/2).onChange(n),d.add(e.ellipsoidRegion,"latEnd",-Math.PI/2,Math.PI/2).onChange(n),d.add(e.ellipsoidRegion,"lonStart",0,2*Math.PI).onChange(n),d.add(e.ellipsoidRegion,"lonEnd",0,2*Math.PI).onChange(n),d.add(e.ellipsoidRegion,"heightStart",-.25,.25).onChange(n),d.add(e.ellipsoidRegion,"heightEnd",-.25,.25).onChange(n),H(),window.addEventListener("resize",H,!1)}function n(){g.ellipsoidRegion.radius.copy(e.ellipsoidRegion.radius),e.update(),g.update(),f.update(),e.ellipsoidRegion.getBoundingSphere(c.sphere),e.ellipsoidRegion.getBoundingBox(u.box,a.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale);const h=e.ellipsoidRegion._getPoints();t.forEach(i=>i.visible=!1);for(let i=0;ii[u]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function $u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cv={exports:{}},bu={},Pv={exports:{}},oe={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yi=Symbol.for("react.element"),gy=Symbol.for("react.portal"),yy=Symbol.for("react.fragment"),Sy=Symbol.for("react.strict_mode"),wy=Symbol.for("react.profiler"),ky=Symbol.for("react.provider"),Ey=Symbol.for("react.context"),_y=Symbol.for("react.forward_ref"),xy=Symbol.for("react.suspense"),Cy=Symbol.for("react.memo"),Py=Symbol.for("react.lazy"),Gp=Symbol.iterator;function zy(e){return e===null||typeof e!="object"?null:(e=Gp&&e[Gp]||e["@@iterator"],typeof e=="function"?e:null)}var zv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nv=Object.assign,Rv={};function Ol(e,n,r){this.props=e,this.context=n,this.refs=Rv,this.updater=r||zv}Ol.prototype.isReactComponent={};Ol.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};Ol.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Lv(){}Lv.prototype=Ol.prototype;function lf(e,n,r){this.props=e,this.context=n,this.refs=Rv,this.updater=r||zv}var of=lf.prototype=new Lv;of.constructor=lf;Nv(of,Ol.prototype);of.isPureReactComponent=!0;var Yp=Array.isArray,Tv=Object.prototype.hasOwnProperty,uf={current:null},Mv={key:!0,ref:!0,__self:!0,__source:!0};function Ov(e,n,r){var i,u={},a=null,f=null;if(n!=null)for(i in n.ref!==void 0&&(f=n.ref),n.key!==void 0&&(a=""+n.key),n)Tv.call(n,i)&&!Mv.hasOwnProperty(i)&&(u[i]=n[i]);var p=arguments.length-2;if(p===1)u.children=r;else if(1>>1,ee=L[Y];if(0>>1;Yu(Je,j))Aeu(Fn,Je)?(L[Y]=Fn,L[Ae]=j,Y=Ae):(L[Y]=Je,L[Ne]=j,Y=Ne);else if(Aeu(Fn,j))L[Y]=Fn,L[Ae]=j,Y=Ae;else break e}}return U}function u(L,U){var j=L.sortIndex-U.sortIndex;return j!==0?j:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var f=Date,p=f.now();e.unstable_now=function(){return f.now()-p}}var m=[],S=[],h=1,v=null,w=3,x=!1,C=!1,N=!1,I=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(L){for(var U=r(S);U!==null;){if(U.callback===null)i(S);else if(U.startTime<=L)i(S),U.sortIndex=U.expirationTime,n(m,U);else break;U=r(S)}}function z(L){if(N=!1,E(L),!C)if(r(m)!==null)C=!0,Ke(O);else{var U=r(S);U!==null&&mn(z,U.startTime-L)}}function O(L,U){C=!1,N&&(N=!1,g(W),W=-1),x=!0;var j=w;try{for(E(U),v=r(m);v!==null&&(!(v.expirationTime>U)||L&&!V());){var Y=v.callback;if(typeof Y=="function"){v.callback=null,w=v.priorityLevel;var ee=Y(v.expirationTime<=U);U=e.unstable_now(),typeof ee=="function"?v.callback=ee:v===r(m)&&i(m),E(U)}else i(m);v=r(m)}if(v!==null)var ue=!0;else{var Ne=r(S);Ne!==null&&mn(z,Ne.startTime-U),ue=!1}return ue}finally{v=null,w=j,x=!1}}var D=!1,H=null,W=-1,$=5,G=-1;function V(){return!(e.unstable_now()-G<$)}function ie(){if(H!==null){var L=e.unstable_now();G=L;var U=!0;try{U=H(!0,L)}finally{U?me():(D=!1,H=null)}}else D=!1}var me;if(typeof y=="function")me=function(){y(ie)};else if(typeof MessageChannel<"u"){var pn=new MessageChannel,Cn=pn.port2;pn.port1.onmessage=ie,me=function(){Cn.postMessage(null)}}else me=function(){I(ie,0)};function Ke(L){H=L,D||(D=!0,me())}function mn(L,U){W=I(function(){L(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){C||x||(C=!0,Ke(O))},e.unstable_forceFrameRate=function(L){0>L||125Y?(L.sortIndex=j,n(S,L),r(m)===null&&L===r(S)&&(N?(g(W),W=-1):N=!0,mn(z,j-Y))):(L.sortIndex=ee,n(m,L),C||x||(C=!0,Ke(O))),L},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(L){var U=w;return function(){var j=w;w=U;try{return L.apply(this,arguments)}finally{w=j}}}})(Uv);Fv.exports=Uv;var Ay=Fv.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Hy=F,In=Ay;function A(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=Object.prototype.hasOwnProperty,By=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Zp={},Jp={};function Wy(e){return sc.call(Jp,e)?!0:sc.call(Zp,e)?!1:By.test(e)?Jp[e]=!0:(Zp[e]=!0,!1)}function Qy(e,n,r,i){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Vy(e,n,r,i){if(n===null||typeof n>"u"||Qy(e,n,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function dn(e,n,r,i,u,a,f){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=f}var Ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ze[e]=new dn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];Ze[n]=new dn(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ze[e]=new dn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ze[e]=new dn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ze[e]=new dn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ze[e]=new dn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ze[e]=new dn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ze[e]=new dn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ze[e]=new dn(e,5,!1,e.toLowerCase(),null,!1,!1)});var af=/[\-:]([a-z])/g;function cf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(af,cf);Ze[n]=new dn(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(af,cf);Ze[n]=new dn(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(af,cf);Ze[n]=new dn(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ze[e]=new dn(e,1,!1,e.toLowerCase(),null,!1,!1)});Ze.xlinkHref=new dn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ze[e]=new dn(e,1,!1,e.toLowerCase(),null,!0,!0)});function ff(e,n,r,i){var u=Ze.hasOwnProperty(n)?Ze[n]:null;(u!==null?u.type!==0:i||!(2p||u[f]!==a[p]){var m=` +`+u[f].replace(" at new "," at ");return e.displayName&&m.includes("")&&(m=m.replace("",e.displayName)),m}while(1<=f&&0<=p);break}}}finally{La=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?hi(e):""}function Ky(e){switch(e.tag){case 5:return hi(e.type);case 16:return hi("Lazy");case 13:return hi("Suspense");case 19:return hi("SuspenseList");case 0:case 2:case 15:return e=Ta(e.type,!1),e;case 11:return e=Ta(e.type.render,!1),e;case 1:return e=Ta(e.type,!0),e;default:return""}}function dc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ul:return"Fragment";case ol:return"Portal";case ac:return"Profiler";case df:return"StrictMode";case cc:return"Suspense";case fc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bv:return(e.displayName||"Context")+".Consumer";case Hv:return(e._context.displayName||"Context")+".Provider";case pf:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mf:return n=e.displayName||null,n!==null?n:dc(e.type)||"Memo";case Xt:n=e._payload,e=e._init;try{return dc(e(n))}catch{}}return null}function Gy(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dc(n);case 8:return n===df?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qv(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Yy(e){var n=Qv(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),i=""+e[n];if(!e.hasOwnProperty(n)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,a=r.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(f){i=""+f,a.call(this,f)}}),Object.defineProperty(e,n,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(f){i=""+f},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function $o(e){e._valueTracker||(e._valueTracker=Yy(e))}function Vv(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),i="";return e&&(i=Qv(e)?e.checked?"true":"false":e.value),e=i,e!==r?(n.setValue(e),!0):!1}function Nu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function pc(e,n){var r=n.checked;return ze({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function $p(e,n){var r=n.defaultValue==null?"":n.defaultValue,i=n.checked!=null?n.checked:n.defaultChecked;r=sr(n.value!=null?n.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Kv(e,n){n=n.checked,n!=null&&ff(e,"checked",n,!1)}function mc(e,n){Kv(e,n);var r=sr(n.value),i=n.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?vc(e,n.type,r):n.hasOwnProperty("defaultValue")&&vc(e,n.type,sr(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function bp(e,n,r){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var i=n.type;if(!(i!=="submit"&&i!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,r||n===e.value||(e.value=n),e.defaultValue=n}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function vc(e,n,r){(n!=="number"||Nu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var gi=Array.isArray;function Sl(e,n,r,i){if(e=e.options,n){n={};for(var u=0;u"+n.valueOf().toString()+"",n=bo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Li(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var wi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xy=["Webkit","ms","Moz","O"];Object.keys(wi).forEach(function(e){Xy.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),wi[n]=wi[e]})});function Zv(e,n,r){return n==null||typeof n=="boolean"||n===""?"":r||typeof n!="number"||n===0||wi.hasOwnProperty(e)&&wi[e]?(""+n).trim():n+"px"}function Jv(e,n){e=e.style;for(var r in n)if(n.hasOwnProperty(r)){var i=r.indexOf("--")===0,u=Zv(r,n[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,u):e[r]=u}}var Zy=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yc(e,n){if(n){if(Zy[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(A(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(A(61))}if(n.style!=null&&typeof n.style!="object")throw Error(A(62))}}function Sc(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wc=null;function vf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kc=null,wl=null,kl=null;function tm(e){if(e=Ji(e)){if(typeof kc!="function")throw Error(A(280));var n=e.stateNode;n&&(n=ls(n),kc(e.stateNode,e.type,n))}}function qv(e){wl?kl?kl.push(e):kl=[e]:wl=e}function $v(){if(wl){var e=wl,n=kl;if(kl=wl=null,tm(e),n)for(e=0;e>>=0,e===0?32:31-(oS(e)/uS|0)|0}var eu=64,nu=4194304;function yi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mu(e,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,u=e.suspendedLanes,a=e.pingedLanes,f=r&268435455;if(f!==0){var p=f&~u;p!==0?i=yi(p):(a&=f,a!==0&&(i=yi(a)))}else f=r&~u,f!==0?i=yi(f):a!==0&&(i=yi(a));if(i===0)return 0;if(n!==0&&n!==i&&!(n&u)&&(u=i&-i,a=n&-n,u>=a||u===16&&(a&4194240)!==0))return n;if(i&4&&(i|=r&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=i;0r;r++)n.push(e);return n}function Xi(e,n,r){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-ot(n),e[n]=r}function fS(e,n){var r=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=Ei),fm=" ",dm=!1;function yh(e,n){switch(e){case"keyup":return AS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sl=!1;function BS(e,n){switch(e){case"compositionend":return Sh(n);case"keypress":return n.which!==32?null:(dm=!0,fm);case"textInput":return e=n.data,e===fm&&dm?null:e;default:return null}}function WS(e,n){if(sl)return e==="compositionend"||!_f&&yh(e,n)?(e=hh(),yu=wf=$t=null,sl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hm(r)}}function _h(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?_h(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function xh(){for(var e=window,n=Nu();n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Nu(e.document)}return n}function xf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function qS(e){var n=xh(),r=e.focusedElem,i=e.selectionRange;if(n!==r&&r&&r.ownerDocument&&_h(r.ownerDocument.documentElement,r)){if(i!==null&&xf(r)){if(n=i.start,e=i.end,e===void 0&&(e=n),"selectionStart"in r)r.selectionStart=n,r.selectionEnd=Math.min(e,r.value.length);else if(e=(n=r.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var u=r.textContent.length,a=Math.min(i.start,u);i=i.end===void 0?a:Math.min(i.end,u),!e.extend&&a>i&&(u=i,i=a,a=u),u=gm(r,a);var f=gm(r,i);u&&f&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==f.node||e.focusOffset!==f.offset)&&(n=n.createRange(),n.setStart(u.node,u.offset),e.removeAllRanges(),a>i?(e.addRange(n),e.extend(f.node,f.offset)):(n.setEnd(f.node,f.offset),e.addRange(n)))}}for(n=[],e=r;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,al=null,zc=null,xi=null,Nc=!1;function ym(e,n,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Nc||al==null||al!==Nu(i)||(i=al,"selectionStart"in i&&xf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),xi&&ji(xi,i)||(xi=i,i=Du(zc,"onSelect"),0dl||(e.current=Ic[dl],Ic[dl]=null,dl--)}function ge(e,n){dl++,Ic[dl]=e.current,e.current=n}var ar={},on=fr(ar),En=fr(!1),Or=ar;function Pl(e,n){var r=e.type.contextTypes;if(!r)return ar;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===n)return i.__reactInternalMemoizedMaskedChildContext;var u={},a;for(a in r)u[a]=n[a];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=u),u}function _n(e){return e=e.childContextTypes,e!=null}function Fu(){we(En),we(on)}function Cm(e,n,r){if(on.current!==ar)throw Error(A(168));ge(on,n),ge(En,r)}function Oh(e,n,r){var i=e.stateNode;if(n=n.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var u in i)if(!(u in n))throw Error(A(108,Gy(e)||"Unknown",u));return ze({},r,i)}function Uu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ar,Or=on.current,ge(on,e),ge(En,En.current),!0}function Pm(e,n,r){var i=e.stateNode;if(!i)throw Error(A(169));r?(e=Oh(e,n,Or),i.__reactInternalMemoizedMergedChildContext=e,we(En),we(on),ge(on,e)):we(En),ge(En,r)}var Nt=null,is=!1,Ka=!1;function Ih(e){Nt===null?Nt=[e]:Nt.push(e)}function aw(e){is=!0,Ih(e)}function dr(){if(!Ka&&Nt!==null){Ka=!0;var e=0,n=de;try{var r=Nt;for(de=1;e>=f,u-=f,Rt=1<<32-ot(n)+u|r<W?($=H,H=null):$=H.sibling;var G=w(g,H,E[W],z);if(G===null){H===null&&(H=$);break}e&&H&&G.alternate===null&&n(g,H),y=a(G,y,W),D===null?O=G:D.sibling=G,D=G,H=$}if(W===E.length)return r(g,H),_e&&_r(g,W),O;if(H===null){for(;WW?($=H,H=null):$=H.sibling;var V=w(g,H,G.value,z);if(V===null){H===null&&(H=$);break}e&&H&&V.alternate===null&&n(g,H),y=a(V,y,W),D===null?O=V:D.sibling=V,D=V,H=$}if(G.done)return r(g,H),_e&&_r(g,W),O;if(H===null){for(;!G.done;W++,G=E.next())G=v(g,G.value,z),G!==null&&(y=a(G,y,W),D===null?O=G:D.sibling=G,D=G);return _e&&_r(g,W),O}for(H=i(g,H);!G.done;W++,G=E.next())G=x(H,g,W,G.value,z),G!==null&&(e&&G.alternate!==null&&H.delete(G.key===null?W:G.key),y=a(G,y,W),D===null?O=G:D.sibling=G,D=G);return e&&H.forEach(function(ie){return n(g,ie)}),_e&&_r(g,W),O}function I(g,y,E,z){if(typeof E=="object"&&E!==null&&E.type===ul&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case qo:e:{for(var O=E.key,D=y;D!==null;){if(D.key===O){if(O=E.type,O===ul){if(D.tag===7){r(g,D.sibling),y=u(D,E.props.children),y.return=g,g=y;break e}}else if(D.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===Xt&&Rm(O)===D.type){r(g,D.sibling),y=u(D,E.props),y.ref=fi(g,D,E),y.return=g,g=y;break e}r(g,D);break}else n(g,D);D=D.sibling}E.type===ul?(y=Mr(E.props.children,g.mode,z,E.key),y.return=g,g=y):(z=Pu(E.type,E.key,E.props,null,g.mode,z),z.ref=fi(g,y,E),z.return=g,g=z)}return f(g);case ol:e:{for(D=E.key;y!==null;){if(y.key===D)if(y.tag===4&&y.stateNode.containerInfo===E.containerInfo&&y.stateNode.implementation===E.implementation){r(g,y.sibling),y=u(y,E.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else n(g,y);y=y.sibling}y=ba(E,g.mode,z),y.return=g,g=y}return f(g);case Xt:return D=E._init,I(g,y,D(E._payload),z)}if(gi(E))return C(g,y,E,z);if(oi(E))return N(g,y,E,z);su(g,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,y!==null&&y.tag===6?(r(g,y.sibling),y=u(y,E),y.return=g,g=y):(r(g,y),y=$a(E,g.mode,z),y.return=g,g=y),f(g)):r(g,y)}return I}var Nl=Uh(!0),Ah=Uh(!1),Bu=fr(null),Wu=null,vl=null,Nf=null;function Rf(){Nf=vl=Wu=null}function Lf(e){var n=Bu.current;we(Bu),e._currentValue=n}function Fc(e,n,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===r)break;e=e.return}}function _l(e,n){Wu=e,Nf=vl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(kn=!0),e.firstContext=null)}function Jn(e){var n=e._currentValue;if(Nf!==e)if(e={context:e,memoizedValue:n,next:null},vl===null){if(Wu===null)throw Error(A(308));vl=e,Wu.dependencies={lanes:0,firstContext:e}}else vl=vl.next=e;return n}var Nr=null;function Tf(e){Nr===null?Nr=[e]:Nr.push(e)}function Hh(e,n,r,i){var u=n.interleaved;return u===null?(r.next=r,Tf(n)):(r.next=u.next,u.next=r),n.interleaved=r,It(e,i)}function It(e,n){e.lanes|=n;var r=e.alternate;for(r!==null&&(r.lanes|=n),r=e,e=e.return;e!==null;)e.childLanes|=n,r=e.alternate,r!==null&&(r.childLanes|=n),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Zt=!1;function Mf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bh(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tt(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function lr(e,n,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,se&2){var u=i.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),i.pending=n,It(e,r)}return u=i.interleaved,u===null?(n.next=n,Tf(i)):(n.next=u.next,u.next=n),i.interleaved=n,It(e,r)}function wu(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194240)!==0)){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,gf(e,r)}}function Lm(e,n){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var u=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var f={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?u=a=f:a=a.next=f,r=r.next}while(r!==null);a===null?u=a=n:a=a.next=n}else u=a=n;r={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:a,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}function Qu(e,n,r,i){var u=e.updateQueue;Zt=!1;var a=u.firstBaseUpdate,f=u.lastBaseUpdate,p=u.shared.pending;if(p!==null){u.shared.pending=null;var m=p,S=m.next;m.next=null,f===null?a=S:f.next=S,f=m;var h=e.alternate;h!==null&&(h=h.updateQueue,p=h.lastBaseUpdate,p!==f&&(p===null?h.firstBaseUpdate=S:p.next=S,h.lastBaseUpdate=m))}if(a!==null){var v=u.baseState;f=0,h=S=m=null,p=a;do{var w=p.lane,x=p.eventTime;if((i&w)===w){h!==null&&(h=h.next={eventTime:x,lane:0,tag:p.tag,payload:p.payload,callback:p.callback,next:null});e:{var C=e,N=p;switch(w=n,x=r,N.tag){case 1:if(C=N.payload,typeof C=="function"){v=C.call(x,v,w);break e}v=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=N.payload,w=typeof C=="function"?C.call(x,v,w):C,w==null)break e;v=ze({},v,w);break e;case 2:Zt=!0}}p.callback!==null&&p.lane!==0&&(e.flags|=64,w=u.effects,w===null?u.effects=[p]:w.push(p))}else x={eventTime:x,lane:w,tag:p.tag,payload:p.payload,callback:p.callback,next:null},h===null?(S=h=x,m=v):h=h.next=x,f|=w;if(p=p.next,p===null){if(p=u.shared.pending,p===null)break;w=p,p=w.next,w.next=null,u.lastBaseUpdate=w,u.shared.pending=null}}while(!0);if(h===null&&(m=v),u.baseState=m,u.firstBaseUpdate=S,u.lastBaseUpdate=h,n=u.shared.interleaved,n!==null){u=n;do f|=u.lane,u=u.next;while(u!==n)}else a===null&&(u.shared.lanes=0);jr|=f,e.lanes=f,e.memoizedState=v}}function Tm(e,n,r){if(e=n.effects,n.effects=null,e!==null)for(n=0;nr?r:4,e(!0);var i=Ya.transition;Ya.transition={};try{e(!1),n()}finally{de=r,Ya.transition=i}}function l0(){return qn().memoizedState}function pw(e,n,r){var i=or(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},i0(e))o0(n,r);else if(r=Hh(e,n,r,i),r!==null){var u=cn();ut(r,e,i,u),u0(r,n,i)}}function mw(e,n,r){var i=or(e),u={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(i0(e))o0(n,u);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=n.lastRenderedReducer,a!==null))try{var f=n.lastRenderedState,p=a(f,r);if(u.hasEagerState=!0,u.eagerState=p,st(p,f)){var m=n.interleaved;m===null?(u.next=u,Tf(n)):(u.next=m.next,m.next=u),n.interleaved=u;return}}catch{}finally{}r=Hh(e,n,u,i),r!==null&&(u=cn(),ut(r,e,i,u),u0(r,n,i))}}function i0(e){var n=e.alternate;return e===Pe||n!==null&&n===Pe}function o0(e,n){Ci=Ku=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function u0(e,n,r){if(r&4194240){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,gf(e,r)}}var Gu={readContext:Jn,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useInsertionEffect:tn,useLayoutEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useMutableSource:tn,useSyncExternalStore:tn,useId:tn,unstable_isNewReconciler:!1},vw={readContext:Jn,useCallback:function(e,n){return gt().memoizedState=[e,n===void 0?null:n],e},useContext:Jn,useEffect:Om,useImperativeHandle:function(e,n,r){return r=r!=null?r.concat([e]):null,Eu(4194308,4,bh.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Eu(4194308,4,e,n)},useInsertionEffect:function(e,n){return Eu(4,2,e,n)},useMemo:function(e,n){var r=gt();return n=n===void 0?null:n,e=e(),r.memoizedState=[e,n],e},useReducer:function(e,n,r){var i=gt();return n=r!==void 0?r(n):n,i.memoizedState=i.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=pw.bind(null,Pe,e),[i.memoizedState,e]},useRef:function(e){var n=gt();return e={current:e},n.memoizedState=e},useState:Mm,useDebugValue:Hf,useDeferredValue:function(e){return gt().memoizedState=e},useTransition:function(){var e=Mm(!1),n=e[0];return e=dw.bind(null,e[1]),gt().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,r){var i=Pe,u=gt();if(_e){if(r===void 0)throw Error(A(407));r=r()}else{if(r=n(),Ve===null)throw Error(A(349));Dr&30||Kh(i,n,r)}u.memoizedState=r;var a={value:r,getSnapshot:n};return u.queue=a,Om(Yh.bind(null,i,a,e),[e]),i.flags|=2048,Vi(9,Gh.bind(null,i,a,r,n),void 0,null),r},useId:function(){var e=gt(),n=Ve.identifierPrefix;if(_e){var r=Lt,i=Rt;r=(i&~(1<<32-ot(i)-1)).toString(32)+r,n=":"+n+"R"+r,r=Wi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=f.createElement(r,{is:i.is}):(e=f.createElement(r),r==="select"&&(f=e,i.multiple?f.multiple=!0:i.size&&(f.size=i.size))):e=f.createElementNS(e,r),e[yt]=n,e[Ai]=i,g0(e,n,!1,!1),n.stateNode=e;e:{switch(f=Sc(r,i),r){case"dialog":Se("cancel",e),Se("close",e),u=i;break;case"iframe":case"object":case"embed":Se("load",e),u=i;break;case"video":case"audio":for(u=0;uTl&&(n.flags|=128,i=!0,di(a,!1),n.lanes=4194304)}else{if(!i)if(e=Vu(f),e!==null){if(n.flags|=128,i=!0,r=e.updateQueue,r!==null&&(n.updateQueue=r,n.flags|=4),di(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!_e)return rn(n),null}else 2*Me()-a.renderingStartTime>Tl&&r!==1073741824&&(n.flags|=128,i=!0,di(a,!1),n.lanes=4194304);a.isBackwards?(f.sibling=n.child,n.child=f):(r=a.last,r!==null?r.sibling=f:n.child=f,a.last=f)}return a.tail!==null?(n=a.tail,a.rendering=n,a.tail=n.sibling,a.renderingStartTime=Me(),n.sibling=null,r=Ce.current,ge(Ce,i?r&1|2:r&1),n):(rn(n),null);case 22:case 23:return Gf(),i=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(n.flags|=8192),i&&n.mode&1?Tn&1073741824&&(rn(n),n.subtreeFlags&6&&(n.flags|=8192)):rn(n),null;case 24:return null;case 25:return null}throw Error(A(156,n.tag))}function _w(e,n){switch(Pf(n),n.tag){case 1:return _n(n.type)&&Fu(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Rl(),we(En),we(on),Df(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return If(n),null;case 13:if(we(Ce),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(A(340));zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return we(Ce),null;case 4:return Rl(),null;case 10:return Lf(n.type._context),null;case 22:case 23:return Gf(),null;case 24:return null;default:return null}}var cu=!1,ln=!1,xw=typeof WeakSet=="function"?WeakSet:Set,X=null;function hl(e,n){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Le(e,n,i)}else r.current=null}function Gc(e,n,r){try{r()}catch(i){Le(e,n,i)}}var Vm=!1;function Cw(e,n){if(Rc=Ou,e=xh(),xf(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var u=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var f=0,p=-1,m=-1,S=0,h=0,v=e,w=null;n:for(;;){for(var x;v!==r||u!==0&&v.nodeType!==3||(p=f+u),v!==a||i!==0&&v.nodeType!==3||(m=f+i),v.nodeType===3&&(f+=v.nodeValue.length),(x=v.firstChild)!==null;)w=v,v=x;for(;;){if(v===e)break n;if(w===r&&++S===u&&(p=f),w===a&&++h===i&&(m=f),(x=v.nextSibling)!==null)break;v=w,w=v.parentNode}v=x}r=p===-1||m===-1?null:{start:p,end:m}}else r=null}r=r||{start:0,end:0}}else r=null;for(Lc={focusedElem:e,selectionRange:r},Ou=!1,X=n;X!==null;)if(n=X,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,X=e;else for(;X!==null;){n=X;try{var C=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var N=C.memoizedProps,I=C.memoizedState,g=n.stateNode,y=g.getSnapshotBeforeUpdate(n.elementType===n.type?N:rt(n.type,N),I);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var E=n.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(z){Le(n,n.return,z)}if(e=n.sibling,e!==null){e.return=n.return,X=e;break}X=n.return}return C=Vm,Vm=!1,C}function Pi(e,n,r){var i=n.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&e)===e){var a=u.destroy;u.destroy=void 0,a!==void 0&&Gc(n,r,a)}u=u.next}while(u!==i)}}function ss(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==n)}}function Yc(e){var n=e.ref;if(n!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof n=="function"?n(e):n.current=e}}function w0(e){var n=e.alternate;n!==null&&(e.alternate=null,w0(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[yt],delete n[Ai],delete n[Oc],delete n[uw],delete n[sw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function k0(e){return e.tag===5||e.tag===3||e.tag===4}function Km(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||k0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,n,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?r.nodeType===8?r.parentNode.insertBefore(e,n):r.insertBefore(e,n):(r.nodeType===8?(n=r.parentNode,n.insertBefore(e,r)):(n=r,n.appendChild(e)),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ju));else if(i!==4&&(e=e.child,e!==null))for(Xc(e,n,r),e=e.sibling;e!==null;)Xc(e,n,r),e=e.sibling}function Zc(e,n,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Zc(e,n,r),e=e.sibling;e!==null;)Zc(e,n,r),e=e.sibling}var Ye=null,lt=!1;function Yt(e,n,r){for(r=r.child;r!==null;)E0(e,n,r),r=r.sibling}function E0(e,n,r){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(es,r)}catch{}switch(r.tag){case 5:ln||hl(r,n);case 6:var i=Ye,u=lt;Ye=null,Yt(e,n,r),Ye=i,lt=u,Ye!==null&&(lt?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(lt?(e=Ye,r=r.stateNode,e.nodeType===8?Va(e.parentNode,r):e.nodeType===1&&Va(e,r),Ii(e)):Va(Ye,r.stateNode));break;case 4:i=Ye,u=lt,Ye=r.stateNode.containerInfo,lt=!0,Yt(e,n,r),Ye=i,lt=u;break;case 0:case 11:case 14:case 15:if(!ln&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var a=u,f=a.destroy;a=a.tag,f!==void 0&&(a&2||a&4)&&Gc(r,n,f),u=u.next}while(u!==i)}Yt(e,n,r);break;case 1:if(!ln&&(hl(r,n),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(p){Le(r,n,p)}Yt(e,n,r);break;case 21:Yt(e,n,r);break;case 22:r.mode&1?(ln=(i=ln)||r.memoizedState!==null,Yt(e,n,r),ln=i):Yt(e,n,r);break;default:Yt(e,n,r)}}function Gm(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new xw),n.forEach(function(i){var u=Iw.bind(null,e,i);r.has(i)||(r.add(i),i.then(u,u))})}}function tt(e,n){var r=n.deletions;if(r!==null)for(var i=0;iu&&(u=f),i&=~a}if(i=u,i=Me()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*zw(i/1960))-i,10e?16:e,bt===null)var i=!1;else{if(e=bt,bt=null,Zu=0,se&6)throw Error(A(331));var u=se;for(se|=4,X=e.current;X!==null;){var a=X,f=a.child;if(X.flags&16){var p=a.deletions;if(p!==null){for(var m=0;mMe()-Vf?Tr(e,0):Qf|=r),xn(e,n)}function L0(e,n){n===0&&(e.mode&1?(n=nu,nu<<=1,!(nu&130023424)&&(nu=4194304)):n=1);var r=cn();e=It(e,n),e!==null&&(Xi(e,n,r),xn(e,r))}function Ow(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),L0(e,r)}function Iw(e,n){var r=0;switch(e.tag){case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(A(314))}i!==null&&i.delete(n),L0(e,r)}var T0;T0=function(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps||En.current)kn=!0;else{if(!(e.lanes&r)&&!(n.flags&128))return kn=!1,kw(e,n,r);kn=!!(e.flags&131072)}else kn=!1,_e&&n.flags&1048576&&Dh(n,Hu,n.index);switch(n.lanes=0,n.tag){case 2:var i=n.type;_u(e,n),e=n.pendingProps;var u=Pl(n,on.current);_l(n,r),u=Ff(null,n,i,e,u,r);var a=Uf();return n.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,_n(i)?(a=!0,Uu(n)):a=!1,n.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Mf(n),u.updater=us,n.stateNode=u,u._reactInternals=n,Ac(n,i,e,r),n=Wc(null,n,i,!0,a,r)):(n.tag=0,_e&&a&&Cf(n),an(null,n,u,r),n=n.child),n;case 16:i=n.elementType;e:{switch(_u(e,n),e=n.pendingProps,u=i._init,i=u(i._payload),n.type=i,u=n.tag=jw(i),e=rt(i,e),u){case 0:n=Bc(null,n,i,e,r);break e;case 1:n=Bm(null,n,i,e,r);break e;case 11:n=Am(null,n,i,e,r);break e;case 14:n=Hm(null,n,i,rt(i.type,e),r);break e}throw Error(A(306,i,""))}return n;case 0:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:rt(i,u),Bc(e,n,i,u,r);case 1:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:rt(i,u),Bm(e,n,i,u,r);case 3:e:{if(m0(n),e===null)throw Error(A(387));i=n.pendingProps,a=n.memoizedState,u=a.element,Bh(e,n),Qu(n,i,null,r);var f=n.memoizedState;if(i=f.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:f.cache,pendingSuspenseBoundaries:f.pendingSuspenseBoundaries,transitions:f.transitions},n.updateQueue.baseState=a,n.memoizedState=a,n.flags&256){u=Ll(Error(A(423)),n),n=Wm(e,n,i,r,u);break e}else if(i!==u){u=Ll(Error(A(424)),n),n=Wm(e,n,i,r,u);break e}else for(Mn=rr(n.stateNode.containerInfo.firstChild),On=n,_e=!0,it=null,r=Ah(n,null,i,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(zl(),i===u){n=Dt(e,n,r);break e}an(e,n,i,r)}n=n.child}return n;case 5:return Wh(n),e===null&&jc(n),i=n.type,u=n.pendingProps,a=e!==null?e.memoizedProps:null,f=u.children,Tc(i,u)?f=null:a!==null&&Tc(i,a)&&(n.flags|=32),p0(e,n),an(e,n,f,r),n.child;case 6:return e===null&&jc(n),null;case 13:return v0(e,n,r);case 4:return Of(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=Nl(n,null,i,r):an(e,n,i,r),n.child;case 11:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:rt(i,u),Am(e,n,i,u,r);case 7:return an(e,n,n.pendingProps,r),n.child;case 8:return an(e,n,n.pendingProps.children,r),n.child;case 12:return an(e,n,n.pendingProps.children,r),n.child;case 10:e:{if(i=n.type._context,u=n.pendingProps,a=n.memoizedProps,f=u.value,ge(Bu,i._currentValue),i._currentValue=f,a!==null)if(st(a.value,f)){if(a.children===u.children&&!En.current){n=Dt(e,n,r);break e}}else for(a=n.child,a!==null&&(a.return=n);a!==null;){var p=a.dependencies;if(p!==null){f=a.child;for(var m=p.firstContext;m!==null;){if(m.context===i){if(a.tag===1){m=Tt(-1,r&-r),m.tag=2;var S=a.updateQueue;if(S!==null){S=S.shared;var h=S.pending;h===null?m.next=m:(m.next=h.next,h.next=m),S.pending=m}}a.lanes|=r,m=a.alternate,m!==null&&(m.lanes|=r),Fc(a.return,r,n),p.lanes|=r;break}m=m.next}}else if(a.tag===10)f=a.type===n.type?null:a.child;else if(a.tag===18){if(f=a.return,f===null)throw Error(A(341));f.lanes|=r,p=f.alternate,p!==null&&(p.lanes|=r),Fc(f,r,n),f=a.sibling}else f=a.child;if(f!==null)f.return=a;else for(f=a;f!==null;){if(f===n){f=null;break}if(a=f.sibling,a!==null){a.return=f.return,f=a;break}f=f.return}a=f}an(e,n,u.children,r),n=n.child}return n;case 9:return u=n.type,i=n.pendingProps.children,_l(n,r),u=Jn(u),i=i(u),n.flags|=1,an(e,n,i,r),n.child;case 14:return i=n.type,u=rt(i,n.pendingProps),u=rt(i.type,u),Hm(e,n,i,u,r);case 15:return f0(e,n,n.type,n.pendingProps,r);case 17:return i=n.type,u=n.pendingProps,u=n.elementType===i?u:rt(i,u),_u(e,n),n.tag=1,_n(i)?(e=!0,Uu(n)):e=!1,_l(n,r),s0(n,i,u),Ac(n,i,u,r),Wc(null,n,i,!0,e,r);case 19:return h0(e,n,r);case 22:return d0(e,n,r)}throw Error(A(156,n.tag))};function M0(e,n){return ih(e,n)}function Dw(e,n,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,n,r,i){return new Dw(e,n,r,i)}function Xf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jw(e){if(typeof e=="function")return Xf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pf)return 11;if(e===mf)return 14}return 2}function ur(e,n){var r=e.alternate;return r===null?(r=Xn(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Pu(e,n,r,i,u,a){var f=2;if(i=e,typeof e=="function")Xf(e)&&(f=1);else if(typeof e=="string")f=5;else e:switch(e){case ul:return Mr(r.children,u,a,n);case df:f=8,u|=8;break;case ac:return e=Xn(12,r,n,u|2),e.elementType=ac,e.lanes=a,e;case cc:return e=Xn(13,r,n,u),e.elementType=cc,e.lanes=a,e;case fc:return e=Xn(19,r,n,u),e.elementType=fc,e.lanes=a,e;case Wv:return cs(r,u,a,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Hv:f=10;break e;case Bv:f=9;break e;case pf:f=11;break e;case mf:f=14;break e;case Xt:f=16,i=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return n=Xn(f,r,n,u),n.elementType=e,n.type=i,n.lanes=a,n}function Mr(e,n,r,i){return e=Xn(7,e,i,n),e.lanes=r,e}function cs(e,n,r,i){return e=Xn(22,e,i,n),e.elementType=Wv,e.lanes=r,e.stateNode={isHidden:!1},e}function $a(e,n,r){return e=Xn(6,e,null,n),e.lanes=r,e}function ba(e,n,r){return n=Xn(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Fw(e,n,r,i,u){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Zf(e,n,r,i,u,a,f,p,m){return e=new Fw(e,n,r,p,m),n===1?(n=1,a===!0&&(n|=8)):n=0,a=Xn(3,null,null,n),e.current=a,a.stateNode=e,a.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mf(a),e}function Uw(e,n,r){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j0)}catch(e){console.error(e)}}j0(),jv.exports=Dn;var F0=jv.exports;const Y2=$u(F0);var Qw,ev=F0;Qw=ev.createRoot,ev.hydrateRoot;var U0={exports:{}},Hr={};/** + * @license React + * react-reconciler-constants.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Hr.ConcurrentRoot=1;Hr.ContinuousEventPriority=4;Hr.DefaultEventPriority=16;Hr.DiscreteEventPriority=1;Hr.IdleEventPriority=536870912;Hr.LegacyRoot=0;U0.exports=Hr;var yl=U0.exports;function Vw(e){let n;const r=new Set,i=(S,h)=>{const v=typeof S=="function"?S(n):S;if(v!==n){const w=n;n=h?v:Object.assign({},n,v),r.forEach(x=>x(n,w))}},u=()=>n,a=(S,h=u,v=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let w=h(n);function x(){const C=h(n);if(!v(w,C)){const N=w;S(w=C,N)}}return r.add(x),()=>r.delete(x)},m={setState:i,getState:u,subscribe:(S,h,v)=>h||v?a(S,h,v):(r.add(S),()=>r.delete(S)),destroy:()=>r.clear()};return n=e(i,u,m),m}const Kw=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),nv=Kw?F.useEffect:F.useLayoutEffect;function A0(e){const n=typeof e=="function"?Vw(e):e,r=(i=n.getState,u=Object.is)=>{const[,a]=F.useReducer(I=>I+1,0),f=n.getState(),p=F.useRef(f),m=F.useRef(i),S=F.useRef(u),h=F.useRef(!1),v=F.useRef();v.current===void 0&&(v.current=i(f));let w,x=!1;(p.current!==f||m.current!==i||S.current!==u||h.current)&&(w=i(f),x=!u(v.current,w)),nv(()=>{x&&(v.current=w),p.current=f,m.current=i,S.current=u,h.current=!1});const C=F.useRef(f);nv(()=>{const I=()=>{try{const y=n.getState(),E=m.current(y);S.current(v.current,E)||(p.current=y,v.current=E,a())}catch{h.current=!0,a()}},g=n.subscribe(I);return n.getState()!==C.current&&I(),g},[]);const N=x?w:v.current;return F.useDebugValue(N),N};return Object.assign(r,n),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[r,n];return{next(){const u=i.length<=0;return{value:i.shift(),done:u}}}},r}const Gw=e=>typeof e=="object"&&typeof e.then=="function",Lr=[];function H0(e,n,r=(i,u)=>i===u){if(e===n)return!0;if(!e||!n)return!1;const i=e.length;if(n.length!==i)return!1;for(let u=0;u0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,i.lifespan)),a.response;if(!r)throw a.promise}const u={keys:n,equal:i.equal,remove:()=>{const a=Lr.indexOf(u);a!==-1&&Lr.splice(a,1)},promise:(Gw(e)?e:e(...n)).then(a=>{u.response=a,i.lifespan&&i.lifespan>0&&(u.timeout=setTimeout(u.remove,i.lifespan))}).catch(a=>u.error=a)};if(Lr.push(u),!r)throw u.promise}const Yw=(e,n,r)=>B0(e,n,!1,r),Xw=(e,n,r)=>void B0(e,n,!0,r),Zw=e=>{if(e===void 0||e.length===0)Lr.splice(0,Lr.length);else{const n=Lr.find(r=>H0(e,r.keys,r.equal));n&&n.remove()}};var W0={exports:{}},Q0={exports:{}},V0={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function n(L,U){var j=L.length;L.push(U);e:for(;0>>1,ee=L[Y];if(0>>1;Yu(Je,j))Aeu(Fn,Je)?(L[Y]=Fn,L[Ae]=j,Y=Ae):(L[Y]=Je,L[Ne]=j,Y=Ne);else if(Aeu(Fn,j))L[Y]=Fn,L[Ae]=j,Y=Ae;else break e}}return U}function u(L,U){var j=L.sortIndex-U.sortIndex;return j!==0?j:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var f=Date,p=f.now();e.unstable_now=function(){return f.now()-p}}var m=[],S=[],h=1,v=null,w=3,x=!1,C=!1,N=!1,I=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(L){for(var U=r(S);U!==null;){if(U.callback===null)i(S);else if(U.startTime<=L)i(S),U.sortIndex=U.expirationTime,n(m,U);else break;U=r(S)}}function z(L){if(N=!1,E(L),!C)if(r(m)!==null)C=!0,Ke(O);else{var U=r(S);U!==null&&mn(z,U.startTime-L)}}function O(L,U){C=!1,N&&(N=!1,g(W),W=-1),x=!0;var j=w;try{for(E(U),v=r(m);v!==null&&(!(v.expirationTime>U)||L&&!V());){var Y=v.callback;if(typeof Y=="function"){v.callback=null,w=v.priorityLevel;var ee=Y(v.expirationTime<=U);U=e.unstable_now(),typeof ee=="function"?v.callback=ee:v===r(m)&&i(m),E(U)}else i(m);v=r(m)}if(v!==null)var ue=!0;else{var Ne=r(S);Ne!==null&&mn(z,Ne.startTime-U),ue=!1}return ue}finally{v=null,w=j,x=!1}}var D=!1,H=null,W=-1,$=5,G=-1;function V(){return!(e.unstable_now()-G<$)}function ie(){if(H!==null){var L=e.unstable_now();G=L;var U=!0;try{U=H(!0,L)}finally{U?me():(D=!1,H=null)}}else D=!1}var me;if(typeof y=="function")me=function(){y(ie)};else if(typeof MessageChannel<"u"){var pn=new MessageChannel,Cn=pn.port2;pn.port1.onmessage=ie,me=function(){Cn.postMessage(null)}}else me=function(){I(ie,0)};function Ke(L){H=L,D||(D=!0,me())}function mn(L,U){W=I(function(){L(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){C||x||(C=!0,Ke(O))},e.unstable_forceFrameRate=function(L){0>L||125Y?(L.sortIndex=j,n(S,L),r(m)===null&&L===r(S)&&(N?(g(W),W=-1):N=!0,mn(z,j-Y))):(L.sortIndex=ee,n(m,L),C||x||(C=!0,Ke(O))),L},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(L){var U=w;return function(){var j=w;w=U;try{return L.apply(this,arguments)}finally{w=j}}}})(V0);Q0.exports=V0;var ef=Q0.exports;/** + * @license React + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jw=function(n){var r={},i=F,u=ef,a=Object.assign;function f(t){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+t,o=1;o_||c[k]!==d[_]){var M=` +`+c[k].replace(" at new "," at ");return t.displayName&&M.includes("")&&(M=M.replace("",t.displayName)),M}while(1<=k&&0<=_);break}}}finally{Ss=!1,Error.prepareStackTrace=o}return(t=t?t.displayName||t.name:"")?Hl(t):""}var lg=Object.prototype.hasOwnProperty,ks=[],Br=-1;function Ft(t){return{current:t}}function ye(t){0>Br||(t.current=ks[Br],ks[Br]=null,Br--)}function ve(t,l){Br++,ks[Br]=t.current,t.current=l}var Ut={},qe=Ft(Ut),vn=Ft(!1),pr=Ut;function Wr(t,l){var o=t.type.contextTypes;if(!o)return Ut;var s=t.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===l)return s.__reactInternalMemoizedMaskedChildContext;var c={},d;for(d in o)c[d]=l[d];return s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=l,t.__reactInternalMemoizedMaskedChildContext=c),c}function hn(t){return t=t.childContextTypes,t!=null}function no(){ye(vn),ye(qe)}function fd(t,l,o){if(qe.current!==Ut)throw Error(f(168));ve(qe,l),ve(vn,o)}function dd(t,l,o){var s=t.stateNode;if(l=l.childContextTypes,typeof s.getChildContext!="function")return o;s=s.getChildContext();for(var c in s)if(!(c in l))throw Error(f(108,W(t)||"Unknown",c));return a({},o,s)}function to(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ut,pr=qe.current,ve(qe,t),ve(vn,vn.current),!0}function pd(t,l,o){var s=t.stateNode;if(!s)throw Error(f(169));o?(t=dd(t,l,pr),s.__reactInternalMemoizedMergedChildContext=t,ye(vn),ye(qe),ve(qe,t)):ye(vn),ve(vn,o)}var bn=Math.clz32?Math.clz32:ug,ig=Math.log,og=Math.LN2;function ug(t){return t>>>=0,t===0?32:31-(ig(t)/og|0)|0}var ro=64,lo=4194304;function Bl(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function io(t,l){var o=t.pendingLanes;if(o===0)return 0;var s=0,c=t.suspendedLanes,d=t.pingedLanes,k=o&268435455;if(k!==0){var _=k&~c;_!==0?s=Bl(_):(d&=k,d!==0&&(s=Bl(d)))}else k=o&~c,k!==0?s=Bl(k):d!==0&&(s=Bl(d));if(s===0)return 0;if(l!==0&&l!==s&&!(l&c)&&(c=s&-s,d=l&-l,c>=d||c===16&&(d&4194240)!==0))return l;if(s&4&&(s|=o&16),l=t.entangledLanes,l!==0)for(t=t.entanglements,l&=s;0o;o++)l.push(t);return l}function Wl(t,l,o){t.pendingLanes|=l,l!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,l=31-bn(l),t[l]=o}function cg(t,l){var o=t.pendingLanes&~l;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=l,t.mutableReadLanes&=l,t.entangledLanes&=l,l=t.entanglements;var s=t.eventTimes;for(t=t.expirationTimes;0>=k,c-=k,_t=1<<32-bn(l)+c|o<ce?(We=te,te=null):We=te.sibling;var fe=b(R,te,T[ce],K);if(fe===null){te===null&&(te=We);break}t&&te&&fe.alternate===null&&l(R,te),P=d(fe,P,ce),re===null?J=fe:re.sibling=fe,re=fe,te=We}if(ce===T.length)return o(R,te),ke&&vr(R,ce),J;if(te===null){for(;cece?(We=te,te=null):We=te.sibling;var Gt=b(R,te,fe.value,K);if(Gt===null){te===null&&(te=We);break}t&&te&&Gt.alternate===null&&l(R,te),P=d(Gt,P,ce),re===null?J=Gt:re.sibling=Gt,re=Gt,te=We}if(fe.done)return o(R,te),ke&&vr(R,ce),J;if(te===null){for(;!fe.done;ce++,fe=T.next())fe=ne(R,fe.value,K),fe!==null&&(P=d(fe,P,ce),re===null?J=fe:re.sibling=fe,re=fe);return ke&&vr(R,ce),J}for(te=s(R,te);!fe.done;ce++,fe=T.next())fe=pe(te,R,ce,fe.value,K),fe!==null&&(t&&fe.alternate!==null&&te.delete(fe.key===null?ce:fe.key),P=d(fe,P,ce),re===null?J=fe:re.sibling=fe,re=fe);return t&&te.forEach(function(Zg){return l(R,Zg)}),ke&&vr(R,ce),J}function Kn(R,P,T,K){if(typeof T=="object"&&T!==null&&T.type===h&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case m:e:{for(var J=T.key,re=P;re!==null;){if(re.key===J){if(J=T.type,J===h){if(re.tag===7){o(R,re.sibling),P=c(re,T.props.children),P.return=R,R=P;break e}}else if(re.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===E&&Rd(J)===re.type){o(R,re.sibling),P=c(re,T.props),P.ref=Kl(R,re,T),P.return=R,R=P;break e}o(R,re);break}else l(R,re);re=re.sibling}T.type===h?(P=Er(T.props.children,R.mode,K,T.key),P.return=R,R=P):(K=Xo(T.type,T.key,T.props,null,R.mode,K),K.ref=Kl(R,P,T),K.return=R,R=K)}return k(R);case S:e:{for(re=T.key;P!==null;){if(P.key===re)if(P.tag===4&&P.stateNode.containerInfo===T.containerInfo&&P.stateNode.implementation===T.implementation){o(R,P.sibling),P=c(P,T.children||[]),P.return=R,R=P;break e}else{o(R,P);break}else l(R,P);P=P.sibling}P=xa(T,R.mode,K),P.return=R,R=P}return k(R);case E:return re=T._init,Kn(R,P,re(T._payload),K)}if(Cn(T))return q(R,P,T,K);if(D(T))return nn(R,P,T,K);go(R,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,P!==null&&P.tag===6?(o(R,P.sibling),P=c(P,T),P.return=R,R=P):(o(R,P),P=_a(T,R.mode,K),P.return=R,R=P),k(R)):o(R,P)}return Kn}var Xr=Ld(!0),Td=Ld(!1),Gl={},Bn=Ft(Gl),Yl=Ft(Gl),Zr=Ft(Gl);function pt(t){if(t===Gl)throw Error(f(174));return t}function Bs(t,l){ve(Zr,l),ve(Yl,t),ve(Bn,Gl),t=mn(l),ye(Bn),ve(Bn,t)}function Jr(){ye(Bn),ye(Yl),ye(Zr)}function Md(t){var l=pt(Zr.current),o=pt(Bn.current);l=L(o,t.type,l),o!==l&&(ve(Yl,t),ve(Bn,l))}function Ws(t){Yl.current===t&&(ye(Bn),ye(Yl))}var xe=Ft(0);function yo(t){for(var l=t;l!==null;){if(l.tag===13){var o=l.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||ad(o)||gs(o)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break;for(;l.sibling===null;){if(l.return===null||l.return===t)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Qs=[];function Vs(){for(var t=0;to?o:4,t(!0);var s=Wn.transition;Wn.transition={};try{t(!1),l()}finally{ae=o,Wn.transition=s}}function Gd(){return mt().memoizedState}function Eg(t,l,o){var s=Qt(t);o={lane:s,action:o,hasEagerState:!1,eagerState:null,next:null},Yd(t)?Xd(l,o):(Zd(t,l,o),o=sn(),t=Qn(t,s,o),t!==null&&Jd(t,l,s))}function _g(t,l,o){var s=Qt(t),c={lane:s,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yd(t))Xd(l,c);else{Zd(t,l,c);var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=l.lastRenderedReducer,d!==null))try{var k=l.lastRenderedState,_=d(k,o);if(c.hasEagerState=!0,c.eagerState=_,ct(_,k))return}catch{}finally{}o=sn(),t=Qn(t,s,o),t!==null&&Jd(t,l,s)}}function Yd(t){var l=t.alternate;return t===Re||l!==null&&l===Re}function Xd(t,l){Xl=wo=!0;var o=t.pending;o===null?l.next=l:(l.next=o.next,o.next=l),t.pending=l}function Zd(t,l,o){Oe!==null&&t.mode&1&&!(le&2)?(t=l.interleaved,t===null?(o.next=o,dt===null?dt=[l]:dt.push(l)):(o.next=t.next,t.next=o),l.interleaved=o):(t=l.pending,t===null?o.next=o:(o.next=t.next,t.next=o),l.pending=o)}function Jd(t,l,o){if(o&4194240){var s=l.lanes;s&=t.pendingLanes,o|=s,l.lanes=o,xs(t,o)}}var Co={readContext:Un,useCallback:be,useContext:be,useEffect:be,useImperativeHandle:be,useInsertionEffect:be,useLayoutEffect:be,useMemo:be,useReducer:be,useRef:be,useState:be,useDebugValue:be,useDeferredValue:be,useTransition:be,useMutableSource:be,useSyncExternalStore:be,useId:be,unstable_isNewReconciler:!1},xg={readContext:Un,useCallback:function(t,l){return Ct().memoizedState=[t,l===void 0?null:l],t},useContext:Un,useEffect:Zs,useImperativeHandle:function(t,l,o){return o=o!=null?o.concat([t]):null,_o(4194308,4,Wd.bind(null,l,t),o)},useLayoutEffect:function(t,l){return _o(4194308,4,t,l)},useInsertionEffect:function(t,l){return _o(4,2,t,l)},useMemo:function(t,l){var o=Ct();return l=l===void 0?null:l,t=t(),o.memoizedState=[t,l],t},useReducer:function(t,l,o){var s=Ct();return l=o!==void 0?o(l):l,s.memoizedState=s.baseState=l,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:l},s.queue=t,t=t.dispatch=Eg.bind(null,Re,t),[s.memoizedState,t]},useRef:function(t){var l=Ct();return t={current:t},l.memoizedState=t},useState:Xs,useDebugValue:Js,useDeferredValue:function(t){var l=Xs(t),o=l[0],s=l[1];return Zs(function(){var c=Wn.transition;Wn.transition={};try{s(t)}finally{Wn.transition=c}},[t]),o},useTransition:function(){var t=Xs(!1),l=t[0];return t=kg.bind(null,t[1]),Ct().memoizedState=t,[l,t]},useMutableSource:function(){},useSyncExternalStore:function(t,l,o){var s=Re,c=Ct();if(ke){if(o===void 0)throw Error(f(407));o=o()}else{if(o=l(),Oe===null)throw Error(f(349));qr&30||Dd(s,l,o)}c.memoizedState=o;var d={value:o,getSnapshot:l};return c.queue=d,Zs(Fd.bind(null,s,d,t),[t]),s.flags|=2048,Jl(9,jd.bind(null,s,d,o,l),void 0,null),o},useId:function(){var t=Ct(),l=Oe.identifierPrefix;if(ke){var o=xt,s=_t;o=(s&~(1<<32-bn(s)-1)).toString(32)+o,l=":"+l+"R"+o,o=Zl++,0va&&(l.flags|=128,s=!0,ei(c,!1),l.lanes=4194304)}else{if(!s)if(t=yo(d),t!==null){if(l.flags|=128,s=!0,t=t.updateQueue,t!==null&&(l.updateQueue=t,l.flags|=4),ei(c,!0),c.tail===null&&c.tailMode==="hidden"&&!d.alternate&&!ke)return en(l),null}else 2*He()-c.renderingStartTime>va&&o!==1073741824&&(l.flags|=128,s=!0,ei(c,!1),l.lanes=4194304);c.isBackwards?(d.sibling=l.child,l.child=d):(t=c.last,t!==null?t.sibling=d:l.child=d,c.last=d)}return c.tail!==null?(l=c.tail,c.rendering=l,c.tail=l.sibling,c.renderingStartTime=He(),l.sibling=null,t=xe.current,ve(xe,s?t&1|2:t&1),l):(en(l),null);case 22:case 23:return wa(),s=l.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(l.flags|=8192),s&&l.mode&1?Ln&1073741824&&(en(l),$n&&l.subtreeFlags&6&&(l.flags|=8192)):en(l),null;case 24:return null;case 25:return null}throw Error(f(156,l.tag))}var Rg=p.ReactCurrentOwner,Rn=!1;function un(t,l,o,s){l.child=t===null?Td(l,null,o,s):Xr(l,t.child,o,s)}function lp(t,l,o,s,c){o=o.render;var d=l.ref;return Vr(l,c),s=Gs(t,l,o,s,d,c),o=Ys(),t!==null&&!Rn?(l.updateQueue=t.updateQueue,l.flags&=-2053,t.lanes&=~c,Pt(t,l,c)):(ke&&o&&js(l),l.flags|=1,un(t,l,s,c),l.child)}function ip(t,l,o,s,c){if(t===null){var d=o.type;return typeof d=="function"&&!Ea(d)&&d.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(l.tag=15,l.type=d,op(t,l,d,s,c)):(t=Xo(o.type,null,s,l,l.mode,c),t.ref=l.ref,t.return=l,l.child=t)}if(d=t.child,!(t.lanes&c)){var k=d.memoizedProps;if(o=o.compare,o=o!==null?o:so,o(k,s)&&t.ref===l.ref)return Pt(t,l,c)}return l.flags|=1,t=Kt(d,s),t.ref=l.ref,t.return=l,l.child=t}function op(t,l,o,s,c){if(t!==null&&so(t.memoizedProps,s)&&t.ref===l.ref)if(Rn=!1,(t.lanes&c)!==0)t.flags&131072&&(Rn=!0);else return l.lanes=t.lanes,Pt(t,l,c);return bs(t,l,o,s,c)}function up(t,l,o){var s=l.pendingProps,c=s.children,d=t!==null?t.memoizedState:null;if(s.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null},ve($r,Ln),Ln|=o;else if(o&1073741824)l.memoizedState={baseLanes:0,cachePool:null},s=d!==null?d.baseLanes:o,ve($r,Ln),Ln|=s;else return t=d!==null?d.baseLanes|o:o,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:t,cachePool:null},l.updateQueue=null,ve($r,Ln),Ln|=t,null;else d!==null?(s=d.baseLanes|o,l.memoizedState=null):s=o,ve($r,Ln),Ln|=s;return un(t,l,c,o),l.child}function sp(t,l){var o=l.ref;(t===null&&o!==null||t!==null&&t.ref!==o)&&(l.flags|=512,l.flags|=2097152)}function bs(t,l,o,s,c){var d=hn(o)?pr:qe.current;return d=Wr(l,d),Vr(l,c),o=Gs(t,l,o,s,d,c),s=Ys(),t!==null&&!Rn?(l.updateQueue=t.updateQueue,l.flags&=-2053,t.lanes&=~c,Pt(t,l,c)):(ke&&s&&js(l),l.flags|=1,un(t,l,o,c),l.child)}function ap(t,l,o,s,c){if(hn(o)){var d=!0;to(l)}else d=!1;if(Vr(l,c),l.stateNode===null)t!==null&&(t.alternate=null,l.alternate=null,l.flags|=2),_d(l,o,s),Ds(l,o,s,c),s=!0;else if(t===null){var k=l.stateNode,_=l.memoizedProps;k.props=_;var M=k.context,B=o.contextType;typeof B=="object"&&B!==null?B=Un(B):(B=hn(o)?pr:qe.current,B=Wr(l,B));var Z=o.getDerivedStateFromProps,ne=typeof Z=="function"||typeof k.getSnapshotBeforeUpdate=="function";ne||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(_!==s||M!==B)&&xd(l,k,s,B),At=!1;var b=l.memoizedState;k.state=b,po(l,s,k,c),M=l.memoizedState,_!==s||b!==M||vn.current||At?(typeof Z=="function"&&(Is(l,o,Z,s),M=l.memoizedState),(_=At||Ed(l,o,_,s,b,M,B))?(ne||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(l.flags|=4194308)):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=s,l.memoizedState=M),k.props=s,k.state=M,k.context=B,s=_):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),s=!1)}else{k=l.stateNode,yd(t,l),_=l.memoizedProps,B=l.type===l.elementType?_:et(l.type,_),k.props=B,ne=l.pendingProps,b=k.context,M=o.contextType,typeof M=="object"&&M!==null?M=Un(M):(M=hn(o)?pr:qe.current,M=Wr(l,M));var pe=o.getDerivedStateFromProps;(Z=typeof pe=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(_!==ne||b!==M)&&xd(l,k,s,M),At=!1,b=l.memoizedState,k.state=b,po(l,s,k,c);var q=l.memoizedState;_!==ne||b!==q||vn.current||At?(typeof pe=="function"&&(Is(l,o,pe,s),q=l.memoizedState),(B=At||Ed(l,o,B,s,b,q,M)||!1)?(Z||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(s,q,M),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(s,q,M)),typeof k.componentDidUpdate=="function"&&(l.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof k.componentDidUpdate!="function"||_===t.memoizedProps&&b===t.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||_===t.memoizedProps&&b===t.memoizedState||(l.flags|=1024),l.memoizedProps=s,l.memoizedState=q),k.props=s,k.state=q,k.context=M,s=B):(typeof k.componentDidUpdate!="function"||_===t.memoizedProps&&b===t.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||_===t.memoizedProps&&b===t.memoizedState||(l.flags|=1024),s=!1)}return ea(t,l,o,s,d,c)}function ea(t,l,o,s,c,d){sp(t,l);var k=(l.flags&128)!==0;if(!s&&!k)return c&&pd(l,o,!1),Pt(t,l,d);s=l.stateNode,Rg.current=l;var _=k&&typeof o.getDerivedStateFromError!="function"?null:s.render();return l.flags|=1,t!==null&&k?(l.child=Xr(l,t.child,null,d),l.child=Xr(l,null,_,d)):un(t,l,_,d),l.memoizedState=s.state,c&&pd(l,o,!0),l.child}function cp(t){var l=t.stateNode;l.pendingContext?fd(t,l.pendingContext,l.pendingContext!==l.context):l.context&&fd(t,l.context,!1),Bs(t,l.containerInfo)}function fp(t,l,o,s,c){return Yr(),Hs(c),l.flags|=256,un(t,l,o,s),l.child}var No={dehydrated:null,treeContext:null,retryLane:0};function Ro(t){return{baseLanes:t,cachePool:null}}function dp(t,l,o){var s=l.pendingProps,c=xe.current,d=!1,k=(l.flags&128)!==0,_;if((_=k)||(_=t!==null&&t.memoizedState===null?!1:(c&2)!==0),_?(d=!0,l.flags&=-129):(t===null||t.memoizedState!==null)&&(c|=1),ve(xe,c&1),t===null)return As(l),t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(l.mode&1?gs(t)?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(c=s.children,t=s.fallback,d?(s=l.mode,d=l.child,c={mode:"hidden",children:c},!(s&1)&&d!==null?(d.childLanes=0,d.pendingProps=c):d=Zo(c,s,0,null),t=Er(t,s,o,null),d.return=l,t.return=l,d.sibling=t,l.child=d,l.child.memoizedState=Ro(o),l.memoizedState=No,t):na(l,c));if(c=t.memoizedState,c!==null){if(_=c.dehydrated,_!==null){if(k)return l.flags&256?(l.flags&=-257,Lo(t,l,o,Error(f(422)))):l.memoizedState!==null?(l.child=t.child,l.flags|=128,null):(d=s.fallback,c=l.mode,s=Zo({mode:"visible",children:s.children},c,0,null),d=Er(d,c,o,null),d.flags|=2,s.return=l,d.return=l,s.sibling=d,l.child=s,l.mode&1&&Xr(l,t.child,null,o),l.child.memoizedState=Ro(o),l.memoizedState=No,d);if(!(l.mode&1))l=Lo(t,l,o,null);else if(gs(_))l=Lo(t,l,o,Error(f(419)));else if(s=(o&t.childLanes)!==0,Rn||s){if(s=Oe,s!==null){switch(o&-o){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}s=d&(s.suspendedLanes|o)?0:d,s!==0&&s!==c.retryLane&&(c.retryLane=s,Qn(t,s,-1))}ka(),l=Lo(t,l,o,Error(f(421)))}else ad(_)?(l.flags|=128,l.child=t.child,l=Wg.bind(null,t),V1(_,l),l=null):(o=c.treeContext,Pn&&(Nn=Y1(_),zn=l,ke=!0,nt=null,Ql=!1,o!==null&&(An[Hn++]=_t,An[Hn++]=xt,An[Hn++]=mr,_t=o.id,xt=o.overflow,mr=l)),l=na(l,l.pendingProps.children),l.flags|=4096);return l}return d?(s=mp(t,l,s.children,s.fallback,o),d=l.child,c=t.child.memoizedState,d.memoizedState=c===null?Ro(o):{baseLanes:c.baseLanes|o,cachePool:null},d.childLanes=t.childLanes&~o,l.memoizedState=No,s):(o=pp(t,l,s.children,o),l.memoizedState=null,o)}return d?(s=mp(t,l,s.children,s.fallback,o),d=l.child,c=t.child.memoizedState,d.memoizedState=c===null?Ro(o):{baseLanes:c.baseLanes|o,cachePool:null},d.childLanes=t.childLanes&~o,l.memoizedState=No,s):(o=pp(t,l,s.children,o),l.memoizedState=null,o)}function na(t,l){return l=Zo({mode:"visible",children:l},t.mode,0,null),l.return=t,t.child=l}function pp(t,l,o,s){var c=t.child;return t=c.sibling,o=Kt(c,{mode:"visible",children:o}),!(l.mode&1)&&(o.lanes=s),o.return=l,o.sibling=null,t!==null&&(s=l.deletions,s===null?(l.deletions=[t],l.flags|=16):s.push(t)),l.child=o}function mp(t,l,o,s,c){var d=l.mode;t=t.child;var k=t.sibling,_={mode:"hidden",children:o};return!(d&1)&&l.child!==t?(o=l.child,o.childLanes=0,o.pendingProps=_,l.deletions=null):(o=Kt(t,_),o.subtreeFlags=t.subtreeFlags&14680064),k!==null?s=Kt(k,s):(s=Er(s,d,c,null),s.flags|=2),s.return=l,o.return=l,o.sibling=s,l.child=o,s}function Lo(t,l,o,s){return s!==null&&Hs(s),Xr(l,t.child,null,o),t=na(l,l.pendingProps.children),t.flags|=2,l.memoizedState=null,t}function vp(t,l,o){t.lanes|=l;var s=t.alternate;s!==null&&(s.lanes|=l),Ms(t.return,l,o)}function ta(t,l,o,s,c){var d=t.memoizedState;d===null?t.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:c}:(d.isBackwards=l,d.rendering=null,d.renderingStartTime=0,d.last=s,d.tail=o,d.tailMode=c)}function hp(t,l,o){var s=l.pendingProps,c=s.revealOrder,d=s.tail;if(un(t,l,s.children,o),s=xe.current,s&2)s=s&1|2,l.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=l.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&vp(t,o,l);else if(t.tag===19)vp(t,o,l);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===l)break e;for(;t.sibling===null;){if(t.return===null||t.return===l)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}s&=1}if(ve(xe,s),!(l.mode&1))l.memoizedState=null;else switch(c){case"forwards":for(o=l.child,c=null;o!==null;)t=o.alternate,t!==null&&yo(t)===null&&(c=o),o=o.sibling;o=c,o===null?(c=l.child,l.child=null):(c=o.sibling,o.sibling=null),ta(l,!1,c,o,d);break;case"backwards":for(o=null,c=l.child,l.child=null;c!==null;){if(t=c.alternate,t!==null&&yo(t)===null){l.child=c;break}t=c.sibling,c.sibling=o,o=c,c=t}ta(l,!0,o,null,d);break;case"together":ta(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Pt(t,l,o){if(t!==null&&(l.dependencies=t.dependencies),br|=l.lanes,!(o&l.childLanes))return null;if(t!==null&&l.child!==t.child)throw Error(f(153));if(l.child!==null){for(t=l.child,o=Kt(t,t.pendingProps),l.child=o,o.return=l;t.sibling!==null;)t=t.sibling,o=o.sibling=Kt(t,t.pendingProps),o.return=l;o.sibling=null}return l.child}function Lg(t,l,o){switch(l.tag){case 3:cp(l),Yr();break;case 5:Md(l);break;case 1:hn(l.type)&&to(l);break;case 4:Bs(l,l.stateNode.containerInfo);break;case 10:gd(l,l.type._context,l.memoizedProps.value);break;case 13:var s=l.memoizedState;if(s!==null)return s.dehydrated!==null?(ve(xe,xe.current&1),l.flags|=128,null):o&l.child.childLanes?dp(t,l,o):(ve(xe,xe.current&1),t=Pt(t,l,o),t!==null?t.sibling:null);ve(xe,xe.current&1);break;case 19:if(s=(o&l.childLanes)!==0,t.flags&128){if(s)return hp(t,l,o);l.flags|=128}var c=l.memoizedState;if(c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ve(xe,xe.current),s)break;return null;case 22:case 23:return l.lanes=0,up(t,l,o)}return Pt(t,l,o)}function Tg(t,l){switch(Fs(l),l.tag){case 1:return hn(l.type)&&no(),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return Jr(),ye(vn),ye(qe),Vs(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 5:return Ws(l),null;case 13:if(ye(xe),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(f(340));Yr()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return ye(xe),null;case 4:return Jr(),null;case 10:return Ts(l.type._context),null;case 22:case 23:return wa(),null;case 24:return null;default:return null}}var To=!1,gr=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Mo(t,l){var o=t.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(s){Sn(t,l,s)}else o.current=null}function ra(t,l,o){try{o()}catch(s){Sn(t,l,s)}}var gp=!1;function Og(t,l){for(U(t.containerInfo),Q=l;Q!==null;)if(t=Q,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Q=l;else for(;Q!==null;){t=Q;try{var o=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(o!==null){var s=o.memoizedProps,c=o.memoizedState,d=t.stateNode,k=d.getSnapshotBeforeUpdate(t.elementType===t.type?s:et(t.type,s),c);d.__reactInternalSnapshotBeforeUpdate=k}break;case 3:$n&&U1(t.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(f(163))}}catch(_){Sn(t,t.return,_)}if(l=t.sibling,l!==null){l.return=t.return,Q=l;break}Q=t.return}return o=gp,gp=!1,o}function yr(t,l,o){var s=l.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&t)===t){var d=c.destroy;c.destroy=void 0,d!==void 0&&ra(l,o,d)}c=c.next}while(c!==s)}}function ni(t,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var o=l=l.next;do{if((o.tag&t)===t){var s=o.create;o.destroy=s()}o=o.next}while(o!==l)}}function la(t){var l=t.ref;if(l!==null){var o=t.stateNode;switch(t.tag){case 5:t=Ke(o);break;default:t=o}typeof l=="function"?l(t):l.current=t}}function yp(t,l,o){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(oo,l)}catch{}switch(l.tag){case 0:case 11:case 14:case 15:if(t=l.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var s=t=t.next;do{var c=s,d=c.destroy;c=c.tag,d!==void 0&&(c&2||c&4)&&ra(l,o,d),s=s.next}while(s!==t)}break;case 1:if(Mo(l,o),t=l.stateNode,typeof t.componentWillUnmount=="function")try{t.props=l.memoizedProps,t.state=l.memoizedState,t.componentWillUnmount()}catch(k){Sn(l,o,k)}break;case 5:Mo(l,o);break;case 4:$n?xp(t,l,o):eo&&eo&&(l=l.stateNode.containerInfo,o=ld(l),od(l,o))}}function Sp(t,l,o){for(var s=l;;)if(yp(t,s,o),s.child===null||$n&&s.tag===4){if(s===l)break;for(;s.sibling===null;){if(s.return===null||s.return===l)return;s=s.return}s.sibling.return=s.return,s=s.sibling}else s.child.return=s,s=s.child}function wp(t){var l=t.alternate;l!==null&&(t.alternate=null,wp(l)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(l=t.stateNode,l!==null&&h1(l)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function kp(t){return t.tag===5||t.tag===3||t.tag===4}function Ep(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||kp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function _p(t){if($n){e:{for(var l=t.return;l!==null;){if(kp(l))break e;l=l.return}throw Error(f(160))}var o=l;switch(o.tag){case 5:l=o.stateNode,o.flags&32&&(rd(l),o.flags&=-33),o=Ep(t),oa(t,o,l);break;case 3:case 4:l=o.stateNode.containerInfo,o=Ep(t),ia(t,o,l);break;default:throw Error(f(161))}}}function ia(t,l,o){var s=t.tag;if(s===5||s===6)t=t.stateNode,l?T1(o,t,l):P1(o,t);else if(s!==4&&(t=t.child,t!==null))for(ia(t,l,o),t=t.sibling;t!==null;)ia(t,l,o),t=t.sibling}function oa(t,l,o){var s=t.tag;if(s===5||s===6)t=t.stateNode,l?L1(o,t,l):C1(o,t);else if(s!==4&&(t=t.child,t!==null))for(oa(t,l,o),t=t.sibling;t!==null;)oa(t,l,o),t=t.sibling}function xp(t,l,o){for(var s=l,c=!1,d,k;;){if(!c){c=s.return;e:for(;;){if(c===null)throw Error(f(160));switch(d=c.stateNode,c.tag){case 5:k=!1;break e;case 3:d=d.containerInfo,k=!0;break e;case 4:d=d.containerInfo,k=!0;break e}c=c.return}c=!0}if(s.tag===5||s.tag===6)Sp(t,s,o),k?O1(d,s.stateNode):M1(d,s.stateNode);else if(s.tag===18)k?eg(d,s.stateNode):b1(d,s.stateNode);else if(s.tag===4){if(s.child!==null){d=s.stateNode.containerInfo,k=!0,s.child.return=s,s=s.child;continue}}else if(yp(t,s,o),s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break;for(;s.sibling===null;){if(s.return===null||s.return===l)return;s=s.return,s.tag===4&&(c=!1)}s.sibling.return=s.return,s=s.sibling}}function ua(t,l){if($n){switch(l.tag){case 0:case 11:case 14:case 15:yr(3,l,l.return),ni(3,l),yr(5,l,l.return);return;case 1:return;case 5:var o=l.stateNode;if(o!=null){var s=l.memoizedProps;t=t!==null?t.memoizedProps:s;var c=l.type,d=l.updateQueue;l.updateQueue=null,d!==null&&R1(o,d,c,t,s,l)}return;case 6:if(l.stateNode===null)throw Error(f(162));o=l.memoizedProps,z1(l.stateNode,t!==null?t.memoizedProps:o,o);return;case 3:Pn&&t!==null&&t.memoizedState.isDehydrated&&cd(l.stateNode.containerInfo);return;case 12:return;case 13:Oo(l);return;case 19:Oo(l);return;case 17:return}throw Error(f(163))}switch(l.tag){case 0:case 11:case 14:case 15:yr(3,l,l.return),ni(3,l),yr(5,l,l.return);return;case 12:return;case 13:Oo(l);return;case 19:Oo(l);return;case 3:Pn&&t!==null&&t.memoizedState.isDehydrated&&cd(l.stateNode.containerInfo);break;case 22:case 23:return}e:if(eo){switch(l.tag){case 1:case 5:case 6:break e;case 3:case 4:l=l.stateNode,od(l.containerInfo,l.pendingChildren);break e}throw Error(f(163))}}function Oo(t){var l=t.updateQueue;if(l!==null){t.updateQueue=null;var o=t.stateNode;o===null&&(o=t.stateNode=new Mg),l.forEach(function(s){var c=Qg.bind(null,t,s);o.has(s)||(o.add(s),s.then(c,c))})}}function Ig(t,l){for(Q=l;Q!==null;){l=Q;var o=l.deletions;if(o!==null)for(var s=0;s";case Do:return":has("+(ca(t)||"")+")";case jo:return'[role="'+t.value+'"]';case Uo:return'"'+t.value+'"';case Fo:return'[data-testname="'+t.value+'"]';default:throw Error(f(365))}}function Rp(t,l){var o=[];t=[t,0];for(var s=0;sc&&(c=k),s&=~d}if(s=c,s=He()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*jg(s/1960))-s,10t?16:t,Wt===null)var s=!1;else{if(t=Wt,Wt=null,Qo=0,le&6)throw Error(f(331));var c=le;for(le|=4,Q=t.current;Q!==null;){var d=Q,k=d.child;if(Q.flags&16){var _=d.deletions;if(_!==null){for(var M=0;M<_.length;M++){var B=_[M];for(Q=B;Q!==null;){var Z=Q;switch(Z.tag){case 0:case 11:case 15:yr(8,Z,d)}var ne=Z.child;if(ne!==null)ne.return=Z,Q=ne;else for(;Q!==null;){Z=Q;var b=Z.sibling,pe=Z.return;if(wp(Z),Z===B){Q=null;break}if(b!==null){b.return=pe,Q=b;break}Q=pe}}}var q=d.alternate;if(q!==null){var nn=q.child;if(nn!==null){q.child=null;do{var Kn=nn.sibling;nn.sibling=null,nn=Kn}while(nn!==null)}}Q=d}}if(d.subtreeFlags&2064&&k!==null)k.return=d,Q=k;else e:for(;Q!==null;){if(d=Q,d.flags&2048)switch(d.tag){case 0:case 11:case 15:yr(9,d,d.return)}var R=d.sibling;if(R!==null){R.return=d.return,Q=R;break e}Q=d.return}}var P=t.current;for(Q=P;Q!==null;){k=Q;var T=k.child;if(k.subtreeFlags&2064&&T!==null)T.return=k,Q=T;else e:for(k=P;Q!==null;){if(_=Q,_.flags&2048)try{switch(_.tag){case 0:case 11:case 15:ni(9,_)}}catch(J){Sn(_,_.return,J)}if(_===k){Q=null;break e}var K=_.sibling;if(K!==null){K.return=_.return,Q=K;break e}Q=_.return}}if(le=c,ft(),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(oo,t)}catch{}s=!0}return s}finally{ae=o,Te.transition=l}}return!1}function Fp(t,l,o){l=qs(o,l),l=qd(t,l,1),Ht(t,l),l=sn(),t=Go(t,1),t!==null&&(Wl(t,1,l),yn(t,l))}function Sn(t,l,o){if(t.tag===3)Fp(t,t,o);else for(;l!==null;){if(l.tag===3){Fp(l,t,o);break}else if(l.tag===1){var s=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Bt===null||!Bt.has(s))){t=qs(o,t),t=$d(l,t,1),Ht(l,t),t=sn(),l=Go(l,1),l!==null&&(Wl(l,1,t),yn(l,t));break}}l=l.return}}function Bg(t,l,o){var s=t.pingCache;s!==null&&s.delete(l),l=sn(),t.pingedLanes|=t.suspendedLanes&o,Oe===t&&(Ge&o)===o&&(je===4||je===3&&(Ge&130023424)===Ge&&500>He()-ma?Sr(t,0):pa|=o),yn(t,l)}function Up(t,l){l===0&&(t.mode&1?(l=lo,lo<<=1,!(lo&130023424)&&(lo=4194304)):l=1);var o=sn();t=Go(t,l),t!==null&&(Wl(t,l,o),yn(t,o))}function Wg(t){var l=t.memoizedState,o=0;l!==null&&(o=l.retryLane),Up(t,o)}function Qg(t,l){var o=0;switch(t.tag){case 13:var s=t.stateNode,c=t.memoizedState;c!==null&&(o=c.retryLane);break;case 19:s=t.stateNode;break;default:throw Error(f(314))}s!==null&&s.delete(l),Up(t,o)}var Ap;Ap=function(t,l,o){if(t!==null)if(t.memoizedProps!==l.pendingProps||vn.current)Rn=!0;else{if(!(t.lanes&o)&&!(l.flags&128))return Rn=!1,Lg(t,l,o);Rn=!!(t.flags&131072)}else Rn=!1,ke&&l.flags&1048576&&Cd(l,ho,l.index);switch(l.lanes=0,l.tag){case 2:var s=l.type;t!==null&&(t.alternate=null,l.alternate=null,l.flags|=2),t=l.pendingProps;var c=Wr(l,qe.current);Vr(l,o),c=Gs(null,l,s,t,c,o);var d=Ys();return l.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,hn(s)?(d=!0,to(l)):d=!1,l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Os(l),c.updater=mo,l.stateNode=c,c._reactInternals=l,Ds(l,s,t,o),l=ea(null,l,s,!0,d,o)):(l.tag=0,ke&&d&&js(l),un(null,l,c,o),l=l.child),l;case 16:s=l.elementType;e:{switch(t!==null&&(t.alternate=null,l.alternate=null,l.flags|=2),t=l.pendingProps,c=s._init,s=c(s._payload),l.type=s,c=l.tag=Kg(s),t=et(s,t),c){case 0:l=bs(null,l,s,t,o);break e;case 1:l=ap(null,l,s,t,o);break e;case 11:l=lp(null,l,s,t,o);break e;case 14:l=ip(null,l,s,et(s.type,t),o);break e}throw Error(f(306,s,""))}return l;case 0:return s=l.type,c=l.pendingProps,c=l.elementType===s?c:et(s,c),bs(t,l,s,c,o);case 1:return s=l.type,c=l.pendingProps,c=l.elementType===s?c:et(s,c),ap(t,l,s,c,o);case 3:e:{if(cp(l),t===null)throw Error(f(387));s=l.pendingProps,d=l.memoizedState,c=d.element,yd(t,l),po(l,s,null,o);var k=l.memoizedState;if(s=k.element,Pn&&d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:k.cache,transitions:k.transitions},l.updateQueue.baseState=d,l.memoizedState=d,l.flags&256){c=Error(f(423)),l=fp(t,l,s,o,c);break e}else if(s!==c){c=Error(f(424)),l=fp(t,l,s,o,c);break e}else for(Pn&&(Nn=G1(l.stateNode.containerInfo),zn=l,ke=!0,nt=null,Ql=!1),o=Td(l,null,s,o),l.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Yr(),s===c){l=Pt(t,l,o);break e}un(t,l,s,o)}l=l.child}return l;case 5:return Md(l),t===null&&As(l),s=l.type,c=l.pendingProps,d=t!==null?t.memoizedProps:null,k=c.children,Je(s,c)?k=null:d!==null&&Je(s,d)&&(l.flags|=32),sp(t,l),un(t,l,k,o),l.child;case 6:return t===null&&As(l),null;case 13:return dp(t,l,o);case 4:return Bs(l,l.stateNode.containerInfo),s=l.pendingProps,t===null?l.child=Xr(l,null,s,o):un(t,l,s,o),l.child;case 11:return s=l.type,c=l.pendingProps,c=l.elementType===s?c:et(s,c),lp(t,l,s,c,o);case 7:return un(t,l,l.pendingProps,o),l.child;case 8:return un(t,l,l.pendingProps.children,o),l.child;case 12:return un(t,l,l.pendingProps.children,o),l.child;case 10:e:{if(s=l.type._context,c=l.pendingProps,d=l.memoizedProps,k=c.value,gd(l,s,k),d!==null)if(ct(d.value,k)){if(d.children===c.children&&!vn.current){l=Pt(t,l,o);break e}}else for(d=l.child,d!==null&&(d.return=l);d!==null;){var _=d.dependencies;if(_!==null){k=d.child;for(var M=_.firstContext;M!==null;){if(M.context===s){if(d.tag===1){M=Et(-1,o&-o),M.tag=2;var B=d.updateQueue;if(B!==null){B=B.shared;var Z=B.pending;Z===null?M.next=M:(M.next=Z.next,Z.next=M),B.pending=M}}d.lanes|=o,M=d.alternate,M!==null&&(M.lanes|=o),Ms(d.return,o,l),_.lanes|=o;break}M=M.next}}else if(d.tag===10)k=d.type===l.type?null:d.child;else if(d.tag===18){if(k=d.return,k===null)throw Error(f(341));k.lanes|=o,_=k.alternate,_!==null&&(_.lanes|=o),Ms(k,o,l),k=d.sibling}else k=d.child;if(k!==null)k.return=d;else for(k=d;k!==null;){if(k===l){k=null;break}if(d=k.sibling,d!==null){d.return=k.return,k=d;break}k=k.return}d=k}un(t,l,c.children,o),l=l.child}return l;case 9:return c=l.type,s=l.pendingProps.children,Vr(l,o),c=Un(c),s=s(c),l.flags|=1,un(t,l,s,o),l.child;case 14:return s=l.type,c=et(s,l.pendingProps),c=et(s.type,c),ip(t,l,s,c,o);case 15:return op(t,l,l.type,l.pendingProps,o);case 17:return s=l.type,c=l.pendingProps,c=l.elementType===s?c:et(s,c),t!==null&&(t.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,hn(s)?(t=!0,to(l)):t=!1,Vr(l,o),_d(l,s,c),Ds(l,s,c,o),ea(null,l,s,!0,t,o);case 19:return hp(t,l,o);case 22:return up(t,l,o)}throw Error(f(156,l.tag))};function Hp(t,l){return Cs(t,l)}function Vg(t,l,o,s){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(t,l,o,s){return new Vg(t,l,o,s)}function Ea(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Kg(t){if(typeof t=="function")return Ea(t)?1:0;if(t!=null){if(t=t.$$typeof,t===N)return 11;if(t===y)return 14}return 2}function Kt(t,l){var o=t.alternate;return o===null?(o=Vn(t.tag,l,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=l,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&14680064,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,l=t.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o}function Xo(t,l,o,s,c,d){var k=2;if(s=t,typeof t=="function")Ea(t)&&(k=1);else if(typeof t=="string")k=5;else e:switch(t){case h:return Er(o.children,c,d,l);case v:k=8,c|=8;break;case w:return t=Vn(12,o,l,c|2),t.elementType=w,t.lanes=d,t;case I:return t=Vn(13,o,l,c),t.elementType=I,t.lanes=d,t;case g:return t=Vn(19,o,l,c),t.elementType=g,t.lanes=d,t;case z:return Zo(o,c,d,l);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:k=10;break e;case C:k=9;break e;case N:k=11;break e;case y:k=14;break e;case E:k=16,s=null;break e}throw Error(f(130,t==null?t:typeof t,""))}return l=Vn(k,o,l,c),l.elementType=t,l.type=s,l.lanes=d,l}function Er(t,l,o,s){return t=Vn(7,t,s,l),t.lanes=o,t}function Zo(t,l,o,s){return t=Vn(22,t,s,l),t.elementType=z,t.lanes=o,t.stateNode={},t}function _a(t,l,o){return t=Vn(6,t,null,l),t.lanes=o,t}function xa(t,l,o){return l=Vn(4,t.children!==null?t.children:[],t.key,l),l.lanes=o,l.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},l}function Gg(t,l,o,s,c){this.tag=l,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=hs,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_s(0),this.expirationTimes=_s(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_s(0),this.identifierPrefix=s,this.onRecoverableError=c,Pn&&(this.mutableSourceEagerHydrationData=null)}function Bp(t,l,o,s,c,d,k,_,M){return t=new Gg(t,l,o,_,M),l===1?(l=1,d===!0&&(l|=8)):l=0,d=Vn(3,null,null,l),t.current=d,d.stateNode=t,d.memoizedState={element:s,isDehydrated:o,cache:null,transitions:null},Os(d),t}function Wp(t){if(!t)return Ut;t=t._reactInternals;e:{if($(t)!==t||t.tag!==1)throw Error(f(170));var l=t;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(hn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(f(171))}if(t.tag===1){var o=t.type;if(hn(o))return dd(t,o,l)}return l}function Qp(t){var l=t._reactInternals;if(l===void 0)throw typeof t.render=="function"?Error(f(188)):(t=Object.keys(t).join(","),Error(f(268,t)));return t=ie(l),t===null?null:t.stateNode}function Vp(t,l){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o=B&&d>=ne&&c<=Z&&k<=b){t.splice(l,1);break}else if(s!==B||o.width!==M.width||bk){if(!(d!==ne||o.height!==M.height||Zc)){B>s&&(M.width+=B-s,M.x=s),Zd&&(M.height+=ne-d,M.y=d),bo&&(o=k)),k ")+` + +No matching component was found for: + `)+t.join(" > ")}return null},r.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return Ke(t.child.stateNode);default:return t.child.stateNode}},r.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:p.ReactCurrentDispatcher,findHostInstanceByFiber:Yg,findFiberByHostInstance:t.findFiberByHostInstance||Xg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(l.isDisabled||!l.supportsFiber)t=!0;else{try{oo=l.inject(t),at=l}catch{}t=!!l.checkDCE}}return t},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(t,l,o,s){if(!Fl)throw Error(f(363));t=fa(t,l);var c=x1(t,o,s).disconnect;return{disconnect:function(){c()}}},r.registerMutableSourceForHydration=function(t,l){var o=l._getVersion;o=o(l._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[l,o]:t.mutableSourceEagerHydrationData.push(l,o)},r.runWithPriority=function(t,l){var o=ae;try{return ae=t,l()}finally{ae=o}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(t,l,o,s){var c=l.current,d=sn(),k=Qt(c);return o=Wp(o),l.context===null?l.context=o:l.pendingContext=o,l=Et(d,k),l.payload={element:t},s=s===void 0?null:s,s!==null&&(l.callback=s),Ht(c,l),t=Qn(c,k,d),t!==null&&fo(t,c,k),k},r};W0.exports=Jw;var qw=W0.exports;const $w=$u(qw),bf={},bw=e=>void Object.assign(bf,e);function e2(e,n){function r(h,{args:v=[],attach:w,...x},C){let N=`${h[0].toUpperCase()}${h.slice(1)}`,I;if(h==="primitive"){if(x.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=x.object;I=ll(g,{type:h,root:C,attach:w,primitive:!0})}else{const g=bf[N];if(!g)throw new Error(`R3F: ${N} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(v))throw new Error("R3F: The args prop must be an array!");I=ll(new g(...v),{type:h,root:C,attach:w,memoizedProps:{args:v}})}return I.__r3f.attach===void 0&&(I instanceof ry?I.__r3f.attach="geometry":I instanceof ly&&(I.__r3f.attach="material")),N!=="inject"&&tc(I,x),I}function i(h,v){let w=!1;if(v){var x,C;(x=v.__r3f)!=null&&x.attach?nc(h,v,v.__r3f.attach):v.isObject3D&&h.isObject3D&&(h.add(v),w=!0),w||(C=h.__r3f)==null||C.objects.push(v),v.__r3f||ll(v,{}),v.__r3f.parent=h,tf(v),il(v)}}function u(h,v,w){let x=!1;if(v){var C,N;if((C=v.__r3f)!=null&&C.attach)nc(h,v,v.__r3f.attach);else if(v.isObject3D&&h.isObject3D){v.parent=h,v.dispatchEvent({type:"added"}),h.dispatchEvent({type:"childadded",child:v});const I=h.children.filter(y=>y!==v),g=I.indexOf(w);h.children=[...I.slice(0,g),v,...I.slice(g)],x=!0}x||(N=h.__r3f)==null||N.objects.push(v),v.__r3f||ll(v,{}),v.__r3f.parent=h,tf(v),il(v)}}function a(h,v,w=!1){h&&[...h].forEach(x=>f(v,x,w))}function f(h,v,w){if(v){var x,C,N;if(v.__r3f&&(v.__r3f.parent=null),(x=h.__r3f)!=null&&x.objects&&(h.__r3f.objects=h.__r3f.objects.filter(z=>z!==v)),(C=v.__r3f)!=null&&C.attach)ov(h,v,v.__r3f.attach);else if(v.isObject3D&&h.isObject3D){var I;h.remove(v),(I=v.__r3f)!=null&&I.root&&s2(zu(v),v)}const y=(N=v.__r3f)==null?void 0:N.primitive,E=!y&&(w===void 0?v.dispose!==null:w);if(!y){var g;a((g=v.__r3f)==null?void 0:g.objects,v,E),a(v.children,v,E)}if(delete v.__r3f,E&&v.dispose&&v.type!=="Scene"){const z=()=>{try{v.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?ef.unstable_scheduleCallback(ef.unstable_IdlePriority,z):z()}il(h)}}function p(h,v,w,x){var C;const N=(C=h.__r3f)==null?void 0:C.parent;if(!N)return;const I=r(v,w,h.__r3f.root);if(h.children){for(const g of h.children)g.__r3f&&i(I,g);h.children=h.children.filter(g=>!g.__r3f)}h.__r3f.objects.forEach(g=>i(I,g)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||f(N,h),I.parent&&(I.__r3f.autoRemovedBeforeAppend=!0),i(N,I),I.raycast&&I.__r3f.eventCount&&zu(I).getState().internal.interaction.push(I),[x,x.alternate].forEach(g=>{g!==null&&(g.stateNode=I,g.ref&&(typeof g.ref=="function"?g.ref(I):g.ref.current=I))})}const m=()=>{};return{reconciler:$w({createInstance:r,removeChild:f,appendChild:i,appendInitialChild:i,insertBefore:u,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,v)=>{if(!v)return;const w=h.getState().scene;w.__r3f&&(w.__r3f.root=h,i(w,v))},removeChildFromContainer:(h,v)=>{v&&f(h.getState().scene,v)},insertInContainerBefore:(h,v,w)=>{if(!v||!w)return;const x=h.getState().scene;x.__r3f&&u(x,v,w)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var v;return!!((v=h==null?void 0:h.__r3f)!=null?v:{}).handlers},prepareUpdate(h,v,w,x){var C;if(((C=h==null?void 0:h.__r3f)!=null?C:{}).primitive&&x.object&&x.object!==h)return[!0];{const{args:I=[],children:g,...y}=x,{args:E=[],children:z,...O}=w;if(!Array.isArray(I))throw new Error("R3F: the args prop must be an array!");if(I.some((H,W)=>H!==E[W]))return[!0];const D=q0(h,y,O,!0);return D.changes.length?[!1,D]:null}},commitUpdate(h,[v,w],x,C,N,I){v?p(h,x,N,I):tc(h,w)},commitMount(h,v,w,x){var C;const N=(C=h.__r3f)!=null?C:{};h.raycast&&N.handlers&&N.eventCount&&zu(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>ll(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var v;const{attach:w,parent:x}=(v=h.__r3f)!=null?v:{};w&&x&&ov(x,h,w),h.isObject3D&&(h.visible=!1),il(h)},unhideInstance(h,v){var w;const{attach:x,parent:C}=(w=h.__r3f)!=null?w:{};x&&C&&nc(C,h,x),(h.isObject3D&&v.visible==null||v.visible)&&(h.visible=!0),il(h)},createTextInstance:m,hideTextInstance:m,unhideTextInstance:m,getCurrentEventPriority:()=>n?n():yl.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&he.fun(performance.now)?performance.now:he.fun(Date.now)?Date.now:()=>0,scheduleTimeout:he.fun(setTimeout)?setTimeout:void 0,cancelTimeout:he.fun(clearTimeout)?clearTimeout:void 0}),applyProps:tc}}var tv,rv;const ec=e=>"colorSpace"in e||"outputColorSpace"in e,K0=()=>{var e;return(e=bf.ColorManagement)!=null?e:null},G0=e=>e&&e.isOrthographicCamera,n2=e=>e&&e.hasOwnProperty("current"),jl=typeof window<"u"&&((tv=window.document)!=null&&tv.createElement||((rv=window.navigator)==null?void 0:rv.product)==="ReactNative")?F.useLayoutEffect:F.useEffect;function Y0(e){const n=F.useRef(e);return jl(()=>void(n.current=e),[e]),n}function t2({set:e}){return jl(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}class X0 extends F.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}}X0.getDerivedStateFromError=()=>({error:!0});const Z0="__default",lv=new Map,r2=e=>e&&!!e.memoized&&!!e.changes;function J0(e){var n;const r=typeof window<"u"?(n=window.devicePixelRatio)!=null?n:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],r),e[1]):e}const mi=e=>{var n;return(n=e.__r3f)==null?void 0:n.root.getState()};function zu(e){let n=e.__r3f.root;for(;n.getState().previousRoot;)n=n.getState().previousRoot;return n}const he={obj:e=>e===Object(e)&&!he.arr(e)&&typeof e!="function",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",boo:e=>typeof e=="boolean",und:e=>e===void 0,arr:e=>Array.isArray(e),equ(e,n,{arrays:r="shallow",objects:i="reference",strict:u=!0}={}){if(typeof e!=typeof n||!!e!=!!n)return!1;if(he.str(e)||he.num(e)||he.boo(e))return e===n;const a=he.obj(e);if(a&&i==="reference")return e===n;const f=he.arr(e);if(f&&r==="reference")return e===n;if((f||a)&&e===n)return!0;let p;for(p in e)if(!(p in n))return!1;if(a&&r==="shallow"&&i==="shallow"){for(p in u?n:e)if(!he.equ(e[p],n[p],{strict:u,objects:"reference"}))return!1}else for(p in u?n:e)if(e[p]!==n[p])return!1;if(he.und(p)){if(f&&e.length===0&&n.length===0||a&&Object.keys(e).length===0&&Object.keys(n).length===0)return!0;if(e!==n)return!1}return!0}};function l2(e){const n={nodes:{},materials:{}};return e&&e.traverse(r=>{r.name&&(n.nodes[r.name]=r),r.material&&!n.materials[r.material.name]&&(n.materials[r.material.name]=r.material)}),n}function i2(e){e.dispose&&e.type!=="Scene"&&e.dispose();for(const n in e)n.dispose==null||n.dispose(),delete e[n]}function ll(e,n){const r=e;return r.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...n},e}function nf(e,n){let r=e;if(n.includes("-")){const i=n.split("-"),u=i.pop();return r=i.reduce((a,f)=>a[f],e),{target:r,key:u}}else return{target:r,key:n}}const iv=/-\d+$/;function nc(e,n,r){if(he.str(r)){if(iv.test(r)){const a=r.replace(iv,""),{target:f,key:p}=nf(e,a);Array.isArray(f[p])||(f[p]=[])}const{target:i,key:u}=nf(e,r);n.__r3f.previousAttach=i[u],i[u]=n}else n.__r3f.previousAttach=r(e,n)}function ov(e,n,r){var i,u;if(he.str(r)){const{target:a,key:f}=nf(e,r),p=n.__r3f.previousAttach;p===void 0?delete a[f]:a[f]=p}else(i=n.__r3f)==null||i.previousAttach==null||i.previousAttach(e,n);(u=n.__r3f)==null||delete u.previousAttach}function q0(e,{children:n,key:r,ref:i,...u},{children:a,key:f,ref:p,...m}={},S=!1){const h=e.__r3f,v=Object.entries(u),w=[];if(S){const C=Object.keys(m);for(let N=0;N{var I;if((I=e.__r3f)!=null&&I.primitive&&C==="object"||he.equ(N,m[C]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(C))return w.push([C,N,!0,[]]);let g=[];C.includes("-")&&(g=C.split("-")),w.push([C,N,!1,g]);for(const y in u){const E=u[y];y.startsWith(`${C}-`)&&w.push([y,E,!1,y.split("-")])}});const x={...u};return h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.args&&(x.args=h.memoizedProps.args),h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.attach&&(x.attach=h.memoizedProps.attach),{memoized:x,changes:w}}const o2=typeof process<"u"&&!1;function tc(e,n){var r;const i=e.__r3f,u=i==null?void 0:i.root,a=u==null||u.getState==null?void 0:u.getState(),{memoized:f,changes:p}=r2(n)?n:q0(e,n),m=i==null?void 0:i.eventCount;e.__r3f&&(e.__r3f.memoizedProps=f);for(let h=0;hg[y],e),!(I&&I.set))){const[g,...y]=C.reverse();N=y.reverse().reduce((E,z)=>E[z],e),v=g}if(w===Z0+"remove")if(N.constructor){let g=lv.get(N.constructor);g||(g=new N.constructor,lv.set(N.constructor,g)),w=g[v]}else w=0;if(x&&i)w?i.handlers[v]=w:delete i.handlers[v],i.eventCount=Object.keys(i.handlers).length;else if(I&&I.set&&(I.copy||I instanceof Pa)){if(Array.isArray(w))I.fromArray?I.fromArray(w):I.set(...w);else if(I.copy&&w&&w.constructor&&(o2?I.constructor.name===w.constructor.name:I.constructor===w.constructor))I.copy(w);else if(w!==void 0){const g=I instanceof iy;!g&&I.setScalar?I.setScalar(w):I instanceof Pa&&w instanceof Pa?I.mask=w.mask:I.set(w),!K0()&&a&&!a.linear&&g&&I.convertSRGBToLinear()}}else if(N[v]=w,N[v]instanceof Jg&&N[v].format===qg&&N[v].type===$g&&a){const g=N[v];ec(g)&&ec(a.gl)?g.colorSpace=a.gl.outputColorSpace:g.encoding=a.gl.outputEncoding}il(e)}if(i&&i.parent&&e.raycast&&m!==i.eventCount){const h=zu(e).getState().internal,v=h.interaction.indexOf(e);v>-1&&h.interaction.splice(v,1),i.eventCount&&h.interaction.push(e)}return!(p.length===1&&p[0][0]==="onUpdate")&&p.length&&(r=e.__r3f)!=null&&r.parent&&tf(e),e}function il(e){var n,r;const i=(n=e.__r3f)==null||(r=n.root)==null||r.getState==null?void 0:r.getState();i&&i.internal.frames===0&&i.invalidate()}function tf(e){e.onUpdate==null||e.onUpdate(e)}function $0(e,n){e.manual||(G0(e)?(e.left=n.width/-2,e.right=n.width/2,e.top=n.height/2,e.bottom=n.height/-2):e.aspect=n.width/n.height,e.updateProjectionMatrix(),e.updateMatrixWorld())}function pu(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function u2(){var e;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return yl.DefaultEventPriority;switch((e=n.event)==null?void 0:e.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return yl.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return yl.ContinuousEventPriority;default:return yl.DefaultEventPriority}}function b0(e,n,r,i){const u=r.get(n);u&&(r.delete(n),r.size===0&&(e.delete(i),u.target.releasePointerCapture(i)))}function s2(e,n){const{internal:r}=e.getState();r.interaction=r.interaction.filter(i=>i!==n),r.initialHits=r.initialHits.filter(i=>i!==n),r.hovered.forEach((i,u)=>{(i.eventObject===n||i.object===n)&&r.hovered.delete(u)}),r.capturedMap.forEach((i,u)=>{b0(r.capturedMap,n,i,u)})}function a2(e){function n(m){const{internal:S}=e.getState(),h=m.offsetX-S.initialClick[0],v=m.offsetY-S.initialClick[1];return Math.round(Math.sqrt(h*h+v*v))}function r(m){return m.filter(S=>["Move","Over","Enter","Out","Leave"].some(h=>{var v;return(v=S.__r3f)==null?void 0:v.handlers["onPointer"+h]}))}function i(m,S){const h=e.getState(),v=new Set,w=[],x=S?S(h.internal.interaction):h.internal.interaction;for(let g=0;g{const E=mi(g.object),z=mi(y.object);return!E||!z?g.distance-y.distance:z.events.priority-E.events.priority||g.distance-y.distance}).filter(g=>{const y=pu(g);return v.has(y)?!1:(v.add(y),!0)});h.events.filter&&(N=h.events.filter(N,h));for(const g of N){let y=g.object;for(;y;){var I;(I=y.__r3f)!=null&&I.eventCount&&w.push({...g,eventObject:y}),y=y.parent}}if("pointerId"in m&&h.internal.capturedMap.has(m.pointerId))for(let g of h.internal.capturedMap.get(m.pointerId).values())v.has(pu(g.intersection))||w.push(g.intersection);return w}function u(m,S,h,v){const w=e.getState();if(m.length){const x={stopped:!1};for(const C of m){const N=mi(C.object)||w,{raycaster:I,pointer:g,camera:y,internal:E}=N,z=new Pr(g.x,g.y,0).unproject(y),O=G=>{var V,ie;return(V=(ie=E.capturedMap.get(G))==null?void 0:ie.has(C.eventObject))!=null?V:!1},D=G=>{const V={intersection:C,target:S.target};E.capturedMap.has(G)?E.capturedMap.get(G).set(C.eventObject,V):E.capturedMap.set(G,new Map([[C.eventObject,V]])),S.target.setPointerCapture(G)},H=G=>{const V=E.capturedMap.get(G);V&&b0(E.capturedMap,C.eventObject,V,G)};let W={};for(let G in S){let V=S[G];typeof V!="function"&&(W[G]=V)}let $={...C,...W,pointer:g,intersections:m,stopped:x.stopped,delta:h,unprojectedPoint:z,ray:I.ray,camera:y,stopPropagation(){const G="pointerId"in S&&E.capturedMap.get(S.pointerId);if((!G||G.has(C.eventObject))&&($.stopped=x.stopped=!0,E.hovered.size&&Array.from(E.hovered.values()).find(V=>V.eventObject===C.eventObject))){const V=m.slice(0,m.indexOf(C));a([...V,C])}},target:{hasPointerCapture:O,setPointerCapture:D,releasePointerCapture:H},currentTarget:{hasPointerCapture:O,setPointerCapture:D,releasePointerCapture:H},nativeEvent:S};if(v($),x.stopped===!0)break}}return m}function a(m){const{internal:S}=e.getState();for(const h of S.hovered.values())if(!m.length||!m.find(v=>v.object===h.object&&v.index===h.index&&v.instanceId===h.instanceId)){const w=h.eventObject.__r3f,x=w==null?void 0:w.handlers;if(S.hovered.delete(pu(h)),w!=null&&w.eventCount){const C={...h,intersections:m};x.onPointerOut==null||x.onPointerOut(C),x.onPointerLeave==null||x.onPointerLeave(C)}}}function f(m,S){for(let h=0;ha([]);case"onLostPointerCapture":return S=>{const{internal:h}=e.getState();"pointerId"in S&&h.capturedMap.has(S.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(S.pointerId)&&(h.capturedMap.delete(S.pointerId),a([]))})}}return function(h){const{onPointerMissed:v,internal:w}=e.getState();w.lastEvent.current=h;const x=m==="onPointerMove",C=m==="onClick"||m==="onContextMenu"||m==="onDoubleClick",I=i(h,x?r:void 0),g=C?n(h):0;m==="onPointerDown"&&(w.initialClick=[h.offsetX,h.offsetY],w.initialHits=I.map(E=>E.eventObject)),C&&!I.length&&g<=2&&(f(h,w.interaction),v&&v(h)),x&&a(I);function y(E){const z=E.eventObject,O=z.__r3f,D=O==null?void 0:O.handlers;if(O!=null&&O.eventCount)if(x){if(D.onPointerOver||D.onPointerEnter||D.onPointerOut||D.onPointerLeave){const H=pu(E),W=w.hovered.get(H);W?W.stopped&&E.stopPropagation():(w.hovered.set(H,E),D.onPointerOver==null||D.onPointerOver(E),D.onPointerEnter==null||D.onPointerEnter(E))}D.onPointerMove==null||D.onPointerMove(E)}else{const H=D[m];H?(!C||w.initialHits.includes(z))&&(f(h,w.interaction.filter(W=>!w.initialHits.includes(W))),H(E)):C&&w.initialHits.includes(z)&&f(h,w.interaction.filter(W=>!w.initialHits.includes(W)))}}u(I,h,g,y)}}return{handlePointer:p}}const c2=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],e1=e=>!!(e!=null&&e.render),ed=F.createContext(null),f2=(e,n)=>{const r=A0((p,m)=>{const S=new Pr,h=new Pr,v=new Pr;function w(g=m().camera,y=h,E=m().size){const{width:z,height:O,top:D,left:H}=E,W=z/O;y instanceof Pr?v.copy(y):v.set(...y);const $=g.getWorldPosition(S).distanceTo(v);if(G0(g))return{width:z/g.zoom,height:O/g.zoom,top:D,left:H,factor:1,distance:$,aspect:W};{const G=g.fov*Math.PI/180,V=2*Math.tan(G/2)*$,ie=V*(z/O);return{width:ie,height:V,top:D,left:H,factor:z/ie,distance:$,aspect:W}}}let x;const C=g=>p(y=>({performance:{...y.performance,current:g}})),N=new xv;return{set:p,get:m,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>e(m(),g),advance:(g,y)=>n(g,y,m()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new fy,pointer:N,mouse:N,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=m();x&&clearTimeout(x),g.performance.current!==g.performance.min&&C(g.performance.min),x=setTimeout(()=>C(m().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:w},setEvents:g=>p(y=>({...y,events:{...y.events,...g}})),setSize:(g,y,E,z,O)=>{const D=m().camera,H={width:g,height:y,top:z||0,left:O||0,updateStyle:E};p(W=>({size:H,viewport:{...W.viewport,...w(D,h,H)}}))},setDpr:g=>p(y=>{const E=J0(g);return{viewport:{...y.viewport,dpr:E,initialDpr:y.viewport.initialDpr||E}}}),setFrameloop:(g="always")=>{const y=m().clock;y.stop(),y.elapsedTime=0,g!=="never"&&(y.start(),y.elapsedTime=0),p(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:F.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,y,E)=>{const z=m().internal;return z.priority=z.priority+(y>0?1:0),z.subscribers.push({ref:g,priority:y,store:E}),z.subscribers=z.subscribers.sort((O,D)=>O.priority-D.priority),()=>{const O=m().internal;O!=null&&O.subscribers&&(O.priority=O.priority-(y>0?1:0),O.subscribers=O.subscribers.filter(D=>D.ref!==g))}}}}}),i=r.getState();let u=i.size,a=i.viewport.dpr,f=i.camera;return r.subscribe(()=>{const{camera:p,size:m,viewport:S,gl:h,set:v}=r.getState();if(m.width!==u.width||m.height!==u.height||S.dpr!==a){var w;u=m,a=S.dpr,$0(p,m),h.setPixelRatio(S.dpr);const x=(w=m.updateStyle)!=null?w:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(m.width,m.height,x)}p!==f&&(f=p,v(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(p)}})))}),r.subscribe(p=>e(p)),r};let mu,d2=new Set,p2=new Set,m2=new Set;function rc(e,n){if(e.size)for(const{callback:r}of e.values())r(n)}function vi(e,n){switch(e){case"before":return rc(d2,n);case"after":return rc(p2,n);case"tail":return rc(m2,n)}}let lc,ic;function oc(e,n,r){let i=n.clock.getDelta();for(n.frameloop==="never"&&typeof e=="number"&&(i=e-n.clock.elapsedTime,n.clock.oldTime=n.clock.elapsedTime,n.clock.elapsedTime=e),lc=n.internal.subscribers,mu=0;mu0)&&!((h=a.gl.xr)!=null&&h.isPresenting)&&(i+=oc(S,a))}if(r=!1,vi("after",S),i===0)return vi("tail",S),n=!1,cancelAnimationFrame(u)}function p(S,h=1){var v;if(!S)return e.forEach(w=>p(w.store.getState(),h));(v=S.gl.xr)!=null&&v.isPresenting||!S.internal.active||S.frameloop==="never"||(h>1?S.internal.frames=Math.min(60,S.internal.frames+h):r?S.internal.frames=2:S.internal.frames=1,n||(n=!0,requestAnimationFrame(f)))}function m(S,h=!0,v,w){if(h&&vi("before",S),v)oc(S,v,w);else for(const x of e.values())oc(S,x.store.getState());h&&vi("after",S)}return{loop:f,invalidate:p,advance:m}}function X2(e){const n=F.useRef(null);return jl(()=>void(n.current=e.current.__r3f),[e]),n}function nd(){const e=F.useContext(ed);if(!e)throw new Error("R3F: Hooks can only be used within the Canvas component!");return e}function Cr(e=r=>r,n){return nd()(e,n)}function n1(e,n=0){const r=nd(),i=r.getState().internal.subscribe,u=Y0(e);return jl(()=>i(u,n,r),[n,i,r]),null}const uv=new WeakMap;function t1(e,n){return function(r,...i){let u=uv.get(r);return u||(u=new r,uv.set(r,u)),e&&e(u),Promise.all(i.map(a=>new Promise((f,p)=>u.load(a,m=>{m.scene&&Object.assign(m,l2(m.scene)),f(m)},n,m=>p(new Error(`Could not load ${a}: ${m==null?void 0:m.message}`))))))}}function r1(e,n,r,i){const u=Array.isArray(n)?n:[n],a=Yw(t1(r,i),[e,...u],{equal:he.equ});return Array.isArray(n)?a:a[0]}r1.preload=function(e,n,r){const i=Array.isArray(n)?n:[n];return Xw(t1(r),[e,...i])};r1.clear=function(e,n){const r=Array.isArray(n)?n:[n];return Zw([e,...r])};const Ml=new Map,{invalidate:sv,advance:av}=v2(Ml),{reconciler:Gi,applyProps:tl}=e2(Ml,u2),rl={objects:"shallow",strict:!1},h2=(e,n)=>{const r=typeof e=="function"?e(n):e;return e1(r)?r:new oy({powerPreference:"high-performance",canvas:n,antialias:!0,alpha:!0,...e})};function g2(e,n){const r=typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement;if(n){const{width:i,height:u,top:a,left:f,updateStyle:p=r}=n;return{width:i,height:u,top:a,left:f,updateStyle:p}}else if(typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&e.parentElement){const{width:i,height:u,top:a,left:f}=e.parentElement.getBoundingClientRect();return{width:i,height:u,top:a,left:f,updateStyle:r}}else if(typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height,top:0,left:0,updateStyle:r};return{width:0,height:0,top:0,left:0}}function y2(e){const n=Ml.get(e),r=n==null?void 0:n.fiber,i=n==null?void 0:n.store;n&&console.warn("R3F.createRoot should only be called once!");const u=typeof reportError=="function"?reportError:console.error,a=i||f2(sv,av),f=r||Gi.createContainer(a,yl.ConcurrentRoot,null,!1,null,"",u,null);n||Ml.set(e,{fiber:f,store:a});let p,m=!1,S;return{configure(h={}){let{gl:v,size:w,scene:x,events:C,onCreated:N,shadows:I=!1,linear:g=!1,flat:y=!1,legacy:E=!1,orthographic:z=!1,frameloop:O="always",dpr:D=[1,2],performance:H,raycaster:W,camera:$,onPointerMissed:G}=h,V=a.getState(),ie=V.gl;V.gl||V.set({gl:ie=h2(v,e)});let me=V.raycaster;me||V.set({raycaster:me=new _v});const{params:pn,...Cn}=W||{};if(he.equ(Cn,me,rl)||tl(me,{...Cn}),he.equ(pn,me.params,rl)||tl(me,{params:{...me.params,...pn}}),!V.camera||V.camera===S&&!he.equ(S,$,rl)){S=$;const j=$ instanceof uy,Y=j?$:z?new bg(0,0,0,0,.1,1e3):new ey(75,0,.1,1e3);j||(Y.position.z=5,$&&(tl(Y,$),("aspect"in $||"left"in $||"right"in $||"bottom"in $||"top"in $)&&(Y.manual=!0,Y.updateProjectionMatrix())),!V.camera&&!($!=null&&$.rotation)&&Y.lookAt(0,0,0)),V.set({camera:Y}),me.camera=Y}if(!V.scene){let j;x instanceof Kp?j=x:(j=new Kp,x&&tl(j,x)),V.set({scene:ll(j)})}if(!V.xr){var Ke;const j=(ue,Ne)=>{const Je=a.getState();Je.frameloop!=="never"&&av(ue,!0,Je,Ne)},Y=()=>{const ue=a.getState();ue.gl.xr.enabled=ue.gl.xr.isPresenting,ue.gl.xr.setAnimationLoop(ue.gl.xr.isPresenting?j:null),ue.gl.xr.isPresenting||sv(ue)},ee={connect(){const ue=a.getState().gl;ue.xr.addEventListener("sessionstart",Y),ue.xr.addEventListener("sessionend",Y)},disconnect(){const ue=a.getState().gl;ue.xr.removeEventListener("sessionstart",Y),ue.xr.removeEventListener("sessionend",Y)}};typeof((Ke=ie.xr)==null?void 0:Ke.addEventListener)=="function"&&ee.connect(),V.set({xr:ee})}if(ie.shadowMap){const j=ie.shadowMap.enabled,Y=ie.shadowMap.type;if(ie.shadowMap.enabled=!!I,he.boo(I))ie.shadowMap.type=za;else if(he.str(I)){var mn;const ee={basic:sy,percentage:ay,soft:za,variance:cy};ie.shadowMap.type=(mn=ee[I])!=null?mn:za}else he.obj(I)&&Object.assign(ie.shadowMap,I);(j!==ie.shadowMap.enabled||Y!==ie.shadowMap.type)&&(ie.shadowMap.needsUpdate=!0)}const L=K0();L&&("enabled"in L?L.enabled=!E:"legacyMode"in L&&(L.legacyMode=E)),m||tl(ie,{outputEncoding:g?3e3:3001,toneMapping:y?ny:ty}),V.legacy!==E&&V.set(()=>({legacy:E})),V.linear!==g&&V.set(()=>({linear:g})),V.flat!==y&&V.set(()=>({flat:y})),v&&!he.fun(v)&&!e1(v)&&!he.equ(v,ie,rl)&&tl(ie,v),C&&!V.events.handlers&&V.set({events:C(a)});const U=g2(e,w);return he.equ(U,V.size,rl)||V.setSize(U.width,U.height,U.updateStyle,U.top,U.left),D&&V.viewport.dpr!==J0(D)&&V.setDpr(D),V.frameloop!==O&&V.setFrameloop(O),V.onPointerMissed||V.set({onPointerMissed:G}),H&&!he.equ(H,V.performance,rl)&&V.set(j=>({performance:{...j.performance,...H}})),p=N,m=!0,this},render(h){return m||this.configure(),Gi.updateContainer(Ee.jsx(S2,{store:a,children:h,onCreated:p,rootElement:e}),f,null,()=>{}),a},unmount(){l1(e)}}}function S2({store:e,children:n,onCreated:r,rootElement:i}){return jl(()=>{const u=e.getState();u.set(a=>({internal:{...a.internal,active:!0}})),r&&r(u),e.getState().events.connected||u.events.connect==null||u.events.connect(i)},[]),Ee.jsx(ed.Provider,{value:e,children:n})}function l1(e,n){const r=Ml.get(e),i=r==null?void 0:r.fiber;if(i){const u=r==null?void 0:r.store.getState();u&&(u.internal.active=!1),Gi.updateContainer(null,i,null,()=>{u&&setTimeout(()=>{try{var a,f,p,m;u.events.disconnect==null||u.events.disconnect(),(a=u.gl)==null||(f=a.renderLists)==null||f.dispose==null||f.dispose(),(p=u.gl)==null||p.forceContextLoss==null||p.forceContextLoss(),(m=u.gl)!=null&&m.xr&&u.xr.disconnect(),i2(u),Ml.delete(e)}catch{}},500)})}}function Z2(e,n,r){return Ee.jsx(w2,{children:e,container:n,state:r},n.uuid)}function w2({state:e={},children:n,container:r}){const{events:i,size:u,...a}=e,f=nd(),[p]=F.useState(()=>new _v),[m]=F.useState(()=>new xv),S=F.useCallback((v,w)=>{const x={...v};Object.keys(v).forEach(N=>{(c2.includes(N)||v[N]!==w[N]&&w[N])&&delete x[N]});let C;if(w&&u){const N=w.camera;C=v.viewport.getCurrentViewport(N,new Pr,u),N!==v.camera&&$0(N,u)}return{...x,scene:r,raycaster:p,pointer:m,mouse:m,previousRoot:f,events:{...v.events,...w==null?void 0:w.events,...i},size:{...v.size,...u},viewport:{...v.viewport,...C},...a}},[e]),[h]=F.useState(()=>{const v=f.getState();return A0((x,C)=>({...v,scene:r,raycaster:p,pointer:m,mouse:m,previousRoot:f,events:{...v.events,...i},size:{...v.size,...u},...a,set:x,get:C,setEvents:N=>x(I=>({...I,events:{...I.events,...N}}))}))});return F.useEffect(()=>{const v=f.subscribe(w=>h.setState(x=>S(w,x)));return()=>{v()}},[S]),F.useEffect(()=>{h.setState(v=>S(f.getState(),v))},[S]),F.useEffect(()=>()=>{h.destroy()},[]),Ee.jsx(Ee.Fragment,{children:Gi.createPortal(Ee.jsx(ed.Provider,{value:h,children:n}),h,null)})}Gi.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:F.version});const uc={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function k2(e){const{handlePointer:n}=a2(e);return{priority:1,enabled:!0,compute(r,i,u){i.pointer.set(r.offsetX/i.size.width*2-1,-(r.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(uc).reduce((r,i)=>({...r,[i]:n(i)}),{}),update:()=>{var r;const{events:i,internal:u}=e.getState();(r=u.lastEvent)!=null&&r.current&&i.handlers&&i.handlers.onPointerMove(u.lastEvent.current)},connect:r=>{var i;const{set:u,events:a}=e.getState();a.disconnect==null||a.disconnect(),u(f=>({events:{...f.events,connected:r}})),Object.entries((i=a.handlers)!=null?i:[]).forEach(([f,p])=>{const[m,S]=uc[f];r.addEventListener(m,p,{passive:S})})},disconnect:()=>{const{set:r,events:i}=e.getState();if(i.connected){var u;Object.entries((u=i.handlers)!=null?u:[]).forEach(([a,f])=>{if(i&&i.connected instanceof HTMLElement){const[p]=uc[a];i.connected.removeEventListener(p,f)}}),r(a=>({events:{...a.events,connected:void 0}}))}}}}function rf(e,n,r){var i,u,a,f,p;n==null&&(n=100);function m(){var h=Date.now()-f;h=0?i=setTimeout(m,n-h):(i=null,r||(p=e.apply(a,u),a=u=null))}var S=function(){a=this,u=arguments,f=Date.now();var h=r&&!i;return i||(i=setTimeout(m,n)),h&&(p=e.apply(a,u),a=u=null),p};return S.clear=function(){i&&(clearTimeout(i),i=null)},S.flush=function(){i&&(p=e.apply(a,u),a=u=null,clearTimeout(i),i=null)},S}rf.debounce=rf;var E2=rf;const cv=$u(E2);var _2=Object.defineProperty,x2=Object.defineProperties,C2=Object.getOwnPropertyDescriptors,fv=Object.getOwnPropertySymbols,P2=Object.prototype.hasOwnProperty,z2=Object.prototype.propertyIsEnumerable,dv=(e,n,r)=>n in e?_2(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,pv=(e,n)=>{for(var r in n||(n={}))P2.call(n,r)&&dv(e,r,n[r]);if(fv)for(var r of fv(n))z2.call(n,r)&&dv(e,r,n[r]);return e},N2=(e,n)=>x2(e,C2(n)),mv,vv;typeof window<"u"&&((mv=window.document)!=null&&mv.createElement||((vv=window.navigator)==null?void 0:vv.product)==="ReactNative")?F.useLayoutEffect:F.useEffect;function i1(e,n,r){if(!e)return;if(r(e)===!0)return e;let i=e.child;for(;i;){const u=i1(i,n,r);if(u)return u;i=i.sibling}}function o1(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const hv=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=hv;return}return hv.apply(this,arguments)};const td=o1(F.createContext(null));class u1 extends F.Component{render(){return F.createElement(td.Provider,{value:this._reactInternals},this.props.children)}}function R2(){const e=F.useContext(td);if(e===null)throw new Error("its-fine: useFiber must be called within a !");const n=F.useId();return F.useMemo(()=>{for(const i of[e,e==null?void 0:e.alternate]){if(!i)continue;const u=i1(i,!1,a=>{let f=a.memoizedState;for(;f;){if(f.memoizedState===n)return!0;f=f.next}});if(u)return u}},[e,n])}function L2(){const e=R2(),[n]=F.useState(()=>new Map);n.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const u=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;u&&u!==td&&!n.has(u)&&n.set(u,F.useContext(o1(u)))}r=r.return}return n}function T2(){const e=L2();return F.useMemo(()=>Array.from(e.keys()).reduce((n,r)=>i=>F.createElement(n,null,F.createElement(r.Provider,N2(pv({},i),{value:e.get(r)}))),n=>F.createElement(u1,pv({},n))),[e])}function M2({debounce:e,scroll:n,polyfill:r,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const u=r||typeof window<"u"&&window.ResizeObserver,[a,f]=F.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!u)return a.width=1280,a.height=800,[()=>{},a,()=>{}];const p=F.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),m=e?typeof e=="number"?e:e.scroll:null,S=e?typeof e=="number"?e:e.resize:null,h=F.useRef(!1);F.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[v,w,x]=F.useMemo(()=>{const g=()=>{if(!p.current.element)return;const{left:y,top:E,width:z,height:O,bottom:D,right:H,x:W,y:$}=p.current.element.getBoundingClientRect(),G={left:y,top:E,width:z,height:O,bottom:D,right:H,x:W,y:$};p.current.element instanceof HTMLElement&&i&&(G.height=p.current.element.offsetHeight,G.width=p.current.element.offsetWidth),Object.freeze(G),h.current&&!j2(p.current.lastBounds,G)&&f(p.current.lastBounds=G)};return[g,S?cv(g,S):g,m?cv(g,m):g]},[f,i,m,S]);function C(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",x,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function N(){var g;p.current.element&&(p.current.resizeObserver=new u(w),(g=p.current.resizeObserver)==null||g.observe(p.current.element),n&&p.current.scrollContainers&&p.current.scrollContainers.forEach(y=>y.addEventListener("scroll",x,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{x()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}const I=g=>{!g||g===p.current.element||(C(),p.current.element=g,p.current.scrollContainers=s1(g),N())};return I2(x,!!n),O2(w),F.useEffect(()=>{C(),N()},[n,x,w]),F.useEffect(()=>C,[]),[I,a,v]}function O2(e){F.useEffect(()=>{const n=e;return window.addEventListener("resize",n),()=>void window.removeEventListener("resize",n)},[e])}function I2(e,n){F.useEffect(()=>{if(n){const r=e;return window.addEventListener("scroll",r,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",r,!0)}},[e,n])}function s1(e){const n=[];if(!e||e===document.body)return n;const{overflow:r,overflowX:i,overflowY:u}=window.getComputedStyle(e);return[r,i,u].some(a=>a==="auto"||a==="scroll")&&n.push(e),[...n,...s1(e.parentElement)]}const D2=["x","y","top","bottom","left","right","width","height"],j2=(e,n)=>D2.every(r=>e[r]===n[r]),F2=F.forwardRef(function({children:n,fallback:r,resize:i,style:u,gl:a,events:f=k2,eventSource:p,eventPrefix:m,shadows:S,linear:h,flat:v,legacy:w,orthographic:x,frameloop:C,dpr:N,performance:I,raycaster:g,camera:y,scene:E,onPointerMissed:z,onCreated:O,...D},H){F.useMemo(()=>bw(dy),[]);const W=T2(),[$,G]=M2({scroll:!0,debounce:{scroll:50,resize:0},...i}),V=F.useRef(null),ie=F.useRef(null);F.useImperativeHandle(H,()=>V.current);const me=Y0(z),[pn,Cn]=F.useState(!1),[Ke,mn]=F.useState(!1);if(pn)throw pn;if(Ke)throw Ke;const L=F.useRef(null);jl(()=>{const j=V.current;G.width>0&&G.height>0&&j&&(L.current||(L.current=y2(j)),L.current.configure({gl:a,events:f,shadows:S,linear:h,flat:v,legacy:w,orthographic:x,frameloop:C,dpr:N,performance:I,raycaster:g,camera:y,scene:E,size:G,onPointerMissed:(...Y)=>me.current==null?void 0:me.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(p?n2(p)?p.current:p:ie.current),m&&Y.setEvents({compute:(ee,ue)=>{const Ne=ee[m+"X"],Je=ee[m+"Y"];ue.pointer.set(Ne/ue.size.width*2-1,-(Je/ue.size.height)*2+1),ue.raycaster.setFromCamera(ue.pointer,ue.camera)}}),O==null||O(Y)}}),L.current.render(Ee.jsx(W,{children:Ee.jsx(X0,{set:mn,children:Ee.jsx(F.Suspense,{fallback:Ee.jsx(t2,{set:Cn}),children:n})})})))}),F.useEffect(()=>{const j=V.current;if(j)return()=>l1(j)},[]);const U=p?"none":"auto";return Ee.jsx("div",{ref:ie,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...u},...D,children:Ee.jsx("div",{ref:$,style:{width:"100%",height:"100%"},children:Ee.jsx("canvas",{ref:V,style:{display:"block"},children:r})})})}),J2=F.forwardRef(function(n,r){return Ee.jsx(u1,{children:Ee.jsx(F2,{...n,ref:r})})});function U2(e,n){if(e===n)return!0;if(!e||!n)return e===n;for(const r in e)if(e[r]!==n[r])return!1;for(const r in n)if(e[r]!==n[r])return!1;return!0}function vs(e){const n=F.useRef();return U2(n.current,e)||(n.current=e),n.current}function gv(e){return/^on/g.test(e)}function yv(e){return e.replace(/^on/,"").replace(/[a-z][A-Z]/g,n=>`${n[0]}-${n[1]}`).toLowerCase()}function Sv(e){return e.split("-")}function a1(e,n){let r=e;const i=[...n];for(;i.length!==0;){const u=i.shift();r=r[u]}return r}function wv(e,n,r){const i=[...n],u=i.pop();a1(e,i)[u]=r}function A2(e,n){F.useEffect(()=>{if(e!==null){for(const r in n)if(gv(r))e.addEventListener(yv(r),n[r]);else{const i=Sv(r);a1(e,i),wv(e,i,n[r])}return()=>{for(const r in n)gv(r)&&e.removeEventListener(yv(r),n[r]);for(const r in n){const i=Sv(r);wv(e,i,n[r])}}}},[e,vs(n)])}function c1(e,n){F.useEffect(()=>{if(e===null)return;const r={};for(const i in n)i in e&&(r[i]=e[i],e[i]=n[i]);return()=>{for(const i in r)e[i]=r[i]}},[e,vs(n)])}function H2(){const[e,n]=F.useState(0);return[e,()=>n(e+1)]}const $i=F.createContext(null);function B2({children:e}){const n=F.useContext($i),r=F.useRef();return F.useEffect(()=>{n&&(r.current.matrixWorld=n.group.matrixWorld)},[n]),Ee.jsx("group",{ref:r,matrixWorldAutoUpdate:!1,matrixAutoUpdate:!1,children:e})}const kv=new Pr;function q2(e){const{lat:n=0,lon:r=0,height:i=0,az:u=0,el:a=0,roll:f=0,children:p}=e,m=F.useRef(),S=F.useContext($i),h=S&&S.ellipsoid||null;return F.useEffect(()=>{if(h===null)return;const v=m.current;v.matrix.identity(),h.getRotationMatrixFromAzElRoll(n,r,u,a,f,v.matrix),h.getCartographicToPosition(n,r,i,kv),v.matrix.setPosition(kv),v.matrix.decompose(v.position,v.quaternion,v.scale),v.updateMatrixWorld()},[h,n,r,i,u,a,f]),Ee.jsx("group",{ref:m,children:p})}const $2=F.forwardRef(function(n,r){const{plugin:i,args:u,...a}=n,f=F.useContext($i),p=F.useMemo(()=>{if(f===null)return null;let m;return Array.isArray(u)?m=new i(...u):m=new i(u),m},[f,i,vs(u)]);c1(p,a),F.useEffect(()=>{r&&(r instanceof Function?r(p):r.current=p)},[p,r]),F.useEffect(()=>{if(f!==null)return f.registerPlugin(p),()=>{f.unregisterPlugin(p)}},[p,f])}),b2=F.forwardRef(function(n,r){const{url:i,group:u={},children:a,...f}=n,[p,m]=F.useState(null),[S,h,v]=Cr(C=>[C.camera,C.gl,C.invalidate]),[w,x]=H2();return F.useEffect(()=>{const C=new vy(i);return C.addEventListener("load-content",()=>v()),C.addEventListener("force-rerender",()=>v()),m(C),()=>{C.dispose()}},[i,v]),n1(()=>{p!==null&&(S.updateMatrixWorld(),p.setResolutionFromRenderer(S,h),p.update())}),F.useEffect(()=>{if(p!==null)return p.setCamera(S),()=>{p.deleteCamera(S)}},[p,S]),F.useEffect(()=>{r&&(r instanceof Function?r(p):r.current=p)},[p,r]),A2(p,f),F.useEffect(()=>{x()},[p,vs(f)]),Ee.jsxs(Ee.Fragment,{children:[p?Ee.jsx("primitive",{object:p.group,...u}):null,Ee.jsx($i.Provider,{value:p,children:Ee.jsx(B2,{children:a})},w)]})}),f1=F.forwardRef(function(n,r){const{controlsConstructor:i,domElement:u,scene:a,camera:f,tilesRenderer:p,...m}=n,[S]=Cr(O=>[O.camera]),[h]=Cr(O=>[O.gl]),[v]=Cr(O=>[O.scene]),[w]=Cr(O=>[O.invalidate]),[x]=Cr(O=>[O.get]),[C]=Cr(O=>[O.set]),N=F.useContext($i),I=f||S||null,g=a||v||null,y=u||h.domElement||null,E=p||N||null,z=F.useMemo(()=>new i,[i]);F.useEffect(()=>{r&&(r instanceof Function?r(z):r.current=z)},[z,r]),F.useEffect(()=>{const O=()=>w();return z.addEventListener("change",O),z.addEventListener("start",O),z.addEventListener("end",O),()=>{z.removeEventListener("change",O),z.removeEventListener("start",O),z.removeEventListener("end",O)}},[z,w]),F.useEffect(()=>{z.setCamera(I)},[z,I]),F.useEffect(()=>{z.setScene(g)},[z,g]),F.useEffect(()=>{z.setTilesRenderer(E)},[z,E]),F.useEffect(()=>(z.attach(y),()=>{z.detach()}),[z,y]),F.useEffect(()=>{const O=x().controls;return C({controls:z}),()=>C({controls:O})},[z,x,C]),n1(()=>{z.update()},-1),c1(z,m)});function ek(e){return Ee.jsx(f1,{...e,controlsConstructor:py})}function nk(e){return Ee.jsx(f1,{...e,controlsConstructor:my})}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var n=1;n{r.deleteCamera(u),e.deleteCamera(u),r.setCamera(m),e.setCamera(m),d.setCamera(m)}),d=new y(l,t.camera,s.domElement),d.minZoomDistance=2,d.cameraRadius=1,c=new S,c.rotation.set(Math.PI/2,0,0),l.add(c),w(),f(),window.addEventListener("resize",f,!1);const o=new D,n=o.addFolder("camera");n.add(a,"orthographic").onChange(m=>{t.fixedPoint.copy(d.pivotPoint),t.syncCameras(),d.adjustCamera(t.perspectiveCamera),d.adjustCamera(t.orthographicCamera),t.toggle()}),n.add(a,"transitionDuration",0,1.5);const i=o.addFolder("fade");i.add(a,"useFade"),i.add(a,"fadeRootTiles"),i.add(a,"errorTarget",0,1e3),i.add(a,"fadeDuration",0,5),i.add(a,"renderScale",.1,1,.05).onChange(m=>s.setPixelRatio(m*window.devicePixelRatio));const C=i.add(a,"fadingGroundTiles").listen().disable();C.domElement.style.opacity=1,o.add(a,"reinstantiateTiles"),o.open()}function w(){e&&(e.dispose(),e.group.removeFromParent(),r.dispose(),r.group.removeFromParent()),e=new p("https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize_tileset.json"),e.fetchOptions.mode="cors",e.lruCache.minSize=900,e.lruCache.maxSize=1300,e.errorTarget=12,e.registerPlugin(new g),e.setCamera(t.camera),r=new p("https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_sky/0528_0260184_to_s64o256_sky_tileset.json"),r.fetchOptions.mode="cors",r.lruCache=e.lruCache,r.registerPlugin(new g),r.setCamera(t.camera),c.add(e.group,r.group)}function f(){const{perspectiveCamera:o,orthographicCamera:n}=t,i=window.innerWidth/window.innerHeight;n.bottom=-40,n.top=40,n.left=-40*i,n.right=40*i,n.updateProjectionMatrix(),o.aspect=i,o.updateProjectionMatrix(),s.setSize(window.innerWidth,window.innerHeight)}function h(){requestAnimationFrame(h),d.enabled=!t.animating,d.update(),t.duration=1e3*a.transitionDuration,t.update();const o=t.camera;o.updateMatrixWorld();const n=e.getPluginByName("FADE_TILES_PLUGIN");n.fadeRootTiles=a.fadeRootTiles,n.fadeDuration=a.useFade?a.fadeDuration*1e3:0,e.errorTarget=a.errorTarget,e.setCamera(o),e.setResolutionFromRenderer(o,s),e.update();const i=r.getPluginByName("FADE_TILES_PLUGIN");i.fadeRootTiles=a.fadeRootTiles,i.fadeDuration=a.useFade?a.fadeDuration*1e3:0,r.setCamera(o),r.setResolutionFromRenderer(o,s),r.update(),s.render(l,o),a.fadingGroundTiles=n.fadingTiles+" tiles"} diff --git a/example/bundle/assets/globe-DIPqhisI.js b/example/bundle/assets/globe-DIPqhisI.js new file mode 100644 index 00000000..ceb8f020 --- /dev/null +++ b/example/bundle/assets/globe-DIPqhisI.js @@ -0,0 +1 @@ +import{k as l,i as a}from"./three.module-_fL2BuBc.js";import{c as u,j as o,r as p,C as d,T as g,d as s,G as x,f as h,a as f}from"./extends-BiwV-o27.js";import{D as j}from"./DRACOLoader-BZaFS3O1.js";import{u as v,T as P}from"./leva.esm-CLDXiY66.js";import{G as T}from"./GoogleCloudAuthPlugin-BapiqItz.js";import{G as C}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import{T as G}from"./TileCompressionPlugin-CHefINqs.js";import{U as M}from"./UpdateOnChangePlugin-UYN3BMUO.js";import{T as D}from"./TilesFadePlugin-oL7QwVsE.js";import{E}from"./Environment-JXyVb9Rj.js";import{C as y,a as k}from"./CameraTransition-CM6KQSA4.js";import"./EnvironmentControls-CJG7lPg-.js";import"./GlobeControls-5ygGpakr.js";import"./Ellipsoid-CKpUFSOi.js";import"./TilesRenderer-DkGmB3Pz.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./CameraTransitionManager-CKH8Mdl-.js";const R=new j().setDecoderPath("https://www.gstatic.com/draco/v1/decoders/"),n=new l,m=new l;function b(){const i=p.useRef();return f(({camera:t})=>{const e=i.current;n.setFromMatrixPosition(t.matrixWorld),e.position.set(0,0,0),e.updateMatrixWorld(),m.setFromMatrixPosition(e.matrixWorld);let r;if(t.isPerspectiveCamera){const c=n.distanceTo(m);r=Math.max(.05*c*Math.atan(t.fov*a.DEG2RAD),25)}else r=Math.max((t.top-t.bottom)*.05/t.zoom,25);e.scale.setScalar(r),e.position.z=r*.5}),o.jsxs("mesh",{ref:i,"rotation-x":-Math.PI/2,raycast:()=>{},children:[o.jsx("coneGeometry",{args:[.3]}),o.jsx("meshStandardMaterial",{color:15483002,emissive:15483002,emissiveIntensity:.25})]})}function w(){const i={apiToken:{value:localStorage.getItem("google-token")||"put-your-api-key-here",onChange:r=>localStorage.setItem("google-token",r),transient:!1},ortho:!1},{apiToken:t,ortho:e}=v(i);return o.jsxs(d,{frameloop:"demand",camera:{position:[0,.5*1e7,1.5*1e7]},style:{width:"100%",height:"100%",position:"absolute",margin:0,left:0,top:0},flat:!0,children:[o.jsx("color",{attach:"background",args:[1118481]}),o.jsxs(g,{group:{rotation:[-Math.PI/2,0,0]},children:[o.jsx(s,{plugin:T,args:{apiToken:t}}),o.jsx(s,{plugin:C,dracoLoader:R}),o.jsx(s,{plugin:G}),o.jsx(s,{plugin:M}),o.jsx(s,{plugin:D}),o.jsx(x,{enableDamping:!0}),o.jsx(P,{}),o.jsx(h,{lat:34.2013*a.DEG2RAD,lon:-118.1714*a.DEG2RAD,height:350,children:o.jsx(b,{})}),";",o.jsx(y,{})]}),o.jsx(E,{preset:"sunset",backgroundBlurriness:.9,environmentIntensity:1}),o.jsx(k,{mode:e?"orthographic":"perspective"})]})}u(document.getElementById("root")).render(o.jsx(p.StrictMode,{children:o.jsx(w,{})})); diff --git a/example/bundle/assets/gltf-DcEUtpxO.js b/example/bundle/assets/gltf-DcEUtpxO.js new file mode 100644 index 00000000..bc1e4d45 --- /dev/null +++ b/example/bundle/assets/gltf-DcEUtpxO.js @@ -0,0 +1 @@ +import{S as k,W as M,P as L,a as b,D as C,A as F,L as P}from"./three.module-_fL2BuBc.js";import{O as S}from"./OrbitControls-Ck5AM9Mk.js";import{D as x}from"./DRACOLoader-BZaFS3O1.js";import{G}from"./GLTFLoader-CFm4138C.js";import{G as g}from"./GLTFExtensionLoader-BffG-g_T.js";import"./LoaderBase-CVSPpjX2.js";let s,t,r,e,i;R();h();function R(){r=new k,e=new M({antialias:!0}),e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),e.setClearColor(1383455),e.shadowMap.enabled=!0,e.shadowMap.type=L,document.body.appendChild(e.domElement),s=new b(60,window.innerWidth/window.innerHeight,1,4e3),s.position.set(3,10,20),t=new S(s,e.domElement),t.screenSpacePanning=!1,t.minDistance=1,t.maxDistance=2e3,i=new C(16777215,1.25),i.position.set(1,2,3).multiplyScalar(40),i.castShadow=!0,i.shadow.bias=-.01,i.shadow.mapSize.setScalar(2048);const d=i.shadow.camera;d.left=-200,d.bottom=-200,d.right=200,d.top=200,d.updateProjectionMatrix(),r.add(i);const p=new F(16777215,.05);r.add(p);let c=0;const f=["https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMilkTruck/glTF-Binary/CesiumMilkTruck.glb","https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMilkTruck/glTF-Embedded/CesiumMilkTruck.gltf","https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMilkTruck/glTF/CesiumMilkTruck.gltf"];for(const o of f){const n=new g;n.workingPath=n.workingPathForURL(o),n.loadAsync(o).then(a=>{a.scene.position.set(c+=5,0,0),t.target.set(c/2,0,0),t.update(),console.log("default loader:",{gltf:a,url:o}),r.add(a.scene)})}const T=["https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMilkTruck/glTF-Draco/CesiumMilkTruck.gltf","https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Box/glTF-Binary/Box.glb"],l=new P,m=new G(l),w=new x(l);w.setDecoderPath("https://unpkg.com/three@0.153.0/examples/jsm/libs/draco/gltf/"),m.setDRACOLoader(w),l.addHandler(/\.gltf$/,m),l.addHandler(/\.glb$/,m);for(const o of T){const n=new g(l);n.workingPath=n.workingPathForURL(o),n.loadAsync(o).then(a=>{a.scene.position.set(c+=5,0,0),t.target.set(c/2,0,0),t.update(),console.log("custom loader:",{gltf:a,url:o}),r.add(a.scene)})}u(),window.addEventListener("resize",u,!1)}function u(){s.aspect=window.innerWidth/window.innerHeight,e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),s.updateProjectionMatrix()}function h(){requestAnimationFrame(h),D()}function D(){e.render(r,s)} diff --git a/example/bundle/assets/googleMapsAerial-3Ki-FxFD.js b/example/bundle/assets/googleMapsAerial-3Ki-FxFD.js new file mode 100644 index 00000000..fc65580c --- /dev/null +++ b/example/bundle/assets/googleMapsAerial-3Ki-FxFD.js @@ -0,0 +1,2 @@ +import{S as f,W as h,a as P,i as l,R}from"./three.module-_fL2BuBc.js";import{D as y}from"./DRACOLoader-BZaFS3O1.js";import{g as D}from"./lil-gui.module.min-Bc0DeA9g.js";import{O as L}from"./OrbitControls-Ck5AM9Mk.js";import{T as x}from"./TilesRenderer-DkGmB3Pz.js";import{G as T}from"./GoogleCloudAuthPlugin-BapiqItz.js";import{T as A}from"./TileCompressionPlugin-CHefINqs.js";import{T as C}from"./TilesFadePlugin-oL7QwVsE.js";import{G as E}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import{W as G}from"./I3DMLoader-QCOT_FZM.js";import{t as S}from"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";let t,i,m,o,e;const W=new R;W.firstHitOnly=!0;const b=localStorage.getItem("googleApiKey")??"put-your-api-key-here",d={apiKey:b,reload:g};v();w();function g(){localStorage.setItem("googleApiKey",d.apiKey),e&&(m.remove(e.group),e.dispose(),e=null),e=new x,e.registerPlugin(new T({apiToken:d.apiKey})),e.registerPlugin(new A),e.registerPlugin(new C),e.registerPlugin(new E({dracoLoader:new y().setDecoderPath("https://unpkg.com/three@0.153.0/examples/jsm/libs/draco/gltf/")})),e.setLatLonToYUp(35.6586*l.DEG2RAD,139.7454*l.DEG2RAD),m.add(e.group),e.setResolutionFromRenderer(t,o),e.setCamera(t)}function v(){m=new f,o=new h({antialias:!0}),o.setClearColor(1383455),document.body.appendChild(o.domElement),t=new P(60,window.innerWidth/window.innerHeight,100,16e5),t.position.set(1e3,1e3,1e3).multiplyScalar(.5),i=new L(t,o.domElement),i.minDistance=500,i.maxDistance=1e4*2,i.minPolarAngle=0,i.maxPolarAngle=3*Math.PI/8,i.enableDamping=!0,i.autoRotate=!0,i.autoRotateSpeed=.5,i.enablePan=!1,g(),c(),window.addEventListener("resize",c,!1),window.addEventListener("hashchange",u);const n=new D;n.width=300,n.add(d,"apiKey"),n.add(d,"reload"),n.open(),u()}function c(){t.aspect=window.innerWidth/window.innerHeight,o.setSize(window.innerWidth,window.innerHeight),t.updateProjectionMatrix(),o.setPixelRatio(window.devicePixelRatio)}function u(){const r=window.location.hash.replace(/^#/,"").split(/,/g).map(s=>parseFloat(s));if(r.length!==2||r.findIndex(s=>Number.isNaN(s))!==-1)return;const[p,a]=r;e.setLatLonToYUp(p*l.DEG2RAD,a*l.DEG2RAD)}function w(){requestAnimationFrame(w),e&&(i.update(),e.setResolutionFromRenderer(t,o),e.setCamera(t),t.updateMatrixWorld(),e.update(),F())}function F(){var n;if(o.render(m,t),e){const r=e.group.matrixWorld.clone().invert(),p=t.position.clone().applyMatrix4(r),a={};G.getPositionToCartographic(p,a);const s=((n=e.getAttributions()[0])==null?void 0:n.value)||"";document.getElementById("credits").innerText=S(a.lat,a.lon)+` +`+s}} diff --git a/example/bundle/assets/googleMapsExample-Bi3XX3O7.js b/example/bundle/assets/googleMapsExample-Bi3XX3O7.js new file mode 100644 index 00000000..b4f54487 --- /dev/null +++ b/example/bundle/assets/googleMapsExample-Bi3XX3O7.js @@ -0,0 +1,18 @@ +import{j as F,k as R,l as z,m as O,g as V,B as H,d as j,n as N,o as $,p as K,q as E,W as q,S as Q,a as X,O as Z,i as g}from"./three.module-_fL2BuBc.js";import{D as J}from"./DRACOLoader-BZaFS3O1.js";import{g as Y}from"./lil-gui.module.min-Bc0DeA9g.js";import{S as ee}from"./stats.module--VATS4Kh.js";import{F as te,G as ae}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import{L as ie,T as se}from"./TilesRenderer-DkGmB3Pz.js";import{G as re}from"./GoogleCloudAuthPlugin-BapiqItz.js";import{T as ne}from"./TileCompressionPlugin-CHefINqs.js";import{U as oe}from"./UpdateOnChangePlugin-UYN3BMUO.js";import{T as ce}from"./TilesFadePlugin-oL7QwVsE.js";import{C as le}from"./CameraTransitionManager-CKH8Mdl-.js";import{G as de}from"./GlobeControls-5ygGpakr.js";import{C as U,t as he}from"./Ellipsoid-CKpUFSOi.js";import{W as w}from"./I3DMLoader-QCOT_FZM.js";import"./GLTFLoader-CFm4138C.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./LoaderBase-CVSPpjX2.js";import"./B3DMLoader-s-i-FwTx.js";import"./readMagicBytes-Da5ueiou.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./EllipsoidRegion-CVV0HJli.js";import"./EnvironmentControls-CJG7lPg-.js";class ue{set delay(e){this.deferCallbacks.delay=e}get delay(){return this.deferCallbacks.delay}set bytesTarget(e){this.lruCache.minBytesSize=e}get bytesTarget(){return this.lruCache.minBytesSize}get estimatedGpuBytes(){return this.lruCache.cachedBytes}constructor(e={}){const{delay:t=0,bytesTarget:a=0}=e;this.name="UNLOAD_TILES_PLUGIN",this.tiles=null,this.lruCache=new ie,this.deferCallbacks=new me,this.delay=t,this.bytesTarget=a}init(e){this.tiles=e;const{lruCache:t,deferCallbacks:a}=this;a.callback=s=>{t.markUnused(s),t.scheduleUnload(!1)};const r=s=>{const i=s.cached.scene;e.visibleTiles.has(s)||e.invokeOnePlugin(o=>o.unloadTileFromGPU&&o.unloadTileFromGPU(i,s))};this._onUpdateBefore=()=>{t.unloadPriorityCallback=e.lruCache.unloadPriorityCallback,t.computeMemoryUsageCallback=e.lruCache.computeMemoryUsageCallback,t.minSize=1/0,t.maxSize=1/0,t.maxBytesSize=1/0,t.unloadPercent=1,t.autoMarkUnused=!1},this._onVisibilityChangeCallback=({tile:s,visible:i})=>{i?(t.add(s,r),t.markUsed(s),a.cancel(s)):a.run(s)},e.forEachLoadedModel((s,i)=>{const n=e.visibleSet.has(i);this._onVisibilityChangeCallback({scene:s,visible:n})}),e.addEventListener("tile-visibility-change",this._onVisibilityChangeCallback),e.addEventListener("update-before",this._onUpdateBefore)}unloadTileFromGPU(e,t){e&&e.traverse(a=>{if(a.material){const r=a.material;r.dispose();for(const s in r){const i=r[s];i&&i.isTexture&&i.dispose()}}a.geometry&&a.geometry.dispose()})}dispose(){this.tiles.removeEventListener("tile-visibility-change",this._onVisibilityChangeCallback),this.tiles.removeEventListener("update-before",this._onUpdateBefore),this.deferCallbacks.cancelAll()}}class me{constructor(e=()=>{}){this.map=new Map,this.callback=e,this.delay=0}run(e){const{map:t,delay:a}=this;if(t.has(e))throw new Error("DeferCallbackManager: Callback already initialized.");a===0?this.callback(e):t.set(e,setTimeout(()=>this.callback(e),a))}cancel(e){const{map:t}=this;t.has(e)&&(clearTimeout(t.get(e)),t.delete(e))}cancelAll(){this.map.forEach((e,t)=>{this.cancel(t)})}}const pe=new F,D=new R,v=new R;class ge extends z{constructor(...e){super(...e),this.resetDistance=1e4,this._matricesTextureHandle=null,this._lastCameraPos=new F,this._forceUpdate=!0}setMatrixAt(...e){super.setMatrixAt(...e),this._forceUpdate=!0}onBeforeRender(e,t,a,r,s,i){super.onBeforeRender(e,t,a,r,s,i),D.setFromMatrixPosition(a.matrixWorld),v.setFromMatrixPosition(this._lastCameraPos);const n=this._matricesTexture;let o=this._modelViewMatricesTexture;if((!o||o.image.width!==n.image.width||o.image.height!==n.image.height)&&(o&&o.dispose(),o=n.clone(),o.source=new O({...o.image,data:o.image.data.slice()}),this._modelViewMatricesTexture=o),this._forceUpdate||D.distanceTo(v)>this.resetDistance){const d=n.image.data,m=o.image.data;for(let h=0;h{const C=this.getGeometryRangeAt(m),{reservedIndexCount:x,reservedVertexCount:T}=C;if(x>=s&&T>=i){const b=s-x+(i-T);b{const h=this.unusedVertexCountthis.deleteGeometry(h)),i.length=0,this.optimize(),o())){const h=this.geometry.index,C=this.geometry.attributes.position;let x,T;if(h){const b=Math.ceil(s*h.count);x=Math.max(b,a,d.count)+h.count}else x=Math.max(this.unusedIndexCount,a);if(C){const b=Math.ceil(s*C.count);T=Math.max(b,t,m.count)+C.count}else T=Math.max(this.unusedVertexCount,t);this.setGeometrySize(T,x)}n=super.addGeometry(e,t,a)}return n}addInstance(e){if(this.maxInstanceCount===this.instanceCount){const t=Math.ceil(this.maxInstanceCount*(1+this.expandPercent));this.setInstanceCount(Math.min(t,this.maxInstanceExpansionSize))}return super.addInstance(e)}deleteInstance(e){const t=this.getGeometryIdAt(e);return t!==-1&&this._freeGeometryIds.push(t),super.deleteInstance(e)}raycastInstance(e,t,a){const r=this.geometry,s=this.getGeometryIdAt(e);y.material=this.material,y.geometry.index=r.index,y.geometry.attributes=r.attributes;const i=this.getGeometryRangeAt(s);y.geometry.setDrawRange(i.start,i.count),y.geometry.boundingBox===null&&(y.geometry.boundingBox=new H),y.geometry.boundingSphere===null&&(y.geometry.boundingSphere=new j),this.getMatrixAt(e,y.matrixWorld).premultiply(this.matrixWorld),this.getBoundingBoxAt(s,y.geometry.boundingBox),this.getBoundingSphereAt(s,y.geometry.boundingSphere),y.raycast(t,_);for(let n=0,o=_.length;n{e.vertexShader=e.vertexShader.replace("#include ",` + #include + varying float texture_index; + `).replace("#include ",` + #include + texture_index = getIndirectIndex( gl_DrawID ); + `),e.fragmentShader=e.fragmentShader.replace("#include ",` + #ifdef USE_MAP + precision highp sampler2DArray; + uniform sampler2DArray map; + varying float texture_index; + #endif + `).replace("#include ",` + #ifdef USE_MAP + diffuseColor *= texture( map, vec3( vMapUv, texture_index ) ); + #endif + `)}}const S=new te(new N),L=new $(new Uint8Array([255,255,255,255]),1,1);L.needsUpdate=!0;class Ce{constructor(e={}){if(parseInt(K)<170)throw new Error("BatchedTilesPlugin: Three.js revision 170 or higher required.");e={instanceCount:500,vertexCount:750,indexCount:2e3,expandPercent:.25,maxInstanceCount:1/0,discardOriginalContent:!0,material:null,renderer:null,...e},this.name="BATCHED_MESH_PLUGIN",this.priority=-1;const t=e.renderer.getContext();this.instanceCount=e.instanceCount,this.vertexCount=e.vertexCount,this.indexCount=e.indexCount,this.material=e.material?e.material.clone():null,this.expandPercent=e.expandPercent,this.maxInstanceCount=Math.min(e.maxInstanceCount,t.getParameter(t.MAX_3D_TEXTURE_SIZE)),this.renderer=e.renderer,this.discardOriginalContent=e.discardOriginalContent,this.batchedMesh=null,this.arrayTarget=null,this.tiles=null,this._onLoadModel=null,this._onDisposeModel=null,this._onVisibilityChange=null,this._tileToInstanceId=new Map}init(e){this._onDisposeModel=({scene:t,tile:a})=>{this.removeSceneFromBatchedMesh(t,a)},e.addEventListener("dispose-model",this._onDisposeModel),this.tiles=e}initBatchedMesh(e){if(this.batchedMesh!==null)return;const{instanceCount:t,vertexCount:a,indexCount:r,tiles:s,renderer:i}=this,n=this.material?this.material:new e.material.constructor,o=new xe(t,t*a,t*r,n);o.name="BatchTilesPlugin",o.frustumCulled=!1,s.group.add(o),o.updateMatrixWorld();const d=e.material.map,m={colorSpace:d.colorSpace,wrapS:d.wrapS,wrapT:d.wrapT,wrapR:d.wrapS,magFilter:d.magFilter},h=new E(d.image.width,d.image.height,t);Object.assign(h.texture,m),i.initRenderTarget(h),n.map=h.texture,ye(n),this.arrayTarget=h,this.batchedMesh=o}setTileVisible(e,t){const a=e.cached.scene;if(t&&this.addSceneToBatchedMesh(a,e),this._tileToInstanceId.has(e)){this._tileToInstanceId.get(e).forEach(i=>{this.batchedMesh.setVisibleAt(i,t)});const s=this.tiles;return t?s.visibleTiles.add(e):s.visibleTiles.delete(e),s.dispatchEvent({type:"tile-visibility-change",scene:a,tile:e,visible:t}),!0}return!1}unloadTileFromGPU(e,t){return!this.discardOriginalContent&&this._tileToInstanceId.has(t)?(this.removeSceneFromBatchedMesh(e,t),!0):!1}assignTextureToLayer(e,t){this.expandArrayTargetIfNeeded();const{renderer:a}=this,r=a.getRenderTarget();a.setRenderTarget(this.arrayTarget,t),S.material.map=e,S.render(a),a.setRenderTarget(r),S.material.map=null,e.dispose()}expandArrayTargetIfNeeded(){const{batchedMesh:e,arrayTarget:t,renderer:a}=this,r=Math.min(e.maxInstanceCount,this.maxInstanceCount);if(r>t.depth){const s={colorSpace:t.texture.colorSpace,wrapS:t.texture.wrapS,wrapT:t.texture.wrapT,generateMipmaps:t.texture.generateMipmaps,minFilter:t.texture.minFilter,magFilter:t.texture.magFilter},i=new E(t.width,t.height,r);Object.assign(i.texture,s),a.initRenderTarget(i),a.copyTextureToTexture(t.texture,i.texture),t.dispose(),e.material.map=i.texture,this.arrayTarget=i}}removeSceneFromBatchedMesh(e,t){if(this._tileToInstanceId.has(t)){const a=this._tileToInstanceId.get(t);this._tileToInstanceId.delete(t),a.forEach(r=>{this.batchedMesh.deleteInstance(r)})}}addSceneToBatchedMesh(e,t){if(this._tileToInstanceId.has(t))return;const a=[];e.traverse(i=>{i.isMesh&&a.push(i)});let r=!0;a.forEach(i=>{if(this.batchedMesh&&r){const n=i.geometry.attributes,o=this.batchedMesh.geometry.attributes;for(const d in o)if(!(d in n)){r=!1;return}}});const s=!this.batchedMesh||this.batchedMesh.instanceCount+a.length<=this.maxInstanceCount;if(r&&s){this.discardOriginalContent&&(t.cached.scene=null,t.cached.materials=[],t.cached.geometries=[],t.cached.textures=[]),e.updateMatrixWorld();const i=[];a.forEach(n=>{this.initBatchedMesh(n);const{geometry:o,material:d}=n,{batchedMesh:m,expandPercent:h}=this;m.expandPercent=h;const C=m.addGeometry(o,this.vertexCount,this.indexCount),x=m.addInstance(C);i.push(x),m.setMatrixAt(x,n.matrixWorld),m.setVisibleAt(x,!1),fe(d.color)||(d.color.setHSL(Math.random(),.5,.5),m.setColorAt(x,d.color));const T=d.map;T?this.assignTextureToLayer(T,x):this.assignTextureToLayer(L,x)}),this._tileToInstanceId.set(t,i)}}raycastTile(e,t,a,r){return this._tileToInstanceId.has(e)?(this._tileToInstanceId.get(e).forEach(i=>{this.batchedMesh.raycastInstance(i,a,r)}),!0):!1}dispose(){const{arrayTarget:e,tiles:t,batchedMesh:a}=this;e&&e.dispose(),a&&(a.material.dispose(),a.geometry.dispose(),a.dispose(),a.removeFromParent()),t.removeEventListener("dispose-model",this._onDisposeModel)}}let M,I,f,c,u,A,P;const Te=localStorage.getItem("googleApiKey")??"put-your-api-key-here",p={orthographic:!1,enableCacheDisplay:!1,enableRendererStats:!1,apiKey:Te,useBatchedMesh:!!new URLSearchParams(window.location.hash.replace(/^#/,"")).get("batched"),errorTarget:40,reload:k};Me();W();function k(){c&&(I.remove(c.group),c.dispose(),c=null),localStorage.setItem("googleApiKey",p.apiKey),c=new se,c.registerPlugin(new re({apiToken:p.apiKey,autoRefreshToken:!0})),c.registerPlugin(new ne),c.registerPlugin(new oe),c.registerPlugin(new ue),c.registerPlugin(new ae({dracoLoader:new J().setDecoderPath("https://unpkg.com/three@0.153.0/examples/jsm/libs/draco/gltf/")})),p.useBatchedMesh?c.registerPlugin(new Ce({renderer:f})):c.registerPlugin(new ce),c.group.rotation.x=-Math.PI/2,I.add(c.group),c.setResolutionFromRenderer(u.camera,f),c.setCamera(u.camera),M.setTilesRenderer(c)}function Me(){f=new q({antialias:!0}),f.setClearColor(1383455),document.body.appendChild(f.domElement),I=new Q,u=new le(new X(60,window.innerWidth/window.innerHeight,1,16e7),new Z(-1,1,1,-1,1,16e7)),u.perspectiveCamera.position.set(48e5,257e4,1472e4),u.perspectiveCamera.lookAt(0,0,0),u.autoSync=!1,u.addEventListener("camera-change",({camera:a,prevCamera:r})=>{c.deleteCamera(r),c.setCamera(a),M.setCamera(a)}),u.orthographicPositionalZoom=!1,M=new de(I,u.camera,f.domElement,null),M.enableDamping=!0,k(),G(),window.addEventListener("resize",G,!1),window.addEventListener("hashchange",B);const l=new Y;l.width=300,l.add(p,"orthographic").onChange(a=>{M.getPivotPoint(u.fixedPoint),u.syncCameras(),M.adjustCamera(u.perspectiveCamera),M.adjustCamera(u.orthographicCamera),u.toggle()});const e=l.addFolder("Google Photorealistic Tiles");e.add(p,"apiKey"),e.add(p,"useBatchedMesh").listen(),e.add(p,"reload");const t=l.addFolder("Example Options");t.add(p,"enableCacheDisplay"),t.add(p,"enableRendererStats"),t.add(p,"errorTarget",5,100,1).onChange(()=>{c.getPluginByName("UPDATE_ON_CHANGE_PLUGIN").needsUpdate=!0}),A=document.createElement("div"),document.getElementById("info").appendChild(A),P=new ee,P.showPanel(0),document.body.appendChild(P.dom),B(),setInterval(be,100)}function G(){const{perspectiveCamera:l,orthographicCamera:e}=u,t=window.innerWidth/window.innerHeight;l.aspect=t,l.updateProjectionMatrix(),e.left=-e.top*t,e.right=-e.left,e.updateProjectionMatrix(),f.setSize(window.innerWidth,window.innerHeight),f.setPixelRatio(window.devicePixelRatio)}function be(){if(!c)return;const l=u.camera,e={},t={},a=c.group.matrixWorld.clone().invert(),r=l.position.clone().applyMatrix4(a),s=l.matrixWorld.clone().premultiply(a);w.getPositionToCartographic(r,e),w.getAzElRollFromRotationMatrix(e.lat,e.lon,s,t,U),t.azimuth*=g.RAD2DEG,t.elevation*=g.RAD2DEG,t.roll*=g.RAD2DEG,e.lat*=g.RAD2DEG,e.lon*=g.RAD2DEG;const i=new URLSearchParams;i.set("lat",e.lat.toFixed(4)),i.set("lon",e.lon.toFixed(4)),i.set("height",e.height.toFixed(2)),i.set("az",t.azimuth.toFixed(2)),i.set("el",t.elevation.toFixed(2)),i.set("roll",t.roll.toFixed(2)),p.useBatchedMesh&&i.set("batched",1),window.history.replaceState(void 0,void 0,`#${i}`)}function B(){const l=window.location.hash.replace(/^#/,""),e=new URLSearchParams(l);if(e.has("batched")&&(p.useBatchedMesh=!!e.get("batched")),!e.has("lat")&&!e.has("lon"))return;c.group.updateMatrixWorld();const t=u.camera,a=parseFloat(e.get("lat")),r=parseFloat(e.get("lon")),s=parseFloat(e.get("height"))||1e3;if(e.has("az")&&e.has("el")){const i=parseFloat(e.get("az")),n=parseFloat(e.get("el")),o=parseFloat(e.get("roll"))||0;w.getRotationMatrixFromAzElRoll(a*g.DEG2RAD,r*g.DEG2RAD,i*g.DEG2RAD,n*g.DEG2RAD,o*g.DEG2RAD,t.matrixWorld,U),t.matrixWorld.premultiply(c.group.matrixWorld),t.matrixWorld.decompose(t.position,t.quaternion,t.scale),w.getCartographicToPosition(a*g.DEG2RAD,r*g.DEG2RAD,s,t.position),t.position.applyMatrix4(c.group.matrixWorld)}else w.getCartographicToPosition(a*g.DEG2RAD,r*g.DEG2RAD,s,t.position),t.position.applyMatrix4(c.group.matrixWorld),t.lookAt(0,0,0)}function W(){if(requestAnimationFrame(W),!c)return;M.enabled=!u.animating,M.update(),u.update();const l=u.camera;c.setResolutionFromRenderer(l,f),c.setCamera(l),l.updateMatrixWorld(),c.errorTarget=p.errorTarget,c.update(),f.render(I,l),P.update(),we()}function we(){var s;let l="";if(p.enableCacheDisplay){const i=c.lruCache,n=i.cachedBytes/i.maxBytesSize;l+=`Downloading: ${c.stats.downloading} Parsing: ${c.stats.parsing} Visible: ${c.visibleTiles.size}
`,l+=`Cache: ${(100*n).toFixed(2)}% ~${(i.cachedBytes/1e3/1e3).toFixed(2)}mb
`}if(p.enableRendererStats){const i=f.info.memory,n=f.info.render,o=f.info.programs.length;l+=`Geometries: ${i.geometries} Textures: ${i.textures} Programs: ${o} Draw Calls: ${n.calls}`}A.innerHTML!==l&&(A.innerHTML=l);const e=c.group.matrixWorld.clone().invert(),t=u.camera.position.clone().applyMatrix4(e),a={};w.getPositionToCartographic(t,a);const r=((s=c.getAttributions()[0])==null?void 0:s.value)||"";document.getElementById("credits").innerText=he(a.lat,a.lon)+` +`+r} diff --git a/example/bundle/assets/i3dmExample-DUm0-sdH.js b/example/bundle/assets/i3dmExample-DUm0-sdH.js new file mode 100644 index 00000000..06b0870e --- /dev/null +++ b/example/bundle/assets/i3dmExample-DUm0-sdH.js @@ -0,0 +1 @@ +import{S,W as P,P as b,a as M,D as W,A as C,k as m,Q as v,j as L}from"./three.module-_fL2BuBc.js";import{O as y}from"./OrbitControls-Ck5AM9Mk.js";import{I as R}from"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";let n,a,s,e,i;z();f();function z(){s=new S,e=new P({antialias:!0}),e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),e.setClearColor(1383455),e.shadowMap.enabled=!0,e.shadowMap.type=b,document.body.appendChild(e.domElement),n=new M(60,window.innerWidth/window.innerHeight,1,4e3),n.position.set(100,100,100),a=new y(n,e.domElement),a.screenSpacePanning=!1,a.minDistance=1,a.maxDistance=2e3,i=new W(16777215,1.25),i.position.set(1,2,3).multiplyScalar(40),i.castShadow=!0,i.shadow.bias=-.01,i.shadow.mapSize.setScalar(2048);const o=i.shadow.camera;o.left=-200,o.bottom=-200,o.right=200,o.top=200,o.updateProjectionMatrix(),s.add(i);const h=new C(16777215,.05);s.add(h),new R().loadAsync("https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/main/1.0/TilesetWithTreeBillboards/tree.i3dm").then(d=>{let t=null;if(d.scene.traverse(r=>{!t&&r.isInstancedMesh&&(t=r)}),t){d.scene.updateMatrixWorld(!0);const r=new m,u=new v,g=new m,w=new L,c=new m;for(let l=0,x=t.count;l>Math.log2(g),S=I[h];if(!this.getBit(e._tileAvailability,r)){t.push(void 0);continue}const c=this.deriveChildTile(e,S,r,E);S.children.push(c),t.push(c)}I=t,t=[]}return I}deriveChildTile(A,e,I,t){const i=new VA(e,t);i.boundingVolume=this.getTileBoundingVolume(i),i.geometricError=this.getGeometricError(i);for(let g=0;A&&g=A.lengthBits)throw new Error("Bit index out of bounds.");if(A.constant!==void 0)return A.constant;const I=e>>3,t=e%8;return(new Uint8Array(A.bitstream)[I]>>t&1)===1}getTileBoundingVolume(A){const e={};if(this.rootTile.boundingVolume.region){const I=[...this.rootTile.boundingVolume.region],t=I[0],i=I[2],g=I[1],C=I[3],o=(i-t)/Math.pow(2,A.__level),E=(C-g)/Math.pow(2,A.__level);I[0]=t+o*A.__x,I[2]=t+o*(A.__x+1),I[1]=g+E*A.__y,I[3]=g+E*(A.__y+1);for(let r=0;r<4;r++){const h=I[r];h<-Math.PI?I[r]+=2*Math.PI:h>Math.PI&&(I[r]-=2*Math.PI)}if(FA(A)){const r=I[4],S=(I[5]-r)/Math.pow(2,A.__level);I[4]=r+S*A.__z,I[5]=r+S*(A.__z+1)}e.region=I}if(this.rootTile.boundingVolume.box){const I=[...this.rootTile.boundingVolume.box],t=2**A.__level-1,i=Math.pow(2,-A.__level),g=FA(A)?3:2;for(let C=0;C{this.enabled&&Object.defineProperty(w,"shiftKey",{get(){return!1}})};e.addEventListener("pointerdown",I),super(A,e),this.enableKeys=!1,this.enableFlight=!0,this.baseSpeed=1,this.fastSpeed=4,this.forwardKey="w",this.backKey="s",this.leftKey="a",this.rightKey="d",this.upKey="q",this.downKey="e",this.fastKey="shift";let t=!1,i=!1,g=!1,C=!1,o=!1,E=!1,r=!1,h=0,S=0,c=0,a=-1;const n=new Re,d=new ue,l=()=>{if(a!==-1){cancelAnimationFrame(a),a=-1,this.minDistance=S,this.maxDistance=c;const w=Math.min(h,A.position.distanceTo(n));N.set(0,0,-1,0).applyMatrix4(A.matrixWorld),this.target.copy(A.position).addScaledVector(N,w),this.dispatchEvent(uI)}},D=()=>{if(!this.enabled||!this.enableFlight)return;a=requestAnimationFrame(D),N.set(0,0,0,0),i&&(N.z-=1),g&&(N.z+=1),C&&(N.x-=1),o&&(N.x+=1),E&&(N.y+=1),r&&(N.y-=1),N.applyMatrix4(A.matrixWorld);const w=60*d.getDelta(),u=t?this.fastSpeed:this.baseSpeed;A.position.addScaledVector(N,u*w),this.target.addScaledVector(N,u*w),this.dispatchEvent(RI)},F=w=>{const u=w.key.toLowerCase();switch(a===-1&&(c=this.maxDistance,S=this.minDistance,h=A.position.distanceTo(this.target),n.copy(this.target)),u){case this.forwardKey:i=!0;break;case this.backKey:g=!0;break;case this.leftKey:C=!0;break;case this.rightKey:o=!0;break;case this.upKey:E=!0;break;case this.downKey:r=!0;break;case this.fastKey:t=!0;break}switch(u){case this.fastKey:case this.forwardKey:case this.backKey:case this.leftKey:case this.rightKey:case this.upKey:case this.downKey:w.stopPropagation(),w.preventDefault()}(i||g||C||o||E||r||t)&&(this.minDistance=.01,this.maxDistance=.01,N.set(0,0,-1,0).applyMatrix4(A.matrixWorld),this.target.copy(A.position).addScaledVector(N,.01),a===-1&&(this.dispatchEvent(mI),d.getDelta(),D()))},R=w=>{const u=w.key.toLowerCase();switch(u){case this.fastKey:case this.forwardKey:case this.backKey:case this.leftKey:case this.rightKey:case this.upKey:case this.downKey:w.stopPropagation(),w.preventDefault()}switch(u){case this.forwardKey:i=!1;break;case this.backKey:g=!1;break;case this.leftKey:C=!1;break;case this.rightKey:o=!1;break;case this.upKey:E=!1;break;case this.downKey:r=!1;break;case this.fastKey:t=!1;break}i||g||C||o||E||r||t||l()},M=()=>{l()};this.blurCallback=M,this.keyDownCallback=F,this.keyUpCallback=R,this.disableShiftKeyCallback=I,this.domElement.addEventListener("blur",M),this.domElement.addEventListener("keydown",F),this.domElement.addEventListener("keyup",R)}dispose(){super.dispose(),this.domElement.removeEventListener("blur",this.blurCallback),this.domElement.removeEventListener("keydown",this.keyDownCallback),this.domElement.removeEventListener("keyup",this.keyUpCallback),this.domElement.removeEventListener("pointerdown",this.disableShiftKeyCallback)}}class UI{constructor(A=4){this.pool=A,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(A){if(!this.workers[A]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,A)),this.workers[A]=e}}_getIdleWorker(){for(let A=0;A{const t=this._getIdleWorker();t!==-1?(this._initWorker(t),this.workerStatus|=1<A.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const LI=0,WA=2,kI=1,XA=2,NI=0,MI=1,_I=10,xI=0,ge=9,Be=15,Ce=16,oe=22,se=37,Qe=43,Ee=76,ae=83,ne=97,re=100,ce=103,he=109,le=165,de=166,YA=1000066e3;class TI{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class gA{constructor(A,e,I,t){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(A.buffer,A.byteOffset+e,I),this._littleEndian=t,this._offset=0}_nextUint8(){const A=this._dataView.getUint8(this._offset);return this._offset+=1,A}_nextUint16(){const A=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,A}_nextUint32(){const A=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,A}_nextUint64(){const A=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,A}_nextInt32(){const A=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,A}_nextUint8Array(A){const e=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,A);return this._offset+=A,e}_skip(A){return this._offset+=A,this}_scan(A,e){e===void 0&&(e=0);const I=this._offset;let t=0;for(;this._dataView.getUint8(this._offset)!==e&&tA.arrayBuffer()).then(A=>WebAssembly.instantiate(A,NA)).then(this._init):WebAssembly.instantiate(Buffer.from(zA,"base64"),NA).then(this._init),kA)}_init(A){K=A.instance,NA.env.emscripten_notify_memory_growth(0)}decode(A,e=0){if(!K)throw new Error("ZSTDDecoder: Await .init() before decoding.");const I=A.byteLength,t=K.exports.malloc(I);JA.set(A,t),e=e||Number(K.exports.ZSTD_findDecompressedSize(t,I));const i=K.exports.malloc(e),g=K.exports.ZSTD_decompress(i,e,t,I),C=JA.slice(i,i+g);return K.exports.free(t),K.exports.free(i),C}}const zA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAg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GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAws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IAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiAL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NBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADD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EG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOA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///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",HI="display-p3",bI="display-p3-linear",MA=new WeakMap;let _A=0,xA;class J extends Ue{constructor(A){super(A),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new UI,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(A){return this.transcoderPath=A,this}setWorkerLimit(A){return this.workerPool.setWorkerLimit(A),this}async detectSupportAsync(A){return this.workerConfig={astcSupported:await A.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await A.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await A.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await A.hasFeatureAsync("texture-compression-bc"),bptcSupported:await A.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await A.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(A){return A.isWebGPURenderer===!0?this.workerConfig={astcSupported:A.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:A.hasFeature("texture-compression-etc1"),etc2Supported:A.hasFeature("texture-compression-etc2"),dxtSupported:A.hasFeature("texture-compression-bc"),bptcSupported:A.hasFeature("texture-compression-bptc"),pvrtcSupported:A.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:A.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:A.extensions.has("WEBGL_compressed_texture_astc")&&A.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:A.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:A.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:A.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:A.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:A.extensions.has("WEBGL_compressed_texture_pvrtc")||A.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const A=new GA(this.manager);A.setPath(this.transcoderPath),A.setWithCredentials(this.withCredentials);const e=A.loadAsync("basis_transcoder.js"),I=new GA(this.manager);I.setPath(this.transcoderPath),I.setResponseType("arraybuffer"),I.setWithCredentials(this.withCredentials);const t=I.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([e,t]).then(([i,g])=>{const C=J.BasisWorker.toString(),o=["/* constants */","let _EngineFormat = "+JSON.stringify(J.EngineFormat),"let _EngineType = "+JSON.stringify(J.EngineType),"let _TranscoderFormat = "+JSON.stringify(J.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(J.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",C.substring(C.indexOf("{")+1,C.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([o])),this.transcoderBinary=g,this.workerPool.setWorkerCreator(()=>{const E=new Worker(this.workerSourceURL),r=this.transcoderBinary.slice(0);return E.postMessage({type:"init",config:this.workerConfig,transcoderBinary:r},[r]),E})}),_A>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),_A++}return this.transcoderPending}load(A,e,I,t){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new GA(this.manager);i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials),i.load(A,g=>{this.parse(g,e,t)},I,t)}parse(A,e,I){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(MA.has(A))return MA.get(A).promise.then(e).catch(I);this._createTexture(A).then(t=>e?e(t):null).catch(I)}_createTextureFrom(A,e){const{type:I,error:t,data:{faces:i,width:g,height:C,format:o,type:E,dfdFlags:r}}=A;if(I==="error")return Promise.reject(t);let h;if(e.faceCount===6)h=new Le(i,o,E);else{const S=i[0].mipmaps;h=e.layerCount>1?new ke(S,g,C,e.layerCount,o,E):new te(S,g,C,o,E)}return h.minFilter=i[0].mipmaps.length===1?KA:Ne,h.magFilter=KA,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=we(e),h.premultiplyAlpha=!!(r&kI),h}async _createTexture(A,e={}){const I=qI(new Uint8Array(A)),t=I.vkFormat===YA&&I.dataFormatDescriptor[0].colorModel===167;if(!(I.vkFormat===xI||t&&!this.workerConfig.astcHDRSupported))return KI(I);const g=e,C=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:A,taskConfig:g},[A])).then(o=>this._createTextureFrom(o.data,I));return MA.set(A,{promise:C}),C}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),_A--,this}}J.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};J.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};J.EngineFormat={RGBAFormat:AA,RGBA_ASTC_4x4_Format:ie,RGB_BPTC_UNSIGNED_Format:Me,RGBA_BPTC_Format:_e,RGBA_ETC2_EAC_Format:xe,RGBA_PVRTC_4BPPV1_Format:Te,RGBA_S3TC_DXT5_Format:qe,RGB_ETC1_Format:Je,RGB_ETC2_Format:He,RGB_PVRTC_4BPPV1_Format:be,RGBA_S3TC_DXT1_Format:Ye};J.EngineType={UnsignedByteType:Y,HalfFloatType:eA,FloatType:sA};J.BasisWorker=function(){let B,A,e;const I=_EngineFormat,t=_EngineType,i=_TranscoderFormat,g=_BasisFormat;self.addEventListener("message",function(a){const n=a.data;switch(n.type){case"init":B=n.config,C(n.transcoderBinary);break;case"transcode":A.then(()=>{try{const{faces:d,buffers:l,width:D,height:F,hasAlpha:R,format:M,type:w,dfdFlags:u}=o(n.buffer);self.postMessage({type:"transcode",id:n.id,data:{faces:d,width:D,height:F,hasAlpha:R,format:M,type:w,dfdFlags:u}},l)}catch(d){console.error(d),self.postMessage({type:"error",id:n.id,error:d.message})}});break}});function C(a){A=new Promise(n=>{e={wasmBinary:a,onRuntimeInitialized:n},BASIS(e)}).then(()=>{e.initializeBasis(),e.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function o(a){const n=new e.KTX2File(new Uint8Array(a));function d(){n.close(),n.delete()}if(!n.isValid())throw d(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let l;if(n.isUASTC())l=g.UASTC;else if(n.isETC1S())l=g.ETC1S;else if(n.isHDR())l=g.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const D=n.getWidth(),F=n.getHeight(),R=n.getLayers()||1,M=n.getLevels(),w=n.getFaces(),u=n.getHasAlpha(),rA=n.getDFDFlags(),{transcoderFormat:IA,engineFormat:tA,engineType:Z}=h(l,D,F,u);if(!D||!F||!M)throw d(),new Error("THREE.KTX2Loader: Invalid texture");if(!n.startTranscoding())throw d(),new Error("THREE.KTX2Loader: .startTranscoding failed");const cA=[],hA=[];for(let W=0;W1?(_=j.origWidth,V=j.origHeight):(_=j.width,V=j.height);let $=new Uint8Array(n.getImageTranscodedSizeInBytes(O,z,0,IA));const Se=n.transcodeImage($,O,z,W,IA,0,-1,-1);if(Z===t.HalfFloatType&&($=new Uint16Array($.buffer,$.byteOffset,$.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Se)throw d(),new Error("THREE.KTX2Loader: .transcodeImage failed.");U.push($)}const iA=c(U);lA.push({data:iA,width:_,height:V}),hA.push(iA.buffer)}cA.push({mipmaps:lA,width:D,height:F,format:tA,type:Z})}return d(),{faces:cA,buffers:hA,width:D,height:F,hasAlpha:u,dfdFlags:rA,format:tA,type:Z}}const E=[{if:"astcSupported",basisFormat:[g.UASTC],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[I.RGBA_ASTC_4x4_Format,I.RGBA_ASTC_4x4_Format],engineType:[t.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[g.ETC1S,g.UASTC],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[I.RGBA_BPTC_Format,I.RGBA_BPTC_Format],engineType:[t.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[g.ETC1S,g.UASTC],transcoderFormat:[i.BC1,i.BC3],engineFormat:[I.RGBA_S3TC_DXT1_Format,I.RGBA_S3TC_DXT5_Format],engineType:[t.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[g.ETC1S,g.UASTC],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[I.RGB_ETC2_Format,I.RGBA_ETC2_EAC_Format],engineType:[t.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[g.ETC1S,g.UASTC],transcoderFormat:[i.ETC1],engineFormat:[I.RGB_ETC1_Format],engineType:[t.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[g.ETC1S,g.UASTC],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[I.RGB_PVRTC_4BPPV1_Format,I.RGBA_PVRTC_4BPPV1_Format],engineType:[t.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[g.UASTC_HDR],transcoderFormat:[i.BC6H],engineFormat:[I.RGB_BPTC_UNSIGNED_Format],engineType:[t.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[g.ETC1S,g.UASTC],transcoderFormat:[i.RGBA32,i.RGBA32],engineFormat:[I.RGBAFormat,I.RGBAFormat],engineType:[t.UnsignedByteType,t.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[g.UASTC_HDR],transcoderFormat:[i.RGBA_HALF],engineFormat:[I.RGBAFormat],engineType:[t.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],r={[g.ETC1S]:E.filter(a=>a.basisFormat.includes(g.ETC1S)).sort((a,n)=>a.priorityUASTC-n.priorityUASTC),[g.UASTC]:E.filter(a=>a.basisFormat.includes(g.UASTC)).sort((a,n)=>a.priorityUASTC-n.priorityUASTC),[g.UASTC_HDR]:E.filter(a=>a.basisFormat.includes(g.UASTC_HDR)).sort((a,n)=>a.priorityHDR-n.priorityHDR)};function h(a,n,d,l){const D=r[a];for(let F=0;F{const g=new JI;await g.init(),i(g)})),e=await xA);const I=[];for(let i=0;i>i),C=Math.max(1,B.pixelHeight>>i),o=B.pixelDepth?Math.max(1,B.pixelDepth>>i):0,E=B.levels[i];let r;if(B.supercompressionScheme===LI)r=E.levelData;else if(B.supercompressionScheme===WA)r=e.decode(E.levelData,E.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let h;qA[A]===sA?h=new Float32Array(r.buffer,r.byteOffset,r.byteLength/Float32Array.BYTES_PER_ELEMENT):qA[A]===eA?h=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/Uint16Array.BYTES_PER_ELEMENT):h=r,I.push({data:h,width:g,height:C,depth:o})}let t;if(YI.has(TA[A]))t=B.pixelDepth===0?new Ke(I[0].data,B.pixelWidth,B.pixelHeight):new Pe(I[0].data,B.pixelWidth,B.pixelHeight,B.pixelDepth);else{if(B.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");t=new te(I,B.pixelWidth,B.pixelHeight)}return t.mipmaps=I,t.type=qA[A],t.format=TA[A],t.colorSpace=we(B),t.needsUpdate=!0,Promise.resolve(t)}function we(B){const A=B.dataFormatDescriptor[0];return A.colorPrimaries===MI?A.transferFunction===XA?ve:Oe:A.colorPrimaries===_I?A.transferFunction===XA?HI:bI:A.colorPrimaries===NI?PA:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${A.colorPrimaries}"`),PA)}const PI=1,De=2,ye=window.location.hash.replace(/^#/,"");let p,oA,H,f,Q,QA,P,T,dA,y,EA,wA,L,G,aA,yA,HA,v,b,m,nA,X,q,x,fA;const s={enableUpdate:!0,raycast:pA,optimizeRaycast:!0,enableCacheDisplay:!1,enableRendererStats:!1,orthographic:!1,errorTarget:6,errorThreshold:60,maxDepth:15,displayActiveTiles:!1,resolutionScale:1,up:ye?"+Z":"+Y",displayBoxBounds:!1,displaySphereBounds:!1,displayRegionBounds:!1,colorMode:0,showThirdPerson:!1,showSecondView:!1,reload:fe};vI();Ge();function fe(){const B=ye||"../data/tileset.json";Q&&(q.remove(Q.group),Q.dispose());const A=new gI;A.setDecoderPath("https://unpkg.com/three@0.153.0/examples/jsm/libs/draco/gltf/");const e=new J;e.setTranscoderPath("https://unpkg.com/three@0.153.0/examples/jsm/libs/basis/"),e.detectSupport(f),Q=new wI(B),Q.registerPlugin(new dI),Q.registerPlugin(new SI),Q.registerPlugin(new pI({rtc:!0,dracoLoader:A,ktxLoader:e})),Q.fetchOptions.mode="cors",q.add(Q.group),Q.customColorCallback=(I,t)=>{const g=I.__depth%2===0?16711680:16777215;t.traverse(C=>{C.isMesh&&C.material.color.set(g)})}}function vI(){H=new Ve,f=new SA({antialias:!0}),f.setPixelRatio(window.devicePixelRatio),f.setSize(window.innerWidth,window.innerHeight),f.setClearColor(1383455),document.body.appendChild(f.domElement),f.domElement.tabIndex=1,p=new RA(60,window.innerWidth/window.innerHeight,1,1e4),p.position.set(400,400,400),QA=new mA(p),H.add(QA),G=new We,aA=new mA(G),H.add(aA),L=new RA(60,window.innerWidth/window.innerHeight,1,4e3),L.position.set(400,400,-400),L.lookAt(0,0,0),y=new SA({antialias:!0}),y.setPixelRatio(window.devicePixelRatio),y.setSize(window.innerWidth,window.innerHeight),y.setClearColor(1383455),document.body.appendChild(y.domElement),y.domElement.style.position="absolute",y.domElement.style.right="0",y.domElement.style.top="0",y.domElement.style.outline="#0f1416 solid 2px",y.domElement.tabIndex=1,wA=new LA(L,y.domElement),wA.screenSpacePanning=!1,wA.minDistance=1,wA.maxDistance=5e3,EA=new mA(L),H.add(EA),P=new RA(60,window.innerWidth/window.innerHeight,1,4e3),P.position.set(50,40,40),P.lookAt(0,0,0),T=new SA({antialias:!0}),T.setPixelRatio(window.devicePixelRatio),T.setSize(window.innerWidth,window.innerHeight),T.setClearColor(988182),document.body.appendChild(T.domElement),T.domElement.style.position="fixed",T.domElement.style.left="5px",T.domElement.style.bottom="5px",T.domElement.tabIndex=1,dA=new LA(P,T.domElement),dA.screenSpacePanning=!1,dA.minDistance=1,dA.maxDistance=5e3,oA=new LA(p,f.domElement),oA.screenSpacePanning=!1,oA.minDistance=1,oA.maxDistance=5e3;const B=new Xe(16777215,4);B.position.set(1,2,3),H.add(B);const A=new Ze(16777215,.2);H.add(A),yA=new AI,HA=new eI,X=new uA,H.add(X),q=new uA,X.add(q),v=new II,b=new bA,m=new uA;const e=new ze({color:15277667}),I=new OA(new je(.25,.25,6),e);I.rotation.x=Math.PI/2,I.position.z+=3,m.add(I);const t=new OA(new $e(1.5,.2,16,100),e);m.add(t),H.add(m),m.visible=!1,fe(),DA(),window.addEventListener("resize",DA,!1),f.domElement.addEventListener("pointermove",$A,!1),f.domElement.addEventListener("pointerdown",ee,!1),f.domElement.addEventListener("pointerup",Ie,!1),f.domElement.addEventListener("pointerleave",jA,!1),y.domElement.addEventListener("pointermove",$A,!1),y.domElement.addEventListener("pointerdown",ee,!1),y.domElement.addEventListener("pointerup",Ie,!1),y.domElement.addEventListener("pointerleave",jA,!1);const i=new BI;i.width=300;const g=i.addFolder("Tiles Options");g.add(s,"displayActiveTiles"),g.add(s,"errorTarget").min(0).max(50),g.add(s,"errorThreshold").min(0).max(1e3),g.add(s,"maxDepth").min(1).max(100),g.add(s,"up",["+Y","+Z","-Z"]),g.open();const C=i.addFolder("Debug Options");C.add(s,"displayBoxBounds"),C.add(s,"displaySphereBounds"),C.add(s,"displayRegionBounds"),C.add(s,"colorMode",{NONE:pA,SCREEN_ERROR:oI,GEOMETRIC_ERROR:sI,DISTANCE:QI,DEPTH:EI,RELATIVE_DEPTH:aI,IS_LEAF:nI,RANDOM_COLOR:rI,RANDOM_NODE_COLOR:cI,CUSTOM_COLOR:hI,LOAD_ORDER:lI}),C.open();const o=i.addFolder("Example Options");o.add(s,"resolutionScale").min(.01).max(2).step(.01).onChange(DA),o.add(s,"orthographic"),o.add(s,"showThirdPerson"),o.add(s,"showSecondView").onChange(DA),o.add(s,"enableUpdate").onChange(E=>{Q.parseQueue.autoUpdate=E,Q.downloadQueue.autoUpdate=E,E&&(Q.parseQueue.scheduleJobRun(),Q.downloadQueue.scheduleJobRun())}),o.add(s,"raycast",{NONE:pA,ALL_HITS:PI,FIRST_HIT_ONLY:De}),o.add(s,"optimizeRaycast"),o.add(s,"enableCacheDisplay"),o.add(s,"enableRendererStats"),o.open(),i.add(s,"reload"),i.open(),x=document.createElement("div"),x.style.position="absolute",x.style.top=0,x.style.left=0,x.style.color="white",x.style.width="100%",x.style.textAlign="center",x.style.padding="5px",x.style.pointerEvents="none",x.style.lineHeight="1.5em",document.body.appendChild(x),fA=new CI,fA.showPanel(0),document.body.appendChild(fA.dom)}function DA(){P.aspect=window.innerWidth/window.innerHeight,P.updateProjectionMatrix(),T.setSize(Math.floor(window.innerWidth/3),Math.floor(window.innerHeight/3)),s.showSecondView?(p.aspect=.5*window.innerWidth/window.innerHeight,f.setSize(.5*window.innerWidth,window.innerHeight),L.aspect=.5*window.innerWidth/window.innerHeight,y.setSize(.5*window.innerWidth,window.innerHeight),y.domElement.style.display="block"):(p.aspect=window.innerWidth/window.innerHeight,f.setSize(window.innerWidth,window.innerHeight),y.domElement.style.display="none"),p.updateProjectionMatrix(),f.setPixelRatio(window.devicePixelRatio*s.resolutionScale),L.updateProjectionMatrix(),y.setPixelRatio(window.devicePixelRatio),Fe()}function jA(B){nA=null}function $A(B){const A=this.getBoundingClientRect();b.x=B.clientX-A.x,b.y=B.clientY-A.y,b.x=b.x/A.width*2-1,b.y=-(b.y/A.height)*2+1,nA=this}const pe=new bA,Ae=new bA;function ee(B){const A=this.getBoundingClientRect();pe.set(B.clientX-A.x,B.clientY-A.y)}function Ie(B){const A=this.getBoundingClientRect();if(Ae.set(B.clientX-A.x,B.clientY-A.y),pe.distanceTo(Ae)>2)return;nA===y.domElement?v.setFromCamera(b,L):v.setFromCamera(b,s.orthographic?G:p),v.firstHitOnly=!0;const e=v.intersectObject(Q.group,!0);if(e.length){const I=e[0].object,t=Q.getPluginByName("DEBUG_TILES_PLUGIN").getTileInformationFromActiveObject(I);let i="";for(const g in t){let C=t[g];typeof C=="number"&&(C=Math.floor(C*1e5)/1e5);let o=g;for(;o.length<20;)o+=" ";i+=`${o} : ${C} +`}console.log(i)}}function Fe(){G.position.copy(p.position),G.rotation.copy(p.rotation);const B=p.position.distanceTo(oA.target)/2;let A=window.innerWidth/window.innerHeight;s.showSecondView&&(A*=.5),G.left=-A*B,G.right=A*B,G.bottom=-B,G.top=B,G.near=p.near,G.far=p.far,G.updateProjectionMatrix()}function Ge(){requestAnimationFrame(Ge),Q.errorTarget=s.errorTarget,Q.errorThreshold=s.errorThreshold,Q.optimizeRaycast=s.optimizeRaycast,Q.displayActiveTiles=s.displayActiveTiles,Q.maxDepth=s.maxDepth;const B=Q.getPluginByName("DEBUG_TILES_PLUGIN");if(B.displayBoxBounds=s.displayBoxBounds,B.displaySphereBounds=s.displaySphereBounds,B.displayRegionBounds=s.displayRegionBounds,B.colorMode=parseFloat(s.colorMode),s.orthographic?(Q.deleteCamera(p),Q.setCamera(G),Q.setResolutionFromRenderer(G,f)):(Q.deleteCamera(G),Q.setCamera(p),Q.setResolutionFromRenderer(p,f)),s.showSecondView?(Q.setCamera(L),Q.setResolutionFromRenderer(L,y)):Q.deleteCamera(L),Q.root&&Q.root.boundingVolume.region&&(Q.getOrientedBoundingBox(yA,q.matrix),q.matrix.decompose(q.position,q.quaternion,q.scale),q.position.set(0,0,0),q.quaternion.invert(),q.scale.set(1,1,1)),X.rotation.set(0,0,0),s.up==="-Z"?X.rotation.x=Math.PI/2:s.up==="+Z"&&(X.rotation.x=-Math.PI/2),X.updateMatrixWorld(!1),Q.getBoundingBox(yA)?(yA.getCenter(Q.group.position),Q.group.position.multiplyScalar(-1)):Q.getBoundingSphere(HA)&&(Q.group.position.copy(HA.center),Q.group.position.multiplyScalar(-1)),parseFloat(s.raycast)!==pA&&nA!==null){nA===f.domElement?v.setFromCamera(b,s.orthographic?G:p):v.setFromCamera(b,L),v.firstHitOnly=parseFloat(s.raycast)===De;const A=v.intersectObject(Q.group,!0);if(A.length){const e=A[0],I=e.point;if(m.position.copy(I),e.face){const t=e.face.normal;t.transformDirection(e.object.matrixWorld),m.lookAt(I.x+t.x,I.y+t.y,I.z+t.z)}m.visible=!0}else m.visible=!1}else m.visible=!1;window.tiles=Q,s.enableUpdate&&(L.updateMatrixWorld(),p.updateMatrixWorld(),G.updateMatrixWorld(),Q.update()),OI(),fA.update()}function OI(){if(Fe(),QA.visible=!1,aA.visible=!1,EA.visible=!1,s.orthographic){const e=G.position.distanceTo(m.position);m.scale.setScalar(e/150)}else{const e=p.position.distanceTo(m.position);m.scale.setScalar(e*p.fov/6e3)}if(f.render(H,s.orthographic?G:p),s.showSecondView){const e=L.position.distanceTo(m.position);m.scale.setScalar(e*L.fov/6e3),y.render(H,L)}if(T.domElement.style.visibility=s.showThirdPerson?"visible":"hidden",s.showThirdPerson){QA.update(),QA.visible=!s.orthographic,aA.update(),aA.visible=s.orthographic,s.showSecondView&&(EA.update(),EA.visible=!0);const e=P.position.distanceTo(m.position);m.scale.setScalar(e*P.fov/6e3),T.render(H,P)}const B=Q.lruCache.itemList.length/Q.lruCache.maxSize;let A=`Downloading: ${Q.stats.downloading} Parsing: ${Q.stats.parsing} Visible: ${Q.visibleTiles.size}`;if(s.enableCacheDisplay){const e=new Set;Q.traverse(t=>{const i=t.cached.scene;i&&i.traverse(g=>{g.geometry&&e.add(g.geometry)})});let I=0;e.forEach(t=>{I+=iI(t)}),A+=`
Cache: ${(100*B).toFixed(2)}% ~${(I/1e3/1e3).toFixed(2)}mb`}if(s.enableRendererStats){const e=f.info.memory,I=f.info.programs.length;A+=`
Geometries: ${e.geometries} Textures: ${e.textures} Programs: ${I}`}x.innerHTML!==A&&(x.innerHTML=A)} diff --git a/example/bundle/assets/ion-DCEYGvnu.js b/example/bundle/assets/ion-DCEYGvnu.js new file mode 100644 index 00000000..19d5a168 --- /dev/null +++ b/example/bundle/assets/ion-DCEYGvnu.js @@ -0,0 +1 @@ +import{d as g,k as d}from"./three.module-_fL2BuBc.js";import{c as x,j as e,r as f,C as k,T as b,d as s,E as P}from"./extends-BiwV-o27.js";import{D as C}from"./DRACOLoader-BZaFS3O1.js";import{u as v,T as j}from"./leva.esm-CLDXiY66.js";import{C as y}from"./CesiumIonAuthPlugin-3uWD2B4J.js";import{G as E}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import{O as T}from"./Ellipsoid-CKpUFSOi.js";import{U as L}from"./UpdateOnChangePlugin-UYN3BMUO.js";import{E as M}from"./Environment-JXyVb9Rj.js";import{G as I,a as w}from"./GizmoViewport-DdGPEc5i.js";import"./EnvironmentControls-CJG7lPg-.js";import"./GlobeControls-5ygGpakr.js";import"./TilesRenderer-DkGmB3Pz.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./GoogleCloudAuthPlugin-BapiqItz.js";const l=new g,p=new d;class z{constructor(t){t={up:"+z",recenter:!0,lat:null,lon:null,height:0,...t},this.tiles=null,this.up=t.up.toLowerCase().replace(/\s+/,""),this.lat=t.lat,this.lon=t.lon,this.height=t.height,this.recenter=t.recenter,this._callback=null}init(t){this.tiles=t,this._callback=()=>{const{up:i,lat:a,lon:r,height:n,recenter:u}=this;if(a!==null&&r!==null)this.transformLatLonHeightToOrigin(a,r,n);else{const{ellipsoid:m}=t,h=Math.min(...m.radius);if(t.getBoundingSphere(l),l.center.length()>h*.5){const o={};m.getPositionToCartographic(l.center,o),this.transformLatLonHeightToOrigin(o.lat,o.lon,o.height)}else{const o=t.group;switch(o.rotation.set(0,0,0),i){case"x":case"+x":o.rotation.z=Math.PI/2;break;case"-x":o.rotation.z=-Math.PI/2;break;case"y":case"+y":break;case"-y":o.rotation.z=Math.PI;break;case"z":case"+z":o.rotation.x=-Math.PI/2;break;case"-z":o.rotation.x=Math.PI/2;break}t.group.position.copy(l.center).applyEuler(o.rotation).multiplyScalar(-1)}}u||t.group.position.setScalar(0),t.removeEventListener("load-tile-set",this._callback)},t.addEventListener("load-tile-set",this._callback)}transformLatLonHeightToOrigin(t,i,a=0){const{group:r,ellipsoid:n}=this.tiles;n.getRotationMatrixFromAzElRoll(t,i,0,0,0,r.matrix,T),n.getCartographicToPosition(t,i,a,p),r.matrix.setPosition(p).invert().decompose(r.position,r.quaternion,r.scale),r.updateMatrixWorld()}dispose(){const{group:t}=this.tiles;t.position.setScalar(0),t.quaternion.identity(),t.scale.set(1,1,1),this.tiles.addEventListener("load-tile-set",this._callback)}}const R=new C().setDecoderPath("https://www.gstatic.com/draco/v1/decoders/");function S(){const c={apiToken:{value:localStorage.getItem("ion-token")||"put-your-api-key-here",onChange:a=>localStorage.setItem("ion-token",a),transient:!1},assetId:{value:"40866",options:{"Aerometrex - San Francisco":"1415196","Aerometrex - Denver":"354307","New York City 3D Buildings":"75343","Melbourne Photogrammetry":"69380","Cesium HQ":"40866","Melbourne Point Cloud":"43978","Montreal Point Cloud":"28945"}}},{apiToken:t,assetId:i}=v(c);return e.jsxs(k,{frameloop:"demand",camera:{position:[300,300,300],near:1,far:1e5},style:{width:"100%",height:"100%",position:"absolute",margin:0,left:0,top:0},children:[e.jsxs(b,{children:[e.jsx(s,{plugin:y,args:{apiToken:t,assetId:i}}),e.jsx(s,{plugin:E,dracoLoader:R}),e.jsx(s,{plugin:z}),e.jsx(s,{plugin:L}),e.jsx(j,{})]},i+t),e.jsx(P,{enableDamping:!0,maxDistance:5e3}),e.jsx(M,{preset:"sunset",background:!0,backgroundBlurriness:.9,environmentIntensity:1}),e.jsx(I,{alignment:"bottom-right",children:e.jsx(w,{})})]})}x(document.getElementById("root")).render(e.jsx(f.StrictMode,{children:e.jsx(S,{})})); diff --git a/example/bundle/assets/ionExample-B7_B-1xL.js b/example/bundle/assets/ionExample-B7_B-1xL.js new file mode 100644 index 00000000..ca773ee3 --- /dev/null +++ b/example/bundle/assets/ionExample-B7_B-1xL.js @@ -0,0 +1 @@ +import{S as f,o as h,ab as A,W as x,a as T,d as y,k as l,Q as P}from"./three.module-_fL2BuBc.js";import{D as C}from"./DRACOLoader-BZaFS3O1.js";import{g as E}from"./lil-gui.module.min-Bc0DeA9g.js";import{E as I}from"./EnvironmentControls-CJG7lPg-.js";import{T as k}from"./TilesRenderer-DkGmB3Pz.js";import{C as z}from"./CesiumIonAuthPlugin-3uWD2B4J.js";import{G as R}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./GoogleCloudAuthPlugin-BapiqItz.js";let o,p,s,i,e;const v=localStorage.getItem("ionApiKey")??"put-your-api-key-here",a={ionAssetId:"40866",ionAccessToken:v,reload:u};W();w();function D(t,r){const n=new P,d=new l().crossVectors(t,r);return n.x=d.x,n.y=d.y,n.z=d.z,n.w=1+t.clone().dot(r),n.normalize(),n}function S(){e.fetchOptions.mode="cors",e.registerPlugin(new R({dracoLoader:new C().setDecoderPath("https://unpkg.com/three@0.153.0/examples/jsm/libs/draco/gltf/")})),s.add(e.group)}function u(){e&&(s.remove(e.group),e.dispose(),e=null),localStorage.setItem("ionApiKey",a.ionAccessToken),e=new k,e.registerPlugin(new z({apiToken:a.ionAccessToken,assetId:a.ionAssetId})),e.addEventListener("load-tile-set",()=>{const t=new y;e.getBoundingSphere(t);const r=t.center.clone(),n=r.length(),d=r.normalize(),g=new l(0,1,0),c=D(d,g);e.group.quaternion.x=c.x,e.group.quaternion.y=c.y,e.group.quaternion.z=c.z,e.group.quaternion.w=c.w,e.group.position.y=-n}),S()}function W(){s=new f;const t=new h(new Uint8Array(64*64*4).fill(255),64,64);t.mapping=A,t.needsUpdate=!0,s.environment=t,i=new x({antialias:!0}),i.setClearColor(1383455),document.body.appendChild(i.domElement),i.domElement.tabIndex=1,o=new T(60,window.innerWidth/window.innerHeight,1,1e5),o.position.set(100,100,-100),o.lookAt(0,0,0),p=new I(s,o,i.domElement),p.adjustHeight=!1,p.minDistance=1,p.maxAltitude=Math.PI,u(),m(),window.addEventListener("resize",m,!1);const r=new E;r.width=300;const n=r.addFolder("Ion");n.add(a,"ionAssetId"),n.add(a,"ionAccessToken"),n.add(a,"reload"),n.open()}function m(){o.aspect=window.innerWidth/window.innerHeight,o.updateProjectionMatrix(),i.setSize(window.innerWidth,window.innerHeight),i.setPixelRatio(window.devicePixelRatio)}function w(){requestAnimationFrame(w),e&&(p.update(),e.setCamera(o),e.setResolutionFromRenderer(o,i),o.updateMatrixWorld(),e.update(),i.render(s,o))} diff --git a/example/bundle/assets/ionLunar-DGvaLlWT.js b/example/bundle/assets/ionLunar-DGvaLlWT.js new file mode 100644 index 00000000..cc91dc84 --- /dev/null +++ b/example/bundle/assets/ionLunar-DGvaLlWT.js @@ -0,0 +1 @@ +import{W as d,S as l,a as u}from"./three.module-_fL2BuBc.js";import{g as w}from"./lil-gui.module.min-Bc0DeA9g.js";import{G as g}from"./GlobeControls-5ygGpakr.js";import{T as c}from"./TilesRenderer-DkGmB3Pz.js";import{L as f}from"./I3DMLoader-QCOT_FZM.js";import{C as P}from"./CesiumIonAuthPlugin-3uWD2B4J.js";import{T as h}from"./TileCompressionPlugin-CHefINqs.js";import{U as y}from"./UpdateOnChangePlugin-UYN3BMUO.js";import{T}from"./TilesFadePlugin-oL7QwVsE.js";import"./EnvironmentControls-CJG7lPg-.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./GoogleCloudAuthPlugin-BapiqItz.js";let n,o,i,r,e;const C=localStorage.getItem("ionApiKey")??"put-your-api-key-here",a={apiKey:C,reload:p};R();m();function p(){e&&(o.remove(e.group),e.dispose(),e=null),localStorage.setItem("ionApiKey",a.apiKey),e=new c,e.ellipsoid.copy(f),e.registerPlugin(new P({apiToken:a.apiKey,assetId:"2684829",autoRefreshToken:!0})),e.registerPlugin(new h),e.registerPlugin(new y),e.registerPlugin(new T),e.group.rotation.x=-Math.PI/2,e.errorTarget=20,o.add(e.group),e.setCamera(i),n.setTilesRenderer(e)}function R(){r=new d({antialias:!0}),r.setClearColor(1383455),document.body.appendChild(r.domElement),o=new l,i=new u(60,window.innerWidth/window.innerHeight,1,16e7),i.position.set(2620409,0,-6249816),i.lookAt(0,0,0),n=new g(o,i,r.domElement,null),n.enableDamping=!0,p(),s(),window.addEventListener("resize",s,!1);const t=new w;t.width=300,t.add(a,"apiKey"),t.add(a,"reload")}function s(){const t=window.innerWidth/window.innerHeight;i.aspect=t,i.updateProjectionMatrix(),r.setSize(window.innerWidth,window.innerHeight),r.setPixelRatio(window.devicePixelRatio)}function m(){requestAnimationFrame(m),e&&(n.update(),e.setResolutionFromRenderer(i,r),i.updateMatrixWorld(),e.update(),r.render(o,i))} diff --git a/example/bundle/assets/landformSiteOverlay-CtdkAejr.js b/example/bundle/assets/landformSiteOverlay-CtdkAejr.js new file mode 100644 index 00000000..159dd011 --- /dev/null +++ b/example/bundle/assets/landformSiteOverlay-CtdkAejr.js @@ -0,0 +1,29 @@ +import{k as v,j as N,Q as P,C as k,ac as J,ad as S,S as U,W as j,a as q,G as I,a2 as Y,n as B}from"./three.module-_fL2BuBc.js";import{g as D}from"./lil-gui.module.min-Bc0DeA9g.js";import{P as Q,T as V}from"./TilesRenderer-DkGmB3Pz.js";import{E as K}from"./EnvironmentControls-CJG7lPg-.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";const M=new v,w=new P,y=new v;function E(a,e){if(a.sceneMatrix)return;const{translation:t,rotation:r,scale:s}=a;if(M.set(t.x,t.y,t.z),w.set(r.x,r.y,r.z,r.w),y.set(s.x,s.y,s.z),a.matrix=new N().compose(M,w,y),a.sceneMatrix=new N().copy(a.matrix),a.parent_id!==""){const i=e.find(o=>o.id===a.parent_id);E(i,e),a.sceneMatrix.premultiply(i.sceneMatrix)}}class W{constructor(){this.fetchOptions={}}loadAsync(e){return fetch(e,this.fetchOptions).then(t=>t.json()).then(t=>this.parse(t))}parse(e){return e.frames.forEach(t=>E(t,e.frames)),e}}const z=a=>class extends a{constructor(...e){super(...e),this.textures=[],this.overlayColor=new k(8716287),this.displayAsOverlay=!1}onBeforeCompile(e){const t=this.textures,r=this;e.uniforms.textures={get value(){return r.textures}},e.uniforms.overlayColor={get value(){return r.overlayColor}},e.defines={DISPLAY_AS_OVERLAY:Number(this.displayAsOverlay)},t.length!==0&&(e.fragmentShader=e.fragmentShader.replace(/void main/,s=>` + uniform sampler2D textures[ ${t.length} ]; + uniform vec3 overlayColor; + ${s} + + `).replace(/#include /,s=>` + + ${s} + + vec4 col; + #pragma unroll_loop_start + for ( int i = 0; i < ${t.length}; i ++ ) { + + col = texture( textures[ i ], vMapUv ); + + #if DISPLAY_AS_OVERLAY + + diffuseColor = mix( diffuseColor, vec4( overlayColor, 1.0 ), col.r * 0.5 ); + + #else + + diffuseColor = mix( diffuseColor, col, col.a ); + + #endif + + } + #pragma unroll_loop_end + + `))}customProgramCacheKey(){return String(this.displayAsOverlay)+String(this.textures.length)+this.onBeforeCompile.toString()}};function G(){let a=!1,e=!1,t=-1;return typeof navigator<"u"&&(a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,e=navigator.userAgent.indexOf("Firefox")>-1,t=e?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),!(typeof createImageBitmap>"u"||a||e&&t<98)}class ${constructor(e,t){this.cache={},this.fetchOptions={},this.loadTextureCallback=e,this.queue=t}getTextureLoader(){const e=this.fetchOptions;let t;return G()?t=new J:t=new S,e.credentials==="include"&&e.mode==="cors"&&t.setCrossOrigin("use-credentials"),"credentials"in e&&t.setWithCredentials(e.credentials==="include"),e.headers&&t.setRequestHeader(e.headers),t}loadTexture(e){const t=this.cache;if(e in t)return t[e].promise;const r=new AbortController,s=this.queue.add(e,()=>this.loadTextureCallback(e)).then(i=>{if(r.signal.aborted)throw new Error("TextureCache: Texture load aborted.");return t[e].texture=i,i});return this.cache[e]={texture:null,abortController:r,promise:s},s}getTexture(e){const t=this.cache;return e in t?t[e].texture:null}deleteTexture(e){const t=this.cache;if(e in t){const r=t[e];r.refs--,r.refs===0&&(r.texture?r.texture.dispose():r.abortController&&(r.abortController.abort(),this.queue.remove(e)),delete this.cache[e])}}dispose(){const e=this.cache;for(const t in e){const r=e[t];r.texture?(r.texture.dispose(),r.texture.image instanceof ImageBitmap&&r.texture.image.close()):r.abortController&&r.abortController.abort()}}}class H{constructor(e={}){e={textureUpdateCallback:()=>{throw new Error('TextureOverlayPlugin: "textureUpdateCallback" required.')},waitForLoadCompletion:!0,...e},this.name="TEXTURE_OVERLAY_PLUGIN",this.caches=null,this.queue=null,this.tiles=null,this.textureUpdateCallback=e.textureUpdateCallback,this.waitForLoadCompletion=e.waitForLoadCompletion}init(e){this.tiles=e,this.caches={},this.queue=new Q,this.queue.priorityCallback=(t,r)=>e.downloadQueue.priorityCallback(t,r),this._disposeModelCallback=({tile:t})=>{const r=this.caches;for(const s in r)r[s].deleteTexture(this.getTileKey(t))},this._assignTexturesCallback=({tile:t,scene:r})=>{queueMicrotask(()=>this.textureUpdateCallback(r,t,this))},e.addEventListener("dispose-model",this._disposeModelCallback),e.addEventListener("load-model",this._assignTexturesCallback),e.addEventListener("layer-textures-change",this._assignTexturesCallback)}processTileModel(e,t){const r=this.caches,s=[];for(const i in r){const n=r[i].loadTexture(this.getTileKey(t)).catch(()=>{});s.push(n)}return Promise.all(s)}dispose(){const{caches:e,tiles:t}=this;Object.keys(e).forEach(r=>{this.unregisterLayer(r)}),t.removeEventListener("dispose-model",this._disposeModelCallback),t.removeEventListener("load-model",this._assignTexturesCallback),t.removeEventListener("layer-textures-change",this._assignTexturesCallback)}getTileKey(e){return new URL(e.content.uri,e.__basePath+"/").toString()}getTexturesForTile(e,t={}){const r=this.getTileKey(e),s=this.caches;for(const i in t)i in s||delete t[i];for(const i in s)t[i]=s[i].getTexture(r);return t}hasLayer(e){return e in this.caches}registerLayer(e,t){if(e in this.caches)throw new Error(`TextureOverlayPlugin: Texture overlay named ${e} already exists.`);const r=this.tiles,s=new $(t,this.queue);if(s.fetchOptions=r.fetchOptions,this.caches[e]=s,this.waitForLoadCompletion){const i=[];r.forEachLoadedModel((o,n)=>{const c=s.loadTexture(this.getTileKey(n)).then(()=>({scene:o,tile:n}));i.push(c)}),Promise.allSettled(i).then(o=>{e in this.caches&&o.forEach(n=>{n.status==="fulfilled"&&this.textureUpdateCallback(n.value.scene,n.value.tile,this)})})}else r.forEachLoadedModel((i,o)=>{s.loadTexture(this.getTileKey(o)).then(()=>this.textureUpdateCallback(i,o,this)).catch(()=>{})})}unregisterLayer(e){const t=this.tiles,r=this.caches;if(e in r){const s=r[e];delete r[e],t.forEachLoadedModel((i,o)=>{s.getTexture(this.getTileKey(o))&&this.textureUpdateCallback(i,o,this)}),s.dispose()}}}const X=["NLF_0477_0709296508M723RAS_N0261004NCAM00701_0A0085J02/NLF_0477_0709296508M723RAS_N0261004NCAM00701_0A0085J02_scene.json","NLF_0477_0709296508M723RAS_N0261004NCAM00708_0A00LLJ02/NLF_0477_0709296508M723RAS_N0261004NCAM00708_0A00LLJ02_scene.json","NLF_0477_0709297328M366RAS_N0261004NCAM03477_0A0195J02/NLF_0477_0709297328M366RAS_N0261004NCAM03477_0A0195J02_scene.json","NLF_0477_0709297503M102RAS_N0261004NCAM03477_0A0195J02/NLF_0477_0709297503M102RAS_N0261004NCAM03477_0A0195J02_scene.json","NLF_0477_0709297668M065RAS_N0261004NCAM03477_0A0195J02/NLF_0477_0709297668M065RAS_N0261004NCAM03477_0A0195J02_scene.json","NLF_0477_0709297838M897RAS_N0261004NCAM02477_0A0195J02/NLF_0477_0709297838M897RAS_N0261004NCAM02477_0A0195J02_scene.json","NLF_0477_0709298005M099RAS_N0261004NCAM02477_0A0195J02/NLF_0477_0709298005M099RAS_N0261004NCAM02477_0A0195J02_scene.json","NLF_0477_0709298187M680RAS_N0261004NCAM13477_0A0195J02/NLF_0477_0709298187M680RAS_N0261004NCAM13477_0A0195J02_scene.json","NLF_0477_0709298299M678RAS_N0261004NCAM13477_0A0195J02/NLF_0477_0709298299M678RAS_N0261004NCAM13477_0A0195J02_scene.json","NLF_0477_0709298393M010RAS_N0261004NCAM13477_0A0195J02/NLF_0477_0709298393M010RAS_N0261004NCAM13477_0A0195J02_scene.json"].map(a=>"https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/m20-drive-1004/tilesets/"+a),x=[];let d,f,A,u;const g={errorTarget:12,slopeDisplay:"NONE"};Z();R();function Z(){A=new U,u=new j({antialias:!0}),u.setPixelRatio(window.devicePixelRatio),u.setSize(window.innerWidth,window.innerHeight),u.setClearColor(14208704),document.body.appendChild(u.domElement),u.domElement.tabIndex=1,d=new q(60,window.innerWidth/window.innerHeight,.025,4e3),d.position.set(-20,10,20),d.lookAt(0,0,0),f=new K(A,d,u.domElement),f.adjustHeight=!1,f.minDistance=1,f.maxAltitude=Math.PI;const a=new I;a.rotation.set(Math.PI/2,0,0),A.add(a);let e=null,t=null,r=null;const s=async o=>{const n=o.replace("/tilesets/","/textures/SMG/").replace(/\.[0-9a-z]+$/i,".png");return new S().loadAsync(n).then(c=>(c.colorSpace=Y,c.flipY=!1,c))};X.forEach(async o=>{const n=await new W().loadAsync(o),c=o.split(/[\\/]/g);c.pop();const C=z(B);n.tilesets.forEach(p=>{const b=[...c,`${p.id}_tileset.json`].join("/"),l=new V(b),O=(m,L,_)=>{m.traverse(h=>{h.material&&(h.material.textures=Object.values(_.getTexturesForTile(L)),h.material.displayAsOverlay=g.slopeDisplay==="OVERLAY",h.material.needsUpdate=!0)})},F=new H({textureUpdateCallback:O});l.registerPlugin(F),l.addEventListener("load-model",({tile:m,scene:L})=>{L.traverse(_=>{if(_.material){const h=new C;h.copy(_.material),_.material=h}})}),r=r||l.lruCache,t=t||l.parseQueue,e=e||l.downloadQueue,l.lruCache=r,l.downloadQueue=e,l.parseQueue=t,l.setCamera(d),n.frames.find(m=>m.id===p.frame_id).sceneMatrix.decompose(l.group.position,l.group.quaternion,l.group.scale),a.add(l.group),x.push(l)})}),T(),window.addEventListener("resize",T,!1);const i=new D;i.add(g,"errorTarget",0,100),i.add(g,"slopeDisplay",["NONE","OVERLAY","SOLID"]).onChange(o=>{o!=="NONE"?x.forEach(n=>{const c=n.getPluginByName("TEXTURE_OVERLAY_PLUGIN");c.hasLayer("slopeLayer")||c.registerLayer("slopeLayer",s),n.forEachLoadedModel(C=>{C.traverse(p=>{p.material&&(p.material.displayAsOverlay=o==="OVERLAY",p.material.needsUpdate=!0)})})}):x.forEach(n=>{n.getPluginByName("TEXTURE_OVERLAY_PLUGIN").unregisterLayer("slopeLayer")})}),i.open()}function T(){d.aspect=window.innerWidth/window.innerHeight,d.updateProjectionMatrix(),u.setSize(window.innerWidth,window.innerHeight),u.setPixelRatio(window.devicePixelRatio)}function R(){requestAnimationFrame(R),f.update(),d.updateMatrixWorld(),x.forEach(a=>{a.errorTarget=g.errorTarget,a.setResolutionFromRenderer(d,u),a.update()}),u.render(A,d)} diff --git a/example/bundle/assets/leva.esm-CLDXiY66.js b/example/bundle/assets/leva.esm-CLDXiY66.js new file mode 100644 index 00000000..763d0c13 --- /dev/null +++ b/example/bundle/assets/leva.esm-CLDXiY66.js @@ -0,0 +1,64 @@ +import{u as ba,r as d,c as va,j as z,g as ya,k as fi,l as di,R as g,m as wa,n as pi,o as xa}from"./extends-BiwV-o27.js";function Ea({children:e,...t}){const[n]=ba(s=>[s.gl]),r=d.useMemo(()=>document.createElement("div"),[]),o=d.useMemo(()=>va(r),[r]),i=d.useMemo(()=>{const s=new ResizeObserver(([{contentRect:a}])=>{r.style.top=`${a.top}px`,r.style.left=`${a.left}px`,r.style.width=`${a.width}px`,r.style.height=`${a.height}px`});return s.observe(n.domElement),s},[n,r]);d.useEffect(()=>(r.style.pointerEvents="none",r.style.position="absolute",document.body.appendChild(r),()=>{r.remove(),i.disconnect()}),[i,r]),o.render(z.jsx(d.StrictMode,{children:z.jsx("div",{...t,children:e})}))}function mm({children:e,style:t,...n}){const r=d.useContext(ya),[o,i]=d.useState([]);d.useEffect(()=>{if(!r)return;let l=!1;const u=()=>{l||(l=!0,queueMicrotask(()=>{i(r.getAttributions()),l=!1}))};return r.addEventListener("tile-visibility-change",u),r.addEventListener("load-tile-set",u),()=>{r.removeEventListener("tile-visibility-change",u),r.removeEventListener("load-tile-set",u)}},[r]);const s=[];o.forEach((l,u)=>{let f=null;l.type==="string"?f=z.jsx("div",{children:l.value},u):l.type==="html"?f=z.jsx("div",{dangerouslySetInnerHTML:{__html:l.value},style:{pointerEvents:"all"}},u):l.type==="image"&&(f=z.jsx("div",{children:z.jsx("img",{src:l.value})},u)),f&&s.push(f)});const a=d.useMemo(()=>"class_"+window.crypto.randomUUID(),[]),c=d.useMemo(()=>` + #${a} a { + color: white; + } + + #${a} img { + max-width: 125px; + display: block; + margin: 5px 0; + } + `,[a]);return z.jsxs(Ea,{id:a,style:{position:"absolute",bottom:0,left:0,padding:"10px",color:"rgba( 255, 255, 255, 0.75 )",fontSize:"10px",...t},...n,children:[z.jsx("style",{children:c}),e,s]})}function $a(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function hi(...e){return t=>e.forEach(n=>$a(n,t))}function Ye(...e){return d.useCallback(hi(...e),e)}var gi=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),i=o.find(Sa);if(i){const s=i.props.children,a=o.map(c=>c===i?d.Children.count(s)>1?d.Children.only(null):d.isValidElement(s)?s.props.children:null:c);return z.jsx(Gn,{...r,ref:t,children:d.isValidElement(s)?d.cloneElement(s,void 0,a):null})}return z.jsx(Gn,{...r,ref:t,children:n})});gi.displayName="Slot";var Gn=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Oa(n);return d.cloneElement(n,{...Ca(r,n.props),ref:t?hi(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Gn.displayName="SlotClone";var mi=({children:e})=>z.jsx(z.Fragment,{children:e});function Sa(e){return d.isValidElement(e)&&e.type===mi}function Ca(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Oa(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ra=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fe=Ra.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?gi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),z.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _a(e,t){e&&fi.flushSync(()=>e.dispatchEvent(t))}var Ue=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Pa="Portal",bi=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=d.useState(!1);Ue(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?di.createPortal(z.jsx(Fe.div,{...r,ref:t}),s):null});bi.displayName=Pa;var Ta=bi,Ur=Object.prototype.hasOwnProperty;function Pt(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Pt(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ur.call(e,n)&&++r&&!Ur.call(t,n)||!(n in t)||!Pt(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function mn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r0;)s[a]=arguments[a+4];e.call(this,s),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=o,this.target=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Ee=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Ee.prototype._applyRule=function(t,n){var r=this;return function(){for(var o=[],i=arguments.length;i--;)o[i]=arguments[i];return r.chain.push(new bn(n,t.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}};Ee.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new ka(n,t.simple,t.async)),this};Ee.prototype._clone=function(){return new Ee(this.chain.slice(),this.nextRuleModifiers.slice())};Ee.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})};Ee.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(r){try{r._check(t)}catch(o){n.push(new wr(r,t,o))}}),n};Ee.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(r){throw new wr(n,t,r)}})};Ee.prototype.testAsync=function(t){var n=this;return new Promise(function(r,o){wi(t,n.chain.slice(),r,o)})};function wi(e,t,n,r){if(t.length){var o=t.shift();o._testAsync(e).then(function(){wi(e,t,n,r)},function(i){r(new wr(o,e,i))})}else n(e)}var Kr=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function Aa(e,t){return t===void 0&&(t=!1),{simple:function(n){return Kr(n,t)||e.check(n)===void 0},async:function(n){return Kr(n,t)||e.testAsync(n)}}}function ce(){return typeof Proxy<"u"?xi(new Ee):Yn(new Ee)}var Tt={};ce.extend=function(e){Object.assign(Tt,e)};ce.clearCustomRules=function(){Tt={}};function xi(e){return new Proxy(e,{get:function(n,r){if(r in n)return n[r];var o=xi(e._clone());if(r in en)return o._applyModifier(en[r],r);if(r in Tt)return o._applyRule(Tt[r],r);if(r in qn)return o._applyRule(qn[r],r)}})}function Yn(e){var t=function(o,i){return Object.keys(o).forEach(function(s){i[s]=function(){for(var a=[],c=arguments.length;c--;)a[c]=arguments[c];var l=Yn(i._clone()),u=l._applyRule(o[s],s).apply(void 0,a);return u}}),i},n=t(qn,e),r=t(Tt,n);return Object.keys(en).forEach(function(o){Object.defineProperty(r,o,{get:function(){var i=Yn(r._clone());return i._applyModifier(en[o],o)}})}),r}var en={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(e){return function(t){return Ut(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Ut(t).map(function(n){try{return e(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(e){return function(t){return t!==!1&&Ut(t).every(e)}},async:function(e){return function(t){return Promise.all(Ut(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return Gr(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then(function(r){return Gr(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function Gr(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Ut(e){return typeof e=="string"?e.split(""):e}var qn={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return e===void 0&&(e=!0),function(t){return typeof t=="number"&&(e||isFinite(t))}},integer:function(){return function(e){var t=Number.isInteger||Da;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return tt("string")},boolean:function(){return tt("boolean")},undefined:function(){return tt("undefined")},null:function(){return tt("null")},array:function(){return tt("array")},object:function(){return tt("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return typeof e=="boolean"||e===e.toLowerCase()&&e.trim()!==""}},uppercase:function(){return function(e){return e===e.toUpperCase()&&e.trim()!==""}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return e.length===0}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return te}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2===0}},odd:function(){return function(e){return e%2!==0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return Ia(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(r){return r.test(n)})}},optional:Aa};function tt(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function Da(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function Ia(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(r){var o=e[r];try{o.check((t||{})[r])}catch(i){i.target=r,n.push(i)}}),n.length>0)throw n;return!0},async:function(t){var n=[],r=Object.keys(e).map(function(o){var i=e[o];return i.testAsync((t||{})[o]).catch(function(s){s.target=o,n.push(s)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var V="colors",ne="sizes",_="space",ja={gap:_,gridGap:_,columnGap:_,gridColumnGap:_,rowGap:_,gridRowGap:_,inset:_,insetBlock:_,insetBlockEnd:_,insetBlockStart:_,insetInline:_,insetInlineEnd:_,insetInlineStart:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,marginBlock:_,marginBlockEnd:_,marginBlockStart:_,marginInline:_,marginInlineEnd:_,marginInlineStart:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,paddingBlock:_,paddingBlockEnd:_,paddingBlockStart:_,paddingInline:_,paddingInlineEnd:_,paddingInlineStart:_,top:_,right:_,bottom:_,left:_,scrollMargin:_,scrollMarginTop:_,scrollMarginRight:_,scrollMarginBottom:_,scrollMarginLeft:_,scrollMarginX:_,scrollMarginY:_,scrollMarginBlock:_,scrollMarginBlockEnd:_,scrollMarginBlockStart:_,scrollMarginInline:_,scrollMarginInlineEnd:_,scrollMarginInlineStart:_,scrollPadding:_,scrollPaddingTop:_,scrollPaddingRight:_,scrollPaddingBottom:_,scrollPaddingLeft:_,scrollPaddingX:_,scrollPaddingY:_,scrollPaddingBlock:_,scrollPaddingBlockEnd:_,scrollPaddingBlockStart:_,scrollPaddingInline:_,scrollPaddingInlineEnd:_,scrollPaddingInlineStart:_,fontSize:"fontSizes",background:V,backgroundColor:V,backgroundImage:V,borderImage:V,border:V,borderBlock:V,borderBlockEnd:V,borderBlockStart:V,borderBottom:V,borderBottomColor:V,borderColor:V,borderInline:V,borderInlineEnd:V,borderInlineStart:V,borderLeft:V,borderLeftColor:V,borderRight:V,borderRightColor:V,borderTop:V,borderTopColor:V,caretColor:V,color:V,columnRuleColor:V,fill:V,outline:V,outlineColor:V,stroke:V,textDecorationColor:V,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:ne,minBlockSize:ne,maxBlockSize:ne,inlineSize:ne,minInlineSize:ne,maxInlineSize:ne,width:ne,minWidth:ne,maxWidth:ne,height:ne,minHeight:ne,maxHeight:ne,flexBasis:ne,gridTemplateColumns:ne,gridTemplateRows:ne,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},Ma=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,ut=()=>{const e=Object.create(null);return(t,n,...r)=>{const o=(i=>JSON.stringify(i,Ma))(t);return o in e?e[o]:e[o]=n(t,...r)}},He=Symbol.for("sxs.internal"),xr=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),Yr=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:La}=Object.prototype,Xn=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),Na=/\s+(?![^()]*\))/,nt=e=>t=>e(...typeof t=="string"?String(t).split(Na):[t]),qr={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:nt((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:nt((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:nt((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:nt((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:nt((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:nt((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},jn=/([\d.]+)([^]*)/,za=(e,t)=>e.length?e.reduce((n,r)=>(n.push(...t.map(o=>o.includes("&")?o.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(o)?`:is(${r})`:r):r+" "+o)),n),[]):t,Fa=(e,t)=>e in Ba&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,o,i)=>r+(o==="stretch"?`-moz-available${i};${Xn(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${Xn(e)}:${r}fit-content`)+i):String(t),Ba={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Te=e=>e?e+"-":"",Ei=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,o,i,s,a)=>s=="$"==!!i?r:(o||s=="--"?"calc(":"")+"var(--"+(s==="$"?Te(t)+(a.includes("$")?"":Te(n))+a.replace(/\$/g,"-"):a)+")"+(o||s=="--"?"*"+(o||"")+(i||"1")+")":"")),Wa=/\s*,\s*(?![^()]*\))/,Ha=Object.prototype.toString,ot=(e,t,n,r,o)=>{let i,s,a;const c=(l,u,f)=>{let p,h;const m=b=>{for(p in b){const w=p.charCodeAt(0)===64,x=w&&Array.isArray(b[p])?b[p]:[b[p]];for(h of x){const $=/[A-Z]/.test(v=p)?v:v.replace(/-[^]/g,E=>E[1].toUpperCase()),C=typeof h=="object"&&h&&h.toString===Ha&&(!r.utils[$]||!u.length);if($ in r.utils&&!C){const E=r.utils[$];if(E!==s){s=E,m(E(h)),s=null;continue}}else if($ in qr){const E=qr[$];if(E!==a){a=E,m(E(h)),a=null;continue}}if(w&&(y=p.slice(1)in r.media?"@media "+r.media[p.slice(1)]:p,p=y.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(E,S,k,F,R,P)=>{const T=jn.test(S),I=.0625*(T?-1:1),[j,L]=T?[F,S]:[S,F];return"("+(k[0]==="="?"":k[0]===">"===T?"max-":"min-")+j+":"+(k[0]!=="="&&k.length===1?L.replace(jn,(B,W,M)=>Number(W)+I*(k===">"?1:-1)+M):L)+(R?") and ("+(R[0]===">"?"min-":"max-")+j+":"+(R.length===1?P.replace(jn,(B,W,M)=>Number(W)+I*(R===">"?-1:1)+M):P):"")+")"})),C){const E=w?f.concat(p):[...f],S=w?[...u]:za(u,p.split(Wa));i!==void 0&&o(Xr(...i)),i=void 0,c(h,S,E)}else i===void 0&&(i=[[],u,f]),p=w||p.charCodeAt(0)!==36?p:`--${Te(r.prefix)}${p.slice(1).replace(/\$/g,"-")}`,h=C?h:typeof h=="number"?h&&$ in Va?String(h)+"px":String(h):Ei(Fa($,h??""),r.prefix,r.themeMap[$]),i[0].push(`${w?`${p} `:`${Xn(p)}:`}${h}`)}}var y,v};m(l),i!==void 0&&o(Xr(...i)),i=void 0};c(e,t,n)},Xr=(e,t,n)=>`${n.map(r=>`${r}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,Va={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Jr=e=>String.fromCharCode(e+(e>25?39:97)),Ve=e=>(t=>{let n,r="";for(n=Math.abs(t);n>52;n=n/52|0)r=Jr(n%52)+r;return Jr(n%52)+r})(((t,n)=>{let r=n.length;for(;r;)t=33*t^n.charCodeAt(--r);return t})(5381,JSON.stringify(e))>>>0),Ct=["themed","global","styled","onevar","resonevar","allvar","inline"],Ua=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},Ka=e=>{let t;const n=()=>{const{cssRules:o}=t.sheet;return[].map.call(o,(i,s)=>{const{cssText:a}=i;let c="";if(a.startsWith("--sxs"))return"";if(o[s-1]&&(c=o[s-1].cssText).startsWith("--sxs")){if(!i.cssRules.length)return"";for(const l in t.rules)if(t.rules[l].group===i)return`--sxs{--sxs:${[...t.rules[l].cache].join(" ")}}${a}`;return i.cssRules.length?`${c}${a}`:""}return a}).join("")},r=()=>{if(t){const{rules:a,sheet:c}=t;if(!c.deleteRule){for(;Object(Object(c.cssRules)[0]).type===3;)c.cssRules.splice(0,1);c.cssRules=[]}for(const l in a)delete a[l]}const o=Object(e).styleSheets||[];for(const a of o)if(Ua(a)){for(let c=0,l=a.cssRules;l[c];++c){const u=Object(l[c]);if(u.type!==1)continue;const f=Object(l[c+1]);if(f.type!==4)continue;++c;const{cssText:p}=u;if(!p.startsWith("--sxs"))continue;const h=p.slice(14,-3).trim().split(/\s+/),m=Ct[h[0]];m&&(t||(t={sheet:a,reset:r,rules:{},toString:n}),t.rules[m]={group:f,index:c,cache:new Set(h)})}if(t)break}if(!t){const a=(c,l)=>({type:l,cssRules:[],insertRule(u,f){this.cssRules.splice(f,0,a(u,{import:3,undefined:1}[(u.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return c==="@media{}"?`@media{${[].map.call(this.cssRules,u=>u.cssText).join("")}}`:c}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:a("","text/css"),rules:{},reset:r,toString:n}}const{sheet:i,rules:s}=t;for(let a=Ct.length-1;a>=0;--a){const c=Ct[a];if(!s[c]){const l=Ct[a+1],u=s[l]?s[l].index:i.cssRules.length;i.insertRule("@media{}",u),i.insertRule(`--sxs{--sxs:${a}}`,u),s[c]={group:i.cssRules[u+1],index:u,cache:new Set([a])}}Ga(s[c])}};return r(),t},Ga=e=>{const t=e.group;let n=t.cssRules.length;e.apply=r=>{try{t.insertRule(r,n),++n}catch{}}},Et=Symbol(),Ya=ut(),Zr=(e,t)=>Ya(e,()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[He]){r.type==null&&(r.type=o[He].type);for(const i of o[He].composers)r.composers.add(i)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(qa(o,e));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),Xa(e,r,t)}),qa=({variants:e,compoundVariants:t,defaultVariants:n,...r},o)=>{const i=`${Te(o.prefix)}c-${Ve(r)}`,s=[],a=[],c=Object.create(null),l=[];for(const p in n)c[p]=String(n[p]);if(typeof e=="object"&&e)for(const p in e){u=c,f=p,La.call(u,f)||(c[p]="undefined");const h=e[p];for(const m in h){const b={[p]:String(m)};String(m)==="undefined"&&l.push(p);const y=h[m],v=[b,y,!Yr(y)];s.push(v)}}var u,f;if(typeof t=="object"&&t)for(const p of t){let{css:h,...m}=p;h=typeof h=="object"&&h||{};for(const y in m)m[y]=String(m[y]);const b=[m,h,!Yr(h)];a.push(b)}return[i,r,s,a,c,l]},Xa=(e,t,n)=>{const[r,o,i,s]=Ja(t.composers),a=typeof t.type=="function"||t.type.$$typeof?(f=>{function p(){for(let h=0;hp.rules[h]={apply:m=>p[Et].push([h,m])}),p})(n):null,c=(a||n).rules,l=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,u=f=>{f=typeof f=="object"&&f||Za;const{css:p,...h}=f,m={};for(const v in i)if(delete h[v],v in f){let w=f[v];typeof w=="object"&&w?m[v]={"@initial":i[v],...w}:(w=String(w),m[v]=w!=="undefined"||s.has(v)?w:i[v])}else m[v]=i[v];const b=new Set([...o]);for(const[v,w,x,$]of t.composers){n.rules.styled.cache.has(v)||(n.rules.styled.cache.add(v),ot(w,[`.${v}`],[],e,S=>{c.styled.apply(S)}));const C=Qr(x,m,e.media),E=Qr($,m,e.media,!0);for(const S of C)if(S!==void 0)for(const[k,F,R]of S){const P=`${v}-${Ve(F)}-${k}`;b.add(P);const T=(R?n.rules.resonevar:n.rules.onevar).cache,I=R?c.resonevar:c.onevar;T.has(P)||(T.add(P),ot(F,[`.${P}`],[],e,j=>{I.apply(j)}))}for(const S of E)if(S!==void 0)for(const[k,F]of S){const R=`${v}-${Ve(F)}-${k}`;b.add(R),n.rules.allvar.cache.has(R)||(n.rules.allvar.cache.add(R),ot(F,[`.${R}`],[],e,P=>{c.allvar.apply(P)}))}}if(typeof p=="object"&&p){const v=`${r}-i${Ve(p)}-css`;b.add(v),n.rules.inline.cache.has(v)||(n.rules.inline.cache.add(v),ot(p,[`.${v}`],[],e,w=>{c.inline.apply(w)}))}for(const v of String(f.className||"").trim().split(/\s+/))v&&b.add(v);const y=h.className=[...b].join(" ");return{type:t.type,className:y,selector:l,props:h,toString:()=>y,deferredInjector:a}};return xr(u,{className:r,selector:l,[He]:t,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},Ja=e=>{let t="";const n=[],r={},o=[];for(const[i,,,,s,a]of e){t===""&&(t=i),n.push(i),o.push(...a);for(const c in s){const l=s[c];(r[c]===void 0||l!=="undefined"||a.includes(l))&&(r[c]=l)}}return[t,n,r,new Set(o)]},Qr=(e,t,n,r)=>{const o=[];e:for(let[i,s,a]of e){if(a)continue;let c,l=0,u=!1;for(c in i){const f=i[c];let p=t[c];if(p!==f){if(typeof p!="object"||!p)continue e;{let h,m,b=0;for(const y in p){if(f===String(p[y])){if(y!=="@initial"){const v=y.slice(1);(m=m||[]).push(v in n?n[v]:y.replace(/^@media ?/,"")),u=!0}l+=b,h=!0}++b}if(m&&m.length&&(s={["@media "+m.join(", ")]:s}),!h)continue e}}}(o[l]=o[l]||[]).push([r?"cv":`${c}-${i[c]}`,s,u])}return o},Za={},Qa=ut(),ec=(e,t)=>Qa(e,()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let i=Ve(o);if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in o){let s=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let a of[].concat(o["@import"]))a=a.includes('"')||a.includes("'")?a:`"${a}"`,t.sheet.insertRule(`@import ${a};`,s++);delete o["@import"]}ot(o,[],[],e,s=>{t.rules.global.apply(s)})}}return""};return xr(r,{toString:r})}),tc=ut(),nc=(e,t)=>tc(e,()=>n=>{const r=`${Te(e.prefix)}k-${Ve(n)}`,o=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];ot(n,[],[],e,a=>i.push(a));const s=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(s)}return r};return xr(o,{get name(){return o()},toString:o})}),rc=class{constructor(e,t,n,r){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Te(this.prefix)+Te(this.scale)+this.token}toString(){return this.computedValue}},oc=ut(),ic=(e,t)=>oc(e,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${Te(e.prefix)}t-${Ve(r)}`}`,i={},s=[];for(const c in r){i[c]={};for(const l in r[c]){const u=`--${Te(e.prefix)}${c}-${l}`,f=Ei(String(r[c][l]),e.prefix,c);i[c][l]=new rc(l,f,c,e.prefix),s.push(`${u}:${f}`)}}const a=()=>{if(s.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const c=`${r===e.theme?":root,":""}.${n}{${s.join(";")}}`;t.rules.themed.apply(c)}return n};return{...i,get className(){return a()},selector:o,toString:a}}),sc=ut(),ac=ut(),cc=e=>{const t=(n=>{let r=!1;const o=sc(n,i=>{r=!0;const s="prefix"in(i=typeof i=="object"&&i||{})?String(i.prefix):"",a=typeof i.media=="object"&&i.media||{},c=typeof i.root=="object"?i.root||null:globalThis.document||null,l=typeof i.theme=="object"&&i.theme||{},u={prefix:s,media:a,theme:l,themeMap:typeof i.themeMap=="object"&&i.themeMap||{...ja},utils:typeof i.utils=="object"&&i.utils||{}},f=Ka(c),p={css:Zr(u,f),globalCss:ec(u,f),keyframes:nc(u,f),createTheme:ic(u,f),reset(){f.reset(),p.theme.toString()},theme:{},sheet:f,config:u,prefix:s,getCssText:f.toString,toString:f.toString};return String(p.theme=p.createTheme(l)),p});return r||o.reset(),o})(e);return t.styled=(({config:n,sheet:r})=>ac(n,()=>{const o=Zr(n,r);return(...i)=>{const s=o(...i),a=s[He].type,c=g.forwardRef((l,u)=>{const f=l&&l.as||a,{props:p,deferredInjector:h}=s(l);return delete p.as,p.ref=u,h?g.createElement(g.Fragment,null,g.createElement(f,p),g.createElement(h,null)):g.createElement(f,p)});return c.className=s.className,c.displayName=`Styled.${a.displayName||a.name||a}`,c.selector=s.selector,c.toString=()=>s.selector,c[He]=s[He],c}}))(t),t};function lc(e,t,n){return Math.max(t,Math.min(e,n))}const ee={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function eo(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function to(e,t,n,r=.15){return r===0?lc(e,t,n):en?+eo(e-n,n-t,r)+n:e}function uc(e,[t,n],[r,o]){const[[i,s],[a,c]]=e;return[to(t,i,s,r),to(n,a,c,o)]}function fc(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dc(e){var t=fc(e,"string");return typeof t=="symbol"?t:String(t)}function ae(e,t,n){return t=dc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function no(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function wc(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Ci(e){return vn(e)?wc(e)[0]:e}function xc(e){return yc(e).map(t=>t.identifier)}function Mn(e){const t=Ci(e);return vn(e)?t.identifier:t.pointerId}function oo(e){const t=Ci(e);return[t.clientX,t.clientY]}function Ec(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}function tn(e,...t){return typeof e=="function"?e(...t):e}function $c(){}function Sc(...e){return e.length===0?$c:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function io(e,t){return Object.assign({},t,e||{})}const Cc=32;class Oc{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?tn(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let i=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,Ec(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,i=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const E=n._delta.map(Math.abs);ee.addTo(n._distance,E)}this.axisIntent&&this.axisIntent(t);const[s,a]=n._movement,[c,l]=r.threshold,{_step:u,values:f}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(s)>=c&&f[0]),u[1]===!1&&(u[1]=Math.abs(a)>=l&&f[1])):(u[0]===!1&&(u[0]=Math.abs(s)>=c&&Math.sign(s)*c),u[1]===!1&&(u[1]=Math.abs(a)>=l&&Math.sign(a)*l)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const p=[0,0];if(r.hasCustomTransform){const[E,S]=f;p[0]=u[0]!==!1?E-u[0]:0,p[1]=u[1]!==!1?S-u[1]:0}else p[0]=u[0]!==!1?s-u[0]:0,p[1]=u[1]!==!1?a-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(p);const h=n.offset,m=n._active&&!n._blocked||n.active;m&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=tn(r.bounds,n)),this.setup&&this.setup()),n.movement=p,this.computeOffset()));const[b,y]=n.offset,[[v,w],[x,$]]=n._bounds;n.overflow=[bw?1:0,y$?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const C=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=uc(n._bounds,n.offset,C),n.delta=ee.sub(n.offset,h),this.computeMovement(),m&&(!n.last||i>Cc)){n.delta=ee.sub(n.offset,h);const E=n.delta.map(Math.abs);ee.addTo(n.distance,E),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&i>0&&(n.velocity=[E[0]/i,E[1]/i],n.timeDelta=i)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(q(q(q({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Rc([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class _c extends Oc{constructor(...t){super(...t),ae(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ee.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ee.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[Si(t)]:r.axisThreshold;n.axis=Rc(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const Pc=e=>e,so=.15,Oi={enabled(e=!0){return e},eventOptions(e,t,n){return q(q({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[so,so];case!1:return[0,0];default:return ee.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return ee.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Pc},threshold(e){return ee.toVector(e,0)}},Tc=0,Dt=q(q({},Oi),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=Tc){return e},bounds(e={}){if(typeof e=="function")return i=>Dt.bounds(e(i));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),ao={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class kc extends _c{constructor(...t){super(...t),ae(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=Dt.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Mn(t),r._pointerActive=!0,this.computeValues(oo(t)),this.computeInitial(),n.preventScrollAxis&&Si(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=Mn(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=oo(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=ee.sub(i,n._values),this.computeValues(i)),ee.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=Mn(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,s]=n._distance;if(n.tap=i<=r.tapsThreshold&&s<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[a,c]=n._delta,[l,u]=n._movement,[f,p]=r.swipe.velocity,[h,m]=r.swipe.distance,b=r.swipe.duration;if(n.elapsedTimef&&Math.abs(l)>h&&(n.swipe[0]=Math.sign(a)),v>p&&Math.abs(u)>m&&(n.swipe[1]=Math.sign(c))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,Ac(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=ao[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,ee.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in ao&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Ac(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const It=typeof window<"u"&&window.document&&window.document.createElement;function Ri(){return It&&"ontouchstart"in window}function Dc(){return Ri()||It&&window.navigator.maxTouchPoints>1}function Ic(){return It&&"onpointerdown"in window}function jc(){return It&&"exitPointerLock"in window.document}function Mc(){try{return"constructor"in GestureEvent}catch{return!1}}const de={isBrowser:It,gesture:Mc(),touch:Ri(),touchscreen:Dc(),pointer:Ic(),pointerLock:jc()},Lc=250,Nc=180,zc=.5,Fc=50,Bc=250,Wc=10,co={mouse:0,touch:0,pen:8},Hc=q(q({},Dt),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&de.pointerLock,de.touch&&n?"touch":this.pointerLock?"mouse":de.pointer&&!o?"pointer":de.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?Lc:void 0,!(!de.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const i=ee.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=zc,distance:t=Fc,duration:n=Bc}={}){return{velocity:this.transform(ee.toVector(e)),distance:this.transform(ee.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return Nc;case!1:return 0;default:return e}},axisThreshold(e){return e?q(q({},co),e):co},keyboardDisplacement(e=Wc){return e}});q(q({},Oi),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!de.touch&&de.gesture)return"gesture";if(de.touch&&r)return"touch";if(de.touchscreen){if(de.pointer)return"pointer";if(de.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=s=>{const a=io(tn(n,s),{min:-1/0,max:1/0});return[a.min,a.max]},i=s=>{const a=io(tn(r,s),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[o(),i()]:s=>[o(s),i(s)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",ee.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});q(q({},Dt),{},{mouseOnly:(e=!0)=>e});q(q({},Dt),{},{mouseOnly:(e=!0)=>e});const _i=new Map,Jn=new Map;function Vc(e){_i.set(e.key,e.engine),Jn.set(e.key,e.resolver)}const Uc={key:"drag",engine:kc,resolver:Hc};function Kc(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Gc(e,t){if(e==null)return{};var n=Kc(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const Yc={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=de.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},qc=["target","eventOptions","window","enabled","transform"];function Zt(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=Zt(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function Xc(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:c}=r,l=Gc(r,qc);if(n.shared=Zt({target:o,eventOptions:i,window:s,enabled:a,transform:c},Yc),t){const u=Jn.get(t);n[t]=Zt(q({shared:n.shared},l),u)}else for(const u in l){const f=Jn.get(u);f&&(n[u]=Zt(q({shared:n.shared},l[u]),f))}return n}class Pi{constructor(t,n){ae(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const s=this._listeners,a=vc(n,r),c=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},l=q(q({},c),i);t.addEventListener(a,o,l);const u=()=>{t.removeEventListener(a,o,l),s.delete(u)};return s.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class Jc{constructor(){ae(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class Zc{constructor(t){ae(this,"gestures",new Set),ae(this,"_targetEventStore",new Pi(this)),ae(this,"gestureEventStores",{}),ae(this,"gestureTimeoutStores",{}),ae(this,"handlers",{}),ae(this,"config",{}),ae(this,"pointerIds",new Set),ae(this,"touchIds",new Set),ae(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Qc(this,t)}setEventIds(t){if(vn(t))return this.touchIds=new Set(xc(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=Xc(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const s of this.gestures){const a=this.config[s],c=lo(r,a.eventOptions,!!o);if(a.enabled){const l=_i.get(s);new l(this,t,s).bind(c)}}const i=lo(r,n.eventOptions,!!o);for(const s in this.nativeHandlers)i(s,"",a=>this.nativeHandlers[s](q(q({},this.state.shared),{},{event:a,args:t})),void 0,!0)}for(const i in r)r[i]=Sc(...r[i]);if(!o)return r;for(const i in r){const{device:s,capture:a,passive:c}=bc(i);this._targetEventStore.add(o,s,"",r[i],{capture:a,passive:c})}}}}function rt(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Pi(e,t),e.gestureTimeoutStores[t]=new Jc}function Qc(e,t){t.drag&&rt(e,"drag"),t.wheel&&rt(e,"wheel"),t.scroll&&rt(e,"scroll"),t.move&&rt(e,"move"),t.pinch&&rt(e,"pinch"),t.hover&&rt(e,"hover")}const lo=(e,t,n)=>(r,o,i,s={},a=!1)=>{var c,l;const u=(c=s.capture)!==null&&c!==void 0?c:t.capture,f=(l=s.passive)!==null&&l!==void 0?l:t.passive;let p=a?r:gc(r,o,u);n&&f&&(p+="Passive"),e[p]=e[p]||[],e[p].push(i)};function el(e,t={},n,r){const o=g.useMemo(()=>new Zc(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),g.useEffect(o.effect.bind(o)),g.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function tl(e,t){return Vc(Uc),el({drag:e},t||{},"drag")}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function nl(e,t=[]){let n=[];function r(i,s){const a=d.createContext(s),c=n.length;n=[...n,s];const l=f=>{var v;const{scope:p,children:h,...m}=f,b=((v=p==null?void 0:p[e])==null?void 0:v[c])||a,y=d.useMemo(()=>m,Object.values(m));return z.jsx(b.Provider,{value:y,children:h})};l.displayName=i+"Provider";function u(f,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[c])||a,m=d.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,u]}const o=()=>{const i=n.map(s=>d.createContext(s));return function(a){const c=(a==null?void 0:a[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,rl(o,...t)]}function rl(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:l})=>{const f=c(i)[`__scope${l}`];return{...a,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ft(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ol(e,t=globalThis==null?void 0:globalThis.document){const n=ft(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var il="DismissableLayer",Zn="dismissableLayer.update",sl="dismissableLayer.pointerDownOutside",al="dismissableLayer.focusOutside",uo,Ti=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ki=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...c}=e,l=d.useContext(Ti),[u,f]=d.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=d.useState({}),m=Ye(t,S=>f(S)),b=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=b.indexOf(y),w=u?b.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,$=w>=v,C=ul(S=>{const k=S.target,F=[...l.branches].some(R=>R.contains(k));!$||F||(o==null||o(S),s==null||s(S),S.defaultPrevented||a==null||a())},p),E=fl(S=>{const k=S.target;[...l.branches].some(R=>R.contains(k))||(i==null||i(S),s==null||s(S),S.defaultPrevented||a==null||a())},p);return ol(S=>{w===l.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},p),d.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(uo=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),fo(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=uo)}},[u,p,n,l]),d.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),fo())},[u,l]),d.useEffect(()=>{const S=()=>h({});return document.addEventListener(Zn,S),()=>document.removeEventListener(Zn,S)},[]),z.jsx(Fe.div,{...c,ref:m,style:{pointerEvents:x?$?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,C.onPointerDownCapture)})});ki.displayName=il;var cl="DismissableLayerBranch",ll=d.forwardRef((e,t)=>{const n=d.useContext(Ti),r=d.useRef(null),o=Ye(t,r);return d.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),z.jsx(Fe.div,{...e,ref:o})});ll.displayName=cl;function ul(e,t=globalThis==null?void 0:globalThis.document){const n=ft(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){Ai(sl,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fl(e,t=globalThis==null?void 0:globalThis.document){const n=ft(e),r=d.useRef(!1);return d.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ai(al,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fo(){const e=new CustomEvent(Zn);document.dispatchEvent(e)}function Ai(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_a(o,i):o.dispatchEvent(i)}var dl=wa.useId||(()=>{}),pl=0;function hl(e){const[t,n]=d.useState(dl());return Ue(()=>{n(r=>r??String(pl++))},[e]),t?`radix-${t}`:""}const gl=["top","right","bottom","left"],je=Math.min,le=Math.max,nn=Math.round,Kt=Math.floor,Me=e=>({x:e,y:e}),ml={left:"right",right:"left",bottom:"top",top:"bottom"},bl={start:"end",end:"start"};function Qn(e,t,n){return le(e,je(t,n))}function ke(e,t){return typeof e=="function"?e(t):e}function Ae(e){return e.split("-")[0]}function dt(e){return e.split("-")[1]}function Er(e){return e==="x"?"y":"x"}function $r(e){return e==="y"?"height":"width"}function Le(e){return["top","bottom"].includes(Ae(e))?"y":"x"}function Sr(e){return Er(Le(e))}function vl(e,t,n){n===void 0&&(n=!1);const r=dt(e),o=Sr(e),i=$r(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=rn(s)),[s,rn(s)]}function yl(e){const t=rn(e);return[er(e),t,er(t)]}function er(e){return e.replace(/start|end/g,t=>bl[t])}function wl(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function xl(e,t,n,r){const o=dt(e);let i=wl(Ae(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(er)))),i}function rn(e){return e.replace(/left|right|bottom|top/g,t=>ml[t])}function El(e){return{top:0,right:0,bottom:0,left:0,...e}}function Di(e){return typeof e!="number"?El(e):{top:e,right:e,bottom:e,left:e}}function on(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function po(e,t,n){let{reference:r,floating:o}=e;const i=Le(t),s=Sr(t),a=$r(s),c=Ae(t),l=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(dt(t)){case"start":h[s]-=p*(n&&l?-1:1);break;case"end":h[s]+=p*(n&&l?-1:1);break}return h}const $l=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=po(l,r,c),p=r,h={},m=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=ke(e,t)||{};if(l==null)return{};const f=Di(u),p={x:n,y:r},h=Sr(o),m=$r(h),b=await s.getDimensions(l),y=h==="y",v=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",$=i.reference[m]+i.reference[h]-p[h]-i.floating[m],C=p[h]-i.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let S=E?E[x]:0;(!S||!await(s.isElement==null?void 0:s.isElement(E)))&&(S=a.floating[x]||i.floating[m]);const k=$/2-C/2,F=S/2-b[m]/2-1,R=je(f[v],F),P=je(f[w],F),T=R,I=S-b[m]-P,j=S/2-b[m]/2+k,L=Qn(T,j,I),B=!c.arrow&&dt(o)!=null&&j!==L&&i.reference[m]/2-(jj<=0)){var P,T;const j=(((P=i.flip)==null?void 0:P.index)||0)+1,L=S[j];if(L)return{data:{index:j,overflows:R},reset:{placement:L}};let B=(T=R.filter(W=>W.overflows[0]<=0).sort((W,M)=>W.overflows[1]-M.overflows[1])[0])==null?void 0:T.placement;if(!B)switch(h){case"bestFit":{var I;const W=(I=R.filter(M=>{if(E){const H=Le(M.placement);return H===w||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,J)=>H+J,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:I[0];W&&(B=W);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function ho(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function go(e){return gl.some(t=>e[t]>=0)}const Ol=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ke(e,t);switch(r){case"referenceHidden":{const i=await kt(t,{...o,elementContext:"reference"}),s=ho(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:go(s)}}}case"escaped":{const i=await kt(t,{...o,altBoundary:!0}),s=ho(i,n.floating);return{data:{escapedOffsets:s,escaped:go(s)}}}default:return{}}}}};async function Rl(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ae(n),a=dt(n),c=Le(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,f=ke(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*u,y:p*l}:{x:p*l,y:h*u}}const _l=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await Rl(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Pl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:w}=y;return{x:v,y:w}}},...c}=ke(e,t),l={x:n,y:r},u=await kt(t,c),f=Le(Ae(o)),p=Er(f);let h=l[p],m=l[f];if(i){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",w=h+u[y],x=h-u[v];h=Qn(w,h,x)}if(s){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=m+u[y],x=m-u[v];m=Qn(w,m,x)}const b=a.fn({...t,[p]:h,[f]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[f]:s}}}}}},Tl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ke(e,t),u={x:n,y:r},f=Le(o),p=Er(f);let h=u[p],m=u[f];const b=ke(a,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const x=p==="y"?"height":"width",$=i.reference[p]-i.floating[x]+y.mainAxis,C=i.reference[p]+i.reference[x]-y.mainAxis;h<$?h=$:h>C&&(h=C)}if(l){var v,w;const x=p==="y"?"width":"height",$=["top","left"].includes(Ae(o)),C=i.reference[f]-i.floating[x]+($&&((v=s.offset)==null?void 0:v[f])||0)+($?0:y.crossAxis),E=i.reference[f]+i.reference[x]+($?0:((w=s.offset)==null?void 0:w[f])||0)-($?y.crossAxis:0);mE&&(m=E)}return{[p]:h,[f]:m}}}},kl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=ke(e,t),u=await kt(t,l),f=Ae(o),p=dt(o),h=Le(o)==="y",{width:m,height:b}=i.floating;let y,v;f==="top"||f==="bottom"?(y=f,v=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,y=p==="end"?"top":"bottom");const w=b-u.top-u.bottom,x=m-u.left-u.right,$=je(b-u[y],w),C=je(m-u[v],x),E=!t.middlewareData.shift;let S=$,k=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=w),E&&!p){const R=le(u.left,0),P=le(u.right,0),T=le(u.top,0),I=le(u.bottom,0);h?k=m-2*(R!==0||P!==0?R+P:le(u.left,u.right)):S=b-2*(T!==0||I!==0?T+I:le(u.top,u.bottom))}await c({...t,availableWidth:k,availableHeight:S});const F=await s.getDimensions(a.floating);return m!==F.width||b!==F.height?{reset:{rects:!0}}:{}}}};function yn(){return typeof window<"u"}function pt(e){return Ii(e)?(e.nodeName||"").toLowerCase():"#document"}function ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Se(e){var t;return(t=(Ii(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ii(e){return yn()?e instanceof Node||e instanceof ue(e).Node:!1}function be(e){return yn()?e instanceof Element||e instanceof ue(e).Element:!1}function $e(e){return yn()?e instanceof HTMLElement||e instanceof ue(e).HTMLElement:!1}function mo(e){return!yn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ue(e).ShadowRoot}function jt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Al(e){return["table","td","th"].includes(pt(e))}function wn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Cr(e){const t=Or(),n=be(e)?ve(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Dl(e){let t=Ne(e);for(;$e(t)&&!at(t);){if(Cr(t))return t;if(wn(t))return null;t=Ne(t)}return null}function Or(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function at(e){return["html","body","#document"].includes(pt(e))}function ve(e){return ue(e).getComputedStyle(e)}function xn(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ne(e){if(pt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||mo(e)&&e.host||Se(e);return mo(t)?t.host:t}function ji(e){const t=Ne(e);return at(t)?e.ownerDocument?e.ownerDocument.body:e.body:$e(t)&&jt(t)?t:ji(t)}function At(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ji(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ue(o);if(i){const a=tr(s);return t.concat(s,s.visualViewport||[],jt(o)?o:[],a&&n?At(a):[])}return t.concat(o,At(o,[],n))}function tr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mi(e){const t=ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$e(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=nn(n)!==i||nn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Rr(e){return be(e)?e:e.contextElement}function st(e){const t=Rr(e);if(!$e(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Mi(t);let s=(i?nn(n.width):n.width)/r,a=(i?nn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Il=Me(0);function Li(e){const t=ue(e);return!Or()||!t.visualViewport?Il:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ue(e)?!1:t}function Ke(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Rr(e);let s=Me(1);t&&(r?be(r)&&(s=st(r)):s=st(e));const a=jl(i,n,r)?Li(i):Me(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=ue(i),h=r&&be(r)?ue(r):r;let m=p,b=tr(m);for(;b&&r&&h!==m;){const y=st(b),v=b.getBoundingClientRect(),w=ve(b),x=v.left+(b.clientLeft+parseFloat(w.paddingLeft))*y.x,$=v.top+(b.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,f*=y.y,c+=x,l+=$,m=ue(b),b=tr(m)}}return on({width:u,height:f,x:c,y:l})}function Ml(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Se(r),a=t?wn(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Me(1);const u=Me(0),f=$e(r);if((f||!f&&!i)&&((pt(r)!=="body"||jt(s))&&(c=xn(r)),$e(r))){const p=Ke(r);l=st(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function Ll(e){return Array.from(e.getClientRects())}function nr(e,t){const n=xn(e).scrollLeft;return t?t.left+n:Ke(Se(e)).left+n}function Nl(e){const t=Se(e),n=xn(e),r=e.ownerDocument.body,o=le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nr(e);const a=-n.scrollTop;return ve(r).direction==="rtl"&&(s+=le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function zl(e,t){const n=ue(e),r=Se(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=Or();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function Fl(e,t){const n=Ke(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$e(e)?st(e):Me(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function bo(e,t,n){let r;if(t==="viewport")r=zl(e,n);else if(t==="document")r=Nl(Se(e));else if(be(t))r=Fl(t,n);else{const o=Li(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return on(r)}function Ni(e,t){const n=Ne(e);return n===t||!be(n)||at(n)?!1:ve(n).position==="fixed"||Ni(n,t)}function Bl(e,t){const n=t.get(e);if(n)return n;let r=At(e,[],!1).filter(a=>be(a)&&pt(a)!=="body"),o=null;const i=ve(e).position==="fixed";let s=i?Ne(e):e;for(;be(s)&&!at(s);){const a=ve(s),c=Cr(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||jt(s)&&!c&&Ni(e,s))?r=r.filter(u=>u!==s):o=a,s=Ne(s)}return t.set(e,r),r}function Wl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?wn(t)?[]:Bl(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const f=bo(t,u,o);return l.top=le(f.top,l.top),l.right=je(f.right,l.right),l.bottom=je(f.bottom,l.bottom),l.left=le(f.left,l.left),l},bo(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Hl(e){const{width:t,height:n}=Mi(e);return{width:t,height:n}}function Vl(e,t,n){const r=$e(t),o=Se(t),i=n==="fixed",s=Ke(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Me(0);if(r||!r&&!i)if((pt(t)!=="body"||jt(o))&&(a=xn(t)),r){const h=Ke(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=nr(o));let l=0,u=0;if(o&&!r&&!i){const h=o.getBoundingClientRect();u=h.top+a.scrollTop,l=h.left+a.scrollLeft-nr(o,h)}const f=s.left+a.scrollLeft-c.x-l,p=s.top+a.scrollTop-c.y-u;return{x:f,y:p,width:s.width,height:s.height}}function Ln(e){return ve(e).position==="static"}function vo(e,t){if(!$e(e)||ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Se(e)===n&&(n=n.ownerDocument.body),n}function zi(e,t){const n=ue(e);if(wn(e))return n;if(!$e(e)){let o=Ne(e);for(;o&&!at(o);){if(be(o)&&!Ln(o))return o;o=Ne(o)}return n}let r=vo(e,t);for(;r&&Al(r)&&Ln(r);)r=vo(r,t);return r&&at(r)&&Ln(r)&&!Cr(r)?n:r||Dl(e)||n}const Ul=async function(e){const t=this.getOffsetParent||zi,n=this.getDimensions,r=await n(e.floating);return{reference:Vl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Kl(e){return ve(e).direction==="rtl"}const Gl={convertOffsetParentRelativeRectToViewportRelativeRect:Ml,getDocumentElement:Se,getClippingRect:Wl,getOffsetParent:zi,getElementRects:Ul,getClientRects:Ll,getDimensions:Hl,getScale:st,isElement:be,isRTL:Kl};function Yl(e,t){let n=null,r;const o=Se(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:l,top:u,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const h=Kt(u),m=Kt(o.clientWidth-(l+f)),b=Kt(o.clientHeight-(u+p)),y=Kt(l),w={rootMargin:-h+"px "+-m+"px "+-b+"px "+-y+"px",threshold:le(0,je(1,c))||1};let x=!0;function $(C){const E=C[0].intersectionRatio;if(E!==c){if(!x)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver($,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver($,w)}n.observe(e)}return s(!0),i}function ql(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Rr(e),u=o||i?[...l?At(l):[],...At(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=l&&a?Yl(l,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let m,b=c?Ke(e):null;c&&y();function y(){const v=Ke(e);b&&(v.x!==b.x||v.y!==b.y||v.width!==b.width||v.height!==b.height)&&n(),b=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const Xl=_l,Jl=Pl,Zl=Cl,Ql=kl,eu=Ol,yo=Sl,tu=Tl,nu=(e,t,n)=>{const r=new Map,o={platform:Gl,...n},i={...o.platform,_c:r};return $l(e,t,{...o,platform:i})};var Qt=typeof document<"u"?d.useLayoutEffect:d.useEffect;function sn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!sn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Fi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wo(e,t){const n=Fi(e);return Math.round(t*n)/n}function Nn(e){const t=d.useRef(e);return Qt(()=>{t.current=e}),t}function ru(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=d.useState(r);sn(p,r)||h(r);const[m,b]=d.useState(null),[y,v]=d.useState(null),w=d.useCallback(M=>{M!==E.current&&(E.current=M,b(M))},[]),x=d.useCallback(M=>{M!==S.current&&(S.current=M,v(M))},[]),$=i||m,C=s||y,E=d.useRef(null),S=d.useRef(null),k=d.useRef(u),F=c!=null,R=Nn(c),P=Nn(o),T=Nn(l),I=d.useCallback(()=>{if(!E.current||!S.current)return;const M={placement:t,strategy:n,middleware:p};P.current&&(M.platform=P.current),nu(E.current,S.current,M).then(H=>{const J={...H,isPositioned:T.current!==!1};j.current&&!sn(k.current,J)&&(k.current=J,fi.flushSync(()=>{f(J)}))})},[p,t,n,P,T]);Qt(()=>{l===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[l]);const j=d.useRef(!1);Qt(()=>(j.current=!0,()=>{j.current=!1}),[]),Qt(()=>{if($&&(E.current=$),C&&(S.current=C),$&&C){if(R.current)return R.current($,C,I);I()}},[$,C,I,R,F]);const L=d.useMemo(()=>({reference:E,floating:S,setReference:w,setFloating:x}),[w,x]),B=d.useMemo(()=>({reference:$,floating:C}),[$,C]),W=d.useMemo(()=>{const M={position:n,left:0,top:0};if(!B.floating)return M;const H=wo(B.floating,u.x),J=wo(B.floating,u.y);return a?{...M,transform:"translate("+H+"px, "+J+"px)",...Fi(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:J}},[n,a,B.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:I,refs:L,elements:B,floatingStyles:W}),[u,I,L,B,W])}const ou=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yo({element:r.current,padding:o}).fn(n):{}:r?yo({element:r,padding:o}).fn(n):{}}}},iu=(e,t)=>({...Xl(e),options:[e,t]}),su=(e,t)=>({...Jl(e),options:[e,t]}),au=(e,t)=>({...tu(e),options:[e,t]}),cu=(e,t)=>({...Zl(e),options:[e,t]}),lu=(e,t)=>({...Ql(e),options:[e,t]}),uu=(e,t)=>({...eu(e),options:[e,t]}),fu=(e,t)=>({...ou(e),options:[e,t]});var du="Arrow",Bi=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return z.jsx(Fe.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:z.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bi.displayName=du;var pu=Bi;function hu(e,t=[]){let n=[];function r(i,s){const a=d.createContext(s),c=n.length;n=[...n,s];function l(f){const{scope:p,children:h,...m}=f,b=(p==null?void 0:p[e][c])||a,y=d.useMemo(()=>m,Object.values(m));return z.jsx(b.Provider,{value:y,children:h})}function u(f,p){const h=(p==null?void 0:p[e][c])||a,m=d.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,u]}const o=()=>{const i=n.map(s=>d.createContext(s));return function(a){const c=(a==null?void 0:a[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,gu(o,...t)]}function gu(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:l})=>{const f=c(i)[`__scope${l}`];return{...a,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function mu(e){const[t,n]=d.useState(void 0);return Ue(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _r="Popper",[Wi,Hi]=hu(_r),[bu,Vi]=Wi(_r),Ui=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return z.jsx(bu,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ui.displayName=_r;var Ki="PopperAnchor",Gi=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Vi(Ki,n),s=d.useRef(null),a=Ye(t,s);return d.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:z.jsx(Fe.div,{...o,ref:a})});Gi.displayName=Ki;var Pr="PopperContent",[vu,yu]=Wi(Pr),Yi=d.forwardRef((e,t)=>{var Be,Ce,bt,vt,yt,wt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...b}=e,y=Vi(Pr,n),[v,w]=d.useState(null),x=Ye(t,fe=>w(fe)),[$,C]=d.useState(null),E=mu($),S=(E==null?void 0:E.width)??0,k=(E==null?void 0:E.height)??0,F=r+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(l)?l:[l],T=P.length>0,I={padding:R,boundary:P.filter(xu),altBoundary:T},{refs:j,floatingStyles:L,placement:B,isPositioned:W,middlewareData:M}=ru({strategy:"fixed",placement:F,whileElementsMounted:(...fe)=>ql(...fe,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[iu({mainAxis:o+k,alignmentAxis:s}),c&&su({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?au():void 0,...I}),c&&cu({...I}),lu({...I,apply:({elements:fe,rects:Xe,availableWidth:Je,availableHeight:Ze})=>{const{width:On,height:Rn}=Xe.reference,Qe=fe.floating.style;Qe.setProperty("--radix-popper-available-width",`${Je}px`),Qe.setProperty("--radix-popper-available-height",`${Ze}px`),Qe.setProperty("--radix-popper-anchor-width",`${On}px`),Qe.setProperty("--radix-popper-anchor-height",`${Rn}px`)}}),$&&fu({element:$,padding:a}),Eu({arrowWidth:S,arrowHeight:k}),p&&uu({strategy:"referenceHidden",...I})]}),[H,J]=Ji(B),ie=ft(m);Ue(()=>{W&&(ie==null||ie())},[W,ie]);const Ft=(Be=M.arrow)==null?void 0:Be.x,Bt=(Ce=M.arrow)==null?void 0:Ce.y,Wt=((bt=M.arrow)==null?void 0:bt.centerOffset)!==0,[Ht,qe]=d.useState();return Ue(()=>{v&&qe(window.getComputedStyle(v).zIndex)},[v]),z.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:W?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ht,"--radix-popper-transform-origin":[(vt=M.transformOrigin)==null?void 0:vt.x,(yt=M.transformOrigin)==null?void 0:yt.y].join(" "),...((wt=M.hide)==null?void 0:wt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:z.jsx(vu,{scope:n,placedSide:H,onArrowChange:C,arrowX:Ft,arrowY:Bt,shouldHideArrow:Wt,children:z.jsx(Fe.div,{"data-side":H,"data-align":J,...b,ref:x,style:{...b.style,animation:W?void 0:"none"}})})})});Yi.displayName=Pr;var qi="PopperArrow",wu={top:"bottom",right:"left",bottom:"top",left:"right"},Xi=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=yu(qi,r),s=wu[i.placedSide];return z.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:z.jsx(pu,{...o,ref:n,style:{...o.style,display:"block"}})})});Xi.displayName=qi;function xu(e){return e!==null}var Eu=e=>({name:"transformOrigin",options:e,fn(t){var y,v,w;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,u]=Ji(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let m="",b="";return l==="bottom"?(m=s?f:`${p}px`,b=`${-c}px`):l==="top"?(m=s?f:`${p}px`,b=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,b=s?f:`${h}px`):l==="left"&&(m=`${r.floating.width+c}px`,b=s?f:`${h}px`),{data:{x:m,y:b}}}});function Ji(e){const[t,n="center"]=e.split("-");return[t,n]}var $u=Ui,Su=Gi,Cu=Yi,Ou=Xi;function Ru(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Zi=e=>{const{present:t,children:n}=e,r=_u(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),i=Ye(r.ref,Pu(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:i}):null};Zi.displayName="Presence";function _u(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),i=d.useRef("none"),s=e?"mounted":"unmounted",[a,c]=Ru(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const l=Gt(r.current);i.current=a==="mounted"?l:"none"},[a]),Ue(()=>{const l=r.current,u=o.current;if(u!==e){const p=i.current,h=Gt(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ue(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,f=h=>{const b=Gt(r.current).includes(h.animationName);if(h.target===t&&b&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Gt(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Gt(e){return(e==null?void 0:e.animationName)||"none"}function Pu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Tu({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ku({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=ft(n),c=d.useCallback(l=>{if(i){const f=typeof l=="function"?l(e):l;f!==e&&a(f)}else o(l)},[i,e,o,a]);return[s,c]}function ku({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),i=ft(t);return d.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var Au="VisuallyHidden",Qi=d.forwardRef((e,t)=>z.jsx(Fe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Qi.displayName=Au;var Du=Qi,[En,bm]=nl("Tooltip",[Hi]),$n=Hi(),Iu="TooltipProvider",rr="tooltip.open",[vm,Tr]=En(Iu),Sn="Tooltip",[ju,Cn]=En(Sn),es=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,c=Tr(Sn,e.__scopeTooltip),l=$n(t),[u,f]=d.useState(null),p=hl(),h=d.useRef(0),m=s??c.disableHoverableContent,b=a??c.delayDuration,y=d.useRef(!1),[v=!1,w]=Tu({prop:r,defaultProp:o,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(rr))):c.onClose(),i==null||i(S)}}),x=d.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),$=d.useCallback(()=>{window.clearTimeout(h.current),y.current=!1,w(!0)},[w]),C=d.useCallback(()=>{window.clearTimeout(h.current),w(!1)},[w]),E=d.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0)},b)},[b,w]);return d.useEffect(()=>()=>window.clearTimeout(h.current),[]),z.jsx($u,{...l,children:z.jsx(ju,{scope:t,contentId:p,open:v,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayed?E():$()},[c.isOpenDelayed,E,$]),onTriggerLeave:d.useCallback(()=>{m?C():window.clearTimeout(h.current)},[C,m]),onOpen:$,onClose:C,disableHoverableContent:m,children:n})})};es.displayName=Sn;var or="TooltipTrigger",ts=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Cn(or,n),i=Tr(or,n),s=$n(n),a=d.useRef(null),c=Ye(t,a,o.onTriggerChange),l=d.useRef(!1),u=d.useRef(!1),f=d.useCallback(()=>l.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),z.jsx(Su,{asChild:!0,...s,children:z.jsx(Fe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:Re(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Re(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:Re(e.onBlur,o.onClose),onClick:Re(e.onClick,o.onClose)})})});ts.displayName=or;var Mu="TooltipPortal",[ym,Lu]=En(Mu,{forceMount:void 0}),ct="TooltipContent",ns=d.forwardRef((e,t)=>{const n=Lu(ct,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Cn(ct,e.__scopeTooltip);return z.jsx(Zi,{present:r||s.open,children:s.disableHoverableContent?z.jsx(rs,{side:o,...i,ref:t}):z.jsx(Nu,{side:o,...i,ref:t})})}),Nu=d.forwardRef((e,t)=>{const n=Cn(ct,e.__scopeTooltip),r=Tr(ct,e.__scopeTooltip),o=d.useRef(null),i=Ye(t,o),[s,a]=d.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:f}=r,p=d.useCallback(()=>{a(null),f(!1)},[f]),h=d.useCallback((m,b)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},w=Bu(v,y.getBoundingClientRect()),x=Wu(v,w),$=Hu(b.getBoundingClientRect()),C=Uu([...x,...$]);a(C),f(!0)},[f]);return d.useEffect(()=>()=>p(),[p]),d.useEffect(()=>{if(c&&u){const m=y=>h(y,u),b=y=>h(y,c);return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",b)}}},[c,u,h,p]),d.useEffect(()=>{if(s){const m=b=>{const y=b.target,v={x:b.clientX,y:b.clientY},w=(c==null?void 0:c.contains(y))||(u==null?void 0:u.contains(y)),x=!Vu(v,s);w?p():x&&(p(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,s,l,p]),z.jsx(rs,{...e,ref:i})}),[zu,Fu]=En(Sn,{isInside:!1}),rs=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,c=Cn(ct,n),l=$n(n),{onClose:u}=c;return d.useEffect(()=>(document.addEventListener(rr,u),()=>document.removeEventListener(rr,u)),[u]),d.useEffect(()=>{if(c.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),z.jsx(ki,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:z.jsxs(Cu,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[z.jsx(mi,{children:r}),z.jsx(zu,{scope:n,isInside:!0,children:z.jsx(Du,{id:c.contentId,role:"tooltip",children:o||r})})]})})});ns.displayName=ct;var os="TooltipArrow",is=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$n(n);return Fu(os,n).isInside?null:z.jsx(Ou,{...o,...r,ref:t})});is.displayName=os;function Bu(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Wu(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Hu(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Vu(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function Uu(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),Ku(t)}function Ku(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Gu=es,Yu=ts,qu=ns,Xu=is;function Ju(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function U(e,t){if(e==null)return{};var n=Ju(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}let Y;(function(e){e[e.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",e[e.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",e[e.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",e[e.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",e[e.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",e[e.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",e[e.THEME_ERROR=6]="THEME_ERROR",e[e.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",e[e.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",e[e.EMPTY_KEY=9]="EMPTY_KEY"})(Y||(Y={}));const Zu={[Y.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[Y.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[Y.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[Y.DUPLICATE_KEYS]:(e,t,n)=>[`Key \`${e}\` of path \`${t}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[Y.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[Y.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[Y.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[Y.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[Y.PATH_DOESNT_EXIST]:e=>[`Error accessing the value at path \`${e}\``],[Y.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[Y.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function ss(e,t,...n){const[r,...o]=Zu[t](...n);console[e]("LEVA: "+r,...o)}const _e=ss.bind(null,"warn"),Qu=ss.bind(null,"log"),ef=["value"],tf=["schema"],nf=["value"],as=[],Ge={};function xo(e){let{value:t}=e,n=U(e,ef);for(let r of as){const o=r(t,n);if(o)return o}}function De(e,t){let{schema:n}=t,r=U(t,tf);if(e in Ge){_e(Y.ALREADY_REGISTERED_TYPE,e);return}as.push((o,i)=>n(o,i)&&e),Ge[e]=r}function zn(e,t,n,r){const{normalize:o}=Ge[e];if(o)return o(t,n,r);if(typeof t!="object"||!("value"in t))return{value:t};const{value:i}=t,s=U(t,nf);return{value:i,settings:s}}function rf(e,t,n,r,o,i){const{sanitize:s}=Ge[e];return s?s(t,n,r,o,i):t}function Eo(e,t,n){const{format:r}=Ge[e];return r?r(t,n):t}function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;te>n?n:e{if(e===""||typeof e=="number")return e;try{const t=Ie(e);if(!isNaN(t))return t}catch{}return parseFloat(e)},af=Math.log(10);function So(e){let t=Math.abs(+String(e).replace(".",""));if(t===0)return .01;for(;t!==0&&t%10===0;)t/=10;const n=Math.floor(Math.log(t)/af)+1,r=Math.floor(Math.log10(Math.abs(e))),o=Math.pow(10,r-n);return Math.max(o,.001)}const an=(e,t,n)=>n===t?0:(ze(e,t,n)-t)/(n-t),cn=(e,t,n)=>e*(n-t)+t,cf=()=>"_"+Math.random().toString(36).substr(2,9),Co=/\(([0-9+\-*/^ .]+)\)/,Oo=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,Ro=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,_o=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,Po=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,To=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function Ie(e){if(isNaN(Number(e)))if(Co.test(e)){const t=e.replace(Co,(n,r)=>String(Ie(r)));return Ie(t)}else if(Oo.test(e)){const t=e.replace(Oo,(n,r,o)=>String(Math.pow(Number(r),Number(o))));return Ie(t)}else if(Ro.test(e)){const t=e.replace(Ro,(n,r,o)=>String(Number(r)*Number(o)));return Ie(t)}else if(_o.test(e)){const t=e.replace(_o,(n,r,o)=>{if(o!=0)return String(Number(r)/Number(o));throw new Error("Division by zero")});return Ie(t)}else if(Po.test(e)){const t=e.replace(Po,(n,r,o)=>String(Number(r)+Number(o)));return Ie(t)}else if(To.test(e)){const t=e.replace(To,(n,r,o)=>String(Number(r)-Number(o)));return Ie(t)}else return Number(e);return Number(e)}function lf(e,t){return t.reduce((n,r)=>(e&&e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}function uf(e,t){const n=D({},e);return t.forEach(r=>r in e&&delete n[r]),n}function ff(e,t){return e.reduce((n,r,o)=>Object.assign(n,{[t[o]]:r}),{})}function cs(e){return Object.prototype.toString.call(e)==="[object Object]"}const df=e=>cs(e)&&Object.keys(e).length===0;let me;(function(e){e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER"})(me||(me={}));let ye;(function(e){e.SELECT="SELECT",e.IMAGE="IMAGE",e.NUMBER="NUMBER",e.COLOR="COLOR",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.INTERVAL="INTERVAL",e.VECTOR3D="VECTOR3D",e.VECTOR2D="VECTOR2D"})(ye||(ye={}));const pf=["type","__customInput"],hf=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],gf=["type"];function ls(e,t,n={},r){var o,i;if(typeof e!="object"||Array.isArray(e))return{type:r,input:e,options:D({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:C,__customInput:E}=e,S=U(e,pf);return ls(E,t,S,C)}const{render:s,label:a,optional:c,order:l=0,disabled:u,hint:f,onChange:p,onEditStart:h,onEditEnd:m,transient:b}=e,y=U(e,hf),v=D({render:s,key:t,label:a??t,hint:f,transient:b??!!p,onEditStart:h,onEditEnd:m,disabled:u,optional:c,order:l},n);let{type:w}=y,x=U(y,gf);if(w=r??w,w in me)return{type:w,input:x,options:v};let $;return r&&cs(x)&&"value"in x?$=x.value:$=df(x)?void 0:x,{type:w,input:$,options:D(D({},v),{},{onChange:p,optional:(o=v.optional)!==null&&o!==void 0?o:!1,disabled:(i=v.disabled)!==null&&i!==void 0?i:!1})}}function mf(e,t,n,r){const o=ls(e,t),{type:i,input:s,options:a}=o;if(i)return i in me?o:{type:i,input:zn(i,s,n,r),options:a};let c=xo(s);return c?{type:c,input:zn(c,s,n,r),options:a}:(c=xo({value:s}),c?{type:c,input:zn(c,{value:s},n,r),options:a}:!1)}function ko(e,t,n,r,o){const{value:i,type:s,settings:a}=e;e.value=us({type:s,value:i,settings:a},t,n,r),e.fromPanel=o}const bf=function(t,n,r){this.type="LEVA_ERROR",this.message="LEVA: "+t,this.previousValue=n,this.error=r};function us({type:e,value:t,settings:n},r,o,i){const s=e!=="SELECT"&&typeof r=="function"?r(t):r;let a;try{a=rf(e,s,n,t,o,i)}catch(c){throw new bf(`The value \`${r}\` did not result in a correct value.`,t,c)}return Pt(a,t)?t:a}const fs=(e,t,n=!1)=>{let r=0;return function(){const o=arguments,i=n&&!r,s=()=>e.apply(this,o);window.clearTimeout(r),r=window.setTimeout(s,t),i&&s()}},ds=e=>e.shiftKey?5:e.altKey?1/5:1;function vf(e,t){const n=console.error;console.error=()=>{},di.render(e,t),console.error=n}const yf=["value"],wf=["min","max"],xf=e=>{if(typeof e=="number")return!0;if(typeof e=="string"){const t=parseFloat(e);return isNaN(t)?!1:e.substring((""+t).length).trim().length<4}return!1},ps=(e,{min:t=-1/0,max:n=1/0,suffix:r})=>{const o=parseFloat(e);if(e===""||isNaN(o))throw Error("Invalid number");const i=ze(o,t,n);return r?i+r:i},Ef=(e,{pad:t=0,suffix:n})=>{const r=parseFloat(e).toFixed(t);return n?r+n:r},hs=e=>{let{value:t}=e,n=U(e,yf);const{min:r=-1/0,max:o=1/0}=n,i=U(n,wf);let s=parseFloat(t);const a=typeof t=="string"?t.substring((""+s).length):void 0;s=ze(s,r,o);let c=n.step;c||(Number.isFinite(r)?Number.isFinite(o)?c=+(Math.abs(o-r)/100).toPrecision(1):c=+(Math.abs(s-r)/100).toPrecision(1):Number.isFinite(o)&&(c=+(Math.abs(o-s)/100).toPrecision(1)));const l=c?So(c)*10:So(s);c=c||l/10;const u=Math.round(ze(Math.log10(1/l),0,2));return{value:a?s+a:s,settings:D({initialValue:s,step:c,pad:u,min:r,max:o,suffix:a},i)}},gs=(e,{step:t,initialValue:n})=>{const r=Math.round((e-n)/t);return n+r*t};var ms=Object.freeze({__proto__:null,schema:xf,sanitize:ps,format:Ef,normalize:hs,sanitizeStep:gs});function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function Yt(e,t){const[n,r]=e.split(" "),o={};return n!=="none"&&(o.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${n!=="default"&&n||t.borderColor}`),r&&(o.backgroundColor=r),o}const $t={$inputStyle:()=>e=>Yt(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>Yt(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>Yt(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>Yt(e,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:A,css:wm,createTheme:Sf,globalCss:Cf,keyframes:xm}=cc({prefix:"leva",theme:ws(),utils:D(D({},$t),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:e=>({"&:focus":$t.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":$t.$focusStyle()(e)}),$hover:e=>({"&:hover":$t.$hoverStyle()(e)}),$active:e=>({"&:active":$t.$activeStyle()(e)})})}),Of=Cf({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function Rf(e){const t=ws();if(!e)return{theme:t,className:""};Object.keys(e).forEach(r=>{Object.assign(t[r],e[r])});const n=Sf(t);return{theme:t,className:n.className}}function Pe(e,t){const{theme:n}=d.useContext(kr);if(!(e in n)||!(t in n[e]))return _e(Y.THEME_ERROR,e,t),"";let r=t;for(;;){let o=n[e][r];if(typeof o=="string"&&o.charAt(0)==="$")r=o.substr(1);else return o}}const xs=A("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),Es=A("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${xs}`]:{paddingLeft:0}}),_f=A(Es,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),Pf=A("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),Tf=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],kf=["onUpdate"];function Ar(e){let{innerLabel:t,value:n,onUpdate:r,onChange:o,onKeyDown:i,type:s,id:a,inputType:c="text",rows:l=0}=e,u=U(e,Tf);const{id:f,emitOnEditStart:p,emitOnEditEnd:h,disabled:m}=te(),b=a||f,y=d.useRef(null),v=l>0,w=v?"textarea":"input",x=d.useCallback(E=>S=>{const k=S.currentTarget.value;E(k)},[]);g.useEffect(()=>{const E=y.current,S=x(k=>{r(k),h()});return E==null||E.addEventListener("blur",S),()=>E==null?void 0:E.removeEventListener("blur",S)},[x,r,h]);const $=d.useCallback(E=>{E.key==="Enter"&&x(r)(E)},[x,r]),C=Object.assign({as:w},v?{rows:l}:{},u);return g.createElement(Pf,{textArea:v},t&&typeof t=="string"?g.createElement(Es,null,t):t,g.createElement(xs,X({levaType:s,ref:y,id:b,type:c,autoComplete:"off",spellCheck:"false",value:n,onChange:x(o),onFocus:()=>p(),onKeyPress:$,onKeyDown:i,disabled:m},C)))}function Af(e){let{onUpdate:t}=e,n=U(e,kf);const r=d.useCallback(i=>t(sf(i)),[t]),o=d.useCallback(i=>{const s=i.key==="ArrowUp"?1:i.key==="ArrowDown"?-1:0;if(s){i.preventDefault();const a=i.altKey?.1:i.shiftKey?10:1;t(c=>parseFloat(c)+s*a)}},[t]);return g.createElement(Ar,X({},n,{onUpdate:r,onKeyDown:o,type:"number"}))}const ln=A("div",{}),ir=A("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),Df=A("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${ir}::after`]:{opacity:.6},[`${ln}:hover > & + ${ir}::after`]:{opacity:.6},[`${ln}:hover > & > svg`]:{opacity:1}}),$s=A("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${ln}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),Ss=A("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${$s} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),Cs=A(Ss,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),If=A("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),jf=A("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),sr=A("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),Mf=A("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${sr}`]:{pointerEvents:"auto"}}}}}),Os=A("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),Lf=A("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),Nf=A(Xu,{fill:"$toolTipBackground"});function Dr({children:e}){const{className:t}=d.useContext(kr);return g.createElement(Ta,{className:t},e)}const zf=["align"];function Ff(){const{id:e,disable:t,disabled:n}=te();return g.createElement(g.Fragment,null,g.createElement(jf,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),g.createElement("label",{htmlFor:e+"__disable"}))}function Bf(e){const{id:t,optional:n,hint:r}=te(),o=e.htmlFor||(t?{htmlFor:t}:null),i=!r&&typeof e.children=="string"?{title:e.children}:null;return g.createElement(g.Fragment,null,n&&g.createElement(Ff,null),r!==void 0?g.createElement(Gu,null,g.createElement(Yu,{asChild:!0},g.createElement(sr,X({},o,e))),g.createElement(qu,{side:"top",sideOffset:2},g.createElement(Lf,null,r,g.createElement(Nf,null)))):g.createElement(sr,X({},o,i,e)))}function we(e){let{align:t}=e,n=U(e,zf);const{value:r,label:o,key:i,disabled:s}=te(),{hideCopyButton:a}=$f(),c=!a&&i!==void 0,[l,u]=d.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[i]:r??""})),u(!0)}catch{_e(Y.CLIPBOARD_ERROR,{[i]:r})}};return g.createElement(If,{align:t,onPointerLeave:()=>u(!1)},g.createElement(Bf,n),c&&!s&&g.createElement("div",{title:`Click to copy ${typeof o=="string"?o:i} value`},l?g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},g.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),g.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):g.createElement("svg",{onClick:f,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},g.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),g.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const Wf=["toggled"],Hf=A("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Ir(e){let{toggled:t}=e,n=U(e,Wf);return g.createElement(Hf,X({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),g.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const Vf=["input"];function he(e){let{input:t}=e,n=U(e,Vf);return t?g.createElement(Cs,n):g.createElement(Ss,n)}function Rs({value:e,type:t,settings:n,setValue:r}){const[o,i]=d.useState(Eo(t,e,n)),s=d.useRef(e),a=d.useRef(n);a.current=n;const c=d.useCallback(u=>i(Eo(t,u,a.current)),[t]),l=d.useCallback(u=>{try{r(u)}catch(f){const{type:p,previousValue:h}=f;if(p!=="LEVA_ERROR")throw f;c(h)}},[c,r]);return d.useEffect(()=>{Pt(e,s.current)||c(e),s.current=e},[e,c]),{displayValue:o,onChange:i,onUpdate:l}}function Lt(e,t){const{emitOnEditStart:n,emitOnEditEnd:r}=te();return tl(o=>{o.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const i=e(o);return o.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),i},t)}function Uf(e){const t=d.useRef(null),n=d.useRef(null),r=d.useRef(!1);return d.useEffect(()=>{const o=fs(()=>{t.current.width=t.current.offsetWidth*window.devicePixelRatio,t.current.height=t.current.offsetHeight*window.devicePixelRatio,e(t.current,n.current)},250);return window.addEventListener("resize",o),r.current||(o(),r.current=!0),()=>window.removeEventListener("resize",o)},[e]),d.useEffect(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}function _s(){const e=d.useRef(null),t=d.useRef({x:0,y:0}),n=d.useCallback(r=>{Object.assign(t.current,r),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}const Kf=["__refCount"],Fn=(e,t)=>{if(!e[t])return null;const n=e[t];return U(n,Kf)};function Gf(e){const t=Mt(),[n,r]=d.useState(Fn(t.getData(),e)),o=d.useCallback(l=>t.setValueAtPath(e,l,!0),[e,t]),i=d.useCallback(l=>t.setSettingsAtPath(e,l),[e,t]),s=d.useCallback(l=>t.disableInputAtPath(e,l),[e,t]),a=d.useCallback(()=>t.emitOnEditStart(e),[e,t]),c=d.useCallback(()=>t.emitOnEditEnd(e),[e,t]);return d.useEffect(()=>{r(Fn(t.getData(),e));const l=t.useStore.subscribe(u=>Fn(u.data,e),r,{equalityFn:mn});return()=>l()},[t,e]),[n,{set:o,setSettings:i,disable:s,storeId:t.storeId,emitOnEditStart:a,emitOnEditEnd:c}]}const Yf=A("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Ps=A("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),ar=A("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),Ts=A("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),ks=A("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function qf({value:e,min:t,max:n,onDrag:r,step:o,initialValue:i}){const s=d.useRef(null),a=d.useRef(null),c=d.useRef(0),l=Pe("sizes","scrubberWidth"),u=Lt(({event:p,first:h,xy:[m],movement:[b],memo:y})=>{if(h){const{width:w,left:x}=s.current.getBoundingClientRect();c.current=w-parseFloat(l),y=(p==null?void 0:p.target)===a.current?e:cn((m-x)/w,t,n)}const v=y+cn(b/c.current,0,n-t);return r(gs(v,{step:o,initialValue:i})),y}),f=an(e,t,n);return g.createElement(Ts,X({ref:s},u()),g.createElement(Ps,null,g.createElement(ks,{style:{left:0,right:`${(1-f)*100}%`}})),g.createElement(ar,{ref:a,style:{left:`calc(${f} * (100% - ${l}))`}}))}const Xf=g.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:r})=>{const[o,i]=d.useState(!1),s=Lt(({active:a,delta:[c],event:l,memo:u=0})=>(i(a),u+=c/2,Math.abs(u)>=1&&(t(f=>parseFloat(f)+Math.floor(u)*n*ds(l)),u=0),u));return g.createElement(_f,X({dragging:o,title:e.length>1?e:""},s()),e.slice(0,r))});function As({label:e,id:t,displayValue:n,onUpdate:r,onChange:o,settings:i,innerLabelTrim:s=1}){const a=s>0&&g.createElement(Xf,{label:e,step:i.step,onUpdate:r,innerLabelTrim:s});return g.createElement(Af,{id:t,value:String(n),onUpdate:r,onChange:o,innerLabel:a})}function Jf(){const e=te(),{label:t,value:n,onUpdate:r,settings:o,id:i}=e,{min:s,max:a}=o,c=a!==1/0&&s!==-1/0;return g.createElement(he,{input:!0},g.createElement(we,null,t),g.createElement(Yf,{hasRange:c},c&&g.createElement(qf,X({value:parseFloat(n),onDrag:r},o)),g.createElement(As,X({},e,{id:i,label:"value",innerLabelTrim:c?0:1}))))}const{sanitizeStep:Zf}=ms,Qf=U(ms,["sanitizeStep"]);var ed=D({component:Jf},Qf);const td=(e,t)=>ce().schema({options:ce().passesAnyOf(ce().object(),ce().array())}).test(t),nd=(e,{values:t})=>{if(t.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},rd=(e,{values:t})=>t.indexOf(e),od=e=>{let{value:t,options:n}=e,r,o;return Array.isArray(n)?(o=n,r=n.map(i=>String(i))):(o=Object.values(n),r=Object.keys(n)),"value"in e?o.includes(t)||(r.unshift(String(t)),o.unshift(t)):t=o[0],Object.values(n).includes(t)||(n[String(t)]=t),{value:t,settings:{keys:r,values:o}}};var id=Object.freeze({__proto__:null,schema:td,sanitize:nd,format:rd,normalize:od});const sd=A("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),cr=A("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),ad=A("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${cr}:focus + &`]:{$focusStyle:""},[`${cr}:hover + &`]:{$hoverStyle:""}});function cd({displayValue:e,value:t,onUpdate:n,id:r,settings:o,disabled:i}){const{keys:s,values:a}=o,c=d.useRef();return t===a[e]&&(c.current=s[e]),g.createElement(sd,null,g.createElement(cr,{id:r,value:e,onChange:l=>n(a[Number(l.currentTarget.value)]),disabled:i},s.map((l,u)=>g.createElement("option",{key:l,value:u},l))),g.createElement(ad,null,c.current),g.createElement(Ir,{toggled:!0}))}function ld(){const{label:e,value:t,displayValue:n,onUpdate:r,id:o,disabled:i,settings:s}=te();return g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(cd,{id:o,value:t,displayValue:n,onUpdate:r,settings:s,disabled:i}))}var ud=D({component:ld},id);const fd=e=>ce().string().test(e),dd=e=>{if(typeof e!="string")throw Error("Invalid string");return e},pd=({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:typeof n=="number"?n:n?5:0}});var hd=Object.freeze({__proto__:null,schema:fd,sanitize:dd,normalize:pd});const gd=["displayValue","onUpdate","onChange","editable"],md=A("div",{whiteSpace:"pre-wrap"});function bd(e){let{displayValue:t,onUpdate:n,onChange:r,editable:o=!0}=e,i=U(e,gd);return o?g.createElement(Ar,X({value:t,onUpdate:n,onChange:r},i)):g.createElement(md,null,t)}function vd(){const{label:e,settings:t,displayValue:n,onUpdate:r,onChange:o}=te();return g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(bd,X({displayValue:n,onUpdate:r,onChange:o},t)))}var yd=D({component:vd},hd);const wd=e=>ce().boolean().test(e),xd=e=>{if(typeof e!="boolean")throw Error("Invalid boolean");return e};var Ed=Object.freeze({__proto__:null,schema:wd,sanitize:xd});const $d=A("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Sd({value:e,onUpdate:t,id:n,disabled:r}){return g.createElement($d,null,g.createElement("input",{id:n,type:"checkbox",checked:e,onChange:o=>t(o.currentTarget.checked),disabled:r}),g.createElement("label",{htmlFor:n},g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},g.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function Cd(){const{label:e,value:t,onUpdate:n,disabled:r,id:o}=te();return g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(Sd,{value:t,onUpdate:n,id:o,disabled:r}))}var Od=D({component:Cd},Ed);const Rd=["locked"];function _d({value:e,id:t,valueKey:n,settings:r,onUpdate:o,innerLabelTrim:i}){const s=d.useRef(e[n]);s.current=e[n];const a=d.useCallback(l=>o({[n]:us({type:"NUMBER",value:s.current,settings:r},l)}),[o,r,n]),c=Rs({type:"NUMBER",value:e[n],settings:r,setValue:a});return g.createElement(As,{id:t,label:n,value:e[n],displayValue:c.displayValue,onUpdate:c.onUpdate,onChange:c.onChange,settings:r,innerLabelTrim:i})}const Pd=A("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function Td(e){let{locked:t}=e,n=U(e,Rd);return g.createElement("svg",X({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?g.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):g.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function jr({value:e,onUpdate:t,settings:n,innerLabelTrim:r}){const{id:o,setSettings:i}=te(),{lock:s,locked:a}=n;return g.createElement(Pd,{withLock:s},s&&g.createElement(Td,{locked:a,onClick:()=>i({locked:!a})}),Object.keys(e).map((c,l)=>g.createElement(_d,{id:l===0?o:`${o}.${c}`,key:c,valueKey:c,value:e,settings:n[c],onUpdate:t,innerLabelTrim:r})))}const Ds=(e,t)=>{const n={};let r=0,o=1/0;Object.entries(e).forEach(([i,s])=>{n[i]=hs(D({value:s},t[i])).settings,r=Math.max(r,n[i].step),o=Math.min(o,n[i].pad)});for(let i in n){const{step:s,min:a,max:c}=t[i]||{};!isFinite(s)&&(!isFinite(a)||!isFinite(c))&&(n[i].step=r,n[i].pad=o)}return n},kd=["lock"],Ad=["value"];function Dd(e){const t=ce().array().length(e).every.number(),n=r=>{if(!r||typeof r!="object")return!1;const o=Object.values(r);return o.length===e&&o.every(i=>isFinite(i))};return r=>t.test(r)||n(r)}function Id(e){return Array.isArray(e)?"array":"object"}function Ot(e,t,n){return Id(e)===t?e:t==="array"?Object.values(e):ff(e,n)}const jd=(e,t,n)=>{const r=Ot(e,"object",t.keys);for(let s in r)r[s]=ps(r[s],t[s]);const o=Object.keys(r);let i={};if(o.length===t.keys.length)i=r;else{const s=Ot(n,"object",t.keys);if(o.length===1&&t.locked){const a=o[0],c=r[a],l=s[a],u=l!==0?c/l:1;for(let f in s)f===a?i[a]=c:i[f]=s[f]*u}else i=D(D({},s),r)}return Ot(i,t.format,t.keys)},Md=(e,t)=>Ot(e,"object",t.keys),Ld=e=>!!e&&("step"in e||"min"in e||"max"in e);function Nd(e,t,n=[]){const{lock:r=!1}=t,o=U(t,kd),i=Array.isArray(e)?"array":"object",s=i==="object"?Object.keys(e):n,a=Ot(e,"object",s),c=Ld(o)?s.reduce((u,f)=>Object.assign(u,{[f]:o}),{}):o,l=Ds(a,c);return{value:i==="array"?e:a,settings:D(D({},l),{},{format:i,keys:s,lock:r,locked:!1})}}function Is(e){return{schema:Dd(e.length),normalize:t=>{let{value:n}=t,r=U(t,Ad);return Nd(n,r,e)},format:(t,n)=>Md(t,n),sanitize:(t,n,r)=>jd(t,n,r)}}var zd={grad:.9,turn:360,rad:360/(2*Math.PI)},Oe=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Z=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},pe=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},js=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ao=function(e){return{r:pe(e.r,0,255),g:pe(e.g,0,255),b:pe(e.b,0,255),a:pe(e.a)}},Bn=function(e){return{r:Z(e.r),g:Z(e.g),b:Z(e.b),a:Z(e.a,3)}},Fd=/^#([0-9a-f]{3,8})$/i,qt=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ms=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},Ls=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),c=r*(1-(1-t+i)*n),l=i%6;return{r:255*[r,a,s,s,c,r][l],g:255*[c,r,r,a,s,s][l],b:255*[s,s,c,r,r,a][l],a:o}},Do=function(e){return{h:js(e.h),s:pe(e.s,0,100),l:pe(e.l,0,100),a:pe(e.a)}},Io=function(e){return{h:Z(e.h),s:Z(e.s),l:Z(e.l),a:Z(e.a,3)}},jo=function(e){return Ls((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Rt=function(e){return{h:(t=Ms(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},Bd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Hd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Vd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lr={string:[[function(e){var t=Fd.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Z(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Z(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Hd.exec(e)||Vd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ao({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Bd.exec(e)||Wd.exec(e);if(!t)return null;var n,r,o=Do({h:(n=t[1],r=t[2],r===void 0&&(r="deg"),Number(n)*(zd[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return jo(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=o===void 0?1:o;return Oe(t)&&Oe(n)&&Oe(r)?Ao({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=o===void 0?1:o;if(!Oe(t)||!Oe(n)||!Oe(r))return null;var s=Do({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return jo(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=o===void 0?1:o;if(!Oe(t)||!Oe(n)||!Oe(r))return null;var s=function(a){return{h:js(a.h),s:pe(a.s,0,100),v:pe(a.v,0,100),a:pe(a.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return Ls(s)},"hsv"]]},Mo=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=Bn(this.rgba),n=t.r,r=t.g,o=t.b,s=(i=t.a)<1?qt(Z(255*i)):"","#"+qt(n)+qt(r)+qt(o)+s;var t,n,r,o,i,s},e.prototype.toRgb=function(){return Bn(this.rgba)},e.prototype.toRgbString=function(){return t=Bn(this.rgba),n=t.r,r=t.g,o=t.b,(i=t.a)<1?"rgba("+n+", "+r+", "+o+", "+i+")":"rgb("+n+", "+r+", "+o+")";var t,n,r,o,i},e.prototype.toHsl=function(){return Io(Rt(this.rgba))},e.prototype.toHslString=function(){return t=Io(Rt(this.rgba)),n=t.h,r=t.s,o=t.l,(i=t.a)<1?"hsla("+n+", "+r+"%, "+o+"%, "+i+")":"hsl("+n+", "+r+"%, "+o+"%)";var t,n,r,o,i},e.prototype.toHsv=function(){return t=Ms(this.rgba),{h:Z(t.h),s:Z(t.s),v:Z(t.v),a:Z(t.a,3)};var t},e.prototype.invert=function(){return re({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),re(Wn(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),re(Wn(this.rgba,-t))},e.prototype.grayscale=function(){return re(Wn(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),re(Lo(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),re(Lo(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?re({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):Z(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=Rt(this.rgba);return typeof t=="number"?re({h:t,s:n.s,l:n.l,a:n.a}):Z(n.h)},e.prototype.isEqual=function(t){return this.toHex()===re(t).toHex()},e}(),re=function(e){return e instanceof ur?e:new ur(e)},No=[],Kd=function(e){e.forEach(function(t){No.indexOf(t)<0&&(t(ur,lr),No.push(t))})};function Gd(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,l=r[this.toHex()];if(l)return l;if(s!=null&&s.closest){var u=this.toRgb(),f=1/0,p="black";if(!i.length)for(var h in n)i[h]=new e(n[h]).toRgb();for(var m in n){var b=(a=u,c=i[m],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));b=0||(o[n]=e[n]);return o}function fr(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var lt=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:y.buttons>0)&&o.current?i(zo(o.current,y,a.current)):b(!1)},m=function(){return b(!1)};function b(y){var v=c.current,w=dr(o.current),x=y?w.addEventListener:w.removeEventListener;x(v?"touchmove":"mousemove",h),x(v?"touchend":"mouseup",m)}return[function(y){var v=y.nativeEvent,w=o.current;if(w&&(Fo(v),!function($,C){return C&&!_t($)}(v,c.current)&&w)){if(_t(v)){c.current=!0;var x=v.changedTouches||[];x.length&&(a.current=x[0].identifier)}w.focus(),i(zo(w,v,a.current)),b(!0)}},function(y){var v=y.which||y.keyCode;v<37||v>40||(y.preventDefault(),s({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},b]},[s,i]),u=l[0],f=l[1],p=l[2];return d.useEffect(function(){return p},[p]),g.createElement("div",ht({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))}),Nt=function(e){return e.filter(Boolean).join(" ")},Nr=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,i=Nt(["react-colorful__pointer",e.className]);return g.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},g.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},oe=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},zs=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:oe(e.h),s:oe(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:oe(o/2),a:oe(r,2)}},pr=function(e){var t=zs(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Vn=function(e){var t=zs(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Fs=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),c=r*(1-(1-t+i)*n),l=i%6;return{r:oe(255*[r,a,s,s,c,r][l]),g:oe(255*[c,r,r,a,s,s][l]),b:oe(255*[s,s,c,r,r,a][l]),a:oe(o,2)}},Bs=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:oe(60*(a<0?a+6:a)),s:oe(i?s/i*100:0),v:oe(i/255*100),a:o}},Ws=g.memo(function(e){var t=e.hue,n=e.onChange,r=Nt(["react-colorful__hue",e.className]);return g.createElement("div",{className:r},g.createElement(Lr,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:lt(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":oe(t),"aria-valuemax":"360","aria-valuemin":"0"},g.createElement(Nr,{className:"react-colorful__hue-pointer",left:t/360,color:pr({h:t,s:100,v:100,a:1})})))}),Hs=g.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:pr({h:t.h,s:100,v:100,a:1})};return g.createElement("div",{className:"react-colorful__saturation",style:r},g.createElement(Lr,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:lt(t.s+100*o.left,0,100),v:lt(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+oe(t.s)+"%, Brightness "+oe(t.v)+"%"},g.createElement(Nr,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:pr(t)})))}),zr=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Vs(e,t,n){var r=fr(n),o=d.useState(function(){return e.toHsva(t)}),i=o[0],s=o[1],a=d.useRef({color:t,hsva:i});d.useEffect(function(){if(!e.equal(t,a.current.color)){var l=e.toHsva(t);a.current={hsva:l,color:t},s(l)}},[t,e]),d.useEffect(function(){var l;zr(i,a.current.hsva)||e.equal(l=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:l},r(l))},[i,e,r]);var c=d.useCallback(function(l){s(function(u){return Object.assign({},u,l)})},[]);return[i,c]}var Yd=typeof window<"u"?d.useLayoutEffect:d.useEffect,qd=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Bo=new Map,Us=function(e){Yd(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Bo.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Bo.set(t,n);var r=qd();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Xd=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,s=Mr(e,["className","colorModel","color","onChange"]),a=d.useRef(null);Us(a);var c=Vs(n,o,i),l=c[0],u=c[1],f=Nt(["react-colorful",t]);return g.createElement("div",ht({},s,{ref:a,className:f}),g.createElement(Hs,{hsva:l,onChange:u}),g.createElement(Ws,{hue:l.h,onChange:u,className:"react-colorful__last-control"}))},Jd=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Vn(Object.assign({},n,{a:0}))+", "+Vn(Object.assign({},n,{a:1}))+")"},i=Nt(["react-colorful__alpha",t]),s=oe(100*n.a);return g.createElement("div",{className:i},g.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),g.createElement(Lr,{onMove:function(a){r({a:a.left})},onKey:function(a){r({a:lt(n.a+a.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},g.createElement(Nr,{className:"react-colorful__alpha-pointer",left:n.a,color:Vn(n)})))},Zd=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,s=Mr(e,["className","colorModel","color","onChange"]),a=d.useRef(null);Us(a);var c=Vs(n,o,i),l=c[0],u=c[1],f=Nt(["react-colorful",t]);return g.createElement("div",ht({},s,{ref:a,className:f}),g.createElement(Hs,{hsva:l,onChange:u}),g.createElement(Ws,{hue:l.h,onChange:u}),g.createElement(Jd,{hsva:l,onChange:u,className:"react-colorful__last-control"}))},Qd={defaultColor:{r:0,g:0,b:0,a:1},toHsva:Bs,fromHsva:Fs,equal:zr},ep=function(e){return g.createElement(Zd,ht({},e,{colorModel:Qd}))},tp={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return Bs({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=Fs(e)).r,g:t.g,b:t.b};var t},equal:zr},np=function(e){return g.createElement(Xd,ht({},e,{colorModel:tp}))},Ks={exports:{}},rp="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",op=rp,ip=op;function Gs(){}function Ys(){}Ys.resetWarningCache=Gs;var sp=function(){function e(r,o,i,s,a,c){if(c!==ip){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ys,resetWarningCache:Gs};return n.PropTypes=n,n};Ks.exports=sp();var ap=Ks.exports;const K=pi(ap);function gt(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(u){try{l(r.next(u))}catch(f){s(f)}}function c(u){try{l(r.throw(u))}catch(f){s(f)}}function l(u){u.done?i(u.value):o(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function mt(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(i=l[0]&2?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function lp(){for(var e=[],t=0;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function fp(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=up.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var dp=[".DS_Store","Thumbs.db"];function pp(e){return gt(this,void 0,void 0,function(){return mt(this,function(t){return un(e)&&hp(e)?[2,vp(e.dataTransfer,e.type)]:gp(e)?[2,mp(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,bp(e)]:[2,[]]})})}function hp(e){return un(e.dataTransfer)}function gp(e){return un(e)&&un(e.target)}function un(e){return typeof e=="object"&&e!==null}function mp(e){return hr(e.target.files).map(function(t){return zt(t)})}function bp(e){return gt(this,void 0,void 0,function(){var t;return mt(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return zt(r)})]}})})}function vp(e,t){return gt(this,void 0,void 0,function(){var n,r;return mt(this,function(o){switch(o.label){case 0:return e===null?[2,[]]:e.items?(n=hr(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(yp))]):[3,2];case 1:return r=o.sent(),[2,Wo(qs(r))];case 2:return[2,Wo(hr(e.files).map(function(i){return zt(i)}))]}})})}function Wo(e){return e.filter(function(t){return dp.indexOf(t.name)===-1})}function hr(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,Yo(n)];if(e.sizen)return[!1,Yo(n)]}return[!0,null]}function St(e){return e!=null}function Dp(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,s=e.maxFiles;return!i&&t.length>1||i&&s>=1&&t.length>s?!1:t.every(function(a){var c=Zs(a,n),l=Ko(c,1),u=l[0],f=Qs(a,r,o),p=Ko(f,1),h=p[0];return u&&h})}function fn(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Xt(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Xo(e){e.preventDefault()}function Ip(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function jp(e){return e.indexOf("Edge/")!==-1}function Mp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Ip(e)||jp(e)}function xe(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zp(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Fr=d.forwardRef(function(e,t){var n=e.children,r=dn(e,Bp),o=na(r),i=o.open,s=dn(o,Wp);return d.useImperativeHandle(t,function(){return{open:i}},[i]),g.createElement(d.Fragment,null,n(G(G({},s),{},{open:i})))});Fr.displayName="Dropzone";var ta={disabled:!1,getFilesFromEvent:pp,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};Fr.defaultProps=ta;Fr.propTypes={children:K.func,accept:K.oneOfType([K.string,K.arrayOf(K.string)]),multiple:K.bool,preventDropOnDocument:K.bool,noClick:K.bool,noKeyboard:K.bool,noDrag:K.bool,noDragEventsBubbling:K.bool,minSize:K.number,maxSize:K.number,maxFiles:K.number,disabled:K.bool,getFilesFromEvent:K.func,onFileDialogCancel:K.func,onFileDialogOpen:K.func,useFsAccessApi:K.bool,onDragEnter:K.func,onDragLeave:K.func,onDragOver:K.func,onDrop:K.func,onDropAccepted:K.func,onDropRejected:K.func,validator:K.func};var br={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function na(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=G(G({},ta),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,s=t.minSize,a=t.multiple,c=t.maxFiles,l=t.onDragEnter,u=t.onDragLeave,f=t.onDragOver,p=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,b=t.onFileDialogCancel,y=t.onFileDialogOpen,v=t.useFsAccessApi,w=t.preventDropOnDocument,x=t.noClick,$=t.noKeyboard,C=t.noDrag,E=t.noDragEventsBubbling,S=t.validator,k=d.useMemo(function(){return typeof y=="function"?y:Zo},[y]),F=d.useMemo(function(){return typeof b=="function"?b:Zo},[b]),R=d.useRef(null),P=d.useRef(null),T=d.useReducer(Qp,br),I=Un(T,2),j=I[0],L=I[1],B=j.isFocused,W=j.isFileDialogActive,M=j.draggedFiles,H=d.useRef(typeof window<"u"&&window.isSecureContext&&v&&Lp()),J=function(){!H.current&&W&&setTimeout(function(){if(P.current){var N=P.current.files;N.length||(L({type:"closeDialog"}),F())}},300)};d.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[P,W,F,H]);var ie=d.useRef([]),Ft=function(N){R.current&&R.current.contains(N.target)||(N.preventDefault(),ie.current=[])};d.useEffect(function(){return w&&(document.addEventListener("dragover",Xo,!1),document.addEventListener("drop",Ft,!1)),function(){w&&(document.removeEventListener("dragover",Xo),document.removeEventListener("drop",Ft))}},[R,w]);var Bt=d.useCallback(function(O){O.preventDefault(),O.persist(),Ze(O),ie.current=[].concat(Up(ie.current),[O.target]),Xt(O)&&Promise.resolve(o(O)).then(function(N){fn(O)&&!E||(L({draggedFiles:N,isDragActive:!0,type:"setDraggedFiles"}),l&&l(O))})},[o,l,E]),Wt=d.useCallback(function(O){O.preventDefault(),O.persist(),Ze(O);var N=Xt(O);if(N&&O.dataTransfer)try{O.dataTransfer.dropEffect="copy"}catch{}return N&&f&&f(O),!1},[f,E]),Ht=d.useCallback(function(O){O.preventDefault(),O.persist(),Ze(O);var N=ie.current.filter(function(se){return R.current&&R.current.contains(se)}),Q=N.indexOf(O.target);Q!==-1&&N.splice(Q,1),ie.current=N,!(N.length>0)&&(L({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Xt(O)&&u&&u(O))},[R,u,E]),qe=d.useCallback(function(O,N){var Q=[],se=[];O.forEach(function(ge){var xt=Zs(ge,n),et=Un(xt,2),_n=et[0],Pn=et[1],Tn=Qs(ge,s,i),Vt=Un(Tn,2),kn=Vt[0],An=Vt[1],Dn=S?S(ge):null;if(_n&&kn&&!Dn)Q.push(ge);else{var In=[Pn,An];Dn&&(In=In.concat(Dn)),se.push({file:ge,errors:In.filter(function(ma){return ma})})}}),(!a&&Q.length>1||a&&c>=1&&Q.length>c)&&(Q.forEach(function(ge){se.push({file:ge,errors:[Ap]})}),Q.splice(0)),L({acceptedFiles:Q,fileRejections:se,type:"setFiles"}),p&&p(Q,se,N),se.length>0&&m&&m(se,N),Q.length>0&&h&&h(Q,N)},[L,a,n,s,i,c,p,h,m,S]),Be=d.useCallback(function(O){O.preventDefault(),O.persist(),Ze(O),ie.current=[],Xt(O)&&Promise.resolve(o(O)).then(function(N){fn(O)&&!E||qe(N,O)}),L({type:"reset"})},[o,qe,E]),Ce=d.useCallback(function(){if(H.current){L({type:"openDialog"}),k();var O={multiple:a,types:Np(n)};window.showOpenFilePicker(O).then(function(N){return o(N)}).then(function(N){qe(N,null),L({type:"closeDialog"})}).catch(function(N){zp(N)?(F(N),L({type:"closeDialog"})):Fp(N)&&(H.current=!1,P.current&&(P.current.value=null,P.current.click()))});return}P.current&&(L({type:"openDialog"}),k(),P.current.value=null,P.current.click())},[L,k,F,v,qe,n,a]),bt=d.useCallback(function(O){!R.current||!R.current.isEqualNode(O.target)||(O.key===" "||O.key==="Enter"||O.keyCode===32||O.keyCode===13)&&(O.preventDefault(),Ce())},[R,Ce]),vt=d.useCallback(function(){L({type:"focus"})},[]),yt=d.useCallback(function(){L({type:"blur"})},[]),wt=d.useCallback(function(){x||(Mp()?setTimeout(Ce,0):Ce())},[x,Ce]),fe=function(N){return r?null:N},Xe=function(N){return $?null:fe(N)},Je=function(N){return C?null:fe(N)},Ze=function(N){E&&N.stopPropagation()},On=d.useMemo(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=O.refKey,Q=N===void 0?"ref":N,se=O.role,ge=O.onKeyDown,xt=O.onFocus,et=O.onBlur,_n=O.onClick,Pn=O.onDragEnter,Tn=O.onDragOver,Vt=O.onDragLeave,kn=O.onDrop,An=dn(O,Hp);return G(G(mr({onKeyDown:Xe(xe(ge,bt)),onFocus:Xe(xe(xt,vt)),onBlur:Xe(xe(et,yt)),onClick:fe(xe(_n,wt)),onDragEnter:Je(xe(Pn,Bt)),onDragOver:Je(xe(Tn,Wt)),onDragLeave:Je(xe(Vt,Ht)),onDrop:Je(xe(kn,Be)),role:typeof se=="string"&&se!==""?se:"button"},Q,R),!r&&!$?{tabIndex:0}:{}),An)}},[R,bt,vt,yt,wt,Bt,Wt,Ht,Be,$,C,r]),Rn=d.useCallback(function(O){O.stopPropagation()},[]),Qe=d.useMemo(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=O.refKey,Q=N===void 0?"ref":N,se=O.onChange,ge=O.onClick,xt=dn(O,Vp),et=mr({accept:n,multiple:a,type:"file",style:{display:"none"},onChange:fe(xe(se,Be)),onClick:fe(xe(ge,Rn)),tabIndex:-1},Q,P);return G(G({},et),xt)}},[P,n,a,Be,r]),Hr=M.length,Vr=Hr>0&&Dp({files:M,accept:n,minSize:s,maxSize:i,multiple:a,maxFiles:c}),ga=Hr>0&&!Vr;return G(G({},j),{},{isDragAccept:Vr,isDragReject:ga,isFocused:B&&!r,getRootProps:On,getInputProps:Qe,rootRef:R,inputRef:P,open:fe(Ce)})}function Qp(e,t){switch(t.type){case"focus":return G(G({},e),{},{isFocused:!0});case"blur":return G(G({},e),{},{isFocused:!1});case"openDialog":return G(G({},br),{},{isFileDialogActive:!0});case"closeDialog":return G(G({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return G(G({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return G(G({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return G({},br);default:return e}}function Zo(){}const eh=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(s,a,c)=>{let l=s;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=s(r.getState());l=p=>{const h=s(p);if(!u(f,h)){const m=f;a(f=h,m)}},c!=null&&c.fireImmediately&&a(f,f)}return o(l)},e(t,n,r)};/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var th=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var nh=th;function Qo(e){return nh(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var ra=function(t){var n,r;return!(Qo(t)===!1||(n=t.constructor,typeof n!="function")||(r=n.prototype,Qo(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */var rh=ra,Br=function(t){return rh(t)||typeof t=="function"||Array.isArray(t)};/*! + * for-in + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var oh=function(t,n,r){for(var o in t)if(n.call(r,t[o],o,t)===!1)break},ih=Br,sh=oh;function oa(e,t){for(var n=arguments.length,r=0;++r + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */var uh=function(e,t,n,r,o){if(!fh(e)||!t)return e;if(t=Jt(t),n&&(t+="."+Jt(n)),r&&(t+="."+Jt(r)),o&&(t+="."+Jt(o)),t in e)return e[t];for(var i=t.split("."),s=i.length,a=-1;e&&++a + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */var dh=function(e,t){if(e===null||typeof e>"u")throw new TypeError("expected first argument to be an object.");if(typeof t>"u"||typeof Symbol>"u"||typeof Object.getOwnPropertySymbols!="function")return e;for(var n=Object.prototype.propertyIsEnumerable,r=Object(e),o=arguments.length,i=0;++i"u")throw new TypeError("Cannot convert undefined or null to object");ei(e)||(e={});for(var t=1;t + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */var wh=gh,xh=function(e,t,n){if(typeof e!="string")throw new TypeError("expected a string");typeof t=="function"&&(n=t,t=null),typeof t=="string"&&(t={sep:t});var r=wh({sep:"."},t),o=r.quotes||['"',"'","`"],i;r.brackets===!0?i={"<":">","(":")","[":"]","{":"}"}:r.brackets&&(i=r.brackets);var s=[],a=[],c=[""],l=r.sep,u=e.length,f=-1,p;function h(){if(i&&a.length)return i[a[a.length-1]]}for(;++f + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */var Sh=function(t){return typeof t<"u"&&t!==null&&(typeof t=="object"||typeof t=="function")},ti=Sh,Ch=function(t){ti(t)||(t={});for(var n=arguments.length,r=1;r + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */var _h=function(t){return typeof t<"u"&&t!==null&&(typeof t=="object"||typeof t=="function")};/*! + * set-value + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */var Ph=xh,Th=Ch,ni=ra,ri=_h,kh=function(e,t,n){if(!ri(e)||(Array.isArray(t)&&(t=[].concat.apply([],t).join(".")),typeof t!="string"))return e;for(var r=Ph(t,{sep:".",brackets:!0}).filter(Ah),o=r.length,i=-1,s=e;++ie.filter(Boolean).join(".");function Mh(e){const t=e.split(".");return[t.pop(),t.join(".")||void 0]}function Lh(e,t){return Object.entries(lf(e,t)).reduce((n,[,{value:r,disabled:o,key:i}])=>(n[i]=o?void 0:r,n),{})}function Nh(e,t){const n=d.useRef();return Pt(e,n.current)||(n.current=e),n.current}function ia(e,t){return d.useMemo(e,Nh(t))}function zh(e){const t=d.useRef(null),n=d.useRef(null),r=d.useRef(!0);return d.useLayoutEffect(()=>{e||(t.current.style.height="0px",t.current.style.overflow="hidden")},[]),d.useEffect(()=>{if(r.current){r.current=!1;return}let o;const i=t.current,s=()=>{e&&(i.style.removeProperty("height"),i.style.removeProperty("overflow"),n.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};i.addEventListener("transitionend",s,{once:!0});const{height:a}=n.current.getBoundingClientRect();return i.style.height=a+"px",e||(i.style.overflow="hidden",o=window.setTimeout(()=>i.style.height="0px",50)),()=>{i.removeEventListener("transitionend",s),clearTimeout(o)}},[e]),{wrapperRef:t,contentRef:n}}const Fh=e=>{const[t,n]=d.useState(e.getVisiblePaths());return d.useEffect(()=>{n(e.getVisiblePaths());const r=e.useStore.subscribe(e.getVisiblePaths,n,{equalityFn:mn});return()=>r()},[e]),t};function Bh(e,t,n){return e.useStore(o=>{const i=D(D({},n),o.data);return Lh(i,t)},mn)}function sa(e=3){const t=d.useRef(null),n=d.useRef(null),[r,o]=d.useState(!1),i=d.useCallback(()=>o(!0),[]),s=d.useCallback(()=>o(!1),[]);return d.useLayoutEffect(()=>{if(r){const{bottom:a,top:c,left:l}=t.current.getBoundingClientRect(),{height:u}=n.current.getBoundingClientRect(),f=a+u>window.innerHeight-40?"up":"down";n.current.style.position="fixed",n.current.style.zIndex="10000",n.current.style.left=l+"px",f==="down"?n.current.style.top=a+e+"px":n.current.style.bottom=window.innerHeight-c+e+"px"}},[e,r]),{popinRef:t,wrapperRef:n,shown:r,show:i,hide:s}}Kd([Gd]);const Wh={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};ce.extend({color:()=>e=>re(e).isValid()});const Hh=e=>ce().color().test(e);function aa(e,{format:t,hasAlpha:n,isString:r}){const o=Wh[t]+(r&&t!=="hex"?"String":""),i=e[o]();return typeof i=="object"&&!n?uf(i,["a"]):i}const ca=(e,t)=>{const n=re(e);if(!n.isValid())throw Error("Invalid color");return aa(n,t)},Vh=(e,t)=>aa(re(e),D(D({},t),{},{isString:!0,format:"hex"})),Uh=({value:e})=>{const t=Ud(e),n=t==="name"?"hex":t,r=typeof e=="object"?"a"in e:t==="hex"&&e.length===8||/^(rgba)|(hsla)|(hsva)/.test(e),o={format:n,hasAlpha:r,isString:typeof e=="string"};return{value:ca(e,o),settings:o}};var Kh=Object.freeze({__proto__:null,schema:Hh,sanitize:ca,format:Vh,normalize:Uh});const Gh=A("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),Yh=A("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),qh=A("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function si(e,t){return t!=="rgb"?re(e).toRgb():e}function Xh({value:e,displayValue:t,settings:n,onUpdate:r}){const{emitOnEditStart:o,emitOnEditEnd:i}=te(),{format:s,hasAlpha:a}=n,{popinRef:c,wrapperRef:l,shown:u,show:f,hide:p}=sa(),h=d.useRef(0),[m,b]=d.useState(()=>si(e,s)),y=a?ep:np,v=()=>{b(si(e,s)),f(),o()},w=()=>{p(),i(),window.clearTimeout(h.current)},x=()=>{h.current=window.setTimeout(w,500)};return d.useEffect(()=>()=>window.clearTimeout(h.current),[]),g.createElement(g.Fragment,null,g.createElement(Gh,{ref:c,active:u,onClick:()=>v(),style:{color:t}}),u&&g.createElement(Dr,null,g.createElement(Os,{onPointerUp:w}),g.createElement(qh,{ref:l,onMouseEnter:()=>window.clearTimeout(h.current),onMouseLeave:$=>$.buttons===0&&x()},g.createElement(y,{color:m,onChange:r}))))}function Jh(){const{value:e,displayValue:t,label:n,onChange:r,onUpdate:o,settings:i}=te();return g.createElement(he,{input:!0},g.createElement(we,null,n),g.createElement(Yh,null,g.createElement(Xh,{value:e,displayValue:t,onChange:r,onUpdate:o,settings:i}),g.createElement(Ar,{value:t,onChange:r,onUpdate:o})))}var Zh=D({component:Jh},Kh);function Qh(){const{label:e,displayValue:t,onUpdate:n,settings:r}=te();return g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(jr,{value:t,settings:r,onUpdate:n}))}var eg=D({component:Qh},Is(["x","y","z"]));const tg=A("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),ng=A("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function rg({value:e,settings:t,onUpdate:n}){const r=d.useRef(),o=d.useRef(0),i=d.useRef(0),s=d.useRef(1),[a,c]=d.useState(!1),[l,u]=d.useState(!1),[f,p]=_s(),h=d.useRef(null),m=d.useRef(null);d.useLayoutEffect(()=>{if(a){const{top:T,left:I,width:j,height:L}=h.current.getBoundingClientRect();m.current.style.left=I+j/2+"px",m.current.style.top=T+L/2+"px"}},[a]);const{keys:[b,y],joystick:v}=t,w=v==="invertY"?1:-1,{[b]:{step:x},[y]:{step:$}}=t,C=Pe("sizes","joystickWidth"),E=Pe("sizes","joystickHeight"),S=parseFloat(C)*.8/2,k=parseFloat(E)*.8/2,F=d.useCallback(()=>{r.current||(u(!0),o.current&&p({x:o.current*S}),i.current&&p({y:i.current*-k}),r.current=window.setInterval(()=>{n(T=>{const I=x*o.current*s.current,j=w*$*i.current*s.current;return Array.isArray(T)?{[b]:T[0]+I,[y]:T[1]+j}:{[b]:T[b]+I,[y]:T[y]+j}})},16))},[S,k,n,p,x,$,b,y,w]),R=d.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0,u(!1)},[]);d.useEffect(()=>{function T(I){s.current=ds(I)}return window.addEventListener("keydown",T),window.addEventListener("keyup",T),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",T),window.removeEventListener("keyup",T)}},[]);const P=Lt(({first:T,active:I,delta:[j,L],movement:[B,W]})=>{T&&c(!0);const M=ze(B,-S,S),H=ze(W,-k,k);o.current=Math.abs(B)>Math.abs(M)?Math.sign(B-M):0,i.current=Math.abs(W)>Math.abs(H)?Math.sign(H-W):0;let J=e[b],ie=e[y];I?(o.current||(J+=j*x*s.current,p({x:M})),i.current||(ie-=w*L*$*s.current,p({y:H})),o.current||i.current?F():R(),n({[b]:J,[y]:ie})):(c(!1),o.current=0,i.current=0,p({x:0,y:0}),R())});return g.createElement(tg,X({ref:h},P()),a&&g.createElement(Dr,null,g.createElement(ng,{ref:m,isOutOfBounds:l},g.createElement("div",null),g.createElement("span",{ref:f}))))}const og=A("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function ig(){const{label:e,displayValue:t,onUpdate:n,settings:r}=te();return g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(og,{withJoystick:!!r.joystick},r.joystick&&g.createElement(rg,{value:t,settings:r,onUpdate:n}),g.createElement(jr,{value:t,settings:r,onUpdate:n})))}const sg=["joystick"],la=Is(["x","y"]),ag=e=>{let{joystick:t=!0}=e,n=U(e,sg);const{value:r,settings:o}=la.normalize(n);return{value:r,settings:D(D({},o),{},{joystick:t})}};var cg=D(D({component:ig},la),{},{normalize:ag});const lg=e=>{if(e!==void 0){if(e instanceof File)try{return URL.createObjectURL(e)}catch{return}if(typeof e=="string"&&e.indexOf("blob:")===0)return e;throw Error("Invalid image format [undefined | blob | File].")}},ug=(e,t)=>typeof t=="object"&&"image"in t,fg=({image:e})=>({value:e});var dg=Object.freeze({__proto__:null,sanitize:lg,schema:ug,normalize:fg});const pg=A("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),hg=A("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),gg=A("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),mg=A("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),bg=A("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),vg=A("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function yg(){const{label:e,value:t,onUpdate:n,disabled:r}=te(),{popinRef:o,wrapperRef:i,shown:s,show:a,hide:c}=sa(),l=d.useCallback(m=>{m.length&&n(m[0])},[n]),u=d.useCallback(m=>{m.stopPropagation(),n(void 0)},[n]),{getRootProps:f,getInputProps:p,isDragAccept:h}=na({maxFiles:1,accept:"image/*",onDrop:l,disabled:r});return g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(pg,null,g.createElement(gg,{ref:o,hasImage:!!t,onPointerDown:()=>!!t&&a(),onPointerUp:c,style:{backgroundImage:t?`url(${t})`:"none"}}),s&&!!t&&g.createElement(Dr,null,g.createElement(Os,{onPointerUp:c,style:{cursor:"pointer"}}),g.createElement(mg,{ref:i,style:{backgroundImage:`url(${t})`}})),g.createElement(hg,f({isDragAccept:h}),g.createElement("input",p()),g.createElement(bg,null,h?"drop image":"click or drop")),g.createElement(vg,{onClick:u,disabled:!t})))}var wg=D({component:yg},dg);const ai=ce().number(),xg=(e,t)=>ce().array().length(2).every.number().test(e)&&ce().schema({min:ai,max:ai}).test(t),pn=e=>({min:e[0],max:e[1]}),ua=(e,{bounds:[t,n]},r)=>{const o=Array.isArray(e)?pn(e):e,i={min:r[0],max:r[1]},{min:s,max:a}=D(D({},i),o);return[ze(Number(s),t,Math.max(t,a)),ze(Number(a),Math.min(n,s),n)]},Eg=({value:e,min:t,max:n})=>{const r={min:t,max:n},o=Ds(pn(e),{min:r,max:r}),i=[t,n],s=D(D({},o),{},{bounds:i});return{value:ua(pn(e),s,e),settings:s}};var $g=Object.freeze({__proto__:null,schema:xg,format:pn,sanitize:ua,normalize:Eg});const Sg=["value","bounds","onDrag"],Cg=["bounds"],Og=A("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function Rg(e){let{value:t,bounds:[n,r],onDrag:o}=e,i=U(e,Sg);const s=d.useRef(null),a=d.useRef(null),c=d.useRef(null),l=d.useRef(0),u=Pe("sizes","scrubberWidth"),f=Lt(({event:m,first:b,xy:[y],movement:[v],memo:w={}})=>{if(b){const{width:$,left:C}=s.current.getBoundingClientRect();l.current=$-parseFloat(u);const E=(m==null?void 0:m.target)===a.current||(m==null?void 0:m.target)===c.current;w.pos=cn((y-C)/$,n,r);const S=Math.abs(w.pos-t.min)-Math.abs(w.pos-t.max);w.key=S<0||S===0&&w.pos<=t.min?"min":"max",E&&(w.pos=t[w.key])}const x=w.pos+cn(v/l.current,0,r-n);return o({[w.key]:Zf(x,i[w.key])}),w}),p=`calc(${an(t.min,n,r)} * (100% - ${u} - 8px) + 4px)`,h=`calc(${1-an(t.max,n,r)} * (100% - ${u} - 8px) + 4px)`;return g.createElement(Ts,X({ref:s},f()),g.createElement(Ps,null,g.createElement(ks,{style:{left:p,right:h}})),g.createElement(ar,{position:"left",ref:a,style:{left:p}}),g.createElement(ar,{position:"right",ref:c,style:{right:h}}))}function _g(){const{label:e,displayValue:t,onUpdate:n,settings:r}=te(),o=U(r,Cg);return g.createElement(g.Fragment,null,g.createElement(he,{input:!0},g.createElement(we,null,e),g.createElement(Og,null,g.createElement(Rg,X({value:t},r,{onDrag:n})),g.createElement(jr,{value:t,settings:o,onUpdate:n,innerLabelTrim:0}))))}var Pg=D({component:_g},$g);const Tg=()=>{const e=new Map;return{on:(t,n)=>{let r=e.get(t);r===void 0&&(r=new Set,e.set(t,r)),r.add(n)},off:(t,n)=>{const r=e.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.delete(t))},emit:(t,...n)=>{const r=e.get(t);if(r!==void 0)for(const o of r)o(...n)}}},kg=["type","value"],Ag=["onChange","transient","onEditStart","onEditEnd"],Dg=function(){const t=xa(eh(()=>({data:{}}))),n=Tg();this.storeId=cf(),this.useStore=t;const r={},o=new Set;this.getVisiblePaths=()=>{const s=this.getData(),a=Object.keys(s),c=[];Object.entries(r).forEach(([u,f])=>{f.render&&a.some(p=>p.indexOf(u)===0)&&!f.render(this.get)&&c.push(u+".")});const l=[];return o.forEach(u=>{u in s&&s[u].__refCount>0&&c.every(f=>u.indexOf(f)===-1)&&(!s[u].render||s[u].render(this.get))&&l.push(u)}),l},this.setOrderedPaths=s=>{s.forEach(a=>o.add(a))},this.orderPaths=s=>(this.setOrderedPaths(s),s),this.disposePaths=s=>{t.setState(a=>{const c=a.data;return s.forEach(l=>{if(l in c){const u=c[l];u.__refCount--,u.__refCount===0&&u.type in me&&delete c[l]}}),{data:c}})},this.dispose=()=>{t.setState(()=>({data:{}}))},this.getFolderSettings=s=>r[s]||{},this.getData=()=>t.getState().data,this.addData=(s,a)=>{t.setState(c=>{const l=c.data;return Object.entries(s).forEach(([u,f])=>{let p=l[u];if(p){const{type:h,value:m}=f,b=U(f,kg);h!==p.type?_e(Y.INPUT_TYPE_OVERRIDE,h):((p.__refCount===0||a)&&Object.assign(p,b),p.__refCount++)}else l[u]=D(D({},f),{},{__refCount:1})}),{data:l}})},this.setValueAtPath=(s,a,c)=>{t.setState(l=>{const u=l.data;return ko(u[s],a,s,this,c),{data:u}})},this.setSettingsAtPath=(s,a)=>{t.setState(c=>{const l=c.data;return l[s].settings=D(D({},l[s].settings),a),{data:l}})},this.disableInputAtPath=(s,a)=>{t.setState(c=>{const l=c.data;return l[s].disabled=a,{data:l}})},this.set=(s,a)=>{t.setState(c=>{const l=c.data;return Object.entries(s).forEach(([u,f])=>{try{ko(l[u],f,void 0,void 0,a)}catch{}}),{data:l}})},this.getInput=s=>{try{return this.getData()[s]}catch{_e(Y.PATH_DOESNT_EXIST,s)}},this.get=s=>{var a;return(a=this.getInput(s))===null||a===void 0?void 0:a.value},this.emitOnEditStart=s=>{n.emit(`onEditStart:${s}`,this.get(s),s,D(D({},this.getInput(s)),{},{get:this.get}))},this.emitOnEditEnd=s=>{n.emit(`onEditEnd:${s}`,this.get(s),s,D(D({},this.getInput(s)),{},{get:this.get}))},this.subscribeToEditStart=(s,a)=>{const c=`onEditStart:${s}`;return n.on(c,a),()=>n.off(c,a)},this.subscribeToEditEnd=(s,a)=>{const c=`onEditEnd:${s}`;return n.on(c,a),()=>n.off(c,a)};const i=(s,a,c)=>{const l={};return Object.entries(s).forEach(([u,f])=>{if(u==="")return _e(Y.EMPTY_KEY);let p=Wr(a,u);if(f.type===me.FOLDER){const h=i(f.schema,p,c);Object.assign(l,h),p in r||(r[p]=f.settings)}else if(u in c)_e(Y.DUPLICATE_KEYS,u,p,c[u].path);else{const h=mf(f,u,p,l);if(h){const{type:m,options:b,input:y}=h,{onChange:v,transient:w,onEditStart:x,onEditEnd:$}=b,C=U(b,Ag);l[p]=D(D(D({type:m},C),y),{},{fromPanel:!0}),c[u]={path:p,onChange:v,transient:w,onEditStart:x,onEditEnd:$}}else _e(Y.UNKNOWN_INPUT,p,f)}}),l};this.getDataFromSchema=s=>{const a={};return[i(s,"",a),a]}},fa=new Dg,Ig={collapsed:!1};function jg(e,t){return{type:me.FOLDER,schema:e,settings:D(D({},Ig),t)}}const ci=e=>"__levaInput"in e,Mg=(e,t)=>{const n={},r=t?t.toLowerCase():null;return e.forEach(o=>{const[i,s]=Mh(o);(!r||i.toLowerCase().indexOf(r)>-1)&&jh(n,s,{[i]:{__levaInput:!0,path:o}})}),n},Lg=["type","label","path","valueKey","value","settings","setValue","disabled"];function Ng(e){let{type:t,label:n,path:r,valueKey:o,value:i,settings:s,setValue:a,disabled:c}=e,l=U(e,Lg);const{displayValue:u,onChange:f,onUpdate:p}=Rs({type:t,value:i,settings:s,setValue:a}),h=Ge[t].component;return h?g.createElement(bs.Provider,{value:D({key:o,path:r,id:""+r,label:n,displayValue:u,value:i,onChange:f,onUpdate:p,settings:s,setValue:a,disabled:c},l)},g.createElement(Mf,{disabled:c},g.createElement(h,null))):(_e(Y.NO_COMPONENT_FOR_TYPE,t,r),null)}const zg=A("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function Fg({onClick:e,settings:t,label:n}){const r=Mt();return g.createElement(he,null,g.createElement(zg,{disabled:t.disabled,onClick:()=>e(r.get)},n))}const Bg=A("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),Wg=A("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),Hg=({label:e,opts:t})=>{let n=typeof e=="string"&&e.trim()===""?null:e,r=t;return typeof t.opts=="object"&&(r.label!==void 0&&(n=t.label),r=t.opts),{label:n,opts:r}};function Vg(e){const{label:t,opts:n}=Hg(e),r=Mt();return g.createElement(he,{input:!!t},t&&g.createElement(we,null,t),g.createElement(Bg,null,Object.entries(n).map(([o,i])=>g.createElement(Wg,{key:o,onClick:()=>i(r.get)},o))))}const Ug=A("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),da=100;function Kg(e,t){e.push(t),e.length>da&&e.shift()}const Gg=d.forwardRef(function({initialValue:e},t){const n=Pe("colors","highlight3"),r=Pe("colors","elevation2"),o=Pe("colors","highlight1"),[i,s]=d.useMemo(()=>[re(o).alpha(.4).toRgbString(),re(o).alpha(.1).toRgbString()],[o]),a=d.useRef([e]),c=d.useRef(e),l=d.useRef(e),u=d.useRef(),f=d.useCallback((m,b)=>{if(!m)return;const{width:y,height:v}=m,w=new Path2D,x=y/da,$=v*.05;for(let S=0;S({frame:m=>{(c.current===void 0||ml.current)&&(l.current=m),Kg(a.current,m),u.current=requestAnimationFrame(()=>f(p.current,h.current))}}),[p,h,f]),d.useEffect(()=>()=>cancelAnimationFrame(u.current),[]),g.createElement(Ug,{ref:p})}),li=e=>Number.isFinite(e)?e.toPrecision(2):e.toString(),Yg=d.forwardRef(function({initialValue:e},t){const[n,r]=d.useState(li(e));return d.useImperativeHandle(t,()=>({frame:o=>r(li(o))}),[]),g.createElement("div",null,n)});function ui(e){return typeof e=="function"?e():e.current}function qg({label:e,objectOrFn:t,settings:n}){const r=d.useRef(),o=d.useRef(ui(t));return d.useEffect(()=>{const i=window.setInterval(()=>{var s;document.hidden||(s=r.current)===null||s===void 0||s.frame(ui(t))},n.interval);return()=>window.clearInterval(i)},[t,n.interval]),g.createElement(he,{input:!0},g.createElement(we,{align:"top"},e),n.graph?g.createElement(Gg,{ref:r,initialValue:o.current}):g.createElement(Yg,{ref:r,initialValue:o.current}))}const Xg=["type","label","key"],Jg={[me.BUTTON]:Fg,[me.BUTTON_GROUP]:Vg,[me.MONITOR]:qg},Zg=g.memo(({path:e})=>{const[t,{set:n,setSettings:r,disable:o,storeId:i,emitOnEditStart:s,emitOnEditEnd:a}]=Gf(e);if(!t)return null;const{type:c,label:l,key:u}=t,f=U(t,Xg);if(c in me){const p=Jg[c];return g.createElement(p,X({label:l,path:e},f))}return c in Ge?g.createElement(Ng,X({key:i+e,type:c,label:l,storeId:i,path:e,valueKey:u,setValue:n,setSettings:r,disable:o,emitOnEditStart:s,emitOnEditEnd:a},f)):(Qu(Y.UNSUPPORTED_INPUT,c,e),null)});function Qg({toggle:e,toggled:t,name:n}){return g.createElement(Df,{onClick:()=>e()},g.createElement(Ir,{toggled:t}),g.createElement("div",null,n))}const em=({name:e,path:t,tree:n})=>{const r=Mt(),o=Wr(t,e),{collapsed:i,color:s}=r.getFolderSettings(o),[a,c]=d.useState(!i),l=d.useRef(null),u=Pe("colors","folderWidgetColor"),f=Pe("colors","folderTextColor");return d.useLayoutEffect(()=>{l.current.style.setProperty("--leva-colors-folderWidgetColor",s||u),l.current.style.setProperty("--leva-colors-folderTextColor",s||f)},[s,u,f]),g.createElement(ln,{ref:l},g.createElement(Qg,{name:e,toggled:a,toggle:()=>c(p=>!p)}),g.createElement(pa,{parent:o,tree:n,toggled:a}))},pa=g.memo(({isRoot:e=!1,fill:t=!1,flat:n=!1,parent:r,tree:o,toggled:i})=>{const{wrapperRef:s,contentRef:a}=zh(i),c=Mt(),l=([f,p])=>{var h;return(ci(p)?(h=c.getInput(p.path))===null||h===void 0?void 0:h.order:c.getFolderSettings(Wr(r,f)).order)||0},u=Object.entries(o).sort((f,p)=>l(f)-l(p));return g.createElement(ir,{ref:s,isRoot:e,fill:t,flat:n},g.createElement($s,{ref:a,isRoot:e,toggled:i},u.map(([f,p])=>ci(p)?g.createElement(Zg,{key:p.path,valueKey:p.valueKey,path:p.path}):g.createElement(em,{key:f,name:f,path:r,tree:p}))))}),tm=A("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${Cs}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),ha=40,hn=A("i",{$flexCenter:"",width:ha,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),nm=A("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),rm=A("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${hn}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),om=A("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),im=A("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:ha}}}}),sm=g.forwardRef(({setFilter:e,toggle:t},n)=>{const[r,o]=d.useState(""),i=d.useMemo(()=>fs(e,250),[e]),s=()=>{e(""),o("")},a=c=>{const l=c.currentTarget.value;t(!0),o(l)};return d.useEffect(()=>{i(r)},[r,i]),g.createElement(g.Fragment,null,g.createElement(om,{ref:n,value:r,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:c=>c.stopPropagation(),onChange:a}),g.createElement(hn,{onClick:()=>s(),style:{visibility:r?"visible":"hidden"}},g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},g.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function am({setFilter:e,onDrag:t,onDragStart:n,onDragEnd:r,toggle:o,toggled:i,title:s,drag:a,filterEnabled:c,from:l}){const[u,f]=d.useState(!1),p=d.useRef(null);d.useEffect(()=>{var m,b;u?(m=p.current)===null||m===void 0||m.focus():(b=p.current)===null||b===void 0||b.blur()},[u]);const h=Lt(({offset:[m,b],first:y,last:v})=>{t({x:m,y:b}),y&&n({x:m,y:b}),v&&r({x:m,y:b})},{filterTaps:!0,from:({offset:[m,b]})=>[(l==null?void 0:l.x)||m,(l==null?void 0:l.y)||b]});return d.useEffect(()=>{const m=b=>{b.key==="L"&&b.shiftKey&&b.metaKey&&f(y=>!y)};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),g.createElement(g.Fragment,null,g.createElement(nm,{mode:a?"drag":void 0},g.createElement(hn,{active:!i,onClick:()=>o()},g.createElement(Ir,{toggled:i,width:12,height:8})),g.createElement(im,X({},a?h():{},{drag:a,filterEnabled:c}),s===void 0&&a?g.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},g.createElement("circle",{cx:"2",cy:"2",r:"2"}),g.createElement("circle",{cx:"14",cy:"2",r:"2"}),g.createElement("circle",{cx:"26",cy:"2",r:"2"}),g.createElement("circle",{cx:"2",cy:"12",r:"2"}),g.createElement("circle",{cx:"14",cy:"12",r:"2"}),g.createElement("circle",{cx:"26",cy:"12",r:"2"})):s),c&&g.createElement(hn,{active:u,onClick:()=>f(m=>!m)},g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},g.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),g.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),g.createElement(rm,{toggled:u},g.createElement(sm,{ref:p,setFilter:e,toggle:o})))}const cm=["store","hidden","theme","collapsed"];function lm(e){let{store:t,hidden:n=!1,theme:r,collapsed:o=!1}=e,i=U(e,cm);const s=ia(()=>Rf(r),[r]),[a,c]=d.useState(!o),l=typeof o=="object"?!o.collapsed:a,u=d.useMemo(()=>typeof o=="object"?f=>{typeof f=="function"?o.onChange(!f(!o.collapsed)):o.onChange(!f)}:c,[o]);return!t||n?null:g.createElement(kr.Provider,{value:s},g.createElement(um,X({store:t},i,{toggled:l,setToggle:u,rootClass:s.className})))}const um=g.memo(({store:e,rootClass:t,fill:n=!1,flat:r=!1,neverHide:o=!1,oneLineLabels:i=!1,titleBar:s={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:a=!1,toggled:c,setToggle:l})=>{var u,f;const p=Fh(e),[h,m]=d.useState(""),b=d.useMemo(()=>Mg(p,h),[p,h]),[y,v]=_s(),w=o||p.length>0,x=typeof s=="object"&&s.title||void 0,$=typeof s=="object"&&(u=s.drag)!==null&&u!==void 0?u:!0,C=typeof s=="object"&&(f=s.filter)!==null&&f!==void 0?f:!0,E=typeof s=="object"&&s.position||void 0,S=typeof s=="object"&&s.onDrag||void 0,k=typeof s=="object"&&s.onDragStart||void 0,F=typeof s=="object"&&s.onDragEnd||void 0;return g.useEffect(()=>{v({x:E==null?void 0:E.x,y:E==null?void 0:E.y})},[E,v]),Of(),g.createElement(ys.Provider,{value:{hideCopyButton:a}},g.createElement(tm,{ref:y,className:t,fill:n,flat:r,oneLineLabels:i,hideTitleBar:!s,style:{display:w?"block":"none"}},s&&g.createElement(am,{onDrag:R=>{v(R),S==null||S(R)},onDragStart:R=>k==null?void 0:k(R),onDragEnd:R=>F==null?void 0:F(R),setFilter:m,toggle:R=>l(P=>R??!P),toggled:c,title:x,drag:$,filterEnabled:C,from:E}),w&&g.createElement(vs.Provider,{value:e},g.createElement(pa,{isRoot:!0,fill:n,flat:r,tree:b,toggled:c}))))}),fm=["isRoot"];let gn=!1,We=null;function dm(e){let{isRoot:t=!1}=e,n=U(e,fm);return d.useEffect(()=>(gn=!0,!t&&We&&(We.remove(),We=null),()=>{t||(gn=!1)}),[t]),g.createElement(lm,X({store:fa},n))}function pm(e){d.useEffect(()=>{e&&!gn&&(We||(We=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(We),vf(g.createElement(dm,{isRoot:!0}),We))),gn=!0)},[e])}function hm(e,t,n,r,o){let i,s,a,c,l;return typeof e=="string"?(s=e,i=t,Array.isArray(n)&&(l=n)):(i=e,Array.isArray(t)?l=t:(c=t,l=n)),{schema:i,folderName:s,folderSettings:a,hookSettings:c,deps:l||[]}}function Em(e,t,n,r,o){const{folderName:i,schema:s,folderSettings:a,hookSettings:c,deps:l}=hm(e,t,n),u=typeof s=="function",f=d.useRef(!1),p=d.useRef(!0),h=ia(()=>{f.current=!0;const P=typeof s=="function"?s():s;return i?{[i]:jg(P,a)}:P},l),m=!(c!=null&&c.store);pm(m);const[b]=d.useState(()=>(c==null?void 0:c.store)||fa),[y,v]=d.useMemo(()=>b.getDataFromSchema(h),[b,h]),[w,x,$,C,E]=d.useMemo(()=>{const P=[],T=[],I={},j={},L={};return Object.values(v).forEach(({path:B,onChange:W,onEditStart:M,onEditEnd:H,transient:J})=>{P.push(B),W?(I[B]=W,J||T.push(B)):T.push(B),M&&(j[B]=M),H&&(L[B]=H)}),[P,T,I,j,L]},[v]),S=d.useMemo(()=>b.orderPaths(w),[w,b]),k=Bh(b,x,y),F=d.useCallback(P=>{const T=Object.entries(P).reduce((I,[j,L])=>Object.assign(I,{[v[j].path]:L}),{});b.set(T,!1)},[b,v]),R=d.useCallback(P=>b.get(v[P].path),[b,v]);return d.useEffect(()=>{const P=!p.current&&f.current;return b.addData(y,P),p.current=!1,f.current=!1,()=>b.disposePaths(S)},[b,S,y]),d.useEffect(()=>{const P=[];return Object.entries($).forEach(([T,I])=>{I(b.get(T),T,D({initial:!0,get:b.get},b.getInput(T)));const j=b.useStore.subscribe(L=>{const B=L.data[T];return[B.disabled?void 0:B.value,B]},([L,B])=>I(L,T,D({initial:!1,get:b.get},B)),{equalityFn:mn});P.push(j)}),()=>P.forEach(T=>T())},[b,$]),d.useEffect(()=>{const P=[];return Object.entries(C).forEach(([T,I])=>P.push(b.subscribeToEditStart(T,I))),Object.entries(E).forEach(([T,I])=>P.push(b.subscribeToEditEnd(T,I))),()=>P.forEach(T=>T())},[C,E,b]),u?[k,F,R]:k}De(ye.SELECT,ud);De(ye.IMAGE,wg);De(ye.NUMBER,ed);De(ye.COLOR,Zh);De(ye.STRING,yd);De(ye.BOOLEAN,Od);De(ye.INTERVAL,Pg);De(ye.VECTOR3D,eg);De(ye.VECTOR2D,cg);export{mm as T,Em as u}; diff --git a/example/bundle/assets/lil-gui.module.min-Bc0DeA9g.js b/example/bundle/assets/lil-gui.module.min-Bc0DeA9g.js new file mode 100644 index 00000000..428c5fdf --- /dev/null +++ b/example/bundle/assets/lil-gui.module.min-Bc0DeA9g.js @@ -0,0 +1,10 @@ +/** + * lil-gui + * https://lil-gui.georgealways.com + * @version 0.17.0 + * @author George Michael Brower + * @license MIT + */class u{constructor(t,i,e,n,a="div"){this.parent=t,this.object=i,this.property=e,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),u.nextNameID=u.nextNameID||0,this.$name.id="lil-gui-name-"+ ++u.nextNameID,this.$widget=document.createElement(a),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(e)}name(t){return this._name=t,this.$name.innerHTML=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled||(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t)),this}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){const i=this.parent.add(this.object,this.property,t);return i.name(this._name),this.destroy(),i}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.object[this.property]=t,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class C extends u{constructor(t,i,e){super(t,i,e,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function w(l){let t,i;return(t=l.match(/(#|0x)?([a-f0-9]{6})/i))?i=t[2]:(t=l.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=l.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),!!i&&"#"+i}const k={isPrimitive:!0,match:l=>typeof l=="string",fromHexString:w,toHexString:w},m={isPrimitive:!0,match:l=>typeof l=="number",fromHexString:l=>parseInt(l.substring(1),16),toHexString:l=>"#"+l.toString(16).padStart(6,0)},L={isPrimitive:!1,match:Array.isArray,fromHexString(l,t,i=1){const e=m.fromHexString(l);t[0]=(e>>16&255)/255*i,t[1]=(e>>8&255)/255*i,t[2]=(255&e)/255*i},toHexString:([l,t,i],e=1)=>m.toHexString(l*(e=255/e)<<16^t*e<<8^i*e<<0)},S={isPrimitive:!1,match:l=>Object(l)===l,fromHexString(l,t,i=1){const e=m.fromHexString(l);t.r=(e>>16&255)/255*i,t.g=(e>>8&255)/255*i,t.b=(255&e)/255*i},toHexString:({r:l,g:t,b:i},e=1)=>m.toHexString(l*(e=255/e)<<16^t*e<<8^i*e<<0)},D=[k,m,L,S];class F extends u{constructor(t,i,e,n){var a;super(t,i,e,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(a=this.initialValue,D.find(r=>r.match(a))),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const r=w(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){const i=this._format.fromHexString(t);this.setValue(i)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class f extends u{constructor(t,i,e){super(t,i,e,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object)}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class V extends u{constructor(t,i,e,n,a,r){super(t,i,e,"number"),this._initInput(),this.min(n),this.max(a);const d=r!==void 0;this.step(d?r:this._getImplicitStep(),d),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,i=!0){return this._step=t,this._stepExplicit=i,this}updateDisplay(){const t=this.getValue();if(this._hasSlider){let i=(t-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=100*i+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input;const t=s=>{const p=parseFloat(this.$input.value);isNaN(p)||(this._snapClampSetValue(p+s),this.$input.value=this.getValue())};let i,e,n,a,r,d=!1;const h=s=>{if(d){const p=s.clientX-i,o=s.clientY-e;Math.abs(o)>5?(s.preventDefault(),this.$input.blur(),d=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(p)>5&&c()}if(!d){const p=s.clientY-n;r-=p*this._step*this._arrowKeyMultiplier(s),a+r>this._max?r=this._max-a:a+r{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",c)};this.$input.addEventListener("input",()=>{let s=parseFloat(this.$input.value);isNaN(s)||(this._stepExplicit&&(s=this._snap(s)),this.setValue(this._clamp(s)))}),this.$input.addEventListener("keydown",s=>{s.code==="Enter"&&this.$input.blur(),s.code==="ArrowUp"&&(s.preventDefault(),t(this._step*this._arrowKeyMultiplier(s))),s.code==="ArrowDown"&&(s.preventDefault(),t(this._step*this._arrowKeyMultiplier(s)*-1))}),this.$input.addEventListener("wheel",s=>{this._inputFocused&&(s.preventDefault(),t(this._step*this._normalizeMouseWheel(s)))},{passive:!1}),this.$input.addEventListener("mousedown",s=>{i=s.clientX,e=n=s.clientY,d=!0,a=this.getValue(),r=0,window.addEventListener("mousemove",h),window.addEventListener("mouseup",c)}),this.$input.addEventListener("focus",()=>{this._inputFocused=!0}),this.$input.addEventListener("blur",()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()})}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const t=o=>{const g=this.$slider.getBoundingClientRect();let b=(x=o,v=g.left,y=g.right,A=this._min,_=this._max,(x-v)/(y-v)*(_-A)+A);var x,v,y,A,_;this._snapClampSetValue(b)},i=o=>{t(o.clientX)},e=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",e)};let n,a,r=!1;const d=o=>{o.preventDefault(),this._setDraggingStyle(!0),t(o.touches[0].clientX),r=!1},h=o=>{if(r){const g=o.touches[0].clientX-n,b=o.touches[0].clientY-a;Math.abs(g)>Math.abs(b)?d(o):(window.removeEventListener("touchmove",h),window.removeEventListener("touchend",c))}else o.preventDefault(),t(o.touches[0].clientX)},c=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",h),window.removeEventListener("touchend",c)},s=this._callOnFinishChange.bind(this);let p;this.$slider.addEventListener("mousedown",o=>{this._setDraggingStyle(!0),t(o.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",e)}),this.$slider.addEventListener("touchstart",o=>{o.touches.length>1||(this._hasScrollBar?(n=o.touches[0].clientX,a=o.touches[0].clientY,r=!0):d(o),window.addEventListener("touchmove",h,{passive:!1}),window.addEventListener("touchend",c))},{passive:!1}),this.$slider.addEventListener("wheel",o=>{if(Math.abs(o.deltaX)this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){const t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class M extends u{constructor(t,i,e,n){super(t,i,e,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(n)?n:Object.values(n),this._names=Array.isArray(n)?n:Object.keys(n),this._names.forEach(a=>{const r=document.createElement("option");r.innerHTML=a,this.$select.appendChild(r)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){const t=this.getValue(),i=this._values.indexOf(t);return this.$select.selectedIndex=i,this.$display.innerHTML=i===-1?t:this._names[i],this}}class H extends u{constructor(t,i,e){super(t,i,e,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}let $=!1;class E{constructor({parent:t,autoPlace:i=t===void 0,container:e,width:n,title:a="Controls",injectStyles:r=!0,touchStyles:d=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",h=>{h.code!=="Enter"&&h.code!=="Space"||(h.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(a),d&&this.domElement.classList.add("allow-touch-styles"),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),!$&&r&&(function(h){const c=document.createElement("style");c.innerHTML=h;const s=document.querySelector("head link[rel=stylesheet], head style");s?document.head.insertBefore(c,s):document.head.appendChild(c)}('.lil-gui{--background-color:#1f1f1f;--text-color:#ebebeb;--title-background-color:#111;--title-text-color:#ebebeb;--widget-color:#424242;--hover-color:#4f4f4f;--focus-color:#595959;--number-color:#2cc9ff;--string-color:#a2db3c;--font-size:11px;--input-font-size:11px;--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;--font-family-mono:Menlo,Monaco,Consolas,"Droid Sans Mono",monospace;--padding:4px;--spacing:4px;--widget-height:20px;--name-width:45%;--slider-knob-width:2px;--slider-input-width:27%;--color-input-width:27%;--slider-input-min-width:45px;--color-input-min-width:45px;--folder-indent:7px;--widget-padding:0 0 0 3px;--widget-border-radius:2px;--checkbox-size:calc(var(--widget-height)*0.75);--scrollbar-width:5px;background-color:var(--background-color);color:var(--text-color);font-family:var(--font-family);font-size:var(--font-size);font-style:normal;font-weight:400;line-height:1;text-align:left;touch-action:manipulation;user-select:none;-webkit-user-select:none}.lil-gui,.lil-gui *{box-sizing:border-box;margin:0;padding:0}.lil-gui.root{display:flex;flex-direction:column;width:var(--width,245px)}.lil-gui.root>.title{background:var(--title-background-color);color:var(--title-text-color)}.lil-gui.root>.children{overflow-x:hidden;overflow-y:auto}.lil-gui.root>.children::-webkit-scrollbar{background:var(--background-color);height:var(--scrollbar-width);width:var(--scrollbar-width)}.lil-gui.root>.children::-webkit-scrollbar-thumb{background:var(--focus-color);border-radius:var(--scrollbar-width)}.lil-gui.force-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}.lil-gui.autoPlace{max-height:100%;position:fixed;right:15px;top:0;z-index:1001}.lil-gui .controller{align-items:center;display:flex;margin:var(--spacing) 0;padding:0 var(--padding)}.lil-gui .controller.disabled{opacity:.5}.lil-gui .controller.disabled,.lil-gui .controller.disabled *{pointer-events:none!important}.lil-gui .controller>.name{flex-shrink:0;line-height:var(--widget-height);min-width:var(--name-width);padding-right:var(--spacing);white-space:pre}.lil-gui .controller .widget{align-items:center;display:flex;min-height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.string input{color:var(--string-color)}.lil-gui .controller.boolean .widget{cursor:pointer}.lil-gui .controller.color .display{border-radius:var(--widget-border-radius);height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.color input[type=color]{cursor:pointer;height:100%;opacity:0;width:100%}.lil-gui .controller.color input[type=text]{flex-shrink:0;font-family:var(--font-family-mono);margin-left:var(--spacing);min-width:var(--color-input-min-width);width:var(--color-input-width)}.lil-gui .controller.option select{max-width:100%;opacity:0;position:absolute;width:100%}.lil-gui .controller.option .display{background:var(--widget-color);border-radius:var(--widget-border-radius);height:var(--widget-height);line-height:var(--widget-height);max-width:100%;overflow:hidden;padding-left:.55em;padding-right:1.75em;pointer-events:none;position:relative;word-break:break-all}.lil-gui .controller.option .display.active{background:var(--focus-color)}.lil-gui .controller.option .display:after{bottom:0;content:"↕";font-family:lil-gui;padding-right:.375em;position:absolute;right:0;top:0}.lil-gui .controller.option .widget,.lil-gui .controller.option select{cursor:pointer}.lil-gui .controller.number input{color:var(--number-color)}.lil-gui .controller.number.hasSlider input{flex-shrink:0;margin-left:var(--spacing);min-width:var(--slider-input-min-width);width:var(--slider-input-width)}.lil-gui .controller.number .slider{background-color:var(--widget-color);border-radius:var(--widget-border-radius);cursor:ew-resize;height:var(--widget-height);overflow:hidden;padding-right:var(--slider-knob-width);touch-action:pan-y;width:100%}.lil-gui .controller.number .slider.active{background-color:var(--focus-color)}.lil-gui .controller.number .slider.active .fill{opacity:.95}.lil-gui .controller.number .fill{border-right:var(--slider-knob-width) solid var(--number-color);box-sizing:content-box;height:100%}.lil-gui-dragging .lil-gui{--hover-color:var(--widget-color)}.lil-gui-dragging *{cursor:ew-resize!important}.lil-gui-dragging.lil-gui-vertical *{cursor:ns-resize!important}.lil-gui .title{--title-height:calc(var(--widget-height) + var(--spacing)*1.25);-webkit-tap-highlight-color:transparent;text-decoration-skip:objects;cursor:pointer;font-weight:600;height:var(--title-height);line-height:calc(var(--title-height) - 4px);outline:none;padding:0 var(--padding)}.lil-gui .title:before{content:"▾";display:inline-block;font-family:lil-gui;padding-right:2px}.lil-gui .title:active{background:var(--title-background-color);opacity:.75}.lil-gui.root>.title:focus{text-decoration:none!important}.lil-gui.closed>.title:before{content:"▸"}.lil-gui.closed>.children{opacity:0;transform:translateY(-7px)}.lil-gui.closed:not(.transition)>.children{display:none}.lil-gui.transition>.children{overflow:hidden;pointer-events:none;transition-duration:.3s;transition-property:height,opacity,transform;transition-timing-function:cubic-bezier(.2,.6,.35,1)}.lil-gui .children:empty:before{content:"Empty";display:block;font-style:italic;height:var(--widget-height);line-height:var(--widget-height);margin:var(--spacing) 0;opacity:.5;padding:0 var(--padding)}.lil-gui.root>.children>.lil-gui>.title{border-width:0;border-bottom:1px solid var(--widget-color);border-left:0 solid var(--widget-color);border-right:0 solid var(--widget-color);border-top:1px solid var(--widget-color);transition:border-color .3s}.lil-gui.root>.children>.lil-gui.closed>.title{border-bottom-color:transparent}.lil-gui+.controller{border-top:1px solid var(--widget-color);margin-top:0;padding-top:var(--spacing)}.lil-gui .lil-gui .lil-gui>.title{border:none}.lil-gui .lil-gui .lil-gui>.children{border:none;border-left:2px solid var(--widget-color);margin-left:var(--folder-indent)}.lil-gui .lil-gui .controller{border:none}.lil-gui input{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:0;border-radius:var(--widget-border-radius);color:var(--text-color);font-family:var(--font-family);font-size:var(--input-font-size);height:var(--widget-height);outline:none;width:100%}.lil-gui input:disabled{opacity:1}.lil-gui input[type=number],.lil-gui input[type=text]{padding:var(--widget-padding)}.lil-gui input[type=number]:focus,.lil-gui input[type=text]:focus{background:var(--focus-color)}.lil-gui input::-webkit-inner-spin-button,.lil-gui input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.lil-gui input[type=number]{-moz-appearance:textfield}.lil-gui input[type=checkbox]{appearance:none;-webkit-appearance:none;border-radius:var(--widget-border-radius);cursor:pointer;height:var(--checkbox-size);text-align:center;width:var(--checkbox-size)}.lil-gui input[type=checkbox]:checked:before{content:"✓";font-family:lil-gui;font-size:var(--checkbox-size);line-height:var(--checkbox-size)}.lil-gui button{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:1px solid var(--widget-color);border-radius:var(--widget-border-radius);color:var(--text-color);cursor:pointer;font-family:var(--font-family);font-size:var(--font-size);height:var(--widget-height);line-height:calc(var(--widget-height) - 4px);outline:none;text-align:center;text-transform:none;width:100%}.lil-gui button:active{background:var(--focus-color)}@font-face{font-family:lil-gui;src:url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/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Vj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff")}@media (pointer:coarse){.lil-gui.allow-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}}@media (hover:hover){.lil-gui .controller.color .display:hover:before{border:1px solid #fff9;border-radius:var(--widget-border-radius);bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.lil-gui .controller.option .display.focus{background:var(--focus-color)}.lil-gui .controller.option .widget:hover .display{background:var(--hover-color)}.lil-gui .controller.number .slider:hover{background-color:var(--hover-color)}body:not(.lil-gui-dragging) .lil-gui .title:hover{background:var(--title-background-color);opacity:.85}.lil-gui .title:focus{text-decoration:underline var(--focus-color)}.lil-gui input:hover{background:var(--hover-color)}.lil-gui input:active{background:var(--focus-color)}.lil-gui input[type=checkbox]:focus{box-shadow:inset 0 0 0 1px var(--focus-color)}.lil-gui button:hover{background:var(--hover-color);border-color:var(--hover-color)}.lil-gui button:focus{border-color:var(--focus-color)}}'),$=!0),e?e.appendChild(this.domElement):i&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this.domElement.addEventListener("keydown",h=>h.stopPropagation()),this.domElement.addEventListener("keyup",h=>h.stopPropagation())}add(t,i,e,n,a){if(Object(e)===e)return new M(this,t,i,e);const r=t[i];switch(typeof r){case"number":return new V(this,t,i,e,n,a);case"boolean":return new C(this,t,i);case"string":return new H(this,t,i);case"function":return new f(this,t,i)}console.error(`gui.add failed + property:`,i,` + object:`,t,` + value:`,r)}addColor(t,i,e=1){return new F(this,t,i,e)}addFolder(t){return new E({parent:this,title:t})}load(t,i=!0){return t.controllers&&this.controllers.forEach(e=>{e instanceof f||e._name in t.controllers&&e.load(t.controllers[e._name])}),i&&t.folders&&this.folders.forEach(e=>{e._title in t.folders&&e.load(t.folders[e._title])}),this}save(t=!0){const i={controllers:{},folders:{}};return this.controllers.forEach(e=>{if(!(e instanceof f)){if(e._name in i.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);i.controllers[e._name]=e.save()}}),t&&this.folders.forEach(e=>{if(e._title in i.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);i.folders[e._title]=e.save()}),i}open(t=!0){return this._closed=!t,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._closed=!t,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const i=this.$children.clientHeight;this.$children.style.height=i+"px",this.domElement.classList.add("transition");const e=a=>{a.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",e))};this.$children.addEventListener("transitionend",e);const n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.innerHTML=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(i=>{t=t.concat(i.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(i=>{t=t.concat(i.foldersRecursive())}),t}}export{E as g}; diff --git a/example/bundle/assets/mars-Dgxnnstm.js b/example/bundle/assets/mars-Dgxnnstm.js new file mode 100644 index 00000000..23f6efcd --- /dev/null +++ b/example/bundle/assets/mars-Dgxnnstm.js @@ -0,0 +1 @@ +import{ae as f,S as h,W as x,a as B,D as P,A as S,G as T}from"./three.module-_fL2BuBc.js";import{g as y}from"./lil-gui.module.min-Bc0DeA9g.js";import{E as C}from"./EnvironmentControls-CJG7lPg-.js";import{T as m}from"./TilesRenderer-DkGmB3Pz.js";import{d as p}from"./DebugTilesPlugin-Bz8-pW4a.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./EllipsoidRegionHelper-B2BBEUen.js";let t,a,n,o,e,i;const r={errorTarget:12,displayBoxBounds:!1,fog:!1};R();g();function R(){const u=new f(14208704,.0075,250);n=new h,o=new x({antialias:!0}),o.setPixelRatio(window.devicePixelRatio),o.setSize(window.innerWidth,window.innerHeight),o.setClearColor(14208704),document.body.appendChild(o.domElement),o.domElement.tabIndex=1,t=new B(60,window.innerWidth/window.innerHeight,1,4e3),t.position.set(20,10,20),t.lookAt(0,0,0),a=new C(n,t,o.domElement),a.minZoomDistance=2,a.cameraRadius=1;const l=new P(16777215);l.position.set(1,2,3),n.add(l);const w=new S(16777215,.2);n.add(w);const d=new T;d.rotation.set(Math.PI/2,0,0),n.add(d),e=new m("https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize_tileset.json"),e.registerPlugin(new p),e.fetchOptions.mode="cors",e.lruCache.minSize=900,e.lruCache.maxSize=1300,e.errorTarget=12,i=new m("https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_sky/0528_0260184_to_s64o256_sky_tileset.json"),i.registerPlugin(new p),i.fetchOptions.mode="cors",i.lruCache=e.lruCache,d.add(e.group,i.group),c(),window.addEventListener("resize",c,!1);const s=new y;s.add(r,"fog").onChange(_=>{n.fog=_?u:null}),s.add(r,"displayBoxBounds"),s.add(r,"errorTarget",0,100),s.open()}function c(){t.aspect=window.innerWidth/window.innerHeight,t.updateProjectionMatrix(),o.setSize(window.innerWidth,window.innerHeight),o.setPixelRatio(window.devicePixelRatio)}function g(){requestAnimationFrame(g),a.update(),t.updateMatrixWorld(),e.errorTarget=r.errorTarget,e.getPluginByName("DEBUG_TILES_PLUGIN").displayBoxBounds=r.displayBoxBounds,i.getPluginByName("DEBUG_TILES_PLUGIN").displayBoxBounds=r.displayBoxBounds,e.setCamera(t),e.setResolutionFromRenderer(t,o),e.update(),i.setCamera(t),i.setResolutionFromRenderer(t,o),i.update(),o.render(n,t)} diff --git a/example/bundle/assets/metadata-BqRGFOIs.js b/example/bundle/assets/metadata-BqRGFOIs.js new file mode 100644 index 00000000..3432d285 --- /dev/null +++ b/example/bundle/assets/metadata-BqRGFOIs.js @@ -0,0 +1,172 @@ +import{W as Y,S as $,a as G,D as j,A as V,G as N,V as W,R as k,k as L,am as X,d as z}from"./three.module-_fL2BuBc.js";import{g as O}from"./lil-gui.module.min-Bc0DeA9g.js";import{E as B}from"./EnvironmentControls-CJG7lPg-.js";import{T as K}from"./TilesRenderer-DkGmB3Pz.js";import{C as q}from"./CesiumIonAuthPlugin-3uWD2B4J.js";import{G as Z}from"./GLTFExtensionsPlugin-DuLOiCt_.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";import"./GoogleCloudAuthPlugin-BapiqItz.js";const J=i=>class extends i{get featureTexture(){return this.uniforms.featureTexture.value}set featureTexture(e){const t=this.uniforms.featureTexture.value;t!==e&&t&&t.dispose(),this.uniforms.featureTexture.value=e}get nullFeatureId(){return this.uniforms.nullFeatureId.value}set nullFeatureId(e){e<0||e===null||e===void 0?(this.uniforms.nullFeatureId.value=null,this.setDefine("USE_NULL_FEATURE",0)):(this.uniforms.nullFeatureId.value=e,this.setDefine("USE_NULL_FEATURE",1))}get highlightFeatureId(){return this.uniforms.highlightFeatureId.value}set highlightFeatureId(e){e==null?(this.uniforms.highlightFeatureId.value=null,this.setDefine("USE_HIGHLIGHT_FEATURE",0)):(this.uniforms.highlightFeatureId.value=e,this.setDefine("USE_HIGHLIGHT_FEATURE",1))}constructor(...e){super(...e),this.isMeshFeaturesMaterial=!0,this.uniforms={featureChannelsLength:{value:0},featureChannels:{value:new Array(4).fill(0)},featureTexture:{value:null},nullFeatureId:{value:null},highlightFeatureId:{value:-1}},Object.assign(this.defines,{FEATURE_TYPE:0,USE_HIGHLIGHT_FEATURE:0,USE_NULL_FEATURE:0,FEATURE_ATTR:"",FEATURE_TEXTURE_ATTR:"uv"}),this.addEventListener("dispose",()=>{this.featureTexture&&this.featureTexture.dispose()})}copy(e){const t=this.defines;if(super.copy(e),e.defines&&Object.assign(this.defines,t,e.defines),e.uniforms)for(const r in this.uniforms){const a=e.uniforms[r].value;Array.isArray(a)?this.uniforms[r].value=a.slice():this.uniforms[r].value=a}this.needsUpdate=!0}setDefine(e,t){const r=this.defines;r[e]!==t&&(this.needsUpdate=!0),t===null?delete r[e]:r[e]=t}setFromMeshFeatures(e,t){let r=null;typeof t=="number"?r=e.getFeatureInfo()[t]||null:typeof t=="string"&&(r=e.getFeatureInfo().find(a=>a.label===t)||null),r===null?(this.setDefine("FEATURE_TYPE",0),this.featureTexture=null):"attribute"in r?this._setAttributeFeature(r.attribute):"texture"in r?this._setTextureFeature(e.textures[r.texture.index],r.texture.texCoord,r.texture.channels):this._setAttributeFeature(null),r!==null&&(this.nullFeatureId=r.nullFeatureId==null?null:r.nullFeatureId)}disableFeatureDisplay(){this.setDefine("FEATURE_TYPE",0),this.featureTexture=null}_setTextureFeature(e,t,r){const a=this.uniforms;this.setDefine("FEATURE_TYPE",3),t===0?(this.setDefine("FEATURE_TEXTURE_ATTR","uv"),this.setDefine("USE_UV","")):(this.setDefine("FEATURE_TEXTURE_ATTR",`uv${t}`),this.setDefine(`USE_UV${t}`,"")),t!==0&&this.setDefine("USE_UV",null),t!==1&&this.setDefine("USE_UV1",null),t!==2&&this.setDefine("USE_UV2",null),t!==3&&this.setDefine("USE_UV3",null),a.featureChannelsLength.value=r.length,a.featureChannels.value=[...r],this.featureTexture=e}_setAttributeFeature(e=null){e===null?this.setDefine("FEATURE_TYPE",1):(this.setDefine("FEATURE_TYPE",2),this.setDefine("FEATURE_ATTR",`_feature_id_${e}`)),this.featureTexture=null}customProgramCacheKey(){const e=this.defines;return`${e.FEATURE_TYPE}|${e.USE_HIGHLIGHT_FEATURE}|${e.USE_NULL_FEATURE}|${e.FEATURE_ATTR}|${e.FEATURE_TEXTURE_ATTR}`}onBeforeCompile(e){e.uniforms={...e.uniforms,...this.uniforms},e.defines=this.defines,e.vertexShader=e.vertexShader.replace(/^/,t=>` + // texture + #if FEATURE_TYPE == 3 + + varying vec2 _feature_uv; + + // attribute + #elif FEATURE_TYPE == 2 + + attribute float FEATURE_ATTR; + flat varying uint _feature_attr; + + // implicit + #elif FEATURE_TYPE == 1 + + flat varying uint _feature_attr; + + #endif + + ${t} + `).replace(/void main\(\) {/,t=>` + ${t} + + // texture + #if FEATURE_TYPE == 3 + + _feature_uv = FEATURE_TEXTURE_ATTR; + + // attribute + #elif FEATURE_TYPE == 2 + + _feature_attr = uint( FEATURE_ATTR ); + + // none + #elif FEATURE_TYPE == 1 + + _feature_attr = uint( gl_VertexID ); + + #endif + `),e.fragmentShader=e.fragmentShader.replace(/^/,t=>` + + #if USE_HIGHLIGHT_FEATURE + + uniform uint highlightFeatureId; + + #endif + + #if USE_NULL_FEATURE + + uniform uint nullFeatureId; + + #endif + + // texture + #if FEATURE_TYPE == 3 + + uniform sampler2D featureTexture; + uniform int featureChannelsLength; + uniform uint featureChannels[ 4 ]; + varying vec2 _feature_uv; + + // attribute + #elif FEATURE_TYPE == 2 + + flat varying uint _feature_attr; + + // none + #elif FEATURE_TYPE == 1 + + flat varying uint _feature_attr; + + #endif + + // https://www.shadertoy.com/view/XljGzV + vec3 hsl2rgb( in vec3 c ) { + + vec3 rgb = clamp( abs( mod( c.x * 6.0 + vec3( 0.0, 4.0, 2.0 ), 6.0 ) - 3.0 ) - 1.0, 0.0, 1.0 ); + return c.z + c.y * ( rgb - 0.5 ) * ( 1.0 - abs( 2.0 * c.z - 1.0 ) ); + + } + + // https://stackoverflow.com/questions/4200224/random-noise-functions-for-glsl + float rand( float v ) { + + return fract( sin( dot( vec2( v, v ), vec2( 12.9898, 78.233 ) ) ) * 43758.5453 ); + + } + + vec3 randFeatureColor( uint feature ) { + + vec3 hsl; + hsl.r = rand( float( feature ) / 5500.0 ); + hsl.g = 0.75; + hsl.b = 0.5; + return hsl2rgb( hsl ); + + } + + ${t} + `).replace(/#include /,t=>` + ${t} + + // disabled + #if FEATURE_TYPE != 0 + + uint featureId = 0u; + + // texture + #if FEATURE_TYPE == 3 + + // TODO: support anti aliasing here at the pixel edges + uvec4 fields = uvec4( texture( featureTexture, _feature_uv ) * float( 0xff ) ); + for ( int i = 0; i < min( featureChannelsLength, 4 ); i ++ ) { + + uint offset = 8u * featureChannels[ i ]; + featureId = featureId | ( fields[ i ] << offset ); + + } + + // attribute + #elif FEATURE_TYPE == 2 + + featureId = _feature_attr; + + // implicit + #elif FEATURE_TYPE == 1 + + featureId = _feature_attr; + + #endif + + #if USE_HIGHLIGHT_FEATURE + + if ( highlightFeatureId != featureId ) { + + diffuseColor.rgb *= 0.25; + + } + + #else + + vec3 featureColor = randFeatureColor( featureId ); + diffuseColor.rgb = mix( diffuseColor.rgb * featureColor, featureColor, 0.05 ); + + #endif + + #if USE_NULL_FEATURE + + if ( nullFeatureId == featureId ) { + + diffuseColor.rgb *= vec3( 0.0 ); + + } + + #endif + + #endif + + `)}};let h,p,g,T,I,f,A,_,R,U,w=!1,c=null,v=!1;const b=new W(-1,-1),y=new k;y.firstHitOnly=!0;y.params.Points.threshold=.05;const Q=localStorage.getItem("ionApiKey")??"put-your-api-key-here",l={accessToken:Q,assetId:2333904,reload:()=>{P()},featureIndex:0,propertyTexture:0,highlightAllFeatures:!1};ee();H();function ee(){_=document.getElementById("meshFeatures"),R=document.getElementById("structuralMetadata"),T=new Y({antialias:!0}),T.setPixelRatio(window.devicePixelRatio),T.setSize(window.innerWidth,window.innerHeight),T.setClearColor(1383455),document.body.appendChild(T.domElement),g=new $,h=new G(60,window.innerWidth/window.innerHeight,.1,5e3),h.position.set(-4,2,0).multiplyScalar(30),h.lookAt(0,0,0),p=new B(g,h,T.domElement),p.minDistance=.1,p.cameraRadius=.1,p.minAltitude=0,p.maxAltitude=Math.PI,p.adjustHeight=!1,p.addEventListener("start",()=>w=!0),p.addEventListener("end",()=>w=!1),I=new j(16777215,3.3),I.position.set(1,2,3).multiplyScalar(40),g.add(I),g.add(new V(16777215,1)),A=new N,A.position.y=40,g.add(A),P(),S(),window.addEventListener("resize",S,!1),window.addEventListener("pointermove",i=>{b.x=i.clientX/window.innerWidth*2-1,b.y=-(i.clientY/window.innerHeight)*2+1})}function te(){U&&U.destroy(),U=new O;const i=U.addFolder("ion");i.add(l,"accessToken"),i.add(l,"assetId",[2333904,2342602]).onChange(P),i.add(l,"reload");const e=U.addFolder("features");l.assetId===2333904?(e.add(l,"featureIndex",[0,1]),e.add(l,"highlightAllFeatures")):e.add(l,"propertyTexture",{NONE:0,HORIZ_UNCERTAINTY:1,VERT_UNCERTAINTY:2})}function P(){f&&(f.dispose(),f.group.removeFromParent()),localStorage.setItem("ionApiKey",l.accessToken),f=new K,f.registerPlugin(new q({apiToken:l.accessToken,assetId:l.assetId})),f.registerPlugin(new Z({metadata:!0})),f.setCamera(h),A.add(f.group),f.addEventListener("load-model",({scene:i})=>{i.traverse(e=>{if(e.material&&e.userData.meshFeatures){const t=J(e.material.constructor),r=new t;r.copy(e.material),r.metalness=0,e.material=r}e.material&&e.userData.structuralMetadata&&(e.material.originalMap=e.material.map)})}),te()}function S(){h.aspect=window.innerWidth/window.innerHeight,T.setPixelRatio(window.devicePixelRatio),T.setSize(window.innerWidth,window.innerHeight),h.updateProjectionMatrix()}function C(i,e,t,r=null,a=null,d=null){if(R.innerText=`STRUCTURAL_METADATA +`,a!==null){const u=i.getPropertyTableData(a,d);n(u,i.getPropertyTableInfo(a))}r!==null&&n(i.getPropertyAttributeData(r),i.getPropertyAttributeInfo()),n(i.getPropertyTextureData(e,t),i.getPropertyTextureInfo());function n(u,s){const o=Math.max(...Object.values(u).flatMap(m=>Object.keys(m)).map(m=>m.length));for(const m in u){R.innerText+=` +${s[m].name||s[m].className} +`;const F=u[m];for(const D in F){let E=F[D];E&&E.toArray&&(E=E.toArray()),E&&E.join&&(E=` +`+E.map(x=>x.toFixed?parseFloat(x.toFixed(6)):x).map((x,M)=>` [${M}] ${x}`).join(` +`)),typeof E=="number"&&(E=parseFloat(E.toFixed(6))),R.innerText+=` ${D.padEnd(o+1)} : ${E} +`}}}}function re(){if(v||w)return;y.setFromCamera(b,h);const i=y.intersectObject(g)[0];if(i){const{object:e,face:t,point:r,index:a,faceIndex:d}=i,n=new L;if(t){const s=new X;s.setFromAttributeAndIndices(e.geometry.attributes.position,t.a,t.b,t.c),s.a.applyMatrix4(e.matrixWorld),s.b.applyMatrix4(e.matrixWorld),s.c.applyMatrix4(e.matrixWorld),s.getBarycoord(r,n)}else n.set(0,0,0);const{meshFeatures:u}=i.object.userData;u?(v=!0,u.getFeaturesAsync(d,n).then(s=>{v=!1,c={index:a,features:s,faceIndex:d,barycoord:n,object:e}})):c={index:a,features:null,faceIndex:d,barycoord:n,object:e}}else c=null}function ie(){const{featureIndex:i}=l;let e=null,t=null,r=null;if(c&&(e=c.object.userData.meshFeatures,t=c.object.userData.structuralMetadata,r=c.features),e!==null&&r!==null){const{index:a,faceIndex:d,barycoord:n}=c;if(_.innerText=`EXT_MESH_FEATURES + +`,_.innerText+=`feature : ${r.map(u=>u+"").join(", ")} +`,_.innerText+=`texture memory : ${T.info.memory.textures} +`,t!==null){const s=e.getFeatureInfo().map(o=>o.propertyTable);C(t,d,n,a,s,r)}}else if(_.innerText=`EXT_MESH_FEATURES + +`,_.innerText+=`feature : - +`,_.innerText+=`texture memory : ${T.info.memory.textures}`,t!==null){const{index:a,faceIndex:d,barycoord:n}=c;C(t,d,n,a)}else R.innerText="";f.forEachLoadedModel(a=>a.traverse(d=>{const n=d.material,{meshFeatures:u,structuralMetadata:s}=d.userData;if(n&&u)if(l.highlightAllFeatures)n.setFromMeshFeatures(u,i),n.highlightFeatureId=null;else if(c===null)n.disableFeatureDisplay();else{const o=r[i];n.setFromMeshFeatures(u,i),n.highlightFeatureId=o===null?-1:o}if(n&&s&&s.textureAccessors.length>0){let o=null;if(l.propertyTexture===0)o=n.originalMap;else if(l.propertyTexture===1){const F=s.getPropertyTextureInfo()[0].properties.r3dm_uncertainty_ce90sum;o=s.textures[F.index],o.channel=F.texCoord}else if(l.propertyTexture===2){const F=s.getPropertyTextureInfo()[1].properties.r3dm_uncertainty_le90sum;o=s.textures[F.index],o.channel=F.texCoord}n.map!==o&&(n.map=o,n.needsUpdate=!0)}}))}function H(){requestAnimationFrame(H),p.update(),h.updateMatrixWorld(),ie(),re();const i=new z,e=new L(0,1,0);f.getBoundingSphere(i),f.group.position.copy(i.center).multiplyScalar(-1),A.quaternion.setFromUnitVectors(i.center.normalize(),e),f.setResolutionFromRenderer(h,T),f.update(),T.render(g,h)} diff --git a/example/bundle/assets/offscreenShadows-CLFPJWAu.js b/example/bundle/assets/offscreenShadows-CLFPJWAu.js new file mode 100644 index 00000000..4e5a1abe --- /dev/null +++ b/example/bundle/assets/offscreenShadows-CLFPJWAu.js @@ -0,0 +1 @@ +import{S as b,W as R,P,a as y,O as v,D as T,A as W,G as A,M as L,B as D,d as E}from"./three.module-_fL2BuBc.js";import{O}from"./OrbitControls-Ck5AM9Mk.js";import{g as z}from"./lil-gui.module.min-Bc0DeA9g.js";import{S as B}from"./stats.module--VATS4Kh.js";import{T as H}from"./TilesRenderer-DkGmB3Pz.js";import"./I3DMLoader-QCOT_FZM.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";import"./GLTFLoader-CFm4138C.js";import"./Ellipsoid-CKpUFSOi.js";import"./B3DMLoader-s-i-FwTx.js";import"./PNTSLoader-ClFH5U_K.js";import"./CMPTLoader-DW6cWF_V.js";import"./GLTFExtensionLoader-BffG-g_T.js";import"./EllipsoidRegion-CVV0HJli.js";let a,p,m,i,e,t,d,c,h,r,w;const u=0,g=1,S=2,s={errorTarget:2,shadowStrategy:u,orthographic:!1};I();x();function F({scene:o}){o.traverse(n=>{n.isMesh&&(n.material=new L,n.castShadow=!0,n.receiveShadow=!0)})}function j(o){o.traverse(n=>{n.isMesh&&n.material.dispose()})}function I(){m=new b,i=new R({antialias:!0}),i.setPixelRatio(window.devicePixelRatio),i.setSize(window.innerWidth,window.innerHeight),i.setClearColor(1383455),i.shadowMap.enabled=!0,i.shadowMap.type=P,document.body.appendChild(i.domElement),a=new y(60,window.innerWidth/window.innerHeight,1,4e3),a.position.set(-56,232,260),t=new v,p=new O(a,i.domElement),p.screenSpacePanning=!1,p.minDistance=1,p.maxDistance=2e3,r=new T(16777215,1.25),r.position.set(-100,40,10),r.castShadow=!0,r.shadow.bias=-1e-4,r.shadow.normalBias=.2,r.shadow.mapSize.setScalar(2048);const o=r.shadow.camera;o.left=-120,o.bottom=-120,o.right=120,o.top=120,o.updateProjectionMatrix(),m.add(r);const n=new W(16777215,.05);m.add(n),c=new D,h=new E,d=new A,m.add(d);const M=window.location.hash.replace(/^#/,"")||"../data/tileset.json";e=new H(M),e.addEventListener("load-model",F),e.addEventListener("dispose-model",j),d.add(e.group),f(),window.addEventListener("resize",f,!1);const l=new z;l.width=300,l.add(s,"orthographic"),l.add(s,"errorTarget").min(0).max(25).step(1),l.add(s,"shadowStrategy",{NONE:u,DISPLAY_ACTIVE_TILES:g,USE_SHADOW_CAMERA:S}),l.open(),w=new B,w.showPanel(0),document.body.appendChild(w.dom)}function f(){a.aspect=window.innerWidth/window.innerHeight,i.setPixelRatio(window.devicePixelRatio),i.setSize(window.innerWidth,window.innerHeight),a.updateProjectionMatrix(),C()}function C(){t.position.copy(a.position),t.rotation.copy(a.rotation);const o=a.position.distanceTo(p.target)/2,n=window.innerWidth/window.innerHeight;t.left=-n*o,t.right=n*o,t.bottom=-o,t.top=o,t.near=a.near,t.far=a.far,t.updateProjectionMatrix()}function x(){switch(requestAnimationFrame(x),e.errorTarget=s.errorTarget,parseFloat(s.shadowStrategy)){case u:e.displayActiveTiles=!1,e.autoDisableRendererCulling=!0,e.deleteCamera(r.shadow.camera);break;case g:e.displayActiveTiles=!0,e.autoDisableRendererCulling=!1,e.deleteCamera(r.shadow.camera);break;case S:e.displayActiveTiles=!1,e.autoDisableRendererCulling=!1,e.setCamera(r.shadow.camera),e.setResolution(r.shadow.camera,r.shadow.mapSize);break}s.orthographic?(e.deleteCamera(a),e.setCamera(t),e.setResolutionFromRenderer(t,i)):(e.deleteCamera(t),e.setCamera(a),e.setResolutionFromRenderer(a,i)),d.rotation.set(0,0,0),s.up==="-Z"&&(d.rotation.x=Math.PI/2),d.updateMatrixWorld(!0),e.getBoundingBox(c)?(c.getCenter(e.group.position),e.group.position.multiplyScalar(-1)):e.getBoundingSphere(h)&&(e.group.position.copy(h.center),e.group.position.multiplyScalar(-1)),window.tiles=e,a.updateMatrixWorld(),t.updateMatrixWorld(),e.update(),_(),w.update()}function _(){C(),i.render(m,s.orthographic?t:a)} diff --git a/example/bundle/assets/pntsExample-DqiqTF1M.js b/example/bundle/assets/pntsExample-DqiqTF1M.js new file mode 100644 index 00000000..4e21f37e --- /dev/null +++ b/example/bundle/assets/pntsExample-DqiqTF1M.js @@ -0,0 +1 @@ +import{S as c,W as m,P as l,a as h,D as p,A as f}from"./three.module-_fL2BuBc.js";import{O as u}from"./OrbitControls-Ck5AM9Mk.js";import{P as S}from"./PNTSLoader-ClFH5U_K.js";import"./readMagicBytes-Da5ueiou.js";import"./LoaderBase-CVSPpjX2.js";let n,a,o,e,i;g();d();function g(){o=new c,e=new m({antialias:!0}),e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),e.setClearColor(1383455),e.shadowMap.enabled=!0,e.shadowMap.type=l,document.body.appendChild(e.domElement),n=new h(60,window.innerWidth/window.innerHeight,1,4e3),n.position.set(2,2,2),a=new u(n,e.domElement),a.screenSpacePanning=!1,a.minDistance=1,a.maxDistance=2e3,i=new p(16777215,1.25),i.position.set(1,2,3).multiplyScalar(40),i.castShadow=!0,i.shadow.bias=-.01,i.shadow.mapSize.setScalar(2048);const t=i.shadow.camera;t.left=-200,t.bottom=-200,t.right=200,t.top=200,t.updateProjectionMatrix(),o.add(i);const w=new f(16777215,.05);o.add(w),new S().loadAsync("https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/main/1.0/TilesetWithRequestVolume/points.pnts").then(s=>{console.log(s),o.add(s.scene)}),r(),window.addEventListener("resize",r,!1)}function r(){n.aspect=window.innerWidth/window.innerHeight,e.setPixelRatio(window.devicePixelRatio),e.setSize(window.innerWidth,window.innerHeight),n.updateProjectionMatrix()}function d(){requestAnimationFrame(d),P()}function P(){e.render(o,n)} diff --git a/example/bundle/assets/readMagicBytes-Da5ueiou.js b/example/bundle/assets/readMagicBytes-Da5ueiou.js new file mode 100644 index 00000000..09bab973 --- /dev/null +++ b/example/bundle/assets/readMagicBytes-Da5ueiou.js @@ -0,0 +1 @@ +const y=new TextDecoder;function I(i){return y.decode(i)}function f(i,e,t,s,a,r){let n;switch(s){case"SCALAR":n=1;break;case"VEC2":n=2;break;case"VEC3":n=3;break;case"VEC4":n=4;break;default:throw new Error(`FeatureTable : Feature type not provided for "${r}".`)}let c;const o=t*n;switch(a){case"BYTE":c=new Int8Array(i,e,o);break;case"UNSIGNED_BYTE":c=new Uint8Array(i,e,o);break;case"SHORT":c=new Int16Array(i,e,o);break;case"UNSIGNED_SHORT":c=new Uint16Array(i,e,o);break;case"INT":c=new Int32Array(i,e,o);break;case"UNSIGNED_INT":c=new Uint32Array(i,e,o);break;case"FLOAT":c=new Float32Array(i,e,o);break;case"DOUBLE":c=new Float64Array(i,e,o);break;default:throw new Error(`FeatureTable : Feature component type not provided for "${r}".`)}return c}class T{constructor(e,t,s,a){this.buffer=e,this.binOffset=t+s,this.binLength=a;let r=null;if(s!==0){const n=new Uint8Array(e,t,s);r=JSON.parse(I(n))}else r={};this.header=r}getKeys(){return Object.keys(this.header)}getData(e,t,s=null,a=null){const r=this.header;if(!(e in r))return null;const n=r[e];if(n instanceof Object){if(Array.isArray(n))return n;{const{buffer:c,binOffset:o,binLength:h}=this,l=n.byteOffset||0,p=n.type||a,b=n.componentType||s;if("type"in n&&a&&n.type!==a)throw new Error("FeatureTable: Specified type does not match expected type.");const u=o+l,d=f(c,u,t,p,b,e);if(u+d.byteLength>o+h)throw new Error("FeatureTable: Feature data read outside binary body length.");return d}}else return n}getBuffer(e,t){const{buffer:s,binOffset:a}=this;return s.slice(a+e,a+e+t)}}class g{constructor(e){this.batchTable=e;const t=e.header.extensions["3DTILES_batch_table_hierarchy"];this.classes=t.classes;for(const a of this.classes){const r=a.instances;for(const n in r)a.instances[n]=this._parseProperty(r[n],a.length,n)}if(this.instancesLength=t.instancesLength,this.classIds=this._parseProperty(t.classIds,this.instancesLength,"classIds"),t.parentCounts?this.parentCounts=this._parseProperty(t.parentCounts,this.instancesLength,"parentCounts"):this.parentCounts=new Array(this.instancesLength).fill(1),t.parentIds){const a=this.parentCounts.reduce((r,n)=>r+n,0);this.parentIds=this._parseProperty(t.parentIds,a,"parentIds")}else this.parentIds=null;this.instancesIds=[];const s={};for(const a of this.classIds)s[a]=s[a]??0,this.instancesIds.push(s[a]),s[a]++}_parseProperty(e,t,s){if(Array.isArray(e))return e;{const{buffer:a,binOffset:r}=this.batchTable,n=e.byteOffset,c=e.componentType||"UNSIGNED_SHORT",o=r+n;return f(a,o,t,"SCALAR",c,s)}}getDataFromId(e,t={}){const s=this.parentCounts[e];if(this.parentIds&&s>0){let o=0;for(let h=0;h=this.count)throw new Error(`BatchTable: id value "${e}" out of bounds for "${this.count}" features number.`);for(const s of this.getKeys())s!=="extensions"&&(t[s]=super.getData(s,this.count)[e]);for(const s in this.extensions){const a=this.extensions[s];a.getDataFromId instanceof Function&&(t[s]=t[s]||{},a.getDataFromId(e,t[s]))}return t}getPropertyArray(e){return super.getData(e,this.count)}}function A(i){let e;if(i instanceof DataView?e=i:e=new DataView(i),String.fromCharCode(e.getUint8(0))==="{")return null;let t="";for(let s=0;s<4;s++)t+=String.fromCharCode(e.getUint8(s));return t}export{D as B,T as F,I as a,A as r}; diff --git a/example/bundle/assets/stats.module--VATS4Kh.js b/example/bundle/assets/stats.module--VATS4Kh.js new file mode 100644 index 00000000..74b251dc --- /dev/null +++ b/example/bundle/assets/stats.module--VATS4Kh.js @@ -0,0 +1 @@ +var P=function(){var m=0,a=document.createElement("div");a.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",a.addEventListener("click",function(n){n.preventDefault(),o(++m%a.children.length)},!1);function i(n){return a.appendChild(n.dom),n}function o(n){for(var l=0;l=r+1e3&&(u.update(e*1e3/(n-r),100),r=n,e=0,h)){var l=performance.memory;h.update(l.usedJSHeapSize/1048576,l.jsHeapSizeLimit/1048576)}return n},update:function(){f=this.end()},domElement:a,setMode:o}};P.Panel=function(m,a,i){var o=1/0,f=0,r=Math.round,e=r(window.devicePixelRatio||1),u=80*e,v=48*e,h=3*e,n=2*e,l=3*e,c=15*e,d=74*e,s=30*e,p=document.createElement("canvas");p.width=u,p.height=v,p.style.cssText="width:80px;height:48px";var t=p.getContext("2d");return t.font="bold "+9*e+"px Helvetica,Arial,sans-serif",t.textBaseline="top",t.fillStyle=i,t.fillRect(0,0,u,v),t.fillStyle=a,t.fillText(m,h,n),t.fillRect(l,c,d,s),t.fillStyle=i,t.globalAlpha=.9,t.fillRect(l,c,d,s),{dom:p,update:function(x,S){o=Math.min(o,x),f=Math.max(f,x),t.fillStyle=i,t.globalAlpha=1,t.fillRect(0,0,u,c),t.fillStyle=a,t.fillText(r(x)+" "+m+" ("+r(o)+"-"+r(f)+")",h,n),t.drawImage(p,l+e,c,d-e,s,l,c,d-e,s),t.fillRect(l+d-e,c,e,s),t.fillStyle=i,t.globalAlpha=.9,t.fillRect(l+d-e,c,e,r((1-x/S)*s))}}};export{P as S}; diff --git a/example/bundle/assets/three.module-_fL2BuBc.js b/example/bundle/assets/three.module-_fL2BuBc.js new file mode 100644 index 00000000..9ec47c9d --- /dev/null +++ b/example/bundle/assets/three.module-_fL2BuBc.js @@ -0,0 +1,3828 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function e(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=e(i);fetch(i.href,s)}})();/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const Ja="170",mf={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},gf={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},hu=0,vl=1,uu=2,_f=3,xf=0,Nl=1,du=2,un=3,Un=0,Ue=1,dn=2,Pn=0,Si=1,yl=2,Ml=3,Sl=4,fu=5,Zn=100,pu=101,mu=102,gu=103,_u=104,xu=200,vu=201,yu=202,Mu=203,ha=204,ua=205,Su=206,bu=207,Eu=208,Tu=209,Au=210,wu=211,Cu=212,Ru=213,Iu=214,da=0,fa=1,pa=2,Ai=3,ma=4,ga=5,_a=6,xa=7,rr=0,Pu=1,Lu=2,Ln=0,Du=1,Uu=2,Nu=3,Fu=4,Ou=5,Bu=6,zu=7,bl="attached",ku="detached",$a=300,Nn=301,Jn=302,Hs=303,Gs=304,hs=306,Ws=1e3,Qe=1001,Xs=1002,be=1003,Fl=1004,vf=1004,ts=1005,yf=1005,xe=1006,Ds=1007,Mf=1007,fn=1008,Sf=1008,_n=1009,Ol=1010,Bl=1011,as=1012,Ka=1013,Fn=1014,He=1015,us=1016,Qa=1017,ja=1018,wi=1020,zl=35902,kl=1021,Vl=1022,De=1023,Hl=1024,Gl=1025,bi=1026,Ci=1027,to=1028,ar=1029,Wl=1030,eo=1031,bf=1032,no=1033,Us=33776,Ns=33777,Fs=33778,Os=33779,va=35840,ya=35841,Ma=35842,Sa=35843,ba=36196,Ea=37492,Ta=37496,Aa=37808,wa=37809,Ca=37810,Ra=37811,Ia=37812,Pa=37813,La=37814,Da=37815,Ua=37816,Na=37817,Fa=37818,Oa=37819,Ba=37820,za=37821,Bs=36492,ka=36494,Va=36495,Xl=36283,Ha=36284,Ga=36285,Wa=36286,Vu=2200,Hu=2201,Gu=2202,qs=2300,Xa=2301,la=2302,xi=2400,vi=2401,Ys=2402,io=2500,ql=2501,Ef=0,Tf=1,Af=2,Wu=3200,Xu=3201,wf=3202,Cf=3203,Kn=0,qu=1,Cn="",ke="srgb",Pi="srgb-linear",or="linear",se="srgb",Rf=0,mi=7680,If=7681,Pf=7682,Lf=7683,Df=34055,Uf=34056,Nf=5386,Ff=512,Of=513,Bf=514,zf=515,kf=516,Vf=517,Hf=518,El=519,Yu=512,Zu=513,Ju=514,Yl=515,$u=516,Ku=517,Qu=518,ju=519,Zs=35044,Gf=35048,Wf=35040,Xf=35045,qf=35049,Yf=35041,Zf=35046,Jf=35050,$f=35042,Kf="100",Tl="300 es",pn=2e3,Js=2001;class xn{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const i=this._listeners[t];if(i!==void 0){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const i=n.slice(0);for(let s=0,a=i.length;s>8&255]+Te[r>>16&255]+Te[r>>24&255]+"-"+Te[t&255]+Te[t>>8&255]+"-"+Te[t>>16&15|64]+Te[t>>24&255]+"-"+Te[e&63|128]+Te[e>>8&255]+"-"+Te[e>>16&255]+Te[e>>24&255]+Te[n&255]+Te[n>>8&255]+Te[n>>16&255]+Te[n>>24&255]).toLowerCase()}function fe(r,t,e){return Math.max(t,Math.min(e,r))}function Zl(r,t){return(r%t+t)%t}function Qf(r,t,e,n,i){return n+(r-t)*(i-n)/(e-t)}function jf(r,t,e){return r!==t?(e-r)/(t-r):0}function zs(r,t,e){return(1-e)*r+e*t}function tp(r,t,e,n){return zs(r,t,1-Math.exp(-e*n))}function ep(r,t=1){return t-Math.abs(Zl(r,t*2)-t)}function np(r,t,e){return r<=t?0:r>=e?1:(r=(r-t)/(e-t),r*r*(3-2*r))}function ip(r,t,e){return r<=t?0:r>=e?1:(r=(r-t)/(e-t),r*r*r*(r*(r*6-15)+10))}function sp(r,t){return r+Math.floor(Math.random()*(t-r+1))}function rp(r,t){return r+Math.random()*(t-r)}function ap(r){return r*(.5-Math.random())}function op(r){r!==void 0&&(Ic=r);let t=Ic+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function lp(r){return r*Ei}function cp(r){return r*os}function hp(r){return(r&r-1)===0&&r!==0}function up(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function dp(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function fp(r,t,e,n,i){const s=Math.cos,a=Math.sin,o=s(e/2),l=a(e/2),c=s((t+n)/2),h=a((t+n)/2),u=s((t-n)/2),d=a((t-n)/2),f=s((n-t)/2),m=a((n-t)/2);switch(i){case"XYX":r.set(o*h,l*u,l*d,o*c);break;case"YZY":r.set(l*d,o*h,l*u,o*c);break;case"ZXZ":r.set(l*u,l*d,o*h,o*c);break;case"XZX":r.set(o*h,l*m,l*f,o*c);break;case"YXY":r.set(l*f,o*h,l*m,o*c);break;case"ZYZ":r.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Le(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function kt(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const pp={DEG2RAD:Ei,RAD2DEG:os,generateUUID:Ze,clamp:fe,euclideanModulo:Zl,mapLinear:Qf,inverseLerp:jf,lerp:zs,damp:tp,pingpong:ep,smoothstep:np,smootherstep:ip,randInt:sp,randFloat:rp,randFloatSpread:ap,seededRandom:op,degToRad:lp,radToDeg:cp,isPowerOfTwo:hp,ceilPowerOfTwo:up,floorPowerOfTwo:dp,setQuaternionFromProperEuler:fp,normalize:kt,denormalize:Le};class ${constructor(t=0,e=0){$.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(fe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*n-a*i+t.x,this.y=s*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Bt{constructor(t,e,n,i,s,a,o,l,c){Bt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,o,l,c)}set(t,e,n,i,s,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=i,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],y=i[1],v=i[4],x=i[7],P=i[2],T=i[5],C=i[8];return s[0]=a*_+o*y+l*P,s[3]=a*g+o*v+l*T,s[6]=a*p+o*x+l*C,s[1]=c*_+h*y+u*P,s[4]=c*g+h*v+u*T,s[7]=c*p+h*x+u*C,s[2]=d*_+f*y+m*P,s[5]=d*g+f*v+m*T,s[8]=d*p+f*x+m*C,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*s*h+n*o*l+i*s*c-i*a*l}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,d=o*l-h*s,f=c*s-a*l,m=e*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return t[0]=u*_,t[1]=(i*c-h*n)*_,t[2]=(o*n-i*a)*_,t[3]=d*_,t[4]=(h*e-i*l)*_,t[5]=(i*s-o*e)*_,t[6]=f*_,t[7]=(n*l-c*e)*_,t[8]=(a*e-n*s)*_,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-i*c,i*l,-i*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Po.makeScale(t,e)),this}rotate(t){return this.premultiply(Po.makeRotation(-t)),this}translate(t,e){return this.premultiply(Po.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Po=new Bt;function td(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}const mp={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function es(r,t){return new mp[r](t)}function $s(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function ed(){const r=$s("canvas");return r.style.display="block",r}const Pc={};function Is(r){r in Pc||(Pc[r]=!0,console.warn(r))}function gp(r,t,e){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(t,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,e);break;default:n()}}setTimeout(s,e)})}function _p(r){const t=r.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function xp(r){const t=r.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const Yt={enabled:!0,workingColorSpace:Pi,spaces:{},convert:function(r,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===se&&(r.r=Dn(r.r),r.g=Dn(r.g),r.b=Dn(r.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(r.applyMatrix3(this.spaces[t].toXYZ),r.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===se&&(r.r=rs(r.r),r.g=rs(r.g),r.b=rs(r.b))),r},fromWorkingColorSpace:function(r,t){return this.convert(r,this.workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Cn?or:this.spaces[r].transfer},getLuminanceCoefficients:function(r,t=this.workingColorSpace){return r.fromArray(this.spaces[t].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,t,e){return r.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}};function Dn(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function rs(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}const Lc=[.64,.33,.3,.6,.15,.06],Dc=[.2126,.7152,.0722],Uc=[.3127,.329],Nc=new Bt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fc=new Bt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);Yt.define({[Pi]:{primaries:Lc,whitePoint:Uc,transfer:or,toXYZ:Nc,fromXYZ:Fc,luminanceCoefficients:Dc,workingColorSpaceConfig:{unpackColorSpace:ke},outputColorSpaceConfig:{drawingBufferColorSpace:ke}},[ke]:{primaries:Lc,whitePoint:Uc,transfer:se,toXYZ:Nc,fromXYZ:Fc,luminanceCoefficients:Dc,outputColorSpaceConfig:{drawingBufferColorSpace:ke}}});let Fi;class nd{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Fi===void 0&&(Fi=$s("canvas")),Fi.width=t.width,Fi.height=t.height;const n=Fi.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Fi}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=$s("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let a=0;a0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==$a)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ws:t.x=t.x-Math.floor(t.x);break;case Qe:t.x=t.x<0?0:1;break;case Xs:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Ws:t.y=t.y-Math.floor(t.y);break;case Qe:t.y=t.y<0?0:1;break;case Xs:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}pe.DEFAULT_IMAGE=null;pe.DEFAULT_MAPPING=$a;pe.DEFAULT_ANISOTROPY=1;class Kt{constructor(t=0,e=0,n=0,i=1){Kt.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s;const l=t.elements,c=l[0],h=l[4],u=l[8],d=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const v=(c+1)/2,x=(f+1)/2,P=(p+1)/2,T=(h+d)/4,C=(u+_)/4,R=(m+g)/4;return v>x&&v>P?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=T/n,s=C/n):x>P?x<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(x),n=T/i,s=R/i):P<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(P),n=C/s,i=R/s),this.set(n,i,s,e),this}let y=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(y)<.001&&(y=1),this.x=(g-m)/y,this.y=(u-_)/y,this.z=(d-h)/y,this.w=Math.acos((c+f+p-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class id extends xn{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Kt(0,0,t,e),this.scissorTest=!1,this.viewport=new Kt(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:xe,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new pe(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,v=1-p*p;if(v>Number.EPSILON){const P=Math.sqrt(v),T=Math.atan2(P,p*y);g=Math.sin(g*T)/P,o=Math.sin(o*T)/P}const x=o*y;if(l=l*g+d*x,c=c*g+f*x,h=h*g+m*x,u=u*g+_*x,g===1-o){const P=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=P,c*=P,h*=P,u*=P}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=s[a],d=s[a+1],f=s[a+2],m=s[a+3];return t[e]=o*m+h*u+l*f-c*d,t[e+1]=l*m+h*d+c*u-o*f,t[e+2]=c*m+h*f+o*d-l*u,t[e+3]=h*m-o*u-l*d-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(s/2),d=l(n/2),f=l(i/2),m=l(s/2);switch(a){case"XYZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"YZX":this._x=d*h*u+c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u-d*f*m;break;case"XZY":this._x=d*h*u-c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-l)*f,this._y=(s-c)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(s-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(s+c)/f,this._y=(l+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(fe(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+i*c-s*l,this._y=i*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,s=this._z,a=this._w;let o=a*t._w+n*t._x+i*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const f=1-e;return this._w=f*a+e*this._w,this._x=f*n+e*this._x,this._y=f*i+e*this._y,this._z=f*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=s*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class w{constructor(t=0,e=0,n=0){w.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Oc.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Oc.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,s=t.elements,a=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*i-o*n),h=2*(o*e-s*i),u=2*(s*n-a*e);return this.x=e+l*c+a*u-o*h,this.y=n+l*h+o*c-s*u,this.z=i+l*u+s*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Do.copy(this).projectOnVector(t),this.sub(Do)}reflect(t){return this.sub(Do.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(fe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Do=new w,Oc=new Ge;class Ne{constructor(t=new w(1/0,1/0,1/0),e=new w(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,en),en.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(xs),xr.subVectors(this.max,xs),Oi.subVectors(t.a,xs),Bi.subVectors(t.b,xs),zi.subVectors(t.c,xs),kn.subVectors(Bi,Oi),Vn.subVectors(zi,Bi),ni.subVectors(Oi,zi);let e=[0,-kn.z,kn.y,0,-Vn.z,Vn.y,0,-ni.z,ni.y,kn.z,0,-kn.x,Vn.z,0,-Vn.x,ni.z,0,-ni.x,-kn.y,kn.x,0,-Vn.y,Vn.x,0,-ni.y,ni.x,0];return!Uo(e,Oi,Bi,zi,xr)||(e=[1,0,0,0,1,0,0,0,1],!Uo(e,Oi,Bi,zi,xr))?!1:(vr.crossVectors(kn,Vn),e=[vr.x,vr.y,vr.z],Uo(e,Oi,Bi,zi,xr))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,en).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(en).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Sn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Sn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Sn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Sn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Sn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Sn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Sn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Sn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Sn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Sn=[new w,new w,new w,new w,new w,new w,new w,new w],en=new w,_r=new Ne,Oi=new w,Bi=new w,zi=new w,kn=new w,Vn=new w,ni=new w,xs=new w,xr=new w,vr=new w,ii=new w;function Uo(r,t,e,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){ii.fromArray(r,s);const o=i.x*Math.abs(ii.x)+i.y*Math.abs(ii.y)+i.z*Math.abs(ii.z),l=t.dot(ii),c=e.dot(ii),h=n.dot(ii);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const bp=new Ne,vs=new w,No=new w;class Ce{constructor(t=new w,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):bp.setFromPoints(t).getCenter(n);let i=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;vs.subVectors(t,this.center);const e=vs.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(vs,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(No.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(vs.copy(t.center).add(No)),this.expandByPoint(vs.copy(t.center).sub(No))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const bn=new w,Fo=new w,yr=new w,Hn=new w,Oo=new w,Mr=new w,Bo=new w;class ds{constructor(t=new w,e=new w(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,bn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=bn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(bn.copy(this.origin).addScaledVector(this.direction,e),bn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Fo.copy(t).add(e).multiplyScalar(.5),yr.copy(e).sub(t).normalize(),Hn.copy(this.origin).sub(Fo);const s=t.distanceTo(e)*.5,a=-this.direction.dot(yr),o=Hn.dot(this.direction),l=-Hn.dot(yr),c=Hn.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*l-o,d=a*o-l,m=s*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,f=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*s+o)),d=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(u=Math.max(0,-(a*s+o)),d=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c);else d=a>0?-s:s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Fo).addScaledVector(yr,d),f}intersectSphere(t,e){bn.subVectors(t.center,this.origin);const n=bn.dot(this.direction),i=bn.dot(bn)-n*n,s=t.radius*t.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(n=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),h>=0?(s=(t.min.y-d.y)*h,a=(t.max.y-d.y)*h):(s=(t.max.y-d.y)*h,a=(t.min.y-d.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a=0?(o=(t.min.z-d.z)*u,l=(t.max.z-d.z)*u):(o=(t.max.z-d.z)*u,l=(t.min.z-d.z)*u),n>l||o>i)||((o>n||n!==n)&&(n=o),(l=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,bn)!==null}intersectTriangle(t,e,n,i,s){Oo.subVectors(e,t),Mr.subVectors(n,t),Bo.crossVectors(Oo,Mr);let a=this.direction.dot(Bo),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Hn.subVectors(this.origin,t);const l=o*this.direction.dot(Mr.crossVectors(Hn,Mr));if(l<0)return null;const c=o*this.direction.dot(Oo.cross(Hn));if(c<0||l+c>a)return null;const h=-o*Hn.dot(Bo);return h<0?null:this.at(h/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Dt{constructor(t,e,n,i,s,a,o,l,c,h,u,d,f,m,_,g){Dt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,o,l,c,h,u,d,f,m,_,g)}set(t,e,n,i,s,a,o,l,c,h,u,d,f,m,_,g){const p=this.elements;return p[0]=t,p[4]=e,p[8]=n,p[12]=i,p[1]=s,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=_,p[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Dt().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/ki.setFromMatrixColumn(t,0).length(),s=1/ki.setFromMatrixColumn(t,1).length(),a=1/ki.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,s=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const d=a*h,f=a*u,m=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=f+m*c,e[5]=d-_*c,e[9]=-o*l,e[2]=_-d*c,e[6]=m+f*c,e[10]=a*l}else if(t.order==="YXZ"){const d=l*h,f=l*u,m=c*h,_=c*u;e[0]=d+_*o,e[4]=m*o-f,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=f*o-m,e[6]=_+d*o,e[10]=a*l}else if(t.order==="ZXY"){const d=l*h,f=l*u,m=c*h,_=c*u;e[0]=d-_*o,e[4]=-a*u,e[8]=m+f*o,e[1]=f+m*o,e[5]=a*h,e[9]=_-d*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const d=a*h,f=a*u,m=o*h,_=o*u;e[0]=l*h,e[4]=m*c-f,e[8]=d*c+_,e[1]=l*u,e[5]=_*c+d,e[9]=f*c-m,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const d=a*l,f=a*c,m=o*l,_=o*c;e[0]=l*h,e[4]=_-d*u,e[8]=m*u+f,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=f*u+m,e[10]=d-_*u}else if(t.order==="XZY"){const d=a*l,f=a*c,m=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=d*u+_,e[5]=a*h,e[9]=f*u-m,e[2]=m*u-f,e[6]=o*h,e[10]=_*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Ep,t,Tp)}lookAt(t,e,n){const i=this.elements;return qe.subVectors(t,e),qe.lengthSq()===0&&(qe.z=1),qe.normalize(),Gn.crossVectors(n,qe),Gn.lengthSq()===0&&(Math.abs(n.z)===1?qe.x+=1e-4:qe.z+=1e-4,qe.normalize(),Gn.crossVectors(n,qe)),Gn.normalize(),Sr.crossVectors(qe,Gn),i[0]=Gn.x,i[4]=Sr.x,i[8]=qe.x,i[1]=Gn.y,i[5]=Sr.y,i[9]=qe.y,i[2]=Gn.z,i[6]=Sr.z,i[10]=qe.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],y=n[3],v=n[7],x=n[11],P=n[15],T=i[0],C=i[4],R=i[8],b=i[12],M=i[1],L=i[5],k=i[9],O=i[13],V=i[2],Z=i[6],H=i[10],et=i[14],G=i[3],ot=i[7],mt=i[11],Mt=i[15];return s[0]=a*T+o*M+l*V+c*G,s[4]=a*C+o*L+l*Z+c*ot,s[8]=a*R+o*k+l*H+c*mt,s[12]=a*b+o*O+l*et+c*Mt,s[1]=h*T+u*M+d*V+f*G,s[5]=h*C+u*L+d*Z+f*ot,s[9]=h*R+u*k+d*H+f*mt,s[13]=h*b+u*O+d*et+f*Mt,s[2]=m*T+_*M+g*V+p*G,s[6]=m*C+_*L+g*Z+p*ot,s[10]=m*R+_*k+g*H+p*mt,s[14]=m*b+_*O+g*et+p*Mt,s[3]=y*T+v*M+x*V+P*G,s[7]=y*C+v*L+x*Z+P*ot,s[11]=y*R+v*k+x*H+P*mt,s[15]=y*b+v*O+x*et+P*Mt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],d=t[10],f=t[14],m=t[3],_=t[7],g=t[11],p=t[15];return m*(+s*l*u-i*c*u-s*o*d+n*c*d+i*o*f-n*l*f)+_*(+e*l*f-e*c*d+s*a*d-i*a*f+i*c*h-s*l*h)+g*(+e*c*u-e*o*f-s*a*u+n*a*f+s*o*h-n*c*h)+p*(-i*o*h-e*l*u+e*o*d+i*a*u-n*a*d+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],f=t[11],m=t[12],_=t[13],g=t[14],p=t[15],y=u*g*c-_*d*c+_*l*f-o*g*f-u*l*p+o*d*p,v=m*d*c-h*g*c-m*l*f+a*g*f+h*l*p-a*d*p,x=h*_*c-m*u*c+m*o*f-a*_*f-h*o*p+a*u*p,P=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,T=e*y+n*v+i*x+s*P;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/T;return t[0]=y*C,t[1]=(_*d*s-u*g*s-_*i*f+n*g*f+u*i*p-n*d*p)*C,t[2]=(o*g*s-_*l*s+_*i*c-n*g*c-o*i*p+n*l*p)*C,t[3]=(u*l*s-o*d*s-u*i*c+n*d*c+o*i*f-n*l*f)*C,t[4]=v*C,t[5]=(h*g*s-m*d*s+m*i*f-e*g*f-h*i*p+e*d*p)*C,t[6]=(m*l*s-a*g*s-m*i*c+e*g*c+a*i*p-e*l*p)*C,t[7]=(a*d*s-h*l*s+h*i*c-e*d*c-a*i*f+e*l*f)*C,t[8]=x*C,t[9]=(m*u*s-h*_*s-m*n*f+e*_*f+h*n*p-e*u*p)*C,t[10]=(a*_*s-m*o*s+m*n*c-e*_*c-a*n*p+e*o*p)*C,t[11]=(h*o*s-a*u*s-h*n*c+e*u*c+a*n*f-e*o*f)*C,t[12]=P*C,t[13]=(h*_*i-m*u*i+m*n*d-e*_*d-h*n*g+e*u*g)*C,t[14]=(m*o*i-a*_*i-m*n*l+e*_*l+a*n*g-e*o*g)*C,t[15]=(a*u*i-h*o*i+h*n*l-e*u*l-a*n*d+e*o*d)*C,this}scale(t){const e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),s=1-n,a=t.x,o=t.y,l=t.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,a){return this.set(1,n,s,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,h=a+a,u=o+o,d=s*c,f=s*h,m=s*u,_=a*h,g=a*u,p=o*u,y=l*c,v=l*h,x=l*u,P=n.x,T=n.y,C=n.z;return i[0]=(1-(_+p))*P,i[1]=(f+x)*P,i[2]=(m-v)*P,i[3]=0,i[4]=(f-x)*T,i[5]=(1-(d+p))*T,i[6]=(g+y)*T,i[7]=0,i[8]=(m+v)*C,i[9]=(g-y)*C,i[10]=(1-(d+_))*C,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let s=ki.set(i[0],i[1],i[2]).length();const a=ki.set(i[4],i[5],i[6]).length(),o=ki.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],nn.copy(this);const c=1/s,h=1/a,u=1/o;return nn.elements[0]*=c,nn.elements[1]*=c,nn.elements[2]*=c,nn.elements[4]*=h,nn.elements[5]*=h,nn.elements[6]*=h,nn.elements[8]*=u,nn.elements[9]*=u,nn.elements[10]*=u,e.setFromRotationMatrix(nn),n.x=s,n.y=a,n.z=o,this}makePerspective(t,e,n,i,s,a,o=pn){const l=this.elements,c=2*s/(e-t),h=2*s/(n-i),u=(e+t)/(e-t),d=(n+i)/(n-i);let f,m;if(o===pn)f=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===Js)f=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,a,o=pn){const l=this.elements,c=1/(e-t),h=1/(n-i),u=1/(a-s),d=(e+t)*c,f=(n+i)*h;let m,_;if(o===pn)m=(a+s)*u,_=-2*u;else if(o===Js)m=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const ki=new w,nn=new Dt,Ep=new w(0,0,0),Tp=new w(1,1,1),Gn=new w,Sr=new w,qe=new w,Bc=new Dt,zc=new Ge;class Je{constructor(t=0,e=0,n=0,i=Je.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=i[6],f=i[10];switch(e){case"XYZ":this._y=Math.asin(fe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-fe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(fe(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-fe(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(fe(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-fe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Bc.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Bc,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return zc.setFromEuler(this),this.setFromQuaternion(zc,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Je.DEFAULT_ORDER="XYZ";class ro{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){i.children=[];for(let o=0;o0){i.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){sn.subVectors(i,e),Tn.subVectors(n,e),ko.subVectors(t,e);const a=sn.dot(sn),o=sn.dot(Tn),l=sn.dot(ko),c=Tn.dot(Tn),h=Tn.dot(ko),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const d=1/u,f=(c*l-o*h)*d,m=(a*h-o*l)*d;return s.set(1-f-m,m,f)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,An)===null?!1:An.x>=0&&An.y>=0&&An.x+An.y<=1}static getInterpolation(t,e,n,i,s,a,o,l){return this.getBarycoord(t,e,n,i,An)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,An.x),l.addScaledVector(a,An.y),l.addScaledVector(o,An.z),l)}static getInterpolatedAttribute(t,e,n,i,s,a){return Wo.setScalar(0),Xo.setScalar(0),qo.setScalar(0),Wo.fromBufferAttribute(t,e),Xo.fromBufferAttribute(t,n),qo.fromBufferAttribute(t,i),a.setScalar(0),a.addScaledVector(Wo,s.x),a.addScaledVector(Xo,s.y),a.addScaledVector(qo,s.z),a}static isFrontFacing(t,e,n,i){return sn.subVectors(n,e),Tn.subVectors(t,e),sn.cross(Tn).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return sn.subVectors(this.c,this.b),Tn.subVectors(this.a,this.b),sn.cross(Tn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ve.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Ve.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return Ve.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return Ve.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ve.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,s=this.c;let a,o;Gi.subVectors(i,n),Wi.subVectors(s,n),Vo.subVectors(t,n);const l=Gi.dot(Vo),c=Wi.dot(Vo);if(l<=0&&c<=0)return e.copy(n);Ho.subVectors(t,i);const h=Gi.dot(Ho),u=Wi.dot(Ho);if(h>=0&&u<=h)return e.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(Gi,a);Go.subVectors(t,s);const f=Gi.dot(Go),m=Wi.dot(Go);if(m>=0&&f<=m)return e.copy(s);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),e.copy(n).addScaledVector(Wi,o);const g=h*m-f*u;if(g<=0&&u-h>=0&&f-m>=0)return Xc.subVectors(s,i),o=(u-h)/(u-h+(f-m)),e.copy(i).addScaledVector(Xc,o);const p=1/(g+_+d);return a=_*p,o=d*p,e.copy(n).addScaledVector(Gi,a).addScaledVector(Wi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const sd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Wn={h:0,s:0,l:0},Er={h:0,s:0,l:0};function Yo(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}class pt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=ke){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Yt.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Yt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Yt.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Yt.workingColorSpace){if(t=Zl(t,1),e=fe(e,0,1),n=fe(n,0,1),e===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+e):n+e-n*e,a=2*n-s;this.r=Yo(a,s,t+1/3),this.g=Yo(a,s,t),this.b=Yo(a,s,t-1/3)}return Yt.toWorkingColorSpace(this,i),this}setStyle(t,e=ke){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=ke){const n=sd[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Dn(t.r),this.g=Dn(t.g),this.b=Dn(t.b),this}copyLinearToSRGB(t){return this.r=rs(t.r),this.g=rs(t.g),this.b=rs(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ke){return Yt.fromWorkingColorSpace(Ae.copy(this),t),Math.round(fe(Ae.r*255,0,255))*65536+Math.round(fe(Ae.g*255,0,255))*256+Math.round(fe(Ae.b*255,0,255))}getHexString(t=ke){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Yt.workingColorSpace){Yt.fromWorkingColorSpace(Ae.copy(this),e);const n=Ae.r,i=Ae.g,s=Ae.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-s)/u+(i0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Si&&(n.blending=this.blending),this.side!==Un&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==ha&&(n.blendSrc=this.blendSrc),this.blendDst!==ua&&(n.blendDst=this.blendDst),this.blendEquation!==Zn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Ai&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==El&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==mi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==mi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==mi&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=i(t.textures),a=i(t.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Qn extends Re{static get type(){return"MeshBasicMaterial"}constructor(t){super(),this.isMeshBasicMaterial=!0,this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Je,this.combine=rr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Rn=Pp();function Pp(){const r=new ArrayBuffer(4),t=new Float32Array(r),e=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,i[l]=24,i[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;!(c&8388608);)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:t,uint32View:e,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function ze(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=fe(r,-65504,65504),Rn.floatView[0]=r;const t=Rn.uint32View[0],e=t>>23&511;return Rn.baseTable[e]+((t&8388607)>>Rn.shiftTable[e])}function Ps(r){const t=r>>10;return Rn.uint32View[0]=Rn.mantissaTable[Rn.offsetTable[t]+(r&1023)]+Rn.exponentTable[t],Rn.floatView[0]}const Lp={toHalfFloat:ze,fromHalfFloat:Ps},ge=new w,Tr=new $;class re{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Zs,this.updateRanges=[],this.gpuType=He,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;ie.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ne);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new w(-1/0,-1/0,-1/0),new w(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u0&&(i[l]=h,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const i=t.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,f=u.length;d0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s(t.far-t.near)**2))&&(qc.copy(s).invert(),si.copy(t.ray).applyMatrix4(qc),!(n.boundingBox!==null&&si.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,si)))}_computeIntersections(t,e,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],y=Math.max(g.start,f.start),v=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let x=y,P=v;xe.far?null:{distance:c,point:Pr.clone(),object:r}}function Lr(r,t,e,n,i,s,a,o,l,c){r.getVertexPosition(o,wr),r.getVertexPosition(l,Cr),r.getVertexPosition(c,Rr);const h=kp(r,t,e,n,wr,Cr,Rr,Zc);if(h){const u=new w;Ve.getBarycoord(Zc,wr,Cr,Rr,u),i&&(h.uv=Ve.getInterpolatedAttribute(i,o,l,c,u,new $)),s&&(h.uv1=Ve.getInterpolatedAttribute(s,o,l,c,u,new $)),a&&(h.normal=Ve.getInterpolatedAttribute(a,o,l,c,u,new w),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new w,materialIndex:0};Ve.getNormal(wr,Cr,Rr,d.normal),h.face=d,h.barycoord=u}return h}class Li extends Wt{constructor(t=1,e=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,e,t,a,s,0),m("z","y","x",1,-1,n,e,-t,a,s,1),m("x","z","y",1,1,t,n,e,i,a,2),m("x","z","y",1,-1,t,n,-e,i,a,3),m("x","y","z",1,-1,t,e,n,i,s,4),m("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new St(c,3)),this.setAttribute("normal",new St(h,3)),this.setAttribute("uv",new St(u,2));function m(_,g,p,y,v,x,P,T,C,R,b){const M=x/C,L=P/R,k=x/2,O=P/2,V=T/2,Z=C+1,H=R+1;let et=0,G=0;const ot=new w;for(let mt=0;mt0?1:-1,h.push(ot.x,ot.y,ot.z),u.push(zt/C),u.push(1-mt/R),et+=1}}for(let mt=0;mt0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class ao extends Qt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dt,this.projectionMatrix=new Dt,this.projectionMatrixInverse=new Dt,this.coordinateSystem=pn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Xn=new w,Jc=new $,$c=new $;class Se extends ao{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=os*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Ei*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return os*2*Math.atan(Math.tan(Ei*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Xn.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Xn.x,Xn.y).multiplyScalar(-t/Xn.z),Xn.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Xn.x,Xn.y).multiplyScalar(-t/Xn.z)}getViewSize(t,e){return this.getViewBounds(t,Jc,$c),e.subVectors($c,Jc)}setViewOffset(t,e,n,i,s,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Ei*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*i/l,e-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const qi=-90,Yi=1;class od extends Qt{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Se(qi,Yi,t,e);i.layers=this.layers,this.add(i);const s=new Se(qi,Yi,t,e);s.layers=this.layers,this.add(s);const a=new Se(qi,Yi,t,e);a.layers=this.layers,this.add(a);const o=new Se(qi,Yi,t,e);o.layers=this.layers,this.add(o);const l=new Se(qi,Yi,t,e);l.layers=this.layers,this.add(l);const c=new Se(qi,Yi,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,s,a,o,l]=e;for(const c of e)this.remove(c);if(t===pn)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Js)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,c,h]=this.children,u=t.getRenderTarget(),d=t.getActiveCubeFace(),f=t.getActiveMipmapLevel(),m=t.xr.enabled;t.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,s),t.setRenderTarget(n,1,i),t.render(e,a),t.setRenderTarget(n,2,i),t.render(e,o),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=_,t.setRenderTarget(n,5,i),t.render(e,h),t.setRenderTarget(u,d,f),t.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class lr extends pe{constructor(t,e,n,i,s,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Nn,super(t,e,n,i,s,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class ld extends an{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new lr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:xe}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new Li(5,5,5),s=new on({name:"CubemapFromEquirect",uniforms:ls(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ue,blending:Pn});s.uniforms.tEquirect.value=e;const a=new _e(i,s),o=e.minFilter;return e.minFilter===fn&&(e.minFilter=xe),new od(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,i){const s=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(s)}}const $o=new w,Wp=new w,Xp=new Bt;class Yn{constructor(t=new w(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=$o.subVectors(n,e).cross(Wp.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta($o),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Xp.getNormalMatrix(t),i=this.coplanarPoint($o).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ri=new Ce,Dr=new w;class cr{constructor(t=new Yn,e=new Yn,n=new Yn,i=new Yn,s=new Yn,a=new Yn){this.planes=[t,e,n,i,s,a]}set(t,e,n,i,s,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=pn){const n=this.planes,i=t.elements,s=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],u=i[6],d=i[7],f=i[8],m=i[9],_=i[10],g=i[11],p=i[12],y=i[13],v=i[14],x=i[15];if(n[0].setComponents(l-s,d-c,g-f,x-p).normalize(),n[1].setComponents(l+s,d+c,g+f,x+p).normalize(),n[2].setComponents(l+a,d+h,g+m,x+y).normalize(),n[3].setComponents(l-a,d-h,g-m,x-y).normalize(),n[4].setComponents(l-o,d-u,g-_,x-v).normalize(),e===pn)n[5].setComponents(l+o,d+u,g+_,x+v).normalize();else if(e===Js)n[5].setComponents(o,u,_,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ri.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),ri.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ri)}intersectsSprite(t){return ri.center.set(0,0,0),ri.radius=.7071067811865476,ri.applyMatrix4(t.matrixWorld),this.intersectsSphere(ri)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)0?t.max.x:t.min.x,Dr.y=i.normal.y>0?t.max.y:t.min.y,Dr.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Dr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function cd(){let r=null,t=!1,e=null,n=null;function i(s,a){e(s,a),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function qp(r){const t=new WeakMap;function e(o,l){const c=o.array,h=o.usage,u=c.byteLength,d=r.createBuffer();r.bindBuffer(l,d),r.bufferData(l,c,h),o.onUploadCallback();let f;if(c instanceof Float32Array)f=r.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?f=r.HALF_FLOAT:f=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=r.SHORT;else if(c instanceof Uint32Array)f=r.UNSIGNED_INT;else if(c instanceof Int32Array)f=r.INT;else if(c instanceof Int8Array)f=r.BYTE;else if(c instanceof Uint8Array)f=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,l,c){const h=l.array,u=l.updateRanges;if(r.bindBuffer(c,o),u.length===0)r.bufferSubData(c,0,h);else{u.sort((f,m)=>f.start-m.start);let d=0;for(let f=1;f 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,cm=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,hm=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,um=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,dm=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,fm=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,pm=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,mm=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,gm=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,_m=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,xm=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,vm=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,ym=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Mm=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Sm=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,bm="gl_FragColor = linearToOutputTexel( gl_FragColor );",Em=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,Tm=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Am=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,wm=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Cm=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Rm=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Im=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Pm=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Lm=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,Dm=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Um=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,Nm=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,Fm=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Om=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Bm=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,zm=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,km=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Vm=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Hm=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,Gm=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Wm=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,Xm=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,qm=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,Ym=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,Zm=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,Jm=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,$m=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,Km=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,Qm=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,jm=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,tg=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,eg=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,ng=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,ig=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,sg=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,rg=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,ag=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,og=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,lg=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,cg=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,hg=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,ug=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,dg=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,fg=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,pg=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,mg=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,gg=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,_g=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,xg=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,vg=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,yg=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Mg=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Sg=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,bg=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Eg=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Tg=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Ag=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,wg=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Cg=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,Rg=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Ig=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,Pg=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Lg=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,Dg=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,Ug=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,Ng=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,Fg=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,Og=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Bg=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,zg=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,kg=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,Vg=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,Hg=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,Gg=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,Wg=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,Xg=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const qg=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,Yg=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,Zg=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Jg=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,$g=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Kg=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,Qg=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,jg=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,t_=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,e_=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,n_=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,i_=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,s_=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,r_=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,a_=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,o_=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,l_=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,c_=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,h_=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,u_=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,d_=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,f_=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,p_=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,m_=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,g_=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,__=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,x_=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,v_=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,y_=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,M_=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,S_=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,b_=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,E_=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,T_=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Gt={alphahash_fragment:Yp,alphahash_pars_fragment:Zp,alphamap_fragment:Jp,alphamap_pars_fragment:$p,alphatest_fragment:Kp,alphatest_pars_fragment:Qp,aomap_fragment:jp,aomap_pars_fragment:tm,batching_pars_vertex:em,batching_vertex:nm,begin_vertex:im,beginnormal_vertex:sm,bsdfs:rm,iridescence_fragment:am,bumpmap_pars_fragment:om,clipping_planes_fragment:lm,clipping_planes_pars_fragment:cm,clipping_planes_pars_vertex:hm,clipping_planes_vertex:um,color_fragment:dm,color_pars_fragment:fm,color_pars_vertex:pm,color_vertex:mm,common:gm,cube_uv_reflection_fragment:_m,defaultnormal_vertex:xm,displacementmap_pars_vertex:vm,displacementmap_vertex:ym,emissivemap_fragment:Mm,emissivemap_pars_fragment:Sm,colorspace_fragment:bm,colorspace_pars_fragment:Em,envmap_fragment:Tm,envmap_common_pars_fragment:Am,envmap_pars_fragment:wm,envmap_pars_vertex:Cm,envmap_physical_pars_fragment:zm,envmap_vertex:Rm,fog_vertex:Im,fog_pars_vertex:Pm,fog_fragment:Lm,fog_pars_fragment:Dm,gradientmap_pars_fragment:Um,lightmap_pars_fragment:Nm,lights_lambert_fragment:Fm,lights_lambert_pars_fragment:Om,lights_pars_begin:Bm,lights_toon_fragment:km,lights_toon_pars_fragment:Vm,lights_phong_fragment:Hm,lights_phong_pars_fragment:Gm,lights_physical_fragment:Wm,lights_physical_pars_fragment:Xm,lights_fragment_begin:qm,lights_fragment_maps:Ym,lights_fragment_end:Zm,logdepthbuf_fragment:Jm,logdepthbuf_pars_fragment:$m,logdepthbuf_pars_vertex:Km,logdepthbuf_vertex:Qm,map_fragment:jm,map_pars_fragment:tg,map_particle_fragment:eg,map_particle_pars_fragment:ng,metalnessmap_fragment:ig,metalnessmap_pars_fragment:sg,morphinstance_vertex:rg,morphcolor_vertex:ag,morphnormal_vertex:og,morphtarget_pars_vertex:lg,morphtarget_vertex:cg,normal_fragment_begin:hg,normal_fragment_maps:ug,normal_pars_fragment:dg,normal_pars_vertex:fg,normal_vertex:pg,normalmap_pars_fragment:mg,clearcoat_normal_fragment_begin:gg,clearcoat_normal_fragment_maps:_g,clearcoat_pars_fragment:xg,iridescence_pars_fragment:vg,opaque_fragment:yg,packing:Mg,premultiplied_alpha_fragment:Sg,project_vertex:bg,dithering_fragment:Eg,dithering_pars_fragment:Tg,roughnessmap_fragment:Ag,roughnessmap_pars_fragment:wg,shadowmap_pars_fragment:Cg,shadowmap_pars_vertex:Rg,shadowmap_vertex:Ig,shadowmask_pars_fragment:Pg,skinbase_vertex:Lg,skinning_pars_vertex:Dg,skinning_vertex:Ug,skinnormal_vertex:Ng,specularmap_fragment:Fg,specularmap_pars_fragment:Og,tonemapping_fragment:Bg,tonemapping_pars_fragment:zg,transmission_fragment:kg,transmission_pars_fragment:Vg,uv_pars_fragment:Hg,uv_pars_vertex:Gg,uv_vertex:Wg,worldpos_vertex:Xg,background_vert:qg,background_frag:Yg,backgroundCube_vert:Zg,backgroundCube_frag:Jg,cube_vert:$g,cube_frag:Kg,depth_vert:Qg,depth_frag:jg,distanceRGBA_vert:t_,distanceRGBA_frag:e_,equirect_vert:n_,equirect_frag:i_,linedashed_vert:s_,linedashed_frag:r_,meshbasic_vert:a_,meshbasic_frag:o_,meshlambert_vert:l_,meshlambert_frag:c_,meshmatcap_vert:h_,meshmatcap_frag:u_,meshnormal_vert:d_,meshnormal_frag:f_,meshphong_vert:p_,meshphong_frag:m_,meshphysical_vert:g_,meshphysical_frag:__,meshtoon_vert:x_,meshtoon_frag:v_,points_vert:y_,points_frag:M_,shadow_vert:S_,shadow_frag:b_,sprite_vert:E_,sprite_frag:T_},lt={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Bt},alphaMap:{value:null},alphaMapTransform:{value:new Bt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Bt}},envmap:{envMap:{value:null},envMapRotation:{value:new Bt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Bt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Bt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Bt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Bt},normalScale:{value:new $(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Bt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Bt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Bt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Bt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Bt},alphaTest:{value:0},uvTransform:{value:new Bt}},sprite:{diffuse:{value:new pt(16777215)},opacity:{value:1},center:{value:new $(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Bt},alphaMap:{value:null},alphaMapTransform:{value:new Bt},alphaTest:{value:0}}},rn={basic:{uniforms:Pe([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.fog]),vertexShader:Gt.meshbasic_vert,fragmentShader:Gt.meshbasic_frag},lambert:{uniforms:Pe([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,lt.lights,{emissive:{value:new pt(0)}}]),vertexShader:Gt.meshlambert_vert,fragmentShader:Gt.meshlambert_frag},phong:{uniforms:Pe([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,lt.lights,{emissive:{value:new pt(0)},specular:{value:new pt(1118481)},shininess:{value:30}}]),vertexShader:Gt.meshphong_vert,fragmentShader:Gt.meshphong_frag},standard:{uniforms:Pe([lt.common,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.roughnessmap,lt.metalnessmap,lt.fog,lt.lights,{emissive:{value:new pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag},toon:{uniforms:Pe([lt.common,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.gradientmap,lt.fog,lt.lights,{emissive:{value:new pt(0)}}]),vertexShader:Gt.meshtoon_vert,fragmentShader:Gt.meshtoon_frag},matcap:{uniforms:Pe([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,{matcap:{value:null}}]),vertexShader:Gt.meshmatcap_vert,fragmentShader:Gt.meshmatcap_frag},points:{uniforms:Pe([lt.points,lt.fog]),vertexShader:Gt.points_vert,fragmentShader:Gt.points_frag},dashed:{uniforms:Pe([lt.common,lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Gt.linedashed_vert,fragmentShader:Gt.linedashed_frag},depth:{uniforms:Pe([lt.common,lt.displacementmap]),vertexShader:Gt.depth_vert,fragmentShader:Gt.depth_frag},normal:{uniforms:Pe([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,{opacity:{value:1}}]),vertexShader:Gt.meshnormal_vert,fragmentShader:Gt.meshnormal_frag},sprite:{uniforms:Pe([lt.sprite,lt.fog]),vertexShader:Gt.sprite_vert,fragmentShader:Gt.sprite_frag},background:{uniforms:{uvTransform:{value:new Bt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Gt.background_vert,fragmentShader:Gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Bt}},vertexShader:Gt.backgroundCube_vert,fragmentShader:Gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Gt.cube_vert,fragmentShader:Gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Gt.equirect_vert,fragmentShader:Gt.equirect_frag},distanceRGBA:{uniforms:Pe([lt.common,lt.displacementmap,{referencePosition:{value:new w},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Gt.distanceRGBA_vert,fragmentShader:Gt.distanceRGBA_frag},shadow:{uniforms:Pe([lt.lights,lt.fog,{color:{value:new pt(0)},opacity:{value:1}}]),vertexShader:Gt.shadow_vert,fragmentShader:Gt.shadow_frag}};rn.physical={uniforms:Pe([rn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Bt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Bt},clearcoatNormalScale:{value:new $(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Bt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Bt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Bt},sheen:{value:0},sheenColor:{value:new pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Bt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Bt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Bt},transmissionSamplerSize:{value:new $},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Bt},attenuationDistance:{value:0},attenuationColor:{value:new pt(0)},specularColor:{value:new pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Bt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Bt},anisotropyVector:{value:new $},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Bt}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag};const Ur={r:0,b:0,g:0},ai=new Je,A_=new Dt;function w_(r,t,e,n,i,s,a){const o=new pt(0);let l=s===!0?0:1,c,h,u=null,d=0,f=null;function m(y){let v=y.isScene===!0?y.background:null;return v&&v.isTexture&&(v=(y.backgroundBlurriness>0?e:t).get(v)),v}function _(y){let v=!1;const x=m(y);x===null?p(o,l):x&&x.isColor&&(p(x,1),v=!0);const P=r.xr.getEnvironmentBlendMode();P==="additive"?n.buffers.color.setClear(0,0,0,1,a):P==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||v)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function g(y,v){const x=m(v);x&&(x.isCubeTexture||x.mapping===hs)?(h===void 0&&(h=new _e(new Li(1,1,1),new on({name:"BackgroundCubeMaterial",uniforms:ls(rn.backgroundCube.uniforms),vertexShader:rn.backgroundCube.vertexShader,fragmentShader:rn.backgroundCube.fragmentShader,side:Ue,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,T,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),ai.copy(v.backgroundRotation),ai.x*=-1,ai.y*=-1,ai.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(ai.y*=-1,ai.z*=-1),h.material.uniforms.envMap.value=x,h.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(A_.makeRotationFromEuler(ai)),h.material.toneMapped=Yt.getTransfer(x.colorSpace)!==se,(u!==x||d!==x.version||f!==r.toneMapping)&&(h.material.needsUpdate=!0,u=x,d=x.version,f=r.toneMapping),h.layers.enableAll(),y.unshift(h,h.geometry,h.material,0,0,null)):x&&x.isTexture&&(c===void 0&&(c=new _e(new fs(2,2),new on({name:"BackgroundMaterial",uniforms:ls(rn.background.uniforms),vertexShader:rn.background.vertexShader,fragmentShader:rn.background.fragmentShader,side:Un,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=x,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=Yt.getTransfer(x.colorSpace)!==se,x.matrixAutoUpdate===!0&&x.updateMatrix(),c.material.uniforms.uvTransform.value.copy(x.matrix),(u!==x||d!==x.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=x,d=x.version,f=r.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function p(y,v){y.getRGB(Ur,rd(r)),n.buffers.color.setClear(Ur.r,Ur.g,Ur.b,v,a)}return{getClearColor:function(){return o},setClearColor:function(y,v=1){o.set(y),l=v,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,p(o,l)},render:_,addToRenderList:g}}function C_(r,t){const e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null);let s=i,a=!1;function o(M,L,k,O,V){let Z=!1;const H=u(O,k,L);s!==H&&(s=H,c(s.object)),Z=f(M,O,k,V),Z&&m(M,O,k,V),V!==null&&t.update(V,r.ELEMENT_ARRAY_BUFFER),(Z||a)&&(a=!1,x(M,L,k,O),V!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return r.createVertexArray()}function c(M){return r.bindVertexArray(M)}function h(M){return r.deleteVertexArray(M)}function u(M,L,k){const O=k.wireframe===!0;let V=n[M.id];V===void 0&&(V={},n[M.id]=V);let Z=V[L.id];Z===void 0&&(Z={},V[L.id]=Z);let H=Z[O];return H===void 0&&(H=d(l()),Z[O]=H),H}function d(M){const L=[],k=[],O=[];for(let V=0;V=0){const mt=V[G];let Mt=Z[G];if(Mt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(Mt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(Mt=M.instanceColor)),mt===void 0||mt.attribute!==Mt||Mt&&mt.data!==Mt.data)return!0;H++}return s.attributesNum!==H||s.index!==O}function m(M,L,k,O){const V={},Z=L.attributes;let H=0;const et=k.getAttributes();for(const G in et)if(et[G].location>=0){let mt=Z[G];mt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(mt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(mt=M.instanceColor));const Mt={};Mt.attribute=mt,mt&&mt.data&&(Mt.data=mt.data),V[G]=Mt,H++}s.attributes=V,s.attributesNum=H,s.index=O}function _(){const M=s.newAttributes;for(let L=0,k=M.length;L=0){let ot=V[et];if(ot===void 0&&(et==="instanceMatrix"&&M.instanceMatrix&&(ot=M.instanceMatrix),et==="instanceColor"&&M.instanceColor&&(ot=M.instanceColor)),ot!==void 0){const mt=ot.normalized,Mt=ot.itemSize,zt=t.get(ot);if(zt===void 0)continue;const te=zt.buffer,Y=zt.type,it=zt.bytesPerElement,bt=Y===r.INT||Y===r.UNSIGNED_INT||ot.gpuType===Ka;if(ot.isInterleavedBufferAttribute){const rt=ot.data,It=rt.stride,Ft=ot.offset;if(rt.isInstancedInterleavedBuffer){for(let Ut=0;Ut0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=e.logarithmicDepthBuffer===!0,d=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),y=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),x=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),P=m>0,T=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:y,maxVaryings:v,maxFragmentUniforms:x,vertexTextures:P,maxSamples:T}}function P_(r){const t=this;let e=null,n=0,i=!1,s=!1;const a=new Yn,o=new Bt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,d){e=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=r.get(u);if(!i||m===null||m.length===0||s&&!g)s?h(null):c();else{const y=s?0:n,v=y*4;let x=p.clippingState||null;l.value=x,x=h(m,d,v,f);for(let P=0;P!==v;++P)x[P]=e[P];p.clippingState=x,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(u,d,f,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,y=d.matrixWorldInverse;o.getNormalMatrix(y),(g===null||g.length0){const c=new ld(l.height);return c.fromEquirectangularTexture(r,a),t.set(a,c),a.addEventListener("dispose",i),e(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}class oo extends ao{constructor(t=-1,e=1,n=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-t,a=n+t,o=i+e,l=i-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const ns=4,Kc=[.125,.215,.35,.446,.526,.582],_i=20,Ko=new oo,Qc=new pt;let Qo=null,jo=0,tl=0,el=!1;const gi=(1+Math.sqrt(5))/2,Zi=1/gi,jc=[new w(-gi,Zi,0),new w(gi,Zi,0),new w(-Zi,0,gi),new w(Zi,0,gi),new w(0,gi,-Zi),new w(0,gi,Zi),new w(-1,1,-1),new w(1,1,-1),new w(-1,1,1),new w(1,1,1)];class Al{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Qo=this._renderer.getRenderTarget(),jo=this._renderer.getActiveCubeFace(),tl=this._renderer.getActiveMipmapLevel(),el=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=nh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=eh(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?v:0,v,v),h.setRenderTarget(i),_&&h.render(m,o),h.render(t,o)}m.geometry.dispose(),m.material.dispose(),h.toneMapping=d,h.autoClear=u,t.background=g}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===Nn||t.mapping===Jn;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=nh()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=eh());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new _e(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;const l=this._cubeSize;Nr(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,Ko)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s_i&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${_i}`);const p=[];let y=0;for(let C=0;C<_i;++C){const R=C/_,b=Math.exp(-R*R/2);p.push(b),C===0?y+=b:Cv-ns?i-v+ns:0),T=4*(this._cubeSize-x);Nr(e,P,T,3*x,2*x),l.setRenderTarget(e),l.render(u,Ko)}}function D_(r){const t=[],e=[],n=[];let i=r;const s=r-ns+1+Kc.length;for(let a=0;ar-ns?l=Kc[a-r+ns-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,_=3,g=2,p=1,y=new Float32Array(_*m*f),v=new Float32Array(g*m*f),x=new Float32Array(p*m*f);for(let T=0;T2?0:-1,b=[C,R,0,C+2/3,R,0,C+2/3,R+1,0,C,R,0,C+2/3,R+1,0,C,R+1,0];y.set(b,_*m*T),v.set(d,g*m*T);const M=[T,T,T,T,T,T];x.set(M,p*m*T)}const P=new Wt;P.setAttribute("position",new re(y,_)),P.setAttribute("uv",new re(v,g)),P.setAttribute("faceIndex",new re(x,p)),t.push(P),i>ns&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function th(r,t,e){const n=new an(r,t,e);return n.texture.mapping=hs,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Nr(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function U_(r,t,e){const n=new Float32Array(_i),i=new w(0,1,0);return new on({name:"SphericalGaussianBlur",defines:{n:_i,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ql(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Pn,depthTest:!1,depthWrite:!1})}function eh(){return new on({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ql(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Pn,depthTest:!1,depthWrite:!1})}function nh(){return new on({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ql(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Pn,depthTest:!1,depthWrite:!1})}function Ql(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function N_(r){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Hs||l===Gs,h=l===Nn||l===Jn;if(c||h){let u=t.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return e===null&&(e=new Al(r)),u=c?e.fromEquirectangular(o,u):e.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return c&&f&&f.height>0||h&&f&&i(f)?(e===null&&(e=new Al(r)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",s),u.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(P=Math.ceil(x/t.maxTextureSize),x=t.maxTextureSize);const T=new Float32Array(x*P*4*u),C=new so(T,x,P,u);C.type=He,C.needsUpdate=!0;const R=v*4;for(let M=0;M0)return r;const i=t*e;let s=sh[i];if(s===void 0&&(s=new Float32Array(i),sh[i]=s),t!==0){n.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,r[a].toArray(s,o)}return s}function ve(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e":" "} ${o}: ${e[a]}`)}return n.join(` +`)}const uh=new Bt;function N0(r){Yt._getMatrix(uh,Yt.workingColorSpace,r);const t=`mat3( ${uh.elements.map(e=>e.toFixed(4))} )`;switch(Yt.getTransfer(r)){case or:return[t,"LinearTransferOETF"];case se:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",r),[t,"LinearTransferOETF"]}}function dh(r,t,e){const n=r.getShaderParameter(t,r.COMPILE_STATUS),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const a=parseInt(s[1]);return e.toUpperCase()+` + +`+i+` + +`+U0(r.getShaderSource(t),a)}else return i}function F0(r,t){const e=N0(t);return[`vec4 ${r}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` +`)}function O0(r,t){let e;switch(t){case Du:e="Linear";break;case Uu:e="Reinhard";break;case Nu:e="Cineon";break;case Fu:e="ACESFilmic";break;case Bu:e="AgX";break;case zu:e="Neutral";break;case Ou:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Fr=new w;function B0(){Yt.getLuminanceCoefficients(Fr);const r=Fr.x.toFixed(4),t=Fr.y.toFixed(4),e=Fr.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` +`)}function z0(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ls).join(` +`)}function k0(r){const t=[];for(const e in r){const n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function V0(r,t){const e={},n=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function wl(r){return r.replace(H0,W0)}const G0=new Map;function W0(r,t){let e=Gt[t];if(e===void 0){const n=G0.get(t);if(n!==void 0)e=Gt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return wl(e)}const X0=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function mh(r){return r.replace(X0,q0)}function q0(r,t,e,n){let i="";for(let s=parseInt(t);s0&&(g+=` +`),p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m].filter(Ls).join(` +`),p.length>0&&(p+=` +`)):(g=[gh(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Ls).join(` +`),p=[gh(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Ln?"#define TONE_MAPPING":"",e.toneMapping!==Ln?Gt.tonemapping_pars_fragment:"",e.toneMapping!==Ln?O0("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Gt.colorspace_pars_fragment,F0("linearToOutputTexel",e.outputColorSpace),B0(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(Ls).join(` +`)),a=wl(a),a=fh(a,e),a=ph(a,e),o=wl(o),o=fh(o,e),o=ph(o,e),a=mh(a),o=mh(o),e.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,p=["#define varying in",e.glslVersion===Tl?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Tl?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+p);const v=y+g+a,x=y+p+o,P=hh(i,i.VERTEX_SHADER,v),T=hh(i,i.FRAGMENT_SHADER,x);i.attachShader(_,P),i.attachShader(_,T),e.index0AttributeName!==void 0?i.bindAttribLocation(_,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function C(L){if(r.debug.checkShaderErrors){const k=i.getProgramInfoLog(_).trim(),O=i.getShaderInfoLog(P).trim(),V=i.getShaderInfoLog(T).trim();let Z=!0,H=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(Z=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,_,P,T);else{const et=dh(i,P,"vertex"),G=dh(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` + +Material Name: `+L.name+` +Material Type: `+L.type+` + +Program Info Log: `+k+` +`+et+` +`+G)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(O===""||V==="")&&(H=!1);H&&(L.diagnostics={runnable:Z,programLog:k,vertexShader:{log:O,prefix:g},fragmentShader:{log:V,prefix:p}})}i.deleteShader(P),i.deleteShader(T),R=new ca(i,_),b=V0(i,_)}let R;this.getUniforms=function(){return R===void 0&&C(this),R};let b;this.getAttributes=function(){return b===void 0&&C(this),b};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(_,L0)),M},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=D0++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=P,this.fragmentShader=T,this}let j0=0;class tx{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new ex(t),e.set(t,n)),n}}class ex{constructor(t){this.id=j0++,this.code=t,this.usedTimes=0}}function nx(r,t,e,n,i,s,a){const o=new ro,l=new tx,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=i.vertexTextures;let f=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,M,L,k,O){const V=k.fog,Z=O.geometry,H=b.isMeshStandardMaterial?k.environment:null,et=(b.isMeshStandardMaterial?e:t).get(b.envMap||H),G=et&&et.mapping===hs?et.image.height:null,ot=m[b.type];b.precision!==null&&(f=i.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const mt=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,Mt=mt!==void 0?mt.length:0;let zt=0;Z.morphAttributes.position!==void 0&&(zt=1),Z.morphAttributes.normal!==void 0&&(zt=2),Z.morphAttributes.color!==void 0&&(zt=3);let te,Y,it,bt;if(ot){const ie=rn[ot];te=ie.vertexShader,Y=ie.fragmentShader}else te=b.vertexShader,Y=b.fragmentShader,l.update(b),it=l.getVertexShaderID(b),bt=l.getFragmentShaderID(b);const rt=r.getRenderTarget(),It=r.state.buffers.depth.getReversed(),Ft=O.isInstancedMesh===!0,Ut=O.isBatchedMesh===!0,Jt=!!b.map,K=!!b.matcap,nt=!!et,I=!!b.aoMap,Ct=!!b.lightMap,j=!!b.bumpMap,xt=!!b.normalMap,at=!!b.displacementMap,Pt=!!b.emissiveMap,gt=!!b.metalnessMap,A=!!b.roughnessMap,S=b.anisotropy>0,F=b.clearcoat>0,X=b.dispersion>0,Q=b.iridescence>0,q=b.sheen>0,Et=b.transmission>0,ct=S&&!!b.anisotropyMap,_t=F&&!!b.clearcoatMap,qt=F&&!!b.clearcoatNormalMap,tt=F&&!!b.clearcoatRoughnessMap,vt=Q&&!!b.iridescenceMap,Lt=Q&&!!b.iridescenceThicknessMap,Nt=q&&!!b.sheenColorMap,yt=q&&!!b.sheenRoughnessMap,Zt=!!b.specularMap,Xt=!!b.specularColorMap,ae=!!b.specularIntensityMap,D=Et&&!!b.transmissionMap,ht=Et&&!!b.thicknessMap,W=!!b.gradientMap,J=!!b.alphaMap,ft=b.alphaTest>0,ut=!!b.alphaHash,Vt=!!b.extensions;let ue=Ln;b.toneMapped&&(rt===null||rt.isXRRenderTarget===!0)&&(ue=r.toneMapping);const Ee={shaderID:ot,shaderType:b.type,shaderName:b.name,vertexShader:te,fragmentShader:Y,defines:b.defines,customVertexShaderID:it,customFragmentShaderID:bt,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:Ut,batchingColor:Ut&&O._colorsTexture!==null,instancing:Ft,instancingColor:Ft&&O.instanceColor!==null,instancingMorph:Ft&&O.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:rt===null?r.outputColorSpace:rt.isXRRenderTarget===!0?rt.texture.colorSpace:Pi,alphaToCoverage:!!b.alphaToCoverage,map:Jt,matcap:K,envMap:nt,envMapMode:nt&&et.mapping,envMapCubeUVHeight:G,aoMap:I,lightMap:Ct,bumpMap:j,normalMap:xt,displacementMap:d&&at,emissiveMap:Pt,normalMapObjectSpace:xt&&b.normalMapType===qu,normalMapTangentSpace:xt&&b.normalMapType===Kn,metalnessMap:gt,roughnessMap:A,anisotropy:S,anisotropyMap:ct,clearcoat:F,clearcoatMap:_t,clearcoatNormalMap:qt,clearcoatRoughnessMap:tt,dispersion:X,iridescence:Q,iridescenceMap:vt,iridescenceThicknessMap:Lt,sheen:q,sheenColorMap:Nt,sheenRoughnessMap:yt,specularMap:Zt,specularColorMap:Xt,specularIntensityMap:ae,transmission:Et,transmissionMap:D,thicknessMap:ht,gradientMap:W,opaque:b.transparent===!1&&b.blending===Si&&b.alphaToCoverage===!1,alphaMap:J,alphaTest:ft,alphaHash:ut,combine:b.combine,mapUv:Jt&&_(b.map.channel),aoMapUv:I&&_(b.aoMap.channel),lightMapUv:Ct&&_(b.lightMap.channel),bumpMapUv:j&&_(b.bumpMap.channel),normalMapUv:xt&&_(b.normalMap.channel),displacementMapUv:at&&_(b.displacementMap.channel),emissiveMapUv:Pt&&_(b.emissiveMap.channel),metalnessMapUv:gt&&_(b.metalnessMap.channel),roughnessMapUv:A&&_(b.roughnessMap.channel),anisotropyMapUv:ct&&_(b.anisotropyMap.channel),clearcoatMapUv:_t&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:qt&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:vt&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:Lt&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:Nt&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:yt&&_(b.sheenRoughnessMap.channel),specularMapUv:Zt&&_(b.specularMap.channel),specularColorMapUv:Xt&&_(b.specularColorMap.channel),specularIntensityMapUv:ae&&_(b.specularIntensityMap.channel),transmissionMapUv:D&&_(b.transmissionMap.channel),thicknessMapUv:ht&&_(b.thicknessMap.channel),alphaMapUv:J&&_(b.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(xt||S),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:O.isPoints===!0&&!!Z.attributes.uv&&(Jt||J),fog:!!V,useFog:b.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:It,skinning:O.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:Mt,morphTextureStride:zt,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:ue,decodeVideoTexture:Jt&&b.map.isVideoTexture===!0&&Yt.getTransfer(b.map.colorSpace)===se,decodeVideoTextureEmissive:Pt&&b.emissiveMap.isVideoTexture===!0&&Yt.getTransfer(b.emissiveMap.colorSpace)===se,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===dn,flipSided:b.side===Ue,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Vt&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Vt&&b.extensions.multiDraw===!0||Ut)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Ee.vertexUv1s=c.has(1),Ee.vertexUv2s=c.has(2),Ee.vertexUv3s=c.has(3),c.clear(),Ee}function p(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)M.push(L),M.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(y(M,b),v(M,b),M.push(r.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function y(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function v(b,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),b.push(o.mask)}function x(b){const M=m[b.type];let L;if(M){const k=rn[M];L=ad.clone(k.uniforms)}else L=b.uniforms;return L}function P(b,M){let L;for(let k=0,O=h.length;k0?n.push(p):f.transparent===!0?i.push(p):e.push(p)}function l(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):e.unshift(p)}function c(u,d){e.length>1&&e.sort(u||sx),n.length>1&&n.sort(d||_h),i.length>1&&i.sort(d||_h)}function h(){for(let u=t,d=r.length;u=s.length?(a=new xh,s.push(a)):a=s[i],a}function e(){r=new WeakMap}return{get:t,dispose:e}}function ax(){const r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new w,color:new pt};break;case"SpotLight":e={position:new w,direction:new w,color:new pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new w,color:new pt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new w,skyColor:new pt,groundColor:new pt};break;case"RectAreaLight":e={color:new pt,position:new w,halfWidth:new w,halfHeight:new w};break}return r[t.id]=e,e}}}function ox(){const r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new $};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new $};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new $,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}let lx=0;function cx(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function hx(r){const t=new ax,e=ox(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new w);const i=new w,s=new Dt,a=new Dt;function o(c){let h=0,u=0,d=0;for(let b=0;b<9;b++)n.probe[b].set(0,0,0);let f=0,m=0,_=0,g=0,p=0,y=0,v=0,x=0,P=0,T=0,C=0;c.sort(cx);for(let b=0,M=c.length;b0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=lt.LTC_FLOAT_1,n.rectAreaLTC2=lt.LTC_FLOAT_2):(n.rectAreaLTC1=lt.LTC_HALF_1,n.rectAreaLTC2=lt.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const R=n.hash;(R.directionalLength!==f||R.pointLength!==m||R.spotLength!==_||R.rectAreaLength!==g||R.hemiLength!==p||R.numDirectionalShadows!==y||R.numPointShadows!==v||R.numSpotShadows!==x||R.numSpotMaps!==P||R.numLightProbes!==C)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=v,n.pointShadowMap.length=v,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=v,n.spotLightMatrix.length=x+P-T,n.spotLightMap.length=P,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,R.directionalLength=f,R.pointLength=m,R.spotLength=_,R.rectAreaLength=g,R.hemiLength=p,R.numDirectionalShadows=y,R.numPointShadows=v,R.numSpotShadows=x,R.numSpotMaps=P,R.numLightProbes=C,n.version=lx++)}function l(c,h){let u=0,d=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,y=c.length;p=a.length?(o=new vh(r),a.push(o)):o=a[s],o}function n(){t=new WeakMap}return{get:e,dispose:n}}class tc extends Re{static get type(){return"MeshDepthMaterial"}constructor(t){super(),this.isMeshDepthMaterial=!0,this.depthPacking=Wu,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class ec extends Re{static get type(){return"MeshDistanceMaterial"}constructor(t){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const dx=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,fx=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function px(r,t,e){let n=new cr;const i=new $,s=new $,a=new Kt,o=new tc({depthPacking:Xu}),l=new ec,c={},h=e.maxTextureSize,u={[Un]:Ue,[Ue]:Un,[dn]:dn},d=new on({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new $},radius:{value:4}},vertexShader:dx,fragmentShader:fx}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new Wt;m.setAttribute("position",new re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new _e(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Nl;let p=this.type;this.render=function(T,C,R){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const b=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),k=r.state;k.setBlending(Pn),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);const O=p!==un&&this.type===un,V=p===un&&this.type!==un;for(let Z=0,H=T.length;Zh||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/ot.x),i.x=s.x*ot.x,G.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/ot.y),i.y=s.y*ot.y,G.mapSize.y=s.y)),G.map===null||O===!0||V===!0){const Mt=this.type!==un?{minFilter:be,magFilter:be}:{};G.map!==null&&G.map.dispose(),G.map=new an(i.x,i.y,Mt),G.map.texture.name=et.name+".shadowMap",G.camera.updateProjectionMatrix()}r.setRenderTarget(G.map),r.clear();const mt=G.getViewportCount();for(let Mt=0;Mt0||C.map&&C.alphaTest>0){const k=M.uuid,O=C.uuid;let V=c[k];V===void 0&&(V={},c[k]=V);let Z=V[O];Z===void 0&&(Z=M.clone(),V[O]=Z,C.addEventListener("dispose",P)),M=Z}if(M.visible=C.visible,M.wireframe=C.wireframe,b===un?M.side=C.shadowSide!==null?C.shadowSide:C.side:M.side=C.shadowSide!==null?C.shadowSide:u[C.side],M.alphaMap=C.alphaMap,M.alphaTest=C.alphaTest,M.map=C.map,M.clipShadows=C.clipShadows,M.clippingPlanes=C.clippingPlanes,M.clipIntersection=C.clipIntersection,M.displacementMap=C.displacementMap,M.displacementScale=C.displacementScale,M.displacementBias=C.displacementBias,M.wireframeLinewidth=C.wireframeLinewidth,M.linewidth=C.linewidth,R.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const k=r.properties.get(M);k.light=R}return M}function x(T,C,R,b,M){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===un)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,T.matrixWorld);const O=t.update(T),V=T.material;if(Array.isArray(V)){const Z=O.groups;for(let H=0,et=Z.length;H=1):G.indexOf("OpenGL ES")!==-1&&(et=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),H=et>=2);let ot=null,mt={};const Mt=r.getParameter(r.SCISSOR_BOX),zt=r.getParameter(r.VIEWPORT),te=new Kt().fromArray(Mt),Y=new Kt().fromArray(zt);function it(D,ht,W,J){const ft=new Uint8Array(4),ut=r.createTexture();r.bindTexture(D,ut),r.texParameteri(D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(D,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Vt=0;Vtt?(r.repeat.x=1,r.repeat.y=e/t,r.offset.x=0,r.offset.y=(1-r.repeat.y)/2):(r.repeat.x=t/e,r.repeat.y=1,r.offset.x=(1-r.repeat.x)/2,r.offset.y=0),r}function xx(r,t){const e=r.image&&r.image.width?r.image.width/r.image.height:1;return e>t?(r.repeat.x=t/e,r.repeat.y=1,r.offset.x=(1-r.repeat.x)/2,r.offset.y=0):(r.repeat.x=1,r.repeat.y=e/t,r.offset.x=0,r.offset.y=(1-r.repeat.y)/2),r}function vx(r){return r.repeat.x=1,r.repeat.y=1,r.offset.x=0,r.offset.y=0,r}function Cl(r,t,e,n){const i=yx(n);switch(e){case kl:return r*t;case Hl:return r*t;case Gl:return r*t*2;case to:return r*t/i.components*i.byteLength;case ar:return r*t/i.components*i.byteLength;case Wl:return r*t*2/i.components*i.byteLength;case eo:return r*t*2/i.components*i.byteLength;case Vl:return r*t*3/i.components*i.byteLength;case De:return r*t*4/i.components*i.byteLength;case no:return r*t*4/i.components*i.byteLength;case Us:case Ns:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case Fs:case Os:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case ya:case Sa:return Math.max(r,16)*Math.max(t,8)/4;case va:case Ma:return Math.max(r,8)*Math.max(t,8)/2;case ba:case Ea:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case Ta:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case Aa:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case wa:return Math.floor((r+4)/5)*Math.floor((t+3)/4)*16;case Ca:return Math.floor((r+4)/5)*Math.floor((t+4)/5)*16;case Ra:return Math.floor((r+5)/6)*Math.floor((t+4)/5)*16;case Ia:return Math.floor((r+5)/6)*Math.floor((t+5)/6)*16;case Pa:return Math.floor((r+7)/8)*Math.floor((t+4)/5)*16;case La:return Math.floor((r+7)/8)*Math.floor((t+5)/6)*16;case Da:return Math.floor((r+7)/8)*Math.floor((t+7)/8)*16;case Ua:return Math.floor((r+9)/10)*Math.floor((t+4)/5)*16;case Na:return Math.floor((r+9)/10)*Math.floor((t+5)/6)*16;case Fa:return Math.floor((r+9)/10)*Math.floor((t+7)/8)*16;case Oa:return Math.floor((r+9)/10)*Math.floor((t+9)/10)*16;case Ba:return Math.floor((r+11)/12)*Math.floor((t+9)/10)*16;case za:return Math.floor((r+11)/12)*Math.floor((t+11)/12)*16;case Bs:case ka:case Va:return Math.ceil(r/4)*Math.ceil(t/4)*16;case Xl:case Ha:return Math.ceil(r/4)*Math.ceil(t/4)*8;case Ga:case Wa:return Math.ceil(r/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function yx(r){switch(r){case _n:case Ol:return{byteLength:1,components:1};case as:case Bl:case us:return{byteLength:2,components:1};case Qa:case ja:return{byteLength:2,components:4};case Fn:case Ka:case He:return{byteLength:4,components:1};case zl:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}const Mx={contain:_x,cover:xx,fill:vx,getByteLength:Cl};function Sx(r,t,e,n,i,s,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new $,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(A,S){return f?new OffscreenCanvas(A,S):$s("canvas")}function _(A,S,F){let X=1;const Q=gt(A);if((Q.width>F||Q.height>F)&&(X=F/Math.max(Q.width,Q.height)),X<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){const q=Math.floor(X*Q.width),Et=Math.floor(X*Q.height);u===void 0&&(u=m(q,Et));const ct=S?m(q,Et):u;return ct.width=q,ct.height=Et,ct.getContext("2d").drawImage(A,0,0,q,Et),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Q.width+"x"+Q.height+") to ("+q+"x"+Et+")."),ct}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Q.width+"x"+Q.height+")."),A;return A}function g(A){return A.generateMipmaps}function p(A){r.generateMipmap(A)}function y(A){return A.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:A.isWebGL3DRenderTarget?r.TEXTURE_3D:A.isWebGLArrayRenderTarget||A.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function v(A,S,F,X,Q=!1){if(A!==null){if(r[A]!==void 0)return r[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let q=S;if(S===r.RED&&(F===r.FLOAT&&(q=r.R32F),F===r.HALF_FLOAT&&(q=r.R16F),F===r.UNSIGNED_BYTE&&(q=r.R8)),S===r.RED_INTEGER&&(F===r.UNSIGNED_BYTE&&(q=r.R8UI),F===r.UNSIGNED_SHORT&&(q=r.R16UI),F===r.UNSIGNED_INT&&(q=r.R32UI),F===r.BYTE&&(q=r.R8I),F===r.SHORT&&(q=r.R16I),F===r.INT&&(q=r.R32I)),S===r.RG&&(F===r.FLOAT&&(q=r.RG32F),F===r.HALF_FLOAT&&(q=r.RG16F),F===r.UNSIGNED_BYTE&&(q=r.RG8)),S===r.RG_INTEGER&&(F===r.UNSIGNED_BYTE&&(q=r.RG8UI),F===r.UNSIGNED_SHORT&&(q=r.RG16UI),F===r.UNSIGNED_INT&&(q=r.RG32UI),F===r.BYTE&&(q=r.RG8I),F===r.SHORT&&(q=r.RG16I),F===r.INT&&(q=r.RG32I)),S===r.RGB_INTEGER&&(F===r.UNSIGNED_BYTE&&(q=r.RGB8UI),F===r.UNSIGNED_SHORT&&(q=r.RGB16UI),F===r.UNSIGNED_INT&&(q=r.RGB32UI),F===r.BYTE&&(q=r.RGB8I),F===r.SHORT&&(q=r.RGB16I),F===r.INT&&(q=r.RGB32I)),S===r.RGBA_INTEGER&&(F===r.UNSIGNED_BYTE&&(q=r.RGBA8UI),F===r.UNSIGNED_SHORT&&(q=r.RGBA16UI),F===r.UNSIGNED_INT&&(q=r.RGBA32UI),F===r.BYTE&&(q=r.RGBA8I),F===r.SHORT&&(q=r.RGBA16I),F===r.INT&&(q=r.RGBA32I)),S===r.RGB&&F===r.UNSIGNED_INT_5_9_9_9_REV&&(q=r.RGB9_E5),S===r.RGBA){const Et=Q?or:Yt.getTransfer(X);F===r.FLOAT&&(q=r.RGBA32F),F===r.HALF_FLOAT&&(q=r.RGBA16F),F===r.UNSIGNED_BYTE&&(q=Et===se?r.SRGB8_ALPHA8:r.RGBA8),F===r.UNSIGNED_SHORT_4_4_4_4&&(q=r.RGBA4),F===r.UNSIGNED_SHORT_5_5_5_1&&(q=r.RGB5_A1)}return(q===r.R16F||q===r.R32F||q===r.RG16F||q===r.RG32F||q===r.RGBA16F||q===r.RGBA32F)&&t.get("EXT_color_buffer_float"),q}function x(A,S){let F;return A?S===null||S===Fn||S===wi?F=r.DEPTH24_STENCIL8:S===He?F=r.DEPTH32F_STENCIL8:S===as&&(F=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):S===null||S===Fn||S===wi?F=r.DEPTH_COMPONENT24:S===He?F=r.DEPTH_COMPONENT32F:S===as&&(F=r.DEPTH_COMPONENT16),F}function P(A,S){return g(A)===!0||A.isFramebufferTexture&&A.minFilter!==be&&A.minFilter!==xe?Math.log2(Math.max(S.width,S.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?S.mipmaps.length:1}function T(A){const S=A.target;S.removeEventListener("dispose",T),R(S),S.isVideoTexture&&h.delete(S)}function C(A){const S=A.target;S.removeEventListener("dispose",C),M(S)}function R(A){const S=n.get(A);if(S.__webglInit===void 0)return;const F=A.source,X=d.get(F);if(X){const Q=X[S.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&b(A),Object.keys(X).length===0&&d.delete(F)}n.remove(A)}function b(A){const S=n.get(A);r.deleteTexture(S.__webglTexture);const F=A.source,X=d.get(F);delete X[S.__cacheKey],a.memory.textures--}function M(A){const S=n.get(A);if(A.depthTexture&&(A.depthTexture.dispose(),n.remove(A.depthTexture)),A.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(S.__webglFramebuffer[X]))for(let Q=0;Q=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+i.maxTextures),L+=1,A}function V(A){const S=[];return S.push(A.wrapS),S.push(A.wrapT),S.push(A.wrapR||0),S.push(A.magFilter),S.push(A.minFilter),S.push(A.anisotropy),S.push(A.internalFormat),S.push(A.format),S.push(A.type),S.push(A.generateMipmaps),S.push(A.premultiplyAlpha),S.push(A.flipY),S.push(A.unpackAlignment),S.push(A.colorSpace),S.join()}function Z(A,S){const F=n.get(A);if(A.isVideoTexture&&at(A),A.isRenderTargetTexture===!1&&A.version>0&&F.__version!==A.version){const X=A.image;if(X===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(X.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(F,A,S);return}}e.bindTexture(r.TEXTURE_2D,F.__webglTexture,r.TEXTURE0+S)}function H(A,S){const F=n.get(A);if(A.version>0&&F.__version!==A.version){Y(F,A,S);return}e.bindTexture(r.TEXTURE_2D_ARRAY,F.__webglTexture,r.TEXTURE0+S)}function et(A,S){const F=n.get(A);if(A.version>0&&F.__version!==A.version){Y(F,A,S);return}e.bindTexture(r.TEXTURE_3D,F.__webglTexture,r.TEXTURE0+S)}function G(A,S){const F=n.get(A);if(A.version>0&&F.__version!==A.version){it(F,A,S);return}e.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+S)}const ot={[Ws]:r.REPEAT,[Qe]:r.CLAMP_TO_EDGE,[Xs]:r.MIRRORED_REPEAT},mt={[be]:r.NEAREST,[Fl]:r.NEAREST_MIPMAP_NEAREST,[ts]:r.NEAREST_MIPMAP_LINEAR,[xe]:r.LINEAR,[Ds]:r.LINEAR_MIPMAP_NEAREST,[fn]:r.LINEAR_MIPMAP_LINEAR},Mt={[Yu]:r.NEVER,[ju]:r.ALWAYS,[Zu]:r.LESS,[Yl]:r.LEQUAL,[Ju]:r.EQUAL,[Qu]:r.GEQUAL,[$u]:r.GREATER,[Ku]:r.NOTEQUAL};function zt(A,S){if(S.type===He&&t.has("OES_texture_float_linear")===!1&&(S.magFilter===xe||S.magFilter===Ds||S.magFilter===ts||S.magFilter===fn||S.minFilter===xe||S.minFilter===Ds||S.minFilter===ts||S.minFilter===fn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(A,r.TEXTURE_WRAP_S,ot[S.wrapS]),r.texParameteri(A,r.TEXTURE_WRAP_T,ot[S.wrapT]),(A===r.TEXTURE_3D||A===r.TEXTURE_2D_ARRAY)&&r.texParameteri(A,r.TEXTURE_WRAP_R,ot[S.wrapR]),r.texParameteri(A,r.TEXTURE_MAG_FILTER,mt[S.magFilter]),r.texParameteri(A,r.TEXTURE_MIN_FILTER,mt[S.minFilter]),S.compareFunction&&(r.texParameteri(A,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(A,r.TEXTURE_COMPARE_FUNC,Mt[S.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(S.magFilter===be||S.minFilter!==ts&&S.minFilter!==fn||S.type===He&&t.has("OES_texture_float_linear")===!1)return;if(S.anisotropy>1||n.get(S).__currentAnisotropy){const F=t.get("EXT_texture_filter_anisotropic");r.texParameterf(A,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(S.anisotropy,i.getMaxAnisotropy())),n.get(S).__currentAnisotropy=S.anisotropy}}}function te(A,S){let F=!1;A.__webglInit===void 0&&(A.__webglInit=!0,S.addEventListener("dispose",T));const X=S.source;let Q=d.get(X);Q===void 0&&(Q={},d.set(X,Q));const q=V(S);if(q!==A.__cacheKey){Q[q]===void 0&&(Q[q]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,F=!0),Q[q].usedTimes++;const Et=Q[A.__cacheKey];Et!==void 0&&(Q[A.__cacheKey].usedTimes--,Et.usedTimes===0&&b(S)),A.__cacheKey=q,A.__webglTexture=Q[q].texture}return F}function Y(A,S,F){let X=r.TEXTURE_2D;(S.isDataArrayTexture||S.isCompressedArrayTexture)&&(X=r.TEXTURE_2D_ARRAY),S.isData3DTexture&&(X=r.TEXTURE_3D);const Q=te(A,S),q=S.source;e.bindTexture(X,A.__webglTexture,r.TEXTURE0+F);const Et=n.get(q);if(q.version!==Et.__version||Q===!0){e.activeTexture(r.TEXTURE0+F);const ct=Yt.getPrimaries(Yt.workingColorSpace),_t=S.colorSpace===Cn?null:Yt.getPrimaries(S.colorSpace),qt=S.colorSpace===Cn||ct===_t?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,S.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,S.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,qt);let tt=_(S.image,!1,i.maxTextureSize);tt=Pt(S,tt);const vt=s.convert(S.format,S.colorSpace),Lt=s.convert(S.type);let Nt=v(S.internalFormat,vt,Lt,S.colorSpace,S.isVideoTexture);zt(X,S);let yt;const Zt=S.mipmaps,Xt=S.isVideoTexture!==!0,ae=Et.__version===void 0||Q===!0,D=q.dataReady,ht=P(S,tt);if(S.isDepthTexture)Nt=x(S.format===Ci,S.type),ae&&(Xt?e.texStorage2D(r.TEXTURE_2D,1,Nt,tt.width,tt.height):e.texImage2D(r.TEXTURE_2D,0,Nt,tt.width,tt.height,0,vt,Lt,null));else if(S.isDataTexture)if(Zt.length>0){Xt&&ae&&e.texStorage2D(r.TEXTURE_2D,ht,Nt,Zt[0].width,Zt[0].height);for(let W=0,J=Zt.length;W0){const ft=Cl(yt.width,yt.height,S.format,S.type);for(const ut of S.layerUpdates){const Vt=yt.data.subarray(ut*ft/yt.data.BYTES_PER_ELEMENT,(ut+1)*ft/yt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,W,0,0,ut,yt.width,yt.height,1,vt,Vt)}S.clearLayerUpdates()}else e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,W,0,0,0,yt.width,yt.height,tt.depth,vt,yt.data)}else e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,W,Nt,yt.width,yt.height,tt.depth,0,yt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Xt?D&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,W,0,0,0,yt.width,yt.height,tt.depth,vt,Lt,yt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,W,Nt,yt.width,yt.height,tt.depth,0,vt,Lt,yt.data)}else{Xt&&ae&&e.texStorage2D(r.TEXTURE_2D,ht,Nt,Zt[0].width,Zt[0].height);for(let W=0,J=Zt.length;W0){const W=Cl(tt.width,tt.height,S.format,S.type);for(const J of S.layerUpdates){const ft=tt.data.subarray(J*W/tt.data.BYTES_PER_ELEMENT,(J+1)*W/tt.data.BYTES_PER_ELEMENT);e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,J,tt.width,tt.height,1,vt,Lt,ft)}S.clearLayerUpdates()}else e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,tt.width,tt.height,tt.depth,vt,Lt,tt.data)}else e.texImage3D(r.TEXTURE_2D_ARRAY,0,Nt,tt.width,tt.height,tt.depth,0,vt,Lt,tt.data);else if(S.isData3DTexture)Xt?(ae&&e.texStorage3D(r.TEXTURE_3D,ht,Nt,tt.width,tt.height,tt.depth),D&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,tt.width,tt.height,tt.depth,vt,Lt,tt.data)):e.texImage3D(r.TEXTURE_3D,0,Nt,tt.width,tt.height,tt.depth,0,vt,Lt,tt.data);else if(S.isFramebufferTexture){if(ae)if(Xt)e.texStorage2D(r.TEXTURE_2D,ht,Nt,tt.width,tt.height);else{let W=tt.width,J=tt.height;for(let ft=0;ft>=1,J>>=1}}else if(Zt.length>0){if(Xt&&ae){const W=gt(Zt[0]);e.texStorage2D(r.TEXTURE_2D,ht,Nt,W.width,W.height)}for(let W=0,J=Zt.length;W0&&ht++;const J=gt(vt[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,ht,Zt,J.width,J.height)}for(let J=0;J<6;J++)if(tt){Xt?D&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,0,0,vt[J].width,vt[J].height,Nt,yt,vt[J].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,Zt,vt[J].width,vt[J].height,0,Nt,yt,vt[J].data);for(let ft=0;ft>q),Lt=Math.max(1,S.height>>q);Q===r.TEXTURE_3D||Q===r.TEXTURE_2D_ARRAY?e.texImage3D(Q,q,_t,vt,Lt,S.depth,0,Et,ct,null):e.texImage2D(Q,q,_t,vt,Lt,0,Et,ct,null)}e.bindFramebuffer(r.FRAMEBUFFER,A),xt(S)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,X,Q,tt.__webglTexture,0,j(S)):(Q===r.TEXTURE_2D||Q>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,X,Q,tt.__webglTexture,q),e.bindFramebuffer(r.FRAMEBUFFER,null)}function rt(A,S,F){if(r.bindRenderbuffer(r.RENDERBUFFER,A),S.depthBuffer){const X=S.depthTexture,Q=X&&X.isDepthTexture?X.type:null,q=x(S.stencilBuffer,Q),Et=S.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ct=j(S);xt(S)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ct,q,S.width,S.height):F?r.renderbufferStorageMultisample(r.RENDERBUFFER,ct,q,S.width,S.height):r.renderbufferStorage(r.RENDERBUFFER,q,S.width,S.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Et,r.RENDERBUFFER,A)}else{const X=S.textures;for(let Q=0;Q{delete S.__boundDepthTexture,delete S.__depthDisposeCallback,X.removeEventListener("dispose",Q)};X.addEventListener("dispose",Q),S.__depthDisposeCallback=Q}S.__boundDepthTexture=X}if(A.depthTexture&&!S.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");It(S.__webglFramebuffer,A)}else if(F){S.__webglDepthbuffer=[];for(let X=0;X<6;X++)if(e.bindFramebuffer(r.FRAMEBUFFER,S.__webglFramebuffer[X]),S.__webglDepthbuffer[X]===void 0)S.__webglDepthbuffer[X]=r.createRenderbuffer(),rt(S.__webglDepthbuffer[X],A,!1);else{const Q=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,q=S.__webglDepthbuffer[X];r.bindRenderbuffer(r.RENDERBUFFER,q),r.framebufferRenderbuffer(r.FRAMEBUFFER,Q,r.RENDERBUFFER,q)}}else if(e.bindFramebuffer(r.FRAMEBUFFER,S.__webglFramebuffer),S.__webglDepthbuffer===void 0)S.__webglDepthbuffer=r.createRenderbuffer(),rt(S.__webglDepthbuffer,A,!1);else{const X=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Q=S.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,Q),r.framebufferRenderbuffer(r.FRAMEBUFFER,X,r.RENDERBUFFER,Q)}e.bindFramebuffer(r.FRAMEBUFFER,null)}function Ut(A,S,F){const X=n.get(A);S!==void 0&&bt(X.__webglFramebuffer,A,A.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),F!==void 0&&Ft(A)}function Jt(A){const S=A.texture,F=n.get(A),X=n.get(S);A.addEventListener("dispose",C);const Q=A.textures,q=A.isWebGLCubeRenderTarget===!0,Et=Q.length>1;if(Et||(X.__webglTexture===void 0&&(X.__webglTexture=r.createTexture()),X.__version=S.version,a.memory.textures++),q){F.__webglFramebuffer=[];for(let ct=0;ct<6;ct++)if(S.mipmaps&&S.mipmaps.length>0){F.__webglFramebuffer[ct]=[];for(let _t=0;_t0){F.__webglFramebuffer=[];for(let ct=0;ct0&&xt(A)===!1){F.__webglMultisampledFramebuffer=r.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ct=0;ct0)for(let _t=0;_t0)for(let _t=0;_t0){if(xt(A)===!1){const S=A.textures,F=A.width,X=A.height;let Q=r.COLOR_BUFFER_BIT;const q=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Et=n.get(A),ct=S.length>1;if(ct)for(let _t=0;_t0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&S.__useRenderToTexture!==!1}function at(A){const S=a.render.frame;h.get(A)!==S&&(h.set(A,S),A.update())}function Pt(A,S){const F=A.colorSpace,X=A.format,Q=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||F!==Pi&&F!==Cn&&(Yt.getTransfer(F)===se?(X!==De||Q!==_n)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),S}function gt(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=O,this.resetTextureUnits=k,this.setTexture2D=Z,this.setTexture2DArray=H,this.setTexture3D=et,this.setTextureCube=G,this.rebindTextures=Ut,this.setupRenderTarget=Jt,this.updateRenderTargetMipmap=K,this.updateMultisampleRenderTarget=Ct,this.setupDepthRenderbuffer=Ft,this.setupFrameBufferTexture=bt,this.useMultisampledRTT=xt}function pd(r,t){function e(n,i=Cn){let s;const a=Yt.getTransfer(i);if(n===_n)return r.UNSIGNED_BYTE;if(n===Qa)return r.UNSIGNED_SHORT_4_4_4_4;if(n===ja)return r.UNSIGNED_SHORT_5_5_5_1;if(n===zl)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===Ol)return r.BYTE;if(n===Bl)return r.SHORT;if(n===as)return r.UNSIGNED_SHORT;if(n===Ka)return r.INT;if(n===Fn)return r.UNSIGNED_INT;if(n===He)return r.FLOAT;if(n===us)return r.HALF_FLOAT;if(n===kl)return r.ALPHA;if(n===Vl)return r.RGB;if(n===De)return r.RGBA;if(n===Hl)return r.LUMINANCE;if(n===Gl)return r.LUMINANCE_ALPHA;if(n===bi)return r.DEPTH_COMPONENT;if(n===Ci)return r.DEPTH_STENCIL;if(n===to)return r.RED;if(n===ar)return r.RED_INTEGER;if(n===Wl)return r.RG;if(n===eo)return r.RG_INTEGER;if(n===no)return r.RGBA_INTEGER;if(n===Us||n===Ns||n===Fs||n===Os)if(a===se)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Us)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ns)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Fs)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Os)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Us)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ns)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Fs)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Os)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===va||n===ya||n===Ma||n===Sa)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===va)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ya)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ma)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Sa)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===ba||n===Ea||n===Ta)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===ba||n===Ea)return a===se?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Ta)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Aa||n===wa||n===Ca||n===Ra||n===Ia||n===Pa||n===La||n===Da||n===Ua||n===Na||n===Fa||n===Oa||n===Ba||n===za)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Aa)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===wa)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ca)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Ra)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Ia)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Pa)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===La)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Da)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ua)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Na)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Fa)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Oa)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Ba)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===za)return a===se?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Bs||n===ka||n===Va)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===Bs)return a===se?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===ka)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Va)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Xl||n===Ha||n===Ga||n===Wa)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===Bs)return s.COMPRESSED_RED_RGTC1_EXT;if(n===Ha)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Ga)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Wa)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===wi?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}class md extends Se{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class is extends Qt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const bx={type:"move"};class il{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new is,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new is,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new w,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new w),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new is,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new w,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new w),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const _ of t.hand.values()){const g=e.getJointPose(_,n),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;c.inputState.pinching&&d>f+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=f-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(bx)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new is;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const Ex=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Tx=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class Ax{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const i=new pe,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new on({vertexShader:Ex,fragmentShader:Tx,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new _e(new fs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class wx extends xn{constructor(t,e){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=new Ax,g=e.getContextAttributes();let p=null,y=null;const v=[],x=[],P=new $;let T=null;const C=new Se;C.viewport=new Kt;const R=new Se;R.viewport=new Kt;const b=[C,R],M=new md;let L=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let it=v[Y];return it===void 0&&(it=new il,v[Y]=it),it.getTargetRaySpace()},this.getControllerGrip=function(Y){let it=v[Y];return it===void 0&&(it=new il,v[Y]=it),it.getGripSpace()},this.getHand=function(Y){let it=v[Y];return it===void 0&&(it=new il,v[Y]=it),it.getHandSpace()};function O(Y){const it=x.indexOf(Y.inputSource);if(it===-1)return;const bt=v[it];bt!==void 0&&(bt.update(Y.inputSource,Y.frame,c||a),bt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){i.removeEventListener("select",O),i.removeEventListener("selectstart",O),i.removeEventListener("selectend",O),i.removeEventListener("squeeze",O),i.removeEventListener("squeezestart",O),i.removeEventListener("squeezeend",O),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",Z);for(let Y=0;Y=0&&(x[rt]=null,v[rt].disconnect(bt))}for(let it=0;it=x.length){x.push(bt),rt=Ft;break}else if(x[Ft]===null){x[Ft]=bt,rt=Ft;break}if(rt===-1)break}const It=v[rt];It&&It.connect(bt)}}const H=new w,et=new w;function G(Y,it,bt){H.setFromMatrixPosition(it.matrixWorld),et.setFromMatrixPosition(bt.matrixWorld);const rt=H.distanceTo(et),It=it.projectionMatrix.elements,Ft=bt.projectionMatrix.elements,Ut=It[14]/(It[10]-1),Jt=It[14]/(It[10]+1),K=(It[9]+1)/It[5],nt=(It[9]-1)/It[5],I=(It[8]-1)/It[0],Ct=(Ft[8]+1)/Ft[0],j=Ut*I,xt=Ut*Ct,at=rt/(-I+Ct),Pt=at*-I;if(it.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Pt),Y.translateZ(at),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),It[10]===-1)Y.projectionMatrix.copy(it.projectionMatrix),Y.projectionMatrixInverse.copy(it.projectionMatrixInverse);else{const gt=Ut+at,A=Jt+at,S=j-Pt,F=xt+(rt-Pt),X=K*Jt/A*gt,Q=nt*Jt/A*gt;Y.projectionMatrix.makePerspective(S,F,X,Q,gt,A),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function ot(Y,it){it===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(it.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let it=Y.near,bt=Y.far;_.texture!==null&&(_.depthNear>0&&(it=_.depthNear),_.depthFar>0&&(bt=_.depthFar)),M.near=R.near=C.near=it,M.far=R.far=C.far=bt,(L!==M.near||k!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,k=M.far),C.layers.mask=Y.layers.mask|2,R.layers.mask=Y.layers.mask|4,M.layers.mask=C.layers.mask|R.layers.mask;const rt=Y.parent,It=M.cameras;ot(M,rt);for(let Ft=0;Ft0&&(g.alphaTest.value=p.alphaTest);const y=t.get(p),v=y.envMap,x=y.envMapRotation;v&&(g.envMap.value=v,oi.copy(x),oi.x*=-1,oi.y*=-1,oi.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(oi.y*=-1,oi.z*=-1),g.envMapRotation.value.setFromMatrix4(Cx.makeRotationFromEuler(oi)),g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,e(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,e(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,y,v){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*y,g.scale.value=v*.5,p.map&&(g.map.value=p.map,e(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,e(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,e(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,y){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,e(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,e(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,e(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,e(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,e(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Ue&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,e(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,e(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,e(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,e(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,e(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,e(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,e(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const y=t.get(p).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function Ix(r,t,e,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,v){const x=v.program;n.uniformBlockBinding(y,x)}function c(y,v){let x=i[y.id];x===void 0&&(m(y),x=h(y),i[y.id]=x,y.addEventListener("dispose",g));const P=v.program;n.updateUBOMapping(y,P);const T=t.render.frame;s[y.id]!==T&&(d(y),s[y.id]=T)}function h(y){const v=u();y.__bindingPointIndex=v;const x=r.createBuffer(),P=y.__size,T=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,P,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,x),x}function u(){for(let y=0;y0&&(x+=P-T),y.__size=x,y.__cache={},this}function _(y){const v={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function g(y){const v=y.target;v.removeEventListener("dispose",g);const x=a.indexOf(v.__bindingPointIndex);a.splice(x,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function p(){for(const y in i)r.deleteBuffer(i[y]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class Px{constructor(t={}){const{canvas:e=ed(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const y=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ke,this.toneMapping=Ln,this.toneMappingExposure=1;const x=this;let P=!1,T=0,C=0,R=null,b=-1,M=null;const L=new Kt,k=new Kt;let O=null;const V=new pt(0);let Z=0,H=e.width,et=e.height,G=1,ot=null,mt=null;const Mt=new Kt(0,0,H,et),zt=new Kt(0,0,H,et);let te=!1;const Y=new cr;let it=!1,bt=!1;const rt=new Dt,It=new Dt,Ft=new w,Ut=new Kt,Jt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let K=!1;function nt(){return R===null?G:1}let I=n;function Ct(E,U){return e.getContext(E,U)}try{const E={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Ja}`),e.addEventListener("webglcontextlost",J,!1),e.addEventListener("webglcontextrestored",ft,!1),e.addEventListener("webglcontextcreationerror",ut,!1),I===null){const U="webgl2";if(I=Ct(U,E),I===null)throw Ct(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let j,xt,at,Pt,gt,A,S,F,X,Q,q,Et,ct,_t,qt,tt,vt,Lt,Nt,yt,Zt,Xt,ae,D;function ht(){j=new F_(I),j.init(),Xt=new pd(I,j),xt=new I_(I,j,t,Xt),at=new gx(I,j),xt.reverseDepthBuffer&&d&&at.buffers.depth.setReversed(!0),Pt=new z_(I),gt=new ix,A=new Sx(I,j,at,gt,xt,Xt,Pt),S=new L_(x),F=new N_(x),X=new qp(I),ae=new C_(I,X),Q=new O_(I,X,Pt,ae),q=new V_(I,Q,X,Pt),Nt=new k_(I,xt,A),tt=new P_(gt),Et=new nx(x,S,F,j,xt,ae,tt),ct=new Rx(x,gt),_t=new rx,qt=new ux(j),Lt=new w_(x,S,F,at,q,f,l),vt=new px(x,q,xt),D=new Ix(I,Pt,xt,at),yt=new R_(I,j,Pt),Zt=new B_(I,j,Pt),Pt.programs=Et.programs,x.capabilities=xt,x.extensions=j,x.properties=gt,x.renderLists=_t,x.shadowMap=vt,x.state=at,x.info=Pt}ht();const W=new wx(x,I);this.xr=W,this.getContext=function(){return I},this.getContextAttributes=function(){return I.getContextAttributes()},this.forceContextLoss=function(){const E=j.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=j.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return G},this.setPixelRatio=function(E){E!==void 0&&(G=E,this.setSize(H,et,!1))},this.getSize=function(E){return E.set(H,et)},this.setSize=function(E,U,B=!0){if(W.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=E,et=U,e.width=Math.floor(E*G),e.height=Math.floor(U*G),B===!0&&(e.style.width=E+"px",e.style.height=U+"px"),this.setViewport(0,0,E,U)},this.getDrawingBufferSize=function(E){return E.set(H*G,et*G).floor()},this.setDrawingBufferSize=function(E,U,B){H=E,et=U,G=B,e.width=Math.floor(E*B),e.height=Math.floor(U*B),this.setViewport(0,0,E,U)},this.getCurrentViewport=function(E){return E.copy(L)},this.getViewport=function(E){return E.copy(Mt)},this.setViewport=function(E,U,B,z){E.isVector4?Mt.set(E.x,E.y,E.z,E.w):Mt.set(E,U,B,z),at.viewport(L.copy(Mt).multiplyScalar(G).round())},this.getScissor=function(E){return E.copy(zt)},this.setScissor=function(E,U,B,z){E.isVector4?zt.set(E.x,E.y,E.z,E.w):zt.set(E,U,B,z),at.scissor(k.copy(zt).multiplyScalar(G).round())},this.getScissorTest=function(){return te},this.setScissorTest=function(E){at.setScissorTest(te=E)},this.setOpaqueSort=function(E){ot=E},this.setTransparentSort=function(E){mt=E},this.getClearColor=function(E){return E.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor.apply(Lt,arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha.apply(Lt,arguments)},this.clear=function(E=!0,U=!0,B=!0){let z=0;if(E){let N=!1;if(R!==null){const st=R.texture.format;N=st===no||st===eo||st===ar}if(N){const st=R.texture.type,dt=st===_n||st===Fn||st===as||st===wi||st===Qa||st===ja,Tt=Lt.getClearColor(),At=Lt.getClearAlpha(),Ot=Tt.r,Ht=Tt.g,wt=Tt.b;dt?(m[0]=Ot,m[1]=Ht,m[2]=wt,m[3]=At,I.clearBufferuiv(I.COLOR,0,m)):(_[0]=Ot,_[1]=Ht,_[2]=wt,_[3]=At,I.clearBufferiv(I.COLOR,0,_))}else z|=I.COLOR_BUFFER_BIT}U&&(z|=I.DEPTH_BUFFER_BIT),B&&(z|=I.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),I.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",J,!1),e.removeEventListener("webglcontextrestored",ft,!1),e.removeEventListener("webglcontextcreationerror",ut,!1),_t.dispose(),qt.dispose(),gt.dispose(),S.dispose(),F.dispose(),q.dispose(),ae.dispose(),D.dispose(),Et.dispose(),W.dispose(),W.removeEventListener("sessionstart",Sc),W.removeEventListener("sessionend",bc),ei.stop()};function J(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),P=!0}function ft(){console.log("THREE.WebGLRenderer: Context Restored."),P=!1;const E=Pt.autoReset,U=vt.enabled,B=vt.autoUpdate,z=vt.needsUpdate,N=vt.type;ht(),Pt.autoReset=E,vt.enabled=U,vt.autoUpdate=B,vt.needsUpdate=z,vt.type=N}function ut(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function Vt(E){const U=E.target;U.removeEventListener("dispose",Vt),ue(U)}function ue(E){Ee(E),gt.remove(E)}function Ee(E){const U=gt.get(E).programs;U!==void 0&&(U.forEach(function(B){Et.releaseProgram(B)}),E.isShaderMaterial&&Et.releaseShaderCache(E))}this.renderBufferDirect=function(E,U,B,z,N,st){U===null&&(U=Jt);const dt=N.isMesh&&N.matrixWorld.determinant()<0,Tt=df(E,U,B,z,N);at.setMaterial(z,dt);let At=B.index,Ot=1;if(z.wireframe===!0){if(At=Q.getWireframeAttribute(B),At===void 0)return;Ot=2}const Ht=B.drawRange,wt=B.attributes.position;let jt=Ht.start*Ot,oe=(Ht.start+Ht.count)*Ot;st!==null&&(jt=Math.max(jt,st.start*Ot),oe=Math.min(oe,(st.start+st.count)*Ot)),At!==null?(jt=Math.max(jt,0),oe=Math.min(oe,At.count)):wt!=null&&(jt=Math.max(jt,0),oe=Math.min(oe,wt.count));const le=oe-jt;if(le<0||le===1/0)return;ae.setup(N,z,Tt,B,At);let Oe,ee=yt;if(At!==null&&(Oe=X.get(At),ee=Zt,ee.setIndex(Oe)),N.isMesh)z.wireframe===!0?(at.setLineWidth(z.wireframeLinewidth*nt()),ee.setMode(I.LINES)):ee.setMode(I.TRIANGLES);else if(N.isLine){let Rt=z.linewidth;Rt===void 0&&(Rt=1),at.setLineWidth(Rt*nt()),N.isLineSegments?ee.setMode(I.LINES):N.isLineLoop?ee.setMode(I.LINE_LOOP):ee.setMode(I.LINE_STRIP)}else N.isPoints?ee.setMode(I.POINTS):N.isSprite&&ee.setMode(I.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)ee.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if(j.get("WEBGL_multi_draw"))ee.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const Rt=N._multiDrawStarts,Mn=N._multiDrawCounts,ne=N._multiDrawCount,tn=At?X.get(At).bytesPerElement:1,Ni=gt.get(z).currentProgram.getUniforms();for(let Xe=0;Xe{function st(){if(z.forEach(function(dt){gt.get(dt).currentProgram.isReady()&&z.delete(dt)}),z.size===0){N(E);return}setTimeout(st,10)}j.get("KHR_parallel_shader_compile")!==null?st():setTimeout(st,10)})};let je=null;function yn(E){je&&je(E)}function Sc(){ei.stop()}function bc(){ei.start()}const ei=new cd;ei.setAnimationLoop(yn),typeof self<"u"&&ei.setContext(self),this.setAnimationLoop=function(E){je=E,W.setAnimationLoop(E),E===null?ei.stop():ei.start()},W.addEventListener("sessionstart",Sc),W.addEventListener("sessionend",bc),this.render=function(E,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(P===!0)return;if(E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),W.enabled===!0&&W.isPresenting===!0&&(W.cameraAutoUpdate===!0&&W.updateCamera(U),U=W.getCamera()),E.isScene===!0&&E.onBeforeRender(x,E,U,R),p=qt.get(E,v.length),p.init(U),v.push(p),It.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),Y.setFromProjectionMatrix(It),bt=this.localClippingEnabled,it=tt.init(this.clippingPlanes,bt),g=_t.get(E,y.length),g.init(),y.push(g),W.enabled===!0&&W.isPresenting===!0){const st=x.xr.getDepthSensingMesh();st!==null&&Io(st,U,-1/0,x.sortObjects)}Io(E,U,0,x.sortObjects),g.finish(),x.sortObjects===!0&&g.sort(ot,mt),K=W.enabled===!1||W.isPresenting===!1||W.hasDepthSensing()===!1,K&&Lt.addToRenderList(g,E),this.info.render.frame++,it===!0&&tt.beginShadows();const B=p.state.shadowsArray;vt.render(B,E,U),it===!0&&tt.endShadows(),this.info.autoReset===!0&&this.info.reset();const z=g.opaque,N=g.transmissive;if(p.setupLights(),U.isArrayCamera){const st=U.cameras;if(N.length>0)for(let dt=0,Tt=st.length;dt0&&Tc(z,N,E,U),K&&Lt.render(E),Ec(g,E,U);R!==null&&(A.updateMultisampleRenderTarget(R),A.updateRenderTargetMipmap(R)),E.isScene===!0&&E.onAfterRender(x,E,U),ae.resetDefaultState(),b=-1,M=null,v.pop(),v.length>0?(p=v[v.length-1],it===!0&&tt.setGlobalState(x.clippingPlanes,p.state.camera)):p=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function Io(E,U,B,z){if(E.visible===!1)return;if(E.layers.test(U.layers)){if(E.isGroup)B=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(U);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Y.intersectsSprite(E)){z&&Ut.setFromMatrixPosition(E.matrixWorld).applyMatrix4(It);const dt=q.update(E),Tt=E.material;Tt.visible&&g.push(E,dt,Tt,B,Ut.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Y.intersectsObject(E))){const dt=q.update(E),Tt=E.material;if(z&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),Ut.copy(E.boundingSphere.center)):(dt.boundingSphere===null&&dt.computeBoundingSphere(),Ut.copy(dt.boundingSphere.center)),Ut.applyMatrix4(E.matrixWorld).applyMatrix4(It)),Array.isArray(Tt)){const At=dt.groups;for(let Ot=0,Ht=At.length;Ot0&&mr(N,U,B),st.length>0&&mr(st,U,B),dt.length>0&&mr(dt,U,B),at.buffers.depth.setTest(!0),at.buffers.depth.setMask(!0),at.buffers.color.setMask(!0),at.setPolygonOffset(!1)}function Tc(E,U,B,z){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[z.id]===void 0&&(p.state.transmissionRenderTarget[z.id]=new an(1,1,{generateMipmaps:!0,type:j.has("EXT_color_buffer_half_float")||j.has("EXT_color_buffer_float")?us:_n,minFilter:fn,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Yt.workingColorSpace}));const st=p.state.transmissionRenderTarget[z.id],dt=z.viewport||L;st.setSize(dt.z,dt.w);const Tt=x.getRenderTarget();x.setRenderTarget(st),x.getClearColor(V),Z=x.getClearAlpha(),Z<1&&x.setClearColor(16777215,.5),x.clear(),K&&Lt.render(B);const At=x.toneMapping;x.toneMapping=Ln;const Ot=z.viewport;if(z.viewport!==void 0&&(z.viewport=void 0),p.setupLightsView(z),it===!0&&tt.setGlobalState(x.clippingPlanes,z),mr(E,B,z),A.updateMultisampleRenderTarget(st),A.updateRenderTargetMipmap(st),j.has("WEBGL_multisampled_render_to_texture")===!1){let Ht=!1;for(let wt=0,jt=U.length;wt0),wt=!!B.morphAttributes.position,jt=!!B.morphAttributes.normal,oe=!!B.morphAttributes.color;let le=Ln;z.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(le=x.toneMapping);const Oe=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,ee=Oe!==void 0?Oe.length:0,Rt=gt.get(z),Mn=p.state.lights;if(it===!0&&(bt===!0||E!==M)){const $e=E===M&&z.id===b;tt.setState(z,E,$e)}let ne=!1;z.version===Rt.__version?(Rt.needsLights&&Rt.lightsStateVersion!==Mn.state.version||Rt.outputColorSpace!==Tt||N.isBatchedMesh&&Rt.batching===!1||!N.isBatchedMesh&&Rt.batching===!0||N.isBatchedMesh&&Rt.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&Rt.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&Rt.instancing===!1||!N.isInstancedMesh&&Rt.instancing===!0||N.isSkinnedMesh&&Rt.skinning===!1||!N.isSkinnedMesh&&Rt.skinning===!0||N.isInstancedMesh&&Rt.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&Rt.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&Rt.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&Rt.instancingMorph===!1&&N.morphTexture!==null||Rt.envMap!==At||z.fog===!0&&Rt.fog!==st||Rt.numClippingPlanes!==void 0&&(Rt.numClippingPlanes!==tt.numPlanes||Rt.numIntersection!==tt.numIntersection)||Rt.vertexAlphas!==Ot||Rt.vertexTangents!==Ht||Rt.morphTargets!==wt||Rt.morphNormals!==jt||Rt.morphColors!==oe||Rt.toneMapping!==le||Rt.morphTargetsCount!==ee)&&(ne=!0):(ne=!0,Rt.__version=z.version);let tn=Rt.currentProgram;ne===!0&&(tn=gr(z,U,N));let Ni=!1,Xe=!1,gs=!1;const ce=tn.getUniforms(),hn=Rt.uniforms;if(at.useProgram(tn.program)&&(Ni=!0,Xe=!0,gs=!0),z.id!==b&&(b=z.id,Xe=!0),Ni||M!==E){at.buffers.depth.getReversed()?(rt.copy(E.projectionMatrix),_p(rt),xp(rt),ce.setValue(I,"projectionMatrix",rt)):ce.setValue(I,"projectionMatrix",E.projectionMatrix),ce.setValue(I,"viewMatrix",E.matrixWorldInverse);const Bn=ce.map.cameraPosition;Bn!==void 0&&Bn.setValue(I,Ft.setFromMatrixPosition(E.matrixWorld)),xt.logarithmicDepthBuffer&&ce.setValue(I,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&ce.setValue(I,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,Xe=!0,gs=!0)}if(N.isSkinnedMesh){ce.setOptional(I,N,"bindMatrix"),ce.setOptional(I,N,"bindMatrixInverse");const $e=N.skeleton;$e&&($e.boneTexture===null&&$e.computeBoneTexture(),ce.setValue(I,"boneTexture",$e.boneTexture,A))}N.isBatchedMesh&&(ce.setOptional(I,N,"batchingTexture"),ce.setValue(I,"batchingTexture",N._matricesTexture,A),ce.setOptional(I,N,"batchingIdTexture"),ce.setValue(I,"batchingIdTexture",N._indirectTexture,A),ce.setOptional(I,N,"batchingColorTexture"),N._colorsTexture!==null&&ce.setValue(I,"batchingColorTexture",N._colorsTexture,A));const _s=B.morphAttributes;if((_s.position!==void 0||_s.normal!==void 0||_s.color!==void 0)&&Nt.update(N,B,tn),(Xe||Rt.receiveShadow!==N.receiveShadow)&&(Rt.receiveShadow=N.receiveShadow,ce.setValue(I,"receiveShadow",N.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(hn.envMap.value=At,hn.flipEnvMap.value=At.isCubeTexture&&At.isRenderTargetTexture===!1?-1:1),z.isMeshStandardMaterial&&z.envMap===null&&U.environment!==null&&(hn.envMapIntensity.value=U.environmentIntensity),Xe&&(ce.setValue(I,"toneMappingExposure",x.toneMappingExposure),Rt.needsLights&&ff(hn,gs),st&&z.fog===!0&&ct.refreshFogUniforms(hn,st),ct.refreshMaterialUniforms(hn,z,G,et,p.state.transmissionRenderTarget[E.id]),ca.upload(I,wc(Rt),hn,A)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(ca.upload(I,wc(Rt),hn,A),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&ce.setValue(I,"center",N.center),ce.setValue(I,"modelViewMatrix",N.modelViewMatrix),ce.setValue(I,"normalMatrix",N.normalMatrix),ce.setValue(I,"modelMatrix",N.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){const $e=z.uniformsGroups;for(let Bn=0,zn=$e.length;Bn0&&A.useMultisampledRTT(E)===!1?N=gt.get(E).__webglMultisampledFramebuffer:Array.isArray(Ht)?N=Ht[B]:N=Ht,L.copy(E.viewport),k.copy(E.scissor),O=E.scissorTest}else L.copy(Mt).multiplyScalar(G).floor(),k.copy(zt).multiplyScalar(G).floor(),O=te;if(at.bindFramebuffer(I.FRAMEBUFFER,N)&&z&&at.drawBuffers(E,N),at.viewport(L),at.scissor(k),at.setScissorTest(O),st){const At=gt.get(E.texture);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_CUBE_MAP_POSITIVE_X+U,At.__webglTexture,B)}else if(dt){const At=gt.get(E.texture),Ot=U||0;I.framebufferTextureLayer(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,At.__webglTexture,B||0,Ot)}b=-1},this.readRenderTargetPixels=function(E,U,B,z,N,st,dt){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Tt=gt.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&dt!==void 0&&(Tt=Tt[dt]),Tt){at.bindFramebuffer(I.FRAMEBUFFER,Tt);try{const At=E.texture,Ot=At.format,Ht=At.type;if(!xt.textureFormatReadable(Ot)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!xt.textureTypeReadable(Ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=E.width-z&&B>=0&&B<=E.height-N&&I.readPixels(U,B,z,N,Xt.convert(Ot),Xt.convert(Ht),st)}finally{const At=R!==null?gt.get(R).__webglFramebuffer:null;at.bindFramebuffer(I.FRAMEBUFFER,At)}}},this.readRenderTargetPixelsAsync=async function(E,U,B,z,N,st,dt){if(!(E&&E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Tt=gt.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&dt!==void 0&&(Tt=Tt[dt]),Tt){const At=E.texture,Ot=At.format,Ht=At.type;if(!xt.textureFormatReadable(Ot))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!xt.textureTypeReadable(Ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(U>=0&&U<=E.width-z&&B>=0&&B<=E.height-N){at.bindFramebuffer(I.FRAMEBUFFER,Tt);const wt=I.createBuffer();I.bindBuffer(I.PIXEL_PACK_BUFFER,wt),I.bufferData(I.PIXEL_PACK_BUFFER,st.byteLength,I.STREAM_READ),I.readPixels(U,B,z,N,Xt.convert(Ot),Xt.convert(Ht),0);const jt=R!==null?gt.get(R).__webglFramebuffer:null;at.bindFramebuffer(I.FRAMEBUFFER,jt);const oe=I.fenceSync(I.SYNC_GPU_COMMANDS_COMPLETE,0);return I.flush(),await gp(I,oe,4),I.bindBuffer(I.PIXEL_PACK_BUFFER,wt),I.getBufferSubData(I.PIXEL_PACK_BUFFER,0,st),I.deleteBuffer(wt),I.deleteSync(oe),st}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(E,U=null,B=0){E.isTexture!==!0&&(Is("WebGLRenderer: copyFramebufferToTexture function signature has changed."),U=arguments[0]||null,E=arguments[1]);const z=Math.pow(2,-B),N=Math.floor(E.image.width*z),st=Math.floor(E.image.height*z),dt=U!==null?U.x:0,Tt=U!==null?U.y:0;A.setTexture2D(E,0),I.copyTexSubImage2D(I.TEXTURE_2D,B,0,0,dt,Tt,N,st),at.unbindTexture()},this.copyTextureToTexture=function(E,U,B=null,z=null,N=0){E.isTexture!==!0&&(Is("WebGLRenderer: copyTextureToTexture function signature has changed."),z=arguments[0]||null,E=arguments[1],U=arguments[2],N=arguments[3]||0,B=null);let st,dt,Tt,At,Ot,Ht,wt,jt,oe;const le=E.isCompressedTexture?E.mipmaps[N]:E.image;B!==null?(st=B.max.x-B.min.x,dt=B.max.y-B.min.y,Tt=B.isBox3?B.max.z-B.min.z:1,At=B.min.x,Ot=B.min.y,Ht=B.isBox3?B.min.z:0):(st=le.width,dt=le.height,Tt=le.depth||1,At=0,Ot=0,Ht=0),z!==null?(wt=z.x,jt=z.y,oe=z.z):(wt=0,jt=0,oe=0);const Oe=Xt.convert(U.format),ee=Xt.convert(U.type);let Rt;U.isData3DTexture?(A.setTexture3D(U,0),Rt=I.TEXTURE_3D):U.isDataArrayTexture||U.isCompressedArrayTexture?(A.setTexture2DArray(U,0),Rt=I.TEXTURE_2D_ARRAY):(A.setTexture2D(U,0),Rt=I.TEXTURE_2D),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,U.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,U.unpackAlignment);const Mn=I.getParameter(I.UNPACK_ROW_LENGTH),ne=I.getParameter(I.UNPACK_IMAGE_HEIGHT),tn=I.getParameter(I.UNPACK_SKIP_PIXELS),Ni=I.getParameter(I.UNPACK_SKIP_ROWS),Xe=I.getParameter(I.UNPACK_SKIP_IMAGES);I.pixelStorei(I.UNPACK_ROW_LENGTH,le.width),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,le.height),I.pixelStorei(I.UNPACK_SKIP_PIXELS,At),I.pixelStorei(I.UNPACK_SKIP_ROWS,Ot),I.pixelStorei(I.UNPACK_SKIP_IMAGES,Ht);const gs=E.isDataArrayTexture||E.isData3DTexture,ce=U.isDataArrayTexture||U.isData3DTexture;if(E.isRenderTargetTexture||E.isDepthTexture){const hn=gt.get(E),_s=gt.get(U),$e=gt.get(hn.__renderTarget),Bn=gt.get(_s.__renderTarget);at.bindFramebuffer(I.READ_FRAMEBUFFER,$e.__webglFramebuffer),at.bindFramebuffer(I.DRAW_FRAMEBUFFER,Bn.__webglFramebuffer);for(let zn=0;zn0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class uo{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Zs,this.updateRanges=[],this.version=0,this.uuid=Ze()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,s=this.stride;it.far||e.push({distance:l,point:Ss.clone(),uv:Ve.getInterpolation(Ss,Or,Es,Br,yh,sl,Mh,new $),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function zr(r,t,e,n,i,s){Qi.subVectors(r,e).addScalar(.5).multiply(n),i!==void 0?(bs.x=s*Qi.x-i*Qi.y,bs.y=i*Qi.x+s*Qi.y):bs.copy(Qi),r.copy(t),r.x+=bs.x,r.y+=bs.y,r.applyMatrix4(_d)}const kr=new w,Sh=new w;class vd extends Qt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let n=0,i=e.length;n0){let n,i;for(n=1,i=e.length;n0){kr.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(kr);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){kr.setFromMatrixPosition(t.matrixWorld),Sh.setFromMatrixPosition(this.matrixWorld);const n=kr.distanceTo(Sh)/t.zoom;e[0].object.visible=!0;let i,s;for(i=1,s=e.length;i=a)e[i-1].object.visible=!1,e[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const o=s[this.index];a.push(o),this.index++,o.start=t,o.count=e,o.z=n,o.index=i}reset(){this.list.length=0,this.index=0}}const Be=new Dt,Bx=new pt(1,1,1),ll=new cr,Gr=new Ne,li=new Ce,ws=new w,Ph=new w,zx=new w,cl=new Ox,we=new _e,Wr=[];function kx(r,t,e=0){const n=t.itemSize;if(r.isInterleavedBufferAttribute||r.array.constructor!==t.array.constructor){const i=r.count;for(let s=0;s65535?new Uint32Array(i):new Uint16Array(i);e.setIndex(new re(s,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in e.attributes){if(!t.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=t.getAttribute(n),s=e.getAttribute(n);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ne);const t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let n=0,i=e.length;n=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:t};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(ol),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=n):(i=this._instanceInfo.length,this._instanceInfo.push(n));const s=this._matricesTexture;Be.identity().toArray(s.image.data,i*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(Bx.toArray(a.image.data,i*4),a.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(t,e=-1,n=-1){this._initializeGeometry(t),this._validateGeometry(t);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=e===-1?t.getAttribute("position").count:e;const a=t.getIndex();if(a!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=n===-1?a.count:n),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(ol),l=this._availableGeometryIds.shift(),s[l]=i):(l=this._geometryCount,this._geometryCount++,s.push(i)),this.setGeometryAt(l,t),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,l}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const n=this.geometry,i=n.getIndex()!==null,s=n.getIndex(),a=e.getIndex(),o=this._geometryInfo[t];if(i&&a.count>o.reservedIndexCount||e.attributes.position.count>o.reservedVertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=e.getAttribute("position").count;for(const h in n.attributes){const u=e.getAttribute(h),d=n.getAttribute(h);kx(u,d,l);const f=u.itemSize;for(let m=u.count,_=c;m<_;m++){const g=l+m;for(let p=0;p=e.length||e[t].active===!1)return this;const n=this._instanceInfo;for(let i=0,s=n.length;i=e.length||e[t].active===!1?this:(e[t].active=!1,this._availableInstanceIds.push(t),this._visibilityChanged=!0,this)}optimize(){let t=0,e=0;const n=this._geometryInfo,i=n.map((a,o)=>o).sort((a,o)=>n[a].vertexStart-n[o].vertexStart),s=this.geometry;for(let a=0,o=n.length;a=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[t];if(i.boundingBox===null){const s=new Ne,a=n.index,o=n.attributes.position;for(let l=i.start,c=i.start+i.count;l=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[t];if(i.boundingSphere===null){const s=new Ce;this.getBoundingBoxAt(t,Gr),Gr.getCenter(s.center);const a=n.index,o=n.attributes.position;let l=0;for(let c=i.start,h=i.start+i.count;c=n.length||n[t].active===!1?this:(e.toArray(s,t*16),i.needsUpdate=!0,this)}getMatrixAt(t,e){const n=this._instanceInfo,i=this._matricesTexture.image.data;return t>=n.length||n[t].active===!1?null:e.fromArray(i,t*16)}setColorAt(t,e){this._colorsTexture===null&&this._initColorsTexture();const n=this._colorsTexture,i=this._colorsTexture.image.data,s=this._instanceInfo;return t>=s.length||s[t].active===!1?this:(e.toArray(i,t*4),n.needsUpdate=!0,this)}getColorAt(t,e){const n=this._colorsTexture.image.data,i=this._instanceInfo;return t>=i.length||i[t].active===!1?null:e.fromArray(n,t*4)}setVisibleAt(t,e){const n=this._instanceInfo;return t>=n.length||n[t].active===!1||n[t].visible===e?this:(n[t].visible=e,this._visibilityChanged=!0,this)}getVisibleAt(t){const e=this._instanceInfo;return t>=e.length||e[t].active===!1?!1:e[t].visible}setGeometryIdAt(t,e){const n=this._instanceInfo,i=this._geometryInfo;return t>=n.length||n[t].active===!1||e>=i.length||i[e].active===!1?null:(n[t].geometryIndex=e,this)}getGeometryIdAt(t){const e=this._instanceInfo;return t>=e.length||e[t].active===!1?-1:e[t].geometryIndex}getGeometryRangeAt(t,e={}){if(t<0||t>=this._geometryCount)return null;const n=this._geometryInfo[t];return e.vertexStart=n.vertexStart,e.vertexCount=n.vertexCount,e.reservedVertexCount=n.reservedVertexCount,e.indexStart=n.indexStart,e.indexCount=n.indexCount,e.reservedIndexCount=n.reservedIndexCount,e.start=n.start,e.count=n.count,e}setInstanceCount(t){const e=this._availableInstanceIds,n=this._instanceInfo;for(e.sort(ol);e[e.length-1]===n.length;)n.pop(),e.pop();if(to.active);if(Math.max(...n.map(o=>o.vertexStart+o.reservedVertexCount))>t)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(l=>l.indexStart+l.reservedIndexCount))>e)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Wt,this._initializeGeometry(s));const a=this.geometry;s.index&&ci(s.index.array,a.index.array);for(const o in s.attributes)ci(s.attributes[o].array,a.attributes[o].array)}raycast(t,e){const n=this._instanceInfo,i=this._geometryInfo,s=this.matrixWorld,a=this.geometry;we.material=this.material,we.geometry.index=a.index,we.geometry.attributes=a.attributes,we.geometry.boundingBox===null&&(we.geometry.boundingBox=new Ne),we.geometry.boundingSphere===null&&(we.geometry.boundingSphere=new Ce);for(let o=0,l=n.length;o({...e,boundingBox:e.boundingBox!==null?e.boundingBox.clone():null,boundingSphere:e.boundingSphere!==null?e.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(e=>({...e})),this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(t,e,n,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=i.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._geometryInfo,d=this.perObjectFrustumCulled,f=this._indirectTexture,m=f.image.data;d&&(Be.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),ll.setFromProjectionMatrix(Be,t.coordinateSystem));let _=0;if(this.sortObjects){Be.copy(this.matrixWorld).invert(),ws.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Be),Ph.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Be);for(let y=0,v=l.length;y0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;sn)return;hl.applyMatrix4(r.matrixWorld);const l=t.ray.origin.distanceTo(hl);if(!(lt.far))return{distance:l,point:Dh.clone().applyMatrix4(r.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:r}}const Uh=new w,Nh=new w;class vn extends $n{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[];for(let i=0,s=e.count;i0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;si.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class Vx extends pe{constructor(t,e,n,i,s,a,o,l,c){super(t,e,n,i,s,a,o,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:xe,this.magFilter=s!==void 0?s:xe,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,t.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Hx extends pe{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=be,this.minFilter=be,this.generateMipmaps=!1,this.needsUpdate=!0}}class po extends pe{constructor(t,e,n,i,s,a,o,l,c,h,u,d){super(null,a,o,l,c,h,i,s,u,d),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Gx extends po{constructor(t,e,n,i,s,a){super(t,e,n,s,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Qe,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class Wx extends po{constructor(t,e,n){super(void 0,t[0].width,t[0].height,e,n,Nn),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class Xx extends pe{constructor(t,e,n,i,s,a,o,l,c){super(t,e,n,i,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ln{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),s=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),s+=n.distanceTo(i),e.push(s),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const s=n.length;let a;e?a=e:a=t*n[s-1];let o=0,l=s-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(s-1);const h=n[i],d=n[i+1]-h,f=(a-h)/d;return(i+f)/(s-1)}getTangent(t,e){let i=t-1e-4,s=t+1e-4;i<0&&(i=0),s>1&&(s=1);const a=this.getPoint(i),o=this.getPoint(s),l=e||(a.isVector2?new $:new w);return l.copy(o).sub(a).normalize(),l}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new w,i=[],s=[],a=[],o=new w,l=new Dt;for(let f=0;f<=t;f++){const m=f/t;i[f]=this.getTangentAt(m,new w)}s[0]=new w,a[0]=new w;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),a[0].crossVectors(i[0],s[0]);for(let f=1;f<=t;f++){if(s[f]=s[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(fe(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],s[f])}if(e===!0){let f=Math.acos(fe(s[0].dot(s[t]),-1,1));f/=t,i[0].dot(o.crossVectors(s[0],s[t]))>0&&(f=-f);for(let m=1;m<=t;m++)s[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],s[m])}return{tangents:i,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class mo extends ln{constructor(t=0,e=0,n=1,i=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e=new $){const n=e,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%s]:(Jr.subVectors(i[0],i[1]).add(i[0]),c=Jr);const u=i[o%s],d=i[(o+1)%s];if(this.closed||o+2i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(Bh(o,l.x,c.x,h.x,u.x),Bh(o,l.y,c.y,h.y,u.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=n){const a=i[s]-n,o=this.curves[s],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,e)}s++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class hr extends Wt{constructor(t=[new $(0,-.5),new $(.5,0),new $(0,.5)],e=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=fe(i,0,Math.PI*2);const s=[],a=[],o=[],l=[],c=[],h=1/e,u=new w,d=new $,f=new w,m=new w,_=new w;let g=0,p=0;for(let y=0;y<=t.length-1;y++)switch(y){case 0:g=t[y+1].x-t[y].x,p=t[y+1].y-t[y].y,f.x=p*1,f.y=-g,f.z=p*0,_.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case t.length-1:l.push(_.x,_.y,_.z);break;default:g=t[y+1].x-t[y].x,p=t[y+1].y-t[y].y,f.x=p*1,f.y=-g,f.z=p*0,m.copy(f),f.x+=_.x,f.y+=_.y,f.z+=_.z,f.normalize(),l.push(f.x,f.y,f.z),_.copy(m)}for(let y=0;y<=e;y++){const v=n+y*h*i,x=Math.sin(v),P=Math.cos(v);for(let T=0;T<=t.length-1;T++){u.x=t[T].x*x,u.y=t[T].y,u.z=t[T].x*P,a.push(u.x,u.y,u.z),d.x=y/e,d.y=T/(t.length-1),o.push(d.x,d.y);const C=l[3*T+0]*x,R=l[3*T+1],b=l[3*T+0]*P;c.push(C,R,b)}}for(let y=0;y0&&v(!0),e>0&&v(!1)),this.setIndex(h),this.setAttribute("position",new St(u,3)),this.setAttribute("normal",new St(d,3)),this.setAttribute("uv",new St(f,2));function y(){const x=new w,P=new w;let T=0;const C=(e-t)/n;for(let R=0;R<=s;R++){const b=[],M=R/s,L=M*(e-t)+t;for(let k=0;k<=i;k++){const O=k/i,V=O*l+o,Z=Math.sin(V),H=Math.cos(V);P.x=L*Z,P.y=-M*n+g,P.z=L*H,u.push(P.x,P.y,P.z),x.set(Z,C,H).normalize(),d.push(x.x,x.y,x.z),f.push(O,1-M),b.push(m++)}_.push(b)}for(let R=0;R0||b!==0)&&(h.push(M,L,O),T+=3),(e>0||b!==s-1)&&(h.push(L,k,O),T+=3)}c.addGroup(p,T,0),p+=T}function v(x){const P=m,T=new $,C=new w;let R=0;const b=x===!0?t:e,M=x===!0?1:-1;for(let k=1;k<=i;k++)u.push(0,g*M,0),d.push(0,M,0),f.push(.5,.5),m++;const L=m;for(let k=0;k<=i;k++){const V=k/i*l+o,Z=Math.cos(V),H=Math.sin(V);C.x=b*H,C.y=g*M,C.z=b*Z,u.push(C.x,C.y,C.z),d.push(0,M,0),T.x=Z*.5+.5,T.y=H*.5*M+.5,f.push(T.x,T.y),m++}for(let k=0;k.9&&C<.1&&(v<.2&&(a[y+0]+=1),x<.2&&(a[y+2]+=1),P<.2&&(a[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,v){const x=y*3;v.x=t[x+0],v.y=t[x+1],v.z=t[x+2]}function m(){const y=new w,v=new w,x=new w,P=new w,T=new $,C=new $,R=new $;for(let b=0,M=0;b80*e){o=c=r[0],l=h=r[1];for(let m=e;mc&&(c=u),d>h&&(h=d);f=Math.max(c-o,h-l),f=f!==0?32767/f:0}return Qs(s,a,e,o,l,f,0),a}};function Pd(r,t,e,n,i){let s,a;if(i===mv(r,t,e,n)>0)for(s=t;s=t;s-=n)a=zh(s,r[s],r[s+1],a);return a&&yo(a,a.next)&&(tr(a),a=a.next),a}function Ii(r,t){if(!r)return r;t||(t=r);let e=r,n;do if(n=!1,!e.steiner&&(yo(e,e.next)||he(e.prev,e,e.next)===0)){if(tr(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function Qs(r,t,e,n,i,s,a){if(!r)return;!a&&s&&cv(r,n,i,s);let o=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?ev(r,n,i,s):tv(r)){t.push(l.i/e|0),t.push(r.i/e|0),t.push(c.i/e|0),tr(r),r=c.next,o=c.next;continue}if(r=c,r===o){a?a===1?(r=nv(Ii(r),t,e),Qs(r,t,e,n,i,s,2)):a===2&&iv(r,t,e,n,i,s):Qs(Ii(r),t,e,n,i,s,1);break}}}function tv(r){const t=r.prev,e=r,n=r.next;if(he(t,e,n)>=0)return!1;const i=t.x,s=e.x,a=n.x,o=t.y,l=e.y,c=n.y,h=is?i>a?i:a:s>a?s:a,f=o>l?o>c?o:c:l>c?l:c;let m=n.next;for(;m!==t;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=f&&ss(i,o,s,l,a,c,m.x,m.y)&&he(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function ev(r,t,e,n){const i=r.prev,s=r,a=r.next;if(he(i,s,a)>=0)return!1;const o=i.x,l=s.x,c=a.x,h=i.y,u=s.y,d=a.y,f=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,p=Il(f,m,t,e,n),y=Il(_,g,t,e,n);let v=r.prevZ,x=r.nextZ;for(;v&&v.z>=p&&x&&x.z<=y;){if(v.x>=f&&v.x<=_&&v.y>=m&&v.y<=g&&v!==i&&v!==a&&ss(o,h,l,u,c,d,v.x,v.y)&&he(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=f&&x.x<=_&&x.y>=m&&x.y<=g&&x!==i&&x!==a&&ss(o,h,l,u,c,d,x.x,x.y)&&he(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=p;){if(v.x>=f&&v.x<=_&&v.y>=m&&v.y<=g&&v!==i&&v!==a&&ss(o,h,l,u,c,d,v.x,v.y)&&he(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=_&&x.y>=m&&x.y<=g&&x!==i&&x!==a&&ss(o,h,l,u,c,d,x.x,x.y)&&he(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function nv(r,t,e){let n=r;do{const i=n.prev,s=n.next.next;!yo(i,s)&&Ld(i,n,n.next,s)&&js(i,s)&&js(s,i)&&(t.push(i.i/e|0),t.push(n.i/e|0),t.push(s.i/e|0),tr(n),tr(n.next),n=r=s),n=n.next}while(n!==r);return Ii(n)}function iv(r,t,e,n,i,s){let a=r;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&dv(a,o)){let l=Dd(a,o);a=Ii(a,a.next),l=Ii(l,l.next),Qs(a,t,e,n,i,s,0),Qs(l,t,e,n,i,s,0);return}o=o.next}a=a.next}while(a!==r)}function sv(r,t,e,n){const i=[];let s,a,o,l,c;for(s=0,a=t.length;s=e.next.y&&e.next.y!==e.y){const d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=s&&d>n&&(n=d,i=e.x=e.x&&e.x>=l&&s!==e.x&&ss(ai.x||e.x===i.x&&lv(i,e)))&&(i=e,h=u)),e=e.next;while(e!==o);return i}function lv(r,t){return he(r.prev,r,t.prev)<0&&he(t.next,r,r.next)<0}function cv(r,t,e,n){let i=r;do i.z===0&&(i.z=Il(i.x,i.y,t,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,hv(i)}function hv(r){let t,e,n,i,s,a,o,l,c=1;do{for(e=r,r=null,s=null,a=0;e;){for(a++,n=e,o=0,t=0;t0||l>0&&n;)o!==0&&(l===0||!n||e.z<=n.z)?(i=e,e=e.nextZ,o--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;e=n}s.nextZ=null,c*=2}while(a>1);return r}function Il(r,t,e,n,i){return r=(r-e)*i|0,t=(t-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function uv(r){let t=r,e=r;do(t.x=(r-a)*(s-o)&&(r-a)*(n-o)>=(e-a)*(t-o)&&(e-a)*(s-o)>=(i-a)*(n-o)}function dv(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!fv(r,t)&&(js(r,t)&&js(t,r)&&pv(r,t)&&(he(r.prev,r,t.prev)||he(r,t.prev,t))||yo(r,t)&&he(r.prev,r,r.next)>0&&he(t.prev,t,t.next)>0)}function he(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function yo(r,t){return r.x===t.x&&r.y===t.y}function Ld(r,t,e,n){const i=ta(he(r,t,e)),s=ta(he(r,t,n)),a=ta(he(e,n,r)),o=ta(he(e,n,t));return!!(i!==s&&a!==o||i===0&&jr(r,e,t)||s===0&&jr(r,n,t)||a===0&&jr(e,r,n)||o===0&&jr(e,t,n))}function jr(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function ta(r){return r>0?1:r<0?-1:0}function fv(r,t){let e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ld(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function js(r,t){return he(r.prev,r,r.next)<0?he(r,t,r.next)>=0&&he(r,r.prev,t)>=0:he(r,t,r.prev)<0||he(r,r.next,t)<0}function pv(r,t){let e=r,n=!1;const i=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function Dd(r,t){const e=new Pl(r.i,r.x,r.y),n=new Pl(t.i,t.x,t.y),i=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,n.next=e,e.prev=n,s.next=n,n.prev=s,n}function zh(r,t,e,n){const i=new Pl(r,t,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function tr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Pl(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function mv(r,t,e,n){let i=0;for(let s=t,a=e-n;s2&&r[t-1].equals(r[0])&&r.pop()}function Vh(r,t){for(let e=0;eNumber.EPSILON){const X=Math.sqrt(S),Q=Math.sqrt(gt*gt+A*A),q=nt.x-Pt/X,Et=nt.y+at/X,ct=I.x-A/Q,_t=I.y+gt/Q,qt=((ct-q)*A-(_t-Et)*gt)/(at*A-Pt*gt);Ct=q+at*qt-K.x,j=Et+Pt*qt-K.y;const tt=Ct*Ct+j*j;if(tt<=2)return new $(Ct,j);xt=Math.sqrt(tt/2)}else{let X=!1;at>Number.EPSILON?gt>Number.EPSILON&&(X=!0):at<-Number.EPSILON?gt<-Number.EPSILON&&(X=!0):Math.sign(Pt)===Math.sign(A)&&(X=!0),X?(Ct=-Pt,j=at,xt=Math.sqrt(S)):(Ct=at,j=Pt,xt=Math.sqrt(S/2))}return new $(Ct/xt,j/xt)}const ot=[];for(let K=0,nt=V.length,I=nt-1,Ct=K+1;K=0;K--){const nt=K/g,I=f*Math.cos(nt*Math.PI/2),Ct=m*Math.sin(nt*Math.PI/2)+_;for(let j=0,xt=V.length;j=0;){const Ct=I;let j=I-1;j<0&&(j=K.length-1);for(let xt=0,at=h+g*2;xt0)&&f.push(v,x,T),(p!==n-1||l0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Bd extends Re{static get type(){return"MeshPhongMaterial"}constructor(t){super(),this.isMeshPhongMaterial=!0,this.color=new pt(16777215),this.specular=new pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kn,this.normalScale=new $(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Je,this.combine=rr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class zd extends Re{static get type(){return"MeshToonMaterial"}constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.color=new pt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kn,this.normalScale=new $(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class kd extends Re{static get type(){return"MeshNormalMaterial"}constructor(t){super(),this.isMeshNormalMaterial=!0,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kn,this.normalScale=new $(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Vd extends Re{static get type(){return"MeshLambertMaterial"}constructor(t){super(),this.isMeshLambertMaterial=!0,this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kn,this.normalScale=new $(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Je,this.combine=rr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Hd extends Re{static get type(){return"MeshMatcapMaterial"}constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.color=new pt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Kn,this.normalScale=new $(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Gd extends Fe{static get type(){return"LineDashedMaterial"}constructor(t){super(),this.isLineDashedMaterial=!0,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Mi(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function Wd(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function Xd(r){function t(i,s){return r[i]-r[s]}const e=r.length,n=new Array(e);for(let i=0;i!==e;++i)n[i]=i;return n.sort(t),n}function Ll(r,t,e){const n=r.length,i=new r.constructor(n);for(let s=0,a=0;a!==n;++s){const o=e[s]*t;for(let l=0;l!==t;++l)i[a++]=r[o+l]}return i}function dc(r,t,e,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let a=s[n];if(a!==void 0)if(Array.isArray(a))do a=s[n],a!==void 0&&(t.push(s.time),e.push.apply(e,a)),s=r[i++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[n],a!==void 0&&(t.push(s.time),a.toArray(e,e.length)),s=r[i++];while(s!==void 0);else do a=s[n],a!==void 0&&(t.push(s.time),e.push(a)),s=r[i++];while(s!==void 0)}function vv(r,t,e,n,i=30){const s=r.clone();s.name=t;const a=[];for(let l=0;l=n)){u.push(c.times[f]);for(let _=0;_s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l=o.times[m]){const p=m*u+h,y=p+u-h;_=o.values.slice(p,y)}else{const p=o.createInterpolant(),y=h,v=u-h;p.evaluate(s),_=p.resultBuffer.slice(y,v)}l==="quaternion"&&new Ge().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let p=0;p=s)){const o=e[1];t=s)break e}a=n,n=0;break n}break t}for(;n>>1;te;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(i!==void 0&&Wd(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===la,s=t.length-1;let a=1;for(let o=1;o0){t[a]=t[s];for(let o=s*n,l=a*n,c=0;c!==n;++c)e[l+c]=e[o+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}cn.prototype.TimeBufferType=Float32Array;cn.prototype.ValueBufferType=Float32Array;cn.prototype.DefaultInterpolation=Xa;class Di extends cn{constructor(t,e,n){super(t,e,n)}}Di.prototype.ValueTypeName="bool";Di.prototype.ValueBufferType=Array;Di.prototype.DefaultInterpolation=qs;Di.prototype.InterpolantFactoryMethodLinear=void 0;Di.prototype.InterpolantFactoryMethodSmooth=void 0;class pc extends cn{}pc.prototype.ValueTypeName="color";class er extends cn{}er.prototype.ValueTypeName="number";class Zd extends fr{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-e)/(i-e);let c=t*o;for(let h=c+o;c!==h;c+=4)Ge.slerpFlat(s,0,a,c-o,a,c,l);return s}}class pr extends cn{InterpolantFactoryMethodLinear(t){return new Zd(this.times,this.values,this.getValueSize(),t)}}pr.prototype.ValueTypeName="quaternion";pr.prototype.InterpolantFactoryMethodSmooth=void 0;class Ui extends cn{constructor(t,e,n){super(t,e,n)}}Ui.prototype.ValueTypeName="string";Ui.prototype.ValueBufferType=Array;Ui.prototype.DefaultInterpolation=qs;Ui.prototype.InterpolantFactoryMethodLinear=void 0;Ui.prototype.InterpolantFactoryMethodSmooth=void 0;class nr extends cn{}nr.prototype.ValueTypeName="vector";class ir{constructor(t="",e=-1,n=[],i=io){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Ze(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let a=0,o=n.length;a!==o;++a)e.push(bv(n[a]).scale(i));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let s=0,a=n.length;s!==a;++s)e.push(cn.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const s=e.length,a=[];for(let o=0;o1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],e,n));return a}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,m,_){if(f.length!==0){const g=[],p=[];dc(f,g,p,m),g.length!==0&&_.push(new u(d,g,p))}},i=[],s=t.name||"default",a=t.fps||30,o=t.blendMode;let l=t.length||-1;const c=t.hierarchy||[];for(let u=0;u{e&&e(s),this.manager.itemEnd(t)},0),s;if(wn[t]!==void 0){wn[t].push({onLoad:e,onProgress:n,onError:i});return}wn[t]=[],wn[t].push({onLoad:e,onProgress:n,onError:i});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=wn[t],u=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0;let _=0;const g=new ReadableStream({start(p){y();function y(){u.read().then(({done:v,value:x})=>{if(v)p.close();else{_+=x.byteLength;const P=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:f});for(let T=0,C=h.length;T{p.error(v)})}}});return new Response(g)}else throw new Ev(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(m=>f.decode(m))}}}).then(c=>{In.add(t,c);const h=wn[t];delete wn[t];for(let u=0,d=h.length;u{const h=wn[t];if(h===void 0)throw this.manager.itemError(t),c;delete wn[t];for(let u=0,d=h.length;u{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Tv extends We{constructor(t){super(t)}load(t,e,n,i){const s=this,a=new On(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(s.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),s.manager.itemError(t)}},n,i)}parse(t){const e=[];for(let n=0;n0:i.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const s in t.uniforms){const a=t.uniforms[s];switch(i.uniforms[s]={},a.type){case"t":i.uniforms[s].value=n(a.value);break;case"c":i.uniforms[s].value=new pt().setHex(a.value);break;case"v2":i.uniforms[s].value=new $().fromArray(a.value);break;case"v3":i.uniforms[s].value=new w().fromArray(a.value);break;case"v4":i.uniforms[s].value=new Kt().fromArray(a.value);break;case"m3":i.uniforms[s].value=new Bt().fromArray(a.value);break;case"m4":i.uniforms[s].value=new Dt().fromArray(a.value);break;default:i.uniforms[s].value=a.value}}if(t.defines!==void 0&&(i.defines=t.defines),t.vertexShader!==void 0&&(i.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(i.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(i.glslVersion=t.glslVersion),t.extensions!==void 0)for(const s in t.extensions)i.extensions[s]=t.extensions[s];if(t.lights!==void 0&&(i.lights=t.lights),t.clipping!==void 0&&(i.clipping=t.clipping),t.size!==void 0&&(i.size=t.size),t.sizeAttenuation!==void 0&&(i.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(i.map=n(t.map)),t.matcap!==void 0&&(i.matcap=n(t.matcap)),t.alphaMap!==void 0&&(i.alphaMap=n(t.alphaMap)),t.bumpMap!==void 0&&(i.bumpMap=n(t.bumpMap)),t.bumpScale!==void 0&&(i.bumpScale=t.bumpScale),t.normalMap!==void 0&&(i.normalMap=n(t.normalMap)),t.normalMapType!==void 0&&(i.normalMapType=t.normalMapType),t.normalScale!==void 0){let s=t.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new $().fromArray(s)}return t.displacementMap!==void 0&&(i.displacementMap=n(t.displacementMap)),t.displacementScale!==void 0&&(i.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(i.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(i.roughnessMap=n(t.roughnessMap)),t.metalnessMap!==void 0&&(i.metalnessMap=n(t.metalnessMap)),t.emissiveMap!==void 0&&(i.emissiveMap=n(t.emissiveMap)),t.emissiveIntensity!==void 0&&(i.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(i.specularMap=n(t.specularMap)),t.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(t.specularIntensityMap)),t.specularColorMap!==void 0&&(i.specularColorMap=n(t.specularColorMap)),t.envMap!==void 0&&(i.envMap=n(t.envMap)),t.envMapRotation!==void 0&&i.envMapRotation.fromArray(t.envMapRotation),t.envMapIntensity!==void 0&&(i.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(i.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(i.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(i.lightMap=n(t.lightMap)),t.lightMapIntensity!==void 0&&(i.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(i.aoMap=n(t.aoMap)),t.aoMapIntensity!==void 0&&(i.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(i.gradientMap=n(t.gradientMap)),t.clearcoatMap!==void 0&&(i.clearcoatMap=n(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new $().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(i.iridescenceMap=n(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(i.transmissionMap=n(t.transmissionMap)),t.thicknessMap!==void 0&&(i.thicknessMap=n(t.thicknessMap)),t.anisotropyMap!==void 0&&(i.anisotropyMap=n(t.anisotropyMap)),t.sheenColorMap!==void 0&&(i.sheenColorMap=n(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return Ro.createMaterialFromType(t)}static createMaterialFromType(t){const e={ShadowMaterial:Nd,SpriteMaterial:nc,RawShaderMaterial:Fd,ShaderMaterial:on,PointsMaterial:sc,MeshPhysicalMaterial:Od,MeshStandardMaterial:uc,MeshPhongMaterial:Bd,MeshToonMaterial:zd,MeshNormalMaterial:kd,MeshLambertMaterial:Vd,MeshDepthMaterial:tc,MeshDistanceMaterial:ec,MeshBasicMaterial:Qn,MeshMatcapMaterial:Hd,LineDashedMaterial:Gd,LineBasicMaterial:Fe,Material:Re};return new e[t]}}class Dl{static decodeText(t){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,i=t.length;n0){const l=new mc(e);s=new sr(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,h=t.length;c0){i=new sr(this.manager),i.setCrossOrigin(this.crossOrigin);for(let a=0,o=t.length;a{const g=new Ne;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const p=new Ce;return p.radius=_.sphereRadius,p.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:p}}),a._maxInstanceCount=t.maxInstanceCount,a._maxVertexCount=t.maxVertexCount,a._maxIndexCount=t.maxIndexCount,a._geometryInitialized=t.geometryInitialized,a._geometryCount=t.geometryCount,a._matricesTexture=c(t.matricesTexture.uuid),t.colorsTexture!==void 0&&(a._colorsTexture=c(t.colorsTexture.uuid));break;case"LOD":a=new vd;break;case"Line":a=new $n(o(t.geometry),l(t.material));break;case"LineLoop":a=new bd(o(t.geometry),l(t.material));break;case"LineSegments":a=new vn(o(t.geometry),l(t.material));break;case"PointCloud":case"Points":a=new Ed(o(t.geometry),l(t.material));break;case"Sprite":a=new xd(l(t.material));break;case"Group":a=new is;break;case"Bone":a=new ic;break;default:a=new Qt}if(a.uuid=t.uuid,t.name!==void 0&&(a.name=t.name),t.matrix!==void 0?(a.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=t.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(t.position!==void 0&&a.position.fromArray(t.position),t.rotation!==void 0&&a.rotation.fromArray(t.rotation),t.quaternion!==void 0&&a.quaternion.fromArray(t.quaternion),t.scale!==void 0&&a.scale.fromArray(t.scale)),t.up!==void 0&&a.up.fromArray(t.up),t.castShadow!==void 0&&(a.castShadow=t.castShadow),t.receiveShadow!==void 0&&(a.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.intensity!==void 0&&(a.shadow.intensity=t.shadow.intensity),t.shadow.bias!==void 0&&(a.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(a.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(a.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(a.visible=t.visible),t.frustumCulled!==void 0&&(a.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(a.renderOrder=t.renderOrder),t.userData!==void 0&&(a.userData=t.userData),t.layers!==void 0&&(a.layers.mask=t.layers),t.children!==void 0){const d=t.children;for(let f=0;f"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,n,i){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,a=In.get(t);if(a!==void 0){if(s.manager.itemStart(t),a.then){a.then(c=>{e&&e(c),s.manager.itemEnd(t)}).catch(c=>{i&&i(c)});return}return setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(t,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return In.add(t,c),e&&e(c),s.manager.itemEnd(t),c}).catch(function(c){i&&i(c),In.remove(t),s.manager.itemError(t),s.manager.itemEnd(t)});In.add(t,l),s.manager.itemStart(t)}}let ea;class _c{static getContext(){return ea===void 0&&(ea=new(window.AudioContext||window.webkitAudioContext)),ea}static setContext(t){ea=t}}class Fv extends We{constructor(t){super(t)}load(t,e,n,i){const s=this,a=new On(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(l){try{const c=l.slice(0);_c.getContext().decodeAudioData(c,function(u){e(u)}).catch(o)}catch(c){o(c)}},n,i);function o(l){i?i(l):console.error(l),s.manager.itemError(t)}}}const Jh=new Dt,$h=new Dt,hi=new Dt;class Ov{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Se,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Se,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,hi.copy(t.projectionMatrix);const i=e.eyeSep/2,s=i*e.near/e.focus,a=e.near*Math.tan(Ei*e.fov*.5)/e.zoom;let o,l;$h.elements[12]=-i,Jh.elements[12]=i,o=-a*e.aspect+s,l=a*e.aspect+s,hi.elements[0]=2*e.near/(l-o),hi.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(hi),o=-a*e.aspect-s,l=a*e.aspect-s,hi.elements[0]=2*e.near/(l-o),hi.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(hi)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply($h),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Jh)}}class of{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Kh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Kh();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Kh(){return performance.now()}const ui=new w,Qh=new Ge,Bv=new w,di=new w;class zv extends Qt{constructor(){super(),this.type="AudioListener",this.context=_c.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new of}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ui,Qh,Bv),di.set(0,0,-1).applyQuaternion(Qh),e.positionX){const i=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(ui.x,i),e.positionY.linearRampToValueAtTime(ui.y,i),e.positionZ.linearRampToValueAtTime(ui.z,i),e.forwardX.linearRampToValueAtTime(di.x,i),e.forwardY.linearRampToValueAtTime(di.y,i),e.forwardZ.linearRampToValueAtTime(di.z,i),e.upX.linearRampToValueAtTime(n.x,i),e.upY.linearRampToValueAtTime(n.y,i),e.upZ.linearRampToValueAtTime(n.z,i)}else e.setPosition(ui.x,ui.y,ui.z),e.setOrientation(di.x,di.y,di.z,n.x,n.y,n.z)}}class lf extends Qt{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(t=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let l=e,c=e+e;l!==c;++l)if(n[l]!==n[l+e]){o.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let s=n,a=i;s!==a;++s)e[s]=e[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let a=0;a!==s;++a)t[e+a]=t[n+a]}_slerp(t,e,n,i){Ge.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,s){const a=this._workIndex*s;Ge.multiplyQuaternionsFlat(t,a,t,e,t,n),Ge.slerpFlat(t,e,t,e,t,a,i)}_lerp(t,e,n,i,s){const a=1-i;for(let o=0;o!==s;++o){const l=e+o;t[l]=t[l]*a+t[n+o]*i}}_lerpAdditive(t,e,n,i,s){for(let a=0;a!==s;++a){const o=e+a;t[o]=t[o]+t[n+a]*i}}}const xc="\\[\\]\\.:\\/",Gv=new RegExp("["+xc+"]","g"),vc="[^"+xc+"]",Wv="[^"+xc.replace("\\.","")+"]",Xv=/((?:WC+[\/:])*)/.source.replace("WC",vc),qv=/(WCOD+)?/.source.replace("WCOD",Wv),Yv=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vc),Zv=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vc),Jv=new RegExp("^"+Xv+qv+Yv+Zv+"$"),$v=["material","materials","bones","map"];class Kv{constructor(t,e,n){const i=n||$t.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}class $t{constructor(t,e,n){this.path=e,this.parsedPath=n||$t.parseTrackName(e),this.node=$t.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new $t.Composite(t,e,n):new $t(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Gv,"")}static parseTrackName(t){const e=Jv.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);$v.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){const n=function(s){for(let a=0;a=s){const u=s++,d=t[u];e[d.uuid]=h,t[h]=d,e[c]=u,t[u]=l;for(let f=0,m=i;f!==m;++f){const _=n[f],g=_[u],p=_[h];_[h]=g,_[u]=p}}}this.nCachedObjects_=s}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,a=t.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],h=c.uuid,u=e[h];if(u!==void 0)if(delete e[h],u0&&(e[f.uuid]=u),t[u]=f,t.pop();for(let m=0,_=i;m!==_;++m){const g=n[m];g[u]=g[d],g.pop()}}}this.nCachedObjects_=s}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const s=this._bindings;if(i!==void 0)return s[i];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);i=s.length,n[t]=i,a.push(t),o.push(e),s.push(u);for(let d=h,f=l.length;d!==f;++d){const m=l[d];u[d]=new $t(m,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(n!==void 0){const i=this._paths,s=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=t[o];e[c]=n,a[n]=l,a.pop(),s[n]=s[o],s.pop(),i[n]=i[o],i.pop()}}}class hf{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const s=e.tracks,a=s.length,o=new Array(a),l={endingStart:xi,endingEnd:xi};for(let c=0;c!==a;++c){const h=s[c].createInterpolant(null);o[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Hu,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const i=this._clip.duration,s=t._clip.duration,a=s/i,o=i/s;t.warp(1,a,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,s=i.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=s,l[1]=s+n,c[0]=t/a,c[1]=e/a,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled){this._updateWeight(t);return}const s=this._startTime;if(s!==null){const l=(t-s)*n;l<0||n===0?e=0:(this._startTime=null,e=n*l)}e*=this._updateTimeScale(t);const a=this._updateTime(e),o=this._updateWeight(t);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case ql:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulateAdditive(o);break;case io:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(i,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,s=this._loopCount;const a=n===Gu;if(t===0)return s===-1?i:a&&(s&1)===1?e-i:i;if(n===Vu){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else if(i<0)i=0;else{this.time=i;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(s===-1&&(t>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),i>=e||i<0){const o=Math.floor(i/e);i-=e*o,s+=Math.abs(o);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(a&&(s&1)===1)return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=vi,i.endingEnd=vi):(t?i.endingStart=this.zeroSlopeAtStart?vi:xi:i.endingStart=Ys,e?i.endingEnd=this.zeroSlopeAtEnd?vi:xi:i.endingEnd=Ys)}_scheduleFading(t,e,n){const i=this._mixer,s=i.time;let a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,l[0]=e,o[1]=s+t,l[1]=n,this}}const jv=new Float32Array(1);class ty extends xn{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,s=i.length,a=t._propertyBindings,o=t._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){const d=i[u],f=d.name;let m=h[f];if(m!==void 0)++m.referenceCount,a[u]=m;else{if(m=a[u],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,l,f));continue}const _=e&&e._propertyBindings[u].binding.parsedPath;m=new cf($t.create(n,f,_),d.ValueTypeName,d.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,f),a[u]=m}o[u].resultBuffer=m.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const n=(t._localRoot||this._root).uuid,i=t._clip.uuid,s=this._actionsByClip[i];this._bindAction(t,s&&s.knownActions[0]),this._addInactiveAction(t,i,n)}const e=t._propertyBindings;for(let n=0,i=e.length;n!==i;++n){const s=e[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let n=0,i=e.length;n!==i;++n){const s=e[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return e!==null&&e=0;--n)t[n].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,s=Math.sign(t),a=this._accuIndex^=1;for(let c=0;c!==n;++c)e[c]._update(i,t,s,a);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(a);return this}setTime(t){this.time=0;for(let e=0;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,nu).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const iu=new w,na=new w;class cy{constructor(t=new w,e=new w){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){iu.subVectors(t,this.start),na.subVectors(this.end,this.start);const n=na.dot(na);let s=na.dot(iu)/n;return e&&(s=fe(s,0,1)),s}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const su=new w;class hy extends Qt{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const n=new Wt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,l=32;a1)for(let u=0;u.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{cu.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(cu,e)}}setLength(t,e=t*.2,n=e*.2){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class by extends vn{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Wt;i.setAttribute("position",new St(e,3)),i.setAttribute("color",new St(n,3));const s=new Fe({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(t,e,n){const i=new pt,s=this.geometry.attributes.color.array;return i.set(t),i.toArray(s,0),i.toArray(s,3),i.set(e),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Ey{constructor(){this.type="ShapePath",this.color=new pt,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Ks,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,s,a){return this.currentPath.bezierCurveTo(t,e,n,i,s,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(p){const y=[];for(let v=0,x=p.length;vNumber.EPSILON){if(M<0&&(C=y[T],b=-b,R=y[P],M=-M),p.yR.y)continue;if(p.y===C.y){if(p.x===C.x)return!0}else{const L=M*(p.x-C.x)-b*(p.y-C.y);if(L===0)return!0;if(L<0)continue;x=!x}}else{if(p.y!==C.y)continue;if(R.x<=p.x&&p.x<=C.x||C.x<=p.x&&p.x<=R.x)return!0}}return x}const i=gn.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,l;const c=[];if(s.length===1)return o=s[0],l=new Ti,l.curves=o.curves,c.push(l),c;let h=!i(s[0].getPoints());h=t?!h:h;const u=[],d=[];let f=[],m=0,_;d[m]=void 0,f[m]=[];for(let p=0,y=s.length;p1){let p=!1,y=0;for(let v=0,x=d.length;v0&&p===!1&&(f=u)}let g;for(let p=0,y=d.length;p{console.warn(y)}))},navigator.xr.offerSession!==void 0&&navigator.xr.offerSession("immersive-vr",T).then(b).catch(y=>{console.warn(y)})}function a(){s.style.display="",s.style.cursor="auto",s.style.left="calc(50% - 75px)",s.style.width="150px",s.onmouseenter=null,s.onmouseleave=null,s.onclick=null}function i(){a(),s.textContent="VR NOT SUPPORTED"}function h(n){a(),console.warn("Exception when trying to call xr.isSessionSupported",n),s.textContent="VR NOT ALLOWED"}function l(n){n.style.position="absolute",n.style.bottom="20px",n.style.padding="12px 6px",n.style.border="1px solid #fff",n.style.borderRadius="4px",n.style.background="rgba(0,0,0,0.1)",n.style.color="#fff",n.style.font="normal 13px sans-serif",n.style.textAlign="center",n.style.opacity="0.5",n.style.outline="none",n.style.zIndex="999"}if("xr"in navigator)return s.id="VRButton",s.style.display="none",l(s),navigator.xr.isSessionSupported("immersive-vr").then(function(n){n?r():i(),n&&g.xrSessionIsGranted&&s.click()}).catch(h),s;{const n=document.createElement("a");return window.isSecureContext===!1?(n.href=document.location.href.replace(/^http:/,"https:"),n.innerHTML="WEBXR NEEDS HTTPS"):(n.href="https://immersiveweb.dev/",n.innerHTML="WEBXR NOT AVAILABLE"),n.style.left="calc(50% - 90px)",n.style.width="180px",n.style.textDecoration="none",l(n),n}}static registerSessionGrantedListener(){if(typeof navigator<"u"&&"xr"in navigator){if(/WebXRViewer\//i.test(navigator.userAgent))return;navigator.xr.addEventListener("sessiongranted",()=>{g.xrSessionIsGranted=!0})}}}g.xrSessionIsGranted=!1;g.registerSessionGrantedListener();const u={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function U(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function re(o){if(!o)throw new Error("No basePath supplied");return await U(`${o}/profilesList.json`)}async function le(o,e,t=null,s=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const r=await re(e);let a;if(o.profiles.some(l=>{const n=r[l];return n&&(a={profileId:l,profilePath:`${e}/${n.path}`,deprecated:!!n.deprecated}),!!a}),!a){if(!t)throw new Error("No matching profile name found");const l=r[t];if(!l)throw new Error(`No matching profile name found and default profile "${t}" missing.`);a={profileId:t,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}}const i=await U(a.profilePath);let h;if(s){let l;if(o.handedness==="any"?l=i.layouts[Object.keys(i.layouts)[0]]:l=i.layouts[o.handedness],!l)throw new Error(`No matching handedness, ${o.handedness}, in profile ${a.profileId}`);l.assetPath&&(h=a.profilePath.replace("profile.json",l.assetPath))}return{profile:i,assetPath:h}}const de={xAxis:0,yAxis:0,button:0,state:u.ComponentState.DEFAULT};function ue(o=0,e=0){let t=o,s=e;if(Math.sqrt(o*o+e*e)>1){const i=Math.atan2(e,o);t=Math.cos(i),s=Math.sin(i)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:s*.5+.5}}class ce{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===u.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(de)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:r}){const{normalizedXAxis:a,normalizedYAxis:i}=ue(e,t);switch(this.componentProperty){case u.ComponentProperty.X_AXIS:this.value=this.states.includes(r)?a:.5;break;case u.ComponentProperty.Y_AXIS:this.value=this.states.includes(r)?i:.5;break;case u.ComponentProperty.BUTTON:this.value=this.states.includes(r)?s:0;break;case u.ComponentProperty.STATE:this.valueNodeProperty===u.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(r):this.value=this.states.includes(r)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class he{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(s=>{const r=new ce(t.visualResponses[s]);this.visualResponses[s]=r}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:u.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=u.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=u.ComponentState.PRESSED:(t.touched||this.values.button>u.ButtonTouchThreshold)&&(this.values.state=u.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===u.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>u.AxisTouchThreshold&&(this.values.state=u.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===u.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>u.AxisTouchThreshold&&(this.values.state=u.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class pe{constructor(e,t,s){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=s,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(r=>{const a=this.layoutDescription.components[r];this.components[r]=new he(r,a)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const fe="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",me="generic-trigger";class xe extends z{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(s=>{const{valueNode:r,minNode:a,maxNode:i,value:h,valueNodeProperty:l}=s;r&&(l===u.VisualResponseProperty.VISIBILITY?r.visible=h:l===u.VisualResponseProperty.TRANSFORM&&(r.quaternion.slerpQuaternions(a.quaternion,i.quaternion,h),r.position.lerpVectors(a.position,i.position,h)))})}))}}function ye(o,e){Object.values(o.components).forEach(t=>{const{type:s,touchPointNodeName:r,visualResponses:a}=t;if(s===u.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(r),t.touchPointNode){const i=new H(.001),h=new R({color:255}),l=new O(i,h);t.touchPointNode.add(l)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(a).forEach(i=>{const{valueNodeName:h,minNodeName:l,maxNodeName:n,valueNodeProperty:b}=i;if(b===u.VisualResponseProperty.TRANSFORM){if(i.minNode=e.getObjectByName(l),i.maxNode=e.getObjectByName(n),!i.minNode){console.warn(`Could not find ${l} in the model`);return}if(!i.maxNode){console.warn(`Could not find ${n} in the model`);return}}i.valueNode=e.getObjectByName(h),i.valueNode||console.warn(`Could not find ${h} in the model`)})})}function j(o,e){ye(o.motionController,e),o.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=o.envMap,t.material.needsUpdate=!0)}),o.add(e)}class ve{constructor(e=null,t=null){this.gltfLoader=e,this.path=fe,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new ie)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new xe;let s=null;return e.addEventListener("connected",r=>{const a=r.data;a.targetRayMode!=="tracked-pointer"||!a.gamepad||a.hand||le(a,this.path,me).then(({profile:i,assetPath:h})=>{t.motionController=new pe(a,i,h);const l=this._assetCache[t.motionController.assetUrl];if(l)s=l.scene.clone(),j(t,s),this.onLoad&&this.onLoad(s);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,n=>{this._assetCache[t.motionController.assetUrl]=n,s=n.scene.clone(),j(t,s),this.onLoad&&this.onLoad(s)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(i=>{console.warn(i)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(s),s=null}),t}}let p,v,c,d,m,L,P,w,N,V,f,A,x,C,E=null;const S=[],we=new G(0,1,0),k={displayGrid:!0};ge();function ge(){v=new W,c=new D({antialias:!0}),c.setPixelRatio(window.devicePixelRatio),c.setSize(window.innerWidth,window.innerHeight),c.setClearColor(12303291),c.xr.enabled=!0,document.body.appendChild(c.domElement),c.domElement.tabIndex=1,c.setAnimationLoop(Ee),m=new M,v.add(m),w=new $(10,10,16777215,16777215),w.material.transparent=!0,w.material.opacity=.5,w.material.depthWrite=!1,m.add(w),p=new X(60,window.innerWidth/window.innerHeight,.1,4e3),p.position.set(0,1,0),m.add(p);const o=new _(16777215);o.position.set(1,2,3),v.add(o);const e=new q(16777215,.2);v.add(e),L=new te,P=new se,A=new M,A.rotation.x=Math.PI/2,A.position.y=32,v.add(A),d=new ae("https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/scene-tileset.json"),A.add(d.group),d.setCamera(p),d.setResolutionFromRenderer(p,c);const t=i=>{S.push(i)};d.downloadQueue.schedulingCallback=t,d.parseQueue.schedulingCallback=t,d.lruCache.maxSize=1200,d.lruCache.minSize=900,N=new oe,V=new G(0,0,1);const s=new R({color:11722715});f=new O(new Y(1.5,.2,16,100),s),f.visible=!1,v.add(f),document.body.appendChild(g.createButton(c)),x=c.xr.getController(0),x.addEventListener("selectstart",()=>{f.visible&&m.position.copy(f.position)}),x.addEventListener("connected",function(i){this.controllerActive=!0,this.add(be(i.data))}),x.addEventListener("disconnected",function(){this.controllerActive=!1,this.remove(this.children[0])}),m.add(x);const r=new ve;C=c.xr.getControllerGrip(0),C.add(r.createControllerModel(C)),m.add(C),B(),window.addEventListener("resize",B,!1);const a=new ne;a.width=300,a.add(k,"displayGrid"),a.open()}function be(o){let e,t;switch(o.targetRayMode){case"tracked-pointer":return e=new J,e.setAttribute("position",new F([0,0,0,0,0,-1],3)),e.setAttribute("color",new F([.5,.5,.5,0,0,0],3)),t=new K({vertexColors:!0,blending:Z,depthWrite:!1,transparent:!0}),new ee(e,t);case"gaze":return e=new Q(.02,.04,32).translate(0,0,-1),t=new R({opacity:.5,transparent:!0}),new O(e,t)}}function B(){p.updateProjectionMatrix(),c.setPixelRatio(window.devicePixelRatio),c.setSize(window.innerWidth,window.innerHeight),p.aspect=window.innerWidth/window.innerHeight,p.updateProjectionMatrix()}function Ae(){if(c.xr.isPresenting){if(E===null){const o=c.xr.getCamera(p);d.cameras.forEach(t=>d.deleteCamera(t)),d.setCamera(o);const e=o.cameras[0];e&&d.setResolution(o,e.viewport.z,e.viewport.w),E=c.xr.getSession()}}else E!==null&&(d.cameras.forEach(o=>d.deleteCamera(o)),d.setCamera(p),d.setResolutionFromRenderer(p,c),p.position.set(0,1,0),E=null)}function Ce(){for(let o=0,e=S.length;o + + + + + + 3D Tiles Renderer Batch Example + + + + + + + + + + + +
+ + diff --git a/example/bundle/cmptExample.html b/example/bundle/cmptExample.html new file mode 100644 index 00000000..22d92ff3 --- /dev/null +++ b/example/bundle/cmptExample.html @@ -0,0 +1,40 @@ + + + + + + + 3D Tiles Renderer Composite Format Example + + + + + + + + + + + + + + + + + diff --git a/example/bundle/customMaterial.html b/example/bundle/customMaterial.html new file mode 100644 index 00000000..f5871796 --- /dev/null +++ b/example/bundle/customMaterial.html @@ -0,0 +1,45 @@ + + + + + + + 3D Tiles Renderer Material Example + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/bundle/ellipsoid.html b/example/bundle/ellipsoid.html new file mode 100644 index 00000000..a62393d5 --- /dev/null +++ b/example/bundle/ellipsoid.html @@ -0,0 +1,46 @@ + + + + + + + 3D Tiles Renderer Batch Example + + + + + + + + + + + +
+ + diff --git a/example/bundle/fadingTiles.html b/example/bundle/fadingTiles.html new file mode 100644 index 00000000..60238bdb --- /dev/null +++ b/example/bundle/fadingTiles.html @@ -0,0 +1,68 @@ + + + + + + + Dither Fade Tiles + + + + + + + + + + + + + + + + + + + + + +
+ Demonstration of tiles using a dither fade to change, smoothing out the transition. +
+ + diff --git a/example/bundle/gltf.html b/example/bundle/gltf.html new file mode 100644 index 00000000..c3c2c83b --- /dev/null +++ b/example/bundle/gltf.html @@ -0,0 +1,36 @@ + + + + + + + 3D Tiles Renderer 3DTILES_content_gltf Example + + + + + + + + + + + + + diff --git a/example/bundle/googleMapsAerial.html b/example/bundle/googleMapsAerial.html new file mode 100644 index 00000000..2fb2d0cc --- /dev/null +++ b/example/bundle/googleMapsAerial.html @@ -0,0 +1,86 @@ + + + + + + + Google 3D Tiles Example + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Example using Googles Photorealistic 3D Tiles - Tokyo Tower +
+ Google Cloud Tiles API key required +
+
+
+
+ + diff --git a/example/bundle/googleMapsExample.html b/example/bundle/googleMapsExample.html new file mode 100644 index 00000000..6cb44cd3 --- /dev/null +++ b/example/bundle/googleMapsExample.html @@ -0,0 +1,90 @@ + + + + + + + Google 3D Tiles Example + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Example using Googles Photorealistic 3D Tiles - Globe +
+ Google Cloud Tiles API key required +
+
+
+
+ + diff --git a/example/bundle/i3dmExample.html b/example/bundle/i3dmExample.html new file mode 100644 index 00000000..247c5184 --- /dev/null +++ b/example/bundle/i3dmExample.html @@ -0,0 +1,37 @@ + + + + + + + 3D Tiles Renderer Instanced Example + + + + + + + + + + + + + + diff --git a/example/bundle/index.html b/example/bundle/index.html new file mode 100644 index 00000000..a03e6c34 --- /dev/null +++ b/example/bundle/index.html @@ -0,0 +1,49 @@ + + + + + + + 3D Tiles Renderer Options Example + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/bundle/ionExample.html b/example/bundle/ionExample.html new file mode 100644 index 00000000..bc921f69 --- /dev/null +++ b/example/bundle/ionExample.html @@ -0,0 +1,71 @@ + + + + + + + 3D Tiles Renderer Cesium Ion Integration Example + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Paste the evaluation Cesium Ion token from the Cesium repository or your own token and asset id
into the fields and press "reload" to see the demo. See cesium.com for more information. +
+
+
+ + diff --git a/example/bundle/ionLunar.html b/example/bundle/ionLunar.html new file mode 100644 index 00000000..d15e2992 --- /dev/null +++ b/example/bundle/ionLunar.html @@ -0,0 +1,73 @@ + + + + + + + Cesium Ion Lunar Data Set + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Paste the evaluation Cesium Ion token from the Cesium repository or your own token and asset id
into the fields and press "reload" to see the demo. See cesium.com for more information. +
+
+
+ + diff --git a/example/bundle/landformSiteOverlay.html b/example/bundle/landformSiteOverlay.html new file mode 100644 index 00000000..6ec8331c --- /dev/null +++ b/example/bundle/landformSiteOverlay.html @@ -0,0 +1,68 @@ + + + + + + + Landform Drive 1004 Drive Tile Sets + + + + + + + + + + + + + + + + + + + +
+ Set of tiles from M20 Drive 1004 generated using NASA JPL's Landform with generated slope magnitude overlay. +
+ See information on this tile sets generation here. +
+ + diff --git a/example/bundle/mars.html b/example/bundle/mars.html new file mode 100644 index 00000000..02b3919c --- /dev/null +++ b/example/bundle/mars.html @@ -0,0 +1,70 @@ + + + + + + + Dingo Gap Tile Set + + + + + + + + + + + + + + + + + + + + + +
+ Dingo Gap site reconstructed from multiple sols of Curiosity Rover and Mars Reconnaissance Orbiter images. +
+ See more information here. +
+ + diff --git a/example/bundle/metadata.html b/example/bundle/metadata.html new file mode 100644 index 00000000..f3b94631 --- /dev/null +++ b/example/bundle/metadata.html @@ -0,0 +1,99 @@ + + + + + + + 3D Tiles Renderer Metadata Example + + + + + + + + + + + + + + + + + + + + + + +
+
+ Demonstration of displaying glTF Mesh Features and +
+ Structural Metadata properties on mouse-over. +
+ See Cesium repo for demo API key.
+
+
+
+ + diff --git a/example/bundle/offscreenShadows.html b/example/bundle/offscreenShadows.html new file mode 100644 index 00000000..aa8e24c2 --- /dev/null +++ b/example/bundle/offscreenShadows.html @@ -0,0 +1,45 @@ + + + + + + + 3D Tiles Renderer Material Example + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/bundle/pntsExample.html b/example/bundle/pntsExample.html new file mode 100644 index 00000000..6c52e844 --- /dev/null +++ b/example/bundle/pntsExample.html @@ -0,0 +1,35 @@ + + + + + + + 3D Tiles Renderer Points Example + + + + + + + + + + + + diff --git a/example/bundle/r3f/atmosphere.html b/example/bundle/r3f/atmosphere.html new file mode 100644 index 00000000..c0a74b1d --- /dev/null +++ b/example/bundle/r3f/atmosphere.html @@ -0,0 +1,67 @@ + + + + + + @react-three/fiber Cesium Ion + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Example using Google Photorealistic Tiles + & @takram/three-geospatial atmosphere effects. +
+ Google Cloud API Token required. +
+
+ + diff --git a/example/bundle/r3f/basic.html b/example/bundle/r3f/basic.html new file mode 100644 index 00000000..45407445 --- /dev/null +++ b/example/bundle/r3f/basic.html @@ -0,0 +1,56 @@ + + + + + + @react-three/fiber 3D Tiles Renderer + + + + + + + + + + + + + + + + + + + + + + +
Demonstration using @react-three/fiber and @react-three/drei
+
+ + diff --git a/example/bundle/r3f/globe.html b/example/bundle/r3f/globe.html new file mode 100644 index 00000000..10ee70a0 --- /dev/null +++ b/example/bundle/r3f/globe.html @@ -0,0 +1,67 @@ + + + + + + @react-three/fiber Cesium Ion + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Example using Google Photorealistic Tiles & @react-three/fiber. +
+ Google Cloud API Token required. +
+
+ + diff --git a/example/bundle/r3f/ion.html b/example/bundle/r3f/ion.html new file mode 100644 index 00000000..788898e3 --- /dev/null +++ b/example/bundle/r3f/ion.html @@ -0,0 +1,65 @@ + + + + + + @react-three/fiber Cesium Ion + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Example using Cesium Ion & @react-three/fiber. +
+ Paste the evaluation token from the Cesium repository or your own. +
+
+ + diff --git a/example/bundle/vr.html b/example/bundle/vr.html new file mode 100644 index 00000000..b7e235d9 --- /dev/null +++ b/example/bundle/vr.html @@ -0,0 +1,42 @@ + + + + + + + 3D Tiles Renderer VR Example + + + + + + + + + + + + + + + + + + + +