@mappedin/mappedin-js 5.34.3 → 5.35.0

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 +1 @@
1
- import{$ as _,A as He,D as Ve,E as V,L as G,N as Ge,Oa as z,Pa as Ze,R as Ye,S as D,V as W,Y as Ke,ba as je,da as qe,e as _e,fa as Xe,ha as We,i as Ce,j as Ue,k as ve,l as Le,m as Oe,ma as Je,n as De,o as Pe,oa as P,p as ze,q as Be,va as Y,w as Fe,wa as Qe,z as ke}from"./chunk-FE4M476A.js";import{a as H}from"./chunk-SAYKHSRQ.js";import{a as T}from"./chunk-ZRT45YCM.js";var B,J,U,K;function j(e,t=1/0,s=null){J||(J=new We(2,2,1,1)),U||(U=new qe({uniforms:{blitTexture:new Ze(e)},vertexShader:"\n\t\t\tvarying vec2 vUv;\n\t\t\tvoid main(){\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = vec4(position.xy * 1.0,0.,.999999);\n\t\t\t}",fragmentShader:"\n\t\t\tuniform sampler2D blitTexture; \n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main(){ \n\t\t\t\tgl_FragColor = vec4(vUv.xy, 0, 1);\n\t\t\t\t\n\t\t\t\t#ifdef IS_SRGB\n\t\t\t\tgl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n\t\t\t\t#else\n\t\t\t\tgl_FragColor = texture2D( blitTexture, vUv);\n\t\t\t\t#endif\n\t\t\t}"})),U.uniforms.blitTexture.value=e,U.defines.IS_SRGB=e.colorSpace==V,U.needsUpdate=!0,K||((K=new je(J,U)).frustrumCulled=!1);let r=new Xe,n=new P;n.add(K),null===s&&(s=B=new Je({antialias:!1}));let i=Math.min(e.image.width,t),a=Math.min(e.image.height,t);s.setSize(i,a),s.clear(),s.render(n,r);let o=document.createElement("canvas"),l=o.getContext("2d");o.width=i,o.height=a,l.drawImage(s.domElement,0,0,i,a);let c=new Qe(o);return c.minFilter=e.minFilter,c.magFilter=e.magFilter,c.wrapS=e.wrapS,c.wrapT=e.wrapT,c.name=e.name,B&&(B.forceContextLoss(),B.dispose(),B=null),c}H(),H(),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{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-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,r){let n=new $,i=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)i.push(this.pluginCallbacks[e](n));n.setPlugins(i),n.write(e,t,r).catch(s)}parseAsync(e,t){let s=this;return new Promise((function(r,n){s.parse(e,r,n,t)}))}};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(e,t){return e.length===t.length&&e.every((function(e,s){return e===t[s]}))}function ps(e){return(new TextEncoder).encode(e).buffer}function ds(e){return F(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function gs(e,t,s){let r={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=t;n<t+s;n++)for(let t=0;t<e.itemSize;t++){let s;e.itemSize>4?s=e.array[n*e.itemSize+t]:(0===t?s=e.getX(n):1===t?s=e.getY(n):2===t?s=e.getZ(n):3===t&&(s=e.getW(n)),!0===e.normalized&&(s=G.normalize(s,e.array))),r.min[t]=Math.min(r.min[t],s),r.max[t]=Math.max(r.max[t],s)}return r}function is(e){return 4*Math.ceil(e/4)}function Z(e,t=0){let s=is(e.byteLength);if(s!==e.byteLength){let r=new Uint8Array(s);if(r.set(new Uint8Array(e)),0!==t)for(let n=e.byteLength;n<s;n++)r[n]=t;return r.buffer}return e}function ns(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function rs(e,t){if(void 0!==e.toBlob)return new Promise((s=>e.toBlob(s,t)));let s;return"image/jpeg"===t?s=.92:"image/webp"===t&&(s=.8),e.convertToBlob({type:t,quality:s})}T(F,"equalArray"),T(ps,"stringToArrayBuffer"),T(ds,"isIdentityMatrix"),T(gs,"getMinMax"),T(is,"getPaddedBufferSize"),T(Z,"getPaddedArrayBuffer"),T(ns,"getCanvas"),T(rs,"getToBlobPromise");var de=class{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,t,s={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let r=this,n=r.buffers,i=r.json;s=r.options;let a=r.extensionsUsed,o=r.extensionsRequired,l=new Blob(n,{type:"application/octet-stream"}),c=Object.keys(a),u=Object.keys(o);if(c.length>0&&(i.extensionsUsed=c),u.length>0&&(i.extensionsRequired=u),i.buffers&&i.buffers.length>0&&(i.buffers[0].byteLength=l.size),!0===s.binary){let e=new FileReader;e.readAsArrayBuffer(l),e.onloadend=function(){let s=Z(e.result),r=new DataView(new ArrayBuffer(ts));r.setUint32(0,s.byteLength,!0),r.setUint32(4,hs,!0);let n=Z(ps(JSON.stringify(i)),32),a=new DataView(new ArrayBuffer(ts));a.setUint32(0,n.byteLength,!0),a.setUint32(4,fs,!0);let o=new ArrayBuffer(ss),l=new DataView(o);l.setUint32(0,us,!0),l.setUint32(4,ls,!0);let c=ss+a.byteLength+n.byteLength+r.byteLength+s.byteLength;l.setUint32(8,c,!0);let u=new Blob([o,a,n,r,s],{type:"application/octet-stream"}),h=new FileReader;h.readAsArrayBuffer(u),h.onloadend=function(){t(h.result)}}}else if(i.buffers&&i.buffers.length>0){let e=new FileReader;e.readAsDataURL(l),e.onloadend=function(){let s=e.result;i.buffers[0].uri=s,t(i)}}else t(i)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let s=this.options,r=this.extensionsUsed;try{let n=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&n.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(let e in n.gltfExtensions)t.extensions[e]=n.gltfExtensions[e],r[e]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){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(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new D;for(let s=0,r=e.count;s<r;s++)if(Math.abs(t.fromBufferAttribute(e,s).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let s=e.clone(),r=new D;for(let e=0,t=s.count;e<t;e++)r.fromBufferAttribute(s,e),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),s.setXYZ(e,r.x,r.y,r.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1,r={};(0!==t.offset.x||0!==t.offset.y)&&(r.offset=t.offset.toArray(),s=!0),0!==t.rotation&&(r.rotation=t.rotation,s=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(r.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=r,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(e){return e.colorSpace===V?T((function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}),"SRGBToLinear"):T((function(e){return e}),"LinearToLinear")}T(s,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Y&&(e=j(e)),t instanceof Y&&(t=j(t));let r=e?e.image:null,n=t?t.image:null,i=Math.max(r?r.width:0,n?n.width:0),a=Math.max(r?r.height:0,n?n.height:0),o=ns();o.width=i,o.height=a;let l=o.getContext("2d");l.fillStyle="#00ffff",l.fillRect(0,0,i,a);let c=l.getImageData(0,0,i,a);if(r){l.drawImage(r,0,0,i,a);let t=s(e),n=l.getImageData(0,0,i,a).data;for(let e=2;e<n.length;e+=4)c.data[e]=256*t(n[e]/256)}if(n){l.drawImage(n,0,0,i,a);let e=s(t),r=l.getImageData(0,0,i,a).data;for(let t=1;t<r.length;t+=4)c.data[t]=256*e(r[t]/256)}l.putImageData(c,0,0);let u=(e||t).clone();return u.source=new Ge(o),u.colorSpace=Ve,u.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),u}processBuffer(e){let t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,r,n){let i,a=this.json;switch(a.bufferViews||(a.bufferViews=[]),t){case x.BYTE:case x.UNSIGNED_BYTE:i=1;break;case x.SHORT:case x.UNSIGNED_SHORT:i=2;break;default:i=4}let o=is(r*e.itemSize*i),l=new DataView(new ArrayBuffer(o)),c=0;for(let n=s;n<s+r;n++)for(let s=0;s<e.itemSize;s++){let r;e.itemSize>4?r=e.array[n*e.itemSize+s]:(0===s?r=e.getX(n):1===s?r=e.getY(n):2===s?r=e.getZ(n):3===s&&(r=e.getW(n)),!0===e.normalized&&(r=G.normalize(r,e.array))),t===x.FLOAT?l.setFloat32(c,r,!0):t===x.INT?l.setInt32(c,r,!0):t===x.UNSIGNED_INT?l.setUint32(c,r,!0):t===x.SHORT?l.setInt16(c,r,!0):t===x.UNSIGNED_SHORT?l.setUint16(c,r,!0):t===x.BYTE?l.setInt8(c,r):t===x.UNSIGNED_BYTE&&l.setUint8(c,r),c+=i}let u={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};return void 0!==n&&(u.target=n),n===x.ARRAY_BUFFER&&(u.byteStride=e.itemSize*i),this.byteOffset+=o,a.bufferViews.push(u),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise((function(r){let n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){let e=Z(n.result),i={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,r(s.bufferViews.push(i)-1)}}))}processAccessor(e,t,s,r){let n,i=this.json;if(e.array.constructor===Float32Array)n=x.FLOAT;else if(e.array.constructor===Int32Array)n=x.INT;else if(e.array.constructor===Uint32Array)n=x.UNSIGNED_INT;else if(e.array.constructor===Int16Array)n=x.SHORT;else if(e.array.constructor===Uint16Array)n=x.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)n=x.BYTE;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);n=x.UNSIGNED_BYTE}if(void 0===s&&(s=0),(void 0===r||r===1/0)&&(r=e.count),0===r)return null;let a,o=gs(e,s,r);void 0!==t&&(a=e===t.index?x.ELEMENT_ARRAY_BUFFER:x.ARRAY_BUFFER);let l=this.processBufferView(e,n,s,r,a),c={bufferView:l.id,byteOffset:l.byteOffset,componentType:n,count:r,max:o.max,min:o.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(c.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(c)-1}processImage(e,t,s,r="image/png"){if(null!==e){let n=this,i=n.cache,a=n.json,o=n.options,l=n.pending;i.images.has(e)||i.images.set(e,{});let c=i.images.get(e),u=r+":flipY/"+s.toString();if(void 0!==c[u])return c[u];a.images||(a.images=[]);let h={mimeType:r},p=ns();p.width=Math.min(e.width,o.maxTextureSize),p.height=Math.min(e.height,o.maxTextureSize);let m=p.getContext("2d");if(!0===s&&(m.translate(0,p.height),m.scale(1,-1)),void 0!==e.data){t!==Fe&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let s=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<s.length;t+=4)s[t+0]=e.data[t+0],s[t+1]=e.data[t+1],s[t+2]=e.data[t+2],s[t+3]=e.data[t+3];m.putImageData(new ImageData(s,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))throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement or ImageBitmap.");m.drawImage(e,0,0,p.width,p.height)}!0===o.binary?l.push(rs(p,r).then((e=>n.processBufferViewImage(e))).then((e=>{h.bufferView=e}))):void 0!==p.toDataURL?h.uri=p.toDataURL(r):l.push(rs(p,r).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{h.uri=e})));let f=a.images.push(h)-1;return c[u]=f,f}throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let s={magFilter:b[e.magFilter],minFilter:b[e.minFilter],wrapS:b[e.wrapS],wrapT:b[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){let t=this.options,s=this.cache,r=this.json;if(s.textures.has(e))return s.textures.get(e);r.textures||(r.textures=[]),e instanceof Y&&(e=j(e,t.maxTextureSize));let n=e.userData.mimeType;"image/webp"===n&&(n="image/png");let i={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(i.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,i)}));let a=r.textures.push(i)-1;return s.textures.set(e,a),a}processMaterial(e){let t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);let r={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let n=e.color.toArray().concat([e.opacity]);if(F(n,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),s={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(s,t),r.pbrMetallicRoughness.metallicRoughnessTexture=s}if(e.map){let t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===_e&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,r)}));let i=s.materials.push(r)-1;return t.materials.set(e,i),i}processMesh(e){let t=this.cache,s=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,s=e.material.length;t<s;t++)r.push(e.material[t].uuid);else r.push(e.material.uuid);let n=r.join(":");if(t.meshes.has(n))return t.meshes.get(n);let i,a=e.geometry;i=e.isLineSegments?x.LINES:e.isLineLoop?x.LINE_LOOP:e.isLine?x.LINE_STRIP:e.isPoints?x.POINTS:e.material.wireframe?x.LINES:x.TRIANGLES;let o={},l={},c=[],u=[],h={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},p=a.getAttribute("normal");void 0!==p&&!this.isNormalizedNormalAttribute(p)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(p)));let m=null;for(let e in a.attributes){if("morph"===e.slice(0,5))continue;let s=a.attributes[e];if(e=h[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),t.attributes.has(this.getUID(s))){l[e]=t.attributes.get(this.getUID(s));continue}m=null;let r=s.array;"JOINTS_0"===e&&!(r instanceof Uint16Array)&&!(r instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),m=new _(new Uint16Array(r),s.itemSize,s.normalized));let n=this.processAccessor(m||s,a);null!==n&&(e.startsWith("_")||this.detectMeshQuantization(e,s),l[e]=n,t.attributes.set(this.getUID(s),n))}if(void 0!==p&&a.setAttribute("normal",p),0===Object.keys(l).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let s=[],r=[],n={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)n[e.morphTargetDictionary[t]]=t;for(let i=0;i<e.morphTargetInfluences.length;++i){let o={},l=!1;for(let e in a.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}let s=a.morphAttributes[e][i],r=e.toUpperCase(),n=a.attributes[e];if(t.attributes.has(this.getUID(s,!0))){o[r]=t.attributes.get(this.getUID(s,!0));continue}let c=s.clone();if(!a.morphTargetsRelative)for(let e=0,t=s.count;e<t;e++)for(let t=0;t<s.itemSize;t++)0===t&&c.setX(e,s.getX(e)-n.getX(e)),1===t&&c.setY(e,s.getY(e)-n.getY(e)),2===t&&c.setZ(e,s.getZ(e)-n.getZ(e)),3===t&&c.setW(e,s.getW(e)-n.getW(e));o[r]=this.processAccessor(c,a),t.attributes.set(this.getUID(n,!0),o[r])}u.push(o),s.push(e.morphTargetInfluences[i]),void 0!==e.morphTargetDictionary&&r.push(n[i])}o.weights=s,r.length>0&&(o.extras={},o.extras.targetNames=r)}let f=Array.isArray(e.material);if(f&&0===a.groups.length)return null;let g=!1;if(f&&null===a.index){let e=[];for(let t=0,s=a.attributes.position.count;t<s;t++)e[t]=t;a.setIndex(e),g=!0}let d=f?e.material:[e.material],T=f?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,s=T.length;e<s;e++){let s={mode:i,attributes:l};if(this.serializeUserData(a,s),u.length>0&&(s.targets=u),null!==a.index){let r=this.getUID(a.index);(void 0!==T[e].start||void 0!==T[e].count)&&(r+=":"+T[e].start+":"+T[e].count),t.attributes.has(r)?s.indices=t.attributes.get(r):(s.indices=this.processAccessor(a.index,a,T[e].start,T[e].count),t.attributes.set(r,s.indices)),null===s.indices&&delete s.indices}let r=this.processMaterial(d[T[e].materialIndex]);null!==r&&(s.material=r),c.push(s)}!0===g&&a.setIndex(null),o.primitives=c,s.meshes||(s.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,o)}));let y=s.meshes.push(o)-1;return t.meshes.set(n,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[Q])return;let s;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");let r=e.split("_",1)[0];$e[r]&&$e[r].includes(s)&&(this.extensionsUsed[Q]=!0,this.extensionsRequired[Q]=!0)}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let s=e.isOrthographicCamera,r={type:s?"orthographic":"perspective"};return s?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.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&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let s=this.json,r=this.nodeMap;s.animations||(s.animations=[]);let n=(e=q.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,i=[],a=[];for(let e=0;e<n.length;++e){let s=n[e],o=z.parseTrackName(s.name),l=z.findNode(t,o.nodeName),c=es[o.propertyName];if("bones"===o.objectName&&(l=!0===l.isSkinnedMesh?l.skeleton.getBoneByName(o.objectIndex):void 0),!l||!c)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',s.name),null;let u,h=1,p=s.values.length/s.times.length;c===es.morphTargetInfluences&&(p/=l.morphTargetInfluences.length),!0===s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(u="CUBICSPLINE",p/=3):u=s.getInterpolation()===ke?"STEP":"LINEAR",a.push({input:this.processAccessor(new _(s.times,h)),output:this.processAccessor(new _(s.values,p)),interpolation:u}),i.push({sampler:a.length-1,target:{node:r.get(l),path:c}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:a,channels:i}),s.animations.length-1}processSkin(e){let t=this.json,s=this.nodeMap,r=t.nodes[s.get(e)],n=e.skeleton;if(void 0===n)return null;let i=e.skeleton.bones[0];if(void 0===i)return null;let a=[],o=new Float32Array(16*n.bones.length),l=new W;for(let t=0;t<n.bones.length;++t)a.push(s.get(n.bones[t])),l.copy(n.boneInverses[t]),l.multiply(e.bindMatrix).toArray(o,16*t);return void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new _(o,16)),joints:a,skeleton:s.get(i)}),r.skin=t.skins.length-1}processNode(e){let t=this.json,s=this.options,r=this.nodeMap;t.nodes||(t.nodes=[]);let n={};if(s.trs){let t=e.quaternion.toArray(),s=e.position.toArray(),r=e.scale.toArray();F(t,[0,0,0,1])||(n.rotation=t),F(s,[0,0,0])||(n.translation=s),F(r,[1,1,1])||(n.scale=r)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===ds(e.matrix)&&(n.matrix=e.matrix.elements);if(""!==e.name&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){let t=this.processMesh(e);null!==t&&(n.mesh=t)}else e.isCamera&&(n.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let t=[];for(let r=0,n=e.children.length;r<n;r++){let n=e.children[r];if(n.visible||!1===s.onlyVisible){let e=this.processNode(n);null!==e&&t.push(e)}}t.length>0&&(n.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,n)}));let i=t.nodes.push(n)-1;return r.set(e,i),i}processScene(e){let t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);let n=[];for(let t=0,r=e.children.length;t<r;t++){let r=e.children[t];if(r.visible||!1===s.onlyVisible){let e=this.processNode(r);null!==e&&n.push(e)}}n.length>0&&(r.nodes=n),this.serializeUserData(e,r)}processObjects(e){let t=new P;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));let s=[];for(let t=0;t<e.length;t++)e[t]instanceof P?this.processScene(e[t]):s.push(e[t]);s.length>0&&this.processObjects(s);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}};T(de,"GLTFWriter");var $=de,ge=class{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);let s=this.writer,r=s.json,n=s.extensionsUsed,i={};e.name&&(i.name=e.name),i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight?i.type="directional":e.isPointLight?(i.type="point",e.distance>0&&(i.range=e.distance)):e.isSpotLight&&(i.type="spot",e.distance>0&&(i.range=e.distance),i.spot={},i.spot.innerConeAngle=(1-e.penumbra)*e.angle,i.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||-1!==e.target.position.z)&&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."),n[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},n[this.name]=!0);let a=r.extensions[this.name].lights;a.push(i),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}};T(ge,"GLTFLightExtension");var ee=ge,xe=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let s=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}};T(xe,"GLTFMaterialsUnlitExtension");var se=xe,me=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(t,e.clearcoatMap),n.clearcoatTexture=t}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(t,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};s.applyTextureTransform(t,e.clearcoatNormalMap),n.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(me,"GLTFMaterialsClearcoatExtension");var te=me,Te=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(t,e.iridescenceMap),n.iridescenceTexture=t}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(t,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Te,"GLTFMaterialsIridescenceExtension");var ne=Te,ye=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){let t={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(t,e.transmissionMap),n.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(ye,"GLTFMaterialsTransmissionExtension");var re=ye,we=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){let t={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(t,e.thicknessMap),n.thicknessTexture=t}n.attenuationDistance=e.attenuationDistance,n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(we,"GLTFMaterialsVolumeExtension");var ie=we,Me=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;let s=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}};T(Me,"GLTFMaterialsIorExtension");var oe=Me,Ie=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(cs)&&!e.specularIntensityMap&&!e.specularColorMap)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.specularIntensityMap){let t={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(t,e.specularIntensityMap),n.specularTexture=t}if(e.specularColorMap){let t={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(t,e.specularColorMap),n.specularColorTexture=t}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Ie,"GLTFMaterialsSpecularExtension");var ae=Ie,Ae=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.sheenRoughnessMap){let t={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(t,e.sheenRoughnessMap),n.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(t,e.sheenColorMap),n.sheenColorTexture=t}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Ae,"GLTFMaterialsSheenExtension");var ce=Ae,Re=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.anisotropyMap){let t={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(t,e.anisotropyMap),n.anisotropyTexture=t}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Re,"GLTFMaterialsAnisotropyExtension");var ue=Re,Ee=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;let s=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}};T(Ee,"GLTFMaterialsEmissiveStrengthExtension");var le=Ee,be=class{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.bumpScale&&!e.bumpMap)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.bumpMap){let t={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(t,e.bumpMap),n.bumpTexture=t}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(be,"GLTFMaterialsBumpExtension");var fe=be,Ne=class{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;let s=this.writer,r=e,n=new Float32Array(3*r.count),i=new Float32Array(4*r.count),a=new Float32Array(3*r.count),o=new W,l=new D,c=new Ye,u=new D;for(let e=0;e<r.count;e++)r.getMatrixAt(e,o),o.decompose(l,c,u),l.toArray(n,3*e),c.toArray(i,4*e),u.toArray(a,3*e);let h={TRANSLATION:s.processAccessor(new _(n,3)),ROTATION:s.processAccessor(new _(i,4)),SCALE:s.processAccessor(new _(a,3))};r.instanceColor&&(h._COLOR_0=s.processAccessor(r.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:h},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}};T(Ne,"GLTFMeshGpuInstancing");var he=Ne;q.Utils={insertKeyframe:function(e,t){let s,r=e.getValueSize(),n=new e.TimeBufferType(e.times.length+1),i=new e.ValueBufferType(e.values.length+r),a=e.createInterpolant(new e.ValueBufferType(r));if(0===e.times.length){n[0]=t;for(let e=0;e<r;e++)i[e]=0;s=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<.001)return 0;n[0]=t,n.set(e.times,1),i.set(a.evaluate(t),0),i.set(e.values,r),s=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;n[n.length-1]=t,n.set(e.times,0),i.set(e.values,0),i.set(a.evaluate(t),e.values.length),s=n.length-1}else for(let o=0;o<e.times.length;o++){if(Math.abs(e.times[o]-t)<.001)return o;if(e.times[o]<t&&e.times[o+1]>t){n.set(e.times.slice(0,o+1),0),n[o+1]=t,n.set(e.times.slice(o+1),o+2),i.set(e.values.slice(0,(o+1)*r),0),i.set(a.evaluate(t),(o+1)*r),i.set(e.values.slice((o+1)*r),(o+2)*r),s=o+1;break}}return e.times=n,e.values=i,s},mergeMorphTargetTracks:function(e,t){let s=[],r={},n=e.tracks;for(let e=0;e<n.length;++e){let i=n[e],a=z.parseTrackName(i.name),o=z.findNode(t,a.nodeName);if("morphTargetInfluences"!==a.propertyName||void 0===a.propertyIndex){s.push(i);continue}if(i.createInterpolant!==i.InterpolantFactoryMethodDiscrete&&i.createInterpolant!==i.InterpolantFactoryMethodLinear){if(i.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."),i=i.clone(),i.setInterpolation(He)}let l,c=o.morphTargetInfluences.length,u=o.morphTargetDictionary[a.propertyIndex];if(void 0===u)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);if(void 0===r[o.uuid]){l=i.clone();let e=new l.ValueBufferType(c*l.times.length);for(let t=0;t<l.times.length;t++)e[t*c+u]=l.values[t];l.name=(a.nodeName||"")+".morphTargetInfluences",l.values=e,r[o.uuid]=l,s.push(l);continue}let h=i.createInterpolant(new i.ValueBufferType(1));l=r[o.uuid];for(let e=0;e<l.times.length;e++)l.values[e*c+u]=h.evaluate(l.times[e]);for(let e=0;e<i.times.length;e++){let t=this.insertKeyframe(l,i.times[e]);l.values[t*c+u]=i.values[e]}}return e.tracks=s,e}};export{q as GLTFExporter};
1
+ import{$ as _,A as He,D as Ve,E as V,L as G,N as Ge,Oa as z,Pa as Ze,R as Ye,S as D,V as W,Y as Ke,ba as je,da as qe,e as _e,fa as Xe,ha as We,i as Ce,j as Ue,k as ve,l as Le,m as Oe,ma as Je,n as De,o as Pe,oa as P,p as ze,q as Be,va as Y,w as Fe,wa as Qe,z as ke}from"./chunk-7YAKONSF.js";import{a as H}from"./chunk-AXGI3N6R.js";import{a as T}from"./chunk-ZRT45YCM.js";var B,J,U,K;function j(e,t=1/0,s=null){J||(J=new We(2,2,1,1)),U||(U=new qe({uniforms:{blitTexture:new Ze(e)},vertexShader:"\n\t\t\tvarying vec2 vUv;\n\t\t\tvoid main(){\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = vec4(position.xy * 1.0,0.,.999999);\n\t\t\t}",fragmentShader:"\n\t\t\tuniform sampler2D blitTexture; \n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main(){ \n\t\t\t\tgl_FragColor = vec4(vUv.xy, 0, 1);\n\t\t\t\t\n\t\t\t\t#ifdef IS_SRGB\n\t\t\t\tgl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n\t\t\t\t#else\n\t\t\t\tgl_FragColor = texture2D( blitTexture, vUv);\n\t\t\t\t#endif\n\t\t\t}"})),U.uniforms.blitTexture.value=e,U.defines.IS_SRGB=e.colorSpace==V,U.needsUpdate=!0,K||((K=new je(J,U)).frustrumCulled=!1);let r=new Xe,n=new P;n.add(K),null===s&&(s=B=new Je({antialias:!1}));let i=Math.min(e.image.width,t),a=Math.min(e.image.height,t);s.setSize(i,a),s.clear(),s.render(n,r);let o=document.createElement("canvas"),l=o.getContext("2d");o.width=i,o.height=a,l.drawImage(s.domElement,0,0,i,a);let c=new Qe(o);return c.minFilter=e.minFilter,c.magFilter=e.magFilter,c.wrapS=e.wrapS,c.wrapT=e.wrapT,c.name=e.name,B&&(B.forceContextLoss(),B.dispose(),B=null),c}H(),H(),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{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-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,r){let n=new $,i=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)i.push(this.pluginCallbacks[e](n));n.setPlugins(i),n.write(e,t,r).catch(s)}parseAsync(e,t){let s=this;return new Promise((function(r,n){s.parse(e,r,n,t)}))}};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(e,t){return e.length===t.length&&e.every((function(e,s){return e===t[s]}))}function ps(e){return(new TextEncoder).encode(e).buffer}function ds(e){return F(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function gs(e,t,s){let r={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=t;n<t+s;n++)for(let t=0;t<e.itemSize;t++){let s;e.itemSize>4?s=e.array[n*e.itemSize+t]:(0===t?s=e.getX(n):1===t?s=e.getY(n):2===t?s=e.getZ(n):3===t&&(s=e.getW(n)),!0===e.normalized&&(s=G.normalize(s,e.array))),r.min[t]=Math.min(r.min[t],s),r.max[t]=Math.max(r.max[t],s)}return r}function is(e){return 4*Math.ceil(e/4)}function Z(e,t=0){let s=is(e.byteLength);if(s!==e.byteLength){let r=new Uint8Array(s);if(r.set(new Uint8Array(e)),0!==t)for(let n=e.byteLength;n<s;n++)r[n]=t;return r.buffer}return e}function ns(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function rs(e,t){if(void 0!==e.toBlob)return new Promise((s=>e.toBlob(s,t)));let s;return"image/jpeg"===t?s=.92:"image/webp"===t&&(s=.8),e.convertToBlob({type:t,quality:s})}T(F,"equalArray"),T(ps,"stringToArrayBuffer"),T(ds,"isIdentityMatrix"),T(gs,"getMinMax"),T(is,"getPaddedBufferSize"),T(Z,"getPaddedArrayBuffer"),T(ns,"getCanvas"),T(rs,"getToBlobPromise");var de=class{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,t,s={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let r=this,n=r.buffers,i=r.json;s=r.options;let a=r.extensionsUsed,o=r.extensionsRequired,l=new Blob(n,{type:"application/octet-stream"}),c=Object.keys(a),u=Object.keys(o);if(c.length>0&&(i.extensionsUsed=c),u.length>0&&(i.extensionsRequired=u),i.buffers&&i.buffers.length>0&&(i.buffers[0].byteLength=l.size),!0===s.binary){let e=new FileReader;e.readAsArrayBuffer(l),e.onloadend=function(){let s=Z(e.result),r=new DataView(new ArrayBuffer(ts));r.setUint32(0,s.byteLength,!0),r.setUint32(4,hs,!0);let n=Z(ps(JSON.stringify(i)),32),a=new DataView(new ArrayBuffer(ts));a.setUint32(0,n.byteLength,!0),a.setUint32(4,fs,!0);let o=new ArrayBuffer(ss),l=new DataView(o);l.setUint32(0,us,!0),l.setUint32(4,ls,!0);let c=ss+a.byteLength+n.byteLength+r.byteLength+s.byteLength;l.setUint32(8,c,!0);let u=new Blob([o,a,n,r,s],{type:"application/octet-stream"}),h=new FileReader;h.readAsArrayBuffer(u),h.onloadend=function(){t(h.result)}}}else if(i.buffers&&i.buffers.length>0){let e=new FileReader;e.readAsDataURL(l),e.onloadend=function(){let s=e.result;i.buffers[0].uri=s,t(i)}}else t(i)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let s=this.options,r=this.extensionsUsed;try{let n=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&n.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(let e in n.gltfExtensions)t.extensions[e]=n.gltfExtensions[e],r[e]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){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(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new D;for(let s=0,r=e.count;s<r;s++)if(Math.abs(t.fromBufferAttribute(e,s).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let s=e.clone(),r=new D;for(let e=0,t=s.count;e<t;e++)r.fromBufferAttribute(s,e),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),s.setXYZ(e,r.x,r.y,r.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1,r={};(0!==t.offset.x||0!==t.offset.y)&&(r.offset=t.offset.toArray(),s=!0),0!==t.rotation&&(r.rotation=t.rotation,s=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(r.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=r,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(e){return e.colorSpace===V?T((function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}),"SRGBToLinear"):T((function(e){return e}),"LinearToLinear")}T(s,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Y&&(e=j(e)),t instanceof Y&&(t=j(t));let r=e?e.image:null,n=t?t.image:null,i=Math.max(r?r.width:0,n?n.width:0),a=Math.max(r?r.height:0,n?n.height:0),o=ns();o.width=i,o.height=a;let l=o.getContext("2d");l.fillStyle="#00ffff",l.fillRect(0,0,i,a);let c=l.getImageData(0,0,i,a);if(r){l.drawImage(r,0,0,i,a);let t=s(e),n=l.getImageData(0,0,i,a).data;for(let e=2;e<n.length;e+=4)c.data[e]=256*t(n[e]/256)}if(n){l.drawImage(n,0,0,i,a);let e=s(t),r=l.getImageData(0,0,i,a).data;for(let t=1;t<r.length;t+=4)c.data[t]=256*e(r[t]/256)}l.putImageData(c,0,0);let u=(e||t).clone();return u.source=new Ge(o),u.colorSpace=Ve,u.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),u}processBuffer(e){let t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,r,n){let i,a=this.json;switch(a.bufferViews||(a.bufferViews=[]),t){case x.BYTE:case x.UNSIGNED_BYTE:i=1;break;case x.SHORT:case x.UNSIGNED_SHORT:i=2;break;default:i=4}let o=is(r*e.itemSize*i),l=new DataView(new ArrayBuffer(o)),c=0;for(let n=s;n<s+r;n++)for(let s=0;s<e.itemSize;s++){let r;e.itemSize>4?r=e.array[n*e.itemSize+s]:(0===s?r=e.getX(n):1===s?r=e.getY(n):2===s?r=e.getZ(n):3===s&&(r=e.getW(n)),!0===e.normalized&&(r=G.normalize(r,e.array))),t===x.FLOAT?l.setFloat32(c,r,!0):t===x.INT?l.setInt32(c,r,!0):t===x.UNSIGNED_INT?l.setUint32(c,r,!0):t===x.SHORT?l.setInt16(c,r,!0):t===x.UNSIGNED_SHORT?l.setUint16(c,r,!0):t===x.BYTE?l.setInt8(c,r):t===x.UNSIGNED_BYTE&&l.setUint8(c,r),c+=i}let u={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};return void 0!==n&&(u.target=n),n===x.ARRAY_BUFFER&&(u.byteStride=e.itemSize*i),this.byteOffset+=o,a.bufferViews.push(u),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise((function(r){let n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){let e=Z(n.result),i={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,r(s.bufferViews.push(i)-1)}}))}processAccessor(e,t,s,r){let n,i=this.json;if(e.array.constructor===Float32Array)n=x.FLOAT;else if(e.array.constructor===Int32Array)n=x.INT;else if(e.array.constructor===Uint32Array)n=x.UNSIGNED_INT;else if(e.array.constructor===Int16Array)n=x.SHORT;else if(e.array.constructor===Uint16Array)n=x.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)n=x.BYTE;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);n=x.UNSIGNED_BYTE}if(void 0===s&&(s=0),(void 0===r||r===1/0)&&(r=e.count),0===r)return null;let a,o=gs(e,s,r);void 0!==t&&(a=e===t.index?x.ELEMENT_ARRAY_BUFFER:x.ARRAY_BUFFER);let l=this.processBufferView(e,n,s,r,a),c={bufferView:l.id,byteOffset:l.byteOffset,componentType:n,count:r,max:o.max,min:o.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(c.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(c)-1}processImage(e,t,s,r="image/png"){if(null!==e){let n=this,i=n.cache,a=n.json,o=n.options,l=n.pending;i.images.has(e)||i.images.set(e,{});let c=i.images.get(e),u=r+":flipY/"+s.toString();if(void 0!==c[u])return c[u];a.images||(a.images=[]);let h={mimeType:r},p=ns();p.width=Math.min(e.width,o.maxTextureSize),p.height=Math.min(e.height,o.maxTextureSize);let m=p.getContext("2d");if(!0===s&&(m.translate(0,p.height),m.scale(1,-1)),void 0!==e.data){t!==Fe&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let s=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<s.length;t+=4)s[t+0]=e.data[t+0],s[t+1]=e.data[t+1],s[t+2]=e.data[t+2],s[t+3]=e.data[t+3];m.putImageData(new ImageData(s,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))throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement or ImageBitmap.");m.drawImage(e,0,0,p.width,p.height)}!0===o.binary?l.push(rs(p,r).then((e=>n.processBufferViewImage(e))).then((e=>{h.bufferView=e}))):void 0!==p.toDataURL?h.uri=p.toDataURL(r):l.push(rs(p,r).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{h.uri=e})));let f=a.images.push(h)-1;return c[u]=f,f}throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let s={magFilter:b[e.magFilter],minFilter:b[e.minFilter],wrapS:b[e.wrapS],wrapT:b[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){let t=this.options,s=this.cache,r=this.json;if(s.textures.has(e))return s.textures.get(e);r.textures||(r.textures=[]),e instanceof Y&&(e=j(e,t.maxTextureSize));let n=e.userData.mimeType;"image/webp"===n&&(n="image/png");let i={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(i.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,i)}));let a=r.textures.push(i)-1;return s.textures.set(e,a),a}processMaterial(e){let t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);let r={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let n=e.color.toArray().concat([e.opacity]);if(F(n,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),s={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(s,t),r.pbrMetallicRoughness.metallicRoughnessTexture=s}if(e.map){let t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===_e&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,r)}));let i=s.materials.push(r)-1;return t.materials.set(e,i),i}processMesh(e){let t=this.cache,s=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,s=e.material.length;t<s;t++)r.push(e.material[t].uuid);else r.push(e.material.uuid);let n=r.join(":");if(t.meshes.has(n))return t.meshes.get(n);let i,a=e.geometry;i=e.isLineSegments?x.LINES:e.isLineLoop?x.LINE_LOOP:e.isLine?x.LINE_STRIP:e.isPoints?x.POINTS:e.material.wireframe?x.LINES:x.TRIANGLES;let o={},l={},c=[],u=[],h={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},p=a.getAttribute("normal");void 0!==p&&!this.isNormalizedNormalAttribute(p)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(p)));let m=null;for(let e in a.attributes){if("morph"===e.slice(0,5))continue;let s=a.attributes[e];if(e=h[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),t.attributes.has(this.getUID(s))){l[e]=t.attributes.get(this.getUID(s));continue}m=null;let r=s.array;"JOINTS_0"===e&&!(r instanceof Uint16Array)&&!(r instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),m=new _(new Uint16Array(r),s.itemSize,s.normalized));let n=this.processAccessor(m||s,a);null!==n&&(e.startsWith("_")||this.detectMeshQuantization(e,s),l[e]=n,t.attributes.set(this.getUID(s),n))}if(void 0!==p&&a.setAttribute("normal",p),0===Object.keys(l).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let s=[],r=[],n={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)n[e.morphTargetDictionary[t]]=t;for(let i=0;i<e.morphTargetInfluences.length;++i){let o={},l=!1;for(let e in a.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}let s=a.morphAttributes[e][i],r=e.toUpperCase(),n=a.attributes[e];if(t.attributes.has(this.getUID(s,!0))){o[r]=t.attributes.get(this.getUID(s,!0));continue}let c=s.clone();if(!a.morphTargetsRelative)for(let e=0,t=s.count;e<t;e++)for(let t=0;t<s.itemSize;t++)0===t&&c.setX(e,s.getX(e)-n.getX(e)),1===t&&c.setY(e,s.getY(e)-n.getY(e)),2===t&&c.setZ(e,s.getZ(e)-n.getZ(e)),3===t&&c.setW(e,s.getW(e)-n.getW(e));o[r]=this.processAccessor(c,a),t.attributes.set(this.getUID(n,!0),o[r])}u.push(o),s.push(e.morphTargetInfluences[i]),void 0!==e.morphTargetDictionary&&r.push(n[i])}o.weights=s,r.length>0&&(o.extras={},o.extras.targetNames=r)}let f=Array.isArray(e.material);if(f&&0===a.groups.length)return null;let g=!1;if(f&&null===a.index){let e=[];for(let t=0,s=a.attributes.position.count;t<s;t++)e[t]=t;a.setIndex(e),g=!0}let d=f?e.material:[e.material],T=f?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,s=T.length;e<s;e++){let s={mode:i,attributes:l};if(this.serializeUserData(a,s),u.length>0&&(s.targets=u),null!==a.index){let r=this.getUID(a.index);(void 0!==T[e].start||void 0!==T[e].count)&&(r+=":"+T[e].start+":"+T[e].count),t.attributes.has(r)?s.indices=t.attributes.get(r):(s.indices=this.processAccessor(a.index,a,T[e].start,T[e].count),t.attributes.set(r,s.indices)),null===s.indices&&delete s.indices}let r=this.processMaterial(d[T[e].materialIndex]);null!==r&&(s.material=r),c.push(s)}!0===g&&a.setIndex(null),o.primitives=c,s.meshes||(s.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,o)}));let y=s.meshes.push(o)-1;return t.meshes.set(n,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[Q])return;let s;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");let r=e.split("_",1)[0];$e[r]&&$e[r].includes(s)&&(this.extensionsUsed[Q]=!0,this.extensionsRequired[Q]=!0)}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let s=e.isOrthographicCamera,r={type:s?"orthographic":"perspective"};return s?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.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&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let s=this.json,r=this.nodeMap;s.animations||(s.animations=[]);let n=(e=q.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,i=[],a=[];for(let e=0;e<n.length;++e){let s=n[e],o=z.parseTrackName(s.name),l=z.findNode(t,o.nodeName),c=es[o.propertyName];if("bones"===o.objectName&&(l=!0===l.isSkinnedMesh?l.skeleton.getBoneByName(o.objectIndex):void 0),!l||!c)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',s.name),null;let u,h=1,p=s.values.length/s.times.length;c===es.morphTargetInfluences&&(p/=l.morphTargetInfluences.length),!0===s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(u="CUBICSPLINE",p/=3):u=s.getInterpolation()===ke?"STEP":"LINEAR",a.push({input:this.processAccessor(new _(s.times,h)),output:this.processAccessor(new _(s.values,p)),interpolation:u}),i.push({sampler:a.length-1,target:{node:r.get(l),path:c}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:a,channels:i}),s.animations.length-1}processSkin(e){let t=this.json,s=this.nodeMap,r=t.nodes[s.get(e)],n=e.skeleton;if(void 0===n)return null;let i=e.skeleton.bones[0];if(void 0===i)return null;let a=[],o=new Float32Array(16*n.bones.length),l=new W;for(let t=0;t<n.bones.length;++t)a.push(s.get(n.bones[t])),l.copy(n.boneInverses[t]),l.multiply(e.bindMatrix).toArray(o,16*t);return void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new _(o,16)),joints:a,skeleton:s.get(i)}),r.skin=t.skins.length-1}processNode(e){let t=this.json,s=this.options,r=this.nodeMap;t.nodes||(t.nodes=[]);let n={};if(s.trs){let t=e.quaternion.toArray(),s=e.position.toArray(),r=e.scale.toArray();F(t,[0,0,0,1])||(n.rotation=t),F(s,[0,0,0])||(n.translation=s),F(r,[1,1,1])||(n.scale=r)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===ds(e.matrix)&&(n.matrix=e.matrix.elements);if(""!==e.name&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){let t=this.processMesh(e);null!==t&&(n.mesh=t)}else e.isCamera&&(n.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let t=[];for(let r=0,n=e.children.length;r<n;r++){let n=e.children[r];if(n.visible||!1===s.onlyVisible){let e=this.processNode(n);null!==e&&t.push(e)}}t.length>0&&(n.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,n)}));let i=t.nodes.push(n)-1;return r.set(e,i),i}processScene(e){let t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);let n=[];for(let t=0,r=e.children.length;t<r;t++){let r=e.children[t];if(r.visible||!1===s.onlyVisible){let e=this.processNode(r);null!==e&&n.push(e)}}n.length>0&&(r.nodes=n),this.serializeUserData(e,r)}processObjects(e){let t=new P;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));let s=[];for(let t=0;t<e.length;t++)e[t]instanceof P?this.processScene(e[t]):s.push(e[t]);s.length>0&&this.processObjects(s);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}};T(de,"GLTFWriter");var $=de,ge=class{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);let s=this.writer,r=s.json,n=s.extensionsUsed,i={};e.name&&(i.name=e.name),i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight?i.type="directional":e.isPointLight?(i.type="point",e.distance>0&&(i.range=e.distance)):e.isSpotLight&&(i.type="spot",e.distance>0&&(i.range=e.distance),i.spot={},i.spot.innerConeAngle=(1-e.penumbra)*e.angle,i.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||-1!==e.target.position.z)&&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."),n[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},n[this.name]=!0);let a=r.extensions[this.name].lights;a.push(i),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}};T(ge,"GLTFLightExtension");var ee=ge,xe=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let s=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}};T(xe,"GLTFMaterialsUnlitExtension");var se=xe,me=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(t,e.clearcoatMap),n.clearcoatTexture=t}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(t,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};s.applyTextureTransform(t,e.clearcoatNormalMap),n.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(me,"GLTFMaterialsClearcoatExtension");var te=me,Te=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(t,e.iridescenceMap),n.iridescenceTexture=t}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(t,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Te,"GLTFMaterialsIridescenceExtension");var ne=Te,ye=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){let t={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(t,e.transmissionMap),n.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(ye,"GLTFMaterialsTransmissionExtension");var re=ye,we=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){let t={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(t,e.thicknessMap),n.thicknessTexture=t}n.attenuationDistance=e.attenuationDistance,n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(we,"GLTFMaterialsVolumeExtension");var ie=we,Me=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;let s=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}};T(Me,"GLTFMaterialsIorExtension");var oe=Me,Ie=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(cs)&&!e.specularIntensityMap&&!e.specularColorMap)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.specularIntensityMap){let t={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(t,e.specularIntensityMap),n.specularTexture=t}if(e.specularColorMap){let t={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(t,e.specularColorMap),n.specularColorTexture=t}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Ie,"GLTFMaterialsSpecularExtension");var ae=Ie,Ae=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.sheenRoughnessMap){let t={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(t,e.sheenRoughnessMap),n.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(t,e.sheenColorMap),n.sheenColorTexture=t}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Ae,"GLTFMaterialsSheenExtension");var ce=Ae,Re=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.anisotropyMap){let t={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(t,e.anisotropyMap),n.anisotropyTexture=t}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(Re,"GLTFMaterialsAnisotropyExtension");var ue=Re,Ee=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;let s=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}};T(Ee,"GLTFMaterialsEmissiveStrengthExtension");var le=Ee,be=class{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.bumpScale&&!e.bumpMap)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.bumpMap){let t={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(t,e.bumpMap),n.bumpTexture=t}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}};T(be,"GLTFMaterialsBumpExtension");var fe=be,Ne=class{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;let s=this.writer,r=e,n=new Float32Array(3*r.count),i=new Float32Array(4*r.count),a=new Float32Array(3*r.count),o=new W,l=new D,c=new Ye,u=new D;for(let e=0;e<r.count;e++)r.getMatrixAt(e,o),o.decompose(l,c,u),l.toArray(n,3*e),c.toArray(i,4*e),u.toArray(a,3*e);let h={TRANSLATION:s.processAccessor(new _(n,3)),ROTATION:s.processAccessor(new _(i,4)),SCALE:s.processAccessor(new _(a,3))};r.instanceColor&&(h._COLOR_0=s.processAccessor(r.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:h},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}};T(Ne,"GLTFMeshGpuInstancing");var he=Ne;q.Utils={insertKeyframe:function(e,t){let s,r=e.getValueSize(),n=new e.TimeBufferType(e.times.length+1),i=new e.ValueBufferType(e.values.length+r),a=e.createInterpolant(new e.ValueBufferType(r));if(0===e.times.length){n[0]=t;for(let e=0;e<r;e++)i[e]=0;s=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<.001)return 0;n[0]=t,n.set(e.times,1),i.set(a.evaluate(t),0),i.set(e.values,r),s=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;n[n.length-1]=t,n.set(e.times,0),i.set(e.values,0),i.set(a.evaluate(t),e.values.length),s=n.length-1}else for(let o=0;o<e.times.length;o++){if(Math.abs(e.times[o]-t)<.001)return o;if(e.times[o]<t&&e.times[o+1]>t){n.set(e.times.slice(0,o+1),0),n[o+1]=t,n.set(e.times.slice(o+1),o+2),i.set(e.values.slice(0,(o+1)*r),0),i.set(a.evaluate(t),(o+1)*r),i.set(e.values.slice((o+1)*r),(o+2)*r),s=o+1;break}}return e.times=n,e.values=i,s},mergeMorphTargetTracks:function(e,t){let s=[],r={},n=e.tracks;for(let e=0;e<n.length;++e){let i=n[e],a=z.parseTrackName(i.name),o=z.findNode(t,a.nodeName);if("morphTargetInfluences"!==a.propertyName||void 0===a.propertyIndex){s.push(i);continue}if(i.createInterpolant!==i.InterpolantFactoryMethodDiscrete&&i.createInterpolant!==i.InterpolantFactoryMethodLinear){if(i.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."),i=i.clone(),i.setInterpolation(He)}let l,c=o.morphTargetInfluences.length,u=o.morphTargetDictionary[a.propertyIndex];if(void 0===u)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);if(void 0===r[o.uuid]){l=i.clone();let e=new l.ValueBufferType(c*l.times.length);for(let t=0;t<l.times.length;t++)e[t*c+u]=l.values[t];l.name=(a.nodeName||"")+".morphTargetInfluences",l.values=e,r[o.uuid]=l,s.push(l);continue}let h=i.createInterpolant(new i.ValueBufferType(1));l=r[o.uuid];for(let e=0;e<l.times.length;e++)l.values[e*c+u]=h.evaluate(l.times[e]);for(let e=0;e<i.times.length;e++){let t=this.insertKeyframe(l,i.times[e]);l.values[t*c+u]=i.values[e]}}return e.tracks=s,e}};export{q as GLTFExporter};
@@ -1 +1 @@
1
- import{L as C}from"./chunk-FE4M476A.js";import{a as S}from"./chunk-SAYKHSRQ.js";import{a as o,f as e}from"./chunk-ZRT45YCM.js";S();var F,y,P=class{constructor(t){e(this,"_currentStats",{fps:0,ms:0,mb:0}),e(this,"view"),e(this,"timer"),e(this,"counter"),e(this,"onFPSChangeArray"),e(this,"onFPSChangeIndex"),e(this,"lastFPS",0),e(this,"SECONDS_TO_DECIDE",3),e(this,"MIN_FPS",38),e(this,"CRITICAL_FPS",24),e(this,"MAX_FPS",120),e(this,"MAX_MS",200),e(this,"MAX_MB",((null==(y=null==(F=window.performance)?void 0:F.memory)?void 0:y.jsHeapSizeLimit)||1/0)/1048576),e(this,"updateMappedinDevtools",o((()=>{let t="__MAPPEDIN_DEVTOOLS__";window[t]=window[t]||{};let e=window[t];e.showPerformancePanelArray=e.showPerformancePanelArray||[],e.hidePerformancePanelArray=e.hidePerformancePanelArray||[],e.showPerformancePanelArray.push((()=>this.showPerformancePanel())),e.hidePerformancePanelArray.push((()=>this.hidePerformancePanel()))}),"updateMappedinDevtools"));let{MAX_FPS:i,MAX_MS:s,MAX_MB:n}=this,a={fps:i,ms:s,mb:n};this.view=new d(t.debug,t.container,a),this.timer=new c,this.counter=new u,this.onFPSChangeArray=t.onFPSChangeArray,this.onFPSChangeIndex=t.dynamicPerformance?t.onFPSChangeArray.length:-1,this.updateMappedinDevtools()}static getDefaultOnFPSChangeArray(t){let{effectComposer:e}=t.renderer.implementation;return[()=>{null==e||e.setAntialiasConfiguration({antialias:!1}),t.paths.pathSegments.forEach((({arrowAnimationTween:t})=>{t.stop()}));for(let e in t.polygonMeshesById){let{material:i}=t.polygonMeshesById[e];i.map&&(i.map.anisotropy=1,i.needsUpdate=!0)}t.tryRendering()},()=>{null==e||e.setAmbientOcclusionConfiguration({aoEnabled:!1}),t.tryRendering()}]}updateStats(t){var e,i;let s=(null==(i=null==(e=window.performance)?void 0:e.memory)?void 0:i.usedJSHeapSize)||0;this._currentStats.fps=Math.min(t,this.MAX_FPS),this._currentStats.ms=Math.min(1e3/t,this.MAX_MS),this._currentStats.mb=Math.min(s/1048576,this.MAX_MB),this.view.updatePanels(this._currentStats)}isFPSSpiked(t){return Math.abs(this.lastFPS-t)/this.lastFPS>.1}updateOnFPSChangeIndex(t,e){let i=this.onFPSChangeIndex;return e&&i>0?i=0:t&&(i-=1),this.onFPSChangeIndex=C.clamp(i,-1,this.onFPSChangeArray.length),this.onFPSChangeIndex}handleFPSChange(t,e){let i=this.onFPSChangeIndex,s=this.updateOnFPSChangeIndex(t,e),n=this.onFPSChangeArray[s];!n||s===i||n(this.currentStats)}update(){let{fps:t,duration:e}=this.timer.update();if(e>=1e3){if(!this.isFPSSpiked(t)){let{lowFPS:e,criticalFPS:i}=this.counter.update(t,this.MIN_FPS,this.CRITICAL_FPS,this.SECONDS_TO_DECIDE);this.updateStats(t),this.handleFPSChange(e,i)}this.lastFPS=t,this.timer.reset()}}get currentStats(){return{...this._currentStats}}get dom(){return this.view.dom}hidePerformancePanel(){this.view.hidePerformancePanel()}showPerformancePanel(){this.view.showPerformancePanel()}};o(P,"PerformanceController");var b=P,m=class{constructor(){e(this,"beginTime",performance.now()),e(this,"frames",0),e(this,"duration",0)}reset(){this.duration=0,this.frames=0}update(){let t=performance.now(),e=t-this.beginTime;return this.frames++,this.duration+=e,this.beginTime=t,{duration:this.duration,fps:this.frames/(this.duration/1e3)}}};o(m,"PerformanceTimer");var c=m,f=class{constructor(){e(this,"criticalFpsCounter",0),e(this,"lowFpsCounter",0),e(this,"highFpsCounter",0)}update(t,e,i,s){let n=t<e,a=t<i;return this.criticalFpsCounter=a?this.criticalFpsCounter+1:0,this.lowFpsCounter=n?this.lowFpsCounter+1:0,this.highFpsCounter=n?0:this.highFpsCounter+1,this.lowFpsCounter===s?(this.lowFpsCounter=0,this.criticalFpsCounter===s?(this.criticalFpsCounter=0,{lowFPS:!0,highFPS:!1,criticalFPS:!0}):{lowFPS:!0,highFPS:!1,criticalFPS:!1}):this.highFpsCounter===s?(this.highFpsCounter=0,{lowFPS:!1,highFPS:!0,criticalFPS:!1}):(n?this.highFpsCounter=0:(this.lowFpsCounter=0,this.criticalFpsCounter=0),{lowFPS:!1,highFPS:!1,criticalFPS:!1})}};o(f,"PerformanceCounter");var u=f,g=class{constructor(t,i,s){var n;e(this,"mode",-1),e(this,"panels",[]),e(this,"appContainer"),e(this,"maxValues"),e(this,"debug"),e(this,"stats"),e(this,"container"),this.debug=t,this.appContainer=i,this.maxValues=s,this.container=this.createContainer(),this.addPanel(new l({name:"FPS",foregroundColor:"#0ff",backgroundColor:"#002"})),this.addPanel(new l({name:"MS",foregroundColor:"#0f0",backgroundColor:"#020"})),null!=(n=window.performance)&&n.memory&&this.addPanel(new l({name:"MB",foregroundColor:"#f08",backgroundColor:"#201"})),this.debug&&this.showPerformancePanel()}createContainer(){let t=document.createElement("div");return t.style.cssText="position:absolute;top:0;right:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",(t=>{t.preventDefault(),this.showPanel(++this.mode%this.panels.length)})),t}addPanel(t){this.panels.push(t),this.container.appendChild(t.dom)}showPanel(t){this.panels.forEach(((e,i)=>{e.dom.style.display=i===t?"block":"none"})),this.mode=t}hidePerformancePanel(){this.container.parentNode&&(this.debug=!1,this.appContainer.removeChild(this.container))}showPerformancePanel(){this.container.parentNode||(this.debug=!0,this.stats&&this.updatePanels(this.stats),this.appContainer.appendChild(this.container))}updatePanels(t){this.stats=t,this.debug&&this.panels.forEach(((e,i)=>{0===i?e.update(t.fps,this.maxValues.fps):1===i?e.update(t.ms,this.maxValues.ms):2===i&&e.update(t.mb,this.maxValues.mb)}))}get dom(){return this.container}};o(g,"PerformanceView");var d=g,v=class{constructor(t){this.config=t,e(this,"min",1/0),e(this,"max",0),e(this,"canvas"),e(this,"context"),e(this,"PR",Math.round(window.devicePixelRatio||1)),e(this,"WIDTH",80*this.PR),e(this,"HEIGHT",48*this.PR),e(this,"TEXT_X",3*this.PR),e(this,"TEXT_Y",2*this.PR),e(this,"GRAPH_X",3*this.PR),e(this,"GRAPH_Y",15*this.PR),e(this,"GRAPH_WIDTH",74*this.PR),e(this,"GRAPH_HEIGHT",30*this.PR),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.setupCanvas()}setupCanvas(){this.canvas.dataset.name=this.config.name,this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width="".concat(this.WIDTH/this.PR,"px"),this.canvas.style.height="".concat(this.HEIGHT/this.PR,"px"),this.context.font="bold ".concat(9*this.PR,"px Helvetica,Arial,sans-serif"),this.context.textBaseline="top",this.context.fillStyle=this.config.backgroundColor,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.config.foregroundColor,this.context.fillText(this.config.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.config.backgroundColor,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}get dom(){return this.canvas}update(t,e){this.min=Math.min(this.min,t),this.max=Math.max(this.max,t);let{context:i,WIDTH:s,GRAPH_Y:n,GRAPH_WIDTH:a,GRAPH_HEIGHT:h,PR:o}=this;i.fillStyle=this.config.backgroundColor,i.globalAlpha=1,i.fillRect(0,0,s,n),i.fillStyle=this.config.foregroundColor,i.fillText("".concat(Math.round(t)," ").concat(this.config.name," (").concat(Math.round(this.min),"-").concat(Math.round(this.max),")"),this.TEXT_X,this.TEXT_Y),i.drawImage(this.canvas,this.GRAPH_X+o,this.GRAPH_Y,a-o,h,this.GRAPH_X,this.GRAPH_Y,a-o,h),i.fillRect(this.GRAPH_X+a-o,this.GRAPH_Y,o,h),i.fillStyle=this.config.backgroundColor,i.globalAlpha=.9,i.fillRect(this.GRAPH_X+a-o,this.GRAPH_Y,o,Math.round((1-t/e)*h))}};o(v,"Panel");var l=v;export{b as PerformanceController,d as PerformanceView};
1
+ import{L as C}from"./chunk-7YAKONSF.js";import{a as S}from"./chunk-AXGI3N6R.js";import{a as o,f as e}from"./chunk-ZRT45YCM.js";S();var F,y,P=class{constructor(t){e(this,"_currentStats",{fps:0,ms:0,mb:0}),e(this,"view"),e(this,"timer"),e(this,"counter"),e(this,"onFPSChangeArray"),e(this,"onFPSChangeIndex"),e(this,"lastFPS",0),e(this,"SECONDS_TO_DECIDE",3),e(this,"MIN_FPS",38),e(this,"CRITICAL_FPS",24),e(this,"MAX_FPS",120),e(this,"MAX_MS",200),e(this,"MAX_MB",((null==(y=null==(F=window.performance)?void 0:F.memory)?void 0:y.jsHeapSizeLimit)||1/0)/1048576),e(this,"updateMappedinDevtools",o((()=>{let t="__MAPPEDIN_DEVTOOLS__";window[t]=window[t]||{};let e=window[t];e.showPerformancePanelArray=e.showPerformancePanelArray||[],e.hidePerformancePanelArray=e.hidePerformancePanelArray||[],e.showPerformancePanelArray.push((()=>this.showPerformancePanel())),e.hidePerformancePanelArray.push((()=>this.hidePerformancePanel()))}),"updateMappedinDevtools"));let{MAX_FPS:i,MAX_MS:s,MAX_MB:n}=this,a={fps:i,ms:s,mb:n};this.view=new d(t.debug,t.container,a),this.timer=new c,this.counter=new u,this.onFPSChangeArray=t.onFPSChangeArray,this.onFPSChangeIndex=t.dynamicPerformance?t.onFPSChangeArray.length:-1,this.updateMappedinDevtools()}static getDefaultOnFPSChangeArray(t){let{effectComposer:e}=t.renderer.implementation;return[()=>{null==e||e.setAntialiasConfiguration({antialias:!1}),t.paths.pathSegments.forEach((({arrowAnimationTween:t})=>{t.stop()}));for(let e in t.polygonMeshesById){let{material:i}=t.polygonMeshesById[e];i.map&&(i.map.anisotropy=1,i.needsUpdate=!0)}t.tryRendering()},()=>{null==e||e.setAmbientOcclusionConfiguration({aoEnabled:!1}),t.tryRendering()}]}updateStats(t){var e,i;let s=(null==(i=null==(e=window.performance)?void 0:e.memory)?void 0:i.usedJSHeapSize)||0;this._currentStats.fps=Math.min(t,this.MAX_FPS),this._currentStats.ms=Math.min(1e3/t,this.MAX_MS),this._currentStats.mb=Math.min(s/1048576,this.MAX_MB),this.view.updatePanels(this._currentStats)}isFPSSpiked(t){return Math.abs(this.lastFPS-t)/this.lastFPS>.1}updateOnFPSChangeIndex(t,e){let i=this.onFPSChangeIndex;return e&&i>0?i=0:t&&(i-=1),this.onFPSChangeIndex=C.clamp(i,-1,this.onFPSChangeArray.length),this.onFPSChangeIndex}handleFPSChange(t,e){let i=this.onFPSChangeIndex,s=this.updateOnFPSChangeIndex(t,e),n=this.onFPSChangeArray[s];!n||s===i||n(this.currentStats)}update(){let{fps:t,duration:e}=this.timer.update();if(e>=1e3){if(!this.isFPSSpiked(t)){let{lowFPS:e,criticalFPS:i}=this.counter.update(t,this.MIN_FPS,this.CRITICAL_FPS,this.SECONDS_TO_DECIDE);this.updateStats(t),this.handleFPSChange(e,i)}this.lastFPS=t,this.timer.reset()}}get currentStats(){return{...this._currentStats}}get dom(){return this.view.dom}hidePerformancePanel(){this.view.hidePerformancePanel()}showPerformancePanel(){this.view.showPerformancePanel()}};o(P,"PerformanceController");var b=P,m=class{constructor(){e(this,"beginTime",performance.now()),e(this,"frames",0),e(this,"duration",0)}reset(){this.duration=0,this.frames=0}update(){let t=performance.now(),e=t-this.beginTime;return this.frames++,this.duration+=e,this.beginTime=t,{duration:this.duration,fps:this.frames/(this.duration/1e3)}}};o(m,"PerformanceTimer");var c=m,f=class{constructor(){e(this,"criticalFpsCounter",0),e(this,"lowFpsCounter",0),e(this,"highFpsCounter",0)}update(t,e,i,s){let n=t<e,a=t<i;return this.criticalFpsCounter=a?this.criticalFpsCounter+1:0,this.lowFpsCounter=n?this.lowFpsCounter+1:0,this.highFpsCounter=n?0:this.highFpsCounter+1,this.lowFpsCounter===s?(this.lowFpsCounter=0,this.criticalFpsCounter===s?(this.criticalFpsCounter=0,{lowFPS:!0,highFPS:!1,criticalFPS:!0}):{lowFPS:!0,highFPS:!1,criticalFPS:!1}):this.highFpsCounter===s?(this.highFpsCounter=0,{lowFPS:!1,highFPS:!0,criticalFPS:!1}):(n?this.highFpsCounter=0:(this.lowFpsCounter=0,this.criticalFpsCounter=0),{lowFPS:!1,highFPS:!1,criticalFPS:!1})}};o(f,"PerformanceCounter");var u=f,g=class{constructor(t,i,s){var n;e(this,"mode",-1),e(this,"panels",[]),e(this,"appContainer"),e(this,"maxValues"),e(this,"debug"),e(this,"stats"),e(this,"container"),this.debug=t,this.appContainer=i,this.maxValues=s,this.container=this.createContainer(),this.addPanel(new l({name:"FPS",foregroundColor:"#0ff",backgroundColor:"#002"})),this.addPanel(new l({name:"MS",foregroundColor:"#0f0",backgroundColor:"#020"})),null!=(n=window.performance)&&n.memory&&this.addPanel(new l({name:"MB",foregroundColor:"#f08",backgroundColor:"#201"})),this.debug&&this.showPerformancePanel()}createContainer(){let t=document.createElement("div");return t.style.cssText="position:absolute;top:0;right:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",(t=>{t.preventDefault(),this.showPanel(++this.mode%this.panels.length)})),t}addPanel(t){this.panels.push(t),this.container.appendChild(t.dom)}showPanel(t){this.panels.forEach(((e,i)=>{e.dom.style.display=i===t?"block":"none"})),this.mode=t}hidePerformancePanel(){this.container.parentNode&&(this.debug=!1,this.appContainer.removeChild(this.container))}showPerformancePanel(){this.container.parentNode||(this.debug=!0,this.stats&&this.updatePanels(this.stats),this.appContainer.appendChild(this.container))}updatePanels(t){this.stats=t,this.debug&&this.panels.forEach(((e,i)=>{0===i?e.update(t.fps,this.maxValues.fps):1===i?e.update(t.ms,this.maxValues.ms):2===i&&e.update(t.mb,this.maxValues.mb)}))}get dom(){return this.container}};o(g,"PerformanceView");var d=g,v=class{constructor(t){this.config=t,e(this,"min",1/0),e(this,"max",0),e(this,"canvas"),e(this,"context"),e(this,"PR",Math.round(window.devicePixelRatio||1)),e(this,"WIDTH",80*this.PR),e(this,"HEIGHT",48*this.PR),e(this,"TEXT_X",3*this.PR),e(this,"TEXT_Y",2*this.PR),e(this,"GRAPH_X",3*this.PR),e(this,"GRAPH_Y",15*this.PR),e(this,"GRAPH_WIDTH",74*this.PR),e(this,"GRAPH_HEIGHT",30*this.PR),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.setupCanvas()}setupCanvas(){this.canvas.dataset.name=this.config.name,this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width="".concat(this.WIDTH/this.PR,"px"),this.canvas.style.height="".concat(this.HEIGHT/this.PR,"px"),this.context.font="bold ".concat(9*this.PR,"px Helvetica,Arial,sans-serif"),this.context.textBaseline="top",this.context.fillStyle=this.config.backgroundColor,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.config.foregroundColor,this.context.fillText(this.config.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.config.backgroundColor,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}get dom(){return this.canvas}update(t,e){this.min=Math.min(this.min,t),this.max=Math.max(this.max,t);let{context:i,WIDTH:s,GRAPH_Y:n,GRAPH_WIDTH:a,GRAPH_HEIGHT:h,PR:o}=this;i.fillStyle=this.config.backgroundColor,i.globalAlpha=1,i.fillRect(0,0,s,n),i.fillStyle=this.config.foregroundColor,i.fillText("".concat(Math.round(t)," ").concat(this.config.name," (").concat(Math.round(this.min),"-").concat(Math.round(this.max),")"),this.TEXT_X,this.TEXT_Y),i.drawImage(this.canvas,this.GRAPH_X+o,this.GRAPH_Y,a-o,h,this.GRAPH_X,this.GRAPH_Y,a-o,h),i.fillRect(this.GRAPH_X+a-o,this.GRAPH_Y,o,h),i.fillStyle=this.config.backgroundColor,i.globalAlpha=.9,i.fillRect(this.GRAPH_X+a-o,this.GRAPH_Y,o,Math.round((1-t/e)*h))}};o(v,"Panel");var l=v;export{b as PerformanceController,d as PerformanceView};
@@ -1 +1 @@
1
- import{a as hn}from"./chunk-SAYKHSRQ.js";import{a as u}from"./chunk-ZRT45YCM.js";hn();var ln={},Qn=u((function(n,t,r,e,i){var a=new Worker(ln[t]||(ln[t]=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(n){var t=n.data,r=t.$e$;if(r){var e=new Error(r[0]);e.code=r[1],e.stack=r[2],i(e,null)}else i(null,t)},a.postMessage(r,e),a}),"wk"),D=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new D([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 D([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 D([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=u((function(n,t){for(var r=new q(31),e=0;e<31;++e)r[e]=t+=1<<n[e-1];var i=new gr(r[30]);for(e=1;e<30;++e)for(var a=r[e];a<r[e+1];++a)i[a]=a-r[e]<<5|e;return[r,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=(61680&(tr=(52428&(tr=(43690&E)>>>1|(21845&E)<<1))>>>2|(13107&tr)<<2))>>>4|(3855&tr)<<4,Dr[E]=((65280&tr)>>>8|(255&tr)<<8)>>>1;var tr,X=u((function(n,t,r){for(var e=n.length,i=0,a=new q(t);i<e;++i)n[i]&&++a[n[i]-1];var o,u=new q(t);for(i=0;i<t;++i)u[i]=u[i-1]+a[i-1]<<1;if(r){o=new q(1<<t);var s=15-t;for(i=0;i<e;++i)if(n[i])for(var f=i<<4|n[i],h=t-n[i],c=u[n[i]-1]++<<h,l=c|(1<<h)-1;c<=l;++c)o[Dr[c]>>>s]=f}else for(o=new q(e),i=0;i<e;++i)n[i]&&(o[i]=Dr[u[n[i]-1]++]>>>15-n[i]);return o}),"hMap"),ir=new D(288);for(E=0;E<144;++E)ir[E]=8;for(E=144;E<256;++E)ir[E]=9;for(E=256;E<280;++E)ir[E]=7;for(E=280;E<288;++E)ir[E]=8;var cr=new D(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 t=n[0],r=1;r<n.length;++r)n[r]>t&&(t=n[r]);return t}),"max"),V=u((function(n,t,r){var e=t/8|0;return(n[e]|n[e+1]<<8)>>(7&t)&r}),"bits"),kr=u((function(n,t){var r=t/8|0;return(n[r]|n[r+1]<<8|n[r+2]<<16)>>(7&t)}),"bits16"),Sr=u((function(n){return(n+7)/8|0}),"shft"),d=u((function(n,t,r){(null==t||t<0)&&(t=0),(null==r||r>n.length)&&(r=n.length);var e=new(2==n.BYTES_PER_ELEMENT?q:4==n.BYTES_PER_ELEMENT?gr:D)(r-t);return e.set(n.subarray(t,r)),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,t,r){var e=new Error(t||Cn[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,g),!r)throw e;return e}),"err"),Cr=u((function(n,t,r){var e=n.length;if(!e||r&&r.f&&!r.l)return t||new D(0);var i=!t||r,a=!r||r.i;r||(r={}),t||(t=new D(3*e));var o=u((function(n){var r=t.length;if(n>r){var e=new D(Math.max(2*r,n));e.set(t),t=e}}),"cbuf"),s=r.f||0,f=r.p||0,h=r.b||0,c=r.l,l=r.d,p=r.m,v=r.n,y=8*e;do{if(!c){s=V(n,f,1);var m=V(n,f+1,3);if(f+=3,!m){var b=n[(N=Sr(f)+4)-4]|n[N-3]<<8,w=N+b;if(w>e){a&&g(0);break}i&&o(h+b),t.set(n.subarray(N,w),h),r.b=h+=b,r.p=f=8*w,r.f=s;continue}if(1==m)c=Un,l=Sn,p=9,v=5;else if(2==m){var z=V(n,f,31)+257,E=V(n,f+10,15)+4,I=z+V(n,f+5,31)+1;f+=14;for(var S=new D(I),k=new D(19),A=0;A<E;++A)k[Ur[A]]=V(n,f+3*A,7);f+=3*E;var M=Zr(k),x=(1<<M)-1,U=X(k,M,1);for(A=0;A<I;){var N,T=U[V(n,f,x)];if(f+=15&T,(N=T>>>4)<16)S[A++]=N;else{var C=0,F=0;for(16==N?(F=3+V(n,f,3),f+=2,C=S[A-1]):17==N?(F=3+V(n,f,7),f+=3):18==N&&(F=11+V(n,f,127),f+=7);F--;)S[A++]=C}}var Z=S.subarray(0,z),W=S.subarray(z);p=Zr(Z),v=Zr(W),c=X(Z,p,1),l=X(W,v,1)}else g(1);if(f>y){a&&g(0);break}}i&&o(h+131072);for(var q=(1<<p)-1,K=(1<<v)-1,G=f;;G=f){var _=(C=c[kr(n,f)&q])>>>4;if((f+=15&C)>y){a&&g(0);break}if(C||g(2),_<256)t[h++]=_;else{if(256==_){G=f,c=null;break}var L=_-254;if(_>264){var O=yr[A=_-257];L=V(n,f,(1<<O)-1)+dr[A],f+=O}var R=l[kr(n,f)&K],P=R>>>4;R||g(3),f+=15&R;W=Mn[P];if(P>3){O=wr[P];W+=kr(n,f)&(1<<O)-1,f+=O}if(f>y){a&&g(0);break}i&&o(h+131072);for(var $=h+L;h<$;h+=4)t[h]=t[h-W],t[h+1]=t[h+1-W],t[h+2]=t[h+2-W],t[h+3]=t[h+3-W];h=$}}r.l=c,r.p=G,r.b=h,r.f=s,c&&(s=1,r.m=p,r.d=l,r.n=v)}while(!s);return h==t.length?t:d(t,0,h)}),"inflt"),nr=u((function(n,t,r){r<<=7&t;var e=t/8|0;n[e]|=r,n[e+1]|=r>>>8}),"wbits"),hr=u((function(n,t,r){r<<=7&t;var e=t/8|0;n[e]|=r,n[e+1]|=r>>>8,n[e+2]|=r>>>16}),"wbits16"),Gr=u((function(n,t){for(var r=[],e=0;e<n.length;++e)n[e]&&r.push({s:e,f:n[e]});var i=r.length,a=r.slice();if(!i)return[er,0];if(1==i){var o=new D(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(n,t){return n.f-t.f})),r.push({s:-1,f:25001});var u=r[0],s=r[1],f=0,h=1,c=2;for(r[0]={s:-1,f:u.f+s.f,l:u,r:s};h!=i-1;)u=r[r[f].f<r[c].f?f++:c++],s=r[f!=h&&r[f].f<r[c].f?f++:c++],r[h++]={s:-1,f:u.f+s.f,l:u,r:s};var l=a[0].s;for(e=1;e<i;++e)a[e].s>l&&(l=a[e].s);var p=new q(l+1),v=Lr(r[h-1],p,0);if(v>t){e=0;var g=0,d=v-t,y=1<<d;for(a.sort((function(n,t){return p[t.s]-p[n.s]||n.f-t.f}));e<i;++e){var m=a[e].s;if(!(p[m]>t))break;g+=y-(1<<v-p[m]),p[m]=t}for(g>>>=d;g>0;){var b=a[e].s;p[b]<t?g-=1<<t-p[b]++-1:++e}for(;e>=0&&g;--e){var w=a[e].s;p[w]==t&&(--p[w],++g)}v=t}return[new D(p),v]}),"hTree"),Lr=u((function(n,t,r){return-1==n.s?Math.max(Lr(n.l,t,r+1),Lr(n.r,t,r+1)):t[n.s]=r}),"ln"),Wr=u((function(n){for(var t=n.length;t&&!n[--t];);for(var r=new q(++t),e=0,i=n[0],a=1,o=u((function(n){r[e++]=n}),"w"),s=1;s<=t;++s)if(n[s]==i&&s!=t)++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[s]}return[r.subarray(0,e),t]}),"lc"),lr=u((function(n,t){for(var r=0,e=0;e<t.length;++e)r+=n[e]*t[e];return r}),"clen"),Pr=u((function(n,t,r){var e=r.length,i=Sr(t+2);n[i]=255&e,n[i+1]=e>>>8,n[i+2]=255^n[i],n[i+3]=255^n[i+1];for(var a=0;a<e;++a)n[i+a+4]=r[a];return 8*(i+4+e)}),"wfblk"),jr=u((function(n,t,r,e,i,a,o,u,s,f,h){nr(t,h++,r),++i[256];for(var c=Gr(i,15),l=c[0],p=c[1],v=Gr(a,15),g=v[0],d=v[1],y=Wr(l),m=y[0],b=y[1],w=Wr(g),z=w[0],D=w[1],E=new q(19),I=0;I<m.length;++I)E[31&m[I]]++;for(I=0;I<z.length;++I)E[31&z[I]]++;for(var S=Gr(E,7),k=S[0],A=S[1],M=19;M>4&&!k[Ur[M-1]];--M);var x,U,N,T,C=f+5<<3,F=lr(i,ir)+lr(a,cr)+o,Z=lr(i,l)+lr(a,g)+o+14+3*M+lr(E,k)+(2*E[16]+3*E[17]+7*E[18]);if(C<=F&&C<=Z)return Pr(t,h,n.subarray(s,s+f));if(nr(t,h,1+(Z<F)),h+=2,Z<F){x=X(l,p,0),U=l,N=X(g,d,0),T=g;var W=X(k,A,0);nr(t,h,b-257),nr(t,h+5,D-1),nr(t,h+10,M-4),h+=14;for(I=0;I<M;++I)nr(t,h+3*I,k[Ur[I]]);h+=3*M;for(var K=[m,z],V=0;V<2;++V){var G=K[V];for(I=0;I<G.length;++I){var _=31&G[I];nr(t,h,W[_]),h+=k[_],_>15&&(nr(t,h,G[I]>>>5&127),h+=G[I]>>>12)}}}else x=Tn,U=ir,N=Dn,T=cr;for(I=0;I<u;++I)if(e[I]>255){_=e[I]>>>18&31;hr(t,h,x[_+257]),h+=U[_+257],_>7&&(nr(t,h,e[I]>>>23&31),h+=yr[_]);var L=31&e[I];hr(t,h,N[L]),h+=T[L],L>3&&(hr(t,h,e[I]>>>5&8191),h+=wr[L])}else hr(t,h,x[e[I]]),h+=U[e[I]];return hr(t,h,x[256]),h+U[256]}),"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new D(0),Fn=u((function(n,t,r,e,i,a){var o=n.length,s=new D(e+o+5*(1+Math.ceil(o/7e3))+i),f=s.subarray(e,s.length-i),h=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var l=c+65535;l>=o&&(f[h>>3]=a),h=Pr(f,h+1,n.subarray(c,l))}else{for(var p=En[t-1],v=p>>>13,g=8191&p,y=(1<<r)-1,m=new q(32768),b=new q(y+1),w=Math.ceil(r/3),z=2*w,E=u((function(t){return(n[t]^n[t+1]<<w^n[t+2]<<z)&y}),"hsh"),I=new gr(25e3),S=new q(288),k=new q(32),A=0,M=0,x=(c=0,0),U=0,N=0;c<o;++c){var T=E(c),C=32767&c,F=b[T];if(m[C]=F,b[T]=C,U<=c){var Z=o-c;if((A>7e3||x>24576)&&Z>423){h=jr(n,f,0,I,S,k,M,x,N,c-N,h),x=A=M=0,N=c;for(var W=0;W<286;++W)S[W]=0;for(W=0;W<30;++W)k[W]=0}var K=2,V=0,X=g,G=C-F&32767;if(Z>2&&T==E(c-G))for(var _=Math.min(v,Z)-1,L=Math.min(32767,c),O=Math.min(258,Z);G<=L&&--X&&C!=F;){if(n[c+K]==n[c+K-G]){for(var R=0;R<O&&n[c+R]==n[c+R-G];++R);if(R>K){if(K=R,V=G,R>_)break;var P=Math.min(G,R-2),$=0;for(W=0;W<P;++W){var H=c-G+W+32768&32767,j=H-m[H]+32768&32767;j>$&&($=j,F=H)}}}G+=(C=F)-(F=m[C])+32768&32767}if(V){I[x++]=268435456|Or[K]<<18|Yr[V];var B=31&Or[K],Y=31&Yr[V];M+=yr[B]+wr[Y],++S[257+B],++k[Y],U=c+K,++A}else I[x++]=n[c],++S[n[c]]}}h=jr(n,f,a,I,S,k,M,x,N,c-N,h),!a&&7&h&&(h=Pr(f,h+1,er))}return d(s,0,e+Sr(h)+i)}),"dflt"),In=function(){for(var n=new Int32Array(256),t=0;t<256;++t){for(var r=t,e=9;--e;)r=(1&r&&-306674912)^r>>>1;n[t]=r}return n}(),mr=u((function(){var n=-1;return{p:function(t){for(var r=n,e=0;e<t.length;++e)r=In[255&r^t[e]]^r>>>8;n=r},d:function(){return~n}}}),"crc"),br=u((function(){var n=1,t=0;return{p:function(r){for(var e=n,i=t,a=0|r.length,o=0;o!=a;){for(var u=Math.min(o+2655,a);o<u;++o)i+=e+=r[o];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}n=e,t=i},d:function(){return(255&(n%=65521))<<24|n>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}),"adler"),ur=u((function(n,t,r,e,i){return Fn(n,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+t.mem,r,e,!i)}),"dopt"),Er=u((function(n,t){var r={};for(var e in n)r[e]=n[e];for(var e in t)r[e]=t[e];return r}),"mrg"),cn=u((function(n,t,r){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 u=e[o],s=a[o];if("function"==typeof u){t+=";"+s+"=";var f=u.toString();if(u.prototype)if(-1!=f.indexOf("[native code]")){var h=f.indexOf(" ",8)+1;t+=f.slice(h,f.indexOf("(",h))}else for(var c in t+=f,u.prototype)t+=";"+s+".prototype."+c+"="+u.prototype[c].toString();else t+=f}else r[s]=u}return[t,r]}),"wcln"),Br=[],Vn=u((function(n){var t=[];for(var r in n)n[r].buffer&&t.push((n[r]=new n[r].constructor(n[r])).buffer);return t}),"cbfs"),Bn=u((function(n,t,r,e){var i;if(!Br[r]){for(var a="",o={},u=n.length-1,s=0;s<u;++s)a=(i=cn(n[s],a,o))[0],o=i[1];Br[r]=cn(n[u],a,o)}var f=Er({},Br[r][1]);return Qn(Br[r][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,f,Vn(f),e)}),"wrkr"),xr=u((function(){return[D,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[D,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 D(n.size)}),"gu8"),Ar=u((function(n,t,r,e,i,a){var o=Bn(r,e,i,(function(n,t){o.terminate(),a(n,t)}));return o.postMessage([n,t],t.consume?[n.buffer]:[]),function(){o.terminate()}}),"cbify"),b=u((function(n){return n.ondata=function(n,t){return postMessage([n,t],[n.buffer])},function(t){return n.push(t.data[0],t.data[1])}}),"astrm"),Mr=u((function(n,t,r,e,i){var a,o=Bn(n,e,i,(function(n,r){n?(o.terminate(),t.ondata.call(t,n)):(r[1]&&o.terminate(),t.ondata.call(t,n,r[0],r[1]))}));o.postMessage(r),t.push=function(n,r){t.ondata||g(5),a&&t.ondata(g(4,0,1),null,!!r),o.postMessage([n,a=r],[n.buffer])},t.terminate=function(){o.terminate()}}),"astrmify"),W=u((function(n,t){return n[t]|n[t+1]<<8}),"b2"),N=u((function(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}),"b4"),Hr=u((function(n,t){return N(n,t)+4294967296*N(n,t+4)}),"b8"),I=u((function(n,t,r){for(;r;++t)n[t]=r,r>>>=8}),"wbytes"),rn=u((function(n,t){var r=t.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=t.level<2?4:9==t.level?2:0,n[9]=3,0!=t.mtime&&I(n,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){n[3]=8;for(var e=0;e<=r.length;++e)n[e+10]=r.charCodeAt(e)}}),"gzh"),nn=u((function(n){(31!=n[0]||139!=n[1]||8!=n[2])&&g(6,"invalid gzip data");var t=n[3],r=10;4&t&&(r+=n[10]|2+(n[11]<<8));for(var e=(t>>3&1)+(t>>4&1);e>0;e-=!n[r++]);return r+(2&t)}),"gzs"),Ln=u((function(n){var t=n.length;return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}),"gzl"),tn=u((function(n){return 10+(n.filename&&n.filename.length+1||0)}),"gzhl"),en=u((function(n,t){var r=t.level,e=0==r?0:r<6?1:9==r?3:2;n[0]=120,n[1]=e<<6|(e?32-2*e:1)}),"zlh"),Pn=u((function(n){(8!=(15&n[0])||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&g(6,"invalid zlib data"),32&n[1]&&g(6,"invalid zlib data: preset dictionaries not supported")}),"zlv");function an(n,t){return!t&&"function"==typeof n&&(t=n,n={}),this.ondata=t,n}u(an,"AsyncCmpStrm");var ar=function(){function n(n,t){!t&&"function"==typeof n&&(t=n,n={}),this.ondata=t,this.o=n||{}}return u(n,"Deflate"),n.prototype.p=function(n,t){this.ondata(ur(n,this.o,0,0,!t),t)},n.prototype.push=function(n,t){this.ondata||g(5),this.d&&g(4),this.d=t,this.p(n,t||!1)},n}(),Xn=function(){function n(n,t){Mr([zr,function(){return[b,ar]}],this,an.call(this,n,t),(function(n){var t=new ar(n.data);onmessage=b(t)}),6)}return u(n,"AsyncDeflate"),n}();function dn(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[zr],(function(n){return fr($r(n.data[0],n.data[1]))}),0,r)}function $r(n,t){return ur(n,t||{},0,0)}u(dn,"deflate"),u($r,"deflateSync");var K=function(){function n(n){this.s={},this.p=new D(0),this.ondata=n}return u(n,"Inflate"),n.prototype.e=function(n){this.ondata||g(5),this.d&&g(4);var t=this.p.length,r=new D(t+n.length);r.set(this.p),r.set(n,t),this.p=r},n.prototype.c=function(n){this.d=this.s.i=n||!1;var t=this.s.b,r=Cr(this.p,this.o,this.s);this.ondata(d(r,t,this.s.b),this.d),this.o=d(r,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(n,t){this.e(n),this.c(t)},n}(),Nn=function(){function n(n){this.ondata=n,Mr([xr,function(){return[b,K]}],this,0,(function(){var n=new K;onmessage=b(n)}),7)}return u(n,"AsyncInflate"),n}();function Rn(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[xr],(function(n){return fr(Fr(n.data[0],_r(n.data[1])))}),1,r)}function Fr(n,t){return Cr(n,t)}u(Rn,"inflate"),u(Fr,"inflateSync");var pn=function(){function n(n,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,n,t)}return u(n,"Gzip"),n.prototype.push=function(n,t){ar.prototype.push.call(this,n,t)},n.prototype.p=function(n,t){this.c.p(n),this.l+=n.length;var r=ur(n,this.o,this.v&&tn(this.o),t&&8,!t);this.v&&(rn(r,this.o),this.v=0),t&&(I(r,r.length-8,this.c.d()),I(r,r.length-4,this.l)),this.ondata(r,t)},n}(),ot=function(){function n(n,t){Mr([zr,Zn,function(){return[b,ar,pn]}],this,an.call(this,n,t),(function(n){var t=new pn(n.data);onmessage=b(t)}),8)}return u(n,"AsyncGzip"),n}();function ft(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[zr,Zn,function(){return[gn]}],(function(n){return fr(gn(n.data[0],n.data[1]))}),2,r)}function gn(n,t){t||(t={});var r=mr(),e=n.length;r.p(n);var i=ur(n,t,tn(t),8),a=i.length;return rn(i,t),I(i,a-8,r.d()),I(i,a-4,e),i}u(ft,"gzip"),u(gn,"gzipSync");var Jr=function(){function n(n){this.v=1,K.call(this,n)}return u(n,"Gunzip"),n.prototype.push=function(n,t){if(K.prototype.e.call(this,n),this.v){var r=this.p.length>3?nn(this.p):4;if(r>=this.p.length&&!t)return;this.p=this.p.subarray(r),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}(),bn=function(){function n(n){this.ondata=n,Mr([xr,kn,function(){return[b,K,Jr]}],this,0,(function(){var n=new Jr;onmessage=b(n)}),9)}return u(n,"AsyncGunzip"),n}();function _n(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[xr,kn,function(){return[Kr]}],(function(n){return fr(Kr(n.data[0]))}),3,r)}function Kr(n,t){return Cr(n.subarray(nn(n),-8),t||new D(Ln(n)))}u(_n,"gunzip"),u(Kr,"gunzipSync");var yn=function(){function n(n,t){this.c=br(),this.v=1,ar.call(this,n,t)}return u(n,"Zlib"),n.prototype.push=function(n,t){ar.prototype.push.call(this,n,t)},n.prototype.p=function(n,t){this.c.p(n);var r=ur(n,this.o,this.v&&2,t&&4,!t);this.v&&(en(r,this.o),this.v=0),t&&I(r,r.length-4,this.c.d()),this.ondata(r,t)},n}(),st=function(){function n(n,t){Mr([zr,Gn,function(){return[b,ar,yn]}],this,an.call(this,n,t),(function(n){var t=new yn(n.data);onmessage=b(t)}),10)}return u(n,"AsyncZlib"),n}();function ut(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[zr,Gn,function(){return[wn]}],(function(n){return fr(wn(n.data[0],n.data[1]))}),4,r)}function wn(n,t){t||(t={});var r=br();r.p(n);var e=ur(n,t,2,4);return en(e,t),I(e,e.length-4,r.d()),e}u(ut,"zlib"),u(wn,"zlibSync");var Qr=function(){function n(n){this.v=1,K.call(this,n)}return u(n,"Unzlib"),n.prototype.push=function(n,t){if(K.prototype.e.call(this,n),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}(),rt=function(){function n(n){this.ondata=n,Mr([xr,On,function(){return[b,K,Qr]}],this,0,(function(){var n=new Qr;onmessage=b(n)}),11)}return u(n,"AsyncUnzlib"),n}();function nt(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[xr,On,function(){return[Vr]}],(function(n){return fr(Vr(n.data[0],_r(n.data[1])))}),5,r)}function Vr(n,t){return Cr((Pn(n),n.subarray(2,-4)),t)}u(nt,"unzlib"),u(Vr,"unzlibSync");var tt=function(){function n(n){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=n}return u(n,"Decompress"),n.prototype.push=function(n,t){if(this.ondata||g(5),this.s)this.s.push(n,t);else{if(this.p&&this.p.length){var r=new D(this.p.length+n.length);r.set(this.p),r.set(n,this.p.length)}else this.p=n;if(this.p.length>2){var e=this,i=u((function(){e.ondata.apply(e,arguments)}),"cb");this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,t),this.p=null}}},n}(),vt=function(){function n(n){this.G=bn,this.I=Nn,this.Z=rt,this.ondata=n}return u(n,"AsyncDecompress"),n.prototype.push=function(n,t){tt.prototype.push.call(this,n,t)},n}();function ht(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),31==n[0]&&139==n[1]&&8==n[2]?_n(n,t,r):8!=(15&n[0])||n[0]>>4>7||(n[0]<<8|n[1])%31?Rn(n,t,r):nt(n,t,r)}function lt(n,t){return 31==n[0]&&139==n[1]&&8==n[2]?Kr(n,t):8!=(15&n[0])||n[0]>>4>7||(n[0]<<8|n[1])%31?Fr(n,t):Vr(n,t)}u(ht,"decompress"),u(lt,"decompressSync");var on=u((function(n,t,r,e){for(var i in n){var a=n[i],o=t+i,u=e;Array.isArray(a)&&(u=Er(e,a[1]),a=a[0]),a instanceof D?r[o]=[a,u]:(r[o+="/"]=[new D(0),u],on(a,o,r,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 t="",r=0;;){var e=n[r++],i=(e>127)+(e>223)+(e>239);if(r+i>n.length)return[t,d(n,r-1)];i?3==i?(e=((15&e)<<18|(63&n[r++])<<12|(63&n[r++])<<6|63&n[r++])-65536,t+=String.fromCharCode(55296|e>>10,56320|1023&e)):t+=1&i?String.fromCharCode((31&e)<<6|63&n[r++]):String.fromCharCode((15&e)<<12|(63&n[r++])<<6|63&n[r++]):t+=String.fromCharCode(e)}}),"dutf8"),ct=function(){function n(n){this.ondata=n,$n?this.t=new TextDecoder:this.p=er}return u(n,"DecodeUTF8"),n.prototype.push=function(n,t){if(this.ondata||g(5),t=!!t,this.t)return this.ondata(this.t.decode(n,{stream:!0}),t),void(t&&(this.t.decode().length&&g(8),this.t=null));this.p||g(4);var r=new D(this.p.length+n.length);r.set(this.p),r.set(n,this.p.length);var e=qn(r),i=e[0],a=e[1];t?(a.length&&g(8),this.p=null):this.p=a,this.ondata(i,t)},n}(),pt=function(){function n(n){this.ondata=n}return u(n,"EncodeUTF8"),n.prototype.push=function(n,t){this.ondata||g(5),this.d&&g(4),this.ondata(sr(n),this.d=t||!1)},n}();function sr(n,t){if(t){for(var r=new D(n.length),e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}if(mn)return mn.encode(n);var i=n.length,a=new D(n.length+(n.length>>1)),o=0,s=u((function(n){a[o++]=n}),"w");for(e=0;e<i;++e){if(o+5>a.length){var f=new D(o+8+(i-e<<1));f.set(a),a=f}var h=n.charCodeAt(e);h<128||t?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++e))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return d(a,0,o)}function Hn(n,t){if(t){for(var r="",e=0;e<n.length;e+=16384)r+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return r}if(Xr)return Xr.decode(n);var i=qn(n),a=i[0];return i[1].length&&g(8),a}u(sr,"strToU8"),u(Hn,"strFromU8");var Yn=u((function(n){return 1==n?3:n<6?2:9==n?1:0}),"dbf"),Wn=u((function(n,t){return t+30+W(n,t+26)+W(n,t+28)}),"slzh"),jn=u((function(n,t,r){var e=W(n,t+28),i=Hn(n.subarray(t+46,t+46+e),!(2048&W(n,t+8))),a=t+46+e,o=N(n,t+20),u=r&&4294967295==o?Jn(n,a):[o,N(n,t+24),N(n,t+42)],s=u[0],f=u[1],h=u[2];return[W(n,t+10),s,f,i,a+W(n,t+30)+W(n,t+32),h]}),"zh"),Jn=u((function(n,t){for(;1!=W(n,t);t+=4+W(n,t+2));return[Hr(n,t+12),Hr(n,t+4),Hr(n,t+20)]}),"z64e"),or=u((function(n){var t=0;if(n)for(var r in n){var e=n[r].length;e>65535&&g(9),t+=e+4}return t}),"exfl"),pr=u((function(n,t,r,e,i,a,o,u){var s=e.length,f=r.extra,h=u&&u.length,c=or(f);I(n,t,null!=o?33639248:67324752),t+=4,null!=o&&(n[t++]=20,n[t++]=r.os),n[t]=20,t+=2,n[t++]=r.flag<<1|(null==a&&8),n[t++]=i&&8,n[t++]=255&r.compression,n[t++]=r.compression>>8;var l=new Date(null==r.mtime?Date.now():r.mtime),p=l.getFullYear()-1980;if((p<0||p>119)&&g(10),I(n,t,p<<25|l.getMonth()+1<<21|l.getDate()<<16|l.getHours()<<11|l.getMinutes()<<5|l.getSeconds()>>>1),t+=4,null!=a&&(I(n,t,r.crc),I(n,t+4,a),I(n,t+8,r.size)),I(n,t+12,s),I(n,t+14,c),t+=16,null!=o&&(I(n,t,h),I(n,t+6,r.attrs),I(n,t+10,o),t+=14),n.set(e,t),t+=s,c)for(var v in f){var d=f[v],y=d.length;I(n,t,+v),I(n,t+2,y),n.set(d,t+4),t+=4+y}return h&&(n.set(u,t),t+=h),t}),"wzh"),fn=u((function(n,t,r,e,i){I(n,t,101010256),I(n,t+8,r),I(n,t+10,r),I(n,t+12,e),I(n,t+16,i)}),"wzf"),Nr=function(){function n(n){this.filename=n,this.c=mr(),this.size=0,this.compression=0}return u(n,"ZipPassThrough"),n.prototype.process=function(n,t){this.ondata(null,n,t)},n.prototype.push=function(n,t){this.ondata||g(5),this.c.p(n),this.size+=n.length,t&&(this.crc=this.c.d()),this.process(n,t||!1)},n}(),gt=function(){function n(n,t){var r=this;t||(t={}),Nr.call(this,n),this.d=new ar(t,(function(n,t){r.ondata(null,n,t)})),this.compression=8,this.flag=Yn(t.level)}return u(n,"ZipDeflate"),n.prototype.process=function(n,t){try{this.d.push(n,t)}catch(n){this.ondata(n,null,t)}},n.prototype.push=function(n,t){Nr.prototype.push.call(this,n,t)},n}(),yt=function(){function n(n,t){var r=this;t||(t={}),Nr.call(this,n),this.d=new Xn(t,(function(n,t,e){r.ondata(n,t,e)})),this.compression=8,this.flag=Yn(t.level),this.terminate=this.d.terminate}return u(n,"AsyncZipDeflate"),n.prototype.process=function(n,t){this.d.push(n,t)},n.prototype.push=function(n,t){Nr.prototype.push.call(this,n,t)},n}(),wt=function(){function n(n){this.ondata=n,this.u=[],this.d=1}return u(n,"Zip"),n.prototype.add=function(n){var t=this;if(this.ondata||g(5),2&this.d)this.ondata(g(4+8*(1&this.d),0,1),null,!1);else{var r=sr(n.filename),e=r.length,i=n.comment,a=i&&sr(i),o=e!=n.filename.length||a&&i.length!=a.length,s=e+or(n.extra)+30;e>65535&&this.ondata(g(11,0,1),null,!1);var f=new D(s);pr(f,0,n,r,o);var h=[f],c=u((function(){for(var n=0,r=h;n<r.length;n++){var e=r[n];t.ondata(null,e,!1)}h=[]}),"pAll_1"),l=this.d;this.d=0;var p=this.u.length,v=Er(n,{f:r,u:o,o:a,t:function(){n.terminate&&n.terminate()},r:function(){if(c(),l){var n=t.u[p+1];n?n.r():t.d=1}l=1}}),d=0;n.ondata=function(r,e,i){if(r)t.ondata(r,e,i),t.terminate();else if(d+=e.length,h.push(e),i){var a=new D(16);I(a,0,134695760),I(a,4,n.crc),I(a,8,d),I(a,12,n.size),h.push(a),v.c=d,v.b=s+d+16,v.crc=n.crc,v.size=n.size,l&&v.r(),l=1}else l&&c()},this.u.push(v)}},n.prototype.end=function(){var n=this;2&this.d?this.ondata(g(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&n.d&&(n.u.splice(-1,1),n.e())},t:function(){}}),this.d=3)},n.prototype.e=function(){for(var n=0,t=0,r=0,e=0,i=this.u;e<i.length;e++){r+=46+(s=i[e]).f.length+or(s.extra)+(s.o?s.o.length:0)}for(var a=new D(r+22),o=0,u=this.u;o<u.length;o++){var s=u[o];pr(a,n,s,s.f,s.u,s.c,t,s.o),n+=46+s.f.length+or(s.extra)+(s.o?s.o.length:0),t+=s.b}fn(a,n,this.u.length,r,t),this.ondata(null,a,!0),this.d=2},n.prototype.terminate=function(){for(var n=0,t=this.u;n<t.length;n++){t[n].t()}this.d=2},n}();function mt(n,t,r){r||(r=t,t={}),"function"!=typeof r&&g(7);var e={};on(n,"",e,t);var i=Object.keys(e),a=i.length,o=0,s=0,f=a,h=new Array(a),c=[],l=u((function(){for(var n=0;n<c.length;++n)c[n]()}),"tAll"),p=u((function(n,t){Rr((function(){r(n,t)}))}),"cbd");Rr((function(){p=r}));var v=u((function(){var n=new D(s+22),t=o,r=s-o;s=0;for(var e=0;e<f;++e){var i=h[e];try{var a=i.c.length;pr(n,s,i,i.f,i.u,a);var u=30+i.f.length+or(i.extra),c=s+u;n.set(i.c,c),pr(n,o,i,i.f,i.u,a,s,i.m),o+=16+u+(i.m?i.m.length:0),s=c+a}catch(n){return p(n,null)}}fn(n,o,h.length,r,t),p(null,n)}),"cbf");a||v();for(var d=u((function(n){var t=i[n],r=e[t],f=r[0],d=r[1],y=mr(),m=f.length;y.p(f);var b=sr(t),w=b.length,z=d.comment,D=z&&sr(z),E=D&&D.length,I=or(d.extra),S=0==d.level?0:8,k=u((function(r,e){if(r)l(),p(r,null);else{var i=e.length;h[n]=Er(d,{size:m,crc:y.d(),c:e,f:b,m:D,u:w!=t.length||D&&z.length!=E,compression:S}),o+=30+w+I+i,s+=76+2*(w+I)+(E||0)+i,--a||v()}}),"cbl");if(w>65535&&k(g(11,0,1),null),S)if(m<16e4)try{k(null,$r(f,d))}catch(n){k(n,null)}else c.push(dn(f,d,k));else k(null,f)}),"_loop_1"),y=0;y<f;++y)d(y);return l}function xt(n,t){t||(t={});var r={},e=[];on(n,"",r,t);var i=0,a=0;for(var o in r){var u=r[o],s=u[0],f=u[1],h=0==f.level?0:8,c=(S=sr(o)).length,l=f.comment,p=l&&sr(l),v=p&&p.length,d=or(f.extra);c>65535&&g(11);var y=h?$r(s,f):s,m=y.length,b=mr();b.p(s),e.push(Er(f,{size:s.length,crc:b.d(),c:y,f:S,m:p,u:c!=o.length||p&&l.length!=v,o:i,compression:h})),i+=30+c+d+m,a+=76+2*(c+d)+(v||0)+m}for(var w=new D(a+22),z=i,E=a-i,I=0;I<e.length;++I){var S=e[I];pr(w,S.o,S,S.f,S.u,S.c.length);var k=30+S.f.length+or(S.extra);w.set(S.c,S.o+k),pr(w,i,S,S.f,S.u,S.c.length,S.o,S.m),i+=16+k+(S.m?S.m.length:0)}return fn(w,i,e.length,E,z),w}u(mt,"zip"),u(xt,"zipSync");var et=function(){function n(){}return u(n,"UnzipPassThrough"),n.prototype.push=function(n,t){this.ondata(null,n,t)},n.compression=0,n}(),zt=function(){function n(){var n=this;this.i=new K((function(t,r){n.ondata(null,t,r)}))}return u(n,"UnzipInflate"),n.prototype.push=function(n,t){try{this.i.push(n,t)}catch(n){this.ondata(n,null,t)}},n.compression=8,n}(),At=function(){function n(n,t){var r=this;t<32e4?this.i=new K((function(n,t){r.ondata(null,n,t)})):(this.i=new Nn((function(n,t,e){r.ondata(n,t,e)})),this.terminate=this.i.terminate)}return u(n,"AsyncUnzipInflate"),n.prototype.push=function(n,t){this.i.terminate&&(n=d(n,0)),this.i.push(n,t)},n.compression=8,n}(),Mt=function(){function n(n){this.onfile=n,this.k=[],this.o={0:et},this.p=er}return u(n,"Unzip"),n.prototype.push=function(n,t){var r=this;if(this.onfile||g(5),this.p||g(4),this.c>0){var e=Math.min(this.c,n.length),i=n.subarray(0,e);if(this.c-=e,this.d?this.d.push(i,!this.c):this.k[0].push(i),(n=n.subarray(e)).length)return this.push(n,t)}else{var a=0,o=0,s=void 0,f=void 0;this.p.length?n.length?((f=new D(this.p.length+n.length)).set(this.p),f.set(n,this.p.length)):f=this.p:f=n;for(var h=f.length,c=this.c,l=c&&this.d,p=u((function(){var n,t=N(f,o);if(67324752==t){a=1,s=o,v.d=null,v.c=0;var e=W(f,o+6),i=W(f,o+8),u=2048&e,l=8&e,p=W(f,o+26),d=W(f,o+28);if(h>o+30+p+d){var y=[];v.k.unshift(y),a=2;var m=N(f,o+18),b=N(f,o+22),w=Hn(f.subarray(o+30,o+=30+p),!u);4294967295==m?(n=l?[-2]:Jn(f,o),m=n[0],b=n[1]):l&&(m=-1),o+=d,v.c=m;var z,D={name:w,compression:i,start:function(){if(D.ondata||g(5),m){var n=r.o[i];n||D.ondata(g(14,"unknown compression type "+i,1),null,!1),(z=m<0?new n(w):new n(w,m,b)).ondata=function(n,t,r){D.ondata(n,t,r)};for(var t=0,e=y;t<e.length;t++){var a=e[t];z.push(a,!1)}r.k[0]==y&&r.c?r.d=z:z.push(er,!0)}else D.ondata(null,er,!0)},terminate:function(){z&&z.terminate&&z.terminate()}};m>=0&&(D.size=m,D.originalSize=b),v.onfile(D)}return"break"}if(c){if(134695760==t)return s=o+=12+(-2==c&&8),a=3,v.c=0,"break";if(33639248==t)return s=o-=4,a=3,v.c=0,"break"}}),"_loop_2"),v=this;o<h-4;++o){if("break"===p())break}if(this.p=er,c<0){var d=a?f.subarray(0,s-12-(-2==c&&8)-(134695760==N(f,s-16)&&4)):f.subarray(0,o);l?l.push(d,!!a):this.k[+(2==a)].push(d)}if(2&a)return this.push(f.subarray(o),t);this.p=f.subarray(o)}t&&(this.c&&g(13),this.p=null)},n.prototype.register=function(n){this.o[n.compression]=n},n}(),Rr="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(n){n()};function Tt(n,t,r){r||(r=t,t={}),"function"!=typeof r&&g(7);var e=[],i=u((function(){for(var n=0;n<e.length;++n)e[n]()}),"tAll"),a={},o=u((function(n,t){Rr((function(){r(n,t)}))}),"cbd");Rr((function(){o=r}));for(var s=n.length-22;101010256!=N(n,s);--s)if(!s||n.length-s>65558)return o(g(13,0,1),null),i;var f=W(n,s+8);if(f){var h=f,c=N(n,s+16),l=4294967295==c;if(l){if(s=N(n,s-12),101075792!=N(n,s))return o(g(13,0,1),null),i;h=f=N(n,s+32),c=N(n,s+48)}for(var p=t&&t.filter,v=u((function(t){var r=jn(n,c,l),s=r[0],h=r[1],v=r[2],y=r[3],m=r[4],b=r[5],w=Wn(n,b);c=m;var z=u((function(n,t){n?(i(),o(n,null)):(t&&(a[y]=t),--f||o(null,a))}),"cbl");if(!p||p({name:y,size:h,originalSize:v,compression:s}))if(s)if(8==s){var E=n.subarray(w,w+h);if(h<32e4)try{z(null,Fr(E,new D(v)))}catch(n){z(n,null)}else e.push(Rn(E,{size:v},z))}else z(g(14,"unknown compression type "+s,1),null);else z(null,d(n,w,w+h));else z(null,null)}),"_loop_3"),y=0;y<h;++y)v(y)}else o(null,{});return i}function Ut(n,t){for(var r={},e=n.length-22;101010256!=N(n,e);--e)(!e||n.length-e>65558)&&g(13);var i=W(n,e+8);if(!i)return{};var a=N(n,e+16),o=4294967295==a;o&&(e=N(n,e-12),101075792!=N(n,e)&&g(13),i=N(n,e+32),a=N(n,e+48));for(var u=t&&t.filter,s=0;s<i;++s){var f=jn(n,a,o),h=f[0],c=f[1],l=f[2],p=f[3],v=f[4],y=f[5],m=Wn(n,y);a=v,(!u||u({name:p,size:c,originalSize:l,compression:h}))&&(h?8==h?r[p]=Fr(n.subarray(m,m+c),new D(l)):g(14,"unknown compression type "+h):r[p]=d(n,m,m+c))}return r}u(Tt,"unzip"),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};
1
+ import{a as hn}from"./chunk-AXGI3N6R.js";import{a as u}from"./chunk-ZRT45YCM.js";hn();var ln={},Qn=u((function(n,t,r,e,i){var a=new Worker(ln[t]||(ln[t]=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(n){var t=n.data,r=t.$e$;if(r){var e=new Error(r[0]);e.code=r[1],e.stack=r[2],i(e,null)}else i(null,t)},a.postMessage(r,e),a}),"wk"),D=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new D([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 D([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 D([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=u((function(n,t){for(var r=new q(31),e=0;e<31;++e)r[e]=t+=1<<n[e-1];var i=new gr(r[30]);for(e=1;e<30;++e)for(var a=r[e];a<r[e+1];++a)i[a]=a-r[e]<<5|e;return[r,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=(61680&(tr=(52428&(tr=(43690&E)>>>1|(21845&E)<<1))>>>2|(13107&tr)<<2))>>>4|(3855&tr)<<4,Dr[E]=((65280&tr)>>>8|(255&tr)<<8)>>>1;var tr,X=u((function(n,t,r){for(var e=n.length,i=0,a=new q(t);i<e;++i)n[i]&&++a[n[i]-1];var o,u=new q(t);for(i=0;i<t;++i)u[i]=u[i-1]+a[i-1]<<1;if(r){o=new q(1<<t);var s=15-t;for(i=0;i<e;++i)if(n[i])for(var f=i<<4|n[i],h=t-n[i],c=u[n[i]-1]++<<h,l=c|(1<<h)-1;c<=l;++c)o[Dr[c]>>>s]=f}else for(o=new q(e),i=0;i<e;++i)n[i]&&(o[i]=Dr[u[n[i]-1]++]>>>15-n[i]);return o}),"hMap"),ir=new D(288);for(E=0;E<144;++E)ir[E]=8;for(E=144;E<256;++E)ir[E]=9;for(E=256;E<280;++E)ir[E]=7;for(E=280;E<288;++E)ir[E]=8;var cr=new D(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 t=n[0],r=1;r<n.length;++r)n[r]>t&&(t=n[r]);return t}),"max"),V=u((function(n,t,r){var e=t/8|0;return(n[e]|n[e+1]<<8)>>(7&t)&r}),"bits"),kr=u((function(n,t){var r=t/8|0;return(n[r]|n[r+1]<<8|n[r+2]<<16)>>(7&t)}),"bits16"),Sr=u((function(n){return(n+7)/8|0}),"shft"),d=u((function(n,t,r){(null==t||t<0)&&(t=0),(null==r||r>n.length)&&(r=n.length);var e=new(2==n.BYTES_PER_ELEMENT?q:4==n.BYTES_PER_ELEMENT?gr:D)(r-t);return e.set(n.subarray(t,r)),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,t,r){var e=new Error(t||Cn[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,g),!r)throw e;return e}),"err"),Cr=u((function(n,t,r){var e=n.length;if(!e||r&&r.f&&!r.l)return t||new D(0);var i=!t||r,a=!r||r.i;r||(r={}),t||(t=new D(3*e));var o=u((function(n){var r=t.length;if(n>r){var e=new D(Math.max(2*r,n));e.set(t),t=e}}),"cbuf"),s=r.f||0,f=r.p||0,h=r.b||0,c=r.l,l=r.d,p=r.m,v=r.n,y=8*e;do{if(!c){s=V(n,f,1);var m=V(n,f+1,3);if(f+=3,!m){var b=n[(N=Sr(f)+4)-4]|n[N-3]<<8,w=N+b;if(w>e){a&&g(0);break}i&&o(h+b),t.set(n.subarray(N,w),h),r.b=h+=b,r.p=f=8*w,r.f=s;continue}if(1==m)c=Un,l=Sn,p=9,v=5;else if(2==m){var z=V(n,f,31)+257,E=V(n,f+10,15)+4,I=z+V(n,f+5,31)+1;f+=14;for(var k=new D(I),S=new D(19),A=0;A<E;++A)S[Ur[A]]=V(n,f+3*A,7);f+=3*E;var M=Zr(S),x=(1<<M)-1,U=X(S,M,1);for(A=0;A<I;){var N,T=U[V(n,f,x)];if(f+=15&T,(N=T>>>4)<16)k[A++]=N;else{var C=0,F=0;for(16==N?(F=3+V(n,f,3),f+=2,C=k[A-1]):17==N?(F=3+V(n,f,7),f+=3):18==N&&(F=11+V(n,f,127),f+=7);F--;)k[A++]=C}}var Z=k.subarray(0,z),W=k.subarray(z);p=Zr(Z),v=Zr(W),c=X(Z,p,1),l=X(W,v,1)}else g(1);if(f>y){a&&g(0);break}}i&&o(h+131072);for(var q=(1<<p)-1,K=(1<<v)-1,G=f;;G=f){var _=(C=c[kr(n,f)&q])>>>4;if((f+=15&C)>y){a&&g(0);break}if(C||g(2),_<256)t[h++]=_;else{if(256==_){G=f,c=null;break}var L=_-254;if(_>264){var O=yr[A=_-257];L=V(n,f,(1<<O)-1)+dr[A],f+=O}var R=l[kr(n,f)&K],P=R>>>4;R||g(3),f+=15&R;W=Mn[P];if(P>3){O=wr[P];W+=kr(n,f)&(1<<O)-1,f+=O}if(f>y){a&&g(0);break}i&&o(h+131072);for(var $=h+L;h<$;h+=4)t[h]=t[h-W],t[h+1]=t[h+1-W],t[h+2]=t[h+2-W],t[h+3]=t[h+3-W];h=$}}r.l=c,r.p=G,r.b=h,r.f=s,c&&(s=1,r.m=p,r.d=l,r.n=v)}while(!s);return h==t.length?t:d(t,0,h)}),"inflt"),nr=u((function(n,t,r){r<<=7&t;var e=t/8|0;n[e]|=r,n[e+1]|=r>>>8}),"wbits"),hr=u((function(n,t,r){r<<=7&t;var e=t/8|0;n[e]|=r,n[e+1]|=r>>>8,n[e+2]|=r>>>16}),"wbits16"),Gr=u((function(n,t){for(var r=[],e=0;e<n.length;++e)n[e]&&r.push({s:e,f:n[e]});var i=r.length,a=r.slice();if(!i)return[er,0];if(1==i){var o=new D(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(n,t){return n.f-t.f})),r.push({s:-1,f:25001});var u=r[0],s=r[1],f=0,h=1,c=2;for(r[0]={s:-1,f:u.f+s.f,l:u,r:s};h!=i-1;)u=r[r[f].f<r[c].f?f++:c++],s=r[f!=h&&r[f].f<r[c].f?f++:c++],r[h++]={s:-1,f:u.f+s.f,l:u,r:s};var l=a[0].s;for(e=1;e<i;++e)a[e].s>l&&(l=a[e].s);var p=new q(l+1),v=Lr(r[h-1],p,0);if(v>t){e=0;var g=0,d=v-t,y=1<<d;for(a.sort((function(n,t){return p[t.s]-p[n.s]||n.f-t.f}));e<i;++e){var m=a[e].s;if(!(p[m]>t))break;g+=y-(1<<v-p[m]),p[m]=t}for(g>>>=d;g>0;){var b=a[e].s;p[b]<t?g-=1<<t-p[b]++-1:++e}for(;e>=0&&g;--e){var w=a[e].s;p[w]==t&&(--p[w],++g)}v=t}return[new D(p),v]}),"hTree"),Lr=u((function(n,t,r){return-1==n.s?Math.max(Lr(n.l,t,r+1),Lr(n.r,t,r+1)):t[n.s]=r}),"ln"),Wr=u((function(n){for(var t=n.length;t&&!n[--t];);for(var r=new q(++t),e=0,i=n[0],a=1,o=u((function(n){r[e++]=n}),"w"),s=1;s<=t;++s)if(n[s]==i&&s!=t)++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[s]}return[r.subarray(0,e),t]}),"lc"),lr=u((function(n,t){for(var r=0,e=0;e<t.length;++e)r+=n[e]*t[e];return r}),"clen"),Pr=u((function(n,t,r){var e=r.length,i=Sr(t+2);n[i]=255&e,n[i+1]=e>>>8,n[i+2]=255^n[i],n[i+3]=255^n[i+1];for(var a=0;a<e;++a)n[i+a+4]=r[a];return 8*(i+4+e)}),"wfblk"),jr=u((function(n,t,r,e,i,a,o,u,s,f,h){nr(t,h++,r),++i[256];for(var c=Gr(i,15),l=c[0],p=c[1],v=Gr(a,15),g=v[0],d=v[1],y=Wr(l),m=y[0],b=y[1],w=Wr(g),z=w[0],D=w[1],E=new q(19),I=0;I<m.length;++I)E[31&m[I]]++;for(I=0;I<z.length;++I)E[31&z[I]]++;for(var k=Gr(E,7),S=k[0],A=k[1],M=19;M>4&&!S[Ur[M-1]];--M);var x,U,N,T,C=f+5<<3,F=lr(i,ir)+lr(a,cr)+o,Z=lr(i,l)+lr(a,g)+o+14+3*M+lr(E,S)+(2*E[16]+3*E[17]+7*E[18]);if(C<=F&&C<=Z)return Pr(t,h,n.subarray(s,s+f));if(nr(t,h,1+(Z<F)),h+=2,Z<F){x=X(l,p,0),U=l,N=X(g,d,0),T=g;var W=X(S,A,0);nr(t,h,b-257),nr(t,h+5,D-1),nr(t,h+10,M-4),h+=14;for(I=0;I<M;++I)nr(t,h+3*I,S[Ur[I]]);h+=3*M;for(var K=[m,z],V=0;V<2;++V){var G=K[V];for(I=0;I<G.length;++I){var _=31&G[I];nr(t,h,W[_]),h+=S[_],_>15&&(nr(t,h,G[I]>>>5&127),h+=G[I]>>>12)}}}else x=Tn,U=ir,N=Dn,T=cr;for(I=0;I<u;++I)if(e[I]>255){_=e[I]>>>18&31;hr(t,h,x[_+257]),h+=U[_+257],_>7&&(nr(t,h,e[I]>>>23&31),h+=yr[_]);var L=31&e[I];hr(t,h,N[L]),h+=T[L],L>3&&(hr(t,h,e[I]>>>5&8191),h+=wr[L])}else hr(t,h,x[e[I]]),h+=U[e[I]];return hr(t,h,x[256]),h+U[256]}),"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new D(0),Fn=u((function(n,t,r,e,i,a){var o=n.length,s=new D(e+o+5*(1+Math.ceil(o/7e3))+i),f=s.subarray(e,s.length-i),h=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var l=c+65535;l>=o&&(f[h>>3]=a),h=Pr(f,h+1,n.subarray(c,l))}else{for(var p=En[t-1],v=p>>>13,g=8191&p,y=(1<<r)-1,m=new q(32768),b=new q(y+1),w=Math.ceil(r/3),z=2*w,E=u((function(t){return(n[t]^n[t+1]<<w^n[t+2]<<z)&y}),"hsh"),I=new gr(25e3),k=new q(288),S=new q(32),A=0,M=0,x=(c=0,0),U=0,N=0;c<o;++c){var T=E(c),C=32767&c,F=b[T];if(m[C]=F,b[T]=C,U<=c){var Z=o-c;if((A>7e3||x>24576)&&Z>423){h=jr(n,f,0,I,k,S,M,x,N,c-N,h),x=A=M=0,N=c;for(var W=0;W<286;++W)k[W]=0;for(W=0;W<30;++W)S[W]=0}var K=2,V=0,X=g,G=C-F&32767;if(Z>2&&T==E(c-G))for(var _=Math.min(v,Z)-1,L=Math.min(32767,c),O=Math.min(258,Z);G<=L&&--X&&C!=F;){if(n[c+K]==n[c+K-G]){for(var R=0;R<O&&n[c+R]==n[c+R-G];++R);if(R>K){if(K=R,V=G,R>_)break;var P=Math.min(G,R-2),$=0;for(W=0;W<P;++W){var j=c-G+W+32768&32767,B=j-m[j]+32768&32767;B>$&&($=B,F=j)}}}G+=(C=F)-(F=m[C])+32768&32767}if(V){I[x++]=268435456|Or[K]<<18|Yr[V];var H=31&Or[K],Y=31&Yr[V];M+=yr[H]+wr[Y],++k[257+H],++S[Y],U=c+K,++A}else I[x++]=n[c],++k[n[c]]}}h=jr(n,f,a,I,k,S,M,x,N,c-N,h),!a&&7&h&&(h=Pr(f,h+1,er))}return d(s,0,e+Sr(h)+i)}),"dflt"),In=function(){for(var n=new Int32Array(256),t=0;t<256;++t){for(var r=t,e=9;--e;)r=(1&r&&-306674912)^r>>>1;n[t]=r}return n}(),mr=u((function(){var n=-1;return{p:function(t){for(var r=n,e=0;e<t.length;++e)r=In[255&r^t[e]]^r>>>8;n=r},d:function(){return~n}}}),"crc"),br=u((function(){var n=1,t=0;return{p:function(r){for(var e=n,i=t,a=0|r.length,o=0;o!=a;){for(var u=Math.min(o+2655,a);o<u;++o)i+=e+=r[o];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}n=e,t=i},d:function(){return(255&(n%=65521))<<24|n>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}),"adler"),ur=u((function(n,t,r,e,i){return Fn(n,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+t.mem,r,e,!i)}),"dopt"),Er=u((function(n,t){var r={};for(var e in n)r[e]=n[e];for(var e in t)r[e]=t[e];return r}),"mrg"),cn=u((function(n,t,r){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 u=e[o],s=a[o];if("function"==typeof u){t+=";"+s+"=";var f=u.toString();if(u.prototype)if(-1!=f.indexOf("[native code]")){var h=f.indexOf(" ",8)+1;t+=f.slice(h,f.indexOf("(",h))}else for(var c in t+=f,u.prototype)t+=";"+s+".prototype."+c+"="+u.prototype[c].toString();else t+=f}else r[s]=u}return[t,r]}),"wcln"),Br=[],Vn=u((function(n){var t=[];for(var r in n)n[r].buffer&&t.push((n[r]=new n[r].constructor(n[r])).buffer);return t}),"cbfs"),Bn=u((function(n,t,r,e){var i;if(!Br[r]){for(var a="",o={},u=n.length-1,s=0;s<u;++s)a=(i=cn(n[s],a,o))[0],o=i[1];Br[r]=cn(n[u],a,o)}var f=Er({},Br[r][1]);return Qn(Br[r][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,f,Vn(f),e)}),"wrkr"),xr=u((function(){return[D,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[D,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 D(n.size)}),"gu8"),Ar=u((function(n,t,r,e,i,a){var o=Bn(r,e,i,(function(n,t){o.terminate(),a(n,t)}));return o.postMessage([n,t],t.consume?[n.buffer]:[]),function(){o.terminate()}}),"cbify"),b=u((function(n){return n.ondata=function(n,t){return postMessage([n,t],[n.buffer])},function(t){return n.push(t.data[0],t.data[1])}}),"astrm"),Mr=u((function(n,t,r,e,i){var a,o=Bn(n,e,i,(function(n,r){n?(o.terminate(),t.ondata.call(t,n)):(r[1]&&o.terminate(),t.ondata.call(t,n,r[0],r[1]))}));o.postMessage(r),t.push=function(n,r){t.ondata||g(5),a&&t.ondata(g(4,0,1),null,!!r),o.postMessage([n,a=r],[n.buffer])},t.terminate=function(){o.terminate()}}),"astrmify"),W=u((function(n,t){return n[t]|n[t+1]<<8}),"b2"),N=u((function(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}),"b4"),Hr=u((function(n,t){return N(n,t)+4294967296*N(n,t+4)}),"b8"),I=u((function(n,t,r){for(;r;++t)n[t]=r,r>>>=8}),"wbytes"),rn=u((function(n,t){var r=t.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=t.level<2?4:9==t.level?2:0,n[9]=3,0!=t.mtime&&I(n,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){n[3]=8;for(var e=0;e<=r.length;++e)n[e+10]=r.charCodeAt(e)}}),"gzh"),nn=u((function(n){(31!=n[0]||139!=n[1]||8!=n[2])&&g(6,"invalid gzip data");var t=n[3],r=10;4&t&&(r+=n[10]|2+(n[11]<<8));for(var e=(t>>3&1)+(t>>4&1);e>0;e-=!n[r++]);return r+(2&t)}),"gzs"),Ln=u((function(n){var t=n.length;return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}),"gzl"),tn=u((function(n){return 10+(n.filename&&n.filename.length+1||0)}),"gzhl"),en=u((function(n,t){var r=t.level,e=0==r?0:r<6?1:9==r?3:2;n[0]=120,n[1]=e<<6|(e?32-2*e:1)}),"zlh"),Pn=u((function(n){(8!=(15&n[0])||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&g(6,"invalid zlib data"),32&n[1]&&g(6,"invalid zlib data: preset dictionaries not supported")}),"zlv");function an(n,t){return!t&&"function"==typeof n&&(t=n,n={}),this.ondata=t,n}u(an,"AsyncCmpStrm");var ar=function(){function n(n,t){!t&&"function"==typeof n&&(t=n,n={}),this.ondata=t,this.o=n||{}}return u(n,"Deflate"),n.prototype.p=function(n,t){this.ondata(ur(n,this.o,0,0,!t),t)},n.prototype.push=function(n,t){this.ondata||g(5),this.d&&g(4),this.d=t,this.p(n,t||!1)},n}(),Xn=function(){function n(n,t){Mr([zr,function(){return[b,ar]}],this,an.call(this,n,t),(function(n){var t=new ar(n.data);onmessage=b(t)}),6)}return u(n,"AsyncDeflate"),n}();function dn(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[zr],(function(n){return fr($r(n.data[0],n.data[1]))}),0,r)}function $r(n,t){return ur(n,t||{},0,0)}u(dn,"deflate"),u($r,"deflateSync");var K=function(){function n(n){this.s={},this.p=new D(0),this.ondata=n}return u(n,"Inflate"),n.prototype.e=function(n){this.ondata||g(5),this.d&&g(4);var t=this.p.length,r=new D(t+n.length);r.set(this.p),r.set(n,t),this.p=r},n.prototype.c=function(n){this.d=this.s.i=n||!1;var t=this.s.b,r=Cr(this.p,this.o,this.s);this.ondata(d(r,t,this.s.b),this.d),this.o=d(r,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(n,t){this.e(n),this.c(t)},n}(),Nn=function(){function n(n){this.ondata=n,Mr([xr,function(){return[b,K]}],this,0,(function(){var n=new K;onmessage=b(n)}),7)}return u(n,"AsyncInflate"),n}();function Rn(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[xr],(function(n){return fr(Fr(n.data[0],_r(n.data[1])))}),1,r)}function Fr(n,t){return Cr(n,t)}u(Rn,"inflate"),u(Fr,"inflateSync");var pn=function(){function n(n,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,n,t)}return u(n,"Gzip"),n.prototype.push=function(n,t){ar.prototype.push.call(this,n,t)},n.prototype.p=function(n,t){this.c.p(n),this.l+=n.length;var r=ur(n,this.o,this.v&&tn(this.o),t&&8,!t);this.v&&(rn(r,this.o),this.v=0),t&&(I(r,r.length-8,this.c.d()),I(r,r.length-4,this.l)),this.ondata(r,t)},n}(),ot=function(){function n(n,t){Mr([zr,Zn,function(){return[b,ar,pn]}],this,an.call(this,n,t),(function(n){var t=new pn(n.data);onmessage=b(t)}),8)}return u(n,"AsyncGzip"),n}();function ft(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[zr,Zn,function(){return[gn]}],(function(n){return fr(gn(n.data[0],n.data[1]))}),2,r)}function gn(n,t){t||(t={});var r=mr(),e=n.length;r.p(n);var i=ur(n,t,tn(t),8),a=i.length;return rn(i,t),I(i,a-8,r.d()),I(i,a-4,e),i}u(ft,"gzip"),u(gn,"gzipSync");var Jr=function(){function n(n){this.v=1,K.call(this,n)}return u(n,"Gunzip"),n.prototype.push=function(n,t){if(K.prototype.e.call(this,n),this.v){var r=this.p.length>3?nn(this.p):4;if(r>=this.p.length&&!t)return;this.p=this.p.subarray(r),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}(),bn=function(){function n(n){this.ondata=n,Mr([xr,kn,function(){return[b,K,Jr]}],this,0,(function(){var n=new Jr;onmessage=b(n)}),9)}return u(n,"AsyncGunzip"),n}();function _n(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[xr,kn,function(){return[Kr]}],(function(n){return fr(Kr(n.data[0]))}),3,r)}function Kr(n,t){return Cr(n.subarray(nn(n),-8),t||new D(Ln(n)))}u(_n,"gunzip"),u(Kr,"gunzipSync");var yn=function(){function n(n,t){this.c=br(),this.v=1,ar.call(this,n,t)}return u(n,"Zlib"),n.prototype.push=function(n,t){ar.prototype.push.call(this,n,t)},n.prototype.p=function(n,t){this.c.p(n);var r=ur(n,this.o,this.v&&2,t&&4,!t);this.v&&(en(r,this.o),this.v=0),t&&I(r,r.length-4,this.c.d()),this.ondata(r,t)},n}(),st=function(){function n(n,t){Mr([zr,Gn,function(){return[b,ar,yn]}],this,an.call(this,n,t),(function(n){var t=new yn(n.data);onmessage=b(t)}),10)}return u(n,"AsyncZlib"),n}();function ut(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[zr,Gn,function(){return[wn]}],(function(n){return fr(wn(n.data[0],n.data[1]))}),4,r)}function wn(n,t){t||(t={});var r=br();r.p(n);var e=ur(n,t,2,4);return en(e,t),I(e,e.length-4,r.d()),e}u(ut,"zlib"),u(wn,"zlibSync");var Qr=function(){function n(n){this.v=1,K.call(this,n)}return u(n,"Unzlib"),n.prototype.push=function(n,t){if(K.prototype.e.call(this,n),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}(),rt=function(){function n(n){this.ondata=n,Mr([xr,On,function(){return[b,K,Qr]}],this,0,(function(){var n=new Qr;onmessage=b(n)}),11)}return u(n,"AsyncUnzlib"),n}();function nt(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),Ar(n,t,[xr,On,function(){return[Vr]}],(function(n){return fr(Vr(n.data[0],_r(n.data[1])))}),5,r)}function Vr(n,t){return Cr((Pn(n),n.subarray(2,-4)),t)}u(nt,"unzlib"),u(Vr,"unzlibSync");var tt=function(){function n(n){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=n}return u(n,"Decompress"),n.prototype.push=function(n,t){if(this.ondata||g(5),this.s)this.s.push(n,t);else{if(this.p&&this.p.length){var r=new D(this.p.length+n.length);r.set(this.p),r.set(n,this.p.length)}else this.p=n;if(this.p.length>2){var e=this,i=u((function(){e.ondata.apply(e,arguments)}),"cb");this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,t),this.p=null}}},n}(),vt=function(){function n(n){this.G=bn,this.I=Nn,this.Z=rt,this.ondata=n}return u(n,"AsyncDecompress"),n.prototype.push=function(n,t){tt.prototype.push.call(this,n,t)},n}();function ht(n,t,r){return r||(r=t,t={}),"function"!=typeof r&&g(7),31==n[0]&&139==n[1]&&8==n[2]?_n(n,t,r):8!=(15&n[0])||n[0]>>4>7||(n[0]<<8|n[1])%31?Rn(n,t,r):nt(n,t,r)}function lt(n,t){return 31==n[0]&&139==n[1]&&8==n[2]?Kr(n,t):8!=(15&n[0])||n[0]>>4>7||(n[0]<<8|n[1])%31?Fr(n,t):Vr(n,t)}u(ht,"decompress"),u(lt,"decompressSync");var on=u((function(n,t,r,e){for(var i in n){var a=n[i],o=t+i,u=e;Array.isArray(a)&&(u=Er(e,a[1]),a=a[0]),a instanceof D?r[o]=[a,u]:(r[o+="/"]=[new D(0),u],on(a,o,r,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 t="",r=0;;){var e=n[r++],i=(e>127)+(e>223)+(e>239);if(r+i>n.length)return[t,d(n,r-1)];i?3==i?(e=((15&e)<<18|(63&n[r++])<<12|(63&n[r++])<<6|63&n[r++])-65536,t+=String.fromCharCode(55296|e>>10,56320|1023&e)):t+=1&i?String.fromCharCode((31&e)<<6|63&n[r++]):String.fromCharCode((15&e)<<12|(63&n[r++])<<6|63&n[r++]):t+=String.fromCharCode(e)}}),"dutf8"),ct=function(){function n(n){this.ondata=n,$n?this.t=new TextDecoder:this.p=er}return u(n,"DecodeUTF8"),n.prototype.push=function(n,t){if(this.ondata||g(5),t=!!t,this.t)return this.ondata(this.t.decode(n,{stream:!0}),t),void(t&&(this.t.decode().length&&g(8),this.t=null));this.p||g(4);var r=new D(this.p.length+n.length);r.set(this.p),r.set(n,this.p.length);var e=qn(r),i=e[0],a=e[1];t?(a.length&&g(8),this.p=null):this.p=a,this.ondata(i,t)},n}(),pt=function(){function n(n){this.ondata=n}return u(n,"EncodeUTF8"),n.prototype.push=function(n,t){this.ondata||g(5),this.d&&g(4),this.ondata(sr(n),this.d=t||!1)},n}();function sr(n,t){if(t){for(var r=new D(n.length),e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}if(mn)return mn.encode(n);var i=n.length,a=new D(n.length+(n.length>>1)),o=0,s=u((function(n){a[o++]=n}),"w");for(e=0;e<i;++e){if(o+5>a.length){var f=new D(o+8+(i-e<<1));f.set(a),a=f}var h=n.charCodeAt(e);h<128||t?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++e))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return d(a,0,o)}function Hn(n,t){if(t){for(var r="",e=0;e<n.length;e+=16384)r+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return r}if(Xr)return Xr.decode(n);var i=qn(n),a=i[0];return i[1].length&&g(8),a}u(sr,"strToU8"),u(Hn,"strFromU8");var Yn=u((function(n){return 1==n?3:n<6?2:9==n?1:0}),"dbf"),Wn=u((function(n,t){return t+30+W(n,t+26)+W(n,t+28)}),"slzh"),jn=u((function(n,t,r){var e=W(n,t+28),i=Hn(n.subarray(t+46,t+46+e),!(2048&W(n,t+8))),a=t+46+e,o=N(n,t+20),u=r&&4294967295==o?Jn(n,a):[o,N(n,t+24),N(n,t+42)],s=u[0],f=u[1],h=u[2];return[W(n,t+10),s,f,i,a+W(n,t+30)+W(n,t+32),h]}),"zh"),Jn=u((function(n,t){for(;1!=W(n,t);t+=4+W(n,t+2));return[Hr(n,t+12),Hr(n,t+4),Hr(n,t+20)]}),"z64e"),or=u((function(n){var t=0;if(n)for(var r in n){var e=n[r].length;e>65535&&g(9),t+=e+4}return t}),"exfl"),pr=u((function(n,t,r,e,i,a,o,u){var s=e.length,f=r.extra,h=u&&u.length,c=or(f);I(n,t,null!=o?33639248:67324752),t+=4,null!=o&&(n[t++]=20,n[t++]=r.os),n[t]=20,t+=2,n[t++]=r.flag<<1|(null==a&&8),n[t++]=i&&8,n[t++]=255&r.compression,n[t++]=r.compression>>8;var l=new Date(null==r.mtime?Date.now():r.mtime),p=l.getFullYear()-1980;if((p<0||p>119)&&g(10),I(n,t,p<<25|l.getMonth()+1<<21|l.getDate()<<16|l.getHours()<<11|l.getMinutes()<<5|l.getSeconds()>>>1),t+=4,null!=a&&(I(n,t,r.crc),I(n,t+4,a),I(n,t+8,r.size)),I(n,t+12,s),I(n,t+14,c),t+=16,null!=o&&(I(n,t,h),I(n,t+6,r.attrs),I(n,t+10,o),t+=14),n.set(e,t),t+=s,c)for(var v in f){var d=f[v],y=d.length;I(n,t,+v),I(n,t+2,y),n.set(d,t+4),t+=4+y}return h&&(n.set(u,t),t+=h),t}),"wzh"),fn=u((function(n,t,r,e,i){I(n,t,101010256),I(n,t+8,r),I(n,t+10,r),I(n,t+12,e),I(n,t+16,i)}),"wzf"),Nr=function(){function n(n){this.filename=n,this.c=mr(),this.size=0,this.compression=0}return u(n,"ZipPassThrough"),n.prototype.process=function(n,t){this.ondata(null,n,t)},n.prototype.push=function(n,t){this.ondata||g(5),this.c.p(n),this.size+=n.length,t&&(this.crc=this.c.d()),this.process(n,t||!1)},n}(),gt=function(){function n(n,t){var r=this;t||(t={}),Nr.call(this,n),this.d=new ar(t,(function(n,t){r.ondata(null,n,t)})),this.compression=8,this.flag=Yn(t.level)}return u(n,"ZipDeflate"),n.prototype.process=function(n,t){try{this.d.push(n,t)}catch(n){this.ondata(n,null,t)}},n.prototype.push=function(n,t){Nr.prototype.push.call(this,n,t)},n}(),yt=function(){function n(n,t){var r=this;t||(t={}),Nr.call(this,n),this.d=new Xn(t,(function(n,t,e){r.ondata(n,t,e)})),this.compression=8,this.flag=Yn(t.level),this.terminate=this.d.terminate}return u(n,"AsyncZipDeflate"),n.prototype.process=function(n,t){this.d.push(n,t)},n.prototype.push=function(n,t){Nr.prototype.push.call(this,n,t)},n}(),wt=function(){function n(n){this.ondata=n,this.u=[],this.d=1}return u(n,"Zip"),n.prototype.add=function(n){var t=this;if(this.ondata||g(5),2&this.d)this.ondata(g(4+8*(1&this.d),0,1),null,!1);else{var r=sr(n.filename),e=r.length,i=n.comment,a=i&&sr(i),o=e!=n.filename.length||a&&i.length!=a.length,s=e+or(n.extra)+30;e>65535&&this.ondata(g(11,0,1),null,!1);var f=new D(s);pr(f,0,n,r,o);var h=[f],c=u((function(){for(var n=0,r=h;n<r.length;n++){var e=r[n];t.ondata(null,e,!1)}h=[]}),"pAll_1"),l=this.d;this.d=0;var p=this.u.length,v=Er(n,{f:r,u:o,o:a,t:function(){n.terminate&&n.terminate()},r:function(){if(c(),l){var n=t.u[p+1];n?n.r():t.d=1}l=1}}),d=0;n.ondata=function(r,e,i){if(r)t.ondata(r,e,i),t.terminate();else if(d+=e.length,h.push(e),i){var a=new D(16);I(a,0,134695760),I(a,4,n.crc),I(a,8,d),I(a,12,n.size),h.push(a),v.c=d,v.b=s+d+16,v.crc=n.crc,v.size=n.size,l&&v.r(),l=1}else l&&c()},this.u.push(v)}},n.prototype.end=function(){var n=this;2&this.d?this.ondata(g(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&n.d&&(n.u.splice(-1,1),n.e())},t:function(){}}),this.d=3)},n.prototype.e=function(){for(var n=0,t=0,r=0,e=0,i=this.u;e<i.length;e++){r+=46+(s=i[e]).f.length+or(s.extra)+(s.o?s.o.length:0)}for(var a=new D(r+22),o=0,u=this.u;o<u.length;o++){var s=u[o];pr(a,n,s,s.f,s.u,s.c,t,s.o),n+=46+s.f.length+or(s.extra)+(s.o?s.o.length:0),t+=s.b}fn(a,n,this.u.length,r,t),this.ondata(null,a,!0),this.d=2},n.prototype.terminate=function(){for(var n=0,t=this.u;n<t.length;n++){t[n].t()}this.d=2},n}();function mt(n,t,r){r||(r=t,t={}),"function"!=typeof r&&g(7);var e={};on(n,"",e,t);var i=Object.keys(e),a=i.length,o=0,s=0,f=a,h=new Array(a),c=[],l=u((function(){for(var n=0;n<c.length;++n)c[n]()}),"tAll"),p=u((function(n,t){Rr((function(){r(n,t)}))}),"cbd");Rr((function(){p=r}));var v=u((function(){var n=new D(s+22),t=o,r=s-o;s=0;for(var e=0;e<f;++e){var i=h[e];try{var a=i.c.length;pr(n,s,i,i.f,i.u,a);var u=30+i.f.length+or(i.extra),c=s+u;n.set(i.c,c),pr(n,o,i,i.f,i.u,a,s,i.m),o+=16+u+(i.m?i.m.length:0),s=c+a}catch(n){return p(n,null)}}fn(n,o,h.length,r,t),p(null,n)}),"cbf");a||v();for(var d=u((function(n){var t=i[n],r=e[t],f=r[0],d=r[1],y=mr(),m=f.length;y.p(f);var b=sr(t),w=b.length,z=d.comment,D=z&&sr(z),E=D&&D.length,I=or(d.extra),k=0==d.level?0:8,S=u((function(r,e){if(r)l(),p(r,null);else{var i=e.length;h[n]=Er(d,{size:m,crc:y.d(),c:e,f:b,m:D,u:w!=t.length||D&&z.length!=E,compression:k}),o+=30+w+I+i,s+=76+2*(w+I)+(E||0)+i,--a||v()}}),"cbl");if(w>65535&&S(g(11,0,1),null),k)if(m<16e4)try{S(null,$r(f,d))}catch(n){S(n,null)}else c.push(dn(f,d,S));else S(null,f)}),"_loop_1"),y=0;y<f;++y)d(y);return l}function xt(n,t){t||(t={});var r={},e=[];on(n,"",r,t);var i=0,a=0;for(var o in r){var u=r[o],s=u[0],f=u[1],h=0==f.level?0:8,c=(k=sr(o)).length,l=f.comment,p=l&&sr(l),v=p&&p.length,d=or(f.extra);c>65535&&g(11);var y=h?$r(s,f):s,m=y.length,b=mr();b.p(s),e.push(Er(f,{size:s.length,crc:b.d(),c:y,f:k,m:p,u:c!=o.length||p&&l.length!=v,o:i,compression:h})),i+=30+c+d+m,a+=76+2*(c+d)+(v||0)+m}for(var w=new D(a+22),z=i,E=a-i,I=0;I<e.length;++I){var k=e[I];pr(w,k.o,k,k.f,k.u,k.c.length);var S=30+k.f.length+or(k.extra);w.set(k.c,k.o+S),pr(w,i,k,k.f,k.u,k.c.length,k.o,k.m),i+=16+S+(k.m?k.m.length:0)}return fn(w,i,e.length,E,z),w}u(mt,"zip"),u(xt,"zipSync");var et=function(){function n(){}return u(n,"UnzipPassThrough"),n.prototype.push=function(n,t){this.ondata(null,n,t)},n.compression=0,n}(),zt=function(){function n(){var n=this;this.i=new K((function(t,r){n.ondata(null,t,r)}))}return u(n,"UnzipInflate"),n.prototype.push=function(n,t){try{this.i.push(n,t)}catch(n){this.ondata(n,null,t)}},n.compression=8,n}(),At=function(){function n(n,t){var r=this;t<32e4?this.i=new K((function(n,t){r.ondata(null,n,t)})):(this.i=new Nn((function(n,t,e){r.ondata(n,t,e)})),this.terminate=this.i.terminate)}return u(n,"AsyncUnzipInflate"),n.prototype.push=function(n,t){this.i.terminate&&(n=d(n,0)),this.i.push(n,t)},n.compression=8,n}(),Mt=function(){function n(n){this.onfile=n,this.k=[],this.o={0:et},this.p=er}return u(n,"Unzip"),n.prototype.push=function(n,t){var r=this;if(this.onfile||g(5),this.p||g(4),this.c>0){var e=Math.min(this.c,n.length),i=n.subarray(0,e);if(this.c-=e,this.d?this.d.push(i,!this.c):this.k[0].push(i),(n=n.subarray(e)).length)return this.push(n,t)}else{var a=0,o=0,s=void 0,f=void 0;this.p.length?n.length?((f=new D(this.p.length+n.length)).set(this.p),f.set(n,this.p.length)):f=this.p:f=n;for(var h=f.length,c=this.c,l=c&&this.d,p=u((function(){var n,t=N(f,o);if(67324752==t){a=1,s=o,v.d=null,v.c=0;var e=W(f,o+6),i=W(f,o+8),u=2048&e,l=8&e,p=W(f,o+26),d=W(f,o+28);if(h>o+30+p+d){var y=[];v.k.unshift(y),a=2;var m=N(f,o+18),b=N(f,o+22),w=Hn(f.subarray(o+30,o+=30+p),!u);4294967295==m?(n=l?[-2]:Jn(f,o),m=n[0],b=n[1]):l&&(m=-1),o+=d,v.c=m;var z,D={name:w,compression:i,start:function(){if(D.ondata||g(5),m){var n=r.o[i];n||D.ondata(g(14,"unknown compression type "+i,1),null,!1),(z=m<0?new n(w):new n(w,m,b)).ondata=function(n,t,r){D.ondata(n,t,r)};for(var t=0,e=y;t<e.length;t++){var a=e[t];z.push(a,!1)}r.k[0]==y&&r.c?r.d=z:z.push(er,!0)}else D.ondata(null,er,!0)},terminate:function(){z&&z.terminate&&z.terminate()}};m>=0&&(D.size=m,D.originalSize=b),v.onfile(D)}return"break"}if(c){if(134695760==t)return s=o+=12+(-2==c&&8),a=3,v.c=0,"break";if(33639248==t)return s=o-=4,a=3,v.c=0,"break"}}),"_loop_2"),v=this;o<h-4;++o){if("break"===p())break}if(this.p=er,c<0){var d=a?f.subarray(0,s-12-(-2==c&&8)-(134695760==N(f,s-16)&&4)):f.subarray(0,o);l?l.push(d,!!a):this.k[+(2==a)].push(d)}if(2&a)return this.push(f.subarray(o),t);this.p=f.subarray(o)}t&&(this.c&&g(13),this.p=null)},n.prototype.register=function(n){this.o[n.compression]=n},n}(),Rr="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(n){n()};function Tt(n,t,r){r||(r=t,t={}),"function"!=typeof r&&g(7);var e=[],i=u((function(){for(var n=0;n<e.length;++n)e[n]()}),"tAll"),a={},o=u((function(n,t){Rr((function(){r(n,t)}))}),"cbd");Rr((function(){o=r}));for(var s=n.length-22;101010256!=N(n,s);--s)if(!s||n.length-s>65558)return o(g(13,0,1),null),i;var f=W(n,s+8);if(f){var h=f,c=N(n,s+16),l=4294967295==c;if(l){if(s=N(n,s-12),101075792!=N(n,s))return o(g(13,0,1),null),i;h=f=N(n,s+32),c=N(n,s+48)}for(var p=t&&t.filter,v=u((function(t){var r=jn(n,c,l),s=r[0],h=r[1],v=r[2],y=r[3],m=r[4],b=r[5],w=Wn(n,b);c=m;var z=u((function(n,t){n?(i(),o(n,null)):(t&&(a[y]=t),--f||o(null,a))}),"cbl");if(!p||p({name:y,size:h,originalSize:v,compression:s}))if(s)if(8==s){var E=n.subarray(w,w+h);if(h<32e4)try{z(null,Fr(E,new D(v)))}catch(n){z(n,null)}else e.push(Rn(E,{size:v},z))}else z(g(14,"unknown compression type "+s,1),null);else z(null,d(n,w,w+h));else z(null,null)}),"_loop_3"),y=0;y<h;++y)v(y)}else o(null,{});return i}function Ut(n,t){for(var r={},e=n.length-22;101010256!=N(n,e);--e)(!e||n.length-e>65558)&&g(13);var i=W(n,e+8);if(!i)return{};var a=N(n,e+16),o=4294967295==a;o&&(e=N(n,e-12),101075792!=N(n,e)&&g(13),i=N(n,e+32),a=N(n,e+48));for(var u=t&&t.filter,s=0;s<i;++s){var f=jn(n,a,o),h=f[0],c=f[1],l=f[2],p=f[3],v=f[4],y=f[5],m=Wn(n,y);a=v,(!u||u({name:p,size:c,originalSize:l,compression:h}))&&(h?8==h?r[p]=Fr(n.subarray(m,m+c),new D(l)):g(14,"unknown compression type "+h):r[p]=d(n,m,m+c))}return r}u(Tt,"unzip"),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};