iflow-engine-base-3d 3.11.7 → 3.11.8
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.
- package/dist/bim-engine-sdk.es.js +1 -1
- package/dist/bim-engine-sdk.umd.js +251 -251
- package/dist/chunks/{engine-3d-C7t4h5ek.js → engine-3d-BpjhvH5h.js} +2318 -1947
- package/dist/chunks/{sdk-runtime-ADCm2tCl.js → sdk-runtime-DYC5Yris.js} +1 -1
- package/distGaussian/gaussian.es.js +8 -7
- package/distGaussian/gaussian.umd.js +2 -2
- package/package.json +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(rt,St){typeof exports=="object"&&typeof module<"u"?St(exports,require("three"),require("@mkkellogg/gaussian-splats-3d")):typeof define=="function"&&define.amd?define(["exports","three","@mkkellogg/gaussian-splats-3d"],St):(rt=typeof globalThis<"u"?globalThis:rt||self,St(rt.Gaussian={},rt.THREE,rt.GaussianSplats3D))})(this,(function(rt,St,xn){"use strict";function na(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const d=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,d.get?d:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const dt=na(St),ia=na(xn);var Je=(a=>(a.LoadStart="gaussian-load-start",a.LoadProgress="gaussian-load-progress",a.Loaded="gaussian-loaded",a.LoadError="gaussian-load-error",a.SceneRemoved="gaussian-scene-removed",a.FpsUpdated="gaussian-fps-updated",a.ViewChanged="gaussian-view-changed",a))(Je||{});class En{listeners=new Map;on(e,t){const d=String(e);this.listeners.has(d)||this.listeners.set(d,[]),this.listeners.get(d).push(t)}off(e,t){const d=String(e),x=this.listeners.get(d);if(!x)return;const g=x.indexOf(t);g!==-1&&x.splice(g,1),x.length===0&&this.listeners.delete(d)}trigger(e,t){const d=this.listeners.get(String(e));!d||d.length===0||[...d].forEach(x=>{try{x(t)}catch(g){console.error(`[EventModuleGaussian] event handler failed: ${e}`,g)}})}clear(){this.listeners.clear()}dispose(){this.clear()}}class Sn{scene;constructor(e){this.scene=new dt.Scene,e&&(this.scene.background=new dt.Color(e))}getScene(){return this.scene}setBackgroundColor(e){this.scene.background=e==null?null:new dt.Color(e)}dispose(){this.scene.clear(),this.scene.background=null,this.scene.environment=null}}class bn{camera;container;cameraUp;initialLookAt;constructor(e,t,d,x){this.container=e,this.cameraUp=t,this.initialLookAt=x,this.camera=this.createCamera(d)}createCamera(e){const t=Math.max(this.container.clientWidth,1),d=Math.max(this.container.clientHeight,1),x=new dt.PerspectiveCamera(65,t/d,.1,5e3);return x.position.fromArray(e),x.up.fromArray(this.cameraUp).normalize(),x.lookAt(new dt.Vector3().fromArray(this.initialLookAt)),x.updateProjectionMatrix(),x}getCamera(){return this.camera}updateAspectRatio(e,t){this.camera.aspect=Math.max(e,1)/Math.max(t,1),this.camera.updateProjectionMatrix()}reset(e,t){e&&this.camera.position.fromArray(e),this.camera.lookAt(new dt.Vector3().fromArray(t??this.initialLookAt)),this.camera.updateMatrixWorld(!0)}dispose(){this.camera=null}}const _n="iflowbim.cn",Tn=512,An=128,In=150,wn=38,Dt=290,Jt=190;class Bn{THREE;text;scene;camera;material;sprites=[];size;viewportWidth=0;viewportHeight=0;constructor(e,t=_n){this.THREE=e,this.text=t,this.scene=new e.Scene,this.camera=new e.OrthographicCamera(0,1,1,0,-10,10),this.material=new e.SpriteMaterial({map:new e.CanvasTexture(this.createTextTexture()),transparent:!0,opacity:.46,depthTest:!1,depthWrite:!1,toneMapped:!1}),this.size=new e.Vector2}render(e){}dispose(){this.material.map?.dispose?.(),this.material.dispose?.(),this.sprites.length=0}createTextTexture(){const e=document.createElement("canvas");e.width=Tn,e.height=An;const t=e.getContext("2d");return t&&(t.clearRect(0,0,e.width,e.height),t.textAlign="center",t.textBaseline="middle",t.font="600 54px Arial, Helvetica, sans-serif",t.lineWidth=3,t.strokeStyle="rgba(0, 0, 0, 0.20)",t.fillStyle="rgba(255, 255, 255, 0.24)",t.strokeText(this.text,e.width/2,e.height/2),t.fillText(this.text,e.width/2,e.height/2)),e}updateLayout(e,t){if(e===this.viewportWidth&&t===this.viewportHeight)return;this.viewportWidth=e,this.viewportHeight=t,this.camera.left=-e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-t/2,this.camera.updateProjectionMatrix();const d=Math.ceil(e/Dt)+2,x=Math.ceil(t/Jt)+2,g=d*x;this.ensureSpriteCount(g);let u=0;const r=-e/2-Dt/2,c=-t/2-Jt/2;for(let l=0;l<x;l+=1)for(let b=0;b<d;b+=1){const T=this.sprites[u],E=r+b*Dt+l%2*(Dt/2),s=c+l*Jt;T.position.set(E,s,0),T.visible=!0,u+=1}for(let l=u;l<this.sprites.length;l+=1)this.sprites[l].visible=!1}ensureSpriteCount(e){for(;this.sprites.length<e;){const t=new this.THREE.Sprite(this.material);t.scale.set(In,wn,1),t.rotation.z=-.32,t.renderOrder=999999,this.scene.add(t),this.sprites.push(t)}}}class kn{renderer;viewer;container;animationId=null;isRenderingPaused=!0;fpsFrameCount=0;fpsLastTime=performance.now();fpsInfo={fps:0,frameTimeMs:0,minFps:0};watermark;onBeforeRenderCallback;onAfterRenderCallback;onFpsUpdatedCallback;constructor(e,t,d,x){this.container=e,this.renderer=this.createRenderer(x.antialias),this.watermark=new Bn(dt),this.viewer=new ia.Viewer({selfDrivenMode:!1,renderer:this.renderer,camera:d,threeScene:t,rootElement:e,useBuiltInControls:!0,cameraUp:x.cameraUp,initialCameraPosition:x.initialCameraPosition,initialCameraLookAt:x.initialCameraLookAt,sharedMemoryForWorkers:x.sharedMemoryForWorkers,gpuAcceleratedSort:x.gpuAcceleratedSort,sphericalHarmonicsDegree:x.sphericalHarmonicsDegree,...x.viewerOptions??{}})}createRenderer(e){const t=new dt.WebGLRenderer({antialias:e,alpha:!0,preserveDrawingBuffer:!1});return t.setSize(Math.max(this.container.clientWidth,1),Math.max(this.container.clientHeight,1)),t.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.container.appendChild(t.domElement),t}setOnBeforeRender(e){this.onBeforeRenderCallback=e}setOnAfterRender(e){this.onAfterRenderCallback=e}setOnFpsUpdated(e){this.onFpsUpdatedCallback=e}startRenderLoop(){this.animationId===null&&(this.isRenderingPaused=!1,this.animate())}animate(){if(this.isRenderingPaused){this.animationId=null;return}this.animationId=requestAnimationFrame(()=>this.animate()),this.render()}render(){this.onBeforeRenderCallback?.(),this.viewer.update(this.renderer),this.viewer.render(),this.watermark.render(this.renderer),this.onAfterRenderCallback?.(),this.updateFps()}updateFps(){this.fpsFrameCount++;const e=performance.now(),t=e-this.fpsLastTime;if(t<1e3)return;const d=Math.round(this.fpsFrameCount*1e3/t);this.fpsInfo={fps:d,frameTimeMs:d>0?1e3/d:0,minFps:this.fpsInfo.minFps===0?d:Math.min(this.fpsInfo.minFps,d)},this.fpsFrameCount=0,this.fpsLastTime=e,this.onFpsUpdatedCallback?.({...this.fpsInfo})}resetFpsStats(){this.fpsInfo={fps:0,frameTimeMs:0,minFps:0},this.fpsFrameCount=0,this.fpsLastTime=performance.now()}pauseRendering(){this.isRenderingPaused=!0,this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null)}resumeRendering(){this.isRenderingPaused&&this.startRenderLoop()}isRenderingPausedState(){return this.isRenderingPaused}resize(e,t){this.renderer.setSize(Math.max(e,1),Math.max(t,1)),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2))}getViewer(){return this.viewer}getRenderer(){return this.renderer}getDomElement(){return this.renderer.domElement}getFpsInfo(){return{...this.fpsInfo}}async dispose(){this.pauseRendering(),await this.viewer.dispose(),this.container.contains(this.renderer.domElement)&&this.container.removeChild(this.renderer.domElement),this.watermark.dispose(),this.renderer.dispose(),this.renderer.forceContextLoss()}}const Rn={identity:[0,0,0,1],"x-90":[-.7071068,0,0,.7071068],x90:[.7071068,0,0,.7071068],x180:[1,0,0,0],"y-90":[0,-.7071068,0,.7071068],y90:[0,.7071068,0,.7071068],"z-90":[0,0,-.7071068,.7071068],z90:[0,0,.7071068,.7071068],z180:[0,0,1,0]};class Nn{orientationPreset;constructor(e="x180"){this.orientationPreset=e}setOrientationPreset(e){this.orientationPreset=e}getOrientationPreset(){return this.orientationPreset}getOrientationRotation(){return[...Rn[this.orientationPreset]]}active(){}disActive(){}update(){}dispose(){}}var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ln(a){if(Object.prototype.hasOwnProperty.call(a,"__esModule"))return a;var e=a.default;if(typeof e=="function"){var t=function d(){var x=!1;try{x=this instanceof d}catch{}return x?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(a).forEach(function(d){var x=Object.getOwnPropertyDescriptor(a,d);Object.defineProperty(t,d,x.get?x:{enumerable:!0,get:function(){return a[d]}})}),t}function Ut(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var er={exports:{}};var sa;function Dn(){return sa||(sa=1,(function(a,e){(function(t){a.exports=t()})(function(){return(function t(d,x,g){function u(l,b){if(!x[l]){if(!d[l]){var T=typeof Ut=="function"&&Ut;if(!b&&T)return T(l,!0);if(r)return r(l,!0);var E=new Error("Cannot find module '"+l+"'");throw E.code="MODULE_NOT_FOUND",E}var s=x[l]={exports:{}};d[l][0].call(s.exports,function(v){var h=d[l][1][v];return u(h||v)},s,s.exports,t,d,x,g)}return x[l].exports}for(var r=typeof Ut=="function"&&Ut,c=0;c<g.length;c++)u(g[c]);return u})({1:[function(t,d,x){var g=t("./utils"),u=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";x.encode=function(c){for(var l,b,T,E,s,v,h,y=[],n=0,p=c.length,m=p,_=g.getTypeOf(c)!=="string";n<c.length;)m=p-n,T=_?(l=c[n++],b=n<p?c[n++]:0,n<p?c[n++]:0):(l=c.charCodeAt(n++),b=n<p?c.charCodeAt(n++):0,n<p?c.charCodeAt(n++):0),E=l>>2,s=(3&l)<<4|b>>4,v=1<m?(15&b)<<2|T>>6:64,h=2<m?63&T:64,y.push(r.charAt(E)+r.charAt(s)+r.charAt(v)+r.charAt(h));return y.join("")},x.decode=function(c){var l,b,T,E,s,v,h=0,y=0,n="data:";if(c.substr(0,n.length)===n)throw new Error("Invalid base64 input, it looks like a data url.");var p,m=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===r.charAt(64)&&m--,c.charAt(c.length-2)===r.charAt(64)&&m--,m%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=u.uint8array?new Uint8Array(0|m):new Array(0|m);h<c.length;)l=r.indexOf(c.charAt(h++))<<2|(E=r.indexOf(c.charAt(h++)))>>4,b=(15&E)<<4|(s=r.indexOf(c.charAt(h++)))>>2,T=(3&s)<<6|(v=r.indexOf(c.charAt(h++))),p[y++]=l,s!==64&&(p[y++]=b),v!==64&&(p[y++]=T);return p}},{"./support":30,"./utils":32}],2:[function(t,d,x){var g=t("./external"),u=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),c=t("./stream/DataLengthProbe");function l(b,T,E,s,v){this.compressedSize=b,this.uncompressedSize=T,this.crc32=E,this.compression=s,this.compressedContent=v}l.prototype={getContentWorker:function(){var b=new u(g.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),T=this;return b.on("end",function(){if(this.streamInfo.data_length!==T.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new u(g.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(b,T,E){return b.pipe(new r).pipe(new c("uncompressedSize")).pipe(T.compressWorker(E)).pipe(new c("compressedSize")).withStreamInfo("compression",T)},d.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,d,x){var g=t("./stream/GenericWorker");x.STORE={magic:"\0\0",compressWorker:function(){return new g("STORE compression")},uncompressWorker:function(){return new g("STORE decompression")}},x.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,d,x){var g=t("./utils"),u=(function(){for(var r,c=[],l=0;l<256;l++){r=l;for(var b=0;b<8;b++)r=1&r?3988292384^r>>>1:r>>>1;c[l]=r}return c})();d.exports=function(r,c){return r!==void 0&&r.length?g.getTypeOf(r)!=="string"?(function(l,b,T,E){var s=u,v=E+T;l^=-1;for(var h=E;h<v;h++)l=l>>>8^s[255&(l^b[h])];return-1^l})(0|c,r,r.length,0):(function(l,b,T,E){var s=u,v=E+T;l^=-1;for(var h=E;h<v;h++)l=l>>>8^s[255&(l^b.charCodeAt(h))];return-1^l})(0|c,r,r.length,0):0}},{"./utils":32}],5:[function(t,d,x){x.base64=!1,x.binary=!1,x.dir=!1,x.createFolders=!0,x.date=null,x.compression=null,x.compressionOptions=null,x.comment=null,x.unixPermissions=null,x.dosPermissions=null},{}],6:[function(t,d,x){var g=null;g=typeof Promise<"u"?Promise:t("lie"),d.exports={Promise:g}},{lie:37}],7:[function(t,d,x){var g=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",u=t("pako"),r=t("./utils"),c=t("./stream/GenericWorker"),l=g?"uint8array":"array";function b(T,E){c.call(this,"FlateWorker/"+T),this._pako=null,this._pakoAction=T,this._pakoOptions=E,this.meta={}}x.magic="\b\0",r.inherits(b,c),b.prototype.processChunk=function(T){this.meta=T.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(l,T.data),!1)},b.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new u[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var T=this;this._pako.onData=function(E){T.push({data:E,meta:T.meta})}},x.compressWorker=function(T){return new b("Deflate",T)},x.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,d,x){function g(s,v){var h,y="";for(h=0;h<v;h++)y+=String.fromCharCode(255&s),s>>>=8;return y}function u(s,v,h,y,n,p){var m,_,w=s.file,C=s.compression,o=p!==l.utf8encode,i=r.transformTo("string",p(w.name)),B=r.transformTo("string",l.utf8encode(w.name)),N=w.comment,q=r.transformTo("string",p(N)),I=r.transformTo("string",l.utf8encode(N)),F=B.length!==w.name.length,A=I.length!==N.length,H="",j="",W="",re=w.dir,J=w.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};v&&!h||(oe.crc32=s.crc32,oe.compressedSize=s.compressedSize,oe.uncompressedSize=s.uncompressedSize);var Q=0;v&&(Q|=8),o||!F&&!A||(Q|=2048);var $=0,ce=0;re&&($|=16),n==="UNIX"?(ce=798,$|=(function(ee,ue){var Se=ee;return ee||(Se=ue?16893:33204),(65535&Se)<<16})(w.unixPermissions,re)):(ce=20,$|=(function(ee){return 63&(ee||0)})(w.dosPermissions)),m=J.getUTCHours(),m<<=6,m|=J.getUTCMinutes(),m<<=5,m|=J.getUTCSeconds()/2,_=J.getUTCFullYear()-1980,_<<=4,_|=J.getUTCMonth()+1,_<<=5,_|=J.getUTCDate(),F&&(j=g(1,1)+g(b(i),4)+B,H+="up"+g(j.length,2)+j),A&&(W=g(1,1)+g(b(q),4)+I,H+="uc"+g(W.length,2)+W);var ie="";return ie+=`
|
|
2
|
-
\0`,ie+=g(Q,2),ie+=C.magic,ie+=g(m,2),ie+=g(_,2),ie+=g(oe.crc32,4),ie+=g(oe.compressedSize,4),ie+=g(oe.uncompressedSize,4),ie+=g(i.length,2),ie+=g(H.length,2),{fileRecord:T.LOCAL_FILE_HEADER+ie+i+H,dirRecord:T.CENTRAL_FILE_HEADER+g(ce,2)+ie+g(q.length,2)+"\0\0\0\0"+g($,4)+g(y,4)+i+H+q}}var r=t("../utils"),c=t("../stream/GenericWorker"),l=t("../utf8"),b=t("../crc32"),T=t("../signature");function E(s,v,h,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,this.zipPlatform=h,this.encodeFileName=y,this.streamFiles=s,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(E,c),E.prototype.push=function(s){var v=s.meta.percent||0,h=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(s):(this.bytesWritten+=s.data.length,c.prototype.push.call(this,{data:s.data,meta:{currentFile:this.currentFile,percent:h?(v+100*(h-y-1))/h:100}}))},E.prototype.openedSource=function(s){this.currentSourceOffset=this.bytesWritten,this.currentFile=s.file.name;var v=this.streamFiles&&!s.file.dir;if(v){var h=u(s,v,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},E.prototype.closedSource=function(s){this.accumulate=!1;var v=this.streamFiles&&!s.file.dir,h=u(s,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),v)this.push({data:(function(y){return T.DATA_DESCRIPTOR+g(y.crc32,4)+g(y.compressedSize,4)+g(y.uncompressedSize,4)})(s),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},E.prototype.flush=function(){for(var s=this.bytesWritten,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var h=this.bytesWritten-s,y=(function(n,p,m,_,w){var C=r.transformTo("string",w(_));return T.CENTRAL_DIRECTORY_END+"\0\0\0\0"+g(n,2)+g(n,2)+g(p,4)+g(m,4)+g(C.length,2)+C})(this.dirRecords.length,h,s,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},E.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},E.prototype.registerPrevious=function(s){this._sources.push(s);var v=this;return s.on("data",function(h){v.processChunk(h)}),s.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),s.on("error",function(h){v.error(h)}),this},E.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},E.prototype.error=function(s){var v=this._sources;if(!c.prototype.error.call(this,s))return!1;for(var h=0;h<v.length;h++)try{v[h].error(s)}catch{}return!0},E.prototype.lock=function(){c.prototype.lock.call(this);for(var s=this._sources,v=0;v<s.length;v++)s[v].lock()},d.exports=E},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,d,x){var g=t("../compressions"),u=t("./ZipFileWorker");x.generateWorker=function(r,c,l){var b=new u(c.streamFiles,l,c.platform,c.encodeFileName),T=0;try{r.forEach(function(E,s){T++;var v=(function(p,m){var _=p||m,w=g[_];if(!w)throw new Error(_+" is not a valid compression method !");return w})(s.options.compression,c.compression),h=s.options.compressionOptions||c.compressionOptions||{},y=s.dir,n=s.date;s._compressWorker(v,h).withStreamInfo("file",{name:E,dir:y,date:n,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(b)}),b.entriesCount=T}catch(E){b.error(E)}return b}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,d,x){function g(){if(!(this instanceof g))return new g;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var u=new g;for(var r in this)typeof this[r]!="function"&&(u[r]=this[r]);return u}}(g.prototype=t("./object")).loadAsync=t("./load"),g.support=t("./support"),g.defaults=t("./defaults"),g.version="3.10.1",g.loadAsync=function(u,r){return new g().loadAsync(u,r)},g.external=t("./external"),d.exports=g},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,d,x){var g=t("./utils"),u=t("./external"),r=t("./utf8"),c=t("./zipEntries"),l=t("./stream/Crc32Probe"),b=t("./nodejsUtils");function T(E){return new u.Promise(function(s,v){var h=E.decompressed.getContentWorker().pipe(new l);h.on("error",function(y){v(y)}).on("end",function(){h.streamInfo.crc32!==E.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):s()}).resume()})}d.exports=function(E,s){var v=this;return s=g.extend(s||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),b.isNode&&b.isStream(E)?u.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):g.prepareContent("the loaded zip file",E,!0,s.optimizedBinaryString,s.base64).then(function(h){var y=new c(s);return y.load(h),y}).then(function(h){var y=[u.Promise.resolve(h)],n=h.files;if(s.checkCRC32)for(var p=0;p<n.length;p++)y.push(T(n[p]));return u.Promise.all(y)}).then(function(h){for(var y=h.shift(),n=y.files,p=0;p<n.length;p++){var m=n[p],_=m.fileNameStr,w=g.resolve(m.fileNameStr);v.file(w,m.decompressed,{binary:!0,optimizedBinaryString:!0,date:m.date,dir:m.dir,comment:m.fileCommentStr.length?m.fileCommentStr:null,unixPermissions:m.unixPermissions,dosPermissions:m.dosPermissions,createFolders:s.createFolders}),m.dir||(v.file(w).unsafeOriginalName=_)}return y.zipComment.length&&(v.comment=y.zipComment),v})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,d,x){var g=t("../utils"),u=t("../stream/GenericWorker");function r(c,l){u.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(l)}g.inherits(r,u),r.prototype._bindStream=function(c){var l=this;(this._stream=c).pause(),c.on("data",function(b){l.push({data:b,meta:{percent:0}})}).on("error",function(b){l.isPaused?this.generatedError=b:l.error(b)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},r.prototype.pause=function(){return!!u.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},d.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,d,x){var g=t("readable-stream").Readable;function u(r,c,l){g.call(this,c),this._helper=r;var b=this;r.on("data",function(T,E){b.push(T)||b._helper.pause(),l&&l(E)}).on("error",function(T){b.emit("error",T)}).on("end",function(){b.push(null)})}t("../utils").inherits(u,g),u.prototype._read=function(){this._helper.resume()},d.exports=u},{"../utils":32,"readable-stream":16}],14:[function(t,d,x){d.exports={isNode:typeof Buffer<"u",newBufferFrom:function(g,u){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(g,u);if(typeof g=="number")throw new Error('The "data" argument must not be a number');return new Buffer(g,u)},allocBuffer:function(g){if(Buffer.alloc)return Buffer.alloc(g);var u=new Buffer(g);return u.fill(0),u},isBuffer:function(g){return Buffer.isBuffer(g)},isStream:function(g){return g&&typeof g.on=="function"&&typeof g.pause=="function"&&typeof g.resume=="function"}}},{}],15:[function(t,d,x){function g(w,C,o){var i,B=r.getTypeOf(C),N=r.extend(o||{},b);N.date=N.date||new Date,N.compression!==null&&(N.compression=N.compression.toUpperCase()),typeof N.unixPermissions=="string"&&(N.unixPermissions=parseInt(N.unixPermissions,8)),N.unixPermissions&&16384&N.unixPermissions&&(N.dir=!0),N.dosPermissions&&16&N.dosPermissions&&(N.dir=!0),N.dir&&(w=n(w)),N.createFolders&&(i=y(w))&&p.call(this,i,!0);var q=B==="string"&&N.binary===!1&&N.base64===!1;o&&o.binary!==void 0||(N.binary=!q),(C instanceof T&&C.uncompressedSize===0||N.dir||!C||C.length===0)&&(N.base64=!1,N.binary=!0,C="",N.compression="STORE",B="string");var I=null;I=C instanceof T||C instanceof c?C:v.isNode&&v.isStream(C)?new h(w,C):r.prepareContent(w,C,N.binary,N.optimizedBinaryString,N.base64);var F=new E(w,I,N);this.files[w]=F}var u=t("./utf8"),r=t("./utils"),c=t("./stream/GenericWorker"),l=t("./stream/StreamHelper"),b=t("./defaults"),T=t("./compressedObject"),E=t("./zipObject"),s=t("./generate"),v=t("./nodejsUtils"),h=t("./nodejs/NodejsStreamInputAdapter"),y=function(w){w.slice(-1)==="/"&&(w=w.substring(0,w.length-1));var C=w.lastIndexOf("/");return 0<C?w.substring(0,C):""},n=function(w){return w.slice(-1)!=="/"&&(w+="/"),w},p=function(w,C){return C=C!==void 0?C:b.createFolders,w=n(w),this.files[w]||g.call(this,w,null,{dir:!0,createFolders:C}),this.files[w]};function m(w){return Object.prototype.toString.call(w)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(w){var C,o,i;for(C in this.files)i=this.files[C],(o=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&w(o,i)},filter:function(w){var C=[];return this.forEach(function(o,i){w(o,i)&&C.push(i)}),C},file:function(w,C,o){if(arguments.length!==1)return w=this.root+w,g.call(this,w,C,o),this;if(m(w)){var i=w;return this.filter(function(N,q){return!q.dir&&i.test(N)})}var B=this.files[this.root+w];return B&&!B.dir?B:null},folder:function(w){if(!w)return this;if(m(w))return this.filter(function(B,N){return N.dir&&w.test(B)});var C=this.root+w,o=p.call(this,C),i=this.clone();return i.root=o.name,i},remove:function(w){w=this.root+w;var C=this.files[w];if(C||(w.slice(-1)!=="/"&&(w+="/"),C=this.files[w]),C&&!C.dir)delete this.files[w];else for(var o=this.filter(function(B,N){return N.name.slice(0,w.length)===w}),i=0;i<o.length;i++)delete this.files[o[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(w){var C,o={};try{if((o=r.extend(w||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:u.utf8encode})).type=o.type.toLowerCase(),o.compression=o.compression.toUpperCase(),o.type==="binarystring"&&(o.type="string"),!o.type)throw new Error("No output type specified.");r.checkSupport(o.type),o.platform!=="darwin"&&o.platform!=="freebsd"&&o.platform!=="linux"&&o.platform!=="sunos"||(o.platform="UNIX"),o.platform==="win32"&&(o.platform="DOS");var i=o.comment||this.comment||"";C=s.generateWorker(this,o,i)}catch(B){(C=new c("error")).error(B)}return new l(C,o.type||"string",o.mimeType)},generateAsync:function(w,C){return this.generateInternalStream(w).accumulate(C)},generateNodeStream:function(w,C){return(w=w||{}).type||(w.type="nodebuffer"),this.generateInternalStream(w).toNodejsStream(C)}};d.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,d,x){d.exports=t("stream")},{stream:void 0}],17:[function(t,d,x){var g=t("./DataReader");function u(r){g.call(this,r);for(var c=0;c<this.data.length;c++)r[c]=255&r[c]}t("../utils").inherits(u,g),u.prototype.byteAt=function(r){return this.data[this.zero+r]},u.prototype.lastIndexOfSignature=function(r){for(var c=r.charCodeAt(0),l=r.charCodeAt(1),b=r.charCodeAt(2),T=r.charCodeAt(3),E=this.length-4;0<=E;--E)if(this.data[E]===c&&this.data[E+1]===l&&this.data[E+2]===b&&this.data[E+3]===T)return E-this.zero;return-1},u.prototype.readAndCheckSignature=function(r){var c=r.charCodeAt(0),l=r.charCodeAt(1),b=r.charCodeAt(2),T=r.charCodeAt(3),E=this.readData(4);return c===E[0]&&l===E[1]&&b===E[2]&&T===E[3]},u.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./DataReader":18}],18:[function(t,d,x){var g=t("../utils");function u(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}u.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var c,l=0;for(this.checkOffset(r),c=this.index+r-1;c>=this.index;c--)l=(l<<8)+this.byteAt(c);return this.index+=r,l},readString:function(r){return g.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},d.exports=u},{"../utils":32}],19:[function(t,d,x){var g=t("./Uint8ArrayReader");function u(r){g.call(this,r)}t("../utils").inherits(u,g),u.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,d,x){var g=t("./DataReader");function u(r){g.call(this,r)}t("../utils").inherits(u,g),u.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},u.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},u.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},u.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./DataReader":18}],21:[function(t,d,x){var g=t("./ArrayReader");function u(r){g.call(this,r)}t("../utils").inherits(u,g),u.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./ArrayReader":17}],22:[function(t,d,x){var g=t("../utils"),u=t("../support"),r=t("./ArrayReader"),c=t("./StringReader"),l=t("./NodeBufferReader"),b=t("./Uint8ArrayReader");d.exports=function(T){var E=g.getTypeOf(T);return g.checkSupport(E),E!=="string"||u.uint8array?E==="nodebuffer"?new l(T):u.uint8array?new b(g.transformTo("uint8array",T)):new r(g.transformTo("array",T)):new c(T)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,d,x){x.LOCAL_FILE_HEADER="PK",x.CENTRAL_FILE_HEADER="PK",x.CENTRAL_DIRECTORY_END="PK",x.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",x.ZIP64_CENTRAL_DIRECTORY_END="PK",x.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,d,x){var g=t("./GenericWorker"),u=t("../utils");function r(c){g.call(this,"ConvertWorker to "+c),this.destType=c}u.inherits(r,g),r.prototype.processChunk=function(c){this.push({data:u.transformTo(this.destType,c.data),meta:c.meta})},d.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,d,x){var g=t("./GenericWorker"),u=t("../crc32");function r(){g.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,g),r.prototype.processChunk=function(c){this.streamInfo.crc32=u(c.data,this.streamInfo.crc32||0),this.push(c)},d.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,d,x){var g=t("../utils"),u=t("./GenericWorker");function r(c){u.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}g.inherits(r,u),r.prototype.processChunk=function(c){if(c){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+c.data.length}u.prototype.processChunk.call(this,c)},d.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,d,x){var g=t("../utils"),u=t("./GenericWorker");function r(c){u.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(b){l.dataIsReady=!0,l.data=b,l.max=b&&b.length||0,l.type=g.getTypeOf(b),l.isPaused||l._tickAndRepeat()},function(b){l.error(b)})}g.inherits(r,u),r.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,g.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(g.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,l);break;case"uint8array":c=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":c=this.data.slice(this.index,l)}return this.index=l,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},d.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,d,x){function g(u){this.name=u||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}g.prototype={push:function(u){this.emit("data",u)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(u){this.emit("error",u)}return!0},error:function(u){return!this.isFinished&&(this.isPaused?this.generatedError=u:(this.isFinished=!0,this.emit("error",u),this.previous&&this.previous.error(u),this.cleanUp()),!0)},on:function(u,r){return this._listeners[u].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(u,r){if(this._listeners[u])for(var c=0;c<this._listeners[u].length;c++)this._listeners[u][c].call(this,r)},pipe:function(u){return u.registerPrevious(this)},registerPrevious:function(u){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=u.streamInfo,this.mergeStreamInfo(),this.previous=u;var r=this;return u.on("data",function(c){r.processChunk(c)}),u.on("end",function(){r.end()}),u.on("error",function(c){r.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var u=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),u=!0),this.previous&&this.previous.resume(),!u},flush:function(){},processChunk:function(u){this.push(u)},withStreamInfo:function(u,r){return this.extraStreamInfo[u]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var u in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,u)&&(this.streamInfo[u]=this.extraStreamInfo[u])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var u="Worker "+this.name;return this.previous?this.previous+" -> "+u:u}},d.exports=g},{}],29:[function(t,d,x){var g=t("../utils"),u=t("./ConvertWorker"),r=t("./GenericWorker"),c=t("../base64"),l=t("../support"),b=t("../external"),T=null;if(l.nodestream)try{T=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function E(v,h){return new b.Promise(function(y,n){var p=[],m=v._internalType,_=v._outputType,w=v._mimeType;v.on("data",function(C,o){p.push(C),h&&h(o)}).on("error",function(C){p=[],n(C)}).on("end",function(){try{var C=(function(o,i,B){switch(o){case"blob":return g.newBlob(g.transformTo("arraybuffer",i),B);case"base64":return c.encode(i);default:return g.transformTo(o,i)}})(_,(function(o,i){var B,N=0,q=null,I=0;for(B=0;B<i.length;B++)I+=i[B].length;switch(o){case"string":return i.join("");case"array":return Array.prototype.concat.apply([],i);case"uint8array":for(q=new Uint8Array(I),B=0;B<i.length;B++)q.set(i[B],N),N+=i[B].length;return q;case"nodebuffer":return Buffer.concat(i);default:throw new Error("concat : unsupported type '"+o+"'")}})(m,p),w);y(C)}catch(o){n(o)}p=[]}).resume()})}function s(v,h,y){var n=h;switch(h){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=h,this._mimeType=y,g.checkSupport(n),this._worker=v.pipe(new u(n)),v.lock()}catch(p){this._worker=new r("error"),this._worker.error(p)}}s.prototype={accumulate:function(v){return E(this,v)},on:function(v,h){var y=this;return v==="data"?this._worker.on(v,function(n){h.call(y,n.data,n.meta)}):this._worker.on(v,function(){g.delay(h,arguments,y)}),this},resume:function(){return g.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(v){if(g.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new T(this,{objectMode:this._outputType!=="nodebuffer"},v)}},d.exports=s},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,d,x){if(x.base64=!0,x.array=!0,x.string=!0,x.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",x.nodebuffer=typeof Buffer<"u",x.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")x.blob=!1;else{var g=new ArrayBuffer(0);try{x.blob=new Blob([g],{type:"application/zip"}).size===0}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);u.append(g),x.blob=u.getBlob("application/zip").size===0}catch{x.blob=!1}}}try{x.nodestream=!!t("readable-stream").Readable}catch{x.nodestream=!1}},{"readable-stream":16}],31:[function(t,d,x){for(var g=t("./utils"),u=t("./support"),r=t("./nodejsUtils"),c=t("./stream/GenericWorker"),l=new Array(256),b=0;b<256;b++)l[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;l[254]=l[254]=1;function T(){c.call(this,"utf-8 decode"),this.leftOver=null}function E(){c.call(this,"utf-8 encode")}x.utf8encode=function(s){return u.nodebuffer?r.newBufferFrom(s,"utf-8"):(function(v){var h,y,n,p,m,_=v.length,w=0;for(p=0;p<_;p++)(64512&(y=v.charCodeAt(p)))==55296&&p+1<_&&(64512&(n=v.charCodeAt(p+1)))==56320&&(y=65536+(y-55296<<10)+(n-56320),p++),w+=y<128?1:y<2048?2:y<65536?3:4;for(h=u.uint8array?new Uint8Array(w):new Array(w),p=m=0;m<w;p++)(64512&(y=v.charCodeAt(p)))==55296&&p+1<_&&(64512&(n=v.charCodeAt(p+1)))==56320&&(y=65536+(y-55296<<10)+(n-56320),p++),y<128?h[m++]=y:(y<2048?h[m++]=192|y>>>6:(y<65536?h[m++]=224|y>>>12:(h[m++]=240|y>>>18,h[m++]=128|y>>>12&63),h[m++]=128|y>>>6&63),h[m++]=128|63&y);return h})(s)},x.utf8decode=function(s){return u.nodebuffer?g.transformTo("nodebuffer",s).toString("utf-8"):(function(v){var h,y,n,p,m=v.length,_=new Array(2*m);for(h=y=0;h<m;)if((n=v[h++])<128)_[y++]=n;else if(4<(p=l[n]))_[y++]=65533,h+=p-1;else{for(n&=p===2?31:p===3?15:7;1<p&&h<m;)n=n<<6|63&v[h++],p--;1<p?_[y++]=65533:n<65536?_[y++]=n:(n-=65536,_[y++]=55296|n>>10&1023,_[y++]=56320|1023&n)}return _.length!==y&&(_.subarray?_=_.subarray(0,y):_.length=y),g.applyFromCharCode(_)})(s=g.transformTo(u.uint8array?"uint8array":"array",s))},g.inherits(T,c),T.prototype.processChunk=function(s){var v=g.transformTo(u.uint8array?"uint8array":"array",s.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var h=v;(v=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),v.set(h,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var y=(function(p,m){var _;for((m=m||p.length)>p.length&&(m=p.length),_=m-1;0<=_&&(192&p[_])==128;)_--;return _<0||_===0?m:_+l[p[_]]>m?_:m})(v),n=v;y!==v.length&&(u.uint8array?(n=v.subarray(0,y),this.leftOver=v.subarray(y,v.length)):(n=v.slice(0,y),this.leftOver=v.slice(y,v.length))),this.push({data:x.utf8decode(n),meta:s.meta})},T.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:x.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},x.Utf8DecodeWorker=T,g.inherits(E,c),E.prototype.processChunk=function(s){this.push({data:x.utf8encode(s.data),meta:s.meta})},x.Utf8EncodeWorker=E},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,d,x){var g=t("./support"),u=t("./base64"),r=t("./nodejsUtils"),c=t("./external");function l(h){return h}function b(h,y){for(var n=0;n<h.length;++n)y[n]=255&h.charCodeAt(n);return y}t("setimmediate"),x.newBlob=function(h,y){x.checkSupport("blob");try{return new Blob([h],{type:y})}catch{try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(h),n.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var T={stringifyByChunk:function(h,y,n){var p=[],m=0,_=h.length;if(_<=n)return String.fromCharCode.apply(null,h);for(;m<_;)y==="array"||y==="nodebuffer"?p.push(String.fromCharCode.apply(null,h.slice(m,Math.min(m+n,_)))):p.push(String.fromCharCode.apply(null,h.subarray(m,Math.min(m+n,_)))),m+=n;return p.join("")},stringifyByChar:function(h){for(var y="",n=0;n<h.length;n++)y+=String.fromCharCode(h[n]);return y},applyCanBeUsed:{uint8array:(function(){try{return g.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return g.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function E(h){var y=65536,n=x.getTypeOf(h),p=!0;if(n==="uint8array"?p=T.applyCanBeUsed.uint8array:n==="nodebuffer"&&(p=T.applyCanBeUsed.nodebuffer),p)for(;1<y;)try{return T.stringifyByChunk(h,n,y)}catch{y=Math.floor(y/2)}return T.stringifyByChar(h)}function s(h,y){for(var n=0;n<h.length;n++)y[n]=h[n];return y}x.applyFromCharCode=E;var v={};v.string={string:l,array:function(h){return b(h,new Array(h.length))},arraybuffer:function(h){return v.string.uint8array(h).buffer},uint8array:function(h){return b(h,new Uint8Array(h.length))},nodebuffer:function(h){return b(h,r.allocBuffer(h.length))}},v.array={string:E,array:l,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return r.newBufferFrom(h)}},v.arraybuffer={string:function(h){return E(new Uint8Array(h))},array:function(h){return s(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:l,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return r.newBufferFrom(new Uint8Array(h))}},v.uint8array={string:E,array:function(h){return s(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:l,nodebuffer:function(h){return r.newBufferFrom(h)}},v.nodebuffer={string:E,array:function(h){return s(h,new Array(h.length))},arraybuffer:function(h){return v.nodebuffer.uint8array(h).buffer},uint8array:function(h){return s(h,new Uint8Array(h.length))},nodebuffer:l},x.transformTo=function(h,y){if(y=y||"",!h)return y;x.checkSupport(h);var n=x.getTypeOf(y);return v[n][h](y)},x.resolve=function(h){for(var y=h.split("/"),n=[],p=0;p<y.length;p++){var m=y[p];m==="."||m===""&&p!==0&&p!==y.length-1||(m===".."?n.pop():n.push(m))}return n.join("/")},x.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":g.nodebuffer&&r.isBuffer(h)?"nodebuffer":g.uint8array&&h instanceof Uint8Array?"uint8array":g.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},x.checkSupport=function(h){if(!g[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},x.MAX_VALUE_16BITS=65535,x.MAX_VALUE_32BITS=-1,x.pretty=function(h){var y,n,p="";for(n=0;n<(h||"").length;n++)p+="\\x"+((y=h.charCodeAt(n))<16?"0":"")+y.toString(16).toUpperCase();return p},x.delay=function(h,y,n){setImmediate(function(){h.apply(n||null,y||[])})},x.inherits=function(h,y){function n(){}n.prototype=y.prototype,h.prototype=new n},x.extend=function(){var h,y,n={};for(h=0;h<arguments.length;h++)for(y in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],y)&&n[y]===void 0&&(n[y]=arguments[h][y]);return n},x.prepareContent=function(h,y,n,p,m){return c.Promise.resolve(y).then(function(_){return g.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new c.Promise(function(w,C){var o=new FileReader;o.onload=function(i){w(i.target.result)},o.onerror=function(i){C(i.target.error)},o.readAsArrayBuffer(_)}):_}).then(function(_){var w=x.getTypeOf(_);return w?(w==="arraybuffer"?_=x.transformTo("uint8array",_):w==="string"&&(m?_=u.decode(_):n&&p!==!0&&(_=(function(C){return b(C,g.uint8array?new Uint8Array(C.length):new Array(C.length))})(_))),_):c.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,d,x){var g=t("./reader/readerFor"),u=t("./utils"),r=t("./signature"),c=t("./zipEntry"),l=t("./support");function b(T){this.files=[],this.loadOptions=T}b.prototype={checkSignature:function(T){if(!this.reader.readAndCheckSignature(T)){this.reader.index-=4;var E=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+u.pretty(E)+", expected "+u.pretty(T)+")")}},isSignature:function(T,E){var s=this.reader.index;this.reader.setIndex(T);var v=this.reader.readString(4)===E;return this.reader.setIndex(s),v},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var T=this.reader.readData(this.zipCommentLength),E=l.uint8array?"uint8array":"array",s=u.transformTo(E,T);this.zipComment=this.loadOptions.decodeFileName(s)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var T,E,s,v=this.zip64EndOfCentralSize-44;0<v;)T=this.reader.readInt(2),E=this.reader.readInt(4),s=this.reader.readData(E),this.zip64ExtensibleData[T]={id:T,length:E,value:s}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var T,E;for(T=0;T<this.files.length;T++)E=this.files[T],this.reader.setIndex(E.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),E.readLocalPart(this.reader),E.handleUTF8(),E.processAttributes()},readCentralDir:function(){var T;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(T=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(T);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var T=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(T<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(T);var E=T;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===u.MAX_VALUE_16BITS||this.diskWithCentralDirStart===u.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===u.MAX_VALUE_16BITS||this.centralDirRecords===u.MAX_VALUE_16BITS||this.centralDirSize===u.MAX_VALUE_32BITS||this.centralDirOffset===u.MAX_VALUE_32BITS){if(this.zip64=!0,(T=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(T),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var s=this.centralDirOffset+this.centralDirSize;this.zip64&&(s+=20,s+=12+this.zip64EndOfCentralSize);var v=E-s;if(0<v)this.isSignature(E,r.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" bytes.")},prepareReader:function(T){this.reader=g(T)},load:function(T){this.prepareReader(T),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},d.exports=b},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,d,x){var g=t("./reader/readerFor"),u=t("./utils"),r=t("./compressedObject"),c=t("./crc32"),l=t("./utf8"),b=t("./compressions"),T=t("./support");function E(s,v){this.options=s,this.loadOptions=v}E.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(s){var v,h;if(s.skip(22),this.fileNameLength=s.readInt(2),h=s.readInt(2),this.fileName=s.readData(this.fileNameLength),s.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((v=(function(y){for(var n in b)if(Object.prototype.hasOwnProperty.call(b,n)&&b[n].magic===y)return b[n];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+u.pretty(this.compressionMethod)+" unknown (inner file : "+u.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,v,s.readData(this.compressedSize))},readCentralPart:function(s){this.versionMadeBy=s.readInt(2),s.skip(2),this.bitFlag=s.readInt(2),this.compressionMethod=s.readString(2),this.date=s.readDate(),this.crc32=s.readInt(4),this.compressedSize=s.readInt(4),this.uncompressedSize=s.readInt(4);var v=s.readInt(2);if(this.extraFieldsLength=s.readInt(2),this.fileCommentLength=s.readInt(2),this.diskNumberStart=s.readInt(2),this.internalFileAttributes=s.readInt(2),this.externalFileAttributes=s.readInt(4),this.localHeaderOffset=s.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");s.skip(v),this.readExtraFields(s),this.parseZIP64ExtraField(s),this.fileComment=s.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var s=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),s==0&&(this.dosPermissions=63&this.externalFileAttributes),s==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var s=g(this.extraFields[1].value);this.uncompressedSize===u.MAX_VALUE_32BITS&&(this.uncompressedSize=s.readInt(8)),this.compressedSize===u.MAX_VALUE_32BITS&&(this.compressedSize=s.readInt(8)),this.localHeaderOffset===u.MAX_VALUE_32BITS&&(this.localHeaderOffset=s.readInt(8)),this.diskNumberStart===u.MAX_VALUE_32BITS&&(this.diskNumberStart=s.readInt(4))}},readExtraFields:function(s){var v,h,y,n=s.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});s.index+4<n;)v=s.readInt(2),h=s.readInt(2),y=s.readData(h),this.extraFields[v]={id:v,length:h,value:y};s.setIndex(n)},handleUTF8:function(){var s=T.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;else{var h=u.transformTo(s,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var n=u.transformTo(s,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var s=this.extraFields[28789];if(s){var v=g(s.value);return v.readInt(1)!==1||c(this.fileName)!==v.readInt(4)?null:l.utf8decode(v.readData(s.length-5))}return null},findExtraFieldUnicodeComment:function(){var s=this.extraFields[25461];if(s){var v=g(s.value);return v.readInt(1)!==1||c(this.fileComment)!==v.readInt(4)?null:l.utf8decode(v.readData(s.length-5))}return null}},d.exports=E},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,d,x){function g(v,h,y){this.name=v,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=h,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var u=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),c=t("./utf8"),l=t("./compressedObject"),b=t("./stream/GenericWorker");g.prototype={internalStream:function(v){var h=null,y="string";try{if(!v)throw new Error("No output type specified.");var n=(y=v.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),h=this._decompressWorker();var p=!this._dataBinary;p&&!n&&(h=h.pipe(new c.Utf8EncodeWorker)),!p&&n&&(h=h.pipe(new c.Utf8DecodeWorker))}catch(m){(h=new b("error")).error(m)}return new u(h,y,"")},async:function(v,h){return this.internalStream(v).accumulate(h)},nodeStream:function(v,h){return this.internalStream(v||"nodebuffer").toNodejsStream(h)},_compressWorker:function(v,h){if(this._data instanceof l&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new c.Utf8EncodeWorker)),l.createWorkerFrom(y,v,h)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof b?this._data:new r(this._data)}};for(var T=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],E=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},s=0;s<T.length;s++)g.prototype[T[s]]=E;d.exports=g},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,d,x){(function(g){var u,r,c=g.MutationObserver||g.WebKitMutationObserver;if(c){var l=0,b=new c(v),T=g.document.createTextNode("");b.observe(T,{characterData:!0}),u=function(){T.data=l=++l%2}}else if(g.setImmediate||g.MessageChannel===void 0)u="document"in g&&"onreadystatechange"in g.document.createElement("script")?function(){var h=g.document.createElement("script");h.onreadystatechange=function(){v(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},g.document.documentElement.appendChild(h)}:function(){setTimeout(v,0)};else{var E=new g.MessageChannel;E.port1.onmessage=v,u=function(){E.port2.postMessage(0)}}var s=[];function v(){var h,y;r=!0;for(var n=s.length;n;){for(y=s,s=[],h=-1;++h<n;)y[h]();n=s.length}r=!1}d.exports=function(h){s.push(h)!==1||r||u()}}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,d,x){var g=t("immediate");function u(){}var r={},c=["REJECTED"],l=["FULFILLED"],b=["PENDING"];function T(n){if(typeof n!="function")throw new TypeError("resolver must be a function");this.state=b,this.queue=[],this.outcome=void 0,n!==u&&h(this,n)}function E(n,p,m){this.promise=n,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof m=="function"&&(this.onRejected=m,this.callRejected=this.otherCallRejected)}function s(n,p,m){g(function(){var _;try{_=p(m)}catch(w){return r.reject(n,w)}_===n?r.reject(n,new TypeError("Cannot resolve promise with itself")):r.resolve(n,_)})}function v(n){var p=n&&n.then;if(n&&(typeof n=="object"||typeof n=="function")&&typeof p=="function")return function(){p.apply(n,arguments)}}function h(n,p){var m=!1;function _(o){m||(m=!0,r.reject(n,o))}function w(o){m||(m=!0,r.resolve(n,o))}var C=y(function(){p(w,_)});C.status==="error"&&_(C.value)}function y(n,p){var m={};try{m.value=n(p),m.status="success"}catch(_){m.status="error",m.value=_}return m}(d.exports=T).prototype.finally=function(n){if(typeof n!="function")return this;var p=this.constructor;return this.then(function(m){return p.resolve(n()).then(function(){return m})},function(m){return p.resolve(n()).then(function(){throw m})})},T.prototype.catch=function(n){return this.then(null,n)},T.prototype.then=function(n,p){if(typeof n!="function"&&this.state===l||typeof p!="function"&&this.state===c)return this;var m=new this.constructor(u);return this.state!==b?s(m,this.state===l?n:p,this.outcome):this.queue.push(new E(m,n,p)),m},E.prototype.callFulfilled=function(n){r.resolve(this.promise,n)},E.prototype.otherCallFulfilled=function(n){s(this.promise,this.onFulfilled,n)},E.prototype.callRejected=function(n){r.reject(this.promise,n)},E.prototype.otherCallRejected=function(n){s(this.promise,this.onRejected,n)},r.resolve=function(n,p){var m=y(v,p);if(m.status==="error")return r.reject(n,m.value);var _=m.value;if(_)h(n,_);else{n.state=l,n.outcome=p;for(var w=-1,C=n.queue.length;++w<C;)n.queue[w].callFulfilled(p)}return n},r.reject=function(n,p){n.state=c,n.outcome=p;for(var m=-1,_=n.queue.length;++m<_;)n.queue[m].callRejected(p);return n},T.resolve=function(n){return n instanceof this?n:r.resolve(new this(u),n)},T.reject=function(n){var p=new this(u);return r.reject(p,n)},T.all=function(n){var p=this;if(Object.prototype.toString.call(n)!=="[object Array]")return this.reject(new TypeError("must be an array"));var m=n.length,_=!1;if(!m)return this.resolve([]);for(var w=new Array(m),C=0,o=-1,i=new this(u);++o<m;)B(n[o],o);return i;function B(N,q){p.resolve(N).then(function(I){w[q]=I,++C!==m||_||(_=!0,r.resolve(i,w))},function(I){_||(_=!0,r.reject(i,I))})}},T.race=function(n){var p=this;if(Object.prototype.toString.call(n)!=="[object Array]")return this.reject(new TypeError("must be an array"));var m=n.length,_=!1;if(!m)return this.resolve([]);for(var w=-1,C=new this(u);++w<m;)o=n[w],p.resolve(o).then(function(i){_||(_=!0,r.resolve(C,i))},function(i){_||(_=!0,r.reject(C,i))});var o;return C}},{immediate:36}],38:[function(t,d,x){var g={};(0,t("./lib/utils/common").assign)(g,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),d.exports=g},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,d,x){var g=t("./zlib/deflate"),u=t("./utils/common"),r=t("./utils/strings"),c=t("./zlib/messages"),l=t("./zlib/zstream"),b=Object.prototype.toString,T=0,E=-1,s=0,v=8;function h(n){if(!(this instanceof h))return new h(n);this.options=u.assign({level:E,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:s,to:""},n||{});var p=this.options;p.raw&&0<p.windowBits?p.windowBits=-p.windowBits:p.gzip&&0<p.windowBits&&p.windowBits<16&&(p.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var m=g.deflateInit2(this.strm,p.level,p.method,p.windowBits,p.memLevel,p.strategy);if(m!==T)throw new Error(c[m]);if(p.header&&g.deflateSetHeader(this.strm,p.header),p.dictionary){var _;if(_=typeof p.dictionary=="string"?r.string2buf(p.dictionary):b.call(p.dictionary)==="[object ArrayBuffer]"?new Uint8Array(p.dictionary):p.dictionary,(m=g.deflateSetDictionary(this.strm,_))!==T)throw new Error(c[m]);this._dict_set=!0}}function y(n,p){var m=new h(p);if(m.push(n,!0),m.err)throw m.msg||c[m.err];return m.result}h.prototype.push=function(n,p){var m,_,w=this.strm,C=this.options.chunkSize;if(this.ended)return!1;_=p===~~p?p:p===!0?4:0,typeof n=="string"?w.input=r.string2buf(n):b.call(n)==="[object ArrayBuffer]"?w.input=new Uint8Array(n):w.input=n,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new u.Buf8(C),w.next_out=0,w.avail_out=C),(m=g.deflate(w,_))!==1&&m!==T)return this.onEnd(m),!(this.ended=!0);w.avail_out!==0&&(w.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(u.shrinkBuf(w.output,w.next_out))):this.onData(u.shrinkBuf(w.output,w.next_out)))}while((0<w.avail_in||w.avail_out===0)&&m!==1);return _===4?(m=g.deflateEnd(this.strm),this.onEnd(m),this.ended=!0,m===T):_!==2||(this.onEnd(T),!(w.avail_out=0))},h.prototype.onData=function(n){this.chunks.push(n)},h.prototype.onEnd=function(n){n===T&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},x.Deflate=h,x.deflate=y,x.deflateRaw=function(n,p){return(p=p||{}).raw=!0,y(n,p)},x.gzip=function(n,p){return(p=p||{}).gzip=!0,y(n,p)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,d,x){var g=t("./zlib/inflate"),u=t("./utils/common"),r=t("./utils/strings"),c=t("./zlib/constants"),l=t("./zlib/messages"),b=t("./zlib/zstream"),T=t("./zlib/gzheader"),E=Object.prototype.toString;function s(h){if(!(this instanceof s))return new s(h);this.options=u.assign({chunkSize:16384,windowBits:0,to:""},h||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||h&&h.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var n=g.inflateInit2(this.strm,y.windowBits);if(n!==c.Z_OK)throw new Error(l[n]);this.header=new T,g.inflateGetHeader(this.strm,this.header)}function v(h,y){var n=new s(y);if(n.push(h,!0),n.err)throw n.msg||l[n.err];return n.result}s.prototype.push=function(h,y){var n,p,m,_,w,C,o=this.strm,i=this.options.chunkSize,B=this.options.dictionary,N=!1;if(this.ended)return!1;p=y===~~y?y:y===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof h=="string"?o.input=r.binstring2buf(h):E.call(h)==="[object ArrayBuffer]"?o.input=new Uint8Array(h):o.input=h,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new u.Buf8(i),o.next_out=0,o.avail_out=i),(n=g.inflate(o,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&B&&(C=typeof B=="string"?r.string2buf(B):E.call(B)==="[object ArrayBuffer]"?new Uint8Array(B):B,n=g.inflateSetDictionary(this.strm,C)),n===c.Z_BUF_ERROR&&N===!0&&(n=c.Z_OK,N=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),!(this.ended=!0);o.next_out&&(o.avail_out!==0&&n!==c.Z_STREAM_END&&(o.avail_in!==0||p!==c.Z_FINISH&&p!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(m=r.utf8border(o.output,o.next_out),_=o.next_out-m,w=r.buf2string(o.output,m),o.next_out=_,o.avail_out=i-_,_&&u.arraySet(o.output,o.output,m,_,0),this.onData(w)):this.onData(u.shrinkBuf(o.output,o.next_out)))),o.avail_in===0&&o.avail_out===0&&(N=!0)}while((0<o.avail_in||o.avail_out===0)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(p=c.Z_FINISH),p===c.Z_FINISH?(n=g.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):p!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(o.avail_out=0))},s.prototype.onData=function(h){this.chunks.push(h)},s.prototype.onEnd=function(h){h===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},x.Inflate=s,x.inflate=v,x.inflateRaw=function(h,y){return(y=y||{}).raw=!0,v(h,y)},x.ungzip=v},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,d,x){var g=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";x.assign=function(c){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var b=l.shift();if(b){if(typeof b!="object")throw new TypeError(b+"must be non-object");for(var T in b)b.hasOwnProperty(T)&&(c[T]=b[T])}}return c},x.shrinkBuf=function(c,l){return c.length===l?c:c.subarray?c.subarray(0,l):(c.length=l,c)};var u={arraySet:function(c,l,b,T,E){if(l.subarray&&c.subarray)c.set(l.subarray(b,b+T),E);else for(var s=0;s<T;s++)c[E+s]=l[b+s]},flattenChunks:function(c){var l,b,T,E,s,v;for(l=T=0,b=c.length;l<b;l++)T+=c[l].length;for(v=new Uint8Array(T),l=E=0,b=c.length;l<b;l++)s=c[l],v.set(s,E),E+=s.length;return v}},r={arraySet:function(c,l,b,T,E){for(var s=0;s<T;s++)c[E+s]=l[b+s]},flattenChunks:function(c){return[].concat.apply([],c)}};x.setTyped=function(c){c?(x.Buf8=Uint8Array,x.Buf16=Uint16Array,x.Buf32=Int32Array,x.assign(x,u)):(x.Buf8=Array,x.Buf16=Array,x.Buf32=Array,x.assign(x,r))},x.setTyped(g)},{}],42:[function(t,d,x){var g=t("./common"),u=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{u=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var c=new g.Buf8(256),l=0;l<256;l++)c[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function b(T,E){if(E<65537&&(T.subarray&&r||!T.subarray&&u))return String.fromCharCode.apply(null,g.shrinkBuf(T,E));for(var s="",v=0;v<E;v++)s+=String.fromCharCode(T[v]);return s}c[254]=c[254]=1,x.string2buf=function(T){var E,s,v,h,y,n=T.length,p=0;for(h=0;h<n;h++)(64512&(s=T.charCodeAt(h)))==55296&&h+1<n&&(64512&(v=T.charCodeAt(h+1)))==56320&&(s=65536+(s-55296<<10)+(v-56320),h++),p+=s<128?1:s<2048?2:s<65536?3:4;for(E=new g.Buf8(p),h=y=0;y<p;h++)(64512&(s=T.charCodeAt(h)))==55296&&h+1<n&&(64512&(v=T.charCodeAt(h+1)))==56320&&(s=65536+(s-55296<<10)+(v-56320),h++),s<128?E[y++]=s:(s<2048?E[y++]=192|s>>>6:(s<65536?E[y++]=224|s>>>12:(E[y++]=240|s>>>18,E[y++]=128|s>>>12&63),E[y++]=128|s>>>6&63),E[y++]=128|63&s);return E},x.buf2binstring=function(T){return b(T,T.length)},x.binstring2buf=function(T){for(var E=new g.Buf8(T.length),s=0,v=E.length;s<v;s++)E[s]=T.charCodeAt(s);return E},x.buf2string=function(T,E){var s,v,h,y,n=E||T.length,p=new Array(2*n);for(s=v=0;s<n;)if((h=T[s++])<128)p[v++]=h;else if(4<(y=c[h]))p[v++]=65533,s+=y-1;else{for(h&=y===2?31:y===3?15:7;1<y&&s<n;)h=h<<6|63&T[s++],y--;1<y?p[v++]=65533:h<65536?p[v++]=h:(h-=65536,p[v++]=55296|h>>10&1023,p[v++]=56320|1023&h)}return b(p,v)},x.utf8border=function(T,E){var s;for((E=E||T.length)>T.length&&(E=T.length),s=E-1;0<=s&&(192&T[s])==128;)s--;return s<0||s===0?E:s+c[T[s]]>E?s:E}},{"./common":41}],43:[function(t,d,x){d.exports=function(g,u,r,c){for(var l=65535&g|0,b=g>>>16&65535|0,T=0;r!==0;){for(r-=T=2e3<r?2e3:r;b=b+(l=l+u[c++]|0)|0,--T;);l%=65521,b%=65521}return l|b<<16|0}},{}],44:[function(t,d,x){d.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,d,x){var g=(function(){for(var u,r=[],c=0;c<256;c++){u=c;for(var l=0;l<8;l++)u=1&u?3988292384^u>>>1:u>>>1;r[c]=u}return r})();d.exports=function(u,r,c,l){var b=g,T=l+c;u^=-1;for(var E=l;E<T;E++)u=u>>>8^b[255&(u^r[E])];return-1^u}},{}],46:[function(t,d,x){var g,u=t("../utils/common"),r=t("./trees"),c=t("./adler32"),l=t("./crc32"),b=t("./messages"),T=0,E=4,s=0,v=-2,h=-1,y=4,n=2,p=8,m=9,_=286,w=30,C=19,o=2*_+1,i=15,B=3,N=258,q=N+B+1,I=42,F=113,A=1,H=2,j=3,W=4;function re(f,L){return f.msg=b[L],L}function J(f){return(f<<1)-(4<f?9:0)}function oe(f){for(var L=f.length;0<=--L;)f[L]=0}function Q(f){var L=f.state,G=L.pending;G>f.avail_out&&(G=f.avail_out),G!==0&&(u.arraySet(f.output,L.pending_buf,L.pending_out,G,f.next_out),f.next_out+=G,L.pending_out+=G,f.total_out+=G,f.avail_out-=G,L.pending-=G,L.pending===0&&(L.pending_out=0))}function $(f,L){r._tr_flush_block(f,0<=f.block_start?f.block_start:-1,f.strstart-f.block_start,L),f.block_start=f.strstart,Q(f.strm)}function ce(f,L){f.pending_buf[f.pending++]=L}function ie(f,L){f.pending_buf[f.pending++]=L>>>8&255,f.pending_buf[f.pending++]=255&L}function ee(f,L){var G,M,V=f.max_chain_length,K=f.strstart,X=f.prev_length,te=f.nice_match,Y=f.strstart>f.w_size-q?f.strstart-(f.w_size-q):0,ae=f.window,fe=f.w_mask,se=f.prev,de=f.strstart+N,ye=ae[K+X-1],ge=ae[K+X];f.prev_length>=f.good_match&&(V>>=2),te>f.lookahead&&(te=f.lookahead);do if(ae[(G=L)+X]===ge&&ae[G+X-1]===ye&&ae[G]===ae[K]&&ae[++G]===ae[K+1]){K+=2,G++;do;while(ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&K<de);if(M=N-(de-K),K=de-N,X<M){if(f.match_start=L,te<=(X=M))break;ye=ae[K+X-1],ge=ae[K+X]}}while((L=se[L&fe])>Y&&--V!=0);return X<=f.lookahead?X:f.lookahead}function ue(f){var L,G,M,V,K,X,te,Y,ae,fe,se=f.w_size;do{if(V=f.window_size-f.lookahead-f.strstart,f.strstart>=se+(se-q)){for(u.arraySet(f.window,f.window,se,se,0),f.match_start-=se,f.strstart-=se,f.block_start-=se,L=G=f.hash_size;M=f.head[--L],f.head[L]=se<=M?M-se:0,--G;);for(L=G=se;M=f.prev[--L],f.prev[L]=se<=M?M-se:0,--G;);V+=se}if(f.strm.avail_in===0)break;if(X=f.strm,te=f.window,Y=f.strstart+f.lookahead,ae=V,fe=void 0,fe=X.avail_in,ae<fe&&(fe=ae),G=fe===0?0:(X.avail_in-=fe,u.arraySet(te,X.input,X.next_in,fe,Y),X.state.wrap===1?X.adler=c(X.adler,te,fe,Y):X.state.wrap===2&&(X.adler=l(X.adler,te,fe,Y)),X.next_in+=fe,X.total_in+=fe,fe),f.lookahead+=G,f.lookahead+f.insert>=B)for(K=f.strstart-f.insert,f.ins_h=f.window[K],f.ins_h=(f.ins_h<<f.hash_shift^f.window[K+1])&f.hash_mask;f.insert&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[K+B-1])&f.hash_mask,f.prev[K&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=K,K++,f.insert--,!(f.lookahead+f.insert<B)););}while(f.lookahead<q&&f.strm.avail_in!==0)}function Se(f,L){for(var G,M;;){if(f.lookahead<q){if(ue(f),f.lookahead<q&&L===T)return A;if(f.lookahead===0)break}if(G=0,f.lookahead>=B&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),G!==0&&f.strstart-G<=f.w_size-q&&(f.match_length=ee(f,G)),f.match_length>=B)if(M=r._tr_tally(f,f.strstart-f.match_start,f.match_length-B),f.lookahead-=f.match_length,f.match_length<=f.max_lazy_match&&f.lookahead>=B){for(f.match_length--;f.strstart++,f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart,--f.match_length!=0;);f.strstart++}else f.strstart+=f.match_length,f.match_length=0,f.ins_h=f.window[f.strstart],f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+1])&f.hash_mask;else M=r._tr_tally(f,0,f.window[f.strstart]),f.lookahead--,f.strstart++;if(M&&($(f,!1),f.strm.avail_out===0))return A}return f.insert=f.strstart<B-1?f.strstart:B-1,L===E?($(f,!0),f.strm.avail_out===0?j:W):f.last_lit&&($(f,!1),f.strm.avail_out===0)?A:H}function ve(f,L){for(var G,M,V;;){if(f.lookahead<q){if(ue(f),f.lookahead<q&&L===T)return A;if(f.lookahead===0)break}if(G=0,f.lookahead>=B&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),f.prev_length=f.match_length,f.prev_match=f.match_start,f.match_length=B-1,G!==0&&f.prev_length<f.max_lazy_match&&f.strstart-G<=f.w_size-q&&(f.match_length=ee(f,G),f.match_length<=5&&(f.strategy===1||f.match_length===B&&4096<f.strstart-f.match_start)&&(f.match_length=B-1)),f.prev_length>=B&&f.match_length<=f.prev_length){for(V=f.strstart+f.lookahead-B,M=r._tr_tally(f,f.strstart-1-f.prev_match,f.prev_length-B),f.lookahead-=f.prev_length-1,f.prev_length-=2;++f.strstart<=V&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),--f.prev_length!=0;);if(f.match_available=0,f.match_length=B-1,f.strstart++,M&&($(f,!1),f.strm.avail_out===0))return A}else if(f.match_available){if((M=r._tr_tally(f,0,f.window[f.strstart-1]))&&$(f,!1),f.strstart++,f.lookahead--,f.strm.avail_out===0)return A}else f.match_available=1,f.strstart++,f.lookahead--}return f.match_available&&(M=r._tr_tally(f,0,f.window[f.strstart-1]),f.match_available=0),f.insert=f.strstart<B-1?f.strstart:B-1,L===E?($(f,!0),f.strm.avail_out===0?j:W):f.last_lit&&($(f,!1),f.strm.avail_out===0)?A:H}function k(f,L,G,M,V){this.good_length=f,this.max_lazy=L,this.nice_length=G,this.max_chain=M,this.func=V}function O(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new u.Buf16(2*o),this.dyn_dtree=new u.Buf16(2*(2*w+1)),this.bl_tree=new u.Buf16(2*(2*C+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new u.Buf16(i+1),this.heap=new u.Buf16(2*_+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new u.Buf16(2*_+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function P(f){var L;return f&&f.state?(f.total_in=f.total_out=0,f.data_type=n,(L=f.state).pending=0,L.pending_out=0,L.wrap<0&&(L.wrap=-L.wrap),L.status=L.wrap?I:F,f.adler=L.wrap===2?0:1,L.last_flush=T,r._tr_init(L),s):re(f,v)}function D(f){var L=P(f);return L===s&&(function(G){G.window_size=2*G.w_size,oe(G.head),G.max_lazy_match=g[G.level].max_lazy,G.good_match=g[G.level].good_length,G.nice_match=g[G.level].nice_length,G.max_chain_length=g[G.level].max_chain,G.strstart=0,G.block_start=0,G.lookahead=0,G.insert=0,G.match_length=G.prev_length=B-1,G.match_available=0,G.ins_h=0})(f.state),L}function S(f,L,G,M,V,K){if(!f)return v;var X=1;if(L===h&&(L=6),M<0?(X=0,M=-M):15<M&&(X=2,M-=16),V<1||m<V||G!==p||M<8||15<M||L<0||9<L||K<0||y<K)return re(f,v);M===8&&(M=9);var te=new O;return(f.state=te).strm=f,te.wrap=X,te.gzhead=null,te.w_bits=M,te.w_size=1<<te.w_bits,te.w_mask=te.w_size-1,te.hash_bits=V+7,te.hash_size=1<<te.hash_bits,te.hash_mask=te.hash_size-1,te.hash_shift=~~((te.hash_bits+B-1)/B),te.window=new u.Buf8(2*te.w_size),te.head=new u.Buf16(te.hash_size),te.prev=new u.Buf16(te.w_size),te.lit_bufsize=1<<V+6,te.pending_buf_size=4*te.lit_bufsize,te.pending_buf=new u.Buf8(te.pending_buf_size),te.d_buf=1*te.lit_bufsize,te.l_buf=3*te.lit_bufsize,te.level=L,te.strategy=K,te.method=G,D(f)}g=[new k(0,0,0,0,function(f,L){var G=65535;for(G>f.pending_buf_size-5&&(G=f.pending_buf_size-5);;){if(f.lookahead<=1){if(ue(f),f.lookahead===0&&L===T)return A;if(f.lookahead===0)break}f.strstart+=f.lookahead,f.lookahead=0;var M=f.block_start+G;if((f.strstart===0||f.strstart>=M)&&(f.lookahead=f.strstart-M,f.strstart=M,$(f,!1),f.strm.avail_out===0)||f.strstart-f.block_start>=f.w_size-q&&($(f,!1),f.strm.avail_out===0))return A}return f.insert=0,L===E?($(f,!0),f.strm.avail_out===0?j:W):(f.strstart>f.block_start&&($(f,!1),f.strm.avail_out),A)}),new k(4,4,8,4,Se),new k(4,5,16,8,Se),new k(4,6,32,32,Se),new k(4,4,16,16,ve),new k(8,16,32,32,ve),new k(8,16,128,128,ve),new k(8,32,128,256,ve),new k(32,128,258,1024,ve),new k(32,258,258,4096,ve)],x.deflateInit=function(f,L){return S(f,L,p,15,8,0)},x.deflateInit2=S,x.deflateReset=D,x.deflateResetKeep=P,x.deflateSetHeader=function(f,L){return f&&f.state?f.state.wrap!==2?v:(f.state.gzhead=L,s):v},x.deflate=function(f,L){var G,M,V,K;if(!f||!f.state||5<L||L<0)return f?re(f,v):v;if(M=f.state,!f.output||!f.input&&f.avail_in!==0||M.status===666&&L!==E)return re(f,f.avail_out===0?-5:v);if(M.strm=f,G=M.last_flush,M.last_flush=L,M.status===I)if(M.wrap===2)f.adler=0,ce(M,31),ce(M,139),ce(M,8),M.gzhead?(ce(M,(M.gzhead.text?1:0)+(M.gzhead.hcrc?2:0)+(M.gzhead.extra?4:0)+(M.gzhead.name?8:0)+(M.gzhead.comment?16:0)),ce(M,255&M.gzhead.time),ce(M,M.gzhead.time>>8&255),ce(M,M.gzhead.time>>16&255),ce(M,M.gzhead.time>>24&255),ce(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),ce(M,255&M.gzhead.os),M.gzhead.extra&&M.gzhead.extra.length&&(ce(M,255&M.gzhead.extra.length),ce(M,M.gzhead.extra.length>>8&255)),M.gzhead.hcrc&&(f.adler=l(f.adler,M.pending_buf,M.pending,0)),M.gzindex=0,M.status=69):(ce(M,0),ce(M,0),ce(M,0),ce(M,0),ce(M,0),ce(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),ce(M,3),M.status=F);else{var X=p+(M.w_bits-8<<4)<<8;X|=(2<=M.strategy||M.level<2?0:M.level<6?1:M.level===6?2:3)<<6,M.strstart!==0&&(X|=32),X+=31-X%31,M.status=F,ie(M,X),M.strstart!==0&&(ie(M,f.adler>>>16),ie(M,65535&f.adler)),f.adler=1}if(M.status===69)if(M.gzhead.extra){for(V=M.pending;M.gzindex<(65535&M.gzhead.extra.length)&&(M.pending!==M.pending_buf_size||(M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),Q(f),V=M.pending,M.pending!==M.pending_buf_size));)ce(M,255&M.gzhead.extra[M.gzindex]),M.gzindex++;M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),M.gzindex===M.gzhead.extra.length&&(M.gzindex=0,M.status=73)}else M.status=73;if(M.status===73)if(M.gzhead.name){V=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),Q(f),V=M.pending,M.pending===M.pending_buf_size)){K=1;break}K=M.gzindex<M.gzhead.name.length?255&M.gzhead.name.charCodeAt(M.gzindex++):0,ce(M,K)}while(K!==0);M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),K===0&&(M.gzindex=0,M.status=91)}else M.status=91;if(M.status===91)if(M.gzhead.comment){V=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),Q(f),V=M.pending,M.pending===M.pending_buf_size)){K=1;break}K=M.gzindex<M.gzhead.comment.length?255&M.gzhead.comment.charCodeAt(M.gzindex++):0,ce(M,K)}while(K!==0);M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),K===0&&(M.status=103)}else M.status=103;if(M.status===103&&(M.gzhead.hcrc?(M.pending+2>M.pending_buf_size&&Q(f),M.pending+2<=M.pending_buf_size&&(ce(M,255&f.adler),ce(M,f.adler>>8&255),f.adler=0,M.status=F)):M.status=F),M.pending!==0){if(Q(f),f.avail_out===0)return M.last_flush=-1,s}else if(f.avail_in===0&&J(L)<=J(G)&&L!==E)return re(f,-5);if(M.status===666&&f.avail_in!==0)return re(f,-5);if(f.avail_in!==0||M.lookahead!==0||L!==T&&M.status!==666){var te=M.strategy===2?(function(Y,ae){for(var fe;;){if(Y.lookahead===0&&(ue(Y),Y.lookahead===0)){if(ae===T)return A;break}if(Y.match_length=0,fe=r._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++,fe&&($(Y,!1),Y.strm.avail_out===0))return A}return Y.insert=0,ae===E?($(Y,!0),Y.strm.avail_out===0?j:W):Y.last_lit&&($(Y,!1),Y.strm.avail_out===0)?A:H})(M,L):M.strategy===3?(function(Y,ae){for(var fe,se,de,ye,ge=Y.window;;){if(Y.lookahead<=N){if(ue(Y),Y.lookahead<=N&&ae===T)return A;if(Y.lookahead===0)break}if(Y.match_length=0,Y.lookahead>=B&&0<Y.strstart&&(se=ge[de=Y.strstart-1])===ge[++de]&&se===ge[++de]&&se===ge[++de]){ye=Y.strstart+N;do;while(se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&de<ye);Y.match_length=N-(ye-de),Y.match_length>Y.lookahead&&(Y.match_length=Y.lookahead)}if(Y.match_length>=B?(fe=r._tr_tally(Y,1,Y.match_length-B),Y.lookahead-=Y.match_length,Y.strstart+=Y.match_length,Y.match_length=0):(fe=r._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++),fe&&($(Y,!1),Y.strm.avail_out===0))return A}return Y.insert=0,ae===E?($(Y,!0),Y.strm.avail_out===0?j:W):Y.last_lit&&($(Y,!1),Y.strm.avail_out===0)?A:H})(M,L):g[M.level].func(M,L);if(te!==j&&te!==W||(M.status=666),te===A||te===j)return f.avail_out===0&&(M.last_flush=-1),s;if(te===H&&(L===1?r._tr_align(M):L!==5&&(r._tr_stored_block(M,0,0,!1),L===3&&(oe(M.head),M.lookahead===0&&(M.strstart=0,M.block_start=0,M.insert=0))),Q(f),f.avail_out===0))return M.last_flush=-1,s}return L!==E?s:M.wrap<=0?1:(M.wrap===2?(ce(M,255&f.adler),ce(M,f.adler>>8&255),ce(M,f.adler>>16&255),ce(M,f.adler>>24&255),ce(M,255&f.total_in),ce(M,f.total_in>>8&255),ce(M,f.total_in>>16&255),ce(M,f.total_in>>24&255)):(ie(M,f.adler>>>16),ie(M,65535&f.adler)),Q(f),0<M.wrap&&(M.wrap=-M.wrap),M.pending!==0?s:1)},x.deflateEnd=function(f){var L;return f&&f.state?(L=f.state.status)!==I&&L!==69&&L!==73&&L!==91&&L!==103&&L!==F&&L!==666?re(f,v):(f.state=null,L===F?re(f,-3):s):v},x.deflateSetDictionary=function(f,L){var G,M,V,K,X,te,Y,ae,fe=L.length;if(!f||!f.state||(K=(G=f.state).wrap)===2||K===1&&G.status!==I||G.lookahead)return v;for(K===1&&(f.adler=c(f.adler,L,fe,0)),G.wrap=0,fe>=G.w_size&&(K===0&&(oe(G.head),G.strstart=0,G.block_start=0,G.insert=0),ae=new u.Buf8(G.w_size),u.arraySet(ae,L,fe-G.w_size,G.w_size,0),L=ae,fe=G.w_size),X=f.avail_in,te=f.next_in,Y=f.input,f.avail_in=fe,f.next_in=0,f.input=L,ue(G);G.lookahead>=B;){for(M=G.strstart,V=G.lookahead-(B-1);G.ins_h=(G.ins_h<<G.hash_shift^G.window[M+B-1])&G.hash_mask,G.prev[M&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=M,M++,--V;);G.strstart=M,G.lookahead=B-1,ue(G)}return G.strstart+=G.lookahead,G.block_start=G.strstart,G.insert=G.lookahead,G.lookahead=0,G.match_length=G.prev_length=B-1,G.match_available=0,f.next_in=te,f.input=Y,f.avail_in=X,G.wrap=K,s},x.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,d,x){d.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,d,x){d.exports=function(g,u){var r,c,l,b,T,E,s,v,h,y,n,p,m,_,w,C,o,i,B,N,q,I,F,A,H;r=g.state,c=g.next_in,A=g.input,l=c+(g.avail_in-5),b=g.next_out,H=g.output,T=b-(u-g.avail_out),E=b+(g.avail_out-257),s=r.dmax,v=r.wsize,h=r.whave,y=r.wnext,n=r.window,p=r.hold,m=r.bits,_=r.lencode,w=r.distcode,C=(1<<r.lenbits)-1,o=(1<<r.distbits)-1;e:do{m<15&&(p+=A[c++]<<m,m+=8,p+=A[c++]<<m,m+=8),i=_[p&C];t:for(;;){if(p>>>=B=i>>>24,m-=B,(B=i>>>16&255)===0)H[b++]=65535&i;else{if(!(16&B)){if((64&B)==0){i=_[(65535&i)+(p&(1<<B)-1)];continue t}if(32&B){r.mode=12;break e}g.msg="invalid literal/length code",r.mode=30;break e}N=65535&i,(B&=15)&&(m<B&&(p+=A[c++]<<m,m+=8),N+=p&(1<<B)-1,p>>>=B,m-=B),m<15&&(p+=A[c++]<<m,m+=8,p+=A[c++]<<m,m+=8),i=w[p&o];r:for(;;){if(p>>>=B=i>>>24,m-=B,!(16&(B=i>>>16&255))){if((64&B)==0){i=w[(65535&i)+(p&(1<<B)-1)];continue r}g.msg="invalid distance code",r.mode=30;break e}if(q=65535&i,m<(B&=15)&&(p+=A[c++]<<m,(m+=8)<B&&(p+=A[c++]<<m,m+=8)),s<(q+=p&(1<<B)-1)){g.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=B,m-=B,(B=b-T)<q){if(h<(B=q-B)&&r.sane){g.msg="invalid distance too far back",r.mode=30;break e}if(F=n,(I=0)===y){if(I+=v-B,B<N){for(N-=B;H[b++]=n[I++],--B;);I=b-q,F=H}}else if(y<B){if(I+=v+y-B,(B-=y)<N){for(N-=B;H[b++]=n[I++],--B;);if(I=0,y<N){for(N-=B=y;H[b++]=n[I++],--B;);I=b-q,F=H}}}else if(I+=y-B,B<N){for(N-=B;H[b++]=n[I++],--B;);I=b-q,F=H}for(;2<N;)H[b++]=F[I++],H[b++]=F[I++],H[b++]=F[I++],N-=3;N&&(H[b++]=F[I++],1<N&&(H[b++]=F[I++]))}else{for(I=b-q;H[b++]=H[I++],H[b++]=H[I++],H[b++]=H[I++],2<(N-=3););N&&(H[b++]=H[I++],1<N&&(H[b++]=H[I++]))}break}}break}}while(c<l&&b<E);c-=N=m>>3,p&=(1<<(m-=N<<3))-1,g.next_in=c,g.next_out=b,g.avail_in=c<l?l-c+5:5-(c-l),g.avail_out=b<E?E-b+257:257-(b-E),r.hold=p,r.bits=m}},{}],49:[function(t,d,x){var g=t("../utils/common"),u=t("./adler32"),r=t("./crc32"),c=t("./inffast"),l=t("./inftrees"),b=1,T=2,E=0,s=-2,v=1,h=852,y=592;function n(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function p(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new g.Buf16(320),this.work=new g.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(I){var F;return I&&I.state?(F=I.state,I.total_in=I.total_out=F.total=0,I.msg="",F.wrap&&(I.adler=1&F.wrap),F.mode=v,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new g.Buf32(h),F.distcode=F.distdyn=new g.Buf32(y),F.sane=1,F.back=-1,E):s}function _(I){var F;return I&&I.state?((F=I.state).wsize=0,F.whave=0,F.wnext=0,m(I)):s}function w(I,F){var A,H;return I&&I.state?(H=I.state,F<0?(A=0,F=-F):(A=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15<F)?s:(H.window!==null&&H.wbits!==F&&(H.window=null),H.wrap=A,H.wbits=F,_(I))):s}function C(I,F){var A,H;return I?(H=new p,(I.state=H).window=null,(A=w(I,F))!==E&&(I.state=null),A):s}var o,i,B=!0;function N(I){if(B){var F;for(o=new g.Buf32(512),i=new g.Buf32(32),F=0;F<144;)I.lens[F++]=8;for(;F<256;)I.lens[F++]=9;for(;F<280;)I.lens[F++]=7;for(;F<288;)I.lens[F++]=8;for(l(b,I.lens,0,288,o,0,I.work,{bits:9}),F=0;F<32;)I.lens[F++]=5;l(T,I.lens,0,32,i,0,I.work,{bits:5}),B=!1}I.lencode=o,I.lenbits=9,I.distcode=i,I.distbits=5}function q(I,F,A,H){var j,W=I.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new g.Buf8(W.wsize)),H>=W.wsize?(g.arraySet(W.window,F,A-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(H<(j=W.wsize-W.wnext)&&(j=H),g.arraySet(W.window,F,A-H,j,W.wnext),(H-=j)?(g.arraySet(W.window,F,A-H,H,0),W.wnext=H,W.whave=W.wsize):(W.wnext+=j,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=j))),0}x.inflateReset=_,x.inflateReset2=w,x.inflateResetKeep=m,x.inflateInit=function(I){return C(I,15)},x.inflateInit2=C,x.inflate=function(I,F){var A,H,j,W,re,J,oe,Q,$,ce,ie,ee,ue,Se,ve,k,O,P,D,S,f,L,G,M,V=0,K=new g.Buf8(4),X=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return s;(A=I.state).mode===12&&(A.mode=13),re=I.next_out,j=I.output,oe=I.avail_out,W=I.next_in,H=I.input,J=I.avail_in,Q=A.hold,$=A.bits,ce=J,ie=oe,L=E;e:for(;;)switch(A.mode){case v:if(A.wrap===0){A.mode=13;break}for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(2&A.wrap&&Q===35615){K[A.check=0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0),$=Q=0,A.mode=2;break}if(A.flags=0,A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&Q)<<8)+(Q>>8))%31){I.msg="incorrect header check",A.mode=30;break}if((15&Q)!=8){I.msg="unknown compression method",A.mode=30;break}if($-=4,f=8+(15&(Q>>>=4)),A.wbits===0)A.wbits=f;else if(f>A.wbits){I.msg="invalid window size",A.mode=30;break}A.dmax=1<<f,I.adler=A.check=1,A.mode=512&Q?10:12,$=Q=0;break;case 2:for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(A.flags=Q,(255&A.flags)!=8){I.msg="unknown compression method",A.mode=30;break}if(57344&A.flags){I.msg="unknown header flags set",A.mode=30;break}A.head&&(A.head.text=Q>>8&1),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0)),$=Q=0,A.mode=3;case 3:for(;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.head&&(A.head.time=Q),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,K[2]=Q>>>16&255,K[3]=Q>>>24&255,A.check=r(A.check,K,4,0)),$=Q=0,A.mode=4;case 4:for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.head&&(A.head.xflags=255&Q,A.head.os=Q>>8),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0)),$=Q=0,A.mode=5;case 5:if(1024&A.flags){for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.length=Q,A.head&&(A.head.extra_len=Q),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0)),$=Q=0}else A.head&&(A.head.extra=null);A.mode=6;case 6:if(1024&A.flags&&(J<(ee=A.length)&&(ee=J),ee&&(A.head&&(f=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Array(A.head.extra_len)),g.arraySet(A.head.extra,H,W,ee,f)),512&A.flags&&(A.check=r(A.check,H,ee,W)),J-=ee,W+=ee,A.length-=ee),A.length))break e;A.length=0,A.mode=7;case 7:if(2048&A.flags){if(J===0)break e;for(ee=0;f=H[W+ee++],A.head&&f&&A.length<65536&&(A.head.name+=String.fromCharCode(f)),f&&ee<J;);if(512&A.flags&&(A.check=r(A.check,H,ee,W)),J-=ee,W+=ee,f)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=8;case 8:if(4096&A.flags){if(J===0)break e;for(ee=0;f=H[W+ee++],A.head&&f&&A.length<65536&&(A.head.comment+=String.fromCharCode(f)),f&&ee<J;);if(512&A.flags&&(A.check=r(A.check,H,ee,W)),J-=ee,W+=ee,f)break e}else A.head&&(A.head.comment=null);A.mode=9;case 9:if(512&A.flags){for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(Q!==(65535&A.check)){I.msg="header crc mismatch",A.mode=30;break}$=Q=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),I.adler=A.check=0,A.mode=12;break;case 10:for(;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}I.adler=A.check=n(Q),$=Q=0,A.mode=11;case 11:if(A.havedict===0)return I.next_out=re,I.avail_out=oe,I.next_in=W,I.avail_in=J,A.hold=Q,A.bits=$,2;I.adler=A.check=1,A.mode=12;case 12:if(F===5||F===6)break e;case 13:if(A.last){Q>>>=7&$,$-=7&$,A.mode=27;break}for(;$<3;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}switch(A.last=1&Q,$-=1,3&(Q>>>=1)){case 0:A.mode=14;break;case 1:if(N(A),A.mode=20,F!==6)break;Q>>>=2,$-=2;break e;case 2:A.mode=17;break;case 3:I.msg="invalid block type",A.mode=30}Q>>>=2,$-=2;break;case 14:for(Q>>>=7&$,$-=7&$;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if((65535&Q)!=(Q>>>16^65535)){I.msg="invalid stored block lengths",A.mode=30;break}if(A.length=65535&Q,$=Q=0,A.mode=15,F===6)break e;case 15:A.mode=16;case 16:if(ee=A.length){if(J<ee&&(ee=J),oe<ee&&(ee=oe),ee===0)break e;g.arraySet(j,H,W,ee,re),J-=ee,W+=ee,oe-=ee,re+=ee,A.length-=ee;break}A.mode=12;break;case 17:for(;$<14;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(A.nlen=257+(31&Q),Q>>>=5,$-=5,A.ndist=1+(31&Q),Q>>>=5,$-=5,A.ncode=4+(15&Q),Q>>>=4,$-=4,286<A.nlen||30<A.ndist){I.msg="too many length or distance symbols",A.mode=30;break}A.have=0,A.mode=18;case 18:for(;A.have<A.ncode;){for(;$<3;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.lens[X[A.have++]]=7&Q,Q>>>=3,$-=3}for(;A.have<19;)A.lens[X[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,G={bits:A.lenbits},L=l(0,A.lens,0,19,A.lencode,0,A.work,G),A.lenbits=G.bits,L){I.msg="invalid code lengths set",A.mode=30;break}A.have=0,A.mode=19;case 19:for(;A.have<A.nlen+A.ndist;){for(;k=(V=A.lencode[Q&(1<<A.lenbits)-1])>>>16&255,O=65535&V,!((ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(O<16)Q>>>=ve,$-=ve,A.lens[A.have++]=O;else{if(O===16){for(M=ve+2;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(Q>>>=ve,$-=ve,A.have===0){I.msg="invalid bit length repeat",A.mode=30;break}f=A.lens[A.have-1],ee=3+(3&Q),Q>>>=2,$-=2}else if(O===17){for(M=ve+3;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}$-=ve,f=0,ee=3+(7&(Q>>>=ve)),Q>>>=3,$-=3}else{for(M=ve+7;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}$-=ve,f=0,ee=11+(127&(Q>>>=ve)),Q>>>=7,$-=7}if(A.have+ee>A.nlen+A.ndist){I.msg="invalid bit length repeat",A.mode=30;break}for(;ee--;)A.lens[A.have++]=f}}if(A.mode===30)break;if(A.lens[256]===0){I.msg="invalid code -- missing end-of-block",A.mode=30;break}if(A.lenbits=9,G={bits:A.lenbits},L=l(b,A.lens,0,A.nlen,A.lencode,0,A.work,G),A.lenbits=G.bits,L){I.msg="invalid literal/lengths set",A.mode=30;break}if(A.distbits=6,A.distcode=A.distdyn,G={bits:A.distbits},L=l(T,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,G),A.distbits=G.bits,L){I.msg="invalid distances set",A.mode=30;break}if(A.mode=20,F===6)break e;case 20:A.mode=21;case 21:if(6<=J&&258<=oe){I.next_out=re,I.avail_out=oe,I.next_in=W,I.avail_in=J,A.hold=Q,A.bits=$,c(I,ie),re=I.next_out,j=I.output,oe=I.avail_out,W=I.next_in,H=I.input,J=I.avail_in,Q=A.hold,$=A.bits,A.mode===12&&(A.back=-1);break}for(A.back=0;k=(V=A.lencode[Q&(1<<A.lenbits)-1])>>>16&255,O=65535&V,!((ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(k&&(240&k)==0){for(P=ve,D=k,S=O;k=(V=A.lencode[S+((Q&(1<<P+D)-1)>>P)])>>>16&255,O=65535&V,!(P+(ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}Q>>>=P,$-=P,A.back+=P}if(Q>>>=ve,$-=ve,A.back+=ve,A.length=O,k===0){A.mode=26;break}if(32&k){A.back=-1,A.mode=12;break}if(64&k){I.msg="invalid literal/length code",A.mode=30;break}A.extra=15&k,A.mode=22;case 22:if(A.extra){for(M=A.extra;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.length+=Q&(1<<A.extra)-1,Q>>>=A.extra,$-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=23;case 23:for(;k=(V=A.distcode[Q&(1<<A.distbits)-1])>>>16&255,O=65535&V,!((ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if((240&k)==0){for(P=ve,D=k,S=O;k=(V=A.distcode[S+((Q&(1<<P+D)-1)>>P)])>>>16&255,O=65535&V,!(P+(ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}Q>>>=P,$-=P,A.back+=P}if(Q>>>=ve,$-=ve,A.back+=ve,64&k){I.msg="invalid distance code",A.mode=30;break}A.offset=O,A.extra=15&k,A.mode=24;case 24:if(A.extra){for(M=A.extra;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.offset+=Q&(1<<A.extra)-1,Q>>>=A.extra,$-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){I.msg="invalid distance too far back",A.mode=30;break}A.mode=25;case 25:if(oe===0)break e;if(ee=ie-oe,A.offset>ee){if((ee=A.offset-ee)>A.whave&&A.sane){I.msg="invalid distance too far back",A.mode=30;break}ue=ee>A.wnext?(ee-=A.wnext,A.wsize-ee):A.wnext-ee,ee>A.length&&(ee=A.length),Se=A.window}else Se=j,ue=re-A.offset,ee=A.length;for(oe<ee&&(ee=oe),oe-=ee,A.length-=ee;j[re++]=Se[ue++],--ee;);A.length===0&&(A.mode=21);break;case 26:if(oe===0)break e;j[re++]=A.length,oe--,A.mode=21;break;case 27:if(A.wrap){for(;$<32;){if(J===0)break e;J--,Q|=H[W++]<<$,$+=8}if(ie-=oe,I.total_out+=ie,A.total+=ie,ie&&(I.adler=A.check=A.flags?r(A.check,j,ie,re-ie):u(A.check,j,ie,re-ie)),ie=oe,(A.flags?Q:n(Q))!==A.check){I.msg="incorrect data check",A.mode=30;break}$=Q=0}A.mode=28;case 28:if(A.wrap&&A.flags){for(;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(Q!==(4294967295&A.total)){I.msg="incorrect length check",A.mode=30;break}$=Q=0}A.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;case 32:default:return s}return I.next_out=re,I.avail_out=oe,I.next_in=W,I.avail_in=J,A.hold=Q,A.bits=$,(A.wsize||ie!==I.avail_out&&A.mode<30&&(A.mode<27||F!==4))&&q(I,I.output,I.next_out,ie-I.avail_out)?(A.mode=31,-4):(ce-=I.avail_in,ie-=I.avail_out,I.total_in+=ce,I.total_out+=ie,A.total+=ie,A.wrap&&ie&&(I.adler=A.check=A.flags?r(A.check,j,ie,I.next_out-ie):u(A.check,j,ie,I.next_out-ie)),I.data_type=A.bits+(A.last?64:0)+(A.mode===12?128:0)+(A.mode===20||A.mode===15?256:0),(ce==0&&ie===0||F===4)&&L===E&&(L=-5),L)},x.inflateEnd=function(I){if(!I||!I.state)return s;var F=I.state;return F.window&&(F.window=null),I.state=null,E},x.inflateGetHeader=function(I,F){var A;return I&&I.state?(2&(A=I.state).wrap)==0?s:((A.head=F).done=!1,E):s},x.inflateSetDictionary=function(I,F){var A,H=F.length;return I&&I.state?(A=I.state).wrap!==0&&A.mode!==11?s:A.mode===11&&u(1,F,H,0)!==A.check?-3:q(I,F,H,H)?(A.mode=31,-4):(A.havedict=1,E):s},x.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,d,x){var g=t("../utils/common"),u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];d.exports=function(b,T,E,s,v,h,y,n){var p,m,_,w,C,o,i,B,N,q=n.bits,I=0,F=0,A=0,H=0,j=0,W=0,re=0,J=0,oe=0,Q=0,$=null,ce=0,ie=new g.Buf16(16),ee=new g.Buf16(16),ue=null,Se=0;for(I=0;I<=15;I++)ie[I]=0;for(F=0;F<s;F++)ie[T[E+F]]++;for(j=q,H=15;1<=H&&ie[H]===0;H--);if(H<j&&(j=H),H===0)return v[h++]=20971520,v[h++]=20971520,n.bits=1,0;for(A=1;A<H&&ie[A]===0;A++);for(j<A&&(j=A),I=J=1;I<=15;I++)if(J<<=1,(J-=ie[I])<0)return-1;if(0<J&&(b===0||H!==1))return-1;for(ee[1]=0,I=1;I<15;I++)ee[I+1]=ee[I]+ie[I];for(F=0;F<s;F++)T[E+F]!==0&&(y[ee[T[E+F]]++]=F);if(o=b===0?($=ue=y,19):b===1?($=u,ce-=257,ue=r,Se-=257,256):($=c,ue=l,-1),I=A,C=h,re=F=Q=0,_=-1,w=(oe=1<<(W=j))-1,b===1&&852<oe||b===2&&592<oe)return 1;for(;;){for(i=I-re,N=y[F]<o?(B=0,y[F]):y[F]>o?(B=ue[Se+y[F]],$[ce+y[F]]):(B=96,0),p=1<<I-re,A=m=1<<W;v[C+(Q>>re)+(m-=p)]=i<<24|B<<16|N|0,m!==0;);for(p=1<<I-1;Q&p;)p>>=1;if(p!==0?(Q&=p-1,Q+=p):Q=0,F++,--ie[I]==0){if(I===H)break;I=T[E+y[F]]}if(j<I&&(Q&w)!==_){for(re===0&&(re=j),C+=A,J=1<<(W=I-re);W+re<H&&!((J-=ie[W+re])<=0);)W++,J<<=1;if(oe+=1<<W,b===1&&852<oe||b===2&&592<oe)return 1;v[_=Q&w]=j<<24|W<<16|C-h|0}}return Q!==0&&(v[C+Q]=I-re<<24|64<<16|0),n.bits=j,0}},{"../utils/common":41}],51:[function(t,d,x){d.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,d,x){var g=t("../utils/common"),u=0,r=1;function c(V){for(var K=V.length;0<=--K;)V[K]=0}var l=0,b=29,T=256,E=T+1+b,s=30,v=19,h=2*E+1,y=15,n=16,p=7,m=256,_=16,w=17,C=18,o=[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],i=[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],B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],q=new Array(2*(E+2));c(q);var I=new Array(2*s);c(I);var F=new Array(512);c(F);var A=new Array(256);c(A);var H=new Array(b);c(H);var j,W,re,J=new Array(s);function oe(V,K,X,te,Y){this.static_tree=V,this.extra_bits=K,this.extra_base=X,this.elems=te,this.max_length=Y,this.has_stree=V&&V.length}function Q(V,K){this.dyn_tree=V,this.max_code=0,this.stat_desc=K}function $(V){return V<256?F[V]:F[256+(V>>>7)]}function ce(V,K){V.pending_buf[V.pending++]=255&K,V.pending_buf[V.pending++]=K>>>8&255}function ie(V,K,X){V.bi_valid>n-X?(V.bi_buf|=K<<V.bi_valid&65535,ce(V,V.bi_buf),V.bi_buf=K>>n-V.bi_valid,V.bi_valid+=X-n):(V.bi_buf|=K<<V.bi_valid&65535,V.bi_valid+=X)}function ee(V,K,X){ie(V,X[2*K],X[2*K+1])}function ue(V,K){for(var X=0;X|=1&V,V>>>=1,X<<=1,0<--K;);return X>>>1}function Se(V,K,X){var te,Y,ae=new Array(y+1),fe=0;for(te=1;te<=y;te++)ae[te]=fe=fe+X[te-1]<<1;for(Y=0;Y<=K;Y++){var se=V[2*Y+1];se!==0&&(V[2*Y]=ue(ae[se]++,se))}}function ve(V){var K;for(K=0;K<E;K++)V.dyn_ltree[2*K]=0;for(K=0;K<s;K++)V.dyn_dtree[2*K]=0;for(K=0;K<v;K++)V.bl_tree[2*K]=0;V.dyn_ltree[2*m]=1,V.opt_len=V.static_len=0,V.last_lit=V.matches=0}function k(V){8<V.bi_valid?ce(V,V.bi_buf):0<V.bi_valid&&(V.pending_buf[V.pending++]=V.bi_buf),V.bi_buf=0,V.bi_valid=0}function O(V,K,X,te){var Y=2*K,ae=2*X;return V[Y]<V[ae]||V[Y]===V[ae]&&te[K]<=te[X]}function P(V,K,X){for(var te=V.heap[X],Y=X<<1;Y<=V.heap_len&&(Y<V.heap_len&&O(K,V.heap[Y+1],V.heap[Y],V.depth)&&Y++,!O(K,te,V.heap[Y],V.depth));)V.heap[X]=V.heap[Y],X=Y,Y<<=1;V.heap[X]=te}function D(V,K,X){var te,Y,ae,fe,se=0;if(V.last_lit!==0)for(;te=V.pending_buf[V.d_buf+2*se]<<8|V.pending_buf[V.d_buf+2*se+1],Y=V.pending_buf[V.l_buf+se],se++,te===0?ee(V,Y,K):(ee(V,(ae=A[Y])+T+1,K),(fe=o[ae])!==0&&ie(V,Y-=H[ae],fe),ee(V,ae=$(--te),X),(fe=i[ae])!==0&&ie(V,te-=J[ae],fe)),se<V.last_lit;);ee(V,m,K)}function S(V,K){var X,te,Y,ae=K.dyn_tree,fe=K.stat_desc.static_tree,se=K.stat_desc.has_stree,de=K.stat_desc.elems,ye=-1;for(V.heap_len=0,V.heap_max=h,X=0;X<de;X++)ae[2*X]!==0?(V.heap[++V.heap_len]=ye=X,V.depth[X]=0):ae[2*X+1]=0;for(;V.heap_len<2;)ae[2*(Y=V.heap[++V.heap_len]=ye<2?++ye:0)]=1,V.depth[Y]=0,V.opt_len--,se&&(V.static_len-=fe[2*Y+1]);for(K.max_code=ye,X=V.heap_len>>1;1<=X;X--)P(V,ae,X);for(Y=de;X=V.heap[1],V.heap[1]=V.heap[V.heap_len--],P(V,ae,1),te=V.heap[1],V.heap[--V.heap_max]=X,V.heap[--V.heap_max]=te,ae[2*Y]=ae[2*X]+ae[2*te],V.depth[Y]=(V.depth[X]>=V.depth[te]?V.depth[X]:V.depth[te])+1,ae[2*X+1]=ae[2*te+1]=Y,V.heap[1]=Y++,P(V,ae,1),2<=V.heap_len;);V.heap[--V.heap_max]=V.heap[1],(function(ge,xe){var be,_e,Ae,Ce,Be,Ne,Ie=xe.dyn_tree,Qe=xe.max_code,Ze=xe.stat_desc.static_tree,et=xe.stat_desc.has_stree,nt=xe.stat_desc.extra_bits,it=xe.stat_desc.extra_base,Xe=xe.stat_desc.max_length,st=0;for(Ce=0;Ce<=y;Ce++)ge.bl_count[Ce]=0;for(Ie[2*ge.heap[ge.heap_max]+1]=0,be=ge.heap_max+1;be<h;be++)Xe<(Ce=Ie[2*Ie[2*(_e=ge.heap[be])+1]+1]+1)&&(Ce=Xe,st++),Ie[2*_e+1]=Ce,Qe<_e||(ge.bl_count[Ce]++,Be=0,it<=_e&&(Be=nt[_e-it]),Ne=Ie[2*_e],ge.opt_len+=Ne*(Ce+Be),et&&(ge.static_len+=Ne*(Ze[2*_e+1]+Be)));if(st!==0){do{for(Ce=Xe-1;ge.bl_count[Ce]===0;)Ce--;ge.bl_count[Ce]--,ge.bl_count[Ce+1]+=2,ge.bl_count[Xe]--,st-=2}while(0<st);for(Ce=Xe;Ce!==0;Ce--)for(_e=ge.bl_count[Ce];_e!==0;)Qe<(Ae=ge.heap[--be])||(Ie[2*Ae+1]!==Ce&&(ge.opt_len+=(Ce-Ie[2*Ae+1])*Ie[2*Ae],Ie[2*Ae+1]=Ce),_e--)}})(V,K),Se(ae,ye,V.bl_count)}function f(V,K,X){var te,Y,ae=-1,fe=K[1],se=0,de=7,ye=4;for(fe===0&&(de=138,ye=3),K[2*(X+1)+1]=65535,te=0;te<=X;te++)Y=fe,fe=K[2*(te+1)+1],++se<de&&Y===fe||(se<ye?V.bl_tree[2*Y]+=se:Y!==0?(Y!==ae&&V.bl_tree[2*Y]++,V.bl_tree[2*_]++):se<=10?V.bl_tree[2*w]++:V.bl_tree[2*C]++,ae=Y,ye=(se=0)===fe?(de=138,3):Y===fe?(de=6,3):(de=7,4))}function L(V,K,X){var te,Y,ae=-1,fe=K[1],se=0,de=7,ye=4;for(fe===0&&(de=138,ye=3),te=0;te<=X;te++)if(Y=fe,fe=K[2*(te+1)+1],!(++se<de&&Y===fe)){if(se<ye)for(;ee(V,Y,V.bl_tree),--se!=0;);else Y!==0?(Y!==ae&&(ee(V,Y,V.bl_tree),se--),ee(V,_,V.bl_tree),ie(V,se-3,2)):se<=10?(ee(V,w,V.bl_tree),ie(V,se-3,3)):(ee(V,C,V.bl_tree),ie(V,se-11,7));ae=Y,ye=(se=0)===fe?(de=138,3):Y===fe?(de=6,3):(de=7,4)}}c(J);var G=!1;function M(V,K,X,te){ie(V,(l<<1)+(te?1:0),3),(function(Y,ae,fe,se){k(Y),ce(Y,fe),ce(Y,~fe),g.arraySet(Y.pending_buf,Y.window,ae,fe,Y.pending),Y.pending+=fe})(V,K,X)}x._tr_init=function(V){G||((function(){var K,X,te,Y,ae,fe=new Array(y+1);for(Y=te=0;Y<b-1;Y++)for(H[Y]=te,K=0;K<1<<o[Y];K++)A[te++]=Y;for(A[te-1]=Y,Y=ae=0;Y<16;Y++)for(J[Y]=ae,K=0;K<1<<i[Y];K++)F[ae++]=Y;for(ae>>=7;Y<s;Y++)for(J[Y]=ae<<7,K=0;K<1<<i[Y]-7;K++)F[256+ae++]=Y;for(X=0;X<=y;X++)fe[X]=0;for(K=0;K<=143;)q[2*K+1]=8,K++,fe[8]++;for(;K<=255;)q[2*K+1]=9,K++,fe[9]++;for(;K<=279;)q[2*K+1]=7,K++,fe[7]++;for(;K<=287;)q[2*K+1]=8,K++,fe[8]++;for(Se(q,E+1,fe),K=0;K<s;K++)I[2*K+1]=5,I[2*K]=ue(K,5);j=new oe(q,o,T+1,E,y),W=new oe(I,i,0,s,y),re=new oe(new Array(0),B,0,v,p)})(),G=!0),V.l_desc=new Q(V.dyn_ltree,j),V.d_desc=new Q(V.dyn_dtree,W),V.bl_desc=new Q(V.bl_tree,re),V.bi_buf=0,V.bi_valid=0,ve(V)},x._tr_stored_block=M,x._tr_flush_block=function(V,K,X,te){var Y,ae,fe=0;0<V.level?(V.strm.data_type===2&&(V.strm.data_type=(function(se){var de,ye=4093624447;for(de=0;de<=31;de++,ye>>>=1)if(1&ye&&se.dyn_ltree[2*de]!==0)return u;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return r;for(de=32;de<T;de++)if(se.dyn_ltree[2*de]!==0)return r;return u})(V)),S(V,V.l_desc),S(V,V.d_desc),fe=(function(se){var de;for(f(se,se.dyn_ltree,se.l_desc.max_code),f(se,se.dyn_dtree,se.d_desc.max_code),S(se,se.bl_desc),de=v-1;3<=de&&se.bl_tree[2*N[de]+1]===0;de--);return se.opt_len+=3*(de+1)+5+5+4,de})(V),Y=V.opt_len+3+7>>>3,(ae=V.static_len+3+7>>>3)<=Y&&(Y=ae)):Y=ae=X+5,X+4<=Y&&K!==-1?M(V,K,X,te):V.strategy===4||ae===Y?(ie(V,2+(te?1:0),3),D(V,q,I)):(ie(V,4+(te?1:0),3),(function(se,de,ye,ge){var xe;for(ie(se,de-257,5),ie(se,ye-1,5),ie(se,ge-4,4),xe=0;xe<ge;xe++)ie(se,se.bl_tree[2*N[xe]+1],3);L(se,se.dyn_ltree,de-1),L(se,se.dyn_dtree,ye-1)})(V,V.l_desc.max_code+1,V.d_desc.max_code+1,fe+1),D(V,V.dyn_ltree,V.dyn_dtree)),ve(V),te&&k(V)},x._tr_tally=function(V,K,X){return V.pending_buf[V.d_buf+2*V.last_lit]=K>>>8&255,V.pending_buf[V.d_buf+2*V.last_lit+1]=255&K,V.pending_buf[V.l_buf+V.last_lit]=255&X,V.last_lit++,K===0?V.dyn_ltree[2*X]++:(V.matches++,K--,V.dyn_ltree[2*(A[X]+T+1)]++,V.dyn_dtree[2*$(K)]++),V.last_lit===V.lit_bufsize-1},x._tr_align=function(V){ie(V,2,3),ee(V,m,q),(function(K){K.bi_valid===16?(ce(K,K.bi_buf),K.bi_buf=0,K.bi_valid=0):8<=K.bi_valid&&(K.pending_buf[K.pending++]=255&K.bi_buf,K.bi_buf>>=8,K.bi_valid-=8)})(V)}},{"../utils/common":41}],53:[function(t,d,x){d.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,d,x){(function(g){(function(u,r){if(!u.setImmediate){var c,l,b,T,E=1,s={},v=!1,h=u.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(u);y=y&&y.setTimeout?y:u,c={}.toString.call(u.process)==="[object process]"?function(_){process.nextTick(function(){p(_)})}:(function(){if(u.postMessage&&!u.importScripts){var _=!0,w=u.onmessage;return u.onmessage=function(){_=!1},u.postMessage("","*"),u.onmessage=w,_}})()?(T="setImmediate$"+Math.random()+"$",u.addEventListener?u.addEventListener("message",m,!1):u.attachEvent("onmessage",m),function(_){u.postMessage(T+_,"*")}):u.MessageChannel?((b=new MessageChannel).port1.onmessage=function(_){p(_.data)},function(_){b.port2.postMessage(_)}):h&&"onreadystatechange"in h.createElement("script")?(l=h.documentElement,function(_){var w=h.createElement("script");w.onreadystatechange=function(){p(_),w.onreadystatechange=null,l.removeChild(w),w=null},l.appendChild(w)}):function(_){setTimeout(p,0,_)},y.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var w=new Array(arguments.length-1),C=0;C<w.length;C++)w[C]=arguments[C+1];var o={callback:_,args:w};return s[E]=o,c(E),E++},y.clearImmediate=n}function n(_){delete s[_]}function p(_){if(v)setTimeout(p,0,_);else{var w=s[_];if(w){v=!0;try{(function(C){var o=C.callback,i=C.args;switch(i.length){case 0:o();break;case 1:o(i[0]);break;case 2:o(i[0],i[1]);break;case 3:o(i[0],i[1],i[2]);break;default:o.apply(r,i)}})(w)}finally{n(_),v=!1}}}}function m(_){_.source===u&&typeof _.data=="string"&&_.data.indexOf(T)===0&&p(+_.data.slice(T.length))}})(typeof self>"u"?g===void 0?this:g:self)}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(er)),er.exports}Dn();function Un(a){const e=String(a??"").trim().toLowerCase(),t=e.lastIndexOf(".");return t>=0?e.slice(t):""}function Pn(a){const e=URL.createObjectURL(a);return{url:e,name:a.name,extension:Un(a.name),revoke:()=>URL.revokeObjectURL(e)}}function On(a,e){return`${a}#${e}`}class Fn{viewer;getDefaultRotation;scenes=new Map;localSceneResources=new Map;constructor(e,t){this.viewer=e,this.getDefaultRotation=t}async loadModel(e,t={}){const d=this.viewer.getSceneCount(),x={showLoadingUI:!0,progressiveLoad:!1,position:[0,0,0],rotation:this.getDefaultRotation(),scale:[1,1,1],...t};await this.viewer.addSplatScene(e,x);const g={id:x.id??On(e,d),name:x.name??e.split(/[\\/]/).pop()??e,url:e,index:d,options:x};return this.scenes.set(g.id,g),g}async loadModelFile(e,t={}){if(e.length===0)throw new Error("LoaderModuleGaussian: no file selected");if(e.length>1)throw new Error("LoaderModuleGaussian: only a single local point cloud file is supported");const d=Pn(e[0]);try{const x=await this.loadModel(d.url,{...t,name:t.name??e[0].name});return this.localSceneResources.set(x.id,d),x}catch(x){throw d.revoke(),x}}async loadModels(e){const t=[];for(const d of e)t.push(await this.loadModel(d.url,d.options));return t}async unloadModel(e,t=!0){const d=this.scenes.get(e);d&&(await this.viewer.removeSplatScene(d.index,t),this.scenes.delete(e),this.localSceneResources.get(e)?.revoke(),this.localSceneResources.delete(e),this.reindexScenesAfterRemove(d.index))}getModel(e){return this.scenes.get(e)}getAllModels(){return Array.from(this.scenes.values())}getRawSplatScene(e){const t=typeof e=="number"?e:this.scenes.get(e)?.index;return t==null?void 0:this.viewer.getSplatScene(t)}async clear(e=!1){const t=this.getAllModels().map(d=>d.index);t.length>0&&await this.viewer.removeSplatScenes(t,e),this.scenes.clear(),this.localSceneResources.forEach(d=>d.revoke()),this.localSceneResources.clear()}reindexScenesAfterRemove(e){this.scenes.forEach(t=>{t.index>e&&(t.index-=1)})}}const _t={version:"3.11.3"}.version;function tr(){const a=globalThis.crypto?.subtle;if(!a)throw new Error("[BimEngine] Web Crypto API is required for secure sdkAuth credentials mode");return a}function Tt(a){return new TextEncoder().encode(a)}function At(a){return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}function oa(a){let e="";return a.forEach(t=>{e+=String.fromCharCode(t)}),btoa(e)}function Vn(a){const e=a.getUTCFullYear(),t=String(a.getUTCMonth()+1).padStart(2,"0"),d=String(a.getUTCDate()).padStart(2,"0");return`${e}${t}${d}`}async function Mn(a){const e=await tr().digest("SHA-256",At(Tt(a)));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}async function Kn(a,e){const t=tr(),d=await t.importKey("raw",At(a),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return t.sign("HMAC",d,At(Tt(e)))}function zn(a){return Tt([a.appId,a.engineType,a.requestDate,String(a.timestamp),a.nonce].join("|"))}async function qn(a){const e=tr(),t=new Date,d=t.getTime(),x=Vn(t),g=globalThis.crypto.randomUUID(),u=globalThis.crypto.getRandomValues(new Uint8Array(12)),r=await Mn(a.appSecret),c=await Kn(Tt(r),x),l=await e.importKey("raw",c,"AES-GCM",!1,["encrypt"]),b=JSON.stringify({appKey:a.appKey,appSecret:a.appSecret}),T=await e.encrypt({name:"AES-GCM",iv:u,additionalData:At(zn({appId:a.appId,engineType:a.engineType,requestDate:x,timestamp:d,nonce:g})),tagLength:128},l,At(Tt(b)));return{appId:a.appId,engineType:a.engineType,requestDate:x,timestamp:d,nonce:g,iv:oa(u),cipherText:oa(new Uint8Array(T)),sdkVersion:a.sdkVersion,origin:a.origin,product:a.product}}const rr=new Map;function Pt(a){return a.replace(/\/+$/,"")}function Ot(a){if(a)return a;if(typeof window<"u"&&typeof window.location?.origin=="string")return window.location.origin}function Hn(a,e){return JSON.stringify({endpoint:Pt(a.endpoint),token:a.token??"",appId:a.appId??"",appKey:a.appKey??"",appSecret:a.appSecret??"",origin:Ot(a.origin)??"",product:a.product??"",engineType:e,sdkVersion:_t})}async function ar(a,e,t){const d=typeof AbortController<"u"?new AbortController:void 0,x=d?setTimeout(()=>d.abort(),t):void 0;try{const g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:d?.signal}),u=await g.json().catch(()=>({}));if(!g.ok){const r=u?.error?.message??u?.message??`SDK authentication failed with status ${g.status}`;throw new Error(r)}return u}finally{x!=null&&clearTimeout(x)}}async function Gn(a,e){const t=await ar(`${Pt(a.endpoint)}/oauth/sdk-verify`,{sdkToken:a.token,engineType:e,sdkVersion:_t,origin:Ot(a.origin),product:a.product},a.timeoutMs??8e3);return t.sdkToken=a.token,t}async function Wn(a,e){const t=await qn({appId:a.appId,appKey:a.appKey,appSecret:a.appSecret,engineType:e,sdkVersion:_t,origin:Ot(a.origin),product:a.product}),d=await ar(`${Pt(a.endpoint)}/oauth/sdk-token/secure`,t,a.timeoutMs??8e3),x=await ar(`${Pt(a.endpoint)}/oauth/sdk-verify`,{sdkToken:d.sdkToken,engineType:e,sdkVersion:_t,origin:Ot(a.origin),product:a.product},a.timeoutMs??8e3);return x.sdkToken=d.sdkToken,x}async function jn(a,e){const t=a?.sdkAuth;if(!t)return null;if(!t.endpoint)throw new Error("[BimEngine] sdkAuth.endpoint is required");if(!t.token&&!(t.appId&&t.appKey&&t.appSecret))return null;const d=Hn(t,e),x=rr.get(d);if(x){const u=await x;return a&&(a.__sdkAuthSession=u),u}const g=(t.token?Gn(t,e):Wn(t,e)).then(u=>{if(u.authorized!==!0)throw new Error("[BimEngine] SDK authorization rejected");return a&&(a.__sdkAuthSession=u),u}).catch(u=>{throw rr.delete(d),u});return rr.set(d,g),g}function Qn(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}function ua(a){if(typeof a!="number")throw new TypeError("number expected, got "+typeof a);if(!Number.isSafeInteger(a)||a<0)throw new RangeError("positive integer expected, got "+a)}function Ye(a,e,t=""){const d=Qn(a),x=a?.length,g=e!==void 0;if(!d||g&&x!==e){const u=t&&`"${t}" `,r=g?` of length ${e}`:"",c=d?`length=${x}`:`type=${typeof a}`,l=u+"expected Uint8Array"+r+", got "+c;throw d?new RangeError(l):new TypeError(l)}return a}function la(a,e=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(e&&a.finished)throw new Error("Hash#digest() has already been called")}function Yn(a,e,t=!1){Ye(a,void 0,"output");const d=e.outputLen;if(a.length<d)throw new RangeError("digestInto() expects output buffer of length at least "+d);if(t&&!It(a))throw new Error("invalid output, must be aligned")}function Zn(a){return new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}function vt(a){return new Uint32Array(a.buffer,a.byteOffset,Math.floor(a.byteLength/4))}function pt(...a){for(let e=0;e<a.length;e++)a[e].fill(0)}function Ft(a){return new DataView(a.buffer,a.byteOffset,a.byteLength)}const nr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,fa=a=>a<<24&4278190080|a<<8&16711680|a>>>8&65280|a>>>24&255,ke=nr?a=>a:a=>fa(a)>>>0,ir=nr?a=>a:a=>{for(let e=0;e<a.length;e++)a[e]=fa(a[e]);return a};function Xn(a,e){if(a.length!==e.length)return!1;let t=0;for(let d=0;d<a.length;d++)t|=a[d]^e[d];return t===0}function $n(a,e,t){const d=e,x=t||(()=>[]),g=(r,c)=>d(c,...x(r)).update(r).digest(),u=d(new Uint8Array(a),...x(new Uint8Array(0)));return g.outputLen=u.outputLen,g.blockLen=u.blockLen,g.create=(r,...c)=>d(r,...c),g}const Jn=(a,e)=>{function t(d,...x){if(Ye(d,void 0,"key"),a.nonceLength!==void 0){const b=x[0];Ye(b,a.varSizeNonce?void 0:a.nonceLength,"nonce")}const g=a.tagLength;g&&x[1]!==void 0&&Ye(x[1],void 0,"AAD");const u=e(d,...x),r=(b,T)=>{if(T!==void 0){if(b!==2)throw new Error("cipher output not supported");Ye(T,void 0,"output")}};let c=!1;return{encrypt(b,T){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,Ye(b),r(u.encrypt.length,T),u.encrypt(b,T)},decrypt(b,T){if(Ye(b),g&&b.length<g)throw new Error('"ciphertext" expected length bigger than tagLength='+g);return r(u.decrypt.length,T),u.decrypt(b,T)}}}return Object.assign(t,a),t};function ei(a,e,t=!0){if(e===void 0)return new Uint8Array(a);if(Ye(e,void 0,"output"),e.length!==a)throw new Error('"output" expected Uint8Array of length '+a+", got: "+e.length);if(t&&!It(e))throw new Error("invalid output, must be aligned");return e}function ti(a,e,t){ua(a),ua(e);const d=new Uint8Array(16),x=Ft(d);return x.setBigUint64(0,BigInt(e),t),x.setBigUint64(8,BigInt(a),t),d}function It(a){return a.byteOffset%4===0}function wt(a){return Uint8Array.from(Ye(a))}const Ct=16,ca=new Uint8Array(16),Bt=vt(ca),ri=225,ai=(a,e,t,d)=>{const x=d&1;return{s3:t<<31|d>>>1,s2:e<<31|t>>>1,s1:a<<31|e>>>1,s0:a>>>1^ri<<24&-(x&1)}},Vt=a=>(a>>>0&255)<<24|(a>>>8&255)<<16|(a>>>16&255)<<8|a>>>24&255|0,ni=a=>a>64*1024?8:a>1024?4:2;class ii{blockLen=Ct;outputLen=Ct;s0=0;s1=0;s2=0;s3=0;finished=!1;destroyed=!1;t;W;windowSize;constructor(e,t){Ye(e,16,"key"),e=wt(e);const d=Ft(e);let x=d.getUint32(0,!1),g=d.getUint32(4,!1),u=d.getUint32(8,!1),r=d.getUint32(12,!1);const c=[];for(let v=0;v<128;v++)c.push({s0:Vt(x),s1:Vt(g),s2:Vt(u),s3:Vt(r)}),{s0:x,s1:g,s2:u,s3:r}=ai(x,g,u,r);const l=ni(t||1024);if(![1,2,4,8].includes(l))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=l;const T=128/l,E=this.windowSize=2**l,s=[];for(let v=0;v<T;v++)for(let h=0;h<E;h++){let y=0,n=0,p=0,m=0;for(let _=0;_<l;_++){if(!(h>>>l-_-1&1))continue;const{s0:C,s1:o,s2:i,s3:B}=c[l*v+_];y^=C,n^=o,p^=i,m^=B}s.push({s0:y,s1:n,s2:p,s3:m})}this.t=s}_updateBlock(e,t,d,x){e^=this.s0,t^=this.s1,d^=this.s2,x^=this.s3;const{W:g,t:u,windowSize:r}=this;let c=0,l=0,b=0,T=0;const E=(1<<g)-1;let s=0;for(const v of[e,t,d,x])for(let h=0;h<4;h++){const y=v>>>8*h&255;for(let n=8/g-1;n>=0;n--){const p=y>>>g*n&E,{s0:m,s1:_,s2:w,s3:C}=u[s*r+p];c^=m,l^=_,b^=w,T^=C,s+=1}}this.s0=c,this.s1=l,this.s2=b,this.s3=T}update(e){la(this),Ye(e),e=wt(e);const t=vt(e),d=Math.floor(e.length/Ct),x=e.length%Ct;for(let g=0;g<d;g++)this._updateBlock(ke(t[g*4+0]),ke(t[g*4+1]),ke(t[g*4+2]),ke(t[g*4+3]));return x&&(ca.set(e.subarray(d*Ct)),this._updateBlock(ke(Bt[0]),ke(Bt[1]),ke(Bt[2]),ke(Bt[3])),pt(Bt)),this}destroy(){this.destroyed=!0;const{t:e}=this;for(const t of e)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(e){la(this),Yn(e,this,!0),this.finished=!0;const{s0:t,s1:d,s2:x,s3:g}=this,u=vt(e);u[0]=t,u[1]=d,u[2]=x,u[3]=g,ir(u)}digest(){const e=new Uint8Array(Ct);return this.digestInto(e),this.destroy(),e}}const ha=$n(16,(a,e)=>new ii(a,e),a=>[a.length]),sr=16,si=4,Mt=new Uint8Array(sr),oi=283;function ui(a){if(![16,24,32].includes(a.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+a.length)}function or(a){return a<<1^oi&-(a>>7)}function da(a,e){let t=0;for(;e>0;e>>=1)t^=a&-(e&1),a=or(a);return t}const li=(()=>{const a=new Uint8Array(256);for(let t=0,d=1;t<256;t++,d^=or(d))a[t]=d;const e=new Uint8Array(256);e[0]=99;for(let t=0;t<255;t++){let d=a[255-t];d|=d<<8,e[a[t]]=(d^d>>4^d>>5^d>>6^d>>7^99)&255}return pt(a),e})(),fi=a=>a<<24|a>>>8,ur=a=>a<<8|a>>>24;function ci(a,e){if(a.length!==256)throw new Error("Wrong sbox length");const t=new Uint32Array(256).map((l,b)=>e(a[b])),d=t.map(ur),x=d.map(ur),g=x.map(ur),u=new Uint32Array(256*256),r=new Uint32Array(256*256),c=new Uint16Array(256*256);for(let l=0;l<256;l++)for(let b=0;b<256;b++){const T=l*256+b;u[T]=t[l]^d[b],r[T]=x[l]^g[b],c[T]=a[l]<<8|a[b]}return{sbox:a,sbox2:c,T0:t,T1:d,T2:x,T3:g,T01:u,T23:r}}const pa=ci(li,a=>da(a,3)<<24|a<<16|a<<8|da(a,2)),hi=(()=>{const a=new Uint8Array(16);for(let e=0,t=1;e<16;e++,t=or(t))a[e]=t;return a})();function di(a){Ye(a);const e=a.length;ui(a);const{sbox2:t}=pa,d=[];(!nr||!It(a))&&d.push(a=wt(a));const x=ir(vt(a)),g=x.length,u=c=>kt(t,c,c,c,c),r=new Uint32Array(e+28);r.set(x);for(let c=g;c<r.length;c++){let l=r[c-1];c%g===0?l=u(fi(l))^hi[c/g-1]:g>6&&c%g===4&&(l=u(l)),r[c]=r[c-g]^l}return pt(...d),r}function Kt(a,e,t,d,x,g){return a[t<<8&65280|d>>>8&255]^e[x>>>8&65280|g>>>24&255]}function kt(a,e,t,d,x){return a[e&255|t&65280]|a[d>>>16&255|x>>>16&65280]<<16}function ga(a,e,t,d,x){const{sbox2:g,T01:u,T23:r}=pa;let c=0;e^=a[c++],t^=a[c++],d^=a[c++],x^=a[c++];const l=a.length/4-2;for(let v=0;v<l;v++){const h=a[c++]^Kt(u,r,e,t,d,x),y=a[c++]^Kt(u,r,t,d,x,e),n=a[c++]^Kt(u,r,d,x,e,t),p=a[c++]^Kt(u,r,x,e,t,d);e=h,t=y,d=n,x=p}const b=a[c++]^kt(g,e,t,d,x),T=a[c++]^kt(g,t,d,x,e),E=a[c++]^kt(g,d,x,e,t),s=a[c++]^kt(g,x,e,t,d);return{s0:b,s1:T,s2:E,s3:s}}function zt(a,e,t,d,x){Ye(t,sr,"nonce"),Ye(d),x=ei(d.length,x);const g=t,u=vt(g),r=Ft(g),c=vt(d),l=vt(x),b=e?0:12,T=d.length;let E=r.getUint32(b,e),{s0:s,s1:v,s2:h,s3:y}=ga(a,ke(u[0]),ke(u[1]),ke(u[2]),ke(u[3]));for(let p=0;p+4<=c.length;p+=4)l[p+0]=c[p+0]^ke(s),l[p+1]=c[p+1]^ke(v),l[p+2]=c[p+2]^ke(h),l[p+3]=c[p+3]^ke(y),E=E+1>>>0,r.setUint32(b,E,e),{s0:s,s1:v,s2:h,s3:y}=ga(a,ke(u[0]),ke(u[1]),ke(u[2]),ke(u[3]));const n=sr*Math.floor(c.length/si);if(n<T){const p=new Uint32Array([s,v,h,y]);ir(p);const m=Zn(p);for(let _=n,w=0;_<T;_++,w++)x[_]=d[_]^m[w];pt(p)}return x}function pi(a,e,t,d,x){const g=x?x.length:0,u=a.create(t,d.length+g);x&&u.update(x);const r=ti(8*d.length,8*g,e);u.update(d),u.update(r);const c=u.digest();return pt(r),c}const gi=Jn({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(e,t,d){if(t.length<8)throw new Error("aes/gcm: invalid nonce length");const x=16;function g(r,c,l){const b=pi(ha,!1,r,l,d);for(let T=0;T<c.length;T++)b[T]^=c[T];return b}function u(){const r=di(e),c=Mt.slice(),l=Mt.slice();if(zt(r,!1,l,l,c),t.length===12)l.set(t);else{const T=Mt.slice();Ft(T).setBigUint64(8,BigInt(t.length*8),!1);const s=ha.create(c).update(t).update(T);s.digestInto(l),s.destroy()}const b=zt(r,!1,l,Mt);return{xk:r,authKey:c,counter:l,tagMask:b}}return{encrypt(r){const{xk:c,authKey:l,counter:b,tagMask:T}=u(),E=new Uint8Array(r.length+x),s=[c,l,b,T];It(r)||s.push(r=wt(r)),zt(c,!1,b,r,E.subarray(0,r.length));const v=g(l,T,E.subarray(0,E.length-x));return s.push(v),E.set(v,r.length),pt(...s),E},decrypt(r){const{xk:c,authKey:l,counter:b,tagMask:T}=u(),E=[c,l,T,b];It(r)||E.push(r=wt(r));const s=r.subarray(0,-x),v=r.subarray(-x),h=g(l,T,s);if(E.push(h),!Xn(h,v))throw pt(...E),new Error("aes/gcm: invalid ghash tag");const y=zt(c,!1,b,s);return pt(...E),y}}});var lr,va;function me(){return va||(va=1,lr={options:{usePureJavaScript:!1}}),lr}var fr={exports:{}},cr,ya;function vi(){if(ya)return cr;ya=1;var a={};cr=a;var e={};a.encode=function(d,x,g){if(typeof x!="string")throw new TypeError('"alphabet" must be a string.');if(g!==void 0&&typeof g!="number")throw new TypeError('"maxline" must be a number.');var u="";if(!(d instanceof Uint8Array))u=t(d,x);else{var r=0,c=x.length,l=x.charAt(0),b=[0];for(r=0;r<d.length;++r){for(var T=0,E=d[r];T<b.length;++T)E+=b[T]<<8,b[T]=E%c,E=E/c|0;for(;E>0;)b.push(E%c),E=E/c|0}for(r=0;d[r]===0&&r<d.length-1;++r)u+=l;for(r=b.length-1;r>=0;--r)u+=x[b[r]]}if(g){var s=new RegExp(".{1,"+g+"}","g");u=u.match(s).join(`\r
|
|
2
|
+
\0`,ie+=g(Q,2),ie+=C.magic,ie+=g(m,2),ie+=g(_,2),ie+=g(oe.crc32,4),ie+=g(oe.compressedSize,4),ie+=g(oe.uncompressedSize,4),ie+=g(i.length,2),ie+=g(H.length,2),{fileRecord:T.LOCAL_FILE_HEADER+ie+i+H,dirRecord:T.CENTRAL_FILE_HEADER+g(ce,2)+ie+g(q.length,2)+"\0\0\0\0"+g($,4)+g(y,4)+i+H+q}}var r=t("../utils"),c=t("../stream/GenericWorker"),l=t("../utf8"),b=t("../crc32"),T=t("../signature");function E(s,v,h,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,this.zipPlatform=h,this.encodeFileName=y,this.streamFiles=s,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(E,c),E.prototype.push=function(s){var v=s.meta.percent||0,h=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(s):(this.bytesWritten+=s.data.length,c.prototype.push.call(this,{data:s.data,meta:{currentFile:this.currentFile,percent:h?(v+100*(h-y-1))/h:100}}))},E.prototype.openedSource=function(s){this.currentSourceOffset=this.bytesWritten,this.currentFile=s.file.name;var v=this.streamFiles&&!s.file.dir;if(v){var h=u(s,v,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},E.prototype.closedSource=function(s){this.accumulate=!1;var v=this.streamFiles&&!s.file.dir,h=u(s,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),v)this.push({data:(function(y){return T.DATA_DESCRIPTOR+g(y.crc32,4)+g(y.compressedSize,4)+g(y.uncompressedSize,4)})(s),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},E.prototype.flush=function(){for(var s=this.bytesWritten,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var h=this.bytesWritten-s,y=(function(n,p,m,_,w){var C=r.transformTo("string",w(_));return T.CENTRAL_DIRECTORY_END+"\0\0\0\0"+g(n,2)+g(n,2)+g(p,4)+g(m,4)+g(C.length,2)+C})(this.dirRecords.length,h,s,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},E.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},E.prototype.registerPrevious=function(s){this._sources.push(s);var v=this;return s.on("data",function(h){v.processChunk(h)}),s.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),s.on("error",function(h){v.error(h)}),this},E.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},E.prototype.error=function(s){var v=this._sources;if(!c.prototype.error.call(this,s))return!1;for(var h=0;h<v.length;h++)try{v[h].error(s)}catch{}return!0},E.prototype.lock=function(){c.prototype.lock.call(this);for(var s=this._sources,v=0;v<s.length;v++)s[v].lock()},d.exports=E},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,d,x){var g=t("../compressions"),u=t("./ZipFileWorker");x.generateWorker=function(r,c,l){var b=new u(c.streamFiles,l,c.platform,c.encodeFileName),T=0;try{r.forEach(function(E,s){T++;var v=(function(p,m){var _=p||m,w=g[_];if(!w)throw new Error(_+" is not a valid compression method !");return w})(s.options.compression,c.compression),h=s.options.compressionOptions||c.compressionOptions||{},y=s.dir,n=s.date;s._compressWorker(v,h).withStreamInfo("file",{name:E,dir:y,date:n,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(b)}),b.entriesCount=T}catch(E){b.error(E)}return b}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,d,x){function g(){if(!(this instanceof g))return new g;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var u=new g;for(var r in this)typeof this[r]!="function"&&(u[r]=this[r]);return u}}(g.prototype=t("./object")).loadAsync=t("./load"),g.support=t("./support"),g.defaults=t("./defaults"),g.version="3.10.1",g.loadAsync=function(u,r){return new g().loadAsync(u,r)},g.external=t("./external"),d.exports=g},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,d,x){var g=t("./utils"),u=t("./external"),r=t("./utf8"),c=t("./zipEntries"),l=t("./stream/Crc32Probe"),b=t("./nodejsUtils");function T(E){return new u.Promise(function(s,v){var h=E.decompressed.getContentWorker().pipe(new l);h.on("error",function(y){v(y)}).on("end",function(){h.streamInfo.crc32!==E.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):s()}).resume()})}d.exports=function(E,s){var v=this;return s=g.extend(s||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),b.isNode&&b.isStream(E)?u.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):g.prepareContent("the loaded zip file",E,!0,s.optimizedBinaryString,s.base64).then(function(h){var y=new c(s);return y.load(h),y}).then(function(h){var y=[u.Promise.resolve(h)],n=h.files;if(s.checkCRC32)for(var p=0;p<n.length;p++)y.push(T(n[p]));return u.Promise.all(y)}).then(function(h){for(var y=h.shift(),n=y.files,p=0;p<n.length;p++){var m=n[p],_=m.fileNameStr,w=g.resolve(m.fileNameStr);v.file(w,m.decompressed,{binary:!0,optimizedBinaryString:!0,date:m.date,dir:m.dir,comment:m.fileCommentStr.length?m.fileCommentStr:null,unixPermissions:m.unixPermissions,dosPermissions:m.dosPermissions,createFolders:s.createFolders}),m.dir||(v.file(w).unsafeOriginalName=_)}return y.zipComment.length&&(v.comment=y.zipComment),v})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,d,x){var g=t("../utils"),u=t("../stream/GenericWorker");function r(c,l){u.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(l)}g.inherits(r,u),r.prototype._bindStream=function(c){var l=this;(this._stream=c).pause(),c.on("data",function(b){l.push({data:b,meta:{percent:0}})}).on("error",function(b){l.isPaused?this.generatedError=b:l.error(b)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},r.prototype.pause=function(){return!!u.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},d.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,d,x){var g=t("readable-stream").Readable;function u(r,c,l){g.call(this,c),this._helper=r;var b=this;r.on("data",function(T,E){b.push(T)||b._helper.pause(),l&&l(E)}).on("error",function(T){b.emit("error",T)}).on("end",function(){b.push(null)})}t("../utils").inherits(u,g),u.prototype._read=function(){this._helper.resume()},d.exports=u},{"../utils":32,"readable-stream":16}],14:[function(t,d,x){d.exports={isNode:typeof Buffer<"u",newBufferFrom:function(g,u){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(g,u);if(typeof g=="number")throw new Error('The "data" argument must not be a number');return new Buffer(g,u)},allocBuffer:function(g){if(Buffer.alloc)return Buffer.alloc(g);var u=new Buffer(g);return u.fill(0),u},isBuffer:function(g){return Buffer.isBuffer(g)},isStream:function(g){return g&&typeof g.on=="function"&&typeof g.pause=="function"&&typeof g.resume=="function"}}},{}],15:[function(t,d,x){function g(w,C,o){var i,B=r.getTypeOf(C),N=r.extend(o||{},b);N.date=N.date||new Date,N.compression!==null&&(N.compression=N.compression.toUpperCase()),typeof N.unixPermissions=="string"&&(N.unixPermissions=parseInt(N.unixPermissions,8)),N.unixPermissions&&16384&N.unixPermissions&&(N.dir=!0),N.dosPermissions&&16&N.dosPermissions&&(N.dir=!0),N.dir&&(w=n(w)),N.createFolders&&(i=y(w))&&p.call(this,i,!0);var q=B==="string"&&N.binary===!1&&N.base64===!1;o&&o.binary!==void 0||(N.binary=!q),(C instanceof T&&C.uncompressedSize===0||N.dir||!C||C.length===0)&&(N.base64=!1,N.binary=!0,C="",N.compression="STORE",B="string");var I=null;I=C instanceof T||C instanceof c?C:v.isNode&&v.isStream(C)?new h(w,C):r.prepareContent(w,C,N.binary,N.optimizedBinaryString,N.base64);var F=new E(w,I,N);this.files[w]=F}var u=t("./utf8"),r=t("./utils"),c=t("./stream/GenericWorker"),l=t("./stream/StreamHelper"),b=t("./defaults"),T=t("./compressedObject"),E=t("./zipObject"),s=t("./generate"),v=t("./nodejsUtils"),h=t("./nodejs/NodejsStreamInputAdapter"),y=function(w){w.slice(-1)==="/"&&(w=w.substring(0,w.length-1));var C=w.lastIndexOf("/");return 0<C?w.substring(0,C):""},n=function(w){return w.slice(-1)!=="/"&&(w+="/"),w},p=function(w,C){return C=C!==void 0?C:b.createFolders,w=n(w),this.files[w]||g.call(this,w,null,{dir:!0,createFolders:C}),this.files[w]};function m(w){return Object.prototype.toString.call(w)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(w){var C,o,i;for(C in this.files)i=this.files[C],(o=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&w(o,i)},filter:function(w){var C=[];return this.forEach(function(o,i){w(o,i)&&C.push(i)}),C},file:function(w,C,o){if(arguments.length!==1)return w=this.root+w,g.call(this,w,C,o),this;if(m(w)){var i=w;return this.filter(function(N,q){return!q.dir&&i.test(N)})}var B=this.files[this.root+w];return B&&!B.dir?B:null},folder:function(w){if(!w)return this;if(m(w))return this.filter(function(B,N){return N.dir&&w.test(B)});var C=this.root+w,o=p.call(this,C),i=this.clone();return i.root=o.name,i},remove:function(w){w=this.root+w;var C=this.files[w];if(C||(w.slice(-1)!=="/"&&(w+="/"),C=this.files[w]),C&&!C.dir)delete this.files[w];else for(var o=this.filter(function(B,N){return N.name.slice(0,w.length)===w}),i=0;i<o.length;i++)delete this.files[o[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(w){var C,o={};try{if((o=r.extend(w||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:u.utf8encode})).type=o.type.toLowerCase(),o.compression=o.compression.toUpperCase(),o.type==="binarystring"&&(o.type="string"),!o.type)throw new Error("No output type specified.");r.checkSupport(o.type),o.platform!=="darwin"&&o.platform!=="freebsd"&&o.platform!=="linux"&&o.platform!=="sunos"||(o.platform="UNIX"),o.platform==="win32"&&(o.platform="DOS");var i=o.comment||this.comment||"";C=s.generateWorker(this,o,i)}catch(B){(C=new c("error")).error(B)}return new l(C,o.type||"string",o.mimeType)},generateAsync:function(w,C){return this.generateInternalStream(w).accumulate(C)},generateNodeStream:function(w,C){return(w=w||{}).type||(w.type="nodebuffer"),this.generateInternalStream(w).toNodejsStream(C)}};d.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,d,x){d.exports=t("stream")},{stream:void 0}],17:[function(t,d,x){var g=t("./DataReader");function u(r){g.call(this,r);for(var c=0;c<this.data.length;c++)r[c]=255&r[c]}t("../utils").inherits(u,g),u.prototype.byteAt=function(r){return this.data[this.zero+r]},u.prototype.lastIndexOfSignature=function(r){for(var c=r.charCodeAt(0),l=r.charCodeAt(1),b=r.charCodeAt(2),T=r.charCodeAt(3),E=this.length-4;0<=E;--E)if(this.data[E]===c&&this.data[E+1]===l&&this.data[E+2]===b&&this.data[E+3]===T)return E-this.zero;return-1},u.prototype.readAndCheckSignature=function(r){var c=r.charCodeAt(0),l=r.charCodeAt(1),b=r.charCodeAt(2),T=r.charCodeAt(3),E=this.readData(4);return c===E[0]&&l===E[1]&&b===E[2]&&T===E[3]},u.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./DataReader":18}],18:[function(t,d,x){var g=t("../utils");function u(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}u.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var c,l=0;for(this.checkOffset(r),c=this.index+r-1;c>=this.index;c--)l=(l<<8)+this.byteAt(c);return this.index+=r,l},readString:function(r){return g.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},d.exports=u},{"../utils":32}],19:[function(t,d,x){var g=t("./Uint8ArrayReader");function u(r){g.call(this,r)}t("../utils").inherits(u,g),u.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,d,x){var g=t("./DataReader");function u(r){g.call(this,r)}t("../utils").inherits(u,g),u.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},u.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},u.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},u.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./DataReader":18}],21:[function(t,d,x){var g=t("./ArrayReader");function u(r){g.call(this,r)}t("../utils").inherits(u,g),u.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},d.exports=u},{"../utils":32,"./ArrayReader":17}],22:[function(t,d,x){var g=t("../utils"),u=t("../support"),r=t("./ArrayReader"),c=t("./StringReader"),l=t("./NodeBufferReader"),b=t("./Uint8ArrayReader");d.exports=function(T){var E=g.getTypeOf(T);return g.checkSupport(E),E!=="string"||u.uint8array?E==="nodebuffer"?new l(T):u.uint8array?new b(g.transformTo("uint8array",T)):new r(g.transformTo("array",T)):new c(T)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,d,x){x.LOCAL_FILE_HEADER="PK",x.CENTRAL_FILE_HEADER="PK",x.CENTRAL_DIRECTORY_END="PK",x.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",x.ZIP64_CENTRAL_DIRECTORY_END="PK",x.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,d,x){var g=t("./GenericWorker"),u=t("../utils");function r(c){g.call(this,"ConvertWorker to "+c),this.destType=c}u.inherits(r,g),r.prototype.processChunk=function(c){this.push({data:u.transformTo(this.destType,c.data),meta:c.meta})},d.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,d,x){var g=t("./GenericWorker"),u=t("../crc32");function r(){g.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,g),r.prototype.processChunk=function(c){this.streamInfo.crc32=u(c.data,this.streamInfo.crc32||0),this.push(c)},d.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,d,x){var g=t("../utils"),u=t("./GenericWorker");function r(c){u.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}g.inherits(r,u),r.prototype.processChunk=function(c){if(c){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+c.data.length}u.prototype.processChunk.call(this,c)},d.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,d,x){var g=t("../utils"),u=t("./GenericWorker");function r(c){u.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(b){l.dataIsReady=!0,l.data=b,l.max=b&&b.length||0,l.type=g.getTypeOf(b),l.isPaused||l._tickAndRepeat()},function(b){l.error(b)})}g.inherits(r,u),r.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,g.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(g.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,l);break;case"uint8array":c=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":c=this.data.slice(this.index,l)}return this.index=l,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},d.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,d,x){function g(u){this.name=u||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}g.prototype={push:function(u){this.emit("data",u)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(u){this.emit("error",u)}return!0},error:function(u){return!this.isFinished&&(this.isPaused?this.generatedError=u:(this.isFinished=!0,this.emit("error",u),this.previous&&this.previous.error(u),this.cleanUp()),!0)},on:function(u,r){return this._listeners[u].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(u,r){if(this._listeners[u])for(var c=0;c<this._listeners[u].length;c++)this._listeners[u][c].call(this,r)},pipe:function(u){return u.registerPrevious(this)},registerPrevious:function(u){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=u.streamInfo,this.mergeStreamInfo(),this.previous=u;var r=this;return u.on("data",function(c){r.processChunk(c)}),u.on("end",function(){r.end()}),u.on("error",function(c){r.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var u=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),u=!0),this.previous&&this.previous.resume(),!u},flush:function(){},processChunk:function(u){this.push(u)},withStreamInfo:function(u,r){return this.extraStreamInfo[u]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var u in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,u)&&(this.streamInfo[u]=this.extraStreamInfo[u])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var u="Worker "+this.name;return this.previous?this.previous+" -> "+u:u}},d.exports=g},{}],29:[function(t,d,x){var g=t("../utils"),u=t("./ConvertWorker"),r=t("./GenericWorker"),c=t("../base64"),l=t("../support"),b=t("../external"),T=null;if(l.nodestream)try{T=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function E(v,h){return new b.Promise(function(y,n){var p=[],m=v._internalType,_=v._outputType,w=v._mimeType;v.on("data",function(C,o){p.push(C),h&&h(o)}).on("error",function(C){p=[],n(C)}).on("end",function(){try{var C=(function(o,i,B){switch(o){case"blob":return g.newBlob(g.transformTo("arraybuffer",i),B);case"base64":return c.encode(i);default:return g.transformTo(o,i)}})(_,(function(o,i){var B,N=0,q=null,I=0;for(B=0;B<i.length;B++)I+=i[B].length;switch(o){case"string":return i.join("");case"array":return Array.prototype.concat.apply([],i);case"uint8array":for(q=new Uint8Array(I),B=0;B<i.length;B++)q.set(i[B],N),N+=i[B].length;return q;case"nodebuffer":return Buffer.concat(i);default:throw new Error("concat : unsupported type '"+o+"'")}})(m,p),w);y(C)}catch(o){n(o)}p=[]}).resume()})}function s(v,h,y){var n=h;switch(h){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=h,this._mimeType=y,g.checkSupport(n),this._worker=v.pipe(new u(n)),v.lock()}catch(p){this._worker=new r("error"),this._worker.error(p)}}s.prototype={accumulate:function(v){return E(this,v)},on:function(v,h){var y=this;return v==="data"?this._worker.on(v,function(n){h.call(y,n.data,n.meta)}):this._worker.on(v,function(){g.delay(h,arguments,y)}),this},resume:function(){return g.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(v){if(g.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new T(this,{objectMode:this._outputType!=="nodebuffer"},v)}},d.exports=s},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,d,x){if(x.base64=!0,x.array=!0,x.string=!0,x.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",x.nodebuffer=typeof Buffer<"u",x.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")x.blob=!1;else{var g=new ArrayBuffer(0);try{x.blob=new Blob([g],{type:"application/zip"}).size===0}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);u.append(g),x.blob=u.getBlob("application/zip").size===0}catch{x.blob=!1}}}try{x.nodestream=!!t("readable-stream").Readable}catch{x.nodestream=!1}},{"readable-stream":16}],31:[function(t,d,x){for(var g=t("./utils"),u=t("./support"),r=t("./nodejsUtils"),c=t("./stream/GenericWorker"),l=new Array(256),b=0;b<256;b++)l[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;l[254]=l[254]=1;function T(){c.call(this,"utf-8 decode"),this.leftOver=null}function E(){c.call(this,"utf-8 encode")}x.utf8encode=function(s){return u.nodebuffer?r.newBufferFrom(s,"utf-8"):(function(v){var h,y,n,p,m,_=v.length,w=0;for(p=0;p<_;p++)(64512&(y=v.charCodeAt(p)))==55296&&p+1<_&&(64512&(n=v.charCodeAt(p+1)))==56320&&(y=65536+(y-55296<<10)+(n-56320),p++),w+=y<128?1:y<2048?2:y<65536?3:4;for(h=u.uint8array?new Uint8Array(w):new Array(w),p=m=0;m<w;p++)(64512&(y=v.charCodeAt(p)))==55296&&p+1<_&&(64512&(n=v.charCodeAt(p+1)))==56320&&(y=65536+(y-55296<<10)+(n-56320),p++),y<128?h[m++]=y:(y<2048?h[m++]=192|y>>>6:(y<65536?h[m++]=224|y>>>12:(h[m++]=240|y>>>18,h[m++]=128|y>>>12&63),h[m++]=128|y>>>6&63),h[m++]=128|63&y);return h})(s)},x.utf8decode=function(s){return u.nodebuffer?g.transformTo("nodebuffer",s).toString("utf-8"):(function(v){var h,y,n,p,m=v.length,_=new Array(2*m);for(h=y=0;h<m;)if((n=v[h++])<128)_[y++]=n;else if(4<(p=l[n]))_[y++]=65533,h+=p-1;else{for(n&=p===2?31:p===3?15:7;1<p&&h<m;)n=n<<6|63&v[h++],p--;1<p?_[y++]=65533:n<65536?_[y++]=n:(n-=65536,_[y++]=55296|n>>10&1023,_[y++]=56320|1023&n)}return _.length!==y&&(_.subarray?_=_.subarray(0,y):_.length=y),g.applyFromCharCode(_)})(s=g.transformTo(u.uint8array?"uint8array":"array",s))},g.inherits(T,c),T.prototype.processChunk=function(s){var v=g.transformTo(u.uint8array?"uint8array":"array",s.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var h=v;(v=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),v.set(h,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var y=(function(p,m){var _;for((m=m||p.length)>p.length&&(m=p.length),_=m-1;0<=_&&(192&p[_])==128;)_--;return _<0||_===0?m:_+l[p[_]]>m?_:m})(v),n=v;y!==v.length&&(u.uint8array?(n=v.subarray(0,y),this.leftOver=v.subarray(y,v.length)):(n=v.slice(0,y),this.leftOver=v.slice(y,v.length))),this.push({data:x.utf8decode(n),meta:s.meta})},T.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:x.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},x.Utf8DecodeWorker=T,g.inherits(E,c),E.prototype.processChunk=function(s){this.push({data:x.utf8encode(s.data),meta:s.meta})},x.Utf8EncodeWorker=E},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,d,x){var g=t("./support"),u=t("./base64"),r=t("./nodejsUtils"),c=t("./external");function l(h){return h}function b(h,y){for(var n=0;n<h.length;++n)y[n]=255&h.charCodeAt(n);return y}t("setimmediate"),x.newBlob=function(h,y){x.checkSupport("blob");try{return new Blob([h],{type:y})}catch{try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(h),n.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var T={stringifyByChunk:function(h,y,n){var p=[],m=0,_=h.length;if(_<=n)return String.fromCharCode.apply(null,h);for(;m<_;)y==="array"||y==="nodebuffer"?p.push(String.fromCharCode.apply(null,h.slice(m,Math.min(m+n,_)))):p.push(String.fromCharCode.apply(null,h.subarray(m,Math.min(m+n,_)))),m+=n;return p.join("")},stringifyByChar:function(h){for(var y="",n=0;n<h.length;n++)y+=String.fromCharCode(h[n]);return y},applyCanBeUsed:{uint8array:(function(){try{return g.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return g.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function E(h){var y=65536,n=x.getTypeOf(h),p=!0;if(n==="uint8array"?p=T.applyCanBeUsed.uint8array:n==="nodebuffer"&&(p=T.applyCanBeUsed.nodebuffer),p)for(;1<y;)try{return T.stringifyByChunk(h,n,y)}catch{y=Math.floor(y/2)}return T.stringifyByChar(h)}function s(h,y){for(var n=0;n<h.length;n++)y[n]=h[n];return y}x.applyFromCharCode=E;var v={};v.string={string:l,array:function(h){return b(h,new Array(h.length))},arraybuffer:function(h){return v.string.uint8array(h).buffer},uint8array:function(h){return b(h,new Uint8Array(h.length))},nodebuffer:function(h){return b(h,r.allocBuffer(h.length))}},v.array={string:E,array:l,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return r.newBufferFrom(h)}},v.arraybuffer={string:function(h){return E(new Uint8Array(h))},array:function(h){return s(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:l,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return r.newBufferFrom(new Uint8Array(h))}},v.uint8array={string:E,array:function(h){return s(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:l,nodebuffer:function(h){return r.newBufferFrom(h)}},v.nodebuffer={string:E,array:function(h){return s(h,new Array(h.length))},arraybuffer:function(h){return v.nodebuffer.uint8array(h).buffer},uint8array:function(h){return s(h,new Uint8Array(h.length))},nodebuffer:l},x.transformTo=function(h,y){if(y=y||"",!h)return y;x.checkSupport(h);var n=x.getTypeOf(y);return v[n][h](y)},x.resolve=function(h){for(var y=h.split("/"),n=[],p=0;p<y.length;p++){var m=y[p];m==="."||m===""&&p!==0&&p!==y.length-1||(m===".."?n.pop():n.push(m))}return n.join("/")},x.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":g.nodebuffer&&r.isBuffer(h)?"nodebuffer":g.uint8array&&h instanceof Uint8Array?"uint8array":g.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},x.checkSupport=function(h){if(!g[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},x.MAX_VALUE_16BITS=65535,x.MAX_VALUE_32BITS=-1,x.pretty=function(h){var y,n,p="";for(n=0;n<(h||"").length;n++)p+="\\x"+((y=h.charCodeAt(n))<16?"0":"")+y.toString(16).toUpperCase();return p},x.delay=function(h,y,n){setImmediate(function(){h.apply(n||null,y||[])})},x.inherits=function(h,y){function n(){}n.prototype=y.prototype,h.prototype=new n},x.extend=function(){var h,y,n={};for(h=0;h<arguments.length;h++)for(y in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],y)&&n[y]===void 0&&(n[y]=arguments[h][y]);return n},x.prepareContent=function(h,y,n,p,m){return c.Promise.resolve(y).then(function(_){return g.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new c.Promise(function(w,C){var o=new FileReader;o.onload=function(i){w(i.target.result)},o.onerror=function(i){C(i.target.error)},o.readAsArrayBuffer(_)}):_}).then(function(_){var w=x.getTypeOf(_);return w?(w==="arraybuffer"?_=x.transformTo("uint8array",_):w==="string"&&(m?_=u.decode(_):n&&p!==!0&&(_=(function(C){return b(C,g.uint8array?new Uint8Array(C.length):new Array(C.length))})(_))),_):c.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,d,x){var g=t("./reader/readerFor"),u=t("./utils"),r=t("./signature"),c=t("./zipEntry"),l=t("./support");function b(T){this.files=[],this.loadOptions=T}b.prototype={checkSignature:function(T){if(!this.reader.readAndCheckSignature(T)){this.reader.index-=4;var E=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+u.pretty(E)+", expected "+u.pretty(T)+")")}},isSignature:function(T,E){var s=this.reader.index;this.reader.setIndex(T);var v=this.reader.readString(4)===E;return this.reader.setIndex(s),v},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var T=this.reader.readData(this.zipCommentLength),E=l.uint8array?"uint8array":"array",s=u.transformTo(E,T);this.zipComment=this.loadOptions.decodeFileName(s)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var T,E,s,v=this.zip64EndOfCentralSize-44;0<v;)T=this.reader.readInt(2),E=this.reader.readInt(4),s=this.reader.readData(E),this.zip64ExtensibleData[T]={id:T,length:E,value:s}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var T,E;for(T=0;T<this.files.length;T++)E=this.files[T],this.reader.setIndex(E.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),E.readLocalPart(this.reader),E.handleUTF8(),E.processAttributes()},readCentralDir:function(){var T;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(T=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(T);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var T=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(T<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(T);var E=T;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===u.MAX_VALUE_16BITS||this.diskWithCentralDirStart===u.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===u.MAX_VALUE_16BITS||this.centralDirRecords===u.MAX_VALUE_16BITS||this.centralDirSize===u.MAX_VALUE_32BITS||this.centralDirOffset===u.MAX_VALUE_32BITS){if(this.zip64=!0,(T=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(T),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var s=this.centralDirOffset+this.centralDirSize;this.zip64&&(s+=20,s+=12+this.zip64EndOfCentralSize);var v=E-s;if(0<v)this.isSignature(E,r.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" bytes.")},prepareReader:function(T){this.reader=g(T)},load:function(T){this.prepareReader(T),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},d.exports=b},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,d,x){var g=t("./reader/readerFor"),u=t("./utils"),r=t("./compressedObject"),c=t("./crc32"),l=t("./utf8"),b=t("./compressions"),T=t("./support");function E(s,v){this.options=s,this.loadOptions=v}E.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(s){var v,h;if(s.skip(22),this.fileNameLength=s.readInt(2),h=s.readInt(2),this.fileName=s.readData(this.fileNameLength),s.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((v=(function(y){for(var n in b)if(Object.prototype.hasOwnProperty.call(b,n)&&b[n].magic===y)return b[n];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+u.pretty(this.compressionMethod)+" unknown (inner file : "+u.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,v,s.readData(this.compressedSize))},readCentralPart:function(s){this.versionMadeBy=s.readInt(2),s.skip(2),this.bitFlag=s.readInt(2),this.compressionMethod=s.readString(2),this.date=s.readDate(),this.crc32=s.readInt(4),this.compressedSize=s.readInt(4),this.uncompressedSize=s.readInt(4);var v=s.readInt(2);if(this.extraFieldsLength=s.readInt(2),this.fileCommentLength=s.readInt(2),this.diskNumberStart=s.readInt(2),this.internalFileAttributes=s.readInt(2),this.externalFileAttributes=s.readInt(4),this.localHeaderOffset=s.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");s.skip(v),this.readExtraFields(s),this.parseZIP64ExtraField(s),this.fileComment=s.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var s=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),s==0&&(this.dosPermissions=63&this.externalFileAttributes),s==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var s=g(this.extraFields[1].value);this.uncompressedSize===u.MAX_VALUE_32BITS&&(this.uncompressedSize=s.readInt(8)),this.compressedSize===u.MAX_VALUE_32BITS&&(this.compressedSize=s.readInt(8)),this.localHeaderOffset===u.MAX_VALUE_32BITS&&(this.localHeaderOffset=s.readInt(8)),this.diskNumberStart===u.MAX_VALUE_32BITS&&(this.diskNumberStart=s.readInt(4))}},readExtraFields:function(s){var v,h,y,n=s.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});s.index+4<n;)v=s.readInt(2),h=s.readInt(2),y=s.readData(h),this.extraFields[v]={id:v,length:h,value:y};s.setIndex(n)},handleUTF8:function(){var s=T.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;else{var h=u.transformTo(s,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var n=u.transformTo(s,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var s=this.extraFields[28789];if(s){var v=g(s.value);return v.readInt(1)!==1||c(this.fileName)!==v.readInt(4)?null:l.utf8decode(v.readData(s.length-5))}return null},findExtraFieldUnicodeComment:function(){var s=this.extraFields[25461];if(s){var v=g(s.value);return v.readInt(1)!==1||c(this.fileComment)!==v.readInt(4)?null:l.utf8decode(v.readData(s.length-5))}return null}},d.exports=E},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,d,x){function g(v,h,y){this.name=v,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=h,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var u=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),c=t("./utf8"),l=t("./compressedObject"),b=t("./stream/GenericWorker");g.prototype={internalStream:function(v){var h=null,y="string";try{if(!v)throw new Error("No output type specified.");var n=(y=v.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),h=this._decompressWorker();var p=!this._dataBinary;p&&!n&&(h=h.pipe(new c.Utf8EncodeWorker)),!p&&n&&(h=h.pipe(new c.Utf8DecodeWorker))}catch(m){(h=new b("error")).error(m)}return new u(h,y,"")},async:function(v,h){return this.internalStream(v).accumulate(h)},nodeStream:function(v,h){return this.internalStream(v||"nodebuffer").toNodejsStream(h)},_compressWorker:function(v,h){if(this._data instanceof l&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new c.Utf8EncodeWorker)),l.createWorkerFrom(y,v,h)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof b?this._data:new r(this._data)}};for(var T=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],E=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},s=0;s<T.length;s++)g.prototype[T[s]]=E;d.exports=g},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,d,x){(function(g){var u,r,c=g.MutationObserver||g.WebKitMutationObserver;if(c){var l=0,b=new c(v),T=g.document.createTextNode("");b.observe(T,{characterData:!0}),u=function(){T.data=l=++l%2}}else if(g.setImmediate||g.MessageChannel===void 0)u="document"in g&&"onreadystatechange"in g.document.createElement("script")?function(){var h=g.document.createElement("script");h.onreadystatechange=function(){v(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},g.document.documentElement.appendChild(h)}:function(){setTimeout(v,0)};else{var E=new g.MessageChannel;E.port1.onmessage=v,u=function(){E.port2.postMessage(0)}}var s=[];function v(){var h,y;r=!0;for(var n=s.length;n;){for(y=s,s=[],h=-1;++h<n;)y[h]();n=s.length}r=!1}d.exports=function(h){s.push(h)!==1||r||u()}}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,d,x){var g=t("immediate");function u(){}var r={},c=["REJECTED"],l=["FULFILLED"],b=["PENDING"];function T(n){if(typeof n!="function")throw new TypeError("resolver must be a function");this.state=b,this.queue=[],this.outcome=void 0,n!==u&&h(this,n)}function E(n,p,m){this.promise=n,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof m=="function"&&(this.onRejected=m,this.callRejected=this.otherCallRejected)}function s(n,p,m){g(function(){var _;try{_=p(m)}catch(w){return r.reject(n,w)}_===n?r.reject(n,new TypeError("Cannot resolve promise with itself")):r.resolve(n,_)})}function v(n){var p=n&&n.then;if(n&&(typeof n=="object"||typeof n=="function")&&typeof p=="function")return function(){p.apply(n,arguments)}}function h(n,p){var m=!1;function _(o){m||(m=!0,r.reject(n,o))}function w(o){m||(m=!0,r.resolve(n,o))}var C=y(function(){p(w,_)});C.status==="error"&&_(C.value)}function y(n,p){var m={};try{m.value=n(p),m.status="success"}catch(_){m.status="error",m.value=_}return m}(d.exports=T).prototype.finally=function(n){if(typeof n!="function")return this;var p=this.constructor;return this.then(function(m){return p.resolve(n()).then(function(){return m})},function(m){return p.resolve(n()).then(function(){throw m})})},T.prototype.catch=function(n){return this.then(null,n)},T.prototype.then=function(n,p){if(typeof n!="function"&&this.state===l||typeof p!="function"&&this.state===c)return this;var m=new this.constructor(u);return this.state!==b?s(m,this.state===l?n:p,this.outcome):this.queue.push(new E(m,n,p)),m},E.prototype.callFulfilled=function(n){r.resolve(this.promise,n)},E.prototype.otherCallFulfilled=function(n){s(this.promise,this.onFulfilled,n)},E.prototype.callRejected=function(n){r.reject(this.promise,n)},E.prototype.otherCallRejected=function(n){s(this.promise,this.onRejected,n)},r.resolve=function(n,p){var m=y(v,p);if(m.status==="error")return r.reject(n,m.value);var _=m.value;if(_)h(n,_);else{n.state=l,n.outcome=p;for(var w=-1,C=n.queue.length;++w<C;)n.queue[w].callFulfilled(p)}return n},r.reject=function(n,p){n.state=c,n.outcome=p;for(var m=-1,_=n.queue.length;++m<_;)n.queue[m].callRejected(p);return n},T.resolve=function(n){return n instanceof this?n:r.resolve(new this(u),n)},T.reject=function(n){var p=new this(u);return r.reject(p,n)},T.all=function(n){var p=this;if(Object.prototype.toString.call(n)!=="[object Array]")return this.reject(new TypeError("must be an array"));var m=n.length,_=!1;if(!m)return this.resolve([]);for(var w=new Array(m),C=0,o=-1,i=new this(u);++o<m;)B(n[o],o);return i;function B(N,q){p.resolve(N).then(function(I){w[q]=I,++C!==m||_||(_=!0,r.resolve(i,w))},function(I){_||(_=!0,r.reject(i,I))})}},T.race=function(n){var p=this;if(Object.prototype.toString.call(n)!=="[object Array]")return this.reject(new TypeError("must be an array"));var m=n.length,_=!1;if(!m)return this.resolve([]);for(var w=-1,C=new this(u);++w<m;)o=n[w],p.resolve(o).then(function(i){_||(_=!0,r.resolve(C,i))},function(i){_||(_=!0,r.reject(C,i))});var o;return C}},{immediate:36}],38:[function(t,d,x){var g={};(0,t("./lib/utils/common").assign)(g,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),d.exports=g},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,d,x){var g=t("./zlib/deflate"),u=t("./utils/common"),r=t("./utils/strings"),c=t("./zlib/messages"),l=t("./zlib/zstream"),b=Object.prototype.toString,T=0,E=-1,s=0,v=8;function h(n){if(!(this instanceof h))return new h(n);this.options=u.assign({level:E,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:s,to:""},n||{});var p=this.options;p.raw&&0<p.windowBits?p.windowBits=-p.windowBits:p.gzip&&0<p.windowBits&&p.windowBits<16&&(p.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var m=g.deflateInit2(this.strm,p.level,p.method,p.windowBits,p.memLevel,p.strategy);if(m!==T)throw new Error(c[m]);if(p.header&&g.deflateSetHeader(this.strm,p.header),p.dictionary){var _;if(_=typeof p.dictionary=="string"?r.string2buf(p.dictionary):b.call(p.dictionary)==="[object ArrayBuffer]"?new Uint8Array(p.dictionary):p.dictionary,(m=g.deflateSetDictionary(this.strm,_))!==T)throw new Error(c[m]);this._dict_set=!0}}function y(n,p){var m=new h(p);if(m.push(n,!0),m.err)throw m.msg||c[m.err];return m.result}h.prototype.push=function(n,p){var m,_,w=this.strm,C=this.options.chunkSize;if(this.ended)return!1;_=p===~~p?p:p===!0?4:0,typeof n=="string"?w.input=r.string2buf(n):b.call(n)==="[object ArrayBuffer]"?w.input=new Uint8Array(n):w.input=n,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new u.Buf8(C),w.next_out=0,w.avail_out=C),(m=g.deflate(w,_))!==1&&m!==T)return this.onEnd(m),!(this.ended=!0);w.avail_out!==0&&(w.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(u.shrinkBuf(w.output,w.next_out))):this.onData(u.shrinkBuf(w.output,w.next_out)))}while((0<w.avail_in||w.avail_out===0)&&m!==1);return _===4?(m=g.deflateEnd(this.strm),this.onEnd(m),this.ended=!0,m===T):_!==2||(this.onEnd(T),!(w.avail_out=0))},h.prototype.onData=function(n){this.chunks.push(n)},h.prototype.onEnd=function(n){n===T&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},x.Deflate=h,x.deflate=y,x.deflateRaw=function(n,p){return(p=p||{}).raw=!0,y(n,p)},x.gzip=function(n,p){return(p=p||{}).gzip=!0,y(n,p)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,d,x){var g=t("./zlib/inflate"),u=t("./utils/common"),r=t("./utils/strings"),c=t("./zlib/constants"),l=t("./zlib/messages"),b=t("./zlib/zstream"),T=t("./zlib/gzheader"),E=Object.prototype.toString;function s(h){if(!(this instanceof s))return new s(h);this.options=u.assign({chunkSize:16384,windowBits:0,to:""},h||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||h&&h.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var n=g.inflateInit2(this.strm,y.windowBits);if(n!==c.Z_OK)throw new Error(l[n]);this.header=new T,g.inflateGetHeader(this.strm,this.header)}function v(h,y){var n=new s(y);if(n.push(h,!0),n.err)throw n.msg||l[n.err];return n.result}s.prototype.push=function(h,y){var n,p,m,_,w,C,o=this.strm,i=this.options.chunkSize,B=this.options.dictionary,N=!1;if(this.ended)return!1;p=y===~~y?y:y===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof h=="string"?o.input=r.binstring2buf(h):E.call(h)==="[object ArrayBuffer]"?o.input=new Uint8Array(h):o.input=h,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new u.Buf8(i),o.next_out=0,o.avail_out=i),(n=g.inflate(o,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&B&&(C=typeof B=="string"?r.string2buf(B):E.call(B)==="[object ArrayBuffer]"?new Uint8Array(B):B,n=g.inflateSetDictionary(this.strm,C)),n===c.Z_BUF_ERROR&&N===!0&&(n=c.Z_OK,N=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),!(this.ended=!0);o.next_out&&(o.avail_out!==0&&n!==c.Z_STREAM_END&&(o.avail_in!==0||p!==c.Z_FINISH&&p!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(m=r.utf8border(o.output,o.next_out),_=o.next_out-m,w=r.buf2string(o.output,m),o.next_out=_,o.avail_out=i-_,_&&u.arraySet(o.output,o.output,m,_,0),this.onData(w)):this.onData(u.shrinkBuf(o.output,o.next_out)))),o.avail_in===0&&o.avail_out===0&&(N=!0)}while((0<o.avail_in||o.avail_out===0)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(p=c.Z_FINISH),p===c.Z_FINISH?(n=g.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):p!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(o.avail_out=0))},s.prototype.onData=function(h){this.chunks.push(h)},s.prototype.onEnd=function(h){h===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},x.Inflate=s,x.inflate=v,x.inflateRaw=function(h,y){return(y=y||{}).raw=!0,v(h,y)},x.ungzip=v},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,d,x){var g=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";x.assign=function(c){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var b=l.shift();if(b){if(typeof b!="object")throw new TypeError(b+"must be non-object");for(var T in b)b.hasOwnProperty(T)&&(c[T]=b[T])}}return c},x.shrinkBuf=function(c,l){return c.length===l?c:c.subarray?c.subarray(0,l):(c.length=l,c)};var u={arraySet:function(c,l,b,T,E){if(l.subarray&&c.subarray)c.set(l.subarray(b,b+T),E);else for(var s=0;s<T;s++)c[E+s]=l[b+s]},flattenChunks:function(c){var l,b,T,E,s,v;for(l=T=0,b=c.length;l<b;l++)T+=c[l].length;for(v=new Uint8Array(T),l=E=0,b=c.length;l<b;l++)s=c[l],v.set(s,E),E+=s.length;return v}},r={arraySet:function(c,l,b,T,E){for(var s=0;s<T;s++)c[E+s]=l[b+s]},flattenChunks:function(c){return[].concat.apply([],c)}};x.setTyped=function(c){c?(x.Buf8=Uint8Array,x.Buf16=Uint16Array,x.Buf32=Int32Array,x.assign(x,u)):(x.Buf8=Array,x.Buf16=Array,x.Buf32=Array,x.assign(x,r))},x.setTyped(g)},{}],42:[function(t,d,x){var g=t("./common"),u=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{u=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var c=new g.Buf8(256),l=0;l<256;l++)c[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function b(T,E){if(E<65537&&(T.subarray&&r||!T.subarray&&u))return String.fromCharCode.apply(null,g.shrinkBuf(T,E));for(var s="",v=0;v<E;v++)s+=String.fromCharCode(T[v]);return s}c[254]=c[254]=1,x.string2buf=function(T){var E,s,v,h,y,n=T.length,p=0;for(h=0;h<n;h++)(64512&(s=T.charCodeAt(h)))==55296&&h+1<n&&(64512&(v=T.charCodeAt(h+1)))==56320&&(s=65536+(s-55296<<10)+(v-56320),h++),p+=s<128?1:s<2048?2:s<65536?3:4;for(E=new g.Buf8(p),h=y=0;y<p;h++)(64512&(s=T.charCodeAt(h)))==55296&&h+1<n&&(64512&(v=T.charCodeAt(h+1)))==56320&&(s=65536+(s-55296<<10)+(v-56320),h++),s<128?E[y++]=s:(s<2048?E[y++]=192|s>>>6:(s<65536?E[y++]=224|s>>>12:(E[y++]=240|s>>>18,E[y++]=128|s>>>12&63),E[y++]=128|s>>>6&63),E[y++]=128|63&s);return E},x.buf2binstring=function(T){return b(T,T.length)},x.binstring2buf=function(T){for(var E=new g.Buf8(T.length),s=0,v=E.length;s<v;s++)E[s]=T.charCodeAt(s);return E},x.buf2string=function(T,E){var s,v,h,y,n=E||T.length,p=new Array(2*n);for(s=v=0;s<n;)if((h=T[s++])<128)p[v++]=h;else if(4<(y=c[h]))p[v++]=65533,s+=y-1;else{for(h&=y===2?31:y===3?15:7;1<y&&s<n;)h=h<<6|63&T[s++],y--;1<y?p[v++]=65533:h<65536?p[v++]=h:(h-=65536,p[v++]=55296|h>>10&1023,p[v++]=56320|1023&h)}return b(p,v)},x.utf8border=function(T,E){var s;for((E=E||T.length)>T.length&&(E=T.length),s=E-1;0<=s&&(192&T[s])==128;)s--;return s<0||s===0?E:s+c[T[s]]>E?s:E}},{"./common":41}],43:[function(t,d,x){d.exports=function(g,u,r,c){for(var l=65535&g|0,b=g>>>16&65535|0,T=0;r!==0;){for(r-=T=2e3<r?2e3:r;b=b+(l=l+u[c++]|0)|0,--T;);l%=65521,b%=65521}return l|b<<16|0}},{}],44:[function(t,d,x){d.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,d,x){var g=(function(){for(var u,r=[],c=0;c<256;c++){u=c;for(var l=0;l<8;l++)u=1&u?3988292384^u>>>1:u>>>1;r[c]=u}return r})();d.exports=function(u,r,c,l){var b=g,T=l+c;u^=-1;for(var E=l;E<T;E++)u=u>>>8^b[255&(u^r[E])];return-1^u}},{}],46:[function(t,d,x){var g,u=t("../utils/common"),r=t("./trees"),c=t("./adler32"),l=t("./crc32"),b=t("./messages"),T=0,E=4,s=0,v=-2,h=-1,y=4,n=2,p=8,m=9,_=286,w=30,C=19,o=2*_+1,i=15,B=3,N=258,q=N+B+1,I=42,F=113,A=1,H=2,j=3,W=4;function re(f,L){return f.msg=b[L],L}function J(f){return(f<<1)-(4<f?9:0)}function oe(f){for(var L=f.length;0<=--L;)f[L]=0}function Q(f){var L=f.state,G=L.pending;G>f.avail_out&&(G=f.avail_out),G!==0&&(u.arraySet(f.output,L.pending_buf,L.pending_out,G,f.next_out),f.next_out+=G,L.pending_out+=G,f.total_out+=G,f.avail_out-=G,L.pending-=G,L.pending===0&&(L.pending_out=0))}function $(f,L){r._tr_flush_block(f,0<=f.block_start?f.block_start:-1,f.strstart-f.block_start,L),f.block_start=f.strstart,Q(f.strm)}function ce(f,L){f.pending_buf[f.pending++]=L}function ie(f,L){f.pending_buf[f.pending++]=L>>>8&255,f.pending_buf[f.pending++]=255&L}function ee(f,L){var G,M,V=f.max_chain_length,K=f.strstart,X=f.prev_length,te=f.nice_match,Y=f.strstart>f.w_size-q?f.strstart-(f.w_size-q):0,ae=f.window,fe=f.w_mask,se=f.prev,de=f.strstart+N,ye=ae[K+X-1],ge=ae[K+X];f.prev_length>=f.good_match&&(V>>=2),te>f.lookahead&&(te=f.lookahead);do if(ae[(G=L)+X]===ge&&ae[G+X-1]===ye&&ae[G]===ae[K]&&ae[++G]===ae[K+1]){K+=2,G++;do;while(ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&ae[++K]===ae[++G]&&K<de);if(M=N-(de-K),K=de-N,X<M){if(f.match_start=L,te<=(X=M))break;ye=ae[K+X-1],ge=ae[K+X]}}while((L=se[L&fe])>Y&&--V!=0);return X<=f.lookahead?X:f.lookahead}function ue(f){var L,G,M,V,K,X,te,Y,ae,fe,se=f.w_size;do{if(V=f.window_size-f.lookahead-f.strstart,f.strstart>=se+(se-q)){for(u.arraySet(f.window,f.window,se,se,0),f.match_start-=se,f.strstart-=se,f.block_start-=se,L=G=f.hash_size;M=f.head[--L],f.head[L]=se<=M?M-se:0,--G;);for(L=G=se;M=f.prev[--L],f.prev[L]=se<=M?M-se:0,--G;);V+=se}if(f.strm.avail_in===0)break;if(X=f.strm,te=f.window,Y=f.strstart+f.lookahead,ae=V,fe=void 0,fe=X.avail_in,ae<fe&&(fe=ae),G=fe===0?0:(X.avail_in-=fe,u.arraySet(te,X.input,X.next_in,fe,Y),X.state.wrap===1?X.adler=c(X.adler,te,fe,Y):X.state.wrap===2&&(X.adler=l(X.adler,te,fe,Y)),X.next_in+=fe,X.total_in+=fe,fe),f.lookahead+=G,f.lookahead+f.insert>=B)for(K=f.strstart-f.insert,f.ins_h=f.window[K],f.ins_h=(f.ins_h<<f.hash_shift^f.window[K+1])&f.hash_mask;f.insert&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[K+B-1])&f.hash_mask,f.prev[K&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=K,K++,f.insert--,!(f.lookahead+f.insert<B)););}while(f.lookahead<q&&f.strm.avail_in!==0)}function Se(f,L){for(var G,M;;){if(f.lookahead<q){if(ue(f),f.lookahead<q&&L===T)return A;if(f.lookahead===0)break}if(G=0,f.lookahead>=B&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),G!==0&&f.strstart-G<=f.w_size-q&&(f.match_length=ee(f,G)),f.match_length>=B)if(M=r._tr_tally(f,f.strstart-f.match_start,f.match_length-B),f.lookahead-=f.match_length,f.match_length<=f.max_lazy_match&&f.lookahead>=B){for(f.match_length--;f.strstart++,f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart,--f.match_length!=0;);f.strstart++}else f.strstart+=f.match_length,f.match_length=0,f.ins_h=f.window[f.strstart],f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+1])&f.hash_mask;else M=r._tr_tally(f,0,f.window[f.strstart]),f.lookahead--,f.strstart++;if(M&&($(f,!1),f.strm.avail_out===0))return A}return f.insert=f.strstart<B-1?f.strstart:B-1,L===E?($(f,!0),f.strm.avail_out===0?j:W):f.last_lit&&($(f,!1),f.strm.avail_out===0)?A:H}function ve(f,L){for(var G,M,V;;){if(f.lookahead<q){if(ue(f),f.lookahead<q&&L===T)return A;if(f.lookahead===0)break}if(G=0,f.lookahead>=B&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),f.prev_length=f.match_length,f.prev_match=f.match_start,f.match_length=B-1,G!==0&&f.prev_length<f.max_lazy_match&&f.strstart-G<=f.w_size-q&&(f.match_length=ee(f,G),f.match_length<=5&&(f.strategy===1||f.match_length===B&&4096<f.strstart-f.match_start)&&(f.match_length=B-1)),f.prev_length>=B&&f.match_length<=f.prev_length){for(V=f.strstart+f.lookahead-B,M=r._tr_tally(f,f.strstart-1-f.prev_match,f.prev_length-B),f.lookahead-=f.prev_length-1,f.prev_length-=2;++f.strstart<=V&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+B-1])&f.hash_mask,G=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),--f.prev_length!=0;);if(f.match_available=0,f.match_length=B-1,f.strstart++,M&&($(f,!1),f.strm.avail_out===0))return A}else if(f.match_available){if((M=r._tr_tally(f,0,f.window[f.strstart-1]))&&$(f,!1),f.strstart++,f.lookahead--,f.strm.avail_out===0)return A}else f.match_available=1,f.strstart++,f.lookahead--}return f.match_available&&(M=r._tr_tally(f,0,f.window[f.strstart-1]),f.match_available=0),f.insert=f.strstart<B-1?f.strstart:B-1,L===E?($(f,!0),f.strm.avail_out===0?j:W):f.last_lit&&($(f,!1),f.strm.avail_out===0)?A:H}function k(f,L,G,M,V){this.good_length=f,this.max_lazy=L,this.nice_length=G,this.max_chain=M,this.func=V}function O(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new u.Buf16(2*o),this.dyn_dtree=new u.Buf16(2*(2*w+1)),this.bl_tree=new u.Buf16(2*(2*C+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new u.Buf16(i+1),this.heap=new u.Buf16(2*_+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new u.Buf16(2*_+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function P(f){var L;return f&&f.state?(f.total_in=f.total_out=0,f.data_type=n,(L=f.state).pending=0,L.pending_out=0,L.wrap<0&&(L.wrap=-L.wrap),L.status=L.wrap?I:F,f.adler=L.wrap===2?0:1,L.last_flush=T,r._tr_init(L),s):re(f,v)}function D(f){var L=P(f);return L===s&&(function(G){G.window_size=2*G.w_size,oe(G.head),G.max_lazy_match=g[G.level].max_lazy,G.good_match=g[G.level].good_length,G.nice_match=g[G.level].nice_length,G.max_chain_length=g[G.level].max_chain,G.strstart=0,G.block_start=0,G.lookahead=0,G.insert=0,G.match_length=G.prev_length=B-1,G.match_available=0,G.ins_h=0})(f.state),L}function S(f,L,G,M,V,K){if(!f)return v;var X=1;if(L===h&&(L=6),M<0?(X=0,M=-M):15<M&&(X=2,M-=16),V<1||m<V||G!==p||M<8||15<M||L<0||9<L||K<0||y<K)return re(f,v);M===8&&(M=9);var te=new O;return(f.state=te).strm=f,te.wrap=X,te.gzhead=null,te.w_bits=M,te.w_size=1<<te.w_bits,te.w_mask=te.w_size-1,te.hash_bits=V+7,te.hash_size=1<<te.hash_bits,te.hash_mask=te.hash_size-1,te.hash_shift=~~((te.hash_bits+B-1)/B),te.window=new u.Buf8(2*te.w_size),te.head=new u.Buf16(te.hash_size),te.prev=new u.Buf16(te.w_size),te.lit_bufsize=1<<V+6,te.pending_buf_size=4*te.lit_bufsize,te.pending_buf=new u.Buf8(te.pending_buf_size),te.d_buf=1*te.lit_bufsize,te.l_buf=3*te.lit_bufsize,te.level=L,te.strategy=K,te.method=G,D(f)}g=[new k(0,0,0,0,function(f,L){var G=65535;for(G>f.pending_buf_size-5&&(G=f.pending_buf_size-5);;){if(f.lookahead<=1){if(ue(f),f.lookahead===0&&L===T)return A;if(f.lookahead===0)break}f.strstart+=f.lookahead,f.lookahead=0;var M=f.block_start+G;if((f.strstart===0||f.strstart>=M)&&(f.lookahead=f.strstart-M,f.strstart=M,$(f,!1),f.strm.avail_out===0)||f.strstart-f.block_start>=f.w_size-q&&($(f,!1),f.strm.avail_out===0))return A}return f.insert=0,L===E?($(f,!0),f.strm.avail_out===0?j:W):(f.strstart>f.block_start&&($(f,!1),f.strm.avail_out),A)}),new k(4,4,8,4,Se),new k(4,5,16,8,Se),new k(4,6,32,32,Se),new k(4,4,16,16,ve),new k(8,16,32,32,ve),new k(8,16,128,128,ve),new k(8,32,128,256,ve),new k(32,128,258,1024,ve),new k(32,258,258,4096,ve)],x.deflateInit=function(f,L){return S(f,L,p,15,8,0)},x.deflateInit2=S,x.deflateReset=D,x.deflateResetKeep=P,x.deflateSetHeader=function(f,L){return f&&f.state?f.state.wrap!==2?v:(f.state.gzhead=L,s):v},x.deflate=function(f,L){var G,M,V,K;if(!f||!f.state||5<L||L<0)return f?re(f,v):v;if(M=f.state,!f.output||!f.input&&f.avail_in!==0||M.status===666&&L!==E)return re(f,f.avail_out===0?-5:v);if(M.strm=f,G=M.last_flush,M.last_flush=L,M.status===I)if(M.wrap===2)f.adler=0,ce(M,31),ce(M,139),ce(M,8),M.gzhead?(ce(M,(M.gzhead.text?1:0)+(M.gzhead.hcrc?2:0)+(M.gzhead.extra?4:0)+(M.gzhead.name?8:0)+(M.gzhead.comment?16:0)),ce(M,255&M.gzhead.time),ce(M,M.gzhead.time>>8&255),ce(M,M.gzhead.time>>16&255),ce(M,M.gzhead.time>>24&255),ce(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),ce(M,255&M.gzhead.os),M.gzhead.extra&&M.gzhead.extra.length&&(ce(M,255&M.gzhead.extra.length),ce(M,M.gzhead.extra.length>>8&255)),M.gzhead.hcrc&&(f.adler=l(f.adler,M.pending_buf,M.pending,0)),M.gzindex=0,M.status=69):(ce(M,0),ce(M,0),ce(M,0),ce(M,0),ce(M,0),ce(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),ce(M,3),M.status=F);else{var X=p+(M.w_bits-8<<4)<<8;X|=(2<=M.strategy||M.level<2?0:M.level<6?1:M.level===6?2:3)<<6,M.strstart!==0&&(X|=32),X+=31-X%31,M.status=F,ie(M,X),M.strstart!==0&&(ie(M,f.adler>>>16),ie(M,65535&f.adler)),f.adler=1}if(M.status===69)if(M.gzhead.extra){for(V=M.pending;M.gzindex<(65535&M.gzhead.extra.length)&&(M.pending!==M.pending_buf_size||(M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),Q(f),V=M.pending,M.pending!==M.pending_buf_size));)ce(M,255&M.gzhead.extra[M.gzindex]),M.gzindex++;M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),M.gzindex===M.gzhead.extra.length&&(M.gzindex=0,M.status=73)}else M.status=73;if(M.status===73)if(M.gzhead.name){V=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),Q(f),V=M.pending,M.pending===M.pending_buf_size)){K=1;break}K=M.gzindex<M.gzhead.name.length?255&M.gzhead.name.charCodeAt(M.gzindex++):0,ce(M,K)}while(K!==0);M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),K===0&&(M.gzindex=0,M.status=91)}else M.status=91;if(M.status===91)if(M.gzhead.comment){V=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),Q(f),V=M.pending,M.pending===M.pending_buf_size)){K=1;break}K=M.gzindex<M.gzhead.comment.length?255&M.gzhead.comment.charCodeAt(M.gzindex++):0,ce(M,K)}while(K!==0);M.gzhead.hcrc&&M.pending>V&&(f.adler=l(f.adler,M.pending_buf,M.pending-V,V)),K===0&&(M.status=103)}else M.status=103;if(M.status===103&&(M.gzhead.hcrc?(M.pending+2>M.pending_buf_size&&Q(f),M.pending+2<=M.pending_buf_size&&(ce(M,255&f.adler),ce(M,f.adler>>8&255),f.adler=0,M.status=F)):M.status=F),M.pending!==0){if(Q(f),f.avail_out===0)return M.last_flush=-1,s}else if(f.avail_in===0&&J(L)<=J(G)&&L!==E)return re(f,-5);if(M.status===666&&f.avail_in!==0)return re(f,-5);if(f.avail_in!==0||M.lookahead!==0||L!==T&&M.status!==666){var te=M.strategy===2?(function(Y,ae){for(var fe;;){if(Y.lookahead===0&&(ue(Y),Y.lookahead===0)){if(ae===T)return A;break}if(Y.match_length=0,fe=r._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++,fe&&($(Y,!1),Y.strm.avail_out===0))return A}return Y.insert=0,ae===E?($(Y,!0),Y.strm.avail_out===0?j:W):Y.last_lit&&($(Y,!1),Y.strm.avail_out===0)?A:H})(M,L):M.strategy===3?(function(Y,ae){for(var fe,se,de,ye,ge=Y.window;;){if(Y.lookahead<=N){if(ue(Y),Y.lookahead<=N&&ae===T)return A;if(Y.lookahead===0)break}if(Y.match_length=0,Y.lookahead>=B&&0<Y.strstart&&(se=ge[de=Y.strstart-1])===ge[++de]&&se===ge[++de]&&se===ge[++de]){ye=Y.strstart+N;do;while(se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&se===ge[++de]&&de<ye);Y.match_length=N-(ye-de),Y.match_length>Y.lookahead&&(Y.match_length=Y.lookahead)}if(Y.match_length>=B?(fe=r._tr_tally(Y,1,Y.match_length-B),Y.lookahead-=Y.match_length,Y.strstart+=Y.match_length,Y.match_length=0):(fe=r._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++),fe&&($(Y,!1),Y.strm.avail_out===0))return A}return Y.insert=0,ae===E?($(Y,!0),Y.strm.avail_out===0?j:W):Y.last_lit&&($(Y,!1),Y.strm.avail_out===0)?A:H})(M,L):g[M.level].func(M,L);if(te!==j&&te!==W||(M.status=666),te===A||te===j)return f.avail_out===0&&(M.last_flush=-1),s;if(te===H&&(L===1?r._tr_align(M):L!==5&&(r._tr_stored_block(M,0,0,!1),L===3&&(oe(M.head),M.lookahead===0&&(M.strstart=0,M.block_start=0,M.insert=0))),Q(f),f.avail_out===0))return M.last_flush=-1,s}return L!==E?s:M.wrap<=0?1:(M.wrap===2?(ce(M,255&f.adler),ce(M,f.adler>>8&255),ce(M,f.adler>>16&255),ce(M,f.adler>>24&255),ce(M,255&f.total_in),ce(M,f.total_in>>8&255),ce(M,f.total_in>>16&255),ce(M,f.total_in>>24&255)):(ie(M,f.adler>>>16),ie(M,65535&f.adler)),Q(f),0<M.wrap&&(M.wrap=-M.wrap),M.pending!==0?s:1)},x.deflateEnd=function(f){var L;return f&&f.state?(L=f.state.status)!==I&&L!==69&&L!==73&&L!==91&&L!==103&&L!==F&&L!==666?re(f,v):(f.state=null,L===F?re(f,-3):s):v},x.deflateSetDictionary=function(f,L){var G,M,V,K,X,te,Y,ae,fe=L.length;if(!f||!f.state||(K=(G=f.state).wrap)===2||K===1&&G.status!==I||G.lookahead)return v;for(K===1&&(f.adler=c(f.adler,L,fe,0)),G.wrap=0,fe>=G.w_size&&(K===0&&(oe(G.head),G.strstart=0,G.block_start=0,G.insert=0),ae=new u.Buf8(G.w_size),u.arraySet(ae,L,fe-G.w_size,G.w_size,0),L=ae,fe=G.w_size),X=f.avail_in,te=f.next_in,Y=f.input,f.avail_in=fe,f.next_in=0,f.input=L,ue(G);G.lookahead>=B;){for(M=G.strstart,V=G.lookahead-(B-1);G.ins_h=(G.ins_h<<G.hash_shift^G.window[M+B-1])&G.hash_mask,G.prev[M&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=M,M++,--V;);G.strstart=M,G.lookahead=B-1,ue(G)}return G.strstart+=G.lookahead,G.block_start=G.strstart,G.insert=G.lookahead,G.lookahead=0,G.match_length=G.prev_length=B-1,G.match_available=0,f.next_in=te,f.input=Y,f.avail_in=X,G.wrap=K,s},x.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,d,x){d.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,d,x){d.exports=function(g,u){var r,c,l,b,T,E,s,v,h,y,n,p,m,_,w,C,o,i,B,N,q,I,F,A,H;r=g.state,c=g.next_in,A=g.input,l=c+(g.avail_in-5),b=g.next_out,H=g.output,T=b-(u-g.avail_out),E=b+(g.avail_out-257),s=r.dmax,v=r.wsize,h=r.whave,y=r.wnext,n=r.window,p=r.hold,m=r.bits,_=r.lencode,w=r.distcode,C=(1<<r.lenbits)-1,o=(1<<r.distbits)-1;e:do{m<15&&(p+=A[c++]<<m,m+=8,p+=A[c++]<<m,m+=8),i=_[p&C];t:for(;;){if(p>>>=B=i>>>24,m-=B,(B=i>>>16&255)===0)H[b++]=65535&i;else{if(!(16&B)){if((64&B)==0){i=_[(65535&i)+(p&(1<<B)-1)];continue t}if(32&B){r.mode=12;break e}g.msg="invalid literal/length code",r.mode=30;break e}N=65535&i,(B&=15)&&(m<B&&(p+=A[c++]<<m,m+=8),N+=p&(1<<B)-1,p>>>=B,m-=B),m<15&&(p+=A[c++]<<m,m+=8,p+=A[c++]<<m,m+=8),i=w[p&o];r:for(;;){if(p>>>=B=i>>>24,m-=B,!(16&(B=i>>>16&255))){if((64&B)==0){i=w[(65535&i)+(p&(1<<B)-1)];continue r}g.msg="invalid distance code",r.mode=30;break e}if(q=65535&i,m<(B&=15)&&(p+=A[c++]<<m,(m+=8)<B&&(p+=A[c++]<<m,m+=8)),s<(q+=p&(1<<B)-1)){g.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=B,m-=B,(B=b-T)<q){if(h<(B=q-B)&&r.sane){g.msg="invalid distance too far back",r.mode=30;break e}if(F=n,(I=0)===y){if(I+=v-B,B<N){for(N-=B;H[b++]=n[I++],--B;);I=b-q,F=H}}else if(y<B){if(I+=v+y-B,(B-=y)<N){for(N-=B;H[b++]=n[I++],--B;);if(I=0,y<N){for(N-=B=y;H[b++]=n[I++],--B;);I=b-q,F=H}}}else if(I+=y-B,B<N){for(N-=B;H[b++]=n[I++],--B;);I=b-q,F=H}for(;2<N;)H[b++]=F[I++],H[b++]=F[I++],H[b++]=F[I++],N-=3;N&&(H[b++]=F[I++],1<N&&(H[b++]=F[I++]))}else{for(I=b-q;H[b++]=H[I++],H[b++]=H[I++],H[b++]=H[I++],2<(N-=3););N&&(H[b++]=H[I++],1<N&&(H[b++]=H[I++]))}break}}break}}while(c<l&&b<E);c-=N=m>>3,p&=(1<<(m-=N<<3))-1,g.next_in=c,g.next_out=b,g.avail_in=c<l?l-c+5:5-(c-l),g.avail_out=b<E?E-b+257:257-(b-E),r.hold=p,r.bits=m}},{}],49:[function(t,d,x){var g=t("../utils/common"),u=t("./adler32"),r=t("./crc32"),c=t("./inffast"),l=t("./inftrees"),b=1,T=2,E=0,s=-2,v=1,h=852,y=592;function n(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function p(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new g.Buf16(320),this.work=new g.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(I){var F;return I&&I.state?(F=I.state,I.total_in=I.total_out=F.total=0,I.msg="",F.wrap&&(I.adler=1&F.wrap),F.mode=v,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new g.Buf32(h),F.distcode=F.distdyn=new g.Buf32(y),F.sane=1,F.back=-1,E):s}function _(I){var F;return I&&I.state?((F=I.state).wsize=0,F.whave=0,F.wnext=0,m(I)):s}function w(I,F){var A,H;return I&&I.state?(H=I.state,F<0?(A=0,F=-F):(A=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15<F)?s:(H.window!==null&&H.wbits!==F&&(H.window=null),H.wrap=A,H.wbits=F,_(I))):s}function C(I,F){var A,H;return I?(H=new p,(I.state=H).window=null,(A=w(I,F))!==E&&(I.state=null),A):s}var o,i,B=!0;function N(I){if(B){var F;for(o=new g.Buf32(512),i=new g.Buf32(32),F=0;F<144;)I.lens[F++]=8;for(;F<256;)I.lens[F++]=9;for(;F<280;)I.lens[F++]=7;for(;F<288;)I.lens[F++]=8;for(l(b,I.lens,0,288,o,0,I.work,{bits:9}),F=0;F<32;)I.lens[F++]=5;l(T,I.lens,0,32,i,0,I.work,{bits:5}),B=!1}I.lencode=o,I.lenbits=9,I.distcode=i,I.distbits=5}function q(I,F,A,H){var j,W=I.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new g.Buf8(W.wsize)),H>=W.wsize?(g.arraySet(W.window,F,A-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(H<(j=W.wsize-W.wnext)&&(j=H),g.arraySet(W.window,F,A-H,j,W.wnext),(H-=j)?(g.arraySet(W.window,F,A-H,H,0),W.wnext=H,W.whave=W.wsize):(W.wnext+=j,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=j))),0}x.inflateReset=_,x.inflateReset2=w,x.inflateResetKeep=m,x.inflateInit=function(I){return C(I,15)},x.inflateInit2=C,x.inflate=function(I,F){var A,H,j,W,re,J,oe,Q,$,ce,ie,ee,ue,Se,ve,k,O,P,D,S,f,L,G,M,V=0,K=new g.Buf8(4),X=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return s;(A=I.state).mode===12&&(A.mode=13),re=I.next_out,j=I.output,oe=I.avail_out,W=I.next_in,H=I.input,J=I.avail_in,Q=A.hold,$=A.bits,ce=J,ie=oe,L=E;e:for(;;)switch(A.mode){case v:if(A.wrap===0){A.mode=13;break}for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(2&A.wrap&&Q===35615){K[A.check=0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0),$=Q=0,A.mode=2;break}if(A.flags=0,A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&Q)<<8)+(Q>>8))%31){I.msg="incorrect header check",A.mode=30;break}if((15&Q)!=8){I.msg="unknown compression method",A.mode=30;break}if($-=4,f=8+(15&(Q>>>=4)),A.wbits===0)A.wbits=f;else if(f>A.wbits){I.msg="invalid window size",A.mode=30;break}A.dmax=1<<f,I.adler=A.check=1,A.mode=512&Q?10:12,$=Q=0;break;case 2:for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(A.flags=Q,(255&A.flags)!=8){I.msg="unknown compression method",A.mode=30;break}if(57344&A.flags){I.msg="unknown header flags set",A.mode=30;break}A.head&&(A.head.text=Q>>8&1),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0)),$=Q=0,A.mode=3;case 3:for(;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.head&&(A.head.time=Q),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,K[2]=Q>>>16&255,K[3]=Q>>>24&255,A.check=r(A.check,K,4,0)),$=Q=0,A.mode=4;case 4:for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.head&&(A.head.xflags=255&Q,A.head.os=Q>>8),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0)),$=Q=0,A.mode=5;case 5:if(1024&A.flags){for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.length=Q,A.head&&(A.head.extra_len=Q),512&A.flags&&(K[0]=255&Q,K[1]=Q>>>8&255,A.check=r(A.check,K,2,0)),$=Q=0}else A.head&&(A.head.extra=null);A.mode=6;case 6:if(1024&A.flags&&(J<(ee=A.length)&&(ee=J),ee&&(A.head&&(f=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Array(A.head.extra_len)),g.arraySet(A.head.extra,H,W,ee,f)),512&A.flags&&(A.check=r(A.check,H,ee,W)),J-=ee,W+=ee,A.length-=ee),A.length))break e;A.length=0,A.mode=7;case 7:if(2048&A.flags){if(J===0)break e;for(ee=0;f=H[W+ee++],A.head&&f&&A.length<65536&&(A.head.name+=String.fromCharCode(f)),f&&ee<J;);if(512&A.flags&&(A.check=r(A.check,H,ee,W)),J-=ee,W+=ee,f)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=8;case 8:if(4096&A.flags){if(J===0)break e;for(ee=0;f=H[W+ee++],A.head&&f&&A.length<65536&&(A.head.comment+=String.fromCharCode(f)),f&&ee<J;);if(512&A.flags&&(A.check=r(A.check,H,ee,W)),J-=ee,W+=ee,f)break e}else A.head&&(A.head.comment=null);A.mode=9;case 9:if(512&A.flags){for(;$<16;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(Q!==(65535&A.check)){I.msg="header crc mismatch",A.mode=30;break}$=Q=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),I.adler=A.check=0,A.mode=12;break;case 10:for(;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}I.adler=A.check=n(Q),$=Q=0,A.mode=11;case 11:if(A.havedict===0)return I.next_out=re,I.avail_out=oe,I.next_in=W,I.avail_in=J,A.hold=Q,A.bits=$,2;I.adler=A.check=1,A.mode=12;case 12:if(F===5||F===6)break e;case 13:if(A.last){Q>>>=7&$,$-=7&$,A.mode=27;break}for(;$<3;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}switch(A.last=1&Q,$-=1,3&(Q>>>=1)){case 0:A.mode=14;break;case 1:if(N(A),A.mode=20,F!==6)break;Q>>>=2,$-=2;break e;case 2:A.mode=17;break;case 3:I.msg="invalid block type",A.mode=30}Q>>>=2,$-=2;break;case 14:for(Q>>>=7&$,$-=7&$;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if((65535&Q)!=(Q>>>16^65535)){I.msg="invalid stored block lengths",A.mode=30;break}if(A.length=65535&Q,$=Q=0,A.mode=15,F===6)break e;case 15:A.mode=16;case 16:if(ee=A.length){if(J<ee&&(ee=J),oe<ee&&(ee=oe),ee===0)break e;g.arraySet(j,H,W,ee,re),J-=ee,W+=ee,oe-=ee,re+=ee,A.length-=ee;break}A.mode=12;break;case 17:for(;$<14;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(A.nlen=257+(31&Q),Q>>>=5,$-=5,A.ndist=1+(31&Q),Q>>>=5,$-=5,A.ncode=4+(15&Q),Q>>>=4,$-=4,286<A.nlen||30<A.ndist){I.msg="too many length or distance symbols",A.mode=30;break}A.have=0,A.mode=18;case 18:for(;A.have<A.ncode;){for(;$<3;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.lens[X[A.have++]]=7&Q,Q>>>=3,$-=3}for(;A.have<19;)A.lens[X[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,G={bits:A.lenbits},L=l(0,A.lens,0,19,A.lencode,0,A.work,G),A.lenbits=G.bits,L){I.msg="invalid code lengths set",A.mode=30;break}A.have=0,A.mode=19;case 19:for(;A.have<A.nlen+A.ndist;){for(;k=(V=A.lencode[Q&(1<<A.lenbits)-1])>>>16&255,O=65535&V,!((ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(O<16)Q>>>=ve,$-=ve,A.lens[A.have++]=O;else{if(O===16){for(M=ve+2;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(Q>>>=ve,$-=ve,A.have===0){I.msg="invalid bit length repeat",A.mode=30;break}f=A.lens[A.have-1],ee=3+(3&Q),Q>>>=2,$-=2}else if(O===17){for(M=ve+3;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}$-=ve,f=0,ee=3+(7&(Q>>>=ve)),Q>>>=3,$-=3}else{for(M=ve+7;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}$-=ve,f=0,ee=11+(127&(Q>>>=ve)),Q>>>=7,$-=7}if(A.have+ee>A.nlen+A.ndist){I.msg="invalid bit length repeat",A.mode=30;break}for(;ee--;)A.lens[A.have++]=f}}if(A.mode===30)break;if(A.lens[256]===0){I.msg="invalid code -- missing end-of-block",A.mode=30;break}if(A.lenbits=9,G={bits:A.lenbits},L=l(b,A.lens,0,A.nlen,A.lencode,0,A.work,G),A.lenbits=G.bits,L){I.msg="invalid literal/lengths set",A.mode=30;break}if(A.distbits=6,A.distcode=A.distdyn,G={bits:A.distbits},L=l(T,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,G),A.distbits=G.bits,L){I.msg="invalid distances set",A.mode=30;break}if(A.mode=20,F===6)break e;case 20:A.mode=21;case 21:if(6<=J&&258<=oe){I.next_out=re,I.avail_out=oe,I.next_in=W,I.avail_in=J,A.hold=Q,A.bits=$,c(I,ie),re=I.next_out,j=I.output,oe=I.avail_out,W=I.next_in,H=I.input,J=I.avail_in,Q=A.hold,$=A.bits,A.mode===12&&(A.back=-1);break}for(A.back=0;k=(V=A.lencode[Q&(1<<A.lenbits)-1])>>>16&255,O=65535&V,!((ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(k&&(240&k)==0){for(P=ve,D=k,S=O;k=(V=A.lencode[S+((Q&(1<<P+D)-1)>>P)])>>>16&255,O=65535&V,!(P+(ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}Q>>>=P,$-=P,A.back+=P}if(Q>>>=ve,$-=ve,A.back+=ve,A.length=O,k===0){A.mode=26;break}if(32&k){A.back=-1,A.mode=12;break}if(64&k){I.msg="invalid literal/length code",A.mode=30;break}A.extra=15&k,A.mode=22;case 22:if(A.extra){for(M=A.extra;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.length+=Q&(1<<A.extra)-1,Q>>>=A.extra,$-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=23;case 23:for(;k=(V=A.distcode[Q&(1<<A.distbits)-1])>>>16&255,O=65535&V,!((ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if((240&k)==0){for(P=ve,D=k,S=O;k=(V=A.distcode[S+((Q&(1<<P+D)-1)>>P)])>>>16&255,O=65535&V,!(P+(ve=V>>>24)<=$);){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}Q>>>=P,$-=P,A.back+=P}if(Q>>>=ve,$-=ve,A.back+=ve,64&k){I.msg="invalid distance code",A.mode=30;break}A.offset=O,A.extra=15&k,A.mode=24;case 24:if(A.extra){for(M=A.extra;$<M;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}A.offset+=Q&(1<<A.extra)-1,Q>>>=A.extra,$-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){I.msg="invalid distance too far back",A.mode=30;break}A.mode=25;case 25:if(oe===0)break e;if(ee=ie-oe,A.offset>ee){if((ee=A.offset-ee)>A.whave&&A.sane){I.msg="invalid distance too far back",A.mode=30;break}ue=ee>A.wnext?(ee-=A.wnext,A.wsize-ee):A.wnext-ee,ee>A.length&&(ee=A.length),Se=A.window}else Se=j,ue=re-A.offset,ee=A.length;for(oe<ee&&(ee=oe),oe-=ee,A.length-=ee;j[re++]=Se[ue++],--ee;);A.length===0&&(A.mode=21);break;case 26:if(oe===0)break e;j[re++]=A.length,oe--,A.mode=21;break;case 27:if(A.wrap){for(;$<32;){if(J===0)break e;J--,Q|=H[W++]<<$,$+=8}if(ie-=oe,I.total_out+=ie,A.total+=ie,ie&&(I.adler=A.check=A.flags?r(A.check,j,ie,re-ie):u(A.check,j,ie,re-ie)),ie=oe,(A.flags?Q:n(Q))!==A.check){I.msg="incorrect data check",A.mode=30;break}$=Q=0}A.mode=28;case 28:if(A.wrap&&A.flags){for(;$<32;){if(J===0)break e;J--,Q+=H[W++]<<$,$+=8}if(Q!==(4294967295&A.total)){I.msg="incorrect length check",A.mode=30;break}$=Q=0}A.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;case 32:default:return s}return I.next_out=re,I.avail_out=oe,I.next_in=W,I.avail_in=J,A.hold=Q,A.bits=$,(A.wsize||ie!==I.avail_out&&A.mode<30&&(A.mode<27||F!==4))&&q(I,I.output,I.next_out,ie-I.avail_out)?(A.mode=31,-4):(ce-=I.avail_in,ie-=I.avail_out,I.total_in+=ce,I.total_out+=ie,A.total+=ie,A.wrap&&ie&&(I.adler=A.check=A.flags?r(A.check,j,ie,I.next_out-ie):u(A.check,j,ie,I.next_out-ie)),I.data_type=A.bits+(A.last?64:0)+(A.mode===12?128:0)+(A.mode===20||A.mode===15?256:0),(ce==0&&ie===0||F===4)&&L===E&&(L=-5),L)},x.inflateEnd=function(I){if(!I||!I.state)return s;var F=I.state;return F.window&&(F.window=null),I.state=null,E},x.inflateGetHeader=function(I,F){var A;return I&&I.state?(2&(A=I.state).wrap)==0?s:((A.head=F).done=!1,E):s},x.inflateSetDictionary=function(I,F){var A,H=F.length;return I&&I.state?(A=I.state).wrap!==0&&A.mode!==11?s:A.mode===11&&u(1,F,H,0)!==A.check?-3:q(I,F,H,H)?(A.mode=31,-4):(A.havedict=1,E):s},x.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,d,x){var g=t("../utils/common"),u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];d.exports=function(b,T,E,s,v,h,y,n){var p,m,_,w,C,o,i,B,N,q=n.bits,I=0,F=0,A=0,H=0,j=0,W=0,re=0,J=0,oe=0,Q=0,$=null,ce=0,ie=new g.Buf16(16),ee=new g.Buf16(16),ue=null,Se=0;for(I=0;I<=15;I++)ie[I]=0;for(F=0;F<s;F++)ie[T[E+F]]++;for(j=q,H=15;1<=H&&ie[H]===0;H--);if(H<j&&(j=H),H===0)return v[h++]=20971520,v[h++]=20971520,n.bits=1,0;for(A=1;A<H&&ie[A]===0;A++);for(j<A&&(j=A),I=J=1;I<=15;I++)if(J<<=1,(J-=ie[I])<0)return-1;if(0<J&&(b===0||H!==1))return-1;for(ee[1]=0,I=1;I<15;I++)ee[I+1]=ee[I]+ie[I];for(F=0;F<s;F++)T[E+F]!==0&&(y[ee[T[E+F]]++]=F);if(o=b===0?($=ue=y,19):b===1?($=u,ce-=257,ue=r,Se-=257,256):($=c,ue=l,-1),I=A,C=h,re=F=Q=0,_=-1,w=(oe=1<<(W=j))-1,b===1&&852<oe||b===2&&592<oe)return 1;for(;;){for(i=I-re,N=y[F]<o?(B=0,y[F]):y[F]>o?(B=ue[Se+y[F]],$[ce+y[F]]):(B=96,0),p=1<<I-re,A=m=1<<W;v[C+(Q>>re)+(m-=p)]=i<<24|B<<16|N|0,m!==0;);for(p=1<<I-1;Q&p;)p>>=1;if(p!==0?(Q&=p-1,Q+=p):Q=0,F++,--ie[I]==0){if(I===H)break;I=T[E+y[F]]}if(j<I&&(Q&w)!==_){for(re===0&&(re=j),C+=A,J=1<<(W=I-re);W+re<H&&!((J-=ie[W+re])<=0);)W++,J<<=1;if(oe+=1<<W,b===1&&852<oe||b===2&&592<oe)return 1;v[_=Q&w]=j<<24|W<<16|C-h|0}}return Q!==0&&(v[C+Q]=I-re<<24|64<<16|0),n.bits=j,0}},{"../utils/common":41}],51:[function(t,d,x){d.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,d,x){var g=t("../utils/common"),u=0,r=1;function c(V){for(var K=V.length;0<=--K;)V[K]=0}var l=0,b=29,T=256,E=T+1+b,s=30,v=19,h=2*E+1,y=15,n=16,p=7,m=256,_=16,w=17,C=18,o=[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],i=[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],B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],q=new Array(2*(E+2));c(q);var I=new Array(2*s);c(I);var F=new Array(512);c(F);var A=new Array(256);c(A);var H=new Array(b);c(H);var j,W,re,J=new Array(s);function oe(V,K,X,te,Y){this.static_tree=V,this.extra_bits=K,this.extra_base=X,this.elems=te,this.max_length=Y,this.has_stree=V&&V.length}function Q(V,K){this.dyn_tree=V,this.max_code=0,this.stat_desc=K}function $(V){return V<256?F[V]:F[256+(V>>>7)]}function ce(V,K){V.pending_buf[V.pending++]=255&K,V.pending_buf[V.pending++]=K>>>8&255}function ie(V,K,X){V.bi_valid>n-X?(V.bi_buf|=K<<V.bi_valid&65535,ce(V,V.bi_buf),V.bi_buf=K>>n-V.bi_valid,V.bi_valid+=X-n):(V.bi_buf|=K<<V.bi_valid&65535,V.bi_valid+=X)}function ee(V,K,X){ie(V,X[2*K],X[2*K+1])}function ue(V,K){for(var X=0;X|=1&V,V>>>=1,X<<=1,0<--K;);return X>>>1}function Se(V,K,X){var te,Y,ae=new Array(y+1),fe=0;for(te=1;te<=y;te++)ae[te]=fe=fe+X[te-1]<<1;for(Y=0;Y<=K;Y++){var se=V[2*Y+1];se!==0&&(V[2*Y]=ue(ae[se]++,se))}}function ve(V){var K;for(K=0;K<E;K++)V.dyn_ltree[2*K]=0;for(K=0;K<s;K++)V.dyn_dtree[2*K]=0;for(K=0;K<v;K++)V.bl_tree[2*K]=0;V.dyn_ltree[2*m]=1,V.opt_len=V.static_len=0,V.last_lit=V.matches=0}function k(V){8<V.bi_valid?ce(V,V.bi_buf):0<V.bi_valid&&(V.pending_buf[V.pending++]=V.bi_buf),V.bi_buf=0,V.bi_valid=0}function O(V,K,X,te){var Y=2*K,ae=2*X;return V[Y]<V[ae]||V[Y]===V[ae]&&te[K]<=te[X]}function P(V,K,X){for(var te=V.heap[X],Y=X<<1;Y<=V.heap_len&&(Y<V.heap_len&&O(K,V.heap[Y+1],V.heap[Y],V.depth)&&Y++,!O(K,te,V.heap[Y],V.depth));)V.heap[X]=V.heap[Y],X=Y,Y<<=1;V.heap[X]=te}function D(V,K,X){var te,Y,ae,fe,se=0;if(V.last_lit!==0)for(;te=V.pending_buf[V.d_buf+2*se]<<8|V.pending_buf[V.d_buf+2*se+1],Y=V.pending_buf[V.l_buf+se],se++,te===0?ee(V,Y,K):(ee(V,(ae=A[Y])+T+1,K),(fe=o[ae])!==0&&ie(V,Y-=H[ae],fe),ee(V,ae=$(--te),X),(fe=i[ae])!==0&&ie(V,te-=J[ae],fe)),se<V.last_lit;);ee(V,m,K)}function S(V,K){var X,te,Y,ae=K.dyn_tree,fe=K.stat_desc.static_tree,se=K.stat_desc.has_stree,de=K.stat_desc.elems,ye=-1;for(V.heap_len=0,V.heap_max=h,X=0;X<de;X++)ae[2*X]!==0?(V.heap[++V.heap_len]=ye=X,V.depth[X]=0):ae[2*X+1]=0;for(;V.heap_len<2;)ae[2*(Y=V.heap[++V.heap_len]=ye<2?++ye:0)]=1,V.depth[Y]=0,V.opt_len--,se&&(V.static_len-=fe[2*Y+1]);for(K.max_code=ye,X=V.heap_len>>1;1<=X;X--)P(V,ae,X);for(Y=de;X=V.heap[1],V.heap[1]=V.heap[V.heap_len--],P(V,ae,1),te=V.heap[1],V.heap[--V.heap_max]=X,V.heap[--V.heap_max]=te,ae[2*Y]=ae[2*X]+ae[2*te],V.depth[Y]=(V.depth[X]>=V.depth[te]?V.depth[X]:V.depth[te])+1,ae[2*X+1]=ae[2*te+1]=Y,V.heap[1]=Y++,P(V,ae,1),2<=V.heap_len;);V.heap[--V.heap_max]=V.heap[1],(function(ge,xe){var be,_e,Ae,Ce,Be,Ne,Ie=xe.dyn_tree,Qe=xe.max_code,Ze=xe.stat_desc.static_tree,et=xe.stat_desc.has_stree,nt=xe.stat_desc.extra_bits,it=xe.stat_desc.extra_base,Xe=xe.stat_desc.max_length,st=0;for(Ce=0;Ce<=y;Ce++)ge.bl_count[Ce]=0;for(Ie[2*ge.heap[ge.heap_max]+1]=0,be=ge.heap_max+1;be<h;be++)Xe<(Ce=Ie[2*Ie[2*(_e=ge.heap[be])+1]+1]+1)&&(Ce=Xe,st++),Ie[2*_e+1]=Ce,Qe<_e||(ge.bl_count[Ce]++,Be=0,it<=_e&&(Be=nt[_e-it]),Ne=Ie[2*_e],ge.opt_len+=Ne*(Ce+Be),et&&(ge.static_len+=Ne*(Ze[2*_e+1]+Be)));if(st!==0){do{for(Ce=Xe-1;ge.bl_count[Ce]===0;)Ce--;ge.bl_count[Ce]--,ge.bl_count[Ce+1]+=2,ge.bl_count[Xe]--,st-=2}while(0<st);for(Ce=Xe;Ce!==0;Ce--)for(_e=ge.bl_count[Ce];_e!==0;)Qe<(Ae=ge.heap[--be])||(Ie[2*Ae+1]!==Ce&&(ge.opt_len+=(Ce-Ie[2*Ae+1])*Ie[2*Ae],Ie[2*Ae+1]=Ce),_e--)}})(V,K),Se(ae,ye,V.bl_count)}function f(V,K,X){var te,Y,ae=-1,fe=K[1],se=0,de=7,ye=4;for(fe===0&&(de=138,ye=3),K[2*(X+1)+1]=65535,te=0;te<=X;te++)Y=fe,fe=K[2*(te+1)+1],++se<de&&Y===fe||(se<ye?V.bl_tree[2*Y]+=se:Y!==0?(Y!==ae&&V.bl_tree[2*Y]++,V.bl_tree[2*_]++):se<=10?V.bl_tree[2*w]++:V.bl_tree[2*C]++,ae=Y,ye=(se=0)===fe?(de=138,3):Y===fe?(de=6,3):(de=7,4))}function L(V,K,X){var te,Y,ae=-1,fe=K[1],se=0,de=7,ye=4;for(fe===0&&(de=138,ye=3),te=0;te<=X;te++)if(Y=fe,fe=K[2*(te+1)+1],!(++se<de&&Y===fe)){if(se<ye)for(;ee(V,Y,V.bl_tree),--se!=0;);else Y!==0?(Y!==ae&&(ee(V,Y,V.bl_tree),se--),ee(V,_,V.bl_tree),ie(V,se-3,2)):se<=10?(ee(V,w,V.bl_tree),ie(V,se-3,3)):(ee(V,C,V.bl_tree),ie(V,se-11,7));ae=Y,ye=(se=0)===fe?(de=138,3):Y===fe?(de=6,3):(de=7,4)}}c(J);var G=!1;function M(V,K,X,te){ie(V,(l<<1)+(te?1:0),3),(function(Y,ae,fe,se){k(Y),ce(Y,fe),ce(Y,~fe),g.arraySet(Y.pending_buf,Y.window,ae,fe,Y.pending),Y.pending+=fe})(V,K,X)}x._tr_init=function(V){G||((function(){var K,X,te,Y,ae,fe=new Array(y+1);for(Y=te=0;Y<b-1;Y++)for(H[Y]=te,K=0;K<1<<o[Y];K++)A[te++]=Y;for(A[te-1]=Y,Y=ae=0;Y<16;Y++)for(J[Y]=ae,K=0;K<1<<i[Y];K++)F[ae++]=Y;for(ae>>=7;Y<s;Y++)for(J[Y]=ae<<7,K=0;K<1<<i[Y]-7;K++)F[256+ae++]=Y;for(X=0;X<=y;X++)fe[X]=0;for(K=0;K<=143;)q[2*K+1]=8,K++,fe[8]++;for(;K<=255;)q[2*K+1]=9,K++,fe[9]++;for(;K<=279;)q[2*K+1]=7,K++,fe[7]++;for(;K<=287;)q[2*K+1]=8,K++,fe[8]++;for(Se(q,E+1,fe),K=0;K<s;K++)I[2*K+1]=5,I[2*K]=ue(K,5);j=new oe(q,o,T+1,E,y),W=new oe(I,i,0,s,y),re=new oe(new Array(0),B,0,v,p)})(),G=!0),V.l_desc=new Q(V.dyn_ltree,j),V.d_desc=new Q(V.dyn_dtree,W),V.bl_desc=new Q(V.bl_tree,re),V.bi_buf=0,V.bi_valid=0,ve(V)},x._tr_stored_block=M,x._tr_flush_block=function(V,K,X,te){var Y,ae,fe=0;0<V.level?(V.strm.data_type===2&&(V.strm.data_type=(function(se){var de,ye=4093624447;for(de=0;de<=31;de++,ye>>>=1)if(1&ye&&se.dyn_ltree[2*de]!==0)return u;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return r;for(de=32;de<T;de++)if(se.dyn_ltree[2*de]!==0)return r;return u})(V)),S(V,V.l_desc),S(V,V.d_desc),fe=(function(se){var de;for(f(se,se.dyn_ltree,se.l_desc.max_code),f(se,se.dyn_dtree,se.d_desc.max_code),S(se,se.bl_desc),de=v-1;3<=de&&se.bl_tree[2*N[de]+1]===0;de--);return se.opt_len+=3*(de+1)+5+5+4,de})(V),Y=V.opt_len+3+7>>>3,(ae=V.static_len+3+7>>>3)<=Y&&(Y=ae)):Y=ae=X+5,X+4<=Y&&K!==-1?M(V,K,X,te):V.strategy===4||ae===Y?(ie(V,2+(te?1:0),3),D(V,q,I)):(ie(V,4+(te?1:0),3),(function(se,de,ye,ge){var xe;for(ie(se,de-257,5),ie(se,ye-1,5),ie(se,ge-4,4),xe=0;xe<ge;xe++)ie(se,se.bl_tree[2*N[xe]+1],3);L(se,se.dyn_ltree,de-1),L(se,se.dyn_dtree,ye-1)})(V,V.l_desc.max_code+1,V.d_desc.max_code+1,fe+1),D(V,V.dyn_ltree,V.dyn_dtree)),ve(V),te&&k(V)},x._tr_tally=function(V,K,X){return V.pending_buf[V.d_buf+2*V.last_lit]=K>>>8&255,V.pending_buf[V.d_buf+2*V.last_lit+1]=255&K,V.pending_buf[V.l_buf+V.last_lit]=255&X,V.last_lit++,K===0?V.dyn_ltree[2*X]++:(V.matches++,K--,V.dyn_ltree[2*(A[X]+T+1)]++,V.dyn_dtree[2*$(K)]++),V.last_lit===V.lit_bufsize-1},x._tr_align=function(V){ie(V,2,3),ee(V,m,q),(function(K){K.bi_valid===16?(ce(K,K.bi_buf),K.bi_buf=0,K.bi_valid=0):8<=K.bi_valid&&(K.pending_buf[K.pending++]=255&K.bi_buf,K.bi_buf>>=8,K.bi_valid-=8)})(V)}},{"../utils/common":41}],53:[function(t,d,x){d.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,d,x){(function(g){(function(u,r){if(!u.setImmediate){var c,l,b,T,E=1,s={},v=!1,h=u.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(u);y=y&&y.setTimeout?y:u,c={}.toString.call(u.process)==="[object process]"?function(_){process.nextTick(function(){p(_)})}:(function(){if(u.postMessage&&!u.importScripts){var _=!0,w=u.onmessage;return u.onmessage=function(){_=!1},u.postMessage("","*"),u.onmessage=w,_}})()?(T="setImmediate$"+Math.random()+"$",u.addEventListener?u.addEventListener("message",m,!1):u.attachEvent("onmessage",m),function(_){u.postMessage(T+_,"*")}):u.MessageChannel?((b=new MessageChannel).port1.onmessage=function(_){p(_.data)},function(_){b.port2.postMessage(_)}):h&&"onreadystatechange"in h.createElement("script")?(l=h.documentElement,function(_){var w=h.createElement("script");w.onreadystatechange=function(){p(_),w.onreadystatechange=null,l.removeChild(w),w=null},l.appendChild(w)}):function(_){setTimeout(p,0,_)},y.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var w=new Array(arguments.length-1),C=0;C<w.length;C++)w[C]=arguments[C+1];var o={callback:_,args:w};return s[E]=o,c(E),E++},y.clearImmediate=n}function n(_){delete s[_]}function p(_){if(v)setTimeout(p,0,_);else{var w=s[_];if(w){v=!0;try{(function(C){var o=C.callback,i=C.args;switch(i.length){case 0:o();break;case 1:o(i[0]);break;case 2:o(i[0],i[1]);break;case 3:o(i[0],i[1],i[2]);break;default:o.apply(r,i)}})(w)}finally{n(_),v=!1}}}}function m(_){_.source===u&&typeof _.data=="string"&&_.data.indexOf(T)===0&&p(+_.data.slice(T.length))}})(typeof self>"u"?g===void 0?this:g:self)}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(er)),er.exports}Dn();function Un(a){const e=String(a??"").trim().toLowerCase(),t=e.lastIndexOf(".");return t>=0?e.slice(t):""}function Pn(a){const e=URL.createObjectURL(a);return{url:e,name:a.name,extension:Un(a.name),revoke:()=>URL.revokeObjectURL(e)}}function On(a,e){return`${a}#${e}`}class Fn{viewer;getDefaultRotation;scenes=new Map;localSceneResources=new Map;constructor(e,t){this.viewer=e,this.getDefaultRotation=t}async loadModel(e,t={}){const d=this.viewer.getSceneCount(),x={progressiveLoad:!1,position:[0,0,0],rotation:this.getDefaultRotation(),scale:[1,1,1],...t,showLoadingUI:!1};await this.viewer.addSplatScene(e,x);const g={id:x.id??On(e,d),name:x.name??e.split(/[\\/]/).pop()??e,url:e,index:d,options:x};return this.scenes.set(g.id,g),g}async loadModelFile(e,t={}){if(e.length===0)throw new Error("LoaderModuleGaussian: no file selected");if(e.length>1)throw new Error("LoaderModuleGaussian: only a single local point cloud file is supported");const d=Pn(e[0]);try{const x=await this.loadModel(d.url,{...t,name:t.name??e[0].name});return this.localSceneResources.set(x.id,d),x}catch(x){throw d.revoke(),x}}async loadModels(e){const t=[];for(const d of e)t.push(await this.loadModel(d.url,d.options));return t}async unloadModel(e,t=!1){const d=this.scenes.get(e);d&&(await this.viewer.removeSplatScene(d.index,t),this.scenes.delete(e),this.localSceneResources.get(e)?.revoke(),this.localSceneResources.delete(e),this.reindexScenesAfterRemove(d.index))}getModel(e){return this.scenes.get(e)}getAllModels(){return Array.from(this.scenes.values())}getRawSplatScene(e){const t=typeof e=="number"?e:this.scenes.get(e)?.index;return t==null?void 0:this.viewer.getSplatScene(t)}async clear(e=!1){const t=this.getAllModels().map(d=>d.index);t.length>0&&await this.viewer.removeSplatScenes(t,e),this.scenes.clear(),this.localSceneResources.forEach(d=>d.revoke()),this.localSceneResources.clear()}reindexScenesAfterRemove(e){this.scenes.forEach(t=>{t.index>e&&(t.index-=1)})}}const _t={version:"3.11.7"}.version;function tr(){const a=globalThis.crypto?.subtle;if(!a)throw new Error("[BimEngine] Web Crypto API is required for secure sdkAuth credentials mode");return a}function Tt(a){return new TextEncoder().encode(a)}function At(a){return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}function oa(a){let e="";return a.forEach(t=>{e+=String.fromCharCode(t)}),btoa(e)}function Vn(a){const e=a.getUTCFullYear(),t=String(a.getUTCMonth()+1).padStart(2,"0"),d=String(a.getUTCDate()).padStart(2,"0");return`${e}${t}${d}`}async function Mn(a){const e=await tr().digest("SHA-256",At(Tt(a)));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}async function Kn(a,e){const t=tr(),d=await t.importKey("raw",At(a),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return t.sign("HMAC",d,At(Tt(e)))}function zn(a){return Tt([a.appId,a.engineType,a.requestDate,String(a.timestamp),a.nonce].join("|"))}async function qn(a){const e=tr(),t=new Date,d=t.getTime(),x=Vn(t),g=globalThis.crypto.randomUUID(),u=globalThis.crypto.getRandomValues(new Uint8Array(12)),r=await Mn(a.appSecret),c=await Kn(Tt(r),x),l=await e.importKey("raw",c,"AES-GCM",!1,["encrypt"]),b=JSON.stringify({appKey:a.appKey,appSecret:a.appSecret}),T=await e.encrypt({name:"AES-GCM",iv:u,additionalData:At(zn({appId:a.appId,engineType:a.engineType,requestDate:x,timestamp:d,nonce:g})),tagLength:128},l,At(Tt(b)));return{appId:a.appId,engineType:a.engineType,requestDate:x,timestamp:d,nonce:g,iv:oa(u),cipherText:oa(new Uint8Array(T)),sdkVersion:a.sdkVersion,origin:a.origin,product:a.product}}const rr=new Map;function Pt(a){return a.replace(/\/+$/,"")}function Ot(a){if(a)return a;if(typeof window<"u"&&typeof window.location?.origin=="string")return window.location.origin}function Hn(a,e){return JSON.stringify({endpoint:Pt(a.endpoint),token:a.token??"",appId:a.appId??"",appKey:a.appKey??"",appSecret:a.appSecret??"",origin:Ot(a.origin)??"",product:a.product??"",engineType:e,sdkVersion:_t})}async function ar(a,e,t){const d=typeof AbortController<"u"?new AbortController:void 0,x=d?setTimeout(()=>d.abort(),t):void 0;try{const g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:d?.signal}),u=await g.json().catch(()=>({}));if(!g.ok){const r=u?.error?.message??u?.message??`SDK authentication failed with status ${g.status}`;throw new Error(r)}return u}finally{x!=null&&clearTimeout(x)}}async function Gn(a,e){const t=await ar(`${Pt(a.endpoint)}/oauth/sdk-verify`,{sdkToken:a.token,engineType:e,sdkVersion:_t,origin:Ot(a.origin),product:a.product},a.timeoutMs??8e3);return t.sdkToken=a.token,t}async function Wn(a,e){const t=await qn({appId:a.appId,appKey:a.appKey,appSecret:a.appSecret,engineType:e,sdkVersion:_t,origin:Ot(a.origin),product:a.product}),d=await ar(`${Pt(a.endpoint)}/oauth/sdk-token/secure`,t,a.timeoutMs??8e3),x=await ar(`${Pt(a.endpoint)}/oauth/sdk-verify`,{sdkToken:d.sdkToken,engineType:e,sdkVersion:_t,origin:Ot(a.origin),product:a.product},a.timeoutMs??8e3);return x.sdkToken=d.sdkToken,x}async function jn(a,e){const t=a?.sdkAuth;if(!t)return null;if(!t.endpoint)throw new Error("[BimEngine] sdkAuth.endpoint is required");if(!t.token&&!(t.appId&&t.appKey&&t.appSecret))return null;const d=Hn(t,e),x=rr.get(d);if(x){const u=await x;return a&&(a.__sdkAuthSession=u),u}const g=(t.token?Gn(t,e):Wn(t,e)).then(u=>{if(u.authorized!==!0)throw new Error("[BimEngine] SDK authorization rejected");return a&&(a.__sdkAuthSession=u),u}).catch(u=>{throw rr.delete(d),u});return rr.set(d,g),g}function Qn(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}function ua(a){if(typeof a!="number")throw new TypeError("number expected, got "+typeof a);if(!Number.isSafeInteger(a)||a<0)throw new RangeError("positive integer expected, got "+a)}function Ye(a,e,t=""){const d=Qn(a),x=a?.length,g=e!==void 0;if(!d||g&&x!==e){const u=t&&`"${t}" `,r=g?` of length ${e}`:"",c=d?`length=${x}`:`type=${typeof a}`,l=u+"expected Uint8Array"+r+", got "+c;throw d?new RangeError(l):new TypeError(l)}return a}function la(a,e=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(e&&a.finished)throw new Error("Hash#digest() has already been called")}function Yn(a,e,t=!1){Ye(a,void 0,"output");const d=e.outputLen;if(a.length<d)throw new RangeError("digestInto() expects output buffer of length at least "+d);if(t&&!It(a))throw new Error("invalid output, must be aligned")}function Zn(a){return new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}function vt(a){return new Uint32Array(a.buffer,a.byteOffset,Math.floor(a.byteLength/4))}function pt(...a){for(let e=0;e<a.length;e++)a[e].fill(0)}function Ft(a){return new DataView(a.buffer,a.byteOffset,a.byteLength)}const nr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,fa=a=>a<<24&4278190080|a<<8&16711680|a>>>8&65280|a>>>24&255,ke=nr?a=>a:a=>fa(a)>>>0,ir=nr?a=>a:a=>{for(let e=0;e<a.length;e++)a[e]=fa(a[e]);return a};function Xn(a,e){if(a.length!==e.length)return!1;let t=0;for(let d=0;d<a.length;d++)t|=a[d]^e[d];return t===0}function $n(a,e,t){const d=e,x=t||(()=>[]),g=(r,c)=>d(c,...x(r)).update(r).digest(),u=d(new Uint8Array(a),...x(new Uint8Array(0)));return g.outputLen=u.outputLen,g.blockLen=u.blockLen,g.create=(r,...c)=>d(r,...c),g}const Jn=(a,e)=>{function t(d,...x){if(Ye(d,void 0,"key"),a.nonceLength!==void 0){const b=x[0];Ye(b,a.varSizeNonce?void 0:a.nonceLength,"nonce")}const g=a.tagLength;g&&x[1]!==void 0&&Ye(x[1],void 0,"AAD");const u=e(d,...x),r=(b,T)=>{if(T!==void 0){if(b!==2)throw new Error("cipher output not supported");Ye(T,void 0,"output")}};let c=!1;return{encrypt(b,T){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,Ye(b),r(u.encrypt.length,T),u.encrypt(b,T)},decrypt(b,T){if(Ye(b),g&&b.length<g)throw new Error('"ciphertext" expected length bigger than tagLength='+g);return r(u.decrypt.length,T),u.decrypt(b,T)}}}return Object.assign(t,a),t};function ei(a,e,t=!0){if(e===void 0)return new Uint8Array(a);if(Ye(e,void 0,"output"),e.length!==a)throw new Error('"output" expected Uint8Array of length '+a+", got: "+e.length);if(t&&!It(e))throw new Error("invalid output, must be aligned");return e}function ti(a,e,t){ua(a),ua(e);const d=new Uint8Array(16),x=Ft(d);return x.setBigUint64(0,BigInt(e),t),x.setBigUint64(8,BigInt(a),t),d}function It(a){return a.byteOffset%4===0}function wt(a){return Uint8Array.from(Ye(a))}const Ct=16,ca=new Uint8Array(16),Bt=vt(ca),ri=225,ai=(a,e,t,d)=>{const x=d&1;return{s3:t<<31|d>>>1,s2:e<<31|t>>>1,s1:a<<31|e>>>1,s0:a>>>1^ri<<24&-(x&1)}},Vt=a=>(a>>>0&255)<<24|(a>>>8&255)<<16|(a>>>16&255)<<8|a>>>24&255|0,ni=a=>a>64*1024?8:a>1024?4:2;class ii{blockLen=Ct;outputLen=Ct;s0=0;s1=0;s2=0;s3=0;finished=!1;destroyed=!1;t;W;windowSize;constructor(e,t){Ye(e,16,"key"),e=wt(e);const d=Ft(e);let x=d.getUint32(0,!1),g=d.getUint32(4,!1),u=d.getUint32(8,!1),r=d.getUint32(12,!1);const c=[];for(let v=0;v<128;v++)c.push({s0:Vt(x),s1:Vt(g),s2:Vt(u),s3:Vt(r)}),{s0:x,s1:g,s2:u,s3:r}=ai(x,g,u,r);const l=ni(t||1024);if(![1,2,4,8].includes(l))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=l;const T=128/l,E=this.windowSize=2**l,s=[];for(let v=0;v<T;v++)for(let h=0;h<E;h++){let y=0,n=0,p=0,m=0;for(let _=0;_<l;_++){if(!(h>>>l-_-1&1))continue;const{s0:C,s1:o,s2:i,s3:B}=c[l*v+_];y^=C,n^=o,p^=i,m^=B}s.push({s0:y,s1:n,s2:p,s3:m})}this.t=s}_updateBlock(e,t,d,x){e^=this.s0,t^=this.s1,d^=this.s2,x^=this.s3;const{W:g,t:u,windowSize:r}=this;let c=0,l=0,b=0,T=0;const E=(1<<g)-1;let s=0;for(const v of[e,t,d,x])for(let h=0;h<4;h++){const y=v>>>8*h&255;for(let n=8/g-1;n>=0;n--){const p=y>>>g*n&E,{s0:m,s1:_,s2:w,s3:C}=u[s*r+p];c^=m,l^=_,b^=w,T^=C,s+=1}}this.s0=c,this.s1=l,this.s2=b,this.s3=T}update(e){la(this),Ye(e),e=wt(e);const t=vt(e),d=Math.floor(e.length/Ct),x=e.length%Ct;for(let g=0;g<d;g++)this._updateBlock(ke(t[g*4+0]),ke(t[g*4+1]),ke(t[g*4+2]),ke(t[g*4+3]));return x&&(ca.set(e.subarray(d*Ct)),this._updateBlock(ke(Bt[0]),ke(Bt[1]),ke(Bt[2]),ke(Bt[3])),pt(Bt)),this}destroy(){this.destroyed=!0;const{t:e}=this;for(const t of e)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(e){la(this),Yn(e,this,!0),this.finished=!0;const{s0:t,s1:d,s2:x,s3:g}=this,u=vt(e);u[0]=t,u[1]=d,u[2]=x,u[3]=g,ir(u)}digest(){const e=new Uint8Array(Ct);return this.digestInto(e),this.destroy(),e}}const ha=$n(16,(a,e)=>new ii(a,e),a=>[a.length]),sr=16,si=4,Mt=new Uint8Array(sr),oi=283;function ui(a){if(![16,24,32].includes(a.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+a.length)}function or(a){return a<<1^oi&-(a>>7)}function da(a,e){let t=0;for(;e>0;e>>=1)t^=a&-(e&1),a=or(a);return t}const li=(()=>{const a=new Uint8Array(256);for(let t=0,d=1;t<256;t++,d^=or(d))a[t]=d;const e=new Uint8Array(256);e[0]=99;for(let t=0;t<255;t++){let d=a[255-t];d|=d<<8,e[a[t]]=(d^d>>4^d>>5^d>>6^d>>7^99)&255}return pt(a),e})(),fi=a=>a<<24|a>>>8,ur=a=>a<<8|a>>>24;function ci(a,e){if(a.length!==256)throw new Error("Wrong sbox length");const t=new Uint32Array(256).map((l,b)=>e(a[b])),d=t.map(ur),x=d.map(ur),g=x.map(ur),u=new Uint32Array(256*256),r=new Uint32Array(256*256),c=new Uint16Array(256*256);for(let l=0;l<256;l++)for(let b=0;b<256;b++){const T=l*256+b;u[T]=t[l]^d[b],r[T]=x[l]^g[b],c[T]=a[l]<<8|a[b]}return{sbox:a,sbox2:c,T0:t,T1:d,T2:x,T3:g,T01:u,T23:r}}const pa=ci(li,a=>da(a,3)<<24|a<<16|a<<8|da(a,2)),hi=(()=>{const a=new Uint8Array(16);for(let e=0,t=1;e<16;e++,t=or(t))a[e]=t;return a})();function di(a){Ye(a);const e=a.length;ui(a);const{sbox2:t}=pa,d=[];(!nr||!It(a))&&d.push(a=wt(a));const x=ir(vt(a)),g=x.length,u=c=>kt(t,c,c,c,c),r=new Uint32Array(e+28);r.set(x);for(let c=g;c<r.length;c++){let l=r[c-1];c%g===0?l=u(fi(l))^hi[c/g-1]:g>6&&c%g===4&&(l=u(l)),r[c]=r[c-g]^l}return pt(...d),r}function Kt(a,e,t,d,x,g){return a[t<<8&65280|d>>>8&255]^e[x>>>8&65280|g>>>24&255]}function kt(a,e,t,d,x){return a[e&255|t&65280]|a[d>>>16&255|x>>>16&65280]<<16}function ga(a,e,t,d,x){const{sbox2:g,T01:u,T23:r}=pa;let c=0;e^=a[c++],t^=a[c++],d^=a[c++],x^=a[c++];const l=a.length/4-2;for(let v=0;v<l;v++){const h=a[c++]^Kt(u,r,e,t,d,x),y=a[c++]^Kt(u,r,t,d,x,e),n=a[c++]^Kt(u,r,d,x,e,t),p=a[c++]^Kt(u,r,x,e,t,d);e=h,t=y,d=n,x=p}const b=a[c++]^kt(g,e,t,d,x),T=a[c++]^kt(g,t,d,x,e),E=a[c++]^kt(g,d,x,e,t),s=a[c++]^kt(g,x,e,t,d);return{s0:b,s1:T,s2:E,s3:s}}function zt(a,e,t,d,x){Ye(t,sr,"nonce"),Ye(d),x=ei(d.length,x);const g=t,u=vt(g),r=Ft(g),c=vt(d),l=vt(x),b=e?0:12,T=d.length;let E=r.getUint32(b,e),{s0:s,s1:v,s2:h,s3:y}=ga(a,ke(u[0]),ke(u[1]),ke(u[2]),ke(u[3]));for(let p=0;p+4<=c.length;p+=4)l[p+0]=c[p+0]^ke(s),l[p+1]=c[p+1]^ke(v),l[p+2]=c[p+2]^ke(h),l[p+3]=c[p+3]^ke(y),E=E+1>>>0,r.setUint32(b,E,e),{s0:s,s1:v,s2:h,s3:y}=ga(a,ke(u[0]),ke(u[1]),ke(u[2]),ke(u[3]));const n=sr*Math.floor(c.length/si);if(n<T){const p=new Uint32Array([s,v,h,y]);ir(p);const m=Zn(p);for(let _=n,w=0;_<T;_++,w++)x[_]=d[_]^m[w];pt(p)}return x}function pi(a,e,t,d,x){const g=x?x.length:0,u=a.create(t,d.length+g);x&&u.update(x);const r=ti(8*d.length,8*g,e);u.update(d),u.update(r);const c=u.digest();return pt(r),c}const gi=Jn({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(e,t,d){if(t.length<8)throw new Error("aes/gcm: invalid nonce length");const x=16;function g(r,c,l){const b=pi(ha,!1,r,l,d);for(let T=0;T<c.length;T++)b[T]^=c[T];return b}function u(){const r=di(e),c=Mt.slice(),l=Mt.slice();if(zt(r,!1,l,l,c),t.length===12)l.set(t);else{const T=Mt.slice();Ft(T).setBigUint64(8,BigInt(t.length*8),!1);const s=ha.create(c).update(t).update(T);s.digestInto(l),s.destroy()}const b=zt(r,!1,l,Mt);return{xk:r,authKey:c,counter:l,tagMask:b}}return{encrypt(r){const{xk:c,authKey:l,counter:b,tagMask:T}=u(),E=new Uint8Array(r.length+x),s=[c,l,b,T];It(r)||s.push(r=wt(r)),zt(c,!1,b,r,E.subarray(0,r.length));const v=g(l,T,E.subarray(0,E.length-x));return s.push(v),E.set(v,r.length),pt(...s),E},decrypt(r){const{xk:c,authKey:l,counter:b,tagMask:T}=u(),E=[c,l,T,b];It(r)||E.push(r=wt(r));const s=r.subarray(0,-x),v=r.subarray(-x),h=g(l,T,s);if(E.push(h),!Xn(h,v))throw pt(...E),new Error("aes/gcm: invalid ghash tag");const y=zt(c,!1,b,s);return pt(...E),y}}});var lr,va;function me(){return va||(va=1,lr={options:{usePureJavaScript:!1}}),lr}var fr={exports:{}},cr,ya;function vi(){if(ya)return cr;ya=1;var a={};cr=a;var e={};a.encode=function(d,x,g){if(typeof x!="string")throw new TypeError('"alphabet" must be a string.');if(g!==void 0&&typeof g!="number")throw new TypeError('"maxline" must be a number.');var u="";if(!(d instanceof Uint8Array))u=t(d,x);else{var r=0,c=x.length,l=x.charAt(0),b=[0];for(r=0;r<d.length;++r){for(var T=0,E=d[r];T<b.length;++T)E+=b[T]<<8,b[T]=E%c,E=E/c|0;for(;E>0;)b.push(E%c),E=E/c|0}for(r=0;d[r]===0&&r<d.length-1;++r)u+=l;for(r=b.length-1;r>=0;--r)u+=x[b[r]]}if(g){var s=new RegExp(".{1,"+g+"}","g");u=u.match(s).join(`\r
|
|
3
3
|
`)}return u},a.decode=function(d,x){if(typeof d!="string")throw new TypeError('"input" must be a string.');if(typeof x!="string")throw new TypeError('"alphabet" must be a string.');var g=e[x];if(!g){g=e[x]=[];for(var u=0;u<x.length;++u)g[x.charCodeAt(u)]=u}d=d.replace(/\s/g,"");for(var r=x.length,c=x.charAt(0),l=[0],u=0;u<d.length;u++){var b=g[d.charCodeAt(u)];if(b===void 0)return;for(var T=0,E=b;T<l.length;++T)E+=l[T]*r,l[T]=E&255,E>>=8;for(;E>0;)l.push(E&255),E>>=8}for(var s=0;d[s]===c&&s<d.length-1;++s)l.push(0);return typeof Buffer<"u"?Buffer.from(l.reverse()):new Uint8Array(l.reverse())};function t(d,x){var g=0,u=x.length,r=x.charAt(0),c=[0];for(g=0;g<d.length();++g){for(var l=0,b=d.at(g);l<c.length;++l)b+=c[l]<<8,c[l]=b%u,b=b/u|0;for(;b>0;)c.push(b%u),b=b/u|0}var T="";for(g=0;d.at(g)===0&&g<d.length()-1;++g)T+=r;for(g=c.length-1;g>=0;--g)T+=x[c[g]];return T}return cr}var ma;function Ee(){if(ma)return fr.exports;ma=1;var a=me(),e=vi(),t=fr.exports=a.util=a.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){t.nextTick=process.nextTick,typeof setImmediate=="function"?t.setImmediate=setImmediate:t.setImmediate=t.nextTick;return}if(typeof setImmediate=="function"){t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},t.nextTick=function(o){return setImmediate(o)};return}if(t.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(i){if(i.source===window&&i.data===n){i.stopPropagation();var B=p.slice();p.length=0,B.forEach(function(N){N()})}};var n="forge.setImmediate",p=[];t.setImmediate=function(i){p.push(i),p.length===1&&window.postMessage(n,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var m=Date.now(),_=!0,w=document.createElement("div"),p=[];new MutationObserver(function(){var i=p.slice();p.length=0,i.forEach(function(B){B()})}).observe(w,{attributes:!0});var C=t.setImmediate;t.setImmediate=function(i){Date.now()-m>15?(m=Date.now(),C(i)):(p.push(i),p.length===1&&w.setAttribute("a",_=!_))}}t.nextTick=t.setImmediate})(),t.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,t.globalScope=(function(){return t.isNodejs?bt:typeof self>"u"?window:self})(),t.isArray=Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"},t.isArrayBuffer=function(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer},t.isArrayBufferView=function(n){return n&&t.isArrayBuffer(n.buffer)&&n.byteLength!==void 0};function d(n){if(!(n===8||n===16||n===24||n===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+n)}t.ByteBuffer=x;function x(n){if(this.data="",this.read=0,typeof n=="string")this.data=n;else if(t.isArrayBuffer(n)||t.isArrayBufferView(n))if(typeof Buffer<"u"&&n instanceof Buffer)this.data=n.toString("binary");else{var p=new Uint8Array(n);try{this.data=String.fromCharCode.apply(null,p)}catch{for(var m=0;m<p.length;++m)this.putByte(p[m])}}else(n instanceof x||typeof n=="object"&&typeof n.data=="string"&&typeof n.read=="number")&&(this.data=n.data,this.read=n.read);this._constructedStringLength=0}t.ByteStringBuffer=x;var g=4096;t.ByteStringBuffer.prototype._optimizeConstructedString=function(n){this._constructedStringLength+=n,this._constructedStringLength>g&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(n){return this.putBytes(String.fromCharCode(n))},t.ByteStringBuffer.prototype.fillWithByte=function(n,p){n=String.fromCharCode(n);for(var m=this.data;p>0;)p&1&&(m+=n),p>>>=1,p>0&&(n+=n);return this.data=m,this._optimizeConstructedString(p),this},t.ByteStringBuffer.prototype.putBytes=function(n){return this.data+=n,this._optimizeConstructedString(n.length),this},t.ByteStringBuffer.prototype.putString=function(n){return this.putBytes(t.encodeUtf8(n))},t.ByteStringBuffer.prototype.putInt16=function(n){return this.putBytes(String.fromCharCode(n>>8&255)+String.fromCharCode(n&255))},t.ByteStringBuffer.prototype.putInt24=function(n){return this.putBytes(String.fromCharCode(n>>16&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n&255))},t.ByteStringBuffer.prototype.putInt32=function(n){return this.putBytes(String.fromCharCode(n>>24&255)+String.fromCharCode(n>>16&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n&255))},t.ByteStringBuffer.prototype.putInt16Le=function(n){return this.putBytes(String.fromCharCode(n&255)+String.fromCharCode(n>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(n){return this.putBytes(String.fromCharCode(n&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(n){return this.putBytes(String.fromCharCode(n&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n>>16&255)+String.fromCharCode(n>>24&255))},t.ByteStringBuffer.prototype.putInt=function(n,p){d(p);var m="";do p-=8,m+=String.fromCharCode(n>>p&255);while(p>0);return this.putBytes(m)},t.ByteStringBuffer.prototype.putSignedInt=function(n,p){return n<0&&(n+=2<<p-1),this.putInt(n,p)},t.ByteStringBuffer.prototype.putBuffer=function(n){return this.putBytes(n.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var n=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,n},t.ByteStringBuffer.prototype.getInt24=function(){var n=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,n},t.ByteStringBuffer.prototype.getInt32=function(){var n=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,n},t.ByteStringBuffer.prototype.getInt16Le=function(){var n=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,n},t.ByteStringBuffer.prototype.getInt24Le=function(){var n=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,n},t.ByteStringBuffer.prototype.getInt32Le=function(){var n=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,n},t.ByteStringBuffer.prototype.getInt=function(n){d(n);var p=0;do p=(p<<8)+this.data.charCodeAt(this.read++),n-=8;while(n>0);return p},t.ByteStringBuffer.prototype.getSignedInt=function(n){var p=this.getInt(n),m=2<<n-2;return p>=m&&(p-=m<<1),p},t.ByteStringBuffer.prototype.getBytes=function(n){var p;return n?(n=Math.min(this.length(),n),p=this.data.slice(this.read,this.read+n),this.read+=n):n===0?p="":(p=this.read===0?this.data:this.data.slice(this.read),this.clear()),p},t.ByteStringBuffer.prototype.bytes=function(n){return typeof n>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+n)},t.ByteStringBuffer.prototype.at=function(n){return this.data.charCodeAt(this.read+n)},t.ByteStringBuffer.prototype.setAt=function(n,p){return this.data=this.data.substr(0,this.read+n)+String.fromCharCode(p)+this.data.substr(this.read+n+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var n=t.createBuffer(this.data);return n.read=this.read,n},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(n){var p=Math.max(0,this.length()-n);return this.data=this.data.substr(this.read,p),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var n="",p=this.read;p<this.data.length;++p){var m=this.data.charCodeAt(p);m<16&&(n+="0"),n+=m.toString(16)}return n},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())};function u(n,p){p=p||{},this.read=p.readOffset||0,this.growSize=p.growSize||1024;var m=t.isArrayBuffer(n),_=t.isArrayBufferView(n);if(m||_){m?this.data=new DataView(n):this.data=new DataView(n.buffer,n.byteOffset,n.byteLength),this.write="writeOffset"in p?p.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,n!=null&&this.putBytes(n),"writeOffset"in p&&(this.write=p.writeOffset)}t.DataBuffer=u,t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(n,p){if(this.length()>=n)return this;p=Math.max(p||this.growSize,n);var m=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),_=new Uint8Array(this.length()+p);return _.set(m),this.data=new DataView(_.buffer),this},t.DataBuffer.prototype.putByte=function(n){return this.accommodate(1),this.data.setUint8(this.write++,n),this},t.DataBuffer.prototype.fillWithByte=function(n,p){this.accommodate(p);for(var m=0;m<p;++m)this.data.setUint8(n);return this},t.DataBuffer.prototype.putBytes=function(n,p){if(t.isArrayBufferView(n)){var m=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),_=m.byteLength-m.byteOffset;this.accommodate(_);var w=new Uint8Array(this.data.buffer,this.write);return w.set(m),this.write+=_,this}if(t.isArrayBuffer(n)){var m=new Uint8Array(n);this.accommodate(m.byteLength);var w=new Uint8Array(this.data.buffer);return w.set(m,this.write),this.write+=m.byteLength,this}if(n instanceof t.DataBuffer||typeof n=="object"&&typeof n.read=="number"&&typeof n.write=="number"&&t.isArrayBufferView(n.data)){var m=new Uint8Array(n.data.byteLength,n.read,n.length());this.accommodate(m.byteLength);var w=new Uint8Array(n.data.byteLength,this.write);return w.set(m),this.write+=m.byteLength,this}if(n instanceof t.ByteStringBuffer&&(n=n.data,p="binary"),p=p||"binary",typeof n=="string"){var C;if(p==="hex")return this.accommodate(Math.ceil(n.length/2)),C=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(n,C,this.write),this;if(p==="base64")return this.accommodate(Math.ceil(n.length/4)*3),C=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(n,C,this.write),this;if(p==="utf8"&&(n=t.encodeUtf8(n),p="binary"),p==="binary"||p==="raw")return this.accommodate(n.length),C=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(C),this;if(p==="utf16")return this.accommodate(n.length*2),C=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(C),this;throw new Error("Invalid encoding: "+p)}throw Error("Invalid parameter: "+n)},t.DataBuffer.prototype.putBuffer=function(n){return this.putBytes(n),n.clear(),this},t.DataBuffer.prototype.putString=function(n){return this.putBytes(n,"utf16")},t.DataBuffer.prototype.putInt16=function(n){return this.accommodate(2),this.data.setInt16(this.write,n),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(n){return this.accommodate(3),this.data.setInt16(this.write,n>>8&65535),this.data.setInt8(this.write,n>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(n){return this.accommodate(4),this.data.setInt32(this.write,n),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(n){return this.accommodate(2),this.data.setInt16(this.write,n,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(n){return this.accommodate(3),this.data.setInt8(this.write,n>>16&255),this.data.setInt16(this.write,n>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(n){return this.accommodate(4),this.data.setInt32(this.write,n,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(n,p){d(p),this.accommodate(p/8);do p-=8,this.data.setInt8(this.write++,n>>p&255);while(p>0);return this},t.DataBuffer.prototype.putSignedInt=function(n,p){return d(p),this.accommodate(p/8),n<0&&(n+=2<<p-1),this.putInt(n,p)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var n=this.data.getInt16(this.read);return this.read+=2,n},t.DataBuffer.prototype.getInt24=function(){var n=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,n},t.DataBuffer.prototype.getInt32=function(){var n=this.data.getInt32(this.read);return this.read+=4,n},t.DataBuffer.prototype.getInt16Le=function(){var n=this.data.getInt16(this.read,!0);return this.read+=2,n},t.DataBuffer.prototype.getInt24Le=function(){var n=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,n},t.DataBuffer.prototype.getInt32Le=function(){var n=this.data.getInt32(this.read,!0);return this.read+=4,n},t.DataBuffer.prototype.getInt=function(n){d(n);var p=0;do p=(p<<8)+this.data.getInt8(this.read++),n-=8;while(n>0);return p},t.DataBuffer.prototype.getSignedInt=function(n){var p=this.getInt(n),m=2<<n-2;return p>=m&&(p-=m<<1),p},t.DataBuffer.prototype.getBytes=function(n){var p;return n?(n=Math.min(this.length(),n),p=this.data.slice(this.read,this.read+n),this.read+=n):n===0?p="":(p=this.read===0?this.data:this.data.slice(this.read),this.clear()),p},t.DataBuffer.prototype.bytes=function(n){return typeof n>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+n)},t.DataBuffer.prototype.at=function(n){return this.data.getUint8(this.read+n)},t.DataBuffer.prototype.setAt=function(n,p){return this.data.setUint8(n,p),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var n=new Uint8Array(this.data.buffer,this.read),p=new Uint8Array(n.byteLength);p.set(n),this.data=new DataView(p),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(n){return this.write=Math.max(0,this.length()-n),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var n="",p=this.read;p<this.data.byteLength;++p){var m=this.data.getUint8(p);m<16&&(n+="0"),n+=m.toString(16)}return n},t.DataBuffer.prototype.toString=function(n){var p=new Uint8Array(this.data,this.read,this.length());if(n=n||"utf8",n==="binary"||n==="raw")return t.binary.raw.encode(p);if(n==="hex")return t.binary.hex.encode(p);if(n==="base64")return t.binary.base64.encode(p);if(n==="utf8")return t.text.utf8.decode(p);if(n==="utf16")return t.text.utf16.decode(p);throw new Error("Invalid encoding: "+n)},t.createBuffer=function(n,p){return p=p||"raw",n!==void 0&&p==="utf8"&&(n=t.encodeUtf8(n)),new t.ByteBuffer(n)},t.fillString=function(n,p){for(var m="";p>0;)p&1&&(m+=n),p>>>=1,p>0&&(n+=n);return m},t.xorBytes=function(n,p,m){for(var _="",w="",C="",o=0,i=0;m>0;--m,++o)w=n.charCodeAt(o)^p.charCodeAt(o),i>=10&&(_+=C,C="",i=0),C+=String.fromCharCode(w),++i;return _+=C,_},t.hexToBytes=function(n){var p="",m=0;for(n.length&!0&&(m=1,p+=String.fromCharCode(parseInt(n[0],16)));m<n.length;m+=2)p+=String.fromCharCode(parseInt(n.substr(m,2),16));return p},t.bytesToHex=function(n){return t.createBuffer(n).toHex()},t.int32ToBytes=function(n){return String.fromCharCode(n>>24&255)+String.fromCharCode(n>>16&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n&255)};var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(n,p){for(var m="",_="",w,C,o,i=0;i<n.length;)w=n.charCodeAt(i++),C=n.charCodeAt(i++),o=n.charCodeAt(i++),m+=r.charAt(w>>2),m+=r.charAt((w&3)<<4|C>>4),isNaN(C)?m+="==":(m+=r.charAt((C&15)<<2|o>>6),m+=isNaN(o)?"=":r.charAt(o&63)),p&&m.length>p&&(_+=m.substr(0,p)+`\r
|
|
4
4
|
`,m=m.substr(p));return _+=m,_},t.decode64=function(n){n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var p="",m,_,w,C,o=0;o<n.length;)m=c[n.charCodeAt(o++)-43],_=c[n.charCodeAt(o++)-43],w=c[n.charCodeAt(o++)-43],C=c[n.charCodeAt(o++)-43],p+=String.fromCharCode(m<<2|_>>4),w!==64&&(p+=String.fromCharCode((_&15)<<4|w>>2),C!==64&&(p+=String.fromCharCode((w&3)<<6|C)));return p},t.encodeUtf8=function(n){return unescape(encodeURIComponent(n))},t.decodeUtf8=function(n){return decodeURIComponent(escape(n))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:e.encode,decode:e.decode}},t.binary.raw.encode=function(n){return String.fromCharCode.apply(null,n)},t.binary.raw.decode=function(n,p,m){var _=p;_||(_=new Uint8Array(n.length)),m=m||0;for(var w=m,C=0;C<n.length;++C)_[w++]=n.charCodeAt(C);return p?w-m:_},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(n,p,m){var _=p;_||(_=new Uint8Array(Math.ceil(n.length/2))),m=m||0;var w=0,C=m;for(n.length&1&&(w=1,_[C++]=parseInt(n[0],16));w<n.length;w+=2)_[C++]=parseInt(n.substr(w,2),16);return p?C-m:_},t.binary.base64.encode=function(n,p){for(var m="",_="",w,C,o,i=0;i<n.byteLength;)w=n[i++],C=n[i++],o=n[i++],m+=r.charAt(w>>2),m+=r.charAt((w&3)<<4|C>>4),isNaN(C)?m+="==":(m+=r.charAt((C&15)<<2|o>>6),m+=isNaN(o)?"=":r.charAt(o&63)),p&&m.length>p&&(_+=m.substr(0,p)+`\r
|
|
5
5
|
`,m=m.substr(p));return _+=m,_},t.binary.base64.decode=function(n,p,m){var _=p;_||(_=new Uint8Array(Math.ceil(n.length/4)*3)),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,""),m=m||0;for(var w,C,o,i,B=0,N=m;B<n.length;)w=c[n.charCodeAt(B++)-43],C=c[n.charCodeAt(B++)-43],o=c[n.charCodeAt(B++)-43],i=c[n.charCodeAt(B++)-43],_[N++]=w<<2|C>>4,o!==64&&(_[N++]=(C&15)<<4|o>>2,i!==64&&(_[N++]=(o&3)<<6|i));return p?N-m:_.subarray(0,N)},t.binary.base58.encode=function(n,p){return t.binary.baseN.encode(n,l,p)},t.binary.base58.decode=function(n,p){return t.binary.baseN.decode(n,l,p)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(n,p,m){n=t.encodeUtf8(n);var _=p;_||(_=new Uint8Array(n.length)),m=m||0;for(var w=m,C=0;C<n.length;++C)_[w++]=n.charCodeAt(C);return p?w-m:_},t.text.utf8.decode=function(n){return t.decodeUtf8(String.fromCharCode.apply(null,n))},t.text.utf16.encode=function(n,p,m){var _=p;_||(_=new Uint8Array(n.length*2));var w=new Uint16Array(_.buffer);m=m||0;for(var C=m,o=m,i=0;i<n.length;++i)w[o++]=n.charCodeAt(i),C+=2;return p?C-m:_},t.text.utf16.decode=function(n){return String.fromCharCode.apply(null,new Uint16Array(n.buffer))},t.deflate=function(n,p,m){if(p=t.decode64(n.deflate(t.encode64(p)).rval),m){var _=2,w=p.charCodeAt(1);w&32&&(_=6),p=p.substring(_,p.length-4)}return p},t.inflate=function(n,p,m){var _=n.inflate(t.encode64(p)).rval;return _===null?null:t.decode64(_)};var b=function(n,p,m){if(!n)throw new Error("WebStorage not available.");var _;if(m===null?_=n.removeItem(p):(m=t.encode64(JSON.stringify(m)),_=n.setItem(p,m)),typeof _<"u"&&_.rval!==!0){var w=new Error(_.error.message);throw w.id=_.error.id,w.name=_.error.name,w}},T=function(n,p){if(!n)throw new Error("WebStorage not available.");var m=n.getItem(p);if(n.init)if(m.rval===null){if(m.error){var _=new Error(m.error.message);throw _.id=m.error.id,_.name=m.error.name,_}m=null}else m=m.rval;return m!==null&&(m=JSON.parse(t.decode64(m))),m},E=function(n,p,m,_){var w=T(n,p);w===null&&(w={}),w[m]=_,b(n,p,w)},s=function(n,p,m){var _=T(n,p);return _!==null&&(_=m in _?_[m]:null),_},v=function(n,p,m){var _=T(n,p);if(_!==null&&m in _){delete _[m];var w=!0;for(var C in _){w=!1;break}w&&(_=null),b(n,p,_)}},h=function(n,p){b(n,p,null)},y=function(n,p,m){var _=null;typeof m>"u"&&(m=["web","flash"]);var w,C=!1,o=null;for(var i in m){w=m[i];try{if(w==="flash"||w==="both"){if(p[0]===null)throw new Error("Flash local storage not available.");_=n.apply(this,p),C=w==="flash"}(w==="web"||w==="both")&&(p[0]=localStorage,_=n.apply(this,p),C=!0)}catch(B){o=B}if(C)break}if(!C)throw o;return _};return t.setItem=function(n,p,m,_,w){y(E,arguments,w)},t.getItem=function(n,p,m,_){return y(s,arguments,_)},t.removeItem=function(n,p,m,_){y(v,arguments,_)},t.clearItems=function(n,p,m){y(h,arguments,m)},t.isEmpty=function(n){for(var p in n)if(n.hasOwnProperty(p))return!1;return!0},t.format=function(n){for(var p=/%./g,m,_,w=0,C=[],o=0;m=p.exec(n);){_=n.substring(o,p.lastIndex-2),_.length>0&&C.push(_),o=p.lastIndex;var i=m[0][1];switch(i){case"s":case"o":w<arguments.length?C.push(arguments[w+++1]):C.push("<?>");break;case"%":C.push("%");break;default:C.push("<%"+i+"?>")}}return C.push(n.substring(o)),C.join("")},t.formatNumber=function(n,p,m,_){var w=n,C=isNaN(p=Math.abs(p))?2:p,o=m===void 0?",":m,i=_===void 0?".":_,B=w<0?"-":"",N=parseInt(w=Math.abs(+w||0).toFixed(C),10)+"",q=N.length>3?N.length%3:0;return B+(q?N.substr(0,q)+i:"")+N.substr(q).replace(/(\d{3})(?=\d)/g,"$1"+i)+(C?o+Math.abs(w-N).toFixed(C).slice(2):"")},t.formatSize=function(n){return n>=1073741824?n=t.formatNumber(n/1073741824,2,".","")+" GiB":n>=1048576?n=t.formatNumber(n/1048576,2,".","")+" MiB":n>=1024?n=t.formatNumber(n/1024,0)+" KiB":n=t.formatNumber(n,0)+" bytes",n},t.bytesFromIP=function(n){return n.indexOf(".")!==-1?t.bytesFromIPv4(n):n.indexOf(":")!==-1?t.bytesFromIPv6(n):null},t.bytesFromIPv4=function(n){if(n=n.split("."),n.length!==4)return null;for(var p=t.createBuffer(),m=0;m<n.length;++m){var _=parseInt(n[m],10);if(isNaN(_))return null;p.putByte(_)}return p.getBytes()},t.bytesFromIPv6=function(n){var p=0;n=n.split(":").filter(function(o){return o.length===0&&++p,!0});for(var m=(8-n.length+p)*2,_=t.createBuffer(),w=0;w<8;++w){if(!n[w]||n[w].length===0){_.fillWithByte(0,m),m=0;continue}var C=t.hexToBytes(n[w]);C.length<2&&_.putByte(0),_.putBytes(C)}return _.getBytes()},t.bytesToIP=function(n){return n.length===4?t.bytesToIPv4(n):n.length===16?t.bytesToIPv6(n):null},t.bytesToIPv4=function(n){if(n.length!==4)return null;for(var p=[],m=0;m<n.length;++m)p.push(n.charCodeAt(m));return p.join(".")},t.bytesToIPv6=function(n){if(n.length!==16)return null;for(var p=[],m=[],_=0,w=0;w<n.length;w+=2){for(var C=t.bytesToHex(n[w]+n[w+1]);C[0]==="0"&&C!=="0";)C=C.substr(1);if(C==="0"){var o=m[m.length-1],i=p.length;!o||i!==o.end+1?m.push({start:i,end:i}):(o.end=i,o.end-o.start>m[_].end-m[_].start&&(_=m.length-1))}p.push(C)}if(m.length>0){var B=m[_];B.end-B.start>0&&(p.splice(B.start,B.end-B.start+1,""),B.start===0&&p.unshift(""),B.end===7&&p.push(""))}return p.join(":")},t.estimateCores=function(n,p){if(typeof n=="function"&&(p=n,n={}),n=n||{},"cores"in t&&!n.update)return p(null,t.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,p(null,t.cores);if(typeof Worker>"u")return t.cores=1,p(null,t.cores);if(typeof Blob>"u")return t.cores=2,p(null,t.cores);var m=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(o){var i=Date.now(),B=i+4;self.postMessage({st:i,et:B})})}).toString(),")()"],{type:"application/javascript"}));_([],5,16);function _(o,i,B){if(i===0){var N=Math.floor(o.reduce(function(q,I){return q+I},0)/o.length);return t.cores=Math.max(1,N),URL.revokeObjectURL(m),p(null,t.cores)}w(B,function(q,I){o.push(C(B,I)),_(o,i-1,B)})}function w(o,i){for(var B=[],N=[],q=0;q<o;++q){var I=new Worker(m);I.addEventListener("message",function(F){if(N.push(F.data),N.length===o){for(var A=0;A<o;++A)B[A].terminate();i(null,N)}}),B.push(I)}for(var q=0;q<o;++q)B[q].postMessage(q)}function C(o,i){for(var B=[],N=0;N<o;++N)for(var q=i[N],I=B[N]=[],F=0;F<o;++F)if(N!==F){var A=i[F];(q.st>A.st&&q.st<A.et||A.st>q.st&&A.st<q.et)&&I.push(F)}return B.reduce(function(H,j){return Math.max(H,j.length)},0)}},fr.exports}var hr,Ca;function dr(){if(Ca)return hr;Ca=1;var a=me();Ee(),hr=a.cipher=a.cipher||{},a.cipher.algorithms=a.cipher.algorithms||{},a.cipher.createCipher=function(t,d){var x=t;if(typeof x=="string"&&(x=a.cipher.getAlgorithm(x),x&&(x=x())),!x)throw new Error("Unsupported algorithm: "+t);return new a.cipher.BlockCipher({algorithm:x,key:d,decrypt:!1})},a.cipher.createDecipher=function(t,d){var x=t;if(typeof x=="string"&&(x=a.cipher.getAlgorithm(x),x&&(x=x())),!x)throw new Error("Unsupported algorithm: "+t);return new a.cipher.BlockCipher({algorithm:x,key:d,decrypt:!0})},a.cipher.registerAlgorithm=function(t,d){t=t.toUpperCase(),a.cipher.algorithms[t]=d},a.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in a.cipher.algorithms?a.cipher.algorithms[t]:null};var e=a.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};return e.prototype.start=function(t){t=t||{};var d={};for(var x in t)d[x]=t[x];d.decrypt=this._decrypt,this._finish=!1,this._input=a.util.createBuffer(),this.output=t.output||a.util.createBuffer(),this.mode.start(d)},e.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},e.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(x){return t(this.blockSize,x,!1)},this.mode.unpad=function(x){return t(this.blockSize,x,!0)});var d={};return d.decrypt=this._decrypt,d.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,d)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,d))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,d))},hr}var pr={exports:{}},xa;function Ea(){if(xa)return pr.exports;xa=1;var a=me();Ee(),a.cipher=a.cipher||{};var e=pr.exports=a.cipher.modes=a.cipher.modes||{};e.ecb=function(g){g=g||{},this.name="ECB",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},e.ecb.prototype.start=function(g){},e.ecb.prototype.encrypt=function(g,u,r){if(g.length()<this.blockSize&&!(r&&g.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=g.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)u.putInt32(this._outBlock[c])},e.ecb.prototype.decrypt=function(g,u,r){if(g.length()<this.blockSize&&!(r&&g.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=g.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)u.putInt32(this._outBlock[c])},e.ecb.prototype.pad=function(g,u){var r=g.length()===this.blockSize?this.blockSize:this.blockSize-g.length();return g.fillWithByte(r,r),!0},e.ecb.prototype.unpad=function(g,u){if(u.overflow>0)return!1;var r=g.length(),c=g.at(r-1);return c>this.blockSize<<2?!1:(g.truncate(c),!0)},e.cbc=function(g){g=g||{},this.name="CBC",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},e.cbc.prototype.start=function(g){if(g.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in g)this._iv=t(g.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},e.cbc.prototype.encrypt=function(g,u,r){if(g.length()<this.blockSize&&!(r&&g.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=this._prev[c]^g.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)u.putInt32(this._outBlock[c]);this._prev=this._outBlock},e.cbc.prototype.decrypt=function(g,u,r){if(g.length()<this.blockSize&&!(r&&g.length()>0))return!0;for(var c=0;c<this._ints;++c)this._inBlock[c]=g.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var c=0;c<this._ints;++c)u.putInt32(this._prev[c]^this._outBlock[c]);this._prev=this._inBlock.slice(0)},e.cbc.prototype.pad=function(g,u){var r=g.length()===this.blockSize?this.blockSize:this.blockSize-g.length();return g.fillWithByte(r,r),!0},e.cbc.prototype.unpad=function(g,u){if(u.overflow>0)return!1;var r=g.length(),c=g.at(r-1);return c>this.blockSize<<2?!1:(g.truncate(c),!0)},e.cfb=function(g){g=g||{},this.name="CFB",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},e.cfb.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");this._iv=t(g.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.cfb.prototype.encrypt=function(g,u,r){var c=g.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)this._inBlock[l]=g.getInt32()^this._outBlock[l],u.putInt32(this._inBlock[l]);return}var b=(this.blockSize-c)%this.blockSize;b>0&&(b=this.blockSize-b),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialBlock[l]=g.getInt32()^this._outBlock[l],this._partialOutput.putInt32(this._partialBlock[l]);if(b>0)g.read-=this.blockSize;else for(var l=0;l<this._ints;++l)this._inBlock[l]=this._partialBlock[l];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),b>0&&!r)return u.putBytes(this._partialOutput.getBytes(b-this._partialBytes)),this._partialBytes=b,!0;u.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0},e.cfb.prototype.decrypt=function(g,u,r){var c=g.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)this._inBlock[l]=g.getInt32(),u.putInt32(this._inBlock[l]^this._outBlock[l]);return}var b=(this.blockSize-c)%this.blockSize;b>0&&(b=this.blockSize-b),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialBlock[l]=g.getInt32(),this._partialOutput.putInt32(this._partialBlock[l]^this._outBlock[l]);if(b>0)g.read-=this.blockSize;else for(var l=0;l<this._ints;++l)this._inBlock[l]=this._partialBlock[l];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),b>0&&!r)return u.putBytes(this._partialOutput.getBytes(b-this._partialBytes)),this._partialBytes=b,!0;u.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0},e.ofb=function(g){g=g||{},this.name="OFB",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},e.ofb.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");this._iv=t(g.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ofb.prototype.encrypt=function(g,u,r){var c=g.length();if(g.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)u.putInt32(g.getInt32()^this._outBlock[l]),this._inBlock[l]=this._outBlock[l];return}var b=(this.blockSize-c)%this.blockSize;b>0&&(b=this.blockSize-b),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialOutput.putInt32(g.getInt32()^this._outBlock[l]);if(b>0)g.read-=this.blockSize;else for(var l=0;l<this._ints;++l)this._inBlock[l]=this._outBlock[l];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),b>0&&!r)return u.putBytes(this._partialOutput.getBytes(b-this._partialBytes)),this._partialBytes=b,!0;u.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0},e.ofb.prototype.decrypt=e.ofb.prototype.encrypt,e.ctr=function(g){g=g||{},this.name="CTR",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},e.ctr.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");this._iv=t(g.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ctr.prototype.encrypt=function(g,u,r){var c=g.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize)for(var l=0;l<this._ints;++l)u.putInt32(g.getInt32()^this._outBlock[l]);else{var b=(this.blockSize-c)%this.blockSize;b>0&&(b=this.blockSize-b),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialOutput.putInt32(g.getInt32()^this._outBlock[l]);if(b>0&&(g.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),b>0&&!r)return u.putBytes(this._partialOutput.getBytes(b-this._partialBytes)),this._partialBytes=b,!0;u.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0}d(this._inBlock)},e.ctr.prototype.decrypt=e.ctr.prototype.encrypt,e.gcm=function(g){g=g||{},this.name="GCM",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=3774873600},e.gcm.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");var u=a.util.createBuffer(g.iv);this._cipherLength=0;var r;if("additionalData"in g?r=a.util.createBuffer(g.additionalData):r=a.util.createBuffer(),"tagLength"in g?this._tagLength=g.tagLength:this._tagLength=128,this._tag=null,g.decrypt&&(this._tag=a.util.createBuffer(g.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var c=u.length();if(c===12)this._j0=[u.getInt32(),u.getInt32(),u.getInt32(),1];else{for(this._j0=[0,0,0,0];u.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[u.getInt32(),u.getInt32(),u.getInt32(),u.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(x(c*8)))}this._inBlock=this._j0.slice(0),d(this._inBlock),this._partialBytes=0,r=a.util.createBuffer(r),this._aDataLength=x(r.length()*8);var l=r.length()%this.blockSize;for(l&&r.fillWithByte(0,this.blockSize-l),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])},e.gcm.prototype.encrypt=function(g,u,r){var c=g.length();if(c===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&c>=this.blockSize){for(var l=0;l<this._ints;++l)u.putInt32(this._outBlock[l]^=g.getInt32());this._cipherLength+=this.blockSize}else{var b=(this.blockSize-c)%this.blockSize;b>0&&(b=this.blockSize-b),this._partialOutput.clear();for(var l=0;l<this._ints;++l)this._partialOutput.putInt32(g.getInt32()^this._outBlock[l]);if(b<=0||r){if(r){var T=c%this.blockSize;this._cipherLength+=T,this._partialOutput.truncate(this.blockSize-T)}else this._cipherLength+=this.blockSize;for(var l=0;l<this._ints;++l)this._outBlock[l]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),b>0&&!r)return g.read-=this.blockSize,u.putBytes(this._partialOutput.getBytes(b-this._partialBytes)),this._partialBytes=b,!0;u.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),d(this._inBlock)},e.gcm.prototype.decrypt=function(g,u,r){var c=g.length();if(c<this.blockSize&&!(r&&c>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),d(this._inBlock),this._hashBlock[0]=g.getInt32(),this._hashBlock[1]=g.getInt32(),this._hashBlock[2]=g.getInt32(),this._hashBlock[3]=g.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var l=0;l<this._ints;++l)u.putInt32(this._outBlock[l]^this._hashBlock[l]);c<this.blockSize?this._cipherLength+=c%this.blockSize:this._cipherLength+=this.blockSize},e.gcm.prototype.afterFinish=function(g,u){var r=!0;u.decrypt&&u.overflow&&g.truncate(this.blockSize-u.overflow),this.tag=a.util.createBuffer();var c=this._aDataLength.concat(x(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,c);var l=[];this.cipher.encrypt(this._j0,l);for(var b=0;b<this._ints;++b)this.tag.putInt32(this._s[b]^l[b]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),u.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},e.gcm.prototype.multiply=function(g,u){for(var r=[0,0,0,0],c=u.slice(0),l=0;l<128;++l){var b=g[l/32|0]&1<<31-l%32;b&&(r[0]^=c[0],r[1]^=c[1],r[2]^=c[2],r[3]^=c[3]),this.pow(c,c)}return r},e.gcm.prototype.pow=function(g,u){for(var r=g[3]&1,c=3;c>0;--c)u[c]=g[c]>>>1|(g[c-1]&1)<<31;u[0]=g[0]>>>1,r&&(u[0]^=this._R)},e.gcm.prototype.tableMultiply=function(g){for(var u=[0,0,0,0],r=0;r<32;++r){var c=r/8|0,l=g[c]>>>(7-r%8)*4&15,b=this._m[r][l];u[0]^=b[0],u[1]^=b[1],u[2]^=b[2],u[3]^=b[3]}return u},e.gcm.prototype.ghash=function(g,u,r){return u[0]^=r[0],u[1]^=r[1],u[2]^=r[2],u[3]^=r[3],this.tableMultiply(u)},e.gcm.prototype.generateHashTable=function(g,u){for(var r=8/u,c=4*r,l=16*r,b=new Array(l),T=0;T<l;++T){var E=[0,0,0,0],s=T/c|0,v=(c-1-T%c)*u;E[s]=1<<u-1<<v,b[T]=this.generateSubHashTable(this.multiply(E,g),u)}return b},e.gcm.prototype.generateSubHashTable=function(g,u){var r=1<<u,c=r>>>1,l=new Array(r);l[c]=g.slice(0);for(var b=c>>>1;b>0;)this.pow(l[2*b],l[b]=[]),b>>=1;for(b=2;b<c;){for(var T=1;T<b;++T){var E=l[b],s=l[T];l[b+T]=[E[0]^s[0],E[1]^s[1],E[2]^s[2],E[3]^s[3]]}b*=2}for(l[0]=[0,0,0,0],b=c+1;b<r;++b){var v=l[b^c];l[b]=[g[0]^v[0],g[1]^v[1],g[2]^v[2],g[3]^v[3]]}return l};function t(g,u){if(typeof g=="string"&&(g=a.util.createBuffer(g)),a.util.isArray(g)&&g.length>4){var r=g;g=a.util.createBuffer();for(var c=0;c<r.length;++c)g.putByte(r[c])}if(g.length()<u)throw new Error("Invalid IV length; got "+g.length()+" bytes and expected "+u+" bytes.");if(!a.util.isArray(g)){for(var l=[],b=u/4,c=0;c<b;++c)l.push(g.getInt32());g=l}return g}function d(g){g[g.length-1]=g[g.length-1]+1&4294967295}function x(g){return[g/4294967296|0,g&4294967295]}return pr.exports}var gr,Sa;function yt(){if(Sa)return gr;Sa=1;var a=me();dr(),Ea(),Ee(),gr=a.aes=a.aes||{},a.aes.startEncrypting=function(s,v,h,y){var n=E({key:s,output:h,decrypt:!1,mode:y});return n.start(v),n},a.aes.createEncryptionCipher=function(s,v){return E({key:s,output:null,decrypt:!1,mode:v})},a.aes.startDecrypting=function(s,v,h,y){var n=E({key:s,output:h,decrypt:!0,mode:y});return n.start(v),n},a.aes.createDecryptionCipher=function(s,v){return E({key:s,output:null,decrypt:!0,mode:v})},a.aes.Algorithm=function(s,v){t||l();var h=this;h.name=s,h.mode=new v({blockSize:16,cipher:{encrypt:function(y,n){return T(h._w,y,n,!1)},decrypt:function(y,n){return T(h._w,y,n,!0)}}}),h._init=!1},a.aes.Algorithm.prototype.initialize=function(s){if(!this._init){var v=s.key,h;if(typeof v=="string"&&(v.length===16||v.length===24||v.length===32))v=a.util.createBuffer(v);else if(a.util.isArray(v)&&(v.length===16||v.length===24||v.length===32)){h=v,v=a.util.createBuffer();for(var y=0;y<h.length;++y)v.putByte(h[y])}if(!a.util.isArray(v)){h=v,v=[];var n=h.length();if(n===16||n===24||n===32){n=n>>>2;for(var y=0;y<n;++y)v.push(h.getInt32())}}if(!a.util.isArray(v)||!(v.length===4||v.length===6||v.length===8))throw new Error("Invalid key parameter.");var p=this.mode.name,m=["CFB","OFB","CTR","GCM"].indexOf(p)!==-1;this._w=b(v,s.decrypt&&!m),this._init=!0}},a.aes._expandKey=function(s,v){return t||l(),b(s,v)},a.aes._updateBlock=T,e("AES-ECB",a.cipher.modes.ecb),e("AES-CBC",a.cipher.modes.cbc),e("AES-CFB",a.cipher.modes.cfb),e("AES-OFB",a.cipher.modes.ofb),e("AES-CTR",a.cipher.modes.ctr),e("AES-GCM",a.cipher.modes.gcm);function e(s,v){var h=function(){return new a.aes.Algorithm(s,v)};a.cipher.registerAlgorithm(s,h)}var t=!1,d=4,x,g,u,r,c;function l(){t=!0,u=[0,1,2,4,8,16,32,64,128,27,54];for(var s=new Array(256),v=0;v<128;++v)s[v]=v<<1,s[v+128]=v+128<<1^283;x=new Array(256),g=new Array(256),r=new Array(4),c=new Array(4);for(var v=0;v<4;++v)r[v]=new Array(256),c[v]=new Array(256);for(var h=0,y=0,n,p,m,_,w,C,o,v=0;v<256;++v){_=y^y<<1^y<<2^y<<3^y<<4,_=_>>8^_&255^99,x[h]=_,g[_]=h,w=s[_],n=s[h],p=s[n],m=s[p],C=w<<24^_<<16^_<<8^(_^w),o=(n^p^m)<<24^(h^m)<<16^(h^p^m)<<8^(h^n^m);for(var i=0;i<4;++i)r[i][h]=C,c[i][_]=o,C=C<<24|C>>>8,o=o<<24|o>>>8;h===0?h=y=1:(h=n^s[s[s[n^m]]],y^=s[s[y]])}}function b(s,v){for(var h=s.slice(0),y,n=1,p=h.length,m=p+6+1,_=d*m,w=p;w<_;++w)y=h[w-1],w%p===0?(y=x[y>>>16&255]<<24^x[y>>>8&255]<<16^x[y&255]<<8^x[y>>>24]^u[n]<<24,n++):p>6&&w%p===4&&(y=x[y>>>24]<<24^x[y>>>16&255]<<16^x[y>>>8&255]<<8^x[y&255]),h[w]=h[w-p]^y;if(v){var C,o=c[0],i=c[1],B=c[2],N=c[3],q=h.slice(0);_=h.length;for(var w=0,I=_-d;w<_;w+=d,I-=d)if(w===0||w===_-d)q[w]=h[I],q[w+1]=h[I+3],q[w+2]=h[I+2],q[w+3]=h[I+1];else for(var F=0;F<d;++F)C=h[I+F],q[w+(3&-F)]=o[x[C>>>24]]^i[x[C>>>16&255]]^B[x[C>>>8&255]]^N[x[C&255]];h=q}return h}function T(s,v,h,y){var n=s.length/4-1,p,m,_,w,C;y?(p=c[0],m=c[1],_=c[2],w=c[3],C=g):(p=r[0],m=r[1],_=r[2],w=r[3],C=x);var o,i,B,N,q,I,F;o=v[0]^s[0],i=v[y?3:1]^s[1],B=v[2]^s[2],N=v[y?1:3]^s[3];for(var A=3,H=1;H<n;++H)q=p[o>>>24]^m[i>>>16&255]^_[B>>>8&255]^w[N&255]^s[++A],I=p[i>>>24]^m[B>>>16&255]^_[N>>>8&255]^w[o&255]^s[++A],F=p[B>>>24]^m[N>>>16&255]^_[o>>>8&255]^w[i&255]^s[++A],N=p[N>>>24]^m[o>>>16&255]^_[i>>>8&255]^w[B&255]^s[++A],o=q,i=I,B=F;h[0]=C[o>>>24]<<24^C[i>>>16&255]<<16^C[B>>>8&255]<<8^C[N&255]^s[++A],h[y?3:1]=C[i>>>24]<<24^C[B>>>16&255]<<16^C[N>>>8&255]<<8^C[o&255]^s[++A],h[2]=C[B>>>24]<<24^C[N>>>16&255]<<16^C[o>>>8&255]<<8^C[i&255]^s[++A],h[y?1:3]=C[N>>>24]<<24^C[o>>>16&255]<<16^C[i>>>8&255]<<8^C[B&255]^s[++A]}function E(s){s=s||{};var v=(s.mode||"CBC").toUpperCase(),h="AES-"+v,y;s.decrypt?y=a.cipher.createDecipher(h,s.key):y=a.cipher.createCipher(h,s.key);var n=y.start;return y.start=function(p,m){var _=null;m instanceof a.util.ByteBuffer&&(_=m,m={}),m=m||{},m.output=_,m.iv=p,n.call(y,m)},y}return gr}var vr={exports:{}},yr={exports:{}},mr={exports:{}},ba;function mt(){if(ba)return mr.exports;ba=1;var a=me();a.pki=a.pki||{};var e=mr.exports=a.pki.oids=a.oids=a.oids||{};function t(x,g){e[x]=g,e[g]=x}function d(x,g){e[x]=g}return t("1.2.840.113549.1.1.1","rsaEncryption"),t("1.2.840.113549.1.1.4","md5WithRSAEncryption"),t("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),t("1.2.840.113549.1.1.7","RSAES-OAEP"),t("1.2.840.113549.1.1.8","mgf1"),t("1.2.840.113549.1.1.9","pSpecified"),t("1.2.840.113549.1.1.10","RSASSA-PSS"),t("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),t("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),t("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),t("1.3.101.112","EdDSA25519"),t("1.2.840.10040.4.3","dsa-with-sha1"),t("1.3.14.3.2.7","desCBC"),t("1.3.14.3.2.26","sha1"),t("1.3.14.3.2.29","sha1WithRSASignature"),t("2.16.840.1.101.3.4.2.1","sha256"),t("2.16.840.1.101.3.4.2.2","sha384"),t("2.16.840.1.101.3.4.2.3","sha512"),t("2.16.840.1.101.3.4.2.4","sha224"),t("2.16.840.1.101.3.4.2.5","sha512-224"),t("2.16.840.1.101.3.4.2.6","sha512-256"),t("1.2.840.113549.2.2","md2"),t("1.2.840.113549.2.5","md5"),t("1.2.840.113549.1.7.1","data"),t("1.2.840.113549.1.7.2","signedData"),t("1.2.840.113549.1.7.3","envelopedData"),t("1.2.840.113549.1.7.4","signedAndEnvelopedData"),t("1.2.840.113549.1.7.5","digestedData"),t("1.2.840.113549.1.7.6","encryptedData"),t("1.2.840.113549.1.9.1","emailAddress"),t("1.2.840.113549.1.9.2","unstructuredName"),t("1.2.840.113549.1.9.3","contentType"),t("1.2.840.113549.1.9.4","messageDigest"),t("1.2.840.113549.1.9.5","signingTime"),t("1.2.840.113549.1.9.6","counterSignature"),t("1.2.840.113549.1.9.7","challengePassword"),t("1.2.840.113549.1.9.8","unstructuredAddress"),t("1.2.840.113549.1.9.14","extensionRequest"),t("1.2.840.113549.1.9.20","friendlyName"),t("1.2.840.113549.1.9.21","localKeyId"),t("1.2.840.113549.1.9.22.1","x509Certificate"),t("1.2.840.113549.1.12.10.1.1","keyBag"),t("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),t("1.2.840.113549.1.12.10.1.3","certBag"),t("1.2.840.113549.1.12.10.1.4","crlBag"),t("1.2.840.113549.1.12.10.1.5","secretBag"),t("1.2.840.113549.1.12.10.1.6","safeContentsBag"),t("1.2.840.113549.1.5.13","pkcs5PBES2"),t("1.2.840.113549.1.5.12","pkcs5PBKDF2"),t("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),t("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),t("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),t("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),t("1.2.840.113549.2.7","hmacWithSHA1"),t("1.2.840.113549.2.8","hmacWithSHA224"),t("1.2.840.113549.2.9","hmacWithSHA256"),t("1.2.840.113549.2.10","hmacWithSHA384"),t("1.2.840.113549.2.11","hmacWithSHA512"),t("1.2.840.113549.3.7","des-EDE3-CBC"),t("2.16.840.1.101.3.4.1.2","aes128-CBC"),t("2.16.840.1.101.3.4.1.22","aes192-CBC"),t("2.16.840.1.101.3.4.1.42","aes256-CBC"),t("2.5.4.3","commonName"),t("2.5.4.4","surname"),t("2.5.4.5","serialNumber"),t("2.5.4.6","countryName"),t("2.5.4.7","localityName"),t("2.5.4.8","stateOrProvinceName"),t("2.5.4.9","streetAddress"),t("2.5.4.10","organizationName"),t("2.5.4.11","organizationalUnitName"),t("2.5.4.12","title"),t("2.5.4.13","description"),t("2.5.4.15","businessCategory"),t("2.5.4.17","postalCode"),t("2.5.4.42","givenName"),t("2.5.4.65","pseudonym"),t("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),t("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),t("2.16.840.1.113730.1.1","nsCertType"),t("2.16.840.1.113730.1.13","nsComment"),d("2.5.29.1","authorityKeyIdentifier"),d("2.5.29.2","keyAttributes"),d("2.5.29.3","certificatePolicies"),d("2.5.29.4","keyUsageRestriction"),d("2.5.29.5","policyMapping"),d("2.5.29.6","subtreesConstraint"),d("2.5.29.7","subjectAltName"),d("2.5.29.8","issuerAltName"),d("2.5.29.9","subjectDirectoryAttributes"),d("2.5.29.10","basicConstraints"),d("2.5.29.11","nameConstraints"),d("2.5.29.12","policyConstraints"),d("2.5.29.13","basicConstraints"),t("2.5.29.14","subjectKeyIdentifier"),t("2.5.29.15","keyUsage"),d("2.5.29.16","privateKeyUsagePeriod"),t("2.5.29.17","subjectAltName"),t("2.5.29.18","issuerAltName"),t("2.5.29.19","basicConstraints"),d("2.5.29.20","cRLNumber"),d("2.5.29.21","cRLReason"),d("2.5.29.22","expirationDate"),d("2.5.29.23","instructionCode"),d("2.5.29.24","invalidityDate"),d("2.5.29.25","cRLDistributionPoints"),d("2.5.29.26","issuingDistributionPoint"),d("2.5.29.27","deltaCRLIndicator"),d("2.5.29.28","issuingDistributionPoint"),d("2.5.29.29","certificateIssuer"),d("2.5.29.30","nameConstraints"),t("2.5.29.31","cRLDistributionPoints"),t("2.5.29.32","certificatePolicies"),d("2.5.29.33","policyMappings"),d("2.5.29.34","policyConstraints"),t("2.5.29.35","authorityKeyIdentifier"),d("2.5.29.36","policyConstraints"),t("2.5.29.37","extKeyUsage"),d("2.5.29.46","freshestCRL"),d("2.5.29.54","inhibitAnyPolicy"),t("1.3.6.1.4.1.11129.2.4.2","timestampList"),t("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),t("1.3.6.1.5.5.7.3.1","serverAuth"),t("1.3.6.1.5.5.7.3.2","clientAuth"),t("1.3.6.1.5.5.7.3.3","codeSigning"),t("1.3.6.1.5.5.7.3.4","emailProtection"),t("1.3.6.1.5.5.7.3.8","timeStamping"),mr.exports}var _a;function ft(){if(_a)return yr.exports;_a=1;var a=me();Ee(),mt();var e=yr.exports=a.asn1=a.asn1||{};e.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},e.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},e.maxDepth=256,e.create=function(u,r,c,l,b){if(a.util.isArray(l)){for(var T=[],E=0;E<l.length;++E)l[E]!==void 0&&T.push(l[E]);l=T}var s={tagClass:u,type:r,constructed:c,composed:c||a.util.isArray(l),value:l};return b&&"bitStringContents"in b&&(s.bitStringContents=b.bitStringContents,s.original=e.copy(s)),s},e.copy=function(u,r){var c;if(a.util.isArray(u)){c=[];for(var l=0;l<u.length;++l)c.push(e.copy(u[l],r));return c}return typeof u=="string"?u:(c={tagClass:u.tagClass,type:u.type,constructed:u.constructed,composed:u.composed,value:e.copy(u.value,r)},r&&!r.excludeBitStringContents&&(c.bitStringContents=u.bitStringContents),c)},e.equals=function(u,r,c){if(a.util.isArray(u)){if(!a.util.isArray(r)||u.length!==r.length)return!1;for(var l=0;l<u.length;++l)if(!e.equals(u[l],r[l]))return!1;return!0}if(typeof u!=typeof r)return!1;if(typeof u=="string")return u===r;var b=u.tagClass===r.tagClass&&u.type===r.type&&u.constructed===r.constructed&&u.composed===r.composed&&e.equals(u.value,r.value);return c&&c.includeBitStringContents&&(b=b&&u.bitStringContents===r.bitStringContents),b},e.getBerValueLength=function(u){var r=u.getByte();if(r!==128){var c,l=r&128;return l?c=u.getInt((r&127)<<3):c=r,c}};function t(u,r,c){if(c>r){var l=new Error("Too few bytes to parse DER.");throw l.available=u.length(),l.remaining=r,l.requested=c,l}}var d=function(u,r){var c=u.getByte();if(r--,c!==128){var l,b=c&128;if(!b)l=c;else{var T=c&127;t(u,r,T),l=u.getInt(T<<3)}if(l<0)throw new Error("Negative length: "+l);return l}};e.fromDer=function(u,r){r===void 0&&(r={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof r=="boolean"&&(r={strict:r,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in r||(r.strict=!0),"parseAllBytes"in r||(r.parseAllBytes=!0),"decodeBitStrings"in r||(r.decodeBitStrings=!0),"maxDepth"in r||(r.maxDepth=e.maxDepth),typeof u=="string"&&(u=a.util.createBuffer(u));var c=u.length(),l=x(u,u.length(),0,r);if(r.parseAllBytes&&u.length()!==0){var b=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw b.byteCount=c,b.remaining=u.length(),b}return l};function x(u,r,c,l){if(c>=l.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var b;t(u,r,2);var T=u.getByte();r--;var E=T&192,s=T&31;b=u.length();var v=d(u,r);if(r-=b-u.length(),v!==void 0&&v>r){if(l.strict){var h=new Error("Too few bytes to read ASN.1 value.");throw h.available=u.length(),h.remaining=r,h.requested=v,h}v=r}var y,n,p=(T&32)===32;if(p)if(y=[],v===void 0)for(;;){if(t(u,r,2),u.bytes(2)==="\0\0"){u.getBytes(2),r-=2;break}b=u.length(),y.push(x(u,r,c+1,l)),r-=b-u.length()}else for(;v>0;)b=u.length(),y.push(x(u,v,c+1,l)),r-=b-u.length(),v-=b-u.length();if(y===void 0&&E===e.Class.UNIVERSAL&&s===e.Type.BITSTRING&&(n=u.bytes(v)),y===void 0&&l.decodeBitStrings&&E===e.Class.UNIVERSAL&&s===e.Type.BITSTRING&&v>1){var m=u.read,_=r,w=0;if(s===e.Type.BITSTRING&&(t(u,r,1),w=u.getByte(),r--),w===0)try{b=u.length();var C={strict:!0,decodeBitStrings:!0},o=x(u,r,c+1,C),i=b-u.length();r-=i,s==e.Type.BITSTRING&&i++;var B=o.tagClass;i===v&&(B===e.Class.UNIVERSAL||B===e.Class.CONTEXT_SPECIFIC)&&(y=[o])}catch{}y===void 0&&(u.read=m,r=_)}if(y===void 0){if(v===void 0){if(l.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");v=r}if(s===e.Type.BMPSTRING)for(y="";v>0;v-=2)t(u,r,2),y+=String.fromCharCode(u.getInt16()),r-=2;else y=u.getBytes(v),r-=v}var N=n===void 0?null:{bitStringContents:n};return e.create(E,s,p,y,N)}e.toDer=function(u){var r=a.util.createBuffer(),c=u.tagClass|u.type,l=a.util.createBuffer(),b=!1;if("bitStringContents"in u&&(b=!0,u.original&&(b=e.equals(u,u.original))),b)l.putBytes(u.bitStringContents);else if(u.composed){u.constructed?c|=32:l.putByte(0);for(var T=0;T<u.value.length;++T)u.value[T]!==void 0&&l.putBuffer(e.toDer(u.value[T]))}else if(u.type===e.Type.BMPSTRING)for(var T=0;T<u.value.length;++T)l.putInt16(u.value.charCodeAt(T));else u.type===e.Type.INTEGER&&u.value.length>1&&(u.value.charCodeAt(0)===0&&(u.value.charCodeAt(1)&128)===0||u.value.charCodeAt(0)===255&&(u.value.charCodeAt(1)&128)===128)?l.putBytes(u.value.substr(1)):l.putBytes(u.value);if(r.putByte(c),l.length()<=127)r.putByte(l.length()&127);else{var E=l.length(),s="";do s+=String.fromCharCode(E&255),E=E>>>8;while(E>0);r.putByte(s.length|128);for(var T=s.length-1;T>=0;--T)r.putByte(s.charCodeAt(T))}return r.putBuffer(l),r},e.oidToDer=function(u){var r=u.split("."),c=a.util.createBuffer();c.putByte(40*parseInt(r[0],10)+parseInt(r[1],10));for(var l,b,T,E,s=2;s<r.length;++s){if(l=!0,b=[],T=parseInt(r[s],10),T>4294967295)throw new Error("OID value too large; max is 32-bits.");do E=T&127,T=T>>>7,l||(E|=128),b.push(E),l=!1;while(T>0);for(var v=b.length-1;v>=0;--v)c.putByte(b[v])}return c},e.derToOid=function(u){var r;typeof u=="string"&&(u=a.util.createBuffer(u));var c=u.getByte();r=Math.floor(c/40)+"."+c%40;for(var l=0;u.length()>0;){if(l>70368744177663)throw new Error("OID value too large; max is 53-bits.");c=u.getByte(),l=l*128,c&128?l+=c&127:(r+="."+(l+c),l=0)}return r},e.utcTimeToDate=function(u){var r=new Date,c=parseInt(u.substr(0,2),10);c=c>=50?1900+c:2e3+c;var l=parseInt(u.substr(2,2),10)-1,b=parseInt(u.substr(4,2),10),T=parseInt(u.substr(6,2),10),E=parseInt(u.substr(8,2),10),s=0;if(u.length>11){var v=u.charAt(10),h=10;v!=="+"&&v!=="-"&&(s=parseInt(u.substr(10,2),10),h+=2)}if(r.setUTCFullYear(c,l,b),r.setUTCHours(T,E,s,0),h&&(v=u.charAt(h),v==="+"||v==="-")){var y=parseInt(u.substr(h+1,2),10),n=parseInt(u.substr(h+4,2),10),p=y*60+n;p*=6e4,v==="+"?r.setTime(+r-p):r.setTime(+r+p)}return r},e.generalizedTimeToDate=function(u){var r=new Date,c=parseInt(u.substr(0,4),10),l=parseInt(u.substr(4,2),10)-1,b=parseInt(u.substr(6,2),10),T=parseInt(u.substr(8,2),10),E=parseInt(u.substr(10,2),10),s=parseInt(u.substr(12,2),10),v=0,h=0,y=!1;u.charAt(u.length-1)==="Z"&&(y=!0);var n=u.length-5,p=u.charAt(n);if(p==="+"||p==="-"){var m=parseInt(u.substr(n+1,2),10),_=parseInt(u.substr(n+4,2),10);h=m*60+_,h*=6e4,p==="+"&&(h*=-1),y=!0}return u.charAt(14)==="."&&(v=parseFloat(u.substr(14),10)*1e3),y?(r.setUTCFullYear(c,l,b),r.setUTCHours(T,E,s,v),r.setTime(+r+h)):(r.setFullYear(c,l,b),r.setHours(T,E,s,v)),r},e.dateToUtcTime=function(u){if(typeof u=="string")return u;var r="",c=[];c.push((""+u.getUTCFullYear()).substr(2)),c.push(""+(u.getUTCMonth()+1)),c.push(""+u.getUTCDate()),c.push(""+u.getUTCHours()),c.push(""+u.getUTCMinutes()),c.push(""+u.getUTCSeconds());for(var l=0;l<c.length;++l)c[l].length<2&&(r+="0"),r+=c[l];return r+="Z",r},e.dateToGeneralizedTime=function(u){if(typeof u=="string")return u;var r="",c=[];c.push(""+u.getUTCFullYear()),c.push(""+(u.getUTCMonth()+1)),c.push(""+u.getUTCDate()),c.push(""+u.getUTCHours()),c.push(""+u.getUTCMinutes()),c.push(""+u.getUTCSeconds());for(var l=0;l<c.length;++l)c[l].length<2&&(r+="0"),r+=c[l];return r+="Z",r},e.integerToDer=function(u){var r=a.util.createBuffer();if(u>=-128&&u<128)return r.putSignedInt(u,8);if(u>=-32768&&u<32768)return r.putSignedInt(u,16);if(u>=-8388608&&u<8388608)return r.putSignedInt(u,24);if(u>=-2147483648&&u<2147483648)return r.putSignedInt(u,32);var c=new Error("Integer too large; max is 32-bits.");throw c.integer=u,c},e.derToInteger=function(u){typeof u=="string"&&(u=a.util.createBuffer(u));var r=u.length()*8;if(r>32)throw new Error("Integer too large; max is 32-bits.");return u.getSignedInt(r)},e.validate=function(u,r,c,l){var b=!1;if((u.tagClass===r.tagClass||typeof r.tagClass>"u")&&(u.type===r.type||typeof r.type>"u"))if(u.constructed===r.constructed||typeof r.constructed>"u"){if(b=!0,r.value&&a.util.isArray(r.value))for(var T=0,E=0;b&&E<r.value.length;++E){var s=r.value[E];b=!!s.optional;var v=u.value[T];if(!v){s.optional||(b=!1,l&&l.push("["+r.name+'] Missing required element. Expected tag class "'+s.tagClass+'", type "'+s.type+'"'));continue}var h=typeof s.tagClass<"u"&&typeof s.type<"u";if(h&&(v.tagClass!==s.tagClass||v.type!==s.type))if(s.optional){b=!0;continue}else{b=!1,l&&l.push("["+r.name+"] Tag mismatch. Expected ("+s.tagClass+","+s.type+"), got ("+v.tagClass+","+v.type+")");break}var y=e.validate(v,s,c,l);if(y)++T,b=!0;else if(s.optional)b=!0;else{b=!1;break}}if(b&&c&&(r.capture&&(c[r.capture]=u.value),r.captureAsn1&&(c[r.captureAsn1]=u),r.captureBitStringContents&&"bitStringContents"in u&&(c[r.captureBitStringContents]=u.bitStringContents),r.captureBitStringValue&&"bitStringContents"in u))if(u.bitStringContents.length<2)c[r.captureBitStringValue]="";else{var n=u.bitStringContents.charCodeAt(0);if(n!==0)throw new Error("captureBitStringValue only supported for zero unused bits");c[r.captureBitStringValue]=u.bitStringContents.slice(1)}}else l&&l.push("["+r.name+'] Expected constructed "'+r.constructed+'", got "'+u.constructed+'"');else l&&(u.tagClass!==r.tagClass&&l.push("["+r.name+'] Expected tag class "'+r.tagClass+'", got "'+u.tagClass+'"'),u.type!==r.type&&l.push("["+r.name+'] Expected type "'+r.type+'", got "'+u.type+'"'));return b};var g=/[^\\u0000-\\u00ff]/;return e.prettyPrint=function(u,r,c){var l="";r=r||0,c=c||2,r>0&&(l+=`
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
Private-Lines: `+s+`\r
|
|
21
21
|
`,b+=h;var w=x("putty-private-key-file-mac-key",u),C=a.util.createBuffer();d(C,c),d(C,l),d(C,r),C.putInt32(T.length()),C.putBuffer(T),C.putInt32(v.length()),C.putBuffer(v);var o=a.hmac.create();return o.start("sha1",w),o.update(C.bytes()),b+=`\r
|
|
22
22
|
Private-MAC: `+o.digest().toHex()+`\r
|
|
23
|
-
`,b},e.publicKeyToOpenSSH=function(g,u){var r="ssh-rsa";u=u||"";var c=a.util.createBuffer();return d(c,r),t(c,g.e),t(c,g.n),r+" "+a.util.encode64(c.bytes())+" "+u},e.privateKeyToOpenSSH=function(g,u){return u?a.pki.encryptRsaPrivateKey(g,u,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(g)},e.getPublicKeyFingerprint=function(g,u){u=u||{};var r=u.md||a.md.md5.create(),c="ssh-rsa",l=a.util.createBuffer();d(l,c),t(l,g.e),t(l,g.n),r.start(),r.update(l.getBytes());var b=r.digest();if(u.encoding==="hex"){var T=b.toHex();return u.delimiter?T.match(/.{2}/g).join(u.delimiter):T}else{if(u.encoding==="binary")return b.getBytes();if(u.encoding)throw new Error('Unknown encoding "'+u.encoding+'".')}return b};function t(g,u){var r=u.toString(16);r[0]>="8"&&(r="00"+r);var c=a.util.hexToBytes(r);g.putInt32(c.length),g.putBytes(c)}function d(g,u){g.putInt32(u.length),g.putString(u)}function x(){for(var g=a.md.sha1.create(),u=arguments.length,r=0;r<u;++r)g.update(arguments[r]);return g.digest()}return $r.exports}var Jr,yn;function Ai(){return yn||(yn=1,Jr=me(),yt(),mi(),ft(),dr(),qt(),xi(),Rt(),Ei(),Si(),bi(),Za(),wr(),xt(),Ka(),tn(),_i(),an(),qa(),Da(),qr(),at(),Oa(),Ti(),sn(),Ee()),Jr}var ea=Ai();const Ii="evtrsa1",ta=new Map;function mn(a){return a.replace(/\/+$/,"")}function wi(a){return new TextEncoder().encode(a)}function Yt(a){let e="";return a.forEach(t=>{e+=String.fromCharCode(t)}),btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}async function Bi(a,e){const t=typeof AbortController<"u"?new AbortController:void 0,d=t?setTimeout(()=>t.abort(),e):void 0;try{const x=await fetch(a,{method:"GET",headers:{Accept:"application/json"},signal:t?.signal}),g=await x.json().catch(()=>({}));if(!x.ok){const u=g?.error?.message??g?.message??`ViewToken public key request failed with status ${x.status}`;throw new Error(u)}return g}finally{d!=null&&clearTimeout(d)}}function ra(a){const e=globalThis.crypto;if(!e?.getRandomValues)throw new Error("[BimEngine] crypto.getRandomValues is required to encrypt viewToken");return e.getRandomValues(new Uint8Array(a))}function ki(a){let e="";return a.forEach(t=>{e+=String.fromCharCode(t)}),e}function Ri(a){const e=new Uint8Array(a.length);for(let t=0;t<a.length;t+=1)e[t]=a.charCodeAt(t)&255;return e}async function Ni(a,e){const t=`${mn(a)}/models/view-token/public-key`,d=await Bi(t,e);if(d.algorithm!=="RSA-OAEP-256"||!d.publicKey)throw new Error("[BimEngine] OpenAPI returned an invalid viewToken public key");return ea.pki.publicKeyFromPem(d.publicKey)}function Li(a,e){const t=mn(a),d=ta.get(t);if(d)return d;const x=Ni(a,e).catch(g=>{throw ta.delete(t),g});return ta.set(t,x),x}async function Di(a,e,t){const d=await Li(a,t),x=ra(32),g=ra(12),u=ra(16),r=JSON.stringify({viewToken:e,timestamp:Date.now(),nonce:Yt(u)}),c=d.encrypt(ki(x),"RSA-OAEP",{md:ea.md.sha256.create(),mgf1:{md:ea.md.sha256.create()}}),l=gi(x,g).encrypt(wi(r));return[Ii,Yt(Ri(c)),Yt(g),Yt(l)].join(".")}function Ui(a){return a.replace(/\/+$/,"")}async function Pi(a,e,t){const d=typeof AbortController<"u"?new AbortController:void 0,x=d?setTimeout(()=>d.abort(),t):void 0;try{const g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:d?.signal}),u=await g.json().catch(()=>({}));if(!g.ok){const r=u?.error?.message??u?.message??`ViewToken resolve failed with status ${g.status}`;throw new Error(r)}return u}finally{x!=null&&clearTimeout(x)}}function Oi(a){switch(a){case"2d":return"cad_model";case"720":return"panorama";case"gis":return"gis_scene";case"gaussian":return"gaussian_model";case"3d":default:return"model"}}function Fi(a){return{models:[{modelType:a.toLowerCase().endsWith(".json")?"3dtiles":"glb",url:a}]}}function Vi(a,e){return{applicationId:0,engineType:e,assetCategory:Oi(e),url:a,urls:[a],info:e==="gis"?Fi(a):void 0}}async function Mi(a,e,t){const d=a?.sdkAuth;if(!d?.endpoint)return Vi(e,t);let x;(d.token||d.appId&&d.appKey&&d.appSecret)&&(x=(await jn(a,t))?.sdkToken);const u={viewToken:await Di(d.endpoint,e,d.timeoutMs??8e3),engineType:t};return x&&(u.sdkToken=x),Pi(`${Ui(d.endpoint)}/models/view-token/resolve`,u,d.timeoutMs??8e3)}class Cn{eventModule;sceneModule;cameraModule;renderModule;controlModule;loaderModule;isInitialized=!1;options;version=_t;constructor(e){this.options=e,this.initialize(e)}initialize(e){const t={containerId:e.containerId,cameraUp:e.cameraUp??[0,1,0],initialCameraPosition:e.initialCameraPosition??[0,0,6],initialCameraLookAt:e.initialCameraLookAt??[0,0,0],backgroundColor:e.backgroundColor,antialias:e.antialias??!1,showLoadingUI
|
|
23
|
+
`,b},e.publicKeyToOpenSSH=function(g,u){var r="ssh-rsa";u=u||"";var c=a.util.createBuffer();return d(c,r),t(c,g.e),t(c,g.n),r+" "+a.util.encode64(c.bytes())+" "+u},e.privateKeyToOpenSSH=function(g,u){return u?a.pki.encryptRsaPrivateKey(g,u,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(g)},e.getPublicKeyFingerprint=function(g,u){u=u||{};var r=u.md||a.md.md5.create(),c="ssh-rsa",l=a.util.createBuffer();d(l,c),t(l,g.e),t(l,g.n),r.start(),r.update(l.getBytes());var b=r.digest();if(u.encoding==="hex"){var T=b.toHex();return u.delimiter?T.match(/.{2}/g).join(u.delimiter):T}else{if(u.encoding==="binary")return b.getBytes();if(u.encoding)throw new Error('Unknown encoding "'+u.encoding+'".')}return b};function t(g,u){var r=u.toString(16);r[0]>="8"&&(r="00"+r);var c=a.util.hexToBytes(r);g.putInt32(c.length),g.putBytes(c)}function d(g,u){g.putInt32(u.length),g.putString(u)}function x(){for(var g=a.md.sha1.create(),u=arguments.length,r=0;r<u;++r)g.update(arguments[r]);return g.digest()}return $r.exports}var Jr,yn;function Ai(){return yn||(yn=1,Jr=me(),yt(),mi(),ft(),dr(),qt(),xi(),Rt(),Ei(),Si(),bi(),Za(),wr(),xt(),Ka(),tn(),_i(),an(),qa(),Da(),qr(),at(),Oa(),Ti(),sn(),Ee()),Jr}var ea=Ai();const Ii="evtrsa1",ta=new Map;function mn(a){return a.replace(/\/+$/,"")}function wi(a){return new TextEncoder().encode(a)}function Yt(a){let e="";return a.forEach(t=>{e+=String.fromCharCode(t)}),btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}async function Bi(a,e){const t=typeof AbortController<"u"?new AbortController:void 0,d=t?setTimeout(()=>t.abort(),e):void 0;try{const x=await fetch(a,{method:"GET",headers:{Accept:"application/json"},signal:t?.signal}),g=await x.json().catch(()=>({}));if(!x.ok){const u=g?.error?.message??g?.message??`ViewToken public key request failed with status ${x.status}`;throw new Error(u)}return g}finally{d!=null&&clearTimeout(d)}}function ra(a){const e=globalThis.crypto;if(!e?.getRandomValues)throw new Error("[BimEngine] crypto.getRandomValues is required to encrypt viewToken");return e.getRandomValues(new Uint8Array(a))}function ki(a){let e="";return a.forEach(t=>{e+=String.fromCharCode(t)}),e}function Ri(a){const e=new Uint8Array(a.length);for(let t=0;t<a.length;t+=1)e[t]=a.charCodeAt(t)&255;return e}async function Ni(a,e){const t=`${mn(a)}/models/view-token/public-key`,d=await Bi(t,e);if(d.algorithm!=="RSA-OAEP-256"||!d.publicKey)throw new Error("[BimEngine] OpenAPI returned an invalid viewToken public key");return ea.pki.publicKeyFromPem(d.publicKey)}function Li(a,e){const t=mn(a),d=ta.get(t);if(d)return d;const x=Ni(a,e).catch(g=>{throw ta.delete(t),g});return ta.set(t,x),x}async function Di(a,e,t){const d=await Li(a,t),x=ra(32),g=ra(12),u=ra(16),r=JSON.stringify({viewToken:e,timestamp:Date.now(),nonce:Yt(u)}),c=d.encrypt(ki(x),"RSA-OAEP",{md:ea.md.sha256.create(),mgf1:{md:ea.md.sha256.create()}}),l=gi(x,g).encrypt(wi(r));return[Ii,Yt(Ri(c)),Yt(g),Yt(l)].join(".")}function Ui(a){return a.replace(/\/+$/,"")}async function Pi(a,e,t){const d=typeof AbortController<"u"?new AbortController:void 0,x=d?setTimeout(()=>d.abort(),t):void 0;try{const g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:d?.signal}),u=await g.json().catch(()=>({}));if(!g.ok){const r=u?.error?.message??u?.message??`ViewToken resolve failed with status ${g.status}`;throw new Error(r)}return u}finally{x!=null&&clearTimeout(x)}}function Oi(a){switch(a){case"2d":return"cad_model";case"720":return"panorama";case"gis":return"gis_scene";case"gaussian":return"gaussian_model";case"3d":default:return"model"}}function Fi(a){return{models:[{modelType:a.toLowerCase().endsWith(".json")?"3dtiles":"glb",url:a}]}}function Vi(a,e){return{applicationId:0,engineType:e,assetCategory:Oi(e),url:a,urls:[a],info:e==="gis"?Fi(a):void 0}}async function Mi(a,e,t){const d=a?.sdkAuth;if(!d?.endpoint)return Vi(e,t);let x;(d.token||d.appId&&d.appKey&&d.appSecret)&&(x=(await jn(a,t))?.sdkToken);const u={viewToken:await Di(d.endpoint,e,d.timeoutMs??8e3),engineType:t};return x&&(u.sdkToken=x),Pi(`${Ui(d.endpoint)}/models/view-token/resolve`,u,d.timeoutMs??8e3)}class Cn{eventModule;sceneModule;cameraModule;renderModule;controlModule;loaderModule;isInitialized=!1;options;version=_t;constructor(e){this.options=e,this.initialize(e)}initialize(e){const t={containerId:e.containerId,cameraUp:e.cameraUp??[0,1,0],initialCameraPosition:e.initialCameraPosition??[0,0,6],initialCameraLookAt:e.initialCameraLookAt??[0,0,0],backgroundColor:e.backgroundColor,antialias:e.antialias??!1,showLoadingUI:!1,sharedMemoryForWorkers:e.sharedMemoryForWorkers??!1,gpuAcceleratedSort:e.gpuAcceleratedSort??!1,sphericalHarmonicsDegree:e.sphericalHarmonicsDegree??0,orientationPreset:e.orientationPreset??"x180",viewerOptions:e.viewerOptions},d=document.getElementById(t.containerId);if(!d)throw new Error(`Container with id "${t.containerId}" not found`);this.eventModule=new En,this.sceneModule=new Sn(t.backgroundColor),this.cameraModule=new bn(d,t.cameraUp,t.initialCameraPosition,t.initialCameraLookAt),this.controlModule=new Nn(t.orientationPreset),this.renderModule=new kn(d,this.sceneModule.getScene(),this.cameraModule.getCamera(),t),this.loaderModule=new Fn(this.renderModule.getViewer(),()=>this.controlModule.getOrientationRotation()),this.renderModule.setOnBeforeRender(()=>{this.controlModule.update()}),this.renderModule.setOnFpsUpdated(x=>{this.eventModule.trigger(Je.FpsUpdated,x)}),this.renderModule.startRenderLoop(),this.isInitialized=!0}async loadModel(e,t={}){this.checkInitialized(),this.eventModule.trigger(Je.LoadStart,{url:e,name:t.name});try{const d=await this.loaderModule.loadModel(e,{...t,showLoadingUI:!1,onProgress:(x,g,u)=>{this.eventModule.trigger(Je.LoadProgress,{url:e,name:t.name,progress:x}),t.onProgress?.(x,g,u)}});return this.eventModule.trigger(Je.Loaded,{url:e,name:d.name,progress:100}),d}catch(d){throw this.eventModule.trigger(Je.LoadError,{url:e,name:t.name,error:d instanceof Error?d:new Error(String(d))}),d}}async loadModelFile(e,t={}){this.checkInitialized();const d=e[0]?.name??"local-file";this.eventModule.trigger(Je.LoadStart,{url:d,name:t.name??d});try{const x=await this.loaderModule.loadModelFile(e,{...t,showLoadingUI:!1,onProgress:(g,u,r)=>{this.eventModule.trigger(Je.LoadProgress,{url:d,name:t.name??d,progress:g}),t.onProgress?.(g,u,r)}});return this.eventModule.trigger(Je.Loaded,{url:d,name:x.name,progress:100}),x}catch(x){throw this.eventModule.trigger(Je.LoadError,{url:d,name:t.name??d,error:x instanceof Error?x:new Error(String(x))}),x}}async loadModelByViewToken(e,t={}){const d=await Mi(this.options,e,"gaussian");if(d.assetCategory==="composite_model"&&d.urls.length>1)throw new Error("EngineKernelGaussian: composite_model viewToken is not supported");return this.loadModel(d.url,t)}async unloadModel(e){this.checkInitialized(),await this.loaderModule.unloadModel(e,!1),this.eventModule.trigger(Je.SceneRemoved,{id:e})}setOrientationPreset(e){this.checkInitialized(),this.controlModule.setOrientationPreset(e)}getOrientationPreset(){return this.checkInitialized(),this.controlModule.getOrientationPreset()}resize(e,t){this.checkInitialized();const d=this.renderModule.getDomElement(),x=e??d.parentElement?.clientWidth??d.clientWidth,g=t??d.parentElement?.clientHeight??d.clientHeight;this.renderModule.resize(x,g),this.cameraModule.updateAspectRatio(x,g)}pauseRendering(){this.checkInitialized(),this.renderModule.pauseRendering()}resumeRendering(){this.checkInitialized(),this.renderModule.resumeRendering()}resetFpsStats(){this.checkInitialized(),this.renderModule.resetFpsStats()}getFpsInfo(){return this.checkInitialized(),this.renderModule.getFpsInfo()}on(e,t){this.checkInitialized(),this.eventModule.on(e,t)}off(e,t){this.checkInitialized(),this.eventModule.off(e,t)}getVersion(){return this.version}async dispose(){this.isInitialized&&(await this.loaderModule.clear(!1),await this.renderModule.dispose(),this.controlModule.dispose(),this.cameraModule.dispose(),this.sceneModule.dispose(),this.eventModule.dispose(),this.isInitialized=!1)}checkInitialized(){if(!this.isInitialized)throw new Error("EngineKernelGaussian: Not initialized")}}function Ki(a){return new Cn(a)}rt.GaussianSplats3D=ia,rt.EngineKernelGaussian=Cn,rt.EventTypeGaussian=Je,rt.createEngineGaussian=Ki,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})}));
|