@zip.js/zip.js 2.11.2 → 2.11.4
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/BENCHMARKS.md +146 -38
- package/deno.json +1 -1
- package/dist/zip-core-external.js +80 -36
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +82 -36
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +87 -41
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +89 -41
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +87 -41
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +89 -41
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +89 -41
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +82 -36
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +82 -36
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +82 -36
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +88 -40
- package/index-native.min.js +1 -1
- package/index.cjs +88 -40
- package/index.d.cts +39 -2
- package/index.d.ts +39 -2
- package/index.min.js +1 -1
- package/lib/core/io.js +7 -5
- package/lib/core/options.js +13 -0
- package/lib/core/version.js +1 -1
- package/lib/core/zip-fs.js +5 -5
- package/lib/core/zip-reader.js +20 -17
- package/lib/core/zip-writer.js +50 -13
- package/lib/zip-core-writer.js +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=4294967295,e=65535,r=255,n=67324752,o=134695760,a=o,i=84233040,s=33639248,c=101010256,u=101075792,l=117853008,f=46,d=22,w=20,p=56,h=39169,m=21589,y=6534,b=30837,E=30805,S=2048,g=61440,A=16384,R=2048,x=1024,D="/",z=30,F=new Date(2107,11,31,23,59,58),O=new Date(1980,0,1),T=void 0,U=1/0,I="undefined",k="function",C="object",M="string",v=new Uint8Array,N="password",_="rawPassword",B="passThrough",P="signal",j="useWebWorkers",W="useCompressionStream",L="transferStreams",Z="preventClose",V="dataDescriptor",H="offset",G="usdz",K="maxAppendedDataSize",q="signCentralDirectory",Y="filename",X="comment",J="strict",Q="balanced",$="tolerant",tt="Invalid option (must be a function)",et="Invalid signal (must be an AbortSignal instance)",rt="Invalid password (password must be a string, rawPassword must be a Uint8Array)";function nt(t){if(t&&typeof t!=k)throw new Error(tt);return t}function ot(t){if(t&&(typeof t.addEventListener!=k||"boolean"!=typeof t.aborted))throw new Error(et);return t||T}function at(t,e){if(t&&typeof t!=M||e&&!(e instanceof Uint8Array))throw new Error(rt)}function it(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw new Error(r)}function st(t,e,r){t!==T&&it(t,e,r)}function ct(t){return typeof t==M&&t.trim()?Number(t):t}const ut="Invalid maxWorkers (must be an integer greater than 0)";let lt=2;try{typeof navigator!=I&&navigator.hardwareConcurrency&&(lt=navigator.hardwareConcurrency)}catch{}const ft={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:lt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=I&&CompressionStream,DecompressionStream:typeof DecompressionStream!=I&&DecompressionStream},dt="maxWorkers",wt=["chunkSize",dt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],pt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],ht=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...wt,...pt],mt={...ft};function yt(){return mt}function bt(t){return Et(t.chunkSize)}function Et(t){return t=ct(t),Number.isInteger(t)&&t>=1?Math.max(t,64):65536}function St(t){Object.assign(mt,gt(Rt(t)))}function gt(t){const e={};for(const r of ht){const n=t[r];n!==T&&(e[r]=At(r,n))}return e}function At(t,e){if(wt.includes(t)){if(e=ct(e),t==dt&&(!Number.isInteger(e)||e<1))throw new Error(ut)}else pt.includes(t)&&nt(e);return e}function Rt(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===T&&r===T)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===T&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===T&&(n.DecompressionStreamFallback=r),n}function xt(t){const e=gt(Rt(t));Object.assign(ft,e),Object.assign(mt,e)}function Dt(){for(const t of ht)delete mt[t];Object.assign(mt,ft)}function zt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function Ft(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function Ot(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Tt=[[],[],[],[],[],[],[],[]];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;Tt[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=Tt[e-1][t];Tt[e][t]=r>>>8^Tt[0][255&r]}const[Ut,It,kt,Ct,Mt,vt,Nt,_t]=Tt;class Bt{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const o=new DataView(t.buffer,t.byteOffset,r),a=r-8;for(;n<=a;n+=8){const t=e^o.getInt32(n,!0),r=o.getInt32(n+4,!0);e=_t[255&t]^Nt[t>>>8&255]^vt[t>>>16&255]^Mt[t>>>24&255]^Ct[255&r]^kt[r>>>8&255]^It[r>>>16&255]^Ut[r>>>24&255]}}for(;n<r;n++)e=e>>>8^Ut[255&(e^t[n])];this.o=e}get(){return~this.o}}class Pt extends TransformStream{constructor(){let t;const e=new Bt;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function jt(t){if(typeof TextEncoder==I){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}const Wt={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=Wt.l(r);return 32===n?t.concat(e):Wt.h(e,n,0|r,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+Wt.l(r)},m(t,e){if(32*t.length<e)return t;const r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=Wt.S(e,t[r-1]&2147483648>>e-1,1)),t},S:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,h(t,e,r,n){for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(let o=0;o<t.length;o++)n.push(r|t[o]>>>e),r=t[o]<<32-e;const o=t.length?t[t.length-1]:0,a=Wt.l(o);return n.push(Wt.S(e+a&31,e+a>32?r:n.pop(),1)),n}},Lt={bytes:{A(t){const e=Wt.bitLength(t)/8,r=new Uint8Array(e);let n;for(let o=0;o<e;o++)3&o||(n=t[o/4]),r[o]=n>>>24,n<<=8;return r},R(t){const e=[];let r,n=0;for(r=0;r<t.length;r++)n=n<<8|t[r],3&~r||(e.push(n),n=0);return 3&r&&e.push(Wt.S(8*(3&r),n)),e}}},Zt=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.F=[1518500249,1859775393,2400959708,3395469782],t?(e.O=t.O.slice(0),e.T=t.T.slice(0),e.U=t.U):e.reset()}reset(){const t=this;return t.O=t.D.slice(0),t.T=[],t.U=0,t}update(t){const e=this;"string"==typeof t&&(t=Lt.I.R(t));const r=e.T=Wt.concat(e.T,t),n=e.U,o=e.U=n+Wt.bitLength(t);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const a=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);t<=o;t+=e.blockSize)e.C(a.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}M(){const t=this;let e=t.T;const r=t.O;e=Wt.concat(e,[Wt.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.U/4294967296)),e.push(0|t.U);e.length;)t.C(e.splice(0,16));return t.reset(),r}v(t,e,r,n){return t<=19?e&r|~e&n:t<=39?e^r^n:t<=59?e&r|e&n|r&n:t<=79?e^r^n:void 0}N(t,e){return e<<t|e>>>32-t}C(t){const e=this,r=e.O,n=Array(80);for(let e=0;e<16;e++)n[e]=t[e];let o=r[0],a=r[1],i=r[2],s=r[3],c=r[4];for(let t=0;t<=79;t++){t>=16&&(n[t]=e.N(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.N(5,o)+e.v(t,a,i,s)+c+n[t]+e.F[Math.floor(t/20)]|0;c=s,s=i,i=e.N(30,a),a=o,o=r}r[0]=r[0]+o|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0}},Vt={importKey:t=>new Vt._(Lt.bytes.R(t)),B(t,e,r,n){if(r=r||1e4,n<0||r<0)throw new Error("invalid params to pbkdf2");const o=1+(n>>5)<<2;let a,i,s,c,u;const l=new ArrayBuffer(o),f=new DataView(l);let d=0;const w=Wt;for(e=Lt.bytes.R(e),u=1;d<(o||1);u++){for(a=i=t.encrypt(w.concat(e,[u])),s=1;s<r;s++)for(i=t.encrypt(i),c=0;c<i.length;c++)a[c]^=i[c];for(s=0;d<(o||1)&&s<a.length;s++)f.setInt32(d,a[s]),d+=4}return l.slice(0,n/8)},_:class{constructor(t){const e=this,r=e.P=Zt,n=[[],[]];e.j=[new r,new r];const o=e.j[0].blockSize/32;t.length>o&&(t=(new r).update(t).M());for(let e=0;e<o;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e.j[0].update(n[0]),e.j[1].update(n[1]),e.W=new r(e.j[0])}reset(){const t=this;t.W=new t.P(t.j[0]),t.L=!1}update(t){this.L=!0,this.W.update(t)}digest(){const t=this,e=t.W.M(),r=new t.P(t.j[1]).update(e).M();return t.reset(),r}encrypt(t){if(this.L)throw new Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Ht=typeof crypto!=I&&typeof crypto.getRandomValues==k,Gt="Invalid password",Kt="Invalid authentication code",qt="zipjs-abort-check-password",Yt="Crypto API not supported";function Xt(t){if(Ht)return crypto.getRandomValues(t);throw new Error(Yt)}const Jt=16,Qt={name:"PBKDF2"},$t=Object.assign({hash:{name:"HMAC"}},Qt),te=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Qt),ee=["deriveBits"],re=[8,12,16],ne=[16,24,32],oe=10,ae=[0,0,0,0],ie=typeof crypto!=I,se=ie&&crypto.subtle,ce=ie&&typeof se!=I,ue=Lt.bytes,le=class{constructor(t){const e=this;e.Z=[[[],[],[],[],[]],[[],[],[],[],[]]],e.Z[0][0][0]||e.V();const r=e.Z[0][4],n=e.Z[1],o=t.length;let a,i,s,c=1;if(4!==o&&6!==o&&8!==o)throw new Error("invalid aes key size");for(e.F=[i=t.slice(0),s=[]],a=o;a<4*o+28;a++){let t=i[a-1];(a%o===0||8===o&&a%o===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[255&t],a%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),i[a]=i[a-o]^t}for(let t=0;a;t++,a--){const e=i[3&t?a:a-4];s[t]=a<=4||t<4?e:n[0][r[e>>>24]]^n[1][r[e>>16&255]]^n[2][r[e>>8&255]]^n[3][r[255&e]]}}encrypt(t){return this.H(t,0)}decrypt(t){return this.H(t,1)}V(){const t=this.Z[0],e=this.Z[1],r=t[4],n=e[4],o=[],a=[];let i,s,c,u;for(let t=0;t<256;t++)a[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=i=0;!r[l];l^=s||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,r[l]=a,n[a]=l,u=o[c=o[s=o[l]]];let f=16843009*u^65537*c^257*s^16843008*l,d=257*o[a]^16843008*a;for(let r=0;r<4;r++)t[r][l]=d=d<<24^d>>>8,e[r][a]=f=f<<24^f>>>8}for(let r=0;r<5;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}H(t,e){if(4!==t.length)throw new Error("invalid aes block size");const r=this.F[e],n=r.length/4-2,o=[0,0,0,0],a=this.Z[e],i=a[0],s=a[1],c=a[2],u=a[3],l=a[4];let f,d,w,p=t[0]^r[0],h=t[e?3:1]^r[1],m=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;t<n;t++)f=i[p>>>24]^s[h>>16&255]^c[m>>8&255]^u[255&y]^r[b],d=i[h>>>24]^s[m>>16&255]^c[y>>8&255]^u[255&p]^r[b+1],w=i[m>>>24]^s[y>>16&255]^c[p>>8&255]^u[255&h]^r[b+2],y=i[y>>>24]^s[p>>16&255]^c[h>>8&255]^u[255&m]^r[b+3],b+=4,p=f,h=d,m=w;for(let t=0;t<4;t++)o[e?3&-t:t]=l[p>>>24]<<24^l[h>>16&255]<<16^l[m>>8&255]<<8^l[255&y]^r[b++],f=p,p=h,h=m,m=y,y=f;return o}},fe=class{constructor(t,e){this.G=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.G,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,r){let n;if(!(n=e.length))return[];const o=Wt.bitLength(e);for(let o=0;o<n;o+=4){this.$(r);const n=t.encrypt(r);e[o]^=n[0],e[o+1]^=n[1],e[o+2]^=n[2],e[o+3]^=n[3]}return Wt.m(e,o)}},de=Vt._;let we=ie&&ce&&typeof se.importKey==k,pe=ie&&ce&&typeof se.deriveBits==k;class he extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:o=!0}){super({start(){ye(this,t,e,r)},async transform(t,e){const r=this,{password:o,strength:a,et:i,ready:s}=r;o?(await async function(t,e,r,n){const o=await Ee(t,e,r,ge(n,0,re[e])),a=ge(n,re[e]);if(o[0]!=a[0]||o[1]!=a[1])throw new Error(Gt)}(r,a,o,ge(t,0,re[a]+2)),t=ge(t,re[a]+2),n?e.error(new Error(qt)):i()):await s;const c=new Uint8Array(t.length-oe-(t.length-oe)%Jt);e.enqueue(be(r,t,c,0,oe,!0))},async flush(t){const{nt:e,ot:r,it:n,ready:a}=this;if(r&&e){await a;const i=ge(n,0,n.length-oe),s=ge(n,n.length-oe);let c=v;if(i.length){const t=Re(ue,i);r.update(t);const n=e.update(t);c=Ae(ue,n)}const u=ge(Ae(ue,r.digest()),0,oe);let l=n.length<oe?1:0;for(let t=0;t<oe;t++)l|=u[t]^s[t];if(l&&o)throw new Error(Kt);t.enqueue(c)}}})}}class me extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){ye(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:o,et:a,ready:i}=r;let s=v;n?(s=await async function(t,e,r){const n=Xt(new Uint8Array(re[e]));return zt(n,await Ee(t,e,r,n))}(r,o,n),a()):await i;const c=new Uint8Array(s.length+t.length-t.length%Jt);c.set(s,0),e.enqueue(be(r,t,c,s.length,0))},async flush(t){const{nt:e,ot:r,it:n,ready:o}=this;if(r&&e){await o;let a=v;if(n.length){const t=e.update(Re(ue,n));r.update(t),a=Ae(ue,t)}const i=Ae(ue,r.digest()).slice(0,oe);t.enqueue(zt(a,i))}}})}}function ye(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:Se(e,r),strength:n-1,it:v})}function be(t,e,r,n,o,a){const{nt:i,ot:s,it:c}=t;c.length&&(e=zt(c,e));const u=e.length-o;let l;for(r=function(t,e){if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t}(r,n+(u-u%Jt)),l=0;l<=u-Jt;l+=Jt){const t=Re(ue,ge(e,l,l+Jt));a&&s.update(t);const o=i.update(t);a||s.update(o),r.set(Ae(ue,o),l+n)}return t.it=ge(e,l),r}async function Ee(t,e,r,n){t.password=null;const o=await async function(t,e,r,n,o){if(!we)return Vt.importKey(e);try{return await se.importKey("raw",e,r,!1,o)}catch{return we=!1,Vt.importKey(e)}}(0,r,$t,0,ee),a=await async function(t,e,r){if(!pe)return Vt.B(e,t.salt,te.iterations,r);try{return await se.deriveBits(t,e,r)}catch{return pe=!1,Vt.B(e,t.salt,te.iterations,r)}}(Object.assign({salt:n},te),o,8*(2*ne[e]+2)),i=new Uint8Array(a),s=Re(ue,ge(i,0,ne[e])),c=Re(ue,ge(i,ne[e],2*ne[e])),u=ge(i,2*ne[e]);return Object.assign(t,{keys:{key:s,st:c,passwordVerification:u},nt:new fe(new le(s),Array.from(ae)),ot:new de(c)}),u}function Se(t,e){return e===T?jt(t):e}function ge(t,e,r){return t.subarray(e,r)}function Ae(t,e){return t.A(e)}function Re(t,e){return t.R(e)}class xe extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){ze(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Fe(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw new Error(Gt);t=t.subarray(12)}n?e.error(new Error(qt)):e.enqueue(Fe(r,t))}})}}class De extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){ze(this,t,e,r)},transform(t,e){const r=this;let n,o;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=Xt(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Oe(r,e),0),o=12}else n=new Uint8Array(t.length),o=0;n.set(Oe(r,t),o),e.enqueue(n)}})}}function ze(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),function(t,e,r){const n=[305419896,591751049,878082192];if(Object.assign(t,{keys:n,ct:new Bt(n[0]),ut:new Bt(n[2])}),r)for(let e=0;e<r.length;e++)Te(t,r[e]);else for(let r=0;r<e.length;r++)Te(t,e.charCodeAt(r))}(t,e,r)}function Fe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ue(t)^e[n],Te(t,r[n]);return r}function Oe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ue(t)^e[n],Te(t,e[n]);return r}function Te(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=ke(Math.imul(ke(r+Ie(n)),134775813)+1),t.ut.append([r>>>24]);const o=~t.ut.get();t.keys=[n,r,o]}function Ue(t){const e=2|t.keys[2];return Ie(Math.imul(e,1^e)>>>8)}function Ie(t){return 255&t}function ke(t){return 4294967295&t}function Ce(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}function Me(t,e){t=Ce(t);const r=e?{type:e}:{};if(typeof Blob.prototype.stream!=k||new Blob([]).stream()instanceof ReadableStream)return new Response(t).blob().then(t=>e?new Blob([t],r):t);const n=[];return t.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,r))}function ve(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const Ne="Invalid codec definition",_e="Reserved compression method",Be="Invalid codec module",Pe="Compression method not supported",je=[0,8,9,99],We=new Map,Le=new Map;function Ze(t={}){const{compressionMethod:r,format:n,codecURI:o,CompressionStream:a,DecompressionStream:i,versionNeeded:s}=t;if(!Number.isInteger(r)||r<0||r>e||typeof n!=M||!n.length)throw new Error(Ne);if(je.includes(r))throw new Error(_e);const c=typeof a==k||typeof i==k;if(!(c||typeof o==M&&o.length))throw new Error(Ne);We.set(r,{compressionMethod:r,format:n,codecURI:o,versionNeeded:s}),c&&qe(n,{CompressionStream:a,DecompressionStream:i})}function Ve(t){const e=We.get(t);if(e){let r;We.delete(t),We.forEach(t=>r=r||t.format==e.format),r||Le.delete(e.format)}}function He(t){return We.get(t)}function Ge(){return Array.from(We.values(),t=>Object.assign({},t,Le.get(t.format)))}function Ke(t){return Le.get(t)}function qe(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=k&&typeof n!=k)throw new Error(Be);Le.set(t,{CompressionStream:r,DecompressionStream:n})}const Ye="Invalid uncompressed size",Xe="Invalid compressed data",Je="Invalid CRC32",Qe="deflate-raw",$e="deflate64-raw",tr="gzip",er=[31,139,8];class rr extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:o,encrypted:a,useCompressionStream:i,zipCrypto:s,computeCrc32:c,level:u,deflate64:l,format:f,compressionMethod:d,inputSize:w}=t,p=this;let h,m,y,b=super.readable;const E=f&&Ke(f),S=c&&o&&!l&&!E&&(!a||s)&&Boolean(i&&n);if(a&&!s||!c||S||(h=new Pt,b=fr(b,h)),o)if(E)b=dr(b,ur(E.CompressionStream,f,{level:u,chunkSize:e,compressionMethod:d,uncompressedSize:w}));else if(S)y=new nr,b=dr(b,new n(tr)),b=fr(b,y);else try{b=lr(b,i,{level:u,chunkSize:e},n,r)}catch(t){let e;try{e=new n(tr)}catch{throw t}b=dr(b,e),b=fr(b,new nr)}a&&(s?b=fr(b,new De(t)):(m=new me(t),b=fr(b,m))),cr(p,b,()=>{a&&!s||!c||(p.crc32=S?y.crc32:new DataView(h.value.buffer).getUint32(0))})}}class nr extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const o=r.length+t.length;if(o<=8)return void(r=zt(r,t));const a=o-8,i=Math.min(a,r.length);n.enqueue(zt(r.subarray(0,i),t.subarray(0,a-i))),r=zt(r.subarray(i),t.subarray(a-i))},flush(){const e=Ot(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class or extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:o,encrypted:a,checkCrc32:i,crc32:s,compressed:c,useCompressionStream:u,deflate64:l,format:f,compressionMethod:d,rawBitFlag:w,outputSize:p}=t;let h,m,y=super.readable;if(a&&(o?y=fr(y,new xe(t)):(m=new he(t),y=fr(y,m))),c){const t=f&&Ke(f);if(t)y=dr(y,ur(t.DecompressionStream,f,{chunkSize:e,compressionMethod:d,rawBitFlag:w,uncompressedSize:p}));else try{y=lr(y,u,{chunkSize:e,deflate64:l},n,r)}catch(t){if(l||p===T)throw t;let e;try{e=new n(tr)}catch{throw t}y=function(t,e,r){const n=new Bt;let o,a,i,s=0,c=!1;const u=new Promise((t,e)=>{a=t,i=e});u.catch(()=>{}),r||a();const l=new TransformStream({start(t){const e=new Uint8Array(10);e.set(er),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,d();try{await u}finally{w()}const e=new Uint8Array(8),o=Ot(e);o.setUint32(0,n.get(),!0),o.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),f=new TransformStream({transform(t,e){n.append(t),s+=t.length,s>=r?a():c&&d(),e.enqueue(t)},cancel(t){i(t)}});return t=fr(t,l),fr(t=dr(t,e),f);function d(){w(),o=setTimeout(()=>i(new Error(Ye)),5e3)}function w(){clearTimeout(o)}}(y,e,p)}y=function(t){const e=t.getReader();return new ReadableStream({async pull(t){let r;try{r=await e.read()}catch(t){if(t&&t.message)throw t;const e=new Error(Xe);throw e.cause=t,e}const{value:n,done:o}=r;o?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}(y)}i&&(h=new Pt,y=fr(y,h)),cr(this,y,()=>{if(i){const t=new DataView(h.value.buffer);if(s!=t.getUint32(0,!1))throw new Error(Je)}})}}const ar=new Map;function ir(t,e){if(!t)return!1;let r=ar.get(t);r||(r=new Map,ar.set(t,r));let n=r.get(e);if(n===T){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function sr(t){return ir(t,Qe)}function cr(t,e,r){e=fr(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function ur(t,e,r){if(!t)throw new Error(Pe);return new t(e,r)}function lr(t,e,r,n,o){const a=e&&n?n:o||n,i=r.deflate64?$e:Qe;let s;try{s=new a(i,r)}catch(t){if(!e||!o||a==o)throw t;s=new o(i,r)}return dr(t,s)}function fr(t,e){return Ce(t).pipeThrough(e)}function dr(t,e){const r=e.writable.getWriter(),n=t.getReader();return async function(){try{for(;;){await r.ready;const t=await n.read();if(t.done){await r.close();break}await r.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(r,t),await async function(t,e){try{await t.cancel(e)}catch{}}(n,t)}}(),e.readable}const wr="data",pr="deflate",hr="inflate";class mr extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let o;n.startsWith(pr)?o=rr:n.startsWith(hr)&&(o=or),r.outputSize=0;let a=0;const i=new o(t,e),s=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:a})}}),u=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==T&&r.outputSize>t.outputSize))throw new Error(Ye)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:a})}});Object.defineProperty(r,"readable",{get:()=>s.pipeThrough(c).pipeThrough(i).pipeThrough(u)})}}class yr extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let o=0;for(;o<t;){const r=e[0],a=t-o;r.length<=a?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,a),o),e[0]=r.subarray(a),o+=a)}return r-=t,n}(!Number.isFinite(t)||t<1)&&(t=65536),super({transform(o,a){for(e.push(o),r+=o.length;r>t;)a.enqueue(n())},flush(t){r&&t.enqueue(function(t,e){const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r}(e,r))}})}}const br="Worker startup timeout";let Er,Sr,gr,Ar=()=>{};async function Rr(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.lt)return!0;if(sr(e)||ir(e,tr))return!0;if(r)try{return await Ar(t),!0}catch{return!1}return!1}function xr(t){t.createWorker?Sr=!0:Er=!1}class Dr{constructor(t,{readable:e,writable:r},{options:n,config:o,ft:a,useWebWorkers:i,transferStreams:s,workerURI:c,createWorker:u},l){const{signal:f}=a;return Sr&&(u=T),Object.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new yr(bt(o))).pipeThrough(new zr(a),{signal:f}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:u,transferStreams:s,terminate:()=>new Promise(e=>{const{yt:r,wt:n}=t;r?(n?t.bt=e:(r.terminate(),e()),t.Et=null):e()}),St(){if(t.wt){const{bt:e}=t;e&&(t.bt=null,t.gt=!0,t.yt.terminate(),e()),t.wt=!1,l(t)}}}),Er===T&&(Er=typeof Worker!=I),(i&&gr&&(Er&&c||u)?gr:Or)(t,o)}}class zr extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let o=0;super({async start(){t&&await Fr(t,r)},async transform(t,n){o+=t.length,e&&await Fr(e,o,r),n.enqueue(t)},async flush(){n&&await Fr(n,o)}})}}async function Fr(t,...e){try{await t(...e)}catch{}}function Or(t,e){return{run:()=>Tr(t,e)}}async function Tr({options:t,readable:e,writable:r,St:n},o){let a;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(pr),r=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,n=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(r&&r.lt&&!sr(n))try{await Ar(o)}catch{}}else try{await Ar(o)}catch{r&&!r.lt||(t.useCompressionStream=!0)}}a=new mr(t,o),await e.pipeThrough(a).pipeThrough(new yr(bt(o))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:s}=a;return{crc32:n,inputSize:i,outputSize:s}}catch(t){throw a&&(t.outputSize=a.outputSize),t}finally{n()}}const Ur={type:"module"},Ir="error";let kr,Cr,Mr,vr=!0;try{vr=typeof structuredClone==k&&structuredClone(new DOMException("","AbortError")).code!==T}catch{}var Nr;function _r(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Br(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.Et=null}function Pr(t,e,r,n,o=!0){const{createWorker:a}=r;let i,s,c;if(a)i=a();else if(Cr===T||kr!==t){const a=typeof t==k;s=a?t(o):t;const u=s.startsWith("data:"),l=s.startsWith("blob:");if(u||l){n===T&&(n=!1),n&&(c=Ur);try{i=new Worker(s,c)}catch(o){if(l)try{URL.revokeObjectURL(s)}catch{}if(a&&l)return Pr(t,e,r,n,!1);if(n)throw o;return Pr(t,e,r,!0,!1)}}else{n===T&&(n=!0),n&&(c=Ur);try{s=new URL(s,e)}catch{}try{i=new Worker(s,c)}catch(a){if(n)return Pr(t,e,r,!1,o);throw a}}kr=t,Cr=s,Mr=c}else i=new Worker(Cr,Mr);return i.addEventListener("message",t=>{r.At=!0,jr(r),async function({data:t},e){const{type:r,value:n,messageId:o,result:a,error:i}=t,{reader:s,writer:c,Rt:u,xt:l,St:f,ht:d}=e,w=()=>e.ht!=d;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:o,cause:a,codecImportFailed:s}=i,c=new Error(t);Object.assign(c,{stack:e,code:r,name:n,outputSize:o}),a&&(c.cause=Object.assign(new Error(a.message),{name:a.name})),s&&(c.codecImportFailed=!0),p(c)}else{if("pull"==r){const{value:t,done:r}=await s.read();w()||Lr({type:wr,value:t,done:r,messageId:o},e)}r==wr&&(await c.ready,await c.write(new Uint8Array(n)),w()||Lr({type:"ack",messageId:o},e)),"close"==r&&p(null,a)}}catch(i){w()||(Br(e),p(i))}function p(t,e){w()||(t?l(t):u(e),c&&c.releaseLock(),t&&t.codecImportFailed||f())}}(t,r)}),i.addEventListener(Ir,t=>Wr(t,r)),i.addEventListener("messageerror",t=>Wr(t,r)),i}function jr(t){const{Dt:e}=t;e&&(clearTimeout(e),t.Dt=null)}function Wr(t,e){t.preventDefault&&t.preventDefault(),jr(e);const{At:r,xt:n,writer:o,St:a}=e;Br(e),r||(e.yt=null);let i=t.error||new Error(t.message||Ir);r||(i=Object.assign(new Error(i.message||Ir),{zt:!0}),e.Ft=i),n&&(n(i),o&&o.releaseLock(),r&&a())}function Lr(t,{yt:e,writer:r,transferStreams:n,At:o}){try{const{value:r,readable:a,writable:i}=t,s=[];if(r&&(t.value=Ft(r),s.push(t.value.buffer)),n&&vr&&o?(a&&s.push(a),i&&s.push(i)):t.readable=t.writable=null,s.length)try{return e.postMessage(t,s),!0}catch{vr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}Nr=function(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:o}=e;let{wasmURI:a}=e;if(!t.Et){let i;typeof a==k&&(a=a());try{i=Pr(t.workerURI,r,t)}catch{return xr(t),Or(t,e)}Object.assign(t,{yt:i,At:!1,gt:!1,Ft:null,Et:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{Ft:e}=t;t.Ft=null;const r=e||new Error(br);throw r.zt=!0,r}let r,n;const o=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,Rt:r,xt:n,result:o});const{readable:a,options:i}=t,{writable:s,closed:c,Ot:u}=function(t){const e=new AbortController,{writable:r,readable:n}=new TransformStream,o=n.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:r,closed:o,Ot:()=>e.abort()}}(t.writable);let l;try{l=Lr({type:"start",options:i,config:e,readable:a,writable:s},t)}catch(e){u();try{await c}catch{}throw t.St(),e}l||Object.assign(t,{reader:a.getReader(),writer:s.getWriter()});const{workerStartupTimeout:f}=e;!t.At&&Number.isFinite(f)&&f>=0&&(t.Dt=setTimeout(()=>function(t){if(t.Dt=null,t.At)return;const{xt:e,writer:r}=t;if(Br(t),t.yt=null,e){const t=new Error(br);t.zt=!0,e(t),r&&r.releaseLock()}}(t),f));try{const t=await o;return await d(),await c,t}catch(t){await d(),u();try{await c}catch{}throw t}async function d(){if(!l&&!s.locked)try{await s.getWriter().close()}catch{}}}(t,{chunkSize:n,wasmURI:a,baseURI:r,workerStartupTimeout:o})}catch(r){if(r&&r.zt)return xr(t),_r(t),Tr(t,e);if(r&&r.codecImportFailed){if(t.reader)return _r(t),Tr(t,e);t.St()}throw r}}}})}return t.Et},gr=Nr;let Zr=[];const Vr=[];let Hr,Gr,Kr=0;async function qr(t,e){const{options:r,config:n}=e,{transferStreams:o,useWebWorkers:a,useCompressionStream:i,compressed:s,checkCrc32:c,computeCrc32:u,encrypted:l,format:f,codecURI:d}=r,{workerURI:w,createWorker:p,maxWorkers:h}=n;f&&(d&&(r.codecURI=function(t,e){try{return new URL(t,e).toString()}catch{return t}}(d,n.baseURI)),await async function(t,e){!Le.has(t)&&e&&qe(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(f,r.codecURI)),e.transferStreams=!f&&(o||o===T&&n.transferStreams);const m=!(s||c||u||l),y=f===T||Boolean(r.codecURI);return e.useWebWorkers=!m&&y&&(a||a===T&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:T,e.createWorker=e.useWebWorkers&&p?p:T,r.useCompressionStream=i||i===T&&n.useCompressionStream,(await async function(){const r=Zr.find(t=>!t.wt);if(r)return $r(r),new Dr(r,t,e,b);if(Zr.length<h){const r={Tt:Kr};return Kr++,Zr.push(r),new Dr(r,t,e,b)}return new Promise(r=>{Vr.push({resolve:r,stream:t,Ut:e}),Gr=n.workerStarvationTimeout,Yr()})}()).run();function b(t){if(Xr(),Vr.length){const[{resolve:e,stream:r,Ut:n}]=Vr.splice(0,1);e(new Dr(t,r,n,b)),Yr()}else t.yt?($r(t),function(t,e){const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.gt?t.gt=!1:t.It=setTimeout(async()=>{Zr=Zr.filter(e=>e!=t);try{await t.terminate()}catch{}},n))}(t,e)):Zr=Zr.filter(e=>e!=t)}}function Yr(){!Hr&&Vr.length&&Number.isFinite(Gr)&&Gr>=0&&(Hr=setTimeout(Jr,Gr))}function Xr(){Hr&&(clearTimeout(Hr),Hr=null)}function Jr(){if(Hr=null,Vr.length){const[{resolve:t,stream:e,Ut:r}]=Vr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:T,createWorker:T});t(new Dr({},e,n,Qr)),Yr()}}function Qr(){Xr(),Yr()}function $r(t){const{It:e}=t;e&&(clearTimeout(e),t.It=null)}const tn="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split("");function en(t,e){return rn(t,e,!0)}function rn(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let r=0;r<t.length;r++)e+=tn[t[r]];return e}(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const nn="HTTP error ",on="HTTP Range not supported",an="HTTP resource changed",sn="Writer iterator completed too soon",cn="Writer not initialized",un="Content-Range",ln="Range",fn="GET",dn="bytes",wn=16777216,pn="writable",hn=Symbol();class mn{constructor(){this.size=0}init(){this.initialized=!0}}class yn extends mn{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=bt(yt())}={}){const n=this;let o=0;return r=Et(r),new ReadableStream({async pull(a){const i=e===T?r:Math.min(r,e-o),s=await ro(n,t+o,i);s.length&&(a.enqueue(s),o+=s.length),(e!==T&&o>=e||!s.length&&i)&&a.close()}})}}class bn extends mn{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw new Error(cn);return t.writeUint8Array(Ft(e))}});Object.defineProperty(t,pn,{get:()=>e})}writeUint8Array(){}}class En extends yn{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{kt:t,Ct:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{Ct:r,kt:n}=this,o=new Uint8Array(e),a=4*Math.floor(t/3),i=atob(n.substring(a+r,4*Math.ceil((t+e)/3)+r)),s=t-3*Math.floor(a/4);let c=0;for(let t=s;t<s+e&&t<i.length;t++)o[t-s]=i.charCodeAt(t),c++;return c<o.length?o.subarray(0,c):o}}class Sn extends bn{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Mt:""})}writeUint8Array(t){const e=this;let r,n=e.Mt;const o=e.Mt.length;for(e.Mt="",r=0;r<3*Math.floor((o+t.length)/3)-o;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.Mt+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.Mt=n+e.Mt}getData(){return this.data+btoa(this.Mt)}}let gn,An;class Rn extends yn{constructor(t){super(),Object.assign(this,{vt:t,size:t.size}),An||(An=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();gn=1==e}catch{gn=!1}})())}createReadable(t){const{vt:e,size:r}=this,{offset:n=0,size:o=r-n}=t||{};return!n&&o>=r?Ce(e.stream()):gn?Ce(e.slice(n,n+o).stream()):super.createReadable(t)}async readUint8Array(t,e){const r=this,n=t+e,o=!t&&n>=r.size?r.vt:r.vt.slice(t,n);let a=await o.arrayBuffer();return a.byteLength>e&&(a=a.slice(t,n)),new Uint8Array(a)}}class xn extends mn{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,pn,{get:()=>r.writable}),e.contentType=t,e.Nt=Me(r.readable,t),e.Nt.catch(()=>{})}getData(){return this.Nt}}class Dn extends Rn{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function zn(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<55296||n>=57344?e+=3:n<56320&&56320==(64512&t.charCodeAt(r+1))?(e+=4,r++):e+=3}return e}class Fn extends xn{constructor(t){super(),Object.assign(this,{encoding:t,_t:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,_t:e}=this,r=await super.getData();return r.text&&e?r.text():function(t,e){return rn(t,e,!1)}(new Uint8Array(await r.arrayBuffer()),t)}}class On extends yn{constructor(t,e){super(),Un(this,t,e)}async init(){await In(this,Zn,Pn),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:o}=e;if((r||n)&&o!==T){const{offset:r=0,size:n=o-r}=t||{};if(n>0&&r<o)return function(t,e,r){let n,o=e,a=0,i=r;return new ReadableStream({start:()=>s(),async pull(t){n||await s();const{value:e,done:r}=await n.read();if(r)throw new Error(on);const o=e.length>a?e.subarray(0,a):e;a-=o.length,i-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=n;n=T,await t.cancel()}(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function s(){const e=Math.min(t.maximumRangeSize,i),r=await Zn(fn,t,_n(t,o,e));if(206!=r.status)throw new Error(on);const s=r.headers.get(un);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=o)throw new Error(on)}Nn(t,r),vn(t,r),o+=e,a=e,n=r.body.getReader()}}(e,r,Math.min(n,o-r))}return super.createReadable(t)}readUint8Array(t,e){return kn(this,t,e,Zn,Pn)}}class Tn extends yn{constructor(t,e){super(),Un(this,t,e)}async init(){await In(this,Vn,jn),super.init()}readUint8Array(t,e){return kn(this,t,e,Vn,jn)}}function Un(t,e,r){const{preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s=!0,maximumRangeSize:c=wn,fetch:u}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s,maximumRangeSize:c,fetch:u})}async function In(t,e,r){const{url:n,preventHeadRequest:o,useRangeHeader:a,forceRangeRequests:i,combineSizeEocd:s}=t;if(function(t){const{baseURI:e}=yt(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r}(n)&&(a||i)&&(typeof o==I||o)){const n=await e(fn,t,_n(t,s?-22:void 0)),o=n.headers.get("Accept-Ranges");if(!(i||o&&o.toLowerCase()==dn))throw new Error(on);{if(s){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Bt=e)}vn(t,n);const o=Cn(n);o===T?await Ln(t,e,r):t.size=o}}else await Ln(t,e,r)}async function kn(t,e,r,n,o){const{useRangeHeader:a,forceRangeRequests:i,Bt:s,size:c,options:u}=t;if(a||i){if(s&&e==c-d&&r==d)return s;if(e>=c||0===r)return v;{e+r>c&&(r=c-e);const o=await n(fn,t,_n(t,e,r));if(206!=o.status)throw new Error(on);const a=o.headers.get(un);if(a){const t=Number(a.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw new Error(on)}Nn(t,o),vn(t,o);const i=new Uint8Array(await o.arrayBuffer());if(i.length!=r)throw new Error(on);return i}}{const{data:n}=t;return n||await o(t,u),t.data.subarray(e,e+r)}}function Cn(t){const e=t.headers.get(un);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Mn({headers:t}){return{Pt:t.get("Etag")||T,lastModified:t.get("Last-Modified")||T}}function vn(t,e){const{checkResourceChanges:r,jt:n}=t;r&&!n&&206==e.status&&(t.jt=Mn(e))}function Nn(t,e){const{checkResourceChanges:r,jt:n,size:o}=t;if(r){const t=Cn(e);if(t!==T&&o!==T&&t!=o)throw new Error(an);if(n){const t=Mn(e);if(Object.entries(n).some(([e,r])=>r!==T&&t[e]!==T&&r!=t[e]))throw new Error(an)}}}function _n(t,e=0,r=1){return Object.assign({},Bn(t),{[ln]:dn+"="+(e<0?e:e+"-"+(e+r-1))})}function Bn({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Pn(t){await Wn(t,Zn)}async function jn(t){await Wn(t,Vn)}async function Wn(t,e){const r=await e(fn,t,Bn(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Ln(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Bn(t)),o=n.headers.get("Content-Length");o&&!n.headers.get("Content-Encoding")?t.size=Number(o):await r(t,t.options)}}async function Zn(t,{fetch:e=fetch,options:r,url:n},o){const a=await e(n,Object.assign({},r,{method:t,headers:o}));if(a.status<400)return a;throw 416==a.status?new Error(on):new Error(nn+(a.statusText||a.status))}function Vn(t,{url:e},r){return new Promise((n,o)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status<400){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:a.status,arrayBuffer:()=>a.response,headers:new Map(t)})}else o(416==a.status?new Error(on):new Error(nn+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>o(t.detail?t.detail.error:new Error("Network error")),!1),a.open(t,e),r)for(const t of Object.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class Hn extends yn{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Tn(t,e):new On(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 Gn extends Hn{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Kn extends yn{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{Wt:t,size:t.length})}readUint8Array(t,e){return this.Wt.slice(t,t+e)}}class qn extends bn{constructor(t){super(),this.Lt=t||262144}init(t=0){Object.assign(this,{offset:0,Wt:new Uint8Array(t>0?t:this.Lt)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.Wt.length){let t=e.Wt.length?2*e.Wt.length:e.Lt;for(;t<r;)t*=2;const n=e.Wt;e.Wt=new Uint8Array(t),e.Wt.set(n)}e.Wt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Wt.length?this.Wt:this.Wt.slice(0,this.offset)}}class Yn extends yn{constructor(t){super(),this.Zt=t}async init(){const t=this;t.Vt=0;const e=t.Zt=await Promise.all(t.Zt.map(eo));t.Ht=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Gt(t){const{Ht:e,size:r}=this,n=e[t];return n===T?r:n}async readUint8Array(t,e){const r=this,{Zt:n}=this;let o,a=0,i=t;for(;n[a]&&i>=n[a].size;)i-=n[a].size,a++;const s=n[a];if(s){const n=s.size;if(i+e<=n)o=await ro(s,i,e);else{const a=n-i;o=zt(await ro(s,i,a),await r.readUint8Array(t+a,e-a))}}else o=v;return r.Vt=Math.max(a,r.Vt),o}}class Xn extends mn{constructor(t,e=4294967295){super();const r=this;let n,o,a;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===hn)return void(a&&await c());const{availableSize:i}=r;if(a)e.length>=i?(await s(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i))):await s(e);else{const{value:i,done:s}=await t.next();if(s&&!i)throw new Error(sn);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await to(n),o=i.writable,a=o.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function s(t){const e=t.length;e&&(await a.ready,await a.write(t),n.size+=e,r.availableSize-=e)}async function c(){await u(),r.diskOffset+=n.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}Object.defineProperty(r,pn,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(hn)}finally{t.releaseLock()}}}class Jn{constructor(t){return Array.isArray(t)&&(t=new Yn(t)),(t instanceof ReadableStream||typeof t.getReader==k)&&(t={readable:Ce(t)}),t}}class Qn{constructor(t){return t.writable===T&&typeof t.next==k&&(t=new Xn(t)),(t instanceof WritableStream||typeof t.getWriter==k)&&(t={writable:ve(t)}),t.size===T&&(t.size=0),t}}function $n(t){return Boolean(t&&t.getData)}async function to(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function eo(t){return t=new Jn(t),await to(t),t.size!==T&&t.readUint8Array||(t=new Rn(await Me(t.readable)),await to(t)),t}function ro(t,e,r){return t.readUint8Array(e,r)}function no(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?yn.prototype.createReadable.call(t,e):t.readable}const oo="filename",ao="rawFilename",io="comment",so="rawComment",co="uncompressedSize",uo="compressedSize",lo="offset",fo="diskNumberStart",wo="lastModDate",po="rawLastModDate",ho="lastAccessDate",mo="rawLastAccessDate",yo="creationDate",bo="rawCreationDate",Eo="internalFileAttributes",So="externalFileAttributes",go="msdosAttributesRaw",Ao="msdosAttributes",Ro="msDosCompatible",xo="zip64",Do="encrypted",zo="version",Fo="versionMadeBy",Oo="zipCrypto",To="directory",Uo="executable",Io="compressionMethod",ko="signature",Co="extraField",Mo="unixMode",vo="setuid",No="setgid",_o="sticky",Bo=[oo,ao,co,uo,wo,po,io,so,ho,mo,yo,bo,lo,fo,Eo,So,go,Ao,Ro,xo,Do,zo,Fo,Oo,To,Uo,"symlink",Io,ko,"crc32",Co,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Mo,"unixExternalUpper",vo,No,_o,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Po{constructor(t){Bo.forEach(e=>this[e]=t[e])}}const jo="File format is not recognized",Wo="End of central directory not found",Lo="End of Zip64 central directory locator not found",Zo="Central directory header not found",Vo="Local file header not found",Ho="Zip64 extra field not found",Go="File contains encrypted entry",Ko="Encryption method not supported",qo="Split zip file",Yo="Overlapping entry found",Xo="Entry data out of bounds",Jo="Ambiguous archive",Qo="Encrypted central directory is not supported",$o="Unsafe filename",ta="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",ea="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",ra="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",na="64-bit value exceeds Number.MAX_SAFE_INTEGER",oa="unsorted central directory",aa="unknown version needed to extract",ia="compressed patched data",sa="malformed extra field",ca="unknown zip64 extensible data",ua="wrapped entries count",la="appended data",fa="prepended data",da="prepended central directory",wa="trailing central directory data",pa="duplicate filename",ha="mismatched zip64 end of central directory record",ma="mismatched local file header (general purpose bit flag)",ya="mismatched local file header (compression method)",ba="mismatched local file header (crc32 or sizes)",Ea=/^[a-zA-Z]:/,Sa="utf-8",ga="cp437",Aa=[[co,t],[uo,t],[lo,t],[fo,e]],Ra={[e]:{Kt:ii,bytes:4},[t]:{Kt:si,bytes:8}},xa=BigInt(Number.MAX_SAFE_INTEGER);class Da{constructor(t,e={}){Object.assign(this,{reader:new Jn(t),options:e,qt:new Map})}async*getEntriesGenerator(n={}){const a=this;let{reader:i}=a;if(await to(i),i.size!==T&&i.readUint8Array||(i=new Rn(await Me(i.readable)),await to(i)),i.size<d)throw new Error(jo);const c=a.warnings=[],h=La(n,a.options),m=h==J,y=h!=$,b=Ha(ti(a,n,K),h),E=function(t,e){if(t===T)return e;if(!Wa(t))throw new Error(ea);return t}(ti(a,n,"filenameValidation"),h),S=ti(a,n,"normalizeFilename"),{Yt:z,Xt:F}=await Ga(i,y,b);if(!z)throw await async function(t){return await ja(t)==o}(i)?new Error(qo):new Error(Wo);y&&F>1&&$a("multiple end of central directory records");const O=Ot(z);let U=ii(O,12),I=ii(O,16);const k=z.offset,C=ai(O,20),M=k+d+C,N=i.size-M;N>b&&$a(la),N>0&&Qa(c,la);let _=ai(O,4);const B=i.Vt||0;let P,j,W,L,Z,V=ai(O,6),H=ai(O,10),G=0,q=p;const Q=I==t||U==t||H==e||V==e;if(I!=t&&V!=e&&(I+=Pa(i,V)),Q){const r=z.offset>=w?await ro(i,z.offset-w,w):v,n=Ot(r);if(r.length==w&&ii(n,0)==l){I=Pa(i,ii(n,4))+si(n,8);let r=await ro(i,I,p),o=Ot(r);const a=z.offset-w-p;if((r.length<p||ii(o,0)!=u)&&I!=a&&a>=0){const t=I;I=a,I>t&&(G=I-t),r=await ro(i,I,p),o=Ot(r)}if(r.length<p||ii(o,0)!=u)throw new Error(Lo);if(W=!0,L=si(o,4)>44,L){const t=Math.min(si(o,4)-44,i.size-I-p);t>0&&(q+=t,Z=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Ot(t),n=ai(r,26);Object.assign(e,{compressionMethod:ai(r,0),compressedSize:si(r,2),uncompressedSize:si(r,10),encryptionAlgorithm:ai(r,18),bitLength:ai(r,20),flags:ai(r,22),hashAlgorithm:ai(r,24),hashData:t.subarray(28,28+n)})}return e}(await ro(i,I+p,t)))}_==e?_=ii(o,16):_!=ii(o,16)&&Ja(m,c,ha),V==e?V=ii(o,20):V!=ii(o,20)&&Ja(m,c,ha),H==e?H=si(o,32):H!=si(o,32)&&Ja(m,c,ha),U==t?U=si(o,40):U!=si(o,40)&&Ja(m,c,ha),I=Pa(i,V)+si(o,48)+G}}let tt=U;const et=z.offset-(W?q+w:0);if(I>=i.size&&(G=i.size-I-U-d,I=i.size-U-d),B!=_)throw new Error(qo);if(I<0)throw new Error(jo);let rt=0,nt=await ro(i,I,U),ot=Ot(nt);if(U){if(nt.length<4)throw new Error(jo);const t=et-U;if(I!=t&&V==_){const e=ii(ot,rt)==s||Boolean(Z&&Z.compressedSize)||Ta(ot);let r=!e;if(!r&&t>=0&&t+4<=i.size&&(r=ii(Ot(await ro(i,t,4)),0)==s),r){const r=I;I=t,I>r&&(G+=I-r,P=e),nt=await ro(i,I,U),ot=Ot(nt)}}}const at=et-I;if(U!=at&&at>=0&&V==_&&(U=at,nt=await ro(i,I,U),ot=Ot(nt)),I<0||I>=i.size)throw new Error(jo);a.directoryOffset=I,a.directoryLength=tt;const it=ei(a,n,"decryptCentralDirectory");let st,ct;if(it&&H&&nt.length>=4&&ii(ot,0)!=s&&(L||Ta(ot))){const t=function(t,e,r){const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r}(Z,tt,nt.length);ct=nt.subarray(t),nt=await it(nt.subarray(0,t),Z),ot=Ot(nt),tt=nt.length,st=!0}Z&&!st&&(nt.length<4||ii(ot,0)==s)&&Qa(c,ca),j=I;const ut=ti(a,n,"filenameEncoding"),lt=ti(a,n,"commentEncoding"),ft=new Set;let dt,wt=-1;const pt=!m&&!W;!H&&pt&&(H=Ua(ot,nt,rt),H&&Qa(c,ua));for(let t=0;t<H;t++){const o=new Oa(i,a.options);if(rt+f>nt.length||ii(ot,rt)!=s){if(0==t&&!st&&(L||Ta(ot)))throw new Error(Qo);throw new Error(Zo)}ka(o,ot,rt+6);const u=Boolean(o.bitFlag.languageEncodingFlag),l=rt+f,d=l+o.filenameLength,w=d+o.extraFieldLength,p=ai(ot,rt+4),h=!(p>>8),m=p>>8==3,y=nt.subarray(l,d),b=ai(ot,rt+32),z=w+b,F=nt.subarray(w,z),O=u,U=u,I=ii(ot,rt+38),k=I&r,C={readOnly:Boolean(1&k),hidden:Boolean(2&k),system:Boolean(4&k),directory:Boolean(16&k),archive:Boolean(32&k)},M=ii(ot,rt+42),v=ei(a,n,"decodeText")||en,N=O?Sa:ut||ga,_=U?Sa:lt||ga;let B=v(y,N,Y);if(B===T&&(B=en(y,N)),S){const t=S(B);t!==T&&(B=t)}if(Va(B,E)){const t=new Error($o);throw t.filename=B,t}let P=v(F,_,X);P===T&&(P=en(F,_)),Object.assign(o,{index:t,Jt:st,versionMadeBy:p,msDosCompatible:h,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:b,offset:M,diskNumberStart:ai(ot,rt+34),internalFileAttributes:ai(ot,rt+36),externalFileAttributes:I,msdosAttributesRaw:k,msdosAttributes:C,rawFilename:y,filenameUTF8:O,commentUTF8:U,rawExtraField:nt.subarray(d,w),rawComment:F,filename:B,comment:P}),Ca(o,o,ot,rt+6)&&Qa(c,sa,B),o.offset+=G;const W=Pa(i,o.diskNumberStart)+o.offset;j=Math.min(W,j),W<wt&&Qa(c,oa,B),wt=W,(o.version&r)>63&&Qa(c,aa,B),32&~o.rawBitFlag||Qa(c,ia,B),ft.has(o.filename)&&(dt=!0),ft.add(o.filename);const Z=o.externalFileAttributes>>16&e;o.unixMode===T&&16877&Z&&(o.unixMode=Z);const V=Boolean(o.unixMode&R),K=Boolean(o.unixMode&x),q=Boolean(512&o.unixMode),J=40960==((o.unixMode===T?Z:o.unixMode)&g),Q=!J&&(o.unixMode!==T?!!(73&o.unixMode):m&&!!(73&Z)),$=o.unixMode!==T&&(o.unixMode&g)==A,tt=(Z&g)==A;Object.assign(o,{setuid:V,setgid:K,sticky:q,symlink:J,unixExternalUpper:Z,executable:Q,directory:$||tt||h&&C.directory||o.filename.endsWith(D),zipCrypto:o.encrypted&&!o.extraFieldAES});const et=new Po(o);if(et.getData=(t,e)=>o.getData(t,et,a.qt,e),et.arrayBuffer=async t=>{const e=new TransformStream,r=Me(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await o.getData(e,et,a.qt,t),r},rt=z,t==H-1&&pt){const t=Ua(ot,nt,rt);t&&(H+=t,Qa(c,ua))}const{onprogress:at}=n;if(at)try{await at(t+1,H,new Po(o))}catch{}yield et}let ht=rt,mt=Ia(nt.subarray(rt))||(st?Ia(ct):T);if(!mt&&!st){const t=I+rt,e=Math.min(et-t,65541);e>=6&&(mt=Ia(await ro(i,t,e)))}mt&&(a.digitalSignature=mt,ht=rt+6+mt.length),(rt!=tt&&ht!=tt||!st&&rt!=U&&ht!=U)&&Ja(m,c,wa),dt&&Ja(m,c,pa);const yt=ti(a,n,"extractPrependedData"),bt=ti(a,n,"extractAppendedData"),Et=(m||yt)&&H&&4==j&&await async function(t){const e=await ja(t);return e==o||808471376==e}(i)?4:0;return m&&(G||H&&j>Et)&&$a(fa),(G||H&&j>4)&&Qa(c,fa),P&&Qa(c,da),yt&&(a.prependedData=j>Et?await ro(i,Et,j-Et):v),a.comment=C?await ro(i,k+d,C):v,bt&&(a.appendedData=M<i.size?await ro(i,M,i.size-M):v),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class za{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new Da(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await n.next();if(e)return t.close();const o={...r,readable:function(){const{readable:t,writable:e}=new TransformStream;if(r.getData)return async function(){try{await r.getData(e)}catch(t){try{await e.abort(t)}catch{}}}(),t}()};delete o.getData,t.enqueue(o)}}),this.writable=r}}async function Fa(t,e={}){if(t=new Jn(t),await to(t),t.size!==T&&t.readUint8Array||(t=new Rn(await Me(t.readable)),await to(t)),t.size<d)return!1;const r=La(e,{}),n=r!=$,o=Ha(e[K],r),{Yt:a,Xt:i}=await Ga(t,n,o);if(!a||r==J&&i>1)return!1;const s=ai(Ot(a),20),c=a.offset+d+s;return t.size-c<=o}let Oa=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,o,i={}){const s=this,c=yt(),{reader:u,index:l,offset:f,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:p,compressionMethod:h,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:E,uncompressedSize:S,compressedSize:g}=s,{dataDescriptor:A}=m,R=e.localDirectory={},x=e.warnings=[],D=Pa(u,d)+f,F=await ro(u,D,z),O=Ot(F);let U=ti(s,i,N),I=ti(s,i,_);const k=ti(s,i,B);if(at(U,I),U=U&&U.length&&U,I=I&&I.length&&I,w&&99!=w.originalCompressionMethod)throw new Error(Pe);if(F.length<z||ii(O,0)!=n)throw new Error(Vo);ka(R,O,4);const{extraFieldLength:C,filenameLength:M}=R,V=R.dataOffset=D+z+M+C,H=ti(s,i,"checkLocalDirectory"),G=La(i,s.options),K=function(t,e){return t===T?e!=$:Boolean(t)}(H,G),q=function(t,e){return t===T?e==J:Boolean(t)}(H,G);let Y=v;if(q&&(M||C)){const t=await ro(u,D+z,M+C);Y=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=C?await ro(u,D+z+M,C):v;q&&(R.rawFilename=Y),Ca(s,R,O,4,!0)&&Qa(x,sa),function(t,e,r,n,o){const{rawFilename:a}=t,i=!o,s=t.Jt&&!(8192&~e.rawBitFlag);!n||s||r.length==a.length&&!r.some((t,e)=>t!=a[e])||Ja(i,o,"mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Ja(i,o,ma),e.compressionMethod!=t.compressionMethod&&Ja(i,o,ya),e.bitFlag.dataDescriptor||s||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Ja(i,o,ba)}(s,R,Y,q,K?T:x);const{lastAccessDate:X,creationDate:Q,uid:tt,gid:et}=R;X&&(e.lastAccessDate=X),Q&&(e.creationDate=Q),tt!==T&&e.uid===T&&(e.uid=tt),et!==T&&e.gid===T&&(e.gid=et);const rt=s.encrypted&&R.encrypted&&!k,nt=rt&&!w;if(k||(e.zipCrypto=nt),rt&&!(64&~R.rawBitFlag))throw new Error(Ko);const it=k?T:He(h);if(0!=h&&8!=h&&9!=h&&!it&&!k)throw new Error(Pe);if(rt){if(!nt&&(w.strength<1||w.strength>3))throw new Error(Ko);if(!U&&!I)throw new Error(Go)}if(V+g>u.size)throw new Error(Xo);const st=g,ct=Ce(u.createReadable({offset:V,size:st})),ut=ot(ti(s,i,P)),lt=ti(s,i,"checkPasswordOnly");let ft=ti(s,i,"checkOverlappingEntry");const dt=ti(s,i,"checkOverlappingEntryOnly");dt&&(ft=!0);const{onstart:wt,onprogress:pt,onend:ht}=i,mt=0!=h&&!k,bt=k?g:S,Et=9==h;let St=ti(s,i,W);Et&&(St=!1);const gt=ti(s,i,"checkCrc32"),At=(gt===T?ti(s,i,"checkSignature"):gt)&&!k&&(!rt||nt||w&&1==w.vendorVersion),Rt={options:{codecType:hr,password:U,rawPassword:I,zipCrypto:nt,encryptionStrength:w&&w.strength,checkCrc32:At,checkAuthenticationCode:ti(s,i,"checkAuthenticationCode"),passwordVerification:nt&&(A?E>>>8&r:b>>>24&r),outputSize:bt,crc32:b,compressed:mt,encrypted:rt,useWebWorkers:ti(s,i,j),useCompressionStream:St,transferStreams:ti(s,i,L),deflate64:Et,format:it?it.format:T,codecURI:it?it.codecURI:T,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:lt},config:c,ft:{signal:ut,size:st,onstart:wt,onprogress:pt,onend:ht}};let xt,Dt;ft&&await async function({reader:t,$t:e,index:r,offset:n,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:c,dataDescriptor:u,extraFieldZip64:l,qt:f}){let d=0;if(u&&(d=l?20:12),d){const r=await ro(t,c+i,d+4),n=Ot(r);let u=r.length==d+4&&ii(n,0)==a;if(u){const t=Ba(n,4,l);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:u=!1}if(r.length>=d){const t=Ba(n,u?4:0,l);t.signature=u,e.localDirectory.dataDescriptor=t}}const w={start:n,end:c+i+d,$t:e};for(const[t,e]of f)if(t!=r&&w.start<e.end&&e.start<w.end){const t=new Error(Yo);throw t.overlappingEntry=e.$t,t}f.set(r,w)}({reader:u,$t:e,index:l,offset:D,crc32:b,compressedSize:g,uncompressedSize:S,dataOffset:V,dataDescriptor:A||R.bitFlag.dataDescriptor,extraFieldZip64:p||R.extraFieldZip64,qt:o});try{if(!dt){lt&&(t=new WritableStream),t=new Qn(t),await to(t,function(t,e,r){return Math.min(t,r?1032*e:e)}(bt,g,mt)),({writable:xt}=t);const{outputSize:e}=await qr({readable:ct,writable:xt},Rt);if(t.size+=e,e!=bt)throw new Error(Ye)}}catch(e){if(e.outputSize!==T&&(t.size+=e.outputSize),!lt||e.message!=qt)throw Dt=e,e}finally{if(($n(t)||!ti(s,i,Z))&&xt&&!xt.locked){const t=xt.getWriter();if(Dt)try{await t.abort(Dt)}catch{}else await t.close()}}return lt||dt?T:t.getData?t.getData():xt}};function Ta(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;r<e;r++)if(134630224==ii(t,r))return!0;return!1}function Ua(t,e,r){let n=0;for(;r+f<=e.length&&ii(t,r)==s;)r+=f+ai(t,r+28)+ai(t,r+30)+ai(t,r+32),n++;return n%65536?0:n}function Ia(t){if(t.length>=6){const e=Ot(t);if(ii(e,0)==i){const r=ai(e,4);if(6+r<=t.length)return t.subarray(6,6+r)}}}function ka(t,e,r){const n=t.rawBitFlag=ai(e,r+2),o=!(1&~n),a=ii(e,r+6);Object.assign(t,{encrypted:o,version:ai(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:a,lastModDate:ri(a),filenameLength:ai(e,r+22),extraFieldLength:ai(e,r+24)})}function Ca(t,e,r,n,o){const{rawExtraField:a}=e,i=e.extraField=new Map,s=Ot(a);let c=0,u=!1;try{for(;c<a.length;){const t=ai(s,c),e=ai(s,c+2);i.set(t,{type:t,data:a.slice(c+4,c+4+e)}),c+=4+e}}catch{u=!0}c>a.length&&(u=!0);const l=ai(r,n+4);Object.assign(e,{signature:ii(r,n+10),crc32:ii(r,n+10),compressedSize:ii(r,n+14),uncompressedSize:ii(r,n+18)});const f=i.get(1);f&&(function(t,e){e.zip64=!0;const r=Ot(t.data),n=Aa.filter(([t,r])=>e[t]==r),o=n.reduce((t,[,e])=>t+Ra[e].bytes,0);if(t.data.length<o)throw new Error(Ho);for(let o=0,a=0;o<n.length;o++){const[i,s]=n[o],c=Ra[s];e[i]=t[i]=c.Kt(r,a),a+=c.bytes}}(f,e),e.extraFieldZip64=f);const d=i.get(28789);d&&(Ma(d,oo,ao,e,t),e.extraFieldUnicodePath=d);const w=i.get(25461);w&&(Ma(w,io,so,e,t),e.extraFieldUnicodeComment=w);const p=i.get(h);p&&p.data.length>=7?(function(t,e,r){const n=Ot(t.data),o=oi(n,4);Object.assign(t,{vendorVersion:oi(n,0),vendorId:oi(n,2),strength:o,originalCompressionMethod:r,compressionMethod:ai(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=T)}(p,e,l),e.extraFieldAES=p):e.compressionMethod=l;const S=i.get(13);S&&(va(S,e),e.extraFieldPkwareUnix=S);const g=i.get(22613);g&&(va(g,e),e.extraFieldUnixType1=g);const A=i.get(10);A&&(function(t,e){const r=Ot(t.data);let n,o=4;try{for(;o<t.data.length&&!n;){const e=ai(r,o),a=ai(r,o+2);1==e&&(n=t.data.slice(o+4,o+4+a)),o+=4+a}}catch{}if(n&&24==n.length){const r=Ot(n),o=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:o,rawLastAccessDate:a,rawCreationDate:i});const s={lastModDate:ni(o),lastAccessDate:ni(a),creationDate:ni(i)};Object.assign(t,s),Object.assign(e,s,{rawLastAccessDate:a,rawCreationDate:i})}}(A,e),e.extraFieldNTFS=A);const R=i.get(E);let x;if(R&&(x=Na(R,e,!1),e.extraFieldUnix=R),!x){const t=i.get(b);t&&(Na(t,e,!0),e.extraFieldInfoZip=t)}const D=i.get(m);D&&(function(t,e,r){if(!t.data.length)return;const n=Ot(t.data),o=oi(n,0),a=[],i=[];r?(1&~o||(a.push(wo),i.push(po)),2&~o||(a.push(ho),i.push(mo)),4&~o||(a.push(yo),i.push(bo))):t.data.length>=5&&(a.push(wo),i.push(po));let s=1;a.forEach((r,o)=>{if(t.data.length>=s+4){const a=ii(n,s);e[r]=t[r]=new Date(1e3*(0|a));const c=i[o];t[c]=a}s+=4})}(D,e,o),e.extraFieldExtendedTimestamp=D);const z=i.get(y);return z&&(e.extraFieldUSDZ=z),u}function Ma(t,e,r,n,o){if(t.data.length<5)return void(t.valid=!1);const a=Ot(t.data),i=new Bt;i.append(o[r]);const s=Ot(new Uint8Array(4));s.setUint32(0,i.get(),!0);const c=ii(a,1),u=oi(a,0);Object.assign(t,{version:u,[e]:en(t.data.subarray(5)),valid:1==u&&!o.bitFlag.languageEncodingFlag&&c==ii(s,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function va(t,e){if(t.data.length<8)return;const r=Ot(t.data),n={lastAccessDate:new Date(1e3*(0|ii(r,0))),lastModDate:new Date(1e3*(0|ii(r,4)))};t.data.length>=12&&(n.uid=ai(r,8),n.gid=ai(r,10)),Object.assign(t,n),Object.assign(e,n)}function Na(t,e,r){try{const n=Ot(t.data);let o,a;if(r){let e=0;const r=oi(n,e++),i=oi(n,e++);o=_a(t.data.subarray(e,e+i)),e+=i;const s=oi(n,e++);a=_a(t.data.subarray(e,e+s)),Object.assign(t,{version:r,uid:o,gid:a})}else t.data.length>=4&&(o=ai(n,0),a=ai(n,2),Object.assign(t,{uid:o,gid:a}));return o!==T&&(e.uid=o),a!==T&&(e.gid=a),o!==T||a!==T}catch{}}function _a(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Ba(t,e,r){const n=ii(t,e);let o,a;return r?(o=si(t,e+4),a=si(t,e+12)):(o=ii(t,e+4),a=ii(t,e+8)),{crc32:n,compressedSize:o,uncompressedSize:a}}function Pa(t,e){return t.Gt?t.Gt(e):0}async function ja(t){return ii(Ot(await ro(t,0,4)))}function Wa(t){return t===J||t===Q||t===$}function La(t,e){return Za(t,Za(e,Q))}function Za(t,e){const r=t.strictness;if(r!==T){if(!Wa(r))throw new Error(ta);return r}const n=t.checkAmbiguity;return n===T?e:n?J:e==$?$:Q}function Va(t,e){if(e==$)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(r.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Ea.test(t))||e==J&&(r.includes(".")||r.includes(""))}function Ha(t,r){if(t!==T){const e=ct(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw new Error(ra);return e}return r==J?0:r==$?1/0:e}async function Ga(t,e,r){const{size:n}=t,o=Math.min(n,65557),a={count:64};let i,s,c=0;for await(const[r,u,l,f,w]of Ka(t,o)){const o=ai(r,f+20);if(w+d+o==n){const o=await Ya(t,r,u,f,w,n,a);if(2==o){if(i||(i=qa(l,f,w)),c++,!e||c>1)break}else 1!=o||s||(s=qa(l,f,w))}}return i||(i=s),i||(i=await async function(t,e,r){const{size:n}=t,o=Math.min(n,e==1/0?n:65557+e);let a,i;for await(const[e,s,c,u,l]of Ka(t,o)){const o=qa(c,u,l);a||(a=o);const f=await Ya(t,e,s,u,l,n,r);if(2==f)return o;1!=f||i||(i=o)}return i||a}(t,r,a)),{Yt:i,Xt:c}}async function*Ka(t,e){const r=t.size-e,n=await ro(t,r,e),o=Ot(n);for(let t=n.length-d;t>=0;t--)ii(o,t)==c&&(yield[o,r,n,t,r+t])}function qa(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Ya(r,n,o,a,i,c,u){const f=ai(n,a+10),d=ii(n,a+12),p=ii(n,a+16);if(f==e||d==t||p==t)return await Xa(r,n,o,i-w,c,u)==l?2:0;if(!f&&!d)return 1;const h=ai(n,a+6);for(const t of[i-d,Pa(r,h)+p])if(await Xa(r,n,o,t,c,u)==s)return 2;return 0}async function Xa(t,e,r,n,o,a){return n<0||n+4>o?T:n>=r?ii(e,n-r):a.count>0?(a.count--,ii(Ot(await ro(t,n,4)),0)):T}function Ja(t,e,r){t?$a(r):Qa(e,r)}function Qa(t,e,r){if(!t.some(t=>t.reason==e)){const n={reason:e};r!==T&&(n.filename=r),t.push(n)}}function $a(t){const e=new Error(Jo);throw e.reason=t,e}function ti(t,e,r){return e[r]===T?t.options[r]:e[r]}function ei(t,e,r){return nt(ti(t,e,r))}function ri(t){const r=(4294901760&t)>>16,n=t&e,o=new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return o<O?O:o}function ni(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function oi(t,e){return t.getUint8(e)}function ai(t,e){return t.getUint16(e,!0)}function ii(t,e){return t.getUint32(e,!0)}function si(t,e){const r=t.getBigUint64(e,!0);if(r>xa)throw new Error(na);return Number(r)}var ci=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Jo,ERR_BAD_FORMAT:jo,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Zo,ERR_ENCRYPTED:Go,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Qo,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Xo,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Lo,ERR_EOCDR_NOT_FOUND:Wo,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Ho,ERR_INVALID_AUTHENTICATION_CODE:Kt,ERR_INVALID_COMPRESSED_DATA:Xe,ERR_INVALID_CRC32:Je,ERR_INVALID_FILENAME_VALIDATION:ea,ERR_INVALID_MAX_APPENDED_DATA_SIZE:ra,ERR_INVALID_PASSWORD:Gt,ERR_INVALID_STRICTNESS:ta,ERR_INVALID_UNCOMPRESSED_SIZE:Ye,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Vo,ERR_OVERLAPPING_ENTRY:Yo,ERR_SPLIT_ZIP_FILE:qo,ERR_UNSAFE_FILENAME:$o,ERR_UNSUPPORTED_COMPRESSION:Pe,ERR_UNSUPPORTED_ENCRYPTION:Ko,ERR_UNSUPPORTED_UINT64:na,ERR_WORKER_STARTUP_TIMEOUT:br,WARNING_APPENDED_DATA:la,WARNING_COMPRESSED_PATCHED_DATA:ia,WARNING_DUPLICATE_FILENAME:pa,WARNING_MALFORMED_EXTRA_FIELD:sa,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:ma,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ya,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ba,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:ha,WARNING_PREPENDED_CENTRAL_DIRECTORY:da,WARNING_PREPENDED_DATA:fa,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:wa,WARNING_UNKNOWN_VERSION:aa,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:ca,WARNING_UNSORTED_CENTRAL_DIRECTORY:oa,WARNING_WRAPPED_ENTRIES_COUNT:ua,ZipReader:Da,ZipReaderStream:za,isZipFile:Fa});const ui="File already exists",li="Zip file comment exceeds 64KB",fi="Invalid zip file comment (must be a Uint8Array)",di="File entry comment exceeds 64KB",wi="Invalid file entry comment (must be a string)",pi="Invalid date (must be a valid Date instance)",hi="File entry name exceeds 64KB",mi="Version exceeds 65535",yi="The strength must equal 1, 2, or 3",bi="Encryption is not supported in USDZ files",Ei="Encryption is not supported when the 'passThrough' option is set",Si="Invalid extra field (must be a Map)",gi="Invalid extra field type (must be integer 0..65535)",Ai="Invalid extra field data (must be a Uint8Array)",Ri="Extra field data exceeds 64KB",xi=-2147483648,Di=2147483647,zi=BigInt(0),Fi=BigInt("0x7fffffffffffffff"),Oi="Zip64 is not supported (set the 'zip64' option to 'true')",Ti="Undefined uncompressed size",Ui="Undefined compression method",Ii="Undetermined size",ki="Undefined reader",Ci="Zip file not empty",Mi="Invalid uid (must be integer 0..2^32-1)",vi="Invalid gid (must be integer 0..2^32-1)",Ni="Invalid UNIX mode (must be integer 0..65535)",_i="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Bi="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Pi="Invalid msdosAttributesRaw (must be integer 0..255)",ji="Invalid msdosAttributes (must be an object with boolean flags)",Wi="Invalid level (must be integer 0..9)",Li="Signature data exceeds 64KB",Zi=new Uint8Array([7,0,2,0,65,69,3,0,0]),Vi="infozip",Hi="unix";let Gi=0;const Ki=[];class qi{constructor(t,e={}){t=new Qn(t);const{availableSize:r=U,maxSize:n=U}=t,o=r>0&&r!==U&&n>0&&n!==U;Object.assign(this,{writer:t,te:o,options:e,ee:new Map,re:new Set,offset:e[H]===T?t.size||t.writable.size||0:e[H],ne:e[H]===T?0:e[H]-(t.size||t.writable.size||0),oe:new Set,ae:[],ie:0,se:0,ce:T})}prependZip(t){return Ji(this,async function(t,e){if(t.re.size)throw new Error(Ci);await t.ue(e)}(this,t))}appendZip(t){return Ji(this,this.ue(t))}async ue(t){const e=this,{oe:r,re:n,ee:a}=e;for(;r.size;)await Promise.allSettled(Array.from(r));let i;const s=new Promise(t=>i=t);r.add(s);const c=[];let u;try{t=new Jn(t),await to(t),t.size!==T&&t.readUint8Array||(t=new Rn(await Me(t.readable)),await to(t));const{ZipReader:r}=await Promise.resolve().then(function(){return ci}),i=new r(t),s=await i.getEntries();await i.close(),await to(e.writer);const{directoryOffset:l}=i;s.forEach(({filename:t})=>{if(n.has(t))throw new Error(ui);n.add(t),c.push(t)}),e.le=!0;const{fe:f}=e;e.fe=new Promise(t=>u=()=>{e.le=!1,t()}),await f,e.te&&(delete e.te,await async function(t){return Ot(await ro(t,0,4)).getUint32(0,!0)==o}(t)||(await Ss(e.writer,bs()),e.offset+=4));const d=await async function(t,e,r,n){const{writer:o}=t,a=new Map;if(o.closeDisk){const i=Array.from(r).sort((t,r)=>ys(e,t)-ys(e,r));let s=0;for(const r of i){const n=ys(e,r);await hs(t,e,s,n-s),ds(o,await ms(e,n))&&await o.closeDisk(),a.set(r,{offset:ws(t,o),diskNumberStart:ls(o)}),s=n}await hs(t,e,s,n-s)}else{const o=t.offset;await hs(t,e,0,n),r.forEach(t=>a.set(t,{offset:o+ys(e,t),diskNumberStart:0}))}return a}(e,t,s,l);s.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:n,bitFlag:o,encrypted:i,uncompressedSize:s,compressedSize:c,extraFieldZip64:u}=t;let{compressionMethod:l,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:h}=o;f=ps(f||v),t.extraFieldAES&&(l=99);const m=_s(f),y=Boolean(u)&&u.uncompressedSize!==T,b=Boolean(u)&&u.compressedSize!==T,E=-7&Ps(w,p,h,i,l)|w<<1,{de:S,we:g}=Bs({version:e,bitFlag:E,compressionMethod:l,uncompressedSize:s,compressedSize:c,rawLastModDate:r,rawFilename:n,pe:b,he:y,extraFieldLength:m}),{crc32:A}=t;A!==T&&Ms(g,10,A);const{offset:R,diskNumberStart:x}=d.get(t);Object.assign(t,{he:y,pe:b,offset:R,diskNumberStart:x,me:!1,ye:v,be:v,Ee:v,Se:v,ge:v,rawExtraField:f,Ae:v,extendedTimestamp:!1,de:S,we:g}),a.set(t.filename,t)})}catch(t){throw c.forEach(t=>n.delete(t)),t}finally{i(),r.delete(s),u&&u()}}add(e="",n,o={}){const a=this,{oe:i}=a,s=async function(e,n,o,a){if(zs(e,a=Object.assign({},a),To)&&!n.endsWith(D)&&(n+=D),e.re.has(n))throw new Error(ui);e.re.add(n),Gi<yt().maxWorkers?Gi++:await new Promise(t=>Ki.push(t));try{return await async function(e,n,o,a){const i=ts(e,n,a);({name:n}=i);const s=es(e,n,a),{comment:c}=s,u=a[Co];e.ee.set(n,T);const l=e.ce,f={};let d,w;s.Re.keepOrder&&(f.xe=new Promise(t=>d=t)),e.ce=f;try{const{Re:c}=s;0==c.level||c.compressionMethod!==T||c.passThrough||await Rr(yt())||(c.level=0);const u=await async function(t,e,{Re:r},n){if(r.passThrough&&!e&&!zs(t,n,To))throw new Error(ki);let o;return e&&(e=new Jn(e),await to(e),({size:o}=e)),Object.assign({reader:e},ns(t,Boolean(e),o,r,n))}(e,o,s,a);({reader:o}=u);const p=fs(e.writer),h=ls(e.writer),m=os(a=Object.assign({},a,i.Re,s.Re,u.Re,{signature:a[ko],crc32:a.crc32===T?a[ko]:a.crc32,offset:e.offset-p,diskNumberStart:h,[G]:e.options[G]})),y=ss(a),b=_s(m.De,y.ze);w=await async function(e,n,o,a,i){const{ee:s,writer:c}=e,{keepOrder:u,dataDescriptor:l,Fe:f,signal:d}=i,{Oe:w,$t:p,Te:h,Ue:m}=a,y=e.options[G];let b,E,S,g,A,R,x,D=p,F=0;const O=u&&h?h.xe:T;s.set(n,D);try{i.bufferedWrite||!u||e.le||e.ie||e.se||!l&&!f?(b=!0,e.ie++,x=i.createTempStream?await i.createTempStream():new TransformStream(T,T,{highWaterMark:U}),x.size=0,await to(c)):(E=!0,e.se++,x=c,await O,await I()),await to(x);const p=fs(c);e.te&&!b&&await Es(e,c),y&&!b&&as(a,e.offset-p);const{De:h}=w;b||await k();const m=ls(c),S=ws(e,c);if(D.diskNumberStart=m,b||(A=!0,R=c.size,await Ss(x,h)),D=await async function(e,n,{diskNumberStart:o,xe:a},i,s,c){const{Oe:u,Ie:l,ke:f}=i,{de:d,we:w,lastModDate:p,rawLastModDate:h,encrypted:m,compressed:y,version:b,compressionMethod:E,ye:S,Ce:g,Ee:A,Me:R,Se:x,ge:D,be:z}=u,{ze:F}=l,{rawFilename:O,lastAccessDate:U,creationDate:I,password:k,rawPassword:C,level:M,zip64:v,he:N,pe:_,zipCrypto:B,dataDescriptor:P,directory:j,executable:W,versionMadeBy:L,rawComment:Z,rawExtraField:V,Ae:H,useWebWorkers:G,transferStreams:K,onstart:q,onprogress:Y,onend:X,signal:J,encryptionStrength:Q,extendedTimestamp:$,msDosCompatible:tt,internalFileAttributes:et,externalFileAttributes:rt,uid:nt,gid:ot,unixMode:at,symlink:it,setuid:st,setgid:ct,sticky:ut,unixExternalUpper:lt,msdosAttributesRaw:ft,msdosAttributes:dt,useCompressionStream:wt,passThrough:pt,format:ht,codecURI:mt}=c,yt={xe:a,versionMadeBy:L,zip64:v,directory:Boolean(j),executable:Boolean(W),filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:Z,ye:S,Ce:g,Ee:A,Se:x,ge:D,be:z,rawExtraField:V,Ae:H,extendedTimestamp:$,msDosCompatible:tt,internalFileAttributes:et,externalFileAttributes:rt,diskNumberStart:o,uid:nt,gid:ot,unixMode:at,symlink:Boolean(it),setuid:st,setgid:ct,sticky:ut,unixExternalUpper:lt,msdosAttributesRaw:ft,msdosAttributes:dt};let{crc32:bt,uncompressedSize:Et}=c,St=0;pt||(Et=0);const{writable:gt}=n;if(e){const o=e.size,a=Ce(no(e,{size:o})),i={options:{codecType:pr,inputSize:o,level:M,rawPassword:C,password:k,encryptionStrength:Q,zipCrypto:m&&B,passwordVerification:m&&B&&h>>8&r,computeCrc32:!pt,compressed:y&&!pt,encrypted:m&&!pt,useWebWorkers:G,useCompressionStream:wt,transferStreams:K,format:ht,codecURI:mt,compressionMethod:E},config:s,ft:{signal:J,size:o,onstart:q,onprogress:Y,onend:X}};try{const e=await qr({readable:a,writable:gt},i);if(St=e.outputSize,n.size+=St,pt||(Et=e.inputSize,m&&!B||(bt=e.crc32)),!_&&St>=t||!N&&Et>=t)throw new Error(Oi)}catch(t){throw t.outputSize!==T&&(n.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:r,Oe:n,Ie:o},{zip64:a,zipCrypto:i,passThrough:s,dataDescriptor:c}){const{we:u,encrypted:l}=n,{ve:f,Ne:d}=o;l&&!i&&!s||t===T||(Ms(u,10,t),c&&Ms(f,d,t)),a?c&&(vs(f,d+4,BigInt(e)),vs(f,d+12,BigInt(r))):(Ms(u,14,e),Ms(u,18,r),c&&(Ms(f,d+4,e),Ms(f,d+8,r)))}({crc32:bt,compressedSize:St,uncompressedSize:Et,Oe:u,Ie:l},c),P&&await Ss(n,F),Object.assign(yt,{uncompressedSize:Et,compressedSize:St,lastModDate:p,rawLastModDate:h,creationDate:I,lastAccessDate:U,encrypted:Boolean(m),zipCrypto:Boolean(B),size:f+St,compressionMethod:E,version:b,de:d,we:w,signature:bt,crc32:!m||B||pt?bt:T,Me:R,he:N,pe:_}),yt}(o,x,D,a,yt(),i),b||(A=!1),s.set(n,D),D.filename=n,b){if(await Promise.all([x.writable.getWriter().close(),O]),await I(),e.te&&await Es(e,c),g=!0,R=c.size,await k(),D.diskNumberStart=ls(c),D.offset=ws(e,c),y){const t=a.ke;as(a,e.offset-fs(c)),D.size+=a.ke-t}!function({rawFilename:t,encrypted:e,zip64:r,Ce:n,crc32:o,compressedSize:a,uncompressedSize:i,he:s,pe:c},u,{dataDescriptor:l,passThrough:f}){if(l||((!e||f&&o!==T)&&Ms(u,14,o),c||Ms(u,18,a),s||Ms(u,22,i)),r&&n){const e=z+_s(t)+4;vs(u,e,BigInt(i)),vs(u,e+8,BigInt(a))}}(D,w._e,i),await Ss(c,w.De),await gs(x.readable,c,d,t=>F+=t),c.size+=x.size,g=!1}else D.diskNumberStart=m,D.offset=S;return e.offset+=D.size,D}catch(t){if(g||A){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-R,b&&(e.offset+=F)}throw s.delete(n),t}finally{if(b&&e.ie--,E&&e.se--,m&&m(O),S&&S(),b&&x&&x.dispose)try{await x.dispose()}catch{}}async function I(){e.le=!0;const{fe:t}=e;e.fe=new Promise(t=>S=()=>{e.le=!1,t()}),await t}async function k(){ds(c,_s(w.De))&&await c.closeDisk()}}(e,n,o,{Oe:m,Ie:y,ke:b,$t:f,Te:l,Ue:d},a)}catch(t){throw e.ee.delete(n),t}finally{d&&d(l&&l.xe)}return Object.assign(w,{name:n,comment:c,extraField:u}),new Po(w)}(e,n,o,a)}catch(t){throw e.re.delete(n),t}finally{const t=Ki.shift();t?t():Gi--}}(a,e,n,o);i.add(s);const c=()=>i.delete(s);return Promise.prototype.then.call(s,c,c),Ji(a,s)}remove(t){const{re:e,ee:r}=this;if(typeof t==M&&(t=r.get(t)),t&&t.filename!==T){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=v,n={}){const o=this,{oe:a,writer:w}=this,{writable:p}=w;if(!(r instanceof Uint8Array))throw new Error(fi);if(_s(r)>e)throw new Error(li);for(;a.size;)await Promise.allSettled(Array.from(a));await Promise.allSettled(o.ae.map(t=>t.Be));const h=o.ae.filter(t=>t.error&&!t.Pe);if(h.length){const t=h.map(t=>t.error);h.forEach(t=>t.Pe=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(r,n,o){const a=cs(r.ee),{je:w,We:p,Le:h}=await async function(r,n,o){const{ee:a,writer:i}=r,c=new Uint8Array(n);await to(i);let u=0,l=0,d=ls(i),w=fs(i),p=0;for(const[r,n]of Array.from(a.values()).entries()){const{offset:h,rawFilename:m,ye:y,be:b,Ee:E,Se:S,ge:g,rawExtraField:A,Ae:R,rawComment:x,versionMadeBy:D,de:z,we:F,he:O,pe:T,me:U,Ze:I,internalFileAttributes:k,externalFileAttributes:C,diskNumberStart:M,uncompressedSize:v,compressedSize:N}=n,_=_s(y,b,E,S,g,A,R),B=f+_s(m,x)+_;ds(i,u+B-l)&&(await Ss(i,c.slice(l,u)),l=u,p=0,await i.closeDisk()),0==r&&(d=ls(i),w=fs(i)),O||Ms(F,18,v),T||Ms(F,14,N),(I||U)&&n.version<45&&Cs(F,0,45);const P=us(B);if(P.Ve(s),P.He(D),P.Ge(z.subarray(0,24)),P.He(_),P.He(_s(x)),P.He(U?e:M),P.He(k),P.Ve(C),P.Ve(I?t:h),P.Ge(m),P.Ge(y),P.Ge(b),P.Ge(E),P.Ge(S),P.Ge(g),P.Ge(A),P.Ge(R),P.Ge(x),Ns(c,P.Wt,u),u+=B,p++,o.onprogress)try{await o.onprogress(r+1,a.size,new Po(n))}catch{}}return await Ss(i,l?c.slice(l):c),{je:{diskNumber:d,diskOffset:w},We:{diskNumber:ls(i),Ke:p},Le:c}}(r,a,o),m=await async function(t,r,n){const o=Os(t,n,q);if(o){const n=await o(r),a=_s(n);if(a>e)throw new Error(Li);const s=us(6+a);s.Ve(i),s.He(a),s.Ge(n);const{writer:c}=t;return ds(c,_s(s.Wt))&&await c.closeDisk(),await Ss(c,s.Wt),6+a}return 0}(r,h,o);await async function(r,n,o,a){const{writer:i}=r,{je:s,We:f,qe:w}=a;let{Ye:p}=a,h=r.ee.size,m=s.diskNumber,y=ws(r,s);const b=_s(n);if(b>e)throw new Error(li);let E=zs(r,o,xo),S=ls(i);if(ds(i,(E?98:d)+b)&&S++,y>=t||p>=t||h>=e||S>=e){if(!1===E)throw new Error(Oi);E=!0}const g=us(E?98:d);ds(i,_s(g.Wt)+b)&&await i.closeDisk(),S=ls(i);let A=S==f.diskNumber?f.Ke:0;E&&(g.Ve(u),g.Xe(44),g.He(45),g.He(45),g.Ve(S),g.Ve(m),g.Xe(A),g.Xe(h),g.Xe(p),g.Xe(y),g.Ve(l),g.Ve(S),g.Xe(BigInt(ws(r,i))+BigInt(p)+BigInt(w)),g.Ve(S+1),zs(r,o,"supportZip64SplitFile",!0)&&(S=e,m=e),A=e,h=e,y=t,p=t),g.Ve(c),g.He(S),g.He(m),g.He(A),g.He(h),g.Ve(p),g.Ve(y),g.He(b),await Ss(i,g.Wt),b&&await Ss(i,n)}(r,n,o,{je:w,We:p,Ye:a,qe:m})}(o,r,n),!$n(w)&&zs(o,n,Z)||await p.getWriter().close(),w.getData?w.getData():p}}class Yi{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new qi(r,t),this.oe=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:o}=new TransformStream({start(t){r=t},flush:()=>{!async function(){try{await e.close()}catch(t){await Qi(e,t)}}()}});return $i(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return $i(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){const{zipWriter:r}=this,n=(await Promise.allSettled(Array.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(n.length){const[t]=n;try{t.entryErrors=n}catch{}throw await Qi(r,t),t}try{return await r.close(t,e)}catch(t){throw await Qi(r,t),t}}}class Xi extends Promise{then(t,e){const{Je:r}=this;return r&&(r.Pe=!0),super.then(t,e)}}function Ji(t,e){const r=new Xi((t,r)=>Promise.prototype.then.call(e,t,r)),n={};return r.Je=n,n.Be=Promise.prototype.then.call(r,T,t=>n.error=t),t.ae.push(n),r}async function Qi(t,e){try{await t.writer.writable.abort(e)}catch{}}function $i(t,e,r){t.oe.add(e),e.catch(t=>{try{r(t)}catch{}})}function ts(n,o,a){let i=zs(n,a,Ro),s=zs(n,a,Fo,i?20:768);const c=zs(n,a,Uo),u=Ts(n,a,"uid"),l=Ts(n,a,"gid");let f=Ts(n,a,Mo),d=zs(n,a,"unixExtraFieldType"),w=zs(n,a,vo),p=zs(n,a,No),h=zs(n,a,_o);if(st(u,t,Mi),st(l,t,vi),st(f,e,Ni),d!==T&&d!==Vi&&d!==Hi)throw new Error(_i);if(d===Hi&&(u!==T&&u>e||l!==T&&l>e))throw new Error(Bi);d!==T||u===T&&l===T||(d=Vi);let m=Ts(n,a,go),y=zs(n,a,Ao);const b=m!==T||y!==T;if(u!==T||l!==T||f!==T||d||c?(i=!1,s=s&r|768):b&&(i=!0,s&=r),st(m,r,Pi),y&&(typeof y!==C||Array.isArray(y)))throw new Error(ji);if(s>e)throw new Error(mi);let E=zs(n,a,So);const S=E!==T;S||(E=0),!a[To]&&o.endsWith(D)&&(a[To]=!0);const z=zs(n,a,To);if(z?(o.endsWith(D)||(o+=D),S||(E=16,i||(E|=16877<<16))):i||S||(E=c?493<<16:27525120),!i){const t=f!==T||Boolean(w||p||h);f=f===T?E>>16&e:f&e,w?f|=R:w=Boolean(f&R),p?f|=x:p=Boolean(f&x),h?f|=512:h=Boolean(512&f),S&&!t||(z?f=-61441&f|A:f&g||(f|=32768),E=(f&e)<<16|E&e)}({msdosAttributesRaw:m,msdosAttributes:y}=function(t,e){if(t!==T)t&=r;else if(e!==T){const{readOnly:n,hidden:o,system:a,directory:i,archive:s}=e;let c=0;n&&(c|=1),o&&(c|=2),a&&(c|=4),i&&(c|=16),s&&(c|=32),t=c&r}return e===T&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(m,y)),b&&(E=E&t|m&r);const F=E>>16&e,O=f!==T&&40960==(f&g);return{name:o,Re:{versionMadeBy:s,msDosCompatible:Boolean(i),externalFileAttributes:E,unixExternalUpper:F,uid:u,gid:l,unixMode:f,unixExtraFieldType:d,symlink:O,setuid:w,setgid:p,sticky:h,msdosAttributesRaw:m,msdosAttributes:y}}}function es(t,r,n){const o=Os(t,n,"encodeText")||jt;let a=o(r,Y);if(a===T&&(a=jt(r)),_s(a)>e)throw new Error(hi);const i=n[io]||"";if(typeof i!=M)throw new Error(wi);let s=o(i,X);if(s===T&&(s=jt(i)),_s(s)>e)throw new Error(di);const c=zs(t,n,zo);if(c!==T&&c>e)throw new Error(mi);const u=Fs(t,n,wo,new Date),l=zs(t,n,po),f=Fs(t,n,ho),d=Fs(t,n,yo),w=zs(t,n,Eo,0),p=zs(t,n,B),h=zs(t,n,N),m=zs(t,n,_);at(h,m);const y=Ts(t,n,"encryptionStrength",3),b=zs(t,n,Oo),E=zs(t,n,"extendedTimestamp",!0),S=zs(t,n,"ntfsTimestamp"),g=zs(t,n,"keepOrder",!0),A=zs(t,n,j),R=zs(t,n,L),x=zs(t,n,"bufferedWrite"),D=Os(t,n,"createTempStream"),z=zs(t,n,"dataDescriptorSignature",!0),F=ot(zs(t,n,P)),O=zs(t,n,"useUnicodeFileNames",!0),U=zs(t,n,Io),I=p||U===T?T:He(U);if(!p&&U!==T&&0!==U&&8!==U&&!I)throw new Error(Pe);let k=Ts(t,n,"level");if(st(k,9,Wi),t.options[G]){if(h!==T||m!==T)throw new Error(bi);k===T&&U===T&&(k=0)}p&&(k=T);let C=zs(t,n,W),v=zs(t,n,V);x&&v===T&&(v=!1),(v===T||b&&!p)&&(v=!0),k!==T&&6!=k&&(C=!1);const Z=zs(t,n,xo);if(!(b||h===T&&m===T||Number.isInteger(y)&&y>=1&&y<=3))throw new Error(yi);const H=rs(n[Co]),K=rs(n.localExtraField),q=rs(n.centralExtraField);return{comment:i,Re:{rawFilename:a,rawComment:s,version:c,lastModDate:u,rawLastModDate:l,lastAccessDate:f,creationDate:d,internalFileAttributes:w,passThrough:p,password:h,rawPassword:m,encryptionStrength:y,zipCrypto:b,extendedTimestamp:E,ntfsTimestamp:S,keepOrder:g,useWebWorkers:A,transferStreams:R,bufferedWrite:x,createTempStream:D,dataDescriptorSignature:z,signal:F,useUnicodeFileNames:O,compressionMethod:U,format:I?I.format:T,codecURI:I?I.codecURI:T,Qe:I?I.versionNeeded:T,level:k,useCompressionStream:C,dataDescriptor:v,zip64:Z,rawExtraField:H,$e:K,Ae:q}}}function rs(t){if(!t)return v;if(!(t instanceof Map))throw new Error(Si);let r=0,n=0;t.forEach((t,n)=>{if(it(n,e,gi),!(t instanceof Uint8Array))throw new Error(Ai);if(_s(t)>e)throw new Error(Ri);r+=4+_s(t)});const o=new Uint8Array(r),a=Ot(o);return t.forEach((t,e)=>{Cs(a,n,e),Cs(a,n+2,_s(t)),Ns(o,t,n+4),n+=4+_s(t)}),o}function ns(e,r,n,o,a){const{passThrough:i,zipCrypto:s,password:c,rawPassword:u,encryptionStrength:l}=o;let{dataDescriptor:f,zip64:d,level:w,compressionMethod:p}=o,h=0,m=0;if(i&&r){if(m=a[co],m===T)throw new Error(Ti);if(p===T)throw new Error(Ui)}const y=!0===d,b=zs(e,a,Do);if(r&&i&&!b&&_s(c,u))throw new Error(Ei);const E=r&&(Boolean(c&&_s(c)||u&&_s(u))||i&&b);r||(w=0,p=0);const S=E?s?12:16+4*l:0;r&&(i?(a.uncompressedSize=m,h=n===T?Us(m)+S:n):n===T?(f=!0,(d||d===T)&&(d=!0,m=h=4294967296)):(a.uncompressedSize=m=n,h=(Is(p,w)?Us(m):m)+S));const g=!(E||r&&(0!==n||i)||Is(p,w));g&&!s&&zs(e,a,V)===T&&(f=!1);const A=y||m>=t,R=y||h>=t;if(A||R){if(!1===d)throw new Error(Oi);d=!0}return d=d||!1,{er:h,Re:{dataDescriptor:f,Fe:g,zip64:d,he:A,pe:R,uncompressedSize:m,level:w,compressionMethod:p,encrypted:E}}}function os(t){const{rawFilename:r,lastModDate:o,rawLastModDate:a,lastAccessDate:i,creationDate:s,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:f,dataDescriptor:d,directory:w,rawExtraField:p,$e:y,encryptionStrength:S,extendedTimestamp:g,ntfsTimestamp:A,passThrough:R,encrypted:x,he:D,pe:U,uncompressedSize:I,crc32:k}=t;let{version:C,compressionMethod:M}=t;const N=!w&&Is(M,c);let _;const B=R||!N,P=u&&(t.bufferedWrite||!d||!D&&!U||B),j=P||u&&d&&(D||U);if(u&&(D||U)){const t=20,e=us(t);if(e.He(1),e.He(t-4),_=e.Wt,P&&(e.Xe(I),B)){const t=x?l?12:16+4*S:0;e.Xe(R?0:I+t)}}else _=v;let W,L,Z,V,H;if(x&&!l){const t=us(_s(Zi)+2);t.He(h),t.Ge(Zi),W=t.Wt,W[8]=S}else W=v;if(g){const t=Rs(o),e=xs(t);if(e){const e=9+(i?4:0)+(s?4:0),r=us(e);V=1+(i?2:0)+(s?4:0),r.He(m),r.He(e-4),r.rr(V),r.Ve(t),i&&r.Ve(Ds(Rs(i))),s&&r.Ve(Ds(Rs(s))),Z=r.Wt}else Z=v;if(A===T?!e||Boolean(i||s):A)try{const t=As(o),e=us(36);e.He(10),e.He(32),e.nr(4),e.He(1),e.He(24),e.Xe(t),e.Xe(i?As(i):t),e.Xe(s?As(s):t),L=e.Wt}catch{L=v}else L=v}else L=Z=v;try{const{uid:r,gid:n,unixExtraFieldType:o}=t;if(o!=Vi||r===T&&n===T)if(o!=Hi||r===T&&n===T)H=v;else{const t=us(8);t.He(E),t.He(4),t.He((r===T?0:r)&e),t.He((n===T?0:n)&e),H=t.Wt}else{const t=is(r===T?0:r),e=is(n===T?0:n),o=3+t.length+e.length,a=us(4+o);a.He(b),a.He(o),a.rr(1),a.rr(t.length),a.Ge(t),a.rr(e.length),a.Ge(e),H=a.Wt}}catch{H=v}M===T&&(M=N?8:0),C===T&&(C=0!=M||w||x?20:10);const{Qe:K}=t;N&&K!==T&&(C=C>K?C:K),u&&(C=C>45?C:45),x&&!l&&(C=C>51?C:51,R&&k!==T&&(W[4]=1),Cs(Ot(W),9,M),M=99);const q=j?_s(_):0,Y=q+_s(W,Z,L,H,p,y);if(Y+(t[G]?67:0)>e)throw new Error(Ri);const X=new Date(2e3*Math.ceil(Math.floor(o.getTime()/1e3)/2)),{de:J,we:Q,rawLastModDate:$}=Bs({version:C,bitFlag:Ps(c,f,d,x,M),compressionMethod:M,uncompressedSize:I,lastModDate:X<O?O:X>F?F:X,rawLastModDate:a,rawFilename:r,pe:U,he:D,extraFieldLength:Y}),tt=us(z+_s(r)+Y),et=tt.Wt,rt=Ot(et);return tt.Ve(n),tt.Ge(J),tt.Ge(r),j&&tt.Ge(_),tt.Ge(W),tt.Ge(Z),tt.Ge(L),tt.Ge(H),tt.Ge(p),tt.Ge(y),d&&(U||Ms(rt,18,0),D||Ms(rt,22,0)),{De:et,_e:rt,de:J,we:Q,lastModDate:o,rawLastModDate:$,encrypted:x,compressed:N,version:C,compressionMethod:M,Me:V,ye:v,Ce:q,Ee:Z,Se:L,ge:H,be:W,extraFieldLength:Y}}function as(t,e){const{Oe:r}=t;let{De:n,extraFieldLength:o}=r,a=64-(e+_s(n))%64;a<4&&(a+=64);const i=new Uint8Array(a),s=Ot(i);Cs(s,0,y),Cs(s,2,a-4);const c=n;r.De=n=new Uint8Array(_s(c)+a),Ns(n,c),Ns(n,i,_s(c));const u=Ot(n);Cs(u,28,o+a),r._e=u,t.ke+=a}function is(t){const e=new Uint8Array(4);Ot(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function ss({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,o=v,i=0,s=t?20:12;return r&&(s+=4),e&&(o=new Uint8Array(s),n=Ot(o),r&&(i=4,Ms(n,0,a))),{ze:o,ve:n,Ne:i}}function cs(r){let n=0;for(const[,o]of r){const{rawFilename:r,be:a,rawComment:i,Se:s,ge:c,rawExtraField:u,Ae:l,extendedTimestamp:d,Me:w,lastModDate:p,he:h,pe:y,uncompressedSize:b,compressedSize:E}=o,S=o.offset>=t,g=o.diskNumberStart>=e;let A,R;if(S||g||h||y){const t=4+(h?8:0)+(y?8:0)+(S?8:0)+(g?4:0),e=us(t);e.He(1),e.He(t-4),h&&e.Xe(b),y&&e.Xe(E),S&&e.Xe(o.offset),g&&e.Ve(o.diskNumberStart),A=e.Wt}else A=v;o.ye=A,o.Ze=S,o.me=g;const x=Rs(p);if(d&&xs(x)){const t=us(9);t.He(m),t.He(5),t.rr(w),t.Ve(x),R=t.Wt}else R=v;o.Ee=R;const D=_s(A,a,s,c,R,u,l);if(D>e)throw new Error(Ri);n+=f+_s(r,i)+D}return n}function us(t){const e=new Uint8Array(t),r=Ot(e);let n=0;return{Wt:e,rr:t=>{!function(t,e,r){t.setUint8(e,r)}(r,n,t),n+=1},He:t=>{Cs(r,n,t),n+=2},Ve:t=>{Ms(r,n,t),n+=4},Xe:t=>{vs(r,n,BigInt(t)),n+=8},Ge:t=>{Ns(e,t,n),n+=_s(t)},nr:t=>n+=t}}function ls(t){const{diskNumber:e=0}=t;return e}function fs(t){const{diskOffset:e=0}=t;return e}function ds(t,e){const{availableSize:r=U}=t;return e>r}function ws(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.ne:0)}function ps(t){const e=Ot(t);let r=0;for(;r+4<=_s(t);){const n=4+ks(e,r+2);if(1==ks(e,r))return ps(zt(t.subarray(0,r),t.subarray(Math.min(r+n,_s(t)))));r+=n}return t}async function hs(t,e,r,n){if(n>0){const{writer:o}=t;let a=0;try{await gs(no(e,{offset:r,size:n}),o,T,t=>a+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=a,t.offset+=a}}}async function ms(t,e){const r=await ro(t,e,z);if(_s(r)<z)return z;const n=Ot(r);return z+ks(n,26)+ks(n,28)}function ys(t,{offset:e,diskNumberStart:r}){return e+(t.Gt?t.Gt(r):0)}function bs(){const t=new Uint8Array(4);return Ms(Ot(t),0,o),t}async function Es(t,e){delete t.te,await Ss(e,bs()),t.offset+=4}async function Ss(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=_s(e),await n.write(e)}finally{n.releaseLock()}}async function gs(t,e,r,n){const o=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){await o.ready,await o.write(t),n(_s(t))}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{o.releaseLock()}}function As(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<zi?zi:e>Fi?Fi:e}}function Rs(t){return Math.floor(t.getTime()/1e3)}function xs(t){return t>=xi&&t<=Di}function Ds(t){return Math.min(Di,Math.max(xi,t))}function zs(t,e,r,n){const o=e[r]===T?t.options[r]:e[r];return o===T?n:o}function Fs(t,e,r,n){const o=zs(t,e,r,n);if(null===o)return n;if(o!==T&&(typeof o.getTime!=k||Number.isNaN(o.getTime())))throw new Error(pi);return o}function Os(t,e,r){return nt(zs(t,e,r))}function Ts(t,e,r,n){return ct(zs(t,e,r,n))}function Us(t){return t+5*(Math.floor(t/16383)+1)}function Is(t,e){return t===T?e===T||e>0:0!==t}function ks(t,e){return t.getUint16(e,!0)}function Cs(t,e,r){t.setUint16(e,r,!0)}function Ms(t,e,r){t.setUint32(e,r,!0)}function vs(t,e,r){t.setBigUint64(e,r,!0)}function Ns(t,e,r){t.set(e,r)}function _s(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Bs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:o,compressedSize:a,lastModDate:i,rawLastModDate:s,rawFilename:c,pe:u,he:l,extraFieldLength:f}){const d=us(26),w=d.Wt,p=Ot(w);if(d.He(e),d.He(r),d.He(n),s===T){const t=new Uint32Array(1),e=Ot(t);Cs(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Cs(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.Ve(s),d.nr(4),u||a!==T?d.Ve(u?t:a):d.nr(4),l||o!==T?d.Ve(l?t:o):d.nr(4),d.He(_s(c)),d.He(f),{de:w,we:p,rawLastModDate:s}}function Ps(t,e,r,n,o){let a=0;return e&&(a|=S),r&&(a|=8),8!=o&&9!=o||(t>=0&&t<=3&&(a|=6),t>3&&t<=5&&(a|=4),9==t&&(a|=2)),n&&(a|=1),a}function js(){return"application/octet-stream"}function Ws(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:r,DecompressionStreamFallback:n}=yt(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Ls(r,Qe)||Ls(t,Qe)||Ls(t,tr),decompression:Ls(n,Qe)||Ls(e,Qe)||Ls(e,tr),registered:!1},{compressionMethod:9,compression:!1,decompression:Ls(n,$e)||Ls(e,$e),registered:!1}];for(const t of Ge()){const e=Ke(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==k:T,decompression:e?typeof e.DecompressionStream==k:T,registered:!0})}return o}function Ls(t,e){if(!t)return!1;const{ar:r}=t;return r?r.includes(e):ir(t,e)}const Zs="2.11.2",Vs=1048576,Hs=".zip.js-temp";function Gs(t={}){const{thresholdBytes:e=Vs,directoryName:r=Hs,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let o;function a(){return o||(o=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),o}return function(){const t=[];let r,n,o,i,s=0,c=!1;const u=new WritableStream({async write(i){c?await o.write(i):(t.push(i),s+=i.length,s>e&&await async function(){const e=await a();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""),n=await e.getFileHandle(r,{create:!0}),o=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await o.write(e);t.length=0}())},async close(){o&&(await o.close(),o=null)}});let l=0;return{writable:u,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else l<t.length?e.enqueue(t[l++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(o){try{await o.close()}catch{}o=null}if(r){try{const t=await a();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const Ks=1048576;function qs(t={}){const{thresholdBytes:e=Ks}=t;return function(){const t=[];let r,n,o,a=0,i=!1;const s=new WritableStream({async write(o){i?await r.write(o):(t.push(o),a+=o.length,a>e&&await async function(){const e=new TransformStream;n=Me(e.readable),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0}())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:s,readable:new ReadableStream({async pull(e){if(i){if(!o){const t=await n;o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const Ys=1048576,Xs=".zip.js-temp",Js="createSyncAccessHandle is only available in dedicated workers";function Qs(t={}){const{thresholdBytes:e=Ys,directoryName:r=Xs,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new Error(Js);const o=n||(()=>navigator.storage.getDirectory());let a;function i(){return a||(a=Promise.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,n,o=0,a=!1,s=0,c=0;const u=new WritableStream({async write(c){a?(n.write(c,{at:s}),s+=c.length):(t.push(c),o+=c.length,o>e&&await async function(){const e=await i();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("");const o=await e.getFileHandle(r,{create:!0});n=await o.createSyncAccessHandle(),a=!0;for(const e of t)n.write(e,{at:s}),s+=e.length;t.length=0}())},close(){n&&n.flush()}});let l=0;return{writable:u,readable:new ReadableStream({pull(e){if(a){const t=s-c;if(t<=0)return void e.close();const r=new Uint8Array(Math.min(524288,t)),o=n.read(r,{at:c});o?(c+=o,e.enqueue(r.subarray(0,o))):e.close()}else l<t.length?e.enqueue(t[l++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{xt({baseURI:import.meta.url})}catch{}const $s="deflate",tc="deflate-raw",ec="deflate64-raw",rc="gzip";let nc,oc,ac,ic,sc;function cc(t,e,r={}){if(!nc){const t=new Error("WASM module not loaded");throw t.cause=sc,t}const n="number"==typeof r.level?r.level:-1,o="number"==typeof r.outBuffer?r.outBuffer:65536,a="number"==typeof r.inBufferSize?r.inBufferSize:65536;return new TransformStream({start(){try{let r;if(this.ir=oc(o),this.in=oc(a),this.inBufferSize=a,!this.ir||!this.in)throw new Error("allocation failed");if(this.sr=new Uint8Array(o),t?(this.cr=nc.deflate_process,this.ur=nc.deflate_last_consumed,this.lr=nc.deflate_end,this.dr=nc.deflate_new(),r=e===rc?nc.deflate_init_gzip(this.dr,n):e===tc?nc.deflate_init_raw(this.dr,n):nc.deflate_init(this.dr,n)):e===ec?(this.cr=nc.inflate9_process,this.ur=nc.inflate9_last_consumed,this.lr=nc.inflate9_end,this.dr=nc.inflate9_new(),r=nc.inflate9_init_raw(this.dr)):(this.cr=nc.inflate_process,this.ur=nc.inflate_last_consumed,this.lr=nc.inflate_end,this.dr=nc.inflate_new(),r=e===tc?nc.inflate_init_raw(this.dr):e===rc?nc.inflate_init_gzip(this.dr):nc.inflate_init(this.dr)),0!==r)throw new Error("init failed:"+r)}catch(t){throw i(this),t}},transform(t,e){try{const r=t,n=new Uint8Array(ic.buffer),a=this.cr,i=this.ur,s=this.ir,c=this.sr;let u=0;for(;u<r.length;){const t=Math.min(r.length-u,32768);if((!this.in||this.inBufferSize<t)&&(this.in&&ac&&(ac(this.in),this.in=0),this.in=oc(t),this.inBufferSize=t,!this.in))throw new Error("allocation failed");n.set(r.subarray(u,u+t),this.in);const l=a(this.dr,this.in,t,s,o,0),f=l>>24&255,d=128&f?f-256:f;if(d<0)throw new Error("process error:"+d);const w=16777215&l;w&&(c.set(n.subarray(s,s+w),0),e.enqueue(c.slice(0,w)));const p=i(this.dr);if(0===p&&0===w)break;u+=p}}catch(t){i(this),e.error(t)}},flush(t){try{const e=new Uint8Array(ic.buffer),r=this.cr,n=this.ir,a=this.sr;for(;;){const i=r(this.dr,0,0,n,o,4),s=i>>24&255,c=128&s?s-256:s;if(c<0)throw new Error("process error:"+c);const u=16777215&i;if(u&&(a.set(e.subarray(n,n+u),0),t.enqueue(a.slice(0,u))),1===s||0===u)break}}catch(e){t.error(e)}finally{const e=i(this);0!==e&&t.error(new Error("end error:"+e))}},cancel(){i(this)}});function i(t){let e=0;return t.dr&&t.lr&&(e=t.lr(t.dr)),t.dr=0,t.in&&ac&&ac(t.in),t.in=0,t.ir&&ac&&ac(t.ir),t.ir=0,e}}class uc{constructor(t=$s,e){return cc(!0,t,e)}}class lc{constructor(t=$s,e){return cc(!1,t,e)}}uc.lt=!0,lc.lt=!0,uc.ar=[$s,tc,rc],lc.ar=[$s,tc,rc,ec];let fc,dc=!1;function wc(){fc=null,async function(){await Promise.allSettled(Zr.map(t=>($r(t),t.terminate()))),Er=T,Sr=!1}(),dc=!1,nc=oc=ac=ic=sc=null}!function({wr:t}){Ar=t}({wr:t=>{if(!fc){let{wasmURI:e}=t;typeof e==k&&(e=e()),fc=async function(t,{baseURI:e}){if(!dc)try{await async function(t,e){let r,n;try{try{n=new URL(t,e)}catch{}const o=await fetch(n);r=await o.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=function(t){const e=t.split(",")[1],r=atob(e),n=r.length,o=new Uint8Array(n);for(let t=0;t<n;++t)o[t]=r.charCodeAt(t);return o.buffer}(t)}!function(t){if(nc=t,({malloc:oc,free:ac,memory:ic}=nc),"function"!=typeof oc||"function"!=typeof ac||!ic)throw nc=oc=ac=ic=null,new Error("Invalid WASM module")}((await WebAssembly.instantiate(r)).instance.exports)}(t,e),dc=!0}catch(t){throw function(t){sc=t}(t),t}}(e,t).catch(t=>{throw fc=null,t})}return fc}}),xt({CompressionStreamFallback:uc,DecompressionStreamFallback:lc}),xt({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const pc="Entry filename already exists",hc="Duplicate entry filename in the imported zip file",mc='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',yc="Entry is a ancestor of target entry",bc="Readable stream already consumed",Ec="throw",Sc="keep-first",gc="keep-last",Ac=new Set([Ec,Sc,gc]),Rc="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",xc="Invalid readerOptions (must be an object)",Dc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",zc="zipjs-abort-export",Fc="The operation was aborted",Oc=new Set([1,h,10,m,28789,25461,y,b,E,22613,13]);class Tc{constructor(t,e,r,n){const o=this;if(t.root&&n&&n.getChildByName(e))throw new Error(pc);r||(r={}),Object.assign(o,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.pr++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,mr:r.mr||r.uncompressedSize===T,passThrough:r.passThrough,yr:r.yr||new Date}),!n&&t.root||(t.entries[o.id]=o),n&&o.parent.children.push(o)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let r=e.parent;if(r){const n=ru(t);n&&(t=n.pop(),r=nu(r,n,e));const o=r.getChildByName(t);if(o&&o!=e)throw new Error(pc);r!=e.parent&&(Wc(e),e.parent=r,r.children.push(e),tu(e.fs,e))}e.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==T))}}class Uc extends Tc{constructor(t,e,r,n){super(t,e,r,n);const o=this;o.Reader=r.Reader,o.Writer=r.Writer,r.getData&&(o.getData=r.getData)}clone(){return new Uc(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data&&function(t,e){const{contentType:r}=t;return r===T||(t.constructor==xn?e.type==r:t.constructor!=Sn||e.startsWith("data:"+(r||"")+";base64,"))}(t,r.data))return r.data;{const n=r.reader=Pc(r.Reader,r.data,e),o=r.uncompressedSize||n.size;await Promise.all([to(n),to(t,o)]);const a=ot(e.signal),i=function(t,e,r,n){const{onstart:o,onprogress:a,onend:i}=r,{readable:s}=e;return t.data instanceof Po||!o&&!a&&!i?s:Ce(s).pipeThrough(new zr({onstart:o,onprogress:a,onend:i,size:e.size}),{signal:n})}(r,n,e,a),s=!$n(t)&&Boolean(e.preventClose);return r.uncompressedSize=n.size,await Ce(i).pipeTo(ve(t.writable),{signal:a,preventClose:s,preventAbort:s}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Gt)return!1;throw t}}getText(t,e){return this.getData(new Fn(t),e)}getBlob(t,e){return this.getData(new xn(t),e)}getData64URI(t,e){return this.getData(new Sn(t),e)}getUint8Array(t){return this.getData(new qn,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Ft(await this.getUint8Array(t)).buffer}replaceBlob(t){Gc(this,{data:t,Reader:Rn,Writer:xn,uncompressedSize:t.size})}replaceText(t){Gc(this,{data:t,Reader:Dn,Writer:Fn,uncompressedSize:zn(t)})}replaceData64URI(t){Gc(this,{data:t,Reader:En,Writer:Sn,uncompressedSize:Kc(t)})}replaceUint8Array(t){Gc(this,{data:t,Reader:Kn,Writer:qn,uncompressedSize:t.length})}replaceReadable(t){Gc(this,{data:null,Reader:_c(t),Writer:null,uncompressedSize:T})}}class Ic extends Tc{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new Ic(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return eu(this,t,{options:e},!0)}addText(t,e,r={}){return eu(this,t,{data:e,Reader:Dn,Writer:Fn,options:r,uncompressedSize:zn(e)})}addBlob(t,e,r={}){return eu(this,t,{data:e,Reader:Rn,Writer:xn,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){return eu(this,t,{data:e,Reader:En,Writer:Sn,options:r,uncompressedSize:Kc(e)})}addUint8Array(t,e,r={}){return eu(this,t,{data:e,Reader:Kn,Writer:qn,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return eu(this,t,{data:e,Reader:class extends Hn{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return eu(this,t,{Reader:_c(e),options:r})}addFileSystemEntry(t,e={}){return Xc(this,t,e)}addFileSystemHandle(t,e={}){return Xc(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),eu(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new Rn(t),e)}importData64URI(t,e){return this.importZip(new En(t),e)}importUint8Array(t,e){return this.importZip(new Kn(t),e)}importHttpContent(t,e){return this.importZip(new Hn(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new xn(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Sn(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new qn,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:n,onprogress:o,onend:a}=r,i=Hc(r.readerOptions),s=new AbortController,{signal:c}=s,u=function(t,e){if(!ot(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}(r.signal,s),l=Object.assign({},r,i,{signal:c,onstart:T,onprogress:T,onend:T,preventClose:!1}),f=Mc([t],t=>Nc(t,l.passThrough)),d=[];let w=!1,p=0;try{n&&await Fr(n,f),await m(t,e),a&&await Fr(a,p)}catch(t){try{t.exportedEntryNames=d}catch{}throw t}finally{u()}return e;function h(t){const e=t.getWriter();return new WritableStream({async write(t){await e.write(t),p+=t.length,o&&await Fr(o,p,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function m(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>y(t,e)))).filter(t=>"rejected"==t.status);if(r.length){const t=r.filter(t=>!Lc(t.reason));throw function(t){const[e]=t,r=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(r.length)try{e.entryErrors=[...e.entryErrors||[],...r]}catch{}return e}((t.length?t:r).map(t=>t.reason))}}else for(const r of t.children)await y(r,e)}async function y(e,r){if(c.aborted){if(w||Lc(c.reason))return;throw c.reason===T?new DOMException(Fc,"AbortError"):c.reason}try{if(e.directory){const t=await r.getDirectoryHandle(e.name,{create:!0});await m(e,t)}else{const n=await r.getFileHandle(e.name,{create:!0}),o=await n.createWritable();try{await e.getData({writable:h(o)},l)}catch(t){throw w?new Error(zc):t}d.push(e.getRelativeName(t))}}catch(r){w=!0,s.abort(new Error(zc));try{r.entryName===T&&(r.entryName=e.getRelativeName(t),r.entryId=e.id)}catch{}throw r}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==k?(r=t,e=Object.assign({},r.options,e)):(await to(t),r=new Da(t,e));const n=function(t){if(t===T)return Ec;if(Ac.has(t))return t;throw new Error(mc)}(e.duplicates),o=[],a=await r.getEntries(e);for(const t of a){let r=this;try{const a=t.filename.split("/").filter(t=>""!=t&&"."!=t),i=a.pop();let s=!1;for(const t of a){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(n==Sc){s=!0;break}if(n!=gc)throw new Error(hc);this.fs.remove(r),r=new Ic(this.fs,t,{data:null},e),o.push(r)}}else r=new Ic(this.fs,t,{data:null},e),o.push(r)}if(s)continue;if(t.directory){let e=r;if(i){if(e=r.getChildByName(i),e&&!e.directory){if(n==Sc)continue;if(n!=gc)throw new Error(hc);this.fs.remove(e),e=T}e||(e=new Ic(this.fs,i,{data:null},r),o.push(e))}e==this||e.data||(e.data=t)}else{const a=r.getChildByName(i);if(a){if(n==Sc)continue;if(n!=gc)throw new Error(hc);this.fs.remove(a)}o.push(eu(r,i,{data:t,Reader:Bc(Object.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){o.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return o}async exportZip(t,e={}){const r=this;(e=Object.assign({},e)).bufferedWrite===T&&(e.bufferedWrite=!0);const[n]=await Promise.all([jc(r,Hc(e.readerOptions)),to(t)]),o=new qi(t,e);return await async function(t,e,r,n,o){const{onstart:a,onprogress:i,onend:s,onentryprogress:c}=n,u=e,l=Mc(e.children,t=>Yc(t)?0:1);let f=0,d=0;if(a&&await Fr(a,r),n.bufferedWrite)await async function t(e){const r=(await Promise.allSettled(e.children.map(async e=>{await w(e),await t(e)}))).find(t=>"rejected"==t.status);if(r)throw r.reason}(e);else for(const t of e.getChildren({recursive:!0}))await w(t);async function w(e){if(Yc(e))return;const{name:a,Er:s}=Zc(e,u,n);let w=0;const p=await t.add(a,o.get(e),Object.assign(s,{onstart:T,onend:T,onprogress:async t=>{f+=t-w,w=t,i&&await Fr(i,f,r)}}));d++,c&&await Fr(c,d,l,p)}s&&await Fr(s,f)}(o,r,Mc([r],vc),e,n),await o.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(r={}){const n=this;Hc((r=Object.assign({},r)).readerOptions),r.bufferedWrite===T&&(r.bufferedWrite=!0);const o=n.getChildren({recursive:!0}).filter(t=>!Yc(t)).map(t=>{const{name:e,Er:o}=Zc(t,n,r);return{name:e,size:t.directory?0:Vc(t,qc(t,r)),options:o}}),a=!r.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&n.children.every(t=>!t.children.length);return async function(r,n,o,a){const i={options:r};if(nt(r[q]))throw new Error(Ii);if(a!==T&&!(a instanceof Uint8Array))throw new Error(fi);const s=_s(a);if(s>e)throw new Error(li);const c=r[G],u=new Map,l=r[H]===T?0:r[H];let f=l,w=U;for(const t of n){let{name:e}=t;const{size:r}=t,n=Object.assign({},t.options);zs(i,n,To)&&!e.endsWith(D)&&(e+=D);const o=ts(i,e,n);({name:e}=o);const{Re:a}=es(i,e,n);0==a.level||a.compressionMethod!==T||a.passThrough||await Rr(yt())||(a.level=0);const s=!zs(i,n,To);if(s&&r===T)throw new Error(Ii);const{er:l,Re:d}=ns(i,s,r,a,n);if(s&&!a.passThrough&&Is(d.compressionMethod,d.level))throw new Error(Ii);const p=Object.assign({},n,o.Re,a,d,{[G]:c}),h=os(p),m=ss(p),y={Oe:h,ke:_s(h.De,m.ze)};c&&as(y,f);const b=s?l:0;u.set(e,Object.assign({},p,h,{offset:f,diskNumberStart:0,compressedSize:b}));const E=y.ke+b;w=Math.min(w,E),f+=E}if(u.size>1&&(c||f-w>=t)&&!o)throw new Error(Ii);const p=cs(u);let h=zs(i,r,xo);if(f>=t||p>=t||u.size>=e){if(!1===h)throw new Error(Oi);h=!0}return f-l+p+s+(h?98:d)}(r,o,a,r.globalComment)}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}getChildren(t={}){return function(t,e){const r=[],n=[t];let o=0;for(;o<n.length;)for(const t of n[o++].children)r.push(t),e&&n.push(t);return r}(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 r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}class kc{constructor(){Qc(this)}get children(){return this.root.children}remove(t){Wc(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=T}move(t,e){if(t==this.root)throw new Error("Root directory cannot be moved");if(!e.directory)throw new Error("Target entry is not a directory");if(e.isDescendantOf(t))throw new Error(yc);if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw new Error(pc)}else Wc(t),t.parent=e,e.children.push(t),tu(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.directory?r.getChildByName(e[t]):T;return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}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,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}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 $c(this,r=>r.importBlob(t,e))}importData64URI(t,e){return $c(this,r=>r.importData64URI(t,e))}importUint8Array(t,e){return $c(this,r=>r.importUint8Array(t,e))}importHttpContent(t,e){return $c(this,r=>r.importHttpContent(t,e))}importReadable(t,e){return $c(this,r=>r.importReadable(t,e))}importZip(t,e){return $c(this,r=>r.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 Cc={FS:kc,ZipDirectoryEntry:Ic,ZipFileEntry:Uc};function Mc(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=e(t)||0;for(const e of t.children)n.push(e)}return r}function vc(t){return t.uncompressedSize}function Nc(t,e){const{data:r}=t;return e&&r instanceof Po?r.compressedSize:t.uncompressedSize}function _c(t){let e;return function(){if(e)throw new Error(bc);return e=!0,{readable:t}}}function Bc(t){return class extends yn{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=Object.assign({},t,e.options),{checkOverlappingEntry:n,checkOverlappingEntryOnly:o}=r,a=await e.entry.getData(new xn,Object.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:o||n,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=a,e.Sr=new Rn(a),e.size=a.size,super.init()}readUint8Array(t,e){return this.Sr.readUint8Array(t,e)}}}function Pc(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function jc(t,e){const r=[],n=[t],o=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async t=>{const r=t.reader=Pc(t.Reader,t.data,e);o.set(t,r);try{await to(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==T&&(t.uncompressedSize=r.size,t.mr=!1)})),o}function Wc(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function Lc(t){return Boolean(t)&&t.message==zc}function Zc(t,e,n){const o=n.relativePath?t.getRelativeName(e):t.getFullname(),a=t.options||{};let i={},s={};if(t.data instanceof Po){const{externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,rawLastModDate:l,creationDate:f,lastAccessDate:d,uncompressedSize:w,encrypted:p,zipCrypto:h,crc32:m,compressionMethod:y,extraFieldAES:b,internalFileAttributes:E,extraField:S,bitFlag:g,uid:A,gid:R}=t.data;i={externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,creationDate:f,lastAccessDate:d,internalFileAttributes:E};const x=function(t){if(t){const e=new Map;if(t.forEach((t,r)=>{Oc.has(r)||e.set(r,t.data)}),e.size)return e}}(S);if(x&&(i.extraField=x),A===T&&R===T||Object.assign(i,{uid:A,gid:R,unixExtraFieldType:"infozip"}),qc(t,n)){let t;b&&(t=b.strength),s={passThrough:!0,encrypted:p,zipCrypto:h,crc32:m,uncompressedSize:w,encryptionStrength:t,compressionMethod:y},g&&(s.dataDescriptor=g.dataDescriptor);const e=a.lastModDate===T?n.lastModDate:a.lastModDate;if(e===T)s.rawLastModDate=l;else if(h&&(!g||g.dataDescriptor)&&e instanceof Date&&function(t){let e=new Date(2e3*Math.ceil(Math.floor(t.getTime()/1e3)/2));return e<O?e=O:e>F&&(e=F),(e.getHours()<<3|e.getMinutes()>>3)&r}(e)!=(l>>>8&r))throw new Error(Dc)}}const c=Object.assign({lastModDate:t.yr},i,n,a,s,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===T)throw new Error(Rc);return{name:o,Er:c}}function Vc(t,e){const{reader:r}=t;return r&&r.size!==T?r.size:t.mr?T:Nc(t,e)}function Hc(t){if(t&&(typeof t!=C||Array.isArray(t)))throw new Error(xc);return t}function Gc(t,e){const{uncompressedSize:r}=e;Object.assign(t,e,{reader:null,passThrough:T,uncompressedSize:r===T?0:r,mr:r===T})}function Kc(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;return Math.floor(.75*(e-r))}function qc(t,e){const{readerOptions:r}=e;return Boolean(!t.directory&&(t.passThrough||r&&r.passThrough))}function Yc(t){return t.directory&&null===t.data}function Xc(t,e,r){return async function t(e,n,o,a=""){if(n){const i=a?a+"/"+n.name:n.name;try{if((n.isFile||n.isDirectory)&&(n=await Jc(n)),"file"==n.kind){const t=await n.getFile();o.push(eu(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const a=e.addDirectory(n.name,r);o.push(a);for await(const e of n.values())await t(a,e,o,i)}}catch(t){try{t.entryName===T&&(t.entryName=i)}catch{}throw t}}return o}(t,e,[])}async function Jc(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await async function(t){const e=[];function r(t,n,o){t.readEntries(async a=>{if(a.length){for(const t of a)e.push(await Jc(t));r(t,n,o)}else n(e)},o)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}}(t);e.values=()=>r}return e}function Qc(t){t.entries=[],t.pr=0,t.root=new Ic(t)}function $c(t,e){const{entries:r,pr:n,root:o}=t;return Qc(t),e(t.root).catch(e=>{throw Object.assign(t,{entries:r,pr:n,root:o}),e})}function tu(t,e){const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}}function eu(t,e,r,n){if(t.directory){const o=ru(e);return o&&(e=o.pop(),t=nu(t,o)),n?new Ic(t.fs,e,r,t):new Uc(t.fs,e,r,t)}throw new Error("Parent entry is not a directory")}function ru(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function nu(t,e,r){return e.forEach(e=>{const n=t;if(t=t.getChildByName(e)){if(!t.directory)throw new Error(pc);if(r&&(t==r||t.isDescendantOf(r)))throw new Error(yc)}else t=new Ic(n.fs,e,{data:null},n)}),t}export{Rn as BlobReader,xn as BlobWriter,En as Data64URIReader,Sn as Data64URIWriter,Fc as ERR_ABORTED,Jo as ERR_AMBIGUOUS_ARCHIVE,jo as ERR_BAD_FORMAT,Zo as ERR_CENTRAL_DIRECTORY_NOT_FOUND,ui as ERR_DUPLICATED_NAME,hc as ERR_DUPLICATE_IMPORTED_ENTRY,Go as ERR_ENCRYPTED,Qo as ERR_ENCRYPTED_CENTRAL_DIRECTORY,Xo as ERR_ENTRY_DATA_OUT_OF_BOUNDS,pc as ERR_ENTRY_EXISTS,Lo as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Wo as ERR_EOCDR_NOT_FOUND,Ho as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,on as ERR_HTTP_RANGE,an as ERR_HTTP_RESOURCE_CHANGED,Kt as ERR_INVALID_AUTHENTICATION_CODE,Ne as ERR_INVALID_CODEC_DEFINITION,Be as ERR_INVALID_CODEC_MODULE,li as ERR_INVALID_COMMENT,fi as ERR_INVALID_COMMENT_TYPE,Xe as ERR_INVALID_COMPRESSED_DATA,Je as ERR_INVALID_CRC32,pi as ERR_INVALID_DATE,mc as ERR_INVALID_DUPLICATES,yi as ERR_INVALID_ENCRYPTION_STRENGTH,di as ERR_INVALID_ENTRY_COMMENT,wi as ERR_INVALID_ENTRY_COMMENT_TYPE,hi as ERR_INVALID_ENTRY_NAME,Si as ERR_INVALID_EXTRAFIELD,Ri as ERR_INVALID_EXTRAFIELD_DATA,Ai as ERR_INVALID_EXTRAFIELD_DATA_TYPE,gi as ERR_INVALID_EXTRAFIELD_TYPE,ea as ERR_INVALID_FILENAME_VALIDATION,tt as ERR_INVALID_FUNCTION_OPTION,vi as ERR_INVALID_GID,Wi as ERR_INVALID_LEVEL,ra as ERR_INVALID_MAX_APPENDED_DATA_SIZE,ut as ERR_INVALID_MAX_WORKERS,Pi as ERR_INVALID_MSDOS_ATTRIBUTES,ji as ERR_INVALID_MSDOS_DATA,Gt as ERR_INVALID_PASSWORD,rt as ERR_INVALID_PASSWORD_TYPE,Rc as ERR_INVALID_PASS_THROUGH,xc as ERR_INVALID_READER_OPTIONS,et as ERR_INVALID_SIGNAL,Li as ERR_INVALID_SIGNATURE_DATA,ta as ERR_INVALID_STRICTNESS,Mi as ERR_INVALID_UID,Ye as ERR_INVALID_UNCOMPRESSED_SIZE,_i as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,Bi as ERR_INVALID_UNIX_ID_SIZE,Ni as ERR_INVALID_UNIX_MODE,mi as ERR_INVALID_VERSION,sn as ERR_ITERATOR_COMPLETED_TOO_SOON,Vo as ERR_LOCAL_FILE_HEADER_NOT_FOUND,Yo as ERR_OVERLAPPING_ENTRY,bc as ERR_READABLE_CONSUMED,_e as ERR_RESERVED_COMPRESSION_METHOD,qo as ERR_SPLIT_ZIP_FILE,Ui as ERR_UNDEFINED_COMPRESSION_METHOD,ki as ERR_UNDEFINED_READER,Ti as ERR_UNDEFINED_UNCOMPRESSED_SIZE,Ii as ERR_UNDETERMINED_SIZE,$o as ERR_UNSAFE_FILENAME,Pe as ERR_UNSUPPORTED_COMPRESSION,Js as ERR_UNSUPPORTED_CONTEXT,Yt as ERR_UNSUPPORTED_CRYPTO_API,Ko as ERR_UNSUPPORTED_ENCRYPTION,Ei as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,bi as ERR_UNSUPPORTED_ENCRYPTION_USDZ,Oi as ERR_UNSUPPORTED_FORMAT,na as ERR_UNSUPPORTED_UINT64,br as ERR_WORKER_STARTUP_TIMEOUT,cn as ERR_WRITER_NOT_INITIALIZED,Dc as ERR_ZIP_CRYPTO_LAST_MOD_DATE,Ci as ERR_ZIP_NOT_EMPTY,Gn as HttpRangeReader,Hn as HttpReader,yn as Reader,Yn as SplitDataReader,Xn as SplitDataWriter,Dn as TextReader,Fn as TextWriter,Kn as Uint8ArrayReader,qn as Uint8ArrayWriter,Zs as VERSION,la as WARNING_APPENDED_DATA,ia as WARNING_COMPRESSED_PATCHED_DATA,pa as WARNING_DUPLICATE_FILENAME,sa as WARNING_MALFORMED_EXTRA_FIELD,ma as WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,ya as WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,ba as WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,ha as WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,da as WARNING_PREPENDED_CENTRAL_DIRECTORY,fa as WARNING_PREPENDED_DATA,wa as WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,aa as WARNING_UNKNOWN_VERSION,ca as WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA,oa as WARNING_UNSORTED_CENTRAL_DIRECTORY,ua as WARNING_WRAPPED_ENTRIES_COUNT,bn as Writer,Ic as ZipDirectoryEntry,Tc as ZipEntry,kc as ZipFS,Uc as ZipFileEntry,Da as ZipReader,za as ZipReaderStream,qi as ZipWriter,Yi as ZipWriterStream,St as configure,qs as createBlobTempStream,Gs as createOPFSTempStream,Qs as createSyncAccessHandleTempStream,Cc as fs,js as getMimeType,Ge as getRegisteredCodecs,Ws as getSupportedCompressionMethods,Fa as isZipFile,Ze as registerCodec,Dt as resetConfiguration,wc as terminateWorkers,Ve as unregisterCodec};
|
|
1
|
+
const t=4294967295,e=65535,r=255,n=67324752,o=134695760,a=o,i=84233040,s=33639248,c=101010256,u=101075792,l=117853008,f=46,d=22,w=20,p=56,h=39169,m=21589,y=6534,b=30837,E=30805,S=2048,g=61440,A=16384,R=2048,z=1024,D="/",x=30,F=new Date(2107,11,31,23,59,58),O=new Date(1980,0,1),T=void 0,U=1/0,I="undefined",k="function",C="object",M="string",v=new Uint8Array,N="password",_="rawPassword",B="passThrough",j="signal",P="useWebWorkers",L="useCompressionStream",W="transferStreams",Z="preventClose",V="dataDescriptor",H="offset",G="usdz",K="maxAppendedDataSize",q="signCentralDirectory",Y="filename",X="comment",J="strict",Q="balanced",$="tolerant",tt="Invalid option (must be a function)",et="Invalid signal (must be an AbortSignal instance)",rt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",nt="The operation was aborted",ot="AbortError";function at(t){if(t&&typeof t!=k)throw new Error(tt);return t}function it(t){if(t&&(typeof t.addEventListener!=k||"boolean"!=typeof t.aborted))throw new Error(et);return t||T}function st(t){if(t&&t.aborted)throw t.reason===T?new DOMException(nt,ot):t.reason}function ct(t,e){if(t&&typeof t!=M||e&&!(e instanceof Uint8Array))throw new Error(rt)}function ut(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw new Error(r)}function lt(t,e,r){t!==T&&ut(t,e,r)}function ft(t){return typeof t==M&&t.trim()?Number(t):t}const dt="Invalid maxWorkers (must be an integer greater than 0)";let wt=2;try{typeof navigator!=I&&navigator.hardwareConcurrency&&(wt=navigator.hardwareConcurrency)}catch{}const pt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:wt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=I&&CompressionStream,DecompressionStream:typeof DecompressionStream!=I&&DecompressionStream},ht="maxWorkers",mt=["chunkSize",ht,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],yt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],bt=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...mt,...yt],Et={...pt};function St(){return Et}function gt(t){return At(t.chunkSize)}function At(t){return t=ft(t),Number.isInteger(t)&&t>=1?Math.max(t,64):65536}function Rt(t){Object.assign(Et,zt(xt(t)))}function zt(t){const e={};for(const r of bt){const n=t[r];n!==T&&(e[r]=Dt(r,n))}return e}function Dt(t,e){if(mt.includes(t)){if(e=ft(e),t==ht&&(!Number.isInteger(e)||e<1))throw new Error(dt)}else yt.includes(t)&&at(e);return e}function xt(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===T&&r===T)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===T&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===T&&(n.DecompressionStreamFallback=r),n}function Ft(t){const e=zt(xt(t));Object.assign(pt,e),Object.assign(Et,e)}function Ot(){for(const t of bt)delete Et[t];Object.assign(Et,pt)}function Tt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function Ut(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function It(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const kt=[[],[],[],[],[],[],[],[]];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;kt[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=kt[e-1][t];kt[e][t]=r>>>8^kt[0][255&r]}const[Ct,Mt,vt,Nt,_t,Bt,jt,Pt]=kt;class Lt{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const o=new DataView(t.buffer,t.byteOffset,r),a=r-8;for(;n<=a;n+=8){const t=e^o.getInt32(n,!0),r=o.getInt32(n+4,!0);e=Pt[255&t]^jt[t>>>8&255]^Bt[t>>>16&255]^_t[t>>>24&255]^Nt[255&r]^vt[r>>>8&255]^Mt[r>>>16&255]^Ct[r>>>24&255]}}for(;n<r;n++)e=e>>>8^Ct[255&(e^t[n])];this.o=e}get(){return~this.o}}class Wt extends TransformStream{constructor(){let t;const e=new Lt;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function Zt(t){if(typeof TextEncoder==I){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}const Vt={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=Vt.l(r);return 32===n?t.concat(e):Vt.h(e,n,0|r,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+Vt.l(r)},m(t,e){if(32*t.length<e)return t;const r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=Vt.S(e,t[r-1]&2147483648>>e-1,1)),t},S:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,h(t,e,r,n){for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(let o=0;o<t.length;o++)n.push(r|t[o]>>>e),r=t[o]<<32-e;const o=t.length?t[t.length-1]:0,a=Vt.l(o);return n.push(Vt.S(e+a&31,e+a>32?r:n.pop(),1)),n}},Ht={bytes:{A(t){const e=Vt.bitLength(t)/8,r=new Uint8Array(e);let n;for(let o=0;o<e;o++)3&o||(n=t[o/4]),r[o]=n>>>24,n<<=8;return r},R(t){const e=[];let r,n=0;for(r=0;r<t.length;r++)n=n<<8|t[r],3&~r||(e.push(n),n=0);return 3&r&&e.push(Vt.S(8*(3&r),n)),e}}},Gt=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.F=[1518500249,1859775393,2400959708,3395469782],t?(e.O=t.O.slice(0),e.T=t.T.slice(0),e.U=t.U):e.reset()}reset(){const t=this;return t.O=t.D.slice(0),t.T=[],t.U=0,t}update(t){const e=this;"string"==typeof t&&(t=Ht.I.R(t));const r=e.T=Vt.concat(e.T,t),n=e.U,o=e.U=n+Vt.bitLength(t);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const a=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);t<=o;t+=e.blockSize)e.C(a.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}M(){const t=this;let e=t.T;const r=t.O;e=Vt.concat(e,[Vt.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.U/4294967296)),e.push(0|t.U);e.length;)t.C(e.splice(0,16));return t.reset(),r}v(t,e,r,n){return t<=19?e&r|~e&n:t<=39?e^r^n:t<=59?e&r|e&n|r&n:t<=79?e^r^n:void 0}N(t,e){return e<<t|e>>>32-t}C(t){const e=this,r=e.O,n=Array(80);for(let e=0;e<16;e++)n[e]=t[e];let o=r[0],a=r[1],i=r[2],s=r[3],c=r[4];for(let t=0;t<=79;t++){t>=16&&(n[t]=e.N(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.N(5,o)+e.v(t,a,i,s)+c+n[t]+e.F[Math.floor(t/20)]|0;c=s,s=i,i=e.N(30,a),a=o,o=r}r[0]=r[0]+o|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0}},Kt={importKey:t=>new Kt._(Ht.bytes.R(t)),B(t,e,r,n){if(r=r||1e4,n<0||r<0)throw new Error("invalid params to pbkdf2");const o=1+(n>>5)<<2;let a,i,s,c,u;const l=new ArrayBuffer(o),f=new DataView(l);let d=0;const w=Vt;for(e=Ht.bytes.R(e),u=1;d<(o||1);u++){for(a=i=t.encrypt(w.concat(e,[u])),s=1;s<r;s++)for(i=t.encrypt(i),c=0;c<i.length;c++)a[c]^=i[c];for(s=0;d<(o||1)&&s<a.length;s++)f.setInt32(d,a[s]),d+=4}return l.slice(0,n/8)},_:class{constructor(t){const e=this,r=e.j=Gt,n=[[],[]];e.P=[new r,new r];const o=e.P[0].blockSize/32;t.length>o&&(t=(new r).update(t).M());for(let e=0;e<o;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e.P[0].update(n[0]),e.P[1].update(n[1]),e.L=new r(e.P[0])}reset(){const t=this;t.L=new t.j(t.P[0]),t.W=!1}update(t){this.W=!0,this.L.update(t)}digest(){const t=this,e=t.L.M(),r=new t.j(t.P[1]).update(e).M();return t.reset(),r}encrypt(t){if(this.W)throw new Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},qt=typeof crypto!=I&&typeof crypto.getRandomValues==k,Yt="Invalid password",Xt="Invalid authentication code",Jt="zipjs-abort-check-password",Qt="Crypto API not supported";function $t(t){if(qt)return crypto.getRandomValues(t);throw new Error(Qt)}const te=16,ee={name:"PBKDF2"},re=Object.assign({hash:{name:"HMAC"}},ee),ne=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},ee),oe=["deriveBits"],ae=[8,12,16],ie=[16,24,32],se=10,ce=[0,0,0,0],ue=typeof crypto!=I,le=ue&&crypto.subtle,fe=ue&&typeof le!=I,de=Ht.bytes,we=class{constructor(t){const e=this;e.Z=[[[],[],[],[],[]],[[],[],[],[],[]]],e.Z[0][0][0]||e.V();const r=e.Z[0][4],n=e.Z[1],o=t.length;let a,i,s,c=1;if(4!==o&&6!==o&&8!==o)throw new Error("invalid aes key size");for(e.F=[i=t.slice(0),s=[]],a=o;a<4*o+28;a++){let t=i[a-1];(a%o===0||8===o&&a%o===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[255&t],a%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),i[a]=i[a-o]^t}for(let t=0;a;t++,a--){const e=i[3&t?a:a-4];s[t]=a<=4||t<4?e:n[0][r[e>>>24]]^n[1][r[e>>16&255]]^n[2][r[e>>8&255]]^n[3][r[255&e]]}}encrypt(t){return this.H(t,0)}decrypt(t){return this.H(t,1)}V(){const t=this.Z[0],e=this.Z[1],r=t[4],n=e[4],o=[],a=[];let i,s,c,u;for(let t=0;t<256;t++)a[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=i=0;!r[l];l^=s||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,r[l]=a,n[a]=l,u=o[c=o[s=o[l]]];let f=16843009*u^65537*c^257*s^16843008*l,d=257*o[a]^16843008*a;for(let r=0;r<4;r++)t[r][l]=d=d<<24^d>>>8,e[r][a]=f=f<<24^f>>>8}for(let r=0;r<5;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}H(t,e){if(4!==t.length)throw new Error("invalid aes block size");const r=this.F[e],n=r.length/4-2,o=[0,0,0,0],a=this.Z[e],i=a[0],s=a[1],c=a[2],u=a[3],l=a[4];let f,d,w,p=t[0]^r[0],h=t[e?3:1]^r[1],m=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;t<n;t++)f=i[p>>>24]^s[h>>16&255]^c[m>>8&255]^u[255&y]^r[b],d=i[h>>>24]^s[m>>16&255]^c[y>>8&255]^u[255&p]^r[b+1],w=i[m>>>24]^s[y>>16&255]^c[p>>8&255]^u[255&h]^r[b+2],y=i[y>>>24]^s[p>>16&255]^c[h>>8&255]^u[255&m]^r[b+3],b+=4,p=f,h=d,m=w;for(let t=0;t<4;t++)o[e?3&-t:t]=l[p>>>24]<<24^l[h>>16&255]<<16^l[m>>8&255]<<8^l[255&y]^r[b++],f=p,p=h,h=m,m=y,y=f;return o}},pe=class{constructor(t,e){this.G=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.G,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,r){let n;if(!(n=e.length))return[];const o=Vt.bitLength(e);for(let o=0;o<n;o+=4){this.$(r);const n=t.encrypt(r);e[o]^=n[0],e[o+1]^=n[1],e[o+2]^=n[2],e[o+3]^=n[3]}return Vt.m(e,o)}},he=Kt._;let me=ue&&fe&&typeof le.importKey==k,ye=ue&&fe&&typeof le.deriveBits==k;class be extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:o=!0}){super({start(){Se(this,t,e,r)},async transform(t,e){const r=this,{password:o,strength:a,et:i,ready:s}=r;o?(await async function(t,e,r,n){const o=await Ae(t,e,r,ze(n,0,ae[e])),a=ze(n,ae[e]);if(o[0]!=a[0]||o[1]!=a[1])throw new Error(Yt)}(r,a,o,ze(t,0,ae[a]+2)),t=ze(t,ae[a]+2),n?e.error(new Error(Jt)):i()):await s;const c=new Uint8Array(t.length-se-(t.length-se)%te);e.enqueue(ge(r,t,c,0,se,!0))},async flush(t){const{nt:e,ot:r,it:n,ready:a}=this;if(r&&e){await a;const i=ze(n,0,n.length-se),s=ze(n,n.length-se);let c=v;if(i.length){const t=xe(de,i);r.update(t);const n=e.update(t);c=De(de,n)}const u=ze(De(de,r.digest()),0,se);let l=n.length<se?1:0;for(let t=0;t<se;t++)l|=u[t]^s[t];if(l&&o)throw new Error(Xt);t.enqueue(c)}}})}}class Ee extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){Se(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:o,et:a,ready:i}=r;let s=v;n?(s=await async function(t,e,r){const n=$t(new Uint8Array(ae[e]));return Tt(n,await Ae(t,e,r,n))}(r,o,n),a()):await i;const c=new Uint8Array(s.length+t.length-t.length%te);c.set(s,0),e.enqueue(ge(r,t,c,s.length,0))},async flush(t){const{nt:e,ot:r,it:n,ready:o}=this;if(r&&e){await o;let a=v;if(n.length){const t=e.update(xe(de,n));r.update(t),a=De(de,t)}const i=De(de,r.digest()).slice(0,se);t.enqueue(Tt(a,i))}}})}}function Se(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:Re(e,r),strength:n-1,it:v})}function ge(t,e,r,n,o,a){const{nt:i,ot:s,it:c}=t;c.length&&(e=Tt(c,e));const u=e.length-o;let l;for(r=function(t,e){if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t}(r,n+(u-u%te)),l=0;l<=u-te;l+=te){const t=xe(de,ze(e,l,l+te));a&&s.update(t);const o=i.update(t);a||s.update(o),r.set(De(de,o),l+n)}return t.it=ze(e,l),r}async function Ae(t,e,r,n){t.password=null;const o=await async function(t,e,r,n,o){if(!me)return Kt.importKey(e);try{return await le.importKey("raw",e,r,!1,o)}catch{return me=!1,Kt.importKey(e)}}(0,r,re,0,oe),a=await async function(t,e,r){if(!ye)return Kt.B(e,t.salt,ne.iterations,r);try{return await le.deriveBits(t,e,r)}catch{return ye=!1,Kt.B(e,t.salt,ne.iterations,r)}}(Object.assign({salt:n},ne),o,8*(2*ie[e]+2)),i=new Uint8Array(a),s=xe(de,ze(i,0,ie[e])),c=xe(de,ze(i,ie[e],2*ie[e])),u=ze(i,2*ie[e]);return Object.assign(t,{keys:{key:s,st:c,passwordVerification:u},nt:new pe(new we(s),Array.from(ce)),ot:new he(c)}),u}function Re(t,e){return e===T?Zt(t):e}function ze(t,e,r){return t.subarray(e,r)}function De(t,e){return t.A(e)}function xe(t,e){return t.R(e)}class Fe extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Te(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Ue(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw new Error(Yt);t=t.subarray(12)}n?e.error(new Error(Jt)):e.enqueue(Ue(r,t))}})}}class Oe extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Te(this,t,e,r)},transform(t,e){const r=this;let n,o;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=$t(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Ie(r,e),0),o=12}else n=new Uint8Array(t.length),o=0;n.set(Ie(r,t),o),e.enqueue(n)}})}}function Te(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),function(t,e,r){const n=[305419896,591751049,878082192];if(Object.assign(t,{keys:n,ct:new Lt(n[0]),ut:new Lt(n[2])}),r)for(let e=0;e<r.length;e++)ke(t,r[e]);else for(let r=0;r<e.length;r++)ke(t,e.charCodeAt(r))}(t,e,r)}function Ue(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ce(t)^e[n],ke(t,r[n]);return r}function Ie(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ce(t)^e[n],ke(t,e[n]);return r}function ke(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=ve(Math.imul(ve(r+Me(n)),134775813)+1),t.ut.append([r>>>24]);const o=~t.ut.get();t.keys=[n,r,o]}function Ce(t){const e=2|t.keys[2];return Me(Math.imul(e,1^e)>>>8)}function Me(t){return 255&t}function ve(t){return 4294967295&t}function Ne(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}function _e(t,e){t=Ne(t);const r=e?{type:e}:{};if(typeof Blob.prototype.stream!=k||new Blob([]).stream()instanceof ReadableStream)return new Response(t).blob().then(t=>e?new Blob([t],r):t);const n=[];return t.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,r))}function Be(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const je="Invalid codec definition",Pe="Reserved compression method",Le="Invalid codec module",We="Compression method not supported",Ze=[0,8,9,99],Ve=new Map,He=new Map;function Ge(t={}){const{compressionMethod:r,format:n,codecURI:o,CompressionStream:a,DecompressionStream:i,versionNeeded:s}=t;if(!Number.isInteger(r)||r<0||r>e||typeof n!=M||!n.length)throw new Error(je);if(Ze.includes(r))throw new Error(Pe);const c=typeof a==k||typeof i==k;if(!(c||typeof o==M&&o.length))throw new Error(je);Ve.set(r,{compressionMethod:r,format:n,codecURI:o,versionNeeded:s}),c&&Je(n,{CompressionStream:a,DecompressionStream:i})}function Ke(t){const e=Ve.get(t);if(e){let r;Ve.delete(t),Ve.forEach(t=>r=r||t.format==e.format),r||He.delete(e.format)}}function qe(t){return Ve.get(t)}function Ye(){return Array.from(Ve.values(),t=>Object.assign({},t,He.get(t.format)))}function Xe(t){return He.get(t)}function Je(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=k&&typeof n!=k)throw new Error(Le);He.set(t,{CompressionStream:r,DecompressionStream:n})}const Qe="Invalid uncompressed size",$e="Invalid compressed data",tr="Invalid CRC32",er="deflate-raw",rr="deflate64-raw",nr="gzip",or=[31,139,8];class ar extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:o,encrypted:a,useCompressionStream:i,zipCrypto:s,computeCrc32:c,level:u,deflate64:l,format:f,compressionMethod:d,inputSize:w}=t,p=this;let h,m,y,b=super.readable;const E=f&&Xe(f),S=c&&o&&!l&&!E&&(!a||s)&&Boolean(i&&n);if(a&&!s||!c||S||(h=new Wt,b=pr(b,h)),o)if(E)b=hr(b,dr(E.CompressionStream,f,{level:u,chunkSize:e,compressionMethod:d,uncompressedSize:w}));else if(S)y=new ir,b=hr(b,new n(nr)),b=pr(b,y);else try{b=wr(b,i,{level:u,chunkSize:e},n,r)}catch(t){let e;try{e=new n(nr)}catch{throw t}b=hr(b,e),b=pr(b,new ir)}a&&(s?b=pr(b,new Oe(t)):(m=new Ee(t),b=pr(b,m))),fr(p,b,()=>{a&&!s||!c||(p.crc32=S?y.crc32:new DataView(h.value.buffer).getUint32(0))})}}class ir extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const o=r.length+t.length;if(o<=8)return void(r=Tt(r,t));const a=o-8,i=Math.min(a,r.length);n.enqueue(Tt(r.subarray(0,i),t.subarray(0,a-i))),r=Tt(r.subarray(i),t.subarray(a-i))},flush(){const e=It(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class sr extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:o,encrypted:a,checkCrc32:i,crc32:s,compressed:c,useCompressionStream:u,deflate64:l,format:f,compressionMethod:d,rawBitFlag:w,outputSize:p}=t;let h,m,y=super.readable;if(a&&(o?y=pr(y,new Fe(t)):(m=new be(t),y=pr(y,m))),c){const t=f&&Xe(f);if(t)y=hr(y,dr(t.DecompressionStream,f,{chunkSize:e,compressionMethod:d,rawBitFlag:w,uncompressedSize:p}));else try{y=wr(y,u,{chunkSize:e,deflate64:l},n,r)}catch(t){if(l||p===T)throw t;let e;try{e=new n(nr)}catch{throw t}y=function(t,e,r){const n=new Lt;let o,a,i,s=0,c=!1;const u=new Promise((t,e)=>{a=t,i=e});u.catch(()=>{}),r||a();const l=new TransformStream({start(t){const e=new Uint8Array(10);e.set(or),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,d();try{await u}finally{w()}const e=new Uint8Array(8),o=It(e);o.setUint32(0,n.get(),!0),o.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),f=new TransformStream({transform(t,e){n.append(t),s+=t.length,s>=r?a():c&&d(),e.enqueue(t)},cancel(t){i(t)}});return t=pr(t,l),pr(t=hr(t,e),f);function d(){w(),o=setTimeout(()=>i(new Error(Qe)),5e3)}function w(){clearTimeout(o)}}(y,e,p)}y=function(t){const e=t.getReader();return new ReadableStream({async pull(t){let r;try{r=await e.read()}catch(t){if(t&&t.message)throw t;const e=new Error($e);throw e.cause=t,e}const{value:n,done:o}=r;o?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}(y)}i&&(h=new Wt,y=pr(y,h)),fr(this,y,()=>{if(i){const t=new DataView(h.value.buffer);if(s!=t.getUint32(0,!1))throw new Error(tr)}})}}const cr=new Map;function ur(t,e){if(!t)return!1;let r=cr.get(t);r||(r=new Map,cr.set(t,r));let n=r.get(e);if(n===T){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function lr(t){return ur(t,er)}function fr(t,e,r){e=pr(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function dr(t,e,r){if(!t)throw new Error(We);return new t(e,r)}function wr(t,e,r,n,o){const a=e&&n?n:o||n,i=r.deflate64?rr:er;let s;try{s=new a(i,r)}catch(t){if(!e||!o||a==o)throw t;s=new o(i,r)}return hr(t,s)}function pr(t,e){return Ne(t).pipeThrough(e)}function hr(t,e){const r=e.writable.getWriter(),n=t.getReader();return async function(){try{for(;;){await r.ready;const t=await n.read();if(t.done){await r.close();break}await r.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(r,t),await async function(t,e){try{await t.cancel(e)}catch{}}(n,t)}}(),e.readable}const mr="data",yr="deflate",br="inflate";class Er extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let o;n.startsWith(yr)?o=ar:n.startsWith(br)&&(o=sr),r.outputSize=0;let a=0;const i=new o(t,e),s=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:a})}}),u=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==T&&r.outputSize>t.outputSize))throw new Error(Qe)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:a})}});Object.defineProperty(r,"readable",{get:()=>s.pipeThrough(c).pipeThrough(i).pipeThrough(u)})}}class Sr extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let o=0;for(;o<t;){const r=e[0],a=t-o;r.length<=a?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,a),o),e[0]=r.subarray(a),o+=a)}return r-=t,n}(!Number.isFinite(t)||t<1)&&(t=65536),super({transform(o,a){for(e.push(o),r+=o.length;r>t;)a.enqueue(n())},flush(t){r&&t.enqueue(function(t,e){const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r}(e,r))}})}}const gr="Worker startup timeout";let Ar,Rr,zr,Dr=()=>{};async function xr(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.lt)return!0;if(lr(e)||ur(e,nr))return!0;if(r)try{return await Dr(t),!0}catch{return!1}return!1}function Fr(t){t.createWorker?Rr=!0:Ar=!1}class Or{constructor(t,{readable:e,writable:r},{options:n,config:o,ft:a,useWebWorkers:i,transferStreams:s,workerURI:c,createWorker:u},l){const{signal:f}=a;return Rr&&(u=T),Object.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new Sr(gt(o))).pipeThrough(new Tr(a),{signal:f}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:u,transferStreams:s,terminate:()=>new Promise(e=>{const{yt:r,wt:n}=t;r?(n?t.bt=e:(r.terminate(),e()),t.Et=null):e()}),St(){if(t.wt){const{bt:e}=t;e&&(t.bt=null,t.gt=!0,t.yt.terminate(),e()),t.wt=!1,l(t)}}}),Ar===T&&(Ar=typeof Worker!=I),(i&&zr&&(Ar&&c||u)?zr:Ir)(t,o)}}class Tr extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let o=0;super({async start(){t&&await Ur(t,r)},async transform(t,n){o+=t.length,e&&await Ur(e,o,r),n.enqueue(t)},async flush(){n&&await Ur(n,o)}})}}async function Ur(t,...e){try{await t(...e)}catch{}}function Ir(t,e){return{run:()=>kr(t,e)}}async function kr({options:t,readable:e,writable:r,St:n},o){let a;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(yr),r=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,n=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(r&&r.lt&&!lr(n))try{await Dr(o)}catch{}}else try{await Dr(o)}catch{r&&!r.lt||(t.useCompressionStream=!0)}}a=new Er(t,o),await e.pipeThrough(a).pipeThrough(new Sr(gt(o))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:s}=a;return{crc32:n,inputSize:i,outputSize:s}}catch(t){throw a&&(t.outputSize=a.outputSize),t}finally{n()}}const Cr={type:"module"},Mr="error";let vr,Nr,_r,Br=!0;try{Br=typeof structuredClone==k&&structuredClone(new DOMException("","AbortError")).code!==T}catch{}var jr;function Pr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Lr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.Et=null}function Wr(t,e,r,n,o=!0){const{createWorker:a}=r;let i,s,c;if(a)i=a();else if(Nr===T||vr!==t){const a=typeof t==k;s=a?t(o):t;const u=s.startsWith("data:"),l=s.startsWith("blob:");if(u||l){n===T&&(n=!1),n&&(c=Cr);try{i=new Worker(s,c)}catch(o){if(l)try{URL.revokeObjectURL(s)}catch{}if(a&&l)return Wr(t,e,r,n,!1);if(n)throw o;return Wr(t,e,r,!0,!1)}}else{n===T&&(n=!0),n&&(c=Cr);try{s=new URL(s,e)}catch{}try{i=new Worker(s,c)}catch(a){if(n)return Wr(t,e,r,!1,o);throw a}}vr=t,Nr=s,_r=c}else i=new Worker(Nr,_r);return i.addEventListener("message",t=>{r.At=!0,Zr(r),async function({data:t},e){const{type:r,value:n,messageId:o,result:a,error:i}=t,{reader:s,writer:c,Rt:u,zt:l,St:f,ht:d}=e,w=()=>e.ht!=d;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:o,cause:a,codecImportFailed:s}=i,c=new Error(t);Object.assign(c,{stack:e,code:r,name:n,outputSize:o}),a&&(c.cause=Object.assign(new Error(a.message),{name:a.name})),s&&(c.codecImportFailed=!0),p(c)}else{if("pull"==r){const{value:t,done:r}=await s.read();w()||Hr({type:mr,value:t,done:r,messageId:o},e)}r==mr&&(await c.ready,await c.write(new Uint8Array(n)),w()||Hr({type:"ack",messageId:o},e)),"close"==r&&p(null,a)}}catch(i){w()||(Lr(e),p(i))}function p(t,e){w()||(t?l(t):u(e),c&&c.releaseLock(),t&&t.codecImportFailed||f())}}(t,r)}),i.addEventListener(Mr,t=>Vr(t,r)),i.addEventListener("messageerror",t=>Vr(t,r)),i}function Zr(t){const{Dt:e}=t;e&&(clearTimeout(e),t.Dt=null)}function Vr(t,e){t.preventDefault&&t.preventDefault(),Zr(e);const{At:r,zt:n,writer:o,St:a}=e;Lr(e),r||(e.yt=null);let i=t.error||new Error(t.message||Mr);r||(i=Object.assign(new Error(i.message||Mr),{xt:!0}),e.Ft=i),n&&(n(i),o&&o.releaseLock(),r&&a())}function Hr(t,{yt:e,writer:r,transferStreams:n,At:o}){try{const{value:r,readable:a,writable:i}=t,s=[];if(r&&(t.value=Ut(r),s.push(t.value.buffer)),n&&Br&&o?(a&&s.push(a),i&&s.push(i)):t.readable=t.writable=null,s.length)try{return e.postMessage(t,s),!0}catch{Br=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}jr=function(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:o}=e;let{wasmURI:a}=e;if(!t.Et){let i;typeof a==k&&(a=a());try{i=Wr(t.workerURI,r,t)}catch{return Fr(t),Ir(t,e)}Object.assign(t,{yt:i,At:!1,gt:!1,Ft:null,Et:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{Ft:e}=t;t.Ft=null;const r=e||new Error(gr);throw r.xt=!0,r}let r,n;const o=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,Rt:r,zt:n,result:o});const{readable:a,options:i}=t,{writable:s,closed:c,Ot:u}=function(t){const e=new AbortController,{writable:r,readable:n}=new TransformStream,o=n.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:r,closed:o,Ot:()=>e.abort()}}(t.writable);let l;try{l=Hr({type:"start",options:i,config:e,readable:a,writable:s},t)}catch(e){u();try{await c}catch{}throw t.St(),e}l||Object.assign(t,{reader:a.getReader(),writer:s.getWriter()});const{workerStartupTimeout:f}=e;!t.At&&Number.isFinite(f)&&f>=0&&(t.Dt=setTimeout(()=>function(t){if(t.Dt=null,t.At)return;const{zt:e,writer:r}=t;if(Lr(t),t.yt=null,e){const t=new Error(gr);t.xt=!0,e(t),r&&r.releaseLock()}}(t),f));try{const t=await o;return await d(),await c,t}catch(t){await d(),u();try{await c}catch{}throw t}async function d(){if(!l&&!s.locked)try{await s.getWriter().close()}catch{}}}(t,{chunkSize:n,wasmURI:a,baseURI:r,workerStartupTimeout:o})}catch(r){if(r&&r.xt)return Fr(t),Pr(t),kr(t,e);if(r&&r.codecImportFailed){if(t.reader)return Pr(t),kr(t,e);t.St()}throw r}}}})}return t.Et},zr=jr;let Gr=[];const Kr=[];let qr,Yr,Xr=0;async function Jr(t,e){const{options:r,config:n}=e,{transferStreams:o,useWebWorkers:a,useCompressionStream:i,compressed:s,checkCrc32:c,computeCrc32:u,encrypted:l,format:f,codecURI:d}=r,{workerURI:w,createWorker:p,maxWorkers:h}=n;f&&(d&&(r.codecURI=function(t,e){try{return new URL(t,e).toString()}catch{return t}}(d,n.baseURI)),await async function(t,e){!He.has(t)&&e&&Je(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(f,r.codecURI)),e.transferStreams=!f&&(o||o===T&&n.transferStreams);const m=!(s||c||u||l),y=f===T||Boolean(r.codecURI);return e.useWebWorkers=!m&&y&&(a||a===T&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:T,e.createWorker=e.useWebWorkers&&p?p:T,r.useCompressionStream=i||i===T&&n.useCompressionStream,(await async function(){const r=Gr.find(t=>!t.wt);if(r)return rn(r),new Or(r,t,e,b);if(Gr.length<h){const r={Tt:Xr};return Xr++,Gr.push(r),new Or(r,t,e,b)}return new Promise(r=>{Kr.push({resolve:r,stream:t,Ut:e}),Yr=n.workerStarvationTimeout,Qr()})}()).run();function b(t){if($r(),Kr.length){const[{resolve:e,stream:r,Ut:n}]=Kr.splice(0,1);e(new Or(t,r,n,b)),Qr()}else t.yt?(rn(t),function(t,e){const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.gt?t.gt=!1:t.It=setTimeout(async()=>{Gr=Gr.filter(e=>e!=t);try{await t.terminate()}catch{}},n))}(t,e)):Gr=Gr.filter(e=>e!=t)}}function Qr(){!qr&&Kr.length&&Number.isFinite(Yr)&&Yr>=0&&(qr=setTimeout(tn,Yr))}function $r(){qr&&(clearTimeout(qr),qr=null)}function tn(){if(qr=null,Kr.length){const[{resolve:t,stream:e,Ut:r}]=Kr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:T,createWorker:T});t(new Or({},e,n,en)),Qr()}}function en(){$r(),Qr()}function rn(t){const{It:e}=t;e&&(clearTimeout(e),t.It=null)}const nn="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split("");function on(t,e){return an(t,e,!0)}function an(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let r=0;r<t.length;r++)e+=nn[t[r]];return e}(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const sn="HTTP error ",cn="HTTP Range not supported",un="HTTP resource changed",ln="Writer iterator completed too soon",fn="Writer not initialized",dn="Content-Range",wn="Range",pn="GET",hn="bytes",mn=16777216,yn="writable",bn=Symbol();class En{constructor(){this.size=0}init(){this.initialized=!0}}class Sn extends En{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=gt(St())}={}){const n=this;let o=0;return r=At(r),new ReadableStream({async pull(a){const i=e===T?r:Math.min(r,e-o),s=await ao(n,t+o,i);s.length&&(a.enqueue(s),o+=s.length),(e!==T&&o>=e||!s.length&&i)&&a.close()}})}}class gn extends En{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw new Error(fn);return t.writeUint8Array(Ut(e))}});Object.defineProperty(t,yn,{get:()=>e})}writeUint8Array(){}}class An extends Sn{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{kt:t,Ct:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{Ct:r,kt:n}=this,o=new Uint8Array(e),a=4*Math.floor(t/3),i=atob(n.substring(a+r,4*Math.ceil((t+e)/3)+r)),s=t-3*Math.floor(a/4);let c=0;for(let t=s;t<s+e&&t<i.length;t++)o[t-s]=i.charCodeAt(t),c++;return c<o.length?o.subarray(0,c):o}}class Rn extends gn{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Mt:""})}writeUint8Array(t){const e=this;let r,n=e.Mt;const o=e.Mt.length;for(e.Mt="",r=0;r<3*Math.floor((o+t.length)/3)-o;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.Mt+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.Mt=n+e.Mt}getData(){return this.data+btoa(this.Mt)}}let zn,Dn;class xn extends Sn{constructor(t){super(),Object.assign(this,{vt:t,size:t.size}),Dn||(Dn=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();zn=1==e}catch{zn=!1}})())}createReadable(t){const{vt:e,size:r}=this,{offset:n=0,size:o=r-n}=t||{};if(typeof e.stream==k){if(!n&&o>=r)return Ne(e.stream());if(zn)return Ne(e.slice(n,n+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const r=this,n=t+e,o=!t&&n>=r.size?r.vt:r.vt.slice(t,n);let a=await o.arrayBuffer();return a.byteLength>e&&(a=a.slice(t,n)),new Uint8Array(a)}}class Fn extends En{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,yn,{get:()=>r.writable}),e.contentType=t,e.Nt=_e(r.readable,t),e.Nt.catch(()=>{})}getData(){return this.Nt}}class On extends xn{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function Tn(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<55296||n>=57344?e+=3:n<56320&&56320==(64512&t.charCodeAt(r+1))?(e+=4,r++):e+=3}return e}class Un extends Fn{constructor(t){super(),Object.assign(this,{encoding:t,_t:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,_t:e}=this,r=await super.getData();return r.text&&e?r.text():function(t,e){return an(t,e,!1)}(new Uint8Array(await r.arrayBuffer()),t)}}class In extends Sn{constructor(t,e){super(),Cn(this,t,e)}async init(){await Mn(this,Gn,Wn),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:o}=e;if((r||n)&&o!==T){const{offset:r=0,size:n=o-r}=t||{};if(n>0&&r<o)return function(t,e,r){let n,o=e,a=0,i=r;return new ReadableStream({start:()=>s(),async pull(t){n||await s();const{value:e,done:r}=await n.read();if(r)throw new Error(cn);const o=e.length>a?e.subarray(0,a):e;a-=o.length,i-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=n;n=T,await t.cancel()}(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function s(){const e=Math.min(t.maximumRangeSize,i),r=await Gn(pn,t,Pn(t,o,e));if(206!=r.status)throw new Error(cn);const s=r.headers.get(dn);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=o)throw new Error(cn)}jn(t,r),Bn(t,r),o+=e,a=e,n=r.body.getReader()}}(e,r,Math.min(n,o-r))}return super.createReadable(t)}readUint8Array(t,e){return vn(this,t,e,Gn,Wn)}}class kn extends Sn{constructor(t,e){super(),Cn(this,t,e)}async init(){await Mn(this,Kn,Zn),super.init()}readUint8Array(t,e){return vn(this,t,e,Kn,Zn)}}function Cn(t,e,r){const{preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s=!0,maximumRangeSize:c=mn,fetch:u}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s,maximumRangeSize:c,fetch:u})}async function Mn(t,e,r){const{url:n,preventHeadRequest:o,useRangeHeader:a,forceRangeRequests:i,combineSizeEocd:s}=t;if(function(t){const{baseURI:e}=St(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r}(n)&&(a||i)&&(typeof o==I||o)){const n=await e(pn,t,Pn(t,s?-22:void 0)),o=n.headers.get("Accept-Ranges");if(!(i||o&&o.toLowerCase()==hn))throw new Error(cn);{if(s){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Bt=e)}Bn(t,n);const o=Nn(n);o===T?await Hn(t,e,r):t.size=o}}else await Hn(t,e,r)}async function vn(t,e,r,n,o){const{useRangeHeader:a,forceRangeRequests:i,Bt:s,size:c,options:u}=t;if(a||i){if(s&&e==c-d&&r==d)return s;if(e>=c||0===r)return v;{e+r>c&&(r=c-e);const o=await n(pn,t,Pn(t,e,r));if(206!=o.status)throw new Error(cn);const a=o.headers.get(dn);if(a){const t=Number(a.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw new Error(cn)}jn(t,o),Bn(t,o);const i=new Uint8Array(await o.arrayBuffer());if(i.length!=r)throw new Error(cn);return i}}{const{data:n}=t;return n||await o(t,u),t.data.subarray(e,e+r)}}function Nn(t){const e=t.headers.get(dn);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function _n({headers:t}){return{jt:t.get("Etag")||T,lastModified:t.get("Last-Modified")||T}}function Bn(t,e){const{checkResourceChanges:r,Pt:n}=t;r&&!n&&206==e.status&&(t.Pt=_n(e))}function jn(t,e){const{checkResourceChanges:r,Pt:n,size:o}=t;if(r){const t=Nn(e);if(t!==T&&o!==T&&t!=o)throw new Error(un);if(n){const t=_n(e);if(Object.entries(n).some(([e,r])=>r!==T&&t[e]!==T&&r!=t[e]))throw new Error(un)}}}function Pn(t,e=0,r=1){return Object.assign({},Ln(t),{[wn]:hn+"="+(e<0?e:e+"-"+(e+r-1))})}function Ln({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Wn(t){await Vn(t,Gn)}async function Zn(t){await Vn(t,Kn)}async function Vn(t,e){const r=await e(pn,t,Ln(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Hn(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Ln(t)),o=n.headers.get("Content-Length");o&&!n.headers.get("Content-Encoding")?t.size=Number(o):await r(t,t.options)}}async function Gn(t,{fetch:e=fetch,options:r,url:n},o){const a=await e(n,Object.assign({},r,{method:t,headers:o}));if(a.status<400)return a;throw 416==a.status?new Error(cn):new Error(sn+(a.statusText||a.status))}function Kn(t,{url:e},r){return new Promise((n,o)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status<400){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:a.status,arrayBuffer:()=>a.response,headers:new Map(t)})}else o(416==a.status?new Error(cn):new Error(sn+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>o(t.detail?t.detail.error:new Error("Network error")),!1),a.open(t,e),r)for(const t of Object.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class qn extends Sn{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new kn(t,e):new In(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 Yn extends qn{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Xn extends Sn{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{Lt:t,size:t.length})}readUint8Array(t,e){return this.Lt.slice(t,t+e)}}class Jn extends gn{constructor(t){super(),this.Wt=t||262144}init(t=0){Object.assign(this,{offset:0,Lt:new Uint8Array(t>0?t:this.Wt)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.Lt.length){let t=e.Lt.length?2*e.Lt.length:e.Wt;for(;t<r;)t*=2;const n=e.Lt;e.Lt=new Uint8Array(t),e.Lt.set(n)}e.Lt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Lt.length?this.Lt:this.Lt.slice(0,this.offset)}}class Qn extends Sn{constructor(t){super(),this.Zt=t}async init(){const t=this;t.Vt=0;const e=t.Zt=await Promise.all(t.Zt.map(oo));t.Ht=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Gt(t){const{Ht:e,size:r}=this,n=e[t];return n===T?r:n}async readUint8Array(t,e){const r=this,{Zt:n}=this;let o,a=0,i=t;for(;n[a]&&i>=n[a].size;)i-=n[a].size,a++;const s=n[a];if(s){const n=s.size;if(i+e<=n)o=await ao(s,i,e);else{const a=n-i;o=Tt(await ao(s,i,a),await r.readUint8Array(t+a,e-a))}}else o=v;return r.Vt=Math.max(a,r.Vt),o}}class $n extends En{constructor(t,e=4294967295){super();const r=this;let n,o,a;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===bn)return void(a&&await c());const{availableSize:i}=r;if(a)e.length>=i?(await s(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i))):await s(e);else{const{value:i,done:s}=await t.next();if(s&&!i)throw new Error(ln);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await no(n),o=i.writable,a=o.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function s(t){const e=t.length;e&&(await a.ready,await a.write(t),n.size+=e,r.availableSize-=e)}async function c(){await u(),r.diskOffset+=n.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}Object.defineProperty(r,yn,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(bn)}finally{t.releaseLock()}}}class to{constructor(t){return Array.isArray(t)&&(t=new Qn(t)),(t instanceof ReadableStream||typeof t.getReader==k)&&(t={readable:Ne(t)}),t}}class eo{constructor(t){return t.writable===T&&typeof t.next==k&&(t=new $n(t)),(t instanceof WritableStream||typeof t.getWriter==k)&&(t={writable:Be(t)}),t.size===T&&(t.size=0),t}}function ro(t){return Boolean(t&&t.getData)}async function no(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function oo(t){return t=new to(t),await no(t),t.size!==T&&t.readUint8Array||(t=new xn(await _e(t.readable)),await no(t)),t}function ao(t,e,r){return t.readUint8Array(e,r)}function io(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?Sn.prototype.createReadable.call(t,e):t.readable}const so="filename",co="rawFilename",uo="comment",lo="rawComment",fo="uncompressedSize",wo="compressedSize",po="offset",ho="diskNumberStart",mo="lastModDate",yo="rawLastModDate",bo="lastAccessDate",Eo="rawLastAccessDate",So="creationDate",go="rawCreationDate",Ao="internalFileAttributes",Ro="externalFileAttributes",zo="msdosAttributesRaw",Do="msdosAttributes",xo="msDosCompatible",Fo="zip64",Oo="encrypted",To="version",Uo="versionMadeBy",Io="zipCrypto",ko="directory",Co="executable",Mo="compressionMethod",vo="signature",No="extraField",_o="unixMode",Bo="setuid",jo="setgid",Po="sticky",Lo=[so,co,fo,wo,mo,yo,uo,lo,bo,Eo,So,go,po,ho,Ao,Ro,zo,Do,xo,Fo,Oo,To,Uo,Io,ko,Co,"symlink",Mo,vo,"crc32",No,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",_o,"unixExternalUpper",Bo,jo,Po,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Wo{constructor(t){Lo.forEach(e=>this[e]=t[e])}}const Zo="File format is not recognized",Vo="End of central directory not found",Ho="End of Zip64 central directory locator not found",Go="Central directory header not found",Ko="Local file header not found",qo="Zip64 extra field not found",Yo="File contains encrypted entry",Xo="Encryption method not supported",Jo="Split zip file",Qo="Overlapping entry found",$o="Entry data out of bounds",ta="Ambiguous archive",ea="Encrypted central directory is not supported",ra="Unsafe filename",na="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",oa="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",aa="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",ia="64-bit value exceeds Number.MAX_SAFE_INTEGER",sa="unsorted central directory",ca="unknown version needed to extract",ua="compressed patched data",la="malformed extra field",fa="unknown zip64 extensible data",da="wrapped entries count",wa="appended data",pa="prepended data",ha="prepended central directory",ma="trailing central directory data",ya="duplicate filename",ba="mismatched zip64 end of central directory record",Ea="mismatched local file header (general purpose bit flag)",Sa="mismatched local file header (compression method)",ga="mismatched local file header (crc32 or sizes)",Aa=/^[a-zA-Z]:/,Ra="utf-8",za="cp437",Da=[[fo,t],[wo,t],[po,t],[ho,e]],xa={[e]:{Kt:ui,bytes:4},[t]:{Kt:li,bytes:8}},Fa=BigInt(Number.MAX_SAFE_INTEGER);class Oa{constructor(t,e={}){Object.assign(this,{reader:new to(t),options:e,qt:new Map})}async*getEntriesGenerator(n={}){const a=this;let{reader:i}=a;if(await no(i),i.size!==T&&i.readUint8Array||(i=new xn(await _e(i.readable)),await no(i)),i.size<d)throw new Error(Zo);const c=a.warnings=[],h=Ha(n,a.options),m=h==J,y=h!=$,b=qa(ni(a,n,K),h),E=function(t,e){if(t===T)return e;if(!Va(t))throw new Error(oa);return t}(ni(a,n,"filenameValidation"),h),S=ni(a,n,"normalizeFilename"),{Yt:x,Xt:F}=await Ya(i,y,b);if(!x)throw await async function(t){return await Za(t)==o}(i)?new Error(Jo):new Error(Vo);y&&F>1&&ri("multiple end of central directory records");const O=It(x);let U=ui(O,12),I=ui(O,16);const k=x.offset,C=ci(O,20),M=k+d+C,N=i.size-M;N>b&&ri(wa),N>0&&ei(c,wa);let _=ci(O,4);const B=i.Vt||0;let j,P,L,W,Z,V=ci(O,6),H=ci(O,10),G=0,q=p;const Q=I==t||U==t||H==e||V==e;if(I!=t&&V!=e&&(I+=Wa(i,V)),Q){const r=x.offset>=w?await ao(i,x.offset-w,w):v,n=It(r);if(r.length==w&&ui(n,0)==l){I=Wa(i,ui(n,4))+li(n,8);let r=await ao(i,I,p),o=It(r);const a=x.offset-w-p;if((r.length<p||ui(o,0)!=u)&&I!=a&&a>=0){const t=I;I=a,I>t&&(G=I-t),r=await ao(i,I,p),o=It(r)}if(r.length<p||ui(o,0)!=u)throw new Error(Ho);if(L=!0,W=li(o,4)>44,W){const t=Math.min(li(o,4)-44,i.size-I-p);t>0&&(q+=t,Z=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=It(t),n=ci(r,26);Object.assign(e,{compressionMethod:ci(r,0),compressedSize:li(r,2),uncompressedSize:li(r,10),encryptionAlgorithm:ci(r,18),bitLength:ci(r,20),flags:ci(r,22),hashAlgorithm:ci(r,24),hashData:t.subarray(28,28+n)})}return e}(await ao(i,I+p,t)))}_==e?_=ui(o,16):_!=ui(o,16)&&ti(m,c,ba),V==e?V=ui(o,20):V!=ui(o,20)&&ti(m,c,ba),H==e?H=li(o,32):H!=li(o,32)&&ti(m,c,ba),U==t?U=li(o,40):U!=li(o,40)&&ti(m,c,ba),I=Wa(i,V)+li(o,48)+G}}let tt=U;const et=x.offset-(L?q+w:0);if(I>=i.size&&(G=i.size-I-U-d,I=i.size-U-d),B!=_)throw new Error(Jo);if(I<0)throw new Error(Zo);let rt=0,nt=await ao(i,I,U),ot=It(nt);if(U){if(nt.length<4)throw new Error(Zo);const t=et-U;if(I!=t&&V==_){const e=ui(ot,rt)==s||Boolean(Z&&Z.compressedSize)||ka(ot);let r=!e;if(!r&&t>=0&&t+4<=i.size&&(r=ui(It(await ao(i,t,4)),0)==s),r){const r=I;I=t,I>r&&(G+=I-r,j=e),nt=await ao(i,I,U),ot=It(nt)}}}const at=et-I;if(U!=at&&at>=0&&V==_&&(U=at,nt=await ao(i,I,U),ot=It(nt)),I<0||I>=i.size)throw new Error(Zo);a.directoryOffset=I,a.directoryLength=tt;const it=oi(a,n,"decryptCentralDirectory");let st,ct;if(it&&H&&nt.length>=4&&ui(ot,0)!=s&&(W||ka(ot))){const t=function(t,e,r){const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r}(Z,tt,nt.length);ct=nt.subarray(t),nt=await it(nt.subarray(0,t),Z),ot=It(nt),tt=nt.length,st=!0}Z&&!st&&(nt.length<4||ui(ot,0)==s)&&ei(c,fa),P=I;const ut=ni(a,n,"filenameEncoding"),lt=ni(a,n,"commentEncoding"),ft=new Set;let dt,wt=-1;const pt=!m&&!L;!H&&pt&&(H=Ca(ot,nt,rt),H&&ei(c,da));for(let t=0;t<H;t++){const o=new Ia(i,a.options);if(rt+f>nt.length||ui(ot,rt)!=s){if(0==t&&!st&&(W||ka(ot)))throw new Error(ea);throw new Error(Go)}va(o,ot,rt+6);const u=Boolean(o.bitFlag.languageEncodingFlag),l=rt+f,d=l+o.filenameLength,w=d+o.extraFieldLength,p=ci(ot,rt+4),h=!(p>>8),m=p>>8==3,y=nt.subarray(l,d),b=ci(ot,rt+32),x=w+b,F=nt.subarray(w,x),O=u,U=u,I=ui(ot,rt+38),k=I&r,C={readOnly:Boolean(1&k),hidden:Boolean(2&k),system:Boolean(4&k),directory:Boolean(16&k),archive:Boolean(32&k)},M=ui(ot,rt+42),v=oi(a,n,"decodeText")||on,N=O?Ra:ut||za,_=U?Ra:lt||za;let B=v(y,N,Y);if(B===T&&(B=on(y,N)),S){const t=S(B);t!==T&&(B=t)}if(Ka(B,E)){const t=new Error(ra);throw t.filename=B,t}let j=v(F,_,X);j===T&&(j=on(F,_)),Object.assign(o,{index:t,Jt:st,versionMadeBy:p,msDosCompatible:h,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:b,offset:M,diskNumberStart:ci(ot,rt+34),internalFileAttributes:ci(ot,rt+36),externalFileAttributes:I,msdosAttributesRaw:k,msdosAttributes:C,rawFilename:y,filenameUTF8:O,commentUTF8:U,rawExtraField:nt.subarray(d,w),rawComment:F,filename:B,comment:j}),Na(o,o,ot,rt+6)&&ei(c,la,B),o.offset+=G;const L=Wa(i,o.diskNumberStart)+o.offset;P=Math.min(L,P),L<wt&&ei(c,sa,B),wt=L,(o.version&r)>63&&ei(c,ca,B),32&~o.rawBitFlag||ei(c,ua,B),ft.has(o.filename)&&(dt=!0),ft.add(o.filename);const Z=o.externalFileAttributes>>16&e;o.unixMode===T&&16877&Z&&(o.unixMode=Z);const V=Boolean(o.unixMode&R),K=Boolean(o.unixMode&z),q=Boolean(512&o.unixMode),J=40960==((o.unixMode===T?Z:o.unixMode)&g),Q=!J&&(o.unixMode!==T?!!(73&o.unixMode):m&&!!(73&Z)),$=o.unixMode!==T&&(o.unixMode&g)==A,tt=(Z&g)==A;Object.assign(o,{setuid:V,setgid:K,sticky:q,symlink:J,unixExternalUpper:Z,executable:Q,directory:$||tt||h&&C.directory||o.filename.endsWith(D),zipCrypto:o.encrypted&&!o.extraFieldAES});const et=new Wo(o);if(et.getData=(t,e)=>o.getData(t,et,a.qt,e),et.arrayBuffer=async t=>{const e=new TransformStream,r=_e(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await o.getData(e,et,a.qt,t),r},rt=x,t==H-1&&pt){const t=Ca(ot,nt,rt);t&&(H+=t,ei(c,da))}const{onprogress:at}=n;if(at)try{await at(t+1,H,new Wo(o))}catch{}yield et}let ht=rt,mt=Ma(nt.subarray(rt))||(st?Ma(ct):T);if(!mt&&!st){const t=I+rt,e=Math.min(et-t,65541);e>=6&&(mt=Ma(await ao(i,t,e)))}mt&&(a.digitalSignature=mt,ht=rt+6+mt.length),(rt!=tt&&ht!=tt||!st&&rt!=U&&ht!=U)&&ti(m,c,ma),dt&&ti(m,c,ya);const yt=ni(a,n,"extractPrependedData"),bt=ni(a,n,"extractAppendedData"),Et=(m||yt)&&H&&4==P&&await async function(t){const e=await Za(t);return e==o||808471376==e}(i)?4:0;return m&&(G||H&&P>Et)&&ri(pa),(G||H&&P>4)&&ei(c,pa),j&&ei(c,ha),yt&&(a.prependedData=P>Et?await ao(i,Et,P-Et):v),a.comment=C?await ao(i,k+d,C):v,bt&&(a.appendedData=M<i.size?await ao(i,M,i.size-M):v),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class Ta{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new Oa(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await n.next();if(e)return t.close();const o=function(){const{readable:t,writable:e}=new TransformStream;if(r.getData)return async function(){try{await r.getData(e)}catch(t){try{await e.abort(t)}catch{}}}(),t}(),a={...r,readable:o};delete a.getData,t.enqueue(a)}}),this.writable=r}}async function Ua(t,e={}){if(t=new to(t),await no(t),t.size!==T&&t.readUint8Array||(t=new xn(await _e(t.readable)),await no(t)),t.size<d)return!1;const r=Ha(e,{}),n=r!=$,o=qa(e[K],r),{Yt:a,Xt:i}=await Ya(t,n,o);if(!a||r==J&&i>1)return!1;const s=ci(It(a),20),c=a.offset+d+s;return t.size-c<=o}let Ia=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,o,i={}){const s=this,c=St(),{reader:u,index:l,offset:f,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:p,compressionMethod:h,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:E,uncompressedSize:S,compressedSize:g}=s,{dataDescriptor:A}=m,R=e.localDirectory={},z=e.warnings=[],D=Wa(u,d)+f,F=await ao(u,D,x),O=It(F);let U=ni(s,i,N),I=ni(s,i,_);const k=ni(s,i,B);if(ct(U,I),U=U&&U.length&&U,I=I&&I.length&&I,w&&99!=w.originalCompressionMethod)throw new Error(We);if(F.length<x||ui(O,0)!=n)throw new Error(Ko);va(R,O,4);const{extraFieldLength:C,filenameLength:M}=R,V=R.dataOffset=D+x+M+C,H=ni(s,i,"checkLocalDirectory"),G=Ha(i,s.options),K=function(t,e){return t===T?e!=$:Boolean(t)}(H,G),q=function(t,e){return t===T?e==J:Boolean(t)}(H,G);let Y=v;if(q&&(M||C)){const t=await ao(u,D+x,M+C);Y=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=C?await ao(u,D+x+M,C):v;q&&(R.rawFilename=Y),Na(s,R,O,4,!0)&&ei(z,la),function(t,e,r,n,o){const{rawFilename:a}=t,i=!o,s=t.Jt&&!(8192&~e.rawBitFlag);!n||s||r.length==a.length&&!r.some((t,e)=>t!=a[e])||ti(i,o,"mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&ti(i,o,Ea),e.compressionMethod!=t.compressionMethod&&ti(i,o,Sa),e.bitFlag.dataDescriptor||s||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||ti(i,o,ga)}(s,R,Y,q,K?T:z);const{lastAccessDate:X,creationDate:Q,uid:tt,gid:et}=R;X&&(e.lastAccessDate=X),Q&&(e.creationDate=Q),tt!==T&&e.uid===T&&(e.uid=tt),et!==T&&e.gid===T&&(e.gid=et);const rt=s.encrypted&&R.encrypted&&!k,nt=rt&&!w;if(k||(e.zipCrypto=nt),rt&&!(64&~R.rawBitFlag))throw new Error(Xo);const ot=k?T:qe(h);if(0!=h&&8!=h&&9!=h&&!ot&&!k)throw new Error(We);if(rt){if(!nt&&(w.strength<1||w.strength>3))throw new Error(Xo);if(!U&&!I)throw new Error(Yo)}if(V+g>u.size)throw new Error($o);const at=g,ut=Ne(u.createReadable({offset:V,size:at})),lt=it(ni(s,i,j));st(lt);const ft=ni(s,i,"checkPasswordOnly");let dt=ni(s,i,"checkOverlappingEntry");const wt=ni(s,i,"checkOverlappingEntryOnly");wt&&(dt=!0);const{onstart:pt,onprogress:ht,onend:mt}=i,yt=0!=h&&!k,bt=k?g:S,Et=9==h;let gt=ni(s,i,L);Et&&(gt=!1);const At=ni(s,i,"checkCrc32"),Rt=(At===T?ni(s,i,"checkSignature"):At)&&!k&&(!rt||nt||w&&1==w.vendorVersion),zt={options:{codecType:br,password:U,rawPassword:I,zipCrypto:nt,encryptionStrength:w&&w.strength,checkCrc32:Rt,checkAuthenticationCode:ni(s,i,"checkAuthenticationCode"),passwordVerification:nt&&(A?E>>>8&r:b>>>24&r),outputSize:bt,crc32:b,compressed:yt,encrypted:rt,useWebWorkers:ni(s,i,P),useCompressionStream:gt,transferStreams:ni(s,i,W),deflate64:Et,format:ot?ot.format:T,codecURI:ot?ot.codecURI:T,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:ft},config:c,ft:{signal:lt,size:at,onstart:pt,onprogress:ht,onend:mt}};let Dt,xt;dt&&await async function({reader:t,$t:e,index:r,offset:n,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:c,dataDescriptor:u,extraFieldZip64:l,qt:f}){let d=0;if(u&&(d=l?20:12),d){const r=await ao(t,c+i,d+4),n=It(r);let u=r.length==d+4&&ui(n,0)==a;if(u){const t=La(n,4,l);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:u=!1}if(r.length>=d){const t=La(n,u?4:0,l);t.signature=u,e.localDirectory.dataDescriptor=t}}const w={start:n,end:c+i+d,$t:e};for(const[t,e]of f)if(t!=r&&w.start<e.end&&e.start<w.end){const t=new Error(Qo);throw t.overlappingEntry=e.$t,t}f.set(r,w)}({reader:u,$t:e,index:l,offset:D,crc32:b,compressedSize:g,uncompressedSize:S,dataOffset:V,dataDescriptor:A||R.bitFlag.dataDescriptor,extraFieldZip64:p||R.extraFieldZip64,qt:o});try{if(!wt){ft&&(t=new WritableStream),t=new eo(t),await no(t,function(t,e,r){return Math.min(t,r?1032*e:e)}(bt,g,yt)),({writable:Dt}=t);const{outputSize:e}=await Jr({readable:ut,writable:Dt},zt);if(t.size+=e,e!=bt)throw new Error(Qe)}}catch(e){if(e.outputSize!==T&&(t.size+=e.outputSize),!ft||e.message!=Jt)throw xt=e,e}finally{if((ro(t)||!ni(s,i,Z))&&Dt&&!Dt.locked){const t=Dt.getWriter();if(xt)try{await t.abort(xt)}catch{}else await t.close()}}return ft||wt?T:t.getData?t.getData():Dt}};function ka(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;r<e;r++)if(134630224==ui(t,r))return!0;return!1}function Ca(t,e,r){let n=0;for(;r+f<=e.length&&ui(t,r)==s;)r+=f+ci(t,r+28)+ci(t,r+30)+ci(t,r+32),n++;return n%65536?0:n}function Ma(t){if(t.length>=6){const e=It(t);if(ui(e,0)==i){const r=ci(e,4);if(6+r<=t.length)return t.subarray(6,6+r)}}}function va(t,e,r){const n=t.rawBitFlag=ci(e,r+2),o=!(1&~n),a=ui(e,r+6);Object.assign(t,{encrypted:o,version:ci(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:a,lastModDate:ai(a),filenameLength:ci(e,r+22),extraFieldLength:ci(e,r+24)})}function Na(t,e,r,n,o){const{rawExtraField:a}=e,i=e.extraField=new Map,s=It(a);let c=0,u=!1;try{for(;c<a.length;){const t=ci(s,c),e=ci(s,c+2);i.set(t,{type:t,data:a.slice(c+4,c+4+e)}),c+=4+e}}catch{u=!0}c>a.length&&(u=!0);const l=ci(r,n+4);Object.assign(e,{signature:ui(r,n+10),crc32:ui(r,n+10),compressedSize:ui(r,n+14),uncompressedSize:ui(r,n+18)});const f=i.get(1);f&&(function(t,e){e.zip64=!0;const r=It(t.data),n=Da.filter(([t,r])=>e[t]==r),o=n.reduce((t,[,e])=>t+xa[e].bytes,0);if(t.data.length<o)throw new Error(qo);for(let o=0,a=0;o<n.length;o++){const[i,s]=n[o],c=xa[s];e[i]=t[i]=c.Kt(r,a),a+=c.bytes}}(f,e),e.extraFieldZip64=f);const d=i.get(28789);d&&(_a(d,so,co,e,t),e.extraFieldUnicodePath=d);const w=i.get(25461);w&&(_a(w,uo,lo,e,t),e.extraFieldUnicodeComment=w);const p=i.get(h);p&&p.data.length>=7?(function(t,e,r){const n=It(t.data),o=si(n,4);Object.assign(t,{vendorVersion:si(n,0),vendorId:si(n,2),strength:o,originalCompressionMethod:r,compressionMethod:ci(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=T)}(p,e,l),e.extraFieldAES=p):e.compressionMethod=l;const S=i.get(13);S&&(Ba(S,e),e.extraFieldPkwareUnix=S);const g=i.get(22613);g&&(Ba(g,e),e.extraFieldUnixType1=g);const A=i.get(10);A&&(function(t,e){const r=It(t.data);let n,o=4;try{for(;o<t.data.length&&!n;){const e=ci(r,o),a=ci(r,o+2);1==e&&(n=t.data.slice(o+4,o+4+a)),o+=4+a}}catch{}if(n&&24==n.length){const r=It(n),o=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:o,rawLastAccessDate:a,rawCreationDate:i});const s={lastModDate:ii(o),lastAccessDate:ii(a),creationDate:ii(i)};Object.assign(t,s),Object.assign(e,s,{rawLastAccessDate:a,rawCreationDate:i})}}(A,e),e.extraFieldNTFS=A);const R=i.get(E);let z;if(R&&(z=ja(R,e,!1),e.extraFieldUnix=R),!z){const t=i.get(b);t&&(ja(t,e,!0),e.extraFieldInfoZip=t)}const D=i.get(m);D&&(function(t,e,r){if(!t.data.length)return;const n=It(t.data),o=si(n,0),a=[],i=[];r?(1&~o||(a.push(mo),i.push(yo)),2&~o||(a.push(bo),i.push(Eo)),4&~o||(a.push(So),i.push(go))):t.data.length>=5&&(a.push(mo),i.push(yo));let s=1;a.forEach((r,o)=>{if(t.data.length>=s+4){const a=ui(n,s);e[r]=t[r]=new Date(1e3*(0|a));const c=i[o];t[c]=a}s+=4})}(D,e,o),e.extraFieldExtendedTimestamp=D);const x=i.get(y);return x&&(e.extraFieldUSDZ=x),u}function _a(t,e,r,n,o){if(t.data.length<5)return void(t.valid=!1);const a=It(t.data),i=new Lt;i.append(o[r]);const s=It(new Uint8Array(4));s.setUint32(0,i.get(),!0);const c=ui(a,1),u=si(a,0);Object.assign(t,{version:u,[e]:on(t.data.subarray(5)),valid:1==u&&!o.bitFlag.languageEncodingFlag&&c==ui(s,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Ba(t,e){if(t.data.length<8)return;const r=It(t.data),n={lastAccessDate:new Date(1e3*(0|ui(r,0))),lastModDate:new Date(1e3*(0|ui(r,4)))};t.data.length>=12&&(n.uid=ci(r,8),n.gid=ci(r,10)),Object.assign(t,n),Object.assign(e,n)}function ja(t,e,r){try{const n=It(t.data);let o,a;if(r){let e=0;const r=si(n,e++),i=si(n,e++);o=Pa(t.data.subarray(e,e+i)),e+=i;const s=si(n,e++);a=Pa(t.data.subarray(e,e+s)),Object.assign(t,{version:r,uid:o,gid:a})}else t.data.length>=4&&(o=ci(n,0),a=ci(n,2),Object.assign(t,{uid:o,gid:a}));return o!==T&&(e.uid=o),a!==T&&(e.gid=a),o!==T||a!==T}catch{}}function Pa(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function La(t,e,r){const n=ui(t,e);let o,a;return r?(o=li(t,e+4),a=li(t,e+12)):(o=ui(t,e+4),a=ui(t,e+8)),{crc32:n,compressedSize:o,uncompressedSize:a}}function Wa(t,e){return t.Gt?t.Gt(e):0}async function Za(t){return ui(It(await ao(t,0,4)))}function Va(t){return t===J||t===Q||t===$}function Ha(t,e){return Ga(t,Ga(e,Q))}function Ga(t,e){const r=t.strictness;if(r!==T){if(!Va(r))throw new Error(na);return r}const n=t.checkAmbiguity;return n===T?e:n?J:e==$?$:Q}function Ka(t,e){if(e==$)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(r.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Aa.test(t))||e==J&&(r.includes(".")||r.includes(""))}function qa(t,r){if(t!==T){const e=ft(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw new Error(aa);return e}return r==J?0:r==$?1/0:e}async function Ya(t,e,r){const{size:n}=t,o=Math.min(n,65557),a={count:64};let i,s,c=0;for await(const[r,u,l,f,w]of Xa(t,o)){const o=ci(r,f+20);if(w+d+o==n){const o=await Qa(t,r,u,f,w,n,a);if(2==o){if(i||(i=Ja(l,f,w)),c++,!e||c>1)break}else 1!=o||s||(s=Ja(l,f,w))}}return i||(i=s),i||(i=await async function(t,e,r){const{size:n}=t,o=Math.min(n,e==1/0?n:65557+e);let a,i;for await(const[e,s,c,u,l]of Xa(t,o)){const o=Ja(c,u,l);a||(a=o);const f=await Qa(t,e,s,u,l,n,r);if(2==f)return o;1!=f||i||(i=o)}return i||a}(t,r,a)),{Yt:i,Xt:c}}async function*Xa(t,e){const r=t.size-e,n=await ao(t,r,e),o=It(n);for(let t=n.length-d;t>=0;t--)ui(o,t)==c&&(yield[o,r,n,t,r+t])}function Ja(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Qa(r,n,o,a,i,c,u){const f=ci(n,a+10),d=ui(n,a+12),p=ui(n,a+16);if(f==e||d==t||p==t)return await $a(r,n,o,i-w,c,u)==l?2:0;if(!f&&!d)return 1;const h=ci(n,a+6);for(const t of[i-d,Wa(r,h)+p])if(await $a(r,n,o,t,c,u)==s)return 2;return 0}async function $a(t,e,r,n,o,a){return n<0||n+4>o?T:n>=r?ui(e,n-r):a.count>0?(a.count--,ui(It(await ao(t,n,4)),0)):T}function ti(t,e,r){t?ri(r):ei(e,r)}function ei(t,e,r){if(!t.some(t=>t.reason==e)){const n={reason:e};r!==T&&(n.filename=r),t.push(n)}}function ri(t){const e=new Error(ta);throw e.reason=t,e}function ni(t,e,r){return e[r]===T?t.options[r]:e[r]}function oi(t,e,r){return at(ni(t,e,r))}function ai(t){const r=(4294901760&t)>>16,n=t&e,o=new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return o<O?O:o}function ii(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function si(t,e){return t.getUint8(e)}function ci(t,e){return t.getUint16(e,!0)}function ui(t,e){return t.getUint32(e,!0)}function li(t,e){const r=t.getBigUint64(e,!0);if(r>Fa)throw new Error(ia);return Number(r)}var fi=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ta,ERR_BAD_FORMAT:Zo,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Go,ERR_ENCRYPTED:Yo,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ea,ERR_ENTRY_DATA_OUT_OF_BOUNDS:$o,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Ho,ERR_EOCDR_NOT_FOUND:Vo,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:qo,ERR_INVALID_AUTHENTICATION_CODE:Xt,ERR_INVALID_COMPRESSED_DATA:$e,ERR_INVALID_CRC32:tr,ERR_INVALID_FILENAME_VALIDATION:oa,ERR_INVALID_MAX_APPENDED_DATA_SIZE:aa,ERR_INVALID_PASSWORD:Yt,ERR_INVALID_STRICTNESS:na,ERR_INVALID_UNCOMPRESSED_SIZE:Qe,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ko,ERR_OVERLAPPING_ENTRY:Qo,ERR_SPLIT_ZIP_FILE:Jo,ERR_UNSAFE_FILENAME:ra,ERR_UNSUPPORTED_COMPRESSION:We,ERR_UNSUPPORTED_ENCRYPTION:Xo,ERR_UNSUPPORTED_UINT64:ia,ERR_WORKER_STARTUP_TIMEOUT:gr,WARNING_APPENDED_DATA:wa,WARNING_COMPRESSED_PATCHED_DATA:ua,WARNING_DUPLICATE_FILENAME:ya,WARNING_MALFORMED_EXTRA_FIELD:la,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:Ea,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:Sa,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ga,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:ba,WARNING_PREPENDED_CENTRAL_DIRECTORY:ha,WARNING_PREPENDED_DATA:pa,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:ma,WARNING_UNKNOWN_VERSION:ca,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:fa,WARNING_UNSORTED_CENTRAL_DIRECTORY:sa,WARNING_WRAPPED_ENTRIES_COUNT:da,ZipReader:Oa,ZipReaderStream:Ta,isZipFile:Ua});const di="File already exists",wi="Zip file comment exceeds 64KB",pi="Invalid zip file comment (must be a Uint8Array)",hi="File entry comment exceeds 64KB",mi="Invalid file entry comment (must be a string)",yi="Invalid date (must be a valid Date instance)",bi="File entry name exceeds 64KB",Ei="Version exceeds 65535",Si="The strength must equal 1, 2, or 3",gi="Encryption is not supported in USDZ files",Ai="Split zip files are not supported in USDZ files",Ri="Encryption is not supported when the 'passThrough' option is set",zi="Invalid extra field (must be a Map)",Di="Invalid extra field type (must be integer 0..65535)",xi="Invalid extra field data (must be a Uint8Array)",Fi="Extra field data exceeds 64KB",Oi=-2147483648,Ti=2147483647,Ui=BigInt(0),Ii=BigInt("0x7fffffffffffffff"),ki="Zip64 is not supported (set the 'zip64' option to 'true')",Ci="Undefined uncompressed size",Mi="Undefined compression method",vi="Undetermined size",Ni="Undefined reader",_i="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",Bi="Zip file not empty",ji="Invalid uid (must be integer 0..2^32-1)",Pi="Invalid gid (must be integer 0..2^32-1)",Li="Invalid UNIX mode (must be integer 0..65535)",Wi="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Zi="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Vi="Invalid msdosAttributesRaw (must be integer 0..255)",Hi="Invalid msdosAttributes (must be an object with boolean flags)",Gi="Invalid level (must be integer 0..9)",Ki="Signature data exceeds 64KB",qi=new Uint8Array([7,0,2,0,65,69,3,0,0]),Yi="infozip",Xi="unix";let Ji=0;const Qi=[];class $i{constructor(t,e={}){t=new eo(t);const{availableSize:r=U,maxSize:n=U}=t,o=r>0&&r!==U&&n>0&&n!==U;if(o&&e[G])throw new Error(Ai);Object.assign(this,{writer:t,te:o,options:e,ee:new Map,re:new Set,offset:e[H]===T?t.size||t.writable.size||0:e[H],ne:e[H]===T?0:e[H]-(t.size||t.writable.size||0),oe:new Set,ae:[],ie:0,se:0,ce:T})}prependZip(t){return rs(this,async function(t,e){if(t.re.size)throw new Error(Bi);await t.ue(e)}(this,t))}appendZip(t){return rs(this,this.ue(t))}async ue(t){const e=this,{oe:r,re:n,ee:a}=e;for(;r.size;)await Promise.allSettled(Array.from(r));let i;const s=new Promise(t=>i=t);r.add(s);const c=[];let u;try{t=new to(t),await no(t),t.size!==T&&t.readUint8Array||(t=new xn(await _e(t.readable)),await no(t));const{ZipReader:r}=await Promise.resolve().then(function(){return fi}),i=new r(t),s=await i.getEntries();await i.close(),await no(e.writer);const{directoryOffset:l}=i;s.forEach(({filename:t})=>{if(n.has(t))throw new Error(di);n.add(t),c.push(t)}),e.le=!0;const{fe:f}=e;e.fe=new Promise(t=>u=()=>{e.le=!1,t()}),await f,e.te&&(delete e.te,await async function(t){return It(await ao(t,0,4)).getUint32(0,!0)==o}(t)||(await Ds(e.writer,Rs()),e.offset+=4));const d=await async function(t,e,r,n){const{writer:o}=t,a=new Map;if(o.closeDisk){const i=Array.from(r).sort((t,r)=>As(e,t)-As(e,r));let s=0;for(const r of i){const n=As(e,r);await Ss(t,e,s,n-s),ys(o,await gs(e,n))&&await o.closeDisk(),a.set(r,{offset:bs(t,o),diskNumberStart:hs(o)}),s=n}await Ss(t,e,s,n-s)}else{const o=t.offset;await Ss(t,e,0,n),r.forEach(t=>a.set(t,{offset:o+As(e,t),diskNumberStart:0}))}return a}(e,t,s,l);s.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:n,bitFlag:o,encrypted:i,uncompressedSize:s,compressedSize:c,extraFieldZip64:u}=t;let{compressionMethod:l,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:h}=o;f=Es(f||v),t.extraFieldAES&&(l=99);const m=Ws(f),y=Boolean(u)&&u.uncompressedSize!==T,b=Boolean(u)&&u.compressedSize!==T,E=-7&Vs(w,p,h,i,l)|w<<1,{de:S,we:g}=Zs({version:e,bitFlag:E,compressionMethod:l,uncompressedSize:s,compressedSize:c,rawLastModDate:r,rawFilename:n,pe:b,he:y,extraFieldLength:m}),{crc32:A}=t;A!==T&&js(g,10,A);const{offset:R,diskNumberStart:z}=d.get(t);Object.assign(t,{me:!0,he:y,pe:b,offset:R,diskNumberStart:z,ye:!1,be:v,Ee:v,Se:v,ge:v,Ae:v,rawExtraField:f,Re:v,extendedTimestamp:!1,de:S,we:g}),a.set(t.filename,t)})}catch(t){throw c.forEach(t=>n.delete(t)),t}finally{i(),r.delete(s),u&&u()}}add(e="",n,o={}){const a=this,{oe:i}=a,s=async function(e,n,o,a){if(Is(e,a=Object.assign({},a),ko)&&!n.endsWith(D)&&(n+=D),e.re.has(n))throw new Error(di);e.re.add(n),Ji<St().maxWorkers?Ji++:await new Promise(t=>Qi.push(t));try{return await async function(e,n,o,a){const i=as(e,n,a);({name:n}=i);const s=is(e,n,a),{comment:c}=s,u=a[No];e.ee.set(n,T);const l=e.ce,f={};let d,w;s.ze.keepOrder&&(f.De=new Promise(t=>d=t)),e.ce=f;try{const{ze:c}=s;0==c.level||c.compressionMethod!==T||c.passThrough||await xr(St())||(c.level=0);const u=await async function(t,e,{ze:r},n){if(r.passThrough&&!e&&!Is(t,n,ko))throw new Error(Ni);let o;if(e){if(e=new to(e),await no(e),!e.readable&&!e.readUint8Array)throw new Error(_i);({size:o}=e)}return Object.assign({reader:e},cs(t,Boolean(e),o,r,n))}(e,o,s,a);({reader:o}=u);const p=ms(e.writer),h=hs(e.writer),m=us(a=Object.assign({},a,i.ze,s.ze,u.ze,{signature:a[vo],crc32:a.crc32===T?a[vo]:a.crc32,offset:e.offset-p,diskNumberStart:h,[G]:e.options[G]})),y=ds(a),b=Ws(m.xe,y.Fe);w=await async function(e,n,o,a,i){const{ee:s,writer:c}=e,{keepOrder:u,dataDescriptor:l,Oe:f,signal:d}=i,{Te:w,$t:p,Ue:h,Ie:m}=a,y=e.options[G];let b,E,S,g,A,R,z,D=p,F=0;const O=u&&h?h.De:T;s.set(n,D);try{i.bufferedWrite||!u||e.le||e.ie||e.se||!l&&!f?(b=!0,e.ie++,z=i.createTempStream?await i.createTempStream():new TransformStream(T,T,{highWaterMark:U}),z.size=0,await no(c)):(E=!0,e.se++,z=c,await O,await I()),await no(z);const p=ms(c);e.te&&!b&&await zs(e,c),y&&!b&&ls(a,e.offset-p);const{xe:h}=w;b||await k();const m=hs(c),S=bs(e,c);if(D.diskNumberStart=m,b||(A=!0,R=c.size,await Ds(z,h)),D=await async function(e,n,{diskNumberStart:o,De:a},i,s,c){const{Te:u,ke:l,Ce:f}=i,{de:d,we:w,lastModDate:p,rawLastModDate:h,encrypted:m,compressed:y,version:b,compressionMethod:E,be:S,Me:g,Se:A,ve:R,ge:z,Ae:D,Ee:x}=u,{Fe:F}=l,{rawFilename:O,lastAccessDate:U,creationDate:I,password:k,rawPassword:C,level:M,zip64:v,me:N,he:_,pe:B,zipCrypto:j,dataDescriptor:P,directory:L,executable:W,versionMadeBy:Z,rawComment:V,rawExtraField:H,Re:G,useWebWorkers:K,transferStreams:q,onstart:Y,onprogress:X,onend:J,signal:Q,encryptionStrength:$,extendedTimestamp:tt,msDosCompatible:et,internalFileAttributes:rt,externalFileAttributes:nt,uid:ot,gid:at,unixMode:it,symlink:st,setuid:ct,setgid:ut,sticky:lt,unixExternalUpper:ft,msdosAttributesRaw:dt,msdosAttributes:wt,useCompressionStream:pt,passThrough:ht,format:mt,codecURI:yt}=c,bt={De:a,versionMadeBy:Z,zip64:v,me:N,directory:Boolean(L),executable:Boolean(W),filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:V,be:S,Me:g,Se:A,ge:z,Ae:D,Ee:x,rawExtraField:H,Re:G,extendedTimestamp:tt,msDosCompatible:et,internalFileAttributes:rt,externalFileAttributes:nt,diskNumberStart:o,uid:ot,gid:at,unixMode:it,symlink:Boolean(st),setuid:ct,setgid:ut,sticky:lt,unixExternalUpper:ft,msdosAttributesRaw:dt,msdosAttributes:wt};let{crc32:Et,uncompressedSize:St}=c,gt=0;ht||(St=0);const{writable:At}=n;if(e){const o=e.size,a=Ne(io(e,{size:o})),i={options:{codecType:yr,inputSize:o,level:M,rawPassword:C,password:k,encryptionStrength:$,zipCrypto:m&&j,passwordVerification:m&&j&&h>>8&r,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:K,useCompressionStream:pt,transferStreams:q,format:mt,codecURI:yt,compressionMethod:E},config:s,ft:{signal:Q,size:o,onstart:Y,onprogress:X,onend:J}};try{const e=await Jr({readable:a,writable:At},i);if(gt=e.outputSize,n.size+=gt,ht||(St=e.inputSize,m&&!j||(Et=e.crc32)),!B&>>=t||!_&&St>=t)throw new Error(ki)}catch(t){throw t.outputSize!==T&&(n.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:r,Te:n,ke:o},{zip64:a,zipCrypto:i,passThrough:s,dataDescriptor:c}){const{we:u,encrypted:l}=n,{Ne:f,_e:d}=o;l&&!i&&!s||t===T||(js(u,10,t),c&&js(f,d,t)),a?c&&(Ps(f,d+4,BigInt(e)),Ps(f,d+12,BigInt(r))):(js(u,14,e),js(u,18,r),c&&(js(f,d+4,e),js(f,d+8,r)))}({crc32:Et,compressedSize:gt,uncompressedSize:St,Te:u,ke:l},c),P&&await Ds(n,F),Object.assign(bt,{uncompressedSize:St,compressedSize:gt,lastModDate:p,rawLastModDate:h,creationDate:I,lastAccessDate:U,encrypted:Boolean(m),zipCrypto:Boolean(j),size:f+gt,compressionMethod:E,version:b,de:d,we:w,signature:Et,crc32:!m||j||ht?Et:T,ve:R,he:_,pe:B}),bt}(o,z,D,a,St(),i),b||(A=!1),s.set(n,D),D.filename=n,b){if(await Promise.all([z.writable.getWriter().close(),O]),await I(),e.te&&await zs(e,c),g=!0,R=c.size,await k(),D.diskNumberStart=hs(c),D.offset=bs(e,c),y){const t=a.Ce;ls(a,e.offset-ms(c)),D.size+=a.Ce-t}!function({rawFilename:t,encrypted:e,zip64:r,Me:n,crc32:o,compressedSize:a,uncompressedSize:i,he:s,pe:c},u,{dataDescriptor:l,passThrough:f}){if(l||((!e||f&&o!==T)&&js(u,14,o),c||js(u,18,a),s||js(u,22,i)),r&&n){const e=x+Ws(t)+4;Ps(u,e,BigInt(i)),Ps(u,e+8,BigInt(a))}}(D,w.Be,i),await Ds(c,w.xe),await xs(z.readable,c,d,t=>F+=t),c.size+=z.size,g=!1}else D.diskNumberStart=m,D.offset=S;return e.offset+=D.size,D}catch(t){if(g||A){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-R,b&&(e.offset+=F)}throw s.delete(n),t}finally{if(b&&e.ie--,E&&e.se--,m&&m(O),S&&S(),b&&z&&z.dispose)try{await z.dispose()}catch{}}async function I(){e.le=!0;const{fe:t}=e;e.fe=new Promise(t=>S=()=>{e.le=!1,t()}),await t}async function k(){ys(c,Ws(w.xe))&&await c.closeDisk()}}(e,n,o,{Te:m,ke:y,Ce:b,$t:f,Ue:l,Ie:d},a)}catch(t){throw e.ee.delete(n),t}finally{d&&d(l&&l.De)}return Object.assign(w,{name:n,comment:c,extraField:u}),new Wo(w)}(e,n,o,a)}catch(t){throw e.re.delete(n),t}finally{const t=Qi.shift();t?t():Ji--}}(a,e,n,o);i.add(s);const c=()=>i.delete(s);return Promise.prototype.then.call(s,c,c),rs(a,s)}remove(t){const{re:e,ee:r}=this;if(typeof t==M&&(t=r.get(t)),t&&t.filename!==T){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=v,n={}){const o=this,{oe:a,writer:w}=this,{writable:p}=w;if(!(r instanceof Uint8Array))throw new Error(pi);if(Ws(r)>e)throw new Error(wi);for(;a.size;)await Promise.allSettled(Array.from(a));await Promise.allSettled(o.ae.map(t=>t.je));const h=o.ae.filter(t=>t.error&&!t.Pe);if(h.length){const t=h.map(t=>t.error);h.forEach(t=>t.Pe=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(r,n,o){const{Le:a,We:w}=ws(r.ee),{Ze:p,Ve:h,He:m}=await async function(r,n,o){const{ee:a,writer:i}=r,c=new Uint8Array(n);await no(i);let u=0,l=0,d=hs(i),w=ms(i),p=0;for(const[r,n]of Array.from(a.values()).entries()){const{offset:h,rawFilename:m,be:y,Ee:b,Se:E,ge:S,Ae:g,rawExtraField:A,Re:R,rawComment:z,versionMadeBy:D,de:x,we:F,he:O,pe:T,ye:U,Ge:I,internalFileAttributes:k,externalFileAttributes:C,diskNumberStart:M,uncompressedSize:v,compressedSize:N}=n,_=Ws(y,b,E,S,g,A,R),B=f+Ws(m,z)+_;ys(i,u+B-l)&&(await Ds(i,c.slice(l,u)),l=u,p=0,await i.closeDisk()),0==r&&(d=hs(i),w=ms(i)),O||js(F,18,v),T||js(F,14,N),(I||U)&&n.version<45&&Bs(F,0,45);const j=ps(B);if(j.Ke(s),j.qe(D),j.Ye(x.subarray(0,24)),j.qe(_),j.qe(Ws(z)),j.qe(U?e:M),j.qe(k),j.Ke(C),j.Ke(I?t:h),j.Ye(m),j.Ye(y),j.Ye(b),j.Ye(E),j.Ye(S),j.Ye(g),j.Ye(A),j.Ye(R),j.Ye(z),Ls(c,j.Lt,u),u+=B,p++,o.onprogress)try{await o.onprogress(r+1,a.size,new Wo(n))}catch{}}return await Ds(i,l?c.slice(l):c),{Ze:{diskNumber:d,diskOffset:w},Ve:{diskNumber:hs(i),Xe:p},He:c}}(r,a,o),y=await async function(t,r,n){const o=Cs(t,n,q);if(o){const n=await o(r),a=Ws(n);if(a>e)throw new Error(Ki);const s=ps(6+a);s.Ke(i),s.qe(a),s.Ye(n);const{writer:c}=t;return ys(c,Ws(s.Lt))&&await c.closeDisk(),await Ds(c,s.Lt),6+a}return 0}(r,m,o);await async function(r,n,o,a){const{writer:i}=r,{Ze:s,Ve:f,Je:w,We:p}=a;let{Le:h}=a,m=r.ee.size,y=s.diskNumber,b=bs(r,s);const E=Ws(n);if(E>e)throw new Error(wi);let S=Is(r,o,Fo),g=hs(i);if(ys(i,(S?98:d)+E)&&g++,b>=t||h>=t||m>=e||g>=e){if(!1===S)throw new Error(ki);S=!0}else S===T&&p&&(S=!0);const A=ps(S?98:d);ys(i,Ws(A.Lt)+E)&&await i.closeDisk(),g=hs(i);let R=g==f.diskNumber?f.Xe:0;S&&(A.Ke(u),A.Qe(44),A.qe(45),A.qe(45),A.Ke(g),A.Ke(y),A.Qe(R),A.Qe(m),A.Qe(h),A.Qe(b),A.Ke(l),A.Ke(g),A.Qe(BigInt(bs(r,i))+BigInt(h)+BigInt(w)),A.Ke(g+1),Is(r,o,"supportZip64SplitFile",!0)&&(g=e,y=e),R=e,m=e,b=t,h=t),A.Ke(c),A.qe(g),A.qe(y),A.qe(R),A.qe(m),A.Ke(h),A.Ke(b),A.qe(E),await Ds(i,A.Lt),E&&await Ds(i,n)}(r,n,o,{Ze:p,Ve:h,Le:a,Je:y,We:w})}(o,r,n),!ro(w)&&Is(o,n,Z)||await p.getWriter().close(),w.getData?w.getData():p}}class ts{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new $i(r,t),this.oe=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:o}=new TransformStream({start(t){r=t},flush:()=>{!async function(){try{await e.close()}catch(t){await ns(e,t)}}()}});return os(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return os(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){const{zipWriter:r}=this,n=(await Promise.allSettled(Array.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(n.length){const[t]=n;try{t.entryErrors=n}catch{}throw await ns(r,t),t}try{return await r.close(t,e)}catch(t){throw await ns(r,t),t}}}class es extends Promise{then(t,e){const{$e:r}=this;return r&&(r.Pe=!0),super.then(t,e)}}function rs(t,e){const r=new es((t,r)=>Promise.prototype.then.call(e,t,r)),n={};return r.$e=n,n.je=Promise.prototype.then.call(r,T,t=>n.error=t),t.ae.push(n),r}async function ns(t,e){try{await t.writer.writable.abort(e)}catch{}}function os(t,e,r){t.oe.add(e),e.catch(t=>{try{r(t)}catch{}})}function as(n,o,a){let i=Is(n,a,xo),s=Is(n,a,Uo,i?20:768);const c=Is(n,a,Co),u=Ms(n,a,"uid"),l=Ms(n,a,"gid");let f=Ms(n,a,_o),d=Is(n,a,"unixExtraFieldType"),w=Is(n,a,Bo),p=Is(n,a,jo),h=Is(n,a,Po);if(lt(u,t,ji),lt(l,t,Pi),lt(f,e,Li),d!==T&&d!==Yi&&d!==Xi)throw new Error(Wi);if(d===Xi&&(u!==T&&u>e||l!==T&&l>e))throw new Error(Zi);d!==T||u===T&&l===T||(d=Yi);let m=Ms(n,a,zo),y=Is(n,a,Do);const b=m!==T||y!==T;if(u!==T||l!==T||f!==T||d||c?(i=!1,s=s&r|768):b&&(i=!0,s&=r),lt(m,r,Vi),y&&(typeof y!==C||Array.isArray(y)))throw new Error(Hi);if(s>e)throw new Error(Ei);let E=Is(n,a,Ro);const S=E!==T;S||(E=0),!a[ko]&&o.endsWith(D)&&(a[ko]=!0);const x=Is(n,a,ko);if(x?(o.endsWith(D)||(o+=D),S||(E=16,i||(E|=16877<<16))):i||S||(E=c?493<<16:27525120),!i){const t=f!==T||Boolean(w||p||h);f=f===T?E>>16&e:f&e,w?f|=R:w=Boolean(f&R),p?f|=z:p=Boolean(f&z),h?f|=512:h=Boolean(512&f),S&&!t||(x?f=-61441&f|A:f&g||(f|=32768),E=(f&e)<<16|E&e)}({msdosAttributesRaw:m,msdosAttributes:y}=function(t,e){if(t!==T)t&=r;else if(e!==T){const{readOnly:n,hidden:o,system:a,directory:i,archive:s}=e;let c=0;n&&(c|=1),o&&(c|=2),a&&(c|=4),i&&(c|=16),s&&(c|=32),t=c&r}return e===T&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(m,y)),b&&(E=E&t|m&r);const F=E>>16&e,O=f!==T&&40960==(f&g);return{name:o,ze:{versionMadeBy:s,msDosCompatible:Boolean(i),externalFileAttributes:E,unixExternalUpper:F,uid:u,gid:l,unixMode:f,unixExtraFieldType:d,symlink:O,setuid:w,setgid:p,sticky:h,msdosAttributesRaw:m,msdosAttributes:y}}}function is(t,r,n){const o=Cs(t,n,"encodeText")||Zt;let a=o(r,Y);if(a===T&&(a=Zt(r)),Ws(a)>e)throw new Error(bi);const i=n[uo]||"";if(typeof i!=M)throw new Error(mi);let s=o(i,X);if(s===T&&(s=Zt(i)),Ws(s)>e)throw new Error(hi);const c=Is(t,n,To);if(c!==T&&c>e)throw new Error(Ei);const u=ks(t,n,mo,new Date),l=Is(t,n,yo),f=ks(t,n,bo),d=ks(t,n,So),w=Is(t,n,Ao,0),p=Is(t,n,B),h=Is(t,n,N),m=Is(t,n,_);ct(h,m);const y=Ms(t,n,"encryptionStrength",3),b=Is(t,n,Io),E=Is(t,n,"extendedTimestamp",!0),S=Is(t,n,"ntfsTimestamp"),g=Is(t,n,"keepOrder",!0),A=Is(t,n,P),R=Is(t,n,W),z=Is(t,n,"bufferedWrite"),D=Cs(t,n,"createTempStream"),x=Is(t,n,"dataDescriptorSignature",!0),F=it(Is(t,n,j));st(F);const O=Is(t,n,"useUnicodeFileNames",!0),U=Is(t,n,Mo),I=p||U===T?T:qe(U);if(!p&&U!==T&&0!==U&&8!==U&&!I)throw new Error(We);let k=Ms(t,n,"level");if(lt(k,9,Gi),t.options[G]){if(h!==T||m!==T)throw new Error(gi);k===T&&U===T&&(k=0)}p&&(k=T);let C=Is(t,n,L),v=Is(t,n,V);z&&v===T&&(v=!1),(v===T||b&&!p)&&(v=!0),k!==T&&6!=k&&(C=!1);const Z=Is(t,n,Fo);if(!(b||h===T&&m===T||Number.isInteger(y)&&y>=1&&y<=3))throw new Error(Si);const H=ss(n[No]),K=ss(n.localExtraField),q=ss(n.centralExtraField);return{comment:i,ze:{rawFilename:a,rawComment:s,version:c,lastModDate:u,rawLastModDate:l,lastAccessDate:f,creationDate:d,internalFileAttributes:w,passThrough:p,password:h,rawPassword:m,encryptionStrength:y,zipCrypto:b,extendedTimestamp:E,ntfsTimestamp:S,keepOrder:g,useWebWorkers:A,transferStreams:R,bufferedWrite:z,createTempStream:D,dataDescriptorSignature:x,signal:F,useUnicodeFileNames:O,compressionMethod:U,format:I?I.format:T,codecURI:I?I.codecURI:T,er:I?I.versionNeeded:T,level:k,useCompressionStream:C,dataDescriptor:v,zip64:Z,rawExtraField:H,rr:K,Re:q}}}function ss(t){if(!t)return v;if(!(t instanceof Map))throw new Error(zi);let r=0,n=0;t.forEach((t,n)=>{if(ut(n,e,Di),!(t instanceof Uint8Array))throw new Error(xi);if(Ws(t)>e)throw new Error(Fi);r+=4+Ws(t)});const o=new Uint8Array(r),a=It(o);return t.forEach((t,e)=>{Bs(a,n,e),Bs(a,n+2,Ws(t)),Ls(o,t,n+4),n+=4+Ws(t)}),o}function cs(e,r,n,o,a){const{passThrough:i,zipCrypto:s,password:c,rawPassword:u,encryptionStrength:l}=o;let{dataDescriptor:f,zip64:d,level:w,compressionMethod:p}=o,h=0,m=0,y=!1;if(i&&r){if(m=a[fo],m===T)throw new Error(Ci);if(p===T)throw new Error(Mi)}const b=!0===d,E=Is(e,a,Oo);if(r&&i&&!E&&Ws(c,u))throw new Error(Ri);const S=r&&(Boolean(c&&Ws(c)||u&&Ws(u))||i&&E);r||(w=0,p=0);const g=S?s?12:16+4*l:0;r&&(i?(a.uncompressedSize=m,h=n===T?vs(m)+g:n):n===T?(f=!0,(d||d===T)&&(d=y=!0,h=4294967296)):(a.uncompressedSize=m=n,h=(Ns(p,w)?vs(m):m)+g));const A=!(S||r&&(0!==n||i)||Ns(p,w));A&&!s&&Is(e,a,V)===T&&(f=!1);const R=b||y||m>=t,z=b||h>=t;if(R||z){if(!1===d)throw new Error(ki);d=!0}return d=d||!1,{nr:h,ze:{dataDescriptor:f,Oe:A,zip64:d,me:b,ar:y,he:R,pe:z,uncompressedSize:m,level:w,compressionMethod:p,encrypted:S}}}function us(t){const{rawFilename:r,lastModDate:o,rawLastModDate:a,lastAccessDate:i,creationDate:s,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:f,dataDescriptor:d,directory:w,rawExtraField:p,rr:y,encryptionStrength:S,extendedTimestamp:g,ntfsTimestamp:A,passThrough:R,encrypted:z,he:D,pe:U,uncompressedSize:I,ar:k,crc32:C}=t;let{version:M,compressionMethod:N}=t;const _=!w&&Ns(N,c);let B;const j=R||!_,P=u&&(t.bufferedWrite||!d||!D&&!U||j&&!k),L=P||u&&d&&(D||U);if(u&&(D||U)){const t=20,e=ps(t);if(e.qe(1),e.qe(t-4),B=e.Lt,P&&(e.Qe(I),j)){const t=z?l?12:16+4*S:0;e.Qe(R?0:I+t)}}else B=v;let W,Z,V,H,K;if(z&&!l){const t=ps(Ws(qi)+2);t.qe(h),t.Ye(qi),W=t.Lt,W[8]=S}else W=v;if(g){const t=Os(o),e=Ts(t);if(e){const e=9+(i?4:0)+(s?4:0),r=ps(e);H=1+(i?2:0)+(s?4:0),r.qe(m),r.qe(e-4),r.ir(H),r.Ke(t),i&&r.Ke(Us(Os(i))),s&&r.Ke(Us(Os(s))),V=r.Lt}else V=v;if(A===T?!e||Boolean(i||s):A)try{const t=Fs(o),e=ps(36);e.qe(10),e.qe(32),e.sr(4),e.qe(1),e.qe(24),e.Qe(t),e.Qe(i?Fs(i):t),e.Qe(s?Fs(s):t),Z=e.Lt}catch{Z=v}else Z=v}else Z=V=v;try{const{uid:r,gid:n,unixExtraFieldType:o}=t;if(o!=Yi||r===T&&n===T)if(o!=Xi||r===T&&n===T)K=v;else{const t=ps(8);t.qe(E),t.qe(4),t.qe((r===T?0:r)&e),t.qe((n===T?0:n)&e),K=t.Lt}else{const t=fs(r===T?0:r),e=fs(n===T?0:n),o=3+t.length+e.length,a=ps(4+o);a.qe(b),a.qe(o),a.ir(1),a.ir(t.length),a.Ye(t),a.ir(e.length),a.Ye(e),K=a.Lt}}catch{K=v}N===T&&(N=_?8:0),M===T&&(M=0!=N||w||z?20:10);const{er:q}=t;_&&q!==T&&(M=M>q?M:q),u&&(M=M>45?M:45),z&&!l&&(M=M>51?M:51,R&&C!==T&&(W[4]=1),Bs(It(W),9,N),N=99);const Y=L?Ws(B):0,X=Y+Ws(W,V,Z,K,p,y);if(X+(t[G]?67:0)>e)throw new Error(Fi);const J=new Date(2e3*Math.ceil(Math.floor(o.getTime()/1e3)/2)),Q=J<O?O:J>F?F:J,$=Ws(V)?new Date(1e3*Os(o)):Ws(Z)?o:Q,{de:tt,we:et,rawLastModDate:rt}=Zs({version:M,bitFlag:Vs(c,f,d,z,N),compressionMethod:N,uncompressedSize:I,lastModDate:Q,rawLastModDate:a,rawFilename:r,pe:U,he:D,extraFieldLength:X}),nt=ps(x+Ws(r)+X),ot=nt.Lt,at=It(ot);return nt.Ke(n),nt.Ye(tt),nt.Ye(r),L&&nt.Ye(B),nt.Ye(W),nt.Ye(V),nt.Ye(Z),nt.Ye(K),nt.Ye(p),nt.Ye(y),d&&(U||js(at,18,0),D||js(at,22,0)),{xe:ot,Be:at,de:tt,we:et,lastModDate:$,rawLastModDate:rt,encrypted:z,compressed:_,version:M,compressionMethod:N,ve:H,be:v,Me:Y,Se:V,ge:Z,Ae:K,Ee:W,extraFieldLength:X}}function ls(t,e){const{Te:r}=t;let{xe:n,extraFieldLength:o}=r,a=64-(e+Ws(n))%64;a<4&&(a+=64);const i=new Uint8Array(a),s=It(i);Bs(s,0,y),Bs(s,2,a-4);const c=n;r.xe=n=new Uint8Array(Ws(c)+a),Ls(n,c),Ls(n,i,Ws(c));const u=It(n);Bs(u,28,o+a),r.Be=u,t.Ce+=a}function fs(t){const e=new Uint8Array(4);It(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function ds({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,o=v,i=0,s=t?20:12;return r&&(s+=4),e&&(o=new Uint8Array(s),n=It(o),r&&(i=4,js(n,0,a))),{Fe:o,Ne:n,_e:i}}function ws(r){let n=0,o=!1;for(const[,a]of r){const{rawFilename:r,Ee:i,rawComment:s,ge:c,Ae:u,rawExtraField:l,Re:d,extendedTimestamp:w,ve:p,lastModDate:h,me:y,uncompressedSize:b,compressedSize:E}=a;let{he:S,pe:g}=a;y||(S&&b<t&&(S=a.he=!1),g&&E<t&&(g=a.pe=!1)),o=o||S||g;const A=a.offset>=t,R=a.diskNumberStart>=e;let z,D;if(A||R||S||g){const t=4+(S?8:0)+(g?8:0)+(A?8:0)+(R?4:0),e=ps(t);e.qe(1),e.qe(t-4),S&&e.Qe(b),g&&e.Qe(E),A&&e.Qe(a.offset),R&&e.Ke(a.diskNumberStart),z=e.Lt}else z=v;a.be=z,a.Ge=A,a.ye=R;const x=Os(h);if(w&&Ts(x)){const t=ps(9);t.qe(m),t.qe(5),t.ir(p),t.Ke(x),D=t.Lt}else D=v;a.Se=D;const F=Ws(z,i,c,u,D,l,d);if(F>e)throw new Error(Fi);n+=f+Ws(r,s)+F}return{Le:n,We:o}}function ps(t){const e=new Uint8Array(t),r=It(e);let n=0;return{Lt:e,ir:t=>{!function(t,e,r){t.setUint8(e,r)}(r,n,t),n+=1},qe:t=>{Bs(r,n,t),n+=2},Ke:t=>{js(r,n,t),n+=4},Qe:t=>{Ps(r,n,BigInt(t)),n+=8},Ye:t=>{Ls(e,t,n),n+=Ws(t)},sr:t=>n+=t}}function hs(t){const{diskNumber:e=0}=t;return e}function ms(t){const{diskOffset:e=0}=t;return e}function ys(t,e){const{availableSize:r=U}=t;return e>r}function bs(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.ne:0)}function Es(t){const e=It(t);let r=0;for(;r+4<=Ws(t);){const n=4+_s(e,r+2);if(1==_s(e,r))return Es(Tt(t.subarray(0,r),t.subarray(Math.min(r+n,Ws(t)))));r+=n}return t}async function Ss(t,e,r,n){if(n>0){const{writer:o}=t;let a=0;try{await xs(io(e,{offset:r,size:n}),o,T,t=>a+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=a,t.offset+=a}}}async function gs(t,e){const r=await ao(t,e,x);if(Ws(r)<x)return x;const n=It(r);return x+_s(n,26)+_s(n,28)}function As(t,{offset:e,diskNumberStart:r}){return e+(t.Gt?t.Gt(r):0)}function Rs(){const t=new Uint8Array(4);return js(It(t),0,o),t}async function zs(t,e){delete t.te,await Ds(e,Rs()),t.offset+=4}async function Ds(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Ws(e),await n.write(e)}finally{n.releaseLock()}}async function xs(t,e,r,n){const o=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){await o.ready,await o.write(t),n(Ws(t))}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{o.releaseLock()}}function Fs(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<Ui?Ui:e>Ii?Ii:e}}function Os(t){return Math.floor(t.getTime()/1e3)}function Ts(t){return t>=Oi&&t<=Ti}function Us(t){return Math.min(Ti,Math.max(Oi,t))}function Is(t,e,r,n){const o=e[r]===T?t.options[r]:e[r];return o===T?n:o}function ks(t,e,r,n){const o=Is(t,e,r,n);if(null===o)return n;if(o!==T&&(typeof o.getTime!=k||Number.isNaN(o.getTime())))throw new Error(yi);return o}function Cs(t,e,r){return at(Is(t,e,r))}function Ms(t,e,r,n){return ft(Is(t,e,r,n))}function vs(t){return t+5*(Math.floor(t/16383)+1)}function Ns(t,e){return t===T?e===T||e>0:0!==t}function _s(t,e){return t.getUint16(e,!0)}function Bs(t,e,r){t.setUint16(e,r,!0)}function js(t,e,r){t.setUint32(e,r,!0)}function Ps(t,e,r){t.setBigUint64(e,r,!0)}function Ls(t,e,r){t.set(e,r)}function Ws(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Zs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:o,compressedSize:a,lastModDate:i,rawLastModDate:s,rawFilename:c,pe:u,he:l,extraFieldLength:f}){const d=ps(26),w=d.Lt,p=It(w);if(d.qe(e),d.qe(r),d.qe(n),s===T){const t=new Uint32Array(1),e=It(t);Bs(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Bs(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.Ke(s),d.sr(4),u||a!==T?d.Ke(u?t:a):d.sr(4),l||o!==T?d.Ke(l?t:o):d.sr(4),d.qe(Ws(c)),d.qe(f),{de:w,we:p,rawLastModDate:s}}function Vs(t,e,r,n,o){let a=0;return e&&(a|=S),r&&(a|=8),8!=o&&9!=o||(t>=0&&t<=3&&(a|=6),t>3&&t<=5&&(a|=4),9==t&&(a|=2)),n&&(a|=1),a}function Hs(){return"application/octet-stream"}function Gs(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:r,DecompressionStreamFallback:n}=St(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Ks(r,er)||Ks(t,er)||Ks(t,nr),decompression:Ks(n,er)||Ks(e,er)||Ks(e,nr),registered:!1},{compressionMethod:9,compression:!1,decompression:Ks(n,rr)||Ks(e,rr),registered:!1}];for(const t of Ye()){const e=Xe(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==k:T,decompression:e?typeof e.DecompressionStream==k:T,registered:!0})}return o}function Ks(t,e){if(!t)return!1;const{cr:r}=t;return r?r.includes(e):ur(t,e)}const qs="2.11.4",Ys=1048576,Xs=".zip.js-temp";function Js(t={}){const{thresholdBytes:e=Ys,directoryName:r=Xs,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let o;function a(){return o||(o=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),o}return function(){const t=[];let r,n,o,i,s=0,c=!1;const u=new WritableStream({async write(i){c?await o.write(i):(t.push(i),s+=i.length,s>e&&await async function(){const e=await a();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""),n=await e.getFileHandle(r,{create:!0}),o=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await o.write(e);t.length=0}())},async close(){o&&(await o.close(),o=null)}});let l=0;return{writable:u,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else l<t.length?e.enqueue(t[l++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(o){try{await o.close()}catch{}o=null}if(r){try{const t=await a();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const Qs=1048576;function $s(t={}){const{thresholdBytes:e=Qs}=t;return function(){const t=[];let r,n,o,a=0,i=!1;const s=new WritableStream({async write(o){i?await r.write(o):(t.push(o),a+=o.length,a>e&&await async function(){const e=new TransformStream;n=_e(e.readable),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0}())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:s,readable:new ReadableStream({async pull(e){if(i){if(!o){const t=await n;o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const tc=1048576,ec=".zip.js-temp",rc="createSyncAccessHandle is only available in dedicated workers";function nc(t={}){const{thresholdBytes:e=tc,directoryName:r=ec,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new Error(rc);const o=n||(()=>navigator.storage.getDirectory());let a;function i(){return a||(a=Promise.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,n,o=0,a=!1,s=0,c=0;const u=new WritableStream({async write(c){a?(n.write(c,{at:s}),s+=c.length):(t.push(c),o+=c.length,o>e&&await async function(){const e=await i();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("");const o=await e.getFileHandle(r,{create:!0});n=await o.createSyncAccessHandle(),a=!0;for(const e of t)n.write(e,{at:s}),s+=e.length;t.length=0}())},close(){n&&n.flush()}});let l=0;return{writable:u,readable:new ReadableStream({pull(e){if(a){const t=s-c;if(t<=0)return void e.close();const r=new Uint8Array(Math.min(524288,t)),o=n.read(r,{at:c});o?(c+=o,e.enqueue(r.subarray(0,o))):e.close()}else l<t.length?e.enqueue(t[l++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{Ft({baseURI:import.meta.url})}catch{}const oc="deflate",ac="deflate-raw",ic="deflate64-raw",sc="gzip";let cc,uc,lc,fc,dc;function wc(t,e,r={}){if(!cc){const t=new Error("WASM module not loaded");throw t.cause=dc,t}const n="number"==typeof r.level?r.level:-1,o="number"==typeof r.outBuffer?r.outBuffer:65536,a="number"==typeof r.inBufferSize?r.inBufferSize:65536;return new TransformStream({start(){try{let r;if(this.ur=uc(o),this.in=uc(a),this.inBufferSize=a,!this.ur||!this.in)throw new Error("allocation failed");if(this.lr=new Uint8Array(o),t?(this.dr=cc.deflate_process,this.wr=cc.deflate_last_consumed,this.pr=cc.deflate_end,this.mr=cc.deflate_new(),r=e===sc?cc.deflate_init_gzip(this.mr,n):e===ac?cc.deflate_init_raw(this.mr,n):cc.deflate_init(this.mr,n)):e===ic?(this.dr=cc.inflate9_process,this.wr=cc.inflate9_last_consumed,this.pr=cc.inflate9_end,this.mr=cc.inflate9_new(),r=cc.inflate9_init_raw(this.mr)):(this.dr=cc.inflate_process,this.wr=cc.inflate_last_consumed,this.pr=cc.inflate_end,this.mr=cc.inflate_new(),r=e===ac?cc.inflate_init_raw(this.mr):e===sc?cc.inflate_init_gzip(this.mr):cc.inflate_init(this.mr)),0!==r)throw new Error("init failed:"+r)}catch(t){throw i(this),t}},transform(t,e){try{const r=t,n=new Uint8Array(fc.buffer),a=this.dr,i=this.wr,s=this.ur,c=this.lr;let u=0;for(;u<r.length;){const t=Math.min(r.length-u,32768);if((!this.in||this.inBufferSize<t)&&(this.in&&lc&&(lc(this.in),this.in=0),this.in=uc(t),this.inBufferSize=t,!this.in))throw new Error("allocation failed");n.set(r.subarray(u,u+t),this.in);const l=a(this.mr,this.in,t,s,o,0),f=l>>24&255,d=128&f?f-256:f;if(d<0)throw new Error("process error:"+d);const w=16777215&l;w&&(c.set(n.subarray(s,s+w),0),e.enqueue(c.slice(0,w)));const p=i(this.mr);if(0===p&&0===w)break;u+=p}}catch(t){i(this),e.error(t)}},flush(t){try{const e=new Uint8Array(fc.buffer),r=this.dr,n=this.ur,a=this.lr;for(;;){const i=r(this.mr,0,0,n,o,4),s=i>>24&255,c=128&s?s-256:s;if(c<0)throw new Error("process error:"+c);const u=16777215&i;if(u&&(a.set(e.subarray(n,n+u),0),t.enqueue(a.slice(0,u))),1===s||0===u)break}}catch(e){t.error(e)}finally{const e=i(this);0!==e&&t.error(new Error("end error:"+e))}},cancel(){i(this)}});function i(t){let e=0;return t.mr&&t.pr&&(e=t.pr(t.mr)),t.mr=0,t.in&&lc&&lc(t.in),t.in=0,t.ur&&lc&&lc(t.ur),t.ur=0,e}}class pc{constructor(t=oc,e){return wc(!0,t,e)}}class hc{constructor(t=oc,e){return wc(!1,t,e)}}pc.lt=!0,hc.lt=!0,pc.cr=[oc,ac,sc],hc.cr=[oc,ac,sc,ic];let mc,yc=!1;function bc(){mc=null,async function(){await Promise.allSettled(Gr.map(t=>(rn(t),t.terminate()))),Ar=T,Rr=!1}(),yc=!1,cc=uc=lc=fc=dc=null}!function({yr:t}){Dr=t}({yr:t=>{if(!mc){let{wasmURI:e}=t;typeof e==k&&(e=e()),mc=async function(t,{baseURI:e}){if(!yc)try{await async function(t,e){let r,n;try{try{n=new URL(t,e)}catch{}const o=await fetch(n);r=await o.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=function(t){const e=t.split(",")[1],r=atob(e),n=r.length,o=new Uint8Array(n);for(let t=0;t<n;++t)o[t]=r.charCodeAt(t);return o.buffer}(t)}!function(t){if(cc=t,({malloc:uc,free:lc,memory:fc}=cc),"function"!=typeof uc||"function"!=typeof lc||!fc)throw cc=uc=lc=fc=null,new Error("Invalid WASM module")}((await WebAssembly.instantiate(r)).instance.exports)}(t,e),yc=!0}catch(t){throw function(t){dc=t}(t),t}}(e,t).catch(t=>{throw mc=null,t})}return mc}}),Ft({CompressionStreamFallback:pc,DecompressionStreamFallback:hc}),Ft({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const Ec="Entry filename already exists",Sc="Duplicate entry filename in the imported zip file",gc='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',Ac="Entry is a ancestor of target entry",Rc="Readable stream already consumed",zc="throw",Dc="keep-first",xc="keep-last",Fc=new Set([zc,Dc,xc]),Oc="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Tc="Invalid readerOptions (must be an object)",Uc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Ic="zipjs-abort-export",kc=new Set([1,h,10,m,28789,25461,y,b,E,22613,13]);class Cc{constructor(t,e,r,n){const o=this;if(t.root&&n&&n.getChildByName(e))throw new Error(Ec);r||(r={}),Object.assign(o,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.Er++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,Sr:r.Sr||r.uncompressedSize===T,passThrough:r.passThrough,gr:r.gr||new Date}),!n&&t.root||(t.entries[o.id]=o),n&&o.parent.children.push(o)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let r=e.parent;if(r){const n=iu(t);n&&(t=n.pop(),r=su(r,n,e));const o=r.getChildByName(t);if(o&&o!=e)throw new Error(Ec);r!=e.parent&&(Hc(e),e.parent=r,r.children.push(e),ou(e.fs,e))}e.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==T))}}class Mc extends Cc{constructor(t,e,r,n){super(t,e,r,n);const o=this;o.Reader=r.Reader,o.Writer=r.Writer,r.getData&&(o.getData=r.getData)}clone(){return new Mc(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data&&function(t,e){const{contentType:r}=t;return r===T||(t.constructor==Fn?e.type==r:t.constructor!=Rn||e.startsWith("data:"+(r||"")+";base64,"))}(t,r.data))return r.data;{const n=r.reader=Zc(r.Reader,r.data,e),o=r.uncompressedSize||n.size;await Promise.all([no(n),no(t,o)]);const a=it(e.signal),i=function(t,e,r,n){const{onstart:o,onprogress:a,onend:i}=r,{readable:s}=e;return t.data instanceof Wo||!o&&!a&&!i?s:Ne(s).pipeThrough(new Tr({onstart:o,onprogress:a,onend:i,size:e.size}),{signal:n})}(r,n,e,a),s=!ro(t)&&Boolean(e.preventClose);return r.uncompressedSize=n.size,await Ne(i).pipeTo(Be(t.writable),{signal:a,preventClose:s,preventAbort:s}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Yt)return!1;throw t}}getText(t,e){return this.getData(new Un(t),e)}getBlob(t,e){return this.getData(new Fn(t),e)}getData64URI(t,e){return this.getData(new Rn(t),e)}getUint8Array(t){return this.getData(new Jn,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Ut(await this.getUint8Array(t)).buffer}replaceBlob(t){Xc(this,{data:t,Reader:xn,Writer:Fn,uncompressedSize:t.size})}replaceText(t){Xc(this,{data:t,Reader:On,Writer:Un,uncompressedSize:Tn(t)})}replaceData64URI(t){Xc(this,{data:t,Reader:An,Writer:Rn,uncompressedSize:Jc(t)})}replaceUint8Array(t){Xc(this,{data:t,Reader:Xn,Writer:Jn,uncompressedSize:t.length})}replaceReadable(t){Xc(this,{data:null,Reader:Lc(t),Writer:null,uncompressedSize:T})}}class vc extends Cc{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new vc(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return au(this,t,{options:e},!0)}addText(t,e,r={}){return au(this,t,{data:e,Reader:On,Writer:Un,options:r,uncompressedSize:Tn(e)})}addBlob(t,e,r={}){return au(this,t,{data:e,Reader:xn,Writer:Fn,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){return au(this,t,{data:e,Reader:An,Writer:Rn,options:r,uncompressedSize:Jc(e)})}addUint8Array(t,e,r={}){return au(this,t,{data:e,Reader:Xn,Writer:Jn,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return au(this,t,{data:e,Reader:class extends qn{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return au(this,t,{Reader:Lc(e),options:r})}addFileSystemEntry(t,e={}){return tu(this,t,e)}addFileSystemHandle(t,e={}){return tu(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),au(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new xn(t),e)}importData64URI(t,e){return this.importZip(new An(t),e)}importUint8Array(t,e){return this.importZip(new Xn(t),e)}importHttpContent(t,e){return this.importZip(new qn(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Fn(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Rn(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Jn,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:n,onprogress:o,onend:a}=r,i=Yc(r.readerOptions),s=new AbortController,{signal:c}=s,u=function(t,e){if(!it(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}(r.signal,s),l=Object.assign({},r,i,{signal:c,onstart:T,onprogress:T,onend:T,preventClose:!1}),f=Bc([t],t=>Pc(t,l.passThrough)),d=[];let w=!1,p=0;try{n&&await Ur(n,f),await m(t,e),a&&await Ur(a,p)}catch(t){try{t.exportedEntryNames=d}catch{}throw t}finally{u()}return e;function h(t){const e=t.getWriter();return new WritableStream({async write(t){await e.write(t),p+=t.length,o&&await Ur(o,p,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function m(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>y(t,e)))).filter(t=>"rejected"==t.status);if(r.length){const t=r.filter(t=>!Gc(t.reason));throw function(t){const[e]=t,r=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(r.length)try{e.entryErrors=[...e.entryErrors||[],...r]}catch{}return e}((t.length?t:r).map(t=>t.reason))}}else for(const r of t.children)await y(r,e)}async function y(e,r){if(c.aborted){if(w||Gc(c.reason))return;throw c.reason===T?new DOMException(nt,ot):c.reason}try{if(e.directory){const t=await r.getDirectoryHandle(e.name,{create:!0});await m(e,t)}else{const n=await r.getFileHandle(e.name,{create:!0}),o=await n.createWritable();try{await e.getData({writable:h(o)},l)}catch(t){throw w?new Error(Ic):t}d.push(e.getRelativeName(t))}}catch(r){w=!0,s.abort(new Error(Ic));try{r.entryName===T&&(r.entryName=e.getRelativeName(t),r.entryId=e.id)}catch{}throw r}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==k?(r=t,e=Object.assign({},r.options,e)):(await no(t),r=new Oa(t,e));const n=function(t){if(t===T)return zc;if(Fc.has(t))return t;throw new Error(gc)}(e.duplicates),o=[],a=await r.getEntries(e);for(const t of a){let r=this;try{const a=t.filename.split("/").filter(t=>""!=t&&"."!=t),i=a.pop();let s=!1;for(const t of a){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(n==Dc){s=!0;break}if(n!=xc)throw new Error(Sc);this.fs.remove(r),r=new vc(this.fs,t,{data:null},e),o.push(r)}}else r=new vc(this.fs,t,{data:null},e),o.push(r)}if(s)continue;if(t.directory){let e=r;if(i){if(e=r.getChildByName(i),e&&!e.directory){if(n==Dc)continue;if(n!=xc)throw new Error(Sc);this.fs.remove(e),e=T}e||(e=new vc(this.fs,i,{data:null},r),o.push(e))}e==this||e.data||(e.data=t)}else{const a=r.getChildByName(i);if(a){if(n==Dc)continue;if(n!=xc)throw new Error(Sc);this.fs.remove(a)}o.push(au(r,i,{data:t,Reader:Wc(Object.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){o.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return o}async exportZip(t,e={}){const r=this;(e=Object.assign({},e)).bufferedWrite===T&&(e.bufferedWrite=!0);const[n]=await Promise.all([Vc(r,Yc(e.readerOptions)),no(t)]),o=new $i(t,e);return await async function(t,e,r,n,o){const{onstart:a,onprogress:i,onend:s,onentryprogress:c}=n,u=e,l=Bc(e.children,t=>$c(t)?0:1);let f=0,d=0;if(a&&await Ur(a,r),n.bufferedWrite)await async function t(e){const r=(await Promise.allSettled(e.children.map(async e=>{await w(e),await t(e)}))).find(t=>"rejected"==t.status);if(r)throw r.reason}(e);else for(const t of e.getChildren({recursive:!0}))await w(t);async function w(e){if($c(e))return;const{name:a,Ar:s}=Kc(e,u,n);let w=0;const p=await t.add(a,o.get(e),Object.assign(s,{onstart:T,onend:T,onprogress:async t=>{f+=t-w,w=t,i&&await Ur(i,f,r)}}));d++,c&&await Ur(c,d,l,p)}s&&await Ur(s,f)}(o,r,Bc([r],jc),e,n),await o.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(r={}){const n=this;Yc((r=Object.assign({},r)).readerOptions),r.bufferedWrite===T&&(r.bufferedWrite=!0);const o=n.getChildren({recursive:!0}),a=o.filter(t=>!$c(t)).map(t=>{const{name:e,Ar:o}=Kc(t,n,r);return{name:e,size:t.directory?0:qc(t,Qc(t,r)),options:o}}),i=!r.bufferedWrite||a.every(t=>!1!==t.options.keepOrder)&&o.every(t=>$c(t)||!t.children.length);return async function(r,n,o,a){const i={options:r};if(at(r[q]))throw new Error(vi);if(a!==T&&!(a instanceof Uint8Array))throw new Error(pi);const s=Ws(a);if(s>e)throw new Error(wi);const c=r[G],u=new Map,l=r[H]===T?0:r[H];let f=l,w=U;for(const t of n){let{name:e}=t;const{size:r}=t,n=Object.assign({},t.options);Is(i,n,ko)&&!e.endsWith(D)&&(e+=D);const o=as(i,e,n);({name:e}=o);const{ze:a}=is(i,e,n);0==a.level||a.compressionMethod!==T||a.passThrough||await xr(St())||(a.level=0);const s=!Is(i,n,ko);if(s&&r===T)throw new Error(vi);const{nr:l,ze:d}=cs(i,s,r,a,n);if(s&&!a.passThrough&&Ns(d.compressionMethod,d.level))throw new Error(vi);const p=Object.assign({},n,o.ze,a,d,{[G]:c}),h=us(p),m=ds(p),y={Te:h,Ce:Ws(h.xe,m.Fe)};c&&ls(y,f);const b=s?l:0;u.set(e,Object.assign({},p,h,{offset:f,diskNumberStart:0,compressedSize:b}));const E=y.Ce+b;w=Math.min(w,E),f+=E}if(u.size>1&&(c||f-w>=t)&&!o)throw new Error(vi);const{Le:p,We:h}=ws(u);let m=Is(i,r,Fo);if(f>=t||p>=t||u.size>=e){if(!1===m)throw new Error(ki);m=!0}else m===T&&h&&(m=!0);return f-l+p+s+(m?98:d)}(r,a,i,r.globalComment)}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}getChildren(t={}){return function(t,e){const r=[],n=[t];let o=0;for(;o<n.length;)for(const t of n[o++].children)r.push(t),e&&n.push(t);return r}(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 r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}class Nc{constructor(){ru(this)}get children(){return this.root.children}remove(t){Hc(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=T}move(t,e){if(t==this.root)throw new Error("Root directory cannot be moved");if(!e.directory)throw new Error("Target entry is not a directory");if(e.isDescendantOf(t))throw new Error(Ac);if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw new Error(Ec)}else Hc(t),t.parent=e,e.children.push(t),ou(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.directory?r.getChildByName(e[t]):T;return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}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,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}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 nu(this,r=>r.importBlob(t,e))}importData64URI(t,e){return nu(this,r=>r.importData64URI(t,e))}importUint8Array(t,e){return nu(this,r=>r.importUint8Array(t,e))}importHttpContent(t,e){return nu(this,r=>r.importHttpContent(t,e))}importReadable(t,e){return nu(this,r=>r.importReadable(t,e))}importZip(t,e){return nu(this,r=>r.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 _c={FS:Nc,ZipDirectoryEntry:vc,ZipFileEntry:Mc};function Bc(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=e(t)||0;for(const e of t.children)n.push(e)}return r}function jc(t){return t.uncompressedSize}function Pc(t,e){const{data:r}=t;return e&&r instanceof Wo?r.compressedSize:t.uncompressedSize}function Lc(t){let e;return function(){if(e)throw new Error(Rc);return e=!0,{readable:t}}}function Wc(t){return class extends Sn{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=Object.assign({},t,e.options),{checkOverlappingEntry:n,checkOverlappingEntryOnly:o}=r,a=await e.entry.getData(new Fn,Object.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:o||n,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=a,e.Rr=new xn(a),e.size=a.size,super.init()}readUint8Array(t,e){return this.Rr.readUint8Array(t,e)}}}function Zc(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function Vc(t,e){const r=[],n=[t],o=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async t=>{const r=t.reader=Zc(t.Reader,t.data,e);o.set(t,r);try{await no(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==T&&(t.uncompressedSize=r.size,t.Sr=!1)})),o}function Hc(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function Gc(t){return Boolean(t)&&t.message==Ic}function Kc(t,e,n){const o=n.relativePath?t.getRelativeName(e):t.getFullname(),a=t.options||{};let i={},s={};if(t.data instanceof Wo){const{externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,rawLastModDate:l,creationDate:f,lastAccessDate:d,uncompressedSize:w,encrypted:p,zipCrypto:h,crc32:m,compressionMethod:y,extraFieldAES:b,internalFileAttributes:E,extraField:S,bitFlag:g,uid:A,gid:R}=t.data;i={externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,creationDate:f,lastAccessDate:d,internalFileAttributes:E};const z=function(t){if(t){const e=new Map;if(t.forEach((t,r)=>{kc.has(r)||e.set(r,t.data)}),e.size)return e}}(S);if(z&&(i.extraField=z),A===T&&R===T||Object.assign(i,{uid:A,gid:R,unixExtraFieldType:"infozip"}),Qc(t,n)){let t;b&&(t=b.strength),s={passThrough:!0,encrypted:p,zipCrypto:h,crc32:m,uncompressedSize:w,encryptionStrength:t,compressionMethod:y},g&&(s.dataDescriptor=g.dataDescriptor);const e=a.lastModDate===T?n.lastModDate:a.lastModDate;if(e===T)s.rawLastModDate=l;else if(h&&(!g||g.dataDescriptor)&&e instanceof Date&&function(t){let e=new Date(2e3*Math.ceil(Math.floor(t.getTime()/1e3)/2));return e<O?e=O:e>F&&(e=F),(e.getHours()<<3|e.getMinutes()>>3)&r}(e)!=(l>>>8&r))throw new Error(Uc)}}const c=Object.assign({lastModDate:t.gr},i,n,a,s,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===T)throw new Error(Oc);return{name:o,Ar:c}}function qc(t,e){const{reader:r}=t;return r&&r.size!==T?r.size:t.Sr?T:Pc(t,e)}function Yc(t){if(t&&(typeof t!=C||Array.isArray(t)))throw new Error(Tc);return t}function Xc(t,e){const{uncompressedSize:r}=e;Object.assign(t,e,{reader:null,passThrough:T,uncompressedSize:r===T?0:r,Sr:r===T})}function Jc(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;return Math.floor(.75*(e-r))}function Qc(t,e){const{readerOptions:r}=e;return Boolean(!t.directory&&(t.passThrough||r&&r.passThrough))}function $c(t){return t.directory&&null===t.data}function tu(t,e,r){return async function t(e,n,o,a=""){if(n){const i=a?a+"/"+n.name:n.name;try{if((n.isFile||n.isDirectory)&&(n=await eu(n)),"file"==n.kind){const t=await n.getFile();o.push(au(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const a=e.addDirectory(n.name,r);o.push(a);for await(const e of n.values())await t(a,e,o,i)}}catch(t){try{t.entryName===T&&(t.entryName=i)}catch{}throw t}}return o}(t,e,[])}async function eu(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await async function(t){const e=[];function r(t,n,o){t.readEntries(async a=>{if(a.length){for(const t of a)e.push(await eu(t));r(t,n,o)}else n(e)},o)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}}(t);e.values=()=>r}return e}function ru(t){t.entries=[],t.Er=0,t.root=new vc(t)}function nu(t,e){const{entries:r,Er:n,root:o}=t;return ru(t),e(t.root).catch(e=>{throw Object.assign(t,{entries:r,Er:n,root:o}),e})}function ou(t,e){const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}}function au(t,e,r,n){if(t.directory){const o=iu(e);return o&&(e=o.pop(),t=su(t,o)),n?new vc(t.fs,e,r,t):new Mc(t.fs,e,r,t)}throw new Error("Parent entry is not a directory")}function iu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function su(t,e,r){return e.forEach(e=>{const n=t;if(t=t.getChildByName(e)){if(!t.directory)throw new Error(Ec);if(r&&(t==r||t.isDescendantOf(r)))throw new Error(Ac)}else t=new vc(n.fs,e,{data:null},n)}),t}export{xn as BlobReader,Fn as BlobWriter,An as Data64URIReader,Rn as Data64URIWriter,nt as ERR_ABORTED,ta as ERR_AMBIGUOUS_ARCHIVE,Zo as ERR_BAD_FORMAT,Go as ERR_CENTRAL_DIRECTORY_NOT_FOUND,di as ERR_DUPLICATED_NAME,Sc as ERR_DUPLICATE_IMPORTED_ENTRY,Yo as ERR_ENCRYPTED,ea as ERR_ENCRYPTED_CENTRAL_DIRECTORY,$o as ERR_ENTRY_DATA_OUT_OF_BOUNDS,Ec as ERR_ENTRY_EXISTS,Ho as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Vo as ERR_EOCDR_NOT_FOUND,qo as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,cn as ERR_HTTP_RANGE,un as ERR_HTTP_RESOURCE_CHANGED,Xt as ERR_INVALID_AUTHENTICATION_CODE,je as ERR_INVALID_CODEC_DEFINITION,Le as ERR_INVALID_CODEC_MODULE,wi as ERR_INVALID_COMMENT,pi as ERR_INVALID_COMMENT_TYPE,$e as ERR_INVALID_COMPRESSED_DATA,tr as ERR_INVALID_CRC32,yi as ERR_INVALID_DATE,gc as ERR_INVALID_DUPLICATES,Si as ERR_INVALID_ENCRYPTION_STRENGTH,hi as ERR_INVALID_ENTRY_COMMENT,mi as ERR_INVALID_ENTRY_COMMENT_TYPE,bi as ERR_INVALID_ENTRY_NAME,zi as ERR_INVALID_EXTRAFIELD,Fi as ERR_INVALID_EXTRAFIELD_DATA,xi as ERR_INVALID_EXTRAFIELD_DATA_TYPE,Di as ERR_INVALID_EXTRAFIELD_TYPE,oa as ERR_INVALID_FILENAME_VALIDATION,tt as ERR_INVALID_FUNCTION_OPTION,Pi as ERR_INVALID_GID,Gi as ERR_INVALID_LEVEL,aa as ERR_INVALID_MAX_APPENDED_DATA_SIZE,dt as ERR_INVALID_MAX_WORKERS,Vi as ERR_INVALID_MSDOS_ATTRIBUTES,Hi as ERR_INVALID_MSDOS_DATA,Yt as ERR_INVALID_PASSWORD,rt as ERR_INVALID_PASSWORD_TYPE,Oc as ERR_INVALID_PASS_THROUGH,_i as ERR_INVALID_READER,Tc as ERR_INVALID_READER_OPTIONS,et as ERR_INVALID_SIGNAL,Ki as ERR_INVALID_SIGNATURE_DATA,na as ERR_INVALID_STRICTNESS,ji as ERR_INVALID_UID,Qe as ERR_INVALID_UNCOMPRESSED_SIZE,Wi as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,Zi as ERR_INVALID_UNIX_ID_SIZE,Li as ERR_INVALID_UNIX_MODE,Ei as ERR_INVALID_VERSION,ln as ERR_ITERATOR_COMPLETED_TOO_SOON,Ko as ERR_LOCAL_FILE_HEADER_NOT_FOUND,Qo as ERR_OVERLAPPING_ENTRY,Rc as ERR_READABLE_CONSUMED,Pe as ERR_RESERVED_COMPRESSION_METHOD,Jo as ERR_SPLIT_ZIP_FILE,Mi as ERR_UNDEFINED_COMPRESSION_METHOD,Ni as ERR_UNDEFINED_READER,Ci as ERR_UNDEFINED_UNCOMPRESSED_SIZE,vi as ERR_UNDETERMINED_SIZE,ra as ERR_UNSAFE_FILENAME,We as ERR_UNSUPPORTED_COMPRESSION,rc as ERR_UNSUPPORTED_CONTEXT,Qt as ERR_UNSUPPORTED_CRYPTO_API,Xo as ERR_UNSUPPORTED_ENCRYPTION,Ri as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,gi as ERR_UNSUPPORTED_ENCRYPTION_USDZ,ki as ERR_UNSUPPORTED_FORMAT,Ai as ERR_UNSUPPORTED_SPLIT_USDZ,ia as ERR_UNSUPPORTED_UINT64,gr as ERR_WORKER_STARTUP_TIMEOUT,fn as ERR_WRITER_NOT_INITIALIZED,Uc as ERR_ZIP_CRYPTO_LAST_MOD_DATE,Bi as ERR_ZIP_NOT_EMPTY,Yn as HttpRangeReader,qn as HttpReader,Sn as Reader,Qn as SplitDataReader,$n as SplitDataWriter,On as TextReader,Un as TextWriter,Xn as Uint8ArrayReader,Jn as Uint8ArrayWriter,qs as VERSION,wa as WARNING_APPENDED_DATA,ua as WARNING_COMPRESSED_PATCHED_DATA,ya as WARNING_DUPLICATE_FILENAME,la as WARNING_MALFORMED_EXTRA_FIELD,Ea as WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,Sa as WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,ga as WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,ba as WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,ha as WARNING_PREPENDED_CENTRAL_DIRECTORY,pa as WARNING_PREPENDED_DATA,ma as WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,ca as WARNING_UNKNOWN_VERSION,fa as WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA,sa as WARNING_UNSORTED_CENTRAL_DIRECTORY,da as WARNING_WRAPPED_ENTRIES_COUNT,gn as Writer,vc as ZipDirectoryEntry,Cc as ZipEntry,Nc as ZipFS,Mc as ZipFileEntry,Oa as ZipReader,Ta as ZipReaderStream,$i as ZipWriter,ts as ZipWriterStream,Rt as configure,$s as createBlobTempStream,Js as createOPFSTempStream,nc as createSyncAccessHandleTempStream,_c as fs,Hs as getMimeType,Ye as getRegisteredCodecs,Gs as getSupportedCompressionMethods,Ua as isZipFile,Ge as registerCodec,Ot as resetConfiguration,bc as terminateWorkers,Ke as unregisterCodec};
|