@mappedin/react-sdk 6.0.1-beta.24 → 6.0.1-beta.25

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.
@@ -1,4 +1,4 @@
1
- THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE WORKSPACE AGGREGATOR 198516E6 08A5 4F5C 8035 00134F149628 PRODUCT.
1
+ THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE WORKSPACE AGGREGATOR 17E97AE3 203E 4CF8 B281 5873C751AB3D PRODUCT.
2
2
 
3
3
  -----
4
4
 
@@ -4090,6 +4090,33 @@ Apache License
4090
4090
 
4091
4091
  -----
4092
4092
 
4093
+ The following software may be included in this product: bidi-js, webgl-sdf-generator. A copy of the source code may be downloaded from https://github.com/lojjic/bidi-js.git (bidi-js), https://github.com/lojjic/webgl-sdf-generator.git (webgl-sdf-generator). This software contains the following license and notice below:
4094
+
4095
+ Copyright (c) 2021 Jason Johnston
4096
+
4097
+ MIT License
4098
+
4099
+ Permission is hereby granted, free of charge, to any person obtaining
4100
+ a copy of this software and associated documentation files (the
4101
+ "Software"), to deal in the Software without restriction, including
4102
+ without limitation the rights to use, copy, modify, merge, publish,
4103
+ distribute, sublicense, and/or sell copies of the Software, and to
4104
+ permit persons to whom the Software is furnished to do so, subject to
4105
+ the following conditions:
4106
+
4107
+ The above copyright notice and this permission notice shall be
4108
+ included in all copies or substantial portions of the Software.
4109
+
4110
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4111
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4112
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
4113
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
4114
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
4115
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
4116
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4117
+
4118
+ -----
4119
+
4093
4120
  The following software may be included in this product: binary-extensions. A copy of the source code may be downloaded from https://github.com/sindresorhus/binary-extensions.git. This software contains the following license and notice below:
4094
4121
 
4095
4122
  MIT License
@@ -24955,6 +24982,33 @@ SOFTWARE.
24955
24982
 
24956
24983
  -----
24957
24984
 
24985
+ The following software may be included in this product: troika-three-text, troika-three-utils, troika-worker-utils. A copy of the source code may be downloaded from https://github.com/protectwise/troika.git (troika-three-text), https://github.com/protectwise/troika.git (troika-three-utils), https://github.com/protectwise/troika.git (troika-worker-utils). This software contains the following license and notice below:
24986
+
24987
+ MIT License
24988
+
24989
+ Copyright (c) 2019 ProtectWise
24990
+ Copyright (c) 2021 Jason Johnston
24991
+
24992
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24993
+ of this software and associated documentation files (the "Software"), to deal
24994
+ in the Software without restriction, including without limitation the rights
24995
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24996
+ copies of the Software, and to permit persons to whom the Software is
24997
+ furnished to do so, subject to the following conditions:
24998
+
24999
+ The above copyright notice and this permission notice shall be included in all
25000
+ copies or substantial portions of the Software.
25001
+
25002
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25003
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25004
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25005
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25006
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25007
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25008
+ SOFTWARE.
25009
+
25010
+ -----
25011
+
24958
25012
  The following software may be included in this product: ts-jest. A copy of the source code may be downloaded from git+https://github.com/kulshekhar/ts-jest.git. This software contains the following license and notice below:
24959
25013
 
24960
25014
  MIT License
