@zip.js/zip.js 2.14.1 → 2.16.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/BENCHMARKS.md +21 -11
  2. package/deno.json +1 -1
  3. package/dist/zip-core-external.js +217 -98
  4. package/dist/zip-core-external.min.js +1 -1
  5. package/dist/zip-core.js +217 -98
  6. package/dist/zip-core.min.js +1 -1
  7. package/dist/zip-fs-core-external.js +217 -98
  8. package/dist/zip-fs-core-external.min.js +1 -1
  9. package/dist/zip-fs-core.js +217 -98
  10. package/dist/zip-fs-core.min.js +1 -1
  11. package/dist/zip-fs-external.js +217 -98
  12. package/dist/zip-fs-external.min.js +1 -1
  13. package/dist/zip-fs-native.js +219 -100
  14. package/dist/zip-fs-native.min.js +1 -1
  15. package/dist/zip-fs.js +219 -100
  16. package/dist/zip-fs.min.js +1 -1
  17. package/dist/zip-legacy.js +219 -100
  18. package/dist/zip-legacy.min.js +1 -1
  19. package/dist/zip-native.js +219 -100
  20. package/dist/zip-native.min.js +1 -1
  21. package/dist/zip-web-worker-native.js +1 -1
  22. package/dist/zip-web-worker.js +1 -1
  23. package/dist/zip.js +219 -100
  24. package/dist/zip.min.js +1 -1
  25. package/index-native.cjs +219 -100
  26. package/index-native.min.js +1 -1
  27. package/index.cjs +219 -100
  28. package/index.d.cts +46 -13
  29. package/index.d.ts +46 -13
  30. package/index.min.js +1 -1
  31. package/lib/core/codec-pool.js +35 -19
  32. package/lib/core/codec-worker.js +4 -2
  33. package/lib/core/io.js +3 -2
  34. package/lib/core/streams/zip-entry-stream.js +151 -66
  35. package/lib/core/util/decode-text.js +15 -1
  36. package/lib/core/version.js +1 -1
  37. package/lib/core/web-worker-inline-native.js +1 -1
  38. package/lib/core/web-worker-inline-wasm.js +1 -1
  39. package/lib/core/zip-reader.js +12 -10
  40. package/lib/core/zlib-streams-inline.js +1 -1
  41. package/package.json +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:E,document:b,crypto:R,btoa:x,TransformStream:z,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:I,navigator:C,Worker:T,Symbol:k,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:self;var U=void 0!==b?b.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,Y=22,K=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(),Et="password",bt="rawPassword",Rt="passThrough",xt="signal",zt="useWebWorkers",Ft="useCompressionStream",Dt="transferStreams",At="preventClose",It="level",Ct="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 Yt(t){if(t&&(typeof t.addEventListener!=pt||typeof t.aborted!=yt))throw new f(Ht);return t||dt}function Kt(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 C!=wt&&C.hardwareConcurrency&&(oe=C.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 I!=wt&&I},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 Ee(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function be(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function Re(t){return Boolean(t)&&"object"==typeof t}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[ze,Fe,De,Ae,Ie,Ce,Te,ke]=xe;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]^Ce[t>>>16&255]^Ie[t>>>24&255]^Ae[255&n]^De[n>>>8&255]^Fe[n>>>16&255]^ze[n>>>24&255]}}for(;r<n;r++)e=e>>>8^ze[255&(e^t[r])];this.o=e}get(){return~this.o}}class _e extends z{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 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 Ue=64,Oe=20,Me=new w([128]),Le=new w(1),Be=new Int32Array([1732584193,4023233417,2562383102,271733878,3285377520]),We=new w(256),Pe=new Int32Array(256),Ze=new Int32Array(256),He=new Int32Array(256),Ve=new Int32Array(256);let Ge=!1;function je(t){const e=function(){const t=new Int32Array(Be),e=new Int32Array(16),n=new w(Ue),r=new m(n.buffer),o=new w(8);let i=0,a=0;return{update:c,digest:function(){const e=8*a,n=s.floor(e/4294967296),r=e>>>0;for(c(Me,0,1);56!=i;)c(Le,0,1);o[0]=n>>>24,o[1]=n>>>16,o[2]=n>>>8,o[3]=n,o[4]=r>>>24,o[5]=r>>>16,o[6]=r>>>8,o[7]=r,c(o,0,8);const u=new w(Oe),l=new m(u.buffer);for(let e=0;e<t.length;e++)l.setInt32(4*e,t[e]);return t.set(Be),i=0,a=0,u}};function c(t,e,o){const s=e+o;if(a+=o,i){for(;e<s&&i<Ue;)n[i++]=t[e++];i==Ue&&(u(r,0),i=0)}if(e+Ue<=s){const n=new m(t.buffer,t.byteOffset,t.byteLength);for(;e+Ue<=s;e+=Ue)u(n,e)}for(;e<s;)n[i++]=t[e++]}function u(n,r){for(let t=0;t<16;t++)e[t]=n.getInt32(r+4*t);let o,i=t[0],s=t[1],a=t[2],c=t[3],u=t[4];for(let t=0;t<15;t+=5)u=(i<<5|i>>>27)+((a^c)&s^c)+u+1518500249+e[t]|0,s=s<<30|s>>>2,c=(u<<5|u>>>27)+((s^a)&i^a)+c+1518500249+e[t+1]|0,i=i<<30|i>>>2,a=(c<<5|c>>>27)+((i^s)&u^s)+a+1518500249+e[t+2]|0,u=u<<30|u>>>2,s=(a<<5|a>>>27)+((u^i)&c^i)+s+1518500249+e[t+3]|0,c=c<<30|c>>>2,i=(s<<5|s>>>27)+((c^u)&a^u)+i+1518500249+e[t+4]|0,a=a<<30|a>>>2;u=(i<<5|i>>>27)+((a^c)&s^c)+u+1518500249+e[15]|0,s=s<<30|s>>>2,o=e[13]^e[8]^e[2]^e[0],o=o<<1|o>>>31,e[0]=o,c=(u<<5|u>>>27)+((s^a)&i^a)+c+1518500249+o|0,i=i<<30|i>>>2,o=e[14]^e[9]^e[3]^e[1],o=o<<1|o>>>31,e[1]=o,a=(c<<5|c>>>27)+((i^s)&u^s)+a+1518500249+o|0,u=u<<30|u>>>2,o=e[15]^e[10]^e[4]^e[2],o=o<<1|o>>>31,e[2]=o,s=(a<<5|a>>>27)+((u^i)&c^i)+s+1518500249+o|0,c=c<<30|c>>>2,o=e[0]^e[11]^e[5]^e[3],o=o<<1|o>>>31,e[3]=o,i=(s<<5|s>>>27)+((c^u)&a^u)+i+1518500249+o|0,a=a<<30|a>>>2;for(let t=20;t<40;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(i<<5|i>>>27)+(s^a^c)+u+1859775393+o|0,s=s<<30|s>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(i^s^a)+c+1859775393+o|0,i=i<<30|i>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,a=(c<<5|c>>>27)+(u^i^s)+a+1859775393+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,s=(a<<5|a>>>27)+(c^u^i)+s+1859775393+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,i=(s<<5|s>>>27)+(a^c^u)+i+1859775393+o|0,a=a<<30|a>>>2;for(let t=40;t<60;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(i<<5|i>>>27)+(s&a|(s|a)&c)+u+2400959708+o|0,s=s<<30|s>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(i&s|(i|s)&a)+c+2400959708+o|0,i=i<<30|i>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,a=(c<<5|c>>>27)+(u&i|(u|i)&s)+a+2400959708+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,s=(a<<5|a>>>27)+(c&u|(c|u)&i)+s+2400959708+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,i=(s<<5|s>>>27)+(a&c|(a|c)&u)+i+2400959708+o|0,a=a<<30|a>>>2;for(let t=60;t<80;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(i<<5|i>>>27)+(s^a^c)+u+3395469782+o|0,s=s<<30|s>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(i^s^a)+c+3395469782+o|0,i=i<<30|i>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,a=(c<<5|c>>>27)+(u^i^s)+a+3395469782+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,s=(a<<5|a>>>27)+(c^u^i)+s+3395469782+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,i=(s<<5|s>>>27)+(a^c^u)+i+3395469782+o|0,a=a<<30|a>>>2;t[0]=t[0]+i|0,t[1]=t[1]+s|0,t[2]=t[2]+a|0,t[3]=t[3]+c|0,t[4]=t[4]+u|0}}(),n=new w(Ue),r=new w(Ue);t.length>Ue&&(e.update(t,0,t.length),t=e.digest());for(let e=0;e<Ue;e++){const o=e<t.length?t[e]:0;n[e]=54^o,r[e]=92^o}return e.update(n,0,Ue),{update(t,n,r){e.update(t,n,r)},digest(){const t=e.digest();e.update(r,0,Ue),e.update(t,0,Oe);const o=e.digest();return e.update(n,0,Ue),o}}}function qe(t){return We[t>>>24]<<24|We[t>>>16&255]<<16|We[t>>>8&255]<<8|We[255&t]}function Ye(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function Ke(t){return 255&(t<<1^27*(t>>7))}const Xe=typeof R!=wt&&typeof R.getRandomValues==pt,Je="Invalid password",Qe="Invalid authentication code",$e="zipjs-abort-check-password",tn="Crypto API not supported";function en(t){if(Xe)return R.getRandomValues(t);throw new f(tn)}const nn={name:"PBKDF2"},rn=n.assign({hash:{name:"HMAC"}},nn),on=n.assign({iterations:1e3,hash:{name:"SHA-1"}},nn),sn=["deriveBits"],an=[8,12,16],cn=[16,24,32],un=10,ln=typeof R!=wt,dn=ln&&R.subtle;let fn=ln&&typeof dn!=wt&&typeof dn.importKey==pt&&typeof dn.deriveBits==pt;class wn extends z{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){hn(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,l:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await gn(t,e,n,En(r,0,an[e])),i=En(r,an[e]);if(o[0]!=i[0]||o[1]!=i[1])throw yn(t),new f(Je)}(n,i,o,En(t,0,an[i]+2)),t=En(t,an[i]+2),r?(yn(n),e.error(new f($e))):s()):await a;const c=new w(t.length-un-(t.length-un)%16);e.enqueue(mn(n,t,c,0,un,!0))},async flush(t){const{h:e,m:n,ready:r}=this;if(e){await r;const i=En(n,n.length-un),s=new w(En(n,0,n.length-un));e.process(s,!0);const a=e.digest();let c=n.length<un?1:0;for(let t=0;t<un;t++)c|=a[t]^i[t];if(c&&o)throw new f(Qe);t.enqueue(s)}},cancel(){yn(this)}})}}class pn extends z{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){hn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,l:i,ready:s}=n;let a=gt;r?(a=await async function(t,e,n){const r=en(new w(an[e]));return Se(r,await gn(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%16);c.set(a,0),e.enqueue(mn(n,t,c,a.length,0,!1))},async flush(t){const{h:e,m:n,ready:r}=this;if(e){await r;const o=new w(n);e.process(o,!1);const i=En(e.digest(),0,un);t.enqueue(Se(o,i))}},cancel(){yn(this)}})}}function hn(t,e,r,o){n.assign(t,{ready:new g(e=>t.l=e),password:Sn(e,r),strength:o-1,m:gt})}function mn(t,e,n,r,o,i){const{h:s,m:a}=t;a.length&&(e=Se(a,e));const c=e.length-o,u=c-c%16;if(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){const t=En(n,r,r+u);t.set(En(e,0,u)),s.process(t,i)}return t.m=En(e,u),n}function yn({h:t}){t&&t.dispose&&t.dispose()}async function gn(t,e,r,o){t.password=null;const i=cn[e],a=await async function(t,e,r){if(fn)try{const o=await dn.importKey("raw",t,rn,!1,sn);return new w(await dn.deriveBits(n.assign({salt:e},on),o,8*r))}catch{fn=!1}return function(t,e,n,r){const o=je(t),i=new w(r),a=new w(e.length+4),c=new m(a.buffer);a.set(e);for(let t=1,n=0;n<r;t++,n+=Oe){c.setUint32(e.length,t),o.update(a,0,a.length);let u=o.digest();const l=u.slice();for(let t=1;t<1e3;t++){o.update(u,0,Oe),u=o.digest();for(let t=0;t<Oe;t++)l[t]^=u[t]}i.set(l.subarray(0,s.min(Oe,r-n)),n)}return i}(t,e,0,r)}(r,o,2*i+2);return t.h=function(t,e){!function(){if(!Ge){let t=1,e=1;do{t=255&(t^t<<1^(128&t?27:0)),e=255&(e^e<<1),e=255&(e^e<<2),e=255&(e^e<<4),128&e&&(e^=9),We[t]=255&(e^(e<<1|e>>7)^(e<<2|e>>6)^(e<<3|e>>5)^(e<<4|e>>4)^99)}while(1!=t);We[0]=99;for(let t=0;t<256;t++){const e=We[t],n=Ke(e),r=n<<24|e<<16|e<<8|n^e;Pe[t]=r,Ze[t]=r>>>8|r<<24,He[t]=r>>>16|r<<16,Ve[t]=r>>>24|r<<8}Ge=!0}}();const n=new Int32Array(60),r=function(t,e){const n=t.length>>2,r=n+6,o=4*(r+1);let i=1;for(let r=0;r<n;r++)e[r]=t[4*r]<<24|t[4*r+1]<<16|t[4*r+2]<<8|t[4*r+3];for(let t=n;t<o;t++){let r=e[t-1];t%n==0?(r=qe(r<<8|r>>>24)^i<<24,i=Ke(i)):n>6&&t%n==4&&(r=qe(r)),e[t]=e[t-n]^r}return r}(t,n),o=new Int32Array(4),i=je(e);let s=0,a=0,c=0,u=0;return{process(t,e){e&&i.update(t,0,t.length),function(t){const e=new m(t.buffer,t.byteOffset,t.byteLength),n=t.length;let r=0;for(;r+16<=n;r+=16)l(),e.setInt32(r,e.getInt32(r)^o[0]),e.setInt32(r+4,e.getInt32(r+4)^o[1]),e.setInt32(r+8,e.getInt32(r+8)^o[2]),e.setInt32(r+12,e.getInt32(r+12)^o[3]);if(r<n){l();for(let e=0;r<n;r++,e++)t[r]^=o[e>>2]>>>24-8*(3&e)}}(t),e||i.update(t,0,t.length)},digest:()=>i.digest()};function l(){s=s+1|0,s||(a=a+1|0,a||(c=c+1|0,c||(u=u+1|0)));let t=Ye(s)^n[0],e=Ye(a)^n[1],i=Ye(c)^n[2],l=Ye(u)^n[3],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[4],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[5],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[6],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[7];t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[8],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[9],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[10],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[11],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[12],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[13],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[14],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[15],t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[16],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[17],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[18],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[19],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[20],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[21],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[22],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[23],t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[24],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[25],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[26],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[27],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[28],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[29],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[30],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[31],t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[32],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[33],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[34],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[35],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[36],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[37],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[38],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[39];let h=40;r>10&&(t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[40],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[41],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[42],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[43],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[44],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[45],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[46],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[47],h=48),r>12&&(t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[48],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[49],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[50],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[51],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[52],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[53],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[54],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[55],h=56),o[0]=(We[d>>>24]<<24|We[f>>>16&255]<<16|We[w>>>8&255]<<8|We[255&p])^n[h],o[1]=(We[f>>>24]<<24|We[w>>>16&255]<<16|We[p>>>8&255]<<8|We[255&d])^n[h+1],o[2]=(We[w>>>24]<<24|We[p>>>16&255]<<16|We[d>>>8&255]<<8|We[255&f])^n[h+2],o[3]=(We[p>>>24]<<24|We[d>>>16&255]<<16|We[f>>>8&255]<<8|We[255&w])^n[h+3]}}(En(a,0,i),En(a,i,2*i)),En(a,2*i)}function Sn(t,e){return e===dt?Ne(t):e}function En(t,e,n){return t.subarray(e,n)}class bn extends z{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){xn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=zn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(Je);t=t.subarray(12)}r?e.error(new f($e)):e.enqueue(zn(n,t))}})}}class Rn extends z{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){xn(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=en(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(Fn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(Fn(n,t),o),e.enqueue(r)}})}}function xn(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,S:new ve(o[0]),R:new ve(o[2])}),r)for(let e=0;e<r.length;e++)Dn(t,r[e]);else for(let n=0;n<e.length;n++)Dn(t,e.charCodeAt(n))}(t,e,r)}function zn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=An(t)^e[r],Dn(t,n[r]);return n}function Fn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=An(t)^e[r],Dn(t,e[r]);return n}function Dn(t,e){let[,n]=t.keys;t.S.append([e]);const r=~t.S.get();n=Cn(s.imul(Cn(n+In(r)),134775813)+1),t.R.append([n>>>24]);const o=~t.R.get();t.keys=[r,n,o]}function An(t){const e=2|t.keys[2];return In(s.imul(e,1^e)>>>8)}function In(t){return 255&t}function Cn(t){return 4294967295&t}function Tn(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 kn(t,e){t=Tn(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 vn(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 _n="Invalid codec definition",Nn="Reserved compression method",Un="Invalid codec module",On="Compression method not supported",Mn=[0,8,9,99],Ln=new c,Bn=new c;function Wn(t){return Ln.get(t)}function Pn(){return e.from(Ln.values(),t=>n.assign({},t,Bn.get(t.format)))}function Zn(t){return Bn.get(t)}function Hn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(Un);Bn.set(t,{CompressionStream:n,DecompressionStream:r})}const Vn="Invalid uncompressed size",Gn="Invalid compressed data",jn="Invalid CRC32",qn="deflate-raw",Yn="deflate64-raw",Kn="gzip",Xn=[31,139,8];class Jn 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 E=d&&Zn(d),b=c&&o&&!l&&!E&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||b||(h=new _e,S=sr(S,h)),o)if(E)S=ar(S,or(E.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(b)g=new Qn,S=ar(S,new r(Kn)),S=sr(S,g);else try{S=ir(S,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(Kn)}catch{throw t}S=ar(S,e),S=sr(S,new Qn)}i&&(a?S=sr(S,new Rn(t)):(y=new pn(t),S=sr(S,y))),rr(p,S,()=>{i&&!a||!c||(p.crc32=b?g.crc32:new m(h.value.buffer).getUint32(0))})}}class Qn 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=be(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class $n 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,E,b=super.readable;if(i&&(o?b=sr(b,new bn(t)):(E=new wn(t),b=sr(b,E))),c){const t=d&&Zn(d);if(t)b=ar(b,or(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{b=ir(b,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(Kn)}catch{throw t}b=function(t,e,n){const r=new ve;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(Xn),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=be(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=sr(t,l),sr(t=ar(t,e),d);function p(){h(),o=v(()=>s(new f(Vn)),5e3)}function h(){_(o)}}(b,e,y)}b=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(Gn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(b)}s&&(S=new _e,b=sr(b,S)),rr(this,b,()=>{if(s){const t=new m(S.value.buffer);if(a!=t.getUint32(0,!1))throw new f(jn)}})}}const tr=new c;function er(t,e){if(!t)return!1;let n=tr.get(t);n||(n=new c,tr.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 nr(t){return er(t,qn)}function rr(t,e,r){e=sr(e,new z({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function or(t,e,n){if(!t)throw new f(On);return new t(e,n)}function ir(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?Yn:qn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return ar(t,a)}function sr(t,e){return Tn(t).pipeThrough(e)}function ar(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 cr="data",ur="deflate",lr="inflate";class dr extends z{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(ur)?i=Jn:o.startsWith(lr)&&(i=$n),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(Vn)},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 fr 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 wr="Worker startup timeout";let pr,hr,mr,yr=()=>{};async function gr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;return!(!n||n.F)||!(!nr(e)&&(r=e,!er(r,Kn)))||!!n&&await Sr();var r}async function Sr(){if(yr)try{return await void 0,!0}catch{}return!1}function Er(t){t.createWorker?hr=!0:pr=!1}class br{constructor(t,{readable:e,writable:r},o,i){const{options:s,config:a,D:c,useWebWorkers:u,transferStreams:l,workerURI:d}=o;let{createWorker:f}=o;const{signal:w}=c;return hr&&(f=dt),n.assign(t,{A:!0,I:(t.I||0)+1,readable:e.pipeThrough(new fr(pe(a))).pipeThrough(new Rr(c),{signal:w}),writable:r,options:n.assign({},s),C:o,workerURI:d,createWorker:f,transferStreams:l,terminate:()=>new g(e=>{const{T:n,A:r}=t;r?(t.v=t.v||[],t.v.push(e)):(n&&(n.terminate(),t.T=null),e()),t._=null}),N(){if(t.A){const{v:e,T:n}=t;e&&(t.v=null,n&&(t.U=!0,n.terminate()),e.forEach(t=>t())),t.A=!1,i(t)}}}),pr===dt&&(pr=typeof T!=wt),(u&&mr&&(pr&&d||f)?mr:zr)(t,a)}}class Rr extends z{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await xr(t,n)},async transform(t,r){o+=t.length,e&&await xr(e,o,n),r.enqueue(t)},async flush(){r&&await xr(r,o)}})}}async function xr(t,...e){try{await t(...e)}catch{}}function zr(t,e){return{run:()=>Fr(t,e)}}async function Fr({options:t,readable:e,writable:n,N:r,C:o},i){let s,a,c;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(ur),n=e?i.CompressionStreamFallback:i.DecompressionStreamFallback,r=e?i.CompressionStream:i.DecompressionStream;t.useCompressionStream?n&&n.F&&!nr(r)&&await u():await u()||n&&!n.F||(t.useCompressionStream=!0)}t.encrypted&&!t.zipCrypto&&await u(),s=new dr(t,i),a=new fr(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,Re(t))try{t.outputSize=e}catch{}}throw t}finally{r()}function u(){return c||(c=Sr()),c}}const Dr={type:"module"},Ar="error";let Ir,Cr,Tr,kr=!0;try{kr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var vr;function _r(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Nr(t){const{T:e}=t;if(e)try{e.terminate()}catch{}t._=null}function Ur(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(Cr===dt||Ir!==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=Dr);try{a=new T(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return Ur(t,e,r,o,!1);if(o)throw i;return Ur(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=Dr);try{c=new d(c,e)}catch{}try{a=new T(c,u)}catch(n){if(o)return Ur(t,e,r,!1,i);throw n}}Ir=t,Cr=c,Tr=u}else a=new T(Cr,Tr);return a.addEventListener("message",t=>{r.O=!0,Or(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a,errorValue:c}=t,{reader:u,writer:l,M:d,L:p,N:h,I:m}=e,y=()=>e.I!=m;try{if(a)g(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}))),Re(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()||Lr({type:cr,value:t,done:n,messageId:i},e)}if(r==cr){const t=new w(o);await l.ready,await l.write(t),y()||Lr({type:"ack",messageId:i},e)}"close"==r&&function(t){y()||(d(t),S(),h())}(s)}}catch(a){y()||(Nr(e),g(a))}function g(t){y()||(p(t),S(),Re(t)&&t.codecImportFailed||h())}function S(){l&&l.releaseLock()}}(t,r)}),a.addEventListener(Ar,t=>Mr(t,r)),a.addEventListener("messageerror",t=>Mr(t,r)),a}function Or(t){const{B:e}=t;e&&(_(e),t.B=null)}function Mr(t,e){t.preventDefault&&t.preventDefault(),Or(e);const{O:r,L:o,writer:i,N:s}=e;Nr(e),r||(e.T=null);let a=t.error||new f(t.message||Ar);r||(a=n.assign(new f(a.message||Ar),{W:!0}),e.P=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function Lr(t,{T:e,writer:n,transferStreams:r,O:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=Ee(n),a.push(t.value.buffer)),r&&kr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{kr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}vr=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t._){let c;typeof a==pt&&(a=a());try{c=Ur(t.workerURI,r,t)}catch{return Er(t),zr(t,e)}n.assign(t,{T:c,O:!1,U:!1,P:null,_:{run:async()=>{try{return await async function(t,e){if(!t.T){const{P:e}=t;t.P=null;const n=e||new f(wr);throw n.W=!0,n}let r,i;const s=new g((e,n)=>{r=e,i=e=>{const{outputSize:r,C:o}=t;if(o.outputSize=r,Re(e))try{e.outputSize=r}catch{}n(e)}});n.assign(t,{reader:null,writer:null,outputSize:0,Z:!1,H:null,M:r,L:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,V:d}=function(t,e){const r=new AbortController;let o;const{writable:i,readable:s}=new z({transform(t,n){e.outputSize+=t.length,n.enqueue(t)}}),a=s.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:r.signal});return a.catch(t=>{o||n.assign(e,{Z:!0,H:t})}),{writable:i,closed:a,V:()=>{o=!0,r.abort()}}}(t.writable,t);let w;try{w=Lr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.N(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.O&&o.isFinite(p)&&p>=0&&(t.B=v(()=>function(t){if(t.B=null,t.O)return;const{L:e,writer:n}=t;if(Nr(t),t.T=null,e){const t=new f(wr);t.W=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(e){await h(),d();try{await l}catch{}const{outputSize:n,C:r,Z:o,H:i}=t;r.outputSize=n;const s=Re(e)&&(e.codecImportFailed||e.W),a=o&&!s?i:e;if(Re(a))try{a.outputSize=n}catch{}throw a}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.W)return Er(t),_r(t),Fr(t,e);if(n&&n.codecImportFailed){if(t.reader)return _r(t),Fr(t,e);t.N()}throw n}}}})}return t._},mr=vr;let Br=[];const Wr=[];let Pr,Zr,Hr=0;async function Vr(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){!Bn.has(t)&&e&&Hn(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),E=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!S&&E&&(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=Br.find(t=>!t.A);if(n)return Kr(n),new br(n,t,e,b);if(Br.length<y){const n={G:Hr};return Hr++,Br.push(n),new br(n,t,e,b)}return new g(n=>{Wr.push({resolve:n,stream:t,C:e}),Zr=r.workerStarvationTimeout,Gr()})}()).run();function b(t){if(jr(),Wr.length){const[{resolve:e,stream:n,C:r}]=Wr.splice(0,1);e(new br(t,n,r,b)),Gr()}else t.T?(Kr(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.U?t.U=!1:t.j=v(async()=>{Br=Br.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):Br=Br.filter(e=>e!=t)}}function Gr(){!Pr&&Wr.length&&o.isFinite(Zr)&&Zr>=0&&(Pr=v(qr,Zr))}function jr(){Pr&&(_(Pr),Pr=null)}function qr(){if(Pr=null,Wr.length){const[{resolve:t,stream:e,C:r}]=Wr.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new br({},e,o,Yr)),Gr()}}function Yr(){jr(),Gr()}function Kr(t){const{j:e}=t;e&&(_(e),t.j=null)}const Xr="\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+=Xr[t[n]];return e}(t):new E(e,{ignoreBOM:n}).decode(t)}const $r="HTTP error ",to="HTTP Range not supported",eo="HTTP resource changed",no="Writer iterator completed too soon",ro="Writer not initialized",oo="Invalid writer (size must be writable)",io="Content-Range",so="Range",ao="GET",co="bytes",uo=16777216,lo="writable",fo=k();class wo{constructor(){this.size=0}init(){this.initialized=!0}}class po extends wo{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 $o(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class ho extends wo{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f(ro);return t.writeUint8Array(Ee(e))}});n.defineProperty(t,lo,{get:()=>e})}writeUint8Array(){}}class mo extends po{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{Y:t,K:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{K:n,Y: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 yo extends ho{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",X:""})}writeUint8Array(t){const e=this;let n,o=e.X;const i=e.X.length;for(e.X="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.X+=r.fromCharCode(t[n]);o.length>2?e.data+=x(o):e.X=o+e.X}getData(){return this.data+x(this.X)}}let go,So;class Eo extends po{constructor(t){super(),n.assign(this,{J:t,size:t.size}),So||(So=(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();go=1==e}catch{go=!1}})())}createReadable(t){const{J:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};if(typeof e.stream==pt){if(!r&&o>=n)return Tn(e.stream());if(go)return Tn(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.J:n.J.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class bo extends wo{constructor(t){super();const e=this,r=new z;n.defineProperty(e,lo,{get:()=>r.writable}),e.contentType=t,e.$=kn(r.readable,t),e.$.catch(()=>{})}getData(){return this.$}}class Ro extends Eo{constructor(t){super(new y([t],{type:"text/plain"}))}}function xo(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 zo extends bo{constructor(t){super(),n.assign(this,{encoding:t,et:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,et: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 Fo extends po{constructor(t,e){super(),Ao(this,t,e)}async init(){await Io(this,Po,Mo),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:o}=e;if((n||r)&&o!==dt){const{offset:n=0,size:r=o-n}=t||{};if(r>0&&n<o)return function(t,e,n){let r,o=e,i=0,a=n;return new F({start:()=>c(),async pull(t){r||await c();const{value:e,done:n}=await r.read();if(n)throw new f(to);const o=e.length>i?e.subarray(0,i):e;i-=o.length,a-=o.length,o.length&&t.enqueue(o),i||(await async function(){const t=r;r=dt,await t.cancel()}(),a||t.close())},cancel:t=>r&&r.cancel(t)});async function c(){const e=s.min(t.maximumRangeSize,a),n=await Po(ao,t,Uo(t,o,e));if(206!=n.status)throw new f(to);const c=To(n);if(c!==dt&&c!=o)throw new f(to);No(t,n),_o(t,n),o+=e,i=e,r=n.body.getReader()}}(e,n,s.min(r,o-n))}return super.createReadable(t)}readUint8Array(t,e){return Co(this,t,e,Po,Mo)}}class Do extends po{constructor(t,e){super(),Ao(this,t,e)}async init(){await Io(this,Zo,Lo),super.init()}readUint8Array(t,e){return Co(this,t,e,Zo,Lo)}}function Ao(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=uo,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 Io(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(ao,t,Uo(t,a?-65557:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==co))throw new f(to);{let o;a&&206==r.status&&(o=new w(await r.arrayBuffer())),_o(t,r);const i=ko(r);i===dt?await Wo(t,e,n):t.size=i,o&&o.length&&To(r)===t.size-o.length&&(t.nt=o)}}else await Wo(t,e,n)}async function Co(t,e,n,r,o){const{useRangeHeader:i,forceRangeRequests:s,nt:a,size:c,options:u}=t;if(i||s){if(e>=c||0===n)return gt;{if(e+n>c&&(n=c-e),a&&e>=c-a.length){const t=e-(c-a.length);return a.slice(t,t+n)}const o=await r(ao,t,Uo(t,e,n));if(206!=o.status)throw new f(to);const i=To(o);if(i!==dt&&i!=e)throw new f(to);No(t,o),_o(t,o);const s=new w(await o.arrayBuffer());if(s.length!=n)throw new f(to);return s}}{const{data:r}=t;return r||await o(t,u),t.data.subarray(e,e+n)}}function To(t){const e=t.headers.get(io);if(e){const t=o(e.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t))return t}}function ko(t){const e=t.headers.get(io);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function vo({headers:t}){return{ot:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function _o(t,e){const{checkResourceChanges:n,it:r}=t;n&&!r&&206==e.status&&(t.it=vo(e))}function No(t,e){const{checkResourceChanges:r,it:o,size:i}=t;if(r){const t=ko(e);if(t!==dt&&i!==dt&&t!=i)throw new f(eo);if(o){const t=vo(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(eo)}}}function Uo(t,e=0,r=1){return n.assign({},Oo(t),{[so]:co+"="+(e<0?e:e+"-"+(e+r-1))})}function Oo({options:t}){const{headers:e}=t;if(e)return k.iterator in e?n.fromEntries(e):e}async function Mo(t){await Bo(t,Po)}async function Lo(t){await Bo(t,Zo)}async function Bo(t,e){const n=await e(ao,t,Oo(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function Wo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,Oo(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function Po(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(to):new f($r+(s.statusText||s.status))}function Zo(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(to):new f($r+(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 Ho extends po{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Do(t,e):new Fo(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 Vo extends po{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{st:t,size:t.length})}readUint8Array(t,e){return this.st.slice(t,t+e)}}class Go extends ho{constructor(t){super(),this.ct=t||262144}init(t=0){n.assign(this,{offset:0,st:new w(t>0?t:this.ct)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.st.length){let t=e.st.length?2*e.st.length:e.ct;for(;t<n;)t*=2;const r=e.st;e.st=new w(t),e.st.set(r)}e.st.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.st.length?this.st:this.st.slice(0,this.offset)}}class jo extends po{constructor(t){super(),this.ut=t}async init(){const t=this;t.lt=0;const e=t.ut=await g.all(t.ut.map(Qo));t.ft=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}wt(t){const{ft:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{ut: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 $o(c,a,e);else{const i=r-a;o=Se(await $o(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=gt;return n.lt=s.max(i,n.lt),o}}class qo extends wo{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===fo)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(no);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,lo,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(fo)}finally{t.releaseLock()}}}class Yo{constructor(t){return e.isArray(t)&&(t=new jo(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:Tn(t)}),t}}class Ko{constructor(t){t.writable===dt&&typeof t.next==pt&&(t=new qo(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:vn(t)});try{t.size=t.size===dt?0:t.size}catch{throw new f(oo)}return t}}function Xo(t){return Boolean(t&&t.getData)}async function Jo(t,e){if(!t.init||t.initialized)return g.resolve();await t.init(e)}async function Qo(t){return t=new Yo(t),await Jo(t),t.size!==dt&&t.readUint8Array||(t=new Eo(await kn(t.readable)),await Jo(t)),t}function $o(t,e,n){return t.readUint8Array(e,n)}function ti(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?po.prototype.createReadable.call(t,e):t.readable}function ei(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}const ni="filename",ri="rawFilename",oi="comment",ii="rawComment",si="uncompressedSize",ai="compressedSize",ci="offset",ui="diskNumberStart",li="lastModDate",di="rawLastModDate",fi="lastAccessDate",wi="rawLastAccessDate",pi="creationDate",hi="rawCreationDate",mi="internalFileAttributes",yi="externalFileAttributes",gi="msdosAttributesRaw",Si="msdosAttributes",Ei="msDosCompatible",bi="zip64",Ri="encrypted",xi="version",zi="versionMadeBy",Fi="zipCrypto",Di="directory",Ai="executable",Ii="compressionMethod",Ci="signature",Ti="extraField",ki="unixMode",vi="setuid",_i="setgid",Ni="sticky",Ui=[ni,ri,si,ai,li,di,oi,ii,fi,wi,pi,hi,ci,ui,mi,yi,gi,Si,Ei,bi,Ri,xi,zi,Fi,Di,Ai,"symlink",Ii,Ci,"crc32",Ti,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",ki,"unixExternalUpper",vi,_i,Ni,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Oi{constructor(t){Ui.forEach(e=>this[e]=t[e])}}const Mi=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);function Li(t,e,n){return t?e?12:16+4*n:0}const Bi="File format is not recognized",Wi="End of central directory not found",Pi="End of Zip64 central directory locator not found",Zi="Central directory header not found",Hi="Local file header not found",Vi="Zip64 extra field not found",Gi="File contains encrypted entry",ji="Encryption method not supported",qi="Split zip file",Yi="Overlapping entry found",Ki="Entry data out of bounds",Xi="Ambiguous archive",Ji="Encrypted central directory is not supported",Qi="Unsafe filename",$i="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",ts="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",es="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",ns="64-bit value exceeds Number.MAX_SAFE_INTEGER",rs="unsorted central directory",os="unknown version needed to extract",is="compressed patched data",ss="malformed extra field",as="unknown zip64 extensible data",cs="wrapped entries count",us="appended data",ls="prepended data",ds="prepended central directory",fs="trailing central directory data",ws="duplicate filename",ps="mismatched zip64 end of central directory record",hs="multiple end of central directory records",ms="mismatched local file header (filename)",ys="mismatched local file header (general purpose bit flag)",gs="mismatched local file header (compression method)",Ss="mismatched local file header (crc32 or sizes)",Es=/^[a-zA-Z]:/,bs="utf-8",Rs="cp437",xs=[[si,O],[ai,O],[ci,O],[ui,M]],zs={[M]:{ht:aa,bytes:4},[O]:{ht:ca,bytes:8}},Fs=i(o.MAX_SAFE_INTEGER);class Ds{constructor(t,e={}){n.assign(this,{reader:new Yo(t),options:e,yt:{gt:new u,St:[],Et:[]}})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await Jo(r),r.size!==dt&&r.readUint8Array||(r=new Eo(await kn(r.readable)),await Jo(r)),r.size<Y)throw new f(Bi);const o=e.warnings=[],i=Vs(t,e.options),a=i==Lt,c=i!=Wt,l=qs(ea(e,t,_t),i),d=function(t,e){if(t===dt)return e;if(!Hs(t))throw new f(ts);return t}(ea(e,t,"filenameValidation"),i),w=ea(e,t,"normalizeFilename"),{bt:p,Rt:h}=await Ys(r,c,l);if(!p)throw await async function(t){return await Zs(t)==W}(r)?new f(qi):new f(Wi);c&&h>1&&ta(hs);const m=be(p);let y=aa(m,12),g=aa(m,16);const S=p.offset,E=sa(m,20),b=S+Y+E,R=r.size-b;R>l&&ta(us),R>0&&ei(o,us);let x=sa(m,4);const F=r.lt||0;let D,A,I,C,T,k=sa(m,6),v=sa(m,10),_=0,N=X;const U=g==O||y==O||v==M||k==M;if(g!=O&&k!=M&&(g+=Ps(r,k)),U){const t=p.offset>=K?await $o(r,p.offset-K,K):gt,e=be(t);if(t.length==K&&aa(e,0)==j){g=Ps(r,aa(e,4))+ca(e,8);let t=await $o(r,g,X),i=be(t);const c=p.offset-K-X;if((t.length<X||aa(i,0)!=G)&&g!=c&&c>=0){const e=g;g=c,g>e&&(_=g-e),t=await $o(r,g,X),i=be(t)}if(t.length<X||aa(i,0)!=G)throw new f(Pi);if(I=!0,C=ca(i,4)>44,C){const t=s.min(ca(i,4)-44,r.size-g-X);t>0&&(N+=t,T=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=be(t),o=sa(r,26);n.assign(e,{compressionMethod:sa(r,0),compressedSize:ca(r,2),uncompressedSize:ca(r,10),encryptionAlgorithm:sa(r,18),bitLength:sa(r,20),flags:sa(r,22),hashAlgorithm:sa(r,24),hashData:t.subarray(28,28+o)})}return e}(await $o(r,g+X,t)))}x==M?x=aa(i,16):x!=aa(i,16)&&$s(a,o,ps),k==M?k=aa(i,20):k!=aa(i,20)&&$s(a,o,ps),v==M?v=ca(i,32):v!=ca(i,32)&&$s(a,o,ps),y==O?y=ca(i,40):y!=ca(i,40)&&$s(a,o,ps),g=Ps(r,k)+ca(i,48)+_}}let B=y;const P=p.offset-(I?N+K:0);if(g>=r.size&&(_=r.size-g-y-Y,g=r.size-y-Y),F!=x)throw new f(qi);if(g<0)throw new f(Bi);let Z=0,V=await $o(r,g,y),J=be(V);if(y){if(V.length<4)throw new f(Bi);const t=P-y;if(g!=t&&k==x){const e=aa(J,Z)==H||Boolean(T&&T.compressedSize)||Ts(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=aa(be(await $o(r,t,4)),0)==H),n){const n=g;g=t,g>n&&(_+=g-n,D=e),V=await $o(r,g,y),J=be(V)}}}const Q=P-g;if(y!=Q&&Q>=0&&k==x&&(y=Q,V=await $o(r,g,y),J=be(V)),g<0||g>=r.size)throw new f(Bi);e.directoryOffset=g,e.directoryLength=B;const $=na(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&aa(J,0)!=H&&(C||Ts(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=be(V),B=V.length,tt=!0}T&&!tt&&(V.length<4||aa(J,0)==H)&&ei(o,as),A=g;const nt=ea(e,t,"filenameEncoding"),ct=ea(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!I;!v&&wt&&(v=ks(J,V,Z),v&&ei(o,cs));for(let i=0;i<v;i++){const a=new Cs(r,e.options);if(Z+q>V.length||aa(J,Z)!=H){if(0==i&&!tt&&(C||Ts(J)))throw new f(Ji);throw new f(Zi)}_s(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=sa(J,Z+4),m=!(h>>8),y=h>>8==3,g=V.subarray(u,l),S=sa(J,Z+32),E=p+S,b=V.subarray(p,E),R=c,x=c,F=aa(J,Z+38),D=F&L,I={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},T=aa(J,Z+42),k=na(e,t,"decodeText")||Jr,N=R?bs:nt||Rs,U=x?bs:ct||Rs;let O=k(g,N,Ot);if(O===dt&&(O=Jr(g,N)),w){const t=w(O);t!==dt&&(O=t)}if(js(O,d)){const t=new f(Qi);throw t.filename=O,t}let B=k(b,U,Mt);B===dt&&(B=Jr(b,U)),n.assign(a,{index:i,xt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,zt:S,offset:T,diskNumberStart:sa(J,Z+34),internalFileAttributes:sa(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:I,rawFilename:g,filenameUTF8:R,commentUTF8:x,rawExtraField:V.subarray(l,p),rawComment:b,filename:O,comment:B}),Ns(a,a,J,Z+6)&&ei(o,ss,O),a.offset+=_;const W=Ps(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&ei(o,rs,O),ft=W,(a.version&L)>63&&ei(o,os,O),32&~a.rawBitFlag||ei(o,is,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),Y=Boolean(512&a.unixMode),K=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!K&&(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:Y,symlink:K,unixExternalUpper:P,executable:X,directory:Q||$||m&&I.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new Oi(a);if(et.getData=(t,n)=>a.getData(t,et,e.yt,n),et.arrayBuffer=async t=>{const r=new z,o=kn(r.readable).then(t=>t.arrayBuffer());return o.catch(()=>{}),await a.getData(r,et,e.yt,n.assign({},t,{preventClose:!1})),o},Z=E,i==v-1&&wt){const t=ks(J,V,Z);t&&(v+=t,ei(o,cs))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new Oi(a))}catch{}yield et}let pt=Z,ht=vs(V.subarray(Z))||(tt?vs(et):dt);if(!ht&&!tt){const t=g+Z,e=s.min(P-t,65541);e>=6&&(ht=vs(await $o(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&$s(a,o,fs),lt&&$s(a,o,ws);const mt=ea(e,t,"extractPrependedData"),yt=ea(e,t,"extractAppendedData"),St=(a||mt)&&v&&4==A&&await async function(t){const e=await Zs(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>St)&&ta(ls),(_||v&&A>4)&&ei(o,ls),D&&ei(o,ds),mt&&(e.prependedData=A>St?await $o(r,St,A-St):gt),e.comment=E?await $o(r,S+Y,E):gt,yt&&(e.appendedData=b<r.size?await $o(r,b,r.size-b):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 As{constructor(t={}){let r;const{readable:o,writable:i}=new z({start(t){r=t}}),s=new Ds(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 Is(t,e={}){if(t=new Yo(t),await Jo(t),t.size!==dt&&t.readUint8Array||(t=new Eo(await kn(t.readable)),await Jo(t)),t.size<Y)return!1;const n=Vs(e,{}),r=n!=Wt,o=qs(e[_t],n),{bt:i,Rt:s}=await Ys(t,r,o);if(!i||n==Lt&&s>1)return!1;const a=sa(be(i),20),c=i.offset+Y+a;return t.size-c<=o}let Cs=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:E,compressedSize:b}=i,{dataDescriptor:R}=m,x=e.localDirectory={},z=e.warnings=[],F=Ps(c,d)+l,A=await $o(c,F,ct),I=be(A);let C=ea(i,o,Et),T=ea(i,o,bt);const k=Jt(ea(i,o,Rt)),v=Boolean(k),_=!0===k;if(Xt(C,T),C=C&&C.length&&C,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw new f(On);if(A.length<ct||aa(I,0)!=B)throw new f(Hi);_s(x,I,4);const{extraFieldLength:N,filenameLength:U}=x,O=x.dataOffset=F+ct+U+N,M=ea(i,o,"checkLocalDirectory"),W=Vs(o,i.options),Z=function(t,e){return t===dt?e!=Wt:Boolean(t)}(M,W),H=ea(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 $o(c,F+ct,U+N);G=t.subarray(0,U),x.rawExtraField=t.subarray(U)}else x.rawExtraField=N?await $o(c,F+ct+U,N):gt;V&&(x.rawFilename=G),Ns(i,x,I,4,!0)&&ei(z,ss),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.xt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||$s(s,o,ms),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&$s(s,o,ys),e.compressionMethod!=t.compressionMethod&&$s(s,o,gs),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||$s(s,o,Ss)}(i,x,G,V,Z?dt:z);const{lastAccessDate:j,creationDate:q,uid:Y,gid:K}=x;j&&(e.lastAccessDate=j),q&&(e.creationDate=q),Y!==dt&&e.uid===dt&&(e.uid=Y),K!==dt&&e.gid===dt&&(e.gid=K);const X=ea(i,o,"checkPasswordOnly"),J=i.encrypted&&x.encrypted&&(!_||X),Q=J&&!w;if(_||(e.zipCrypto=Q),J&&!(64&~x.rawBitFlag))throw new f(ji);const $=v?dt:Wn(h);if(0!=h&&8!=h&&9!=h&&!$&&!v)throw new f(On);if(J){if(!Q&&(w.strength<1||w.strength>3))throw new f(ji);if(!C&&!T)throw new f(Gi)}if(O+b>c.size)throw new f(Ki);const tt=b,et=Yt(ea(i,o,xt));Kt(et);let nt=ea(i,o,"checkOverlappingEntry");const rt=ea(i,o,"checkOverlappingEntryOnly");rt&&(nt=!0);const{onstart:ot,onprogress:it,onend:st}=o,at=0!=h&&!v,ut=v?b-Li(J,Q,w&&w.strength):E,lt=9==h;let ft=ea(i,o,Ft);lt&&(ft=!1);const wt=ea(i,o,"checkCrc32"),pt=(wt===dt?ea(i,o,"checkSignature"):wt)&&!v&&(!J||Q||w&&1==w.vendorVersion),ht={options:{codecType:lr,password:C,rawPassword:T,zipCrypto:Q,encryptionStrength:w&&w.strength,checkCrc32:pt,checkAuthenticationCode:ea(i,o,"checkAuthenticationCode"),passwordVerification:Q&&(R?S>>>8&L:g>>>24&L),outputSize:ut,crc32:g,compressed:at,encrypted:J,useWebWorkers:ea(i,o,zt),useCompressionStream:ft,transferStreams:ea(i,o,Dt),deflate64:lt,format:$?$.format:dt,codecURI:$?$.codecURI:dt,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:X},config:a,D:{signal:et,size:tt,onstart:ot,onprogress:it,onend:st}};let mt,yt,St;nt&&await async function({reader:t,Ft:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,yt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await $o(t,a+i,d+4),r=be(n);let c=n.length==d+4&&aa(r,0)==P;if(c){const t=Ws(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=Ws(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,Ft:e},{gt:p,St:h,Et:m}=l;if(!p.has(n)){const t=function(t,e){let n=0,r=t.length;for(;n<r;){const o=n+r>>>1;t[o].start<e.start?n=o+1:r=o}const o=t[n-1],i=t[n];return o&&Bs(e,o)?o:i&&Bs(e,i)?i:void 0}(h,w)||m.find(t=>Bs(w,t));if(t){const e=new f(Yi);throw e.overlappingEntry=t.Ft,e}p.add(n),m.push(w),m.length*m.length>h.length&&(m.sort((t,e)=>t.start-e.start),l.St=function(t,e){const n=[];let r=0,o=0;for(;r<t.length||o<e.length;)o==e.length||r<t.length&&t[r].start<e[o].start?n.push(t[r++]):n.push(e[o++]);return n}(h,m),m.length=0)}}({reader:c,Ft:e,index:u,offset:F,crc32:g,compressedSize:b,uncompressedSize:E,dataOffset:O,dataDescriptor:R||x.bitFlag.dataDescriptor,extraFieldZip64:p||x.extraFieldZip64,yt:r});try{if(!rt){X&&(t=new D),t=new Ko(t),await Jo(t,function(t,e,n){return s.min(t,n?1032*e:e)}(ut,b,at)),({writable:mt}=t);const e=Tn(c.createReadable({offset:O,size:tt})),{outputSize:r}=await Vr({readable:e,writable:mt},ht);if(r!=ut)throw n.assign(new f(Vn),{outputSize:r});t.size+=r}}catch(e){const{outputSize:n}=ht;if(n!==dt?t.size+=n:Re(e)&&e.outputSize!==dt&&(t.size+=e.outputSize),!X||!Re(e)||e.message!=$e)throw yt=e,St=!0,e}finally{if((Xo(t)||!ea(i,o,At))&&mt&&!mt.locked){const t=mt.getWriter();if(St)try{await t.abort(yt)}catch{}else await t.close()}}return X||rt?dt:t.getData?t.getData():mt}};function Ts(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==aa(t,n))return!0;return!1}function ks(t,e,n){let r=0;for(;n+q<=e.length&&aa(t,n)==H;)n+=q+sa(t,n+28)+sa(t,n+30)+sa(t,n+32),r++;return r%65536?0:r}function vs(t){if(t.length>=6){const e=be(t);if(aa(e,0)==Z){const n=sa(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function _s(t,e,r){const o=t.rawBitFlag=sa(e,r+2),i=!(1&~o),s=aa(e,r+6);n.assign(t,{encrypted:i,version:sa(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:ra(s),filenameLength:sa(e,r+22),extraFieldLength:sa(e,r+24)})}function Ns(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=be(s);let d=0,w=!1;try{for(;d<s.length;){const t=sa(l,d),e=sa(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=sa(r,o+4);n.assign(e,{signature:aa(r,o+10),crc32:aa(r,o+10),compressedSize:aa(r,o+14),uncompressedSize:aa(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=be(t.data),r=xs.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+zs[e].bytes,0);if(t.data.length<o)throw new f(Vi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=zs[a];e[s]=t[s]=c.ht(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(Us(m,ni,ri,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(Us(y,oi,ii,e,t),e.extraFieldUnicodeComment=y);const g=u.get(J);g&&g.data.length>=7?(function(t,e,r){const o=be(t.data),i=ia(o,4);n.assign(t,{vendorVersion:ia(o,0),vendorId:ia(o,2),strength:i,originalCompressionMethod:r,compressionMethod:sa(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&&(Os(S,e),e.extraFieldPkwareUnix=S);const E=u.get(22613);E&&(Os(E,e),e.extraFieldUnixType1=E);const b=u.get(10);b&&(function(t,e){const r=be(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=sa(r,i),n=sa(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=be(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:oa(i),lastAccessDate:oa(s),creationDate:oa(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(b,e),e.extraFieldNTFS=b);const R=u.get(et);let x;if(R&&(x=Ms(R,e,!1),e.extraFieldUnix=R),!x){const t=u.get(tt);t&&(Ms(t,e,!0),e.extraFieldInfoZip=t)}const z=u.get(Q);z&&(function(t,e,n){if(!t.data.length)return;const r=be(t.data),o=ia(r,0),i=[],s=[];n?(1&~o||(i.push(li),s.push(di)),2&~o||(i.push(fi),s.push(wi)),4&~o||(i.push(pi),s.push(hi))):t.data.length>=5&&(i.push(li),s.push(di));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=aa(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 Us(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=be(t.data),a=new ve;a.append(i[r]);const c=be(new w(4));c.setUint32(0,a.get(),!0);const u=aa(s,1),l=ia(s,0);n.assign(t,{version:l,[e]:Jr(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==aa(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function Os(t,e){if(t.data.length<8)return;const r=be(t.data),o={lastAccessDate:new a(1e3*(0|aa(r,0))),lastModDate:new a(1e3*(0|aa(r,4)))};t.data.length>=12&&(o.uid=sa(r,8),o.gid=sa(r,10)),n.assign(t,o),n.assign(e,o)}function Ms(t,e,r){try{const o=be(t.data);let i,s;if(r){let e=0;const r=ia(o,e++),a=ia(o,e++);i=Ls(t.data.subarray(e,e+a)),e+=a;const c=ia(o,e++);s=Ls(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=sa(o,0),s=sa(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 Ls(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Bs(t,e){return t.start<e.end&&e.start<t.end}function Ws(t,e,n){const r=aa(t,e);let o,i;return n?(o=ca(t,e+4),i=ca(t,e+12)):(o=aa(t,e+4),i=aa(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Ps(t,e){return t.wt?t.wt(e):0}async function Zs(t){return aa(be(await $o(t,0,4)))}function Hs(t){return t===Lt||t===Bt||t===Wt}function Vs(t,e){return Gs(t,Gs(e,Bt))}function Gs(t,e){const n=t.strictness;if(n!==dt){if(!Hs(n))throw new f($i);return n}const r=t.checkAmbiguity;return r===dt?e:r?Lt:e==Wt?Wt:Bt}function js(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("\\\\")||Es.test(t))||e==Lt&&(n.includes(".")||n.includes(""))}function qs(t,e){if(t!==dt){const e=te(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(es);return e}return e==Lt?0:e==Wt?1/0:M}async function Ys(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 Ks(t,o)){const o=sa(n,d+20);if(f+Y+o==r){const o=await Js(t,n,s,d,f,r,i);if(2==o){if(a||(a=Xs(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Xs(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 Ks(t,o)){const o=Xs(c,u,l);i||(i=o);const d=await Js(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{bt:a,Rt:u}}async function*Ks(t,e){const n=t.size-e,r=await $o(t,n,e),o=be(r);for(let t=r.length-Y;t>=0;t--)aa(o,t)==V&&(yield[o,n,r,t,n+t])}function Xs(t,e,n){return{offset:n,buffer:t.slice(e,e+Y).buffer}}async function Js(t,e,n,r,o,i,s){const a=sa(e,r+10),c=aa(e,r+12),u=aa(e,r+16);if(a==M||c==O||u==O)return await Qs(t,e,n,o-K,i,s)==j?2:0;if(!a&&!c)return 1;const l=sa(e,r+6);for(const r of[o-c,Ps(t,l)+u])if(await Qs(t,e,n,r,i,s)==H)return 2;return 0}async function Qs(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?aa(e,r-n):i.count>0?(i.count--,aa(be(await $o(t,r,4)),0)):dt}function $s(t,e,n){t?ta(n):ei(e,n)}function ta(t){const e=new f(Xi);throw e.reason=t,e}function ea(t,e,n){return e[n]===dt?t.options[n]:e[n]}function na(t,e,n){return qt(ea(t,e,n))}function ra(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 oa(t){return new a(o(t/i(1e4)-i(116444736e5)))}function ia(t,e){return t.getUint8(e)}function sa(t,e){return t.getUint16(e,!0)}function aa(t,e){return t.getUint32(e,!0)}function ca(t,e){const n=t.getBigUint64(e,!0);if(n>Fs)throw new f(ns);return o(n)}var ua=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Xi,ERR_BAD_FORMAT:Bi,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Zi,ERR_ENCRYPTED:Gi,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Ji,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Ki,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Pi,ERR_EOCDR_NOT_FOUND:Wi,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Vi,ERR_INVALID_AUTHENTICATION_CODE:Qe,ERR_INVALID_COMPRESSED_DATA:Gn,ERR_INVALID_CRC32:jn,ERR_INVALID_FILENAME_VALIDATION:ts,ERR_INVALID_MAX_APPENDED_DATA_SIZE:es,ERR_INVALID_PASSWORD:Je,ERR_INVALID_STRICTNESS:$i,ERR_INVALID_UNCOMPRESSED_SIZE:Vn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Hi,ERR_OVERLAPPING_ENTRY:Yi,ERR_SPLIT_ZIP_FILE:qi,ERR_UNSAFE_FILENAME:Qi,ERR_UNSUPPORTED_COMPRESSION:On,ERR_UNSUPPORTED_ENCRYPTION:ji,ERR_UNSUPPORTED_UINT64:ns,ERR_WORKER_STARTUP_TIMEOUT:wr,WARNING_APPENDED_DATA:us,WARNING_COMPRESSED_PATCHED_DATA:is,WARNING_DUPLICATE_FILENAME:ws,WARNING_MALFORMED_EXTRA_FIELD:ss,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:ys,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:gs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:Ss,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:ms,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:ps,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:hs,WARNING_PREPENDED_CENTRAL_DIRECTORY:ds,WARNING_PREPENDED_DATA:ls,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:fs,WARNING_UNKNOWN_VERSION:os,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:as,WARNING_UNSORTED_CENTRAL_DIRECTORY:rs,WARNING_WRAPPED_ENTRIES_COUNT:cs,ZipReader:Ds,ZipReaderStream:As,isZipFile:Is});const la="File already exists",da="Zip file comment exceeds 64KB",fa="Invalid zip file comment (must be a Uint8Array)",wa="File entry comment exceeds 64KB",pa="Invalid file entry comment (must be a string)",ha="Invalid date (must be a valid Date instance)",ma="File entry name exceeds 64KB",ya="Version exceeds 65535",ga="The strength must equal 1, 2, or 3",Sa="Encryption is not supported in USDZ files",Ea="Split zip files are not supported in USDZ files",ba="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",Ra="Invalid extra field (must be a Map)",xa="Invalid extra field type (must be integer 0..65535)",za="Invalid extra field data (must be a Uint8Array)",Fa="Extra field data exceeds 64KB",Da=-2147483648,Aa=2147483647,Ia=i(0),Ca=i("0x7fffffffffffffff"),Ta="Zip64 is not supported (set the 'zip64' option to 'true')",ka="Undefined uncompressed size",va="Undefined compression method",_a="Undefined CRC32",Na="Undetermined size",Ua="Undefined reader",Oa="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",Ma="Zip file not empty",La="Invalid uid (must be integer 0..2^32-1)",Ba="Invalid gid (must be integer 0..2^32-1)",Wa="Invalid UNIX mode (must be integer 0..65535)",Pa="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Za="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Ha="Invalid msdosAttributesRaw (must be integer 0..255)",Va="Invalid msdosAttributes (must be an object with boolean flags)",Ga="Invalid level (must be integer 0..9)",ja="Signature data exceeds 64KB",qa="Invalid entry option (must be an entry returned by ZipReader#getEntries())",Ya="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Ka="compression unavailable",Xa="clamped last modification date",Ja=new w([7,0,2,0,65,69,3,0,0]),Qa="infozip",$a="unix",tc=[8,9,5,3];let ec=0;const nc=[];class rc{constructor(t,e={}){t=new Ko(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(Ea);n.assign(this,{writer:t,Dt:i,options:e,At:new c,It:new u,offset:e[kt]===dt?t.size||t.writable.size||0:e[kt],Ct:e[kt]===dt?0:e[kt]-(t.size||t.writable.size||0),Tt:new u,kt:[],warnings:[],vt:0,_t:0,Nt:dt,Ut:!1})}prependZip(t){return sc(this,async function(t,e){if(t.It.size)throw new f(Ma);await t.Ot(e)}(this,t))}appendZip(t){return sc(this,this.Ot(t))}async Ot(t){const r=this,{Tt:o,It:i,At: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 Yo(t),await Jo(t),t.size!==dt&&t.readUint8Array||(t=new Eo(await kn(t.readable)),await Jo(t));const{ZipReader:o}=await g.resolve().then(function(){return ua}),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(la);i.add(t),l.push(t)}),r.Mt=!0;const{Lt:p}=r;r.Lt=new g(t=>d=()=>{r.Mt=!1,t()}),await p,r.Dt&&(delete r.Dt,await async function(t){return be(await $o(t,0,4)).getUint32(0,!0)==W}(t)||(await kc(r.writer,Cc()),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)=>Ic(n,t)-Ic(n,e));let c=0;for(const e of a){const r=Ic(n,e);await Dc(t,n,c,r-c),xc(i,await Ac(n,r))&&await i.closeDisk(),s.set(e,{offset:zc(t,i),diskNumberStart:bc(i)}),c=r}await Dc(t,n,c,o-c)}else{const e=t.offset;await Dc(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Ic(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=Fc(f||gt),t.extraFieldAES&&(d=99);const y=qc(f),g=Boolean(l)&&l.uncompressedSize!==dt,S=Boolean(l)&&l.compressedSize!==dt,E=-7&Xc(w,p,m,a,d)|w<<1,{Bt:b,Wt:R}=Yc({version:e,bitFlag:E,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,Pt:S,Zt:g,extraFieldLength:y}),{crc32:x}=t;x!==dt&&Vc(R,10,x);const{offset:z,diskNumberStart:F}=h.get(t);n.assign(t,{Ht:!0,Zt:g,Pt:S,offset:z,diskNumberStart:F,Vt:!1,Gt:gt,jt:gt,qt:gt,Yt:gt,Kt:gt,rawExtraField:f,Xt:gt,Bt:b,Wt:R}),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,{Tt:s}=o,a=async function(t,e,r,o){const s=(o=n.assign({},o))[Ut];if(s!==dt){const{Jt:e,Qt:r}=uc(s,Jt(Oc(t,o,Rt)),Oc(t,o,li));delete o[Ut],o=n.assign(e,r,o)}if(Oc(t,o,Di)&&!e.endsWith(at)&&(e+=at),t.It.has(e))throw new f(la);t.It.add(e),ec<we().maxWorkers?ec++:await new g(t=>nc.push(t));try{return await async function(t,e,r,o){const s=lc(t,e,o);({name:e}=s);const a=dc(t,e,o),{comment:c}=a,u=o[Ti];t.At.set(e,dt);const l=t.Nt,d={};let w,p;a.$t.keepOrder&&(d.te=new g(t=>w=t)),t.Nt=d;try{const{$t:c}=a;0==c.level||c.compressionMethod!==dt||c.ee||await gr(we())||(c.level=0,ei(t.warnings,Ka,e));const u=await async function(t,e,{$t:r},o){if(r.ee&&!e&&!Oc(t,o,Di))throw new f(Ua);let i;if(e){if(e=new Yo(e),await Jo(e),!e.readable&&!e.readUint8Array)throw new f(Oa);({size:i}=e)}return n.assign({reader:e},wc(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=Rc(t.writer),m=bc(t.writer);let y=o.crc32===dt?o[Ci]:o.crc32;const S=u.$t.encrypted&&!c.zipCrypto;if(c.ee&&!c.ne&&S&&(y=dt),c.ee&&r&&!S&&y===dt)throw new f(_a);const E=hc(o=n.assign({},o,s.$t,a.$t,u.$t,{signature:o[Ci],crc32:y,offset:t.offset-h,diskNumberStart:m,[vt]:t.options[vt]}));E.re&&ei(t.warnings,Xa,e);const b=gc(o),R=qc(E.oe,b.ie);p=await async function(t,e,r,o,s){const{At:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,se:d,signal:w}=s,{ae:p,Ft:h,ce:m,ue:y}=o,S=t.options[vt];let E,b,R,x,F,D,A,I=h,C=0;const T=u&&m?m.te:dt;a.set(e,I);try{s.bufferedWrite||!u||t.Mt||t.vt||t._t||!l&&!d?(E=!0,t.vt++,A=s.createTempStream?await s.createTempStream():new z(dt,dt,{highWaterMark:ft}),A.size=0,await Jo(c)):(b=!0,t._t++,A=c,await T,await k()),await Jo(A);const h=Rc(c);t.Dt&&!E&&await Tc(t,c),S&&!E&&mc(o,t.offset-h);const{oe:m}=p;E||await v();const y=bc(c),R=zc(t,c);if(I.diskNumberStart=y,E||(F=!0,D=c.size,await kc(A,m)),I=await async function(t,e,{diskNumberStart:r,te:o},s,a,c){const{ae:u,le:l,de:d}=s,{Bt:w,Wt:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:S,compressionMethod:E,Gt:b,fe:R,qt:x,we:z,pe:F,Yt:D,Kt:A,jt:I}=u,{ie:C}=l,{rawFilename:T,lastAccessDate:k,creationDate:v,password:_,rawPassword:N,level:U,useUnicodeFileNames:M,zip64:B,Ht:W,Zt:P,Pt:Z,zipCrypto:H,dataDescriptor:V,directory:G,executable:j,versionMadeBy:q,rawComment:Y,rawExtraField:K,Xt: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,ee:Et,ne:bt,format:Rt,codecURI:xt}=c,zt={te:o,versionMadeBy:q,zip64:B,Ht:W,directory:Boolean(G),executable:Boolean(j),filenameUTF8:Boolean(M),rawFilename:T,commentUTF8:Boolean(M),rawComment:Y,Gt:b,fe:R,qt:x,Yt:D,Kt:A,jt:I,rawExtraField:K,Xt: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;Et||(Dt=0);const{writable:It}=e;if(t){const n=t.size,r=Tn(ti(t,{size:n})),o={options:{codecType:ur,inputSize:n,level:U,rawPassword:N,password:_,encryptionStrength:rt,zipCrypto:y&&H,passwordVerification:y&&H&&m>>8&L,computeCrc32:!Et,compressed:g&&!Et,encrypted:y&&!bt,useWebWorkers:J,useCompressionStream:St,transferStreams:Q,format:Rt,codecURI:xt,compressionMethod:E},config:a,D:{signal:nt,size:n,onstart:$,onprogress:tt,onend:et}};try{const t=await Vr({readable:r,writable:It},o);if(At=t.outputSize,e.size+=At,Et||(Dt=t.inputSize,y&&!H||(Ft=t.crc32)),!Z&&At>=O||!P&&Dt>=O)throw new f(Ta)}catch(t){const{outputSize:n}=o;throw n!==dt?e.size+=n:Re(t)&&t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,ae:r,le:o},{zip64:s,zipCrypto:a,ee:c,dataDescriptor:u}){const{Wt:l,encrypted:d}=r,{he:f,me:w}=o;d&&!a&&!c||t===dt||(Vc(l,10,t),u&&Vc(f,w,t)),s?u&&(Gc(f,w+4,i(e)),Gc(f,w+12,i(n))):(Vc(l,14,e),Vc(l,18,n),u&&(Vc(f,w+4,e),Vc(f,w+8,n)))}({crc32:Ft,compressedSize:At,uncompressedSize:Dt,ae:u,le:l},c),V&&await kc(e,C),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:E,version:S,Bt:w,Wt:p,signature:Ft,crc32:!y||H||Et?Ft:dt,we:z,pe:F,Zt:P,Pt:Z}),zt}(r,A,I,o,we(),s),E||(F=!1),a.set(e,I),I.filename=e,E){if(await g.all([A.writable.getWriter().close(),T]),await k(),t.Dt&&await Tc(t,c),x=!0,D=c.size,await v(),I.diskNumberStart=bc(c),I.offset=zc(t,c),S){const e=o.de;mc(o,t.offset-Rc(c)),I.size+=o.de-e}!function({rawFilename:t,encrypted:e,zip64:n,fe:r,crc32:o,compressedSize:s,uncompressedSize:a,Zt:c,Pt:u},l,{dataDescriptor:d,ee:f}){if(d||((!e||f&&o!==dt)&&Vc(l,14,o),u||Vc(l,18,s),c||Vc(l,22,a)),n&&r){const e=ct+qc(t)+4;Gc(l,e,i(a)),Gc(l,e+8,i(s))}}(I,p.ye,s),await kc(c,p.oe),await vc(A.readable,c,w,t=>C+=t),c.size+=A.size,x=!1}else I.diskNumberStart=y,I.offset=R;return t.offset+=I.size,I}catch(n){if(x||F){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-D,E&&(t.offset+=C)}throw a.delete(e),n}finally{if(E&&t.vt--,b&&t._t--,y&&y(T),R&&R(),E&&A&&A.dispose)try{await A.dispose()}catch{}}async function k(){t.Mt=!0;const{Lt:e}=t;t.Lt=new g(e=>R=()=>{t.Mt=!1,e()}),await e}async function v(){xc(c,qc(p.oe))&&await c.closeDisk()}}(t,e,r,{ae:E,le:b,de:R,Ft:d,ce:l,ue:w},o)}catch(n){throw t.At.delete(e),n}finally{w&&w(l&&l.te)}return n.assign(p,{name:e,comment:c,extraField:u}),new Oi(p)}(t,e,r,o)}catch(n){throw t.It.delete(e),n}finally{const t=nc.shift();t?t():ec--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return g.prototype.then.call(a,c,c),sc(o,a)}remove(t){const{It:e,At: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,{Tt:o,writer:s}=this,{writable:a}=s;if(r.Ut)return ic(s);if(!(t instanceof w))throw new f(fa);if(qc(t)>M)throw new f(da);for(;o.size;)await g.allSettled(e.from(o));await g.allSettled(r.kt.map(t=>t.ge));const c=r.kt.filter(t=>t.Se&&!t.Ee);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.Ee=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{be:o,Re:s}=Sc(t.At),{xe:a,ze:c,Fe:u}=await async function(t,n,r){const{At:o,writer:i}=t,s=new w(n);await Jo(i);let a=0,c=0,u=bc(i),l=Rc(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,Gt:w,jt:p,qt:h,Yt:m,Kt:y,rawExtraField:g,Xt:S,rawComment:E,versionMadeBy:b,Bt:R,Wt:x,Zt:z,Pt:F,Vt:D,De:A,internalFileAttributes:I,externalFileAttributes:C,diskNumberStart:T,uncompressedSize:k,compressedSize:v}=n,_=qc(w,p,h,m,y,g,S),N=q+qc(f,E)+_;xc(i,a+N-c)&&(await kc(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=bc(i),l=Rc(i)),z||Vc(x,18,k),F||Vc(x,14,v),(A||D)&&n.version<45&&Hc(x,0,45);const U=Ec(N);if(U.Ae(H),U.Ie(b),U.Ce(R.subarray(0,24)),U.Ie(_),U.Ie(qc(E)),U.Ie(D?M:T),U.Ie(I),U.Ae(C),U.Ae(A?O:e),U.Ce(f),U.Ce(w),U.Ce(p),U.Ce(h),U.Ce(m),U.Ce(y),U.Ce(g),U.Ce(S),U.Ce(E),jc(s,U.st,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new Oi(n))}catch{}}return await kc(i,c?s.slice(c):s),{xe:{diskNumber:u,diskOffset:l},ze:{diskNumber:bc(i),Te:d},Fe:s}}(t,o,r),l=await async function(t,e,n){const r=Lc(t,n,Nt);if(r){const n=await r(e),o=qc(n);if(o>M)throw new f(ja);const i=Ec(6+o);i.Ae(Z),i.Ie(o),i.Ce(n);const{writer:s}=t;return xc(s,qc(i.st))&&await s.closeDisk(),await kc(s,i.st),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{xe:s,ze:a,ke:c,Re:u}=r;let{be:l}=r,d=t.At.size,w=s.diskNumber,p=zc(t,s);const h=qc(e);if(h>M)throw new f(da);let m=Oc(t,n,bi),y=bc(o);if(xc(o,(m?98:Y)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(Ta);m=!0}else m===dt&&u&&(m=!0);const g=Ec(m?98:Y);xc(o,qc(g.st)+h)&&await o.closeDisk(),y=bc(o);let S=y==a.diskNumber?a.Te:0;m&&(g.Ae(G),g.ve(44),g.Ie(45),g.Ie(45),g.Ae(y),g.Ae(w),g.ve(S),g.ve(d),g.ve(l),g.ve(p),g.Ae(j),g.Ae(y),g.ve(i(zc(t,o))+i(l)+i(c)),g.Ae(y+1),Oc(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),S=M,d=M,p=O,l=O),g.Ae(V),g.Ie(y),g.Ie(w),g.Ie(S),g.Ie(d),g.Ae(l),g.Ae(p),g.Ie(h),await kc(o,g.st),h&&await kc(o,e)}(t,n,r,{xe:a,ze:c,be:o,ke:l,Re:s})}(r,t,n),r.Ut=!0,!Xo(s)&&Oc(r,n,At)||await a.getWriter().close(),ic(s)}[St](){return this.close()}}class oc extends g{then(t,e){const{_e:n}=this;return n&&(n.Ee=!0),super.then(t,e)}}function ic(t){return t.getData?t.getData():t.writable}function sc(t,e){const r=new oc((t,n)=>g.prototype.then.call(e,t,n)),o={};return r._e=o,o.ge=g.prototype.then.call(r,dt,t=>n.assign(o,{Se:!0,error:t})),t.kt.push(o),r}async function ac(t,e){try{await t.writer.writable.abort(e)}catch{}}function cc(t,e,n){t.Tt.add(e),e.catch(t=>{try{n(t)}catch{}})}function uc(t,r,o){if(null===t||typeof t!=ht||e.isArray(t))throw new f(qa);const{externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:g,crc32:S,compressionMethod:E,extraFieldAES:b,extraFieldUnix:R,internalFileAttributes:x,extraField:z,bitFlag:F,directory:D,uid:A,gid:I}=t,C={externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,creationDate:p,lastAccessDate:h,internalFileAttributes:x,directory:D};F&&F.languageEncodingFlag&&(C[Ct]=!0);const T=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{Mi.has(n)||e.set(n,t.data)}),e.size)return e}}(z);T&&(C[Ti]=T),A===dt&&I===dt||n.assign(C,{uid:A,gid:I,unixExtraFieldType:R?$a:Qa});const k={};if(r&&!D)if(n.assign(k,{uncompressedSize:m,crc32:S,compressionMethod:E}),r!==Pt&&n.assign(k,{encrypted:y,zipCrypto:g,encryptionStrength:b?b.strength:dt}),F&&(k.dataDescriptor=F.dataDescriptor,k[It]=tc[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(Ya);return{Jt:C,Qt:k}}function lc(t,n,r){let o=Oc(t,r,Ei),i=Oc(t,r,zi,o?20:768);const s=Oc(t,r,Ai),a=Bc(t,r,"uid"),c=Bc(t,r,"gid");let u=Bc(t,r,ki),l=Oc(t,r,"unixExtraFieldType"),d=Oc(t,r,vi),w=Oc(t,r,_i),p=Oc(t,r,Ni);if($t(a,O,La),$t(c,O,Ba),$t(u,M,Wa),l!==dt&&l!==Qa&&l!==$a)throw new f(Pa);if(l===$a&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Za);l!==dt||a===dt&&c===dt||(l=Qa);let h=Bc(t,r,gi),m=Oc(t,r,Si);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,Ha),m&&(typeof m!==ht||e.isArray(m)))throw new f(Va);if(i>M)throw new f(ya);let g=Oc(t,r,yi);const S=g!==dt;S||(g=0),!r[Di]&&n.endsWith(at)&&(r[Di]=!0);const E=Oc(t,r,Di);if(E?(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||(E?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 b=g>>16&M,R=u!==dt&&40960==(u&rt);return{name:n,$t:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:g,unixExternalUpper:b,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:R,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function dc(t,e,n){const r=Lc(t,n,"encodeText")||Ne;let i=r(e,Ot);if(i===dt&&(i=Ne(e)),qc(i)>M)throw new f(ma);const s=n[oi]||"";if(typeof s!=mt)throw new f(pa);let c=r(s,Mt);if(c===dt&&(c=Ne(s)),qc(c)>M)throw new f(wa);const u=Oc(t,n,xi);if(u!==dt&&u>M)throw new f(ya);const l=Mc(t,n,li,new a),d=Oc(t,n,di),w=Mc(t,n,fi),p=Mc(t,n,pi),h=Oc(t,n,mi,0),m=Jt(Oc(t,n,Rt)),y=Boolean(m),g=!0===m,S=Oc(t,n,Et),E=Oc(t,n,bt);Xt(S,E);const b=Bc(t,n,"encryptionStrength",3),R=Oc(t,n,Fi),x=Oc(t,n,"extendedTimestamp",!0),z=Oc(t,n,"ntfsTimestamp"),F=Oc(t,n,"keepOrder",!0),D=Oc(t,n,zt),A=Oc(t,n,Dt),I=Oc(t,n,"bufferedWrite"),C=Lc(t,n,"createTempStream"),T=Oc(t,n,"dataDescriptorSignature",!0),k=Yt(Oc(t,n,xt));Kt(k);const v=Oc(t,n,Ct,!Kc(i)||!Kc(c)),_=Oc(t,n,Ii),N=y||_===dt?dt:Wn(_);if(!y&&_!==dt&&0!==_&&8!==_&&!N)throw new f(On);let U=Bc(t,n,It);if($t(U,9,Ga),t.options[vt]){if(S!==dt||E!==dt)throw new f(Sa);U===dt&&_===dt&&(U=0)}y&&(U=te(n[It]));let O=Oc(t,n,Ft),L=Oc(t,n,Tt);I&&L===dt&&(L=!1),(L===dt||R&&!g)&&(L=!0),U!==dt&&6!=U&&(O=!1);const B=Oc(t,n,bi);if(!(R||S===dt&&E===dt||o.isInteger(b)&&b>=1&&b<=3))throw new f(ga);const W=fc(n[Ti]),P=fc(n.localExtraField),Z=fc(n.centralExtraField);return{comment:s,$t:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,ee:y,ne:g,password:S,rawPassword:E,encryptionStrength:b,zipCrypto:R,extendedTimestamp:x,ntfsTimestamp:z,keepOrder:F,useWebWorkers:D,transferStreams:A,bufferedWrite:I,createTempStream:C,dataDescriptorSignature:T,signal:k,useUnicodeFileNames:v,compressionMethod:_,format:N?N.format:dt,codecURI:N?N.codecURI:dt,Ne:N?N.versionNeeded:dt,level:U,useCompressionStream:O,dataDescriptor:L,zip64:B,rawExtraField:W,Ue:P,Xt:Z}}}function fc(t){if(!t)return gt;if(!(t instanceof c))throw new f(Ra);let e=0,n=0;t.forEach((t,n)=>{if(Qt(n,M,xa),!(t instanceof w))throw new f(za);if(qc(t)>M)throw new f(Fa);e+=4+qc(t)});const r=new w(e),o=be(r);return t.forEach((t,e)=>{Hc(o,n,e),Hc(o,n+2,qc(t)),jc(r,t,n+4),n+=4+qc(t)}),r}function wc(t,e,n,r,o){const{ee:i,ne: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[si],y===dt)throw new f(ka);if(h===dt)throw new f(va)}const S=!0===w,E=Oc(t,o,Ri);if(e&&s&&!E&&qc(c,u))throw new f(ba);const b=e&&(Boolean(c&&qc(c)||u&&qc(u))||s&&E);e||(p=0,h=0);const R=Li(b,a,l);e&&(i?(o.uncompressedSize=y,m=n===dt?Wc(y)+R:n+(s?0:R)):n===dt?(d=!0,(w||w===dt)&&(w=g=!0,m=4294967296)):(o.uncompressedSize=y=n,m=(Pc(h,p)?Wc(y):y)+R));const x=!(b||e&&(0!==n||i)||Pc(h,p));x&&Oc(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(Ta);w=!0}return w=w||!1,{Oe:m,$t:{dataDescriptor:d,se:x,zip64:w,Ht:S,Me:g,Zt:z,Pt:F,uncompressedSize:y,level:p,compressionMethod:h,encrypted:b}}}function pc(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 hc(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,Ue:m,encryptionStrength:y,extendedTimestamp:g,ntfsTimestamp:S,ee:E,encrypted:b,Zt:R,Pt:x,uncompressedSize:z,Me:F,crc32:D}=t;let{version:A,compressionMethod:I}=t;const C=!p&&Pc(I,c);let T;const k=E||!C,v=u&&(t.bufferedWrite||!w||!R&&!x||k&&!F),_=v||u&&w&&(R||x);if(u&&(R||x)){const t=20,e=Ec(t);if(e.Ie(1),e.Ie(t-4),T=e.st,v&&(e.ve(z),k)){const t=Li(b,l,y);e.ve(E?0:z+t)}}else T=gt;let N,U,O,L,W;if(b&&!l){const t=Ec(qc(Ja)+2);t.Ie(J),t.Ce(Ja),N=t.st,N[8]=y}else N=gt;if(g){const t=Nc(n),e=(P=t)>=Da&&P<=Aa;if(e){const e=9+(o?4:0)+(i?4:0),n=Ec(e);L=1+(o?2:0)+(i?4:0),W=t,n.Ie(Q),n.Ie(e-4),n.Le(L),n.Ae(t),o&&n.Ae(Uc(Nc(o))),i&&n.Ae(Uc(Nc(i))),O=n.st}else O=gt;if(S===dt?!e||Boolean(o||i):S)try{const t=_c(n),e=Ec(36);e.Ie(10),e.Ie(32),e.Be(4),e.Ie(1),e.Ie(24),e.ve(t),e.ve(o?_c(o):t),e.ve(i?_c(i):t),U=e.st}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!=Qa||e===dt&&n===dt)if(r!=$a||e===dt&&n===dt)Z=gt;else{const t=Ec(8);t.Ie(et),t.Ie(4),t.Ie((e===dt?0:e)&M),t.Ie((n===dt?0:n)&M),Z=t.st}else{const t=yc(e===dt?0:e),r=yc(n===dt?0:n),o=3+t.length+r.length,i=Ec(4+o);i.Ie(tt),i.Ie(o),i.Le(1),i.Le(t.length),i.Ce(t),i.Le(r.length),i.Ce(r),Z=i.st}}catch{Z=gt}I===dt&&(I=C?8:0),A===dt&&(A=0!=I||p||b?20:10);const{Ne:H}=t;C&&H!==dt&&(A=A>H?A:H),u&&(A=A>45?A:45),b&&!l&&(A=A>51?A:51,E&&D!==dt&&(N[4]=1),Hc(be(N),9,I),I=99);const V=_?qc(T):0,G=V+qc(N,O,U,Z,h,m);if(G+(t[vt]?67:0)>M)throw new f(Fa);const j=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),q=j<lt?lt:j>ut?ut:j,Y=qc(O)?new a(1e3*Nc(n)):qc(U)?n:q,{Bt:K,Wt:X,rawLastModDate:$}=Yc({version:A,bitFlag:Xc(c,d,w,b,I),compressionMethod:I,uncompressedSize:z,lastModDate:q,rawLastModDate:r,rawFilename:e,Pt:x,Zt:R,extraFieldLength:G}),nt=Ec(ct+qc(e)+G),rt=nt.st,ot=be(rt);return nt.Ae(B),nt.Ce(K),nt.Ce(e),_&&nt.Ce(T),nt.Ce(N),nt.Ce(O),nt.Ce(U),nt.Ce(Z),nt.Ce(h),nt.Ce(m),w&&(x||Vc(ot,18,0),R||Vc(ot,22,0)),{oe:rt,ye:ot,Bt:K,Wt:X,lastModDate:Y,re:Y===q&&j.getTime()!=q.getTime(),rawLastModDate:$,encrypted:b,compressed:C,version:A,compressionMethod:I,we:L,pe:W,Gt:gt,fe:V,qt:O,Yt:U,Kt:Z,jt:N,extraFieldLength:G}}function mc(t,e){const{ae:n}=t;let{oe:r,extraFieldLength:o}=n,i=64-(e+qc(r))%64;i<4&&(i+=64);const s=new w(i),a=be(s);Hc(a,0,$),Hc(a,2,i-4);const c=r;n.oe=r=new w(qc(c)+i),jc(r,c),jc(r,s,qc(c));const u=be(r);Hc(u,28,o+i),n.ye=u,t.de+=i}function yc(t){const e=new w(4);be(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function gc({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=be(o),n&&(i=4,Vc(r,0,P))),{ie:o,he:r,me:i}}function Sc(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,jt:o,rawComment:i,Yt:s,Kt:a,rawExtraField:c,Xt:u,we:l,pe:d,Ht:w,uncompressedSize:p,compressedSize:h}=r;let{Zt:m,Pt:y}=r;w||(m&&p<O&&(m=r.Zt=!1),y&&h<O&&(y=r.Pt=!1)),n=n||m||y;const g=r.offset>=O,S=r.diskNumberStart>=M;let E,b;if(g||S||m||y){const t=4+(m?8:0)+(y?8:0)+(g?8:0)+(S?4:0),e=Ec(t);e.Ie(1),e.Ie(t-4),m&&e.ve(p),y&&e.ve(h),g&&e.ve(r.offset),S&&e.Ae(r.diskNumberStart),E=e.st}else E=gt;if(r.Gt=E,r.De=g,r.Vt=S,d===dt)b=gt;else{const t=Ec(9);t.Ie(Q),t.Ie(5),t.Le(l),t.Ae(d),b=t.st}r.qt=b;const R=qc(E,o,s,a,b,c,u);if(R>M)throw new f(Fa);e+=q+qc(t,i)+R}return{be:e,Re:n}}function Ec(t){const e=new w(t),n=be(e);let r=0;return{st:e,Le:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},Ie:t=>{Hc(n,r,t),r+=2},Ae:t=>{Vc(n,r,t),r+=4},ve:t=>{Gc(n,r,i(t)),r+=8},Ce:t=>{jc(e,t,r),r+=qc(t)},Be:t=>r+=t}}function bc(t){const{diskNumber:e=0}=t;return e}function Rc(t){const{diskOffset:e=0}=t;return e}function xc(t,e){const{availableSize:n=ft}=t;return e>n}function zc(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.Ct:0)}function Fc(t){const e=be(t);let n=0;for(;n+4<=qc(t);){const r=4+Zc(e,n+2);if(1==Zc(e,n))return Fc(Se(t.subarray(0,n),t.subarray(s.min(n+r,qc(t)))));n+=r}return t}async function Dc(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await vc(ti(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 Ac(t,e){const n=await $o(t,e,ct);if(qc(n)<ct)return ct;const r=be(n);return ct+Zc(r,26)+Zc(r,28)}function Ic(t,{offset:e,diskNumberStart:n}){return e+(t.wt?t.wt(n):0)}function Cc(){const t=new w(4);return Vc(be(t),0,W),t}async function Tc(t,e){delete t.Dt,await kc(e,Cc()),t.offset+=4}async function kc(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=qc(e),await r.write(e)}finally{r.releaseLock()}}async function vc(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(qc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function _c(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<Ia?Ia:e>Ca?Ca:e}}function Nc(t){return s.floor(t.getTime()/1e3)}function Uc(t){return s.min(Aa,s.max(Da,t))}function Oc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function Mc(t,e,n,r){const i=Oc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(ha);return i}function Lc(t,e,n){return qt(Oc(t,e,n))}function Bc(t,e,n,r){return te(Oc(t,e,n,r))}function Wc(t){return t+5*(s.floor(t/16383)+1)}function Pc(t,e){return t===dt?e===dt||e>0:0!==t}function Zc(t,e){return t.getUint16(e,!0)}function Hc(t,e,n){t.setUint16(e,n,!0)}function Vc(t,e,n){t.setUint32(e,n,!0)}function Gc(t,e,n){t.setBigUint64(e,n,!0)}function jc(t,e,n){t.set(e,n)}function qc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Yc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,Pt:c,Zt:u,extraFieldLength:l}){const d=Ec(26),f=d.st,w=be(f);if(d.Ie(t),d.Ie(e),d.Ie(n),s===dt){const t=new h(1),e=be(t);Hc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Hc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.Ae(s),d.Be(4),c||o!==dt?d.Ae(c?O:o):d.Be(4),u||r!==dt?d.Ae(u?O:r):d.Be(4),d.Ie(qc(a)),d.Ie(l),{Bt:f,Wt:w,rawLastModDate:s}}function Kc(t){return t.every(t=>t>=32&&t<=126)}function Xc(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 Jc(t,e){if(!t)return!1;const{We:n}=t;return n?n.includes(e):er(t,e)}const Qc=1048576,$c=".zip.js-temp",tu=1048576,eu=1048576,nu=".zip.js-temp",ru="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===b&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===b?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",b.baseURI).href})}catch{}const ou="Entry filename already exists",iu="Duplicate entry filename in the imported zip file",su='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',au="Entry is an ancestor of target entry",cu="Root directory cannot be moved",uu="Target entry is not a directory",lu="Parent entry is not a directory",du="Readable stream already consumed",fu="throw",wu="keep-first",pu="keep-last",hu=new u([fu,wu,pu]),mu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",yu="Invalid readerOptions (must be an object)",gu="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",Su="zipjs-abort-export";class Eu{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(ou);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Pe++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,Ze:r.Ze||r.uncompressedSize===dt,passThrough:r.passThrough,He:r.He||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=Yu(t);r&&(t=r.pop(),n=Ku(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(ou);n!=e.parent&&(vu(e),e.parent=n,n.children.push(e),ju(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 bu extends Eu{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 bu(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==bo?e.type==n:t.constructor!=yo||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Tu(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await g.all([Jo(r),Jo(t,o)]);const i=Yt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof Oi||!o&&!i&&!s?a:Tn(a).pipeThrough(new Rr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!Xo(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await Tn(s).pipeTo(vn(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(Re(t)&&t.message==Je)return!1;throw t}}getText(t,e){return this.getData(new zo(t),e)}getBlob(t,e){return this.getData(new bo(t),e)}getData64URI(t,e){return this.getData(new yo(t),e)}getUint8Array(t){return this.getData(new Go,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Ee(await this.getUint8Array(t)).buffer}replaceBlob(t){Lu(this,{data:t,Reader:Eo,Writer:bo,uncompressedSize:t.size})}replaceText(t){Lu(this,{data:t,Reader:Ro,Writer:zo,uncompressedSize:xo(t)})}replaceData64URI(t){Lu(this,{data:t,Reader:mo,Writer:yo,uncompressedSize:Bu(t)})}replaceUint8Array(t){Lu(this,{data:t,Reader:Vo,Writer:Go,uncompressedSize:t.length})}replaceReadable(t){Lu(this,{data:null,Reader:Iu(t),Writer:null,uncompressedSize:dt})}}class Ru extends Eu{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Ru(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 qu(this,t,{options:e},!0)}addText(t,e,n={}){return qu(this,t,{data:e,Reader:Ro,Writer:zo,options:n,uncompressedSize:xo(e)})}addBlob(t,e,n={}){return qu(this,t,{data:e,Reader:Eo,Writer:bo,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return qu(this,t,{data:e,Reader:mo,Writer:yo,options:n,uncompressedSize:Bu(e)})}addUint8Array(t,e,n={}){return qu(this,t,{data:e,Reader:Vo,Writer:Go,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return qu(this,t,{data:e,Reader:class extends Ho{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return qu(this,t,{Reader:Iu(e),options:n})}addFileSystemEntry(t,e={}){return Zu(this,t,e)}addFileSystemHandle(t,e={}){return Zu(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),qu(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 Eo(t),e)}importData64URI(t,e){return this.importZip(new mo(t),e)}importUint8Array(t,e){return this.importZip(new Vo(t),e)}importHttpContent(t,e){return this.importZip(new Ho(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new bo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new yo(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Go,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;Mu(r.passThrough);const a=Ou(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Yt(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=Fu([t],t=>Au(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await xr(o,w),await S(t,e),s&&await xr(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 xr(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=>E(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!_u(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 E(n,e)}async function E(e,n){if(u.aborted){if(h||_u(u.reason))return;Kt(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(Su):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(Su));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 Ds(t,e)),Mu(e.passThrough);const o=function(t){if(t===dt)return fu;if(hu.has(t))return t;throw new f(su)}(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==wu){c=!0;break}if(o!=pu)throw new f(iu);this.fs.remove(r),r=new Ru(this.fs,t,{data:null},e),i.push(r)}}else r=new Ru(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||e.data)){if(o==wu)continue;if(o!=pu)throw new f(iu);e.directory?e.data=t:(this.fs.remove(e),e=dt)}e||(e=new Ru(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==wu)continue;if(o!=pu)throw new f(iu);this.fs.remove(s)}i.push(qu(r,a,{data:t,Reader:Cu(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([ku(r,Ou(e.readerOptions)),o?dt:Jo(t)]),s=o?t:new rc(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=Fu(e.children,t=>Pu(t)?0:1);let f=0,w=0;if(s&&await xr(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(Pu(e))return;const{name:s,Jt:c}=Nu(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 xr(a,f,r)}}));w++,u&&await xr(u,w,d,h)}c&&await xr(c,f)}(s,r,Fu([r],Du),e,i),o?s:(await s.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(t={}){const e=this;Ou((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}),o=r.filter(t=>!Pu(t)).map(n=>{const{name:r,Jt:o}=Nu(n,e,t);return{name:r,size:n.directory?0:Uu(n,Wu(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>Pu(t)||!t.children.length);return await async function(t,e,r,o){const i={options:t};if(qt(t[Nt]))throw new f(Na);if(o!==dt&&!(o instanceof w))throw new f(fa);const a=qc(o);if(a>M)throw new f(da);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);Oc(i,o,Di)&&!e.endsWith(at)&&(e+=at);const a=lc(i,e,o);({name:e}=a);const{$t:c}=dc(i,e,o);0==c.level||c.compressionMethod!==dt||c.ee||await gr(we())||(c.level=0);const u=!Oc(i,o,Di);if(u&&r===dt)throw new f(Na);const{Oe:w,$t:p}=wc(i,u,r,c,o);if(u&&!c.ee&&Pc(p.compressionMethod,p.level))throw new f(Na);const S=n.assign({},o,a.$t,c,p,{[vt]:l}),E=hc(S),b=gc(S),R={ae:E,de:qc(E.oe,b.ie)};l&&mc(R,h);const x=u?w:0;d.set(e,n.assign({},S,E,{offset:h,diskNumberStart:0,compressedSize:x}));const z=R.de+x;y.push(z),g.add(Boolean(S.Ht||S.uncompressedSize>=O||x>=O)),m=s.min(m,z),h+=z}if(d.size>1&&(l||h-m>=O&&(g.size>1||pc(y,p,!0)!=pc(y,p,!1)))&&!r)throw new f(Na);const{be:S,Re:E}=Sc(d);let b=Oc(i,t,bi);if(h>=O||S>=O||d.size>=M){if(!1===b)throw new f(Ta);b=!0}else b===dt&&E&&(b=!0);return h-p+S+a+(b?98:Y)}(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 xu{constructor(){Vu(this)}get children(){return this.root.children}remove(t){vu(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(cu);if(!e.directory)throw new f(uu);if(e.isDescendantOf(t))throw new f(au);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(ou)}else vu(t),t.parent=e,e.children.push(t),ju(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 Gu(this,n=>n.importBlob(t,e))}importData64URI(t,e){return Gu(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return Gu(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return Gu(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return Gu(this,n=>n.importReadable(t,e))}importZip(t,e){return Gu(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 zu={FS:xu,ZipDirectoryEntry:Ru,ZipFileEntry:bu};function Fu(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 Du(t){return t.uncompressedSize}function Au(t,e){const{data:n}=t;return e&&n instanceof Oi?n.compressedSize:t.uncompressedSize}function Iu(t){let e;return function(){if(e)throw new f(du);return e=!0,{readable:t}}}function Cu(t){return class extends po{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 bo,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.Ve=new Eo(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.Ve.readUint8Array(t,e)}}}function Tu(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function ku(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=Tu(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.Ze=!1)})),o}function vu(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function _u(t){return Boolean(t)&&t.message==Su}function Nu(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let s={},a={};if(t.data instanceof Oi){const e=Wu(t,r),n=i.lastModDate===dt?r.lastModDate:i.lastModDate;({Jt:s,Qt:a}=uc(t.data,e,n)),e&&(a.passThrough=!0)}const c=n.assign({lastModDate:t.He},s,r,i,a,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===dt)throw new f(mu);return{name:o,Jt:c}}function Uu(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.Ze?dt:Au(t,e)}function Ou(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(yu);return t&&Mu(t.passThrough),t}function Mu(t){if(Jt(t)===Pt)throw new f(gu)}function Lu(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,Ze:r===dt})}function Bu(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function Wu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function Pu(t){return t.directory&&null===t.data}function Zu(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 Hu(o)),"file"==o.kind){const t=await o.getFile();i.push(qu(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 Hu(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 Hu(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 Vu(t){t.entries=[],t.Pe=0,t.root=new Ru(t)}function Gu(t,e){const{entries:r,Pe:o,root:i}=t;return Vu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,Pe:o,root:i}),e})}function ju(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 qu(t,e,n,r){if(t.directory){const o=Yu(e);return o&&(e=o.pop(),t=Ku(t,o)),r?new Ru(t.fs,e,n,t):new bu(t.fs,e,n,t)}throw new f(lu)}function Yu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function Ku(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(ou);if(n&&(t==n||t.isDescendantOf(n)))throw new f(au)}else t=new Ru(r.fs,e,{data:null},r)}),t}t.BlobReader=Eo,t.BlobWriter=bo,t.Data64URIReader=mo,t.Data64URIWriter=yo,t.ERR_ABORTED=jt,t.ERR_AMBIGUOUS_ARCHIVE=Xi,t.ERR_ANCESTOR_ENTRY=au,t.ERR_BAD_FORMAT=Bi,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Zi,t.ERR_DUPLICATED_NAME=la,t.ERR_DUPLICATE_IMPORTED_ENTRY=iu,t.ERR_ENCRYPTED=Gi,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=Ji,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Ki,t.ERR_ENTRY_EXISTS=ou,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=Pi,t.ERR_EOCDR_NOT_FOUND=Wi,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Vi,t.ERR_HTTP_RANGE=to,t.ERR_HTTP_RESOURCE_CHANGED=eo,t.ERR_HTTP_STATUS=$r,t.ERR_INVALID_AUTHENTICATION_CODE=Qe,t.ERR_INVALID_BASE_URI=ne,t.ERR_INVALID_CODEC_DEFINITION=_n,t.ERR_INVALID_CODEC_MODULE=Un,t.ERR_INVALID_COMMENT=da,t.ERR_INVALID_COMMENT_TYPE=fa,t.ERR_INVALID_COMPRESSED_DATA=Gn,t.ERR_INVALID_CRC32=jn,t.ERR_INVALID_DATE=ha,t.ERR_INVALID_DUPLICATES=su,t.ERR_INVALID_ENCRYPTION_STRENGTH=ga,t.ERR_INVALID_ENTRY=qa,t.ERR_INVALID_ENTRY_COMMENT=wa,t.ERR_INVALID_ENTRY_COMMENT_TYPE=pa,t.ERR_INVALID_ENTRY_NAME=ma,t.ERR_INVALID_EXTRAFIELD=Ra,t.ERR_INVALID_EXTRAFIELD_DATA=Fa,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=za,t.ERR_INVALID_EXTRAFIELD_TYPE=xa,t.ERR_INVALID_FILENAME_VALIDATION=ts,t.ERR_INVALID_FUNCTION_OPTION=Zt,t.ERR_INVALID_GID=Ba,t.ERR_INVALID_LEVEL=Ga,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=es,t.ERR_INVALID_MAX_WORKERS=ee,t.ERR_INVALID_MSDOS_ATTRIBUTES=Ha,t.ERR_INVALID_MSDOS_DATA=Va,t.ERR_INVALID_PASSWORD=Je,t.ERR_INVALID_PASSWORD_TYPE=Vt,t.ERR_INVALID_PASS_THROUGH=mu,t.ERR_INVALID_PASS_THROUGH_VALUE=Gt,t.ERR_INVALID_READER=Oa,t.ERR_INVALID_READER_OPTIONS=yu,t.ERR_INVALID_SIGNAL=Ht,t.ERR_INVALID_SIGNATURE_DATA=ja,t.ERR_INVALID_STRICTNESS=$i,t.ERR_INVALID_UID=La,t.ERR_INVALID_UNCOMPRESSED_SIZE=Vn,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=Pa,t.ERR_INVALID_UNIX_ID_SIZE=Za,t.ERR_INVALID_UNIX_MODE=Wa,t.ERR_INVALID_URI=re,t.ERR_INVALID_VERSION=ya,t.ERR_ITERATOR_COMPLETED_TOO_SOON=no,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Hi,t.ERR_OVERLAPPING_ENTRY=Yi,t.ERR_PARENT_NOT_DIRECTORY=lu,t.ERR_READABLE_CONSUMED=du,t.ERR_RESERVED_COMPRESSION_METHOD=Nn,t.ERR_ROOT_DIRECTORY_NOT_MOVABLE=cu,t.ERR_SPLIT_ZIP_FILE=qi,t.ERR_TARGET_NOT_DIRECTORY=uu,t.ERR_UNDEFINED_COMPRESSION_METHOD=va,t.ERR_UNDEFINED_CRC32=_a,t.ERR_UNDEFINED_READER=Ua,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=ka,t.ERR_UNDETERMINED_SIZE=Na,t.ERR_UNSAFE_FILENAME=Qi,t.ERR_UNSUPPORTED_COMPRESSION=On,t.ERR_UNSUPPORTED_CONTEXT=ru,t.ERR_UNSUPPORTED_CRYPTO_API=tn,t.ERR_UNSUPPORTED_ENCRYPTION=ji,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=ba,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=Sa,t.ERR_UNSUPPORTED_FORMAT=Ta,t.ERR_UNSUPPORTED_PASS_THROUGH_VALUE=gu,t.ERR_UNSUPPORTED_SPLIT_USDZ=Ea,t.ERR_UNSUPPORTED_UINT64=ns,t.ERR_WORKER_STARTUP_TIMEOUT=wr,t.ERR_WRITER_NOT_INITIALIZED=ro,t.ERR_WRITER_SIZE_NOT_WRITABLE=oo,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Ya,t.ERR_ZIP_NOT_EMPTY=Ma,t.HttpRangeReader=class extends Ho{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Ho,t.Reader=po,t.SplitDataReader=jo,t.SplitDataWriter=qo,t.TextReader=Ro,t.TextWriter=zo,t.Uint8ArrayReader=Vo,t.Uint8ArrayWriter=Go,t.VERSION="2.14.1",t.WARNING_APPENDED_DATA=us,t.WARNING_CLAMPED_LAST_MODIFICATION_DATE=Xa,t.WARNING_COMPRESSED_PATCHED_DATA=is,t.WARNING_COMPRESSION_UNAVAILABLE=Ka,t.WARNING_DUPLICATE_FILENAME=ws,t.WARNING_MALFORMED_EXTRA_FIELD=ss,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=ys,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=gs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=Ss,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=ms,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=ps,t.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=hs,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=ds,t.WARNING_PREPENDED_DATA=ls,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=fs,t.WARNING_UNKNOWN_VERSION=os,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=as,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=rs,t.WARNING_WRAPPED_ENTRIES_COUNT=cs,t.Writer=ho,t.ZipDirectoryEntry=Ru,t.ZipEntry=Eu,t.ZipFS=xu,t.ZipFileEntry=bu,t.ZipReader=Ds,t.ZipReaderStream=As,t.ZipWriter=rc,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new z;this.readable=e,this.zipWriter=new rc(n,t),this.Tt=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 ac(e,t)}}()}});return cc(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 cc(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.Tt))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await ac(r,t),t}try{return await r.close(t,n)}catch(t){throw await ac(r,t),t}}},t.configure=function(t){n.assign(fe,me(ge(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=tu}=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=kn(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=Qc,directoryName:r=$c,getDirectory:o=()=>C.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=R.randomUUID?R.randomUUID():e.from(R.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=eu,directoryName:r=nu,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(ru);const i=o||(()=>C.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=R.randomUUID?R.randomUUID():e.from(R.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=zu,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=Pn,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:Jc(n,qn)||Jc(t,qn)||Jc(t,Kn),decompression:Jc(r,qn)||Jc(e,qn)||Jc(e,Kn),registered:!1},{compressionMethod:9,compression:!1,decompression:Jc(r,Yn)||Jc(e,Yn),registered:!1}];for(const t of Pn()){const e=Zn(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=Is,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(_n);if(Mn.includes(e))throw new f(Nn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(_n);Ln.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Hn(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(Br.map(t=>(Kr(t),t.terminate()))),pr=dt,hr=!1},t.unregisterCodec=function(t){const e=Ln.get(t);if(e){let n;Ln.delete(t),Ln.forEach(t=>n=n||t.format==e.format),n||Bn.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:g,TextEncoder:S,TextDecoder:E,document:b,crypto:R,btoa:x,TransformStream:z,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:I,navigator:C,Worker:T,Symbol:k,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:self;var U=void 0!==b?b.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,Y=22,K=20,X=56,$=39169,J=21589,Q=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(),Et="password",bt="rawPassword",Rt="passThrough",xt="signal",zt="useWebWorkers",Ft="useCompressionStream",Dt="transferStreams",At="preventClose",It="level",Ct="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 Yt(t){if(t&&(typeof t.addEventListener!=pt||typeof t.aborted!=yt))throw new f(Ht);return t||dt}function Kt(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 $t(t){if(t!==dt&&typeof t!=yt&&t!==Pt)throw new f(Gt);return t}function Jt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function Qt(t,e,n){t!==dt&&Jt(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 C!=wt&&C.hardwareConcurrency&&(oe=C.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 I!=wt&&I},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 Ee(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function be(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function Re(t){return Boolean(t)&&"object"==typeof t}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[ze,Fe,De,Ae,Ie,Ce,Te,ke]=xe;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]^Ce[t>>>16&255]^Ie[t>>>24&255]^Ae[255&n]^De[n>>>8&255]^Fe[n>>>16&255]^ze[n>>>24&255]}}for(;r<n;r++)e=e>>>8^ze[255&(e^t[r])];this.o=e}get(){return~this.o}}class _e extends z{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 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 Ue=64,Oe=20,Me=new w([128]),Le=new w(1),Be=new Int32Array([1732584193,4023233417,2562383102,271733878,3285377520]),We=new w(256),Pe=new Int32Array(256),Ze=new Int32Array(256),He=new Int32Array(256),Ve=new Int32Array(256);let Ge=!1;function je(t){const e=function(){const t=new Int32Array(Be),e=new Int32Array(16),n=new w(Ue),r=new m(n.buffer),o=new w(8);let i=0,a=0;return{update:c,digest:function(){const e=8*a,n=s.floor(e/4294967296),r=e>>>0;for(c(Me,0,1);56!=i;)c(Le,0,1);o[0]=n>>>24,o[1]=n>>>16,o[2]=n>>>8,o[3]=n,o[4]=r>>>24,o[5]=r>>>16,o[6]=r>>>8,o[7]=r,c(o,0,8);const u=new w(Oe),l=new m(u.buffer);for(let e=0;e<t.length;e++)l.setInt32(4*e,t[e]);return t.set(Be),i=0,a=0,u}};function c(t,e,o){const s=e+o;if(a+=o,i){for(;e<s&&i<Ue;)n[i++]=t[e++];i==Ue&&(u(r,0),i=0)}if(e+Ue<=s){const n=new m(t.buffer,t.byteOffset,t.byteLength);for(;e+Ue<=s;e+=Ue)u(n,e)}for(;e<s;)n[i++]=t[e++]}function u(n,r){for(let t=0;t<16;t++)e[t]=n.getInt32(r+4*t);let o,i=t[0],s=t[1],a=t[2],c=t[3],u=t[4];for(let t=0;t<15;t+=5)u=(i<<5|i>>>27)+((a^c)&s^c)+u+1518500249+e[t]|0,s=s<<30|s>>>2,c=(u<<5|u>>>27)+((s^a)&i^a)+c+1518500249+e[t+1]|0,i=i<<30|i>>>2,a=(c<<5|c>>>27)+((i^s)&u^s)+a+1518500249+e[t+2]|0,u=u<<30|u>>>2,s=(a<<5|a>>>27)+((u^i)&c^i)+s+1518500249+e[t+3]|0,c=c<<30|c>>>2,i=(s<<5|s>>>27)+((c^u)&a^u)+i+1518500249+e[t+4]|0,a=a<<30|a>>>2;u=(i<<5|i>>>27)+((a^c)&s^c)+u+1518500249+e[15]|0,s=s<<30|s>>>2,o=e[13]^e[8]^e[2]^e[0],o=o<<1|o>>>31,e[0]=o,c=(u<<5|u>>>27)+((s^a)&i^a)+c+1518500249+o|0,i=i<<30|i>>>2,o=e[14]^e[9]^e[3]^e[1],o=o<<1|o>>>31,e[1]=o,a=(c<<5|c>>>27)+((i^s)&u^s)+a+1518500249+o|0,u=u<<30|u>>>2,o=e[15]^e[10]^e[4]^e[2],o=o<<1|o>>>31,e[2]=o,s=(a<<5|a>>>27)+((u^i)&c^i)+s+1518500249+o|0,c=c<<30|c>>>2,o=e[0]^e[11]^e[5]^e[3],o=o<<1|o>>>31,e[3]=o,i=(s<<5|s>>>27)+((c^u)&a^u)+i+1518500249+o|0,a=a<<30|a>>>2;for(let t=20;t<40;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(i<<5|i>>>27)+(s^a^c)+u+1859775393+o|0,s=s<<30|s>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(i^s^a)+c+1859775393+o|0,i=i<<30|i>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,a=(c<<5|c>>>27)+(u^i^s)+a+1859775393+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,s=(a<<5|a>>>27)+(c^u^i)+s+1859775393+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,i=(s<<5|s>>>27)+(a^c^u)+i+1859775393+o|0,a=a<<30|a>>>2;for(let t=40;t<60;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(i<<5|i>>>27)+(s&a|(s|a)&c)+u+2400959708+o|0,s=s<<30|s>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(i&s|(i|s)&a)+c+2400959708+o|0,i=i<<30|i>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,a=(c<<5|c>>>27)+(u&i|(u|i)&s)+a+2400959708+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,s=(a<<5|a>>>27)+(c&u|(c|u)&i)+s+2400959708+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,i=(s<<5|s>>>27)+(a&c|(a|c)&u)+i+2400959708+o|0,a=a<<30|a>>>2;for(let t=60;t<80;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(i<<5|i>>>27)+(s^a^c)+u+3395469782+o|0,s=s<<30|s>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(i^s^a)+c+3395469782+o|0,i=i<<30|i>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,a=(c<<5|c>>>27)+(u^i^s)+a+3395469782+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,s=(a<<5|a>>>27)+(c^u^i)+s+3395469782+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,i=(s<<5|s>>>27)+(a^c^u)+i+3395469782+o|0,a=a<<30|a>>>2;t[0]=t[0]+i|0,t[1]=t[1]+s|0,t[2]=t[2]+a|0,t[3]=t[3]+c|0,t[4]=t[4]+u|0}}(),n=new w(Ue),r=new w(Ue);t.length>Ue&&(e.update(t,0,t.length),t=e.digest());for(let e=0;e<Ue;e++){const o=e<t.length?t[e]:0;n[e]=54^o,r[e]=92^o}return e.update(n,0,Ue),{update(t,n,r){e.update(t,n,r)},digest(){const t=e.digest();e.update(r,0,Ue),e.update(t,0,Oe);const o=e.digest();return e.update(n,0,Ue),o}}}function qe(t){return We[t>>>24]<<24|We[t>>>16&255]<<16|We[t>>>8&255]<<8|We[255&t]}function Ye(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function Ke(t){return 255&(t<<1^27*(t>>7))}const Xe=typeof R!=wt&&typeof R.getRandomValues==pt,$e="Invalid password",Je="Invalid authentication code",Qe="zipjs-abort-check-password",tn="Crypto API not supported";function en(t){if(Xe)return R.getRandomValues(t);throw new f(tn)}const nn={name:"PBKDF2"},rn=n.assign({hash:{name:"HMAC"}},nn),on=n.assign({iterations:1e3,hash:{name:"SHA-1"}},nn),sn=["deriveBits"],an=[8,12,16],cn=[16,24,32],un=10,ln=typeof R!=wt,dn=ln&&R.subtle;let fn=ln&&typeof dn!=wt&&typeof dn.importKey==pt&&typeof dn.deriveBits==pt;class wn extends z{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){hn(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,l:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await gn(t,e,n,En(r,0,an[e])),i=En(r,an[e]);if(o[0]!=i[0]||o[1]!=i[1])throw yn(t),new f($e)}(n,i,o,En(t,0,an[i]+2)),t=En(t,an[i]+2),r?(yn(n),e.error(new f(Qe))):s()):await a;const c=new w(t.length-un-(t.length-un)%16);e.enqueue(mn(n,t,c,0,un,!0))},async flush(t){const{h:e,m:n,ready:r}=this;if(e){await r;const i=En(n,n.length-un),s=new w(En(n,0,n.length-un));e.process(s,!0);const a=e.digest();let c=n.length<un?1:0;for(let t=0;t<un;t++)c|=a[t]^i[t];if(c&&o)throw new f(Je);t.enqueue(s)}},cancel(){yn(this)}})}}class pn extends z{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){hn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,l:i,ready:s}=n;let a=gt;r?(a=await async function(t,e,n){const r=en(new w(an[e]));return Se(r,await gn(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%16);c.set(a,0),e.enqueue(mn(n,t,c,a.length,0,!1))},async flush(t){const{h:e,m:n,ready:r}=this;if(e){await r;const o=new w(n);e.process(o,!1);const i=En(e.digest(),0,un);t.enqueue(Se(o,i))}},cancel(){yn(this)}})}}function hn(t,e,r,o){n.assign(t,{ready:new g(e=>t.l=e),password:Sn(e,r),strength:o-1,m:gt})}function mn(t,e,n,r,o,i){const{h:s,m:a}=t;a.length&&(e=Se(a,e));const c=e.length-o,u=c-c%16;if(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){const t=En(n,r,r+u);t.set(En(e,0,u)),s.process(t,i)}return t.m=En(e,u),n}function yn({h:t}){t&&t.dispose&&t.dispose()}async function gn(t,e,r,o){t.password=null;const i=cn[e],a=await async function(t,e,r){if(fn)try{const o=await dn.importKey("raw",t,rn,!1,sn);return new w(await dn.deriveBits(n.assign({salt:e},on),o,8*r))}catch{fn=!1}return function(t,e,n,r){const o=je(t),i=new w(r),a=new w(e.length+4),c=new m(a.buffer);a.set(e);for(let t=1,n=0;n<r;t++,n+=Oe){c.setUint32(e.length,t),o.update(a,0,a.length);let u=o.digest();const l=u.slice();for(let t=1;t<1e3;t++){o.update(u,0,Oe),u=o.digest();for(let t=0;t<Oe;t++)l[t]^=u[t]}i.set(l.subarray(0,s.min(Oe,r-n)),n)}return i}(t,e,0,r)}(r,o,2*i+2);return t.h=function(t,e){!function(){if(!Ge){let t=1,e=1;do{t=255&(t^t<<1^(128&t?27:0)),e=255&(e^e<<1),e=255&(e^e<<2),e=255&(e^e<<4),128&e&&(e^=9),We[t]=255&(e^(e<<1|e>>7)^(e<<2|e>>6)^(e<<3|e>>5)^(e<<4|e>>4)^99)}while(1!=t);We[0]=99;for(let t=0;t<256;t++){const e=We[t],n=Ke(e),r=n<<24|e<<16|e<<8|n^e;Pe[t]=r,Ze[t]=r>>>8|r<<24,He[t]=r>>>16|r<<16,Ve[t]=r>>>24|r<<8}Ge=!0}}();const n=new Int32Array(60),r=function(t,e){const n=t.length>>2,r=n+6,o=4*(r+1);let i=1;for(let r=0;r<n;r++)e[r]=t[4*r]<<24|t[4*r+1]<<16|t[4*r+2]<<8|t[4*r+3];for(let t=n;t<o;t++){let r=e[t-1];t%n==0?(r=qe(r<<8|r>>>24)^i<<24,i=Ke(i)):n>6&&t%n==4&&(r=qe(r)),e[t]=e[t-n]^r}return r}(t,n),o=new Int32Array(4),i=je(e);let s=0,a=0,c=0,u=0;return{process(t,e){e&&i.update(t,0,t.length),function(t){const e=new m(t.buffer,t.byteOffset,t.byteLength),n=t.length;let r=0;for(;r+16<=n;r+=16)l(),e.setInt32(r,e.getInt32(r)^o[0]),e.setInt32(r+4,e.getInt32(r+4)^o[1]),e.setInt32(r+8,e.getInt32(r+8)^o[2]),e.setInt32(r+12,e.getInt32(r+12)^o[3]);if(r<n){l();for(let e=0;r<n;r++,e++)t[r]^=o[e>>2]>>>24-8*(3&e)}}(t),e||i.update(t,0,t.length)},digest:()=>i.digest()};function l(){s=s+1|0,s||(a=a+1|0,a||(c=c+1|0,c||(u=u+1|0)));let t=Ye(s)^n[0],e=Ye(a)^n[1],i=Ye(c)^n[2],l=Ye(u)^n[3],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[4],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[5],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[6],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[7];t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[8],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[9],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[10],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[11],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[12],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[13],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[14],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[15],t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[16],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[17],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[18],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[19],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[20],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[21],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[22],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[23],t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[24],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[25],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[26],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[27],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[28],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[29],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[30],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[31],t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[32],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[33],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[34],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[35],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[36],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[37],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[38],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[39];let h=40;r>10&&(t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[40],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[41],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[42],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[43],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[44],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[45],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[46],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[47],h=48),r>12&&(t=Pe[d>>>24]^Ze[f>>>16&255]^He[w>>>8&255]^Ve[255&p]^n[48],e=Pe[f>>>24]^Ze[w>>>16&255]^He[p>>>8&255]^Ve[255&d]^n[49],i=Pe[w>>>24]^Ze[p>>>16&255]^He[d>>>8&255]^Ve[255&f]^n[50],l=Pe[p>>>24]^Ze[d>>>16&255]^He[f>>>8&255]^Ve[255&w]^n[51],d=Pe[t>>>24]^Ze[e>>>16&255]^He[i>>>8&255]^Ve[255&l]^n[52],f=Pe[e>>>24]^Ze[i>>>16&255]^He[l>>>8&255]^Ve[255&t]^n[53],w=Pe[i>>>24]^Ze[l>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[54],p=Pe[l>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&i]^n[55],h=56),o[0]=(We[d>>>24]<<24|We[f>>>16&255]<<16|We[w>>>8&255]<<8|We[255&p])^n[h],o[1]=(We[f>>>24]<<24|We[w>>>16&255]<<16|We[p>>>8&255]<<8|We[255&d])^n[h+1],o[2]=(We[w>>>24]<<24|We[p>>>16&255]<<16|We[d>>>8&255]<<8|We[255&f])^n[h+2],o[3]=(We[p>>>24]<<24|We[d>>>16&255]<<16|We[f>>>8&255]<<8|We[255&w])^n[h+3]}}(En(a,0,i),En(a,i,2*i)),En(a,2*i)}function Sn(t,e){return e===dt?Ne(t):e}function En(t,e,n){return t.subarray(e,n)}class bn extends z{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){xn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=zn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f($e);t=t.subarray(12)}r?e.error(new f(Qe)):e.enqueue(zn(n,t))}})}}class Rn extends z{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){xn(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=en(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(Fn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(Fn(n,t),o),e.enqueue(r)}})}}function xn(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,S:new ve(o[0]),R:new ve(o[2])}),r)for(let e=0;e<r.length;e++)Dn(t,r[e]);else for(let n=0;n<e.length;n++)Dn(t,e.charCodeAt(n))}(t,e,r)}function zn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=An(t)^e[r],Dn(t,n[r]);return n}function Fn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=An(t)^e[r],Dn(t,e[r]);return n}function Dn(t,e){let[,n]=t.keys;t.S.append([e]);const r=~t.S.get();n=Cn(s.imul(Cn(n+In(r)),134775813)+1),t.R.append([n>>>24]);const o=~t.R.get();t.keys=[r,n,o]}function An(t){const e=2|t.keys[2];return In(s.imul(e,1^e)>>>8)}function In(t){return 255&t}function Cn(t){return 4294967295&t}function Tn(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 kn(t,e){t=Tn(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 vn(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 _n="Invalid codec definition",Nn="Reserved compression method",Un="Invalid codec module",On="Compression method not supported",Mn=[0,8,9,99],Ln=new c,Bn=new c;function Wn(t){return Ln.get(t)}function Pn(){return e.from(Ln.values(),t=>n.assign({},t,Bn.get(t.format)))}function Zn(t){return Bn.get(t)}function Hn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(Un);Bn.set(t,{CompressionStream:n,DecompressionStream:r})}const Vn="Invalid uncompressed size",Gn="Invalid compressed data",jn="Invalid CRC32",qn="deflate-raw",Yn="deflate64-raw",Kn="gzip",Xn=[31,139,8];class $n 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 E=d&&Zn(d),b=ir(s,r,n),R=c&&o&&!l&&!E&&(!i||a)&&Boolean(b);if(i&&!a||!c||R||(h=new _e,S=ar(S,h)),o)if(E)S=cr(S,or(E.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(R)g=new Jn,S=cr(S,new b(Kn,{level:u,chunkSize:e})),S=ar(S,g);else try{S=sr(S,s,{level:u,chunkSize:e},r,n)}catch(t){if(!s&&n)throw t;let e;try{e=new r(Kn)}catch{throw t}S=cr(S,e),S=ar(S,new Jn)}i&&(a?S=ar(S,new Rn(t)):(y=new pn(t),S=ar(S,y))),rr(p,S,()=>{i&&!a||!c||(p.crc32=R?g.crc32:new m(h.value.buffer).getUint32(0))})}}class Jn 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=be(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Qn 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,E,b,R=super.readable;if(i&&(o?R=ar(R,new bn(t)):(E=new wn(t),R=ar(R,E))),c){const t=d&&Zn(d);if(t)R=cr(R,or(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else{let t;const o=ir(u,r,n);if(s&&!l&&a!==dt&&y!==dt&&o)try{t=new o(Kn,{chunkSize:e})}catch{t=dt}if(!t)try{R=sr(R,u,{chunkSize:e,deflate64:l},r,n)}catch(e){if(l||y===dt||!u&&n)throw e;try{t=new r(Kn)}catch{throw e}}t&&(b=!0,R=function(t,e,n,r){const o=e.writable.getWriter(),i=e.readable.getReader(),s=r===dt?new ve:dt;let a,c,u=0,l=!1,d=!1,p=!1,h=0,m=!1;const y=new g((t,e)=>{a=t,c=e});return y.catch(()=>{}),async function(){const e=t.getReader();try{const t=new w(10);for(t.set(Xn),await o.write(t);;){await o.ready;const{value:t,done:n}=await e.read();if(n)break;await o.write(t)}l=!0,s&&(m&&E(),await y);const i=new w(8),a=be(i);a.setUint32(0,s?s.get():r,!0),a.setUint32(4,n,!0),d=!0,await o.write(i),await o.close()}catch(t){await ur(o,t),await lr(e,t)}}(),new F({async pull(t){let e;try{e=await function(){h++,m=!0;const t=i.read();return t.then(S,S),l&&s&&E(),t}()}catch(t){throw d?function(t){const e=new f(u==n?jn:Vn);return e.cause=t,e}(t):t}const{value:r,done:o}=e;if(o)t.close();else{if(u+=r.length,u>n){const t=new f(Vn);throw c(t),await lr(i,t),t}s&&s.append(r),t.enqueue(r)}},cancel:t=>(c(t),i.cancel(t))});function S(){m=!1}async function E(){if(!p){p=!0;const t=h;await new g(t=>{const{port1:e,port2:n}=new MessageChannel;n.onmessage=()=>{e.close(),n.close(),t()},e.postMessage(dt)}),p=!1,m&&(h==t?a():E())}}}(R,t,y,a))}R=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(Gn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(R)}s&&!b&&(S=new _e,R=ar(R,S)),rr(this,R,()=>{if(S){const t=new m(S.value.buffer).getUint32(0,!1);if(a!=t)throw new f(jn)}})}}const tr=new c;function er(t,e){if(!t)return!1;let n=tr.get(t);n||(n=new c,tr.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 nr(t){return er(t,qn)}function rr(t,e,r){e=ar(e,new z({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function or(t,e,n){if(!t)throw new f(On);return new t(e,n)}function ir(t,e,n){return t&&e?e:n&&n.requiresModule?n:void 0}function sr(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?Yn:qn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return cr(t,a)}function ar(t,e){return Tn(t).pipeThrough(e)}function cr(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 ur(n,t),await lr(r,t)}}(),e.readable}async function ur(t,e){try{await t.abort(e)}catch{}}async function lr(t,e){try{await t.cancel(e)}catch{}}const dr="data",fr="deflate",wr="inflate";class pr extends z{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(fr)?i=$n:o.startsWith(wr)&&(i=Qn),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(Vn)},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 hr 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 mr="Worker startup timeout";let yr,gr,Sr,Er=()=>{};async function br(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;return!(!n||n.requiresModule)||!(!nr(e)&&(r=e,!er(r,Kn)))||!!n&&await Rr();var r}async function Rr(){if(Er)try{return await void 0,!0}catch{}return!1}function xr(t){t.createWorker?gr=!0:yr=!1}class zr{constructor(t,{readable:e,writable:r},o,i){const{options:s,config:a,F:c,useWebWorkers:u,transferStreams:l,workerURI:d}=o;let{createWorker:f}=o;const{signal:w}=c;return gr&&(f=dt),n.assign(t,{D:!0,A:(t.A||0)+1,readable:e.pipeThrough(new hr(pe(a))).pipeThrough(new Fr(c),{signal:w}),writable:r,options:n.assign({},s),I:o,workerURI:d,createWorker:f,transferStreams:l,terminate:()=>new g(e=>{const{C:n,D:r}=t;r?(t.T=t.T||[],t.T.push(e)):(n&&(n.terminate(),t.C=null),e()),t.v=null}),_(){if(t.D){const{T:e,C:n}=t;e&&(t.T=null,n&&(t.N=!0,n.terminate())),t.D=!1;const r=i(t);e&&e.forEach(t=>t(r))}}}),yr===dt&&(yr=typeof T!=wt),(u&&Sr&&(yr&&d||f)?Sr:Ar)(t,a)}}class Fr extends z{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await Dr(t,n)},async transform(t,r){o+=t.length,e&&await Dr(e,o,n),r.enqueue(t)},async flush(){r&&await Dr(r,o)}})}}async function Dr(t,...e){try{await t(...e)}catch{}}function Ar(t,e){return{run:()=>Ir(t,e)}}async function Ir({options:t,readable:e,writable:n,_:r,I:o},i){let s,a,c;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(fr),n=e?i.CompressionStreamFallback:i.DecompressionStreamFallback,r=e?i.CompressionStream:i.DecompressionStream;t.useCompressionStream?n&&n.requiresModule&&!nr(r)&&await u():await u()||n&&!n.requiresModule||(t.useCompressionStream=!0)}t.encrypted&&!t.zipCrypto&&await u(),s=new pr(t,i),a=new hr(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,Re(t))try{t.outputSize=e}catch{}}throw t}finally{r()}function u(){return c||(c=Rr()),c}}const Cr={type:"module"},Tr="error";let kr,vr,_r,Nr=!0;try{Nr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var Ur;function Or(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Mr(t){const{C:e}=t;if(e)try{e.terminate()}catch{}t.v=null}function Lr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(vr===dt||kr!==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=Cr);try{a=new T(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return Lr(t,e,r,o,!1);if(o)throw i;return Lr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=Cr);try{c=new d(c,e)}catch{}try{a=new T(c,u)}catch(n){if(o)return Lr(t,e,r,!1,i);throw n}}kr=t,vr=c,_r=u}else a=new T(vr,_r);return a.addEventListener("message",t=>{r.U=!0,Br(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a,errorValue:c}=t,{reader:u,writer:l,O:d,M:p,_:h,A:m}=e,y=()=>e.A!=m;try{if(a)g(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}))),Re(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()||Pr({type:dr,value:t,done:n,messageId:i},e)}if(r==dr){const t=new w(o);await l.ready,await l.write(t),y()||Pr({type:"ack",messageId:i},e)}"close"==r&&function(t){y()||(d(t),S(),h())}(s)}}catch(a){y()||(Mr(e),g(a))}function g(t){y()||(p(t),S(),Re(t)&&t.codecImportFailed||h())}function S(){l&&l.releaseLock()}}(t,r)}),a.addEventListener(Tr,t=>Wr(t,r)),a.addEventListener("messageerror",t=>Wr(t,r)),a}function Br(t){const{L:e}=t;e&&(_(e),t.L=null)}function Wr(t,e){t.preventDefault&&t.preventDefault(),Br(e);const{U:r,M:o,writer:i,_:s}=e;Mr(e),r||(e.C=null);let a=t.error||new f(t.message||Tr);r||(a=n.assign(new f(a.message||Tr),{B:!0}),e.W=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function Pr(t,{C:e,writer:n,transferStreams:r,U:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=Ee(n),a.push(t.value.buffer)),r&&Nr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{Nr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}Ur=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t.v){let c;typeof a==pt&&(a=a());try{c=Lr(t.workerURI,r,t)}catch{return xr(t),Ar(t,e)}n.assign(t,{C:c,U:!1,N:!1,W:null,v:{run:async()=>{try{return await async function(t,e){if(!t.C){const{W:e}=t;t.W=null;const n=e||new f(mr);throw n.B=!0,n}let r,i;const s=new g((e,n)=>{r=e,i=e=>{const{outputSize:r,I:o}=t;if(o.outputSize=r,Re(e))try{e.outputSize=r}catch{}n(e)}});n.assign(t,{reader:null,writer:null,outputSize:0,P:!1,Z:null,O:r,M:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,H:d}=function(t,e){const r=new AbortController;let o;const{writable:i,readable:s}=new z({transform(t,n){e.outputSize+=t.length,n.enqueue(t)}}),a=s.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:r.signal});return a.catch(t=>{o||n.assign(e,{P:!0,Z:t})}),{writable:i,closed:a,H:()=>{o=!0,r.abort()}}}(t.writable,t);let w;try{w=Pr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t._(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.U&&o.isFinite(p)&&p>=0&&(t.L=v(()=>function(t){if(t.L=null,t.U)return;const{M:e,writer:n}=t;if(Mr(t),t.C=null,e){const t=new f(mr);t.B=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(e){await h(),d();try{await l}catch{}const{outputSize:n,I:r,P:o,Z:i}=t;r.outputSize=n;const s=Re(e)&&(e.codecImportFailed||e.B),a=o&&!s?i:e;if(Re(a))try{a.outputSize=n}catch{}throw a}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.B)return xr(t),Or(t),Ir(t,e);if(n&&n.codecImportFailed){if(t.reader)return Or(t),Ir(t,e);t._()}throw n}}}})}return t.v},Sr=Ur;let Zr=[];const Hr=[];let Vr,Gr,jr=0;async function qr(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){!Bn.has(t)&&e&&Hn(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),E=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!S&&E&&(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=Zr.find(t=>!t.D);if(n)return to(n),new zr(n,t,e,b);if(Zr.length<y){const n={V:jr};return jr++,Zr.push(n),new zr(n,t,e,b)}return new g(n=>{Hr.push({resolve:n,stream:t,I:e}),Gr=r.workerStarvationTimeout,Yr()})}()).run();function b(t){if(Kr(),t.N)return t.N=!1,$r();if(Hr.length){const[{resolve:e,stream:n,I:r}]=Hr.splice(0,1);e(new zr(t,n,r,b)),Yr()}else t.C?(to(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.G=v(async()=>{Zr=Zr.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):Zr=Zr.filter(e=>e!=t)}}function Yr(){!Vr&&Hr.length&&o.isFinite(Gr)&&Gr>=0&&(Vr=v(Xr,Gr))}function Kr(){Vr&&(_(Vr),Vr=null)}function Xr(){if(Vr=null,Hr.length){const[{resolve:t,stream:e,I:n}]=Hr.splice(0,1);t(new zr({},e,Jr(n),Qr)),Yr()}}function $r(){const t=Hr.splice(0).map(({resolve:t,stream:e,I:n})=>new g(r=>{t(new zr({},e,Jr(n),()=>{Qr(),r()}))}));return Kr(),g.all(t)}function Jr(t){return n.assign({},t,{useWebWorkers:!1,workerURI:dt,createWorker:dt})}function Qr(){Kr(),Yr()}function to(t){const{G:e}=t;e&&(_(e),t.G=null)}const eo="\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 no(t,e){return oo(t,e,!0)}function ro(t){if(!t.some(t=>t>127))return!1;try{return new E("utf-8",{fatal:!0}).decode(t),!0}catch{return!1}}function oo(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=eo[t[n]];return e}(t):new E(e,{ignoreBOM:n}).decode(t)}const io="HTTP error ",so="HTTP Range not supported",ao="HTTP resource changed",co="Writer iterator completed too soon",uo="Writer not initialized",lo="Invalid writer (size must be writable)",fo="Content-Range",wo="Range",po="GET",ho="bytes",mo=16777216,yo="writable",go=k();class So{constructor(){this.size=0}init(){this.initialized=!0}}class Eo extends So{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 ii(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class bo extends So{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f(uo);return t.writeUint8Array(Ee(e))}});n.defineProperty(t,yo,{get:()=>e})}writeUint8Array(){}}class Ro extends Eo{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{j:t,Y:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{Y:n,j: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 xo extends bo{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",K:""})}writeUint8Array(t){const e=this;let n,o=e.K;const i=e.K.length;for(e.K="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.K+=r.fromCharCode(t[n]);o.length>2?e.data+=x(o):e.K=o+e.K}getData(){return this.data+x(this.K)}}let zo,Fo;class Do extends Eo{constructor(t){super(),n.assign(this,{X:t,size:t.size}),Fo||(Fo=(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();zo=1==e}catch{zo=!1}})())}createReadable(t){const{X:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};if(typeof e.stream==pt){if(!r&&o>=n)return Tn(e.stream());if(zo)return Tn(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.X:n.X.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class Ao extends So{constructor(t){super();const e=this,r=new z;n.defineProperty(e,yo,{get:()=>r.writable}),e.contentType=t,e.$=kn(r.readable,t),e.$.catch(()=>{})}getData(){return this.$}}class Io extends Do{constructor(t){super(new y([t],{type:"text/plain"}))}}function Co(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 To extends Ao{constructor(t){super(),n.assign(this,{encoding:t,J:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,J:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return oo(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class ko extends Eo{constructor(t,e){super(),_o(this,t,e)}async init(){await No(this,qo,Ho),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:o,et:i}=e;if((n||r)&&o!==dt){const{offset:n=0,size:r=o-n}=t||{},a=i&&n>=o-i.length;if(r>0&&n<o&&!a)return function(t,e,n){let r,o=e,i=0,a=n;return new F({start:()=>c(),async pull(t){r||await c();const{value:e,done:n}=await r.read();if(n)throw new f(so);const o=e.length>i?e.subarray(0,i):e;i-=o.length,a-=o.length,o.length&&t.enqueue(o),i||(await async function(){const t=r;r=dt,await t.cancel()}(),a||t.close())},cancel:t=>r&&r.cancel(t)});async function c(){const e=s.min(t.maximumRangeSize,a),n=await qo(po,t,Po(t,o,e));if(206!=n.status)throw new f(so);const c=Oo(n);if(c!==dt&&c!=o)throw new f(so);Wo(t,n),Bo(t,n),o+=e,i=e,r=n.body.getReader()}}(e,n,s.min(r,o-n))}return super.createReadable(t)}readUint8Array(t,e){return Uo(this,t,e,qo,Ho)}}class vo extends Eo{constructor(t,e){super(),_o(this,t,e)}async init(){await No(this,Yo,Vo),super.init()}readUint8Array(t,e){return Uo(this,t,e,Yo,Vo)}}function _o(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=mo,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 No(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(po,t,Po(t,a?-65557:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==ho))throw new f(so);{let o;a&&206==r.status&&(o=new w(await r.arrayBuffer())),Bo(t,r);const i=Mo(r);i===dt?await jo(t,e,n):t.size=i,o&&o.length&&Oo(r)===t.size-o.length&&(t.et=o)}}else await jo(t,e,n)}async function Uo(t,e,n,r,o){const{useRangeHeader:i,forceRangeRequests:s,et:a,size:c,options:u}=t;if(i||s){if(e>=c||0===n)return gt;{if(e+n>c&&(n=c-e),a&&e>=c-a.length){const t=e-(c-a.length);return a.slice(t,t+n)}const o=await r(po,t,Po(t,e,n));if(206!=o.status)throw new f(so);const i=Oo(o);if(i!==dt&&i!=e)throw new f(so);Wo(t,o),Bo(t,o);const s=new w(await o.arrayBuffer());if(s.length!=n)throw new f(so);return s}}{const{data:r}=t;return r||await o(t,u),t.data.subarray(e,e+n)}}function Oo(t){const e=t.headers.get(fo);if(e){const t=o(e.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t))return t}}function Mo(t){const e=t.headers.get(fo);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function Lo({headers:t}){return{nt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function Bo(t,e){const{checkResourceChanges:n,ot:r}=t;n&&!r&&206==e.status&&(t.ot=Lo(e))}function Wo(t,e){const{checkResourceChanges:r,ot:o,size:i}=t;if(r){const t=Mo(e);if(t!==dt&&i!==dt&&t!=i)throw new f(ao);if(o){const t=Lo(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(ao)}}}function Po(t,e=0,r=1){return n.assign({},Zo(t),{[wo]:ho+"="+(e<0?e:e+"-"+(e+r-1))})}function Zo({options:t}){const{headers:e}=t;if(e)return k.iterator in e?n.fromEntries(e):e}async function Ho(t){await Go(t,qo)}async function Vo(t){await Go(t,Yo)}async function Go(t,e){const n=await e(po,t,Zo(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function jo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,Zo(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function qo(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(so):new f(io+(s.statusText||s.status))}function Yo(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(so):new f(io+(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 Ko extends Eo{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new vo(t,e):new ko(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 Xo extends Eo{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{it:t,size:t.length})}readUint8Array(t,e){return this.it.slice(t,t+e)}}class $o extends bo{constructor(t){super(),this.st=t||262144}init(t=0){n.assign(this,{offset:0,it:new w(t>0?t:this.st)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.it.length){let t=e.it.length?2*e.it.length:e.st;for(;t<n;)t*=2;const r=e.it;e.it=new w(t),e.it.set(r)}e.it.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.it.length?this.it:this.it.slice(0,this.offset)}}class Jo extends Eo{constructor(t){super(),this.ct=t}async init(){const t=this;t.ut=0;const e=t.ct=await g.all(t.ct.map(oi));t.lt=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}ft(t){const{lt:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{ct: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 ii(c,a,e);else{const i=r-a;o=Se(await ii(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=gt;return n.ut=s.max(i,n.ut),o}}class Qo extends So{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===go)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(co);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await ri(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,yo,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(go)}finally{t.releaseLock()}}}class ti{constructor(t){return e.isArray(t)&&(t=new Jo(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:Tn(t)}),t}}class ei{constructor(t){t.writable===dt&&typeof t.next==pt&&(t=new Qo(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:vn(t)});try{t.size=t.size===dt?0:t.size}catch{throw new f(lo)}return t}}function ni(t){return Boolean(t&&t.getData)}async function ri(t,e){if(!t.init||t.initialized)return g.resolve();await t.init(e)}async function oi(t){return t=new ti(t),await ri(t),t.size!==dt&&t.readUint8Array||(t=new Do(await kn(t.readable)),await ri(t)),t}function ii(t,e,n){return t.readUint8Array(e,n)}function si(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?Eo.prototype.createReadable.call(t,e):t.readable}function ai(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}const ci="filename",ui="rawFilename",li="comment",di="rawComment",fi="uncompressedSize",wi="compressedSize",pi="offset",hi="diskNumberStart",mi="lastModDate",yi="rawLastModDate",gi="lastAccessDate",Si="rawLastAccessDate",Ei="creationDate",bi="rawCreationDate",Ri="internalFileAttributes",xi="externalFileAttributes",zi="msdosAttributesRaw",Fi="msdosAttributes",Di="msDosCompatible",Ai="zip64",Ii="encrypted",Ci="version",Ti="versionMadeBy",ki="zipCrypto",vi="directory",_i="executable",Ni="compressionMethod",Ui="signature",Oi="extraField",Mi="unixMode",Li="setuid",Bi="setgid",Wi="sticky",Pi=[ci,ui,fi,wi,mi,yi,li,di,gi,Si,Ei,bi,pi,hi,Ri,xi,zi,Fi,Di,Ai,Ii,Ci,Ti,ki,vi,_i,"symlink",Ni,Ui,"crc32",Oi,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Mi,"unixExternalUpper",Li,Bi,Wi,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Zi{constructor(t){Pi.forEach(e=>this[e]=t[e])}}const Hi=new u([1,$,10,J,28789,25461,Q,tt,et,22613,13]);function Vi(t,e,n){return t?e?12:16+4*n:0}const Gi="File format is not recognized",ji="End of central directory not found",qi="End of Zip64 central directory locator not found",Yi="Central directory header not found",Ki="Local file header not found",Xi="Zip64 extra field not found",$i="File contains encrypted entry",Ji="Encryption method not supported",Qi="Split zip file",ts="Overlapping entry found",es="Entry data out of bounds",ns="Ambiguous archive",rs="Encrypted central directory is not supported",os="Unsafe filename",is="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",ss="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",as="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",cs="64-bit value exceeds Number.MAX_SAFE_INTEGER",us="unsorted central directory",ls="unknown version needed to extract",ds="compressed patched data",fs="malformed extra field",ws="unknown zip64 extensible data",ps="wrapped entries count",hs="appended data",ms="prepended data",ys="prepended central directory",gs="trailing central directory data",Ss="duplicate filename",Es="mismatched zip64 end of central directory record",bs="multiple end of central directory records",Rs="mismatched local file header (filename)",xs="mismatched local file header (general purpose bit flag)",zs="mismatched local file header (compression method)",Fs="mismatched local file header (crc32 or sizes)",Ds=/^[a-zA-Z]:/,As=/(^|[\\/])\.\.([\\/]|$)/,Is="utf-8",Cs="cp437",Ts=[[fi,O],[wi,O],[pi,O],[hi,M]],ks={[M]:{wt:pa,bytes:4},[O]:{wt:ha,bytes:8}},vs=i(o.MAX_SAFE_INTEGER);class _s{constructor(t,e={}){n.assign(this,{reader:new ti(t),options:e,ht:{yt:new u,gt:[],St:[]}})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await ri(r),r.size!==dt&&r.readUint8Array||(r=new Do(await kn(r.readable)),await ri(r)),r.size<Y)throw new f(Gi);const o=e.warnings=[],i=$s(t,e.options),a=i==Lt,c=i!=Wt,l=ta(ca(e,t,_t),i),d=function(t,e){if(t===dt)return e;if(!Xs(t))throw new f(ss);return t}(ca(e,t,"filenameValidation"),i),p=ca(e,t,"normalizeFilename"),{Et:h,bt:m}=await ea(r,c,l);if(!h)throw await async function(t){return await Ks(t)==W}(r)?new f(Qi):new f(ji);c&&m>1&&aa(bs);const y=be(h);let g=pa(y,12),S=pa(y,16);const E=h.offset,b=wa(y,20),R=E+Y+b,x=r.size-R;x>l&&aa(hs),x>0&&ai(o,hs);let F=wa(y,4);const D=r.ut||0;let A,I,C,T,k,v=wa(y,6),_=wa(y,10),N=0,U=X;const B=S==O||g==O||_==M||v==M;if(S!=O&&v!=M&&(S+=Ys(r,v)),B){const t=h.offset>=K?await ii(r,h.offset-K,K):gt,e=be(t);if(t.length==K&&pa(e,0)==j){S=Ys(r,pa(e,4))+ha(e,8);let t=await ii(r,S,X),i=be(t);const c=h.offset-K-X;if((t.length<X||pa(i,0)!=G)&&S!=c&&c>=0){const e=S;S=c,S>e&&(N=S-e),t=await ii(r,S,X),i=be(t)}if(t.length<X||pa(i,0)!=G)throw new f(qi);if(C=!0,T=ha(i,4)>44,T){const t=s.min(ha(i,4)-44,r.size-S-X);t>0&&(U+=t,k=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=be(t),o=wa(r,26);n.assign(e,{compressionMethod:wa(r,0),compressedSize:ha(r,2),uncompressedSize:ha(r,10),encryptionAlgorithm:wa(r,18),bitLength:wa(r,20),flags:wa(r,22),hashAlgorithm:wa(r,24),hashData:t.subarray(28,28+o)})}return e}(await ii(r,S+X,t)))}F==M?F=pa(i,16):F!=pa(i,16)&&sa(a,o,Es),v==M?v=pa(i,20):v!=pa(i,20)&&sa(a,o,Es),_==M?_=ha(i,32):_!=ha(i,32)&&sa(a,o,Es),g==O?g=ha(i,40):g!=ha(i,40)&&sa(a,o,Es),S=Ys(r,v)+ha(i,48)+N}}let P=g;const Z=h.offset-(C?U+K:0);if(S>=r.size&&(N=r.size-S-g-Y,S=r.size-g-Y),D!=F)throw new f(Qi);if(S<0)throw new f(Gi);let V=0,$=await ii(r,S,g),J=be($);if(g){if($.length<4)throw new f(Gi);const t=Z-g;if(S!=t&&v==F){const e=pa(J,V)==H||Boolean(k&&k.compressedSize)||Ms(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=pa(be(await ii(r,t,4)),0)==H),n){const n=S;S=t,S>n&&(N+=S-n,A=e),$=await ii(r,S,g),J=be($)}}}const Q=Z-S;if(g!=Q&&Q>=0&&v==F&&(g=Q,$=await ii(r,S,g),J=be($)),S<0||S>=r.size)throw new f(Gi);e.directoryOffset=S,e.directoryLength=P;const tt=ua(e,t,"decryptCentralDirectory");let et,nt;if(tt&&_&&$.length>=4&&pa(J,0)!=H&&(T||Ms(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(k,P,$.length);nt=$.subarray(t),$=await tt($.subarray(0,t),k),J=be($),P=$.length,et=!0}k&&!et&&($.length<4||pa(J,0)==H)&&ai(o,ws),I=S;const ct=ca(e,t,"filenameEncoding"),ut=ca(e,t,"commentEncoding"),lt=new u;let ft,wt=-1;const pt=!a&&!C;!_&&pt&&(_=Ls(J,$,V),_&&ai(o,ps));for(let i=0;i<_;i++){const a=new Os(r,e.options);if(V+q>$.length||pa(J,V)!=H){if(0==i&&!et&&(T||Ms(J)))throw new f(rs);throw new f(Yi)}Ws(a,J,V+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=V+q,l=u+a.filenameLength+a.extraFieldLength,h=wa(J,V+4),m=!(h>>8),y=h>>8==3,g=wa(J,V+32),S=l+g,E=new w($.subarray(u,S)),b=E.subarray(0,a.filenameLength),R=E.subarray(a.filenameLength+a.extraFieldLength),x=c||!ct&&ro(b),F=c||!ut&&ro(R),D=pa(J,V+38),A=D&L,C={readOnly:Boolean(1&A),hidden:Boolean(2&A),system:Boolean(4&A),directory:Boolean(16&A),archive:Boolean(32&A)},k=pa(J,V+42),v=ua(e,t,"decodeText")||no,U=x?Is:ct||Cs,O=F?Is:ut||Cs;let B=v(b,U,Ot);if(B===dt&&(B=no(b,U)),p){const t=p(B);t!==dt&&(B=t)}if(Qs(B,d)){const t=new f(os);throw t.filename=B,t}let W=v(R,O,Mt);W===dt&&(W=no(R,O)),n.assign(a,{index:i,Rt:et,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,xt:g,offset:k,diskNumberStart:wa(J,V+34),internalFileAttributes:wa(J,V+36),externalFileAttributes:D,msdosAttributesRaw:A,msdosAttributes:C,rawFilename:b,filenameUTF8:x,commentUTF8:F,rawExtraField:E.subarray(a.filenameLength,a.filenameLength+a.extraFieldLength),rawComment:R,filename:B,comment:W}),Ps(a,a,J,V+6)&&ai(o,fs,B),a.offset+=N;const P=Ys(r,a.diskNumberStart)+a.offset;I=s.min(P,I),P<wt&&ai(o,us,B),wt=P,(a.version&L)>63&&ai(o,ls,B),32&~a.rawBitFlag||ai(o,ds,B),lt.has(a.filename)&&(ft=!0),lt.add(a.filename);const Z=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&Z&&(a.unixMode=Z);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),Y=Boolean(512&a.unixMode),K=40960==((a.unixMode===dt?Z:a.unixMode)&rt),X=!K&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&Z)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,tt=(Z&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:Y,symlink:K,unixExternalUpper:Z,executable:X,directory:Q||tt||m&&C.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const nt=new Zi(a);if(nt.getData=(t,n)=>a.getData(t,nt,e.ht,n),nt.arrayBuffer=async t=>{const r=new z,o=kn(r.readable).then(t=>t.arrayBuffer());return o.catch(()=>{}),await a.getData(r,nt,e.ht,n.assign({},t,{preventClose:!1})),o},V=S,i==_-1&&pt){const t=Ls(J,$,V);t&&(_+=t,ai(o,ps))}const{onprogress:ht}=t;if(ht)try{await ht(i+1,_,new Zi(a))}catch{}yield nt}let ht=V,mt=Bs($.subarray(V))||(et?Bs(nt):dt);if(!mt&&!et){const t=S+V,e=s.min(Z-t,65541);e>=6&&(mt=Bs(await ii(r,t,e)))}mt&&(e.digitalSignature=mt,ht=V+6+mt.length),(V!=P&&ht!=P||!et&&V!=g&&ht!=g)&&sa(a,o,gs),ft&&sa(a,o,Ss);const yt=ca(e,t,"extractPrependedData"),St=ca(e,t,"extractAppendedData"),Et=(a||yt)&&_&&4==I&&await async function(t){const e=await Ks(t);return e==W||808471376==e}(r)?4:0;return a&&(N||_&&I>Et)&&aa(ms),(N||_&&I>4)&&ai(o,ms),A&&ai(o,ys),yt&&(e.prependedData=I>Et?await ii(r,Et,I-Et):gt),e.comment=b?await ii(r,E+Y,b):gt,St&&(e.appendedData=R<r.size?await ii(r,R,r.size-R):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 Ns{constructor(t={}){let r;const{readable:o,writable:i}=new z({start(t){r=t}}),s=new _s(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 Us(t,e={}){if(t=new ti(t),await ri(t),t.size!==dt&&t.readUint8Array||(t=new Do(await kn(t.readable)),await ri(t)),t.size<Y)return!1;const n=$s(e,{}),r=n!=Wt,o=ta(e[_t],n),{Et:i,bt:s}=await ea(t,r,o);if(!i||n==Lt&&s>1)return!1;const a=wa(be(i),20),c=i.offset+Y+a;return t.size-c<=o}let Os=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:E,compressedSize:b}=i,{dataDescriptor:R}=m,x=e.localDirectory={},z=e.warnings=[],F=Ys(c,d)+l,A=await ii(c,F,ct),I=be(A);let C=ca(i,o,Et),T=ca(i,o,bt);const k=$t(ca(i,o,Rt)),v=Boolean(k),_=!0===k;if(Xt(C,T),C=C&&C.length&&C,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw new f(On);if(A.length<ct||pa(I,0)!=B)throw new f(Ki);Ws(x,I,4);const{extraFieldLength:N,filenameLength:U}=x,O=x.dataOffset=F+ct+U+N,M=ca(i,o,"checkLocalDirectory"),W=$s(o,i.options),Z=function(t,e){return t===dt?e!=Wt:Boolean(t)}(M,W),H=ca(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 ii(c,F+ct,U+N);G=t.subarray(0,U),x.rawExtraField=t.subarray(U)}else x.rawExtraField=N?await ii(c,F+ct+U,N):gt;V&&(x.rawFilename=G),Ps(i,x,I,4,!0)&&ai(z,fs),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Rt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||sa(s,o,Rs),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&sa(s,o,xs),e.compressionMethod!=t.compressionMethod&&sa(s,o,zs),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||sa(s,o,Fs)}(i,x,G,V,Z?dt:z);const{lastAccessDate:j,creationDate:q,uid:Y,gid:K}=x;j&&(e.lastAccessDate=j),q&&(e.creationDate=q),Y!==dt&&e.uid===dt&&(e.uid=Y),K!==dt&&e.gid===dt&&(e.gid=K);const X=ca(i,o,"checkPasswordOnly"),$=i.encrypted&&x.encrypted&&(!_||X),J=$&&!w;if(_||(e.zipCrypto=J),$&&!(64&~x.rawBitFlag))throw new f(Ji);const Q=v?dt:Wn(h);if(0!=h&&8!=h&&9!=h&&!Q&&!v)throw new f(On);if($){if(!J&&(w.strength<1||w.strength>3))throw new f(Ji);if(!C&&!T)throw new f($i)}if(O+b>c.size)throw new f(es);const tt=b,et=Yt(ca(i,o,xt));Kt(et);let nt=ca(i,o,"checkOverlappingEntry");const rt=ca(i,o,"checkOverlappingEntryOnly");rt&&(nt=!0);const{onstart:ot,onprogress:it,onend:st}=o,at=0!=h&&!v,ut=v?b-Vi($,J,w&&w.strength):E,lt=9==h;let ft=ca(i,o,Ft);lt&&(ft=!1);const wt=ca(i,o,"checkCrc32"),pt=(wt===dt?ca(i,o,"checkSignature"):wt)&&!v&&(!$||J||w&&1==w.vendorVersion),ht={options:{codecType:wr,password:C,rawPassword:T,zipCrypto:J,encryptionStrength:w&&w.strength,checkCrc32:pt,checkAuthenticationCode:ca(i,o,"checkAuthenticationCode"),passwordVerification:J&&(R?S>>>8&L:g>>>24&L),outputSize:ut,crc32:g,compressed:at,encrypted:$,useWebWorkers:ca(i,o,zt),useCompressionStream:ft,transferStreams:ca(i,o,Dt),deflate64:lt,format:Q?Q.format:dt,codecURI:Q?Q.codecURI:dt,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:X},config:a,F:{signal:et,size:tt,onstart:ot,onprogress:it,onend:st}};let mt,yt,St;nt&&await async function({reader:t,zt:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,ht:l}){let d=0;if(c&&(d=u?20:12),d){const n=await ii(t,a+i,d+4),r=be(n);let c=n.length==d+4&&pa(r,0)==P;if(c){const t=qs(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=qs(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,zt:e},{yt:p,gt:h,St:m}=l;if(!p.has(n)){const t=function(t,e){let n=0,r=t.length;for(;n<r;){const o=n+r>>>1;t[o].start<e.start?n=o+1:r=o}const o=t[n-1],i=t[n];return o&&js(e,o)?o:i&&js(e,i)?i:void 0}(h,w)||m.find(t=>js(w,t));if(t){const e=new f(ts);throw e.overlappingEntry=t.zt,e}p.add(n),m.push(w),m.length*m.length>h.length&&(m.sort((t,e)=>t.start-e.start),l.gt=function(t,e){const n=[];let r=0,o=0;for(;r<t.length||o<e.length;)o==e.length||r<t.length&&t[r].start<e[o].start?n.push(t[r++]):n.push(e[o++]);return n}(h,m),m.length=0)}}({reader:c,zt:e,index:u,offset:F,crc32:g,compressedSize:b,uncompressedSize:E,dataOffset:O,dataDescriptor:R||x.bitFlag.dataDescriptor,extraFieldZip64:p||x.extraFieldZip64,ht:r});try{if(!rt){X&&(t=new D),t=new ei(t),await ri(t,function(t,e,n){return s.min(t,n?1032*e:e)}(ut,b,at)),({writable:mt}=t);const e=Tn(c.createReadable({offset:O,size:tt})),{outputSize:r}=await qr({readable:e,writable:mt},ht);if(r!=ut)throw n.assign(new f(Vn),{outputSize:r});t.size+=r}}catch(e){const{outputSize:n}=ht;if(n!==dt?t.size+=n:Re(e)&&e.outputSize!==dt&&(t.size+=e.outputSize),!X||!Re(e)||e.message!=Qe)throw yt=e,St=!0,e}finally{if((ni(t)||!ca(i,o,At))&&mt&&!mt.locked){const t=mt.getWriter();if(St)try{await t.abort(yt)}catch{}else await t.close()}}return X||rt?dt:t.getData?t.getData():mt}};function Ms(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==pa(t,n))return!0;return!1}function Ls(t,e,n){let r=0;for(;n+q<=e.length&&pa(t,n)==H;)n+=q+wa(t,n+28)+wa(t,n+30)+wa(t,n+32),r++;return r%65536?0:r}function Bs(t){if(t.length>=6){const e=be(t);if(pa(e,0)==Z){const n=wa(e,4);if(6+n<=t.length)return new w(t.subarray(6,6+n))}}}function Ws(t,e,r){const o=t.rawBitFlag=wa(e,r+2),i=!(1&~o),s=pa(e,r+6);n.assign(t,{encrypted:i,version:wa(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:la(s),filenameLength:wa(e,r+22),extraFieldLength:wa(e,r+24)})}function Ps(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=be(s);let d=0,w=!1;try{for(;d<s.length;){const t=wa(l,d),e=wa(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=wa(r,o+4);n.assign(e,{signature:pa(r,o+10),crc32:pa(r,o+10),compressedSize:pa(r,o+14),uncompressedSize:pa(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=be(t.data),r=Ts.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+ks[e].bytes,0);if(t.data.length<o)throw new f(Xi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=ks[a];e[s]=t[s]=c.wt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(Zs(m,ci,ui,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(Zs(y,li,di,e,t),e.extraFieldUnicodeComment=y);const g=u.get($);g&&g.data.length>=7?(function(t,e,r){const o=be(t.data),i=fa(o,4);n.assign(t,{vendorVersion:fa(o,0),vendorId:fa(o,2),strength:i,originalCompressionMethod:r,compressionMethod:wa(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&&(Hs(S,e),e.extraFieldPkwareUnix=S);const E=u.get(22613);E&&(Hs(E,e),e.extraFieldUnixType1=E);const b=u.get(10);b&&(function(t,e){const r=be(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=wa(r,i),n=wa(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=be(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:da(i),lastAccessDate:da(s),creationDate:da(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(b,e),e.extraFieldNTFS=b);const R=u.get(et);let x;if(R&&(x=Vs(R,e,!1),e.extraFieldUnix=R),!x){const t=u.get(tt);t&&(Vs(t,e,!0),e.extraFieldInfoZip=t)}const z=u.get(J);z&&(function(t,e,n){if(!t.data.length)return;const r=be(t.data),o=fa(r,0),i=[],s=[];n?(1&~o||(i.push(mi),s.push(yi)),2&~o||(i.push(gi),s.push(Si)),4&~o||(i.push(Ei),s.push(bi))):t.data.length>=5&&(i.push(mi),s.push(yi));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=pa(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(Q);return F&&(e.extraFieldUSDZ=F),w}function Zs(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=be(t.data),a=new ve;a.append(i[r]);const c=be(new w(4));c.setUint32(0,a.get(),!0);const u=pa(s,1),l=fa(s,0);n.assign(t,{version:l,[e]:no(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==pa(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function Hs(t,e){if(t.data.length<8)return;const r=be(t.data),o={lastAccessDate:new a(1e3*(0|pa(r,0))),lastModDate:new a(1e3*(0|pa(r,4)))};t.data.length>=12&&(o.uid=wa(r,8),o.gid=wa(r,10)),n.assign(t,o),n.assign(e,o)}function Vs(t,e,r){try{const o=be(t.data);let i,s;if(r){let e=0;const r=fa(o,e++),a=fa(o,e++);i=Gs(t.data.subarray(e,e+a)),e+=a;const c=fa(o,e++);s=Gs(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=wa(o,0),s=wa(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 Gs(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function js(t,e){return t.start<e.end&&e.start<t.end}function qs(t,e,n){const r=pa(t,e);let o,i;return n?(o=ha(t,e+4),i=ha(t,e+12)):(o=pa(t,e+4),i=pa(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Ys(t,e){return t.ft?t.ft(e):0}async function Ks(t){return pa(be(await ii(t,0,4)))}function Xs(t){return t===Lt||t===Bt||t===Wt}function $s(t,e){return Js(t,Js(e,Bt))}function Js(t,e){const n=t.strictness;if(n!==dt){if(!Xs(n))throw new f(is);return n}const r=t.checkAmbiguity;return r===dt?e:r?Lt:e==Wt?Wt:Bt}function Qs(t,e){if(e==Wt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(As.test(t)||t.startsWith("/")||t.startsWith("\\")||Ds.test(t))||e==Lt&&(n.includes(".")||n.includes("")||t.includes("\0"))}function ta(t,e){if(t!==dt){const e=te(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(as);return e}return e==Lt?0:e==Wt?1/0:M}async function ea(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 na(t,o)){const o=wa(n,d+20);if(f+Y+o==r){const o=await oa(t,n,s,d,f,r,i);if(2==o){if(a||(a=ra(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=ra(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 na(t,o)){const o=ra(c,u,l);i||(i=o);const d=await oa(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Et:a,bt:u}}async function*na(t,e){const n=t.size-e,r=await ii(t,n,e),o=be(r);for(let t=r.length-Y;t>=0;t--)pa(o,t)==V&&(yield[o,n,r,t,n+t])}function ra(t,e,n){return{offset:n,buffer:new w(t.subarray(e,e+Y)).buffer}}async function oa(t,e,n,r,o,i,s){const a=wa(e,r+10),c=pa(e,r+12),u=pa(e,r+16);if(a==M||c==O||u==O)return await ia(t,e,n,o-K,i,s)==j?2:0;if(!a&&!c)return 1;const l=wa(e,r+6);for(const r of[o-c,Ys(t,l)+u])if(await ia(t,e,n,r,i,s)==H)return 2;return 0}async function ia(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?pa(e,r-n):i.count>0?(i.count--,pa(be(await ii(t,r,4)),0)):dt}function sa(t,e,n){t?aa(n):ai(e,n)}function aa(t){const e=new f(ns);throw e.reason=t,e}function ca(t,e,n){return e[n]===dt?t.options[n]:e[n]}function ua(t,e,n){return qt(ca(t,e,n))}function la(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 da(t){return new a(o(t/i(1e4)-i(116444736e5)))}function fa(t,e){return t.getUint8(e)}function wa(t,e){return t.getUint16(e,!0)}function pa(t,e){return t.getUint32(e,!0)}function ha(t,e){const n=t.getBigUint64(e,!0);if(n>vs)throw new f(cs);return o(n)}var ma=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ns,ERR_BAD_FORMAT:Gi,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Yi,ERR_ENCRYPTED:$i,ERR_ENCRYPTED_CENTRAL_DIRECTORY:rs,ERR_ENTRY_DATA_OUT_OF_BOUNDS:es,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:qi,ERR_EOCDR_NOT_FOUND:ji,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Xi,ERR_INVALID_AUTHENTICATION_CODE:Je,ERR_INVALID_COMPRESSED_DATA:Gn,ERR_INVALID_CRC32:jn,ERR_INVALID_FILENAME_VALIDATION:ss,ERR_INVALID_MAX_APPENDED_DATA_SIZE:as,ERR_INVALID_PASSWORD:$e,ERR_INVALID_STRICTNESS:is,ERR_INVALID_UNCOMPRESSED_SIZE:Vn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ki,ERR_OVERLAPPING_ENTRY:ts,ERR_SPLIT_ZIP_FILE:Qi,ERR_UNSAFE_FILENAME:os,ERR_UNSUPPORTED_COMPRESSION:On,ERR_UNSUPPORTED_ENCRYPTION:Ji,ERR_UNSUPPORTED_UINT64:cs,ERR_WORKER_STARTUP_TIMEOUT:mr,WARNING_APPENDED_DATA:hs,WARNING_COMPRESSED_PATCHED_DATA:ds,WARNING_DUPLICATE_FILENAME:Ss,WARNING_MALFORMED_EXTRA_FIELD:fs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:xs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:zs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:Fs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:Rs,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:Es,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:bs,WARNING_PREPENDED_CENTRAL_DIRECTORY:ys,WARNING_PREPENDED_DATA:ms,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:gs,WARNING_UNKNOWN_VERSION:ls,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:ws,WARNING_UNSORTED_CENTRAL_DIRECTORY:us,WARNING_WRAPPED_ENTRIES_COUNT:ps,ZipReader:_s,ZipReaderStream:Ns,isZipFile:Us});const ya="File already exists",ga="Zip file comment exceeds 64KB",Sa="Invalid zip file comment (must be a Uint8Array)",Ea="File entry comment exceeds 64KB",ba="Invalid file entry comment (must be a string)",Ra="Invalid date (must be a valid Date instance)",xa="File entry name exceeds 64KB",za="Version exceeds 65535",Fa="The strength must equal 1, 2, or 3",Da="Encryption is not supported in USDZ files",Aa="Split zip files are not supported in USDZ files",Ia="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",Ca="Invalid extra field (must be a Map)",Ta="Invalid extra field type (must be integer 0..65535)",ka="Invalid extra field data (must be a Uint8Array)",va="Extra field data exceeds 64KB",_a=-2147483648,Na=2147483647,Ua=i(0),Oa=i("0x7fffffffffffffff"),Ma="Zip64 is not supported (set the 'zip64' option to 'true')",La="Undefined uncompressed size",Ba="Undefined compression method",Wa="Undefined CRC32",Pa="Undetermined size",Za="Undefined reader",Ha="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",Va="Zip file not empty",Ga="Invalid uid (must be integer 0..2^32-1)",ja="Invalid gid (must be integer 0..2^32-1)",qa="Invalid UNIX mode (must be integer 0..65535)",Ya="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Ka="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Xa="Invalid msdosAttributesRaw (must be integer 0..255)",$a="Invalid msdosAttributes (must be an object with boolean flags)",Ja="Invalid level (must be integer 0..9)",Qa="Signature data exceeds 64KB",tc="Invalid entry option (must be an entry returned by ZipReader#getEntries())",ec="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",nc="compression unavailable",rc="clamped last modification date",oc=new w([7,0,2,0,65,69,3,0,0]),ic="infozip",sc="unix",ac=[8,9,5,3];let cc=0;const uc=[];class lc{constructor(t,e={}){t=new ei(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(Aa);n.assign(this,{writer:t,Ft:i,options:e,Dt:new c,At:new u,offset:e[kt]===dt?t.size||t.writable.size||0:e[kt],It:e[kt]===dt?0:e[kt]-(t.size||t.writable.size||0),Ct:new u,Tt:[],warnings:[],kt:0,vt:0,_t:dt,Nt:!1})}prependZip(t){return wc(this,async function(t,e){if(t.At.size)throw new f(Va);await t.Ut(e)}(this,t))}appendZip(t){return wc(this,this.Ut(t))}async Ut(t){const r=this,{Ct:o,At:i,Dt: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 ti(t),await ri(t),t.size!==dt&&t.readUint8Array||(t=new Do(await kn(t.readable)),await ri(t));const{ZipReader:o}=await g.resolve().then(function(){return ma}),a=new o(t),u=await a.getEntries();await a.close(),await ri(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(ya);i.add(t),l.push(t)}),r.Ot=!0;const{Mt:p}=r;r.Mt=new g(t=>d=()=>{r.Ot=!1,t()}),await p,r.Ft&&(delete r.Ft,await async function(t){return be(await ii(t,0,4)).getUint32(0,!0)==W}(t)||(await Lc(r.writer,Oc()),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)=>Uc(n,t)-Uc(n,e));let c=0;for(const e of a){const r=Uc(n,e);await _c(t,n,c,r-c),Tc(i,await Nc(n,r))&&await i.closeDisk(),s.set(e,{offset:kc(t,i),diskNumberStart:Ic(i)}),c=r}await _c(t,n,c,o-c)}else{const e=t.offset;await _c(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Uc(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=vc(f||gt),t.extraFieldAES&&(d=99);const y=tu(f),g=Boolean(l)&&l.uncompressedSize!==dt,S=Boolean(l)&&l.compressedSize!==dt,E=-7&ru(w,p,m,a,d)|w<<1,{Lt:b,Bt:R}=eu({version:e,bitFlag:E,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,Wt:S,Pt:g,extraFieldLength:y}),{crc32:x}=t;x!==dt&&$c(R,10,x);const{offset:z,diskNumberStart:F}=h.get(t);n.assign(t,{Zt:!0,Pt:g,Wt:S,offset:z,diskNumberStart:F,Ht:!1,Vt:gt,Gt:gt,jt:gt,qt:gt,Yt:gt,rawExtraField:f,Kt:gt,Lt:b,Bt:R}),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,{Ct:s}=o,a=async function(t,e,r,o){const s=(o=n.assign({},o))[Ut];if(s!==dt){const{Xt:e,$t:r}=mc(s,$t(Hc(t,o,Rt)),Hc(t,o,mi));delete o[Ut],o=n.assign(e,r,o)}if(Hc(t,o,vi)&&!e.endsWith(at)&&(e+=at),t.At.has(e))throw new f(ya);t.At.add(e),cc<we().maxWorkers?cc++:await new g(t=>uc.push(t));try{return await async function(t,e,r,o){const s=yc(t,e,o);({name:e}=s);const a=gc(t,e,o),{comment:c}=a,u=o[Oi];t.Dt.set(e,dt);const l=t._t,d={};let w,p;a.Jt.keepOrder&&(d.Qt=new g(t=>w=t)),t._t=d;try{const{Jt:c}=a;0==c.level||c.compressionMethod!==dt||c.te||await br(we())||(c.level=0,ai(t.warnings,nc,e));const u=await async function(t,e,{Jt:r},o){if(r.te&&!e&&!Hc(t,o,vi))throw new f(Za);let i;if(e){if(e=new ti(e),await ri(e),!e.readable&&!e.readUint8Array)throw new f(Ha);({size:i}=e)}return n.assign({reader:e},Ec(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=Cc(t.writer),m=Ic(t.writer);let y=o.crc32===dt?o[Ui]:o.crc32;const S=u.Jt.encrypted&&!c.zipCrypto;if(c.te&&!c.ee&&S&&(y=dt),c.te&&r&&!S&&y===dt)throw new f(Wa);const E=Rc(o=n.assign({},o,s.Jt,a.Jt,u.Jt,{signature:o[Ui],crc32:y,offset:t.offset-h,diskNumberStart:m,[vt]:t.options[vt]}));E.ne&&ai(t.warnings,rc,e);const b=Fc(o),R=tu(E.re,b.oe);p=await async function(t,e,r,o,s){const{Dt:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,ie:d,signal:w}=s,{se:p,zt:h,ae:m,ce:y}=o,S=t.options[vt];let E,b,R,x,F,D,A,I=h,C=0;const T=u&&m?m.Qt:dt;a.set(e,I);try{s.bufferedWrite||!u||t.Ot||t.kt||t.vt||!l&&!d?(E=!0,t.kt++,A=s.createTempStream?await s.createTempStream():new z(dt,dt,{highWaterMark:ft}),A.size=0,await ri(c)):(b=!0,t.vt++,A=c,await T,await k()),await ri(A);const h=Cc(c);t.Ft&&!E&&await Mc(t,c),S&&!E&&xc(o,t.offset-h);const{re:m}=p;E||await v();const y=Ic(c),R=kc(t,c);if(I.diskNumberStart=y,E||(F=!0,D=c.size,await Lc(A,m)),I=await async function(t,e,{diskNumberStart:r,Qt:o},s,a,c){const{se:u,ue:l,le:d}=s,{Lt:w,Bt:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:S,compressionMethod:E,Vt:b,de:R,jt:x,fe:z,we:F,qt:D,Yt:A,Gt:I}=u,{oe:C}=l,{rawFilename:T,lastAccessDate:k,creationDate:v,password:_,rawPassword:N,level:U,useUnicodeFileNames:M,zip64:B,Zt:W,Pt:P,Wt:Z,zipCrypto:H,dataDescriptor:V,directory:G,executable:j,versionMadeBy:q,rawComment:Y,rawExtraField:K,Kt:X,useWebWorkers:$,transferStreams:J,onstart:Q,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,te:Et,ee:bt,format:Rt,codecURI:xt}=c,zt={Qt:o,versionMadeBy:q,zip64:B,Zt:W,directory:Boolean(G),executable:Boolean(j),filenameUTF8:Boolean(M),rawFilename:T,commentUTF8:Boolean(M),rawComment:Y,Vt:b,de:R,jt:x,qt:D,Yt:A,Gt:I,rawExtraField:K,Kt: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;Et||(Dt=0);const{writable:It}=e;if(t){const n=t.size,r=Tn(si(t,{size:n})),o={options:{codecType:fr,inputSize:n,level:U,rawPassword:N,password:_,encryptionStrength:rt,zipCrypto:y&&H,passwordVerification:y&&H&&m>>8&L,computeCrc32:!Et,compressed:g&&!Et,encrypted:y&&!bt,useWebWorkers:$,useCompressionStream:St,transferStreams:J,format:Rt,codecURI:xt,compressionMethod:E},config:a,F:{signal:nt,size:n,onstart:Q,onprogress:tt,onend:et}};try{const t=await qr({readable:r,writable:It},o);if(At=t.outputSize,e.size+=At,Et||(Dt=t.inputSize,y&&!H||(Ft=t.crc32)),!Z&&At>=O||!P&&Dt>=O)throw new f(Ma)}catch(t){const{outputSize:n}=o;throw n!==dt?e.size+=n:Re(t)&&t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,se:r,ue:o},{zip64:s,zipCrypto:a,te:c,dataDescriptor:u}){const{Bt:l,encrypted:d}=r,{pe:f,he:w}=o;d&&!a&&!c||t===dt||($c(l,10,t),u&&$c(f,w,t)),s?u&&(Jc(f,w+4,i(e)),Jc(f,w+12,i(n))):($c(l,14,e),$c(l,18,n),u&&($c(f,w+4,e),$c(f,w+8,n)))}({crc32:Ft,compressedSize:At,uncompressedSize:Dt,se:u,ue:l},c),V&&await Lc(e,C),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:E,version:S,Lt:w,Bt:p,signature:Ft,crc32:!y||H||Et?Ft:dt,fe:z,we:F,Pt:P,Wt:Z}),zt}(r,A,I,o,we(),s),E||(F=!1),a.set(e,I),I.filename=e,E){if(await g.all([A.writable.getWriter().close(),T]),await k(),t.Ft&&await Mc(t,c),x=!0,D=c.size,await v(),I.diskNumberStart=Ic(c),I.offset=kc(t,c),S){const e=o.le;xc(o,t.offset-Cc(c)),I.size+=o.le-e}!function({rawFilename:t,encrypted:e,zip64:n,de:r,crc32:o,compressedSize:s,uncompressedSize:a,Pt:c,Wt:u},l,{dataDescriptor:d,te:f}){if(d||((!e||f&&o!==dt)&&$c(l,14,o),u||$c(l,18,s),c||$c(l,22,a)),n&&r){const e=ct+tu(t)+4;Jc(l,e,i(a)),Jc(l,e+8,i(s))}}(I,p.me,s),await Lc(c,p.re),await Bc(A.readable,c,w,t=>C+=t),c.size+=A.size,x=!1}else I.diskNumberStart=y,I.offset=R;return t.offset+=I.size,I}catch(n){if(x||F){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-D,E&&(t.offset+=C)}throw a.delete(e),n}finally{if(E&&t.kt--,b&&t.vt--,y&&y(T),R&&R(),E&&A&&A.dispose)try{await A.dispose()}catch{}}async function k(){t.Ot=!0;const{Mt:e}=t;t.Mt=new g(e=>R=()=>{t.Ot=!1,e()}),await e}async function v(){Tc(c,tu(p.re))&&await c.closeDisk()}}(t,e,r,{se:E,ue:b,le:R,zt:d,ae:l,ce:w},o)}catch(n){throw t.Dt.delete(e),n}finally{w&&w(l&&l.Qt)}return n.assign(p,{name:e,comment:c,extraField:u}),new Zi(p)}(t,e,r,o)}catch(n){throw t.At.delete(e),n}finally{const t=uc.shift();t?t():cc--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return g.prototype.then.call(a,c,c),wc(o,a)}remove(t){const{At:e,Dt: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,{Ct:o,writer:s}=this,{writable:a}=s;if(r.Nt)return fc(s);if(!(t instanceof w))throw new f(Sa);if(tu(t)>M)throw new f(ga);for(;o.size;)await g.allSettled(e.from(o));await g.allSettled(r.Tt.map(t=>t.ye));const c=r.Tt.filter(t=>t.ge&&!t.Se);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.Se=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{Ee:o,be:s}=Dc(t.Dt),{Re:a,xe:c,ze:u}=await async function(t,n,r){const{Dt:o,writer:i}=t,s=new w(n);await ri(i);let a=0,c=0,u=Ic(i),l=Cc(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,Vt:w,Gt:p,jt:h,qt:m,Yt:y,rawExtraField:g,Kt:S,rawComment:E,versionMadeBy:b,Lt:R,Bt:x,Pt:z,Wt:F,Ht:D,Fe:A,internalFileAttributes:I,externalFileAttributes:C,diskNumberStart:T,uncompressedSize:k,compressedSize:v}=n,_=tu(w,p,h,m,y,g,S),N=q+tu(f,E)+_;Tc(i,a+N-c)&&(await Lc(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=Ic(i),l=Cc(i)),z||$c(x,18,k),F||$c(x,14,v),(A||D)&&n.version<45&&Xc(x,0,45);const U=Ac(N);if(U.De(H),U.Ae(b),U.Ie(R.subarray(0,24)),U.Ae(_),U.Ae(tu(E)),U.Ae(D?M:T),U.Ae(I),U.De(C),U.De(A?O:e),U.Ie(f),U.Ie(w),U.Ie(p),U.Ie(h),U.Ie(m),U.Ie(y),U.Ie(g),U.Ie(S),U.Ie(E),Qc(s,U.it,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new Zi(n))}catch{}}return await Lc(i,c?s.slice(c):s),{Re:{diskNumber:u,diskOffset:l},xe:{diskNumber:Ic(i),Ce:d},ze:s}}(t,o,r),l=await async function(t,e,n){const r=Gc(t,n,Nt);if(r){const n=await r(e),o=tu(n);if(o>M)throw new f(Qa);const i=Ac(6+o);i.De(Z),i.Ae(o),i.Ie(n);const{writer:s}=t;return Tc(s,tu(i.it))&&await s.closeDisk(),await Lc(s,i.it),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{Re:s,xe:a,Te:c,be:u}=r;let{Ee:l}=r,d=t.Dt.size,w=s.diskNumber,p=kc(t,s);const h=tu(e);if(h>M)throw new f(ga);let m=Hc(t,n,Ai),y=Ic(o);if(Tc(o,(m?98:Y)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(Ma);m=!0}else m===dt&&u&&(m=!0);const g=Ac(m?98:Y);Tc(o,tu(g.it)+h)&&await o.closeDisk(),y=Ic(o);let S=y==a.diskNumber?a.Ce:0;m&&(g.De(G),g.ke(44),g.Ae(45),g.Ae(45),g.De(y),g.De(w),g.ke(S),g.ke(d),g.ke(l),g.ke(p),g.De(j),g.De(y),g.ke(i(kc(t,o))+i(l)+i(c)),g.De(y+1),Hc(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),S=M,d=M,p=O,l=O),g.De(V),g.Ae(y),g.Ae(w),g.Ae(S),g.Ae(d),g.De(l),g.De(p),g.Ae(h),await Lc(o,g.it),h&&await Lc(o,e)}(t,n,r,{Re:a,xe:c,Ee:o,Te:l,be:s})}(r,t,n),r.Nt=!0,!ni(s)&&Hc(r,n,At)||await a.getWriter().close(),fc(s)}[St](){return this.close()}}class dc extends g{then(t,e){const{ve:n}=this;return n&&(n.Se=!0),super.then(t,e)}}function fc(t){return t.getData?t.getData():t.writable}function wc(t,e){const r=new dc((t,n)=>g.prototype.then.call(e,t,n)),o={};return r.ve=o,o.ye=g.prototype.then.call(r,dt,t=>n.assign(o,{ge:!0,error:t})),t.Tt.push(o),r}async function pc(t,e){try{await t.writer.writable.abort(e)}catch{}}function hc(t,e,n){t.Ct.add(e),e.catch(t=>{try{n(t)}catch{}})}function mc(t,r,o){if(null===t||typeof t!=ht||e.isArray(t))throw new f(tc);const{externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:g,crc32:S,compressionMethod:E,extraFieldAES:b,extraFieldUnix:R,internalFileAttributes:x,extraField:z,bitFlag:F,directory:D,uid:A,gid:I}=t,C={externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,creationDate:p,lastAccessDate:h,internalFileAttributes:x,directory:D};F&&F.languageEncodingFlag&&(C[Ct]=!0);const T=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{Hi.has(n)||e.set(n,t.data)}),e.size)return e}}(z);T&&(C[Oi]=T),A===dt&&I===dt||n.assign(C,{uid:A,gid:I,unixExtraFieldType:R?sc:ic});const k={};if(r&&!D)if(n.assign(k,{uncompressedSize:m,crc32:S,compressionMethod:E}),r!==Pt&&n.assign(k,{encrypted:y,zipCrypto:g,encryptionStrength:b?b.strength:dt}),F&&(k.dataDescriptor=F.dataDescriptor,k[It]=ac[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(ec);return{Xt:C,$t:k}}function yc(t,n,r){let o=Hc(t,r,Di),i=Hc(t,r,Ti,o?20:768);const s=Hc(t,r,_i),a=jc(t,r,"uid"),c=jc(t,r,"gid");let u=jc(t,r,Mi),l=Hc(t,r,"unixExtraFieldType"),d=Hc(t,r,Li),w=Hc(t,r,Bi),p=Hc(t,r,Wi);if(Qt(a,O,Ga),Qt(c,O,ja),Qt(u,M,qa),l!==dt&&l!==ic&&l!==sc)throw new f(Ya);if(l===sc&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Ka);l!==dt||a===dt&&c===dt||(l=ic);let h=jc(t,r,zi),m=Hc(t,r,Fi);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),Qt(h,L,Xa),m&&(typeof m!==ht||e.isArray(m)))throw new f($a);if(i>M)throw new f(za);let g=Hc(t,r,xi);const S=g!==dt;S||(g=0),!r[vi]&&n.endsWith(at)&&(r[vi]=!0);const E=Hc(t,r,vi);if(E?(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||(E?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 b=g>>16&M,R=u!==dt&&40960==(u&rt);return{name:n,Jt:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:g,unixExternalUpper:b,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:R,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function gc(t,e,n){const r=Gc(t,n,"encodeText")||Ne;let i=r(e,Ot);if(i===dt&&(i=Ne(e)),tu(i)>M)throw new f(xa);const s=n[li]||"";if(typeof s!=mt)throw new f(ba);let c=r(s,Mt);if(c===dt&&(c=Ne(s)),tu(c)>M)throw new f(Ea);const u=Hc(t,n,Ci);if(u!==dt&&u>M)throw new f(za);const l=Vc(t,n,mi,new a),d=Hc(t,n,yi),w=Vc(t,n,gi),p=Vc(t,n,Ei),h=Hc(t,n,Ri,0),m=$t(Hc(t,n,Rt)),y=Boolean(m),g=!0===m,S=Hc(t,n,Et),E=Hc(t,n,bt);Xt(S,E);const b=jc(t,n,"encryptionStrength",3),R=Hc(t,n,ki),x=Hc(t,n,"extendedTimestamp",!0),z=Hc(t,n,"ntfsTimestamp"),F=Hc(t,n,"keepOrder",!0),D=Hc(t,n,zt),A=Hc(t,n,Dt),I=Hc(t,n,"bufferedWrite"),C=Gc(t,n,"createTempStream"),T=Hc(t,n,"dataDescriptorSignature",!0),k=Yt(Hc(t,n,xt));Kt(k);const v=Hc(t,n,Ct,!nu(i)||!nu(c)),_=Hc(t,n,Ni),N=y||_===dt?dt:Wn(_);if(!y&&_!==dt&&0!==_&&8!==_&&!N)throw new f(On);let U=jc(t,n,It);if(Qt(U,9,Ja),t.options[vt]){if(S!==dt||E!==dt)throw new f(Da);U===dt&&_===dt&&(U=0)}y&&(U=te(n[It]));let O=Hc(t,n,Ft),L=Hc(t,n,Tt);I&&L===dt&&(L=!1),(L===dt||R&&!g)&&(L=!0),U!==dt&&6!=U&&(O=!1);const B=Hc(t,n,Ai);if(!(R||S===dt&&E===dt||o.isInteger(b)&&b>=1&&b<=3))throw new f(Fa);const W=Sc(n[Oi]),P=Sc(n.localExtraField),Z=Sc(n.centralExtraField);return{comment:s,Jt:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,te:y,ee:g,password:S,rawPassword:E,encryptionStrength:b,zipCrypto:R,extendedTimestamp:x,ntfsTimestamp:z,keepOrder:F,useWebWorkers:D,transferStreams:A,bufferedWrite:I,createTempStream:C,dataDescriptorSignature:T,signal:k,useUnicodeFileNames:v,compressionMethod:_,format:N?N.format:dt,codecURI:N?N.codecURI:dt,_e:N?N.versionNeeded:dt,level:U,useCompressionStream:O,dataDescriptor:L,zip64:B,rawExtraField:W,Ne:P,Kt:Z}}}function Sc(t){if(!t)return gt;if(!(t instanceof c))throw new f(Ca);let e=0,n=0;t.forEach((t,n)=>{if(Jt(n,M,Ta),!(t instanceof w))throw new f(ka);if(tu(t)>M)throw new f(va);e+=4+tu(t)});const r=new w(e),o=be(r);return t.forEach((t,e)=>{Xc(o,n,e),Xc(o,n+2,tu(t)),Qc(r,t,n+4),n+=4+tu(t)}),r}function Ec(t,e,n,r,o){const{te:i,ee: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[fi],y===dt)throw new f(La);if(h===dt)throw new f(Ba)}const S=!0===w,E=Hc(t,o,Ii);if(e&&s&&!E&&tu(c,u))throw new f(Ia);const b=e&&(Boolean(c&&tu(c)||u&&tu(u))||s&&E);e||(p=0,h=0);const R=Vi(b,a,l);e&&(i?(o.uncompressedSize=y,m=n===dt?qc(y)+R:n+(s?0:R)):n===dt?(d=!0,(w||w===dt)&&(w=g=!0,m=4294967296)):(o.uncompressedSize=y=n,m=(Yc(h,p)?qc(y):y)+R));const x=!(b||e&&(0!==n||i)||Yc(h,p));x&&Hc(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(Ma);w=!0}return w=w||!1,{Ue:m,Jt:{dataDescriptor:d,ie:x,zip64:w,Zt:S,Oe:g,Pt:z,Wt:F,uncompressedSize:y,level:p,compressionMethod:h,encrypted:b}}}function bc(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 Rc(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,Ne:m,encryptionStrength:y,extendedTimestamp:g,ntfsTimestamp:S,te:E,encrypted:b,Pt:R,Wt:x,uncompressedSize:z,Oe:F,crc32:D}=t;let{version:A,compressionMethod:I}=t;const C=!p&&Yc(I,c);let T;const k=E||!C,v=u&&(t.bufferedWrite||!w||!R&&!x||k&&!F),_=v||u&&w&&(R||x);if(u&&(R||x)){const t=20,e=Ac(t);if(e.Ae(1),e.Ae(t-4),T=e.it,v&&(e.ke(z),k)){const t=Vi(b,l,y);e.ke(E?0:z+t)}}else T=gt;let N,U,O,L,W;if(b&&!l){const t=Ac(tu(oc)+2);t.Ae($),t.Ie(oc),N=t.it,N[8]=y}else N=gt;if(g){const t=Pc(n),e=(P=t)>=_a&&P<=Na;if(e){const e=9+(o?4:0)+(i?4:0),n=Ac(e);L=1+(o?2:0)+(i?4:0),W=t,n.Ae(J),n.Ae(e-4),n.Me(L),n.De(t),o&&n.De(Zc(Pc(o))),i&&n.De(Zc(Pc(i))),O=n.it}else O=gt;if(S===dt?!e||Boolean(o||i):S)try{const t=Wc(n),e=Ac(36);e.Ae(10),e.Ae(32),e.Le(4),e.Ae(1),e.Ae(24),e.ke(t),e.ke(o?Wc(o):t),e.ke(i?Wc(i):t),U=e.it}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!=ic||e===dt&&n===dt)if(r!=sc||e===dt&&n===dt)Z=gt;else{const t=Ac(8);t.Ae(et),t.Ae(4),t.Ae((e===dt?0:e)&M),t.Ae((n===dt?0:n)&M),Z=t.it}else{const t=zc(e===dt?0:e),r=zc(n===dt?0:n),o=3+t.length+r.length,i=Ac(4+o);i.Ae(tt),i.Ae(o),i.Me(1),i.Me(t.length),i.Ie(t),i.Me(r.length),i.Ie(r),Z=i.it}}catch{Z=gt}I===dt&&(I=C?8:0),A===dt&&(A=0!=I||p||b?20:10);const{_e:H}=t;C&&H!==dt&&(A=A>H?A:H),u&&(A=A>45?A:45),b&&!l&&(A=A>51?A:51,E&&D!==dt&&(N[4]=1),Xc(be(N),9,I),I=99);const V=_?tu(T):0,G=V+tu(N,O,U,Z,h,m);if(G+(t[vt]?67:0)>M)throw new f(va);const j=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),q=j<lt?lt:j>ut?ut:j,Y=tu(O)?new a(1e3*Pc(n)):tu(U)?n:q,{Lt:K,Bt:X,rawLastModDate:Q}=eu({version:A,bitFlag:ru(c,d,w,b,I),compressionMethod:I,uncompressedSize:z,lastModDate:q,rawLastModDate:r,rawFilename:e,Wt:x,Pt:R,extraFieldLength:G}),nt=Ac(ct+tu(e)+G),rt=nt.it,ot=be(rt);return nt.De(B),nt.Ie(K),nt.Ie(e),_&&nt.Ie(T),nt.Ie(N),nt.Ie(O),nt.Ie(U),nt.Ie(Z),nt.Ie(h),nt.Ie(m),w&&(x||$c(ot,18,0),R||$c(ot,22,0)),{re:rt,me:ot,Lt:K,Bt:X,lastModDate:Y,ne:Y===q&&j.getTime()!=q.getTime(),rawLastModDate:Q,encrypted:b,compressed:C,version:A,compressionMethod:I,fe:L,we:W,Vt:gt,de:V,jt:O,qt:U,Yt:Z,Gt:N,extraFieldLength:G}}function xc(t,e){const{se:n}=t;let{re:r,extraFieldLength:o}=n,i=64-(e+tu(r))%64;i<4&&(i+=64);const s=new w(i),a=be(s);Xc(a,0,Q),Xc(a,2,i-4);const c=r;n.re=r=new w(tu(c)+i),Qc(r,c),Qc(r,s,tu(c));const u=be(r);Xc(u,28,o+i),n.me=u,t.le+=i}function zc(t){const e=new w(4);be(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=gt,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=be(o),n&&(i=4,$c(r,0,P))),{oe:o,pe:r,he:i}}function Dc(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,Gt:o,rawComment:i,qt:s,Yt:a,rawExtraField:c,Kt:u,fe:l,we:d,Zt:w,uncompressedSize:p,compressedSize:h}=r;let{Pt:m,Wt:y}=r;w||(m&&p<O&&(m=r.Pt=!1),y&&h<O&&(y=r.Wt=!1)),n=n||m||y;const g=r.offset>=O,S=r.diskNumberStart>=M;let E,b;if(g||S||m||y){const t=4+(m?8:0)+(y?8:0)+(g?8:0)+(S?4:0),e=Ac(t);e.Ae(1),e.Ae(t-4),m&&e.ke(p),y&&e.ke(h),g&&e.ke(r.offset),S&&e.De(r.diskNumberStart),E=e.it}else E=gt;if(r.Vt=E,r.Fe=g,r.Ht=S,d===dt)b=gt;else{const t=Ac(9);t.Ae(J),t.Ae(5),t.Me(l),t.De(d),b=t.it}r.jt=b;const R=tu(E,o,s,a,b,c,u);if(R>M)throw new f(va);e+=q+tu(t,i)+R}return{Ee:e,be:n}}function Ac(t){const e=new w(t),n=be(e);let r=0;return{it:e,Me:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},Ae:t=>{Xc(n,r,t),r+=2},De:t=>{$c(n,r,t),r+=4},ke:t=>{Jc(n,r,i(t)),r+=8},Ie:t=>{Qc(e,t,r),r+=tu(t)},Le:t=>r+=t}}function Ic(t){const{diskNumber:e=0}=t;return e}function Cc(t){const{diskOffset:e=0}=t;return e}function Tc(t,e){const{availableSize:n=ft}=t;return e>n}function kc(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.It:0)}function vc(t){const e=be(t);let n=0;for(;n+4<=tu(t);){const r=4+Kc(e,n+2);if(1==Kc(e,n))return vc(Se(t.subarray(0,n),t.subarray(s.min(n+r,tu(t)))));n+=r}return t}async function _c(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await Bc(si(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 Nc(t,e){const n=await ii(t,e,ct);if(tu(n)<ct)return ct;const r=be(n);return ct+Kc(r,26)+Kc(r,28)}function Uc(t,{offset:e,diskNumberStart:n}){return e+(t.ft?t.ft(n):0)}function Oc(){const t=new w(4);return $c(be(t),0,W),t}async function Mc(t,e){delete t.Ft,await Lc(e,Oc()),t.offset+=4}async function Lc(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=tu(e),await r.write(e)}finally{r.releaseLock()}}async function Bc(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(tu(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function Wc(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<Ua?Ua:e>Oa?Oa:e}}function Pc(t){return s.floor(t.getTime()/1e3)}function Zc(t){return s.min(Na,s.max(_a,t))}function Hc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function Vc(t,e,n,r){const i=Hc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(Ra);return i}function Gc(t,e,n){return qt(Hc(t,e,n))}function jc(t,e,n,r){return te(Hc(t,e,n,r))}function qc(t){return t+5*(s.floor(t/16383)+1)}function Yc(t,e){return t===dt?e===dt||e>0:0!==t}function Kc(t,e){return t.getUint16(e,!0)}function Xc(t,e,n){t.setUint16(e,n,!0)}function $c(t,e,n){t.setUint32(e,n,!0)}function Jc(t,e,n){t.setBigUint64(e,n,!0)}function Qc(t,e,n){t.set(e,n)}function tu(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function eu({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,Wt:c,Pt:u,extraFieldLength:l}){const d=Ac(26),f=d.it,w=be(f);if(d.Ae(t),d.Ae(e),d.Ae(n),s===dt){const t=new h(1),e=be(t);Xc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Xc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.De(s),d.Le(4),c||o!==dt?d.De(c?O:o):d.Le(4),u||r!==dt?d.De(u?O:r):d.Le(4),d.Ae(tu(a)),d.Ae(l),{Lt:f,Bt:w,rawLastModDate:s}}function nu(t){return t.every(t=>t>=32&&t<=126)}function ru(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 ou(t,e){if(!t)return!1;const{supportedFormats:n}=t;return n?n.includes(e):er(t,e)}const iu=1048576,su=".zip.js-temp",au=1048576,cu=1048576,uu=".zip.js-temp",lu="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===b&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===b?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",b.baseURI).href})}catch{}const du="Entry filename already exists",fu="Duplicate entry filename in the imported zip file",wu='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',pu="Entry is an ancestor of target entry",hu="Root directory cannot be moved",mu="Target entry is not a directory",yu="Parent entry is not a directory",gu="Readable stream already consumed",Su="throw",Eu="keep-first",bu="keep-last",Ru=new u([Su,Eu,bu]),xu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",zu="Invalid readerOptions (must be an object)",Fu="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",Du="zipjs-abort-export";class Au{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(du);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Be++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,We:r.We||r.uncompressedSize===dt,passThrough:r.passThrough,Pe:r.Pe||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=el(t);r&&(t=r.pop(),n=nl(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(du);n!=e.parent&&(Bu(e),e.parent=n,n.children.push(e),Qu(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 Iu extends Au{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 Iu(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==Ao?e.type==n:t.constructor!=xo||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Mu(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await g.all([ri(r),ri(t,o)]);const i=Yt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof Zi||!o&&!i&&!s?a:Tn(a).pipeThrough(new Fr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!ni(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await Tn(s).pipeTo(vn(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(Re(t)&&t.message==$e)return!1;throw t}}getText(t,e){return this.getData(new To(t),e)}getBlob(t,e){return this.getData(new Ao(t),e)}getData64URI(t,e){return this.getData(new xo(t),e)}getUint8Array(t){return this.getData(new $o,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Ee(await this.getUint8Array(t)).buffer}replaceBlob(t){Gu(this,{data:t,Reader:Do,Writer:Ao,uncompressedSize:t.size})}replaceText(t){Gu(this,{data:t,Reader:Io,Writer:To,uncompressedSize:Co(t)})}replaceData64URI(t){Gu(this,{data:t,Reader:Ro,Writer:xo,uncompressedSize:ju(t)})}replaceUint8Array(t){Gu(this,{data:t,Reader:Xo,Writer:$o,uncompressedSize:t.length})}replaceReadable(t){Gu(this,{data:null,Reader:Uu(t),Writer:null,uncompressedSize:dt})}}class Cu extends Au{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Cu(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 tl(this,t,{options:e},!0)}addText(t,e,n={}){return tl(this,t,{data:e,Reader:Io,Writer:To,options:n,uncompressedSize:Co(e)})}addBlob(t,e,n={}){return tl(this,t,{data:e,Reader:Do,Writer:Ao,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return tl(this,t,{data:e,Reader:Ro,Writer:xo,options:n,uncompressedSize:ju(e)})}addUint8Array(t,e,n={}){return tl(this,t,{data:e,Reader:Xo,Writer:$o,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return tl(this,t,{data:e,Reader:class extends Ko{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return tl(this,t,{Reader:Uu(e),options:n})}addFileSystemEntry(t,e={}){return Ku(this,t,e)}addFileSystemHandle(t,e={}){return Ku(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),tl(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 Do(t),e)}importData64URI(t,e){return this.importZip(new Ro(t),e)}importUint8Array(t,e){return this.importZip(new Xo(t),e)}importHttpContent(t,e){return this.importZip(new Ko(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Ao(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new xo(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new $o,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;Vu(r.passThrough);const a=Hu(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Yt(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=vu([t],t=>Nu(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await Dr(o,w),await S(t,e),s&&await Dr(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 Dr(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=>E(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Wu(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 E(n,e)}async function E(e,n){if(u.aborted){if(h||Wu(u.reason))return;Kt(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(Du):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(Du));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 ri(t),r=new _s(t,e)),Vu(e.passThrough);const o=function(t){if(t===dt)return Su;if(Ru.has(t))return t;throw new f(wu)}(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==Eu){c=!0;break}if(o!=bu)throw new f(fu);this.fs.remove(r),r=new Cu(this.fs,t,{data:null},e),i.push(r)}}else r=new Cu(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||e.data)){if(o==Eu)continue;if(o!=bu)throw new f(fu);e.directory?e.data=t:(this.fs.remove(e),e=dt)}e||(e=new Cu(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==Eu)continue;if(o!=bu)throw new f(fu);this.fs.remove(s)}i.push(tl(r,a,{data:t,Reader:Ou(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([Lu(r,Hu(e.readerOptions)),o?dt:ri(t)]),s=o?t:new lc(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=vu(e.children,t=>Yu(t)?0:1);let f=0,w=0;if(s&&await Dr(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(Yu(e))return;const{name:s,Xt:c}=Pu(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 Dr(a,f,r)}}));w++,u&&await Dr(u,w,d,h)}c&&await Dr(c,f)}(s,r,vu([r],_u),e,i),o?s:(await s.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(t={}){const e=this;Hu((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}),o=r.filter(t=>!Yu(t)).map(n=>{const{name:r,Xt:o}=Pu(n,e,t);return{name:r,size:n.directory?0:Zu(n,qu(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>Yu(t)||!t.children.length);return await async function(t,e,r,o){const i={options:t};if(qt(t[Nt]))throw new f(Pa);if(o!==dt&&!(o instanceof w))throw new f(Sa);const a=tu(o);if(a>M)throw new f(ga);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);Hc(i,o,vi)&&!e.endsWith(at)&&(e+=at);const a=yc(i,e,o);({name:e}=a);const{Jt:c}=gc(i,e,o);0==c.level||c.compressionMethod!==dt||c.te||await br(we())||(c.level=0);const u=!Hc(i,o,vi);if(u&&r===dt)throw new f(Pa);const{Ue:w,Jt:p}=Ec(i,u,r,c,o);if(u&&!c.te&&Yc(p.compressionMethod,p.level))throw new f(Pa);const S=n.assign({},o,a.Jt,c,p,{[vt]:l}),E=Rc(S),b=Fc(S),R={se:E,le:tu(E.re,b.oe)};l&&xc(R,h);const x=u?w:0;d.set(e,n.assign({},S,E,{offset:h,diskNumberStart:0,compressedSize:x}));const z=R.le+x;y.push(z),g.add(Boolean(S.Zt||S.uncompressedSize>=O||x>=O)),m=s.min(m,z),h+=z}if(d.size>1&&(l||h-m>=O&&(g.size>1||bc(y,p,!0)!=bc(y,p,!1)))&&!r)throw new f(Pa);const{Ee:S,be:E}=Dc(d);let b=Hc(i,t,Ai);if(h>=O||S>=O||d.size>=M){if(!1===b)throw new f(Ma);b=!0}else b===dt&&E&&(b=!0);return h-p+S+a+(b?98:Y)}(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 Tu{constructor(){$u(this)}get children(){return this.root.children}remove(t){Bu(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(hu);if(!e.directory)throw new f(mu);if(e.isDescendantOf(t))throw new f(pu);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(du)}else Bu(t),t.parent=e,e.children.push(t),Qu(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 Ju(this,n=>n.importBlob(t,e))}importData64URI(t,e){return Ju(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return Ju(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return Ju(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return Ju(this,n=>n.importReadable(t,e))}importZip(t,e){return Ju(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 ku={FS:Tu,ZipDirectoryEntry:Cu,ZipFileEntry:Iu};function vu(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 _u(t){return t.uncompressedSize}function Nu(t,e){const{data:n}=t;return e&&n instanceof Zi?n.compressedSize:t.uncompressedSize}function Uu(t){let e;return function(){if(e)throw new f(gu);return e=!0,{readable:t}}}function Ou(t){return class extends Eo{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 Ao,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.Ze=new Do(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.Ze.readUint8Array(t,e)}}}function Mu(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Lu(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=Mu(t.Reader,t.data,e);o.set(t,n);try{await ri(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.We=!1)})),o}function Bu(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Wu(t){return Boolean(t)&&t.message==Du}function Pu(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let s={},a={};if(t.data instanceof Zi){const e=qu(t,r),n=i.lastModDate===dt?r.lastModDate:i.lastModDate;({Xt:s,$t:a}=mc(t.data,e,n)),e&&(a.passThrough=!0)}const c=n.assign({lastModDate:t.Pe},s,r,i,a,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===dt)throw new f(xu);return{name:o,Xt:c}}function Zu(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.We?dt:Nu(t,e)}function Hu(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(zu);return t&&Vu(t.passThrough),t}function Vu(t){if($t(t)===Pt)throw new f(Fu)}function Gu(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,We:r===dt})}function ju(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function qu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function Yu(t){return t.directory&&null===t.data}function Ku(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 Xu(o)),"file"==o.kind){const t=await o.getFile();i.push(tl(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 Xu(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 Xu(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 $u(t){t.entries=[],t.Be=0,t.root=new Cu(t)}function Ju(t,e){const{entries:r,Be:o,root:i}=t;return $u(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,Be:o,root:i}),e})}function Qu(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 tl(t,e,n,r){if(t.directory){const o=el(e);return o&&(e=o.pop(),t=nl(t,o)),r?new Cu(t.fs,e,n,t):new Iu(t.fs,e,n,t)}throw new f(yu)}function el(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function nl(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(du);if(n&&(t==n||t.isDescendantOf(n)))throw new f(pu)}else t=new Cu(r.fs,e,{data:null},r)}),t}t.BlobReader=Do,t.BlobWriter=Ao,t.Data64URIReader=Ro,t.Data64URIWriter=xo,t.ERR_ABORTED=jt,t.ERR_AMBIGUOUS_ARCHIVE=ns,t.ERR_ANCESTOR_ENTRY=pu,t.ERR_BAD_FORMAT=Gi,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Yi,t.ERR_DUPLICATED_NAME=ya,t.ERR_DUPLICATE_IMPORTED_ENTRY=fu,t.ERR_ENCRYPTED=$i,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=rs,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=es,t.ERR_ENTRY_EXISTS=du,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=qi,t.ERR_EOCDR_NOT_FOUND=ji,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Xi,t.ERR_HTTP_RANGE=so,t.ERR_HTTP_RESOURCE_CHANGED=ao,t.ERR_HTTP_STATUS=io,t.ERR_INVALID_AUTHENTICATION_CODE=Je,t.ERR_INVALID_BASE_URI=ne,t.ERR_INVALID_CODEC_DEFINITION=_n,t.ERR_INVALID_CODEC_MODULE=Un,t.ERR_INVALID_COMMENT=ga,t.ERR_INVALID_COMMENT_TYPE=Sa,t.ERR_INVALID_COMPRESSED_DATA=Gn,t.ERR_INVALID_CRC32=jn,t.ERR_INVALID_DATE=Ra,t.ERR_INVALID_DUPLICATES=wu,t.ERR_INVALID_ENCRYPTION_STRENGTH=Fa,t.ERR_INVALID_ENTRY=tc,t.ERR_INVALID_ENTRY_COMMENT=Ea,t.ERR_INVALID_ENTRY_COMMENT_TYPE=ba,t.ERR_INVALID_ENTRY_NAME=xa,t.ERR_INVALID_EXTRAFIELD=Ca,t.ERR_INVALID_EXTRAFIELD_DATA=va,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=ka,t.ERR_INVALID_EXTRAFIELD_TYPE=Ta,t.ERR_INVALID_FILENAME_VALIDATION=ss,t.ERR_INVALID_FUNCTION_OPTION=Zt,t.ERR_INVALID_GID=ja,t.ERR_INVALID_LEVEL=Ja,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=as,t.ERR_INVALID_MAX_WORKERS=ee,t.ERR_INVALID_MSDOS_ATTRIBUTES=Xa,t.ERR_INVALID_MSDOS_DATA=$a,t.ERR_INVALID_PASSWORD=$e,t.ERR_INVALID_PASSWORD_TYPE=Vt,t.ERR_INVALID_PASS_THROUGH=xu,t.ERR_INVALID_PASS_THROUGH_VALUE=Gt,t.ERR_INVALID_READER=Ha,t.ERR_INVALID_READER_OPTIONS=zu,t.ERR_INVALID_SIGNAL=Ht,t.ERR_INVALID_SIGNATURE_DATA=Qa,t.ERR_INVALID_STRICTNESS=is,t.ERR_INVALID_UID=Ga,t.ERR_INVALID_UNCOMPRESSED_SIZE=Vn,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=Ya,t.ERR_INVALID_UNIX_ID_SIZE=Ka,t.ERR_INVALID_UNIX_MODE=qa,t.ERR_INVALID_URI=re,t.ERR_INVALID_VERSION=za,t.ERR_ITERATOR_COMPLETED_TOO_SOON=co,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Ki,t.ERR_OVERLAPPING_ENTRY=ts,t.ERR_PARENT_NOT_DIRECTORY=yu,t.ERR_READABLE_CONSUMED=gu,t.ERR_RESERVED_COMPRESSION_METHOD=Nn,t.ERR_ROOT_DIRECTORY_NOT_MOVABLE=hu,t.ERR_SPLIT_ZIP_FILE=Qi,t.ERR_TARGET_NOT_DIRECTORY=mu,t.ERR_UNDEFINED_COMPRESSION_METHOD=Ba,t.ERR_UNDEFINED_CRC32=Wa,t.ERR_UNDEFINED_READER=Za,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=La,t.ERR_UNDETERMINED_SIZE=Pa,t.ERR_UNSAFE_FILENAME=os,t.ERR_UNSUPPORTED_COMPRESSION=On,t.ERR_UNSUPPORTED_CONTEXT=lu,t.ERR_UNSUPPORTED_CRYPTO_API=tn,t.ERR_UNSUPPORTED_ENCRYPTION=Ji,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=Ia,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=Da,t.ERR_UNSUPPORTED_FORMAT=Ma,t.ERR_UNSUPPORTED_PASS_THROUGH_VALUE=Fu,t.ERR_UNSUPPORTED_SPLIT_USDZ=Aa,t.ERR_UNSUPPORTED_UINT64=cs,t.ERR_WORKER_STARTUP_TIMEOUT=mr,t.ERR_WRITER_NOT_INITIALIZED=uo,t.ERR_WRITER_SIZE_NOT_WRITABLE=lo,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=ec,t.ERR_ZIP_NOT_EMPTY=Va,t.HttpRangeReader=class extends Ko{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Ko,t.Reader=Eo,t.SplitDataReader=Jo,t.SplitDataWriter=Qo,t.TextReader=Io,t.TextWriter=To,t.Uint8ArrayReader=Xo,t.Uint8ArrayWriter=$o,t.VERSION="2.16.0",t.WARNING_APPENDED_DATA=hs,t.WARNING_CLAMPED_LAST_MODIFICATION_DATE=rc,t.WARNING_COMPRESSED_PATCHED_DATA=ds,t.WARNING_COMPRESSION_UNAVAILABLE=nc,t.WARNING_DUPLICATE_FILENAME=Ss,t.WARNING_MALFORMED_EXTRA_FIELD=fs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=xs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=zs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=Fs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=Rs,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=Es,t.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=bs,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=ys,t.WARNING_PREPENDED_DATA=ms,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=gs,t.WARNING_UNKNOWN_VERSION=ls,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=ws,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=us,t.WARNING_WRAPPED_ENTRIES_COUNT=ps,t.Writer=bo,t.ZipDirectoryEntry=Cu,t.ZipEntry=Au,t.ZipFS=Tu,t.ZipFileEntry=Iu,t.ZipReader=_s,t.ZipReaderStream=Ns,t.ZipWriter=lc,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new z;this.readable=e,this.zipWriter=new lc(n,t),this.Ct=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 pc(e,t)}}()}});return hc(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 hc(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.Ct))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await pc(r,t),t}try{return await r.close(t,n)}catch(t){throw await pc(r,t),t}}},t.configure=function(t){n.assign(fe,me(ge(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=au}=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=kn(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=iu,directoryName:r=su,getDirectory:o=()=>C.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=R.randomUUID?R.randomUUID():e.from(R.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=cu,directoryName:r=uu,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(lu);const i=o||(()=>C.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=R.randomUUID?R.randomUUID():e.from(R.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=ku,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=Pn,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:ou(n,qn)||ou(t,qn)||ou(t,Kn),decompression:ou(r,qn)||ou(e,qn)||ou(e,Kn),registered:!1},{compressionMethod:9,compression:!1,decompression:ou(r,Yn)||ou(e,Yn),registered:!1}];for(const t of Pn()){const e=Zn(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=Us,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(_n);if(Mn.includes(e))throw new f(Nn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(_n);Ln.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Hn(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([$r(),...Zr.map(t=>(to(t),t.terminate()))]),yr=dt,gr=!1},t.unregisterCodec=function(t){const e=Ln.get(t);if(e){let n;Ln.delete(t),Ln.forEach(t=>n=n||t.format==e.format),n||Bn.delete(e.format)}}});