@zip.js/zip.js 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/deno.json +1 -1
  2. package/dist/zip-core-external.js +126 -33
  3. package/dist/zip-core-external.min.js +1 -1
  4. package/dist/zip-core.js +126 -33
  5. package/dist/zip-core.min.js +1 -1
  6. package/dist/zip-fs-core-external.js +127 -34
  7. package/dist/zip-fs-core-external.min.js +1 -1
  8. package/dist/zip-fs-core.js +127 -34
  9. package/dist/zip-fs-core.min.js +1 -1
  10. package/dist/zip-fs-external.js +127 -34
  11. package/dist/zip-fs-external.min.js +1 -1
  12. package/dist/zip-fs-native.js +129 -36
  13. package/dist/zip-fs-native.min.js +1 -1
  14. package/dist/zip-fs.js +128 -35
  15. package/dist/zip-fs.min.js +1 -1
  16. package/dist/zip-legacy.js +128 -35
  17. package/dist/zip-legacy.min.js +1 -1
  18. package/dist/zip-native.js +128 -35
  19. package/dist/zip-native.min.js +1 -1
  20. package/dist/zip-web-worker-native.js +1 -1
  21. package/dist/zip-web-worker.js +1 -1
  22. package/dist/zip.js +127 -34
  23. package/dist/zip.min.js +1 -1
  24. package/index-native.cjs +129 -36
  25. package/index-native.min.js +1 -1
  26. package/index.cjs +128 -35
  27. package/index.d.cts +13 -7
  28. package/index.d.ts +13 -7
  29. package/index.min.js +1 -1
  30. package/lib/core/codec-worker-web.js +64 -22
  31. package/lib/core/codec-worker.js +15 -3
  32. package/lib/core/util/error.js +35 -0
  33. package/lib/core/version.js +1 -1
  34. package/lib/core/web-worker-base.js +43 -7
  35. package/lib/core/web-worker-inline-native.js +1 -1
  36. package/lib/core/web-worker-inline-wasm.js +1 -1
  37. package/lib/core/zip-fs.js +2 -1
  38. package/lib/core/zip-reader.js +9 -4
  39. package/lib/core/zip-writer.js +8 -3
  40. package/package.json +1 -1
  41. package/worker-message-property-names.js +1 -1
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:g,TextEncoder:S,TextDecoder:b,document:E,crypto:x,btoa:R,TransformStream:z,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:C,navigator:I,Worker:T,Symbol:k,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:self;var U=void 0!==E?E.currentScript:null;const O=4294967295,M=65535,L=255,B=67324752,W=134695760,P=W,Z=84233040,H=33639248,V=101010256,G=101075792,j=117853008,q=46,K=22,Y=20,X=56,J=39169,Q=21589,$=6534,tt=30837,et=30805,nt=2048,rt=61440,ot=16384,it=2048,st=1024,at="/",ct=30,ut=new a(2107,11,31,23,59,58),lt=new a(1980,0,1),dt=void 0,ft=1/0,wt="undefined",pt="function",ht="object",mt="string",yt="boolean",gt=new w,St=k.asyncDispose||k(),bt="password",Et="rawPassword",xt="passThrough",Rt="signal",zt="useWebWorkers",Ft="useCompressionStream",Dt="transferStreams",At="preventClose",Ct="level",It="useUnicodeFileNames",Tt="dataDescriptor",kt="offset",vt="usdz",_t="maxAppendedDataSize",Nt="signCentralDirectory",Ut="entry",Ot="filename",Mt="comment",Lt="strict",Bt="balanced",Wt="tolerant",Pt="compressed",Zt="Invalid option (must be a function)",Ht="Invalid signal (must be an AbortSignal instance)",Vt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",Gt="Invalid passThrough option (must be a boolean or 'compressed')",jt="The operation was aborted";function qt(t){if(t&&typeof t!=pt)throw new f(Zt);return t}function Kt(t){if(t&&(typeof t.addEventListener!=pt||typeof t.aborted!=yt))throw new f(Ht);return t||dt}function Yt(t){if(t&&t.aborted)throw t.reason===dt?new DOMException(jt,"AbortError"):t.reason}function Xt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Vt)}function Jt(t){if(t!==dt&&typeof t!=yt&&t!==Pt)throw new f(Gt);return t}function Qt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function $t(t,e,n){t!==dt&&Qt(t,e,n)}function te(t){return typeof t==mt&&t.trim()?o(t):t}const ee="Invalid maxWorkers (must be an integer greater than 0)",ne="Invalid baseURI (must be a string)",re="Invalid URI (must be a string or a function returning a string)";let oe=2;try{typeof I!=wt&&I.hardwareConcurrency&&(oe=I.hardwareConcurrency)}catch{}const ie={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:oe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof C!=wt&&C},se="maxWorkers",ae="baseURI",ce=["wasmURI","workerURI"],ue=["chunkSize",se,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],le=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],de=[ae,...ce,"useCompressionStream","useWebWorkers","transferStreams",...ue,...le],fe={...ie};function we(){return fe}function pe(t){return he(t.chunkSize)}function he(t){return t=te(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function me(t){const e={};for(const n of de){const r=t[n];r!==dt&&(e[n]=ye(n,r))}return e}function ye(t,e){if(ue.includes(t)){if(e=te(e),t==se&&(!o.isInteger(e)||e<1))throw new f(ee)}else if(le.includes(t))qt(e);else if(t==ae){if(e&&typeof e!=mt)throw new f(ne)}else if(ce.includes(t)&&e&&typeof e!=mt&&typeof e!=pt)throw new f(re);return e}function ge(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===dt&&r===dt)return t;const o=n.assign({},t);return o.CompressionStreamFallback===dt&&(o.CompressionStreamFallback=e),o.DecompressionStreamFallback===dt&&(o.DecompressionStreamFallback=r),o}function Se(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function be(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function Ee(t){return new m(t.buffer,t.byteOffset,t.byteLength)}const xe=[[],[],[],[],[],[],[],[]];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;xe[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=xe[e-1][t];xe[e][t]=n>>>8^xe[0][255&n]}const[Re,ze,Fe,De,Ae,Ce,Ie,Te]=xe;class ke{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const o=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^o.getInt32(r,!0),n=o.getInt32(r+4,!0);e=Te[255&t]^Ie[t>>>8&255]^Ce[t>>>16&255]^Ae[t>>>24&255]^De[255&n]^Fe[n>>>8&255]^ze[n>>>16&255]^Re[n>>>24&255]}}for(;r<n;r++)e=e>>>8^Re[255&(e^t[r])];this.o=e}get(){return~this.o}}class ve extends z{constructor(){let t;const e=new ke;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function _e(t){if(typeof S==wt){t=unescape(encodeURIComponent(t));const e=new w(t.length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new S).encode(t)}const Ne={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=Ne.l(n);return 32===r?t.concat(e):Ne.h(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+Ne.l(n)},m(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=Ne.S(e,t[n-1]&2147483648>>e-1,1)),t},S:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,l:t=>s.round(t/1099511627776)||32,h(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let o=0;o<t.length;o++)r.push(n|t[o]>>>e),n=t[o]<<32-e;const o=t.length?t[t.length-1]:0,i=Ne.l(o);return r.push(Ne.S(e+i&31,e+i>32?n:r.pop(),1)),r}},Ue={bytes:{R(t){const e=Ne.bitLength(t)/8,n=new w(e);let r;for(let o=0;o<e;o++)3&o||(r=t[o/4]),n[o]=r>>>24,r<<=8;return n},F(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(Ne.S(8*(3&n),r)),e}}},Oe=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.A=[1518500249,1859775393,2400959708,3395469782],t?(e.C=t.C.slice(0),e.I=t.I.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.C=t.D.slice(0),t.I=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Ue.v.F(t));const n=e.I=Ne.concat(e.I,t),r=e.T,o=e.T=r+Ne.bitLength(t);if(o>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let s=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);t<=o;t+=e.blockSize)e._(i.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),e}N(){const t=this;let e=t.I;const n=t.C;e=Ne.concat(e,[Ne.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t._(e.splice(0,16));return t.reset(),n}U(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}O(t,e){return e<<t|e>>>32-t}_(t){const n=this,r=n.C,o=e(80);for(let e=0;e<16;e++)o[e]=t[e];let i=r[0],a=r[1],c=r[2],u=r[3],l=r[4];for(let t=0;t<=79;t++){t>=16&&(o[t]=n.O(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.O(5,i)+n.U(t,a,c,u)+l+o[t]+n.A[s.floor(t/20)]|0;l=u,u=c,c=n.O(30,a),a=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+c|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0}},Me={importKey:t=>new Me.M(Ue.bytes.F(t)),L(t,e,n,r){if(n=n||1e4,r<0||n<0)throw new f("invalid params to pbkdf2");const o=1+(r>>5)<<2;let i,s,a,c,u;const l=new ArrayBuffer(o),d=new m(l);let w=0;const p=Ne;for(e=Ue.bytes.F(e),u=1;w<(o||1);u++){for(i=s=t.encrypt(p.concat(e,[u])),a=1;a<n;a++)for(s=t.encrypt(s),c=0;c<s.length;c++)i[c]^=s[c];for(a=0;w<(o||1)&&a<i.length;a++)d.setInt32(w,i[a]),w+=4}return l.slice(0,r/8)},M:class{constructor(t){const e=this,n=e.B=Oe,r=[[],[]];e.W=[new n,new n];const o=e.W[0].blockSize/32;t.length>o&&(t=(new n).update(t).N());for(let e=0;e<o;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.W[0].update(r[0]),e.W[1].update(r[1]),e.P=new n(e.W[0])}reset(){const t=this;t.P=new t.B(t.W[0]),t.Z=!1}update(t){this.Z=!0,this.P.update(t)}digest(){const t=this,e=t.P.N(),n=new t.B(t.W[1]).update(e).N();return t.reset(),n}encrypt(t){if(this.Z)throw new f("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Le=typeof x!=wt&&typeof x.getRandomValues==pt,Be="Invalid password",We="Invalid authentication code",Pe="zipjs-abort-check-password",Ze="Crypto API not supported";function He(t){if(Le)return x.getRandomValues(t);throw new f(Ze)}const Ve=16,Ge={name:"PBKDF2"},je=n.assign({hash:{name:"HMAC"}},Ge),qe=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Ge),Ke=["deriveBits"],Ye=[8,12,16],Xe=[16,24,32],Je=10,Qe=[0,0,0,0],$e=typeof x!=wt,tn=$e&&x.subtle,en=$e&&typeof tn!=wt,nn=Ue.bytes,rn=class{constructor(t){const e=this;e.H=[[[],[],[],[],[]],[[],[],[],[],[]]],e.H[0][0][0]||e.V();const n=e.H[0][4],r=e.H[1],o=t.length;let i,s,a,c=1;if(4!==o&&6!==o&&8!==o)throw new f("invalid aes key size");for(e.A=[s=t.slice(0),a=[]],i=o;i<4*o+28;i++){let t=s[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-o]^t}for(let t=0;i;t++,i--){const e=s[3&t?i:i-4];a[t]=i<=4||t<4?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.G(t,0)}decrypt(t){return this.G(t,1)}V(){const t=this.H[0],e=this.H[1],n=t[4],r=e[4],o=[],i=[];let s,a,c,u;for(let t=0;t<256;t++)i[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=s=0;!n[l];l^=a||1,s=i[s]||1){let i=s^s<<1^s<<2^s<<3^s<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,u=o[c=o[a=o[l]]];let d=16843009*u^65537*c^257*a^16843008*l,f=257*o[i]^16843008*i;for(let n=0;n<4;n++)t[n][l]=f=f<<24^f>>>8,e[n][i]=d=d<<24^d>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}G(t,e){if(4!==t.length)throw new f("invalid aes block size");const n=this.A[e],r=n.length/4-2,o=[0,0,0,0],i=this.H[e],s=i[0],a=i[1],c=i[2],u=i[3],l=i[4];let d,w,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],g=t[e?1:3]^n[3],S=4;for(let t=0;t<r;t++)d=s[h>>>24]^a[m>>16&255]^c[y>>8&255]^u[255&g]^n[S],w=s[m>>>24]^a[y>>16&255]^c[g>>8&255]^u[255&h]^n[S+1],p=s[y>>>24]^a[g>>16&255]^c[h>>8&255]^u[255&m]^n[S+2],g=s[g>>>24]^a[h>>16&255]^c[m>>8&255]^u[255&y]^n[S+3],S+=4,h=d,m=w,y=p;for(let t=0;t<4;t++)o[e?3&-t:t]=l[h>>>24]<<24^l[m>>16&255]<<16^l[y>>8&255]<<8^l[255&g]^n[S++],d=h,h=m,m=y,y=g,g=d;return o}},on=class{constructor(t,e){this.j=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.j,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,n){let r;if(!(r=e.length))return[];const o=Ne.bitLength(e);for(let o=0;o<r;o+=4){this.$(n);const r=t.encrypt(n);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return Ne.m(e,o)}},sn=Me.M;let an=$e&&en&&typeof tn.importKey==pt,cn=$e&&en&&typeof tn.deriveBits==pt;class un extends z{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){dn(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,et:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await wn(t,e,n,hn(r,0,Ye[e])),i=hn(r,Ye[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new f(Be)}(n,i,o,hn(t,0,Ye[i]+2)),t=hn(t,Ye[i]+2),r?e.error(new f(Pe)):s()):await a;const c=new w(t.length-Je-(t.length-Je)%Ve);e.enqueue(fn(n,t,c,0,Je,!0))},async flush(t){const{nt:e,ot:n,it:r,ready:i}=this;if(n&&e){await i;const s=hn(r,0,r.length-Je),a=hn(r,r.length-Je);let c=gt;if(s.length){const t=yn(nn,s);n.update(t);const r=e.update(t);c=mn(nn,r)}const u=hn(mn(nn,n.digest()),0,Je);let l=r.length<Je?1:0;for(let t=0;t<Je;t++)l|=u[t]^a[t];if(l&&o)throw new f(We);t.enqueue(c)}}})}}class ln extends z{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){dn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,et:i,ready:s}=n;let a=gt;r?(a=await async function(t,e,n){const r=He(new w(Ye[e]));return Se(r,await wn(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%Ve);c.set(a,0),e.enqueue(fn(n,t,c,a.length,0))},async flush(t){const{nt:e,ot:n,it:r,ready:o}=this;if(n&&e){await o;let i=gt;if(r.length){const t=e.update(yn(nn,r));n.update(t),i=mn(nn,t)}const s=mn(nn,n.digest()).slice(0,Je);t.enqueue(Se(i,s))}}})}}function dn(t,e,r,o){n.assign(t,{ready:new g(e=>t.et=e),password:pn(e,r),strength:o-1,it:gt})}function fn(t,e,n,r,o,i){const{nt:s,ot:a,it:c}=t;c.length&&(e=Se(c,e));const u=e.length-o;let l;for(n=function(t,e){if(e&&e>t.length){const n=t;(t=new w(e)).set(n,0)}return t}(n,r+(u-u%Ve)),l=0;l<=u-Ve;l+=Ve){const t=yn(nn,hn(e,l,l+Ve));i&&a.update(t);const o=s.update(t);i||a.update(o),n.set(mn(nn,o),l+r)}return t.it=hn(e,l),n}async function wn(t,r,o,i){t.password=null;const s=await async function(t,e,n,r,o){if(!an)return Me.importKey(e);try{return await tn.importKey("raw",e,n,!1,o)}catch{return an=!1,Me.importKey(e)}}(0,o,je,0,Ke),a=await async function(t,e,n){if(!cn)return Me.L(e,t.salt,qe.iterations,n);try{return await tn.deriveBits(t,e,n)}catch{return cn=!1,Me.L(e,t.salt,qe.iterations,n)}}(n.assign({salt:i},qe),s,8*(2*Xe[r]+2)),c=new w(a),u=yn(nn,hn(c,0,Xe[r])),l=yn(nn,hn(c,Xe[r],2*Xe[r])),d=hn(c,2*Xe[r]);return n.assign(t,{keys:{key:u,st:l,passwordVerification:d},nt:new on(new rn(u),e.from(Qe)),ot:new sn(l)}),d}function pn(t,e){return e===dt?_e(t):e}function hn(t,e,n){return t.subarray(e,n)}function mn(t,e){return t.R(e)}function yn(t,e){return t.F(e)}class gn extends z{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){bn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=En(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(Be);t=t.subarray(12)}r?e.error(new f(Pe)):e.enqueue(En(n,t))}})}}class Sn extends z{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){bn(this,t,e,n)},transform(t,e){const n=this;let r,o;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=He(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(xn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(xn(n,t),o),e.enqueue(r)}})}}function bn(t,e,r,o){n.assign(t,{password:e,rawPassword:r,passwordVerification:o}),function(t,e,r){const o=[305419896,591751049,878082192];if(n.assign(t,{keys:o,ct:new ke(o[0]),ut:new ke(o[2])}),r)for(let e=0;e<r.length;e++)Rn(t,r[e]);else for(let n=0;n<e.length;n++)Rn(t,e.charCodeAt(n))}(t,e,r)}function En(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=zn(t)^e[r],Rn(t,n[r]);return n}function xn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=zn(t)^e[r],Rn(t,e[r]);return n}function Rn(t,e){let[,n]=t.keys;t.ct.append([e]);const r=~t.ct.get();n=Dn(s.imul(Dn(n+Fn(r)),134775813)+1),t.ut.append([n>>>24]);const o=~t.ut.get();t.keys=[r,n,o]}function zn(t){const e=2|t.keys[2];return Fn(s.imul(e,1^e)>>>8)}function Fn(t){return 255&t}function Dn(t){return 4294967295&t}function An(t){if(t instanceof F)return t;const e=t.getReader();return new F({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function Cn(t,e){t=An(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof F)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new D({write(t){r.push(t)}})).then(()=>new y(r,n))}function In(t){if(t instanceof D)return t;const e=t.getWriter();return new D({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const Tn="Invalid codec definition",kn="Reserved compression method",vn="Invalid codec module",_n="Compression method not supported",Nn=[0,8,9,99],Un=new c,On=new c;function Mn(t){return Un.get(t)}function Ln(){return e.from(Un.values(),t=>n.assign({},t,On.get(t.format)))}function Bn(t){return On.get(t)}function Wn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(vn);On.set(t,{CompressionStream:n,DecompressionStream:r})}const Pn="Invalid uncompressed size",Zn="Invalid compressed data",Hn="Invalid CRC32",Vn="deflate-raw",Gn="deflate64-raw",jn="gzip",qn=[31,139,8];class Kn extends z{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:o,encrypted:i,useCompressionStream:s,zipCrypto:a,computeCrc32:c,level:u,deflate64:l,format:d,compressionMethod:f,inputSize:w}=t,p=this;let h,y,g,S=super.readable;const b=d&&Bn(d),E=c&&o&&!l&&!b&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||E||(h=new ve,S=rr(S,h)),o)if(b)S=or(S,er(b.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(E)g=new Yn,S=or(S,new r(jn)),S=rr(S,g);else try{S=nr(S,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(jn)}catch{throw t}S=or(S,e),S=rr(S,new Yn)}i&&(a?S=rr(S,new Sn(t)):(y=new ln(t),S=rr(S,y))),tr(p,S,()=>{i&&!a||!c||(p.crc32=E?g.crc32:new m(h.value.buffer).getUint32(0))})}}class Yn extends z{constructor(){let t,e=10,n=new w(0);super({transform(t,r){if(e){const n=s.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const o=n.length+t.length;if(o<=8)return void(n=Se(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(Se(n.subarray(0,a),t.subarray(0,i-a))),n=Se(n.subarray(a),t.subarray(i-a))},flush(){const e=Ee(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Xn extends z{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:o,encrypted:i,checkCrc32:s,crc32:a,compressed:c,useCompressionStream:u,deflate64:l,format:d,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let S,b,E=super.readable;if(i&&(o?E=rr(E,new gn(t)):(b=new un(t),E=rr(E,b))),c){const t=d&&Bn(d);if(t)E=or(E,er(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{E=nr(E,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(jn)}catch{throw t}E=function(t,e,n){const r=new ke;let o,i,s,a=0,c=!1;const u=new g((t,e)=>{i=t,s=e});u.catch(()=>{}),n||i();const l=new z({start(t){const e=new w(10);e.set(qn),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await u}finally{h()}const e=new w(8),o=Ee(e);o.setUint32(0,r.get(),!0),o.setUint32(4,n,!0),t.enqueue(e)},cancel(t){s(t)}}),d=new z({transform(t,e){r.append(t),a+=t.length,a>=n?i():c&&p(),e.enqueue(t)},cancel(t){s(t)}});return t=rr(t,l),rr(t=or(t,e),d);function p(){h(),o=v(()=>s(new f(Pn)),5e3)}function h(){_(o)}}(E,e,y)}E=function(t){const e=t.getReader();return new F({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(Zn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(E)}s&&(S=new ve,E=rr(E,S)),tr(this,E,()=>{if(s){const t=new m(S.value.buffer);if(a!=t.getUint32(0,!1))throw new f(Hn)}})}}const Jn=new c;function Qn(t,e){if(!t)return!1;let n=Jn.get(t);n||(n=new c,Jn.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function $n(t){return Qn(t,Vn)}function tr(t,e,r){e=rr(e,new z({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function er(t,e,n){if(!t)throw new f(_n);return new t(e,n)}function nr(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?Gn:Vn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return or(t,a)}function rr(t,e){return An(t).pipeThrough(e)}function or(t,e){const n=e.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(n,t),await async function(t,e){try{await t.cancel(e)}catch{}}(r,t)}}(),e.readable}const ir="data",sr="deflate",ar="inflate";class cr extends z{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(sr)?i=Kn:o.startsWith(ar)&&(i=Xn),r.outputSize=0;let s=0;const a=new i(t,e),c=super.readable,u=new z({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:s})}}),l=new z({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new f(Pn)},flush(){const{crc32:t}=a;n.assign(r,{crc32:t,inputSize:s})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class ur extends z{constructor(t){const e=[];let r=0,i=0;function s(){const n=new w(t);let o=0;for(;o<t;){const r=e[0],i=t-o;r.length<=i?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,i),o),e[0]=r.subarray(i),o+=i)}return r-=t,n}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(n,o){for(e.push(n),r+=n.length;r>t;)i+=t,o.enqueue(s())},flush(t){r&&(i+=r,t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,r)))}}),n.defineProperty(this,"outputSize",{get:()=>i})}}const lr="Worker startup timeout";let dr,fr,wr;async function pr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.lt)return!0;if($n(e)||Qn(e,jn))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}function hr(t){t.createWorker?fr=!0:dr=!1}class mr{constructor(t,{readable:e,writable:r},{options:o,config:i,ft:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:l},d){const{signal:f}=s;return fr&&(l=dt),n.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new ur(pe(i))).pipeThrough(new yr(s),{signal:f}),writable:r,options:n.assign({},o),workerURI:u,createWorker:l,transferStreams:c,terminate:()=>new g(e=>{const{yt:n,wt:r}=t;n?(r?t.gt=e:(n.terminate(),e()),t.St=null):e()}),bt(){if(t.wt){const{gt:e}=t;e&&(t.gt=null,t.Et=!0,t.yt.terminate(),e()),t.wt=!1,d(t)}}}),dr===dt&&(dr=typeof T!=wt),(a&&wr&&(dr&&u||l)?wr:Sr)(t,i)}}class yr extends z{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await gr(t,n)},async transform(t,r){o+=t.length,e&&await gr(e,o,n),r.enqueue(t)},async flush(){r&&await gr(r,o)}})}}async function gr(t,...e){try{await t(...e)}catch{}}function Sr(t,e){return{run:()=>br(t,e)}}async function br({options:t,readable:e,writable:n,bt:r},o){let i,s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(sr),n=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,r=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(n&&n.lt&&!$n(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.lt||(t.useCompressionStream=!0)}}i=new cr(t,o),s=new ur(pe(o)),await e.pipeThrough(i).pipeThrough(s).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:a,outputSize:c}=i;return{crc32:r,inputSize:a,outputSize:c}}catch(t){throw i&&(t.outputSize=s?s.outputSize:0),t}finally{r()}}const Er={type:"module"},xr="error";let Rr,zr,Fr,Dr=!0;try{Dr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var Ar;function Cr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Ir(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.St=null}function Tr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(zr===dt||Rr!==t){const n=typeof t==pt;c=n?t(i):t;const s=c.startsWith("data:"),l=c.startsWith("blob:");if(s||l){o===dt&&(o=!1),o&&(u=Er);try{a=new T(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return Tr(t,e,r,o,!1);if(o)throw i;return Tr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=Er);try{c=new d(c,e)}catch{}try{a=new T(c,u)}catch(n){if(o)return Tr(t,e,r,!1,i);throw n}}Rr=t,zr=c,Fr=u}else a=new T(zr,Fr);return a.addEventListener("message",t=>{r.xt=!0,kr(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a}=t,{reader:c,writer:u,Rt:l,zt:d,bt:p,ht:h}=e,m=()=>e.ht!=h;try{if(a){const{message:t,stack:e,code:r,name:o,outputSize:i,cause:s,codecImportFailed:c}=a,u=new f(t);n.assign(u,{stack:e,code:r,name:o,outputSize:i}),s&&(u.cause=n.assign(new f(s.message),{name:s.name})),c&&(u.codecImportFailed=!0),y(u)}else{if("pull"==r){const{value:t,done:n}=await c.read();m()||_r({type:ir,value:t,done:n,messageId:i},e)}if(r==ir){const t=new w(o);await u.ready,await u.write(t),e.outputSize+=t.length,m()||_r({type:"ack",messageId:i},e)}"close"==r&&y(null,s)}}catch(a){m()||(Ir(e),y(a))}function y(t,e){m()||(t?d(t):l(e),u&&u.releaseLock(),t&&t.codecImportFailed||p())}}(t,r)}),a.addEventListener(xr,t=>vr(t,r)),a.addEventListener("messageerror",t=>vr(t,r)),a}function kr(t){const{Ft:e}=t;e&&(_(e),t.Ft=null)}function vr(t,e){t.preventDefault&&t.preventDefault(),kr(e);const{xt:r,zt:o,writer:i,bt:s}=e;Ir(e),r||(e.yt=null);let a=t.error||new f(t.message||xr);r||(a=n.assign(new f(a.message||xr),{Dt:!0}),e.At=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function _r(t,{yt:e,writer:n,transferStreams:r,xt:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=be(n),a.push(t.value.buffer)),r&&Dr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{Dr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}Ar=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t.St){let c;typeof a==pt&&(a=a());try{c=Tr(t.workerURI,r,t)}catch{return hr(t),Sr(t,e)}n.assign(t,{yt:c,xt:!1,Et:!1,At:null,St:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{At:e}=t;t.At=null;const n=e||new f(lr);throw n.Dt=!0,n}let r,i;const s=new g((e,n)=>{r=e,i=e=>{e&&e.outputSize===dt&&(e.outputSize=t.outputSize),n(e)}});n.assign(t,{reader:null,writer:null,outputSize:0,Rt:r,zt:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,Ct:d}=function(t){const e=new AbortController,{writable:n,readable:r}=new z,o=r.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:n,closed:o,Ct:()=>e.abort()}}(t.writable);let w;try{w=_r({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.bt(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.xt&&o.isFinite(p)&&p>=0&&(t.Ft=v(()=>function(t){if(t.Ft=null,t.xt)return;const{zt:e,writer:n}=t;if(Ir(t),t.yt=null,e){const t=new f(lr);t.Dt=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(t){await h(),d();try{await l}catch{}throw t}async function h(){if(!w&&!u.locked)try{await u.getWriter().close()}catch{}}}(t,{chunkSize:i,wasmURI:a,baseURI:r,workerStartupTimeout:s})}catch(n){if(n&&n.Dt)return hr(t),Cr(t),br(t,e);if(n&&n.codecImportFailed){if(t.reader)return Cr(t),br(t,e);t.bt()}throw n}}}})}return t.St},wr=Ar;let Nr=[];const Ur=[];let Or,Mr,Lr=0;async function Br(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:s,useCompressionStream:a,compressed:c,checkCrc32:u,computeCrc32:l,encrypted:f,format:w,codecURI:p}=n,{workerURI:h,createWorker:m,maxWorkers:y}=r;w&&(p&&(n.codecURI=function(t,e){try{return new d(t,e).toString()}catch{return t}}(p,r.baseURI)),await async function(t,e){!On.has(t)&&e&&Wn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const S=!(c||u||l||f),b=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!S&&b&&(s||s===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:dt,e.createWorker=e.useWebWorkers&&m?m:dt,n.useCompressionStream=a||a===dt&&r.useCompressionStream,(await async function(){const n=Nr.find(t=>!t.wt);if(n)return Vr(n),new mr(n,t,e,E);if(Nr.length<y){const n={It:Lr};return Lr++,Nr.push(n),new mr(n,t,e,E)}return new g(n=>{Ur.push({resolve:n,stream:t,Tt:e}),Mr=r.workerStarvationTimeout,Wr()})}()).run();function E(t){if(Pr(),Ur.length){const[{resolve:e,stream:n,Tt:r}]=Ur.splice(0,1);e(new mr(t,n,r,E)),Wr()}else t.yt?(Vr(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.Et?t.Et=!1:t.kt=v(async()=>{Nr=Nr.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):Nr=Nr.filter(e=>e!=t)}}function Wr(){!Or&&Ur.length&&o.isFinite(Mr)&&Mr>=0&&(Or=v(Zr,Mr))}function Pr(){Or&&(_(Or),Or=null)}function Zr(){if(Or=null,Ur.length){const[{resolve:t,stream:e,Tt:r}]=Ur.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new mr({},e,o,Hr)),Wr()}}function Hr(){Pr(),Wr()}function Vr(t){const{kt:e}=t;e&&(_(e),t.kt=null)}const Gr="\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 jr(t,e){return qr(t,e,!0)}function qr(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=Gr[t[n]];return e}(t):new b(e,{ignoreBOM:n}).decode(t)}const Kr="HTTP error ",Yr="HTTP Range not supported",Xr="HTTP resource changed",Jr="Writer iterator completed too soon",Qr="Writer not initialized",$r="Invalid writer (size must be writable)",to="Content-Range",eo="Range",no="GET",ro="bytes",oo=16777216,io="writable",so=k();class ao{constructor(){this.size=0}init(){this.initialized=!0}}class co extends ao{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=pe(we())}={}){const r=this;let o=0;return n=he(n),new F({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await qo(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class uo extends ao{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f(Qr);return t.writeUint8Array(be(e))}});n.defineProperty(t,io,{get:()=>e})}writeUint8Array(){}}class lo extends co{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{vt:t,_t:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{_t:n,vt:r}=this,o=new w(e),i=4*s.floor(t/3),a=atob(r.substring(i+n,4*s.ceil((t+e)/3)+n)),c=t-3*s.floor(i/4);let u=0;for(let t=c;t<c+e&&t<a.length;t++)o[t-c]=a.charCodeAt(t),u++;return u<o.length?o.subarray(0,u):o}}class fo extends uo{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Nt:""})}writeUint8Array(t){const e=this;let n,o=e.Nt;const i=e.Nt.length;for(e.Nt="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.Nt+=r.fromCharCode(t[n]);o.length>2?e.data+=R(o):e.Nt=o+e.Nt}getData(){return this.data+R(this.Nt)}}let wo,po;class ho extends co{constructor(t){super(),n.assign(this,{Ut:t,size:t.size}),po||(po=(async()=>{try{const t=new y([new w(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();wo=1==e}catch{wo=!1}})())}createReadable(t){const{Ut:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};if(typeof e.stream==pt){if(!r&&o>=n)return An(e.stream());if(wo)return An(e.slice(r,r+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,o=!t&&r>=n.size?n.Ut:n.Ut.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class mo extends ao{constructor(t){super();const e=this,r=new z;n.defineProperty(e,io,{get:()=>r.writable}),e.contentType=t,e.Ot=Cn(r.readable,t),e.Ot.catch(()=>{})}getData(){return this.Ot}}class yo extends ho{constructor(t){super(new y([t],{type:"text/plain"}))}}function go(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class So extends mo{constructor(t){super(),n.assign(this,{encoding:t,Mt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,Mt:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return qr(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class bo extends co{constructor(t,e){super(),xo(this,t,e)}async init(){await Ro(this,Uo,ko),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&n<i)return function(t,e,n){let r,i=e,a=0,c=n;return new F({start:()=>u(),async pull(t){r||await u();const{value:e,done:n}=await r.read();if(n)throw new f(Yr);const o=e.length>a?e.subarray(0,a):e;a-=o.length,c-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=r;r=dt,await t.cancel()}(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function u(){const e=s.min(t.maximumRangeSize,c),n=await Uo(no,t,Io(t,i,e));if(206!=n.status)throw new f(Yr);const u=n.headers.get(to);if(u){const t=o(u.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=i)throw new f(Yr)}Co(t,n),Ao(t,n),i+=e,a=e,r=n.body.getReader()}}(e,n,s.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return zo(this,t,e,Uo,ko)}}class Eo extends co{constructor(t,e){super(),xo(this,t,e)}async init(){await Ro(this,Oo,vo),super.init()}readUint8Array(t,e){return zo(this,t,e,Oo,vo)}}function xo(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=oo,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c,maximumRangeSize:u,fetch:l})}async function Ro(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=we(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(no,t,Io(t,a?-22:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==ro))throw new f(Yr);{if(a){const e=new w(await r.arrayBuffer());206==r.status&&e.length==K&&(t.Lt=e)}Ao(t,r);const o=Fo(r);o===dt?await No(t,e,n):t.size=o}}else await No(t,e,n)}async function zo(t,e,n,r,i){const{useRangeHeader:s,forceRangeRequests:a,Lt:c,size:u,options:l}=t;if(s||a){if(c&&e==u-K&&n==K)return c;if(e>=u||0===n)return gt;{e+n>u&&(n=u-e);const i=await r(no,t,Io(t,e,n));if(206!=i.status)throw new f(Yr);const s=i.headers.get(to);if(s){const t=o(s.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=e)throw new f(Yr)}Co(t,i),Ao(t,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new f(Yr);return a}}{const{data:r}=t;return r||await i(t,l),t.data.subarray(e,e+n)}}function Fo(t){const e=t.headers.get(to);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function Do({headers:t}){return{Bt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function Ao(t,e){const{checkResourceChanges:n,Wt:r}=t;n&&!r&&206==e.status&&(t.Wt=Do(e))}function Co(t,e){const{checkResourceChanges:r,Wt:o,size:i}=t;if(r){const t=Fo(e);if(t!==dt&&i!==dt&&t!=i)throw new f(Xr);if(o){const t=Do(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(Xr)}}}function Io(t,e=0,r=1){return n.assign({},To(t),{[eo]:ro+"="+(e<0?e:e+"-"+(e+r-1))})}function To({options:t}){const{headers:e}=t;if(e)return k.iterator in e?n.fromEntries(e):e}async function ko(t){await _o(t,Uo)}async function vo(t){await _o(t,Oo)}async function _o(t,e){const n=await e(no,t,To(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function No(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,To(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function Uo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status>=200&&s.status<=299)return s;throw 416==s.status?new f(Yr):new f(Kr+(s.statusText||s.status))}function Oo(t,{url:e},r){return new g((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status>=200&&s.status<=299){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f(Yr):new f(Kr+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>i(t.detail?t.detail.error:new f("Network error")),!1),s.open(t,e),r)for(const t of n.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Mo extends co{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Eo(t,e):new bo(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 Lo extends co{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{Pt:t,size:t.length})}readUint8Array(t,e){return this.Pt.slice(t,t+e)}}class Bo extends uo{constructor(t){super(),this.Zt=t||262144}init(t=0){n.assign(this,{offset:0,Pt:new w(t>0?t:this.Zt)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.Pt.length){let t=e.Pt.length?2*e.Pt.length:e.Zt;for(;t<n;)t*=2;const r=e.Pt;e.Pt=new w(t),e.Pt.set(r)}e.Pt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Pt.length?this.Pt:this.Pt.slice(0,this.offset)}}class Wo extends co{constructor(t){super(),this.Ht=t}async init(){const t=this;t.Vt=0;const e=t.Ht=await g.all(t.Ht.map(jo));t.Gt=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}jt(t){const{Gt:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{Ht:r}=this;let o,i=0,a=t;for(;r[i]&&a>=r[i].size;)a-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(a+e<=r)o=await qo(c,a,e);else{const i=r-a;o=Se(await qo(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=gt;return n.Vt=s.max(i,n.Vt),o}}class Po extends ao{constructor(t,e=4294967295){super();const r=this;let o,i,s;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const a=new D({async write(e){if(e===so)return void(s&&await u());const{availableSize:n}=r;if(s)e.length>=n?(await c(e.subarray(0,n)),await u(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:a}=await t.next();if(a&&!n)throw new f(Jr);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await Go(o),i=n.writable,s=i.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function c(t){const e=t.length;e&&(await s.ready,await s.write(t),o.size+=e,r.availableSize-=e)}async function u(){await l(),r.diskOffset+=o.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}n.defineProperty(r,io,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(so)}finally{t.releaseLock()}}}class Zo{constructor(t){return e.isArray(t)&&(t=new Wo(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:An(t)}),t}}class Ho{constructor(t){t.writable===dt&&typeof t.next==pt&&(t=new Po(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:In(t)});try{t.size=t.size===dt?0:t.size}catch{throw new f($r)}return t}}function Vo(t){return Boolean(t&&t.getData)}async function Go(t,e){if(!t.init||t.initialized)return g.resolve();await t.init(e)}async function jo(t){return t=new Zo(t),await Go(t),t.size!==dt&&t.readUint8Array||(t=new ho(await Cn(t.readable)),await Go(t)),t}function qo(t,e,n){return t.readUint8Array(e,n)}function Ko(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?co.prototype.createReadable.call(t,e):t.readable}function Yo(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}const Xo="filename",Jo="rawFilename",Qo="comment",$o="rawComment",ti="uncompressedSize",ei="compressedSize",ni="offset",ri="diskNumberStart",oi="lastModDate",ii="rawLastModDate",si="lastAccessDate",ai="rawLastAccessDate",ci="creationDate",ui="rawCreationDate",li="internalFileAttributes",di="externalFileAttributes",fi="msdosAttributesRaw",wi="msdosAttributes",pi="msDosCompatible",hi="zip64",mi="encrypted",yi="version",gi="versionMadeBy",Si="zipCrypto",bi="directory",Ei="executable",xi="compressionMethod",Ri="signature",zi="extraField",Fi="unixMode",Di="setuid",Ai="setgid",Ci="sticky",Ii=[Xo,Jo,ti,ei,oi,ii,Qo,$o,si,ai,ci,ui,ni,ri,li,di,fi,wi,pi,hi,mi,yi,gi,Si,bi,Ei,"symlink",xi,Ri,"crc32",zi,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Fi,"unixExternalUpper",Di,Ai,Ci,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Ti{constructor(t){Ii.forEach(e=>this[e]=t[e])}}const ki=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);function vi(t,e,n){return t?e?12:16+4*n:0}const _i="File format is not recognized",Ni="End of central directory not found",Ui="End of Zip64 central directory locator not found",Oi="Central directory header not found",Mi="Local file header not found",Li="Zip64 extra field not found",Bi="File contains encrypted entry",Wi="Encryption method not supported",Pi="Split zip file",Zi="Overlapping entry found",Hi="Entry data out of bounds",Vi="Ambiguous archive",Gi="Encrypted central directory is not supported",ji="Unsafe filename",qi="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Ki="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Yi="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Xi="64-bit value exceeds Number.MAX_SAFE_INTEGER",Ji="unsorted central directory",Qi="unknown version needed to extract",$i="compressed patched data",ts="malformed extra field",es="unknown zip64 extensible data",ns="wrapped entries count",rs="appended data",os="prepended data",is="prepended central directory",ss="trailing central directory data",as="duplicate filename",cs="mismatched zip64 end of central directory record",us="multiple end of central directory records",ls="mismatched local file header (filename)",ds="mismatched local file header (general purpose bit flag)",fs="mismatched local file header (compression method)",ws="mismatched local file header (crc32 or sizes)",ps=/^[a-zA-Z]:/,hs="utf-8",ms="cp437",ys=[[ti,O],[ei,O],[ni,O],[ri,M]],gs={[M]:{qt:ta,bytes:4},[O]:{qt:ea,bytes:8}},Ss=i(o.MAX_SAFE_INTEGER);class bs{constructor(t,e={}){n.assign(this,{reader:new Zo(t),options:e,Kt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await Go(r),r.size!==dt&&r.readUint8Array||(r=new ho(await Cn(r.readable)),await Go(r)),r.size<K)throw new f(_i);const o=e.warnings=[],i=Ms(t,e.options),a=i==Lt,c=i!=Wt,l=Ws(Ks(e,t,_t),i),d=function(t,e){if(t===dt)return e;if(!Os(t))throw new f(Ki);return t}(Ks(e,t,"filenameValidation"),i),w=Ks(e,t,"normalizeFilename"),{Yt:p,Xt:h}=await Ps(r,c,l);if(!p)throw await async function(t){return await Us(t)==W}(r)?new f(Pi):new f(Ni);c&&h>1&&qs(us);const m=Ee(p);let y=ta(m,12),g=ta(m,16);const S=p.offset,b=$s(m,20),E=S+K+b,x=r.size-E;x>l&&qs(rs),x>0&&Yo(o,rs);let R=$s(m,4);const F=r.Vt||0;let D,A,C,I,T,k=$s(m,6),v=$s(m,10),_=0,N=X;const U=g==O||y==O||v==M||k==M;if(g!=O&&k!=M&&(g+=Ns(r,k)),U){const t=p.offset>=Y?await qo(r,p.offset-Y,Y):gt,e=Ee(t);if(t.length==Y&&ta(e,0)==j){g=Ns(r,ta(e,4))+ea(e,8);let t=await qo(r,g,X),i=Ee(t);const c=p.offset-Y-X;if((t.length<X||ta(i,0)!=G)&&g!=c&&c>=0){const e=g;g=c,g>e&&(_=g-e),t=await qo(r,g,X),i=Ee(t)}if(t.length<X||ta(i,0)!=G)throw new f(Ui);if(C=!0,I=ea(i,4)>44,I){const t=s.min(ea(i,4)-44,r.size-g-X);t>0&&(N+=t,T=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Ee(t),o=$s(r,26);n.assign(e,{compressionMethod:$s(r,0),compressedSize:ea(r,2),uncompressedSize:ea(r,10),encryptionAlgorithm:$s(r,18),bitLength:$s(r,20),flags:$s(r,22),hashAlgorithm:$s(r,24),hashData:t.subarray(28,28+o)})}return e}(await qo(r,g+X,t)))}R==M?R=ta(i,16):R!=ta(i,16)&&js(a,o,cs),k==M?k=ta(i,20):k!=ta(i,20)&&js(a,o,cs),v==M?v=ea(i,32):v!=ea(i,32)&&js(a,o,cs),y==O?y=ea(i,40):y!=ea(i,40)&&js(a,o,cs),g=Ns(r,k)+ea(i,48)+_}}let B=y;const P=p.offset-(C?N+Y:0);if(g>=r.size&&(_=r.size-g-y-K,g=r.size-y-K),F!=R)throw new f(Pi);if(g<0)throw new f(_i);let Z=0,V=await qo(r,g,y),J=Ee(V);if(y){if(V.length<4)throw new f(_i);const t=P-y;if(g!=t&&k==R){const e=ta(J,Z)==H||Boolean(T&&T.compressedSize)||zs(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=ta(Ee(await qo(r,t,4)),0)==H),n){const n=g;g=t,g>n&&(_+=g-n,D=e),V=await qo(r,g,y),J=Ee(V)}}}const Q=P-g;if(y!=Q&&Q>=0&&k==R&&(y=Q,V=await qo(r,g,y),J=Ee(V)),g<0||g>=r.size)throw new f(_i);e.directoryOffset=g,e.directoryLength=B;const $=Ys(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&ta(J,0)!=H&&(I||zs(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(T,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),T),J=Ee(V),B=V.length,tt=!0}T&&!tt&&(V.length<4||ta(J,0)==H)&&Yo(o,es),A=g;const nt=Ks(e,t,"filenameEncoding"),ct=Ks(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!C;!v&&wt&&(v=Fs(J,V,Z),v&&Yo(o,ns));for(let i=0;i<v;i++){const a=new Rs(r,e.options);if(Z+q>V.length||ta(J,Z)!=H){if(0==i&&!tt&&(I||zs(J)))throw new f(Gi);throw new f(Oi)}As(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=$s(J,Z+4),m=!(h>>8),y=h>>8==3,g=V.subarray(u,l),S=$s(J,Z+32),b=p+S,E=V.subarray(p,b),x=c,R=c,F=ta(J,Z+38),D=F&L,C={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},T=ta(J,Z+42),k=Ys(e,t,"decodeText")||jr,N=x?hs:nt||ms,U=R?hs:ct||ms;let O=k(g,N,Ot);if(O===dt&&(O=jr(g,N)),w){const t=w(O);t!==dt&&(O=t)}if(Bs(O,d)){const t=new f(ji);throw t.filename=O,t}let B=k(E,U,Mt);B===dt&&(B=jr(E,U)),n.assign(a,{index:i,Jt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:S,offset:T,diskNumberStart:$s(J,Z+34),internalFileAttributes:$s(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:C,rawFilename:g,filenameUTF8:x,commentUTF8:R,rawExtraField:V.subarray(l,p),rawComment:E,filename:O,comment:B}),Cs(a,a,J,Z+6)&&Yo(o,ts,O),a.offset+=_;const W=Ns(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&Yo(o,Ji,O),ft=W,(a.version&L)>63&&Yo(o,Qi,O),32&~a.rawBitFlag||Yo(o,$i,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),K=Boolean(512&a.unixMode),Y=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!Y&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:K,symlink:Y,unixExternalUpper:P,executable:X,directory:Q||$||m&&C.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new Ti(a);if(et.getData=(t,n)=>a.getData(t,et,e.Kt,n),et.arrayBuffer=async t=>{const r=new z,o=Cn(r.readable).then(t=>t.arrayBuffer());return o.catch(()=>{}),await a.getData(r,et,e.Kt,n.assign({},t,{preventClose:!1})),o},Z=b,i==v-1&&wt){const t=Fs(J,V,Z);t&&(v+=t,Yo(o,ns))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new Ti(a))}catch{}yield et}let pt=Z,ht=Ds(V.subarray(Z))||(tt?Ds(et):dt);if(!ht&&!tt){const t=g+Z,e=s.min(P-t,65541);e>=6&&(ht=Ds(await qo(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&js(a,o,ss),lt&&js(a,o,as);const mt=Ks(e,t,"extractPrependedData"),yt=Ks(e,t,"extractAppendedData"),St=(a||mt)&&v&&4==A&&await async function(t){const e=await Us(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>St)&&qs(os),(_||v&&A>4)&&Yo(o,os),D&&Yo(o,is),mt&&(e.prependedData=A>St?await qo(r,St,A-St):gt),e.comment=b?await qo(r,S+K,b):gt,yt&&(e.appendedData=E<r.size?await qo(r,E,r.size-E):gt),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}[St](){return this.close()}}class Es{constructor(t={}){let r;const{readable:o,writable:i}=new z({start(t){r=t}}),s=new bs(o,t),a=s.getEntriesGenerator(),c=new u;this.readable=new F({async pull(t){const{done:e,value:r}=await a.next();if(e)return t.close();const o=function(t,e){const{readable:n,writable:r}=new z;let o;const i={cancel:async t=>{e.delete(i),await(o?o.cancel(t):n.cancel(t))}};return i.readable=new F({async pull(s){o||(o=n.getReader(),e.add(i),async function(){try{await t.getData(r,{preventClose:!1})}catch(t){try{await r.abort(t)}catch{}}finally{e.delete(i)}}());const{done:a,value:c}=await o.read();a?s.close():s.enqueue(c)},cancel:t=>i.cancel(t)},{highWaterMark:0}),i}(r,c),i={...r,readable:o.readable};delete i.getData,n.defineProperties(i,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),t.enqueue(i)},async cancel(t){const n=e.from(c);c.clear(),r.error(t),await g.allSettled(n.map(e=>e.cancel(t))),await g.allSettled([a.return(),s.close()])}}),this.writable=i}}async function xs(t,e={}){if(t=new Zo(t),await Go(t),t.size!==dt&&t.readUint8Array||(t=new ho(await Cn(t.readable)),await Go(t)),t.size<K)return!1;const n=Ms(e,{}),r=n!=Wt,o=Ws(e[_t],n),{Yt:i,Xt:s}=await Ps(t,r,o);if(!i||n==Lt&&s>1)return!1;const a=$s(Ee(i),20),c=i.offset+K+a;return t.size-c<=o}let Rs=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,r,o={}){const i=this,a=we(),{reader:c,index:u,offset:l,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:p,compressionMethod:h,bitFlag:m,rawBitFlag:y,crc32:g,rawLastModDate:S,uncompressedSize:b,compressedSize:E}=i,{dataDescriptor:x}=m,R=e.localDirectory={},z=e.warnings=[],F=Ns(c,d)+l,A=await qo(c,F,ct),C=Ee(A);let I=Ks(i,o,bt),T=Ks(i,o,Et);const k=Jt(Ks(i,o,xt)),v=Boolean(k),_=!0===k;if(Xt(I,T),I=I&&I.length&&I,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw new f(_n);if(A.length<ct||ta(C,0)!=B)throw new f(Mi);As(R,C,4);const{extraFieldLength:N,filenameLength:U}=R,O=R.dataOffset=F+ct+U+N,M=Ks(i,o,"checkLocalDirectory"),W=Ms(o,i.options),Z=function(t,e){return t===dt?e!=Wt:Boolean(t)}(M,W),H=Ks(i,o,"checkLocalFilename"),V=function(t,e){return t===dt?e==Lt:Boolean(t)}(H===dt?M:H,W);let G=gt;if(V&&(U||N)){const t=await qo(c,F+ct,U+N);G=t.subarray(0,U),R.rawExtraField=t.subarray(U)}else R.rawExtraField=N?await qo(c,F+ct+U,N):gt;V&&(R.rawFilename=G),Cs(i,R,C,4,!0)&&Yo(z,ts),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Jt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||js(s,o,ls),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&js(s,o,ds),e.compressionMethod!=t.compressionMethod&&js(s,o,fs),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||js(s,o,ws)}(i,R,G,V,Z?dt:z);const{lastAccessDate:j,creationDate:q,uid:K,gid:Y}=R;j&&(e.lastAccessDate=j),q&&(e.creationDate=q),K!==dt&&e.uid===dt&&(e.uid=K),Y!==dt&&e.gid===dt&&(e.gid=Y);const X=Ks(i,o,"checkPasswordOnly"),J=i.encrypted&&R.encrypted&&(!_||X),Q=J&&!w;if(_||(e.zipCrypto=Q),J&&!(64&~R.rawBitFlag))throw new f(Wi);const $=v?dt:Mn(h);if(0!=h&&8!=h&&9!=h&&!$&&!v)throw new f(_n);if(J){if(!Q&&(w.strength<1||w.strength>3))throw new f(Wi);if(!I&&!T)throw new f(Bi)}if(O+E>c.size)throw new f(Hi);const tt=E,et=An(c.createReadable({offset:O,size:tt})),nt=Kt(Ks(i,o,Rt));Yt(nt);let rt=Ks(i,o,"checkOverlappingEntry");const ot=Ks(i,o,"checkOverlappingEntryOnly");ot&&(rt=!0);const{onstart:it,onprogress:st,onend:at}=o,ut=0!=h&&!v,lt=v?E-vi(J,Q,w&&w.strength):b,ft=9==h;let wt=Ks(i,o,Ft);ft&&(wt=!1);const pt=Ks(i,o,"checkCrc32"),ht=(pt===dt?Ks(i,o,"checkSignature"):pt)&&!v&&(!J||Q||w&&1==w.vendorVersion),mt={options:{codecType:ar,password:I,rawPassword:T,zipCrypto:Q,encryptionStrength:w&&w.strength,checkCrc32:ht,checkAuthenticationCode:Ks(i,o,"checkAuthenticationCode"),passwordVerification:Q&&(x?S>>>8&L:g>>>24&L),outputSize:lt,crc32:g,compressed:ut,encrypted:J,useWebWorkers:Ks(i,o,zt),useCompressionStream:wt,transferStreams:Ks(i,o,Dt),deflate64:ft,format:$?$.format:dt,codecURI:$?$.codecURI:dt,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:X},config:a,ft:{signal:nt,size:tt,onstart:it,onprogress:st,onend:at}};let yt,St;rt&&await async function({reader:t,$t:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,Kt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await qo(t,a+i,d+4),r=Ee(n);let c=n.length==d+4&&ta(r,0)==P;if(c){const t=_s(r,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:c=!1}if(n.length>=d){const t=_s(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,$t:e};for(const[t,e]of l)if(t!=n&&w.start<e.end&&e.start<w.end){const t=new f(Zi);throw t.overlappingEntry=e.$t,t}l.set(n,w)}({reader:c,$t:e,index:u,offset:F,crc32:g,compressedSize:E,uncompressedSize:b,dataOffset:O,dataDescriptor:x||R.bitFlag.dataDescriptor,extraFieldZip64:p||R.extraFieldZip64,Kt:r});try{if(!ot){X&&(t=new D),t=new Ho(t),await Go(t,function(t,e,n){return s.min(t,n?1032*e:e)}(lt,E,ut)),({writable:yt}=t);const{outputSize:e}=await Br({readable:et,writable:yt},mt);if(e!=lt)throw n.assign(new f(Pn),{outputSize:e});t.size+=e}}catch(e){if(e.outputSize!==dt&&(t.size+=e.outputSize),!X||e.message!=Pe)throw St=e,e}finally{if((Vo(t)||!Ks(i,o,At))&&yt&&!yt.locked){const t=yt.getWriter();if(St)try{await t.abort(St)}catch{}else await t.close()}}return X||ot?dt:t.getData?t.getData():yt}};function zs(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==ta(t,n))return!0;return!1}function Fs(t,e,n){let r=0;for(;n+q<=e.length&&ta(t,n)==H;)n+=q+$s(t,n+28)+$s(t,n+30)+$s(t,n+32),r++;return r%65536?0:r}function Ds(t){if(t.length>=6){const e=Ee(t);if(ta(e,0)==Z){const n=$s(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function As(t,e,r){const o=t.rawBitFlag=$s(e,r+2),i=!(1&~o),s=ta(e,r+6);n.assign(t,{encrypted:i,version:$s(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:Xs(s),filenameLength:$s(e,r+22),extraFieldLength:$s(e,r+24)})}function Cs(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=Ee(s);let d=0,w=!1;try{for(;d<s.length;){const t=$s(l,d),e=$s(l,d+2);u.set(t,{type:t,data:s.slice(d+4,d+4+e)}),d+=4+e}}catch{w=!0}d>s.length&&(w=!0);const p=$s(r,o+4);n.assign(e,{signature:ta(r,o+10),crc32:ta(r,o+10),compressedSize:ta(r,o+14),uncompressedSize:ta(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=Ee(t.data),r=ys.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+gs[e].bytes,0);if(t.data.length<o)throw new f(Li);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=gs[a];e[s]=t[s]=c.qt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(Is(m,Xo,Jo,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(Is(y,Qo,$o,e,t),e.extraFieldUnicodeComment=y);const g=u.get(J);g&&g.data.length>=7?(function(t,e,r){const o=Ee(t.data),i=Qs(o,4);n.assign(t,{vendorVersion:Qs(o,0),vendorId:Qs(o,2),strength:i,originalCompressionMethod:r,compressionMethod:$s(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(g,e,p),e.extraFieldAES=g):e.compressionMethod=p;const S=u.get(13);S&&(Ts(S,e),e.extraFieldPkwareUnix=S);const b=u.get(22613);b&&(Ts(b,e),e.extraFieldUnixType1=b);const E=u.get(10);E&&(function(t,e){const r=Ee(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=$s(r,i),n=$s(r,i+2);1==e&&(o=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(o&&24==o.length){const r=Ee(o),i=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),a=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:s,rawCreationDate:a});const c={lastModDate:Js(i),lastAccessDate:Js(s),creationDate:Js(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(E,e),e.extraFieldNTFS=E);const x=u.get(et);let R;if(x&&(R=ks(x,e,!1),e.extraFieldUnix=x),!R){const t=u.get(tt);t&&(ks(t,e,!0),e.extraFieldInfoZip=t)}const z=u.get(Q);z&&(function(t,e,n){if(!t.data.length)return;const r=Ee(t.data),o=Qs(r,0),i=[],s=[];n?(1&~o||(i.push(oi),s.push(ii)),2&~o||(i.push(si),s.push(ai)),4&~o||(i.push(ci),s.push(ui))):t.data.length>=5&&(i.push(oi),s.push(ii));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=ta(r,c);e[n]=t[n]=new a(1e3*(0|i));const u=s[o];t[u]=i}c+=4})}(z,e,i),e.extraFieldExtendedTimestamp=z);const F=u.get($);return F&&(e.extraFieldUSDZ=F),w}function Is(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=Ee(t.data),a=new ke;a.append(i[r]);const c=Ee(new w(4));c.setUint32(0,a.get(),!0);const u=ta(s,1),l=Qs(s,0);n.assign(t,{version:l,[e]:jr(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==ta(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function Ts(t,e){if(t.data.length<8)return;const r=Ee(t.data),o={lastAccessDate:new a(1e3*(0|ta(r,0))),lastModDate:new a(1e3*(0|ta(r,4)))};t.data.length>=12&&(o.uid=$s(r,8),o.gid=$s(r,10)),n.assign(t,o),n.assign(e,o)}function ks(t,e,r){try{const o=Ee(t.data);let i,s;if(r){let e=0;const r=Qs(o,e++),a=Qs(o,e++);i=vs(t.data.subarray(e,e+a)),e+=a;const c=Qs(o,e++);s=vs(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=$s(o,0),s=$s(o,2),n.assign(t,{uid:i,gid:s}));return i!==dt&&(e.uid=i),s!==dt&&(e.gid=s),i!==dt||s!==dt}catch{}}function vs(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function _s(t,e,n){const r=ta(t,e);let o,i;return n?(o=ea(t,e+4),i=ea(t,e+12)):(o=ta(t,e+4),i=ta(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Ns(t,e){return t.jt?t.jt(e):0}async function Us(t){return ta(Ee(await qo(t,0,4)))}function Os(t){return t===Lt||t===Bt||t===Wt}function Ms(t,e){return Ls(t,Ls(e,Bt))}function Ls(t,e){const n=t.strictness;if(n!==dt){if(!Os(n))throw new f(qi);return n}const r=t.checkAmbiguity;return r===dt?e:r?Lt:e==Wt?Wt:Bt}function Bs(t,e){if(e==Wt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||ps.test(t))||e==Lt&&(n.includes(".")||n.includes(""))}function Ws(t,e){if(t!==dt){const e=te(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(Yi);return e}return e==Lt?0:e==Wt?1/0:M}async function Ps(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of Zs(t,o)){const o=$s(n,d+20);if(f+K+o==r){const o=await Vs(t,n,s,d,f,r,i);if(2==o){if(a||(a=Hs(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Hs(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of Zs(t,o)){const o=Hs(c,u,l);i||(i=o);const d=await Vs(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Yt:a,Xt:u}}async function*Zs(t,e){const n=t.size-e,r=await qo(t,n,e),o=Ee(r);for(let t=r.length-K;t>=0;t--)ta(o,t)==V&&(yield[o,n,r,t,n+t])}function Hs(t,e,n){return{offset:n,buffer:t.slice(e,e+K).buffer}}async function Vs(t,e,n,r,o,i,s){const a=$s(e,r+10),c=ta(e,r+12),u=ta(e,r+16);if(a==M||c==O||u==O)return await Gs(t,e,n,o-Y,i,s)==j?2:0;if(!a&&!c)return 1;const l=$s(e,r+6);for(const r of[o-c,Ns(t,l)+u])if(await Gs(t,e,n,r,i,s)==H)return 2;return 0}async function Gs(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?ta(e,r-n):i.count>0?(i.count--,ta(Ee(await qo(t,r,4)),0)):dt}function js(t,e,n){t?qs(n):Yo(e,n)}function qs(t){const e=new f(Vi);throw e.reason=t,e}function Ks(t,e,n){return e[n]===dt?t.options[n]:e[n]}function Ys(t,e,n){return qt(Ks(t,e,n))}function Xs(t){const e=(4294901760&t)>>16,n=t&M,r=new a(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<lt?lt:r}function Js(t){return new a(o(t/i(1e4)-i(116444736e5)))}function Qs(t,e){return t.getUint8(e)}function $s(t,e){return t.getUint16(e,!0)}function ta(t,e){return t.getUint32(e,!0)}function ea(t,e){const n=t.getBigUint64(e,!0);if(n>Ss)throw new f(Xi);return o(n)}var na=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Vi,ERR_BAD_FORMAT:_i,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Oi,ERR_ENCRYPTED:Bi,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Gi,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Hi,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Ui,ERR_EOCDR_NOT_FOUND:Ni,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Li,ERR_INVALID_AUTHENTICATION_CODE:We,ERR_INVALID_COMPRESSED_DATA:Zn,ERR_INVALID_CRC32:Hn,ERR_INVALID_FILENAME_VALIDATION:Ki,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Yi,ERR_INVALID_PASSWORD:Be,ERR_INVALID_STRICTNESS:qi,ERR_INVALID_UNCOMPRESSED_SIZE:Pn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Mi,ERR_OVERLAPPING_ENTRY:Zi,ERR_SPLIT_ZIP_FILE:Pi,ERR_UNSAFE_FILENAME:ji,ERR_UNSUPPORTED_COMPRESSION:_n,ERR_UNSUPPORTED_ENCRYPTION:Wi,ERR_UNSUPPORTED_UINT64:Xi,ERR_WORKER_STARTUP_TIMEOUT:lr,WARNING_APPENDED_DATA:rs,WARNING_COMPRESSED_PATCHED_DATA:$i,WARNING_DUPLICATE_FILENAME:as,WARNING_MALFORMED_EXTRA_FIELD:ts,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:ds,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:fs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ws,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:ls,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:cs,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:us,WARNING_PREPENDED_CENTRAL_DIRECTORY:is,WARNING_PREPENDED_DATA:os,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:ss,WARNING_UNKNOWN_VERSION:Qi,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:es,WARNING_UNSORTED_CENTRAL_DIRECTORY:Ji,WARNING_WRAPPED_ENTRIES_COUNT:ns,ZipReader:bs,ZipReaderStream:Es,isZipFile:xs});const ra="File already exists",oa="Zip file comment exceeds 64KB",ia="Invalid zip file comment (must be a Uint8Array)",sa="File entry comment exceeds 64KB",aa="Invalid file entry comment (must be a string)",ca="Invalid date (must be a valid Date instance)",ua="File entry name exceeds 64KB",la="Version exceeds 65535",da="The strength must equal 1, 2, or 3",fa="Encryption is not supported in USDZ files",wa="Split zip files are not supported in USDZ files",pa="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",ha="Invalid extra field (must be a Map)",ma="Invalid extra field type (must be integer 0..65535)",ya="Invalid extra field data (must be a Uint8Array)",ga="Extra field data exceeds 64KB",Sa=-2147483648,ba=2147483647,Ea=i(0),xa=i("0x7fffffffffffffff"),Ra="Zip64 is not supported (set the 'zip64' option to 'true')",za="Undefined uncompressed size",Fa="Undefined compression method",Da="Undefined CRC32",Aa="Undetermined size",Ca="Undefined reader",Ia="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",Ta="Zip file not empty",ka="Invalid uid (must be integer 0..2^32-1)",va="Invalid gid (must be integer 0..2^32-1)",_a="Invalid UNIX mode (must be integer 0..65535)",Na="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Ua="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Oa="Invalid msdosAttributesRaw (must be integer 0..255)",Ma="Invalid msdosAttributes (must be an object with boolean flags)",La="Invalid level (must be integer 0..9)",Ba="Signature data exceeds 64KB",Wa="Invalid entry option (must be an entry returned by ZipReader#getEntries())",Pa="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Za="compression unavailable",Ha="clamped last modification date",Va=new w([7,0,2,0,65,69,3,0,0]),Ga="infozip",ja="unix",qa=[8,9,5,3];let Ka=0;const Ya=[];class Xa{constructor(t,e={}){t=new Ho(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;if(i&&e[vt])throw new f(wa);n.assign(this,{writer:t,te:i,options:e,ee:new c,ne:new u,offset:e[kt]===dt?t.size||t.writable.size||0:e[kt],re:e[kt]===dt?0:e[kt]-(t.size||t.writable.size||0),oe:new u,ie:[],warnings:[],se:0,ae:0,ce:dt,ue:!1})}prependZip(t){return $a(this,async function(t,e){if(t.ne.size)throw new f(Ta);await t.le(e)}(this,t))}appendZip(t){return $a(this,this.le(t))}async le(t){const r=this,{oe:o,ne:i,ee:s}=r;for(;o.size;)await g.allSettled(e.from(o));let a;const u=new g(t=>a=t);o.add(u);const l=[];let d;try{t=new Zo(t),await Go(t),t.size!==dt&&t.readUint8Array||(t=new ho(await Cn(t.readable)),await Go(t));const{ZipReader:o}=await g.resolve().then(function(){return na}),a=new o(t),u=await a.getEntries();await a.close(),await Go(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(ra);i.add(t),l.push(t)}),r.de=!0;const{fe:p}=r;r.fe=new g(t=>d=()=>{r.de=!1,t()}),await p,r.te&&(delete r.te,await async function(t){return Ee(await qo(t,0,4)).getUint32(0,!0)==W}(t)||(await zc(r.writer,xc()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>Ec(n,t)-Ec(n,e));let c=0;for(const e of a){const r=Ec(n,e);await Sc(t,n,c,r-c),mc(i,await bc(n,r))&&await i.closeDisk(),s.set(e,{offset:yc(t,i),diskNumberStart:pc(i)}),c=r}await Sc(t,n,c,o-c)}else{const e=t.offset;await Sc(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Ec(n,t),diskNumberStart:0}))}return s}(r,t,u,w);u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:o,bitFlag:i,encrypted:a,uncompressedSize:c,compressedSize:u,extraFieldZip64:l}=t;let{compressionMethod:d,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:m}=i;f=gc(f||gt),t.extraFieldAES&&(d=99);const y=Wc(f),g=Boolean(l)&&l.uncompressedSize!==dt,S=Boolean(l)&&l.compressedSize!==dt,b=-7&Hc(w,p,m,a,d)|w<<1,{we:E,pe:x}=Pc({version:e,bitFlag:b,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,he:S,me:g,extraFieldLength:y}),{crc32:R}=t;R!==dt&&Mc(x,10,R);const{offset:z,diskNumberStart:F}=h.get(t);n.assign(t,{ye:!0,me:g,he:S,offset:z,diskNumberStart:F,ge:!1,Se:gt,be:gt,Ee:gt,xe:gt,Re:gt,rawExtraField:f,ze:gt,extendedTimestamp:!1,we:E,pe:x}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{oe:s}=o,a=async function(t,e,r,o){const s=(o=n.assign({},o))[Ut];if(s!==dt){const{Fe:e,De:r}=nc(s,Jt(Ic(t,o,xt)),Ic(t,o,oi));delete o[Ut],o=n.assign(e,r,o)}if(Ic(t,o,bi)&&!e.endsWith(at)&&(e+=at),t.ne.has(e))throw new f(ra);t.ne.add(e),Ka<we().maxWorkers?Ka++:await new g(t=>Ya.push(t));try{return await async function(t,e,r,o){const s=rc(t,e,o);({name:e}=s);const a=oc(t,e,o),{comment:c}=a,u=o[zi];t.ee.set(e,dt);const l=t.ce,d={};let w,p;a.Ae.keepOrder&&(d.Ce=new g(t=>w=t)),t.ce=d;try{const{Ae:c}=a;0==c.level||c.compressionMethod!==dt||c.Ie||await pr(we())||(c.level=0,Yo(t.warnings,Za,e));const u=await async function(t,e,{Ae:r},o){if(r.Ie&&!e&&!Ic(t,o,bi))throw new f(Ca);let i;if(e){if(e=new Zo(e),await Go(e),!e.readable&&!e.readUint8Array)throw new f(Ia);({size:i}=e)}return n.assign({reader:e},sc(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=hc(t.writer),m=pc(t.writer);let y=o.crc32===dt?o[Ri]:o.crc32;const S=u.Ae.encrypted&&!c.zipCrypto;if(c.Ie&&!c.Te&&S&&(y=dt),c.Ie&&r&&!S&&y===dt)throw new f(Da);const b=cc(o=n.assign({},o,s.Ae,a.Ae,u.Ae,{signature:o[Ri],crc32:y,offset:t.offset-h,diskNumberStart:m,[vt]:t.options[vt]}));b.ke&&Yo(t.warnings,Ha,e);const E=dc(o),x=Wc(b.ve,E._e);p=await async function(t,e,r,o,s){const{ee:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,Ne:d,signal:w}=s,{Ue:p,$t:h,Oe:m,Me:y}=o,S=t.options[vt];let b,E,x,R,F,D,A,C=h,I=0;const T=u&&m?m.Ce:dt;a.set(e,C);try{s.bufferedWrite||!u||t.de||t.se||t.ae||!l&&!d?(b=!0,t.se++,A=s.createTempStream?await s.createTempStream():new z(dt,dt,{highWaterMark:ft}),A.size=0,await Go(c)):(E=!0,t.ae++,A=c,await T,await k()),await Go(A);const h=hc(c);t.te&&!b&&await Rc(t,c),S&&!b&&uc(o,t.offset-h);const{ve:m}=p;b||await v();const y=pc(c),x=yc(t,c);if(C.diskNumberStart=y,b||(F=!0,D=c.size,await zc(A,m)),C=await async function(t,e,{diskNumberStart:r,Ce:o},s,a,c){const{Ue:u,Le:l,Be:d}=s,{we:w,pe:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:S,compressionMethod:b,Se:E,We:x,Ee:R,Pe:z,Ze:F,xe:D,Re:A,be:C}=u,{_e:I}=l,{rawFilename:T,lastAccessDate:k,creationDate:v,password:_,rawPassword:N,level:U,useUnicodeFileNames:M,zip64:B,ye:W,me:P,he:Z,zipCrypto:H,dataDescriptor:V,directory:G,executable:j,versionMadeBy:q,rawComment:K,rawExtraField:Y,ze:X,useWebWorkers:J,transferStreams:Q,onstart:$,onprogress:tt,onend:et,signal:nt,encryptionStrength:rt,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,uid:ct,gid:ut,unixMode:lt,symlink:ft,setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:gt,useCompressionStream:St,Ie:bt,Te:Et,format:xt,codecURI:Rt}=c,zt={Ce:o,versionMadeBy:q,zip64:B,ye:W,directory:Boolean(G),executable:Boolean(j),filenameUTF8:Boolean(M),rawFilename:T,commentUTF8:Boolean(M),rawComment:K,Se:E,We:x,Ee:R,xe:D,Re:A,be:C,rawExtraField:Y,ze:X,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,diskNumberStart:r,uid:ct,gid:ut,unixMode:lt,symlink:Boolean(ft),setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:gt};let{crc32:Ft,uncompressedSize:Dt}=c,At=0;bt||(Dt=0);const{writable:Ct}=e;if(t){const n=t.size,r=An(Ko(t,{size:n})),o={options:{codecType:sr,inputSize:n,level:U,rawPassword:N,password:_,encryptionStrength:rt,zipCrypto:y&&H,passwordVerification:y&&H&&m>>8&L,computeCrc32:!bt,compressed:g&&!bt,encrypted:y&&!Et,useWebWorkers:J,useCompressionStream:St,transferStreams:Q,format:xt,codecURI:Rt,compressionMethod:b},config:a,ft:{signal:nt,size:n,onstart:$,onprogress:tt,onend:et}};try{const t=await Br({readable:r,writable:Ct},o);if(At=t.outputSize,e.size+=At,bt||(Dt=t.inputSize,y&&!H||(Ft=t.crc32)),!Z&&At>=O||!P&&Dt>=O)throw new f(Ra)}catch(t){throw t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,Ue:r,Le:o},{zip64:s,zipCrypto:a,Ie:c,dataDescriptor:u}){const{pe:l,encrypted:d}=r,{He:f,Ve:w}=o;d&&!a&&!c||t===dt||(Mc(l,10,t),u&&Mc(f,w,t)),s?u&&(Lc(f,w+4,i(e)),Lc(f,w+12,i(n))):(Mc(l,14,e),Mc(l,18,n),u&&(Mc(f,w+4,e),Mc(f,w+8,n)))}({crc32:Ft,compressedSize:At,uncompressedSize:Dt,Ue:u,Le:l},c),V&&await zc(e,I),n.assign(zt,{uncompressedSize:Dt,compressedSize:At,lastModDate:h,rawLastModDate:m,creationDate:v,lastAccessDate:k,encrypted:Boolean(y),zipCrypto:Boolean(H),size:d+At,compressionMethod:b,version:S,we:w,pe:p,signature:Ft,crc32:!y||H||bt?Ft:dt,Pe:z,Ze:F,me:P,he:Z}),zt}(r,A,C,o,we(),s),b||(F=!1),a.set(e,C),C.filename=e,b){if(await g.all([A.writable.getWriter().close(),T]),await k(),t.te&&await Rc(t,c),R=!0,D=c.size,await v(),C.diskNumberStart=pc(c),C.offset=yc(t,c),S){const e=o.Be;uc(o,t.offset-hc(c)),C.size+=o.Be-e}!function({rawFilename:t,encrypted:e,zip64:n,We:r,crc32:o,compressedSize:s,uncompressedSize:a,me:c,he:u},l,{dataDescriptor:d,Ie:f}){if(d||((!e||f&&o!==dt)&&Mc(l,14,o),u||Mc(l,18,s),c||Mc(l,22,a)),n&&r){const e=ct+Wc(t)+4;Lc(l,e,i(a)),Lc(l,e+8,i(s))}}(C,p.Ge,s),await zc(c,p.ve),await Fc(A.readable,c,w,t=>I+=t),c.size+=A.size,R=!1}else C.diskNumberStart=y,C.offset=x;return t.offset+=C.size,C}catch(n){if(R||F){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-D,b&&(t.offset+=I)}throw a.delete(e),n}finally{if(b&&t.se--,E&&t.ae--,y&&y(T),x&&x(),b&&A&&A.dispose)try{await A.dispose()}catch{}}async function k(){t.de=!0;const{fe:e}=t;t.fe=new g(e=>x=()=>{t.de=!1,e()}),await e}async function v(){mc(c,Wc(p.ve))&&await c.closeDisk()}}(t,e,r,{Ue:b,Le:E,Be:x,$t:d,Oe:l,Me:w},o)}catch(n){throw t.ee.delete(e),n}finally{w&&w(l&&l.Ce)}return n.assign(p,{name:e,comment:c,extraField:u}),new Ti(p)}(t,e,r,o)}catch(n){throw t.ne.delete(e),n}finally{const t=Ya.shift();t?t():Ka--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return g.prototype.then.call(a,c,c),$a(o,a)}remove(t){const{ne:e,ee:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=gt,n={}){const r=this,{oe:o,writer:s}=this,{writable:a}=s;if(r.ue)return Qa(s);if(!(t instanceof w))throw new f(ia);if(Wc(t)>M)throw new f(oa);for(;o.size;)await g.allSettled(e.from(o));await g.allSettled(r.ie.map(t=>t.je));const c=r.ie.filter(t=>t.error&&!t.qe);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.qe=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{Ke:o,Ye:s}=fc(t.ee),{Xe:a,Je:c,Qe:u}=await async function(t,n,r){const{ee:o,writer:i}=t,s=new w(n);await Go(i);let a=0,c=0,u=pc(i),l=hc(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,Se:w,be:p,Ee:h,xe:m,Re:y,rawExtraField:g,ze:S,rawComment:b,versionMadeBy:E,we:x,pe:R,me:z,he:F,ge:D,$e:A,internalFileAttributes:C,externalFileAttributes:I,diskNumberStart:T,uncompressedSize:k,compressedSize:v}=n,_=Wc(w,p,h,m,y,g,S),N=q+Wc(f,b)+_;mc(i,a+N-c)&&(await zc(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=pc(i),l=hc(i)),z||Mc(R,18,k),F||Mc(R,14,v),(A||D)&&n.version<45&&Oc(R,0,45);const U=wc(N);if(U.tn(H),U.en(E),U.nn(x.subarray(0,24)),U.en(_),U.en(Wc(b)),U.en(D?M:T),U.en(C),U.tn(I),U.tn(A?O:e),U.nn(f),U.nn(w),U.nn(p),U.nn(h),U.nn(m),U.nn(y),U.nn(g),U.nn(S),U.nn(b),Bc(s,U.Pt,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new Ti(n))}catch{}}return await zc(i,c?s.slice(c):s),{Xe:{diskNumber:u,diskOffset:l},Je:{diskNumber:pc(i),rn:d},Qe:s}}(t,o,r),l=await async function(t,e,n){const r=kc(t,n,Nt);if(r){const n=await r(e),o=Wc(n);if(o>M)throw new f(Ba);const i=wc(6+o);i.tn(Z),i.en(o),i.nn(n);const{writer:s}=t;return mc(s,Wc(i.Pt))&&await s.closeDisk(),await zc(s,i.Pt),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{Xe:s,Je:a,sn:c,Ye:u}=r;let{Ke:l}=r,d=t.ee.size,w=s.diskNumber,p=yc(t,s);const h=Wc(e);if(h>M)throw new f(oa);let m=Ic(t,n,hi),y=pc(o);if(mc(o,(m?98:K)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(Ra);m=!0}else m===dt&&u&&(m=!0);const g=wc(m?98:K);mc(o,Wc(g.Pt)+h)&&await o.closeDisk(),y=pc(o);let S=y==a.diskNumber?a.rn:0;m&&(g.tn(G),g.an(44),g.en(45),g.en(45),g.tn(y),g.tn(w),g.an(S),g.an(d),g.an(l),g.an(p),g.tn(j),g.tn(y),g.an(i(yc(t,o))+i(l)+i(c)),g.tn(y+1),Ic(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),S=M,d=M,p=O,l=O),g.tn(V),g.en(y),g.en(w),g.en(S),g.en(d),g.tn(l),g.tn(p),g.en(h),await zc(o,g.Pt),h&&await zc(o,e)}(t,n,r,{Xe:a,Je:c,Ke:o,sn:l,Ye:s})}(r,t,n),r.ue=!0,!Vo(s)&&Ic(r,n,At)||await a.getWriter().close(),Qa(s)}[St](){return this.close()}}class Ja extends g{then(t,e){const{cn:n}=this;return n&&(n.qe=!0),super.then(t,e)}}function Qa(t){return t.getData?t.getData():t.writable}function $a(t,e){const n=new Ja((t,n)=>g.prototype.then.call(e,t,n)),r={};return n.cn=r,r.je=g.prototype.then.call(n,dt,t=>r.error=t),t.ie.push(r),n}async function tc(t,e){try{await t.writer.writable.abort(e)}catch{}}function ec(t,e,n){t.oe.add(e),e.catch(t=>{try{n(t)}catch{}})}function nc(t,r,o){if(null===t||typeof t!=ht||e.isArray(t))throw new f(Wa);const{externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:g,crc32:S,compressionMethod:b,extraFieldAES:E,extraFieldUnix:x,internalFileAttributes:R,extraField:z,bitFlag:F,directory:D,uid:A,gid:C}=t,I={externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,creationDate:p,lastAccessDate:h,internalFileAttributes:R,directory:D};F&&F.languageEncodingFlag&&(I[It]=!0);const T=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{ki.has(n)||e.set(n,t.data)}),e.size)return e}}(z);T&&(I[zi]=T),A===dt&&C===dt||n.assign(I,{uid:A,gid:C,unixExtraFieldType:x?ja:Ga});const k={};if(r&&!D)if(n.assign(k,{uncompressedSize:m,crc32:S,compressionMethod:b}),r!==Pt&&n.assign(k,{encrypted:y,zipCrypto:g,encryptionStrength:E?E.strength:dt}),F&&(k.dataDescriptor=F.dataDescriptor,k[Ct]=qa[F.level]),o===dt)k.rawLastModDate=w;else if(r!==Pt&&g&&(!F||F.dataDescriptor)&&o instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(o)!=(w>>>8&L))throw new f(Pa);return{Fe:I,De:k}}function rc(t,n,r){let o=Ic(t,r,pi),i=Ic(t,r,gi,o?20:768);const s=Ic(t,r,Ei),a=vc(t,r,"uid"),c=vc(t,r,"gid");let u=vc(t,r,Fi),l=Ic(t,r,"unixExtraFieldType"),d=Ic(t,r,Di),w=Ic(t,r,Ai),p=Ic(t,r,Ci);if($t(a,O,ka),$t(c,O,va),$t(u,M,_a),l!==dt&&l!==Ga&&l!==ja)throw new f(Na);if(l===ja&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Ua);l!==dt||a===dt&&c===dt||(l=Ga);let h=vc(t,r,fi),m=Ic(t,r,wi);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),$t(h,L,Oa),m&&(typeof m!==ht||e.isArray(m)))throw new f(Ma);if(i>M)throw new f(la);let g=Ic(t,r,di);const S=g!==dt;S||(g=0),!r[bi]&&n.endsWith(at)&&(r[bi]=!0);const b=Ic(t,r,bi);if(b?(n.endsWith(at)||(n+=at),S||(g=16,o||(g|=16877<<16))):o||S||(g=s?493<<16:27525120),!o){const t=u!==dt||Boolean(d||w||p);u=u===dt?g>>16&M:u&M,d?u|=it:d=Boolean(u&it),w?u|=st:w=Boolean(u&st),p?u|=512:p=Boolean(512&u),S&&!t||(b?u=-61441&u|ot:u&rt||(u|=32768),g=(u&M)<<16|g&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(t,e){if(t!==dt)t&=L;else if(e!==dt){const{readOnly:n,hidden:r,system:o,directory:i,archive:s}=e;let a=0;n&&(a|=1),r&&(a|=2),o&&(a|=4),i&&(a|=16),s&&(a|=32),t=a&L}return e===dt&&(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}}(h,m)),y&&(g=g&O|h&L);const E=g>>16&M,x=u!==dt&&40960==(u&rt);return{name:n,Ae:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:g,unixExternalUpper:E,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:x,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function oc(t,e,n){const r=kc(t,n,"encodeText")||_e;let i=r(e,Ot);if(i===dt&&(i=_e(e)),Wc(i)>M)throw new f(ua);const s=n[Qo]||"";if(typeof s!=mt)throw new f(aa);let c=r(s,Mt);if(c===dt&&(c=_e(s)),Wc(c)>M)throw new f(sa);const u=Ic(t,n,yi);if(u!==dt&&u>M)throw new f(la);const l=Tc(t,n,oi,new a),d=Ic(t,n,ii),w=Tc(t,n,si),p=Tc(t,n,ci),h=Ic(t,n,li,0),m=Jt(Ic(t,n,xt)),y=Boolean(m),g=!0===m,S=Ic(t,n,bt),b=Ic(t,n,Et);Xt(S,b);const E=vc(t,n,"encryptionStrength",3),x=Ic(t,n,Si),R=Ic(t,n,"extendedTimestamp",!0),z=Ic(t,n,"ntfsTimestamp"),F=Ic(t,n,"keepOrder",!0),D=Ic(t,n,zt),A=Ic(t,n,Dt),C=Ic(t,n,"bufferedWrite"),I=kc(t,n,"createTempStream"),T=Ic(t,n,"dataDescriptorSignature",!0),k=Kt(Ic(t,n,Rt));Yt(k);const v=Ic(t,n,It,!Zc(i)||!Zc(c)),_=Ic(t,n,xi),N=y||_===dt?dt:Mn(_);if(!y&&_!==dt&&0!==_&&8!==_&&!N)throw new f(_n);let U=vc(t,n,Ct);if($t(U,9,La),t.options[vt]){if(S!==dt||b!==dt)throw new f(fa);U===dt&&_===dt&&(U=0)}y&&(U=te(n[Ct]));let O=Ic(t,n,Ft),L=Ic(t,n,Tt);C&&L===dt&&(L=!1),(L===dt||x&&!g)&&(L=!0),U!==dt&&6!=U&&(O=!1);const B=Ic(t,n,hi);if(!(x||S===dt&&b===dt||o.isInteger(E)&&E>=1&&E<=3))throw new f(da);const W=ic(n[zi]),P=ic(n.localExtraField),Z=ic(n.centralExtraField);return{comment:s,Ae:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,Ie:y,Te:g,password:S,rawPassword:b,encryptionStrength:E,zipCrypto:x,extendedTimestamp:R,ntfsTimestamp:z,keepOrder:F,useWebWorkers:D,transferStreams:A,bufferedWrite:C,createTempStream:I,dataDescriptorSignature:T,signal:k,useUnicodeFileNames:v,compressionMethod:_,format:N?N.format:dt,codecURI:N?N.codecURI:dt,un:N?N.versionNeeded:dt,level:U,useCompressionStream:O,dataDescriptor:L,zip64:B,rawExtraField:W,ln:P,ze:Z}}}function ic(t){if(!t)return gt;if(!(t instanceof c))throw new f(ha);let e=0,n=0;t.forEach((t,n)=>{if(Qt(n,M,ma),!(t instanceof w))throw new f(ya);if(Wc(t)>M)throw new f(ga);e+=4+Wc(t)});const r=new w(e),o=Ee(r);return t.forEach((t,e)=>{Oc(o,n,e),Oc(o,n+2,Wc(t)),Bc(r,t,n+4),n+=4+Wc(t)}),r}function sc(t,e,n,r,o){const{Ie:i,Te:s,zipCrypto:a,password:c,rawPassword:u,encryptionStrength:l}=r;let{dataDescriptor:d,zip64:w,level:p,compressionMethod:h}=r,m=0,y=0,g=!1;if(i&&e){if(y=o[ti],y===dt)throw new f(za);if(h===dt)throw new f(Fa)}const S=!0===w,b=Ic(t,o,mi);if(e&&s&&!b&&Wc(c,u))throw new f(pa);const E=e&&(Boolean(c&&Wc(c)||u&&Wc(u))||s&&b);e||(p=0,h=0);const x=vi(E,a,l);e&&(i?(o.uncompressedSize=y,m=n===dt?_c(y)+x:n+(s?0:x)):n===dt?(d=!0,(w||w===dt)&&(w=g=!0,m=4294967296)):(o.uncompressedSize=y=n,m=(Nc(h,p)?_c(y):y)+x));const R=!(E||e&&(0!==n||i)||Nc(h,p));R&&!a&&Ic(t,o,Tt)===dt&&(d=!1);const z=S||g||y>=O,F=S||m>=O;if(z||F){if(!1===w)throw new f(Ra);w=!0}return w=w||!1,{dn:m,Ae:{dataDescriptor:d,Ne:R,zip64:w,ye:S,fn:g,me:z,he:F,uncompressedSize:y,level:p,compressionMethod:h,encrypted:E}}}function ac(t,e,n){const r=t.slice().sort((t,e)=>n?e-t:t-e);let o=e,i=0;for(const t of r){if(o>=O)break;o+=t,i++}return i}function cc(t){const{rawFilename:e,lastModDate:n,rawLastModDate:r,lastAccessDate:o,creationDate:i,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:w,directory:p,rawExtraField:h,ln:m,encryptionStrength:y,extendedTimestamp:g,ntfsTimestamp:S,Ie:b,encrypted:E,me:x,he:R,uncompressedSize:z,fn:F,crc32:D}=t;let{version:A,compressionMethod:C}=t;const I=!p&&Nc(C,c);let T;const k=b||!I,v=u&&(t.bufferedWrite||!w||!x&&!R||k&&!F),_=v||u&&w&&(x||R);if(u&&(x||R)){const t=20,e=wc(t);if(e.en(1),e.en(t-4),T=e.Pt,v&&(e.an(z),k)){const t=vi(E,l,y);e.an(b?0:z+t)}}else T=gt;let N,U,O,L,W;if(E&&!l){const t=wc(Wc(Va)+2);t.en(J),t.nn(Va),N=t.Pt,N[8]=y}else N=gt;if(g){const t=Ac(n),e=(P=t)>=Sa&&P<=ba;if(e){const e=9+(o?4:0)+(i?4:0),n=wc(e);L=1+(o?2:0)+(i?4:0),W=t,n.en(Q),n.en(e-4),n.wn(L),n.tn(t),o&&n.tn(Cc(Ac(o))),i&&n.tn(Cc(Ac(i))),O=n.Pt}else O=gt;if(S===dt?!e||Boolean(o||i):S)try{const t=Dc(n),e=wc(36);e.en(10),e.en(32),e.pn(4),e.en(1),e.en(24),e.an(t),e.an(o?Dc(o):t),e.an(i?Dc(i):t),U=e.Pt}catch{U=gt}else U=gt}else U=O=gt;var P;let Z;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=Ga||e===dt&&n===dt)if(r!=ja||e===dt&&n===dt)Z=gt;else{const t=wc(8);t.en(et),t.en(4),t.en((e===dt?0:e)&M),t.en((n===dt?0:n)&M),Z=t.Pt}else{const t=lc(e===dt?0:e),r=lc(n===dt?0:n),o=3+t.length+r.length,i=wc(4+o);i.en(tt),i.en(o),i.wn(1),i.wn(t.length),i.nn(t),i.wn(r.length),i.nn(r),Z=i.Pt}}catch{Z=gt}C===dt&&(C=I?8:0),A===dt&&(A=0!=C||p||E?20:10);const{un:H}=t;I&&H!==dt&&(A=A>H?A:H),u&&(A=A>45?A:45),E&&!l&&(A=A>51?A:51,b&&D!==dt&&(N[4]=1),Oc(Ee(N),9,C),C=99);const V=_?Wc(T):0,G=V+Wc(N,O,U,Z,h,m);if(G+(t[vt]?67:0)>M)throw new f(ga);const j=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),q=j<lt?lt:j>ut?ut:j,K=Wc(O)?new a(1e3*Ac(n)):Wc(U)?n:q,{we:Y,pe:X,rawLastModDate:$}=Pc({version:A,bitFlag:Hc(c,d,w,E,C),compressionMethod:C,uncompressedSize:z,lastModDate:q,rawLastModDate:r,rawFilename:e,he:R,me:x,extraFieldLength:G}),nt=wc(ct+Wc(e)+G),rt=nt.Pt,ot=Ee(rt);return nt.tn(B),nt.nn(Y),nt.nn(e),_&&nt.nn(T),nt.nn(N),nt.nn(O),nt.nn(U),nt.nn(Z),nt.nn(h),nt.nn(m),w&&(R||Mc(ot,18,0),x||Mc(ot,22,0)),{ve:rt,Ge:ot,we:Y,pe:X,lastModDate:K,ke:K===q&&j.getTime()!=q.getTime(),rawLastModDate:$,encrypted:E,compressed:I,version:A,compressionMethod:C,Pe:L,Ze:W,Se:gt,We:V,Ee:O,xe:U,Re:Z,be:N,extraFieldLength:G}}function uc(t,e){const{Ue:n}=t;let{ve:r,extraFieldLength:o}=n,i=64-(e+Wc(r))%64;i<4&&(i+=64);const s=new w(i),a=Ee(s);Oc(a,0,$),Oc(a,2,i-4);const c=r;n.ve=r=new w(Wc(c)+i),Bc(r,c),Bc(r,s,Wc(c));const u=Ee(r);Oc(u,28,o+i),n.Ge=u,t.Be+=i}function lc(t){const e=new w(4);Ee(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function dc({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=gt,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=Ee(o),n&&(i=4,Mc(r,0,P))),{_e:o,He:r,Ve:i}}function fc(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,be:o,rawComment:i,xe:s,Re:a,rawExtraField:c,ze:u,Pe:l,Ze:d,ye:w,uncompressedSize:p,compressedSize:h}=r;let{me:m,he:y}=r;w||(m&&p<O&&(m=r.me=!1),y&&h<O&&(y=r.he=!1)),n=n||m||y;const g=r.offset>=O,S=r.diskNumberStart>=M;let b,E;if(g||S||m||y){const t=4+(m?8:0)+(y?8:0)+(g?8:0)+(S?4:0),e=wc(t);e.en(1),e.en(t-4),m&&e.an(p),y&&e.an(h),g&&e.an(r.offset),S&&e.tn(r.diskNumberStart),b=e.Pt}else b=gt;if(r.Se=b,r.$e=g,r.ge=S,d===dt)E=gt;else{const t=wc(9);t.en(Q),t.en(5),t.wn(l),t.tn(d),E=t.Pt}r.Ee=E;const x=Wc(b,o,s,a,E,c,u);if(x>M)throw new f(ga);e+=q+Wc(t,i)+x}return{Ke:e,Ye:n}}function wc(t){const e=new w(t),n=Ee(e);let r=0;return{Pt:e,wn:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},en:t=>{Oc(n,r,t),r+=2},tn:t=>{Mc(n,r,t),r+=4},an:t=>{Lc(n,r,i(t)),r+=8},nn:t=>{Bc(e,t,r),r+=Wc(t)},pn:t=>r+=t}}function pc(t){const{diskNumber:e=0}=t;return e}function hc(t){const{diskOffset:e=0}=t;return e}function mc(t,e){const{availableSize:n=ft}=t;return e>n}function yc(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.re:0)}function gc(t){const e=Ee(t);let n=0;for(;n+4<=Wc(t);){const r=4+Uc(e,n+2);if(1==Uc(e,n))return gc(Se(t.subarray(0,n),t.subarray(s.min(n+r,Wc(t)))));n+=r}return t}async function Sc(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await Fc(Ko(e,{offset:n,size:r}),o,dt,t=>i+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=i,t.offset+=i}}}async function bc(t,e){const n=await qo(t,e,ct);if(Wc(n)<ct)return ct;const r=Ee(n);return ct+Uc(r,26)+Uc(r,28)}function Ec(t,{offset:e,diskNumberStart:n}){return e+(t.jt?t.jt(n):0)}function xc(){const t=new w(4);return Mc(Ee(t),0,W),t}async function Rc(t,e){delete t.te,await zc(e,xc()),t.offset+=4}async function zc(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=Wc(e),await r.write(e)}finally{r.releaseLock()}}async function Fc(t,e,n,r){const o=e.writable.getWriter();try{await t.pipeTo(new D({async write(t){await o.ready,await o.write(t),r(Wc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function Dc(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<Ea?Ea:e>xa?xa:e}}function Ac(t){return s.floor(t.getTime()/1e3)}function Cc(t){return s.min(ba,s.max(Sa,t))}function Ic(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function Tc(t,e,n,r){const i=Ic(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(ca);return i}function kc(t,e,n){return qt(Ic(t,e,n))}function vc(t,e,n,r){return te(Ic(t,e,n,r))}function _c(t){return t+5*(s.floor(t/16383)+1)}function Nc(t,e){return t===dt?e===dt||e>0:0!==t}function Uc(t,e){return t.getUint16(e,!0)}function Oc(t,e,n){t.setUint16(e,n,!0)}function Mc(t,e,n){t.setUint32(e,n,!0)}function Lc(t,e,n){t.setBigUint64(e,n,!0)}function Bc(t,e,n){t.set(e,n)}function Wc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Pc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,he:c,me:u,extraFieldLength:l}){const d=wc(26),f=d.Pt,w=Ee(f);if(d.en(t),d.en(e),d.en(n),s===dt){const t=new h(1),e=Ee(t);Oc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Oc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.tn(s),d.pn(4),c||o!==dt?d.tn(c?O:o):d.pn(4),u||r!==dt?d.tn(u?O:r):d.pn(4),d.en(Wc(a)),d.en(l),{we:f,pe:w,rawLastModDate:s}}function Zc(t){return t.every(t=>t>=32&&t<=126)}function Hc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function Vc(t,e){if(!t)return!1;const{hn:n}=t;return n?n.includes(e):Qn(t,e)}const Gc=1048576,jc=".zip.js-temp",qc=1048576,Kc=1048576,Yc=".zip.js-temp",Xc="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=me(ge(t));n.assign(ie,e),n.assign(fe,e)}({baseURI:void 0===E&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===E?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",E.baseURI).href})}catch{}const Jc="Entry filename already exists",Qc="Duplicate entry filename in the imported zip file",$c='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',tu="Entry is an ancestor of target entry",eu="Root directory cannot be moved",nu="Target entry is not a directory",ru="Parent entry is not a directory",ou="Readable stream already consumed",iu="throw",su="keep-first",au="keep-last",cu=new u([iu,su,au]),uu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",lu="Invalid readerOptions (must be an object)",du="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",fu="zipjs-abort-export";class wu{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(Jc);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.yn++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,gn:r.gn||r.uncompressedSize===dt,passThrough:r.passThrough,Sn:r.Sn||new a}),!o&&t.root||(t.entries[i.id]=i),o&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let n=e.parent;if(n){const r=Pu(t);r&&(t=r.pop(),n=Zu(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(Jc);n!=e.parent&&(Fu(e),e.parent=n,n.children.push(e),Bu(e.fs,e))}e.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class pu extends wu{constructor(t,e,n,r){super(t,e,n,r);const o=this;o.Reader=n.Reader,o.Writer=n.Writer,n.getData&&(o.getData=n.getData)}clone(){return new pu(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&function(t,e){const{contentType:n}=t;return n===dt||(t.constructor==mo?e.type==n:t.constructor!=fo||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Ru(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await g.all([Go(r),Go(t,o)]);const i=Kt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof Ti||!o&&!i&&!s?a:An(a).pipeThrough(new yr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!Vo(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await An(s).pipeTo(In(t.writable),{signal:i,preventClose:a,preventAbort:a}),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,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Be)return!1;throw t}}getText(t,e){return this.getData(new So(t),e)}getBlob(t,e){return this.getData(new mo(t),e)}getData64URI(t,e){return this.getData(new fo(t),e)}getUint8Array(t){return this.getData(new Bo,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return be(await this.getUint8Array(t)).buffer}replaceBlob(t){ku(this,{data:t,Reader:ho,Writer:mo,uncompressedSize:t.size})}replaceText(t){ku(this,{data:t,Reader:yo,Writer:So,uncompressedSize:go(t)})}replaceData64URI(t){ku(this,{data:t,Reader:lo,Writer:fo,uncompressedSize:vu(t)})}replaceUint8Array(t){ku(this,{data:t,Reader:Lo,Writer:Bo,uncompressedSize:t.length})}replaceReadable(t){ku(this,{data:null,Reader:Eu(t),Writer:null,uncompressedSize:dt})}}class hu extends wu{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new hu(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return Wu(this,t,{options:e},!0)}addText(t,e,n={}){return Wu(this,t,{data:e,Reader:yo,Writer:So,options:n,uncompressedSize:go(e)})}addBlob(t,e,n={}){return Wu(this,t,{data:e,Reader:ho,Writer:mo,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return Wu(this,t,{data:e,Reader:lo,Writer:fo,options:n,uncompressedSize:vu(e)})}addUint8Array(t,e,n={}){return Wu(this,t,{data:e,Reader:Lo,Writer:Bo,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return Wu(this,t,{data:e,Reader:class extends Mo{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return Wu(this,t,{Reader:Eu(e),options:n})}addFileSystemEntry(t,e={}){return Uu(this,t,e)}addFileSystemHandle(t,e={}){return Uu(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),Wu(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 ho(t),e)}importData64URI(t,e){return this.importZip(new lo(t),e)}importUint8Array(t,e){return this.importZip(new Lo(t),e)}importHttpContent(t,e){return this.importZip(new Mo(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new mo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new fo(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Bo,t)}async exportWritable(t=new D,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r;Tu(r.passThrough);const a=Iu(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Kt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}(r.signal,c),d=n.assign({},r,a,{signal:u,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),w=gu([t],t=>bu(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await gr(o,w),await S(t,e),s&&await gr(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new D({async write(t){await e.write(t),m+=t.length,i&&await gr(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function S(t,e){if(r.concurrent){const n=(await g.allSettled(t.children.map(t=>b(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Du(t.reason));throw function(t){const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e}((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await b(n,e)}async function b(e,n){if(u.aborted){if(h||Du(u.reason))return;Yt(u)}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await S(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),o=await r.createWritable();try{await e.getData({writable:y(o)},d)}catch(t){throw h?new f(fu):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(fu));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==pt?(r=t,e=n.assign({},r.options,e)):(await Go(t),r=new bs(t,e)),Tu(e.passThrough);const o=function(t){if(t===dt)return iu;if(cu.has(t))return t;throw new f($c)}(e.duplicates),i=[],s=await r.getEntries(e);for(const t of s){let r=this;try{const s=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=s.pop();let c=!1;for(const t of s){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(o==su){c=!0;break}if(o!=au)throw new f(Qc);this.fs.remove(r),r=new hu(this.fs,t,{data:null},e),i.push(r)}}else r=new hu(this.fs,t,{data:null},e),i.push(r)}if(c)continue;if(t.directory){let e=r;if(a){if(e=r.getChildByName(a),e&&!e.directory){if(o==su)continue;if(o!=au)throw new f(Qc);this.fs.remove(e),e=dt}e||(e=new hu(this.fs,a,{data:null},r),i.push(e))}e==this||e.data||(e.data=t)}else{const s=r.getChildByName(a);if(s){if(o==su)continue;if(o!=au)throw new f(Qc);this.fs.remove(s)}i.push(Wu(r,a,{data:t,Reader:xu(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){i.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return i}async exportZip(t,e={}){const r=this,o=Boolean(t)&&typeof t.add==pt;e=n.assign({},e),o||e.bufferedWrite!==dt||(e.bufferedWrite=!0);const[i]=await g.all([zu(r,Iu(e.readerOptions)),o?dt:Go(t)]),s=o?t:new Xa(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=gu(e.children,t=>Nu(t)?0:1);let f=0,w=0;if(s&&await gr(s,r),o.bufferedWrite)await async function t(e){const n=(await g.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(Nu(e))return;const{name:s,Fe:c}=Au(e,l,o);let p=0;const h=await t.add(s,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{f+=t-p,p=t,a&&await gr(a,f,r)}}));w++,u&&await gr(u,w,d,h)}c&&await gr(c,f)}(s,r,gu([r],Su),e,i),o?s:(await s.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(t={}){const e=this;Iu((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}),o=r.filter(t=>!Nu(t)).map(n=>{const{name:r,Fe:o}=Au(n,e,t);return{name:r,size:n.directory?0:Cu(n,_u(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>Nu(t)||!t.children.length);return await async function(t,e,r,o){const i={options:t};if(qt(t[Nt]))throw new f(Aa);if(o!==dt&&!(o instanceof w))throw new f(ia);const a=Wc(o);if(a>M)throw new f(oa);const l=t[vt],d=new c,p=t[kt]===dt?0:t[kt];let h=p,m=ft;const y=[],g=new u;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);Ic(i,o,bi)&&!e.endsWith(at)&&(e+=at);const a=rc(i,e,o);({name:e}=a);const{Ae:c}=oc(i,e,o);0==c.level||c.compressionMethod!==dt||c.Ie||await pr(we())||(c.level=0);const u=!Ic(i,o,bi);if(u&&r===dt)throw new f(Aa);const{dn:w,Ae:p}=sc(i,u,r,c,o);if(u&&!c.Ie&&Nc(p.compressionMethod,p.level))throw new f(Aa);const S=n.assign({},o,a.Ae,c,p,{[vt]:l}),b=cc(S),E=dc(S),x={Ue:b,Be:Wc(b.ve,E._e)};l&&uc(x,h);const R=u?w:0;d.set(e,n.assign({},S,b,{offset:h,diskNumberStart:0,compressedSize:R}));const z=x.Be+R;y.push(z),g.add(Boolean(S.ye||S.uncompressedSize>=O||R>=O)),m=s.min(m,z),h+=z}if(d.size>1&&(l||h-m>=O&&(g.size>1||ac(y,p,!0)!=ac(y,p,!1)))&&!r)throw new f(Aa);const{Ke:S,Ye:b}=fc(d);let E=Ic(i,t,hi);if(h>=O||S>=O||d.size>=M){if(!1===E)throw new f(Ra);E=!0}else E===dt&&b&&(E=!0);return h-p+S+a+(E?98:K)}(t,o,i,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return function(t,e){const n=[],r=[t];let o=0;for(;o<r.length;)for(const t of r[o++].children)n.push(t),e&&r.push(t);return n}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await g.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class mu{constructor(){Mu(this)}get children(){return this.root.children}remove(t){Fu(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f(eu);if(!e.directory)throw new f(nu);if(e.isDescendantOf(t))throw new f(tu);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(Jc)}else Fu(t),t.parent=e,e.children.push(t),Bu(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.directory?n.getChildByName(e[t]):dt;return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Lu(this,n=>n.importBlob(t,e))}importData64URI(t,e){return Lu(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return Lu(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return Lu(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return Lu(this,n=>n.importReadable(t,e))}importZip(t,e){return Lu(this,n=>n.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 yu={FS:mu,ZipDirectoryEntry:hu,ZipFileEntry:pu};function gu(t,n){let r=0;const o=e.from(t);for(;o.length;){const t=o.pop();r+=n(t)||0;for(const e of t.children)o.push(e)}return r}function Su(t){return t.uncompressedSize}function bu(t,e){const{data:n}=t;return e&&n instanceof Ti?n.compressedSize:t.uncompressedSize}function Eu(t){let e;return function(){if(e)throw new f(ou);return e=!0,{readable:t}}}function xu(t){return class extends co{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:i}=r,s=await e.entry.getData(new mo,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.bn=new ho(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.bn.readUint8Array(t,e)}}}function Ru(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function zu(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await g.all(n.map(async t=>{const n=t.reader=Ru(t.Reader,t.data,e);o.set(t,n);try{await Go(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.gn=!1)})),o}function Fu(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Du(t){return Boolean(t)&&t.message==fu}function Au(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let s={},a={};if(t.data instanceof Ti){const e=_u(t,r),n=i.lastModDate===dt?r.lastModDate:i.lastModDate;({Fe:s,De:a}=nc(t.data,e,n)),e&&(a.passThrough=!0)}const c=n.assign({lastModDate:t.Sn},s,r,i,a,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===dt)throw new f(uu);return{name:o,Fe:c}}function Cu(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.gn?dt:bu(t,e)}function Iu(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(lu);return t&&Tu(t.passThrough),t}function Tu(t){if(Jt(t)===Pt)throw new f(du)}function ku(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,gn:r===dt})}function vu(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function _u(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function Nu(t){return t.directory&&null===t.data}function Uu(t,e,r){return async function t(e,o,i,s=""){if(o){const c=s?s+"/"+o.name:o.name;try{if((o.isFile||o.isDirectory)&&(o=await Ou(o)),"file"==o.kind){const t=await o.getFile();i.push(Wu(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:n.assign({},{lastModDate:new a(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==o.kind){const n=e.addDirectory(o.name,r);i.push(n);for await(const e of o.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function Ou(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new g((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await async function(t){const e=[];function n(t,r,o){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await Ou(t));n(t,r,o)}else r(e)},o)}return await new g((e,r)=>n(t.createReader(),e,r)),{[k.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function Mu(t){t.entries=[],t.yn=0,t.root=new hu(t)}function Lu(t,e){const{entries:r,yn:o,root:i}=t;return Mu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,yn:o,root:i}),e})}function Bu(t,e){const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}}function Wu(t,e,n,r){if(t.directory){const o=Pu(e);return o&&(e=o.pop(),t=Zu(t,o)),r?new hu(t.fs,e,n,t):new pu(t.fs,e,n,t)}throw new f(ru)}function Pu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function Zu(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(Jc);if(n&&(t==n||t.isDescendantOf(n)))throw new f(tu)}else t=new hu(r.fs,e,{data:null},r)}),t}t.BlobReader=ho,t.BlobWriter=mo,t.Data64URIReader=lo,t.Data64URIWriter=fo,t.ERR_ABORTED=jt,t.ERR_AMBIGUOUS_ARCHIVE=Vi,t.ERR_ANCESTOR_ENTRY=tu,t.ERR_BAD_FORMAT=_i,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Oi,t.ERR_DUPLICATED_NAME=ra,t.ERR_DUPLICATE_IMPORTED_ENTRY=Qc,t.ERR_ENCRYPTED=Bi,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=Gi,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Hi,t.ERR_ENTRY_EXISTS=Jc,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=Ui,t.ERR_EOCDR_NOT_FOUND=Ni,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Li,t.ERR_HTTP_RANGE=Yr,t.ERR_HTTP_RESOURCE_CHANGED=Xr,t.ERR_HTTP_STATUS=Kr,t.ERR_INVALID_AUTHENTICATION_CODE=We,t.ERR_INVALID_BASE_URI=ne,t.ERR_INVALID_CODEC_DEFINITION=Tn,t.ERR_INVALID_CODEC_MODULE=vn,t.ERR_INVALID_COMMENT=oa,t.ERR_INVALID_COMMENT_TYPE=ia,t.ERR_INVALID_COMPRESSED_DATA=Zn,t.ERR_INVALID_CRC32=Hn,t.ERR_INVALID_DATE=ca,t.ERR_INVALID_DUPLICATES=$c,t.ERR_INVALID_ENCRYPTION_STRENGTH=da,t.ERR_INVALID_ENTRY=Wa,t.ERR_INVALID_ENTRY_COMMENT=sa,t.ERR_INVALID_ENTRY_COMMENT_TYPE=aa,t.ERR_INVALID_ENTRY_NAME=ua,t.ERR_INVALID_EXTRAFIELD=ha,t.ERR_INVALID_EXTRAFIELD_DATA=ga,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=ya,t.ERR_INVALID_EXTRAFIELD_TYPE=ma,t.ERR_INVALID_FILENAME_VALIDATION=Ki,t.ERR_INVALID_FUNCTION_OPTION=Zt,t.ERR_INVALID_GID=va,t.ERR_INVALID_LEVEL=La,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Yi,t.ERR_INVALID_MAX_WORKERS=ee,t.ERR_INVALID_MSDOS_ATTRIBUTES=Oa,t.ERR_INVALID_MSDOS_DATA=Ma,t.ERR_INVALID_PASSWORD=Be,t.ERR_INVALID_PASSWORD_TYPE=Vt,t.ERR_INVALID_PASS_THROUGH=uu,t.ERR_INVALID_PASS_THROUGH_VALUE=Gt,t.ERR_INVALID_READER=Ia,t.ERR_INVALID_READER_OPTIONS=lu,t.ERR_INVALID_SIGNAL=Ht,t.ERR_INVALID_SIGNATURE_DATA=Ba,t.ERR_INVALID_STRICTNESS=qi,t.ERR_INVALID_UID=ka,t.ERR_INVALID_UNCOMPRESSED_SIZE=Pn,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=Na,t.ERR_INVALID_UNIX_ID_SIZE=Ua,t.ERR_INVALID_UNIX_MODE=_a,t.ERR_INVALID_URI=re,t.ERR_INVALID_VERSION=la,t.ERR_ITERATOR_COMPLETED_TOO_SOON=Jr,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Mi,t.ERR_OVERLAPPING_ENTRY=Zi,t.ERR_PARENT_NOT_DIRECTORY=ru,t.ERR_READABLE_CONSUMED=ou,t.ERR_RESERVED_COMPRESSION_METHOD=kn,t.ERR_ROOT_DIRECTORY_NOT_MOVABLE=eu,t.ERR_SPLIT_ZIP_FILE=Pi,t.ERR_TARGET_NOT_DIRECTORY=nu,t.ERR_UNDEFINED_COMPRESSION_METHOD=Fa,t.ERR_UNDEFINED_CRC32=Da,t.ERR_UNDEFINED_READER=Ca,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=za,t.ERR_UNDETERMINED_SIZE=Aa,t.ERR_UNSAFE_FILENAME=ji,t.ERR_UNSUPPORTED_COMPRESSION=_n,t.ERR_UNSUPPORTED_CONTEXT=Xc,t.ERR_UNSUPPORTED_CRYPTO_API=Ze,t.ERR_UNSUPPORTED_ENCRYPTION=Wi,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=pa,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=fa,t.ERR_UNSUPPORTED_FORMAT=Ra,t.ERR_UNSUPPORTED_PASS_THROUGH_VALUE=du,t.ERR_UNSUPPORTED_SPLIT_USDZ=wa,t.ERR_UNSUPPORTED_UINT64=Xi,t.ERR_WORKER_STARTUP_TIMEOUT=lr,t.ERR_WRITER_NOT_INITIALIZED=Qr,t.ERR_WRITER_SIZE_NOT_WRITABLE=$r,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Pa,t.ERR_ZIP_NOT_EMPTY=Ta,t.HttpRangeReader=class extends Mo{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Mo,t.Reader=co,t.SplitDataReader=Wo,t.SplitDataWriter=Po,t.TextReader=yo,t.TextWriter=So,t.Uint8ArrayReader=Lo,t.Uint8ArrayWriter=Bo,t.VERSION="2.12.0",t.WARNING_APPENDED_DATA=rs,t.WARNING_CLAMPED_LAST_MODIFICATION_DATE=Ha,t.WARNING_COMPRESSED_PATCHED_DATA=$i,t.WARNING_COMPRESSION_UNAVAILABLE=Za,t.WARNING_DUPLICATE_FILENAME=as,t.WARNING_MALFORMED_EXTRA_FIELD=ts,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=ds,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=fs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=ws,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=ls,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=cs,t.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=us,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=is,t.WARNING_PREPENDED_DATA=os,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=ss,t.WARNING_UNKNOWN_VERSION=Qi,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=es,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=Ji,t.WARNING_WRAPPED_ENTRIES_COUNT=ns,t.Writer=uo,t.ZipDirectoryEntry=hu,t.ZipEntry=wu,t.ZipFS=mu,t.ZipFileEntry=pu,t.ZipReader=bs,t.ZipReaderStream=Es,t.ZipWriter=Xa,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new z;this.readable=e,this.zipWriter=new Xa(n,t),this.oe=new u}transform(t){const e=this.zipWriter;let n;const{readable:r,writable:o}=new z({start(t){n=t},flush:()=>{!async function(){try{await e.close()}catch(t){await tc(e,t)}}()}});return ec(this,this.zipWriter.add(t,r),t=>n.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:n,writable:r}=new z({start(t){e=t}});return ec(this,this.zipWriter.add(t,n),t=>e.error(t)),r}async close(t,n={}){const{zipWriter:r}=this,o=(await g.allSettled(e.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await tc(r,t),t}try{return await r.close(t,n)}catch(t){throw await tc(r,t),t}}},t.configure=function(t){n.assign(fe,me(ge(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=qc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new D({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new z;r=Cn(e.readable),n=e.writable.getWriter(),s=!0;for(const e of t)await n.write(e);t.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:a,readable:new F({async pull(e){if(s){if(!o){const t=await r;o=t.stream().getReader()}const{value:t,done:n}=await o.read();n?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(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),t.length=0}}}},t.createOPFSTempStream=function(t={}){const{thresholdBytes:n=Gc,directoryName:r=jc,getDirectory:o=()=>I.storage.getDirectory()}=t;let i;function s(){return i||(i=g.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new D({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join(""),o=await n.getFileHandle(r,{create:!0}),i=(await o.createWritable()).getWriter(),u=!0;for(const e of t)await i.write(e);t.length=0}())},async close(){i&&(await i.close(),i=null)}});let d=0;return{writable:l,readable:new F({async pull(e){if(u){if(!a){const t=await o.getFile();a=t.stream().getReader()}const{value:t,done:n}=await a.read();n?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(i){try{await i.close()}catch{}i=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}o=r=null}t.length=0}}}},t.createSyncAccessHandleTempStream=function(t={}){const{thresholdBytes:n=Kc,directoryName:r=Yc,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(Xc);const i=o||(()=>I.storage.getDirectory());let a;function c(){return a||(a=g.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new D({async write(s){a?(o.write(s,{at:u}),u+=s.length):(t.push(s),i+=s.length,i>n&&await async function(){const n=await c();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join("");const i=await n.getFileHandle(r,{create:!0});o=await i.createSyncAccessHandle(),a=!0;for(const e of t)o.write(e,{at:u}),u+=e.length;t.length=0}())},close(){o&&o.flush()}});let f=0;return{writable:d,readable:new F({pull(e){if(a){const t=u-l;if(t<=0)return void e.close();const n=new w(s.min(524288,t)),r=o.read(n,{at:l});r?(l+=r,e.enqueue(n.subarray(0,r))):e.close()}else f<t.length?e.enqueue(t[f++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(o){try{o.close()}catch{}o=null}if(r){try{const t=await c();await t.removeEntry(r)}catch{}r=null}t.length=0}}}},t.fs=yu,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=Ln,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=we(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Vc(n,Vn)||Vc(t,Vn)||Vc(t,jn),decompression:Vc(r,Vn)||Vc(e,Vn)||Vc(e,jn),registered:!1},{compressionMethod:9,compression:!1,decompression:Vc(r,Gn)||Vc(e,Gn),registered:!1}];for(const t of Ln()){const e=Bn(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==pt:dt,decompression:e?typeof e.DecompressionStream==pt:dt,registered:!0})}return o},t.isZipFile=xs,t.registerCodec=function(t={}){const{compressionMethod:e,format:n,codecURI:r,CompressionStream:i,DecompressionStream:s,versionNeeded:a}=t;if(!o.isInteger(e)||e<0||e>M||typeof n!=mt||!n.length)throw new f(Tn);if(Nn.includes(e))throw new f(kn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(Tn);Un.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Wn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of de)delete fe[t];n.assign(fe,ie)},t.terminateWorkers=async function(){await g.allSettled(Nr.map(t=>(Vr(t),t.terminate()))),dr=dt,fr=!1},t.unregisterCodec=function(t){const e=Un.get(t);if(e){let n;Un.delete(t),Un.forEach(t=>n=n||t.format==e.format),n||On.delete(e.format)}}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:S,TextEncoder:g,TextDecoder:b,document:E,crypto:x,btoa:z,TransformStream:R,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:C,navigator:I,Worker:T,Symbol:k,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:self;var U=void 0!==E?E.currentScript:null;const O=4294967295,M=65535,L=255,B=67324752,W=134695760,P=W,Z=84233040,H=33639248,V=101010256,G=101075792,j=117853008,q=46,K=22,Y=20,X=56,J=39169,Q=21589,$=6534,tt=30837,et=30805,nt=2048,rt=61440,ot=16384,it=2048,st=1024,at="/",ct=30,ut=new a(2107,11,31,23,59,58),lt=new a(1980,0,1),dt=void 0,ft=1/0,wt="undefined",pt="function",ht="object",mt="string",yt="boolean",St=new w,gt=k.asyncDispose||k(),bt="password",Et="rawPassword",xt="passThrough",zt="signal",Rt="useWebWorkers",Ft="useCompressionStream",Dt="transferStreams",At="preventClose",Ct="level",It="useUnicodeFileNames",Tt="dataDescriptor",kt="offset",vt="usdz",_t="maxAppendedDataSize",Nt="signCentralDirectory",Ut="entry",Ot="filename",Mt="comment",Lt="strict",Bt="balanced",Wt="tolerant",Pt="compressed",Zt="Invalid option (must be a function)",Ht="Invalid signal (must be an AbortSignal instance)",Vt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",Gt="Invalid passThrough option (must be a boolean or 'compressed')",jt="The operation was aborted";function qt(t){if(t&&typeof t!=pt)throw new f(Zt);return t}function Kt(t){if(t&&(typeof t.addEventListener!=pt||typeof t.aborted!=yt))throw new f(Ht);return t||dt}function Yt(t){if(t&&t.aborted)throw t.reason===dt?new DOMException(jt,"AbortError"):t.reason}function Xt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Vt)}function Jt(t){if(t!==dt&&typeof t!=yt&&t!==Pt)throw new f(Gt);return t}function Qt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function $t(t,e,n){t!==dt&&Qt(t,e,n)}function te(t){return typeof t==mt&&t.trim()?o(t):t}const ee="Invalid maxWorkers (must be an integer greater than 0)",ne="Invalid baseURI (must be a string)",re="Invalid URI (must be a string or a function returning a string)";let oe=2;try{typeof I!=wt&&I.hardwareConcurrency&&(oe=I.hardwareConcurrency)}catch{}const ie={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:oe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof C!=wt&&C},se="maxWorkers",ae="baseURI",ce=["wasmURI","workerURI"],ue=["chunkSize",se,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],le=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],de=[ae,...ce,"useCompressionStream","useWebWorkers","transferStreams",...ue,...le],fe={...ie};function we(){return fe}function pe(t){return he(t.chunkSize)}function he(t){return t=te(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function me(t){const e={};for(const n of de){const r=t[n];r!==dt&&(e[n]=ye(n,r))}return e}function ye(t,e){if(ue.includes(t)){if(e=te(e),t==se&&(!o.isInteger(e)||e<1))throw new f(ee)}else if(le.includes(t))qt(e);else if(t==ae){if(e&&typeof e!=mt)throw new f(ne)}else if(ce.includes(t)&&e&&typeof e!=mt&&typeof e!=pt)throw new f(re);return e}function Se(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===dt&&r===dt)return t;const o=n.assign({},t);return o.CompressionStreamFallback===dt&&(o.CompressionStreamFallback=e),o.DecompressionStreamFallback===dt&&(o.DecompressionStreamFallback=r),o}function ge(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function be(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function Ee(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function xe(t){return Boolean(t)&&"object"==typeof t}const ze=[[],[],[],[],[],[],[],[]];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;ze[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=ze[e-1][t];ze[e][t]=n>>>8^ze[0][255&n]}const[Re,Fe,De,Ae,Ce,Ie,Te,ke]=ze;class ve{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const o=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^o.getInt32(r,!0),n=o.getInt32(r+4,!0);e=ke[255&t]^Te[t>>>8&255]^Ie[t>>>16&255]^Ce[t>>>24&255]^Ae[255&n]^De[n>>>8&255]^Fe[n>>>16&255]^Re[n>>>24&255]}}for(;r<n;r++)e=e>>>8^Re[255&(e^t[r])];this.o=e}get(){return~this.o}}class _e extends R{constructor(){let t;const e=new ve;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function Ne(t){if(typeof g==wt){t=unescape(encodeURIComponent(t));const e=new w(t.length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new g).encode(t)}const Ue={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=Ue.l(n);return 32===r?t.concat(e):Ue.h(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+Ue.l(n)},m(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=Ue.S(e,t[n-1]&2147483648>>e-1,1)),t},S:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,l:t=>s.round(t/1099511627776)||32,h(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let o=0;o<t.length;o++)r.push(n|t[o]>>>e),n=t[o]<<32-e;const o=t.length?t[t.length-1]:0,i=Ue.l(o);return r.push(Ue.S(e+i&31,e+i>32?n:r.pop(),1)),r}},Oe={bytes:{R(t){const e=Ue.bitLength(t)/8,n=new w(e);let r;for(let o=0;o<e;o++)3&o||(r=t[o/4]),n[o]=r>>>24,r<<=8;return n},F(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(Ue.S(8*(3&n),r)),e}}},Me=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.A=[1518500249,1859775393,2400959708,3395469782],t?(e.C=t.C.slice(0),e.I=t.I.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.C=t.D.slice(0),t.I=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Oe.v.F(t));const n=e.I=Ue.concat(e.I,t),r=e.T,o=e.T=r+Ue.bitLength(t);if(o>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let s=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);t<=o;t+=e.blockSize)e._(i.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),e}N(){const t=this;let e=t.I;const n=t.C;e=Ue.concat(e,[Ue.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t._(e.splice(0,16));return t.reset(),n}U(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}O(t,e){return e<<t|e>>>32-t}_(t){const n=this,r=n.C,o=e(80);for(let e=0;e<16;e++)o[e]=t[e];let i=r[0],a=r[1],c=r[2],u=r[3],l=r[4];for(let t=0;t<=79;t++){t>=16&&(o[t]=n.O(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.O(5,i)+n.U(t,a,c,u)+l+o[t]+n.A[s.floor(t/20)]|0;l=u,u=c,c=n.O(30,a),a=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+c|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0}},Le={importKey:t=>new Le.M(Oe.bytes.F(t)),L(t,e,n,r){if(n=n||1e4,r<0||n<0)throw new f("invalid params to pbkdf2");const o=1+(r>>5)<<2;let i,s,a,c,u;const l=new ArrayBuffer(o),d=new m(l);let w=0;const p=Ue;for(e=Oe.bytes.F(e),u=1;w<(o||1);u++){for(i=s=t.encrypt(p.concat(e,[u])),a=1;a<n;a++)for(s=t.encrypt(s),c=0;c<s.length;c++)i[c]^=s[c];for(a=0;w<(o||1)&&a<i.length;a++)d.setInt32(w,i[a]),w+=4}return l.slice(0,r/8)},M:class{constructor(t){const e=this,n=e.B=Me,r=[[],[]];e.W=[new n,new n];const o=e.W[0].blockSize/32;t.length>o&&(t=(new n).update(t).N());for(let e=0;e<o;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.W[0].update(r[0]),e.W[1].update(r[1]),e.P=new n(e.W[0])}reset(){const t=this;t.P=new t.B(t.W[0]),t.Z=!1}update(t){this.Z=!0,this.P.update(t)}digest(){const t=this,e=t.P.N(),n=new t.B(t.W[1]).update(e).N();return t.reset(),n}encrypt(t){if(this.Z)throw new f("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Be=typeof x!=wt&&typeof x.getRandomValues==pt,We="Invalid password",Pe="Invalid authentication code",Ze="zipjs-abort-check-password",He="Crypto API not supported";function Ve(t){if(Be)return x.getRandomValues(t);throw new f(He)}const Ge=16,je={name:"PBKDF2"},qe=n.assign({hash:{name:"HMAC"}},je),Ke=n.assign({iterations:1e3,hash:{name:"SHA-1"}},je),Ye=["deriveBits"],Xe=[8,12,16],Je=[16,24,32],Qe=10,$e=[0,0,0,0],tn=typeof x!=wt,en=tn&&x.subtle,nn=tn&&typeof en!=wt,rn=Oe.bytes,on=class{constructor(t){const e=this;e.H=[[[],[],[],[],[]],[[],[],[],[],[]]],e.H[0][0][0]||e.V();const n=e.H[0][4],r=e.H[1],o=t.length;let i,s,a,c=1;if(4!==o&&6!==o&&8!==o)throw new f("invalid aes key size");for(e.A=[s=t.slice(0),a=[]],i=o;i<4*o+28;i++){let t=s[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-o]^t}for(let t=0;i;t++,i--){const e=s[3&t?i:i-4];a[t]=i<=4||t<4?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.G(t,0)}decrypt(t){return this.G(t,1)}V(){const t=this.H[0],e=this.H[1],n=t[4],r=e[4],o=[],i=[];let s,a,c,u;for(let t=0;t<256;t++)i[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=s=0;!n[l];l^=a||1,s=i[s]||1){let i=s^s<<1^s<<2^s<<3^s<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,u=o[c=o[a=o[l]]];let d=16843009*u^65537*c^257*a^16843008*l,f=257*o[i]^16843008*i;for(let n=0;n<4;n++)t[n][l]=f=f<<24^f>>>8,e[n][i]=d=d<<24^d>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}G(t,e){if(4!==t.length)throw new f("invalid aes block size");const n=this.A[e],r=n.length/4-2,o=[0,0,0,0],i=this.H[e],s=i[0],a=i[1],c=i[2],u=i[3],l=i[4];let d,w,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],S=t[e?1:3]^n[3],g=4;for(let t=0;t<r;t++)d=s[h>>>24]^a[m>>16&255]^c[y>>8&255]^u[255&S]^n[g],w=s[m>>>24]^a[y>>16&255]^c[S>>8&255]^u[255&h]^n[g+1],p=s[y>>>24]^a[S>>16&255]^c[h>>8&255]^u[255&m]^n[g+2],S=s[S>>>24]^a[h>>16&255]^c[m>>8&255]^u[255&y]^n[g+3],g+=4,h=d,m=w,y=p;for(let t=0;t<4;t++)o[e?3&-t:t]=l[h>>>24]<<24^l[m>>16&255]<<16^l[y>>8&255]<<8^l[255&S]^n[g++],d=h,h=m,m=y,y=S,S=d;return o}},sn=class{constructor(t,e){this.j=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.j,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,n){let r;if(!(r=e.length))return[];const o=Ue.bitLength(e);for(let o=0;o<r;o+=4){this.$(n);const r=t.encrypt(n);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return Ue.m(e,o)}},an=Le.M;let cn=tn&&nn&&typeof en.importKey==pt,un=tn&&nn&&typeof en.deriveBits==pt;class ln extends R{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){fn(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,et:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await pn(t,e,n,mn(r,0,Xe[e])),i=mn(r,Xe[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new f(We)}(n,i,o,mn(t,0,Xe[i]+2)),t=mn(t,Xe[i]+2),r?e.error(new f(Ze)):s()):await a;const c=new w(t.length-Qe-(t.length-Qe)%Ge);e.enqueue(wn(n,t,c,0,Qe,!0))},async flush(t){const{nt:e,ot:n,it:r,ready:i}=this;if(n&&e){await i;const s=mn(r,0,r.length-Qe),a=mn(r,r.length-Qe);let c=St;if(s.length){const t=Sn(rn,s);n.update(t);const r=e.update(t);c=yn(rn,r)}const u=mn(yn(rn,n.digest()),0,Qe);let l=r.length<Qe?1:0;for(let t=0;t<Qe;t++)l|=u[t]^a[t];if(l&&o)throw new f(Pe);t.enqueue(c)}}})}}class dn extends R{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){fn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,et:i,ready:s}=n;let a=St;r?(a=await async function(t,e,n){const r=Ve(new w(Xe[e]));return ge(r,await pn(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%Ge);c.set(a,0),e.enqueue(wn(n,t,c,a.length,0))},async flush(t){const{nt:e,ot:n,it:r,ready:o}=this;if(n&&e){await o;let i=St;if(r.length){const t=e.update(Sn(rn,r));n.update(t),i=yn(rn,t)}const s=yn(rn,n.digest()).slice(0,Qe);t.enqueue(ge(i,s))}}})}}function fn(t,e,r,o){n.assign(t,{ready:new S(e=>t.et=e),password:hn(e,r),strength:o-1,it:St})}function wn(t,e,n,r,o,i){const{nt:s,ot:a,it:c}=t;c.length&&(e=ge(c,e));const u=e.length-o;let l;for(n=function(t,e){if(e&&e>t.length){const n=t;(t=new w(e)).set(n,0)}return t}(n,r+(u-u%Ge)),l=0;l<=u-Ge;l+=Ge){const t=Sn(rn,mn(e,l,l+Ge));i&&a.update(t);const o=s.update(t);i||a.update(o),n.set(yn(rn,o),l+r)}return t.it=mn(e,l),n}async function pn(t,r,o,i){t.password=null;const s=await async function(t,e,n,r,o){if(!cn)return Le.importKey(e);try{return await en.importKey("raw",e,n,!1,o)}catch{return cn=!1,Le.importKey(e)}}(0,o,qe,0,Ye),a=await async function(t,e,n){if(!un)return Le.L(e,t.salt,Ke.iterations,n);try{return await en.deriveBits(t,e,n)}catch{return un=!1,Le.L(e,t.salt,Ke.iterations,n)}}(n.assign({salt:i},Ke),s,8*(2*Je[r]+2)),c=new w(a),u=Sn(rn,mn(c,0,Je[r])),l=Sn(rn,mn(c,Je[r],2*Je[r])),d=mn(c,2*Je[r]);return n.assign(t,{keys:{key:u,st:l,passwordVerification:d},nt:new sn(new on(u),e.from($e)),ot:new an(l)}),d}function hn(t,e){return e===dt?Ne(t):e}function mn(t,e,n){return t.subarray(e,n)}function yn(t,e){return t.R(e)}function Sn(t,e){return t.F(e)}class gn extends R{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){En(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=xn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(We);t=t.subarray(12)}r?e.error(new f(Ze)):e.enqueue(xn(n,t))}})}}class bn extends R{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){En(this,t,e,n)},transform(t,e){const n=this;let r,o;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=Ve(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(zn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(zn(n,t),o),e.enqueue(r)}})}}function En(t,e,r,o){n.assign(t,{password:e,rawPassword:r,passwordVerification:o}),function(t,e,r){const o=[305419896,591751049,878082192];if(n.assign(t,{keys:o,ct:new ve(o[0]),ut:new ve(o[2])}),r)for(let e=0;e<r.length;e++)Rn(t,r[e]);else for(let n=0;n<e.length;n++)Rn(t,e.charCodeAt(n))}(t,e,r)}function xn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=Fn(t)^e[r],Rn(t,n[r]);return n}function zn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=Fn(t)^e[r],Rn(t,e[r]);return n}function Rn(t,e){let[,n]=t.keys;t.ct.append([e]);const r=~t.ct.get();n=An(s.imul(An(n+Dn(r)),134775813)+1),t.ut.append([n>>>24]);const o=~t.ut.get();t.keys=[r,n,o]}function Fn(t){const e=2|t.keys[2];return Dn(s.imul(e,1^e)>>>8)}function Dn(t){return 255&t}function An(t){return 4294967295&t}function Cn(t){if(t instanceof F)return t;const e=t.getReader();return new F({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function In(t,e){t=Cn(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof F)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new D({write(t){r.push(t)}})).then(()=>new y(r,n))}function Tn(t){if(t instanceof D)return t;const e=t.getWriter();return new D({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const kn="Invalid codec definition",vn="Reserved compression method",_n="Invalid codec module",Nn="Compression method not supported",Un=[0,8,9,99],On=new c,Mn=new c;function Ln(t){return On.get(t)}function Bn(){return e.from(On.values(),t=>n.assign({},t,Mn.get(t.format)))}function Wn(t){return Mn.get(t)}function Pn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(_n);Mn.set(t,{CompressionStream:n,DecompressionStream:r})}const Zn="Invalid uncompressed size",Hn="Invalid compressed data",Vn="Invalid CRC32",Gn="deflate-raw",jn="deflate64-raw",qn="gzip",Kn=[31,139,8];class Yn extends R{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:o,encrypted:i,useCompressionStream:s,zipCrypto:a,computeCrc32:c,level:u,deflate64:l,format:d,compressionMethod:f,inputSize:w}=t,p=this;let h,y,S,g=super.readable;const b=d&&Wn(d),E=c&&o&&!l&&!b&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||E||(h=new _e,g=or(g,h)),o)if(b)g=ir(g,nr(b.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(E)S=new Xn,g=ir(g,new r(qn)),g=or(g,S);else try{g=rr(g,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(qn)}catch{throw t}g=ir(g,e),g=or(g,new Xn)}i&&(a?g=or(g,new bn(t)):(y=new dn(t),g=or(g,y))),er(p,g,()=>{i&&!a||!c||(p.crc32=E?S.crc32:new m(h.value.buffer).getUint32(0))})}}class Xn extends R{constructor(){let t,e=10,n=new w(0);super({transform(t,r){if(e){const n=s.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const o=n.length+t.length;if(o<=8)return void(n=ge(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(ge(n.subarray(0,a),t.subarray(0,i-a))),n=ge(n.subarray(a),t.subarray(i-a))},flush(){const e=Ee(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Jn extends R{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:o,encrypted:i,checkCrc32:s,crc32:a,compressed:c,useCompressionStream:u,deflate64:l,format:d,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let g,b,E=super.readable;if(i&&(o?E=or(E,new gn(t)):(b=new ln(t),E=or(E,b))),c){const t=d&&Wn(d);if(t)E=ir(E,nr(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{E=rr(E,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(qn)}catch{throw t}E=function(t,e,n){const r=new ve;let o,i,s,a=0,c=!1;const u=new S((t,e)=>{i=t,s=e});u.catch(()=>{}),n||i();const l=new R({start(t){const e=new w(10);e.set(Kn),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await u}finally{h()}const e=new w(8),o=Ee(e);o.setUint32(0,r.get(),!0),o.setUint32(4,n,!0),t.enqueue(e)},cancel(t){s(t)}}),d=new R({transform(t,e){r.append(t),a+=t.length,a>=n?i():c&&p(),e.enqueue(t)},cancel(t){s(t)}});return t=or(t,l),or(t=ir(t,e),d);function p(){h(),o=v(()=>s(new f(Zn)),5e3)}function h(){_(o)}}(E,e,y)}E=function(t){const e=t.getReader();return new F({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(Hn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(E)}s&&(g=new _e,E=or(E,g)),er(this,E,()=>{if(s){const t=new m(g.value.buffer);if(a!=t.getUint32(0,!1))throw new f(Vn)}})}}const Qn=new c;function $n(t,e){if(!t)return!1;let n=Qn.get(t);n||(n=new c,Qn.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function tr(t){return $n(t,Gn)}function er(t,e,r){e=or(e,new R({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function nr(t,e,n){if(!t)throw new f(Nn);return new t(e,n)}function rr(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?jn:Gn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return ir(t,a)}function or(t,e){return Cn(t).pipeThrough(e)}function ir(t,e){const n=e.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(n,t),await async function(t,e){try{await t.cancel(e)}catch{}}(r,t)}}(),e.readable}const sr="data",ar="deflate",cr="inflate";class ur extends R{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(ar)?i=Yn:o.startsWith(cr)&&(i=Jn),r.outputSize=0;let s=0;const a=new i(t,e),c=super.readable,u=new R({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:s})}}),l=new R({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new f(Zn)},flush(){const{crc32:t}=a;n.assign(r,{crc32:t,inputSize:s})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class lr extends R{constructor(t){const e=[];let r=0,i=0;function s(){const n=new w(t);let o=0;for(;o<t;){const r=e[0],i=t-o;r.length<=i?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,i),o),e[0]=r.subarray(i),o+=i)}return r-=t,n}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(n,o){for(e.push(n),r+=n.length;r>t;)i+=t,o.enqueue(s())},flush(t){r&&(i+=r,t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,r)))}}),n.defineProperty(this,"outputSize",{get:()=>i})}}const dr="Worker startup timeout";let fr,wr,pr;async function hr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.lt)return!0;if(tr(e)||$n(e,qn))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}function mr(t){t.createWorker?wr=!0:fr=!1}class yr{constructor(t,{readable:e,writable:r},o,i){const{options:s,config:a,ft:c,useWebWorkers:u,transferStreams:l,workerURI:d}=o;let{createWorker:f}=o;const{signal:w}=c;return wr&&(f=dt),n.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new lr(pe(a))).pipeThrough(new Sr(c),{signal:w}),writable:r,options:n.assign({},s),yt:o,workerURI:d,createWorker:f,transferStreams:l,terminate:()=>new S(e=>{const{St:n,wt:r}=t;n?(r?t.gt=e:(n.terminate(),e()),t.bt=null):e()}),Et(){if(t.wt){const{gt:e}=t;e&&(t.gt=null,t.xt=!0,t.St.terminate(),e()),t.wt=!1,i(t)}}}),fr===dt&&(fr=typeof T!=wt),(u&&pr&&(fr&&d||f)?pr:br)(t,a)}}class Sr extends R{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await gr(t,n)},async transform(t,r){o+=t.length,e&&await gr(e,o,n),r.enqueue(t)},async flush(){r&&await gr(r,o)}})}}async function gr(t,...e){try{await t(...e)}catch{}}function br(t,e){return{run:()=>Er(t,e)}}async function Er({options:t,readable:e,writable:n,Et:r,yt:o},i){let s,a;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(ar),n=e?i.CompressionStreamFallback:i.DecompressionStreamFallback,r=e?i.CompressionStream:i.DecompressionStream;if(t.useCompressionStream){if(n&&n.lt&&!tr(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.lt||(t.useCompressionStream=!0)}}s=new ur(t,i),a=new lr(pe(i)),await e.pipeThrough(s).pipeThrough(a).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:o,outputSize:c}=s;return{crc32:r,inputSize:o,outputSize:c}}catch(t){if(s){const e=a?a.outputSize:0;if(o.outputSize=e,xe(t))try{t.outputSize=e}catch{}}throw t}finally{r()}}const xr={type:"module"},zr="error";let Rr,Fr,Dr,Ar=!0;try{Ar=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var Cr;function Ir(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Tr(t){const{St:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function kr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(Fr===dt||Rr!==t){const n=typeof t==pt;c=n?t(i):t;const s=c.startsWith("data:"),l=c.startsWith("blob:");if(s||l){o===dt&&(o=!1),o&&(u=xr);try{a=new T(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return kr(t,e,r,o,!1);if(o)throw i;return kr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=xr);try{c=new d(c,e)}catch{}try{a=new T(c,u)}catch(n){if(o)return kr(t,e,r,!1,i);throw n}}Rr=t,Fr=c,Dr=u}else a=new T(Fr,Dr);return a.addEventListener("message",t=>{r.zt=!0,vr(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a,errorValue:c}=t,{reader:u,writer:l,Rt:d,Ft:p,Et:h,ht:m}=e,y=()=>e.ht!=m;try{if(a)a.outputSize!==dt&&(e.outputSize=a.outputSize),S(function(t,e){const{message:r,stack:o,code:i,name:s,outputSize:a,cause:c,codecImportFailed:u}=t;let l;if(e?l=e.value:(l=n.assign(new f(r),{stack:o,code:i,name:s}),c&&(l.cause=n.assign(new f(c.message),{name:c.name}))),xe(l))try{a!==dt&&(l.outputSize=a),u&&(l.codecImportFailed=!0),e&&(l.name!==s&&(l.name=s),l.code!==i&&(l.code=i))}catch{}return l}(a,c));else{if("pull"==r){const{value:t,done:n}=await u.read();y()||Nr({type:sr,value:t,done:n,messageId:i},e)}if(r==sr){const t=new w(o);await l.ready,await l.write(t),e.outputSize+=t.length,y()||Nr({type:"ack",messageId:i},e)}"close"==r&&function(t){y()||(d(t),g(),h())}(s)}}catch(a){y()||(Tr(e),S(a))}function S(t){y()||(p(t),g(),xe(t)&&t.codecImportFailed||h())}function g(){l&&l.releaseLock()}}(t,r)}),a.addEventListener(zr,t=>_r(t,r)),a.addEventListener("messageerror",t=>_r(t,r)),a}function vr(t){const{Dt:e}=t;e&&(_(e),t.Dt=null)}function _r(t,e){t.preventDefault&&t.preventDefault(),vr(e);const{zt:r,Ft:o,writer:i,Et:s}=e;Tr(e),r||(e.St=null);let a=t.error||new f(t.message||zr);r||(a=n.assign(new f(a.message||zr),{At:!0}),e.Ct=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function Nr(t,{St:e,writer:n,transferStreams:r,zt:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=be(n),a.push(t.value.buffer)),r&&Ar&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{Ar=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}Cr=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t.bt){let c;typeof a==pt&&(a=a());try{c=kr(t.workerURI,r,t)}catch{return mr(t),br(t,e)}n.assign(t,{St:c,zt:!1,xt:!1,Ct:null,bt:{run:async()=>{try{return await async function(t,e){if(!t.St){const{Ct:e}=t;t.Ct=null;const n=e||new f(dr);throw n.At=!0,n}let r,i;const s=new S((e,n)=>{r=e,i=e=>{const{outputSize:r,yt:o}=t;if(o.outputSize=r,xe(e)&&e.outputSize===dt)try{e.outputSize=r}catch{}n(e)}});n.assign(t,{reader:null,writer:null,outputSize:0,Rt:r,Ft:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,It:d}=function(t){const e=new AbortController,{writable:n,readable:r}=new R,o=r.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:n,closed:o,It:()=>e.abort()}}(t.writable);let w;try{w=Nr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.Et(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.zt&&o.isFinite(p)&&p>=0&&(t.Dt=v(()=>function(t){if(t.Dt=null,t.zt)return;const{Ft:e,writer:n}=t;if(Tr(t),t.St=null,e){const t=new f(dr);t.At=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(t){await h(),d();try{await l}catch{}throw t}async function h(){if(!w&&!u.locked)try{await u.getWriter().close()}catch{}}}(t,{chunkSize:i,wasmURI:a,baseURI:r,workerStartupTimeout:s})}catch(n){if(n&&n.At)return mr(t),Ir(t),Er(t,e);if(n&&n.codecImportFailed){if(t.reader)return Ir(t),Er(t,e);t.Et()}throw n}}}})}return t.bt},pr=Cr;let Ur=[];const Or=[];let Mr,Lr,Br=0;async function Wr(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:s,useCompressionStream:a,compressed:c,checkCrc32:u,computeCrc32:l,encrypted:f,format:w,codecURI:p}=n,{workerURI:h,createWorker:m,maxWorkers:y}=r;w&&(p&&(n.codecURI=function(t,e){try{return new d(t,e).toString()}catch{return t}}(p,r.baseURI)),await async function(t,e){!Mn.has(t)&&e&&Pn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const g=!(c||u||l||f),b=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!g&&b&&(s||s===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:dt,e.createWorker=e.useWebWorkers&&m?m:dt,n.useCompressionStream=a||a===dt&&r.useCompressionStream,(await async function(){const n=Ur.find(t=>!t.wt);if(n)return Gr(n),new yr(n,t,e,E);if(Ur.length<y){const n={Tt:Br};return Br++,Ur.push(n),new yr(n,t,e,E)}return new S(n=>{Or.push({resolve:n,stream:t,yt:e}),Lr=r.workerStarvationTimeout,Pr()})}()).run();function E(t){if(Zr(),Or.length){const[{resolve:e,stream:n,yt:r}]=Or.splice(0,1);e(new yr(t,n,r,E)),Pr()}else t.St?(Gr(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.xt?t.xt=!1:t.kt=v(async()=>{Ur=Ur.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):Ur=Ur.filter(e=>e!=t)}}function Pr(){!Mr&&Or.length&&o.isFinite(Lr)&&Lr>=0&&(Mr=v(Hr,Lr))}function Zr(){Mr&&(_(Mr),Mr=null)}function Hr(){if(Mr=null,Or.length){const[{resolve:t,stream:e,yt:r}]=Or.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new yr({},e,o,Vr)),Pr()}}function Vr(){Zr(),Pr()}function Gr(t){const{kt:e}=t;e&&(_(e),t.kt=null)}const jr="\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 qr(t,e){return Kr(t,e,!0)}function Kr(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=jr[t[n]];return e}(t):new b(e,{ignoreBOM:n}).decode(t)}const Yr="HTTP error ",Xr="HTTP Range not supported",Jr="HTTP resource changed",Qr="Writer iterator completed too soon",$r="Writer not initialized",to="Invalid writer (size must be writable)",eo="Content-Range",no="Range",ro="GET",oo="bytes",io=16777216,so="writable",ao=k();class co{constructor(){this.size=0}init(){this.initialized=!0}}class uo extends co{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=pe(we())}={}){const r=this;let o=0;return n=he(n),new F({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await Ko(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class lo extends co{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f($r);return t.writeUint8Array(be(e))}});n.defineProperty(t,so,{get:()=>e})}writeUint8Array(){}}class fo extends uo{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{vt:t,_t:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{_t:n,vt:r}=this,o=new w(e),i=4*s.floor(t/3),a=atob(r.substring(i+n,4*s.ceil((t+e)/3)+n)),c=t-3*s.floor(i/4);let u=0;for(let t=c;t<c+e&&t<a.length;t++)o[t-c]=a.charCodeAt(t),u++;return u<o.length?o.subarray(0,u):o}}class wo extends lo{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Nt:""})}writeUint8Array(t){const e=this;let n,o=e.Nt;const i=e.Nt.length;for(e.Nt="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.Nt+=r.fromCharCode(t[n]);o.length>2?e.data+=z(o):e.Nt=o+e.Nt}getData(){return this.data+z(this.Nt)}}let po,ho;class mo extends uo{constructor(t){super(),n.assign(this,{Ut:t,size:t.size}),ho||(ho=(async()=>{try{const t=new y([new w(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();po=1==e}catch{po=!1}})())}createReadable(t){const{Ut:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};if(typeof e.stream==pt){if(!r&&o>=n)return Cn(e.stream());if(po)return Cn(e.slice(r,r+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,o=!t&&r>=n.size?n.Ut:n.Ut.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class yo extends co{constructor(t){super();const e=this,r=new R;n.defineProperty(e,so,{get:()=>r.writable}),e.contentType=t,e.Ot=In(r.readable,t),e.Ot.catch(()=>{})}getData(){return this.Ot}}class So extends mo{constructor(t){super(new y([t],{type:"text/plain"}))}}function go(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class bo extends yo{constructor(t){super(),n.assign(this,{encoding:t,Mt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,Mt:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return Kr(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class Eo extends uo{constructor(t,e){super(),zo(this,t,e)}async init(){await Ro(this,Oo,vo),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&n<i)return function(t,e,n){let r,i=e,a=0,c=n;return new F({start:()=>u(),async pull(t){r||await u();const{value:e,done:n}=await r.read();if(n)throw new f(Xr);const o=e.length>a?e.subarray(0,a):e;a-=o.length,c-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=r;r=dt,await t.cancel()}(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function u(){const e=s.min(t.maximumRangeSize,c),n=await Oo(ro,t,To(t,i,e));if(206!=n.status)throw new f(Xr);const u=n.headers.get(eo);if(u){const t=o(u.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=i)throw new f(Xr)}Io(t,n),Co(t,n),i+=e,a=e,r=n.body.getReader()}}(e,n,s.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return Fo(this,t,e,Oo,vo)}}class xo extends uo{constructor(t,e){super(),zo(this,t,e)}async init(){await Ro(this,Mo,_o),super.init()}readUint8Array(t,e){return Fo(this,t,e,Mo,_o)}}function zo(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=io,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c,maximumRangeSize:u,fetch:l})}async function Ro(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=we(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(ro,t,To(t,a?-22:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==oo))throw new f(Xr);{if(a){const e=new w(await r.arrayBuffer());206==r.status&&e.length==K&&(t.Lt=e)}Co(t,r);const o=Do(r);o===dt?await Uo(t,e,n):t.size=o}}else await Uo(t,e,n)}async function Fo(t,e,n,r,i){const{useRangeHeader:s,forceRangeRequests:a,Lt:c,size:u,options:l}=t;if(s||a){if(c&&e==u-K&&n==K)return c;if(e>=u||0===n)return St;{e+n>u&&(n=u-e);const i=await r(ro,t,To(t,e,n));if(206!=i.status)throw new f(Xr);const s=i.headers.get(eo);if(s){const t=o(s.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=e)throw new f(Xr)}Io(t,i),Co(t,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new f(Xr);return a}}{const{data:r}=t;return r||await i(t,l),t.data.subarray(e,e+n)}}function Do(t){const e=t.headers.get(eo);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function Ao({headers:t}){return{Bt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function Co(t,e){const{checkResourceChanges:n,Wt:r}=t;n&&!r&&206==e.status&&(t.Wt=Ao(e))}function Io(t,e){const{checkResourceChanges:r,Wt:o,size:i}=t;if(r){const t=Do(e);if(t!==dt&&i!==dt&&t!=i)throw new f(Jr);if(o){const t=Ao(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(Jr)}}}function To(t,e=0,r=1){return n.assign({},ko(t),{[no]:oo+"="+(e<0?e:e+"-"+(e+r-1))})}function ko({options:t}){const{headers:e}=t;if(e)return k.iterator in e?n.fromEntries(e):e}async function vo(t){await No(t,Oo)}async function _o(t){await No(t,Mo)}async function No(t,e){const n=await e(ro,t,ko(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function Uo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,ko(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function Oo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status>=200&&s.status<=299)return s;throw 416==s.status?new f(Xr):new f(Yr+(s.statusText||s.status))}function Mo(t,{url:e},r){return new S((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status>=200&&s.status<=299){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f(Xr):new f(Yr+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>i(t.detail?t.detail.error:new f("Network error")),!1),s.open(t,e),r)for(const t of n.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Lo extends uo{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new xo(t,e):new Eo(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 Bo extends uo{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{Pt:t,size:t.length})}readUint8Array(t,e){return this.Pt.slice(t,t+e)}}class Wo extends lo{constructor(t){super(),this.Zt=t||262144}init(t=0){n.assign(this,{offset:0,Pt:new w(t>0?t:this.Zt)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.Pt.length){let t=e.Pt.length?2*e.Pt.length:e.Zt;for(;t<n;)t*=2;const r=e.Pt;e.Pt=new w(t),e.Pt.set(r)}e.Pt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Pt.length?this.Pt:this.Pt.slice(0,this.offset)}}class Po extends uo{constructor(t){super(),this.Ht=t}async init(){const t=this;t.Vt=0;const e=t.Ht=await S.all(t.Ht.map(qo));t.Gt=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}jt(t){const{Gt:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{Ht:r}=this;let o,i=0,a=t;for(;r[i]&&a>=r[i].size;)a-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(a+e<=r)o=await Ko(c,a,e);else{const i=r-a;o=ge(await Ko(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=St;return n.Vt=s.max(i,n.Vt),o}}class Zo extends co{constructor(t,e=4294967295){super();const r=this;let o,i,s;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const a=new D({async write(e){if(e===ao)return void(s&&await u());const{availableSize:n}=r;if(s)e.length>=n?(await c(e.subarray(0,n)),await u(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:a}=await t.next();if(a&&!n)throw new f(Qr);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await jo(o),i=n.writable,s=i.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function c(t){const e=t.length;e&&(await s.ready,await s.write(t),o.size+=e,r.availableSize-=e)}async function u(){await l(),r.diskOffset+=o.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}n.defineProperty(r,so,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(ao)}finally{t.releaseLock()}}}class Ho{constructor(t){return e.isArray(t)&&(t=new Po(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:Cn(t)}),t}}class Vo{constructor(t){t.writable===dt&&typeof t.next==pt&&(t=new Zo(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:Tn(t)});try{t.size=t.size===dt?0:t.size}catch{throw new f(to)}return t}}function Go(t){return Boolean(t&&t.getData)}async function jo(t,e){if(!t.init||t.initialized)return S.resolve();await t.init(e)}async function qo(t){return t=new Ho(t),await jo(t),t.size!==dt&&t.readUint8Array||(t=new mo(await In(t.readable)),await jo(t)),t}function Ko(t,e,n){return t.readUint8Array(e,n)}function Yo(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?uo.prototype.createReadable.call(t,e):t.readable}function Xo(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}const Jo="filename",Qo="rawFilename",$o="comment",ti="rawComment",ei="uncompressedSize",ni="compressedSize",ri="offset",oi="diskNumberStart",ii="lastModDate",si="rawLastModDate",ai="lastAccessDate",ci="rawLastAccessDate",ui="creationDate",li="rawCreationDate",di="internalFileAttributes",fi="externalFileAttributes",wi="msdosAttributesRaw",pi="msdosAttributes",hi="msDosCompatible",mi="zip64",yi="encrypted",Si="version",gi="versionMadeBy",bi="zipCrypto",Ei="directory",xi="executable",zi="compressionMethod",Ri="signature",Fi="extraField",Di="unixMode",Ai="setuid",Ci="setgid",Ii="sticky",Ti=[Jo,Qo,ei,ni,ii,si,$o,ti,ai,ci,ui,li,ri,oi,di,fi,wi,pi,hi,mi,yi,Si,gi,bi,Ei,xi,"symlink",zi,Ri,"crc32",Fi,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Di,"unixExternalUpper",Ai,Ci,Ii,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class ki{constructor(t){Ti.forEach(e=>this[e]=t[e])}}const vi=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);function _i(t,e,n){return t?e?12:16+4*n:0}const Ni="File format is not recognized",Ui="End of central directory not found",Oi="End of Zip64 central directory locator not found",Mi="Central directory header not found",Li="Local file header not found",Bi="Zip64 extra field not found",Wi="File contains encrypted entry",Pi="Encryption method not supported",Zi="Split zip file",Hi="Overlapping entry found",Vi="Entry data out of bounds",Gi="Ambiguous archive",ji="Encrypted central directory is not supported",qi="Unsafe filename",Ki="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Yi="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Xi="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ji="64-bit value exceeds Number.MAX_SAFE_INTEGER",Qi="unsorted central directory",$i="unknown version needed to extract",ts="compressed patched data",es="malformed extra field",ns="unknown zip64 extensible data",rs="wrapped entries count",os="appended data",is="prepended data",ss="prepended central directory",as="trailing central directory data",cs="duplicate filename",us="mismatched zip64 end of central directory record",ls="multiple end of central directory records",ds="mismatched local file header (filename)",fs="mismatched local file header (general purpose bit flag)",ws="mismatched local file header (compression method)",ps="mismatched local file header (crc32 or sizes)",hs=/^[a-zA-Z]:/,ms="utf-8",ys="cp437",Ss=[[ei,O],[ni,O],[ri,O],[oi,M]],gs={[M]:{qt:ea,bytes:4},[O]:{qt:na,bytes:8}},bs=i(o.MAX_SAFE_INTEGER);class Es{constructor(t,e={}){n.assign(this,{reader:new Ho(t),options:e,Kt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await jo(r),r.size!==dt&&r.readUint8Array||(r=new mo(await In(r.readable)),await jo(r)),r.size<K)throw new f(Ni);const o=e.warnings=[],i=Ls(t,e.options),a=i==Lt,c=i!=Wt,l=Ps(Ys(e,t,_t),i),d=function(t,e){if(t===dt)return e;if(!Ms(t))throw new f(Yi);return t}(Ys(e,t,"filenameValidation"),i),w=Ys(e,t,"normalizeFilename"),{Yt:p,Xt:h}=await Zs(r,c,l);if(!p)throw await async function(t){return await Os(t)==W}(r)?new f(Zi):new f(Ui);c&&h>1&&Ks(ls);const m=Ee(p);let y=ea(m,12),S=ea(m,16);const g=p.offset,b=ta(m,20),E=g+K+b,x=r.size-E;x>l&&Ks(os),x>0&&Xo(o,os);let z=ta(m,4);const F=r.Vt||0;let D,A,C,I,T,k=ta(m,6),v=ta(m,10),_=0,N=X;const U=S==O||y==O||v==M||k==M;if(S!=O&&k!=M&&(S+=Us(r,k)),U){const t=p.offset>=Y?await Ko(r,p.offset-Y,Y):St,e=Ee(t);if(t.length==Y&&ea(e,0)==j){S=Us(r,ea(e,4))+na(e,8);let t=await Ko(r,S,X),i=Ee(t);const c=p.offset-Y-X;if((t.length<X||ea(i,0)!=G)&&S!=c&&c>=0){const e=S;S=c,S>e&&(_=S-e),t=await Ko(r,S,X),i=Ee(t)}if(t.length<X||ea(i,0)!=G)throw new f(Oi);if(C=!0,I=na(i,4)>44,I){const t=s.min(na(i,4)-44,r.size-S-X);t>0&&(N+=t,T=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Ee(t),o=ta(r,26);n.assign(e,{compressionMethod:ta(r,0),compressedSize:na(r,2),uncompressedSize:na(r,10),encryptionAlgorithm:ta(r,18),bitLength:ta(r,20),flags:ta(r,22),hashAlgorithm:ta(r,24),hashData:t.subarray(28,28+o)})}return e}(await Ko(r,S+X,t)))}z==M?z=ea(i,16):z!=ea(i,16)&&qs(a,o,us),k==M?k=ea(i,20):k!=ea(i,20)&&qs(a,o,us),v==M?v=na(i,32):v!=na(i,32)&&qs(a,o,us),y==O?y=na(i,40):y!=na(i,40)&&qs(a,o,us),S=Us(r,k)+na(i,48)+_}}let B=y;const P=p.offset-(C?N+Y:0);if(S>=r.size&&(_=r.size-S-y-K,S=r.size-y-K),F!=z)throw new f(Zi);if(S<0)throw new f(Ni);let Z=0,V=await Ko(r,S,y),J=Ee(V);if(y){if(V.length<4)throw new f(Ni);const t=P-y;if(S!=t&&k==z){const e=ea(J,Z)==H||Boolean(T&&T.compressedSize)||Fs(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=ea(Ee(await Ko(r,t,4)),0)==H),n){const n=S;S=t,S>n&&(_+=S-n,D=e),V=await Ko(r,S,y),J=Ee(V)}}}const Q=P-S;if(y!=Q&&Q>=0&&k==z&&(y=Q,V=await Ko(r,S,y),J=Ee(V)),S<0||S>=r.size)throw new f(Ni);e.directoryOffset=S,e.directoryLength=B;const $=Xs(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&ea(J,0)!=H&&(I||Fs(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(T,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),T),J=Ee(V),B=V.length,tt=!0}T&&!tt&&(V.length<4||ea(J,0)==H)&&Xo(o,ns),A=S;const nt=Ys(e,t,"filenameEncoding"),ct=Ys(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!C;!v&&wt&&(v=Ds(J,V,Z),v&&Xo(o,rs));for(let i=0;i<v;i++){const a=new Rs(r,e.options);if(Z+q>V.length||ea(J,Z)!=H){if(0==i&&!tt&&(I||Fs(J)))throw new f(ji);throw new f(Mi)}Cs(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=ta(J,Z+4),m=!(h>>8),y=h>>8==3,S=V.subarray(u,l),g=ta(J,Z+32),b=p+g,E=V.subarray(p,b),x=c,z=c,F=ea(J,Z+38),D=F&L,C={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},T=ea(J,Z+42),k=Xs(e,t,"decodeText")||qr,N=x?ms:nt||ys,U=z?ms:ct||ys;let O=k(S,N,Ot);if(O===dt&&(O=qr(S,N)),w){const t=w(O);t!==dt&&(O=t)}if(Ws(O,d)){const t=new f(qi);throw t.filename=O,t}let B=k(E,U,Mt);B===dt&&(B=qr(E,U)),n.assign(a,{index:i,Jt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:g,offset:T,diskNumberStart:ta(J,Z+34),internalFileAttributes:ta(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:C,rawFilename:S,filenameUTF8:x,commentUTF8:z,rawExtraField:V.subarray(l,p),rawComment:E,filename:O,comment:B}),Is(a,a,J,Z+6)&&Xo(o,es,O),a.offset+=_;const W=Us(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&Xo(o,Qi,O),ft=W,(a.version&L)>63&&Xo(o,$i,O),32&~a.rawBitFlag||Xo(o,ts,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),K=Boolean(512&a.unixMode),Y=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!Y&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:K,symlink:Y,unixExternalUpper:P,executable:X,directory:Q||$||m&&C.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new ki(a);if(et.getData=(t,n)=>a.getData(t,et,e.Kt,n),et.arrayBuffer=async t=>{const r=new R,o=In(r.readable).then(t=>t.arrayBuffer());return o.catch(()=>{}),await a.getData(r,et,e.Kt,n.assign({},t,{preventClose:!1})),o},Z=b,i==v-1&&wt){const t=Ds(J,V,Z);t&&(v+=t,Xo(o,rs))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new ki(a))}catch{}yield et}let pt=Z,ht=As(V.subarray(Z))||(tt?As(et):dt);if(!ht&&!tt){const t=S+Z,e=s.min(P-t,65541);e>=6&&(ht=As(await Ko(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&qs(a,o,as),lt&&qs(a,o,cs);const mt=Ys(e,t,"extractPrependedData"),yt=Ys(e,t,"extractAppendedData"),gt=(a||mt)&&v&&4==A&&await async function(t){const e=await Os(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>gt)&&Ks(is),(_||v&&A>4)&&Xo(o,is),D&&Xo(o,ss),mt&&(e.prependedData=A>gt?await Ko(r,gt,A-gt):St),e.comment=b?await Ko(r,g+K,b):St,yt&&(e.appendedData=E<r.size?await Ko(r,E,r.size-E):St),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}[gt](){return this.close()}}class xs{constructor(t={}){let r;const{readable:o,writable:i}=new R({start(t){r=t}}),s=new Es(o,t),a=s.getEntriesGenerator(),c=new u;this.readable=new F({async pull(t){const{done:e,value:r}=await a.next();if(e)return t.close();const o=function(t,e){const{readable:n,writable:r}=new R;let o;const i={cancel:async t=>{e.delete(i),await(o?o.cancel(t):n.cancel(t))}};return i.readable=new F({async pull(s){o||(o=n.getReader(),e.add(i),async function(){try{await t.getData(r,{preventClose:!1})}catch(t){try{await r.abort(t)}catch{}}finally{e.delete(i)}}());const{done:a,value:c}=await o.read();a?s.close():s.enqueue(c)},cancel:t=>i.cancel(t)},{highWaterMark:0}),i}(r,c),i={...r,readable:o.readable};delete i.getData,n.defineProperties(i,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),t.enqueue(i)},async cancel(t){const n=e.from(c);c.clear(),r.error(t),await S.allSettled(n.map(e=>e.cancel(t))),await S.allSettled([a.return(),s.close()])}}),this.writable=i}}async function zs(t,e={}){if(t=new Ho(t),await jo(t),t.size!==dt&&t.readUint8Array||(t=new mo(await In(t.readable)),await jo(t)),t.size<K)return!1;const n=Ls(e,{}),r=n!=Wt,o=Ps(e[_t],n),{Yt:i,Xt:s}=await Zs(t,r,o);if(!i||n==Lt&&s>1)return!1;const a=ta(Ee(i),20),c=i.offset+K+a;return t.size-c<=o}let Rs=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,r,o={}){const i=this,a=we(),{reader:c,index:u,offset:l,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:p,compressionMethod:h,bitFlag:m,rawBitFlag:y,crc32:S,rawLastModDate:g,uncompressedSize:b,compressedSize:E}=i,{dataDescriptor:x}=m,z=e.localDirectory={},R=e.warnings=[],F=Us(c,d)+l,A=await Ko(c,F,ct),C=Ee(A);let I=Ys(i,o,bt),T=Ys(i,o,Et);const k=Jt(Ys(i,o,xt)),v=Boolean(k),_=!0===k;if(Xt(I,T),I=I&&I.length&&I,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw new f(Nn);if(A.length<ct||ea(C,0)!=B)throw new f(Li);Cs(z,C,4);const{extraFieldLength:N,filenameLength:U}=z,O=z.dataOffset=F+ct+U+N,M=Ys(i,o,"checkLocalDirectory"),W=Ls(o,i.options),Z=function(t,e){return t===dt?e!=Wt:Boolean(t)}(M,W),H=Ys(i,o,"checkLocalFilename"),V=function(t,e){return t===dt?e==Lt:Boolean(t)}(H===dt?M:H,W);let G=St;if(V&&(U||N)){const t=await Ko(c,F+ct,U+N);G=t.subarray(0,U),z.rawExtraField=t.subarray(U)}else z.rawExtraField=N?await Ko(c,F+ct+U,N):St;V&&(z.rawFilename=G),Is(i,z,C,4,!0)&&Xo(R,es),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Jt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||qs(s,o,ds),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&qs(s,o,fs),e.compressionMethod!=t.compressionMethod&&qs(s,o,ws),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||qs(s,o,ps)}(i,z,G,V,Z?dt:R);const{lastAccessDate:j,creationDate:q,uid:K,gid:Y}=z;j&&(e.lastAccessDate=j),q&&(e.creationDate=q),K!==dt&&e.uid===dt&&(e.uid=K),Y!==dt&&e.gid===dt&&(e.gid=Y);const X=Ys(i,o,"checkPasswordOnly"),J=i.encrypted&&z.encrypted&&(!_||X),Q=J&&!w;if(_||(e.zipCrypto=Q),J&&!(64&~z.rawBitFlag))throw new f(Pi);const $=v?dt:Ln(h);if(0!=h&&8!=h&&9!=h&&!$&&!v)throw new f(Nn);if(J){if(!Q&&(w.strength<1||w.strength>3))throw new f(Pi);if(!I&&!T)throw new f(Wi)}if(O+E>c.size)throw new f(Vi);const tt=E,et=Cn(c.createReadable({offset:O,size:tt})),nt=Kt(Ys(i,o,zt));Yt(nt);let rt=Ys(i,o,"checkOverlappingEntry");const ot=Ys(i,o,"checkOverlappingEntryOnly");ot&&(rt=!0);const{onstart:it,onprogress:st,onend:at}=o,ut=0!=h&&!v,lt=v?E-_i(J,Q,w&&w.strength):b,ft=9==h;let wt=Ys(i,o,Ft);ft&&(wt=!1);const pt=Ys(i,o,"checkCrc32"),ht=(pt===dt?Ys(i,o,"checkSignature"):pt)&&!v&&(!J||Q||w&&1==w.vendorVersion),mt={options:{codecType:cr,password:I,rawPassword:T,zipCrypto:Q,encryptionStrength:w&&w.strength,checkCrc32:ht,checkAuthenticationCode:Ys(i,o,"checkAuthenticationCode"),passwordVerification:Q&&(x?g>>>8&L:S>>>24&L),outputSize:lt,crc32:S,compressed:ut,encrypted:J,useWebWorkers:Ys(i,o,Rt),useCompressionStream:wt,transferStreams:Ys(i,o,Dt),deflate64:ft,format:$?$.format:dt,codecURI:$?$.codecURI:dt,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:X},config:a,ft:{signal:nt,size:tt,onstart:it,onprogress:st,onend:at}};let yt,gt,Ct;rt&&await async function({reader:t,$t:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,Kt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await Ko(t,a+i,d+4),r=Ee(n);let c=n.length==d+4&&ea(r,0)==P;if(c){const t=Ns(r,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:c=!1}if(n.length>=d){const t=Ns(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,$t:e};for(const[t,e]of l)if(t!=n&&w.start<e.end&&e.start<w.end){const t=new f(Hi);throw t.overlappingEntry=e.$t,t}l.set(n,w)}({reader:c,$t:e,index:u,offset:F,crc32:S,compressedSize:E,uncompressedSize:b,dataOffset:O,dataDescriptor:x||z.bitFlag.dataDescriptor,extraFieldZip64:p||z.extraFieldZip64,Kt:r});try{if(!ot){X&&(t=new D),t=new Vo(t),await jo(t,function(t,e,n){return s.min(t,n?1032*e:e)}(lt,E,ut)),({writable:yt}=t);const{outputSize:e}=await Wr({readable:et,writable:yt},mt);if(e!=lt)throw n.assign(new f(Zn),{outputSize:e});t.size+=e}}catch(e){const{outputSize:n}=mt;if(n!==dt?t.size+=n:xe(e)&&e.outputSize!==dt&&(t.size+=e.outputSize),!X||!xe(e)||e.message!=Ze)throw gt=e,Ct=!0,e}finally{if((Go(t)||!Ys(i,o,At))&&yt&&!yt.locked){const t=yt.getWriter();if(Ct)try{await t.abort(gt)}catch{}else await t.close()}}return X||ot?dt:t.getData?t.getData():yt}};function Fs(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==ea(t,n))return!0;return!1}function Ds(t,e,n){let r=0;for(;n+q<=e.length&&ea(t,n)==H;)n+=q+ta(t,n+28)+ta(t,n+30)+ta(t,n+32),r++;return r%65536?0:r}function As(t){if(t.length>=6){const e=Ee(t);if(ea(e,0)==Z){const n=ta(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function Cs(t,e,r){const o=t.rawBitFlag=ta(e,r+2),i=!(1&~o),s=ea(e,r+6);n.assign(t,{encrypted:i,version:ta(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:Js(s),filenameLength:ta(e,r+22),extraFieldLength:ta(e,r+24)})}function Is(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=Ee(s);let d=0,w=!1;try{for(;d<s.length;){const t=ta(l,d),e=ta(l,d+2);u.set(t,{type:t,data:s.slice(d+4,d+4+e)}),d+=4+e}}catch{w=!0}d>s.length&&(w=!0);const p=ta(r,o+4);n.assign(e,{signature:ea(r,o+10),crc32:ea(r,o+10),compressedSize:ea(r,o+14),uncompressedSize:ea(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=Ee(t.data),r=Ss.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+gs[e].bytes,0);if(t.data.length<o)throw new f(Bi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=gs[a];e[s]=t[s]=c.qt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(Ts(m,Jo,Qo,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(Ts(y,$o,ti,e,t),e.extraFieldUnicodeComment=y);const S=u.get(J);S&&S.data.length>=7?(function(t,e,r){const o=Ee(t.data),i=$s(o,4);n.assign(t,{vendorVersion:$s(o,0),vendorId:$s(o,2),strength:i,originalCompressionMethod:r,compressionMethod:ta(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(S,e,p),e.extraFieldAES=S):e.compressionMethod=p;const g=u.get(13);g&&(ks(g,e),e.extraFieldPkwareUnix=g);const b=u.get(22613);b&&(ks(b,e),e.extraFieldUnixType1=b);const E=u.get(10);E&&(function(t,e){const r=Ee(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=ta(r,i),n=ta(r,i+2);1==e&&(o=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(o&&24==o.length){const r=Ee(o),i=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),a=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:s,rawCreationDate:a});const c={lastModDate:Qs(i),lastAccessDate:Qs(s),creationDate:Qs(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(E,e),e.extraFieldNTFS=E);const x=u.get(et);let z;if(x&&(z=vs(x,e,!1),e.extraFieldUnix=x),!z){const t=u.get(tt);t&&(vs(t,e,!0),e.extraFieldInfoZip=t)}const R=u.get(Q);R&&(function(t,e,n){if(!t.data.length)return;const r=Ee(t.data),o=$s(r,0),i=[],s=[];n?(1&~o||(i.push(ii),s.push(si)),2&~o||(i.push(ai),s.push(ci)),4&~o||(i.push(ui),s.push(li))):t.data.length>=5&&(i.push(ii),s.push(si));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=ea(r,c);e[n]=t[n]=new a(1e3*(0|i));const u=s[o];t[u]=i}c+=4})}(R,e,i),e.extraFieldExtendedTimestamp=R);const F=u.get($);return F&&(e.extraFieldUSDZ=F),w}function Ts(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=Ee(t.data),a=new ve;a.append(i[r]);const c=Ee(new w(4));c.setUint32(0,a.get(),!0);const u=ea(s,1),l=$s(s,0);n.assign(t,{version:l,[e]:qr(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==ea(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function ks(t,e){if(t.data.length<8)return;const r=Ee(t.data),o={lastAccessDate:new a(1e3*(0|ea(r,0))),lastModDate:new a(1e3*(0|ea(r,4)))};t.data.length>=12&&(o.uid=ta(r,8),o.gid=ta(r,10)),n.assign(t,o),n.assign(e,o)}function vs(t,e,r){try{const o=Ee(t.data);let i,s;if(r){let e=0;const r=$s(o,e++),a=$s(o,e++);i=_s(t.data.subarray(e,e+a)),e+=a;const c=$s(o,e++);s=_s(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=ta(o,0),s=ta(o,2),n.assign(t,{uid:i,gid:s}));return i!==dt&&(e.uid=i),s!==dt&&(e.gid=s),i!==dt||s!==dt}catch{}}function _s(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Ns(t,e,n){const r=ea(t,e);let o,i;return n?(o=na(t,e+4),i=na(t,e+12)):(o=ea(t,e+4),i=ea(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Us(t,e){return t.jt?t.jt(e):0}async function Os(t){return ea(Ee(await Ko(t,0,4)))}function Ms(t){return t===Lt||t===Bt||t===Wt}function Ls(t,e){return Bs(t,Bs(e,Bt))}function Bs(t,e){const n=t.strictness;if(n!==dt){if(!Ms(n))throw new f(Ki);return n}const r=t.checkAmbiguity;return r===dt?e:r?Lt:e==Wt?Wt:Bt}function Ws(t,e){if(e==Wt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||hs.test(t))||e==Lt&&(n.includes(".")||n.includes(""))}function Ps(t,e){if(t!==dt){const e=te(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(Xi);return e}return e==Lt?0:e==Wt?1/0:M}async function Zs(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of Hs(t,o)){const o=ta(n,d+20);if(f+K+o==r){const o=await Gs(t,n,s,d,f,r,i);if(2==o){if(a||(a=Vs(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Vs(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of Hs(t,o)){const o=Vs(c,u,l);i||(i=o);const d=await Gs(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Yt:a,Xt:u}}async function*Hs(t,e){const n=t.size-e,r=await Ko(t,n,e),o=Ee(r);for(let t=r.length-K;t>=0;t--)ea(o,t)==V&&(yield[o,n,r,t,n+t])}function Vs(t,e,n){return{offset:n,buffer:t.slice(e,e+K).buffer}}async function Gs(t,e,n,r,o,i,s){const a=ta(e,r+10),c=ea(e,r+12),u=ea(e,r+16);if(a==M||c==O||u==O)return await js(t,e,n,o-Y,i,s)==j?2:0;if(!a&&!c)return 1;const l=ta(e,r+6);for(const r of[o-c,Us(t,l)+u])if(await js(t,e,n,r,i,s)==H)return 2;return 0}async function js(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?ea(e,r-n):i.count>0?(i.count--,ea(Ee(await Ko(t,r,4)),0)):dt}function qs(t,e,n){t?Ks(n):Xo(e,n)}function Ks(t){const e=new f(Gi);throw e.reason=t,e}function Ys(t,e,n){return e[n]===dt?t.options[n]:e[n]}function Xs(t,e,n){return qt(Ys(t,e,n))}function Js(t){const e=(4294901760&t)>>16,n=t&M,r=new a(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<lt?lt:r}function Qs(t){return new a(o(t/i(1e4)-i(116444736e5)))}function $s(t,e){return t.getUint8(e)}function ta(t,e){return t.getUint16(e,!0)}function ea(t,e){return t.getUint32(e,!0)}function na(t,e){const n=t.getBigUint64(e,!0);if(n>bs)throw new f(Ji);return o(n)}var ra=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Gi,ERR_BAD_FORMAT:Ni,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Mi,ERR_ENCRYPTED:Wi,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ji,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Vi,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Oi,ERR_EOCDR_NOT_FOUND:Ui,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Bi,ERR_INVALID_AUTHENTICATION_CODE:Pe,ERR_INVALID_COMPRESSED_DATA:Hn,ERR_INVALID_CRC32:Vn,ERR_INVALID_FILENAME_VALIDATION:Yi,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Xi,ERR_INVALID_PASSWORD:We,ERR_INVALID_STRICTNESS:Ki,ERR_INVALID_UNCOMPRESSED_SIZE:Zn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Li,ERR_OVERLAPPING_ENTRY:Hi,ERR_SPLIT_ZIP_FILE:Zi,ERR_UNSAFE_FILENAME:qi,ERR_UNSUPPORTED_COMPRESSION:Nn,ERR_UNSUPPORTED_ENCRYPTION:Pi,ERR_UNSUPPORTED_UINT64:Ji,ERR_WORKER_STARTUP_TIMEOUT:dr,WARNING_APPENDED_DATA:os,WARNING_COMPRESSED_PATCHED_DATA:ts,WARNING_DUPLICATE_FILENAME:cs,WARNING_MALFORMED_EXTRA_FIELD:es,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:fs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ws,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ps,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:ds,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:us,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:ls,WARNING_PREPENDED_CENTRAL_DIRECTORY:ss,WARNING_PREPENDED_DATA:is,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:as,WARNING_UNKNOWN_VERSION:$i,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:ns,WARNING_UNSORTED_CENTRAL_DIRECTORY:Qi,WARNING_WRAPPED_ENTRIES_COUNT:rs,ZipReader:Es,ZipReaderStream:xs,isZipFile:zs});const oa="File already exists",ia="Zip file comment exceeds 64KB",sa="Invalid zip file comment (must be a Uint8Array)",aa="File entry comment exceeds 64KB",ca="Invalid file entry comment (must be a string)",ua="Invalid date (must be a valid Date instance)",la="File entry name exceeds 64KB",da="Version exceeds 65535",fa="The strength must equal 1, 2, or 3",wa="Encryption is not supported in USDZ files",pa="Split zip files are not supported in USDZ files",ha="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",ma="Invalid extra field (must be a Map)",ya="Invalid extra field type (must be integer 0..65535)",Sa="Invalid extra field data (must be a Uint8Array)",ga="Extra field data exceeds 64KB",ba=-2147483648,Ea=2147483647,xa=i(0),za=i("0x7fffffffffffffff"),Ra="Zip64 is not supported (set the 'zip64' option to 'true')",Fa="Undefined uncompressed size",Da="Undefined compression method",Aa="Undefined CRC32",Ca="Undetermined size",Ia="Undefined reader",Ta="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",ka="Zip file not empty",va="Invalid uid (must be integer 0..2^32-1)",_a="Invalid gid (must be integer 0..2^32-1)",Na="Invalid UNIX mode (must be integer 0..65535)",Ua="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Oa="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Ma="Invalid msdosAttributesRaw (must be integer 0..255)",La="Invalid msdosAttributes (must be an object with boolean flags)",Ba="Invalid level (must be integer 0..9)",Wa="Signature data exceeds 64KB",Pa="Invalid entry option (must be an entry returned by ZipReader#getEntries())",Za="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Ha="compression unavailable",Va="clamped last modification date",Ga=new w([7,0,2,0,65,69,3,0,0]),ja="infozip",qa="unix",Ka=[8,9,5,3];let Ya=0;const Xa=[];class Ja{constructor(t,e={}){t=new Vo(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;if(i&&e[vt])throw new f(pa);n.assign(this,{writer:t,te:i,options:e,ee:new c,ne:new u,offset:e[kt]===dt?t.size||t.writable.size||0:e[kt],re:e[kt]===dt?0:e[kt]-(t.size||t.writable.size||0),oe:new u,ie:[],warnings:[],se:0,ae:0,ce:dt,ue:!1})}prependZip(t){return tc(this,async function(t,e){if(t.ne.size)throw new f(ka);await t.le(e)}(this,t))}appendZip(t){return tc(this,this.le(t))}async le(t){const r=this,{oe:o,ne:i,ee:s}=r;for(;o.size;)await S.allSettled(e.from(o));let a;const u=new S(t=>a=t);o.add(u);const l=[];let d;try{t=new Ho(t),await jo(t),t.size!==dt&&t.readUint8Array||(t=new mo(await In(t.readable)),await jo(t));const{ZipReader:o}=await S.resolve().then(function(){return ra}),a=new o(t),u=await a.getEntries();await a.close(),await jo(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(oa);i.add(t),l.push(t)}),r.de=!0;const{fe:p}=r;r.fe=new S(t=>d=()=>{r.de=!1,t()}),await p,r.te&&(delete r.te,await async function(t){return Ee(await Ko(t,0,4)).getUint32(0,!0)==W}(t)||(await Fc(r.writer,zc()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>xc(n,t)-xc(n,e));let c=0;for(const e of a){const r=xc(n,e);await bc(t,n,c,r-c),yc(i,await Ec(n,r))&&await i.closeDisk(),s.set(e,{offset:Sc(t,i),diskNumberStart:hc(i)}),c=r}await bc(t,n,c,o-c)}else{const e=t.offset;await bc(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+xc(n,t),diskNumberStart:0}))}return s}(r,t,u,w);u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:o,bitFlag:i,encrypted:a,uncompressedSize:c,compressedSize:u,extraFieldZip64:l}=t;let{compressionMethod:d,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:m}=i;f=gc(f||St),t.extraFieldAES&&(d=99);const y=Pc(f),S=Boolean(l)&&l.uncompressedSize!==dt,g=Boolean(l)&&l.compressedSize!==dt,b=-7&Vc(w,p,m,a,d)|w<<1,{we:E,pe:x}=Zc({version:e,bitFlag:b,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,he:g,me:S,extraFieldLength:y}),{crc32:z}=t;z!==dt&&Lc(x,10,z);const{offset:R,diskNumberStart:F}=h.get(t);n.assign(t,{ye:!0,me:S,he:g,offset:R,diskNumberStart:F,Se:!1,ge:St,be:St,Ee:St,xe:St,ze:St,rawExtraField:f,Re:St,extendedTimestamp:!1,we:E,pe:x}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{oe:s}=o,a=async function(t,e,r,o){const s=(o=n.assign({},o))[Ut];if(s!==dt){const{Fe:e,De:r}=rc(s,Jt(Tc(t,o,xt)),Tc(t,o,ii));delete o[Ut],o=n.assign(e,r,o)}if(Tc(t,o,Ei)&&!e.endsWith(at)&&(e+=at),t.ne.has(e))throw new f(oa);t.ne.add(e),Ya<we().maxWorkers?Ya++:await new S(t=>Xa.push(t));try{return await async function(t,e,r,o){const s=oc(t,e,o);({name:e}=s);const a=ic(t,e,o),{comment:c}=a,u=o[Fi];t.ee.set(e,dt);const l=t.ce,d={};let w,p;a.Ae.keepOrder&&(d.Ce=new S(t=>w=t)),t.ce=d;try{const{Ae:c}=a;0==c.level||c.compressionMethod!==dt||c.Ie||await hr(we())||(c.level=0,Xo(t.warnings,Ha,e));const u=await async function(t,e,{Ae:r},o){if(r.Ie&&!e&&!Tc(t,o,Ei))throw new f(Ia);let i;if(e){if(e=new Ho(e),await jo(e),!e.readable&&!e.readUint8Array)throw new f(Ta);({size:i}=e)}return n.assign({reader:e},ac(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=mc(t.writer),m=hc(t.writer);let y=o.crc32===dt?o[Ri]:o.crc32;const g=u.Ae.encrypted&&!c.zipCrypto;if(c.Ie&&!c.Te&&g&&(y=dt),c.Ie&&r&&!g&&y===dt)throw new f(Aa);const b=uc(o=n.assign({},o,s.Ae,a.Ae,u.Ae,{signature:o[Ri],crc32:y,offset:t.offset-h,diskNumberStart:m,[vt]:t.options[vt]}));b.ke&&Xo(t.warnings,Va,e);const E=fc(o),x=Pc(b.ve,E._e);p=await async function(t,e,r,o,s){const{ee:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,Ne:d,signal:w}=s,{Ue:p,$t:h,Oe:m,Me:y}=o,g=t.options[vt];let b,E,x,z,F,D,A,C=h,I=0;const T=u&&m?m.Ce:dt;a.set(e,C);try{s.bufferedWrite||!u||t.de||t.se||t.ae||!l&&!d?(b=!0,t.se++,A=s.createTempStream?await s.createTempStream():new R(dt,dt,{highWaterMark:ft}),A.size=0,await jo(c)):(E=!0,t.ae++,A=c,await T,await k()),await jo(A);const h=mc(c);t.te&&!b&&await Rc(t,c),g&&!b&&lc(o,t.offset-h);const{ve:m}=p;b||await v();const y=hc(c),x=Sc(t,c);if(C.diskNumberStart=y,b||(F=!0,D=c.size,await Fc(A,m)),C=await async function(t,e,{diskNumberStart:r,Ce:o},s,a,c){const{Ue:u,Le:l,Be:d}=s,{we:w,pe:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:S,version:g,compressionMethod:b,ge:E,We:x,Ee:z,Pe:R,Ze:F,xe:D,ze:A,be:C}=u,{_e:I}=l,{rawFilename:T,lastAccessDate:k,creationDate:v,password:_,rawPassword:N,level:U,useUnicodeFileNames:M,zip64:B,ye:W,me:P,he:Z,zipCrypto:H,dataDescriptor:V,directory:G,executable:j,versionMadeBy:q,rawComment:K,rawExtraField:Y,Re:X,useWebWorkers:J,transferStreams:Q,onstart:$,onprogress:tt,onend:et,signal:nt,encryptionStrength:rt,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,uid:ct,gid:ut,unixMode:lt,symlink:ft,setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:St,useCompressionStream:gt,Ie:bt,Te:Et,format:xt,codecURI:zt}=c,Rt={Ce:o,versionMadeBy:q,zip64:B,ye:W,directory:Boolean(G),executable:Boolean(j),filenameUTF8:Boolean(M),rawFilename:T,commentUTF8:Boolean(M),rawComment:K,ge:E,We:x,Ee:z,xe:D,ze:A,be:C,rawExtraField:Y,Re:X,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,diskNumberStart:r,uid:ct,gid:ut,unixMode:lt,symlink:Boolean(ft),setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:St};let{crc32:Ft,uncompressedSize:Dt}=c,At=0;bt||(Dt=0);const{writable:Ct}=e;if(t){const n=t.size,r=Cn(Yo(t,{size:n})),o={options:{codecType:ar,inputSize:n,level:U,rawPassword:N,password:_,encryptionStrength:rt,zipCrypto:y&&H,passwordVerification:y&&H&&m>>8&L,computeCrc32:!bt,compressed:S&&!bt,encrypted:y&&!Et,useWebWorkers:J,useCompressionStream:gt,transferStreams:Q,format:xt,codecURI:zt,compressionMethod:b},config:a,ft:{signal:nt,size:n,onstart:$,onprogress:tt,onend:et}};try{const t=await Wr({readable:r,writable:Ct},o);if(At=t.outputSize,e.size+=At,bt||(Dt=t.inputSize,y&&!H||(Ft=t.crc32)),!Z&&At>=O||!P&&Dt>=O)throw new f(Ra)}catch(t){const{outputSize:n}=o;throw n!==dt?e.size+=n:xe(t)&&t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,Ue:r,Le:o},{zip64:s,zipCrypto:a,Ie:c,dataDescriptor:u}){const{pe:l,encrypted:d}=r,{He:f,Ve:w}=o;d&&!a&&!c||t===dt||(Lc(l,10,t),u&&Lc(f,w,t)),s?u&&(Bc(f,w+4,i(e)),Bc(f,w+12,i(n))):(Lc(l,14,e),Lc(l,18,n),u&&(Lc(f,w+4,e),Lc(f,w+8,n)))}({crc32:Ft,compressedSize:At,uncompressedSize:Dt,Ue:u,Le:l},c),V&&await Fc(e,I),n.assign(Rt,{uncompressedSize:Dt,compressedSize:At,lastModDate:h,rawLastModDate:m,creationDate:v,lastAccessDate:k,encrypted:Boolean(y),zipCrypto:Boolean(H),size:d+At,compressionMethod:b,version:g,we:w,pe:p,signature:Ft,crc32:!y||H||bt?Ft:dt,Pe:R,Ze:F,me:P,he:Z}),Rt}(r,A,C,o,we(),s),b||(F=!1),a.set(e,C),C.filename=e,b){if(await S.all([A.writable.getWriter().close(),T]),await k(),t.te&&await Rc(t,c),z=!0,D=c.size,await v(),C.diskNumberStart=hc(c),C.offset=Sc(t,c),g){const e=o.Be;lc(o,t.offset-mc(c)),C.size+=o.Be-e}!function({rawFilename:t,encrypted:e,zip64:n,We:r,crc32:o,compressedSize:s,uncompressedSize:a,me:c,he:u},l,{dataDescriptor:d,Ie:f}){if(d||((!e||f&&o!==dt)&&Lc(l,14,o),u||Lc(l,18,s),c||Lc(l,22,a)),n&&r){const e=ct+Pc(t)+4;Bc(l,e,i(a)),Bc(l,e+8,i(s))}}(C,p.Ge,s),await Fc(c,p.ve),await Dc(A.readable,c,w,t=>I+=t),c.size+=A.size,z=!1}else C.diskNumberStart=y,C.offset=x;return t.offset+=C.size,C}catch(n){if(z||F){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-D,b&&(t.offset+=I)}throw a.delete(e),n}finally{if(b&&t.se--,E&&t.ae--,y&&y(T),x&&x(),b&&A&&A.dispose)try{await A.dispose()}catch{}}async function k(){t.de=!0;const{fe:e}=t;t.fe=new S(e=>x=()=>{t.de=!1,e()}),await e}async function v(){yc(c,Pc(p.ve))&&await c.closeDisk()}}(t,e,r,{Ue:b,Le:E,Be:x,$t:d,Oe:l,Me:w},o)}catch(n){throw t.ee.delete(e),n}finally{w&&w(l&&l.Ce)}return n.assign(p,{name:e,comment:c,extraField:u}),new ki(p)}(t,e,r,o)}catch(n){throw t.ne.delete(e),n}finally{const t=Xa.shift();t?t():Ya--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return S.prototype.then.call(a,c,c),tc(o,a)}remove(t){const{ne:e,ee:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=St,n={}){const r=this,{oe:o,writer:s}=this,{writable:a}=s;if(r.ue)return $a(s);if(!(t instanceof w))throw new f(sa);if(Pc(t)>M)throw new f(ia);for(;o.size;)await S.allSettled(e.from(o));await S.allSettled(r.ie.map(t=>t.je));const c=r.ie.filter(t=>t.qe&&!t.Ke);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.Ke=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{Ye:o,Xe:s}=wc(t.ee),{Je:a,Qe:c,$e:u}=await async function(t,n,r){const{ee:o,writer:i}=t,s=new w(n);await jo(i);let a=0,c=0,u=hc(i),l=mc(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,ge:w,be:p,Ee:h,xe:m,ze:y,rawExtraField:S,Re:g,rawComment:b,versionMadeBy:E,we:x,pe:z,me:R,he:F,Se:D,tn:A,internalFileAttributes:C,externalFileAttributes:I,diskNumberStart:T,uncompressedSize:k,compressedSize:v}=n,_=Pc(w,p,h,m,y,S,g),N=q+Pc(f,b)+_;yc(i,a+N-c)&&(await Fc(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=hc(i),l=mc(i)),R||Lc(z,18,k),F||Lc(z,14,v),(A||D)&&n.version<45&&Mc(z,0,45);const U=pc(N);if(U.en(H),U.nn(E),U.rn(x.subarray(0,24)),U.nn(_),U.nn(Pc(b)),U.nn(D?M:T),U.nn(C),U.en(I),U.en(A?O:e),U.rn(f),U.rn(w),U.rn(p),U.rn(h),U.rn(m),U.rn(y),U.rn(S),U.rn(g),U.rn(b),Wc(s,U.Pt,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new ki(n))}catch{}}return await Fc(i,c?s.slice(c):s),{Je:{diskNumber:u,diskOffset:l},Qe:{diskNumber:hc(i),sn:d},$e:s}}(t,o,r),l=await async function(t,e,n){const r=vc(t,n,Nt);if(r){const n=await r(e),o=Pc(n);if(o>M)throw new f(Wa);const i=pc(6+o);i.en(Z),i.nn(o),i.rn(n);const{writer:s}=t;return yc(s,Pc(i.Pt))&&await s.closeDisk(),await Fc(s,i.Pt),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{Je:s,Qe:a,an:c,Xe:u}=r;let{Ye:l}=r,d=t.ee.size,w=s.diskNumber,p=Sc(t,s);const h=Pc(e);if(h>M)throw new f(ia);let m=Tc(t,n,mi),y=hc(o);if(yc(o,(m?98:K)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(Ra);m=!0}else m===dt&&u&&(m=!0);const S=pc(m?98:K);yc(o,Pc(S.Pt)+h)&&await o.closeDisk(),y=hc(o);let g=y==a.diskNumber?a.sn:0;m&&(S.en(G),S.cn(44),S.nn(45),S.nn(45),S.en(y),S.en(w),S.cn(g),S.cn(d),S.cn(l),S.cn(p),S.en(j),S.en(y),S.cn(i(Sc(t,o))+i(l)+i(c)),S.en(y+1),Tc(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),g=M,d=M,p=O,l=O),S.en(V),S.nn(y),S.nn(w),S.nn(g),S.nn(d),S.en(l),S.en(p),S.nn(h),await Fc(o,S.Pt),h&&await Fc(o,e)}(t,n,r,{Je:a,Qe:c,Ye:o,an:l,Xe:s})}(r,t,n),r.ue=!0,!Go(s)&&Tc(r,n,At)||await a.getWriter().close(),$a(s)}[gt](){return this.close()}}class Qa extends S{then(t,e){const{un:n}=this;return n&&(n.Ke=!0),super.then(t,e)}}function $a(t){return t.getData?t.getData():t.writable}function tc(t,e){const r=new Qa((t,n)=>S.prototype.then.call(e,t,n)),o={};return r.un=o,o.je=S.prototype.then.call(r,dt,t=>n.assign(o,{qe:!0,error:t})),t.ie.push(o),r}async function ec(t,e){try{await t.writer.writable.abort(e)}catch{}}function nc(t,e,n){t.oe.add(e),e.catch(t=>{try{n(t)}catch{}})}function rc(t,r,o){if(null===t||typeof t!=ht||e.isArray(t))throw new f(Pa);const{externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:S,crc32:g,compressionMethod:b,extraFieldAES:E,extraFieldUnix:x,internalFileAttributes:z,extraField:R,bitFlag:F,directory:D,uid:A,gid:C}=t,I={externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,creationDate:p,lastAccessDate:h,internalFileAttributes:z,directory:D};F&&F.languageEncodingFlag&&(I[It]=!0);const T=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{vi.has(n)||e.set(n,t.data)}),e.size)return e}}(R);T&&(I[Fi]=T),A===dt&&C===dt||n.assign(I,{uid:A,gid:C,unixExtraFieldType:x?qa:ja});const k={};if(r&&!D)if(n.assign(k,{uncompressedSize:m,crc32:g,compressionMethod:b}),r!==Pt&&n.assign(k,{encrypted:y,zipCrypto:S,encryptionStrength:E?E.strength:dt}),F&&(k.dataDescriptor=F.dataDescriptor,k[Ct]=Ka[F.level]),o===dt)k.rawLastModDate=w;else if(r!==Pt&&S&&(!F||F.dataDescriptor)&&o instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(o)!=(w>>>8&L))throw new f(Za);return{Fe:I,De:k}}function oc(t,n,r){let o=Tc(t,r,hi),i=Tc(t,r,gi,o?20:768);const s=Tc(t,r,xi),a=_c(t,r,"uid"),c=_c(t,r,"gid");let u=_c(t,r,Di),l=Tc(t,r,"unixExtraFieldType"),d=Tc(t,r,Ai),w=Tc(t,r,Ci),p=Tc(t,r,Ii);if($t(a,O,va),$t(c,O,_a),$t(u,M,Na),l!==dt&&l!==ja&&l!==qa)throw new f(Ua);if(l===qa&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Oa);l!==dt||a===dt&&c===dt||(l=ja);let h=_c(t,r,wi),m=Tc(t,r,pi);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),$t(h,L,Ma),m&&(typeof m!==ht||e.isArray(m)))throw new f(La);if(i>M)throw new f(da);let S=Tc(t,r,fi);const g=S!==dt;g||(S=0),!r[Ei]&&n.endsWith(at)&&(r[Ei]=!0);const b=Tc(t,r,Ei);if(b?(n.endsWith(at)||(n+=at),g||(S=16,o||(S|=16877<<16))):o||g||(S=s?493<<16:27525120),!o){const t=u!==dt||Boolean(d||w||p);u=u===dt?S>>16&M:u&M,d?u|=it:d=Boolean(u&it),w?u|=st:w=Boolean(u&st),p?u|=512:p=Boolean(512&u),g&&!t||(b?u=-61441&u|ot:u&rt||(u|=32768),S=(u&M)<<16|S&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(t,e){if(t!==dt)t&=L;else if(e!==dt){const{readOnly:n,hidden:r,system:o,directory:i,archive:s}=e;let a=0;n&&(a|=1),r&&(a|=2),o&&(a|=4),i&&(a|=16),s&&(a|=32),t=a&L}return e===dt&&(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}}(h,m)),y&&(S=S&O|h&L);const E=S>>16&M,x=u!==dt&&40960==(u&rt);return{name:n,Ae:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:S,unixExternalUpper:E,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:x,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function ic(t,e,n){const r=vc(t,n,"encodeText")||Ne;let i=r(e,Ot);if(i===dt&&(i=Ne(e)),Pc(i)>M)throw new f(la);const s=n[$o]||"";if(typeof s!=mt)throw new f(ca);let c=r(s,Mt);if(c===dt&&(c=Ne(s)),Pc(c)>M)throw new f(aa);const u=Tc(t,n,Si);if(u!==dt&&u>M)throw new f(da);const l=kc(t,n,ii,new a),d=Tc(t,n,si),w=kc(t,n,ai),p=kc(t,n,ui),h=Tc(t,n,di,0),m=Jt(Tc(t,n,xt)),y=Boolean(m),S=!0===m,g=Tc(t,n,bt),b=Tc(t,n,Et);Xt(g,b);const E=_c(t,n,"encryptionStrength",3),x=Tc(t,n,bi),z=Tc(t,n,"extendedTimestamp",!0),R=Tc(t,n,"ntfsTimestamp"),F=Tc(t,n,"keepOrder",!0),D=Tc(t,n,Rt),A=Tc(t,n,Dt),C=Tc(t,n,"bufferedWrite"),I=vc(t,n,"createTempStream"),T=Tc(t,n,"dataDescriptorSignature",!0),k=Kt(Tc(t,n,zt));Yt(k);const v=Tc(t,n,It,!Hc(i)||!Hc(c)),_=Tc(t,n,zi),N=y||_===dt?dt:Ln(_);if(!y&&_!==dt&&0!==_&&8!==_&&!N)throw new f(Nn);let U=_c(t,n,Ct);if($t(U,9,Ba),t.options[vt]){if(g!==dt||b!==dt)throw new f(wa);U===dt&&_===dt&&(U=0)}y&&(U=te(n[Ct]));let O=Tc(t,n,Ft),L=Tc(t,n,Tt);C&&L===dt&&(L=!1),(L===dt||x&&!S)&&(L=!0),U!==dt&&6!=U&&(O=!1);const B=Tc(t,n,mi);if(!(x||g===dt&&b===dt||o.isInteger(E)&&E>=1&&E<=3))throw new f(fa);const W=sc(n[Fi]),P=sc(n.localExtraField),Z=sc(n.centralExtraField);return{comment:s,Ae:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,Ie:y,Te:S,password:g,rawPassword:b,encryptionStrength:E,zipCrypto:x,extendedTimestamp:z,ntfsTimestamp:R,keepOrder:F,useWebWorkers:D,transferStreams:A,bufferedWrite:C,createTempStream:I,dataDescriptorSignature:T,signal:k,useUnicodeFileNames:v,compressionMethod:_,format:N?N.format:dt,codecURI:N?N.codecURI:dt,ln:N?N.versionNeeded:dt,level:U,useCompressionStream:O,dataDescriptor:L,zip64:B,rawExtraField:W,dn:P,Re:Z}}}function sc(t){if(!t)return St;if(!(t instanceof c))throw new f(ma);let e=0,n=0;t.forEach((t,n)=>{if(Qt(n,M,ya),!(t instanceof w))throw new f(Sa);if(Pc(t)>M)throw new f(ga);e+=4+Pc(t)});const r=new w(e),o=Ee(r);return t.forEach((t,e)=>{Mc(o,n,e),Mc(o,n+2,Pc(t)),Wc(r,t,n+4),n+=4+Pc(t)}),r}function ac(t,e,n,r,o){const{Ie:i,Te:s,zipCrypto:a,password:c,rawPassword:u,encryptionStrength:l}=r;let{dataDescriptor:d,zip64:w,level:p,compressionMethod:h}=r,m=0,y=0,S=!1;if(i&&e){if(y=o[ei],y===dt)throw new f(Fa);if(h===dt)throw new f(Da)}const g=!0===w,b=Tc(t,o,yi);if(e&&s&&!b&&Pc(c,u))throw new f(ha);const E=e&&(Boolean(c&&Pc(c)||u&&Pc(u))||s&&b);e||(p=0,h=0);const x=_i(E,a,l);e&&(i?(o.uncompressedSize=y,m=n===dt?Nc(y)+x:n+(s?0:x)):n===dt?(d=!0,(w||w===dt)&&(w=S=!0,m=4294967296)):(o.uncompressedSize=y=n,m=(Uc(h,p)?Nc(y):y)+x));const z=!(E||e&&(0!==n||i)||Uc(h,p));z&&!a&&Tc(t,o,Tt)===dt&&(d=!1);const R=g||S||y>=O,F=g||m>=O;if(R||F){if(!1===w)throw new f(Ra);w=!0}return w=w||!1,{fn:m,Ae:{dataDescriptor:d,Ne:z,zip64:w,ye:g,wn:S,me:R,he:F,uncompressedSize:y,level:p,compressionMethod:h,encrypted:E}}}function cc(t,e,n){const r=t.slice().sort((t,e)=>n?e-t:t-e);let o=e,i=0;for(const t of r){if(o>=O)break;o+=t,i++}return i}function uc(t){const{rawFilename:e,lastModDate:n,rawLastModDate:r,lastAccessDate:o,creationDate:i,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:w,directory:p,rawExtraField:h,dn:m,encryptionStrength:y,extendedTimestamp:S,ntfsTimestamp:g,Ie:b,encrypted:E,me:x,he:z,uncompressedSize:R,wn:F,crc32:D}=t;let{version:A,compressionMethod:C}=t;const I=!p&&Uc(C,c);let T;const k=b||!I,v=u&&(t.bufferedWrite||!w||!x&&!z||k&&!F),_=v||u&&w&&(x||z);if(u&&(x||z)){const t=20,e=pc(t);if(e.nn(1),e.nn(t-4),T=e.Pt,v&&(e.cn(R),k)){const t=_i(E,l,y);e.cn(b?0:R+t)}}else T=St;let N,U,O,L,W;if(E&&!l){const t=pc(Pc(Ga)+2);t.nn(J),t.rn(Ga),N=t.Pt,N[8]=y}else N=St;if(S){const t=Cc(n),e=(P=t)>=ba&&P<=Ea;if(e){const e=9+(o?4:0)+(i?4:0),n=pc(e);L=1+(o?2:0)+(i?4:0),W=t,n.nn(Q),n.nn(e-4),n.pn(L),n.en(t),o&&n.en(Ic(Cc(o))),i&&n.en(Ic(Cc(i))),O=n.Pt}else O=St;if(g===dt?!e||Boolean(o||i):g)try{const t=Ac(n),e=pc(36);e.nn(10),e.nn(32),e.hn(4),e.nn(1),e.nn(24),e.cn(t),e.cn(o?Ac(o):t),e.cn(i?Ac(i):t),U=e.Pt}catch{U=St}else U=St}else U=O=St;var P;let Z;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=ja||e===dt&&n===dt)if(r!=qa||e===dt&&n===dt)Z=St;else{const t=pc(8);t.nn(et),t.nn(4),t.nn((e===dt?0:e)&M),t.nn((n===dt?0:n)&M),Z=t.Pt}else{const t=dc(e===dt?0:e),r=dc(n===dt?0:n),o=3+t.length+r.length,i=pc(4+o);i.nn(tt),i.nn(o),i.pn(1),i.pn(t.length),i.rn(t),i.pn(r.length),i.rn(r),Z=i.Pt}}catch{Z=St}C===dt&&(C=I?8:0),A===dt&&(A=0!=C||p||E?20:10);const{ln:H}=t;I&&H!==dt&&(A=A>H?A:H),u&&(A=A>45?A:45),E&&!l&&(A=A>51?A:51,b&&D!==dt&&(N[4]=1),Mc(Ee(N),9,C),C=99);const V=_?Pc(T):0,G=V+Pc(N,O,U,Z,h,m);if(G+(t[vt]?67:0)>M)throw new f(ga);const j=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),q=j<lt?lt:j>ut?ut:j,K=Pc(O)?new a(1e3*Cc(n)):Pc(U)?n:q,{we:Y,pe:X,rawLastModDate:$}=Zc({version:A,bitFlag:Vc(c,d,w,E,C),compressionMethod:C,uncompressedSize:R,lastModDate:q,rawLastModDate:r,rawFilename:e,he:z,me:x,extraFieldLength:G}),nt=pc(ct+Pc(e)+G),rt=nt.Pt,ot=Ee(rt);return nt.en(B),nt.rn(Y),nt.rn(e),_&&nt.rn(T),nt.rn(N),nt.rn(O),nt.rn(U),nt.rn(Z),nt.rn(h),nt.rn(m),w&&(z||Lc(ot,18,0),x||Lc(ot,22,0)),{ve:rt,Ge:ot,we:Y,pe:X,lastModDate:K,ke:K===q&&j.getTime()!=q.getTime(),rawLastModDate:$,encrypted:E,compressed:I,version:A,compressionMethod:C,Pe:L,Ze:W,ge:St,We:V,Ee:O,xe:U,ze:Z,be:N,extraFieldLength:G}}function lc(t,e){const{Ue:n}=t;let{ve:r,extraFieldLength:o}=n,i=64-(e+Pc(r))%64;i<4&&(i+=64);const s=new w(i),a=Ee(s);Mc(a,0,$),Mc(a,2,i-4);const c=r;n.ve=r=new w(Pc(c)+i),Wc(r,c),Wc(r,s,Pc(c));const u=Ee(r);Mc(u,28,o+i),n.Ge=u,t.Be+=i}function dc(t){const e=new w(4);Ee(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function fc({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=St,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=Ee(o),n&&(i=4,Lc(r,0,P))),{_e:o,He:r,Ve:i}}function wc(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,be:o,rawComment:i,xe:s,ze:a,rawExtraField:c,Re:u,Pe:l,Ze:d,ye:w,uncompressedSize:p,compressedSize:h}=r;let{me:m,he:y}=r;w||(m&&p<O&&(m=r.me=!1),y&&h<O&&(y=r.he=!1)),n=n||m||y;const S=r.offset>=O,g=r.diskNumberStart>=M;let b,E;if(S||g||m||y){const t=4+(m?8:0)+(y?8:0)+(S?8:0)+(g?4:0),e=pc(t);e.nn(1),e.nn(t-4),m&&e.cn(p),y&&e.cn(h),S&&e.cn(r.offset),g&&e.en(r.diskNumberStart),b=e.Pt}else b=St;if(r.ge=b,r.tn=S,r.Se=g,d===dt)E=St;else{const t=pc(9);t.nn(Q),t.nn(5),t.pn(l),t.en(d),E=t.Pt}r.Ee=E;const x=Pc(b,o,s,a,E,c,u);if(x>M)throw new f(ga);e+=q+Pc(t,i)+x}return{Ye:e,Xe:n}}function pc(t){const e=new w(t),n=Ee(e);let r=0;return{Pt:e,pn:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},nn:t=>{Mc(n,r,t),r+=2},en:t=>{Lc(n,r,t),r+=4},cn:t=>{Bc(n,r,i(t)),r+=8},rn:t=>{Wc(e,t,r),r+=Pc(t)},hn:t=>r+=t}}function hc(t){const{diskNumber:e=0}=t;return e}function mc(t){const{diskOffset:e=0}=t;return e}function yc(t,e){const{availableSize:n=ft}=t;return e>n}function Sc(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.re:0)}function gc(t){const e=Ee(t);let n=0;for(;n+4<=Pc(t);){const r=4+Oc(e,n+2);if(1==Oc(e,n))return gc(ge(t.subarray(0,n),t.subarray(s.min(n+r,Pc(t)))));n+=r}return t}async function bc(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await Dc(Yo(e,{offset:n,size:r}),o,dt,t=>i+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=i,t.offset+=i}}}async function Ec(t,e){const n=await Ko(t,e,ct);if(Pc(n)<ct)return ct;const r=Ee(n);return ct+Oc(r,26)+Oc(r,28)}function xc(t,{offset:e,diskNumberStart:n}){return e+(t.jt?t.jt(n):0)}function zc(){const t=new w(4);return Lc(Ee(t),0,W),t}async function Rc(t,e){delete t.te,await Fc(e,zc()),t.offset+=4}async function Fc(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=Pc(e),await r.write(e)}finally{r.releaseLock()}}async function Dc(t,e,n,r){const o=e.writable.getWriter();try{await t.pipeTo(new D({async write(t){await o.ready,await o.write(t),r(Pc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function Ac(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<xa?xa:e>za?za:e}}function Cc(t){return s.floor(t.getTime()/1e3)}function Ic(t){return s.min(Ea,s.max(ba,t))}function Tc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function kc(t,e,n,r){const i=Tc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(ua);return i}function vc(t,e,n){return qt(Tc(t,e,n))}function _c(t,e,n,r){return te(Tc(t,e,n,r))}function Nc(t){return t+5*(s.floor(t/16383)+1)}function Uc(t,e){return t===dt?e===dt||e>0:0!==t}function Oc(t,e){return t.getUint16(e,!0)}function Mc(t,e,n){t.setUint16(e,n,!0)}function Lc(t,e,n){t.setUint32(e,n,!0)}function Bc(t,e,n){t.setBigUint64(e,n,!0)}function Wc(t,e,n){t.set(e,n)}function Pc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Zc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,he:c,me:u,extraFieldLength:l}){const d=pc(26),f=d.Pt,w=Ee(f);if(d.nn(t),d.nn(e),d.nn(n),s===dt){const t=new h(1),e=Ee(t);Mc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Mc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.en(s),d.hn(4),c||o!==dt?d.en(c?O:o):d.hn(4),u||r!==dt?d.en(u?O:r):d.hn(4),d.nn(Pc(a)),d.nn(l),{we:f,pe:w,rawLastModDate:s}}function Hc(t){return t.every(t=>t>=32&&t<=126)}function Vc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function Gc(t,e){if(!t)return!1;const{yn:n}=t;return n?n.includes(e):$n(t,e)}const jc=1048576,qc=".zip.js-temp",Kc=1048576,Yc=1048576,Xc=".zip.js-temp",Jc="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=me(Se(t));n.assign(ie,e),n.assign(fe,e)}({baseURI:void 0===E&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===E?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",E.baseURI).href})}catch{}const Qc="Entry filename already exists",$c="Duplicate entry filename in the imported zip file",tu='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',eu="Entry is an ancestor of target entry",nu="Root directory cannot be moved",ru="Target entry is not a directory",ou="Parent entry is not a directory",iu="Readable stream already consumed",su="throw",au="keep-first",cu="keep-last",uu=new u([su,au,cu]),lu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",du="Invalid readerOptions (must be an object)",fu="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",wu="zipjs-abort-export";class pu{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(Qc);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Sn++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,gn:r.gn||r.uncompressedSize===dt,passThrough:r.passThrough,bn:r.bn||new a}),!o&&t.root||(t.entries[i.id]=i),o&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let n=e.parent;if(n){const r=Zu(t);r&&(t=r.pop(),n=Hu(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(Qc);n!=e.parent&&(Du(e),e.parent=n,n.children.push(e),Wu(e.fs,e))}e.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class hu extends pu{constructor(t,e,n,r){super(t,e,n,r);const o=this;o.Reader=n.Reader,o.Writer=n.Writer,n.getData&&(o.getData=n.getData)}clone(){return new hu(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&function(t,e){const{contentType:n}=t;return n===dt||(t.constructor==yo?e.type==n:t.constructor!=wo||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Ru(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await S.all([jo(r),jo(t,o)]);const i=Kt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof ki||!o&&!i&&!s?a:Cn(a).pipeThrough(new Sr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!Go(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await Cn(s).pipeTo(Tn(t.writable),{signal:i,preventClose:a,preventAbort:a}),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,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(xe(t)&&t.message==We)return!1;throw t}}getText(t,e){return this.getData(new bo(t),e)}getBlob(t,e){return this.getData(new yo(t),e)}getData64URI(t,e){return this.getData(new wo(t),e)}getUint8Array(t){return this.getData(new Wo,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return be(await this.getUint8Array(t)).buffer}replaceBlob(t){vu(this,{data:t,Reader:mo,Writer:yo,uncompressedSize:t.size})}replaceText(t){vu(this,{data:t,Reader:So,Writer:bo,uncompressedSize:go(t)})}replaceData64URI(t){vu(this,{data:t,Reader:fo,Writer:wo,uncompressedSize:_u(t)})}replaceUint8Array(t){vu(this,{data:t,Reader:Bo,Writer:Wo,uncompressedSize:t.length})}replaceReadable(t){vu(this,{data:null,Reader:xu(t),Writer:null,uncompressedSize:dt})}}class mu extends pu{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new mu(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return Pu(this,t,{options:e},!0)}addText(t,e,n={}){return Pu(this,t,{data:e,Reader:So,Writer:bo,options:n,uncompressedSize:go(e)})}addBlob(t,e,n={}){return Pu(this,t,{data:e,Reader:mo,Writer:yo,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return Pu(this,t,{data:e,Reader:fo,Writer:wo,options:n,uncompressedSize:_u(e)})}addUint8Array(t,e,n={}){return Pu(this,t,{data:e,Reader:Bo,Writer:Wo,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return Pu(this,t,{data:e,Reader:class extends Lo{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return Pu(this,t,{Reader:xu(e),options:n})}addFileSystemEntry(t,e={}){return Ou(this,t,e)}addFileSystemHandle(t,e={}){return Ou(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),Pu(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 mo(t),e)}importData64URI(t,e){return this.importZip(new fo(t),e)}importUint8Array(t,e){return this.importZip(new Bo(t),e)}importHttpContent(t,e){return this.importZip(new Lo(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new yo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new wo(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Wo,t)}async exportWritable(t=new D,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r;ku(r.passThrough);const a=Tu(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Kt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}(r.signal,c),d=n.assign({},r,a,{signal:u,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),w=gu([t],t=>Eu(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await gr(o,w),await g(t,e),s&&await gr(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new D({async write(t){await e.write(t),m+=t.length,i&&await gr(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function g(t,e){if(r.concurrent){const n=(await S.allSettled(t.children.map(t=>b(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Au(t.reason));throw function(t){const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e}((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await b(n,e)}async function b(e,n){if(u.aborted){if(h||Au(u.reason))return;Yt(u)}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await g(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),o=await r.createWritable();try{await e.getData({writable:y(o)},d)}catch(t){throw h?new f(wu):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(wu));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==pt?(r=t,e=n.assign({},r.options,e)):(await jo(t),r=new Es(t,e)),ku(e.passThrough);const o=function(t){if(t===dt)return su;if(uu.has(t))return t;throw new f(tu)}(e.duplicates),i=[],s=await r.getEntries(e);for(const t of s){let r=this;try{const s=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=s.pop();let c=!1;for(const t of s){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(o==au){c=!0;break}if(o!=cu)throw new f($c);this.fs.remove(r),r=new mu(this.fs,t,{data:null},e),i.push(r)}}else r=new mu(this.fs,t,{data:null},e),i.push(r)}if(c)continue;if(t.directory){let e=r;if(a){if(e=r.getChildByName(a),e&&!e.directory){if(o==au)continue;if(o!=cu)throw new f($c);this.fs.remove(e),e=dt}e||(e=new mu(this.fs,a,{data:null},r),i.push(e))}e==this||e.data||(e.data=t)}else{const s=r.getChildByName(a);if(s){if(o==au)continue;if(o!=cu)throw new f($c);this.fs.remove(s)}i.push(Pu(r,a,{data:t,Reader:zu(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){i.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return i}async exportZip(t,e={}){const r=this,o=Boolean(t)&&typeof t.add==pt;e=n.assign({},e),o||e.bufferedWrite!==dt||(e.bufferedWrite=!0);const[i]=await S.all([Fu(r,Tu(e.readerOptions)),o?dt:jo(t)]),s=o?t:new Ja(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=gu(e.children,t=>Uu(t)?0:1);let f=0,w=0;if(s&&await gr(s,r),o.bufferedWrite)await async function t(e){const n=(await S.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(Uu(e))return;const{name:s,Fe:c}=Cu(e,l,o);let p=0;const h=await t.add(s,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{f+=t-p,p=t,a&&await gr(a,f,r)}}));w++,u&&await gr(u,w,d,h)}c&&await gr(c,f)}(s,r,gu([r],bu),e,i),o?s:(await s.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(t={}){const e=this;Tu((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}),o=r.filter(t=>!Uu(t)).map(n=>{const{name:r,Fe:o}=Cu(n,e,t);return{name:r,size:n.directory?0:Iu(n,Nu(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>Uu(t)||!t.children.length);return await async function(t,e,r,o){const i={options:t};if(qt(t[Nt]))throw new f(Ca);if(o!==dt&&!(o instanceof w))throw new f(sa);const a=Pc(o);if(a>M)throw new f(ia);const l=t[vt],d=new c,p=t[kt]===dt?0:t[kt];let h=p,m=ft;const y=[],S=new u;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);Tc(i,o,Ei)&&!e.endsWith(at)&&(e+=at);const a=oc(i,e,o);({name:e}=a);const{Ae:c}=ic(i,e,o);0==c.level||c.compressionMethod!==dt||c.Ie||await hr(we())||(c.level=0);const u=!Tc(i,o,Ei);if(u&&r===dt)throw new f(Ca);const{fn:w,Ae:p}=ac(i,u,r,c,o);if(u&&!c.Ie&&Uc(p.compressionMethod,p.level))throw new f(Ca);const g=n.assign({},o,a.Ae,c,p,{[vt]:l}),b=uc(g),E=fc(g),x={Ue:b,Be:Pc(b.ve,E._e)};l&&lc(x,h);const z=u?w:0;d.set(e,n.assign({},g,b,{offset:h,diskNumberStart:0,compressedSize:z}));const R=x.Be+z;y.push(R),S.add(Boolean(g.ye||g.uncompressedSize>=O||z>=O)),m=s.min(m,R),h+=R}if(d.size>1&&(l||h-m>=O&&(S.size>1||cc(y,p,!0)!=cc(y,p,!1)))&&!r)throw new f(Ca);const{Ye:g,Xe:b}=wc(d);let E=Tc(i,t,mi);if(h>=O||g>=O||d.size>=M){if(!1===E)throw new f(Ra);E=!0}else E===dt&&b&&(E=!0);return h-p+g+a+(E?98:K)}(t,o,i,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return function(t,e){const n=[],r=[t];let o=0;for(;o<r.length;)for(const t of r[o++].children)n.push(t),e&&r.push(t);return n}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await S.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class yu{constructor(){Lu(this)}get children(){return this.root.children}remove(t){Du(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f(nu);if(!e.directory)throw new f(ru);if(e.isDescendantOf(t))throw new f(eu);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(Qc)}else Du(t),t.parent=e,e.children.push(t),Wu(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.directory?n.getChildByName(e[t]):dt;return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Bu(this,n=>n.importBlob(t,e))}importData64URI(t,e){return Bu(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return Bu(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return Bu(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return Bu(this,n=>n.importReadable(t,e))}importZip(t,e){return Bu(this,n=>n.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 Su={FS:yu,ZipDirectoryEntry:mu,ZipFileEntry:hu};function gu(t,n){let r=0;const o=e.from(t);for(;o.length;){const t=o.pop();r+=n(t)||0;for(const e of t.children)o.push(e)}return r}function bu(t){return t.uncompressedSize}function Eu(t,e){const{data:n}=t;return e&&n instanceof ki?n.compressedSize:t.uncompressedSize}function xu(t){let e;return function(){if(e)throw new f(iu);return e=!0,{readable:t}}}function zu(t){return class extends uo{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:i}=r,s=await e.entry.getData(new yo,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.En=new mo(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.En.readUint8Array(t,e)}}}function Ru(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Fu(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await S.all(n.map(async t=>{const n=t.reader=Ru(t.Reader,t.data,e);o.set(t,n);try{await jo(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.gn=!1)})),o}function Du(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Au(t){return Boolean(t)&&t.message==wu}function Cu(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let s={},a={};if(t.data instanceof ki){const e=Nu(t,r),n=i.lastModDate===dt?r.lastModDate:i.lastModDate;({Fe:s,De:a}=rc(t.data,e,n)),e&&(a.passThrough=!0)}const c=n.assign({lastModDate:t.bn},s,r,i,a,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===dt)throw new f(lu);return{name:o,Fe:c}}function Iu(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.gn?dt:Eu(t,e)}function Tu(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(du);return t&&ku(t.passThrough),t}function ku(t){if(Jt(t)===Pt)throw new f(fu)}function vu(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,gn:r===dt})}function _u(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function Nu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function Uu(t){return t.directory&&null===t.data}function Ou(t,e,r){return async function t(e,o,i,s=""){if(o){const c=s?s+"/"+o.name:o.name;try{if((o.isFile||o.isDirectory)&&(o=await Mu(o)),"file"==o.kind){const t=await o.getFile();i.push(Pu(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:n.assign({},{lastModDate:new a(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==o.kind){const n=e.addDirectory(o.name,r);i.push(n);for await(const e of o.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function Mu(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new S((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await async function(t){const e=[];function n(t,r,o){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await Mu(t));n(t,r,o)}else r(e)},o)}return await new S((e,r)=>n(t.createReader(),e,r)),{[k.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function Lu(t){t.entries=[],t.Sn=0,t.root=new mu(t)}function Bu(t,e){const{entries:r,Sn:o,root:i}=t;return Lu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,Sn:o,root:i}),e})}function Wu(t,e){const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}}function Pu(t,e,n,r){if(t.directory){const o=Zu(e);return o&&(e=o.pop(),t=Hu(t,o)),r?new mu(t.fs,e,n,t):new hu(t.fs,e,n,t)}throw new f(ou)}function Zu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function Hu(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(Qc);if(n&&(t==n||t.isDescendantOf(n)))throw new f(eu)}else t=new mu(r.fs,e,{data:null},r)}),t}t.BlobReader=mo,t.BlobWriter=yo,t.Data64URIReader=fo,t.Data64URIWriter=wo,t.ERR_ABORTED=jt,t.ERR_AMBIGUOUS_ARCHIVE=Gi,t.ERR_ANCESTOR_ENTRY=eu,t.ERR_BAD_FORMAT=Ni,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Mi,t.ERR_DUPLICATED_NAME=oa,t.ERR_DUPLICATE_IMPORTED_ENTRY=$c,t.ERR_ENCRYPTED=Wi,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=ji,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Vi,t.ERR_ENTRY_EXISTS=Qc,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=Oi,t.ERR_EOCDR_NOT_FOUND=Ui,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Bi,t.ERR_HTTP_RANGE=Xr,t.ERR_HTTP_RESOURCE_CHANGED=Jr,t.ERR_HTTP_STATUS=Yr,t.ERR_INVALID_AUTHENTICATION_CODE=Pe,t.ERR_INVALID_BASE_URI=ne,t.ERR_INVALID_CODEC_DEFINITION=kn,t.ERR_INVALID_CODEC_MODULE=_n,t.ERR_INVALID_COMMENT=ia,t.ERR_INVALID_COMMENT_TYPE=sa,t.ERR_INVALID_COMPRESSED_DATA=Hn,t.ERR_INVALID_CRC32=Vn,t.ERR_INVALID_DATE=ua,t.ERR_INVALID_DUPLICATES=tu,t.ERR_INVALID_ENCRYPTION_STRENGTH=fa,t.ERR_INVALID_ENTRY=Pa,t.ERR_INVALID_ENTRY_COMMENT=aa,t.ERR_INVALID_ENTRY_COMMENT_TYPE=ca,t.ERR_INVALID_ENTRY_NAME=la,t.ERR_INVALID_EXTRAFIELD=ma,t.ERR_INVALID_EXTRAFIELD_DATA=ga,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=Sa,t.ERR_INVALID_EXTRAFIELD_TYPE=ya,t.ERR_INVALID_FILENAME_VALIDATION=Yi,t.ERR_INVALID_FUNCTION_OPTION=Zt,t.ERR_INVALID_GID=_a,t.ERR_INVALID_LEVEL=Ba,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Xi,t.ERR_INVALID_MAX_WORKERS=ee,t.ERR_INVALID_MSDOS_ATTRIBUTES=Ma,t.ERR_INVALID_MSDOS_DATA=La,t.ERR_INVALID_PASSWORD=We,t.ERR_INVALID_PASSWORD_TYPE=Vt,t.ERR_INVALID_PASS_THROUGH=lu,t.ERR_INVALID_PASS_THROUGH_VALUE=Gt,t.ERR_INVALID_READER=Ta,t.ERR_INVALID_READER_OPTIONS=du,t.ERR_INVALID_SIGNAL=Ht,t.ERR_INVALID_SIGNATURE_DATA=Wa,t.ERR_INVALID_STRICTNESS=Ki,t.ERR_INVALID_UID=va,t.ERR_INVALID_UNCOMPRESSED_SIZE=Zn,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=Ua,t.ERR_INVALID_UNIX_ID_SIZE=Oa,t.ERR_INVALID_UNIX_MODE=Na,t.ERR_INVALID_URI=re,t.ERR_INVALID_VERSION=da,t.ERR_ITERATOR_COMPLETED_TOO_SOON=Qr,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Li,t.ERR_OVERLAPPING_ENTRY=Hi,t.ERR_PARENT_NOT_DIRECTORY=ou,t.ERR_READABLE_CONSUMED=iu,t.ERR_RESERVED_COMPRESSION_METHOD=vn,t.ERR_ROOT_DIRECTORY_NOT_MOVABLE=nu,t.ERR_SPLIT_ZIP_FILE=Zi,t.ERR_TARGET_NOT_DIRECTORY=ru,t.ERR_UNDEFINED_COMPRESSION_METHOD=Da,t.ERR_UNDEFINED_CRC32=Aa,t.ERR_UNDEFINED_READER=Ia,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=Fa,t.ERR_UNDETERMINED_SIZE=Ca,t.ERR_UNSAFE_FILENAME=qi,t.ERR_UNSUPPORTED_COMPRESSION=Nn,t.ERR_UNSUPPORTED_CONTEXT=Jc,t.ERR_UNSUPPORTED_CRYPTO_API=He,t.ERR_UNSUPPORTED_ENCRYPTION=Pi,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=ha,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=wa,t.ERR_UNSUPPORTED_FORMAT=Ra,t.ERR_UNSUPPORTED_PASS_THROUGH_VALUE=fu,t.ERR_UNSUPPORTED_SPLIT_USDZ=pa,t.ERR_UNSUPPORTED_UINT64=Ji,t.ERR_WORKER_STARTUP_TIMEOUT=dr,t.ERR_WRITER_NOT_INITIALIZED=$r,t.ERR_WRITER_SIZE_NOT_WRITABLE=to,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Za,t.ERR_ZIP_NOT_EMPTY=ka,t.HttpRangeReader=class extends Lo{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Lo,t.Reader=uo,t.SplitDataReader=Po,t.SplitDataWriter=Zo,t.TextReader=So,t.TextWriter=bo,t.Uint8ArrayReader=Bo,t.Uint8ArrayWriter=Wo,t.VERSION="2.13.0",t.WARNING_APPENDED_DATA=os,t.WARNING_CLAMPED_LAST_MODIFICATION_DATE=Va,t.WARNING_COMPRESSED_PATCHED_DATA=ts,t.WARNING_COMPRESSION_UNAVAILABLE=Ha,t.WARNING_DUPLICATE_FILENAME=cs,t.WARNING_MALFORMED_EXTRA_FIELD=es,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=fs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=ws,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=ps,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=ds,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=us,t.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=ls,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=ss,t.WARNING_PREPENDED_DATA=is,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=as,t.WARNING_UNKNOWN_VERSION=$i,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=ns,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=Qi,t.WARNING_WRAPPED_ENTRIES_COUNT=rs,t.Writer=lo,t.ZipDirectoryEntry=mu,t.ZipEntry=pu,t.ZipFS=yu,t.ZipFileEntry=hu,t.ZipReader=Es,t.ZipReaderStream=xs,t.ZipWriter=Ja,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new R;this.readable=e,this.zipWriter=new Ja(n,t),this.oe=new u}transform(t){const e=this.zipWriter;let n;const{readable:r,writable:o}=new R({start(t){n=t},flush:()=>{!async function(){try{await e.close()}catch(t){await ec(e,t)}}()}});return nc(this,this.zipWriter.add(t,r),t=>n.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:n,writable:r}=new R({start(t){e=t}});return nc(this,this.zipWriter.add(t,n),t=>e.error(t)),r}async close(t,n={}){const{zipWriter:r}=this,o=(await S.allSettled(e.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await ec(r,t),t}try{return await r.close(t,n)}catch(t){throw await ec(r,t),t}}},t.configure=function(t){n.assign(fe,me(Se(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=Kc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new D({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new R;r=In(e.readable),n=e.writable.getWriter(),s=!0;for(const e of t)await n.write(e);t.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:a,readable:new F({async pull(e){if(s){if(!o){const t=await r;o=t.stream().getReader()}const{value:t,done:n}=await o.read();n?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(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),t.length=0}}}},t.createOPFSTempStream=function(t={}){const{thresholdBytes:n=jc,directoryName:r=qc,getDirectory:o=()=>I.storage.getDirectory()}=t;let i;function s(){return i||(i=S.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new D({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join(""),o=await n.getFileHandle(r,{create:!0}),i=(await o.createWritable()).getWriter(),u=!0;for(const e of t)await i.write(e);t.length=0}())},async close(){i&&(await i.close(),i=null)}});let d=0;return{writable:l,readable:new F({async pull(e){if(u){if(!a){const t=await o.getFile();a=t.stream().getReader()}const{value:t,done:n}=await a.read();n?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(i){try{await i.close()}catch{}i=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}o=r=null}t.length=0}}}},t.createSyncAccessHandleTempStream=function(t={}){const{thresholdBytes:n=Yc,directoryName:r=Xc,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(Jc);const i=o||(()=>I.storage.getDirectory());let a;function c(){return a||(a=S.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new D({async write(s){a?(o.write(s,{at:u}),u+=s.length):(t.push(s),i+=s.length,i>n&&await async function(){const n=await c();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join("");const i=await n.getFileHandle(r,{create:!0});o=await i.createSyncAccessHandle(),a=!0;for(const e of t)o.write(e,{at:u}),u+=e.length;t.length=0}())},close(){o&&o.flush()}});let f=0;return{writable:d,readable:new F({pull(e){if(a){const t=u-l;if(t<=0)return void e.close();const n=new w(s.min(524288,t)),r=o.read(n,{at:l});r?(l+=r,e.enqueue(n.subarray(0,r))):e.close()}else f<t.length?e.enqueue(t[f++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(o){try{o.close()}catch{}o=null}if(r){try{const t=await c();await t.removeEntry(r)}catch{}r=null}t.length=0}}}},t.fs=Su,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=Bn,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=we(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Gc(n,Gn)||Gc(t,Gn)||Gc(t,qn),decompression:Gc(r,Gn)||Gc(e,Gn)||Gc(e,qn),registered:!1},{compressionMethod:9,compression:!1,decompression:Gc(r,jn)||Gc(e,jn),registered:!1}];for(const t of Bn()){const e=Wn(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==pt:dt,decompression:e?typeof e.DecompressionStream==pt:dt,registered:!0})}return o},t.isZipFile=zs,t.registerCodec=function(t={}){const{compressionMethod:e,format:n,codecURI:r,CompressionStream:i,DecompressionStream:s,versionNeeded:a}=t;if(!o.isInteger(e)||e<0||e>M||typeof n!=mt||!n.length)throw new f(kn);if(Un.includes(e))throw new f(vn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(kn);On.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Pn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of de)delete fe[t];n.assign(fe,ie)},t.terminateWorkers=async function(){await S.allSettled(Ur.map(t=>(Gr(t),t.terminate()))),fr=dt,wr=!1},t.unregisterCodec=function(t){const e=On.get(t);if(e){let n;On.delete(t),On.forEach(t=>n=n||t.format==e.format),n||Mn.delete(e.format)}}});