@@ -0,0 +1 @@
1
+ import{D as Ge,G as Ye,H as D,K as W,N as Ke,Q as _,S as je,V as qe,X as Xe,Ya as z,Z as We,Za as Ze,d as _e,da as Je,e as Ce,f as Ue,fa as P,g as ve,h as Le,i as Oe,j as De,k as Pe,l as ze,m as Be,o as Fe,p as ke,q as He,v as Ve,va as Y,w as V,wa as Qe,z as G}from"./chunk-23O3CSSY.js";import{a as H}from"./chunk-SXU2GBLV.js";import{a as T}from"./chunk-J5IUISYU.js";H();H();var B,J,U,K;function j(c,e=1/0,s=null){J||(J=new We(2,2,1,1)),U||(U=new qe({uniforms:{blitTexture:new Ze(c)},vertexShader:"\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = vec4(position.xy * 1.0,0.,.999999);\n }",fragmentShader:"\n uniform sampler2D blitTexture; \n varying vec2 vUv;\n\n void main(){ \n gl_FragColor = vec4(vUv.xy, 0, 1);\n \n #ifdef IS_SRGB\n gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n #else\n gl_FragColor = texture2D( blitTexture, vUv);\n #endif\n }"})),U.uniforms.blitTexture.value=c,U.defines.IS_SRGB=c.colorSpace==V,U.needsUpdate=!0,K||(K=new je(J,U),K.frustrumCulled=!1);let r=new Xe,t=new P;t.add(K),s===null&&(s=B=new Je({antialias:!1}));let i=Math.min(c.image.width,e),n=Math.min(c.image.height,e);s.setSize(i,n),s.clear(),s.render(t,r);let o=document.createElement("canvas"),a=o.getContext("2d");o.width=i,o.height=n,a.drawImage(s.domElement,0,0,i,n);let u=new Qe(o);return u.minFilter=c.minFilter,u.magFilter=c.magFilter,u.wrapS=c.wrapS,u.wrapT=c.wrapT,u.name=c.name,B&&(B.forceContextLoss(),B.dispose(),B=null),u}T(j,"decompress");var $e={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"]},pe=class pe{constructor(){this.pluginCallbacks=[],this.register(function(e){return new ee(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new re(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new ne(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new he(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}parse(e,s,r,t){let i=new $,n=[];for(let o=0,a=this.pluginCallbacks.length;o<a;o++)n.push(this.pluginCallbacks[o](i));i.setPlugins(n),i.write(e,s,t).catch(r)}parseAsync(e,s){let r=this;return new Promise(function(t,i){r.parse(e,t,i,s)})}};T(pe,"GLTFExporter");var q=pe,x={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},Q="KHR_mesh_quantization",b={};b[Le]=x.NEAREST;b[Oe]=x.NEAREST_MIPMAP_NEAREST;b[De]=x.NEAREST_MIPMAP_LINEAR;b[Pe]=x.LINEAR;b[ze]=x.LINEAR_MIPMAP_NEAREST;b[Be]=x.LINEAR_MIPMAP_LINEAR;b[Ue]=x.CLAMP_TO_EDGE;b[Ce]=x.REPEAT;b[ve]=x.MIRRORED_REPEAT;var es={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},cs=new Ke,ss=12,us=1179937895,ls=2,ts=8,fs=1313821514,hs=5130562;function F(c,e){return c.length===e.length&&c.every(function(s,r){return s===e[r]})}T(F,"equalArray");function ps(c){return new TextEncoder().encode(c).buffer}T(ps,"stringToArrayBuffer");function ds(c){return F(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}T(ds,"isIdentityMatrix");function gs(c,e,s){let r={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 n;c.itemSize>4?n=c.array[t*c.itemSize+i]:(i===0?n=c.getX(t):i===1?n=c.getY(t):i===2?n=c.getZ(t):i===3&&(n=c.getW(t)),c.normalized===!0&&(n=G.normalize(n,c.array))),r.min[i]=Math.min(r.min[i],n),r.max[i]=Math.max(r.max[i],n)}return r}T(gs,"getMinMax");function is(c){return Math.ceil(c/4)*4}T(is,"getPaddedBufferSize");function Z(c,e=0){let s=is(c.byteLength);if(s!==c.byteLength){let r=new Uint8Array(s);if(r.set(new Uint8Array(c)),e!==0)for(let t=c.byteLength;t<s;t++)r[t]=e;return r.buffer}return c}T(Z,"getPaddedArrayBuffer");function ns(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}T(ns,"getCanvas");function rs(c,e){if(c.toBlob!==void 0)return new Promise(r=>c.toBlob(r,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),c.convertToBlob({type:e,quality:s})}T(rs,"getToBlobPromise");var de=class de{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"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,s,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let t=this,i=t.buffers,n=t.json;r=t.options;let o=t.extensionsUsed,a=t.extensionsRequired,u=new Blob(i,{type:"application/octet-stream"}),p=Object.keys(o),f=Object.keys(a);if(p.length>0&&(n.extensionsUsed=p),f.length>0&&(n.extensionsRequired=f),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=u.size),r.binary===!0){let m=new FileReader;m.readAsArrayBuffer(u),m.onloadend=function(){let l=Z(m.result),d=new DataView(new ArrayBuffer(ts));d.setUint32(0,l.byteLength,!0),d.setUint32(4,hs,!0);let h=Z(ps(JSON.stringify(n)),32),w=new DataView(new ArrayBuffer(ts));w.setUint32(0,h.byteLength,!0),w.setUint32(4,fs,!0);let M=new ArrayBuffer(ss),N=new DataView(M);N.setUint32(0,us,!0),N.setUint32(4,ls,!0);let k=ss+w.byteLength+h.byteLength+d.byteLength+l.byteLength;N.setUint32(8,k,!0);let g=new Blob([M,w,h,d,l],{type:"application/octet-stream"}),y=new FileReader;y.readAsArrayBuffer(g),y.onloadend=function(){s(y.result)}}}else if(n.buffers&&n.buffers.length>0){let m=new FileReader;m.readAsDataURL(u),m.onloadend=function(){let l=m.result;n.buffers[0].uri=l,s(n)}}else s(n)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let r=this.options,t=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&i.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let n in i.gltfExtensions)s.extensions[n]=i.gltfExtensions[n],t[n]=!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 r=new D;for(let t=0,i=e.count;t<i;t++)if(Math.abs(r.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 r=e.clone(),t=new D;for(let i=0,n=r.count;i<n;i++)t.fromBufferAttribute(r,i),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),r.setXYZ(i,t.x,t.y,t.z);return s.attributesNormalized.set(e,r),r}applyTextureTransform(e,s){let r=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),r=!0),s.rotation!==0&&(t.rotation=s.rotation,r=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),r=!0),r&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,s){if(e===s)return e;function r(l){return l.colorSpace===V?T(function(h){return h<.04045?h*.0773993808:Math.pow(h*.9478672986+.0521327014,2.4)},"SRGBToLinear"):T(function(h){return h},"LinearToLinear")}T(r,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Y&&(e=j(e)),s instanceof Y&&(s=j(s));let t=e?e.image:null,i=s?s.image:null,n=Math.max(t?t.width:0,i?i.width:0),o=Math.max(t?t.height:0,i?i.height:0),a=ns();a.width=n,a.height=o;let u=a.getContext("2d");u.fillStyle="#00ffff",u.fillRect(0,0,n,o);let p=u.getImageData(0,0,n,o);if(t){u.drawImage(t,0,0,n,o);let l=r(e),d=u.getImageData(0,0,n,o).data;for(let h=2;h<d.length;h+=4)p.data[h]=l(d[h]/256)*256}if(i){u.drawImage(i,0,0,n,o);let l=r(s),d=u.getImageData(0,0,n,o).data;for(let h=1;h<d.length;h+=4)p.data[h]=l(d[h]/256)*256}u.putImageData(p,0,0);let m=(e||s).clone();return m.source=new Ge(a),m.colorSpace=Ve,m.channel=(e||s).channel,e&&s&&e.channel!==s.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),m}processBuffer(e){let s=this.json,r=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),r.push(e),0}processBufferView(e,s,r,t,i){let n=this.json;n.bufferViews||(n.bufferViews=[]);let o;switch(s){case x.BYTE:case x.UNSIGNED_BYTE:o=1;break;case x.SHORT:case x.UNSIGNED_SHORT:o=2;break;default:o=4}let a=is(t*e.itemSize*o),u=new DataView(new ArrayBuffer(a)),p=0;for(let l=r;l<r+t;l++)for(let d=0;d<e.itemSize;d++){let h;e.itemSize>4?h=e.array[l*e.itemSize+d]:(d===0?h=e.getX(l):d===1?h=e.getY(l):d===2?h=e.getZ(l):d===3&&(h=e.getW(l)),e.normalized===!0&&(h=G.normalize(h,e.array))),s===x.FLOAT?u.setFloat32(p,h,!0):s===x.INT?u.setInt32(p,h,!0):s===x.UNSIGNED_INT?u.setUint32(p,h,!0):s===x.SHORT?u.setInt16(p,h,!0):s===x.UNSIGNED_SHORT?u.setUint16(p,h,!0):s===x.BYTE?u.setInt8(p,h):s===x.UNSIGNED_BYTE&&u.setUint8(p,h),p+=o}let f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:a};return i!==void 0&&(f.target=i),i===x.ARRAY_BUFFER&&(f.byteStride=e.itemSize*o),this.byteOffset+=a,n.bufferViews.push(f),{id:n.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,r=s.json;return r.bufferViews||(r.bufferViews=[]),new Promise(function(t){let i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){let n=Z(i.result),o={buffer:s.processBuffer(n),byteOffset:s.byteOffset,byteLength:n.byteLength};s.byteOffset+=n.byteLength,t(r.bufferViews.push(o)-1)}})}processAccessor(e,s,r,t){let i=this.json,n={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=x.FLOAT;else if(e.array.constructor===Int32Array)o=x.INT;else if(e.array.constructor===Uint32Array)o=x.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=x.SHORT;else if(e.array.constructor===Uint16Array)o=x.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=x.BYTE;else if(e.array.constructor===Uint8Array)o=x.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),(t===void 0||t===1/0)&&(t=e.count),t===0)return null;let a=gs(e,r,t),u;s!==void 0&&(u=e===s.index?x.ELEMENT_ARRAY_BUFFER:x.ARRAY_BUFFER);let p=this.processBufferView(e,o,r,t,u),f={bufferView:p.id,byteOffset:p.byteOffset,componentType:o,count:t,max:a.max,min:a.min,type:n[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(f)-1}processImage(e,s,r,t="image/png"){if(e!==null){let i=this,n=i.cache,o=i.json,a=i.options,u=i.pending;n.images.has(e)||n.images.set(e,{});let p=n.images.get(e),f=t+":flipY/"+r.toString();if(p[f]!==void 0)return p[f];o.images||(o.images=[]);let m={mimeType:t},l=ns();l.width=Math.min(e.width,a.maxTextureSize),l.height=Math.min(e.height,a.maxTextureSize);let d=l.getContext("2d");if(r===!0&&(d.translate(0,l.height),d.scale(1,-1)),e.data!==void 0){s!==Fe&&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 w=new Uint8ClampedArray(e.height*e.width*4);for(let M=0;M<w.length;M+=4)w[M+0]=e.data[M+0],w[M+1]=e.data[M+1],w[M+2]=e.data[M+2],w[M+3]=e.data[M+3];d.putImageData(new ImageData(w,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)d.drawImage(e,0,0,l.width,l.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement or ImageBitmap.");a.binary===!0?u.push(rs(l,t).then(w=>i.processBufferViewImage(w)).then(w=>{m.bufferView=w})):l.toDataURL!==void 0?m.uri=l.toDataURL(t):u.push(rs(l,t).then(w=>new FileReader().readAsDataURL(w)).then(w=>{m.uri=w}));let h=o.images.push(m)-1;return p[f]=h,h}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 r={magFilter:b[e.magFilter],minFilter:b[e.minFilter],wrapS:b[e.wrapS],wrapT:b[e.wrapT]};return s.samplers.push(r)-1}processTexture(e){let r=this.options,t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]),e instanceof Y&&(e=j(e,r.maxTextureSize));let n=e.userData.mimeType;n==="image/webp"&&(n="image/png");let o={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(o.name=e.name),this._invokeAll(function(u){u.writeTexture&&u.writeTexture(e,o)});let a=i.textures.push(o)-1;return t.textures.set(e,a),a}processMaterial(e){let s=this.cache,r=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.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(F(i,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=.5,t.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let o=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(o),channel:o.channel};this.applyTextureTransform(a,o),t.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let o={index:this.processTexture(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 u={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),t.emissiveTexture=u}}if(e.normalMap){let o={index:this.processTexture(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:this.processTexture(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===_e&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),this._invokeAll(function(o){o.writeMaterial&&o.writeMaterial(e,t)});let n=r.materials.push(t)-1;return s.materials.set(e,n),n}processMesh(e){let s=this.cache,r=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let g=0,y=e.material.length;g<y;g++)t.push(e.material[g].uuid);else t.push(e.material.uuid);let i=t.join(":");if(s.meshes.has(i))return s.meshes.get(i);let n=e.geometry,o;e.isLineSegments?o=x.LINES:e.isLineLoop?o=x.LINE_LOOP:e.isLine?o=x.LINE_STRIP:e.isPoints?o=x.POINTS:o=e.material.wireframe?x.LINES:x.TRIANGLES;let a={},u={},p=[],f=[],m={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},l=n.getAttribute("normal");l!==void 0&&!this.isNormalizedNormalAttribute(l)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),n.setAttribute("normal",this.createNormalizedNormalAttribute(l)));let d=null;for(let g in n.attributes){if(g.slice(0,5)==="morph")continue;let y=n.attributes[g];if(g=m[g]||g.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(g)||(g="_"+g),s.attributes.has(this.getUID(y))){u[g]=s.attributes.get(this.getUID(y));continue}d=null;let A=y.array;g==="JOINTS_0"&&!(A instanceof Uint16Array)&&!(A instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new _(new Uint16Array(A),y.itemSize,y.normalized));let E=this.processAccessor(d||y,n);E!==null&&(g.startsWith("_")||this.detectMeshQuantization(g,y),u[g]=E,s.attributes.set(this.getUID(y),E))}if(l!==void 0&&n.setAttribute("normal",l),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let g=[],y=[],I={};if(e.morphTargetDictionary!==void 0)for(let A in e.morphTargetDictionary)I[e.morphTargetDictionary[A]]=A;for(let A=0;A<e.morphTargetInfluences.length;++A){let E={},Se=!1;for(let v in n.morphAttributes){if(v!=="position"&&v!=="normal"){Se||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),Se=!0);continue}let S=n.morphAttributes[v][A],X=v.toUpperCase(),L=n.attributes[v];if(s.attributes.has(this.getUID(S,!0))){E[X]=s.attributes.get(this.getUID(S,!0));continue}let O=S.clone();if(!n.morphTargetsRelative)for(let R=0,os=S.count;R<os;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[X]=this.processAccessor(O,n),s.attributes.set(this.getUID(L,!0),E[X])}f.push(E),g.push(e.morphTargetInfluences[A]),e.morphTargetDictionary!==void 0&&y.push(I[A])}a.weights=g,y.length>0&&(a.extras={},a.extras.targetNames=y)}let h=Array.isArray(e.material);if(h&&n.groups.length===0)return null;let w=!1;if(h&&n.index===null){let g=[];for(let y=0,I=n.attributes.position.count;y<I;y++)g[y]=y;n.setIndex(g),w=!0}let M=h?e.material:[e.material],N=h?n.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let g=0,y=N.length;g<y;g++){let I={mode:o,attributes:u};if(this.serializeUserData(n,I),f.length>0&&(I.targets=f),n.index!==null){let E=this.getUID(n.index);(N[g].start!==void 0||N[g].count!==void 0)&&(E+=":"+N[g].start+":"+N[g].count),s.attributes.has(E)?I.indices=s.attributes.get(E):(I.indices=this.processAccessor(n.index,n,N[g].start,N[g].count),s.attributes.set(E,I.indices)),I.indices===null&&delete I.indices}let A=this.processMaterial(M[N[g].materialIndex]);A!==null&&(I.material=A),p.push(I)}w===!0&&n.setIndex(null),a.primitives=p,r.meshes||(r.meshes=[]),this._invokeAll(function(g){g.writeMesh&&g.writeMesh(e,a)});let k=r.meshes.push(a)-1;return s.meshes.set(i,k),k}detectMeshQuantization(e,s){if(this.extensionsUsed[Q])return;let r;switch(s.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}s.normalized&&(r+=" normalized");let t=e.split("_",1)[0];$e[t]&&$e[t].includes(r)&&(this.extensionsUsed[Q]=!0,this.extensionsRequired[Q]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let r=e.isOrthographicCamera,t={type:r?"orthographic":"perspective"};return r?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:G.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 r=this.json,t=this.nodeMap;r.animations||(r.animations=[]),e=q.Utils.mergeMorphTargetTracks(e.clone(),s);let i=e.tracks,n=[],o=[];for(let a=0;a<i.length;++a){let u=i[a],p=z.parseTrackName(u.name),f=z.findNode(s,p.nodeName),m=es[p.propertyName];if(p.objectName==="bones"&&(f.isSkinnedMesh===!0?f=f.skeleton.getBoneByName(p.objectIndex):f=void 0),!f||!m)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',u.name),null;let l=1,d=u.values.length/u.times.length;m===es.morphTargetInfluences&&(d/=f.morphTargetInfluences.length);let h;u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(h="CUBICSPLINE",d/=3):u.getInterpolation()===ke?h="STEP":h="LINEAR",o.push({input:this.processAccessor(new _(u.times,l)),output:this.processAccessor(new _(u.values,d)),interpolation:h}),n.push({sampler:o.length-1,target:{node:t.get(f),path:m}})}return r.animations.push({name:e.name||"clip_"+r.animations.length,samplers:o,channels:n}),r.animations.length-1}processSkin(e){let s=this.json,r=this.nodeMap,t=s.nodes[r.get(e)],i=e.skeleton;if(i===void 0)return null;let n=e.skeleton.bones[0];if(n===void 0)return null;let o=[],a=new Float32Array(i.bones.length*16),u=new W;for(let f=0;f<i.bones.length;++f)o.push(r.get(i.bones[f])),u.copy(i.boneInverses[f]),u.multiply(e.bindMatrix).toArray(a,f*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new _(a,16)),joints:o,skeleton:r.get(n)}),t.skin=s.skins.length-1}processNode(e){let s=this.json,r=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let i={};if(r.trs){let o=e.quaternion.toArray(),a=e.position.toArray(),u=e.scale.toArray();F(o,[0,0,0,1])||(i.rotation=o),F(a,[0,0,0])||(i.translation=a),F(u,[1,1,1])||(i.scale=u)}else e.matrixAutoUpdate&&e.updateMatrix(),ds(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=this.processMesh(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,u=e.children.length;a<u;a++){let p=e.children[a];if(p.visible||r.onlyVisible===!1){let f=this.processNode(p);f!==null&&o.push(f)}}o.length>0&&(i.children=o)}this._invokeAll(function(o){o.writeNode&&o.writeNode(e,i)});let n=s.nodes.push(i)-1;return t.set(e,n),n}processScene(e){let s=this.json,r=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 n=0,o=e.children.length;n<o;n++){let a=e.children[n];if(a.visible||r.onlyVisible===!1){let u=this.processNode(a);u!==null&&i.push(u)}}i.length>0&&(t.nodes=i),this.serializeUserData(e,t)}processObjects(e){let s=new P;s.name="AuxScene";for(let r=0;r<e.length;r++)s.children.push(e[r]);this.processScene(s)}processInput(e){let s=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let r=[];for(let t=0;t<e.length;t++)e[t]instanceof P?this.processScene(e[t]):r.push(e[t]);r.length>0&&this.processObjects(r);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]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let s=0,r=this.plugins.length;s<r;s++)e(this.plugins[s])}};T(de,"GLTFWriter");var $=de,ge=class ge{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 r=this.writer,t=r.json,i=r.extensionsUsed,n={};e.name&&(n.name=e.name),n.color=e.color.toArray(),n.intensity=e.intensity,e.isDirectionalLight?n.type="directional":e.isPointLight?(n.type="point",e.distance>0&&(n.range=e.distance)):e.isSpotLight&&(n.type="spot",e.distance>0&&(n.range=e.distance),n.spot={},n.spot.innerConeAngle=(1-e.penumbra)*e.angle,n.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(n),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}};T(ge,"GLTFLightExtension");var ee=ge,xe=class xe{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(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(xe,"GLTFMaterialsUnlitExtension");var se=xe,me=class me{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let n={index:r.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};r.applyTextureTransform(n,e.clearcoatMap),i.clearcoatTexture=n}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let n={index:r.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};r.applyTextureTransform(n,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=n}if(e.clearcoatNormalMap){let n={index:r.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};r.applyTextureTransform(n,e.clearcoatNormalMap),i.clearcoatNormalTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(me,"GLTFMaterialsClearcoatExtension");var te=me,Te=class Te{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let n={index:r.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};r.applyTextureTransform(n,e.iridescenceMap),i.iridescenceTexture=n}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let n={index:r.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};r.applyTextureTransform(n,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Te,"GLTFMaterialsIridescenceExtension");var ne=Te,ye=class ye{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let n={index:r.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};r.applyTextureTransform(n,e.transmissionMap),i.transmissionTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(ye,"GLTFMaterialsTransmissionExtension");var re=ye,we=class we{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let n={index:r.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};r.applyTextureTransform(n,e.thicknessMap),i.thicknessTexture=n}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(we,"GLTFMaterialsVolumeExtension");var ie=we,Me=class Me{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(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(Me,"GLTFMaterialsIorExtension");var oe=Me,Ie=class Ie{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(cs)&&!e.specularIntensityMap&&!e.specularColorMap)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.specularIntensityMap){let n={index:r.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};r.applyTextureTransform(n,e.specularIntensityMap),i.specularTexture=n}if(e.specularColorMap){let n={index:r.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};r.applyTextureTransform(n,e.specularColorMap),i.specularColorTexture=n}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ie,"GLTFMaterialsSpecularExtension");var ae=Ie,Ae=class Ae{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.sheenRoughnessMap){let n={index:r.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};r.applyTextureTransform(n,e.sheenRoughnessMap),i.sheenRoughnessTexture=n}if(e.sheenColorMap){let n={index:r.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};r.applyTextureTransform(n,e.sheenColorMap),i.sheenColorTexture=n}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ae,"GLTFMaterialsSheenExtension");var ce=Ae,Re=class Re{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.anisotropyMap){let n={index:r.processTexture(e.anisotropyMap)};r.applyTextureTransform(n,e.anisotropyMap),i.anisotropyTexture=n}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Re,"GLTFMaterialsAnisotropyExtension");var ue=Re,Ee=class Ee{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(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(Ee,"GLTFMaterialsEmissiveStrengthExtension");var le=Ee,be=class be{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,s){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.bumpMap){let n={index:r.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};r.applyTextureTransform(n,e.bumpMap),i.bumpTexture=n}i.bumpFactor=e.bumpScale,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(be,"GLTFMaterialsBumpExtension");var fe=be,Ne=class Ne{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,s){if(!e.isInstancedMesh)return;let r=this.writer,t=e,i=new Float32Array(t.count*3),n=new Float32Array(t.count*4),o=new Float32Array(t.count*3),a=new W,u=new D,p=new Ye,f=new D;for(let l=0;l<t.count;l++)t.getMatrixAt(l,a),a.decompose(u,p,f),u.toArray(i,l*3),p.toArray(n,l*4),f.toArray(o,l*3);let m={TRANSLATION:r.processAccessor(new _(i,3)),ROTATION:r.processAccessor(new _(n,4)),SCALE:r.processAccessor(new _(o,3))};t.instanceColor&&(m._COLOR_0=r.processAccessor(t.instanceColor)),s.extensions=s.extensions||{},s.extensions[this.name]={attributes:m},r.extensionsUsed[this.name]=!0,r.extensionsRequired[this.name]=!0}};T(Ne,"GLTFMeshGpuInstancing");var he=Ne;q.Utils={insertKeyframe:function(c,e){let r=c.getValueSize(),t=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+r),n=c.createInterpolant(new c.ValueBufferType(r)),o;if(c.times.length===0){t[0]=e;for(let a=0;a<r;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(n.evaluate(e),0),i.set(c.values,r),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(n.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)*r),0),i.set(n.evaluate(e),(a+1)*r),i.set(c.values.slice((a+1)*r),(a+2)*r),o=a+1;break}}return c.times=t,c.values=i,o},mergeMorphTargetTracks:function(c,e){let s=[],r={},t=c.tracks;for(let i=0;i<t.length;++i){let n=t[i],o=z.parseTrackName(n.name),a=z.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(n);continue}if(n.createInterpolant!==n.InterpolantFactoryMethodDiscrete&&n.createInterpolant!==n.InterpolantFactoryMethodLinear){if(n.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."),n=n.clone(),n.setInterpolation(He)}let u=a.morphTargetInfluences.length,p=a.morphTargetDictionary[o.propertyIndex];if(p===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let f;if(r[a.uuid]===void 0){f=n.clone();let l=new f.ValueBufferType(u*f.times.length);for(let d=0;d<f.times.length;d++)l[d*u+p]=f.values[d];f.name=(o.nodeName||"")+".morphTargetInfluences",f.values=l,r[a.uuid]=f,s.push(f);continue}let m=n.createInterpolant(new n.ValueBufferType(1));f=r[a.uuid];for(let l=0;l<f.times.length;l++)f.values[l*u+p]=m.evaluate(f.times[l]);for(let l=0;l<n.times.length;l++){let d=this.insertKeyframe(f,n.times[l]);f.values[d*u+p]=n.values[l]}}return c.tracks=s,c}};export{q as GLTFExporter};
@@ -0,0 +1 @@
1
+ import{b as ae}from"./chunk-GXJVVNTN.js";import{$ as wt,A as Z,C as J,E as $,Fa as ne,G as ee,Ga as b,H as D,I as _t,Ia as Ut,J as Et,Ja as se,K as j,Ka as re,La as ie,M as te,Ma as jt,N as L,Na as Kt,O as V,Oa as oe,P as H,Pa as Ft,Q as X,Qa as Vt,R as xt,Ra as Xt,S as St,Sa as Gt,Ua as B,Wa as zt,X as yt,Ya as qt,b as ct,ca as G,d as ut,e as F,f as lt,g as ft,ga as Nt,h as dt,ha as bt,i as ht,ia as Mt,j as pt,ja as It,k as W,l as mt,la as Lt,m as Y,ma as Ot,na as Ct,p as At,pa as Dt,q as Q,qa as Pt,ra as kt,s as gt,sa as Ht,t as Tt,ta as Bt,ua as vt,w as k,x as N,z as Rt}from"./chunk-23O3CSSY.js";import{a as at}from"./chunk-SXU2GBLV.js";import{a as p}from"./chunk-J5IUISYU.js";at();var He=class He extends Kt{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new pe(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new ye(e)}),this.register(function(e){return new we(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new Ne(e)}),this.register(function(e){return new be(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 oe(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}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}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))===$t){try{i[g.KHR_BINARY_GLTF]=new Me(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 ke(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 de;break;case g.KHR_DRACO_MESH_COMPRESSION:i[u]=new Ie(s,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:i[u]=new Le;break;case g.KHR_MESH_QUANTIZATION:i[u]=new Oe;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(He,"GLTFLoader");var Wt=He;function en(){let h={};return{get:function(t){return h[t]},add:function(t,e){h[t]=e},remove:function(t){delete h[t]},removeAll:function(){h={}}}}p(en,"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_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"},Be=class Be{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 L(16777215);o.color!==void 0&&l.setRGB(o.color[0],o.color[1],o.color[2],N);let u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new Gt(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Xt(l),c.distance=u;break;case"spot":c=new Vt(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),c.decay=2,C(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(Be,"GLTFLightsExtension");var fe=Be,ve=class ve{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return H}extendParams(t,e,r){let n=[];t.color=new L(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],N),t.opacity=i[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(t,"map",s.baseColorTexture,k))}return Promise.all(n)}};p(ve,"GLTFMaterialsUnlitExtension");var de=ve,Ue=class Ue{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(Ue,"GLTFMaterialsEmissiveStrengthExtension");var he=Ue,je=class je{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:b}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 Z(a,a)}return Promise.all(s)}};p(je,"GLTFMaterialsClearcoatExtension");var pe=je,Ke=class Ke{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:b}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(Ke,"GLTFMaterialsIridescenceExtension");var me=Ke,Fe=class Fe{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:b}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 L(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],N)}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(Fe,"GLTFMaterialsSheenExtension");var Ae=Fe,Ve=class Ve{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:b}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(Ve,"GLTFMaterialsTransmissionExtension");var ge=Ve,Xe=class Xe{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:b}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 L().setRGB(a[0],a[1],a[2],N),Promise.all(s)}};p(Xe,"GLTFMaterialsVolumeExtension");var Te=Xe,Ge=class Ge{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:b}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(Ge,"GLTFMaterialsIorExtension");var Re=Ge,ze=class ze{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:b}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 L().setRGB(a[0],a[1],a[2],N),i.specularColorTexture!==void 0&&s.push(r.assignTexture(e,"specularColorMap",i.specularColorTexture,k)),Promise.all(s)}};p(ze,"GLTFMaterialsSpecularExtension");var _e=ze,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:b}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 Ee=qe,We=class We{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:b}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(We,"GLTFMaterialsAnisotropyExtension");var xe=We,Ye=class Ye{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(Ye,"GLTFTextureBasisUExtension");var Se=Ye,Qe=class Qe{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(Qe,"GLTFTextureWebPExtension");var ye=Qe,Ze=class Ze{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(Ze,"GLTFTextureAVIFExtension");var we=Ze,Je=class Je{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(Je,"GLTFMeshoptCompression");var Ne=Je,$e=class $e{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 m of u){let R=new j,A=new D,T=new ee,E=new D(1,1,1),x=new Ct(m.geometry,m.material,f);for(let _=0;_<f;_++)o.TRANSLATION&&A.fromBufferAttribute(o.TRANSLATION,_),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,_),o.SCALE&&E.fromBufferAttribute(o.SCALE,_),x.setMatrixAt(_,R.compose(A,T,E));for(let _ in o)if(_==="_COLOR_0"){let w=o[_];x.instanceColor=new Ot(w.array,w.itemSize,w.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&m.geometry.setAttribute(_,o[_]);te.prototype.copy.call(x,m),this.parser.assignFinalMaterial(x),d.push(x)}return l.isGroup?(l.clear(),l.add(...d),l):d[0]}))}};p($e,"GLTFMeshGpuInstancing");var be=$e,$t="glTF",K=12,Yt={JSON:1313821514,BIN:5130562},et=class et{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!==$t)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===Yt.JSON){let c=new Uint8Array(t,K+i,a);this.content=r.decode(c)}else if(o===Yt.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(et,"GLTFBinaryExtension");var Me=et,tt=class tt{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=De[l]||l.toLowerCase();a[u]=i[l]}for(let l in t.attributes){let u=De[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 m in d.attributes){let R=d.attributes[m],A=o[m];A!==void 0&&(R.normalized=A)}u(d)},a,c,N,f)})})}};p(tt,"GLTFDracoMeshCompressionExtension");var Ie=tt,nt=class nt{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(nt,"GLTFTextureTransformExtension");var Le=nt,st=class st{constructor(){this.name=g.KHR_MESH_QUANTIZATION}};p(st,"GLTFMeshQuantizationExtension");var Oe=st,rt=class rt extends Ut{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,m=t*c,R=m-c,A=-2*d+3*f,T=d-f,E=1-A,x=T-f+u;for(let _=0;_!==a;_++){let w=i[R+_+a],M=i[R+_+o]*l,y=i[m+_+a],U=i[m+_]*l;s[_]=E*w+x*M+A*y+T*U}return s}};p(rt,"GLTFCubicSplineInterpolant");var z=rt,tn=new ee,it=class it extends z{interpolate_(t,e,r,n){let s=super.interpolate_(t,e,r,n);return tn.fromArray(s).normalize().toArray(s),s}};p(it,"GLTFCubicSplineQuaternionInterpolant");var Ce=it,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},Qt={9728:dt,9729:W,9984:ht,9985:mt,9986:pt,9987:Y},Zt={33071:lt,33648:ft,10497:F},ce={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={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"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},nn={CUBICSPLINE:void 0,LINEAR:Q,STEP:At},ue={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function sn(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new ne({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ct})),h.DefaultMaterial}p(sn,"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 C(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(C,"assignExtrasToUserData");function rn(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(rn,"addMorphTargets");function on(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(on,"updateMorphTargets");function an(h){let t,e=h.extensions&&h.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+le(e.attributes):t=h.indices+":"+le(h.attributes)+":"+h.mode,h.targets!==void 0)for(let r=0,n=h.targets.length;r<n;r++)t+=":"+le(h.targets[r]);return t}p(an,"createPrimitiveKey");function le(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(le,"createAttributesKey");function Pe(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(Pe,"getNormalizedComponentScale");function cn(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":"image/png"}p(cn,"getImageURIMimeType");var un=new j,ot=class ot{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new en,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;typeof navigator<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||n&&s<98?this.textureLoader=new Ft(this.options.manager):this.textureLoader=new zt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new oe(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),C(a,n),Promise.all(r._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){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=ce[n.type],a=v[n.componentType],o=n.normalized===!0,c=new a(n.count*i);return Promise.resolve(new X(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=ce[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,m=n.normalized===!0,R,A;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 Nt(R,d/l),e.cache.add(E,x)),A=new bt(x,o,f%d/l,m)}else a===null?R=new c(n.count*o):R=new c(a,f,n.count*o),A=new X(R,o,m);if(n.sparse!==void 0){let T=ce.SCALAR,E=v[n.sparse.indices.componentType],x=n.sparse.indices.byteOffset||0,_=n.sparse.values.byteOffset||0,w=new E(i[1],x,n.sparse.count*T),M=new c(i[2],_,n.sparse.count*o);a!==null&&(A=new X(A.array.slice(),A.itemSize,A.normalized));for(let y=0,U=w.length;y<U;y++){let I=w[y];if(A.setX(I,M[y*o]),o>=2&&A.setY(I,M[y*o+1]),o>=3&&A.setZ(I,M[y*o+2]),o>=4&&A.setW(I,M[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return A})}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=Qt[f.magFilter]||W,l.minFilter=Qt[f.minFilter]||Y,l.wrapS=Zt[f.wrapS]||F,l.wrapT=Zt[f.wrapT]||F,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 m=f;e.isImageBitmapLoader===!0&&(m=p(function(R){let A=new $(R);A.needsUpdate=!0,f(A)},"onLoad")),e.load(B.resolveURL(u,s.path),m,void 0,d)})}).then(function(u){return c===!0&&a.revokeObjectURL(o),u.userData.mimeType=i.mimeType||cn(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 Bt,V.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 Dt,V.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 ne}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 L(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){let f=u.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],N),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=ut);let l=s.alphaMode||ue.OPAQUE;if(l===ue.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===ue.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 Z(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 L().setRGB(u[0],u[1],u[2],N)}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),C(u,s),e.associations.set(u,{materials:t}),s.extensions&&P(n,u,s),u})}createUniqueName(t){let e=qt.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 Jt(o,a,e)})}p(s,"createDracoPrimitive");let i=[];for(let a=0,o=t.length;a<o;a++){let c=t[a],l=an(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=Jt(new xt,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?sn(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,m=l.length;d<m;d++){let R=l[d],A=i[d],T,E=c[d];if(A.mode===S.TRIANGLES||A.mode===S.TRIANGLE_STRIP||A.mode===S.TRIANGLE_FAN||A.mode===void 0)T=s.isSkinnedMesh===!0?new Mt(R,E):new St(R,E),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),A.mode===S.TRIANGLE_STRIP?T.geometry=ae(T.geometry,gt):A.mode===S.TRIANGLE_FAN&&(T.geometry=ae(T.geometry,Tt));else if(A.mode===S.LINES)T=new kt(R,E);else if(A.mode===S.LINE_STRIP)T=new Pt(R,E);else if(A.mode===S.LINE_LOOP)T=new Ht(R,E);else if(A.mode===S.POINTS)T=new vt(R,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+A.mode);Object.keys(T.geometry.morphAttributes).length>0&&on(T,s),T.name=e.createUniqueName(s.name||"mesh_"+t),C(T,s),A.extensions&&P(n,T,A),e.assignFinalMaterial(T),u.push(T)}for(let d=0,m=u.length;d<m;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 G;s.extensions&&P(n,f,s),e.associations.set(f,{meshes:t});for(let d=0,m=u.length;d<m;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 yt(Rt.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(e=new wt(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(e.name=this.createUniqueName(r.name)),C(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 Lt(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],m=n.samplers[d.sampler],R=d.target,A=R.node,T=n.parameters!==void 0?n.parameters[m.input]:m.input,E=n.parameters!==void 0?n.parameters[m.output]:m.output;R.node!==void 0&&(i.push(this.getDependency("node",A)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",E)),c.push(m),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],m=u[2],R=u[3],A=u[4],T=[];for(let E=0,x=f.length;E<x;E++){let _=f[E],w=d[E],M=m[E],y=R[E],U=A[E];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();let I=r._createAnimationTracks(_,w,M,y,U);if(I)for(let q=0;q<I.length;q++)T.push(I[q])}return new jt(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,un)});for(let d=0,m=u.length;d<m;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 It:c.length>1?l=new G:c.length===1?l=c[0]:l=new te,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),C(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 G;r.name&&(s.name=n.createUniqueName(r.name)),C(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 V||f instanceof $)&&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=[];O[s.path]===O.weights?t.traverse(function(f){f.morphTargetInfluences&&o.push(f.name?f.name:f.uuid)}):o.push(a);let c;switch(O[s.path]){case O.weights:c=se;break;case O.rotation:c=re;break;case O.position:case O.scale:c=ie;break;default:switch(r.itemSize){case 1:c=se;break;case 2:case 3:default:c=ie;break}break}let l=n.interpolation!==void 0?nn[n.interpolation]:Q,u=this._getArrayFromAccessor(r);for(let f=0,d=o.length;f<d;f++){let m=new c(o[f]+"."+O[s.path],e.array,u,l);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),i.push(m)}return i}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){let r=Pe(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 re?Ce:z;return new n(this.times,this.values,this.getValueSize()/3,r)},"InterpolantFactoryMethodGLTFCubicSpline"),t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};p(ot,"GLTFParser");var ke=ot;function ln(h,t,e){let r=t.attributes,n=new _t;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=Pe(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,m=f.max;if(d!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(m[2]))),f.normalized){let R=Pe(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 Et;n.getCenter(i.center),i.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=i}p(ln,"computeBounds");function Jt(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=De[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 J.workingColorSpace!==N&&"COLOR_0"in r&&console.warn('THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "'.concat(J.workingColorSpace,'" not supported.')),C(h,t),ln(h,t,e),Promise.all(n).then(function(){return t.targets!==void 0?rn(h,t.targets,e):h})}p(Jt,"addPrimitiveAttributes");export{Wt as GLTFLoader};
@@ -0,0 +1 @@
1
+ import{a as hn}from"./chunk-SXU2GBLV.js";import{a as u}from"./chunk-J5IUISYU.js";hn();var ln={},Qn=u(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 s=new Error(v[0]);s.code=v[1],s.stack=v[2],i(s,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=u(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=u(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 s=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]=s}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=u(function(n){for(var r=n[0],t=1;t<n.length;++t)n[t]>r&&(r=n[t]);return r},"max"),V=u(function(n,r,t){var e=r/8|0;return(n[e]|n[e+1]<<8)>>(r&7)&t},"bits"),kr=u(function(n,r){var t=r/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(r&7)},"bits16"),Sr=u(function(n){return(n+7)/8|0},"shft"),d=u(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=u(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=u(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=u(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,s=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(s+w),r.set(n.subarray(p,T),s),t.b=s+=w,t.p=v=T*8,t.f=f;continue}if(v>x){a&&g(0);break}}i&&o(s+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[s++]=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(s+131072);for(var $=s+Y;s<$;s+=4)r[s]=r[s-k],r[s+1]=r[s+1-k],r[s+2]=r[s+2-k],r[s+3]=r[s+3-k];s=$}}t.l=h,t.p=j,t.b=s,t.f=f,h&&(f=1,t.m=y,t.d=l,t.n=z)}while(!f);return s==r.length?r:d(r,0,s)},"inflt"),nr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8},"wbits"),hr=u(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=u(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],s=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[s].f<t[l].f?s++:l++],v=t[s!=h&&t[s].f<t[l].f?s++: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=u(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=u(function(n){for(var r=n.length;r&&!n[--r];);for(var t=new q(++r),e=0,i=n[0],a=1,o=u(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=u(function(n,r){for(var t=0,e=0;e<r.length;++e)t+=n[e]*r[e];return t},"clen"),Pr=u(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=u(function(n,r,t,e,i,a,o,f,v,s,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=s+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+s));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=u(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),s=0;if(!r||o<8)for(var h=0;h<=o;h+=65535){var l=h+65535;l>=o&&(v[s>>3]=a),s=Pr(v,s+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=u(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){s=jr(n,v,0,B,C,D,G,S,Z,h-Z,s),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]]}}s=jr(n,v,a,B,C,D,G,S,Z,h-Z,s),!a&&s&7&&(s=Pr(v,s+1,er))}return d(f,0,e+Sr(s)+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=u(function(){var n=-1;return{p:function(r){for(var t=n,e=0;e<r.length;++e)t=In[t&255^r[e]]^t>>>8;n=t},d:function(){return~n}}},"crc"),br=u(function(){var n=1,r=0;return{p: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},d:function(){return n%=65521,r%=65521,(n&255)<<24|n>>>8<<16|(r&255)<<8|r>>>8}}},"adler"),ur=u(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=u(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=u(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 s=f.toString();if(f.prototype)if(s.indexOf("[native code]")!=-1){var h=s.indexOf(" ",8)+1;r+=s.slice(h,s.indexOf("(",h))}else{r+=s;for(var l in f.prototype)r+=";"+v+".prototype."+l+"="+f.prototype[l].toString()}else r+=s}else t[v]=f}return[r,t]},"wcln"),Br=[],Vn=u(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=u(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 s=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,s,Vn(s),e)},"wrkr"),xr=u(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=u(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=u(function(){return[rn,tn,I,mr,In]},"gze"),kn=u(function(){return[nn,Ln]},"guze"),Gn=u(function(){return[en,I,br]},"zle"),On=u(function(){return[Pn]},"zule"),fr=u(function(n){return postMessage(n,[n.buffer])},"pbf"),_r=u(function(n){return n&&n.size&&new U(n.size)},"gu8"),Ar=u(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=u(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=u(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=u(function(n,r){return n[r]|n[r+1]<<8},"b2"),N=u(function(n,r){return(n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24)>>>0},"b4"),Hr=u(function(n,r){return N(n,r)+N(n,r+4)*4294967296},"b8"),I=u(function(n,r,t){for(;t;++r)n[r]=t,t>>>=8},"wbytes"),rn=u(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=u(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=u(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=u(function(n){return 10+(n.filename&&n.filename.length+1||0)},"gzhl"),en=u(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=u(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}u(an,"AsyncCmpStrm");var ar=function(){function n(r,t){!t&&typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{}}return u(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 u(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)}u(dn,"deflate");function $r(n,r){return ur(n,r||{},0,0)}u($r,"deflateSync");var K=function(){function n(r){this.s={},this.p=new U(0),this.ondata=r}return u(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 u(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)}u(Rn,"inflate");function Fr(n,r){return Cr(n,r)}u(Fr,"inflateSync");var pn=function(){function n(r,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,r,t)}return u(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 u(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)}u(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}u(gn,"gzipSync");var Jr=function(){function n(r){this.v=1,K.call(this,r)}return u(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 u(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)}u(_n,"gunzip");function Kr(n,r){return Cr(n.subarray(nn(n),-8),r||new U(Ln(n)))}u(Kr,"gunzipSync");var yn=function(){function n(r,t){this.c=br(),this.v=1,ar.call(this,r,t)}return u(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 u(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)}u(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}u(wn,"zlibSync");var Qr=function(){function n(r){this.v=1,K.call(this,r)}return u(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 u(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)}u(nt,"unzlib");function Vr(n,r){return Cr((Pn(n),n.subarray(2,-4)),r)}u(Vr,"unzlibSync");var tt=function(){function n(r){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=r}return u(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=u(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 u(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)}u(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)}u(lt,"decompressSync");var on=u(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{}var qn=u(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 u(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 u(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=u(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 s=n.charCodeAt(e);s<128||r?f(s):s<2048?(f(192|s>>6),f(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|n.charCodeAt(++e)&1023,f(240|s>>18),f(128|s>>12&63),f(128|s>>6&63),f(128|s&63)):(f(224|s>>12),f(128|s>>6&63),f(128|s&63))}return d(a,0,o)}u(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}}u(Hn,"strFromU8");var Yn=u(function(n){return n==1?3:n<6?2:n==9?1:0},"dbf"),Wn=u(function(n,r){return r+30+W(n,r+26)+W(n,r+28)},"slzh"),jn=u(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],s=f[1],h=f[2];return[W(n,r+10),v,s,i,a+W(n,r+30)+W(n,r+32),h]},"zh"),Jn=u(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=u(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=u(function(n,r,t,e,i,a,o,f){var v=e.length,s=t.extra,h=f&&f.length,l=or(s);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 s){var A=s[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=u(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 u(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 u(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 u(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 u(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 s=new U(v);pr(s,0,r,e,f,-1);var h=[s],l=u(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:function(){r.terminate&&r.terminate()},r:function(){if(l(),y){var p=t.u[z+1];p?p.r():t.d=1}y=1}}),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:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),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,s=this.u;v<s.length;v++){var o=s[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,s=new Array(a),h=[],l=u(function(){for(var p=0;p<h.length;++p)h[p]()},"tAll"),y=u(function(p,w){Rr(function(){t(p,w)})},"cbd");Rr(function(){y=t});var z=u(function(){var p=new U(f+22),w=o,T=f-o;f=0;for(var M=0;M<v;++M){var m=s[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,s.length,T,w),y(null,p)},"cbf");a||z();for(var x=u(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=u(function(P,k){if(P)l(),y(P,null);else{var L=k.length;s[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}u(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],s=f[1],h=s.level==0?0:8,l=sr(o),y=l.length,z=s.comment,x=z&&sr(z),A=x&&x.length,p=or(s.extra);y>65535&&g(11);var w=h?$r(v,s):v,T=w.length,M=mr();M.p(v),e.push(Er(s,{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}u(xt,"zipSync");var et=function(){function n(){}return u(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 u(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 u(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 u(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,s=void 0;this.p.length?r.length?(s=new U(this.p.length+r.length),s.set(this.p),s.set(r,this.p.length)):s=this.p:s=r;for(var h=s.length,l=this.c,y=l&&this.d,z=u(function(){var w,T=N(s,f);if(T==67324752){o=1,v=f,x.d=null,x.c=0;var M=W(s,f+6),m=W(s,f+8),B=M&2048,C=M&8,D=W(s,f+26),c=W(s,f+28);if(h>f+30+D+c){var G=[];x.k.unshift(G),o=2;var S=N(s,f+18),R=N(s,f+22),Z=Hn(s.subarray(f+30,f+=30+D),!B);S==4294967295?(w=C?[-2]:Jn(s,f),S=w[0],R=w[1]):C&&(S=-1),f+=c,x.c=S;var O,F={name:Z,compression:m,start: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)}},terminate:function(){O&&O.terminate&&O.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?s.subarray(0,v-12-(l==-2&&8)-(N(s,v-16)==134695760&&4)):s.subarray(0,f);y?y.push(p,!!o):this.k[+(o==2)].push(p)}if(o&2)return this.push(s.subarray(f),t);this.p=s.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=u(function(){for(var p=0;p<e.length;++p)e[p]()},"tAll"),a={},o=u(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 s=v,h=N(n,f+16),l=h==4294967295||s==65535;if(l){var y=N(n,f-12);l=N(n,y)==101075792,l&&(s=v=N(n,y+32),h=N(n,y+48))}for(var z=r&&r.filter,x=u(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=u(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<s;++A)x(A)}else o(null,{});return i}u(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,s=0;s<i;++s){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}u(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};