@zip.js/zip.js 2.8.54 → 2.8.55
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/deno.json +1 -1
- package/dist/zip-core-external.js +50 -13
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +50 -12
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +51 -18
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +50 -17
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +51 -18
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +53 -19
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +53 -19
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +52 -14
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +52 -14
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +52 -14
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +53 -19
- package/index-native.min.js +1 -1
- package/index.cjs +53 -19
- package/index.d.cts +24 -7
- package/index.d.ts +24 -7
- package/index.min.js +1 -1
- package/lib/core/constants.js +2 -0
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-fs.js +1 -5
- package/lib/core/zip-reader.js +42 -12
- package/lib/core/zip-writer.js +8 -0
- package/lib/core/zlib-streams-inline.js +1 -1
- package/lib/zip-core-writer.js +1 -0
- package/package.json +1 -1
package/dist/zip-fs-core.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})})(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:s,BigInt:i,Math:a,Date:o,Map:c,Set:d,Response:u,URL:l,Error:w,Uint8Array:f,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:g,TextEncoder:x,TextDecoder:S,document:b,crypto:z,btoa:F,TransformStream:E,ReadableStream:D,WritableStream:R,CompressionStream:A,DecompressionStream:v,navigator:C,Worker:k,Symbol:T,setTimeout:U,clearTimeout:I,structuredClone:O}="undefined"!=typeof globalThis?globalThis:this||self,M=4294967295,N=65535,_=255,L=67324752,P=134695760,W=P,B=84233040,V=33639248,Z=101010256,H=101075792,q=117853008,j=22,K=20,Y=56,G=39169,X=21589,J=6534,Q=30837,$=30805,tt=2048,et=61440,nt=16384,rt=2048,st=1024,it="/",at=30,ot=new o(2107,11,31,23,59,58),ct=new o(1980,0,1),dt=void 0,ut=1/0,lt="undefined",wt="function",ft="object",pt="string",ht=new f,mt="password",yt="rawPassword",gt="passThrough",xt="signal",St="useWebWorkers",bt="useCompressionStream",zt="transferStreams",Ft="preventClose",Et="offset",Dt="usdz",Rt="signCentralDirectory",At="filename",vt="comment",Ct="strict",kt="balanced",Tt="tolerant";function Ut(t){if(t&&typeof t!=wt)throw new w("Invalid option (must be a function)");return t}function It(t){if(t&&(typeof t.addEventListener!=wt||"boolean"!=typeof t.aborted))throw new w("Invalid signal (must be an AbortSignal instance)");return t||dt}function Ot(t,e){if(t&&typeof t!=pt||e&&!(e instanceof f))throw new w("Invalid password (password must be a string, rawPassword must be a Uint8Array)")}function Mt(t){return typeof t==pt&&t.trim()?s(t):t}let Nt=2;try{typeof C!=lt&&C.hardwareConcurrency&&(Nt=C.hardwareConcurrency)}catch{}const _t={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:Nt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=lt&&A,DecompressionStream:typeof v!=lt&&v};function Lt(){return _t}function Pt(t){return Wt(t.chunkSize)}function Wt(t){return t=Mt(t),s.isInteger(t)&&t>=1?a.max(t,64):65536}function Bt(t,e){const n=new f(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Vt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new f(t):t}function Zt(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function Ht(t){if(t instanceof D)return t;const e=t.getReader();return new D({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function qt(t,e){t=Ht(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=wt||new y([]).stream()instanceof D)return new u(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new R({write(t){r.push(t)}})).then(()=>new y(r,n))}function jt(t){if(t instanceof R)return t;const e=t.getWriter();return new R({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const Kt="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function Yt(t,e){return Gt(t,e,!0)}function Gt(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let n=0;n<t.length;n++)e+=Kt[t[n]];return e}})(t):new S(e,{ignoreBOM:n}).decode(t)}const Xt="HTTP error ",Jt="HTTP Range not supported",Qt="HTTP resource changed",$t="Content-Range",te="Range",ee="GET",ne="bytes",re=16777216,se="writable",ie=T();class ae{constructor(){this.size=0}init(){this.initialized=!0}}class oe extends ae{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=Pt(Lt())}={}){const r=this;let s=0;return n=Wt(n),new D({async pull(i){const o=e===dt?n:a.min(n,e-s),c=await qe(r,t+s,o);c.length&&i.enqueue(c),s+n>=e||!c.length&&o?i.close():s+=n}})}}class ce extends ae{constructor(){super();const t=this,e=new R({write(e){if(!t.initialized)throw new w("Writer not initialized");return t.writeUint8Array(Vt(e))}});n.defineProperty(t,se,{get:()=>e})}writeUint8Array(){}}class de extends oe{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{o:t,l:r,size:a.floor(.75*(e-r))})}readUint8Array(t,e){const{l:n,o:r}=this,s=new f(e),i=4*a.floor(t/3),o=atob(r.substring(i+n,4*a.ceil((t+e)/3)+n)),c=t-3*a.floor(i/4);let d=0;for(let t=c;c+e>t&&t<o.length;t++)s[t-c]=o.charCodeAt(t),d++;return d<s.length?s.subarray(0,d):s}}class ue extends ce{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",h:""})}writeUint8Array(t){const e=this;let n,s=e.h;const i=e.h.length;for(e.h="",n=0;n<3*a.floor((i+t.length)/3)-i;n++)s+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.h+=r.fromCharCode(t[n]);s.length>2?e.data+=F(s):e.h=s+e.h}getData(){return this.data+F(this.h)}}let le,we;class fe extends oe{constructor(t){super(),n.assign(this,{m:t,size:t.size}),we||(we=(async()=>{try{const t=new y([new f(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();le=1==e}catch{le=!1}})())}createReadable(t){const{m:e,size:n}=this,{offset:r=0,size:s=n-r}=t||{};return r||n>s?le?Ht(e.slice(r,r+s).stream()):super.createReadable(t):Ht(e.stream())}async readUint8Array(t,e){const n=this,r=t+e,s=t||r<n.size?n.m.slice(t,r):n.m;let i=await s.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new f(i)}}class pe extends ae{constructor(t){super();const e=this,r=new E;n.defineProperty(e,se,{get:()=>r.writable}),e.contentType=t,e.S=qt(r.readable,t),e.S.catch(()=>{})}getData(){return this.S}}class he extends fe{constructor(t){super(new y([t],{type:"text/plain"}))}}function me(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);128>r?e+=1:2048>r?e+=2:55296>r||r>=57344?e+=3:56320>r&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class ye extends pe{constructor(t){super(),n.assign(this,{encoding:t,F:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,F:e}=this,n=await super.getData();return n.text&&e?n.text():((t,e)=>Gt(t,e,!1))(new f(await n.arrayBuffer()),t)}}class ge extends oe{constructor(t,e){super(),Se(this,t,e)}async init(){await be(this,Ie,Ce),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&i>n)return((t,e,n)=>{let r,i=e,o=0,c=n;return new D({start:()=>d(),async pull(t){r||await d();const{value:e,done:n}=await r.read();if(n)throw new w(Jt);const s=e.length>o?e.subarray(0,o):e;o-=s.length,c-=s.length,s.length&&t.enqueue(s),o||(await(async()=>{const t=r;r=dt,await t.cancel()})(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function d(){const e=a.min(t.maximumRangeSize,c),n=await Ie(ee,t,Ae(t,i,e));if(206!=n.status)throw new w(Jt);const d=n.headers.get($t);if(d){const t=s(d.trim().split(/[\s-]+/)[1]);if(!s.isNaN(t)&&t!=i)throw new w(Jt)}Re(t,n),De(t,n),i+=e,o=e,r=n.body.getReader()}})(e,n,a.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return ze(this,t,e,Ie,Ce)}}class xe extends oe{constructor(t,e){super(),Se(this,t,e)}async init(){await be(this,Oe,ke),super.init()}readUint8Array(t,e){return ze(this,t,e,Oe,ke)}}function Se(t,e,r){const{preventHeadRequest:s,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o,checkResourceChanges:c=!0,maximumRangeSize:d=re,fetch:u}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:s,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o,checkResourceChanges:c,maximumRangeSize:d,fetch:u})}async function be(t,e,n){const{url:r,preventHeadRequest:s,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=Lt(),{protocol:n}=new l(t,e);return"http:"==n||"https:"==n})(r)&&(i||a)&&(typeof s==lt||s)){const r=await e(ee,t,Ae(t,o?-22:void 0)),s=r.headers.get("Accept-Ranges");if(!(a||s&&s.toLowerCase()==ne))throw new w(Jt);{if(o){const e=new f(await r.arrayBuffer());206==r.status&&e.length==j&&(t.D=e)}De(t,r);const s=Fe(r);s===dt?await Ue(t,e,n):t.size=s}}else await Ue(t,e,n)}async function ze(t,e,n,r,i){const{useRangeHeader:a,forceRangeRequests:o,D:c,size:d,options:u}=t;if(a||o){if(c&&e==d-j&&n==j)return c;if(d>e&&0!==n){e+n>d&&(n=d-e);const i=await r(ee,t,Ae(t,e,n));if(206!=i.status)throw new w(Jt);const a=i.headers.get($t);if(a){const t=s(a.trim().split(/[\s-]+/)[1]);if(!s.isNaN(t)&&t!=e)throw new w(Jt)}Re(t,i),De(t,i);const o=new f(await i.arrayBuffer());if(o.length!=n)throw new w(Jt);return o}return ht}{const{data:r}=t;return r||await i(t,u),t.data.subarray(e,e+n)}}function Fe(t){const e=t.headers.get($t);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=s(t);if(!s.isNaN(e))return e}}}function Ee({headers:t}){return{R:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function De(t,e){const{checkResourceChanges:n,A:r}=t;n&&!r&&206==e.status&&(t.A=Ee(e))}function Re(t,e){const{checkResourceChanges:r,A:s,size:i}=t;if(r){const t=Fe(e);if(t!==dt&&i!==dt&&t!=i)throw new w(Qt);if(s){const t=Ee(e);if(n.entries(s).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new w(Qt)}}}function Ae(t,e=0,r=1){return n.assign({},ve(t),{[te]:ne+"="+(0>e?e:e+"-"+(e+r-1))})}function ve({options:t}){const{headers:e}=t;if(e)return T.iterator in e?n.fromEntries(e):e}async function Ce(t){await Te(t,Ie)}async function ke(t){await Te(t,Oe)}async function Te(t,e){const n=await e(ee,t,ve(t));t.data=new f(await n.arrayBuffer()),t.size=t.data.length}async function Ue(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,ve(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=s(i):await n(t,t.options)}}async function Ie(t,{fetch:e=fetch,options:r,url:s},i){const a=await e(s,n.assign({},r,{method:t,headers:i}));if(400>a.status)return a;throw 416==a.status?new w(Jt):new w(Xt+(a.statusText||a.status))}function Oe(t,{url:e},r){return new g((s,i)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(400>a.status){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),s({status:a.status,arrayBuffer:()=>a.response,headers:new c(t)})}else i(416==a.status?new w(Jt):new w(Xt+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>i(t.detail?t.detail.error:new w("Network error")),!1),a.open(t,e),r)for(const t of n.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class Me extends oe{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new xe(t,e):new ge(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(t){return this.reader.createReadable(t)}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Ne extends oe{constructor(t){super(),t=new f(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{v:t,size:t.length})}readUint8Array(t,e){return this.v.slice(t,t+e)}}class _e extends ce{constructor(t){super(),this.C=t||262144}init(t=0){n.assign(this,{offset:0,v:new f(t>0?t:this.C)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.v.length){let t=e.v.length?2*e.v.length:e.C;for(;n>t;)t*=2;const r=e.v;e.v=new f(t),e.v.set(r)}e.v.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.v.length?this.v:this.v.slice(0,this.offset)}}class Le extends oe{constructor(t){super(),this.T=t}async init(){const t=this;t.U=0;const e=t.T=await g.all(t.T.map(He));t.I=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}O(t){const{I:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{T:r}=this;let s,i=0,o=t;for(;r[i]&&o>=r[i].size;)o-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(o+e>r){const i=r-o;s=Bt(await qe(c,o,i),await n.readUint8Array(t+i,e-i))}else s=await qe(c,o,e)}else s=ht;return n.U=a.max(i,n.U),s}}class Pe extends ae{constructor(t,e=4294967295){super();const r=this;let s,i,a;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const o=new R({async write(e){if(e===ie)return void(a&&await d());const{availableSize:n}=r;if(a)e.length<n?await c(e):(await c(e.subarray(0,n)),await d(),e.length>n&&await this.write(e.subarray(n)));else{const{value:n,done:o}=await t.next();if(o&&!n)throw new w("Writer iterator completed too soon");s=n,s.size=0,s.maxSize&&(r.maxSize=s.maxSize),r.availableSize=r.maxSize,await Ze(s),i=n.writable,a=i.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function c(t){const e=t.length;e&&(await a.ready,await a.write(t),s.size+=e,r.availableSize-=e)}async function d(){await u(),r.diskOffset+=s.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}n.defineProperty(r,se,{get:()=>o})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(ie)}finally{t.releaseLock()}}}class We{constructor(t){return e.isArray(t)&&(t=new Le(t)),(t instanceof D||typeof t.getReader==wt)&&(t={readable:Ht(t)}),t}}class Be{constructor(t){return t.writable===dt&&typeof t.next==wt&&(t=new Pe(t)),(t instanceof R||typeof t.getWriter==wt)&&(t={writable:jt(t)}),t.size===dt&&(t.size=0),t}}function Ve(t){return!(!t||!t.getData)}async function Ze(t,e){if(!t.init||t.initialized)return g.resolve();await t.init(e)}async function He(t){return t=new We(t),await Ze(t),t.size!==dt&&t.readUint8Array||(t=new fe(await qt(t.readable)),await Ze(t)),t}function qe(t,e,n){return t.readUint8Array(e,n)}function je(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?oe.prototype.createReadable.call(t,e):t.readable}const Ke=new c,Ye=new c;function Ge(t){return Ke.get(t)}function Xe(t){return Ye.get(t)}const Je=[[],[],[],[],[],[],[],[]];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?e>>>1^3988292384:e>>>1;Je[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const n=Je[e-1][t];Je[e][t]=n>>>8^Je[0][255&n]}const[Qe,$e,tn,en,nn,rn,sn,an]=Je;class on{constructor(t){this.M=t||-1}append(t){let e=0|this.M;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const s=new m(t.buffer,t.byteOffset,n),i=n-8;for(;i>=r;r+=8){const t=e^s.getInt32(r,!0),n=s.getInt32(r+4,!0);e=an[255&t]^sn[t>>>8&255]^rn[t>>>16&255]^nn[t>>>24&255]^en[255&n]^tn[n>>>8&255]^$e[n>>>16&255]^Qe[n>>>24&255]}}for(;n>r;r++)e=e>>>8^Qe[255&(e^t[r])];this.M=e}get(){return~this.M}}class cn extends E{constructor(){let t;const e=new on;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new f(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function dn(t){if(typeof x==lt){const e=new f((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new x).encode(t)}const un={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=un.N(n);return 32===r?t.concat(e):un._(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+un.N(n)},L(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,a.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=un.P(e,t[n-1]&2147483648>>e-1,1)),t},P:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,N:t=>a.round(t/1099511627776)||32,_(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let s=0;s<t.length;s++)r.push(n|t[s]>>>e),n=t[s]<<32-e;const s=t.length?t[t.length-1]:0,i=un.N(s);return r.push(un.P(e+i&31,e+i>32?n:r.pop(),1)),r}},ln={bytes:{W(t){const e=un.bitLength(t)/8,n=new f(e);let r;for(let s=0;e>s;s++)3&s||(r=t[s/4]),n[s]=r>>>24,r<<=8;return n},B(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(un.P(8*(3&n),r)),e}}},wn=class{constructor(t){const e=this;e.blockSize=512,e.V=[1732584193,4023233417,2562383102,271733878,3285377520],e.Z=[1518500249,1859775393,2400959708,3395469782],t?(e.H=t.H.slice(0),e.j=t.j.slice(0),e.K=t.K):e.reset()}reset(){const t=this;return t.H=t.V.slice(0),t.j=[],t.K=0,t}update(t){const e=this;"string"==typeof t&&(t=ln.Y.B(t));const n=e.j=un.concat(e.j,t),r=e.K,s=e.K=r+un.bitLength(t);if(s>9007199254740991)throw new w("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let a=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);s>=t;t+=e.blockSize)e.G(i.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),e}X(){const t=this;let e=t.j;const n=t.H;e=un.concat(e,[un.P(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(a.floor(t.K/4294967296)),e.push(0|t.K);e.length;)t.G(e.splice(0,16));return t.reset(),n}J(t,e,n,r){return t>19?t>39?t>59?t>79?void 0:e^n^r:e&n|e&r|n&r:e^n^r:e&n|~e&r}$(t,e){return e<<t|e>>>32-t}G(t){const n=this,r=n.H,s=e(80);for(let e=0;16>e;e++)s[e]=t[e];let i=r[0],o=r[1],c=r[2],d=r[3],u=r[4];for(let t=0;79>=t;t++){16>t||(s[t]=n.$(1,s[t-3]^s[t-8]^s[t-14]^s[t-16]));const e=n.$(5,i)+n.J(t,o,c,d)+u+s[t]+n.Z[a.floor(t/20)]|0;u=d,d=c,c=n.$(30,o),o=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+c|0,r[3]=r[3]+d|0,r[4]=r[4]+u|0}},fn={importKey:t=>new fn.et(ln.bytes.B(t)),nt(t,e,n,r){if(n=n||1e4,0>r||0>n)throw new w("invalid params to pbkdf2");const s=1+(r>>5)<<2;let i,a,o,c,d;const u=new ArrayBuffer(s),l=new m(u);let f=0;const p=un;for(e=ln.bytes.B(e),d=1;(s||1)>f;d++){for(i=a=t.encrypt(p.concat(e,[d])),o=1;n>o;o++)for(a=t.encrypt(a),c=0;c<a.length;c++)i[c]^=a[c];for(o=0;(s||1)>f&&o<i.length;o++)l.setInt32(f,i[o]),f+=4}return u.slice(0,r/8)},et:class{constructor(t){const e=this,n=e.st=wn,r=[[],[]];e.it=[new n,new n];const s=e.it[0].blockSize/32;t.length>s&&(t=(new n).update(t).X());for(let e=0;s>e;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.it[0].update(r[0]),e.it[1].update(r[1]),e.ot=new n(e.it[0])}reset(){const t=this;t.ot=new t.st(t.it[0]),t.ct=!1}update(t){this.ct=!0,this.ot.update(t)}digest(){const t=this,e=t.ot.X(),n=new t.st(t.it[1]).update(e).X();return t.reset(),n}encrypt(t){if(this.ct)throw new w("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},pn=typeof z!=lt&&typeof z.getRandomValues==wt,hn="Invalid password",mn="Invalid signature",yn=mn,gn="zipjs-abort-check-password";function xn(t){if(pn)return z.getRandomValues(t);throw new w("Crypto API not supported")}const Sn=16,bn={name:"PBKDF2"},zn=n.assign({hash:{name:"HMAC"}},bn),Fn=n.assign({iterations:1e3,hash:{name:"SHA-1"}},bn),En=["deriveBits"],Dn=[8,12,16],Rn=[16,24,32],An=10,vn=[0,0,0,0],Cn=typeof z!=lt,kn=Cn&&z.subtle,Tn=Cn&&typeof kn!=lt,Un=ln.bytes,In=class{constructor(t){const e=this;e.ut=[[[],[],[],[],[]],[[],[],[],[],[]]],e.ut[0][0][0]||e.lt();const n=e.ut[0][4],r=e.ut[1],s=t.length;let i,a,o,c=1;if(4!==s&&6!==s&&8!==s)throw new w("invalid aes key size");for(e.Z=[a=t.slice(0),o=[]],i=s;4*s+28>i;i++){let t=a[i-1];(i%s===0||8===s&&i%s===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%s===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),a[i]=a[i-s]^t}for(let t=0;i;t++,i--){const e=a[3&t?i:i-4];o[t]=4>=i||4>t?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.wt(t,0)}decrypt(t){return this.wt(t,1)}lt(){const t=this.ut[0],e=this.ut[1],n=t[4],r=e[4],s=[],i=[];let a,o,c,d;for(let t=0;256>t;t++)i[(s[t]=t<<1^283*(t>>7))^t]=t;for(let u=a=0;!n[u];u^=o||1,a=i[a]||1){let i=a^a<<1^a<<2^a<<3^a<<4;i=i>>8^255&i^99,n[u]=i,r[i]=u,d=s[c=s[o=s[u]]];let l=16843009*d^65537*c^257*o^16843008*u,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)t[n][u]=w=w<<24^w>>>8,e[n][i]=l=l<<24^l>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}wt(t,e){if(4!==t.length)throw new w("invalid aes block size");const n=this.Z[e],r=n.length/4-2,s=[0,0,0,0],i=this.ut[e],a=i[0],o=i[1],c=i[2],d=i[3],u=i[4];let l,f,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],g=t[e?1:3]^n[3],x=4;for(let t=0;r>t;t++)l=a[h>>>24]^o[m>>16&255]^c[y>>8&255]^d[255&g]^n[x],f=a[m>>>24]^o[y>>16&255]^c[g>>8&255]^d[255&h]^n[x+1],p=a[y>>>24]^o[g>>16&255]^c[h>>8&255]^d[255&m]^n[x+2],g=a[g>>>24]^o[h>>16&255]^c[m>>8&255]^d[255&y]^n[x+3],x+=4,h=l,m=f,y=p;for(let t=0;4>t;t++)s[e?3&-t:t]=u[h>>>24]<<24^u[m>>16&255]<<16^u[y>>8&255]<<8^u[255&g]^n[x++],l=h,h=m,m=y,y=g,g=l;return s}},On=class{constructor(t,e){this.ft=t,this.ht=e,this.yt=e}reset(){this.yt=this.ht}update(t){return this.gt(this.ft,t,this.yt)}xt(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}St(t){0===(t[0]=this.xt(t[0]))&&(t[1]=this.xt(t[1]))}gt(t,e,n){let r;if(!(r=e.length))return[];const s=un.bitLength(e);for(let s=0;r>s;s+=4){this.St(n);const r=t.encrypt(n);e[s]^=r[0],e[s+1]^=r[1],e[s+2]^=r[2],e[s+3]^=r[3]}return un.L(e,s)}},Mn=fn.et;let Nn=Cn&&Tn&&typeof kn.importKey==wt,_n=Cn&&Tn&&typeof kn.deriveBits==wt;class Ln extends E{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:s=!0}){super({start(){Wn(this,t,e,n)},async transform(t,e){const n=this,{password:s,strength:i,bt:a,ready:o}=n;s?(await(async(t,e,n,r)=>{const s=await Vn(t,e,n,Hn(r,0,Dn[e])),i=Hn(r,Dn[e]);if(s[0]!=i[0]||s[1]!=i[1])throw new w(hn)})(n,i,s,Hn(t,0,Dn[i]+2)),t=Hn(t,Dn[i]+2),r?e.error(new w(gn)):a()):await o;const c=new f(t.length-An-(t.length-An)%Sn);e.enqueue(Bn(n,t,c,0,An,!0))},async flush(t){const{zt:e,Ft:n,Et:r,ready:i}=this;if(n&&e){await i;const a=Hn(r,0,r.length-An),o=Hn(r,r.length-An);let c=ht;if(a.length){const t=jn(Un,a);n.update(t);const r=e.update(t);c=qn(Un,r)}const d=Hn(qn(Un,n.digest()),0,An);let u=r.length<An?1:0;for(let t=0;An>t;t++)u|=d[t]^o[t];if(u&&s)throw new w(yn);t.enqueue(c)}}})}}class Pn extends E{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){Wn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:s,bt:i,ready:a}=n;let o=ht;r?(o=await(async(t,e,n)=>{const r=xn(new f(Dn[e]));return Bt(r,await Vn(t,e,n,r))})(n,s,r),i()):await a;const c=new f(o.length+t.length-t.length%Sn);c.set(o,0),e.enqueue(Bn(n,t,c,o.length,0))},async flush(t){const{zt:e,Ft:n,Et:r,ready:s}=this;if(n&&e){await s;let i=ht;if(r.length){const t=e.update(jn(Un,r));n.update(t),i=qn(Un,t)}const a=qn(Un,n.digest()).slice(0,An);t.enqueue(Bt(i,a))}}})}}function Wn(t,e,r,s){n.assign(t,{ready:new g(e=>t.bt=e),password:Zn(e,r),strength:s-1,Et:ht})}function Bn(t,e,n,r,s,i){const{zt:a,Ft:o,Et:c}=t;c.length&&(e=Bt(c,e));const d=e.length-s;let u;for(n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new f(e)).set(n,0)}return t})(n,r+(d-d%Sn)),u=0;d-Sn>=u;u+=Sn){const t=jn(Un,Hn(e,u,u+Sn));i&&o.update(t);const s=a.update(t);i||o.update(s),n.set(qn(Un,s),u+r)}return t.Et=Hn(e,u),n}async function Vn(t,r,s,i){t.password=null;const a=await(async(t,e,n,r,s)=>{if(!Nn)return fn.importKey(e);try{return await kn.importKey("raw",e,n,!1,s)}catch{return Nn=!1,fn.importKey(e)}})(0,s,zn,0,En),o=await(async(t,e,n)=>{if(!_n)return fn.nt(e,t.salt,Fn.iterations,n);try{return await kn.deriveBits(t,e,n)}catch{return _n=!1,fn.nt(e,t.salt,Fn.iterations,n)}})(n.assign({salt:i},Fn),a,8*(2*Rn[r]+2)),c=new f(o),d=jn(Un,Hn(c,0,Rn[r])),u=jn(Un,Hn(c,Rn[r],2*Rn[r])),l=Hn(c,2*Rn[r]);return n.assign(t,{keys:{key:d,Dt:u,passwordVerification:l},zt:new On(new In(d),e.from(vn)),Ft:new Mn(u)}),l}function Zn(t,e){return e===dt?dn(t):e}function Hn(t,e,n){return t.subarray(e,n)}function qn(t,e){return t.W(e)}function jn(t,e){return t.B(e)}class Kn extends E{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){Gn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=Xn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new w(hn);t=t.subarray(12)}r?e.error(new w(gn)):e.enqueue(Xn(n,t))}})}}class Yn extends E{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){Gn(this,t,e,n)},transform(t,e){const n=this;let r,s;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=xn(new f(12));e[11]=n.passwordVerification,r=new f(t.length+e.length),r.set(Jn(n,e),0),s=12}else r=new f(t.length),s=0;r.set(Jn(n,t),s),e.enqueue(r)}})}}function Gn(t,e,r,s){n.assign(t,{password:e,rawPassword:r,passwordVerification:s}),((t,e,r)=>{const s=[305419896,591751049,878082192];if(n.assign(t,{keys:s,Rt:new on(s[0]),At:new on(s[2])}),r)for(let e=0;e<r.length;e++)Qn(t,r[e]);else for(let n=0;n<e.length;n++)Qn(t,e.charCodeAt(n))})(t,e,r)}function Xn(t,e){const n=new f(e.length);for(let r=0;r<e.length;r++)n[r]=$n(t)^e[r],Qn(t,n[r]);return n}function Jn(t,e){const n=new f(e.length);for(let r=0;r<e.length;r++)n[r]=$n(t)^e[r],Qn(t,e[r]);return n}function Qn(t,e){let[,n]=t.keys;t.Rt.append([e]);const r=~t.Rt.get();n=er(a.imul(er(n+tr(r)),134775813)+1),t.At.append([n>>>24]);const s=~t.At.get();t.keys=[r,n,s]}function $n(t){const e=2|t.keys[2];return tr(a.imul(e,1^e)>>>8)}function tr(t){return 255&t}function er(t){return 4294967295&t}const nr="Invalid uncompressed size",rr="Invalid compressed data",sr=mn,ir="deflate-raw",ar="gzip",or=[31,139,8];class cr extends E{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:a,zipCrypto:o,computeCrc32:c,level:d,deflate64:u,format:l,compressionMethod:w}=t,f=this;let p,h,y,g=super.readable;const x=l&&Xe(l),S=c&&s&&!u&&!x&&(!i||o)&&!(!a||!r);if(i&&!o||!c||S||(p=new cn,g=yr(g,p)),s)if(x)g=gr(g,hr(x.CompressionStream,l,{level:d,chunkSize:e,compressionMethod:w}));else if(S)y=new dr,g=gr(g,new r(ar)),g=yr(g,y);else try{g=mr(g,a,{level:d,chunkSize:e},r,n)}catch(t){let e;try{e=new r(ar)}catch{throw t}g=gr(g,e),g=yr(g,new dr)}i&&(o?g=yr(g,new Yn(t)):(h=new Pn(t),g=yr(g,h))),pr(f,g,()=>{i&&!o||!c||(f.crc32=S?y.crc32:new m(p.value.buffer).getUint32(0))})}}class dr extends E{constructor(){let t,e=10,n=new f(0);super({transform(t,r){if(e){const n=a.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const s=n.length+t.length;if(8>=s)return void(n=Bt(n,t));const i=s-8,o=a.min(i,n.length);r.enqueue(Bt(n.subarray(0,o),t.subarray(0,i-o))),n=Bt(n.subarray(o),t.subarray(i-o))},flush(){const e=Zt(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class ur extends E{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:s,encrypted:i,checkCrc32:a,crc32:o,compressed:c,useCompressionStream:d,deflate64:u,format:l,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let x,S,b=super.readable;if(i&&(s?b=yr(b,new Kn(t)):(S=new Ln(t),b=yr(b,S))),c){const t=l&&Xe(l);if(t)b=gr(b,hr(t.DecompressionStream,l,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{b=mr(b,d,{chunkSize:e,deflate64:u},r,n)}catch(t){if(u||y===dt)throw t;let e;try{e=new r(ar)}catch{throw t}b=((t,e,n)=>{const r=new on;let s,i,a,o=0,c=!1;const d=new g((t,e)=>{i=t,a=e});d.catch(()=>{}),n||i();const u=new E({start(t){const e=new f(10);e.set(or),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await d}finally{h()}const e=new f(8),s=Zt(e);s.setUint32(0,r.get(),!0),s.setUint32(4,n,!0),t.enqueue(e)},cancel(t){a(t)}}),l=new E({transform(t,e){r.append(t),o+=t.length,n>o?c&&p():i(),e.enqueue(t)},cancel(t){a(t)}});return t=yr(t,u),yr(t=gr(t,e),l);function p(){h(),s=U(()=>a(new w(nr)),5e3)}function h(){I(s)}})(b,e,y)}b=(t=>{const e=t.getReader();return new D({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new w(rr);throw e.cause=t,e}const{value:r,done:s}=n;s?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})})(b)}a&&(x=new cn,b=yr(b,x)),pr(this,b,()=>{if(a){const t=new m(x.value.buffer);if(o!=t.getUint32(0,!1))throw new w(sr)}})}}const lr=new c;function wr(t,e){if(!t)return!1;let n=lr.get(t);n||(n=new c,lr.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function fr(t){return wr(t,ir)}function pr(t,e,r){e=yr(e,new E({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function hr(t,e,n){if(!t)throw new w("Compression method not supported");return new t(e,n)}function mr(t,e,n,r,s){const i=e&&r?r:s||r,a=n.deflate64?"deflate64-raw":ir;let o;try{o=new i(a,n)}catch(t){if(!e||!s||i==s)throw t;o=new s(a,n)}return gr(t,o)}function yr(t,e){return Ht(t).pipeThrough(e)}function gr(t,e){const n=e.writable.getWriter(),r=t.getReader();return(async()=>{try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await(async(t,e)=>{try{await t.abort(e)}catch{}})(n,t),await(async(t,e)=>{try{await t.cancel(e)}catch{}})(r,t)}})(),e.readable}const xr="deflate",Sr="inflate";class br extends E{constructor(t,e){super({});const r=this,{codecType:s}=t;let i;s.startsWith(xr)?i=cr:s.startsWith(Sr)&&(i=ur),r.outputSize=0;let a=0;const o=new i(t,e),c=super.readable,d=new E({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:a})}}),u=new E({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new w(nr)},flush(){const{crc32:t}=o;n.assign(r,{crc32:t,inputSize:a})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(d).pipeThrough(o).pipeThrough(u)})}}class zr extends E{constructor(t){const e=[];let n=0;function r(){const r=new f(t);let s=0;for(;t>s;){const n=e[0],i=t-s;n.length>i?(r.set(n.subarray(0,i),s),e[0]=n.subarray(i),s+=i):(r.set(n,s),s+=n.length,e.shift())}return n-=t,r}s.isFinite(t)&&t>=1||(t=65536),super({transform(s,i){for(e.push(s),n+=s.length;n>t;)i.enqueue(r())},flush(t){n&&t.enqueue(((t,e)=>{const n=new f(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n})(e,n))}})}}async function Fr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.vt)return!0;if(fr(e)||wr(e,ar))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}class Er{constructor(t,{readable:e,writable:r},{options:s,config:i,Ct:a,useWebWorkers:o,transferStreams:c,workerURI:d,createWorker:u},l){const{signal:w}=a;return n.assign(t,{kt:!0,Tt:(t.Tt||0)+1,readable:e.pipeThrough(new zr(Pt(i))).pipeThrough(new Dr(a),{signal:w}),writable:r,options:n.assign({},s),workerURI:d,createWorker:u,transferStreams:c,terminate:()=>new g(e=>{const{Ut:n,kt:r}=t;n?(r?t.It=e:(n.terminate(),e()),t.Ot=null):e()}),Mt(){if(t.kt){const{It:e}=t;e&&(t.It=null,t.Nt=!0,t.Ut.terminate(),e()),t.kt=!1,l(t)}}}),((t,e)=>({run:()=>(async({options:t,readable:e,writable:n,Mt:r},s)=>{let i;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(xr),n=e?s.CompressionStreamFallback:s.DecompressionStreamFallback,r=e?s.CompressionStream:s.DecompressionStream;if(t.useCompressionStream){if(n&&n.vt&&!fr(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.vt||(t.useCompressionStream=!0)}}i=new br(t,s),await e.pipeThrough(i).pipeThrough(new zr(Pt(s))).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:a,outputSize:o}=i;return{crc32:r,inputSize:a,outputSize:o}}catch(t){throw i&&(t.outputSize=i.outputSize),t}finally{r()}})(t,e)}))(t,i)}}class Dr extends E{constructor({onstart:t,onprogress:e,size:n,onend:r}){let s=0;super({async start(){t&&await Rr(t,n)},async transform(t,r){s+=t.length,e&&await Rr(e,s,n),r.enqueue(t)},async flush(){r&&await Rr(r,s)}})}}async function Rr(t,...e){try{await t(...e)}catch{}}let Ar=[];const vr=[];let Cr,kr,Tr=0;async function Ur(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:a,useCompressionStream:o,compressed:c,checkCrc32:d,computeCrc32:u,encrypted:f,format:p,codecURI:h}=n,{workerURI:m,createWorker:y,maxWorkers:x}=r;p&&(h&&(n.codecURI=((t,e)=>{try{return new l(t,e).toString()}catch{return t}})(h,r.baseURI)),await(async(t,e)=>{!Ye.has(t)&&e&&((t,e)=>{const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=wt&&typeof r!=wt)throw new w("Invalid codec module");Ye.set(t,{CompressionStream:n,DecompressionStream:r})})(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(p,n.codecURI)),e.transferStreams=!p&&(i||i===dt&&r.transferStreams);const S=!(c||d||u||f),b=p===dt||!!n.codecURI;return e.useWebWorkers=!S&&b&&(a||a===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&m?m:dt,e.createWorker=e.useWebWorkers&&y?y:dt,n.useCompressionStream=o||o===dt&&r.useCompressionStream,(await(async()=>{const n=Ar.find(t=>!t.kt);if(n)return _r(n),new Er(n,t,e,z);if(Ar.length<x){const n={_t:Tr};return Tr++,Ar.push(n),new Er(n,t,e,z)}return new g(n=>{vr.push({resolve:n,stream:t,Lt:e}),kr=r.workerStarvationTimeout,Ir()})})()).run();function z(t){if(Or(),vr.length){const[{resolve:e,stream:n,Lt:r}]=vr.splice(0,1);e(new Er(t,n,r,z)),Ir()}else t.Ut?(_r(t),((t,e)=>{const{config:n}=e,{terminateWorkerTimeout:r}=n;s.isFinite(r)&&r>=0&&(t.Nt?t.Nt=!1:t.Pt=U(async()=>{Ar=Ar.filter(e=>e!=t);try{await t.terminate()}catch{}},r))})(t,e)):Ar=Ar.filter(e=>e!=t)}}function Ir(){!Cr&&vr.length&&s.isFinite(kr)&&kr>=0&&(Cr=U(Mr,kr))}function Or(){Cr&&(I(Cr),Cr=null)}function Mr(){if(Cr=null,vr.length){const[{resolve:t,stream:e,Lt:r}]=vr.splice(0,1),s=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new Er({},e,s,Nr)),Ir()}}function Nr(){Or(),Ir()}function _r(t){const{Pt:e}=t;e&&(I(e),t.Pt=null)}const Lr="filename",Pr="rawFilename",Wr="comment",Br="rawComment",Vr="uncompressedSize",Zr="compressedSize",Hr="offset",qr="diskNumberStart",jr="lastModDate",Kr="rawLastModDate",Yr="lastAccessDate",Gr="rawLastAccessDate",Xr="creationDate",Jr="rawCreationDate",Qr="internalFileAttributes",$r="externalFileAttributes",ts="internalFileAttribute",es="externalFileAttribute",ns="msdosAttributesRaw",rs="msdosAttributes",ss="msDosCompatible",is="zip64",as="encrypted",os="version",cs="versionMadeBy",ds="zipCrypto",us="directory",ls="executable",ws="compressionMethod",fs="signature",ps="extraField",hs="unixMode",ms="setuid",ys="setgid",gs="sticky",xs=[Lr,Pr,Vr,Zr,jr,Kr,Wr,Br,Yr,Gr,Xr,Jr,Hr,qr,Qr,$r,ts,es,ns,rs,ss,is,as,os,cs,ds,us,ls,"symlink",ws,fs,"crc32",ps,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",hs,"unixExternalUpper",ms,ys,gs,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Ss{constructor(t){xs.forEach(e=>this[e]=t[e])}}const bs="File format is not recognized",zs="End of central directory not found",Fs="End of Zip64 central directory locator not found",Es="Central directory header not found",Ds="Local file header not found",Rs="Zip64 extra field not found",As="File contains encrypted entry",vs="Encryption method not supported",Cs="Compression method not supported",ks="Split zip file",Ts="Overlapping entry found",Us="Entry data out of bounds",Is="Ambiguous archive",Os="Encrypted central directory is not supported",Ms="Unsafe filename",Ns="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",_s="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Ls="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ps=/^[a-zA-Z]:/,Ws="utf-8",Bs="cp437",Vs=[[Vr,M],[Zr,M],[Hr,M],[qr,N]],Zs={[N]:{Wt:yi,bytes:4},[M]:{Wt:gi,bytes:8}};class Hs{constructor(t,e={}){n.assign(this,{reader:new We(t),options:e,Bt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await Ze(r),r.size!==dt&&r.readUint8Array||(r=new fe(await qt(r.readable)),await Ze(r)),r.size<j)throw new w(bs);const i=ri(t,e.options),o=i==Ct,c=i!=Tt,u=((t,e)=>{if(t!==dt){const e=Mt(t);if("number"!=typeof e||s.isNaN(e)||0>e)throw new w(Ls);return e}return e==Ct?0:e==Tt?1/0:N})(li(e,t,"maxAppendedDataSize"),i),l=((t,e)=>{if(t===dt)return e;if(!ni(t))throw new w(_s);return t})(li(e,t,"filenameValidation"),i),f=li(e,t,"normalizeFilename"),{Vt:p,Zt:h}=await(async(t,e,n)=>{const{size:r}=t,s=a.min(r,65557),i={count:64};let o,c,d=0;for await(const[n,a,u,l,w]of ai(t,s)){const s=mi(n,l+20);if(w+j+s==r){const s=await ci(t,n,a,l,w,r,i);if(2==s){if(o||(o=oi(u,l,w)),d++,!e||d>1)break}else 1!=s||c||(c=oi(u,l,w))}}return o||(o=c),o||(o=await(async(t,e,n)=>{const{size:r}=t,s=a.min(r,e==1/0?r:65557+e);let i,o;for await(const[e,a,c,d,u]of ai(t,s)){const s=oi(c,d,u);i||(i=s);const l=await ci(t,e,a,d,u,r,n);if(2==l)return s;1!=l||o||(o=s)}return o||i})(t,n,i)),{Vt:o,Zt:d}})(r,c,u);if(!p)throw await(async t=>await ei(t)==P)(r)?new w(ks):new w(zs);c&&h>1&&ui("multiple end of central directory records");const m=Zt(p);let y=yi(m,12),g=yi(m,16);const x=p.offset,S=mi(m,20),b=x+j+S;r.size-b>u&&ui("appended data");let z=mi(m,4);const F=r.U||0;let D,R,A,v,C=mi(m,6),k=mi(m,10),T=0;const U=g==M||y==M||k==N||C==N;if(g!=M&&C!=N&&(g+=ti(r,C)),U){const t=p.offset<K?ht:await qe(r,p.offset-K,K),e=Zt(t);if(t.length==K&&yi(e,0)==q){g=ti(r,yi(e,4))+gi(e,8);let t=await qe(r,g,Y),i=Zt(t);const c=p.offset-K-Y;if((t.length<Y||yi(i,0)!=H)&&g!=c&&c>=0){const e=g;g=c,g>e&&(T=g-e),t=await qe(r,g,Y),i=Zt(t)}if(t.length<Y||yi(i,0)!=H)throw new w(Fs);if(R=!0,A=gi(i,4)>44,A){const t=a.min(s(gi(i,4))-44,r.size-g-Y);t>0&&(v=(t=>{const e={rawExtensibleData:t};if(t.length>=28){const r=Zt(t),i=mi(r,26);n.assign(e,{compressionMethod:mi(r,0),compressedSize:s(gi(r,2)),uncompressedSize:s(gi(r,10)),encryptionAlgorithm:mi(r,18),bitLength:mi(r,20),flags:mi(r,22),hashAlgorithm:mi(r,24),hashData:t.subarray(28,28+i)})}return e})(await qe(r,g+Y,t)))}z==N?z=yi(i,16):o&&z!=yi(i,16)&&ui("mismatched zip64 end of central directory record"),C==N?C=yi(i,20):o&&C!=yi(i,20)&&ui("mismatched zip64 end of central directory record"),k==N?k=gi(i,32):o&&k!=gi(i,32)&&ui("mismatched zip64 end of central directory record"),y==M?y=gi(i,40):o&&y!=gi(i,40)&&ui("mismatched zip64 end of central directory record"),g=ti(r,C)+gi(i,48)+T}}let I=y;const O=p.offset-(R?76:0);if(g<r.size||(T=r.size-g-y-j,g=r.size-y-j),F!=z)throw new w(ks);if(0>g)throw new w(bs);let L=0,W=await qe(r,g,y),Z=Zt(W);if(y){if(4>W.length)throw new w(bs);const t=O-y;if(g!=t&&C==z){let e=!(yi(Z,L)==V);if(e||0>t||t+4>r.size||(e=yi(Zt(await qe(r,t,4)),0)==V),e){const e=g;g=t,g>e&&(T+=g-e),W=await qe(r,g,y),Z=Zt(W)}}}const G=O-g;if(y==G||0>G||C!=z||(y=G,W=await qe(r,g,y),Z=Zt(W)),0>g||g>=r.size)throw new w(bs);e.directoryOffset=g,e.directoryLength=I;const X=wi(e,t,"decryptCentralDirectory");let J;X&&k&&W.length>=4&&yi(Z,0)!=V&&(A||js(Z))&&(W=await X(W,v),Z=Zt(W),I=W.length,J=!0),D=g;const Q=li(e,t,"filenameEncoding"),$=li(e,t,"commentEncoding"),tt=o?new d:dt;let at;for(let s=0;k>s;s++){const i=new qs(r,e.options);if(L+46>W.length||yi(Z,L)!=V){if(0==s&&!J&&(A||js(Z)))throw new w(Os);throw new w(Es)}Ks(i,Z,L+6);const c=!!i.bitFlag.languageEncodingFlag,d=L+46,u=d+i.filenameLength,p=u+i.extraFieldLength,h=mi(Z,L+4),m=!(h>>8),y=h>>8==3,g=W.subarray(d,u),x=mi(Z,L+32),S=p+x,b=W.subarray(p,S),z=c,F=c,R=yi(Z,L+38),v=R&_,C={readOnly:!!(1&v),hidden:!!(2&v),system:!!(4&v),directory:!!(16&v),archive:!!(32&v)},U=yi(Z,L+42),I=wi(e,t,"decodeText")||Yt,O=z?Ws:Q||Bs,M=F?Ws:$||Bs;let P=I(g,O,At);if(P===dt&&(P=Yt(g,O)),f){const t=f(P);t!==dt&&(P=t)}if(ii(P,l)){const t=new w(Ms);throw t.filename=P,t}let B=I(b,M,vt);B===dt&&(B=Yt(b,M)),n.assign(i,{index:s,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Ht:x,offset:U,diskNumberStart:mi(Z,L+34),internalFileAttributes:mi(Z,L+36),externalFileAttributes:R,msdosAttributesRaw:v,msdosAttributes:C,rawFilename:g,filenameUTF8:z,commentUTF8:F,rawExtraField:W.subarray(u,p),rawComment:b,filename:P,comment:B}),Ys(i,i,Z,L+6),i.offset+=T,D=a.min(ti(r,i.diskNumberStart)+i.offset,D),o&&(tt.has(i.filename)&&(at=!0),tt.add(i.filename));const H=i.externalFileAttributes>>16&N;i.unixMode===dt&&16877&H&&(i.unixMode=H);const q=!!(i.unixMode&rt),j=!!(i.unixMode&st),K=!!(512&i.unixMode),Y=40960==((i.unixMode===dt?H:i.unixMode)&et),G=!Y&&(i.unixMode!==dt?!!(73&i.unixMode):y&&!!(73&H)),X=i.unixMode!==dt&&(i.unixMode&et)==nt,ot=(H&et)==nt;n.assign(i,{setuid:q,setgid:j,sticky:K,symlink:Y,unixExternalUpper:H,internalFileAttribute:i.internalFileAttributes,externalFileAttribute:i.externalFileAttributes,executable:G,directory:X||ot||m&&C.directory||i.filename.endsWith(it)&&!i.uncompressedSize,zipCrypto:i.encrypted&&!i.extraFieldAES});const ct=new Ss(i);ct.getData=(t,n)=>i.getData(t,ct,e.Bt,n),ct.arrayBuffer=async t=>{const n=new E,r=qt(n.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await i.getData(n,ct,e.Bt,t),r},L=S;const{onprogress:ut}=t;if(ut)try{await ut(s+1,k,new Ss(i))}catch{}yield ct}let ot=L;if(L+6<=W.length&&yi(Z,L)==B){const t=mi(Z,L+4);L+6+t>W.length||(e.digitalSignature=W.subarray(L+6,L+6+t),ot=L+6+t)}o&&L!=I&&ot!=I&&ui("trailing central directory data"),at&&ui("duplicate filename");const ct=li(e,t,"extractPrependedData"),ut=li(e,t,"extractAppendedData"),lt=(o||ct)&&k&&4==D&&await(async t=>{const e=await ei(t);return e==P||808471376==e})(r)?4:0;return o&&(T||k&&D>lt)&&ui("prepended data"),ct&&(e.prependedData=D>lt?await qe(r,lt,D-lt):ht),e.comment=S?await qe(r,x+j,S):ht,ut&&(e.appendedData=b<r.size?await qe(r,b,r.size-b):ht),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}let qs=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,n,r={}){const s=this,i=Lt(),{reader:o,index:c,offset:d,diskNumberStart:u,extraFieldAES:l,extraFieldZip64:f,compressionMethod:p,bitFlag:h,rawBitFlag:m,crc32:y,rawLastModDate:g,uncompressedSize:x,compressedSize:S}=s,{dataDescriptor:b}=h,z=e.localDirectory={},F=ti(o,u)+d,E=await qe(o,F,at),D=Zt(E);let A=li(s,r,mt),v=li(s,r,yt);const C=li(s,r,gt);if(Ot(A,v),A=A&&A.length&&A,v=v&&v.length&&v,l&&99!=l.originalCompressionMethod)throw new w(Cs);if(E.length<at||yi(D,0)!=L)throw new w(Ds);Ks(z,D,4);const{extraFieldLength:k,filenameLength:T}=z,U=li(s,r,"checkLocalDirectory"),I=ri(r,s.options),O=((t,e)=>t===dt?e!=Tt:!!t)(U,I),M=((t,e)=>t===dt?e==Ct:!!t)(U,I);let N=ht;if(M&&(T||k)){const t=await qe(o,F+at,T+k);N=t.subarray(0,T),z.rawExtraField=t.subarray(T)}else z.rawExtraField=k?await qe(o,F+at+T,k):ht;M&&(z.rawFilename=N),Ys(s,z,D,4,!0),O&&((t,e,n,r)=>{const{rawFilename:s}=t;r&&(n.length!=s.length||n.some((t,e)=>t!=s[e]))&&ui("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&ui("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&ui("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||ui("mismatched local file header (crc32 or sizes)")})(s,z,N,M);const{lastAccessDate:P,creationDate:B,uid:V,gid:Z}=z;P&&(e.lastAccessDate=P),B&&(e.creationDate=B),V!==dt&&e.uid===dt&&(e.uid=V),Z!==dt&&e.gid===dt&&(e.gid=Z);const H=s.encrypted&&z.encrypted&&!C,q=H&&!l;if(C||(e.zipCrypto=q),H&&!(64&~z.rawBitFlag))throw new w(vs);const j=C?dt:Ge(p);if(0!=p&&8!=p&&9!=p&&!j&&!C)throw new w(Cs);if(H){if(!q&&(1>l.strength||l.strength>3))throw new w(vs);if(!A&&!v)throw new w(As)}const K=F+at+T+k;if(K+S>o.size)throw new w(Us);const Y=S,G=Ht(o.createReadable({offset:K,size:Y})),X=It(li(s,r,xt)),J=li(s,r,"checkPasswordOnly");let Q=li(s,r,"checkOverlappingEntry");const $=li(s,r,"checkOverlappingEntryOnly");$&&(Q=!0);const{onstart:tt,onprogress:et,onend:nt}=r,rt=0!=p&&!C,st=C?S:x,it=9==p;let ot=li(s,r,bt);it&&(ot=!1);const ct=li(s,r,"checkCrc32"),ut=(ct===dt?li(s,r,"checkSignature"):ct)&&!C&&(!H||q||l&&1==l.vendorVersion),lt={options:{codecType:Sr,password:A,rawPassword:v,zipCrypto:q,encryptionStrength:l&&l.strength,checkCrc32:ut,checkAuthenticationCode:li(s,r,"checkAuthenticationCode"),passwordVerification:q&&(b?g>>>8&_:y>>>24&_),outputSize:st,crc32:y,compressed:rt,encrypted:H,useWebWorkers:li(s,r,St),useCompressionStream:ot,transferStreams:li(s,r,zt),deflate64:it,format:j?j.format:dt,codecURI:j?j.codecURI:dt,compressionMethod:p,rawBitFlag:m,checkPasswordOnly:J},config:i,Ct:{signal:X,size:Y,onstart:tt,onprogress:et,onend:nt}};let wt,ft;Q&&await(async({reader:t,qt:e,index:n,offset:r,crc32:s,compressedSize:i,uncompressedSize:a,jt:o,dataDescriptor:c,extraFieldZip64:d,Bt:u})=>{let l=0;if(c&&(l=d?20:12),l){const n=await qe(t,o+i,l+4),r=Zt(n);let c=n.length==l+4&&yi(r,0)==W;if(c){const t=$s(r,4,d);(e.encrypted&&!e.zipCrypto||t.crc32==s)&&t.compressedSize==i&&t.uncompressedSize==a?l+=4:c=!1}if(n.length>=l){const t=$s(r,c?4:0,d);t.signature=c,e.localDirectory.dataDescriptor=t}}const f={start:r,end:o+i+l,qt:e};for(const[t,e]of u)if(t!=n&&f.start<e.end&&e.start<f.end){const t=new w(Ts);throw t.overlappingEntry=e.qt,t}u.set(n,f)})({reader:o,qt:e,index:c,offset:F,crc32:y,compressedSize:S,uncompressedSize:x,jt:K,dataDescriptor:b||z.bitFlag.dataDescriptor,extraFieldZip64:f||z.extraFieldZip64,Bt:n});try{if(!$){J&&(t=new R),t=new Be(t),await Ze(t,((t,e,n)=>a.min(t,n?1032*e:e))(st,S,rt)),({writable:wt}=t);const{outputSize:e}=await Ur({readable:G,writable:wt},lt);if(t.size+=e,e!=st)throw new w(nr)}}catch(e){if(e.outputSize!==dt&&(t.size+=e.outputSize),!J||e.message!=gn)throw ft=e,e}finally{if((Ve(t)||!li(s,r,Ft))&&wt&&!wt.locked){const t=wt.getWriter();if(ft)try{await t.abort(ft)}catch{}else await t.close()}}return J||$?dt:t.getData?t.getData():wt}};function js(t){const e=a.min(t.byteLength,1024)-3;for(let n=0;e>n;n++)if(134630224==yi(t,n))return!0;return!1}function Ks(t,e,r){const s=t.rawBitFlag=mi(e,r+2),i=!(1&~s),a=yi(e,r+6);n.assign(t,{encrypted:i,version:mi(e,r),bitFlag:{level:(6&s)>>1,dataDescriptor:!(8&~s),languageEncodingFlag:(s&tt)==tt},rawLastModDate:a,lastModDate:fi(a),filenameLength:mi(e,r+22),extraFieldLength:mi(e,r+24)})}function Ys(t,e,r,s,i){const{rawExtraField:a}=e,d=e.extraField=new c,u=Zt(a);let l=0;try{for(;l<a.length;){const t=mi(u,l),e=mi(u,l+2);d.set(t,{type:t,data:a.slice(l+4,l+4+e)}),l+=4+e}}catch{}const f=mi(r,s+4);n.assign(e,{signature:yi(r,s+10),crc32:yi(r,s+10),compressedSize:yi(r,s+14),uncompressedSize:yi(r,s+18)});const p=d.get(1);p&&(((t,e)=>{e.zip64=!0;const n=Zt(t.data),r=Vs.filter(([t,n])=>e[t]==n),s=r.reduce((t,[,e])=>t+Zs[e].bytes,0);if(t.data.length<s)throw new w(Rs);for(let s=0,i=0;s<r.length;s++){const[a,o]=r[s],c=Zs[o];e[a]=t[a]=c.Wt(n,i),i+=c.bytes}})(p,e),e.extraFieldZip64=p);const h=d.get(28789);h&&(Gs(h,Lr,Pr,e,t),e.extraFieldUnicodePath=h);const m=d.get(25461);m&&(Gs(m,Wr,Br,e,t),e.extraFieldUnicodeComment=m);const y=d.get(G);y&&y.data.length>=7?(((t,e,r)=>{const s=Zt(t.data),i=hi(s,4);n.assign(t,{vendorVersion:hi(s,0),vendorId:hi(s,2),strength:i,originalCompressionMethod:r,compressionMethod:mi(s,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)})(y,e,f),e.extraFieldAES=y):e.compressionMethod=f;const g=d.get(13);g&&(Xs(g,e),e.extraFieldPkwareUnix=g);const x=d.get(22613);x&&(Xs(x,e),e.extraFieldUnixType1=x);const S=d.get(10);S&&(((t,e)=>{const r=Zt(t.data);let s,i=4;try{for(;i<t.data.length&&!s;){const e=mi(r,i),n=mi(r,i+2);1==e&&(s=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(s&&24==s.length){const r=Zt(s),i=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),o=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:a,rawCreationDate:o});const c={lastModDate:pi(i),lastAccessDate:pi(a),creationDate:pi(o)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:a,rawCreationDate:o})}})(S,e),e.extraFieldNTFS=S);const b=d.get($);let z;if(b&&(z=Js(b,e,!1),e.extraFieldUnix=b),!z){const t=d.get(Q);t&&(Js(t,e,!0),e.extraFieldInfoZip=t)}const F=d.get(X);F&&(((t,e,n)=>{if(!t.data.length)return;const r=Zt(t.data),s=hi(r,0),i=[],a=[];n?(1&~s||(i.push(jr),a.push(Kr)),2&~s||(i.push(Yr),a.push(Gr)),4&~s||(i.push(Xr),a.push(Jr))):5>t.data.length||(i.push(jr),a.push(Kr));let c=1;i.forEach((n,s)=>{if(t.data.length>=c+4){const i=yi(r,c);e[n]=t[n]=new o(1e3*(0|i));const d=a[s];t[d]=i}c+=4})})(F,e,i),e.extraFieldExtendedTimestamp=F);const E=d.get(J);E&&(e.extraFieldUSDZ=E)}function Gs(t,e,r,s,i){if(5>t.data.length)return void(t.valid=!1);const a=Zt(t.data),o=new on;o.append(i[r]);const c=Zt(new f(4));c.setUint32(0,o.get(),!0);const d=yi(a,1);n.assign(t,{version:hi(a,0),[e]:Yt(t.data.subarray(5)),valid:!i.bitFlag.languageEncodingFlag&&d==yi(c,0)}),t.valid&&(s[e]=t[e],s[e+"UTF8"]=!0)}function Xs(t,e){if(8>t.data.length)return;const r=Zt(t.data),s={lastAccessDate:new o(1e3*(0|yi(r,0))),lastModDate:new o(1e3*(0|yi(r,4)))};12>t.data.length||(s.uid=mi(r,8),s.gid=mi(r,10)),n.assign(t,s),n.assign(e,s)}function Js(t,e,r){try{const s=Zt(t.data);let i,a;if(r){let e=0;const r=hi(s,e++),o=hi(s,e++);i=Qs(t.data.subarray(e,e+o)),e+=o;const c=hi(s,e++);a=Qs(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:a})}else 4>t.data.length||(i=mi(s,0),a=mi(s,2),n.assign(t,{uid:i,gid:a}));return i!==dt&&(e.uid=i),a!==dt&&(e.gid=a),i!==dt||a!==dt}catch{}}function Qs(t){const e=new f(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function $s(t,e,n){const r=yi(t,e);let s,i;return n?(s=gi(t,e+4),i=gi(t,e+12)):(s=yi(t,e+4),i=yi(t,e+8)),{crc32:r,compressedSize:s,uncompressedSize:i}}function ti(t,e){return t.O?t.O(e):0}async function ei(t){return yi(Zt(await qe(t,0,4)))}function ni(t){return t===Ct||t===kt||t===Tt}function ri(t,e){return si(t,si(e,kt))}function si(t,e){const n=t.strictness;if(n!==dt){if(!ni(n))throw new w(Ns);return n}const r=t.checkAmbiguity;return r===dt?e:r?Ct:e==Tt?Tt:kt}function ii(t,e){if(e==Tt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Ps.test(t))||e==Ct&&(n.includes(".")||n.includes(""))}async function*ai(t,e){const n=t.size-e,r=await qe(t,n,e),s=Zt(r);for(let t=r.length-j;t>=0;t--)yi(s,t)==Z&&(yield[s,n,r,t,n+t])}function oi(t,e,n){return{offset:n,buffer:t.slice(e,e+j).buffer}}async function ci(t,e,n,r,s,i,a){const o=mi(e,r+10),c=yi(e,r+12),d=yi(e,r+16);if(o==N||c==M||d==M)return await di(t,e,n,s-K,i,a)==q?2:0;if(!o&&!c)return 1;const u=mi(e,r+6);for(const r of[s-c,ti(t,u)+d])if(await di(t,e,n,r,i,a)==V)return 2;return 0}async function di(t,e,n,r,s,i){return 0>r||r+4>s?dt:n>r?i.count>0?(i.count--,yi(Zt(await qe(t,r,4)),0)):dt:yi(e,r-n)}function ui(t){const e=new w(Is);throw e.reason=t,e}function li(t,e,n){return e[n]===dt?t.options[n]:e[n]}function wi(t,e,n){return Ut(li(t,e,n))}function fi(t){const e=(4294901760&t)>>16,n=t&N;return new o(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}function pi(t){return new o(s(t/i(1e4)-i(116444736e5)))}function hi(t,e){return t.getUint8(e)}function mi(t,e){return t.getUint16(e,!0)}function yi(t,e){return t.getUint32(e,!0)}function gi(t,e){return s(t.getBigUint64(e,!0))}var xi=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Is,ERR_BAD_FORMAT:bs,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Es,ERR_ENCRYPTED:As,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Os,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Us,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Fs,ERR_EOCDR_NOT_FOUND:zs,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Rs,ERR_INVALID_AUTHENTICATION_CODE:yn,ERR_INVALID_COMPRESSED_DATA:rr,ERR_INVALID_CRC32:sr,ERR_INVALID_FILENAME_VALIDATION:_s,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Ls,ERR_INVALID_PASSWORD:hn,ERR_INVALID_SIGNATURE:mn,ERR_INVALID_STRICTNESS:Ns,ERR_INVALID_UNCOMPRESSED_SIZE:nr,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ds,ERR_OVERLAPPING_ENTRY:Ts,ERR_SPLIT_ZIP_FILE:ks,ERR_UNSAFE_FILENAME:Ms,ERR_UNSUPPORTED_COMPRESSION:Cs,ERR_UNSUPPORTED_ENCRYPTION:vs,ZipReader:Hs});const Si="Zip file comment exceeds 64KB",bi="Invalid zip file comment (must be a Uint8Array)",zi="Version exceeds 65535",Fi="Extra field data exceeds 64KB",Ei=-2147483648,Di=2147483647,Ri=i(0),Ai=i("0x7fffffffffffffff"),vi="Zip64 is not supported (set the 'zip64' option to 'true')",Ci="Undetermined size",ki=new f([7,0,2,0,65,69,3,0,0]),Ti="infozip",Ui="unix";let Ii=0;const Oi=[];class Mi{constructor(t,e={}){t=new Be(t);const{availableSize:r=ut,maxSize:s=ut}=t,i=r>0&&r!==ut&&s>0&&s!==ut;n.assign(this,{writer:t,Kt:i,options:e,Yt:new c,Gt:new d,offset:e[Et]===dt?t.size||t.writable.size||0:e[Et],Xt:e[Et]===dt?0:e[Et]-(t.size||t.writable.size||0),Jt:new d,Qt:0,$t:dt})}async prependZip(t){if(this.Gt.size)throw new w("Zip file not empty");t=new We(t),await Ze(t),t.size!==dt&&t.readUint8Array||(t=new fe(await qt(t.readable)),await Ze(t));const{ZipReader:r}=await g.resolve().then(()=>xi),s=new r(t),i=await s.getEntries();await s.close(),await Ze(this.writer);const{directoryOffset:a}=s;let o=0;this.Kt&&(delete this.Kt,await(async t=>Zt(await qe(t,0,4)).getUint32(0,!0)==P)(t)||(await ta(this.writer,$i()),o=4,this.offset+=o));const u=await(async(t,n,r,s,i)=>{const{writer:a}=t,o=new c;if(a.closeDisk){const i=e.from(r).sort((t,e)=>Qi(n,t)-Qi(n,e));let c=0;for(const e of i){const r=Qi(n,e);await Xi(t,n,c,r-c),Yi(a,await Ji(n,r))&&await a.closeDisk(),o.set(e,{offset:Gi(t,a),diskNumberStart:ji(a)}),c=r}await Xi(t,n,c,s-c)}else await Xi(t,n,0,s),r.forEach(t=>o.set(t,{offset:i+Qi(n,t),diskNumberStart:0}));return o})(this,t,i,a,o);this.Gt=new d(i.map(t=>t.filename)),this.Yt=new c(i.map(t=>{const{version:e,rawLastModDate:r,lastAccessDate:s,creationDate:i,rawFilename:a,bitFlag:o,encrypted:c,uncompressedSize:d,compressedSize:l,zip64:w}=t;let{compressionMethod:f,te:p,ee:h,ne:m,re:y,se:g,rawExtraField:x}=t;const{level:S,languageEncodingFlag:b,dataDescriptor:z}=o;p=p||ht,h=h||ht,m=m||ht,y=y||ht,g=g||ht,x=x||ht,t.extraFieldAES&&(f=99);const F=ga(p,h,m,y,g,x),E=w&&d>=M,D=w&&l>=M,R=-7&Sa(S,b,z,c,f)|S<<1,{ie:A,ae:v}=xa({version:e,bitFlag:R,compressionMethod:f,uncompressedSize:d,compressedSize:l,rawLastModDate:r,rawFilename:a,oe:D,ce:E,extraFieldLength:F}),{crc32:C}=t;C!==dt&&ha(v,10,C);const{offset:k,diskNumberStart:T}=u.get(t);return n.assign(t,{ce:E,oe:D,offset:k,diskNumberStart:T,de:!1,te:p,ee:h,ne:m,re:y,se:g,rawExtraField:x,extendedTimestamp:m.length>0||y.length>0,ue:1+(s?2:0)+(i?4:0),ie:A,ae:v}),[t.filename,t]}))}async add(t="",e,r={}){const s=this;r=n.assign({},r);const{Jt:a}=s;let o,c;Ii<Lt().maxWorkers?Ii++:await new g(t=>Oi.push(t));try{if(t=t.trim(),ia(s,r,us)&&!t.endsWith(it)&&(t+=it),s.Gt.has(t))throw new w("File already exists");return s.Gt.add(t),c=!0,o=(async(t,e,r,s)=>{const a=Ni(t,e,s);({name:e}=a);const o=_i(t,e,s),{comment:c}=o,d=s[ps];let u;t.Yt.set(e,dt);try{const{le:c}=o;0==c.level||c.compressionMethod!==dt||c.passThrough||await Fr(Lt())||(c.level=0);const d=await(async(t,e,{le:r},s)=>{if(r.passThrough&&!e&&!ia(t,s,us))throw new w("Undefined reader");let i;return e&&(e=new We(e),await Ze(e),({size:i}=e)),n.assign({reader:e},Pi(t,!!e,i,r,s))})(t,r,o,s);({reader:r}=d);const l=Ki(t.writer),f=ji(t.writer),p=Wi(s=n.assign({},s,a.le,o.le,d.le,{signature:s[fs],crc32:s.crc32===dt?s[fs]:s.crc32,offset:t.offset-l,diskNumberStart:f})),h=Zi(s),m=ga(p.we,h.fe);u=await(async(t,e,r,s,a)=>{const{Yt:o,writer:c}=t,{keepOrder:d,dataDescriptor:u,signal:l}=a,{pe:f}=s,p=t.options[Dt],h=t.$t;let m,y,x,S,b,z,F,D={},A=0;o.set(e,D),t.$t=D;try{let y;d&&(y=h&&h.he,D.he=new g(t=>x=t)),a.bufferedWrite||!d||t.me||t.Qt||!u?(m=!0,t.Qt++,F=a.createTempStream?await a.createTempStream():new E(dt,dt,{highWaterMark:ut}),F.size=0,await Ze(c)):(F=c,await v()),await Ze(F);const k=Ki(c);t.Kt&&(delete t.Kt,await ta(c,$i()),t.offset+=4),p&&!m&&Bi(s,t.offset-k);const{we:T}=f;m||(await y,await C());const U=ji(c),I=Gi(t,c);if(D.diskNumberStart=U,m||(b=!0,z=c.size,await ta(F,T)),D=await(async(t,e,{diskNumberStart:r,he:s},a,o,c)=>{const{pe:d,ye:u,ge:l}=a,{ie:f,ae:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:x,compressionMethod:S,te:b,xe:z,ne:F,ue:E,re:D,se:R,ee:A}=d,{fe:v}=u,{rawFilename:C,lastAccessDate:k,creationDate:T,password:U,rawPassword:I,level:O,zip64:N,ce:L,oe:P,zipCrypto:W,dataDescriptor:B,directory:V,executable:Z,versionMadeBy:H,rawComment:q,rawExtraField:j,useWebWorkers:K,transferStreams:Y,onstart:G,onprogress:X,onend:J,signal:Q,encryptionStrength:$,extendedTimestamp:tt,msDosCompatible:et,internalFileAttributes:nt,externalFileAttributes:rt,uid:st,gid:it,unixMode:at,symlink:ot,setuid:ct,setgid:ut,sticky:lt,unixExternalUpper:wt,msdosAttributesRaw:ft,msdosAttributes:pt,useCompressionStream:ht,passThrough:mt,format:yt,codecURI:gt}=c,xt={he:s,versionMadeBy:H,zip64:N,directory:!!V,executable:!!Z,filenameUTF8:!0,rawFilename:C,commentUTF8:!0,rawComment:q,te:b,xe:z,ne:F,re:D,se:R,ee:A,rawExtraField:j,extendedTimestamp:tt,msDosCompatible:et,internalFileAttributes:nt,externalFileAttributes:rt,diskNumberStart:r,uid:st,gid:it,unixMode:at,symlink:!!ot,setuid:ct,setgid:ut,sticky:lt,unixExternalUpper:wt,msdosAttributesRaw:ft,msdosAttributes:pt};let{crc32:St,uncompressedSize:bt}=c,zt=0;mt||(bt=0);const{writable:Ft}=e;if(t){const n=Ht(je(t)),r=t.size,s={options:{codecType:xr,level:O,rawPassword:I,password:U,encryptionStrength:$,zipCrypto:y&&W,passwordVerification:y&&W&&m>>8&_,computeCrc32:!mt,compressed:g&&!mt,encrypted:y&&!mt,useWebWorkers:K,useCompressionStream:ht,transferStreams:Y,format:yt,codecURI:gt,compressionMethod:S},config:o,Ct:{signal:Q,size:r,onstart:G,onprogress:X,onend:J}};try{const t=await Ur({readable:n,writable:Ft},s);if(zt=t.outputSize,e.size+=zt,mt||(bt=t.inputSize,y&&!W||(St=t.crc32)),!P&&zt>=M||!L&&bt>=M)throw new w(vi)}catch(t){throw t.outputSize!==dt&&(e.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:n,pe:r,ye:s},{zip64:a,zipCrypto:o,passThrough:c,dataDescriptor:d})=>{const{ae:u,encrypted:l}=r,{Se:w,be:f}=s;l&&!o&&!c||t===dt||(ha(u,10,t),d&&ha(w,f,t)),a?d&&(ma(w,f+4,i(e)),ma(w,f+12,i(n))):(ha(u,14,e),ha(u,18,n),d&&(ha(w,f+4,e),ha(w,f+8,n)))})({crc32:St,compressedSize:zt,uncompressedSize:bt,pe:d,ye:u},c),B&&await ta(e,v),n.assign(xt,{uncompressedSize:bt,compressedSize:zt,lastModDate:h,rawLastModDate:m,creationDate:T,lastAccessDate:k,encrypted:!!y,zipCrypto:!!W,size:l+zt,compressionMethod:S,version:x,ie:f,ae:p,signature:St,crc32:!y||W||mt?St:dt,ue:E,ce:L,oe:P}),xt})(r,F,D,s,Lt(),a),m||(b=!1),o.set(e,D),D.filename=e,m){if(await g.all([F.writable.getWriter().close(),y]),await v(),S=!0,z=c.size,await C(),D.diskNumberStart=ji(c),D.offset=Gi(t,c),p){const e=s.ge;Bi(s,t.offset-Ki(c)),D.size+=s.ge-e}(({rawFilename:t,encrypted:e,zip64:n,xe:r,crc32:s,compressedSize:a,uncompressedSize:o,ce:c,oe:d},u,{dataDescriptor:l,passThrough:w})=>{if(l||((!e||w&&s!==dt)&&ha(u,14,s),d||ha(u,18,a),c||ha(u,22,o)),n&&r){const e=at+ga(t)+4;ma(u,e,i(o)),ma(u,e+8,i(a))}})(D,f.ze,a),await ta(c,f.we),await(async(t,e,n)=>{const r=e.writable.getWriter();try{await t.pipeTo(new R({async write(t){var e;await r.ready,await r.write(t),e=ga(t),A+=e}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}})(F.readable,c,l),c.size+=F.size,S=!1}else D.diskNumberStart=U,D.offset=I;return t.offset+=D.size,D}catch(n){if(S||b){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-z,m&&(t.offset+=A)}throw o.delete(e),n}finally{if(m&&t.Qt--,x&&x(),y&&y(),m&&F&&F.dispose)try{await F.dispose()}catch{}}async function v(){t.me=!0;const{Fe:e}=t;t.Fe=new g(e=>y=()=>{t.me=!1,e()}),await e}async function C(){Yi(c,ga(f.we))&&await c.closeDisk()}})(t,e,r,{pe:p,ye:h,ge:m},s)}catch(n){throw t.Yt.delete(e),n}return n.assign(u,{name:e,comment:c,extraField:d,[ts]:u.internalFileAttributes,[es]:u.externalFileAttributes}),new Ss(u)})(s,t,e,r),a.add(o),await o}catch(e){throw c&&s.Gt.delete(t),e}finally{a.delete(o);const t=Oi.shift();t?t():Ii--}}remove(t){const{Gt:e,Yt:n}=this;if(typeof t==pt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=ht,n={}){const{Jt:r,writer:s}=this,{writable:a}=s;if(!(t instanceof f))throw new w(bi);if(ga(t)>N)throw new w(Si);for(;r.size;)await g.allSettled(e.from(r));return await(async(t,n,r)=>{const s=Hi(t.Yt),{Ee:a,De:o}=await(async(t,n,r)=>{const{Yt:s,writer:i}=t,a=new f(n);await Ze(i);let o=0,c=0,d=ji(i),u=Ki(i);for(const[t,n]of e.from(s.values()).entries()){const{offset:e,rawFilename:l,te:w,ee:f,ne:p,re:h,se:m,rawExtraField:y,rawComment:g,versionMadeBy:x,ie:S,ae:b,ce:z,oe:F,de:E,Re:D,internalFileAttributes:R,externalFileAttributes:A,diskNumberStart:v,uncompressedSize:C,compressedSize:k}=n,T=ga(w,f,p,h,m,y),U=46+ga(l,g)+T;Yi(i,o+U-c)&&(await ta(i,a.slice(c,o)),c=o,await i.closeDisk()),0==t&&(d=ji(i),u=Ki(i)),z||ha(b,18,C),F||ha(b,14,k),(D||E)&&45>n.version&&pa(b,0,45);const I=qi(U);if(I.Ae(V),I.ve(x),I.Ce(S.subarray(0,24)),I.ve(T),I.ve(ga(g)),I.ve(E?N:v),I.ve(R),I.Ae(A),I.Ae(D?M:e),I.Ce(l),I.Ce(w),I.Ce(f),I.Ce(p),I.Ce(h),I.Ce(m),I.Ce(y),I.Ce(g),ya(a,I.v,o),o+=U,r.onprogress)try{await r.onprogress(t+1,s.size,new Ss(n))}catch{}}return await ta(i,c?a.slice(c):a),{Ee:{diskNumber:d,diskOffset:u},De:a}})(t,s,r),c=await(async(t,e,n)=>{const r=oa(t,n,Rt);if(r){const n=await r(e),s=ga(n);if(s>N)throw new w("Signature data exceeds 64KB");const i=qi(6+s);return i.Ae(B),i.ve(s),i.Ce(n),await ta(t.writer,i.v),6+s}return 0})(t,o,r);await(async(t,e,n,r)=>{const{writer:s}=t,{Ee:a,ke:o}=r;let{Te:c}=r,d=t.Yt.size,u=a.diskNumber,l=Gi(t,a),f=ji(s);Yi(s,j)&&f++;let p=ia(t,n,is);if(!(M>l&&M>c&&N>d&&N>f)){if(!1===p)throw new w(vi);p=!0}const h=ga(e);if(h>N)throw new w(Si);const m=qi(p?98:j);Yi(s,ga(m.v)+h)&&await s.closeDisk(),f=ji(s),p&&(m.Ae(H),m.Ue(44),m.ve(45),m.ve(45),m.Ae(f),m.Ae(u),m.Ue(d),m.Ue(d),m.Ue(c),m.Ue(l),m.Ae(q),m.Ae(f),m.Ue(i(Gi(t,s))+i(c)+i(o)),m.Ae(f+1),ia(t,n,"supportZip64SplitFile",!0)&&(f=N,u=N),d=N,l=M,c=M),m.Ae(Z),m.ve(f),m.ve(u),m.ve(d),m.ve(d),m.Ae(c),m.Ae(l),m.ve(h),await ta(s,m.v),h&&await ta(s,e)})(t,n,r,{Ee:a,Te:s,ke:c})})(this,t,n),!Ve(s)&&ia(this,n,Ft)||await a.getWriter().close(),s.getData?s.getData():a}}function Ni(t,n,r){n=n.trim();let i=ia(t,r,ss),a=ia(t,r,cs,i?20:768);const o=ia(t,r,ls),c=ua(t,r,"uid"),d=ua(t,r,"gid");let u=ua(t,r,hs),l=ia(t,r,"unixExtraFieldType"),f=ia(t,r,ms),p=ia(t,r,ys),h=ia(t,r,gs);if(c!==dt&&(!s.isInteger(c)||0>c||c>M))throw new w("Invalid uid (must be integer 0..2^32-1)");if(d!==dt&&(!s.isInteger(d)||0>d||d>M))throw new w("Invalid gid (must be integer 0..2^32-1)");if(u!==dt&&(!s.isInteger(u)||0>u||u>N))throw new w("Invalid UNIX mode (must be integer 0..65535)");if(l!==dt&&l!==Ti&&l!==Ui)throw new w("Invalid unixExtraFieldType (must be 'infozip' or 'unix')");if(l===Ui&&(c!==dt&&c>N||d!==dt&&d>N))throw new w("uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)");l!==dt||c===dt&&d===dt||(l=Ti);let m=ua(t,r,ns),y=ia(t,r,rs);const g=m!==dt||y!==dt;if(c!==dt||d!==dt||u!==dt||l||o?(i=!1,a=a&_|768):g&&(i=!0,a&=_),m!==dt&&(!s.isInteger(m)||0>m||m>_))throw new w("Invalid msdosAttributesRaw (must be integer 0..255)");if(y&&(typeof y!==ft||e.isArray(y)))throw new w("Invalid msdosAttributes (must be an object with boolean flags)");if(a>N)throw new w(zi);let x=ca(t,r,$r,es);const S=x!==dt;S||(x=0),!r[us]&&n.endsWith(it)&&(r[us]=!0);const b=ia(t,r,us);if(b?(n.endsWith(it)||(n+=it),S||(x=16,i||(x|=16877<<16))):i||S||(x=o?493<<16:27525120),!i){const t=u!==dt||!!(f||p||h);u=u===dt?x>>16&N:u&N,f?u|=rt:f=!!(u&rt),p?u|=st:p=!!(u&st),h?u|=512:h=!!(512&u),S&&!t||(b?u=-61441&u|nt:u&et||(u|=32768),x=(u&N)<<16|x&N)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==dt)t&=_;else if(e!==dt){const{readOnly:n,hidden:r,system:s,directory:i,archive:a}=e;let o=0;n&&(o|=1),r&&(o|=2),s&&(o|=4),i&&(o|=16),a&&(o|=32),t=o&_}return e===dt&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),g&&(x=x&M|m&_),{name:n,le:{versionMadeBy:a,msDosCompatible:!!i,externalFileAttributes:x,unixExternalUpper:x>>16&N,uid:c,gid:d,unixMode:u,unixExtraFieldType:l,symlink:u!==dt&&40960==(u&et),setuid:f,setgid:p,sticky:h,msdosAttributesRaw:m,msdosAttributes:y}}}function _i(t,e,n){const r=oa(t,n,"encodeText")||dn;let i=r(e,At);if(i===dt&&(i=dn(e)),ga(i)>N)throw new w("File entry name exceeds 64KB");const a=n[Wr]||"";if(typeof a!=pt)throw new w("Invalid file entry comment (must be a string)");let c=r(a,vt);if(c===dt&&(c=dn(a)),ga(c)>N)throw new w("File entry comment exceeds 64KB");const d=ia(t,n,os,20);if(d>N)throw new w(zi);const u=aa(t,n,jr,new o),l=aa(t,n,Yr),f=aa(t,n,Xr),p=ca(t,n,Qr,ts,0),h=ia(t,n,gt),m=ia(t,n,mt),y=ia(t,n,yt);Ot(m,y);const g=ua(t,n,"encryptionStrength",3),x=ia(t,n,ds),S=ia(t,n,"extendedTimestamp",!0),b=ia(t,n,"ntfsTimestamp"),z=ia(t,n,"keepOrder",!0),F=ia(t,n,St),E=ia(t,n,zt),D=ia(t,n,"bufferedWrite"),R=oa(t,n,"createTempStream"),A=ia(t,n,"dataDescriptorSignature",!0),v=It(ia(t,n,xt)),C=ia(t,n,"useUnicodeFileNames",!0),k=ia(t,n,ws),T=h||k===dt?dt:Ge(k);if(!h&&k!==dt&&0!==k&&8!==k&&!T)throw new w("Compression method not supported");let U=ua(t,n,"level");if(U!==dt&&(!s.isInteger(U)||0>U||U>9))throw new w("Invalid level (must be integer 0..9)");if(t.options[Dt]){if(m!==dt||y!==dt)throw new w("Encryption is not supported in USDZ files");U===dt&&k===dt&&(U=0)}let I=ia(t,n,bt),O=ia(t,n,"dataDescriptor");D&&O===dt&&(O=!1),(O===dt||x)&&(O=!0),U!==dt&&6!=U&&(I=!1);const M=ia(t,n,is);if(!(x||m===dt&&y===dt||s.isInteger(g)&&g>=1&&3>=g))throw new w("The strength must equal 1, 2, or 3");const _=Li(n[ps]),L=Li(n.localExtraField);return{comment:a,le:{rawFilename:i,rawComment:c,version:d,lastModDate:u,lastAccessDate:l,creationDate:f,internalFileAttributes:p,passThrough:h,password:m,rawPassword:y,encryptionStrength:g,zipCrypto:x,extendedTimestamp:S,ntfsTimestamp:b,keepOrder:z,useWebWorkers:F,transferStreams:E,bufferedWrite:D,createTempStream:R,dataDescriptorSignature:A,signal:v,useUnicodeFileNames:C,compressionMethod:k,format:T?T.format:dt,codecURI:T?T.codecURI:dt,Ie:T?T.versionNeeded:dt,level:U,useCompressionStream:I,dataDescriptor:O,zip64:M,rawExtraField:_,Oe:L}}}function Li(t){if(!t)return ht;if(!(t instanceof c))throw new w("Invalid extra field (must be a Map)");let e=0,n=0;t.forEach((t,n)=>{if(!s.isInteger(n)||0>n||n>N)throw new w("Invalid extra field type (must be integer 0..65535)");if(!(t instanceof f))throw new w("Invalid extra field data (must be a Uint8Array)");if(ga(t)>N)throw new w(Fi);e+=4+ga(t)});const r=new f(e),i=Zt(r);return t.forEach((t,e)=>{pa(i,n,e),pa(i,n+2,ga(t)),ya(r,t,n+4),n+=4+ga(t)}),r}function Pi(t,e,n,r,s){const{passThrough:i,zipCrypto:a,password:o,rawPassword:c,encryptionStrength:d}=r;let{dataDescriptor:u,zip64:l,level:f,compressionMethod:p}=r,h=0,m=0;if(i&&e&&(m=s[Vr],m===dt))throw new w("Undefined uncompressed size");const y=!0===l,g=ia(t,s,as);if(e&&i&&!g&&ga(o,c))throw new w("Encryption is not supported when the 'passThrough' option is set");const x=e&&(!!(o&&ga(o)||c&&ga(c))||i&&g);e||(f=0,p=0);const S=x?a?12:16+4*d:0;e&&(i?(s.uncompressedSize=m,h=n===dt?la(m)+S:n):n===dt?(u=!0,(l||l===dt)&&(l=!0,m=h=4294967296)):(s.uncompressedSize=m=n,h=(wa(p,f)?la(m):m)+S));const b=y||m>=M,z=y||h>=M;if(b||z){if(!1===l)throw new w(vi);l=!0}return l=l||!1,{Me:h,le:{dataDescriptor:u,zip64:l,ce:b,oe:z,uncompressedSize:m,level:f,compressionMethod:p,encrypted:x}}}function Wi(t){const{rawFilename:e,lastModDate:n,lastAccessDate:r,creationDate:s,level:i,zip64:c,zipCrypto:d,useUnicodeFileNames:u,dataDescriptor:l,directory:f,rawExtraField:p,Oe:h,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:g,passThrough:x,encrypted:S,ce:b,oe:z,uncompressedSize:F,crc32:E}=t;let{version:D,compressionMethod:R}=t;const A=!f&&wa(R,i);let v;const C=x||!A,k=c&&(t.bufferedWrite||!l||!b&&!z||C),T=k||c&&l&&(b||z);if(c&&(b||z)){const t=20,e=qi(t);if(e.ve(1),e.ve(t-4),v=e.v,k&&(e.Ue(F),C)){const t=S?d?12:16+4*m:0;e.Ue(x?0:F+t)}}else v=ht;let U,I,O,M,_;if(S&&!d){const t=qi(ga(ki)+2);t.ve(G),t.Ce(ki),U=t.v,U[8]=m}else U=ht;if(y){const t=na(n),e=ra(t);if(e){const e=9+(r?4:0)+(s?4:0),n=qi(e);M=1+(r?2:0)+(s?4:0),n.ve(X),n.ve(e-4),n.Ne(M),n.Ae(t),r&&n.Ae(sa(na(r))),s&&n.Ae(sa(na(s))),O=n.v}else O=ht;if(g===dt?!e||r||s:g)try{const t=ea(n),e=qi(36);e.ve(10),e.ve(32),e._e(4),e.ve(1),e.ve(24),e.Ue(t),e.Ue(r?ea(r):t),e.Ue(s?ea(s):t),I=e.v}catch{I=ht}else I=ht}else I=O=ht;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=Ti||e===dt&&n===dt)if(r!=Ui||e===dt&&n===dt)_=ht;else{const t=qi(8);t.ve($),t.ve(4),t.ve((e===dt?0:e)&N),t.ve((n===dt?0:n)&N),_=t.v}else{const t=Vi(e),r=Vi(n),s=3+t.length+r.length,i=qi(4+s);i.ve(Q),i.ve(s),i.Ne(1),i.Ne(t.length),i.Ce(t),i.Ne(r.length),i.Ce(r),_=i.v}}catch{_=ht}R===dt&&(R=A?8:0);const{Ie:P}=t;A&&P!==dt&&(D=D>P?D:P),c&&(D=D>45?D:45),S&&!d&&(D=D>51?D:51,x&&E!==dt&&(U[4]=1),U[9]=R,R=99);const W=T?ga(v):0,B=W+ga(U,O,I,_,p,h);if(B>N)throw new w(Fi);const V=new o(2e3*a.ceil(a.floor(n.getTime()/1e3)/2)),{ie:Z,ae:H,rawLastModDate:q}=xa({version:D,bitFlag:Sa(i,u,l,S,R),compressionMethod:R,uncompressedSize:F,lastModDate:ct>V?ct:V>ot?ot:V,rawFilename:e,oe:z,ce:b,extraFieldLength:B}),j=qi(at+ga(e)+B),K=j.v,Y=Zt(K);return j.Ae(L),j.Ce(Z),j.Ce(e),T&&j.Ce(v),j.Ce(U),j.Ce(O),j.Ce(I),j.Ce(_),j.Ce(p),j.Ce(h),l&&(z||ha(Y,18,0),b||ha(Y,22,0)),{we:K,ze:Y,ie:Z,ae:H,lastModDate:n,rawLastModDate:q,encrypted:S,compressed:A,version:D,compressionMethod:R,ue:M,te:ht,xe:W,ne:O,re:I,se:_,ee:U,extraFieldLength:B}}function Bi(t,e){const{pe:n}=t;let{we:r,extraFieldLength:s}=n,i=64-(e+ga(r))%64;4>i&&(i+=64);const a=new f(i),o=Zt(a);pa(o,0,J),pa(o,2,i-4);const c=r;n.we=r=new f(ga(c)+i),ya(r,c),ya(r,a,ga(c));const d=Zt(r);pa(d,28,s+i),n.ze=d,t.ge+=i}function Vi(t){if(t===dt)return ht;{const e=new f(4);Zt(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}}function Zi({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,s=ht,i=0,a=t?20:12;return n&&(a+=4),e&&(s=new f(a),r=Zt(s),n&&(i=4,ha(r,0,W))),{fe:s,Se:r,be:i}}function Hi(t){let e=0;for(const[,n]of t){const{rawFilename:t,ee:r,rawComment:s,re:i,se:a,rawExtraField:o,extendedTimestamp:c,ue:d,lastModDate:u,ce:l,oe:f,uncompressedSize:p,compressedSize:h}=n,m=n.offset>=M,y=n.diskNumberStart>=N;let g,x;if(m||y||l||f){const t=4+(l?8:0)+(f?8:0)+(m?8:0)+(y?4:0),e=qi(t);e.ve(1),e.ve(t-4),l&&e.Ue(p),f&&e.Ue(h),m&&e.Ue(n.offset),y&&e.Ae(n.diskNumberStart),g=e.v}else g=ht;n.te=g,n.Re=m,n.de=y;const S=na(u);if(c&&ra(S)){const t=qi(9);t.ve(X),t.ve(5),t.Ne(d),t.Ae(S),x=t.v}else x=ht;n.ne=x;const b=ga(g,r,i,a,x,o);if(b>N)throw new w(Fi);e+=46+ga(t,s)+b}return e}function qi(t){const e=new f(t),n=Zt(e);let r=0;return{v:e,Ne:t=>{((t,e,n)=>{t.setUint8(e,n)})(n,r,t),r+=1},ve:t=>{pa(n,r,t),r+=2},Ae:t=>{ha(n,r,t),r+=4},Ue:t=>{ma(n,r,i(t)),r+=8},Ce:t=>{ya(e,t,r),r+=ga(t)},_e:t=>r+=t}}function ji(t){const{diskNumber:e=0}=t;return e}function Ki(t){const{diskOffset:e=0}=t;return e}function Yi(t,e){const{availableSize:n=ut}=t;return e>n}function Gi(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.Xt:0)}async function Xi(t,e,n,r){if(r>0){const{writer:s}=t;await je(e,{offset:n,size:r}).pipeTo(s.writable,{preventClose:!0,preventAbort:!0}),s.size+=r,t.offset+=r}}async function Ji(t,e){const n=await qe(t,e,at);if(ga(n)<at)return at;const r=Zt(n);return at+fa(r,26)+fa(r,28)}function Qi(t,{offset:e,diskNumberStart:n}){return e+(t.O?t.O(n):0)}function $i(){const t=new f(4);return ha(Zt(t),0,P),t}async function ta(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=ga(e),await r.write(e)}finally{r.releaseLock()}}function ea(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return Ri>e?Ri:e>Ai?Ai:e}}function na(t){return a.floor(t.getTime()/1e3)}function ra(t){return t>=Ei&&Di>=t}function sa(t){return a.min(Di,a.max(Ei,t))}function ia(t,e,n,r){const s=e[n]===dt?t.options[n]:e[n];return s===dt?r:s}function aa(t,e,n,r){const i=ia(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=wt||s.isNaN(i.getTime())))throw new w("Invalid date (must be a valid Date instance)");return i}function oa(t,e,n){return Ut(ia(t,e,n))}function ca(t,e,n,r,s){const i=da(e,n,r),a=i===dt?da(t.options,n,r):i;return a===dt?s:a}function da(t,e,n){return t[e]===dt?t[n]:t[e]}function ua(t,e,n,r){return Mt(ia(t,e,n,r))}function la(t){return t+5*(a.floor(t/16383)+1)}function wa(t,e){return t===dt?e===dt||e>0:0!==t}function fa(t,e){return t.getUint16(e,!0)}function pa(t,e,n){t.setUint16(e,n,!0)}function ha(t,e,n){t.setUint32(e,n,!0)}function ma(t,e,n){t.setBigUint64(e,n,!0)}function ya(t,e,n){t.set(e,n)}function ga(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function xa({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:s,lastModDate:i,rawLastModDate:a,rawFilename:o,oe:c,ce:d,extraFieldLength:u}){const l=qi(26),w=l.v,f=Zt(w);if(l.ve(t),l.ve(e),l.ve(n),a===dt){const t=new h(1),e=Zt(t);pa(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),pa(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),a=t[0]}return l.Ae(a),l._e(4),c||s!==dt?l.Ae(c?M:s):l._e(4),d||r!==dt?l.Ae(d?M:r):l._e(4),l.ve(ga(o)),l.ve(u),{ie:w,ae:f,rawLastModDate:a}}function Sa(t,e,n,r,s){let i=0;return e&&(i|=tt),n&&(i|=8),8!=s&&9!=s||(0>t||t>3||(i|=6),t>3&&5>=t&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}const ba="Entry filename already exists",za="Readable stream already consumed",Fa="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Ea="Invalid readerOptions (must be an object)",Da="zipjs-abort-export",Ra="The operation was aborted",Aa=new d([1,G,10,X,28789,25461,J,Q,$,22613,13]);class va{constructor(t,e,r,s){const i=this;if(t.root&&s&&s.getChildByName(e))throw new w(ba);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Le++,parent:s,children:[],uncompressedSize:r.uncompressedSize||0,Pe:r.Pe||r.uncompressedSize===dt,passThrough:r.passThrough,We:r.We||new o}),!s&&t.root||(t.entries[i.id]=i),s&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return!!e}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw new w(ba);this.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class Ca extends va{constructor(t,e,n,r){super(t,e,n,r);const s=this;s.Reader=n.Reader,s.Writer=n.Writer,n.getData&&(s.getData=n.getData)}clone(){return new Ca(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&((t,e)=>{const{contentType:n}=t;return n===dt||(t.constructor==pe?e.type==n:t.constructor!=ue||e.startsWith(t.data))})(t,n.data))return n.data;{const r=n.reader=La(n.Reader,n.data,e),s=n.uncompressedSize||r.size;await g.all([Ze(r),Ze(t,s)]);const i=It(e.signal),a=((t,e,n,r)=>{const{onstart:s,onprogress:i,onend:a}=n,{readable:o}=e;return t.data instanceof Ss||!s&&!i&&!a?o:Ht(o).pipeThrough(new Dr({onstart:s,onprogress:i,onend:a,size:e.size}),{signal:r})})(n,r,e,i),o=!Ve(t)&&!!e.preventClose;return n.uncompressedSize=r.size,await Ht(a).pipeTo(jt(t.writable),{signal:i,preventClose:o,preventAbort:o}),t.getData?t.getData():t.writable}}isPasswordProtected(){return!(!this.data||!this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==hn)return!1;throw t}}getText(t,e){return this.getData(new ye(t),e)}getBlob(t,e){return this.getData(new pe(t),e)}getData64URI(t,e){return this.getData(new ue(t),e)}getUint8Array(t){return this.getData(new _e,t)}getWritable(t=new R,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Vt(await this.getUint8Array(t)).buffer}replaceBlob(t){n.assign(this,{data:t,Reader:fe,Writer:pe,reader:null})}replaceText(t){n.assign(this,{data:t,Reader:he,Writer:ye,reader:null})}replaceData64URI(t){n.assign(this,{data:t,Reader:de,Writer:ue,reader:null})}replaceUint8Array(t){n.assign(this,{data:t,Reader:Ne,Writer:_e,reader:null})}replaceReadable(t){n.assign(this,{data:null,Reader:Na(t),Writer:null,reader:null})}}class ka extends va{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new ka(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return Xa(this,t,{options:e},!0)}addText(t,e,n={}){return Xa(this,t,{data:e,Reader:he,Writer:ye,options:n,uncompressedSize:me(e)})}addBlob(t,e,n={}){return Xa(this,t,{data:e,Reader:fe,Writer:pe,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){let r=e.length;for(;"="==e.charAt(r-1);)r--;const s=e.indexOf(",")+1;return Xa(this,t,{data:e,Reader:de,Writer:ue,options:n,uncompressedSize:a.floor(.75*(r-s))})}addUint8Array(t,e,n={}){return Xa(this,t,{data:e,Reader:Ne,Writer:_e,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return Xa(this,t,{data:e,Reader:class extends Me{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return Xa(this,t,{Reader:Na(e),options:n})}addFileSystemEntry(t,e={}){return Ka(this,t,e)}addFileSystemHandle(t,e={}){return Ka(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new o(t.lastModified)),Xa(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new fe(t),e)}importData64URI(t,e){return this.importZip(new de(t),e)}importUint8Array(t,e){return this.importZip(new Ne(t),e)}importHttpContent(t,e){return this.importZip(new Me(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new pe(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new ue(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new _e,t)}async exportWritable(t=new R,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const{onstart:s,onprogress:i,onend:a}=r,o=Ha(r.readerOptions),c=new AbortController,{signal:d}=c,u=((t,e)=>{if(!It(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)})(r.signal,c),l=n.assign({},r,o,{signal:d,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),f=Ia([t],t=>Ma(t,l.passThrough)),p=[];let h=!1,m=0;try{s&&await Rr(s,f),await x(t,e),a&&await Rr(a,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{u()}return e;function y(t){const e=t.getWriter();return new R({async write(t){await e.write(t),m+=t.length,i&&await Rr(i,m,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function x(t,e){if(r.concurrent){const n=(await g.allSettled(t.children.map(t=>S(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Ba(t.reason));throw(t=>{const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e})((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await S(n,e)}async function S(e,n){if(d.aborted){if(h||Ba(d.reason))return;throw d.reason===dt?new DOMException(Ra,"AbortError"):d.reason}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await x(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),s=await r.createWritable();try{await e.getData({writable:y(s)},l)}catch(t){throw h?new w(Da):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new w(Da));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}})(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==wt?(r=t,e=n.assign({},r.options,e)):(await Ze(t),r=new Hs(t,e));const s=[],i=await r.getEntries(e);for(const t of i){let r=this;try{const i=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=i.pop();if(i.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw new w(ba)}else r=new ka(this.fs,t,{data:null},e),s.push(r)}),t.directory){let e=r;if(a)if(e=r.getChildByName(a),e){if(!e.directory)throw new w(ba)}else e=new ka(this.fs,a,{data:null},r),s.push(e);e==this||e.data||(e.data=t)}else s.push(Xa(r,a,{data:t,Reader:_a(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return s}async exportZip(t,e={}){const r=this;(e=n.assign({},e)).bufferedWrite===dt&&(e.bufferedWrite=!0);const[s]=await g.all([Pa(r,Ha(e.readerOptions)),Ze(t)]),i=new Mi(t,e);return await(async(t,e,r,s,i)=>{const{onstart:a,onprogress:o,onend:c,onentryprogress:d}=s,u=e,l=Ia(e.children,t=>ja(t)?0:1);let w=0,f=0;if(a&&await Rr(a,r),s.bufferedWrite)await async function t(e){const n=(await g.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(ja(e))return;const{name:a,Be:c}=Va(e,u,s);let p=0;const h=await t.add(a,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{w+=t-p,p=t,o&&await Rr(o,w,r)}}));f++,d&&await Rr(d,f,l,h)}c&&await Rr(c,w)})(i,r,Ia([r],Oa),e,s),await i.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(t={}){const e=this;Ha((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=!t.bufferedWrite||!1!==t.keepOrder&&e.children.every(t=>!t.children.length);return(async(t,e,r,s)=>{const i={options:t};if(Ut(t[Rt]))throw new w(Ci);if(s!==dt&&!(s instanceof f))throw new w(bi);const a=ga(s);if(a>N)throw new w(Si);const o=t[Dt],d=new c;let u=!!o,l=0;for(const t of e){let{name:e}=t;const{size:r}=t,s=n.assign({},t.options);e=e.trim(),ia(i,s,us)&&!e.endsWith(it)&&(e+=it);const a=Ni(i,e,s);({name:e}=a);const{le:c}=_i(i,e,s);0==c.level||c.compressionMethod!==dt||c.passThrough||await Fr(Lt())||(c.level=0);const f=!ia(i,s,us);if(f&&r===dt)throw new w(Ci);const{Me:p,le:h}=Pi(i,f,r,c,s);if(f&&!c.passThrough&&wa(h.compressionMethod,h.level))throw new w(Ci);const m=n.assign({},s,a.le,c,h),y=Wi(m),g=Zi(m),x={pe:y,ge:ga(y.we,g.fe)};o&&Bi(x,l);const S=f?p:0;M>l||(u=!0),d.set(e,n.assign({},m,y,{offset:l,diskNumberStart:0,compressedSize:S})),l+=x.ge+S}if(u&&!r)throw new w(Ci);const p=Hi(d);let h=ia(i,t,is);if(l>=M||p>=M||d.size>=N){if(!1===h)throw new w(vi);h=!0}return l+p+a+(h?98:j)})(t,e.getChildren({recursive:!0}).filter(t=>!ja(t)).map(n=>{const{name:r,Be:s}=Va(n,e,t);return{name:r,size:n.directory?0:Za(n,qa(n,t)),options:s}}),r,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return((t,e)=>{const n=[],r=[t];let s=0;for(;s<r.length;)for(const t of r[s++].children)n.push(t),e&&r.push(t);return n})(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await g.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class Ta{constructor(){Ga(this)}get children(){return this.root.children}remove(t){Wa(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new w("Root directory cannot be moved");if(!e.directory)throw new w("Target entry is not a directory");if(e.isDescendantOf(t))throw new w("Entry is a ancestor of target entry");if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new w(ba)}else Wa(t),t.parent=e,e.children.push(t),((t,e)=>{const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}})(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.getChildByName(e[t]);return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Ga(this),this.root.importBlob(t,e)}importData64URI(t,e){return Ga(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return Ga(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return Ga(this),this.root.importHttpContent(t,e)}importReadable(t,e){return Ga(this),this.root.importReadable(t,e)}importZip(t,e){return Ga(this),this.root.importZip(t,e)}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const Ua={FS:Ta,ZipDirectoryEntry:ka,ZipFileEntry:Ca};function Ia(t,n){let r=0;const s=e.from(t);for(;s.length;){const t=s.pop();r+=n(t)||0;for(const e of t.children)s.push(e)}return r}function Oa(t){return t.uncompressedSize}function Ma(t,e){const{data:n}=t;return e&&n instanceof Ss?n.compressedSize:t.uncompressedSize}function Na(t){let e;return()=>{if(e)throw new w(za);return e=!0,{readable:t}}}function _a(t){return class extends oe{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:s,checkOverlappingEntryOnly:i}=r,a=await e.entry.getData(new pe,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||s,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=a,e.Ve=new fe(a),e.size=a.size,super.init()}readUint8Array(t,e){return this.Ve.readUint8Array(t,e)}}}function La(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Pa(t,e){const n=[],r=[t],s=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await g.all(n.map(async t=>{const n=t.reader=La(t.Reader,t.data,e);s.set(t,n);try{await Ze(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.Pe=!1)})),s}function Wa(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Ba(t){return!!t&&t.message==Da}function Va(t,e,r){const s=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let a={},o={};if(t.data instanceof Ss){const{externalFileAttributes:e,versionMadeBy:s,comment:i,lastModDate:d,creationDate:u,lastAccessDate:l,uncompressedSize:w,encrypted:f,zipCrypto:p,crc32:h,compressionMethod:m,extraFieldAES:y,internalFileAttributes:g,extraField:x,uid:S,gid:b}=t.data;a={externalFileAttributes:e,versionMadeBy:s,comment:i,lastModDate:d,creationDate:u,lastAccessDate:l,internalFileAttributes:g};const z=(t=>{if(t){const e=new c;if(t.forEach((t,n)=>{Aa.has(n)||e.set(n,t.data)}),e.size)return e}})(x);if(z&&(a.extraField=z),S===dt&&b===dt||n.assign(a,{uid:S,gid:b,unixExtraFieldType:"infozip"}),qa(t,r)){let t,e;0===m&&(t=0),y&&(e=y.strength),o={passThrough:!0,encrypted:f,zipCrypto:p,crc32:h,uncompressedSize:w,level:t,encryptionStrength:e,compressionMethod:m}}}const d=n.assign({lastModDate:t.We},a,r,i,o,{directory:t.directory});if(!t.directory&&d.passThrough&&d.uncompressedSize===dt)throw new w(Fa);return{name:s,Be:d}}function Za(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.Pe?dt:Ma(t,e)}function Ha(t){if(t&&(typeof t!=ft||e.isArray(t)))throw new w(Ea);return t}function qa(t,e){const{readerOptions:n}=e;return!(t.directory||!(t.passThrough||n&&n.passThrough))}function ja(t){return t.directory&&null===t.data}function Ka(t,e,r){return async function t(e,s,i,a=""){if(s){const c=a?a+"/"+s.name:s.name;try{if((s.isFile||s.isDirectory)&&(s=await Ya(s)),"file"==s.kind){const t=await s.getFile();i.push(Xa(e,t.name,{Reader:()=>({readable:t.stream(),size:t.size}),options:n.assign({},{lastModDate:new o(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==s.kind){const n=e.addDirectory(s.name,r);i.push(n);for await(const e of s.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function Ya(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new g((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await(async t=>{const e=[];function n(t,r,s){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await Ya(t));n(t,r,s)}else r(e)},s)}return await new g((e,r)=>n(t.createReader(),e,r)),{[T.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}})(t);e.values=()=>n}return e}function Ga(t){t.entries=[],t.Le=0,t.root=new ka(t)}function Xa(t,e,n,r){if(t.directory)return r?new ka(t.fs,e,n,t):new Ca(t.fs,e,n,t);throw new w("Parent entry is not a directory")}t.ERR_ABORTED=Ra,t.ERR_ENTRY_EXISTS=ba,t.ERR_INVALID_PASS_THROUGH=Fa,t.ERR_INVALID_READER_OPTIONS=Ea,t.ERR_READABLE_CONSUMED=za,t.ZipDirectoryEntry=ka,t.ZipEntry=va,t.ZipFS=Ta,t.ZipFileEntry=Ca,t.fs=Ua});
|
|
1
|
+
((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})})(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:s,BigInt:i,Math:a,Date:o,Map:c,Set:d,Response:u,URL:l,Error:w,Uint8Array:f,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:g,TextEncoder:x,TextDecoder:S,document:b,crypto:z,btoa:F,TransformStream:E,ReadableStream:D,WritableStream:R,CompressionStream:A,DecompressionStream:v,navigator:C,Worker:k,Symbol:T,setTimeout:U,clearTimeout:I,structuredClone:O}="undefined"!=typeof globalThis?globalThis:this||self,M=4294967295,N=65535,_=255,L=67324752,P=134695760,W=P,B=84233040,V=33639248,Z=101010256,H=101075792,q=117853008,j=22,K=20,Y=56,G=39169,X=21589,J=6534,Q=30837,$=30805,tt=2048,et=61440,nt=16384,rt=2048,st=1024,it="/",at=30,ot=new o(2107,11,31,23,59,58),ct=new o(1980,0,1),dt=void 0,ut=1/0,lt="undefined",wt="function",ft="object",pt="string",ht=new f,mt="password",yt="rawPassword",gt="passThrough",xt="signal",St="useWebWorkers",bt="useCompressionStream",zt="transferStreams",Ft="preventClose",Et="offset",Dt="usdz",Rt="signCentralDirectory",At="filename",vt="comment",Ct="strict",kt="balanced",Tt="tolerant";function Ut(t){if(t&&typeof t!=wt)throw new w("Invalid option (must be a function)");return t}function It(t){if(t&&(typeof t.addEventListener!=wt||"boolean"!=typeof t.aborted))throw new w("Invalid signal (must be an AbortSignal instance)");return t||dt}function Ot(t,e){if(t&&typeof t!=pt||e&&!(e instanceof f))throw new w("Invalid password (password must be a string, rawPassword must be a Uint8Array)")}function Mt(t){return typeof t==pt&&t.trim()?s(t):t}let Nt=2;try{typeof C!=lt&&C.hardwareConcurrency&&(Nt=C.hardwareConcurrency)}catch{}const _t={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:Nt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=lt&&A,DecompressionStream:typeof v!=lt&&v};function Lt(){return _t}function Pt(t){return Wt(t.chunkSize)}function Wt(t){return t=Mt(t),s.isInteger(t)&&t>=1?a.max(t,64):65536}function Bt(t,e){const n=new f(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Vt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new f(t):t}function Zt(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function Ht(t){if(t instanceof D)return t;const e=t.getReader();return new D({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function qt(t,e){t=Ht(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=wt||new y([]).stream()instanceof D)return new u(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new R({write(t){r.push(t)}})).then(()=>new y(r,n))}function jt(t){if(t instanceof R)return t;const e=t.getWriter();return new R({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const Kt="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function Yt(t,e){return Gt(t,e,!0)}function Gt(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let n=0;n<t.length;n++)e+=Kt[t[n]];return e}})(t):new S(e,{ignoreBOM:n}).decode(t)}const Xt="HTTP error ",Jt="HTTP Range not supported",Qt="HTTP resource changed",$t="Content-Range",te="Range",ee="GET",ne="bytes",re=16777216,se="writable",ie=T();class ae{constructor(){this.size=0}init(){this.initialized=!0}}class oe extends ae{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=Pt(Lt())}={}){const r=this;let s=0;return n=Wt(n),new D({async pull(i){const o=e===dt?n:a.min(n,e-s),c=await qe(r,t+s,o);c.length&&i.enqueue(c),s+n>=e||!c.length&&o?i.close():s+=n}})}}class ce extends ae{constructor(){super();const t=this,e=new R({write(e){if(!t.initialized)throw new w("Writer not initialized");return t.writeUint8Array(Vt(e))}});n.defineProperty(t,se,{get:()=>e})}writeUint8Array(){}}class de extends oe{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{o:t,l:r,size:a.floor(.75*(e-r))})}readUint8Array(t,e){const{l:n,o:r}=this,s=new f(e),i=4*a.floor(t/3),o=atob(r.substring(i+n,4*a.ceil((t+e)/3)+n)),c=t-3*a.floor(i/4);let d=0;for(let t=c;t<c+e&&t<o.length;t++)s[t-c]=o.charCodeAt(t),d++;return d<s.length?s.subarray(0,d):s}}class ue extends ce{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",h:""})}writeUint8Array(t){const e=this;let n,s=e.h;const i=e.h.length;for(e.h="",n=0;n<3*a.floor((i+t.length)/3)-i;n++)s+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.h+=r.fromCharCode(t[n]);s.length>2?e.data+=F(s):e.h=s+e.h}getData(){return this.data+F(this.h)}}let le,we;class fe extends oe{constructor(t){super(),n.assign(this,{m:t,size:t.size}),we||(we=(async()=>{try{const t=new y([new f(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();le=1==e}catch{le=!1}})())}createReadable(t){const{m:e,size:n}=this,{offset:r=0,size:s=n-r}=t||{};return!r&&s>=n?Ht(e.stream()):le?Ht(e.slice(r,r+s).stream()):super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,s=!t&&r>=n.size?n.m:n.m.slice(t,r);let i=await s.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new f(i)}}class pe extends ae{constructor(t){super();const e=this,r=new E;n.defineProperty(e,se,{get:()=>r.writable}),e.contentType=t,e.S=qt(r.readable,t),e.S.catch(()=>{})}getData(){return this.S}}class he extends fe{constructor(t){super(new y([t],{type:"text/plain"}))}}function me(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class ye extends pe{constructor(t){super(),n.assign(this,{encoding:t,F:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,F:e}=this,n=await super.getData();return n.text&&e?n.text():((t,e)=>Gt(t,e,!1))(new f(await n.arrayBuffer()),t)}}class ge extends oe{constructor(t,e){super(),Se(this,t,e)}async init(){await be(this,Ie,Ce),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&n<i)return((t,e,n)=>{let r,i=e,o=0,c=n;return new D({start:()=>d(),async pull(t){r||await d();const{value:e,done:n}=await r.read();if(n)throw new w(Jt);const s=e.length>o?e.subarray(0,o):e;o-=s.length,c-=s.length,s.length&&t.enqueue(s),o||(await(async()=>{const t=r;r=dt,await t.cancel()})(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function d(){const e=a.min(t.maximumRangeSize,c),n=await Ie(ee,t,Ae(t,i,e));if(206!=n.status)throw new w(Jt);const d=n.headers.get($t);if(d){const t=s(d.trim().split(/[\s-]+/)[1]);if(!s.isNaN(t)&&t!=i)throw new w(Jt)}Re(t,n),De(t,n),i+=e,o=e,r=n.body.getReader()}})(e,n,a.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return ze(this,t,e,Ie,Ce)}}class xe extends oe{constructor(t,e){super(),Se(this,t,e)}async init(){await be(this,Oe,ke),super.init()}readUint8Array(t,e){return ze(this,t,e,Oe,ke)}}function Se(t,e,r){const{preventHeadRequest:s,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o,checkResourceChanges:c=!0,maximumRangeSize:d=re,fetch:u}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:s,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o,checkResourceChanges:c,maximumRangeSize:d,fetch:u})}async function be(t,e,n){const{url:r,preventHeadRequest:s,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=Lt(),{protocol:n}=new l(t,e);return"http:"==n||"https:"==n})(r)&&(i||a)&&(typeof s==lt||s)){const r=await e(ee,t,Ae(t,o?-22:void 0)),s=r.headers.get("Accept-Ranges");if(!(a||s&&s.toLowerCase()==ne))throw new w(Jt);{if(o){const e=new f(await r.arrayBuffer());206==r.status&&e.length==j&&(t.D=e)}De(t,r);const s=Fe(r);s===dt?await Ue(t,e,n):t.size=s}}else await Ue(t,e,n)}async function ze(t,e,n,r,i){const{useRangeHeader:a,forceRangeRequests:o,D:c,size:d,options:u}=t;if(a||o){if(c&&e==d-j&&n==j)return c;if(e>=d||0===n)return ht;{e+n>d&&(n=d-e);const i=await r(ee,t,Ae(t,e,n));if(206!=i.status)throw new w(Jt);const a=i.headers.get($t);if(a){const t=s(a.trim().split(/[\s-]+/)[1]);if(!s.isNaN(t)&&t!=e)throw new w(Jt)}Re(t,i),De(t,i);const o=new f(await i.arrayBuffer());if(o.length!=n)throw new w(Jt);return o}}{const{data:r}=t;return r||await i(t,u),t.data.subarray(e,e+n)}}function Fe(t){const e=t.headers.get($t);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=s(t);if(!s.isNaN(e))return e}}}function Ee({headers:t}){return{R:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function De(t,e){const{checkResourceChanges:n,A:r}=t;n&&!r&&206==e.status&&(t.A=Ee(e))}function Re(t,e){const{checkResourceChanges:r,A:s,size:i}=t;if(r){const t=Fe(e);if(t!==dt&&i!==dt&&t!=i)throw new w(Qt);if(s){const t=Ee(e);if(n.entries(s).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new w(Qt)}}}function Ae(t,e=0,r=1){return n.assign({},ve(t),{[te]:ne+"="+(e<0?e:e+"-"+(e+r-1))})}function ve({options:t}){const{headers:e}=t;if(e)return T.iterator in e?n.fromEntries(e):e}async function Ce(t){await Te(t,Ie)}async function ke(t){await Te(t,Oe)}async function Te(t,e){const n=await e(ee,t,ve(t));t.data=new f(await n.arrayBuffer()),t.size=t.data.length}async function Ue(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,ve(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=s(i):await n(t,t.options)}}async function Ie(t,{fetch:e=fetch,options:r,url:s},i){const a=await e(s,n.assign({},r,{method:t,headers:i}));if(a.status<400)return a;throw 416==a.status?new w(Jt):new w(Xt+(a.statusText||a.status))}function Oe(t,{url:e},r){return new g((s,i)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status<400){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),s({status:a.status,arrayBuffer:()=>a.response,headers:new c(t)})}else i(416==a.status?new w(Jt):new w(Xt+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>i(t.detail?t.detail.error:new w("Network error")),!1),a.open(t,e),r)for(const t of n.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class Me extends oe{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new xe(t,e):new ge(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(t){return this.reader.createReadable(t)}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Ne extends oe{constructor(t){super(),t=new f(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{v:t,size:t.length})}readUint8Array(t,e){return this.v.slice(t,t+e)}}class _e extends ce{constructor(t){super(),this.C=t||262144}init(t=0){n.assign(this,{offset:0,v:new f(t>0?t:this.C)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.v.length){let t=e.v.length?2*e.v.length:e.C;for(;t<n;)t*=2;const r=e.v;e.v=new f(t),e.v.set(r)}e.v.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.v.length?this.v:this.v.slice(0,this.offset)}}class Le extends oe{constructor(t){super(),this.T=t}async init(){const t=this;t.U=0;const e=t.T=await g.all(t.T.map(He));t.I=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}O(t){const{I:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{T:r}=this;let s,i=0,o=t;for(;r[i]&&o>=r[i].size;)o-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(o+e<=r)s=await qe(c,o,e);else{const i=r-o;s=Bt(await qe(c,o,i),await n.readUint8Array(t+i,e-i))}}else s=ht;return n.U=a.max(i,n.U),s}}class Pe extends ae{constructor(t,e=4294967295){super();const r=this;let s,i,a;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const o=new R({async write(e){if(e===ie)return void(a&&await d());const{availableSize:n}=r;if(a)e.length>=n?(await c(e.subarray(0,n)),await d(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:o}=await t.next();if(o&&!n)throw new w("Writer iterator completed too soon");s=n,s.size=0,s.maxSize&&(r.maxSize=s.maxSize),r.availableSize=r.maxSize,await Ze(s),i=n.writable,a=i.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function c(t){const e=t.length;e&&(await a.ready,await a.write(t),s.size+=e,r.availableSize-=e)}async function d(){await u(),r.diskOffset+=s.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}n.defineProperty(r,se,{get:()=>o})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(ie)}finally{t.releaseLock()}}}class We{constructor(t){return e.isArray(t)&&(t=new Le(t)),(t instanceof D||typeof t.getReader==wt)&&(t={readable:Ht(t)}),t}}class Be{constructor(t){return t.writable===dt&&typeof t.next==wt&&(t=new Pe(t)),(t instanceof R||typeof t.getWriter==wt)&&(t={writable:jt(t)}),t.size===dt&&(t.size=0),t}}function Ve(t){return!(!t||!t.getData)}async function Ze(t,e){if(!t.init||t.initialized)return g.resolve();await t.init(e)}async function He(t){return t=new We(t),await Ze(t),t.size!==dt&&t.readUint8Array||(t=new fe(await qt(t.readable)),await Ze(t)),t}function qe(t,e,n){return t.readUint8Array(e,n)}function je(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?oe.prototype.createReadable.call(t,e):t.readable}const Ke=new c,Ye=new c;function Ge(t){return Ke.get(t)}function Xe(t){return Ye.get(t)}const Je=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;Je[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=Je[e-1][t];Je[e][t]=n>>>8^Je[0][255&n]}const[Qe,$e,tn,en,nn,rn,sn,an]=Je;class on{constructor(t){this.M=t||-1}append(t){let e=0|this.M;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const s=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^s.getInt32(r,!0),n=s.getInt32(r+4,!0);e=an[255&t]^sn[t>>>8&255]^rn[t>>>16&255]^nn[t>>>24&255]^en[255&n]^tn[n>>>8&255]^$e[n>>>16&255]^Qe[n>>>24&255]}}for(;r<n;r++)e=e>>>8^Qe[255&(e^t[r])];this.M=e}get(){return~this.M}}class cn extends E{constructor(){let t;const e=new on;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new f(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function dn(t){if(typeof x==lt){const e=new f((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new x).encode(t)}const un={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=un.N(n);return 32===r?t.concat(e):un._(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+un.N(n)},L(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,a.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=un.P(e,t[n-1]&2147483648>>e-1,1)),t},P:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,N:t=>a.round(t/1099511627776)||32,_(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let s=0;s<t.length;s++)r.push(n|t[s]>>>e),n=t[s]<<32-e;const s=t.length?t[t.length-1]:0,i=un.N(s);return r.push(un.P(e+i&31,e+i>32?n:r.pop(),1)),r}},ln={bytes:{W(t){const e=un.bitLength(t)/8,n=new f(e);let r;for(let s=0;s<e;s++)3&s||(r=t[s/4]),n[s]=r>>>24,r<<=8;return n},B(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(un.P(8*(3&n),r)),e}}},wn=class{constructor(t){const e=this;e.blockSize=512,e.V=[1732584193,4023233417,2562383102,271733878,3285377520],e.Z=[1518500249,1859775393,2400959708,3395469782],t?(e.H=t.H.slice(0),e.j=t.j.slice(0),e.K=t.K):e.reset()}reset(){const t=this;return t.H=t.V.slice(0),t.j=[],t.K=0,t}update(t){const e=this;"string"==typeof t&&(t=ln.Y.B(t));const n=e.j=un.concat(e.j,t),r=e.K,s=e.K=r+un.bitLength(t);if(s>9007199254740991)throw new w("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let a=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);t<=s;t+=e.blockSize)e.G(i.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),e}X(){const t=this;let e=t.j;const n=t.H;e=un.concat(e,[un.P(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(a.floor(t.K/4294967296)),e.push(0|t.K);e.length;)t.G(e.splice(0,16));return t.reset(),n}J(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}$(t,e){return e<<t|e>>>32-t}G(t){const n=this,r=n.H,s=e(80);for(let e=0;e<16;e++)s[e]=t[e];let i=r[0],o=r[1],c=r[2],d=r[3],u=r[4];for(let t=0;t<=79;t++){t>=16&&(s[t]=n.$(1,s[t-3]^s[t-8]^s[t-14]^s[t-16]));const e=n.$(5,i)+n.J(t,o,c,d)+u+s[t]+n.Z[a.floor(t/20)]|0;u=d,d=c,c=n.$(30,o),o=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+c|0,r[3]=r[3]+d|0,r[4]=r[4]+u|0}},fn={importKey:t=>new fn.et(ln.bytes.B(t)),nt(t,e,n,r){if(n=n||1e4,r<0||n<0)throw new w("invalid params to pbkdf2");const s=1+(r>>5)<<2;let i,a,o,c,d;const u=new ArrayBuffer(s),l=new m(u);let f=0;const p=un;for(e=ln.bytes.B(e),d=1;f<(s||1);d++){for(i=a=t.encrypt(p.concat(e,[d])),o=1;o<n;o++)for(a=t.encrypt(a),c=0;c<a.length;c++)i[c]^=a[c];for(o=0;f<(s||1)&&o<i.length;o++)l.setInt32(f,i[o]),f+=4}return u.slice(0,r/8)},et:class{constructor(t){const e=this,n=e.st=wn,r=[[],[]];e.it=[new n,new n];const s=e.it[0].blockSize/32;t.length>s&&(t=(new n).update(t).X());for(let e=0;e<s;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.it[0].update(r[0]),e.it[1].update(r[1]),e.ot=new n(e.it[0])}reset(){const t=this;t.ot=new t.st(t.it[0]),t.ct=!1}update(t){this.ct=!0,this.ot.update(t)}digest(){const t=this,e=t.ot.X(),n=new t.st(t.it[1]).update(e).X();return t.reset(),n}encrypt(t){if(this.ct)throw new w("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},pn=typeof z!=lt&&typeof z.getRandomValues==wt,hn="Invalid password",mn="Invalid signature",yn=mn,gn="zipjs-abort-check-password";function xn(t){if(pn)return z.getRandomValues(t);throw new w("Crypto API not supported")}const Sn=16,bn={name:"PBKDF2"},zn=n.assign({hash:{name:"HMAC"}},bn),Fn=n.assign({iterations:1e3,hash:{name:"SHA-1"}},bn),En=["deriveBits"],Dn=[8,12,16],Rn=[16,24,32],An=10,vn=[0,0,0,0],Cn=typeof z!=lt,kn=Cn&&z.subtle,Tn=Cn&&typeof kn!=lt,Un=ln.bytes,In=class{constructor(t){const e=this;e.ut=[[[],[],[],[],[]],[[],[],[],[],[]]],e.ut[0][0][0]||e.lt();const n=e.ut[0][4],r=e.ut[1],s=t.length;let i,a,o,c=1;if(4!==s&&6!==s&&8!==s)throw new w("invalid aes key size");for(e.Z=[a=t.slice(0),o=[]],i=s;i<4*s+28;i++){let t=a[i-1];(i%s===0||8===s&&i%s===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%s===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),a[i]=a[i-s]^t}for(let t=0;i;t++,i--){const e=a[3&t?i:i-4];o[t]=i<=4||t<4?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.wt(t,0)}decrypt(t){return this.wt(t,1)}lt(){const t=this.ut[0],e=this.ut[1],n=t[4],r=e[4],s=[],i=[];let a,o,c,d;for(let t=0;t<256;t++)i[(s[t]=t<<1^283*(t>>7))^t]=t;for(let u=a=0;!n[u];u^=o||1,a=i[a]||1){let i=a^a<<1^a<<2^a<<3^a<<4;i=i>>8^255&i^99,n[u]=i,r[i]=u,d=s[c=s[o=s[u]]];let l=16843009*d^65537*c^257*o^16843008*u,w=257*s[i]^16843008*i;for(let n=0;n<4;n++)t[n][u]=w=w<<24^w>>>8,e[n][i]=l=l<<24^l>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}wt(t,e){if(4!==t.length)throw new w("invalid aes block size");const n=this.Z[e],r=n.length/4-2,s=[0,0,0,0],i=this.ut[e],a=i[0],o=i[1],c=i[2],d=i[3],u=i[4];let l,f,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],g=t[e?1:3]^n[3],x=4;for(let t=0;t<r;t++)l=a[h>>>24]^o[m>>16&255]^c[y>>8&255]^d[255&g]^n[x],f=a[m>>>24]^o[y>>16&255]^c[g>>8&255]^d[255&h]^n[x+1],p=a[y>>>24]^o[g>>16&255]^c[h>>8&255]^d[255&m]^n[x+2],g=a[g>>>24]^o[h>>16&255]^c[m>>8&255]^d[255&y]^n[x+3],x+=4,h=l,m=f,y=p;for(let t=0;t<4;t++)s[e?3&-t:t]=u[h>>>24]<<24^u[m>>16&255]<<16^u[y>>8&255]<<8^u[255&g]^n[x++],l=h,h=m,m=y,y=g,g=l;return s}},On=class{constructor(t,e){this.ft=t,this.ht=e,this.yt=e}reset(){this.yt=this.ht}update(t){return this.gt(this.ft,t,this.yt)}xt(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}St(t){0===(t[0]=this.xt(t[0]))&&(t[1]=this.xt(t[1]))}gt(t,e,n){let r;if(!(r=e.length))return[];const s=un.bitLength(e);for(let s=0;s<r;s+=4){this.St(n);const r=t.encrypt(n);e[s]^=r[0],e[s+1]^=r[1],e[s+2]^=r[2],e[s+3]^=r[3]}return un.L(e,s)}},Mn=fn.et;let Nn=Cn&&Tn&&typeof kn.importKey==wt,_n=Cn&&Tn&&typeof kn.deriveBits==wt;class Ln extends E{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:s=!0}){super({start(){Wn(this,t,e,n)},async transform(t,e){const n=this,{password:s,strength:i,bt:a,ready:o}=n;s?(await(async(t,e,n,r)=>{const s=await Vn(t,e,n,Hn(r,0,Dn[e])),i=Hn(r,Dn[e]);if(s[0]!=i[0]||s[1]!=i[1])throw new w(hn)})(n,i,s,Hn(t,0,Dn[i]+2)),t=Hn(t,Dn[i]+2),r?e.error(new w(gn)):a()):await o;const c=new f(t.length-An-(t.length-An)%Sn);e.enqueue(Bn(n,t,c,0,An,!0))},async flush(t){const{zt:e,Ft:n,Et:r,ready:i}=this;if(n&&e){await i;const a=Hn(r,0,r.length-An),o=Hn(r,r.length-An);let c=ht;if(a.length){const t=jn(Un,a);n.update(t);const r=e.update(t);c=qn(Un,r)}const d=Hn(qn(Un,n.digest()),0,An);let u=r.length<An?1:0;for(let t=0;t<An;t++)u|=d[t]^o[t];if(u&&s)throw new w(yn);t.enqueue(c)}}})}}class Pn extends E{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){Wn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:s,bt:i,ready:a}=n;let o=ht;r?(o=await(async(t,e,n)=>{const r=xn(new f(Dn[e]));return Bt(r,await Vn(t,e,n,r))})(n,s,r),i()):await a;const c=new f(o.length+t.length-t.length%Sn);c.set(o,0),e.enqueue(Bn(n,t,c,o.length,0))},async flush(t){const{zt:e,Ft:n,Et:r,ready:s}=this;if(n&&e){await s;let i=ht;if(r.length){const t=e.update(jn(Un,r));n.update(t),i=qn(Un,t)}const a=qn(Un,n.digest()).slice(0,An);t.enqueue(Bt(i,a))}}})}}function Wn(t,e,r,s){n.assign(t,{ready:new g(e=>t.bt=e),password:Zn(e,r),strength:s-1,Et:ht})}function Bn(t,e,n,r,s,i){const{zt:a,Ft:o,Et:c}=t;c.length&&(e=Bt(c,e));const d=e.length-s;let u;for(n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new f(e)).set(n,0)}return t})(n,r+(d-d%Sn)),u=0;u<=d-Sn;u+=Sn){const t=jn(Un,Hn(e,u,u+Sn));i&&o.update(t);const s=a.update(t);i||o.update(s),n.set(qn(Un,s),u+r)}return t.Et=Hn(e,u),n}async function Vn(t,r,s,i){t.password=null;const a=await(async(t,e,n,r,s)=>{if(!Nn)return fn.importKey(e);try{return await kn.importKey("raw",e,n,!1,s)}catch{return Nn=!1,fn.importKey(e)}})(0,s,zn,0,En),o=await(async(t,e,n)=>{if(!_n)return fn.nt(e,t.salt,Fn.iterations,n);try{return await kn.deriveBits(t,e,n)}catch{return _n=!1,fn.nt(e,t.salt,Fn.iterations,n)}})(n.assign({salt:i},Fn),a,8*(2*Rn[r]+2)),c=new f(o),d=jn(Un,Hn(c,0,Rn[r])),u=jn(Un,Hn(c,Rn[r],2*Rn[r])),l=Hn(c,2*Rn[r]);return n.assign(t,{keys:{key:d,Dt:u,passwordVerification:l},zt:new On(new In(d),e.from(vn)),Ft:new Mn(u)}),l}function Zn(t,e){return e===dt?dn(t):e}function Hn(t,e,n){return t.subarray(e,n)}function qn(t,e){return t.W(e)}function jn(t,e){return t.B(e)}class Kn extends E{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){Gn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=Xn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new w(hn);t=t.subarray(12)}r?e.error(new w(gn)):e.enqueue(Xn(n,t))}})}}class Yn extends E{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){Gn(this,t,e,n)},transform(t,e){const n=this;let r,s;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=xn(new f(12));e[11]=n.passwordVerification,r=new f(t.length+e.length),r.set(Jn(n,e),0),s=12}else r=new f(t.length),s=0;r.set(Jn(n,t),s),e.enqueue(r)}})}}function Gn(t,e,r,s){n.assign(t,{password:e,rawPassword:r,passwordVerification:s}),((t,e,r)=>{const s=[305419896,591751049,878082192];if(n.assign(t,{keys:s,Rt:new on(s[0]),At:new on(s[2])}),r)for(let e=0;e<r.length;e++)Qn(t,r[e]);else for(let n=0;n<e.length;n++)Qn(t,e.charCodeAt(n))})(t,e,r)}function Xn(t,e){const n=new f(e.length);for(let r=0;r<e.length;r++)n[r]=$n(t)^e[r],Qn(t,n[r]);return n}function Jn(t,e){const n=new f(e.length);for(let r=0;r<e.length;r++)n[r]=$n(t)^e[r],Qn(t,e[r]);return n}function Qn(t,e){let[,n]=t.keys;t.Rt.append([e]);const r=~t.Rt.get();n=er(a.imul(er(n+tr(r)),134775813)+1),t.At.append([n>>>24]);const s=~t.At.get();t.keys=[r,n,s]}function $n(t){const e=2|t.keys[2];return tr(a.imul(e,1^e)>>>8)}function tr(t){return 255&t}function er(t){return 4294967295&t}const nr="Invalid uncompressed size",rr="Invalid compressed data",sr=mn,ir="deflate-raw",ar="gzip",or=[31,139,8];class cr extends E{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:a,zipCrypto:o,computeCrc32:c,level:d,deflate64:u,format:l,compressionMethod:w}=t,f=this;let p,h,y,g=super.readable;const x=l&&Xe(l),S=c&&s&&!u&&!x&&(!i||o)&&!(!a||!r);if(i&&!o||!c||S||(p=new cn,g=yr(g,p)),s)if(x)g=gr(g,hr(x.CompressionStream,l,{level:d,chunkSize:e,compressionMethod:w}));else if(S)y=new dr,g=gr(g,new r(ar)),g=yr(g,y);else try{g=mr(g,a,{level:d,chunkSize:e},r,n)}catch(t){let e;try{e=new r(ar)}catch{throw t}g=gr(g,e),g=yr(g,new dr)}i&&(o?g=yr(g,new Yn(t)):(h=new Pn(t),g=yr(g,h))),pr(f,g,()=>{i&&!o||!c||(f.crc32=S?y.crc32:new m(p.value.buffer).getUint32(0))})}}class dr extends E{constructor(){let t,e=10,n=new f(0);super({transform(t,r){if(e){const n=a.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const s=n.length+t.length;if(s<=8)return void(n=Bt(n,t));const i=s-8,o=a.min(i,n.length);r.enqueue(Bt(n.subarray(0,o),t.subarray(0,i-o))),n=Bt(n.subarray(o),t.subarray(i-o))},flush(){const e=Zt(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class ur extends E{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:s,encrypted:i,checkCrc32:a,crc32:o,compressed:c,useCompressionStream:d,deflate64:u,format:l,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let x,S,b=super.readable;if(i&&(s?b=yr(b,new Kn(t)):(S=new Ln(t),b=yr(b,S))),c){const t=l&&Xe(l);if(t)b=gr(b,hr(t.DecompressionStream,l,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{b=mr(b,d,{chunkSize:e,deflate64:u},r,n)}catch(t){if(u||y===dt)throw t;let e;try{e=new r(ar)}catch{throw t}b=((t,e,n)=>{const r=new on;let s,i,a,o=0,c=!1;const d=new g((t,e)=>{i=t,a=e});d.catch(()=>{}),n||i();const u=new E({start(t){const e=new f(10);e.set(or),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await d}finally{h()}const e=new f(8),s=Zt(e);s.setUint32(0,r.get(),!0),s.setUint32(4,n,!0),t.enqueue(e)},cancel(t){a(t)}}),l=new E({transform(t,e){r.append(t),o+=t.length,o>=n?i():c&&p(),e.enqueue(t)},cancel(t){a(t)}});return t=yr(t,u),yr(t=gr(t,e),l);function p(){h(),s=U(()=>a(new w(nr)),5e3)}function h(){I(s)}})(b,e,y)}b=(t=>{const e=t.getReader();return new D({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new w(rr);throw e.cause=t,e}const{value:r,done:s}=n;s?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})})(b)}a&&(x=new cn,b=yr(b,x)),pr(this,b,()=>{if(a){const t=new m(x.value.buffer);if(o!=t.getUint32(0,!1))throw new w(sr)}})}}const lr=new c;function wr(t,e){if(!t)return!1;let n=lr.get(t);n||(n=new c,lr.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function fr(t){return wr(t,ir)}function pr(t,e,r){e=yr(e,new E({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function hr(t,e,n){if(!t)throw new w("Compression method not supported");return new t(e,n)}function mr(t,e,n,r,s){const i=e&&r?r:s||r,a=n.deflate64?"deflate64-raw":ir;let o;try{o=new i(a,n)}catch(t){if(!e||!s||i==s)throw t;o=new s(a,n)}return gr(t,o)}function yr(t,e){return Ht(t).pipeThrough(e)}function gr(t,e){const n=e.writable.getWriter(),r=t.getReader();return(async()=>{try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await(async(t,e)=>{try{await t.abort(e)}catch{}})(n,t),await(async(t,e)=>{try{await t.cancel(e)}catch{}})(r,t)}})(),e.readable}const xr="deflate",Sr="inflate";class br extends E{constructor(t,e){super({});const r=this,{codecType:s}=t;let i;s.startsWith(xr)?i=cr:s.startsWith(Sr)&&(i=ur),r.outputSize=0;let a=0;const o=new i(t,e),c=super.readable,d=new E({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:a})}}),u=new E({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new w(nr)},flush(){const{crc32:t}=o;n.assign(r,{crc32:t,inputSize:a})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(d).pipeThrough(o).pipeThrough(u)})}}class zr extends E{constructor(t){const e=[];let n=0;function r(){const r=new f(t);let s=0;for(;s<t;){const n=e[0],i=t-s;n.length<=i?(r.set(n,s),s+=n.length,e.shift()):(r.set(n.subarray(0,i),s),e[0]=n.subarray(i),s+=i)}return n-=t,r}(!s.isFinite(t)||t<1)&&(t=65536),super({transform(s,i){for(e.push(s),n+=s.length;n>t;)i.enqueue(r())},flush(t){n&&t.enqueue(((t,e)=>{const n=new f(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n})(e,n))}})}}async function Fr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.vt)return!0;if(fr(e)||wr(e,ar))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}class Er{constructor(t,{readable:e,writable:r},{options:s,config:i,Ct:a,useWebWorkers:o,transferStreams:c,workerURI:d,createWorker:u},l){const{signal:w}=a;return n.assign(t,{kt:!0,Tt:(t.Tt||0)+1,readable:e.pipeThrough(new zr(Pt(i))).pipeThrough(new Dr(a),{signal:w}),writable:r,options:n.assign({},s),workerURI:d,createWorker:u,transferStreams:c,terminate:()=>new g(e=>{const{Ut:n,kt:r}=t;n?(r?t.It=e:(n.terminate(),e()),t.Ot=null):e()}),Mt(){if(t.kt){const{It:e}=t;e&&(t.It=null,t.Nt=!0,t.Ut.terminate(),e()),t.kt=!1,l(t)}}}),((t,e)=>({run:()=>(async({options:t,readable:e,writable:n,Mt:r},s)=>{let i;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(xr),n=e?s.CompressionStreamFallback:s.DecompressionStreamFallback,r=e?s.CompressionStream:s.DecompressionStream;if(t.useCompressionStream){if(n&&n.vt&&!fr(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.vt||(t.useCompressionStream=!0)}}i=new br(t,s),await e.pipeThrough(i).pipeThrough(new zr(Pt(s))).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:a,outputSize:o}=i;return{crc32:r,inputSize:a,outputSize:o}}catch(t){throw i&&(t.outputSize=i.outputSize),t}finally{r()}})(t,e)}))(t,i)}}class Dr extends E{constructor({onstart:t,onprogress:e,size:n,onend:r}){let s=0;super({async start(){t&&await Rr(t,n)},async transform(t,r){s+=t.length,e&&await Rr(e,s,n),r.enqueue(t)},async flush(){r&&await Rr(r,s)}})}}async function Rr(t,...e){try{await t(...e)}catch{}}let Ar=[];const vr=[];let Cr,kr,Tr=0;async function Ur(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:a,useCompressionStream:o,compressed:c,checkCrc32:d,computeCrc32:u,encrypted:f,format:p,codecURI:h}=n,{workerURI:m,createWorker:y,maxWorkers:x}=r;p&&(h&&(n.codecURI=((t,e)=>{try{return new l(t,e).toString()}catch{return t}})(h,r.baseURI)),await(async(t,e)=>{!Ye.has(t)&&e&&((t,e)=>{const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=wt&&typeof r!=wt)throw new w("Invalid codec module");Ye.set(t,{CompressionStream:n,DecompressionStream:r})})(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(p,n.codecURI)),e.transferStreams=!p&&(i||i===dt&&r.transferStreams);const S=!(c||d||u||f),b=p===dt||!!n.codecURI;return e.useWebWorkers=!S&&b&&(a||a===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&m?m:dt,e.createWorker=e.useWebWorkers&&y?y:dt,n.useCompressionStream=o||o===dt&&r.useCompressionStream,(await(async()=>{const n=Ar.find(t=>!t.kt);if(n)return _r(n),new Er(n,t,e,z);if(Ar.length<x){const n={_t:Tr};return Tr++,Ar.push(n),new Er(n,t,e,z)}return new g(n=>{vr.push({resolve:n,stream:t,Lt:e}),kr=r.workerStarvationTimeout,Ir()})})()).run();function z(t){if(Or(),vr.length){const[{resolve:e,stream:n,Lt:r}]=vr.splice(0,1);e(new Er(t,n,r,z)),Ir()}else t.Ut?(_r(t),((t,e)=>{const{config:n}=e,{terminateWorkerTimeout:r}=n;s.isFinite(r)&&r>=0&&(t.Nt?t.Nt=!1:t.Pt=U(async()=>{Ar=Ar.filter(e=>e!=t);try{await t.terminate()}catch{}},r))})(t,e)):Ar=Ar.filter(e=>e!=t)}}function Ir(){!Cr&&vr.length&&s.isFinite(kr)&&kr>=0&&(Cr=U(Mr,kr))}function Or(){Cr&&(I(Cr),Cr=null)}function Mr(){if(Cr=null,vr.length){const[{resolve:t,stream:e,Lt:r}]=vr.splice(0,1),s=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new Er({},e,s,Nr)),Ir()}}function Nr(){Or(),Ir()}function _r(t){const{Pt:e}=t;e&&(I(e),t.Pt=null)}const Lr="filename",Pr="rawFilename",Wr="comment",Br="rawComment",Vr="uncompressedSize",Zr="compressedSize",Hr="offset",qr="diskNumberStart",jr="lastModDate",Kr="rawLastModDate",Yr="lastAccessDate",Gr="rawLastAccessDate",Xr="creationDate",Jr="rawCreationDate",Qr="internalFileAttributes",$r="externalFileAttributes",ts="internalFileAttribute",es="externalFileAttribute",ns="msdosAttributesRaw",rs="msdosAttributes",ss="msDosCompatible",is="zip64",as="encrypted",os="version",cs="versionMadeBy",ds="zipCrypto",us="directory",ls="executable",ws="compressionMethod",fs="signature",ps="extraField",hs="unixMode",ms="setuid",ys="setgid",gs="sticky",xs=[Lr,Pr,Vr,Zr,jr,Kr,Wr,Br,Yr,Gr,Xr,Jr,Hr,qr,Qr,$r,ts,es,ns,rs,ss,is,as,os,cs,ds,us,ls,"symlink",ws,fs,"crc32",ps,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",hs,"unixExternalUpper",ms,ys,gs,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Ss{constructor(t){xs.forEach(e=>this[e]=t[e])}}const bs="File format is not recognized",zs="End of central directory not found",Fs="End of Zip64 central directory locator not found",Es="Central directory header not found",Ds="Local file header not found",Rs="Zip64 extra field not found",As="File contains encrypted entry",vs="Encryption method not supported",Cs="Compression method not supported",ks="Split zip file",Ts="Overlapping entry found",Us="Entry data out of bounds",Is="Ambiguous archive",Os="Encrypted central directory is not supported",Ms="Unsafe filename",Ns="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",_s="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Ls="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ps=/^[a-zA-Z]:/,Ws="utf-8",Bs="cp437",Vs=[[Vr,M],[Zr,M],[Hr,M],[qr,N]],Zs={[N]:{Wt:gi,bytes:4},[M]:{Wt:xi,bytes:8}};class Hs{constructor(t,e={}){n.assign(this,{reader:new We(t),options:e,Bt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await Ze(r),r.size!==dt&&r.readUint8Array||(r=new fe(await qt(r.readable)),await Ze(r)),r.size<j)throw new w(bs);const i=si(t,e.options),o=i==Ct,c=i!=Tt,u=((t,e)=>{if(t!==dt){const e=Mt(t);if("number"!=typeof e||s.isNaN(e)||e<0)throw new w(Ls);return e}return e==Ct?0:e==Tt?1/0:N})(wi(e,t,"maxAppendedDataSize"),i),l=((t,e)=>{if(t===dt)return e;if(!ri(t))throw new w(_s);return t})(wi(e,t,"filenameValidation"),i),f=wi(e,t,"normalizeFilename"),{Vt:p,Zt:h}=await(async(t,e,n)=>{const{size:r}=t,s=a.min(r,65557),i={count:64};let o,c,d=0;for await(const[n,a,u,l,w]of oi(t,s)){const s=yi(n,l+20);if(w+j+s==r){const s=await di(t,n,a,l,w,r,i);if(2==s){if(o||(o=ci(u,l,w)),d++,!e||d>1)break}else 1!=s||c||(c=ci(u,l,w))}}return o||(o=c),o||(o=await(async(t,e,n)=>{const{size:r}=t,s=a.min(r,e==1/0?r:65557+e);let i,o;for await(const[e,a,c,d,u]of oi(t,s)){const s=ci(c,d,u);i||(i=s);const l=await di(t,e,a,d,u,r,n);if(2==l)return s;1!=l||o||(o=s)}return o||i})(t,n,i)),{Vt:o,Zt:d}})(r,c,u);if(!p)throw await(async t=>await ni(t)==P)(r)?new w(ks):new w(zs);c&&h>1&&li("multiple end of central directory records");const m=Zt(p);let y=gi(m,12),g=gi(m,16);const x=p.offset,S=yi(m,20),b=x+j+S;r.size-b>u&&li("appended data");let z=yi(m,4);const F=r.U||0;let D,R,A,v,C=yi(m,6),k=yi(m,10),T=0,U=Y;const I=g==M||y==M||k==N||C==N;if(g!=M&&C!=N&&(g+=ei(r,C)),I){const t=p.offset>=K?await qe(r,p.offset-K,K):ht,e=Zt(t);if(t.length==K&&gi(e,0)==q){g=ei(r,gi(e,4))+xi(e,8);let t=await qe(r,g,Y),i=Zt(t);const c=p.offset-K-Y;if((t.length<Y||gi(i,0)!=H)&&g!=c&&c>=0){const e=g;g=c,g>e&&(T=g-e),t=await qe(r,g,Y),i=Zt(t)}if(t.length<Y||gi(i,0)!=H)throw new w(Fs);if(R=!0,A=xi(i,4)>44,A){const t=a.min(s(xi(i,4))-44,r.size-g-Y);t>0&&(U+=t,v=(t=>{const e={rawExtensibleData:t};if(t.length>=28){const r=Zt(t),i=yi(r,26);n.assign(e,{compressionMethod:yi(r,0),compressedSize:s(xi(r,2)),uncompressedSize:s(xi(r,10)),encryptionAlgorithm:yi(r,18),bitLength:yi(r,20),flags:yi(r,22),hashAlgorithm:yi(r,24),hashData:t.subarray(28,28+i)})}return e})(await qe(r,g+Y,t)))}z==N?z=gi(i,16):o&&z!=gi(i,16)&&li("mismatched zip64 end of central directory record"),C==N?C=gi(i,20):o&&C!=gi(i,20)&&li("mismatched zip64 end of central directory record"),k==N?k=xi(i,32):o&&k!=xi(i,32)&&li("mismatched zip64 end of central directory record"),y==M?y=xi(i,40):o&&y!=xi(i,40)&&li("mismatched zip64 end of central directory record"),g=ei(r,C)+xi(i,48)+T}}let O=y;const L=p.offset-(R?U+K:0);if(g>=r.size&&(T=r.size-g-y-j,g=r.size-y-j),F!=z)throw new w(ks);if(g<0)throw new w(bs);let W=0,B=await qe(r,g,y),Z=Zt(B);if(y){if(B.length<4)throw new w(bs);const t=L-y;if(g!=t&&C==z){let e=!(gi(Z,W)==V||v&&v.compressedSize||js(Z));if(!e&&t>=0&&t+4<=r.size&&(e=gi(Zt(await qe(r,t,4)),0)==V),e){const e=g;g=t,g>e&&(T+=g-e),B=await qe(r,g,y),Z=Zt(B)}}}const G=L-g;if(y!=G&&G>=0&&C==z&&(y=G,B=await qe(r,g,y),Z=Zt(B)),g<0||g>=r.size)throw new w(bs);e.directoryOffset=g,e.directoryLength=O;const X=fi(e,t,"decryptCentralDirectory");let J,Q;if(X&&k&&B.length>=4&&gi(Z,0)!=V&&(A||js(Z))){const t=((t,e,n)=>{const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n})(v,O,B.length);Q=B.subarray(t),B=await X(B.subarray(0,t),v),Z=Zt(B),O=B.length,J=!0}D=g;const $=wi(e,t,"filenameEncoding"),tt=wi(e,t,"commentEncoding"),at=o?new d:dt;let ot;for(let s=0;s<k;s++){const i=new qs(r,e.options);if(W+46>B.length||gi(Z,W)!=V){if(0==s&&!J&&(A||js(Z)))throw new w(Os);throw new w(Es)}Ys(i,Z,W+6);const c=!!i.bitFlag.languageEncodingFlag,d=W+46,u=d+i.filenameLength,p=u+i.extraFieldLength,h=yi(Z,W+4),m=!(h>>8),y=h>>8==3,g=B.subarray(d,u),x=yi(Z,W+32),S=p+x,b=B.subarray(p,S),z=c,F=c,R=gi(Z,W+38),v=R&_,C={readOnly:!!(1&v),hidden:!!(2&v),system:!!(4&v),directory:!!(16&v),archive:!!(32&v)},U=gi(Z,W+42),I=fi(e,t,"decodeText")||Yt,O=z?Ws:$||Bs,M=F?Ws:tt||Bs;let L=I(g,O,At);if(L===dt&&(L=Yt(g,O)),f){const t=f(L);t!==dt&&(L=t)}if(ai(L,l)){const t=new w(Ms);throw t.filename=L,t}let P=I(b,M,vt);P===dt&&(P=Yt(b,M)),n.assign(i,{index:s,Ht:J,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,qt:x,offset:U,diskNumberStart:yi(Z,W+34),internalFileAttributes:yi(Z,W+36),externalFileAttributes:R,msdosAttributesRaw:v,msdosAttributes:C,rawFilename:g,filenameUTF8:z,commentUTF8:F,rawExtraField:B.subarray(u,p),rawComment:b,filename:L,comment:P}),Gs(i,i,Z,W+6),i.offset+=T,D=a.min(ei(r,i.diskNumberStart)+i.offset,D),o&&(at.has(i.filename)&&(ot=!0),at.add(i.filename));const H=i.externalFileAttributes>>16&N;i.unixMode===dt&&16877&H&&(i.unixMode=H);const q=!!(i.unixMode&rt),j=!!(i.unixMode&st),K=!!(512&i.unixMode),Y=40960==((i.unixMode===dt?H:i.unixMode)&et),G=!Y&&(i.unixMode!==dt?!!(73&i.unixMode):y&&!!(73&H)),X=i.unixMode!==dt&&(i.unixMode&et)==nt,Q=(H&et)==nt;n.assign(i,{setuid:q,setgid:j,sticky:K,symlink:Y,unixExternalUpper:H,internalFileAttribute:i.internalFileAttributes,externalFileAttribute:i.externalFileAttributes,executable:G,directory:X||Q||m&&C.directory||i.filename.endsWith(it)&&!i.uncompressedSize,zipCrypto:i.encrypted&&!i.extraFieldAES});const ct=new Ss(i);ct.getData=(t,n)=>i.getData(t,ct,e.Bt,n),ct.arrayBuffer=async t=>{const n=new E,r=qt(n.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await i.getData(n,ct,e.Bt,t),r},W=S;const{onprogress:ut}=t;if(ut)try{await ut(s+1,k,new Ss(i))}catch{}yield ct}let ct=W;const ut=Ks(B.subarray(W))||(J?Ks(Q):dt);ut&&(e.digitalSignature=ut,ct=W+6+ut.length),o&&W!=O&&ct!=O&&li("trailing central directory data"),ot&&li("duplicate filename");const lt=wi(e,t,"extractPrependedData"),wt=wi(e,t,"extractAppendedData"),ft=(o||lt)&&k&&4==D&&await(async t=>{const e=await ni(t);return e==P||808471376==e})(r)?4:0;return o&&(T||k&&D>ft)&&li("prepended data"),lt&&(e.prependedData=D>ft?await qe(r,ft,D-ft):ht),e.comment=S?await qe(r,x+j,S):ht,wt&&(e.appendedData=b<r.size?await qe(r,b,r.size-b):ht),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}let qs=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,n,r={}){const s=this,i=Lt(),{reader:o,index:c,offset:d,diskNumberStart:u,extraFieldAES:l,extraFieldZip64:f,compressionMethod:p,bitFlag:h,rawBitFlag:m,crc32:y,rawLastModDate:g,uncompressedSize:x,compressedSize:S}=s,{dataDescriptor:b}=h,z=e.localDirectory={},F=ei(o,u)+d,E=await qe(o,F,at),D=Zt(E);let A=wi(s,r,mt),v=wi(s,r,yt);const C=wi(s,r,gt);if(Ot(A,v),A=A&&A.length&&A,v=v&&v.length&&v,l&&99!=l.originalCompressionMethod)throw new w(Cs);if(E.length<at||gi(D,0)!=L)throw new w(Ds);Ys(z,D,4);const{extraFieldLength:k,filenameLength:T}=z,U=wi(s,r,"checkLocalDirectory"),I=si(r,s.options),O=((t,e)=>t===dt?e!=Tt:!!t)(U,I),M=((t,e)=>t===dt?e==Ct:!!t)(U,I);let N=ht;if(M&&(T||k)){const t=await qe(o,F+at,T+k);N=t.subarray(0,T),z.rawExtraField=t.subarray(T)}else z.rawExtraField=k?await qe(o,F+at+T,k):ht;M&&(z.rawFilename=N),Gs(s,z,D,4,!0),O&&((t,e,n,r)=>{const{rawFilename:s}=t,i=t.Ht&&!(8192&~e.rawBitFlag);!r||i||n.length==s.length&&!n.some((t,e)=>t!=s[e])||li("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&li("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&li("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||i||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||li("mismatched local file header (crc32 or sizes)")})(s,z,N,M);const{lastAccessDate:P,creationDate:B,uid:V,gid:Z}=z;P&&(e.lastAccessDate=P),B&&(e.creationDate=B),V!==dt&&e.uid===dt&&(e.uid=V),Z!==dt&&e.gid===dt&&(e.gid=Z);const H=s.encrypted&&z.encrypted&&!C,q=H&&!l;if(C||(e.zipCrypto=q),H&&!(64&~z.rawBitFlag))throw new w(vs);const j=C?dt:Ge(p);if(0!=p&&8!=p&&9!=p&&!j&&!C)throw new w(Cs);if(H){if(!q&&(l.strength<1||l.strength>3))throw new w(vs);if(!A&&!v)throw new w(As)}const K=F+at+T+k;if(K+S>o.size)throw new w(Us);const Y=S,G=Ht(o.createReadable({offset:K,size:Y})),X=It(wi(s,r,xt)),J=wi(s,r,"checkPasswordOnly");let Q=wi(s,r,"checkOverlappingEntry");const $=wi(s,r,"checkOverlappingEntryOnly");$&&(Q=!0);const{onstart:tt,onprogress:et,onend:nt}=r,rt=0!=p&&!C,st=C?S:x,it=9==p;let ot=wi(s,r,bt);it&&(ot=!1);const ct=wi(s,r,"checkCrc32"),ut=(ct===dt?wi(s,r,"checkSignature"):ct)&&!C&&(!H||q||l&&1==l.vendorVersion),lt={options:{codecType:Sr,password:A,rawPassword:v,zipCrypto:q,encryptionStrength:l&&l.strength,checkCrc32:ut,checkAuthenticationCode:wi(s,r,"checkAuthenticationCode"),passwordVerification:q&&(b?g>>>8&_:y>>>24&_),outputSize:st,crc32:y,compressed:rt,encrypted:H,useWebWorkers:wi(s,r,St),useCompressionStream:ot,transferStreams:wi(s,r,zt),deflate64:it,format:j?j.format:dt,codecURI:j?j.codecURI:dt,compressionMethod:p,rawBitFlag:m,checkPasswordOnly:J},config:i,Ct:{signal:X,size:Y,onstart:tt,onprogress:et,onend:nt}};let wt,ft;Q&&await(async({reader:t,jt:e,index:n,offset:r,crc32:s,compressedSize:i,uncompressedSize:a,Kt:o,dataDescriptor:c,extraFieldZip64:d,Bt:u})=>{let l=0;if(c&&(l=d?20:12),l){const n=await qe(t,o+i,l+4),r=Zt(n);let c=n.length==l+4&&gi(r,0)==W;if(c){const t=ti(r,4,d);(e.encrypted&&!e.zipCrypto||t.crc32==s)&&t.compressedSize==i&&t.uncompressedSize==a?l+=4:c=!1}if(n.length>=l){const t=ti(r,c?4:0,d);t.signature=c,e.localDirectory.dataDescriptor=t}}const f={start:r,end:o+i+l,jt:e};for(const[t,e]of u)if(t!=n&&f.start<e.end&&e.start<f.end){const t=new w(Ts);throw t.overlappingEntry=e.jt,t}u.set(n,f)})({reader:o,jt:e,index:c,offset:F,crc32:y,compressedSize:S,uncompressedSize:x,Kt:K,dataDescriptor:b||z.bitFlag.dataDescriptor,extraFieldZip64:f||z.extraFieldZip64,Bt:n});try{if(!$){J&&(t=new R),t=new Be(t),await Ze(t,((t,e,n)=>a.min(t,n?1032*e:e))(st,S,rt)),({writable:wt}=t);const{outputSize:e}=await Ur({readable:G,writable:wt},lt);if(t.size+=e,e!=st)throw new w(nr)}}catch(e){if(e.outputSize!==dt&&(t.size+=e.outputSize),!J||e.message!=gn)throw ft=e,e}finally{if((Ve(t)||!wi(s,r,Ft))&&wt&&!wt.locked){const t=wt.getWriter();if(ft)try{await t.abort(ft)}catch{}else await t.close()}}return J||$?dt:t.getData?t.getData():wt}};function js(t){const e=a.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==gi(t,n))return!0;return!1}function Ks(t){if(t.length>=6){const e=Zt(t);if(gi(e,0)==B){const n=yi(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function Ys(t,e,r){const s=t.rawBitFlag=yi(e,r+2),i=!(1&~s),a=gi(e,r+6);n.assign(t,{encrypted:i,version:yi(e,r),bitFlag:{level:(6&s)>>1,dataDescriptor:!(8&~s),languageEncodingFlag:(s&tt)==tt},rawLastModDate:a,lastModDate:pi(a),filenameLength:yi(e,r+22),extraFieldLength:yi(e,r+24)})}function Gs(t,e,r,s,i){const{rawExtraField:a}=e,d=e.extraField=new c,u=Zt(a);let l=0;try{for(;l<a.length;){const t=yi(u,l),e=yi(u,l+2);d.set(t,{type:t,data:a.slice(l+4,l+4+e)}),l+=4+e}}catch{}const f=yi(r,s+4);n.assign(e,{signature:gi(r,s+10),crc32:gi(r,s+10),compressedSize:gi(r,s+14),uncompressedSize:gi(r,s+18)});const p=d.get(1);p&&(((t,e)=>{e.zip64=!0;const n=Zt(t.data),r=Vs.filter(([t,n])=>e[t]==n),s=r.reduce((t,[,e])=>t+Zs[e].bytes,0);if(t.data.length<s)throw new w(Rs);for(let s=0,i=0;s<r.length;s++){const[a,o]=r[s],c=Zs[o];e[a]=t[a]=c.Wt(n,i),i+=c.bytes}})(p,e),e.extraFieldZip64=p);const h=d.get(28789);h&&(Xs(h,Lr,Pr,e,t),e.extraFieldUnicodePath=h);const m=d.get(25461);m&&(Xs(m,Wr,Br,e,t),e.extraFieldUnicodeComment=m);const y=d.get(G);y&&y.data.length>=7?(((t,e,r)=>{const s=Zt(t.data),i=mi(s,4);n.assign(t,{vendorVersion:mi(s,0),vendorId:mi(s,2),strength:i,originalCompressionMethod:r,compressionMethod:yi(s,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)})(y,e,f),e.extraFieldAES=y):e.compressionMethod=f;const g=d.get(13);g&&(Js(g,e),e.extraFieldPkwareUnix=g);const x=d.get(22613);x&&(Js(x,e),e.extraFieldUnixType1=x);const S=d.get(10);S&&(((t,e)=>{const r=Zt(t.data);let s,i=4;try{for(;i<t.data.length&&!s;){const e=yi(r,i),n=yi(r,i+2);1==e&&(s=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(s&&24==s.length){const r=Zt(s),i=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),o=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:a,rawCreationDate:o});const c={lastModDate:hi(i),lastAccessDate:hi(a),creationDate:hi(o)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:a,rawCreationDate:o})}})(S,e),e.extraFieldNTFS=S);const b=d.get($);let z;if(b&&(z=Qs(b,e,!1),e.extraFieldUnix=b),!z){const t=d.get(Q);t&&(Qs(t,e,!0),e.extraFieldInfoZip=t)}const F=d.get(X);F&&(((t,e,n)=>{if(!t.data.length)return;const r=Zt(t.data),s=mi(r,0),i=[],a=[];n?(1&~s||(i.push(jr),a.push(Kr)),2&~s||(i.push(Yr),a.push(Gr)),4&~s||(i.push(Xr),a.push(Jr))):t.data.length>=5&&(i.push(jr),a.push(Kr));let c=1;i.forEach((n,s)=>{if(t.data.length>=c+4){const i=gi(r,c);e[n]=t[n]=new o(1e3*(0|i));const d=a[s];t[d]=i}c+=4})})(F,e,i),e.extraFieldExtendedTimestamp=F);const E=d.get(J);E&&(e.extraFieldUSDZ=E)}function Xs(t,e,r,s,i){if(t.data.length<5)return void(t.valid=!1);const a=Zt(t.data),o=new on;o.append(i[r]);const c=Zt(new f(4));c.setUint32(0,o.get(),!0);const d=gi(a,1);n.assign(t,{version:mi(a,0),[e]:Yt(t.data.subarray(5)),valid:!i.bitFlag.languageEncodingFlag&&d==gi(c,0)}),t.valid&&(s[e]=t[e],s[e+"UTF8"]=!0)}function Js(t,e){if(t.data.length<8)return;const r=Zt(t.data),s={lastAccessDate:new o(1e3*(0|gi(r,0))),lastModDate:new o(1e3*(0|gi(r,4)))};t.data.length>=12&&(s.uid=yi(r,8),s.gid=yi(r,10)),n.assign(t,s),n.assign(e,s)}function Qs(t,e,r){try{const s=Zt(t.data);let i,a;if(r){let e=0;const r=mi(s,e++),o=mi(s,e++);i=$s(t.data.subarray(e,e+o)),e+=o;const c=mi(s,e++);a=$s(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:a})}else t.data.length>=4&&(i=yi(s,0),a=yi(s,2),n.assign(t,{uid:i,gid:a}));return i!==dt&&(e.uid=i),a!==dt&&(e.gid=a),i!==dt||a!==dt}catch{}}function $s(t){const e=new f(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ti(t,e,n){const r=gi(t,e);let s,i;return n?(s=xi(t,e+4),i=xi(t,e+12)):(s=gi(t,e+4),i=gi(t,e+8)),{crc32:r,compressedSize:s,uncompressedSize:i}}function ei(t,e){return t.O?t.O(e):0}async function ni(t){return gi(Zt(await qe(t,0,4)))}function ri(t){return t===Ct||t===kt||t===Tt}function si(t,e){return ii(t,ii(e,kt))}function ii(t,e){const n=t.strictness;if(n!==dt){if(!ri(n))throw new w(Ns);return n}const r=t.checkAmbiguity;return r===dt?e:r?Ct:e==Tt?Tt:kt}function ai(t,e){if(e==Tt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Ps.test(t))||e==Ct&&(n.includes(".")||n.includes(""))}async function*oi(t,e){const n=t.size-e,r=await qe(t,n,e),s=Zt(r);for(let t=r.length-j;t>=0;t--)gi(s,t)==Z&&(yield[s,n,r,t,n+t])}function ci(t,e,n){return{offset:n,buffer:t.slice(e,e+j).buffer}}async function di(t,e,n,r,s,i,a){const o=yi(e,r+10),c=gi(e,r+12),d=gi(e,r+16);if(o==N||c==M||d==M)return await ui(t,e,n,s-K,i,a)==q?2:0;if(!o&&!c)return 1;const u=yi(e,r+6);for(const r of[s-c,ei(t,u)+d])if(await ui(t,e,n,r,i,a)==V)return 2;return 0}async function ui(t,e,n,r,s,i){return r<0||r+4>s?dt:r>=n?gi(e,r-n):i.count>0?(i.count--,gi(Zt(await qe(t,r,4)),0)):dt}function li(t){const e=new w(Is);throw e.reason=t,e}function wi(t,e,n){return e[n]===dt?t.options[n]:e[n]}function fi(t,e,n){return Ut(wi(t,e,n))}function pi(t){const e=(4294901760&t)>>16,n=t&N;return new o(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}function hi(t){return new o(s(t/i(1e4)-i(116444736e5)))}function mi(t,e){return t.getUint8(e)}function yi(t,e){return t.getUint16(e,!0)}function gi(t,e){return t.getUint32(e,!0)}function xi(t,e){return s(t.getBigUint64(e,!0))}var Si=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Is,ERR_BAD_FORMAT:bs,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Es,ERR_ENCRYPTED:As,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Os,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Us,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Fs,ERR_EOCDR_NOT_FOUND:zs,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Rs,ERR_INVALID_AUTHENTICATION_CODE:yn,ERR_INVALID_COMPRESSED_DATA:rr,ERR_INVALID_CRC32:sr,ERR_INVALID_FILENAME_VALIDATION:_s,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Ls,ERR_INVALID_PASSWORD:hn,ERR_INVALID_SIGNATURE:mn,ERR_INVALID_STRICTNESS:Ns,ERR_INVALID_UNCOMPRESSED_SIZE:nr,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ds,ERR_OVERLAPPING_ENTRY:Ts,ERR_SPLIT_ZIP_FILE:ks,ERR_UNSAFE_FILENAME:Ms,ERR_UNSUPPORTED_COMPRESSION:Cs,ERR_UNSUPPORTED_ENCRYPTION:vs,ZipReader:Hs});const bi="Zip file comment exceeds 64KB",zi="Invalid zip file comment (must be a Uint8Array)",Fi="Version exceeds 65535",Ei="Extra field data exceeds 64KB",Di=-2147483648,Ri=2147483647,Ai=i(0),vi=i("0x7fffffffffffffff"),Ci="Zip64 is not supported (set the 'zip64' option to 'true')",ki="Undetermined size",Ti=new f([7,0,2,0,65,69,3,0,0]),Ui="infozip",Ii="unix";let Oi=0;const Mi=[];class Ni{constructor(t,e={}){t=new Be(t);const{availableSize:r=ut,maxSize:s=ut}=t,i=r>0&&r!==ut&&s>0&&s!==ut;n.assign(this,{writer:t,Yt:i,options:e,Gt:new c,Xt:new d,offset:e[Et]===dt?t.size||t.writable.size||0:e[Et],Jt:e[Et]===dt?0:e[Et]-(t.size||t.writable.size||0),Qt:new d,$t:0,te:dt})}async prependZip(t){if(this.Xt.size)throw new w("Zip file not empty");t=new We(t),await Ze(t),t.size!==dt&&t.readUint8Array||(t=new fe(await qt(t.readable)),await Ze(t));const{ZipReader:r}=await g.resolve().then(()=>Si),s=new r(t),i=await s.getEntries();await s.close(),await Ze(this.writer);const{directoryOffset:a}=s;let o=0;this.Yt&&(delete this.Yt,await(async t=>Zt(await qe(t,0,4)).getUint32(0,!0)==P)(t)||(await ea(this.writer,ta()),o=4,this.offset+=o));const u=await(async(t,n,r,s,i)=>{const{writer:a}=t,o=new c;if(a.closeDisk){const i=e.from(r).sort((t,e)=>$i(n,t)-$i(n,e));let c=0;for(const e of i){const r=$i(n,e);await Ji(t,n,c,r-c),Gi(a,await Qi(n,r))&&await a.closeDisk(),o.set(e,{offset:Xi(t,a),diskNumberStart:Ki(a)}),c=r}await Ji(t,n,c,s-c)}else await Ji(t,n,0,s),r.forEach(t=>o.set(t,{offset:i+$i(n,t),diskNumberStart:0}));return o})(this,t,i,a,o);this.Xt=new d(i.map(t=>t.filename)),this.Gt=new c(i.map(t=>{const{version:e,rawLastModDate:r,lastAccessDate:s,creationDate:i,rawFilename:a,bitFlag:o,encrypted:c,uncompressedSize:d,compressedSize:l,zip64:w}=t;let{compressionMethod:f,ee:p,ne:h,re:m,se:y,ie:g,rawExtraField:x}=t;const{level:S,languageEncodingFlag:b,dataDescriptor:z}=o;p=p||ht,h=h||ht,m=m||ht,y=y||ht,g=g||ht,x=x||ht,t.extraFieldAES&&(f=99);const F=xa(p,h,m,y,g,x),E=w&&d>=M,D=w&&l>=M,R=-7&ba(S,b,z,c,f)|S<<1,{ae:A,oe:v}=Sa({version:e,bitFlag:R,compressionMethod:f,uncompressedSize:d,compressedSize:l,rawLastModDate:r,rawFilename:a,ce:D,de:E,extraFieldLength:F}),{crc32:C}=t;C!==dt&&ma(v,10,C);const{offset:k,diskNumberStart:T}=u.get(t);return n.assign(t,{de:E,ce:D,offset:k,diskNumberStart:T,ue:!1,ee:p,ne:h,re:m,se:y,ie:g,rawExtraField:x,extendedTimestamp:m.length>0||y.length>0,le:1+(s?2:0)+(i?4:0),ae:A,oe:v}),[t.filename,t]}))}async add(t="",e,r={}){const s=this;r=n.assign({},r);const{Qt:a}=s;let o,c;Oi<Lt().maxWorkers?Oi++:await new g(t=>Mi.push(t));try{if(t=t.trim(),aa(s,r,us)&&!t.endsWith(it)&&(t+=it),s.Xt.has(t))throw new w("File already exists");return s.Xt.add(t),c=!0,o=(async(t,e,r,s)=>{const a=_i(t,e,s);({name:e}=a);const o=Li(t,e,s),{comment:c}=o,d=s[ps];let u;t.Gt.set(e,dt);try{const{we:c}=o;0==c.level||c.compressionMethod!==dt||c.passThrough||await Fr(Lt())||(c.level=0);const d=await(async(t,e,{we:r},s)=>{if(r.passThrough&&!e&&!aa(t,s,us))throw new w("Undefined reader");let i;return e&&(e=new We(e),await Ze(e),({size:i}=e)),n.assign({reader:e},Wi(t,!!e,i,r,s))})(t,r,o,s);({reader:r}=d);const l=Yi(t.writer),f=Ki(t.writer),p=Bi(s=n.assign({},s,a.we,o.we,d.we,{signature:s[fs],crc32:s.crc32===dt?s[fs]:s.crc32,offset:t.offset-l,diskNumberStart:f})),h=Hi(s),m=xa(p.fe,h.pe);u=await(async(t,e,r,s,a)=>{const{Gt:o,writer:c}=t,{keepOrder:d,dataDescriptor:u,signal:l}=a,{he:f}=s,p=t.options[Dt],h=t.te;let m,y,x,S,b,z,F,D={},A=0;o.set(e,D),t.te=D;try{let y;d&&(y=h&&h.me,D.me=new g(t=>x=t)),a.bufferedWrite||!d||t.ye||t.$t||!u?(m=!0,t.$t++,F=a.createTempStream?await a.createTempStream():new E(dt,dt,{highWaterMark:ut}),F.size=0,await Ze(c)):(F=c,await v()),await Ze(F);const k=Yi(c);t.Yt&&(delete t.Yt,await ea(c,ta()),t.offset+=4),p&&!m&&Vi(s,t.offset-k);const{fe:T}=f;m||(await y,await C());const U=Ki(c),I=Xi(t,c);if(D.diskNumberStart=U,m||(b=!0,z=c.size,await ea(F,T)),D=await(async(t,e,{diskNumberStart:r,me:s},a,o,c)=>{const{he:d,ge:u,xe:l}=a,{ae:f,oe:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:x,compressionMethod:S,ee:b,Se:z,re:F,le:E,se:D,ie:R,ne:A}=d,{pe:v}=u,{rawFilename:C,lastAccessDate:k,creationDate:T,password:U,rawPassword:I,level:O,zip64:N,de:L,ce:P,zipCrypto:W,dataDescriptor:B,directory:V,executable:Z,versionMadeBy:H,rawComment:q,rawExtraField:j,useWebWorkers:K,transferStreams:Y,onstart:G,onprogress:X,onend:J,signal:Q,encryptionStrength:$,extendedTimestamp:tt,msDosCompatible:et,internalFileAttributes:nt,externalFileAttributes:rt,uid:st,gid:it,unixMode:at,symlink:ot,setuid:ct,setgid:ut,sticky:lt,unixExternalUpper:wt,msdosAttributesRaw:ft,msdosAttributes:pt,useCompressionStream:ht,passThrough:mt,format:yt,codecURI:gt}=c,xt={me:s,versionMadeBy:H,zip64:N,directory:!!V,executable:!!Z,filenameUTF8:!0,rawFilename:C,commentUTF8:!0,rawComment:q,ee:b,Se:z,re:F,se:D,ie:R,ne:A,rawExtraField:j,extendedTimestamp:tt,msDosCompatible:et,internalFileAttributes:nt,externalFileAttributes:rt,diskNumberStart:r,uid:st,gid:it,unixMode:at,symlink:!!ot,setuid:ct,setgid:ut,sticky:lt,unixExternalUpper:wt,msdosAttributesRaw:ft,msdosAttributes:pt};let{crc32:St,uncompressedSize:bt}=c,zt=0;mt||(bt=0);const{writable:Ft}=e;if(t){const n=Ht(je(t)),r=t.size,s={options:{codecType:xr,level:O,rawPassword:I,password:U,encryptionStrength:$,zipCrypto:y&&W,passwordVerification:y&&W&&m>>8&_,computeCrc32:!mt,compressed:g&&!mt,encrypted:y&&!mt,useWebWorkers:K,useCompressionStream:ht,transferStreams:Y,format:yt,codecURI:gt,compressionMethod:S},config:o,Ct:{signal:Q,size:r,onstart:G,onprogress:X,onend:J}};try{const t=await Ur({readable:n,writable:Ft},s);if(zt=t.outputSize,e.size+=zt,mt||(bt=t.inputSize,y&&!W||(St=t.crc32)),!P&&zt>=M||!L&&bt>=M)throw new w(Ci)}catch(t){throw t.outputSize!==dt&&(e.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:n,he:r,ge:s},{zip64:a,zipCrypto:o,passThrough:c,dataDescriptor:d})=>{const{oe:u,encrypted:l}=r,{be:w,ze:f}=s;l&&!o&&!c||t===dt||(ma(u,10,t),d&&ma(w,f,t)),a?d&&(ya(w,f+4,i(e)),ya(w,f+12,i(n))):(ma(u,14,e),ma(u,18,n),d&&(ma(w,f+4,e),ma(w,f+8,n)))})({crc32:St,compressedSize:zt,uncompressedSize:bt,he:d,ge:u},c),B&&await ea(e,v),n.assign(xt,{uncompressedSize:bt,compressedSize:zt,lastModDate:h,rawLastModDate:m,creationDate:T,lastAccessDate:k,encrypted:!!y,zipCrypto:!!W,size:l+zt,compressionMethod:S,version:x,ae:f,oe:p,signature:St,crc32:!y||W||mt?St:dt,le:E,de:L,ce:P}),xt})(r,F,D,s,Lt(),a),m||(b=!1),o.set(e,D),D.filename=e,m){if(await g.all([F.writable.getWriter().close(),y]),await v(),S=!0,z=c.size,await C(),D.diskNumberStart=Ki(c),D.offset=Xi(t,c),p){const e=s.xe;Vi(s,t.offset-Yi(c)),D.size+=s.xe-e}(({rawFilename:t,encrypted:e,zip64:n,Se:r,crc32:s,compressedSize:a,uncompressedSize:o,de:c,ce:d},u,{dataDescriptor:l,passThrough:w})=>{if(l||((!e||w&&s!==dt)&&ma(u,14,s),d||ma(u,18,a),c||ma(u,22,o)),n&&r){const e=at+xa(t)+4;ya(u,e,i(o)),ya(u,e+8,i(a))}})(D,f.Fe,a),await ea(c,f.fe),await(async(t,e,n)=>{const r=e.writable.getWriter();try{await t.pipeTo(new R({async write(t){var e;await r.ready,await r.write(t),e=xa(t),A+=e}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}})(F.readable,c,l),c.size+=F.size,S=!1}else D.diskNumberStart=U,D.offset=I;return t.offset+=D.size,D}catch(n){if(S||b){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-z,m&&(t.offset+=A)}throw o.delete(e),n}finally{if(m&&t.$t--,x&&x(),y&&y(),m&&F&&F.dispose)try{await F.dispose()}catch{}}async function v(){t.ye=!0;const{Ee:e}=t;t.Ee=new g(e=>y=()=>{t.ye=!1,e()}),await e}async function C(){Gi(c,xa(f.fe))&&await c.closeDisk()}})(t,e,r,{he:p,ge:h,xe:m},s)}catch(n){throw t.Gt.delete(e),n}return n.assign(u,{name:e,comment:c,extraField:d,[ts]:u.internalFileAttributes,[es]:u.externalFileAttributes}),new Ss(u)})(s,t,e,r),a.add(o),await o}catch(e){throw c&&s.Xt.delete(t),e}finally{a.delete(o);const t=Mi.shift();t?t():Oi--}}remove(t){const{Xt:e,Gt:n}=this;if(typeof t==pt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=ht,n={}){const{Qt:r,writer:s}=this,{writable:a}=s;if(!(t instanceof f))throw new w(zi);if(xa(t)>N)throw new w(bi);for(;r.size;)await g.allSettled(e.from(r));return await(async(t,n,r)=>{const s=qi(t.Gt),{De:a,Re:o}=await(async(t,n,r)=>{const{Gt:s,writer:i}=t,a=new f(n);await Ze(i);let o=0,c=0,d=Ki(i),u=Yi(i);for(const[t,n]of e.from(s.values()).entries()){const{offset:e,rawFilename:l,ee:w,ne:f,re:p,se:h,ie:m,rawExtraField:y,rawComment:g,versionMadeBy:x,ae:S,oe:b,de:z,ce:F,ue:E,Ae:D,internalFileAttributes:R,externalFileAttributes:A,diskNumberStart:v,uncompressedSize:C,compressedSize:k}=n,T=xa(w,f,p,h,m,y),U=46+xa(l,g)+T;Gi(i,o+U-c)&&(await ea(i,a.slice(c,o)),c=o,await i.closeDisk()),0==t&&(d=Ki(i),u=Yi(i)),z||ma(b,18,C),F||ma(b,14,k),(D||E)&&n.version<45&&ha(b,0,45);const I=ji(U);if(I.ve(V),I.Ce(x),I.ke(S.subarray(0,24)),I.Ce(T),I.Ce(xa(g)),I.Ce(E?N:v),I.Ce(R),I.ve(A),I.ve(D?M:e),I.ke(l),I.ke(w),I.ke(f),I.ke(p),I.ke(h),I.ke(m),I.ke(y),I.ke(g),ga(a,I.v,o),o+=U,r.onprogress)try{await r.onprogress(t+1,s.size,new Ss(n))}catch{}}return await ea(i,c?a.slice(c):a),{De:{diskNumber:d,diskOffset:u},Re:a}})(t,s,r),c=await(async(t,e,n)=>{const r=ca(t,n,Rt);if(r){const n=await r(e),s=xa(n);if(s>N)throw new w("Signature data exceeds 64KB");const i=ji(6+s);return i.ve(B),i.Ce(s),i.ke(n),await ea(t.writer,i.v),6+s}return 0})(t,o,r);await(async(t,e,n,r)=>{const{writer:s}=t,{De:a,Te:o}=r;let{Ue:c}=r,d=t.Gt.size,u=a.diskNumber,l=Xi(t,a),f=Ki(s);Gi(s,j)&&f++;let p=aa(t,n,is);if(l>=M||c>=M||d>=N||f>=N){if(!1===p)throw new w(Ci);p=!0}const h=xa(e);if(h>N)throw new w(bi);const m=ji(p?98:j);Gi(s,xa(m.v)+h)&&await s.closeDisk(),f=Ki(s),p&&(m.ve(H),m.Ie(44),m.Ce(45),m.Ce(45),m.ve(f),m.ve(u),m.Ie(d),m.Ie(d),m.Ie(c),m.Ie(l),m.ve(q),m.ve(f),m.Ie(i(Xi(t,s))+i(c)+i(o)),m.ve(f+1),aa(t,n,"supportZip64SplitFile",!0)&&(f=N,u=N),d=N,l=M,c=M),m.ve(Z),m.Ce(f),m.Ce(u),m.Ce(d),m.Ce(d),m.ve(c),m.ve(l),m.Ce(h),await ea(s,m.v),h&&await ea(s,e)})(t,n,r,{De:a,Ue:s,Te:c})})(this,t,n),!Ve(s)&&aa(this,n,Ft)||await a.getWriter().close(),s.getData?s.getData():a}}function _i(t,n,r){n=n.trim();let i=aa(t,r,ss),a=aa(t,r,cs,i?20:768);const o=aa(t,r,ls),c=la(t,r,"uid"),d=la(t,r,"gid");let u=la(t,r,hs),l=aa(t,r,"unixExtraFieldType"),f=aa(t,r,ms),p=aa(t,r,ys),h=aa(t,r,gs);if(c!==dt&&(!s.isInteger(c)||c<0||c>M))throw new w("Invalid uid (must be integer 0..2^32-1)");if(d!==dt&&(!s.isInteger(d)||d<0||d>M))throw new w("Invalid gid (must be integer 0..2^32-1)");if(u!==dt&&(!s.isInteger(u)||u<0||u>N))throw new w("Invalid UNIX mode (must be integer 0..65535)");if(l!==dt&&l!==Ui&&l!==Ii)throw new w("Invalid unixExtraFieldType (must be 'infozip' or 'unix')");if(l===Ii&&(c!==dt&&c>N||d!==dt&&d>N))throw new w("uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)");l!==dt||c===dt&&d===dt||(l=Ui);let m=la(t,r,ns),y=aa(t,r,rs);const g=m!==dt||y!==dt;if(c!==dt||d!==dt||u!==dt||l||o?(i=!1,a=a&_|768):g&&(i=!0,a&=_),m!==dt&&(!s.isInteger(m)||m<0||m>_))throw new w("Invalid msdosAttributesRaw (must be integer 0..255)");if(y&&(typeof y!==ft||e.isArray(y)))throw new w("Invalid msdosAttributes (must be an object with boolean flags)");if(a>N)throw new w(Fi);let x=da(t,r,$r,es);const S=x!==dt;S||(x=0),!r[us]&&n.endsWith(it)&&(r[us]=!0);const b=aa(t,r,us);if(b?(n.endsWith(it)||(n+=it),S||(x=16,i||(x|=16877<<16))):i||S||(x=o?493<<16:27525120),!i){const t=u!==dt||!!(f||p||h);u=u===dt?x>>16&N:u&N,f?u|=rt:f=!!(u&rt),p?u|=st:p=!!(u&st),h?u|=512:h=!!(512&u),S&&!t||(b?u=-61441&u|nt:u&et||(u|=32768),x=(u&N)<<16|x&N)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==dt)t&=_;else if(e!==dt){const{readOnly:n,hidden:r,system:s,directory:i,archive:a}=e;let o=0;n&&(o|=1),r&&(o|=2),s&&(o|=4),i&&(o|=16),a&&(o|=32),t=o&_}return e===dt&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),g&&(x=x&M|m&_),{name:n,we:{versionMadeBy:a,msDosCompatible:!!i,externalFileAttributes:x,unixExternalUpper:x>>16&N,uid:c,gid:d,unixMode:u,unixExtraFieldType:l,symlink:u!==dt&&40960==(u&et),setuid:f,setgid:p,sticky:h,msdosAttributesRaw:m,msdosAttributes:y}}}function Li(t,e,n){const r=ca(t,n,"encodeText")||dn;let i=r(e,At);if(i===dt&&(i=dn(e)),xa(i)>N)throw new w("File entry name exceeds 64KB");const a=n[Wr]||"";if(typeof a!=pt)throw new w("Invalid file entry comment (must be a string)");let c=r(a,vt);if(c===dt&&(c=dn(a)),xa(c)>N)throw new w("File entry comment exceeds 64KB");const d=aa(t,n,os,20);if(d>N)throw new w(Fi);const u=oa(t,n,jr,new o),l=oa(t,n,Yr),f=oa(t,n,Xr),p=da(t,n,Qr,ts,0),h=aa(t,n,gt),m=aa(t,n,mt),y=aa(t,n,yt);Ot(m,y);const g=la(t,n,"encryptionStrength",3),x=aa(t,n,ds),S=aa(t,n,"extendedTimestamp",!0),b=aa(t,n,"ntfsTimestamp"),z=aa(t,n,"keepOrder",!0),F=aa(t,n,St),E=aa(t,n,zt),D=aa(t,n,"bufferedWrite"),R=ca(t,n,"createTempStream"),A=aa(t,n,"dataDescriptorSignature",!0),v=It(aa(t,n,xt)),C=aa(t,n,"useUnicodeFileNames",!0),k=aa(t,n,ws),T=h||k===dt?dt:Ge(k);if(!h&&k!==dt&&0!==k&&8!==k&&!T)throw new w("Compression method not supported");let U=la(t,n,"level");if(U!==dt&&(!s.isInteger(U)||U<0||U>9))throw new w("Invalid level (must be integer 0..9)");if(t.options[Dt]){if(m!==dt||y!==dt)throw new w("Encryption is not supported in USDZ files");U===dt&&k===dt&&(U=0)}h&&(U=dt);let I=aa(t,n,bt),O=aa(t,n,"dataDescriptor");D&&O===dt&&(O=!1),(O===dt||x)&&(O=!0),U!==dt&&6!=U&&(I=!1);const M=aa(t,n,is);if(!(x||m===dt&&y===dt||s.isInteger(g)&&g>=1&&g<=3))throw new w("The strength must equal 1, 2, or 3");const _=Pi(n[ps]),L=Pi(n.localExtraField);return{comment:a,we:{rawFilename:i,rawComment:c,version:d,lastModDate:u,lastAccessDate:l,creationDate:f,internalFileAttributes:p,passThrough:h,password:m,rawPassword:y,encryptionStrength:g,zipCrypto:x,extendedTimestamp:S,ntfsTimestamp:b,keepOrder:z,useWebWorkers:F,transferStreams:E,bufferedWrite:D,createTempStream:R,dataDescriptorSignature:A,signal:v,useUnicodeFileNames:C,compressionMethod:k,format:T?T.format:dt,codecURI:T?T.codecURI:dt,Oe:T?T.versionNeeded:dt,level:U,useCompressionStream:I,dataDescriptor:O,zip64:M,rawExtraField:_,Me:L}}}function Pi(t){if(!t)return ht;if(!(t instanceof c))throw new w("Invalid extra field (must be a Map)");let e=0,n=0;t.forEach((t,n)=>{if(!s.isInteger(n)||n<0||n>N)throw new w("Invalid extra field type (must be integer 0..65535)");if(!(t instanceof f))throw new w("Invalid extra field data (must be a Uint8Array)");if(xa(t)>N)throw new w(Ei);e+=4+xa(t)});const r=new f(e),i=Zt(r);return t.forEach((t,e)=>{ha(i,n,e),ha(i,n+2,xa(t)),ga(r,t,n+4),n+=4+xa(t)}),r}function Wi(t,e,n,r,s){const{passThrough:i,zipCrypto:a,password:o,rawPassword:c,encryptionStrength:d}=r;let{dataDescriptor:u,zip64:l,level:f,compressionMethod:p}=r,h=0,m=0;if(i&&e){if(m=s[Vr],m===dt)throw new w("Undefined uncompressed size");if(p===dt)throw new w("Undefined compression method")}const y=!0===l,g=aa(t,s,as);if(e&&i&&!g&&xa(o,c))throw new w("Encryption is not supported when the 'passThrough' option is set");const x=e&&(!!(o&&xa(o)||c&&xa(c))||i&&g);e||(f=0,p=0);const S=x?a?12:16+4*d:0;e&&(i?(s.uncompressedSize=m,h=n===dt?wa(m)+S:n):n===dt?(u=!0,(l||l===dt)&&(l=!0,m=h=4294967296)):(s.uncompressedSize=m=n,h=(fa(p,f)?wa(m):m)+S));const b=y||m>=M,z=y||h>=M;if(b||z){if(!1===l)throw new w(Ci);l=!0}return l=l||!1,{Ne:h,we:{dataDescriptor:u,zip64:l,de:b,ce:z,uncompressedSize:m,level:f,compressionMethod:p,encrypted:x}}}function Bi(t){const{rawFilename:e,lastModDate:n,lastAccessDate:r,creationDate:s,level:i,zip64:c,zipCrypto:d,useUnicodeFileNames:u,dataDescriptor:l,directory:f,rawExtraField:p,Me:h,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:g,passThrough:x,encrypted:S,de:b,ce:z,uncompressedSize:F,crc32:E}=t;let{version:D,compressionMethod:R}=t;const A=!f&&fa(R,i);let v;const C=x||!A,k=c&&(t.bufferedWrite||!l||!b&&!z||C),T=k||c&&l&&(b||z);if(c&&(b||z)){const t=20,e=ji(t);if(e.Ce(1),e.Ce(t-4),v=e.v,k&&(e.Ie(F),C)){const t=S?d?12:16+4*m:0;e.Ie(x?0:F+t)}}else v=ht;let U,I,O,M,_;if(S&&!d){const t=ji(xa(Ti)+2);t.Ce(G),t.ke(Ti),U=t.v,U[8]=m}else U=ht;if(y){const t=ra(n),e=sa(t);if(e){const e=9+(r?4:0)+(s?4:0),n=ji(e);M=1+(r?2:0)+(s?4:0),n.Ce(X),n.Ce(e-4),n._e(M),n.ve(t),r&&n.ve(ia(ra(r))),s&&n.ve(ia(ra(s))),O=n.v}else O=ht;if(g===dt?!e||r||s:g)try{const t=na(n),e=ji(36);e.Ce(10),e.Ce(32),e.Le(4),e.Ce(1),e.Ce(24),e.Ie(t),e.Ie(r?na(r):t),e.Ie(s?na(s):t),I=e.v}catch{I=ht}else I=ht}else I=O=ht;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=Ui||e===dt&&n===dt)if(r!=Ii||e===dt&&n===dt)_=ht;else{const t=ji(8);t.Ce($),t.Ce(4),t.Ce((e===dt?0:e)&N),t.Ce((n===dt?0:n)&N),_=t.v}else{const t=Zi(e),r=Zi(n),s=3+t.length+r.length,i=ji(4+s);i.Ce(Q),i.Ce(s),i._e(1),i._e(t.length),i.ke(t),i._e(r.length),i.ke(r),_=i.v}}catch{_=ht}R===dt&&(R=A?8:0);const{Oe:P}=t;A&&P!==dt&&(D=D>P?D:P),c&&(D=D>45?D:45),S&&!d&&(D=D>51?D:51,x&&E!==dt&&(U[4]=1),U[9]=R,R=99);const W=T?xa(v):0,B=W+xa(U,O,I,_,p,h);if(B>N)throw new w(Ei);const V=new o(2e3*a.ceil(a.floor(n.getTime()/1e3)/2)),{ae:Z,oe:H,rawLastModDate:q}=Sa({version:D,bitFlag:ba(i,u,l,S,R),compressionMethod:R,uncompressedSize:F,lastModDate:V<ct?ct:V>ot?ot:V,rawFilename:e,ce:z,de:b,extraFieldLength:B}),j=ji(at+xa(e)+B),K=j.v,Y=Zt(K);return j.ve(L),j.ke(Z),j.ke(e),T&&j.ke(v),j.ke(U),j.ke(O),j.ke(I),j.ke(_),j.ke(p),j.ke(h),l&&(z||ma(Y,18,0),b||ma(Y,22,0)),{fe:K,Fe:Y,ae:Z,oe:H,lastModDate:n,rawLastModDate:q,encrypted:S,compressed:A,version:D,compressionMethod:R,le:M,ee:ht,Se:W,re:O,se:I,ie:_,ne:U,extraFieldLength:B}}function Vi(t,e){const{he:n}=t;let{fe:r,extraFieldLength:s}=n,i=64-(e+xa(r))%64;i<4&&(i+=64);const a=new f(i),o=Zt(a);ha(o,0,J),ha(o,2,i-4);const c=r;n.fe=r=new f(xa(c)+i),ga(r,c),ga(r,a,xa(c));const d=Zt(r);ha(d,28,s+i),n.Fe=d,t.xe+=i}function Zi(t){if(t===dt)return ht;{const e=new f(4);Zt(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}}function Hi({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,s=ht,i=0,a=t?20:12;return n&&(a+=4),e&&(s=new f(a),r=Zt(s),n&&(i=4,ma(r,0,W))),{pe:s,be:r,ze:i}}function qi(t){let e=0;for(const[,n]of t){const{rawFilename:t,ne:r,rawComment:s,se:i,ie:a,rawExtraField:o,extendedTimestamp:c,le:d,lastModDate:u,de:l,ce:f,uncompressedSize:p,compressedSize:h}=n,m=n.offset>=M,y=n.diskNumberStart>=N;let g,x;if(m||y||l||f){const t=4+(l?8:0)+(f?8:0)+(m?8:0)+(y?4:0),e=ji(t);e.Ce(1),e.Ce(t-4),l&&e.Ie(p),f&&e.Ie(h),m&&e.Ie(n.offset),y&&e.ve(n.diskNumberStart),g=e.v}else g=ht;n.ee=g,n.Ae=m,n.ue=y;const S=ra(u);if(c&&sa(S)){const t=ji(9);t.Ce(X),t.Ce(5),t._e(d),t.ve(S),x=t.v}else x=ht;n.re=x;const b=xa(g,r,i,a,x,o);if(b>N)throw new w(Ei);e+=46+xa(t,s)+b}return e}function ji(t){const e=new f(t),n=Zt(e);let r=0;return{v:e,_e:t=>{((t,e,n)=>{t.setUint8(e,n)})(n,r,t),r+=1},Ce:t=>{ha(n,r,t),r+=2},ve:t=>{ma(n,r,t),r+=4},Ie:t=>{ya(n,r,i(t)),r+=8},ke:t=>{ga(e,t,r),r+=xa(t)},Le:t=>r+=t}}function Ki(t){const{diskNumber:e=0}=t;return e}function Yi(t){const{diskOffset:e=0}=t;return e}function Gi(t,e){const{availableSize:n=ut}=t;return e>n}function Xi(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.Jt:0)}async function Ji(t,e,n,r){if(r>0){const{writer:s}=t;await je(e,{offset:n,size:r}).pipeTo(s.writable,{preventClose:!0,preventAbort:!0}),s.size+=r,t.offset+=r}}async function Qi(t,e){const n=await qe(t,e,at);if(xa(n)<at)return at;const r=Zt(n);return at+pa(r,26)+pa(r,28)}function $i(t,{offset:e,diskNumberStart:n}){return e+(t.O?t.O(n):0)}function ta(){const t=new f(4);return ma(Zt(t),0,P),t}async function ea(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=xa(e),await r.write(e)}finally{r.releaseLock()}}function na(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<Ai?Ai:e>vi?vi:e}}function ra(t){return a.floor(t.getTime()/1e3)}function sa(t){return t>=Di&&t<=Ri}function ia(t){return a.min(Ri,a.max(Di,t))}function aa(t,e,n,r){const s=e[n]===dt?t.options[n]:e[n];return s===dt?r:s}function oa(t,e,n,r){const i=aa(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=wt||s.isNaN(i.getTime())))throw new w("Invalid date (must be a valid Date instance)");return i}function ca(t,e,n){return Ut(aa(t,e,n))}function da(t,e,n,r,s){const i=ua(e,n,r),a=i===dt?ua(t.options,n,r):i;return a===dt?s:a}function ua(t,e,n){return t[e]===dt?t[n]:t[e]}function la(t,e,n,r){return Mt(aa(t,e,n,r))}function wa(t){return t+5*(a.floor(t/16383)+1)}function fa(t,e){return t===dt?e===dt||e>0:0!==t}function pa(t,e){return t.getUint16(e,!0)}function ha(t,e,n){t.setUint16(e,n,!0)}function ma(t,e,n){t.setUint32(e,n,!0)}function ya(t,e,n){t.setBigUint64(e,n,!0)}function ga(t,e,n){t.set(e,n)}function xa(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Sa({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:s,lastModDate:i,rawLastModDate:a,rawFilename:o,ce:c,de:d,extraFieldLength:u}){const l=ji(26),w=l.v,f=Zt(w);if(l.Ce(t),l.Ce(e),l.Ce(n),a===dt){const t=new h(1),e=Zt(t);ha(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),ha(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),a=t[0]}return l.ve(a),l.Le(4),c||s!==dt?l.ve(c?M:s):l.Le(4),d||r!==dt?l.ve(d?M:r):l.Le(4),l.Ce(xa(o)),l.Ce(u),{ae:w,oe:f,rawLastModDate:a}}function ba(t,e,n,r,s){let i=0;return e&&(i|=tt),n&&(i|=8),8!=s&&9!=s||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}const za="Entry filename already exists",Fa="Readable stream already consumed",Ea="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Da="Invalid readerOptions (must be an object)",Ra="zipjs-abort-export",Aa="The operation was aborted",va=new d([1,G,10,X,28789,25461,J,Q,$,22613,13]);class Ca{constructor(t,e,r,s){const i=this;if(t.root&&s&&s.getChildByName(e))throw new w(za);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Pe++,parent:s,children:[],uncompressedSize:r.uncompressedSize||0,We:r.We||r.uncompressedSize===dt,passThrough:r.passThrough,Be:r.Be||new o}),!s&&t.root||(t.entries[i.id]=i),s&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return!!e}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw new w(za);this.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class ka extends Ca{constructor(t,e,n,r){super(t,e,n,r);const s=this;s.Reader=n.Reader,s.Writer=n.Writer,n.getData&&(s.getData=n.getData)}clone(){return new ka(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&((t,e)=>{const{contentType:n}=t;return n===dt||(t.constructor==pe?e.type==n:t.constructor!=ue||e.startsWith(t.data))})(t,n.data))return n.data;{const r=n.reader=Pa(n.Reader,n.data,e),s=n.uncompressedSize||r.size;await g.all([Ze(r),Ze(t,s)]);const i=It(e.signal),a=((t,e,n,r)=>{const{onstart:s,onprogress:i,onend:a}=n,{readable:o}=e;return t.data instanceof Ss||!s&&!i&&!a?o:Ht(o).pipeThrough(new Dr({onstart:s,onprogress:i,onend:a,size:e.size}),{signal:r})})(n,r,e,i),o=!Ve(t)&&!!e.preventClose;return n.uncompressedSize=r.size,await Ht(a).pipeTo(jt(t.writable),{signal:i,preventClose:o,preventAbort:o}),t.getData?t.getData():t.writable}}isPasswordProtected(){return!(!this.data||!this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==hn)return!1;throw t}}getText(t,e){return this.getData(new ye(t),e)}getBlob(t,e){return this.getData(new pe(t),e)}getData64URI(t,e){return this.getData(new ue(t),e)}getUint8Array(t){return this.getData(new _e,t)}getWritable(t=new R,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Vt(await this.getUint8Array(t)).buffer}replaceBlob(t){n.assign(this,{data:t,Reader:fe,Writer:pe,reader:null})}replaceText(t){n.assign(this,{data:t,Reader:he,Writer:ye,reader:null})}replaceData64URI(t){n.assign(this,{data:t,Reader:de,Writer:ue,reader:null})}replaceUint8Array(t){n.assign(this,{data:t,Reader:Ne,Writer:_e,reader:null})}replaceReadable(t){n.assign(this,{data:null,Reader:_a(t),Writer:null,reader:null})}}class Ta extends Ca{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Ta(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return Ja(this,t,{options:e},!0)}addText(t,e,n={}){return Ja(this,t,{data:e,Reader:he,Writer:ye,options:n,uncompressedSize:me(e)})}addBlob(t,e,n={}){return Ja(this,t,{data:e,Reader:fe,Writer:pe,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){let r=e.length;for(;"="==e.charAt(r-1);)r--;const s=e.indexOf(",")+1;return Ja(this,t,{data:e,Reader:de,Writer:ue,options:n,uncompressedSize:a.floor(.75*(r-s))})}addUint8Array(t,e,n={}){return Ja(this,t,{data:e,Reader:Ne,Writer:_e,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return Ja(this,t,{data:e,Reader:class extends Me{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return Ja(this,t,{Reader:_a(e),options:n})}addFileSystemEntry(t,e={}){return Ya(this,t,e)}addFileSystemHandle(t,e={}){return Ya(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new o(t.lastModified)),Ja(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new fe(t),e)}importData64URI(t,e){return this.importZip(new de(t),e)}importUint8Array(t,e){return this.importZip(new Ne(t),e)}importHttpContent(t,e){return this.importZip(new Me(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new pe(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new ue(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new _e,t)}async exportWritable(t=new R,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const{onstart:s,onprogress:i,onend:a}=r,o=qa(r.readerOptions),c=new AbortController,{signal:d}=c,u=((t,e)=>{if(!It(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)})(r.signal,c),l=n.assign({},r,o,{signal:d,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),f=Oa([t],t=>Na(t,l.passThrough)),p=[];let h=!1,m=0;try{s&&await Rr(s,f),await x(t,e),a&&await Rr(a,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{u()}return e;function y(t){const e=t.getWriter();return new R({async write(t){await e.write(t),m+=t.length,i&&await Rr(i,m,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function x(t,e){if(r.concurrent){const n=(await g.allSettled(t.children.map(t=>S(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Va(t.reason));throw(t=>{const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e})((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await S(n,e)}async function S(e,n){if(d.aborted){if(h||Va(d.reason))return;throw d.reason===dt?new DOMException(Aa,"AbortError"):d.reason}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await x(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),s=await r.createWritable();try{await e.getData({writable:y(s)},l)}catch(t){throw h?new w(Ra):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new w(Ra));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}})(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==wt?(r=t,e=n.assign({},r.options,e)):(await Ze(t),r=new Hs(t,e));const s=[],i=await r.getEntries(e);for(const t of i){let r=this;try{const i=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=i.pop();if(i.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw new w(za)}else r=new Ta(this.fs,t,{data:null},e),s.push(r)}),t.directory){let e=r;if(a)if(e=r.getChildByName(a),e){if(!e.directory)throw new w(za)}else e=new Ta(this.fs,a,{data:null},r),s.push(e);e==this||e.data||(e.data=t)}else s.push(Ja(r,a,{data:t,Reader:La(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return s}async exportZip(t,e={}){const r=this;(e=n.assign({},e)).bufferedWrite===dt&&(e.bufferedWrite=!0);const[s]=await g.all([Wa(r,qa(e.readerOptions)),Ze(t)]),i=new Ni(t,e);return await(async(t,e,r,s,i)=>{const{onstart:a,onprogress:o,onend:c,onentryprogress:d}=s,u=e,l=Oa(e.children,t=>Ka(t)?0:1);let w=0,f=0;if(a&&await Rr(a,r),s.bufferedWrite)await async function t(e){const n=(await g.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(Ka(e))return;const{name:a,Ve:c}=Za(e,u,s);let p=0;const h=await t.add(a,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{w+=t-p,p=t,o&&await Rr(o,w,r)}}));f++,d&&await Rr(d,f,l,h)}c&&await Rr(c,w)})(i,r,Oa([r],Ma),e,s),await i.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(t={}){const e=this;qa((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=!t.bufferedWrite||!1!==t.keepOrder&&e.children.every(t=>!t.children.length);return(async(t,e,r,s)=>{const i={options:t};if(Ut(t[Rt]))throw new w(ki);if(s!==dt&&!(s instanceof f))throw new w(zi);const a=xa(s);if(a>N)throw new w(bi);const o=t[Dt],d=new c;let u=!!o,l=0;for(const t of e){let{name:e}=t;const{size:r}=t,s=n.assign({},t.options);e=e.trim(),aa(i,s,us)&&!e.endsWith(it)&&(e+=it);const a=_i(i,e,s);({name:e}=a);const{we:c}=Li(i,e,s);0==c.level||c.compressionMethod!==dt||c.passThrough||await Fr(Lt())||(c.level=0);const f=!aa(i,s,us);if(f&&r===dt)throw new w(ki);const{Ne:p,we:h}=Wi(i,f,r,c,s);if(f&&!c.passThrough&&fa(h.compressionMethod,h.level))throw new w(ki);const m=n.assign({},s,a.we,c,h),y=Bi(m),g=Hi(m),x={he:y,xe:xa(y.fe,g.pe)};o&&Vi(x,l);const S=f?p:0;l>=M&&(u=!0),d.set(e,n.assign({},m,y,{offset:l,diskNumberStart:0,compressedSize:S})),l+=x.xe+S}if(u&&!r)throw new w(ki);const p=qi(d);let h=aa(i,t,is);if(l>=M||p>=M||d.size>=N){if(!1===h)throw new w(Ci);h=!0}return l+p+a+(h?98:j)})(t,e.getChildren({recursive:!0}).filter(t=>!Ka(t)).map(n=>{const{name:r,Ve:s}=Za(n,e,t);return{name:r,size:n.directory?0:Ha(n,ja(n,t)),options:s}}),r,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return((t,e)=>{const n=[],r=[t];let s=0;for(;s<r.length;)for(const t of r[s++].children)n.push(t),e&&r.push(t);return n})(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await g.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class Ua{constructor(){Xa(this)}get children(){return this.root.children}remove(t){Ba(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new w("Root directory cannot be moved");if(!e.directory)throw new w("Target entry is not a directory");if(e.isDescendantOf(t))throw new w("Entry is a ancestor of target entry");if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new w(za)}else Ba(t),t.parent=e,e.children.push(t),((t,e)=>{const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}})(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.getChildByName(e[t]);return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Xa(this),this.root.importBlob(t,e)}importData64URI(t,e){return Xa(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return Xa(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return Xa(this),this.root.importHttpContent(t,e)}importReadable(t,e){return Xa(this),this.root.importReadable(t,e)}importZip(t,e){return Xa(this),this.root.importZip(t,e)}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const Ia={FS:Ua,ZipDirectoryEntry:Ta,ZipFileEntry:ka};function Oa(t,n){let r=0;const s=e.from(t);for(;s.length;){const t=s.pop();r+=n(t)||0;for(const e of t.children)s.push(e)}return r}function Ma(t){return t.uncompressedSize}function Na(t,e){const{data:n}=t;return e&&n instanceof Ss?n.compressedSize:t.uncompressedSize}function _a(t){let e;return()=>{if(e)throw new w(Fa);return e=!0,{readable:t}}}function La(t){return class extends oe{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:s,checkOverlappingEntryOnly:i}=r,a=await e.entry.getData(new pe,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||s,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=a,e.Ze=new fe(a),e.size=a.size,super.init()}readUint8Array(t,e){return this.Ze.readUint8Array(t,e)}}}function Pa(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Wa(t,e){const n=[],r=[t],s=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await g.all(n.map(async t=>{const n=t.reader=Pa(t.Reader,t.data,e);s.set(t,n);try{await Ze(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.We=!1)})),s}function Ba(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Va(t){return!!t&&t.message==Ra}function Za(t,e,r){const s=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let a={},o={};if(t.data instanceof Ss){const{externalFileAttributes:e,versionMadeBy:s,comment:i,lastModDate:d,creationDate:u,lastAccessDate:l,uncompressedSize:w,encrypted:f,zipCrypto:p,crc32:h,compressionMethod:m,extraFieldAES:y,internalFileAttributes:g,extraField:x,uid:S,gid:b}=t.data;a={externalFileAttributes:e,versionMadeBy:s,comment:i,lastModDate:d,creationDate:u,lastAccessDate:l,internalFileAttributes:g};const z=(t=>{if(t){const e=new c;if(t.forEach((t,n)=>{va.has(n)||e.set(n,t.data)}),e.size)return e}})(x);if(z&&(a.extraField=z),S===dt&&b===dt||n.assign(a,{uid:S,gid:b,unixExtraFieldType:"infozip"}),ja(t,r)){let t;y&&(t=y.strength),o={passThrough:!0,encrypted:f,zipCrypto:p,crc32:h,uncompressedSize:w,encryptionStrength:t,compressionMethod:m}}}const d=n.assign({lastModDate:t.Be},a,r,i,o,{directory:t.directory});if(!t.directory&&d.passThrough&&d.uncompressedSize===dt)throw new w(Ea);return{name:s,Ve:d}}function Ha(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.We?dt:Na(t,e)}function qa(t){if(t&&(typeof t!=ft||e.isArray(t)))throw new w(Da);return t}function ja(t,e){const{readerOptions:n}=e;return!(t.directory||!(t.passThrough||n&&n.passThrough))}function Ka(t){return t.directory&&null===t.data}function Ya(t,e,r){return async function t(e,s,i,a=""){if(s){const c=a?a+"/"+s.name:s.name;try{if((s.isFile||s.isDirectory)&&(s=await Ga(s)),"file"==s.kind){const t=await s.getFile();i.push(Ja(e,t.name,{Reader:()=>({readable:t.stream(),size:t.size}),options:n.assign({},{lastModDate:new o(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==s.kind){const n=e.addDirectory(s.name,r);i.push(n);for await(const e of s.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function Ga(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new g((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await(async t=>{const e=[];function n(t,r,s){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await Ga(t));n(t,r,s)}else r(e)},s)}return await new g((e,r)=>n(t.createReader(),e,r)),{[T.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}})(t);e.values=()=>n}return e}function Xa(t){t.entries=[],t.Pe=0,t.root=new Ta(t)}function Ja(t,e,n,r){if(t.directory)return r?new Ta(t.fs,e,n,t):new ka(t.fs,e,n,t);throw new w("Parent entry is not a directory")}t.ERR_ABORTED=Aa,t.ERR_ENTRY_EXISTS=za,t.ERR_INVALID_PASS_THROUGH=Ea,t.ERR_INVALID_READER_OPTIONS=Da,t.ERR_READABLE_CONSUMED=Fa,t.ZipDirectoryEntry=Ta,t.ZipEntry=Ca,t.ZipFS=Ua,t.ZipFileEntry=ka,t.fs=Ia});
|