@mappedin/react-sdk 6.0.1-beta.52 → 6.0.1-beta.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{H as F,L as He,P as Ve,Q as v,T as V,W as Ge,Z as U,a as Ee,bb as z,e as Ne,g as be,ga as G,h as Se,i as Ue,j as Ce,k as _e,l as Le,m as Oe,n as ve,o as ze,r as Be,s as Pe,t as De,xa as k,y as Fe,z as ke}from"./chunk-6X6EHSZ7.js";import{a as Re}from"./chunk-5SHMBNLX.js";import{c as T}from"./chunk-PEDEW3M6.js";Re();var Ye={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},ae=class ae{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new q(e)}),this.register(function(e){return new X(e)}),this.register(function(e){return new Q(e)}),this.register(function(e){return new $(e)}),this.register(function(e){return new ee(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new W(e)}),this.register(function(e){return new J(e)}),this.register(function(e){return new Z(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new ne(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new re(e)}),this.register(function(e){return new oe(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,s,n,t){let i=new j,r=[];for(let o=0,a=this.pluginCallbacks.length;o<a;o++)r.push(this.pluginCallbacks[o](i));i.setPlugins(r),i.setTextureUtils(this.textureUtils),i.writeAsync(e,s,t).catch(n)}parseAsync(e,s){let n=this;return new Promise(function(t,i){n.parse(e,t,i,s)})}};T(ae,"GLTFExporter");var P=ae,g={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Y="KHR_mesh_quantization",N={};N[Ce]=g.NEAREST;N[_e]=g.NEAREST_MIPMAP_NEAREST;N[Le]=g.NEAREST_MIPMAP_LINEAR;N[Oe]=g.LINEAR;N[ve]=g.LINEAR_MIPMAP_NEAREST;N[ze]=g.LINEAR_MIPMAP_LINEAR;N[Se]=g.CLAMP_TO_EDGE;N[be]=g.REPEAT;N[Ue]=g.MIRRORED_REPEAT;var Ke={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Qe=new Ge,je=12,$e=1179937895,es=2,qe=8,ss=1313821514,ts=5130562;function B(c,e){return c.length===e.length&&c.every(function(s,n){return s===e[n]})}T(B,"equalArray");function ns(c){return new TextEncoder().encode(c).buffer}T(ns,"stringToArrayBuffer");function is(c){return B(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}T(is,"isIdentityMatrix");function rs(c,e,s){let n={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let t=e;t<e+s;t++)for(let i=0;i<c.itemSize;i++){let r;c.itemSize>4?r=c.array[t*c.itemSize+i]:(i===0?r=c.getX(t):i===1?r=c.getY(t):i===2?r=c.getZ(t):i===3&&(r=c.getW(t)),c.normalized===!0&&(r=F.normalize(r,c.array))),n.min[i]=Math.min(n.min[i],r),n.max[i]=Math.max(n.max[i],r)}return n}T(rs,"getMinMax");function Je(c){return Math.ceil(c/4)*4}T(Je,"getPaddedBufferSize");function K(c,e=0){let s=Je(c.byteLength);if(s!==c.byteLength){let n=new Uint8Array(s);if(n.set(new Uint8Array(c)),e!==0)for(let t=c.byteLength;t<s;t++)n[t]=e;return n.buffer}return c}T(K,"getPaddedArrayBuffer");function Xe(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}T(Xe,"getCanvas");function We(c,e){if(c.toBlob!==void 0)return new Promise(n=>c.toBlob(n,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),c.convertToBlob({type:e,quality:s})}T(We,"getToBlobPromise");var ce=class ce{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+Ee}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,s,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);let t=this,i=t.buffers,r=t.json;n=t.options;let o=t.extensionsUsed,a=t.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(o),u=Object.keys(a);if(h.length>0&&(r.extensionsUsed=h),u.length>0&&(r.extensionsRequired=u),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=l.size),n.binary===!0){let w=new FileReader;w.readAsArrayBuffer(l),w.onloadend=function(){let f=K(w.result),p=new DataView(new ArrayBuffer(qe));p.setUint32(0,f.byteLength,!0),p.setUint32(4,ts,!0);let d=K(ns(JSON.stringify(r)),32),y=new DataView(new ArrayBuffer(qe));y.setUint32(0,d.byteLength,!0),y.setUint32(4,ss,!0);let M=new ArrayBuffer(je),b=new DataView(M);b.setUint32(0,$e,!0),b.setUint32(4,es,!0);let D=je+y.byteLength+d.byteLength+p.byteLength+f.byteLength;b.setUint32(8,D,!0);let x=new Blob([M,y,d,p,f],{type:"application/octet-stream"}),A=new FileReader;A.readAsArrayBuffer(x),A.onloadend=function(){s(A.result)}}}else if(r.buffers&&r.buffers.length>0){let w=new FileReader;w.readAsDataURL(l),w.onloadend=function(){let f=w.result;r.buffers[0].uri=f,s(r)}}else s(r)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let n=this.options,t=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let r in i.gltfExtensions)s.extensions[r]=i.gltfExtensions[r],t[r]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(s.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,s=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(s)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new v;for(let t=0,i=e.count;t<i;t++)if(Math.abs(n.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);let n=e.clone(),t=new v;for(let i=0,r=n.count;i<r;i++)t.fromBufferAttribute(n,i),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),n.setXYZ(i,t.x,t.y,t.z);return s.attributesNormalized.set(e,n),n}applyTextureTransform(e,s){let n=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),n=!0),s.rotation!==0&&(t.rotation=s.rotation,n=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,s){if(e===s)return e;function n(f){return f.colorSpace===ke?T(function(d){return d<.04045?d*.0773993808:Math.pow(d*.9478672986+.0521327014,2.4)},"SRGBToLinear"):T(function(d){return d},"LinearToLinear")}T(n,"getEncodingConversion"),e instanceof k&&(e=await this.decompressTextureAsync(e)),s instanceof k&&(s=await this.decompressTextureAsync(s));let t=e?e.image:null,i=s?s.image:null,r=Math.max(t?t.width:0,i?i.width:0),o=Math.max(t?t.height:0,i?i.height:0),a=Xe();a.width=r,a.height=o;let l=a.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,r,o);let h=l.getImageData(0,0,r,o);if(t){l.drawImage(t,0,0,r,o);let f=n(e),p=l.getImageData(0,0,r,o).data;for(let d=2;d<p.length;d+=4)h.data[d]=f(p[d]/256)*256}if(i){l.drawImage(i,0,0,r,o);let f=n(s),p=l.getImageData(0,0,r,o).data;for(let d=1;d<p.length;d+=4)h.data[d]=f(p[d]/256)*256}l.putImageData(h,0,0);let w=(e||s).clone();return w.source=new He(a),w.colorSpace=Fe,w.channel=(e||s).channel,e&&s&&e.channel!==s.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),w}async decompressTextureAsync(e,s=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,s)}processBuffer(e){let s=this.json,n=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,s,n,t,i){let r=this.json;r.bufferViews||(r.bufferViews=[]);let o;switch(s){case g.BYTE:case g.UNSIGNED_BYTE:o=1;break;case g.SHORT:case g.UNSIGNED_SHORT:o=2;break;default:o=4}let a=e.itemSize*o;i===g.ARRAY_BUFFER&&(a=Math.ceil(a/4)*4);let l=Je(t*a),h=new DataView(new ArrayBuffer(l)),u=0;for(let p=n;p<n+t;p++){for(let d=0;d<e.itemSize;d++){let y;e.itemSize>4?y=e.array[p*e.itemSize+d]:(d===0?y=e.getX(p):d===1?y=e.getY(p):d===2?y=e.getZ(p):d===3&&(y=e.getW(p)),e.normalized===!0&&(y=F.normalize(y,e.array))),s===g.FLOAT?h.setFloat32(u,y,!0):s===g.INT?h.setInt32(u,y,!0):s===g.UNSIGNED_INT?h.setUint32(u,y,!0):s===g.SHORT?h.setInt16(u,y,!0):s===g.UNSIGNED_SHORT?h.setUint16(u,y,!0):s===g.BYTE?h.setInt8(u,y):s===g.UNSIGNED_BYTE&&h.setUint8(u,y),u+=o}u%a!==0&&(u+=a-u%a)}let w={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return i!==void 0&&(w.target=i),i===g.ARRAY_BUFFER&&(w.byteStride=a),this.byteOffset+=l,r.bufferViews.push(w),{id:r.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,n=s.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(t){let i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){let r=K(i.result),o={buffer:s.processBuffer(r),byteOffset:s.byteOffset,byteLength:r.byteLength};s.byteOffset+=r.byteLength,t(n.bufferViews.push(o)-1)}})}processAccessor(e,s,n,t){let i=this.json,r={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=g.FLOAT;else if(e.array.constructor===Int32Array)o=g.INT;else if(e.array.constructor===Uint32Array)o=g.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=g.SHORT;else if(e.array.constructor===Uint16Array)o=g.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=g.BYTE;else if(e.array.constructor===Uint8Array)o=g.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0&&(n=0),(t===void 0||t===1/0)&&(t=e.count),t===0)return null;let a=rs(e,n,t),l;s!==void 0&&(l=e===s.index?g.ELEMENT_ARRAY_BUFFER:g.ARRAY_BUFFER);let h=this.processBufferView(e,o,n,t,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:o,count:t,max:a.max,min:a.min,type:r[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(u)-1}processImage(e,s,n,t="image/png"){if(e!==null){let i=this,r=i.cache,o=i.json,a=i.options,l=i.pending;r.images.has(e)||r.images.set(e,{});let h=r.images.get(e),u=t+":flipY/"+n.toString();if(h[u]!==void 0)return h[u];o.images||(o.images=[]);let w={mimeType:t},f=Xe();f.width=Math.min(e.width,a.maxTextureSize),f.height=Math.min(e.height,a.maxTextureSize);let p=f.getContext("2d",{willReadFrequently:!0});if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){s!==Be&&console.error("GLTFExporter: Only RGBAFormat is supported.",s),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let y=new Uint8ClampedArray(e.height*e.width*4);for(let M=0;M<y.length;M+=4)y[M+0]=e.data[M+0],y[M+1]=e.data[M+1],y[M+2]=e.data[M+2],y[M+3]=e.data[M+3];p.putImageData(new ImageData(y,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)p.drawImage(e,0,0,f.width,f.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");a.binary===!0?l.push(We(f,t).then(y=>i.processBufferViewImage(y)).then(y=>{w.bufferView=y})):f.toDataURL!==void 0?w.uri=f.toDataURL(t):l.push(We(f,t).then(y=>new FileReader().readAsDataURL(y)).then(y=>{w.uri=y}));let d=o.images.push(w)-1;return h[u]=d,d}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let s=this.json;s.samplers||(s.samplers=[]);let n={magFilter:N[e.magFilter],minFilter:N[e.minFilter],wrapS:N[e.wrapS],wrapT:N[e.wrapT]};return s.samplers.push(n)-1}async processTextureAsync(e){let n=this.options,t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]),e instanceof k&&(e=await this.decompressTextureAsync(e,n.maxTextureSize));let r=e.userData.mimeType;r==="image/webp"&&(r="image/png");let o={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(o.name=e.name),await this._invokeAllAsync(async function(l){l.writeTexture&&await l.writeTexture(e,o)});let a=i.textures.push(o)-1;return t.textures.set(e,a),a}async processMaterialAsync(e){let s=this.cache,n=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);let t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let i=e.color.toArray().concat([e.opacity]);if(B(i,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){let o=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),a={index:await this.processTextureAsync(o),texCoord:o.channel};this.applyTextureTransform(a,o),t.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let o={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(o,e.map),t.pbrMetallicRoughness.baseColorTexture=o}if(e.emissive){let o=e.emissive;if(Math.max(o.r,o.g,o.b)>0&&(t.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let l={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),t.emissiveTexture=l}}if(e.normalMap){let o={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(o.scale=e.normalScale.x),this.applyTextureTransform(o,e.normalMap),t.normalTexture=o}if(e.aoMap){let o={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(o.strength=e.aoMapIntensity),this.applyTextureTransform(o,e.aoMap),t.occlusionTexture=o}e.transparent?t.alphaMode="BLEND":e.alphaTest>0&&(t.alphaMode="MASK",t.alphaCutoff=e.alphaTest),e.side===Ne&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),await this._invokeAllAsync(async function(o){o.writeMaterialAsync&&await o.writeMaterialAsync(e,t)});let r=n.materials.push(t)-1;return s.materials.set(e,r),r}async processMeshAsync(e){let s=this.cache,n=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,A=e.material.length;x<A;x++)t.push(e.material[x].uuid);else t.push(e.material.uuid);let i=t.join(":");if(s.meshes.has(i))return s.meshes.get(i);let r=e.geometry,o;e.isLineSegments?o=g.LINES:e.isLineLoop?o=g.LINE_LOOP:e.isLine?o=g.LINE_STRIP:e.isPoints?o=g.POINTS:o=e.material.wireframe?g.LINES:g.TRIANGLES;let a={},l={},h=[],u=[],w={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let p=null;for(let x in r.attributes){if(x.slice(0,5)==="morph")continue;let A=r.attributes[x];if(x=w[x]||x.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(x)||(x="_"+x),s.attributes.has(this.getUID(A))){l[x]=s.attributes.get(this.getUID(A));continue}p=null;let m=A.array;x==="JOINTS_0"&&!(m instanceof Uint16Array)&&!(m instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new U(new Uint16Array(m),A.itemSize,A.normalized)):(m instanceof Uint32Array||m instanceof Int32Array)&&!x.startsWith("_")&&(console.warn('GLTFExporter: Attribute "'.concat(x,'" converted to type FLOAT.')),p=P.Utils.toFloat32BufferAttribute(A));let E=this.processAccessor(p||A,r);E!==null&&(x.startsWith("_")||this.detectMeshQuantization(x,A),l[x]=E,s.attributes.set(this.getUID(A),E))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let x=[],A=[],I={};if(e.morphTargetDictionary!==void 0)for(let m in e.morphTargetDictionary)I[e.morphTargetDictionary[m]]=m;for(let m=0;m<e.morphTargetInfluences.length;++m){let E={},Ie=!1;for(let _ in r.morphAttributes){if(_!=="position"&&_!=="normal"){Ie||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),Ie=!0);continue}let S=r.morphAttributes[_][m],H=_.toUpperCase(),L=r.attributes[_];if(s.attributes.has(this.getUID(S,!0))){E[H]=s.attributes.get(this.getUID(S,!0));continue}let O=S.clone();if(!r.morphTargetsRelative)for(let R=0,Ze=S.count;R<Ze;R++)for(let C=0;C<S.itemSize;C++)C===0&&O.setX(R,S.getX(R)-L.getX(R)),C===1&&O.setY(R,S.getY(R)-L.getY(R)),C===2&&O.setZ(R,S.getZ(R)-L.getZ(R)),C===3&&O.setW(R,S.getW(R)-L.getW(R));E[H]=this.processAccessor(O,r),s.attributes.set(this.getUID(L,!0),E[H])}u.push(E),x.push(e.morphTargetInfluences[m]),e.morphTargetDictionary!==void 0&&A.push(I[m])}a.weights=x,A.length>0&&(a.extras={},a.extras.targetNames=A)}let d=Array.isArray(e.material);if(d&&r.groups.length===0)return null;let y=!1;if(d&&r.index===null){let x=[];for(let A=0,I=r.attributes.position.count;A<I;A++)x[A]=A;r.setIndex(x),y=!0}let M=d?e.material:[e.material],b=d?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,A=b.length;x<A;x++){let I={mode:o,attributes:l};if(this.serializeUserData(r,I),u.length>0&&(I.targets=u),r.index!==null){let E=this.getUID(r.index);(b[x].start!==void 0||b[x].count!==void 0)&&(E+=":"+b[x].start+":"+b[x].count),s.attributes.has(E)?I.indices=s.attributes.get(E):(I.indices=this.processAccessor(r.index,r,b[x].start,b[x].count),s.attributes.set(E,I.indices)),I.indices===null&&delete I.indices}let m=await this.processMaterialAsync(M[b[x].materialIndex]);m!==null&&(I.material=m),h.push(I)}y===!0&&r.setIndex(null),a.primitives=h,n.meshes||(n.meshes=[]),await this._invokeAllAsync(function(x){x.writeMesh&&x.writeMesh(e,a)});let D=n.meshes.push(a)-1;return s.meshes.set(i,D),D}detectMeshQuantization(e,s){if(this.extensionsUsed[Y])return;let n;switch(s.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}s.normalized&&(n+=" normalized");let t=e.split("_",1)[0];Ye[t]&&Ye[t].includes(n)&&(this.extensionsUsed[Y]=!0,this.extensionsRequired[Y]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let n=e.isOrthographicCamera,t={type:n?"orthographic":"perspective"};return n?t.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:t.perspective={aspectRatio:e.aspect,yfov:F.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(t.name=e.type),s.cameras.push(t)-1}processAnimation(e,s){let n=this.json,t=this.nodeMap;n.animations||(n.animations=[]),e=P.Utils.mergeMorphTargetTracks(e.clone(),s);let i=e.tracks,r=[],o=[];for(let a=0;a<i.length;++a){let l=i[a],h=z.parseTrackName(l.name),u=z.findNode(s,h.nodeName),w=Ke[h.propertyName];if(h.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(h.objectIndex):u=void 0),!u||!w){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name);continue}let f=1,p=l.values.length/l.times.length;w===Ke.morphTargetInfluences&&(p/=u.morphTargetInfluences.length);let d;l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(d="CUBICSPLINE",p/=3):l.getInterpolation()===Pe?d="STEP":d="LINEAR",o.push({input:this.processAccessor(new U(l.times,f)),output:this.processAccessor(new U(l.values,p)),interpolation:d}),r.push({sampler:o.length-1,target:{node:t.get(u),path:w}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:o,channels:r}),n.animations.length-1}processSkin(e){let s=this.json,n=this.nodeMap,t=s.nodes[n.get(e)],i=e.skeleton;if(i===void 0)return null;let r=e.skeleton.bones[0];if(r===void 0)return null;let o=[],a=new Float32Array(i.bones.length*16),l=new V;for(let u=0;u<i.bones.length;++u)o.push(n.get(i.bones[u])),l.copy(i.boneInverses[u]),l.multiply(e.bindMatrix).toArray(a,u*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new U(a,16)),joints:o,skeleton:n.get(r)}),t.skin=s.skins.length-1}async processNodeAsync(e){let s=this.json,n=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let i={};if(n.trs){let o=e.quaternion.toArray(),a=e.position.toArray(),l=e.scale.toArray();B(o,[0,0,0,1])||(i.rotation=o),B(a,[0,0,0])||(i.translation=a),B(l,[1,1,1])||(i.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),is(e.matrix)===!1&&(i.matrix=e.matrix.elements);if(e.name!==""&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){let o=await this.processMeshAsync(e);o!==null&&(i.mesh=o)}else e.isCamera&&(i.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let o=[];for(let a=0,l=e.children.length;a<l;a++){let h=e.children[a];if(h.visible||n.onlyVisible===!1){let u=await this.processNodeAsync(h);u!==null&&o.push(u)}}o.length>0&&(i.children=o)}await this._invokeAllAsync(function(o){o.writeNode&&o.writeNode(e,i)});let r=s.nodes.push(i)-1;return t.set(e,r),r}async processSceneAsync(e){let s=this.json,n=this.options;s.scenes||(s.scenes=[],s.scene=0);let t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);let i=[];for(let r=0,o=e.children.length;r<o;r++){let a=e.children[r];if(a.visible||n.onlyVisible===!1){let l=await this.processNodeAsync(a);l!==null&&i.push(l)}}i.length>0&&(t.nodes=i),this.serializeUserData(e,t)}async processObjectsAsync(e){let s=new G;s.name="AuxScene";for(let n=0;n<e.length;n++)s.children.push(e[n]);await this.processSceneAsync(s)}async processInputAsync(e){let s=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(t){t.beforeParse&&t.beforeParse(e)});let n=[];for(let t=0;t<e.length;t++)e[t]instanceof G?await this.processSceneAsync(e[t]):n.push(e[t]);n.length>0&&await this.processObjectsAsync(n);for(let t=0;t<this.skins.length;++t)this.processSkin(this.skins[t]);for(let t=0;t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);await this._invokeAllAsync(function(t){t.afterParse&&t.afterParse(e)})}async _invokeAllAsync(e){for(let s=0,n=this.plugins.length;s<n;s++)await e(this.plugins[s])}};T(ce,"GLTFWriter");var j=ce,ue=class ue{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,t=n.json,i=n.extensionsUsed,r={};e.name&&(r.name=e.name),r.color=e.color.toArray(),r.intensity=e.intensity,e.isDirectionalLight?r.type="directional":e.isPointLight?(r.type="point",e.distance>0&&(r.range=e.distance)):e.isSpotLight&&(r.type="spot",e.distance>0&&(r.range=e.distance),r.spot={},r.spot.innerConeAngle=(1-e.penumbra)*e.angle,r.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},i[this.name]=!0);let o=t.extensions[this.name].lights;o.push(r),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}};T(ue,"GLTFLightExtension");var q=ue,le=class le{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,s){if(!e.isMeshBasicMaterial)return;let t=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},t[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}};T(le,"GLTFMaterialsUnlitExtension");var X=le,fe=class fe{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let r={index:await n.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(r,e.clearcoatMap),i.clearcoatTexture=r}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let r={index:await n.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(r,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=r}if(e.clearcoatNormalMap){let r={index:await n.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(r.scale=e.clearcoatNormalScale.x),n.applyTextureTransform(r,e.clearcoatNormalMap),i.clearcoatNormalTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(fe,"GLTFMaterialsClearcoatExtension");var W=fe,he=class he{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;let t=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(he,"GLTFMaterialsDispersionExtension");var J=he,pe=class pe{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let r={index:await n.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(r,e.iridescenceMap),i.iridescenceTexture=r}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let r={index:await n.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(r,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(pe,"GLTFMaterialsIridescenceExtension");var Z=pe,de=class de{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let r={index:await n.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(r,e.transmissionMap),i.transmissionTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(de,"GLTFMaterialsTransmissionExtension");var Q=de,xe=class xe{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let r={index:await n.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(r,e.thicknessMap),i.thicknessTexture=r}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(xe,"GLTFMaterialsVolumeExtension");var $=xe,ye=class ye{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let t=this.writer.extensionsUsed,i={};i.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(ye,"GLTFMaterialsIorExtension");var ee=ye,ge=class ge{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Qe)&&!e.specularIntensityMap&&!e.specularColorMap)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.specularIntensityMap){let r={index:await n.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(r,e.specularIntensityMap),i.specularTexture=r}if(e.specularColorMap){let r={index:await n.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(r,e.specularColorMap),i.specularColorTexture=r}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(ge,"GLTFMaterialsSpecularExtension");var se=ge,we=class we{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.sheenRoughnessMap){let r={index:await n.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(r,e.sheenRoughnessMap),i.sheenRoughnessTexture=r}if(e.sheenColorMap){let r={index:await n.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(r,e.sheenColorMap),i.sheenColorTexture=r}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(we,"GLTFMaterialsSheenExtension");var te=we,Te=class Te{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.anisotropyMap){let r={index:await n.processTextureAsync(e.anisotropyMap)};n.applyTextureTransform(r,e.anisotropyMap),i.anisotropyTexture=r}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Te,"GLTFMaterialsAnisotropyExtension");var ne=Te,Ae=class Ae{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,s){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let t=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ae,"GLTFMaterialsEmissiveStrengthExtension");var ie=Ae,me=class me{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,s){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.bumpMap){let r={index:await n.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};n.applyTextureTransform(r,e.bumpMap),i.bumpTexture=r}i.bumpFactor=e.bumpScale,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(me,"GLTFMaterialsBumpExtension");var re=me,Me=class Me{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,s){if(!e.isInstancedMesh)return;let n=this.writer,t=e,i=new Float32Array(t.count*3),r=new Float32Array(t.count*4),o=new Float32Array(t.count*3),a=new V,l=new v,h=new Ve,u=new v;for(let f=0;f<t.count;f++)t.getMatrixAt(f,a),a.decompose(l,h,u),l.toArray(i,f*3),h.toArray(r,f*4),u.toArray(o,f*3);let w={TRANSLATION:n.processAccessor(new U(i,3)),ROTATION:n.processAccessor(new U(r,4)),SCALE:n.processAccessor(new U(o,3))};t.instanceColor&&(w._COLOR_0=n.processAccessor(t.instanceColor)),s.extensions=s.extensions||{},s.extensions[this.name]={attributes:w},n.extensionsUsed[this.name]=!0,n.extensionsRequired[this.name]=!0}};T(Me,"GLTFMeshGpuInstancing");var oe=Me;P.Utils={insertKeyframe:T(function(c,e){let n=c.getValueSize(),t=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+n),r=c.createInterpolant(new c.ValueBufferType(n)),o;if(c.times.length===0){t[0]=e;for(let a=0;a<n;a++)i[a]=0;o=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;t[0]=e,t.set(c.times,1),i.set(r.evaluate(e),0),i.set(c.values,n),o=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;t[t.length-1]=e,t.set(c.times,0),i.set(c.values,0),i.set(r.evaluate(e),c.values.length),o=t.length-1}else for(let a=0;a<c.times.length;a++){if(Math.abs(c.times[a]-e)<.001)return a;if(c.times[a]<e&&c.times[a+1]>e){t.set(c.times.slice(0,a+1),0),t[a+1]=e,t.set(c.times.slice(a+1),a+2),i.set(c.values.slice(0,(a+1)*n),0),i.set(r.evaluate(e),(a+1)*n),i.set(c.values.slice((a+1)*n),(a+2)*n),o=a+1;break}}return c.times=t,c.values=i,o},"insertKeyframe"),mergeMorphTargetTracks:T(function(c,e){let s=[],n={},t=c.tracks;for(let i=0;i<t.length;++i){let r=t[i],o=z.parseTrackName(r.name),a=z.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(r);continue}if(r.createInterpolant!==r.InterpolantFactoryMethodDiscrete&&r.createInterpolant!==r.InterpolantFactoryMethodLinear){if(r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),r=r.clone(),r.setInterpolation(De)}let l=a.morphTargetInfluences.length,h=a.morphTargetDictionary[o.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let u;if(n[a.uuid]===void 0){u=r.clone();let f=new u.ValueBufferType(l*u.times.length);for(let p=0;p<u.times.length;p++)f[p*l+h]=u.values[p];u.name=(o.nodeName||"")+".morphTargetInfluences",u.values=f,n[a.uuid]=u,s.push(u);continue}let w=r.createInterpolant(new r.ValueBufferType(1));u=n[a.uuid];for(let f=0;f<u.times.length;f++)u.values[f*l+h]=w.evaluate(u.times[f]);for(let f=0;f<r.times.length;f++){let p=this.insertKeyframe(u,r.times[f]);u.values[p*l+h]=r.values[f]}}return c.tracks=s,c},"mergeMorphTargetTracks"),toFloat32BufferAttribute:T(function(c){let e=new U(new Float32Array(c.count*c.itemSize),c.itemSize,!1);if(!c.normalized&&!c.isInterleavedBufferAttribute)return e.array.set(c.array),e;for(let s=0,n=c.count;s<n;s++)for(let t=0;t<c.itemSize;t++)e.setComponent(s,t,c.getComponent(s,t));return e},"toFloat32BufferAttribute")};export{P as GLTFExporter};
@@ -0,0 +1 @@
1
+ import{b as ce}from"./chunk-YGXQDTMT.js";import{$ as wt,$a as Wt,A as b,H as Et,Ha as se,I as J,Ia as w,K as $,M as ee,Ma as jt,Na as re,Oa as ie,P as te,Pa as oe,Q as D,Qa as Kt,R as xt,Ra as Ft,S as St,Sa as ae,T as j,Ta as Vt,Ua as Xt,V as ne,Va as Gt,W as O,Wa as zt,X,Xa as qt,Y as H,Z as G,Za as B,_ as yt,bb as Yt,c as ft,e as dt,ea as Nt,fa as z,g as F,h as ht,ha as bt,i as pt,ia as Mt,j as Y,ja as It,k as mt,ka as Lt,l as At,m as V,ma as Ot,n as gt,na as Ct,o as Q,oa as Dt,ra as Pt,s as Tt,sa as kt,t as Z,ta as Ht,ua as Bt,v as Rt,va as vt,w as _t,wa as Ut,z as k}from"./chunk-6X6EHSZ7.js";import{a as lt}from"./chunk-5SHMBNLX.js";import{c as p}from"./chunk-PEDEW3M6.js";lt();var ve=class ve extends Ft{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new me(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new we(e)}),this.register(function(e){return new Ne(e)}),this.register(function(e){return new be(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new ye(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new Ie(e)})}load(t,e,r,n){let s=this,i;if(this.resourcePath!=="")i=this.resourcePath;else if(this.path!==""){let c=B.extractUrlBase(t);i=B.resolveURL(c,this.path)}else i=B.extractUrlBase(t);this.manager.itemStart(t);let a=p(function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},"_onError"),o=new ae(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,i,function(l){e(l),s.manager.itemEnd(t)},a)}catch(l){a(l)}},r,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,r,n){let s,i={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===tn){try{i[g.KHR_BINARY_GLTF]=new Le(t)}catch(u){n&&n(u);return}s=JSON.parse(i[g.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new Be(s,{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<this.pluginCallbacks.length;l++){let u=this.pluginCallbacks[l](c);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,i[u.name]=!0}if(s.extensionsUsed)for(let l=0;l<s.extensionsUsed.length;++l){let u=s.extensionsUsed[l],f=s.extensionsRequired||[];switch(u){case g.KHR_MATERIALS_UNLIT:i[u]=new he;break;case g.KHR_DRACO_MESH_COMPRESSION:i[u]=new Oe(s,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:i[u]=new Ce;break;case g.KHR_MESH_QUANTIZATION:i[u]=new De;break;default:f.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(i),c.setPlugins(a),c.parse(r,n)}parseAsync(t,e){let r=this;return new Promise(function(n,s){r.parse(t,e,n,s)})}};p(ve,"GLTFLoader");var Qt=ve;function nn(){let h={};return{get:p(function(t){return h[t]},"get"),add:p(function(t,e){h[t]=e},"add"),remove:p(function(t){delete h[t]},"remove"),removeAll:p(function(){h={}},"removeAll")}}p(nn,"GLTFRegistry");var g={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"},Ue=class Ue{constructor(t){this.parser=t,this.name=g.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let t=this.parser,e=this.parser.json.nodes||[];for(let r=0,n=e.length;r<n;r++){let s=e[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){let e=this.parser,r="light:"+t,n=e.cache.get(r);if(n)return n;let s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t],c,l=new O(16777215);o.color!==void 0&&l.setRGB(o.color[0],o.color[1],o.color[2],b);let u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new qt(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Gt(l),c.distance=u;break;case"spot":c=new Xt(l),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),M(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(r,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){let e=this,r=this.parser,s=r.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return r._getNodeRef(e.cache,a,o)})}};p(Ue,"GLTFLightsExtension");var de=Ue,je=class je{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return H}extendParams(t,e,r){let n=[];t.color=new O(1,1,1),t.opacity=1;let s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){let i=s.baseColorFactor;t.color.setRGB(i[0],i[1],i[2],b),t.opacity=i[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(t,"map",s.baseColorTexture,k))}return Promise.all(n)}};p(je,"GLTFMaterialsUnlitExtension");var he=je,Ke=class Ke{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}};p(Ke,"GLTFMaterialsEmissiveStrengthExtension");var pe=Ke,Fe=class Fe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];if(i.clearcoatFactor!==void 0&&(e.clearcoat=i.clearcoatFactor),i.clearcoatTexture!==void 0&&s.push(r.assignTexture(e,"clearcoatMap",i.clearcoatTexture)),i.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=i.clearcoatRoughnessFactor),i.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(e,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),i.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(e,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0)){let a=i.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new J(a,a)}return Promise.all(s)}};p(Fe,"GLTFMaterialsClearcoatExtension");var me=Fe,Ve=class Ve{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_DISPERSION}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}};p(Ve,"GLTFMaterialsDispersionExtension");var Ae=Ve,Xe=class Xe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.iridescenceFactor!==void 0&&(e.iridescence=i.iridescenceFactor),i.iridescenceTexture!==void 0&&s.push(r.assignTexture(e,"iridescenceMap",i.iridescenceTexture)),i.iridescenceIor!==void 0&&(e.iridescenceIOR=i.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),i.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),i.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),i.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(e,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(s)}};p(Xe,"GLTFMaterialsIridescenceExtension");var ge=Xe,Ge=class Ge{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_SHEEN}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[];e.sheenColor=new O(0,0,0),e.sheenRoughness=0,e.sheen=1;let i=n.extensions[this.name];if(i.sheenColorFactor!==void 0){let a=i.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],b)}return i.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=i.sheenRoughnessFactor),i.sheenColorTexture!==void 0&&s.push(r.assignTexture(e,"sheenColorMap",i.sheenColorTexture,k)),i.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(e,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(s)}};p(Ge,"GLTFMaterialsSheenExtension");var Te=Ge,ze=class ze{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.transmissionFactor!==void 0&&(e.transmission=i.transmissionFactor),i.transmissionTexture!==void 0&&s.push(r.assignTexture(e,"transmissionMap",i.transmissionTexture)),Promise.all(s)}};p(ze,"GLTFMaterialsTransmissionExtension");var Re=ze,qe=class qe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_VOLUME}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];e.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0&&s.push(r.assignTexture(e,"thicknessMap",i.thicknessTexture)),e.attenuationDistance=i.attenuationDistance||1/0;let a=i.attenuationColor||[1,1,1];return e.attenuationColor=new O().setRGB(a[0],a[1],a[2],b),Promise.all(s)}};p(qe,"GLTFMaterialsVolumeExtension");var _e=qe,We=class We{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_IOR}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}};p(We,"GLTFMaterialsIorExtension");var Ee=We,Ye=class Ye{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_SPECULAR}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];e.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0&&s.push(r.assignTexture(e,"specularIntensityMap",i.specularTexture));let a=i.specularColorFactor||[1,1,1];return e.specularColor=new O().setRGB(a[0],a[1],a[2],b),i.specularColorTexture!==void 0&&s.push(r.assignTexture(e,"specularColorMap",i.specularColorTexture,k)),Promise.all(s)}};p(Ye,"GLTFMaterialsSpecularExtension");var xe=Ye,Qe=class Qe{constructor(t){this.parser=t,this.name=g.EXT_MATERIALS_BUMP}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return e.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0&&s.push(r.assignTexture(e,"bumpMap",i.bumpTexture)),Promise.all(s)}};p(Qe,"GLTFMaterialsBumpExtension");var Se=Qe,Ze=class Ze{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:w}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.anisotropyStrength!==void 0&&(e.anisotropy=i.anisotropyStrength),i.anisotropyRotation!==void 0&&(e.anisotropyRotation=i.anisotropyRotation),i.anisotropyTexture!==void 0&&s.push(r.assignTexture(e,"anisotropyMap",i.anisotropyTexture)),Promise.all(s)}};p(Ze,"GLTFMaterialsAnisotropyExtension");var ye=Ze,Je=class Je{constructor(t){this.parser=t,this.name=g.KHR_TEXTURE_BASISU}loadTexture(t){let e=this.parser,r=e.json,n=r.textures[t];if(!n.extensions||!n.extensions[this.name])return null;let s=n.extensions[this.name],i=e.options.ktx2Loader;if(!i){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,i)}};p(Je,"GLTFTextureBasisUExtension");var we=Je,$e=class $e{constructor(t){this.parser=t,this.name=g.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){let e=this.name,r=this.parser,n=r.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;let i=s.extensions[e],a=n.images[i.source],o=r.textureLoader;if(a.uri){let c=r.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(t,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){let e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}};p($e,"GLTFTextureWebPExtension");var Ne=$e,et=class et{constructor(t){this.parser=t,this.name=g.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){let e=this.name,r=this.parser,n=r.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;let i=s.extensions[e],a=n.images[i.source],o=r.textureLoader;if(a.uri){let c=r.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(t,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){let e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}};p(et,"GLTFTextureAVIFExtension");var be=et,tt=class tt{constructor(t){this.name=g.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){let e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){let n=r.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.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 s.then(function(a){let o=n.byteOffset||0,c=n.byteLength||0,l=n.count,u=n.byteStride,f=new Uint8Array(a,o,c);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(l,u,f,n.mode,n.filter).then(function(d){return d.buffer}):i.ready.then(function(){let d=new ArrayBuffer(l*u);return i.decodeGltfBuffer(new Uint8Array(d),l,u,f,n.mode,n.filter),d})})}else return null}};p(tt,"GLTFMeshoptCompression");var Me=tt,nt=class nt{constructor(t){this.name=g.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){let e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;let n=e.meshes[r.mesh];for(let c of n.primitives)if(c.mode!==S.TRIANGLES&&c.mode!==S.TRIANGLE_STRIP&&c.mode!==S.TRIANGLE_FAN&&c.mode!==void 0)return null;let i=r.extensions[this.name].attributes,a=[],o={};for(let c in i)a.push(this.parser.getDependency("accessor",i[c]).then(l=>(o[c]=l,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{let l=c.pop(),u=l.isGroup?l.children:[l],f=c[0].count,d=[];for(let A of u){let R=new j,m=new D,T=new te,E=new D(1,1,1),x=new Dt(A.geometry,A.material,f);for(let _=0;_<f;_++)o.TRANSLATION&&m.fromBufferAttribute(o.TRANSLATION,_),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,_),o.SCALE&&E.fromBufferAttribute(o.SCALE,_),x.setMatrixAt(_,R.compose(m,T,E));for(let _ in o)if(_==="_COLOR_0"){let N=o[_];x.instanceColor=new Ct(N.array,N.itemSize,N.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&A.geometry.setAttribute(_,o[_]);ne.prototype.copy.call(x,A),this.parser.assignFinalMaterial(x),d.push(x)}return l.isGroup?(l.clear(),l.add(...d),l):d[0]}))}};p(nt,"GLTFMeshGpuInstancing");var Ie=nt,tn="glTF",K=12,Zt={JSON:1313821514,BIN:5130562},st=class st{constructor(t){this.name=g.KHR_BINARY_GLTF,this.content=null,this.body=null;let e=new DataView(t,0,K),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==tn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-K,s=new DataView(t,K),i=0;for(;i<n;){let a=s.getUint32(i,!0);i+=4;let o=s.getUint32(i,!0);if(i+=4,o===Zt.JSON){let c=new Uint8Array(t,K+i,a);this.content=r.decode(c)}else if(o===Zt.BIN){let c=K+i;this.body=t.slice(c,c+a)}i+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}};p(st,"GLTFBinaryExtension");var Le=st,rt=class rt{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=g.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){let r=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,i=t.extensions[this.name].attributes,a={},o={},c={};for(let l in i){let u=ke[l]||l.toLowerCase();a[u]=i[l]}for(let l in t.attributes){let u=ke[l]||l.toLowerCase();if(i[l]!==void 0){let f=r.accessors[t.attributes[l]],d=v[f.componentType];c[u]=d.name,o[u]=f.normalized===!0}}return e.getDependency("bufferView",s).then(function(l){return new Promise(function(u,f){n.decodeDracoFile(l,function(d){for(let A in d.attributes){let R=d.attributes[A],m=o[A];m!==void 0&&(R.normalized=m)}u(d)},a,c,b,f)})})}};p(rt,"GLTFDracoMeshCompressionExtension");var Oe=rt,it=class it{constructor(){this.name=g.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}};p(it,"GLTFTextureTransformExtension");var Ce=it,ot=class ot{constructor(){this.name=g.KHR_MESH_QUANTIZATION}};p(ot,"GLTFMeshQuantizationExtension");var De=ot,at=class at extends jt{constructor(t,e,r,n){super(t,e,r,n)}copySampleValue_(t){let e=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let i=0;i!==n;i++)e[i]=r[s+i];return e}interpolate_(t,e,r,n){let s=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,l=n-e,u=(r-e)/l,f=u*u,d=f*u,A=t*c,R=A-c,m=-2*d+3*f,T=d-f,E=1-m,x=T-f+u;for(let _=0;_!==a;_++){let N=i[R+_+a],I=i[R+_+o]*l,y=i[A+_+a],U=i[A+_]*l;s[_]=E*N+x*I+m*y+T*U}return s}};p(at,"GLTFCubicSplineInterpolant");var q=at,sn=new te,ct=class ct extends q{interpolate_(t,e,r,n){let s=super.interpolate_(t,e,r,n);return sn.fromArray(s).normalize().toArray(s),s}};p(ct,"GLTFCubicSplineQuaternionInterpolant");var Pe=ct,S={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},v={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Jt={9728:Y,9729:V,9984:mt,9985:gt,9986:At,9987:Q},$t={33071:ht,33648:pt,10497:F},ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ke={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},C={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},rn={CUBICSPLINE:void 0,LINEAR:Z,STEP:Tt},le={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function on(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new se({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ft})),h.DefaultMaterial}p(on,"createDefaultMaterial");function P(h,t,e){for(let r in e.extensions)h[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=e.extensions[r])}p(P,"addUnknownExtensionsToUserData");function M(h,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(h.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}p(M,"assignExtrasToUserData");function an(h,t,e){let r=!1,n=!1,s=!1;for(let c=0,l=t.length;c<l;c++){let u=t[c];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(h);let i=[],a=[],o=[];for(let c=0,l=t.length;c<l;c++){let u=t[c];if(r){let f=u.POSITION!==void 0?e.getDependency("accessor",u.POSITION):h.attributes.position;i.push(f)}if(n){let f=u.NORMAL!==void 0?e.getDependency("accessor",u.NORMAL):h.attributes.normal;a.push(f)}if(s){let f=u.COLOR_0!==void 0?e.getDependency("accessor",u.COLOR_0):h.attributes.color;o.push(f)}}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(o)]).then(function(c){let l=c[0],u=c[1],f=c[2];return r&&(h.morphAttributes.position=l),n&&(h.morphAttributes.normal=u),s&&(h.morphAttributes.color=f),h.morphTargetsRelative=!0,h})}p(an,"addMorphTargets");function cn(h,t){if(h.updateMorphTargets(),t.weights!==void 0)for(let e=0,r=t.weights.length;e<r;e++)h.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){let e=t.extras.targetNames;if(h.morphTargetInfluences.length===e.length){h.morphTargetDictionary={};for(let r=0,n=e.length;r<n;r++)h.morphTargetDictionary[e[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}p(cn,"updateMorphTargets");function un(h){let t,e=h.extensions&&h.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+fe(e.attributes):t=h.indices+":"+fe(h.attributes)+":"+h.mode,h.targets!==void 0)for(let r=0,n=h.targets.length;r<n;r++)t+=":"+fe(h.targets[r]);return t}p(un,"createPrimitiveKey");function fe(h){let t="",e=Object.keys(h).sort();for(let r=0,n=e.length;r<n;r++)t+=e[r]+":"+h[e[r]]+";";return t}p(fe,"createAttributesKey");function He(h){switch(h){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}p(He,"getNormalizedComponentScale");function ln(h){return h.search(/\.jpe?g($|\?)/i)>0||h.search(/^data\:image\/jpeg/)===0?"image/jpeg":h.search(/\.webp($|\?)/i)>0||h.search(/^data\:image\/webp/)===0?"image/webp":h.search(/\.ktx2($|\?)/i)>0||h.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}p(ln,"getImageURIMimeType");var fn=new j,ut=class ut{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new nn,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 r=!1,n=-1,s=!1,i=-1;if(typeof navigator<"u"){let a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;let o=a.match(/Version\/(\d+)/);n=r&&o?parseInt(o[1],10):-1,s=a.indexOf("Firefox")>-1,i=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&n<17||s&&i<98?this.textureLoader=new Vt(this.options.manager):this.textureLoader=new Wt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ae(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){let r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(i){return i._markDefs&&i._markDefs()}),Promise.all(this._invokeAll(function(i){return i.beforeRoot&&i.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(i){let a={scene:i[0][n.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:n.asset,parser:r,userData:{}};return P(s,a,n),M(a,n),Promise.all(r._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(let o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){let t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){let i=e[n].joints;for(let a=0,o=i.length;a<o;a++)t[i[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){let i=t[n];i.mesh!==void 0&&(this._addNodeRef(this.meshCache,i.mesh),i.skin!==void 0&&(r[i.mesh].isSkinnedMesh=!0)),i.camera!==void 0&&this._addNodeRef(this.cameraCache,i.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,r){if(t.refs[e]<=1)return r;let n=r.clone(),s=p((i,a)=>{let o=this.associations.get(i);o!=null&&this.associations.set(a,o);for(let[c,l]of i.children.entries())s(l,a.children[c])},"updateMappings");return s(r,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){let e=Object.values(this.plugins);e.push(this);for(let r=0;r<e.length;r++){let n=t(e[r]);if(n)return n}return null}_invokeAll(t){let e=Object.values(this.plugins);e.unshift(this);let r=[];for(let n=0;n<e.length;n++){let s=t(e[n]);s&&r.push(s)}return r}getDependency(t,e){let r=t+":"+e,n=this.cache.get(r);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(r,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){let r=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,i){return r.getDependency(t,i)})),this.cache.add(t,e)}return e}loadBuffer(t){let e=this.json.buffers[t],r=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);let n=this.options;return new Promise(function(s,i){r.load(B.resolveURL(e.uri,n.path),s,void 0,function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){let e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(r){let n=e.byteLength||0,s=e.byteOffset||0;return r.slice(s,s+n)})}loadAccessor(t){let e=this,r=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){let i=ue[n.type],a=v[n.componentType],o=n.normalized===!0,c=new a(n.count*i);return Promise.resolve(new G(c,i,o))}let s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(i){let a=i[0],o=ue[n.type],c=v[n.componentType],l=c.BYTES_PER_ELEMENT,u=l*o,f=n.byteOffset||0,d=n.bufferView!==void 0?r.bufferViews[n.bufferView].byteStride:void 0,A=n.normalized===!0,R,m;if(d&&d!==u){let T=Math.floor(f/d),E="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+T+":"+n.count,x=e.cache.get(E);x||(R=new c(a,T*d,n.count*d/l),x=new bt(R,d/l),e.cache.add(E,x)),m=new Mt(x,o,f%d/l,A)}else a===null?R=new c(n.count*o):R=new c(a,f,n.count*o),m=new G(R,o,A);if(n.sparse!==void 0){let T=ue.SCALAR,E=v[n.sparse.indices.componentType],x=n.sparse.indices.byteOffset||0,_=n.sparse.values.byteOffset||0,N=new E(i[1],x,n.sparse.count*T),I=new c(i[2],_,n.sparse.count*o);a!==null&&(m=new G(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let y=0,U=N.length;y<U;y++){let L=N[y];if(m.setX(L,I[y*o]),o>=2&&m.setY(L,I[y*o+1]),o>=3&&m.setZ(L,I[y*o+2]),o>=4&&m.setW(L,I[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=A}return m})}loadTexture(t){let e=this.json,r=this.options,s=e.textures[t].source,i=e.images[s],a=this.textureLoader;if(i.uri){let o=r.manager.getHandler(i.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,r){let n=this,s=this.json,i=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[o])return this.textureCache[o];let c=this.loadImageSource(e,r).then(function(l){l.flipY=!1,l.name=i.name||a.name||"",l.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(l.name=a.uri);let f=(s.samplers||{})[i.sampler]||{};return l.magFilter=Jt[f.magFilter]||V,l.minFilter=Jt[f.minFilter]||Q,l.wrapS=$t[f.wrapS]||F,l.wrapT=$t[f.wrapT]||F,l.generateMipmaps=!l.isCompressedTexture&&l.minFilter!==Y&&l.minFilter!==V,n.associations.set(l,{textures:t}),l}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){let r=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());let i=n.images[t],a=self.URL||self.webkitURL,o=i.uri||"",c=!1;if(i.bufferView!==void 0)o=r.getDependency("bufferView",i.bufferView).then(function(u){c=!0;let f=new Blob([u],{type:i.mimeType});return o=a.createObjectURL(f),o});else if(i.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(u){return new Promise(function(f,d){let A=f;e.isImageBitmapLoader===!0&&(A=p(function(R){let m=new ee(R);m.needsUpdate=!0,f(m)},"onLoad")),e.load(B.resolveURL(u,s.path),A,void 0,d)})}).then(function(u){return c===!0&&a.revokeObjectURL(o),M(u,i),u.userData.mimeType=i.mimeType||ln(i.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,r,n){let s=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(i=i.clone(),i.channel=r.texCoord),s.extensions[g.KHR_TEXTURE_TRANSFORM]){let a=r.extensions!==void 0?r.extensions[g.KHR_TEXTURE_TRANSFORM]:void 0;if(a){let o=s.associations.get(i);i=s.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(i,a),s.associations.set(i,o)}}return n!==void 0&&(i.colorSpace=n),t[e]=i,i})}assignFinalMaterial(t){let e=t.geometry,r=t.material,n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,i=e.attributes.normal===void 0;if(t.isPoints){let a="PointsMaterial:"+r.uuid,o=this.cache.get(a);o||(o=new vt,X.prototype.copy.call(o,r),o.color.copy(r.color),o.map=r.map,o.sizeAttenuation=!1,this.cache.add(a,o)),r=o}else if(t.isLine){let a="LineBasicMaterial:"+r.uuid,o=this.cache.get(a);o||(o=new Pt,X.prototype.copy.call(o,r),o.color.copy(r.color),o.map=r.map,this.cache.add(a,o)),r=o}if(n||s||i){let a="ClonedMaterial:"+r.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),i&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=r.clone(),s&&(o.vertexColors=!0),i&&(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(r))),r=o}t.material=r}getMaterialType(){return se}loadMaterial(t){let e=this,r=this.json,n=this.extensions,s=r.materials[t],i,a={},o=s.extensions||{},c=[];if(o[g.KHR_MATERIALS_UNLIT]){let u=n[g.KHR_MATERIALS_UNLIT];i=u.getMaterialType(),c.push(u.extendParams(a,s,e))}else{let u=s.pbrMetallicRoughness||{};if(a.color=new O(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){let f=u.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],b),a.opacity=f[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",u.baseColorTexture,k)),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))),i=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=dt);let l=s.alphaMode||le.OPAQUE;if(l===le.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===le.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&i!==H&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new J(1,1),s.normalTexture.scale!==void 0)){let u=s.normalTexture.scale;a.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&i!==H&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&i!==H){let u=s.emissiveFactor;a.emissive=new O().setRGB(u[0],u[1],u[2],b)}return s.emissiveTexture!==void 0&&i!==H&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,k)),Promise.all(c).then(function(){let u=new i(a);return s.name&&(u.name=s.name),M(u,s),e.associations.set(u,{materials:t}),s.extensions&&P(n,u,s),u})}createUniqueName(t){let e=Yt.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){let e=this,r=this.extensions,n=this.primitiveCache;function s(a){return r[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return en(o,a,e)})}p(s,"createDracoPrimitive");let i=[];for(let a=0,o=t.length;a<o;a++){let c=t[a],l=un(c),u=n[l];if(u)i.push(u.promise);else{let f;c.extensions&&c.extensions[g.KHR_DRACO_MESH_COMPRESSION]?f=s(c):f=en(new yt,c,e),n[l]={primitive:c,promise:f},i.push(f)}}return Promise.all(i)}loadMesh(t){let e=this,r=this.json,n=this.extensions,s=r.meshes[t],i=s.primitives,a=[];for(let o=0,c=i.length;o<c;o++){let l=i[o].material===void 0?on(this.cache):this.getDependency("material",i[o].material);a.push(l)}return a.push(e.loadGeometries(i)),Promise.all(a).then(function(o){let c=o.slice(0,o.length-1),l=o[o.length-1],u=[];for(let d=0,A=l.length;d<A;d++){let R=l[d],m=i[d],T,E=c[d];if(m.mode===S.TRIANGLES||m.mode===S.TRIANGLE_STRIP||m.mode===S.TRIANGLE_FAN||m.mode===void 0)T=s.isSkinnedMesh===!0?new It(R,E):new wt(R,E),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),m.mode===S.TRIANGLE_STRIP?T.geometry=ce(T.geometry,Rt):m.mode===S.TRIANGLE_FAN&&(T.geometry=ce(T.geometry,_t));else if(m.mode===S.LINES)T=new Ht(R,E);else if(m.mode===S.LINE_STRIP)T=new kt(R,E);else if(m.mode===S.LINE_LOOP)T=new Bt(R,E);else if(m.mode===S.POINTS)T=new Ut(R,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(T.geometry.morphAttributes).length>0&&cn(T,s),T.name=e.createUniqueName(s.name||"mesh_"+t),M(T,s),m.extensions&&P(n,T,m),e.assignFinalMaterial(T),u.push(T)}for(let d=0,A=u.length;d<A;d++)e.associations.set(u[d],{meshes:t,primitives:d});if(u.length===1)return s.extensions&&P(n,u[0],s),u[0];let f=new z;s.extensions&&P(n,f,s),e.associations.set(f,{meshes:t});for(let d=0,A=u.length;d<A;d++)f.add(u[d]);return f})}loadCamera(t){let e,r=this.json.cameras[t],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?e=new Nt(Et.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(e=new zt(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(e.name=this.createUniqueName(r.name)),M(e,r),Promise.resolve(e)}loadSkin(t){let e=this.json.skins[t],r=[];for(let n=0,s=e.joints.length;n<s;n++)r.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",e.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(n){let s=n.pop(),i=n,a=[],o=[];for(let c=0,l=i.length;c<l;c++){let u=i[c];if(u){a.push(u);let f=new j;s!==null&&f.fromArray(s.array,c*16),o.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Ot(a,o)})}loadAnimation(t){let e=this.json,r=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,i=[],a=[],o=[],c=[],l=[];for(let u=0,f=n.channels.length;u<f;u++){let d=n.channels[u],A=n.samplers[d.sampler],R=d.target,m=R.node,T=n.parameters!==void 0?n.parameters[A.input]:A.input,E=n.parameters!==void 0?n.parameters[A.output]:A.output;R.node!==void 0&&(i.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",E)),c.push(A),l.push(R))}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(l)]).then(function(u){let f=u[0],d=u[1],A=u[2],R=u[3],m=u[4],T=[];for(let E=0,x=f.length;E<x;E++){let _=f[E],N=d[E],I=A[E],y=R[E],U=m[E];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();let L=r._createAnimationTracks(_,N,I,y,U);if(L)for(let W=0;W<L.length;W++)T.push(L[W])}return new Kt(s,void 0,T)})}createNodeMesh(t){let e=this.json,r=this,n=e.nodes[t];return n.mesh===void 0?null:r.getDependency("mesh",n.mesh).then(function(s){let i=r._getNodeRef(r.meshCache,n.mesh,s);return n.weights!==void 0&&i.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),i})}loadNode(t){let e=this.json,r=this,n=e.nodes[t],s=r._loadNodeShallow(t),i=[],a=n.children||[];for(let c=0,l=a.length;c<l;c++)i.push(r.getDependency("node",a[c]));let o=n.skin===void 0?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([s,Promise.all(i),o]).then(function(c){let l=c[0],u=c[1],f=c[2];f!==null&&l.traverse(function(d){d.isSkinnedMesh&&d.bind(f,fn)});for(let d=0,A=u.length;d<A;d++)l.add(u[d]);return l})}_loadNodeShallow(t){let e=this.json,r=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];let s=e.nodes[t],i=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let l;if(s.isBone===!0?l=new Lt:c.length>1?l=new z:c.length===1?l=c[0]:l=new ne,l!==c[0])for(let u=0,f=c.length;u<f;u++)l.add(c[u]);if(s.name&&(l.userData.name=s.name,l.name=i),M(l,s),s.extensions&&P(r,l,s),s.matrix!==void 0){let u=new j;u.fromArray(s.matrix),l.applyMatrix4(u)}else s.translation!==void 0&&l.position.fromArray(s.translation),s.rotation!==void 0&&l.quaternion.fromArray(s.rotation),s.scale!==void 0&&l.scale.fromArray(s.scale);return n.associations.has(l)||n.associations.set(l,{}),n.associations.get(l).nodes=t,l}),this.nodeCache[t]}loadScene(t){let e=this.extensions,r=this.json.scenes[t],n=this,s=new z;r.name&&(s.name=n.createUniqueName(r.name)),M(s,r),r.extensions&&P(e,s,r);let i=r.nodes||[],a=[];for(let o=0,c=i.length;o<c;o++)a.push(n.getDependency("node",i[o]));return Promise.all(a).then(function(o){for(let l=0,u=o.length;l<u;l++)s.add(o[l]);let c=p(l=>{let u=new Map;for(let[f,d]of n.associations)(f instanceof X||f instanceof ee)&&u.set(f,d);return l.traverse(f=>{let d=n.associations.get(f);d!=null&&u.set(f,d)}),u},"reduceAssociations");return n.associations=c(s),s})}_createAnimationTracks(t,e,r,n,s){let i=[],a=t.name?t.name:t.uuid,o=[];C[s.path]===C.weights?t.traverse(function(f){f.morphTargetInfluences&&o.push(f.name?f.name:f.uuid)}):o.push(a);let c;switch(C[s.path]){case C.weights:c=re;break;case C.rotation:c=ie;break;case C.position:case C.scale:c=oe;break;default:switch(r.itemSize){case 1:c=re;break;case 2:case 3:default:c=oe;break}break}let l=n.interpolation!==void 0?rn[n.interpolation]:Z,u=this._getArrayFromAccessor(r);for(let f=0,d=o.length;f<d;f++){let A=new c(o[f]+"."+C[s.path],e.array,u,l);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(A),i.push(A)}return i}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){let r=He(e.constructor),n=new Float32Array(e.length);for(let s=0,i=e.length;s<i;s++)n[s]=e[s]*r;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=p(function(r){let n=this instanceof ie?Pe:q;return new n(this.times,this.values,this.getValueSize()/3,r)},"InterpolantFactoryMethodGLTFCubicSpline"),t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};p(ut,"GLTFParser");var Be=ut;function dn(h,t,e){let r=t.attributes,n=new xt;if(r.POSITION!==void 0){let a=e.json.accessors[r.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new D(o[0],o[1],o[2]),new D(c[0],c[1],c[2])),a.normalized){let l=He(v[a.componentType]);n.min.multiplyScalar(l),n.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let s=t.targets;if(s!==void 0){let a=new D,o=new D;for(let c=0,l=s.length;c<l;c++){let u=s[c];if(u.POSITION!==void 0){let f=e.json.accessors[u.POSITION],d=f.min,A=f.max;if(d!==void 0&&A!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(A[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(A[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(A[2]))),f.normalized){let R=He(v[f.componentType]);o.multiplyScalar(R)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}h.boundingBox=n;let i=new St;n.getCenter(i.center),i.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=i}p(dn,"computeBounds");function en(h,t,e){let r=t.attributes,n=[];function s(i,a){return e.getDependency("accessor",i).then(function(o){h.setAttribute(a,o)})}p(s,"assignAttributeAccessor");for(let i in r){let a=ke[i]||i.toLowerCase();a in h.attributes||n.push(s(r[i],a))}if(t.indices!==void 0&&!h.index){let i=e.getDependency("accessor",t.indices).then(function(a){h.setIndex(a)});n.push(i)}return $.workingColorSpace!==b&&"COLOR_0"in r&&console.warn('THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "'.concat($.workingColorSpace,'" not supported.')),M(h,t),dn(h,t,e),Promise.all(n).then(function(){return t.targets!==void 0?an(h,t.targets,e):h})}p(en,"addPrimitiveAttributes");export{Qt as GLTFLoader};
@@ -0,0 +1 @@
1
+ import{a as hn}from"./chunk-5SHMBNLX.js";import{c as s}from"./chunk-PEDEW3M6.js";hn();var ln={},Qn=s(function(n,r,t,e,i){var a=new Worker(ln[r]||(ln[r]=URL.createObjectURL(new Blob([n+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var f=o.data,v=f.$e$;if(v){var u=new Error(v[0]);u.code=v[1],u.stack=v[2],i(u,null)}else i(null,f)},a.postMessage(t,e),a},"wk"),U=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new U([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 U([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]),Ur=new U([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=s(function(n,r){for(var t=new q(31),e=0;e<31;++e)t[e]=r+=1<<n[e-1];for(var i=new gr(t[30]),e=1;e<30;++e)for(var a=t[e];a<t[e+1];++a)i[a]=a-t[e]<<5|e;return[t,i]},"freb"),zn=xn(yr,2),dr=zn[0],Or=zn[1];dr[28]=258,Or[258]=28;var An=xn(wr,0),Mn=An[0],Yr=An[1],Dr=new q(32768);for(E=0;E<32768;++E)tr=(E&43690)>>>1|(E&21845)<<1,tr=(tr&52428)>>>2|(tr&13107)<<2,tr=(tr&61680)>>>4|(tr&3855)<<4,Dr[E]=((tr&65280)>>>8|(tr&255)<<8)>>>1;var tr,E,X=s(function(n,r,t){for(var e=n.length,i=0,a=new q(r);i<e;++i)n[i]&&++a[n[i]-1];var o=new q(r);for(i=0;i<r;++i)o[i]=o[i-1]+a[i-1]<<1;var f;if(t){f=new q(1<<r);var v=15-r;for(i=0;i<e;++i)if(n[i])for(var u=i<<4|n[i],h=r-n[i],l=o[n[i]-1]++<<h,y=l|(1<<h)-1;l<=y;++l)f[Dr[l]>>>v]=u}else for(f=new q(e),i=0;i<e;++i)n[i]&&(f[i]=Dr[o[n[i]-1]++]>>>15-n[i]);return f},"hMap"),ir=new U(288);for(E=0;E<144;++E)ir[E]=8;var E;for(E=144;E<256;++E)ir[E]=9;var E;for(E=256;E<280;++E)ir[E]=7;var E;for(E=280;E<288;++E)ir[E]=8;var E,cr=new U(32);for(E=0;E<32;++E)cr[E]=5;var E,Tn=X(ir,9,0),Un=X(ir,9,1),Dn=X(cr,5,0),Sn=X(cr,5,1),Zr=s(function(n){for(var r=n[0],t=1;t<n.length;++t)n[t]>r&&(r=n[t]);return r},"max"),V=s(function(n,r,t){var e=r/8|0;return(n[e]|n[e+1]<<8)>>(r&7)&t},"bits"),kr=s(function(n,r){var t=r/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(r&7)},"bits16"),Sr=s(function(n){return(n+7)/8|0},"shft"),d=s(function(n,r,t){(r==null||r<0)&&(r=0),(t==null||t>n.length)&&(t=n.length);var e=new(n.BYTES_PER_ELEMENT==2?q:n.BYTES_PER_ELEMENT==4?gr:U)(t-r);return e.set(n.subarray(r,t)),e},"slc"),at={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Cn=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],g=s(function(n,r,t){var e=new Error(r||Cn[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,g),!t)throw e;return e},"err"),Cr=s(function(n,r,t){var e=n.length;if(!e||t&&t.f&&!t.l)return r||new U(0);var i=!r||t,a=!t||t.i;t||(t={}),r||(r=new U(e*3));var o=s(function(Ir){var Tr=r.length;if(Ir>Tr){var vr=new U(Math.max(Tr*2,Ir));vr.set(r),r=vr}},"cbuf"),f=t.f||0,v=t.p||0,u=t.b||0,h=t.l,l=t.d,y=t.m,z=t.n,x=e*8;do{if(!h){f=V(n,v,1);var A=V(n,v+1,3);if(v+=3,A)if(A==1)h=Un,l=Sn,y=9,z=5;else if(A==2){var M=V(n,v,31)+257,m=V(n,v+10,15)+4,B=M+V(n,v+5,31)+1;v+=14;for(var C=new U(B),D=new U(19),c=0;c<m;++c)D[Ur[c]]=V(n,v+c*3,7);v+=m*3;for(var G=Zr(D),S=(1<<G)-1,R=X(D,G,1),c=0;c<B;){var Z=R[V(n,v,S)];v+=Z&15;var p=Z>>>4;if(p<16)C[c++]=p;else{var O=0,F=0;for(p==16?(F=3+V(n,v,3),v+=2,O=C[c-1]):p==17?(F=3+V(n,v,7),v+=3):p==18&&(F=11+V(n,v,127),v+=7);F--;)C[c++]=O}}var P=C.subarray(0,M),k=C.subarray(M);y=Zr(P),z=Zr(k),h=X(P,y,1),l=X(k,z,1)}else g(1);else{var p=Sr(v)+4,w=n[p-4]|n[p-3]<<8,T=p+w;if(T>e){a&&g(0);break}i&&o(u+w),r.set(n.subarray(p,T),u),t.b=u+=w,t.p=v=T*8,t.f=f;continue}if(v>x){a&&g(0);break}}i&&o(u+131072);for(var L=(1<<y)-1,H=(1<<z)-1,j=v;;j=v){var O=h[kr(n,v)&L],Q=O>>>4;if(v+=O&15,v>x){a&&g(0);break}if(O||g(2),Q<256)r[u++]=Q;else if(Q==256){j=v,h=null;break}else{var Y=Q-254;if(Q>264){var c=Q-257,_=yr[c];Y=V(n,v,(1<<_)-1)+dr[c],v+=_}var rr=l[kr(n,v)&H],J=rr>>>4;rr||g(3),v+=rr&15;var k=Mn[J];if(J>3){var _=wr[J];k+=kr(n,v)&(1<<_)-1,v+=_}if(v>x){a&&g(0);break}i&&o(u+131072);for(var $=u+Y;u<$;u+=4)r[u]=r[u-k],r[u+1]=r[u+1-k],r[u+2]=r[u+2-k],r[u+3]=r[u+3-k];u=$}}t.l=h,t.p=j,t.b=u,t.f=f,h&&(f=1,t.m=y,t.d=l,t.n=z)}while(!f);return u==r.length?r:d(r,0,u)},"inflt"),nr=s(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8},"wbits"),hr=s(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8,n[e+2]|=t>>>16},"wbits16"),Gr=s(function(n,r){for(var t=[],e=0;e<n.length;++e)n[e]&&t.push({s:e,f:n[e]});var i=t.length,a=t.slice();if(!i)return[er,0];if(i==1){var o=new U(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(B,C){return B.f-C.f}),t.push({s:-1,f:25001});var f=t[0],v=t[1],u=0,h=1,l=2;for(t[0]={s:-1,f:f.f+v.f,l:f,r:v};h!=i-1;)f=t[t[u].f<t[l].f?u++:l++],v=t[u!=h&&t[u].f<t[l].f?u++:l++],t[h++]={s:-1,f:f.f+v.f,l:f,r:v};for(var y=a[0].s,e=1;e<i;++e)a[e].s>y&&(y=a[e].s);var z=new q(y+1),x=Lr(t[h-1],z,0);if(x>r){var e=0,A=0,p=x-r,w=1<<p;for(a.sort(function(C,D){return z[D.s]-z[C.s]||C.f-D.f});e<i;++e){var T=a[e].s;if(z[T]>r)A+=w-(1<<x-z[T]),z[T]=r;else break}for(A>>>=p;A>0;){var M=a[e].s;z[M]<r?A-=1<<r-z[M]++-1:++e}for(;e>=0&&A;--e){var m=a[e].s;z[m]==r&&(--z[m],++A)}x=r}return[new U(z),x]},"hTree"),Lr=s(function(n,r,t){return n.s==-1?Math.max(Lr(n.l,r,t+1),Lr(n.r,r,t+1)):r[n.s]=t},"ln"),Wr=s(function(n){for(var r=n.length;r&&!n[--r];);for(var t=new q(++r),e=0,i=n[0],a=1,o=s(function(v){t[e++]=v},"w"),f=1;f<=r;++f)if(n[f]==i&&f!=r)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=n[f]}return[t.subarray(0,e),r]},"lc"),lr=s(function(n,r){for(var t=0,e=0;e<r.length;++e)t+=n[e]*r[e];return t},"clen"),Pr=s(function(n,r,t){var e=t.length,i=Sr(r+2);n[i]=e&255,n[i+1]=e>>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var a=0;a<e;++a)n[i+a+4]=t[a];return(i+4+e)*8},"wfblk"),jr=s(function(n,r,t,e,i,a,o,f,v,u,h){nr(r,h++,t),++i[256];for(var l=Gr(i,15),y=l[0],z=l[1],x=Gr(a,15),A=x[0],p=x[1],w=Wr(y),T=w[0],M=w[1],m=Wr(A),B=m[0],C=m[1],D=new q(19),c=0;c<T.length;++c)D[T[c]&31]++;for(var c=0;c<B.length;++c)D[B[c]&31]++;for(var G=Gr(D,7),S=G[0],R=G[1],Z=19;Z>4&&!S[Ur[Z-1]];--Z);var O=u+5<<3,F=lr(i,ir)+lr(a,cr)+o,P=lr(i,y)+lr(a,A)+o+14+3*Z+lr(D,S)+(2*D[16]+3*D[17]+7*D[18]);if(O<=F&&O<=P)return Pr(r,h,n.subarray(v,v+u));var k,L,H,j;if(nr(r,h,1+(P<F)),h+=2,P<F){k=X(y,z,0),L=y,H=X(A,p,0),j=A;var Q=X(S,R,0);nr(r,h,M-257),nr(r,h+5,C-1),nr(r,h+10,Z-4),h+=14;for(var c=0;c<Z;++c)nr(r,h+3*c,S[Ur[c]]);h+=3*Z;for(var Y=[T,B],_=0;_<2;++_)for(var rr=Y[_],c=0;c<rr.length;++c){var J=rr[c]&31;nr(r,h,Q[J]),h+=S[J],J>15&&(nr(r,h,rr[c]>>>5&127),h+=rr[c]>>>12)}}else k=Tn,L=ir,H=Dn,j=cr;for(var c=0;c<f;++c)if(e[c]>255){var J=e[c]>>>18&31;hr(r,h,k[J+257]),h+=L[J+257],J>7&&(nr(r,h,e[c]>>>23&31),h+=yr[J]);var $=e[c]&31;hr(r,h,H[$]),h+=j[$],$>3&&(hr(r,h,e[c]>>>5&8191),h+=wr[$])}else hr(r,h,k[e[c]]),h+=L[e[c]];return hr(r,h,k[256]),h+L[256]},"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new U(0),Fn=s(function(n,r,t,e,i,a){var o=n.length,f=new U(e+o+5*(1+Math.ceil(o/7e3))+i),v=f.subarray(e,f.length-i),u=0;if(!r||o<8)for(var h=0;h<=o;h+=65535){var l=h+65535;l>=o&&(v[u>>3]=a),u=Pr(v,u+1,n.subarray(h,l))}else{for(var y=En[r-1],z=y>>>13,x=y&8191,A=(1<<t)-1,p=new q(32768),w=new q(A+1),T=Math.ceil(t/3),M=2*T,m=s(function(qr){return(n[qr]^n[qr+1]<<T^n[qr+2]<<M)&A},"hsh"),B=new gr(25e3),C=new q(288),D=new q(32),c=0,G=0,h=0,S=0,R=0,Z=0;h<o;++h){var O=m(h),F=h&32767,P=w[O];if(p[F]=P,w[O]=F,R<=h){var k=o-h;if((c>7e3||S>24576)&&k>423){u=jr(n,v,0,B,C,D,G,S,Z,h-Z,u),S=c=G=0,Z=h;for(var L=0;L<286;++L)C[L]=0;for(var L=0;L<30;++L)D[L]=0}var H=2,j=0,Q=x,Y=F-P&32767;if(k>2&&O==m(h-Y))for(var _=Math.min(z,k)-1,rr=Math.min(32767,h),J=Math.min(258,k);Y<=rr&&--Q&&F!=P;){if(n[h+H]==n[h+H-Y]){for(var $=0;$<J&&n[h+$]==n[h+$-Y];++$);if($>H){if(H=$,j=Y,$>_)break;for(var Ir=Math.min(Y,$-2),Tr=0,L=0;L<Ir;++L){var vr=h-Y+L+32768&32767,Kn=p[vr],sn=vr-Kn+32768&32767;sn>Tr&&(Tr=sn,P=vr)}}}F=P,P=p[F],Y+=F-P+32768&32767}if(j){B[S++]=268435456|Or[H]<<18|Yr[j];var un=Or[H]&31,vn=Yr[j]&31;G+=yr[un]+wr[vn],++C[257+un],++D[vn],R=h+H,++c}else B[S++]=n[h],++C[n[h]]}}u=jr(n,v,a,B,C,D,G,S,Z,h-Z,u),!a&&u&7&&(u=Pr(v,u+1,er))}return d(f,0,e+Sr(u)+i)},"dflt"),In=function(){for(var n=new Int32Array(256),r=0;r<256;++r){for(var t=r,e=9;--e;)t=(t&1&&-306674912)^t>>>1;n[r]=t}return n}(),mr=s(function(){var n=-1;return{p:s(function(r){for(var t=n,e=0;e<r.length;++e)t=In[t&255^r[e]]^t>>>8;n=t},"p"),d:s(function(){return~n},"d")}},"crc"),br=s(function(){var n=1,r=0;return{p:s(function(t){for(var e=n,i=r,a=t.length|0,o=0;o!=a;){for(var f=Math.min(o+2655,a);o<f;++o)i+=e+=t[o];e=(e&65535)+15*(e>>16),i=(i&65535)+15*(i>>16)}n=e,r=i},"p"),d:s(function(){return n%=65521,r%=65521,(n&255)<<24|n>>>8<<16|(r&255)<<8|r>>>8},"d")}},"adler"),ur=s(function(n,r,t,e,i){return Fn(n,r.level==null?6:r.level,r.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+r.mem,t,e,!i)},"dopt"),Er=s(function(n,r){var t={};for(var e in n)t[e]=n[e];for(var e in r)t[e]=r[e];return t},"mrg"),cn=s(function(n,r,t){for(var e=n(),i=n.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<e.length;++o){var f=e[o],v=a[o];if(typeof f=="function"){r+=";"+v+"=";var u=f.toString();if(f.prototype)if(u.indexOf("[native code]")!=-1){var h=u.indexOf(" ",8)+1;r+=u.slice(h,u.indexOf("(",h))}else{r+=u;for(var l in f.prototype)r+=";"+v+".prototype."+l+"="+f.prototype[l].toString()}else r+=u}else t[v]=f}return[r,t]},"wcln"),Br=[],Vn=s(function(n){var r=[];for(var t in n)n[t].buffer&&r.push((n[t]=new n[t].constructor(n[t])).buffer);return r},"cbfs"),Bn=s(function(n,r,t,e){var i;if(!Br[t]){for(var a="",o={},f=n.length-1,v=0;v<f;++v)i=cn(n[v],a,o),a=i[0],o=i[1];Br[t]=cn(n[f],a,o)}var u=Er({},Br[t][1]);return Qn(Br[t][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,u,Vn(u),e)},"wrkr"),xr=s(function(){return[U,q,gr,yr,wr,Ur,dr,Mn,Un,Sn,Dr,Cn,X,Zr,V,kr,Sr,d,g,Cr,Fr,fr,_r]},"bInflt"),zr=s(function(){return[U,q,gr,yr,wr,Ur,Or,Yr,Tn,ir,Dn,cr,Dr,En,er,X,nr,hr,Gr,Lr,Wr,lr,Pr,jr,Sr,d,Fn,ur,$r,fr]},"bDflt"),Zn=s(function(){return[rn,tn,I,mr,In]},"gze"),kn=s(function(){return[nn,Ln]},"guze"),Gn=s(function(){return[en,I,br]},"zle"),On=s(function(){return[Pn]},"zule"),fr=s(function(n){return postMessage(n,[n.buffer])},"pbf"),_r=s(function(n){return n&&n.size&&new U(n.size)},"gu8"),Ar=s(function(n,r,t,e,i,a){var o=Bn(t,e,i,function(f,v){o.terminate(),a(f,v)});return o.postMessage([n,r],r.consume?[n.buffer]:[]),function(){o.terminate()}},"cbify"),b=s(function(n){return n.ondata=function(r,t){return postMessage([r,t],[r.buffer])},function(r){return n.push(r.data[0],r.data[1])}},"astrm"),Mr=s(function(n,r,t,e,i){var a,o=Bn(n,e,i,function(f,v){f?(o.terminate(),r.ondata.call(r,f)):(v[1]&&o.terminate(),r.ondata.call(r,f,v[0],v[1]))});o.postMessage(t),r.push=function(f,v){r.ondata||g(5),a&&r.ondata(g(4,0,1),null,!!v),o.postMessage([f,a=v],[f.buffer])},r.terminate=function(){o.terminate()}},"astrmify"),W=s(function(n,r){return n[r]|n[r+1]<<8},"b2"),N=s(function(n,r){return(n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24)>>>0},"b4"),Hr=s(function(n,r){return N(n,r)+N(n,r+4)*4294967296},"b8"),I=s(function(n,r,t){for(;t;++r)n[r]=t,t>>>=8},"wbytes"),rn=s(function(n,r){var t=r.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=r.level<2?4:r.level==9?2:0,n[9]=3,r.mtime!=0&&I(n,4,Math.floor(new Date(r.mtime||Date.now())/1e3)),t){n[3]=8;for(var e=0;e<=t.length;++e)n[e+10]=t.charCodeAt(e)}},"gzh"),nn=s(function(n){(n[0]!=31||n[1]!=139||n[2]!=8)&&g(6,"invalid gzip data");var r=n[3],t=10;r&4&&(t+=n[10]|(n[11]<<8)+2);for(var e=(r>>3&1)+(r>>4&1);e>0;e-=!n[t++]);return t+(r&2)},"gzs"),Ln=s(function(n){var r=n.length;return(n[r-4]|n[r-3]<<8|n[r-2]<<16|n[r-1]<<24)>>>0},"gzl"),tn=s(function(n){return 10+(n.filename&&n.filename.length+1||0)},"gzhl"),en=s(function(n,r){var t=r.level,e=t==0?0:t<6?1:t==9?3:2;n[0]=120,n[1]=e<<6|(e?32-2*e:1)},"zlh"),Pn=s(function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&g(6,"invalid zlib data"),n[1]&32&&g(6,"invalid zlib data: preset dictionaries not supported")},"zlv");function an(n,r){return!r&&typeof n=="function"&&(r=n,n={}),this.ondata=r,n}s(an,"AsyncCmpStrm");var ar=function(){function n(r,t){!t&&typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{}}return s(n,"Deflate"),n.prototype.p=function(r,t){this.ondata(ur(r,this.o,0,0,!t),t)},n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.d=t,this.p(r,t||!1)},n}();var Xn=function(){function n(r,t){Mr([zr,function(){return[b,ar]}],this,an.call(this,r,t),function(e){var i=new ar(e.data);onmessage=b(i)},6)}return s(n,"AsyncDeflate"),n}();function dn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr],function(e){return fr($r(e.data[0],e.data[1]))},0,t)}s(dn,"deflate");function $r(n,r){return ur(n,r||{},0,0)}s($r,"deflateSync");var K=function(){function n(r){this.s={},this.p=new U(0),this.ondata=r}return s(n,"Inflate"),n.prototype.e=function(r){this.ondata||g(5),this.d&&g(4);var t=this.p.length,e=new U(t+r.length);e.set(this.p),e.set(r,t),this.p=e},n.prototype.c=function(r){this.d=this.s.i=r||!1;var t=this.s.b,e=Cr(this.p,this.o,this.s);this.ondata(d(e,t,this.s.b),this.d),this.o=d(e,this.s.b-32768),this.s.b=this.o.length,this.p=d(this.p,this.s.p/8|0),this.s.p&=7},n.prototype.push=function(r,t){this.e(r),this.c(t)},n}();var Nn=function(){function n(r){this.ondata=r,Mr([xr,function(){return[b,K]}],this,0,function(){var t=new K;onmessage=b(t)},7)}return s(n,"AsyncInflate"),n}();function Rn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr],function(e){return fr(Fr(e.data[0],_r(e.data[1])))},1,t)}s(Rn,"inflate");function Fr(n,r){return Cr(n,r)}s(Fr,"inflateSync");var pn=function(){function n(r,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,r,t)}return s(n,"Gzip"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r),this.l+=r.length;var e=ur(r,this.o,this.v&&tn(this.o),t&&8,!t);this.v&&(rn(e,this.o),this.v=0),t&&(I(e,e.length-8,this.c.d()),I(e,e.length-4,this.l)),this.ondata(e,t)},n}();var ot=function(){function n(r,t){Mr([zr,Zn,function(){return[b,ar,pn]}],this,an.call(this,r,t),function(e){var i=new pn(e.data);onmessage=b(i)},8)}return s(n,"AsyncGzip"),n}();function ft(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Zn,function(){return[gn]}],function(e){return fr(gn(e.data[0],e.data[1]))},2,t)}s(ft,"gzip");function gn(n,r){r||(r={});var t=mr(),e=n.length;t.p(n);var i=ur(n,r,tn(r),8),a=i.length;return rn(i,r),I(i,a-8,t.d()),I(i,a-4,e),i}s(gn,"gzipSync");var Jr=function(){function n(r){this.v=1,K.call(this,r)}return s(n,"Gunzip"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){var e=this.p.length>3?nn(this.p):4;if(e>=this.p.length&&!t)return;this.p=this.p.subarray(e),this.v=0}t&&(this.p.length<8&&g(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),K.prototype.c.call(this,t)},n}();var bn=function(){function n(r){this.ondata=r,Mr([xr,kn,function(){return[b,K,Jr]}],this,0,function(){var t=new Jr;onmessage=b(t)},9)}return s(n,"AsyncGunzip"),n}();function _n(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,kn,function(){return[Kr]}],function(e){return fr(Kr(e.data[0]))},3,t)}s(_n,"gunzip");function Kr(n,r){return Cr(n.subarray(nn(n),-8),r||new U(Ln(n)))}s(Kr,"gunzipSync");var yn=function(){function n(r,t){this.c=br(),this.v=1,ar.call(this,r,t)}return s(n,"Zlib"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r);var e=ur(r,this.o,this.v&&2,t&&4,!t);this.v&&(en(e,this.o),this.v=0),t&&I(e,e.length-4,this.c.d()),this.ondata(e,t)},n}();var st=function(){function n(r,t){Mr([zr,Gn,function(){return[b,ar,yn]}],this,an.call(this,r,t),function(e){var i=new yn(e.data);onmessage=b(i)},10)}return s(n,"AsyncZlib"),n}();function ut(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Gn,function(){return[wn]}],function(e){return fr(wn(e.data[0],e.data[1]))},4,t)}s(ut,"zlib");function wn(n,r){r||(r={});var t=br();t.p(n);var e=ur(n,r,2,4);return en(e,r),I(e,e.length-4,t.d()),e}s(wn,"zlibSync");var Qr=function(){function n(r){this.v=1,K.call(this,r)}return s(n,"Unzlib"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&g(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),K.prototype.c.call(this,t)},n}();var rt=function(){function n(r){this.ondata=r,Mr([xr,On,function(){return[b,K,Qr]}],this,0,function(){var t=new Qr;onmessage=b(t)},11)}return s(n,"AsyncUnzlib"),n}();function nt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,On,function(){return[Vr]}],function(e){return fr(Vr(e.data[0],_r(e.data[1])))},5,t)}s(nt,"unzlib");function Vr(n,r){return Cr((Pn(n),n.subarray(2,-4)),r)}s(Vr,"unzlibSync");var tt=function(){function n(r){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=r}return s(n,"Decompress"),n.prototype.push=function(r,t){if(this.ondata||g(5),this.s)this.s.push(r,t);else{if(this.p&&this.p.length){var e=new U(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length)}else this.p=r;if(this.p.length>2){var i=this,a=s(function(){i.ondata.apply(i,arguments)},"cb");this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(a):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(a):new this.Z(a),this.s.push(this.p,t),this.p=null}}},n}();var vt=function(){function n(r){this.G=bn,this.I=Nn,this.Z=rt,this.ondata=r}return s(n,"AsyncDecompress"),n.prototype.push=function(r,t){tt.prototype.push.call(this,r,t)},n}();function ht(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),n[0]==31&&n[1]==139&&n[2]==8?_n(n,r,t):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Rn(n,r,t):nt(n,r,t)}s(ht,"decompress");function lt(n,r){return n[0]==31&&n[1]==139&&n[2]==8?Kr(n,r):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Fr(n,r):Vr(n,r)}s(lt,"decompressSync");var on=s(function(n,r,t,e){for(var i in n){var a=n[i],o=r+i,f=e;Array.isArray(a)&&(f=Er(e,a[1]),a=a[0]),a instanceof U?t[o]=[a,f]:(t[o+="/"]=[new U(0),f],on(a,o,t,e))}},"fltn"),mn=typeof TextEncoder<"u"&&new TextEncoder,Xr=typeof TextDecoder<"u"&&new TextDecoder,$n=0;try{Xr.decode(er,{stream:!0}),$n=1}catch(n){}var qn=s(function(n){for(var r="",t=0;;){var e=n[t++],i=(e>127)+(e>223)+(e>239);if(t+i>n.length)return[r,d(n,t-1)];i?i==3?(e=((e&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,r+=String.fromCharCode(55296|e>>10,56320|e&1023)):i&1?r+=String.fromCharCode((e&31)<<6|n[t++]&63):r+=String.fromCharCode((e&15)<<12|(n[t++]&63)<<6|n[t++]&63):r+=String.fromCharCode(e)}},"dutf8"),ct=function(){function n(r){this.ondata=r,$n?this.t=new TextDecoder:this.p=er}return s(n,"DecodeUTF8"),n.prototype.push=function(r,t){if(this.ondata||g(5),t=!!t,this.t){this.ondata(this.t.decode(r,{stream:!0}),t),t&&(this.t.decode().length&&g(8),this.t=null);return}this.p||g(4);var e=new U(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length);var i=qn(e),a=i[0],o=i[1];t?(o.length&&g(8),this.p=null):this.p=o,this.ondata(a,t)},n}();var pt=function(){function n(r){this.ondata=r}return s(n,"EncodeUTF8"),n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.ondata(sr(r),this.d=t||!1)},n}();function sr(n,r){if(r){for(var t=new U(n.length),e=0;e<n.length;++e)t[e]=n.charCodeAt(e);return t}if(mn)return mn.encode(n);for(var i=n.length,a=new U(n.length+(n.length>>1)),o=0,f=s(function(h){a[o++]=h},"w"),e=0;e<i;++e){if(o+5>a.length){var v=new U(o+8+(i-e<<1));v.set(a),a=v}var u=n.charCodeAt(e);u<128||r?f(u):u<2048?(f(192|u>>6),f(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|n.charCodeAt(++e)&1023,f(240|u>>18),f(128|u>>12&63),f(128|u>>6&63),f(128|u&63)):(f(224|u>>12),f(128|u>>6&63),f(128|u&63))}return d(a,0,o)}s(sr,"strToU8");function Hn(n,r){if(r){for(var t="",e=0;e<n.length;e+=16384)t+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return t}else{if(Xr)return Xr.decode(n);var i=qn(n),a=i[0],o=i[1];return o.length&&g(8),a}}s(Hn,"strFromU8");var Yn=s(function(n){return n==1?3:n<6?2:n==9?1:0},"dbf"),Wn=s(function(n,r){return r+30+W(n,r+26)+W(n,r+28)},"slzh"),jn=s(function(n,r,t){var e=W(n,r+28),i=Hn(n.subarray(r+46,r+46+e),!(W(n,r+8)&2048)),a=r+46+e,o=N(n,r+20),f=t&&o==4294967295?Jn(n,a):[o,N(n,r+24),N(n,r+42)],v=f[0],u=f[1],h=f[2];return[W(n,r+10),v,u,i,a+W(n,r+30)+W(n,r+32),h]},"zh"),Jn=s(function(n,r){for(;W(n,r)!=1;r+=4+W(n,r+2));return[Hr(n,r+12),Hr(n,r+4),Hr(n,r+20)]},"z64e"),or=s(function(n){var r=0;if(n)for(var t in n){var e=n[t].length;e>65535&&g(9),r+=e+4}return r},"exfl"),pr=s(function(n,r,t,e,i,a,o,f){var v=e.length,u=t.extra,h=f&&f.length,l=or(u);I(n,r,o!=null?33639248:67324752),r+=4,o!=null&&(n[r++]=20,n[r++]=t.os),n[r]=20,r+=2,n[r++]=t.flag<<1|(a<0&&8),n[r++]=i&&8,n[r++]=t.compression&255,n[r++]=t.compression>>8;var y=new Date(t.mtime==null?Date.now():t.mtime),z=y.getFullYear()-1980;if((z<0||z>119)&&g(10),I(n,r,z<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>>1),r+=4,a!=-1&&(I(n,r,t.crc),I(n,r+4,a<0?-a-2:a),I(n,r+8,t.size)),I(n,r+12,v),I(n,r+14,l),r+=16,o!=null&&(I(n,r,h),I(n,r+6,t.attrs),I(n,r+10,o),r+=14),n.set(e,r),r+=v,l)for(var x in u){var A=u[x],p=A.length;I(n,r,+x),I(n,r+2,p),n.set(A,r+4),r+=4+p}return h&&(n.set(f,r),r+=h),r},"wzh"),fn=s(function(n,r,t,e,i){I(n,r,101010256),I(n,r+8,t),I(n,r+10,t),I(n,r+12,e),I(n,r+16,i)},"wzf"),Nr=function(){function n(r){this.filename=r,this.c=mr(),this.size=0,this.compression=0}return s(n,"ZipPassThrough"),n.prototype.process=function(r,t){this.ondata(null,r,t)},n.prototype.push=function(r,t){this.ondata||g(5),this.c.p(r),this.size+=r.length,t&&(this.crc=this.c.d()),this.process(r,t||!1)},n}();var gt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new ar(t,function(i,a){e.ondata(null,i,a)}),this.compression=8,this.flag=Yn(t.level)}return s(n,"ZipDeflate"),n.prototype.process=function(r,t){try{this.d.push(r,t)}catch(e){this.ondata(e,null,t)}},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var yt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new Xn(t,function(i,a,o){e.ondata(i,a,o)}),this.compression=8,this.flag=Yn(t.level),this.terminate=this.d.terminate}return s(n,"AsyncZipDeflate"),n.prototype.process=function(r,t){this.d.push(r,t)},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var wt=function(){function n(r){this.ondata=r,this.u=[],this.d=1}return s(n,"Zip"),n.prototype.add=function(r){var t=this;if(this.ondata||g(5),this.d&2)this.ondata(g(4+(this.d&1)*8,0,1),null,!1);else{var e=sr(r.filename),i=e.length,a=r.comment,o=a&&sr(a),f=i!=r.filename.length||o&&a.length!=o.length,v=i+or(r.extra)+30;i>65535&&this.ondata(g(11,0,1),null,!1);var u=new U(v);pr(u,0,r,e,f,-1);var h=[u],l=s(function(){for(var p=0,w=h;p<w.length;p++){var T=w[p];t.ondata(null,T,!1)}h=[]},"pAll_1"),y=this.d;this.d=0;var z=this.u.length,x=Er(r,{f:e,u:f,o,t:s(function(){r.terminate&&r.terminate()},"t"),r:s(function(){if(l(),y){var p=t.u[z+1];p?p.r():t.d=1}y=1},"r")}),A=0;r.ondata=function(p,w,T){if(p)t.ondata(p,w,T),t.terminate();else if(A+=w.length,h.push(w),T){var M=new U(16);I(M,0,134695760),I(M,4,r.crc),I(M,8,A),I(M,12,r.size),h.push(M),x.c=A,x.b=v+A+16,x.crc=r.crc,x.size=r.size,y&&x.r(),y=1}else y&&l()},this.u.push(x)}},n.prototype.end=function(){var r=this;if(this.d&2){this.ondata(g(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:s(function(){r.d&1&&(r.u.splice(-1,1),r.e())},"r"),t:s(function(){},"t")}),this.d=3},n.prototype.e=function(){for(var r=0,t=0,e=0,i=0,a=this.u;i<a.length;i++){var o=a[i];e+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0)}for(var f=new U(e+22),v=0,u=this.u;v<u.length;v++){var o=u[v];pr(f,r,o,o.f,o.u,-o.c-2,t,o.o),r+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0),t+=o.b}fn(f,r,this.u.length,e,t),this.ondata(null,f,!0),this.d=2},n.prototype.terminate=function(){for(var r=0,t=this.u;r<t.length;r++){var e=t[r];e.t()}this.d=2},n}();function mt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e={};on(n,"",e,r);var i=Object.keys(e),a=i.length,o=0,f=0,v=a,u=new Array(a),h=[],l=s(function(){for(var p=0;p<h.length;++p)h[p]()},"tAll"),y=s(function(p,w){Rr(function(){t(p,w)})},"cbd");Rr(function(){y=t});var z=s(function(){var p=new U(f+22),w=o,T=f-o;f=0;for(var M=0;M<v;++M){var m=u[M];try{var B=m.c.length;pr(p,f,m,m.f,m.u,B);var C=30+m.f.length+or(m.extra),D=f+C;p.set(m.c,D),pr(p,o,m,m.f,m.u,B,f,m.m),o+=16+C+(m.m?m.m.length:0),f=D+B}catch(c){return y(c,null)}}fn(p,o,u.length,T,w),y(null,p)},"cbf");a||z();for(var x=s(function(p){var w=i[p],T=e[w],M=T[0],m=T[1],B=mr(),C=M.length;B.p(M);var D=sr(w),c=D.length,G=m.comment,S=G&&sr(G),R=S&&S.length,Z=or(m.extra),O=m.level==0?0:8,F=s(function(P,k){if(P)l(),y(P,null);else{var L=k.length;u[p]=Er(m,{size:C,crc:B.d(),c:k,f:D,m:S,u:c!=w.length||S&&G.length!=R,compression:O}),o+=30+c+Z+L,f+=76+2*(c+Z)+(R||0)+L,--a||z()}},"cbl");if(c>65535&&F(g(11,0,1),null),!O)F(null,M);else if(C<16e4)try{F(null,$r(M,m))}catch(P){F(P,null)}else h.push(dn(M,m,F))},"_loop_1"),A=0;A<v;++A)x(A);return l}s(mt,"zip");function xt(n,r){r||(r={});var t={},e=[];on(n,"",t,r);var i=0,a=0;for(var o in t){var f=t[o],v=f[0],u=f[1],h=u.level==0?0:8,l=sr(o),y=l.length,z=u.comment,x=z&&sr(z),A=x&&x.length,p=or(u.extra);y>65535&&g(11);var w=h?$r(v,u):v,T=w.length,M=mr();M.p(v),e.push(Er(u,{size:v.length,crc:M.d(),c:w,f:l,m:x,u:y!=o.length||x&&z.length!=A,o:i,compression:h})),i+=30+y+p+T,a+=76+2*(y+p)+(A||0)+T}for(var m=new U(a+22),B=i,C=a-i,D=0;D<e.length;++D){var l=e[D];pr(m,l.o,l,l.f,l.u,l.c.length);var c=30+l.f.length+or(l.extra);m.set(l.c,l.o+c),pr(m,i,l,l.f,l.u,l.c.length,l.o,l.m),i+=16+c+(l.m?l.m.length:0)}return fn(m,i,e.length,C,B),m}s(xt,"zipSync");var et=function(){function n(){}return s(n,"UnzipPassThrough"),n.prototype.push=function(r,t){this.ondata(null,r,t)},n.compression=0,n}();var zt=function(){function n(){var r=this;this.i=new K(function(t,e){r.ondata(null,t,e)})}return s(n,"UnzipInflate"),n.prototype.push=function(r,t){try{this.i.push(r,t)}catch(e){this.ondata(e,null,t)}},n.compression=8,n}();var At=function(){function n(r,t){var e=this;t<32e4?this.i=new K(function(i,a){e.ondata(null,i,a)}):(this.i=new Nn(function(i,a,o){e.ondata(i,a,o)}),this.terminate=this.i.terminate)}return s(n,"AsyncUnzipInflate"),n.prototype.push=function(r,t){this.i.terminate&&(r=d(r,0)),this.i.push(r,t)},n.compression=8,n}();var Mt=function(){function n(r){this.onfile=r,this.k=[],this.o={0:et},this.p=er}return s(n,"Unzip"),n.prototype.push=function(r,t){var e=this;if(this.onfile||g(5),this.p||g(4),this.c>0){var i=Math.min(this.c,r.length),a=r.subarray(0,i);if(this.c-=i,this.d?this.d.push(a,!this.c):this.k[0].push(a),r=r.subarray(i),r.length)return this.push(r,t)}else{var o=0,f=0,v=void 0,u=void 0;this.p.length?r.length?(u=new U(this.p.length+r.length),u.set(this.p),u.set(r,this.p.length)):u=this.p:u=r;for(var h=u.length,l=this.c,y=l&&this.d,z=s(function(){var w,T=N(u,f);if(T==67324752){o=1,v=f,x.d=null,x.c=0;var M=W(u,f+6),m=W(u,f+8),B=M&2048,C=M&8,D=W(u,f+26),c=W(u,f+28);if(h>f+30+D+c){var G=[];x.k.unshift(G),o=2;var S=N(u,f+18),R=N(u,f+22),Z=Hn(u.subarray(f+30,f+=30+D),!B);S==4294967295?(w=C?[-2]:Jn(u,f),S=w[0],R=w[1]):C&&(S=-1),f+=c,x.c=S;var O,F={name:Z,compression:m,start:s(function(){if(F.ondata||g(5),!S)F.ondata(null,er,!0);else{var P=e.o[m];P||F.ondata(g(14,"unknown compression type "+m,1),null,!1),O=S<0?new P(Z):new P(Z,S,R),O.ondata=function(j,Q,Y){F.ondata(j,Q,Y)};for(var k=0,L=G;k<L.length;k++){var H=L[k];O.push(H,!1)}e.k[0]==G&&e.c?e.d=O:O.push(er,!0)}},"start"),terminate:s(function(){O&&O.terminate&&O.terminate()},"terminate")};S>=0&&(F.size=S,F.originalSize=R),x.onfile(F)}return"break"}else if(l){if(T==134695760)return v=f+=12+(l==-2&&8),o=3,x.c=0,"break";if(T==33639248)return v=f-=4,o=3,x.c=0,"break"}},"_loop_2"),x=this;f<h-4;++f){var A=z();if(A==="break")break}if(this.p=er,l<0){var p=o?u.subarray(0,v-12-(l==-2&&8)-(N(u,v-16)==134695760&&4)):u.subarray(0,f);y?y.push(p,!!o):this.k[+(o==2)].push(p)}if(o&2)return this.push(u.subarray(f),t);this.p=u.subarray(f)}t&&(this.c&&g(13),this.p=null)},n.prototype.register=function(r){this.o[r.compression]=r},n}();var Rr=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(n){n()};function Tt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e=[],i=s(function(){for(var p=0;p<e.length;++p)e[p]()},"tAll"),a={},o=s(function(p,w){Rr(function(){t(p,w)})},"cbd");Rr(function(){o=t});for(var f=n.length-22;N(n,f)!=101010256;--f)if(!f||n.length-f>65558)return o(g(13,0,1),null),i;var v=W(n,f+8);if(v){var u=v,h=N(n,f+16),l=h==4294967295||u==65535;if(l){var y=N(n,f-12);l=N(n,y)==101075792,l&&(u=v=N(n,y+32),h=N(n,y+48))}for(var z=r&&r.filter,x=s(function(p){var w=jn(n,h,l),T=w[0],M=w[1],m=w[2],B=w[3],C=w[4],D=w[5],c=Wn(n,D);h=C;var G=s(function(R,Z){R?(i(),o(R,null)):(Z&&(a[B]=Z),--v||o(null,a))},"cbl");if(!z||z({name:B,size:M,originalSize:m,compression:T}))if(!T)G(null,d(n,c,c+M));else if(T==8){var S=n.subarray(c,c+M);if(M<32e4)try{G(null,Fr(S,new U(m)))}catch(R){G(R,null)}else e.push(Rn(S,{size:m},G))}else G(g(14,"unknown compression type "+T,1),null);else G(null,null)},"_loop_3"),A=0;A<u;++A)x(A)}else o(null,{});return i}s(Tt,"unzip");function Ut(n,r){for(var t={},e=n.length-22;N(n,e)!=101010256;--e)(!e||n.length-e>65558)&&g(13);var i=W(n,e+8);if(!i)return{};var a=N(n,e+16),o=a==4294967295||i==65535;if(o){var f=N(n,e-12);o=N(n,f)==101075792,o&&(i=N(n,f+32),a=N(n,f+48))}for(var v=r&&r.filter,u=0;u<i;++u){var h=jn(n,a,o),l=h[0],y=h[1],z=h[2],x=h[3],A=h[4],p=h[5],w=Wn(n,p);a=A,(!v||v({name:x,size:y,originalSize:z,compression:l}))&&(l?l==8?t[x]=Fr(n.subarray(w,w+y),new U(z)):g(14,"unknown compression type "+l):t[x]=d(n,w,w+y))}return t}s(Ut,"unzipSync");export{ot as AsyncCompress,vt as AsyncDecompress,Xn as AsyncDeflate,bn as AsyncGunzip,ot as AsyncGzip,Nn as AsyncInflate,At as AsyncUnzipInflate,rt as AsyncUnzlib,yt as AsyncZipDeflate,st as AsyncZlib,pn as Compress,ct as DecodeUTF8,tt as Decompress,ar as Deflate,pt as EncodeUTF8,at as FlateErrorCode,Jr as Gunzip,pn as Gzip,K as Inflate,Mt as Unzip,zt as UnzipInflate,et as UnzipPassThrough,Qr as Unzlib,wt as Zip,gt as ZipDeflate,Nr as ZipPassThrough,yn as Zlib,ft as compress,gn as compressSync,ht as decompress,lt as decompressSync,dn as deflate,$r as deflateSync,_n as gunzip,Kr as gunzipSync,ft as gzip,gn as gzipSync,Rn as inflate,Fr as inflateSync,Hn as strFromU8,sr as strToU8,Tt as unzip,Ut as unzipSync,nt as unzlib,Vr as unzlibSync,mt as zip,xt as zipSync,ut as zlib,wn as zlibSync};
@@ -0,0 +1 @@
1
+ import{i as xe,j as Ye,k as Je}from"./chunk-L6SCRGG4.js";import{$ as be,I as K,Q as b,R as ge,T as ye,V as O,W as $,Y as He,aa as ze,db as ie,qa as Ke}from"./chunk-6X6EHSZ7.js";import{a as l,b as f}from"./chunk-5SHMBNLX.js";import{c as i,j as s,k as d,l as v,m as y}from"./chunk-PEDEW3M6.js";l();function or(r,e,t=!1){let n=null,o=0;return function(...a){o++,o===1&&t===!0&&r(...a);let u=i(()=>{(!t||o>1)&&r(...a),n=null,o=0},"later");clearTimeout(n),n=setTimeout(u,e)}}i(or,"debounce");l();l();var ae="[MappedinJS]",Et=(o=>(o[o.LOG=0]="LOG",o[o.WARN=1]="WARN",o[o.ERROR=2]="ERROR",o[o.SILENT=3]="SILENT",o))(Et||{});function Dt(r="",{prefix:e=ae}={}){let t="".concat(e).concat(r?"-".concat(r):""),n=i((o,a)=>{if(typeof window<"u"&&window.rnDebug){let u=a.map(c=>c instanceof Error&&c.stack?"".concat(c.message,"\n").concat(c.stack):c);window.rnDebug("".concat(r," ").concat(o,": ").concat(u.join(" ")))}},"rnDebug");return{logState:f.env.NODE_ENV==="test"?3:0,log(...o){this.logState<=0&&(console.log(t,...o),n("log",o))},warn(...o){this.logState<=1&&(console.warn(t,...o),n("warn",o))},error(...o){this.logState<=2&&(console.error(t,...o),n("error",o))},assert(...o){console.assert(...o)},time(o){console.time(o)},timeEnd(o){console.timeEnd(o)},setLevel(o){0<=o&&o<=3&&(this.logState=o)}}}i(Dt,"createLogger");var qe=Dt();function ur(r){0<=r&&r<=3&&(qe.logState=r)}i(ur,"setLoggerLevel");var B=qe;l();function Tt(r,e){return"".concat(e," ").concat(r)}i(Tt,"formatMessage");var ve=class ve extends Error{constructor(e,t=ae){super(Tt(e,t)),this.name="MappedinError"}};i(ve,"MappedinError");var Y=ve,Ee=class Ee extends Y{constructor(e,t=ae){super(e,t),this.name="MappedinRenderError"}};i(Ee,"MappedinRenderError");var Xe=Ee;l();l();var De=class De extends Error{};i(De,"InvalidTokenError");var V=De;V.prototype.name="InvalidTokenError";function Mt(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}i(Mt,"b64DecodeUnicode");function St(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Mt(e)}catch(t){return atob(e)}}i(St,"base64UrlDecode");function Ze(r,e){if(typeof r!="string")throw new V("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new V("Invalid token specified: missing part #".concat(t+1));let o;try{o=St(n)}catch(a){throw new V("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(a.message,")"))}try{return JSON.parse(o)}catch(a){throw new V("Invalid token specified: invalid json for part #".concat(t+1," (").concat(a.message,")"))}}i(Ze,"jwtDecode");l();var j=63710088e-1;function Sr(r){var t,n;let e=Ze(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(n=e.capabilities)!=null?n:{}}}i(Sr,"decodeAccessToken");function A(r){return r*(Math.PI/180)}i(A,"toRadians");function wt(r){return r*(180/Math.PI)}i(wt,"toDegrees");function wr(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}i(wr,"round");function Qe(r,e){return(r%e+e)%e}i(Qe,"euclideanModulo");function Pr([r,e],[t,n]){let o=A(n-e),a=A(t-r),u=A(e),c=A(n),m=Math.sin(o/2)*Math.sin(o/2)+Math.sin(a/2)*Math.sin(a/2)*Math.cos(u)*Math.cos(c),p=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));return j*p}i(Pr,"haversineDistance");function Cr([r,e],[t,n]){let o=A(e),a=A(r),u=A(n),m=A(t)-a,p=Math.sin(m)*Math.cos(u),g=Math.cos(o)*Math.sin(u)-Math.sin(o)*Math.cos(u)*Math.cos(m);return wt((Math.atan2(p,g)+Math.PI*2)%(Math.PI*2))}i(Cr,"getForwardBearing");function Ir(r,e){let t=Qe(r,Math.PI*2),n=Qe(e,Math.PI*2),o=n-t,a=n+(o>Math.PI?-Math.PI*2:o<-Math.PI?Math.PI*2:0);return{start:t,end:a}}i(Ir,"shortestTweenRotation");function Pt(r){return r instanceof ie?Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y):Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&Number.isFinite(r.min.z)&&Number.isFinite(r.max.z)}i(Pt,"isFiniteBox");function Lr(r,e,t,n){return(r<e||r>t)&&B.warn(n),Math.min(t,Math.max(e,r))}i(Lr,"clampWithWarning");function Or(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}i(Or,"arraysEqual");function Ar(){return typeof window<"u"&&window!==null}i(Ar,"isBrowser");l();var se=class se extends Error{constructor(t){super(t);s(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,se)}};i(se,"AssertionError");var Te=se;function et(r,e){if(r==null){let t;if(e!=null&&e.customMessage)t=e.customMessage;else{let a=e!=null&&e.valueName?"'".concat(e.valueName,"'"):"value";t="Expected ".concat(a," to be defined, but received ").concat(r)}let n=(e==null?void 0:e.errorClass)||Te,o=new n(t);throw(e==null?void 0:e.captureStackTrace)!==!1&&Error.captureStackTrace&&Error.captureStackTrace(o,et),o}}i(et,"assertExists");function _r(r,e,t){if(et(r),(r==null?void 0:r.type)!==e){let n="Expected type ".concat(e," but got ").concat(r==null?void 0:r.type);throw new Error(t!=null?t:n)}}i(_r,"assertType");l();var Me=[0,4,6,8,10],E=i(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&(n&3)===0&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],Me.map((n,o)=>t.slice(n,o===Me.length-1?void 0:Me[o+1]).join("")).join("-")},"randomId");l();var we=class we{constructor(){s(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};i(we,"PubSub");var Se=we;l();var tt="mi-session-data",rt="mi-local-data",J="id",q="deviceId",U,D,T,X=class X{constructor(){v(this,D);v(this,T);try{let e=sessionStorage.getItem(tt);e?y(this,D,JSON.parse(e)):y(this,D,{[J]:E()})}catch(e){y(this,D,{[J]:E()})}try{let e=localStorage.getItem(rt);e?y(this,T,JSON.parse(e)):y(this,T,{[q]:E()})}catch(e){y(this,T,{[q]:E()})}d(this,D)[J]||(d(this,D)[J]=E()),d(this,T)[q]||(d(this,T)[q]=E())}static getInstance(){return d(this,U)||y(this,U,new X),d(this,U)}static ___clearInstance(){y(this,U,void 0)}saveSessionData(e,t){d(this,D)[e]=t;try{return sessionStorage.setItem(tt,JSON.stringify(d(this,D))),!0}catch(n){return!1}}loadSessionData(e){let t=d(this,D)[e];if(t!=null)return t}saveLocalData(e,t){d(this,T)[e]=t;try{return localStorage.setItem(rt,JSON.stringify(d(this,T))),!0}catch(n){return!1}}loadLocalData(e){let t=d(this,T)[e];if(t!=null)return t}};U=new WeakMap,D=new WeakMap,T=new WeakMap,i(X,"SafeStorage"),v(X,U);var Pe=X;l();var Ct=new Set(Object.keys($.NAMES)),Ce;function nt(){return Ce==null&&(Ce=new $),Ce}i(nt,"getColorInstance");var It=i(r=>Ct.has(r.toLowerCase()),"isX11Color"),Lt=i(r=>{if(!r.startsWith("#"))return!1;let e=r.slice(1);if(e.length!==3&&e.length!==6)return!1;for(let t=0;t<e.length;t++)if(!(e[t]>="0"&&e[t]<="9"||e[t]>="A"&&e[t]<="F"||e[t]>="a"&&e[t]<="f"))return!1;return!0},"isHexColor"),Ot=i(r=>{if(!r.startsWith("rgb(")&&!r.startsWith("rgba("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let o=0;o<n.length;o++){let a=n[o].trim();if(o<3)if(a.endsWith("%")){let u=parseFloat(a.slice(0,-1));if(isNaN(u)||u<0||u>100)return!1}else{let u=parseInt(a,10);if(isNaN(u)||u<0||u>255)return!1}else{let u=parseFloat(a);if(isNaN(u)||u<0||u>1)return!1}}return!0},"isRgbColor"),At=i(r=>{if(!r.startsWith("hsl(")&&!r.startsWith("hsla("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let o=0;o<n.length;o++){let a=n[o].trim();if(o===0){let u=parseFloat(a);if(isNaN(u))return!1}else if(o<3){if(!a.endsWith("%"))return!1;let u=parseFloat(a.slice(0,-1));if(isNaN(u)||u<0||u>100)return!1}else{let u=parseFloat(a);if(isNaN(u)||u<0||u>1)return!1}}return!0},"isHslColor"),ue=i(r=>r==null||typeof r!="string"?!1:!!(Lt(r)||Ot(r)||At(r)||It(r)),"isColor"),Xr=i(r=>{let e=nt();return e.set(r),[e.r,e.g,e.b]},"stringToRgbArray"),Zr=i(r=>{let e=nt();return e.set(r[0],r[1],r[2]),"#"+e.getHexString()},"rgbArrayToString");l();var ot=i(r=>r,"linearEase"),Nt=i(r=>r*r,"quadEaseIn"),kt=i(r=>1-Math.cos(r*Math.PI/2),"easeIn"),Gt=i(r=>1-(1-r)*(1-r),"quadEaseOut"),it={linear:ot,"ease-in":Nt,"ease-out":Gt,"ease-in-out":kt};function nn(r,e,t,n,o,a=ot){if(e===t)return o;r=Math.max(e,Math.min(r,t));let u=(r-Math.min(e,t))/Math.abs(t-e),c=typeof a=="function"?a(u):it[a](u);return n+c*(o-n)}i(nn,"interpolate");function on(r,e,t,n="ease-in"){if(e.length!==t.length)throw new Y("Input and output ranges must have the same number of values.");r=Math.max(e[0],Math.min(r,e[e.length-1]));let o=0;for(;o<e.length-1&&r>e[o+1];)o++;let a=(r-e[o])/(e[o+1]-e[o]),u=typeof n=="function"?n(a):it[n](a);return t[o]+u*(t[o+1]-t[o])}i(on,"interpolateMulti");l();function _t(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}i(_t,"normalizeAngle");l();l();l();l();l();l();l();l();var x=63710088e-1,st={centimeters:x*100,centimetres:x*100,degrees:x/111325,feet:x*3.28084,inches:x*39.37,kilometers:x/1e3,kilometres:x/1e3,meters:x,metres:x,miles:x/1609.344,millimeters:x*1e3,millimetres:x*1e3,nauticalmiles:x/1852,radians:1,yards:x*1.0936},Mn={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/x,yards:1.0936133};function I(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}i(I,"feature");function Ft(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!at(r[0])||!at(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return I(n,e,t)}i(Ft,"point");function Sn(r,e,t){t===void 0&&(t={});for(var n=0,o=r;n<o.length;n++){var a=o[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var u=0;u<a[a.length-1].length;u++)if(a[a.length-1][u]!==a[0][u])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return I(c,e,t)}i(Sn,"polygon");function ut(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return I(n,e,t)}i(ut,"lineString");function wn(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}i(wn,"featureCollection");function Pn(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return I(n,e,t)}i(Pn,"multiLineString");function Cn(r,e,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:r};return I(n,e,t)}i(Cn,"multiPoint");function In(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return I(n,e,t)}i(In,"multiPolygon");function Ln(r,e){e===void 0&&(e="kilometers");var t=st[e];if(!t)throw new Error(e+" units is invalid");return r*t}i(Ln,"radiansToLength");function On(r,e){e===void 0&&(e="kilometers");var t=st[e];if(!t)throw new Error(e+" units is invalid");return r/t}i(On,"lengthToRadians");function An(r){var e=r%(2*Math.PI);return e*180/Math.PI}i(An,"radiansToDegrees");function Nn(r){var e=r%360;return e*Math.PI/180}i(Nn,"degreesToRadians");function at(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}i(at,"isNumber");function Z(r,e,t){if(r!==null)for(var n,o,a,u,c,m,p,g=0,h=0,P,C=r.type,S=C==="FeatureCollection",_=C==="Feature",de=S?r.features.length:1,F=0;F<de;F++){p=S?r.features[F].geometry:_?r.geometry:r,P=p?p.type==="GeometryCollection":!1,c=P?p.geometries.length:1;for(var he=0;he<c;he++){var w=0,R=0;if(u=P?p.geometries[he]:p,u!==null){m=u.coordinates;var L=u.type;switch(g=t&&(L==="Polygon"||L==="MultiPolygon")?1:0,L){case null:break;case"Point":if(e(m,h,F,w,R)===!1)return!1;h++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<m.length;n++){if(e(m[n],h,F,w,R)===!1)return!1;h++,L==="MultiPoint"&&w++}L==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<m.length;n++){for(o=0;o<m[n].length-g;o++){if(e(m[n][o],h,F,w,R)===!1)return!1;h++}L==="MultiLineString"&&w++,L==="Polygon"&&R++}L==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<m.length;n++){for(R=0,o=0;o<m[n].length;o++){for(a=0;a<m[n][o].length-g;a++){if(e(m[n][o][a],h,F,w,R)===!1)return!1;h++}R++}w++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(Z(u.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}i(Z,"coordEach");function Bn(r,e,t,n){var o=t;return Z(r,function(a,u,c,m,p){u===0&&t===void 0?o=a:o=e(o,a,u,c,m,p)},n),o}i(Bn,"coordReduce");function Vn(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}i(Vn,"featureEach");function Rt(r,e){var t,n,o,a,u,c,m,p,g,h,P=0,C=r.type==="FeatureCollection",S=r.type==="Feature",_=C?r.features.length:1;for(t=0;t<_;t++){for(c=C?r.features[t].geometry:S?r.geometry:r,p=C?r.features[t].properties:S?r.properties:{},g=C?r.features[t].bbox:S?r.bbox:void 0,h=C?r.features[t].id:S?r.id:void 0,m=c?c.type==="GeometryCollection":!1,u=m?c.geometries.length:1,o=0;o<u;o++){if(a=m?c.geometries[o]:c,a===null){if(e(null,P,p,g,h)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(a,P,p,g,h)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(e(a.geometries[n],P,p,g,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}P++}}i(Rt,"geomEach");function Bt(r,e){Rt(r,function(t,n,o,a,u){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(I(t,o,{bbox:a,id:u}),n,0)===!1?!1:void 0}var m;switch(c){case"MultiPoint":m="Point";break;case"MultiLineString":m="LineString";break;case"MultiPolygon":m="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var g=t.coordinates[p],h={type:m,coordinates:g};if(e(I(h,o),n,p)===!1)return!1}})}i(Bt,"flattenEach");function Vt(r,e){Bt(r,function(t,n,o){var a=0;if(t.geometry){var u=t.geometry.type;if(!(u==="Point"||u==="MultiPoint")){var c,m=0,p=0,g=0;if(Z(t,function(h,P,C,S,_){if(c===void 0||n>m||S>p||_>g){c=h,m=n,p=S,g=_,a=0;return}var de=ut([c,h],t.properties);if(e(de,n,o,_,a)===!1)return!1;a++,c=h})===!1)return!1}}})}i(Vt,"segmentEach");function jn(r,e,t){var n=t,o=!1;return Vt(r,function(a,u,c,m,p){o===!1&&t===void 0?n=a:n=e(n,a,u,c,m,p),o=!0}),n}i(jn,"segmentReduce");function Ie(r){var e=[1/0,1/0,-1/0,-1/0];return Z(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}i(Ie,"bbox");Ie.default=Ie;var lt=Ie;function ct(r){return lt(r)}i(ct,"getBoundingBoxFromFeature");l();var Le="#ffffff",jt=.1,le=.1,Q,ee,te,Ae=class Ae{constructor(e={}){s(this,"initialColor",Le);v(this,Q,Le);s(this,"initialTopColor");v(this,ee);s(this,"topTexture");s(this,"texture");v(this,te);s(this,"dirty",!0);s(this,"visible",!0);s(this,"opacity",1);s(this,"width",jt);s(this,"height",le);s(this,"initialHeight",le);s(this,"altitude",0);s(this,"join","round");s(this,"cap","round");s(this,"showImage",!0);s(this,"flipImageToFaceCamera",!0);s(this,"url");s(this,"side","double");s(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}set color(e){ue(e)?y(this,Q,e):B.warn('Failed to update color. Invalid color "'.concat(e,'".'))}get color(){return d(this,Q)}set topColor(e){e===void 0||ue(e)?y(this,ee,e):B.warn('Failed to update top color. Invalid color "'.concat(e,'".'))}get topColor(){return d(this,ee)}set hoverColor(e){ue(e)?y(this,te,e):B.warn('Failed to update hover color. Invalid color "'.concat(e,'".'))}get hoverColor(){return d(this,te)}};Q=new WeakMap,ee=new WeakMap,te=new WeakMap,i(Ae,"StyleComponent");var Oe=Ae;var Ne=class Ne extends Ke{constructor(){super(...arguments);s(this,"type","entityBatchedMesh");s(this,"userData",{entities:{}})}};i(Ne,"EntityBatchedMesh");var ce=Ne,re,W,ke=class ke{constructor(e){s(this,"mesh");s(this,"imageMesh");s(this,"textMesh");s(this,"textEntityId");s(this,"type","geometry");s(this,"dirty",!0);s(this,"detached",!1);s(this,"instanceIndex",-1);s(this,"geometry");s(this,"batchedProps");s(this,"material");s(this,"feature");s(this,"currentHeight",le);s(this,"color",new $);s(this,"topColor",new $);s(this,"position",new b);s(this,"altitude",0);v(this,re,1);v(this,W);s(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get opacity(){return d(this,re)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}y(this,re,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return d(this,W)?d(this,W):(y(this,W,ct(this.feature)),d(this,W))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};re=new WeakMap,W=new WeakMap,i(ke,"MeshComponent");var mt=ke;l();var ft="#ffffff",N,Ge=class Ge{constructor(e={}){s(this,"color",ft);s(this,"initialColor",ft);s(this,"topColor");s(this,"initialTopColor");s(this,"opacity",1);s(this,"height");v(this,N);s(this,"outline",!0);s(this,"texture");s(this,"topTexture");s(this,"dirty",!0);var t,n;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.initialColor=this.color,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return d(this,N)}set shading(e){var t;if(!e){y(this,N,void 0);return}y(this,N,(t=d(this,N))!=null?t:{start:0,end:0,intensity:0}),Object.assign(d(this,N),e)}};N=new WeakMap,i(Ge,"GeometryGroupStyleComponent");var me=Ge;var _e=class _e extends O{constructor(t,n=new me){super();s(this,"visible",!0);s(this,"type","geometry-group");s(this,"components");s(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let o of this.children)if(!o.userData.detached){t=o;break}return t instanceof ce?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};i(_e,"GeometryGroupObject3D");var M=_e;l();var Fe=class Fe extends O{};i(Fe,"Geometry2DObject3D");var k=Fe,Re=class Re{constructor(e,t,n=0){s(this,"id");s(this,"verticalOffset");s(this,"occluderId");s(this,"object3d",new k);s(this,"components");s(this,"disposed",!1);s(this,"worldPosition",new b);this.id=e.id||E(),this.components=[e],this.verticalOffset=n,this.object3d=new k,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type,this.positionDirty=!0}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(e){this.object3d.userData.worldPositionDirty=e}updatePosition(e){this.object3d.position.copy(e),this.positionDirty=!0}setAltitude(e){this.object3d.position.z=e,this.positionDirty=!0}};i(Re,"Geometry2D");var ne=Re;l();var Be=class Be extends O{constructor(){super(...arguments);s(this,"type","geometry");s(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(o=>{n.push(o)})}};i(Be,"Geometry3DObject3D");var fe=Be,Ve=class Ve{constructor(e,t){s(this,"id",E());s(this,"components");s(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}attach(e){this.parentObject3D instanceof M?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof M&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};i(Ve,"Geometry3D");var oe=Ve;var H=class H extends O{constructor(t){super();s(this,"childrenIds",new Set);s(this,"children",[]);s(this,"type","group-container");s(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});s(this,"components",[]);this.userData.entityId=t}addOccluderFeature(t,n){this.userData.occluderFeature=t,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(t){t instanceof H?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ne?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id),t.positionDirty=!0):t instanceof M?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof oe&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof H?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ne?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof M?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof oe&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}),this.set2DGeometryChildrenPositionDirty())}set2DGeometryChildrenPositionDirty(){this.children.forEach(t=>{t instanceof k?t.userData.worldPositionDirty=!0:t instanceof H&&t.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};i(H,"GroupContainerObject3D");var z=H;l();var Fo={top:0,bottom:0,left:0,right:0,type:"pixel"},pt="mappedin";var Ro={ALWAYS_ON_TOP:10},Bo=250,Vo="collision-worker.csp.js",jo="maplibre-worker.csp.js";l();function Ut(r){let e=r.min,t=r.max,n=new b(e.x,e.y,e.z),o=new b(t.x,e.y,e.z),a=new b(e.x,t.y,e.z),u=new b(t.x,t.y,e.z);return[n,o,a,u]}i(Ut,"getCornersOfBoundingBox");l();function dt(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}i(dt,"getGeometryByGeometryId");function Jo(r,e,t=[],n=new ge,o){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let a=dt(r.getInternalState(),e);return ht(a,t,n,o),t}i(Jo,"getVerticesOfEntity");var pe=new b;function ht(r,e=[],t=new ge,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let o=r.geometry;if(o.isBufferGeometry){let a=o.attributes.position;for(let u=0;u<a.count;u++)pe.fromBufferAttribute(a,u),n!==void 0&&(pe.z=n),e.push(pe.clone()),t.expandByPoint(pe)}}for(let o of r.children)ht(o,e,t,n)}}i(ht,"traverse");l();function Wt(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}i(Wt,"getPixelRatio");l();function $t(r,e,t=!1){let n=null,o=0;return function(...a){o++,o===1&&t===!0&&r(...a);let u=i(()=>{(!t||o>1)&&r(...a),n=null,o=0},"later");clearTimeout(n),n=setTimeout(u,e)}}i($t,"debounce");l();var Ht=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(e),a=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,u=/android/i.test(e);return r={isIpad:a,isMobile:u||o||a,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),gt=Ht.getDeviceType,yt=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let a=r.getContext("webgl")||r.getContext("experimental-webgl");if(!a)return e;try{let u=gt().isFirefox?null:a.getExtension("WEBGL_debug_renderer_info");return e=u?a.getParameter(u.UNMASKED_RENDERER_WEBGL):a.getParameter(a.RENDERER),e}catch(u){let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}i(n,"getInfo");function o(){var u,c;if(!gt().isWindows)return!1;if(t!==void 0)return t;let a=(c=(u=zt())==null?void 0:u.toLowerCase())!=null?c:"";return t=a.includes("intel")&&(a.includes("uhd")||a.includes("iris")),t}return i(o,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:o,_setCanvas(a){r=a,e=void 0,t=void 0}}})(),zt=yt.getInfo,Kt=yt.shouldDisableOffscreenCanvas;l();function Yt(r,e){let t={};for(let n=0;n<e.length;n++){let o=e[n];o in r&&(t[o]=r[o])}return t}i(Yt,"pick");function Jt(r){return Object.keys(r).length===0}i(Jt,"isEmpty");l();var qt=i(r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let o=r[n];e.includes("mappedin")||(r[n]=o)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function Ti(r,e,t,n){let o=r*(Math.PI/180),a=n/j,u=r+a*180/Math.PI,c=t/j/Math.cos(o),m=e+c*180/Math.PI;return{lat:u,lon:m}}i(Ti,"cartesianToGeographic");function Mi(r,e,t,n){let o=t*(Math.PI/180),a=n*(Math.PI/180),u=r*(Math.PI/180),c=e*(Math.PI/180),m=o-u,p=a-c,g=j*p*Math.cos(u),h=j*m;return{x:g,y:h}}i(Mi,"geographicToCartesian");var Xt=i((r,e,t)=>{var n;if(r.children&&(r.visible||r instanceof z&&r.userData.preloadGeometry))for(let o of r.children){if(o.visible&&o.type)if("entities3D"in o.userData&&((n=o.userData)!=null&&n.entities3D)&&o instanceof M){e.add(o.userData.entityId),o.userData.dirty&&t.add(o.userData.entityId);for(let a of o.userData.entities3D.values())e.add(a)}else(o.type==="group-container"||o.type==="custom-geometry"||o instanceof fe)&&e.add(o.userData.entityId);Xt(o,e,t)}return e},"populateGeometry3DIdsInScene"),Zt=i((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof k&&e.add(n.userData.entityId),Zt(n,e);return e},"populateGeometry2DIdsInScene");function Qt(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Qt(r[t],e[t]):r[t]=e[t]}return r}i(Qt,"mergeObjects");function Si(r,e,t,n){let o={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},a=new ye,u=new b(o.scale,-o.scale,o.scale),c=new ye().makeTranslation(o.translateX,o.translateY,o.translateZ).scale(u),m=t.elevation;return{id:pt,type:"custom",renderingMode:"3d",render:i((p,g)=>{if(a.fromArray(g),m!==t.elevation){let h=Je.fromLngLat(r.toLngLat(),t.elevation);c.makeTranslation(o.translateX,o.translateY,-h.z).scale(u)}e.projectionMatrix=a.multiply(c),m=t.elevation,n()},"render")}}i(Si,"createCustomLayer");function er(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}i(er,"fetchToken");async function wi(r){let e=await er(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}i(wi,"getRequestHeaders");function Pi(r,e=0){let t=3735928559^e,n=1103547991^e;for(let o=0,a;o<r.length;o++)a=r.charCodeAt(o),t=Math.imul(t^a,2654435761),n=Math.imul(n^a,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}i(Pi,"cyrb53");function Ci(r,e,t){let n=r*(Math.PI/180)/2,o=e/2;return t*Math.tan(n)/o}i(Ci,"getProjectionScaleFactor");function Ii(r){return new Ye(new xe(r[0][0],r[0][1]),new xe(r[1][0],r[1][1])).getCenter().toArray()}i(Ii,"getBoundingBoxCenter");function Li(r,e){return r<e||e<=12}i(Li,"shouldExpandZoomLevel");function Oi(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof z?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof M&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof z&&(e=r.parentObject3D.parent.userData.computedOpacity),e}i(Oi,"getGroupContainerOpacity");function Ai(r,e,t=1e-10){if(r.length!==e.length)return!1;let n=Math.abs(r[0]-e[0])<t,o=Math.abs(r[1]-e[1])<t;if(r.length===3&&e.length===3){let a=Math.abs(r[2]-e[2])<t;return n&&o&&a}return n&&o}i(Ai,"coordinatesEqual");var tr="maplibre-frustum-culling-hack";function Ni(){let r=new ze(.01,.01,.01),e=new He({opacity:0,depthWrite:!1,transparent:!0}),t=new be(r,e);return t.position.copy(new b(0,50,0)),t.frustumCulled=!1,t.name=tr,t}i(Ni,"maplibreFrustrumCullHack");var G=new b,bt=new K;function ki(r,e,t=new ie){return r.traverse(n=>{if(n instanceof be){let a=n.geometry.attributes.position;if(e.position.distanceTo(n.position)<e.near)return;for(let c=0;c<a.count;c++)G.fromBufferAttribute(a,c),G.applyMatrix4(n.matrixWorld),G.applyMatrix4(e.matrixWorldInverse),G.applyMatrix4(e.projectionMatrix),G.z<1&&G.z>0&&(bt.set(G.x,G.y),t.expandByPoint(bt))}}),t}i(ki,"projectToBox2D");function xt(r,e){let t=e.clientWidth,n=e.clientHeight;return new K((r.x+1)*t/2,(1-r.y)*n/2)}i(xt,"ndcToScreen");function Gi(r,e,t){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(e),n.style.pointerEvents="none";let o=xt(new K(r.min.x,r.min.y),t),a=xt(new K(r.max.x,r.max.y),t);n.style.left="".concat(o.x,"px"),n.style.top="".concat(a.y,"px");let u=Math.abs(a.x-o.x),c=Math.abs(a.y-o.y);return n.style.width="".concat(u,"px"),n.style.height="".concat(c,"px"),t.appendChild(n),n}i(Gi,"drawProjectedBox");l();var Ue=class Ue{constructor(e){s(this,"visible");s(this,"altitude");s(this,"color");s(this,"dirty",!0);s(this,"maxWidth");s(this,"maxHeight");s(this,"hoverByPolygon");s(this,"flipToFaceCamera",vt.flipToFaceCamera);s(this,"font");s(this,"fillOpacity");s(this,"fontSize");s(this,"margin");s(this,"outlineWidth");s(this,"outlineBlur");s(this,"outlineOffsetX");s(this,"strokeColor");s(this,"strokeOpacity");s(this,"strokeWidth");s(this,"hoverColor");s(this,"outlineOffsetY");s(this,"outlineColor");s(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};i(Ue,"Text3DStyleComponent");var je=Ue,vt=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});l();l();var $e=class $e{constructor(e){s(this,"dirty",!0);s(this,"visible",!0);s(this,"opacity",1);s(this,"verticalOffset",0);s(this,"interactive",!1);s(this,"color");s(this,"material");s(this,"rotation");s(this,"scale");e&&Object.assign(this,e)}};i($e,"ModelStyleComponnet");var We=$e;l();var rr=[1,1,1],nr=[0,0,0];export{Et as a,ur as b,B as c,Y as d,Xe as e,j as f,Sr as g,A as h,wr as i,Pr as j,Cr as k,Ir as l,Pt as m,Lr as n,Or as o,Ar as p,or as q,_r as r,E as s,Se as t,Pe as u,ue as v,Xr as w,Zr as x,ot as y,kt as z,nn as A,on as B,I as C,Ft as D,Sn as E,ut as F,wn as G,Pn as H,Cn as I,In as J,Ln as K,On as L,An as M,Nn as N,Z as O,Bn as P,Vn as Q,Bt as R,jn as S,lt as T,Le as U,Oe as V,ce as W,mt as X,me as Y,M as Z,k as _,ne as $,fe as aa,oe as ba,z as ca,Fo as da,pt as ea,Ro as fa,Bo as ga,Vo as ha,jo as ia,Ut as ja,dt as ka,Jo as la,Wt as ma,$t as na,Kt as oa,Yt as pa,Jt as qa,qt as ra,_t as sa,Ti as ta,Mi as ua,Xt as va,Zt as wa,Qt as xa,Si as ya,wi as za,Pi as Aa,Ci as Ba,Ii as Ca,Li as Da,Oi as Ea,Ai as Fa,Ni as Ga,ki as Ha,Gi as Ia,je as Ja,vt as Ka,We as La,rr as Ma,nr as Na};
@@ -0,0 +1 @@
1
+ import{f as e}from"./chunk-PEDEW3M6.js";var p,a=e(()=>{p={env:{NODE_ENV:"production",npm_package_version:"6.0.1-beta.53"}}});export{a,p as b};