@zenfs/core 0.5.12 → 0.7.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.
- package/dist/FileIndex.d.ts +24 -28
- package/dist/FileIndex.js +2 -2
- package/dist/backends/AsyncStore.d.ts +28 -20
- package/dist/backends/AsyncStore.js +14 -37
- package/dist/backends/InMemory.d.ts +14 -2
- package/dist/backends/Overlay.d.ts +18 -14
- package/dist/backends/Overlay.js +2 -31
- package/dist/backends/SyncStore.d.ts +2 -13
- package/dist/backends/SyncStore.js +1 -25
- package/dist/backends/backend.d.ts +17 -18
- package/dist/backends/backend.js +1 -34
- package/dist/browser.min.js +4 -4
- package/dist/browser.min.js.map +4 -4
- package/dist/config.d.ts +16 -12
- package/dist/config.js +49 -18
- package/dist/emulation/index.d.ts +1 -1
- package/dist/emulation/index.js +1 -1
- package/dist/emulation/promises.js +7 -7
- package/dist/emulation/shared.d.ts +2 -2
- package/dist/emulation/shared.js +2 -2
- package/dist/emulation/sync.js +6 -6
- package/dist/file.d.ts +5 -14
- package/dist/file.js +23 -29
- package/dist/filesystem.d.ts +24 -8
- package/dist/filesystem.js +129 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/utils.d.ts +23 -3
- package/dist/utils.js +6 -3
- package/package.json +3 -2
- package/dist/backends/AsyncMirror.d.ts +0 -126
- package/dist/backends/AsyncMirror.js +0 -253
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var ZenFS=(()=>{var gu=Object.create;var gi=Object.defineProperty;var wu=Object.getOwnPropertyDescriptor;var Su=Object.getOwnPropertyNames;var _u=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty;var s=(t,e)=>gi(t,"name",{value:e,configurable:!0});var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),er=(t,e)=>{for(var i in e)gi(t,i,{get:e[i],enumerable:!0})},xs=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Su(e))!Eu.call(t,n)&&n!==i&&gi(t,n,{get:()=>e[n],enumerable:!(r=wu(e,n))||r.enumerable});return t};var mn=(t,e,i)=>(i=t!=null?gu(_u(t)):{},xs(e||!t||!t.__esModule?gi(i,"default",{value:t,enumerable:!0}):i,t)),xu=t=>xs(gi({},"__esModule",{value:!0}),t);var Os=A(pr=>{"use strict";pr.byteLength=uf;pr.toByteArray=df;pr.fromByteArray=yf;var Le=[],he=[],cf=typeof Uint8Array<"u"?Uint8Array:Array,An="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bt=0,Cs=An.length;bt<Cs;++bt)Le[bt]=An[bt],he[An.charCodeAt(bt)]=bt;var bt,Cs;he["-".charCodeAt(0)]=62;he["_".charCodeAt(0)]=63;function Ls(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var r=i===e?0:4-i%4;return[i,r]}s(Ls,"getLens");function uf(t){var e=Ls(t),i=e[0],r=e[1];return(i+r)*3/4-r}s(uf,"byteLength");function ff(t,e,i){return(e+i)*3/4-i}s(ff,"_byteLength");function df(t){var e,i=Ls(t),r=i[0],n=i[1],o=new cf(ff(t,r,n)),a=0,l=n>0?r-4:r,c;for(c=0;c<l;c+=4)e=he[t.charCodeAt(c)]<<18|he[t.charCodeAt(c+1)]<<12|he[t.charCodeAt(c+2)]<<6|he[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=he[t.charCodeAt(c)]<<2|he[t.charCodeAt(c+1)]>>4,o[a++]=e&255),n===1&&(e=he[t.charCodeAt(c)]<<10|he[t.charCodeAt(c+1)]<<4|he[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(df,"toByteArray");function hf(t){return Le[t>>18&63]+Le[t>>12&63]+Le[t>>6&63]+Le[t&63]}s(hf,"tripletToBase64");function pf(t,e,i){for(var r,n=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(hf(r));return n.join("")}s(pf,"encodeChunk");function yf(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,l=i-r;a<l;a+=o)n.push(pf(t,a,a+o>l?l:a+o));return r===1?(e=t[i-1],n.push(Le[e>>2]+Le[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(Le[e>>10]+Le[e>>4&63]+Le[e<<2&63]+"=")),n.join("")}s(yf,"fromByteArray")});var Rs=A(Fn=>{Fn.read=function(t,e,i,r,n){var o,a,l=n*8-r-1,c=(1<<l)-1,f=c>>1,d=-7,h=i?n-1:0,m=i?-1:1,y=t[e+h];for(h+=m,o=y&(1<<-d)-1,y>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-f}return(y?-1:1)*a*Math.pow(2,o-r)};Fn.write=function(t,e,i,r,n,o){var a,l,c,f=o*8-n-1,d=(1<<f)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:o-1,w=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=m/c:e+=m*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+y]=l&255,y+=w,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[i+y]=a&255,y+=w,a/=256,f-=8);t[i+y-w]|=b*128}});var Se=A(Jt=>{"use strict";var Tn=Os(),Yt=Rs(),Bs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jt.Buffer=p;Jt.SlowBuffer=_f;Jt.INSPECT_MAX_BYTES=50;var yr=2147483647;Jt.kMaxLength=yr;p.TYPED_ARRAY_SUPPORT=mf();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function mf(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(mf,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function ze(t){if(t>yr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}s(ze,"createBuffer");function p(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ln(t)}return Ws(t,e,i)}s(p,"Buffer");p.poolSize=8192;function Ws(t,e,i){if(typeof t=="string")return gf(t,e);if(ArrayBuffer.isView(t))return wf(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Oe(t,ArrayBuffer)||t&&Oe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(t,SharedArrayBuffer)||t&&Oe(t.buffer,SharedArrayBuffer)))return Pn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return p.from(r,e,i);let n=Sf(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(Ws,"from");p.from=function(t,e,i){return Ws(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function qs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(qs,"assertSize");function bf(t,e,i){return qs(t),t<=0?ze(t):e!==void 0?typeof i=="string"?ze(t).fill(e,i):ze(t).fill(e):ze(t)}s(bf,"alloc");p.alloc=function(t,e,i){return bf(t,e,i)};function Ln(t){return qs(t),ze(t<0?0:On(t)|0)}s(Ln,"allocUnsafe");p.allocUnsafe=function(t){return Ln(t)};p.allocUnsafeSlow=function(t){return Ln(t)};function gf(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=js(t,e)|0,r=ze(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(gf,"fromString");function In(t){let e=t.length<0?0:On(t.length)|0,i=ze(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(In,"fromArrayLike");function wf(t){if(Oe(t,Uint8Array)){let e=new Uint8Array(t);return Pn(e.buffer,e.byteOffset,e.byteLength)}return In(t)}s(wf,"fromArrayView");function Pn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,p.prototype),r}s(Pn,"fromArrayBuffer");function Sf(t){if(p.isBuffer(t)){let e=On(t.length)|0,i=ze(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Bn(t.length)?ze(0):In(t);if(t.type==="Buffer"&&Array.isArray(t.data))return In(t.data)}s(Sf,"fromObject");function On(t){if(t>=yr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+yr.toString(16)+" bytes");return t|0}s(On,"checked");function _f(t){return+t!=t&&(t=0),p.alloc(+t)}s(_f,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,i){if(Oe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Oe(i,Uint8Array)&&(i=p.from(i,i.offset,i.byteLength)),!p.isBuffer(e)||!p.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==i[o]){r=e[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");p.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=p.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(Oe(a,Uint8Array))o+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(p.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function js(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Oe(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Cn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Js(t).length;default:if(n)return r?-1:Cn(t).length;e=(""+e).toLowerCase(),n=!0}}s(js,"byteLength");p.byteLength=js;function Ef(t,e,i){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Cf(this,e,i);case"utf8":case"utf-8":return Vs(this,e,i);case"ascii":return If(this,e,i);case"latin1":case"binary":return Pf(this,e,i);case"base64":return Ff(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lf(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(Ef,"slowToString");p.prototype._isBuffer=!0;function gt(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(gt,"swap");p.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)gt(this,i,i+1);return this},"swap16");p.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)gt(this,i,i+3),gt(this,i+1,i+2);return this},"swap32");p.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)gt(this,i,i+7),gt(this,i+1,i+6),gt(this,i+2,i+5),gt(this,i+3,i+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Vs(this,0,e):Ef.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=s(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=s(function(){let e="",i=Jt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Bs&&(p.prototype[Bs]=p.prototype.inspect);p.prototype.compare=s(function(e,i,r,n,o){if(Oe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,l=r-i,c=Math.min(a,l),f=this.slice(n,o),d=e.slice(i,r);for(let h=0;h<c;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function $s(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Bn(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=p.from(e,r)),p.isBuffer(e))return e.length===0?-1:Ds(t,e,i,r,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Ds(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s($s,"bidirectionalIndexOf");function Ds(t,e,i,r,n){let o=1,a=t.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(c,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(c(t,f)===c(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+l>a&&(i=a-l),f=i;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(c(t,f+h)!==c(e,h)){d=!1;break}if(d)return f}return-1}s(Ds,"arrayIndexOf");p.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");p.prototype.indexOf=s(function(e,i,r){return $s(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,i,r){return $s(this,e,i,r,!1)},"lastIndexOf");function xf(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=e.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let l=parseInt(e.substr(a*2,2),16);if(Bn(l))return a;t[i+a]=l}return a}s(xf,"hexWrite");function vf(t,e,i,r){return mr(Cn(e,t.length-i),t,i,r)}s(vf,"utf8Write");function kf(t,e,i,r){return mr(Df(e),t,i,r)}s(kf,"asciiWrite");function Nf(t,e,i,r){return mr(Js(e),t,i,r)}s(Nf,"base64Write");function Af(t,e,i,r){return mr(Mf(e,t.length-i),t,i,r)}s(Af,"ucs2Write");p.prototype.write=s(function(e,i,r,n){if(i===void 0)n="utf8",r=this.length,i=0;else if(r===void 0&&typeof i=="string")n=i,r=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return xf(this,e,i,r);case"utf8":case"utf-8":return vf(this,e,i,r);case"ascii":case"latin1":case"binary":return kf(this,e,i,r);case"base64":return Nf(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Af(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function Ff(t,e,i){return e===0&&i===t.length?Tn.fromByteArray(t):Tn.fromByteArray(t.slice(e,i))}s(Ff,"base64Slice");function Vs(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=i){let c,f,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[n+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[n+1],f=t[n+2],(c&192)===128&&(f&192)===128&&(h=(o&15)<<12|(c&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[n+1],f=t[n+2],d=t[n+3],(c&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(c&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=l}return Tf(r)}s(Vs,"utf8Slice");var Ms=4096;function Tf(t){let e=t.length;if(e<=Ms)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=Ms));return i}s(Tf,"decodeCodePointsArray");function If(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]&127);return r}s(If,"asciiSlice");function Pf(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}s(Pf,"latin1Slice");function Cf(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=e;o<i;++o)n+=Uf[t[o]];return n}s(Cf,"hexSlice");function Lf(t,e,i){let r=t.slice(e,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(Lf,"utf16leSlice");p.prototype.slice=s(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=rt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Pi(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=rt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Pi(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");p.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=i,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");p.prototype.readInt8=s(function(e,i){return e=e>>>0,i||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||G(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");p.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||G(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");p.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=rt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Pi(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=rt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Pi(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),Yt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),Yt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||G(e,8,this.length),Yt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||G(e,8,this.length),Yt.read(this,e,!1,52,8)},"readDoubleBE");function oe(t,e,i,r,n,o){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}s(oe,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;oe(this,e,i,r,l,0)}let o=1,a=0;for(this[i]=e&255;++a<r&&(o*=256);)this[i+a]=e/o&255;return i+r},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;oe(this,e,i,r,l,0)}let o=r-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+r},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function zs(t,e,i,r,n){Xs(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(zs,"wrtBigUInt64LE");function Hs(t,e,i,r,n){Xs(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(Hs,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=rt(s(function(e,i=0){return zs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=rt(s(function(e,i=0){return Hs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);oe(this,e,i,r,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+r},"writeIntLE");p.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);oe(this,e,i,r,c-1,-c)}let o=r-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+r},"writeIntBE");p.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");p.prototype.writeBigInt64LE=rt(s(function(e,i=0){return zs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=rt(s(function(e,i=0){return Hs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ks(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Ks,"checkIEEE754");function Gs(t,e,i,r,n){return e=+e,i=i>>>0,n||Ks(t,e,i,4,34028234663852886e22,-34028234663852886e22),Yt.write(t,e,i,r,23,4),i+4}s(Gs,"writeFloat");p.prototype.writeFloatLE=s(function(e,i,r){return Gs(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,i,r){return Gs(this,e,i,!1,r)},"writeFloatBE");function Ys(t,e,i,r,n){return e=+e,i=i>>>0,n||Ks(t,e,i,8,17976931348623157e292,-17976931348623157e292),Yt.write(t,e,i,r,52,8),i+8}s(Ys,"writeDouble");p.prototype.writeDoubleLE=s(function(e,i,r){return Ys(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,i,r){return Ys(this,e,i,!1,r)},"writeDoubleBE");p.prototype.copy=s(function(e,i,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-i<n-r&&(n=e.length-i+r);let o=n-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),i),o},"copy");p.prototype.fill=s(function(e,i,r,n){if(typeof e=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<r;++o)this[o]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%l]}return this},"fill");var Gt={};function Rn(t,e,i){Gt[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Rn,"E");Rn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Rn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Rn("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Us(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=Us(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function Us(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Us,"addNumericalSeparator");function Of(t,e,i){Xt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Pi(e,t.length-(i+1))}s(Of,"checkBounds");function Xs(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new Gt.ERR_OUT_OF_RANGE("value",l,t)}Of(r,n,o)}s(Xs,"checkIntBI");function Xt(t,e){if(typeof t!="number")throw new Gt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Xt,"validateNumber");function Pi(t,e,i){throw Math.floor(t)!==t?(Xt(t,i),new Gt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Gt.ERR_BUFFER_OUT_OF_BOUNDS:new Gt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Pi,"boundsError");var Rf=/[^+/0-9A-Za-z-_]/g;function Bf(t){if(t=t.split("=")[0],t=t.trim().replace(Rf,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(Bf,"base64clean");function Cn(t,e){e=e||1/0;let i,r=t.length,n=null,o=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(Cn,"utf8ToBytes");function Df(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Df,"asciiToBytes");function Mf(t,e){let i,r,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(Mf,"utf16leToBytes");function Js(t){return Tn.toByteArray(Bf(t))}s(Js,"base64ToBytes");function mr(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}s(mr,"blitBuffer");function Oe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(Oe,"isInstance");function Bn(t){return t!==t}s(Bn,"numberIsNaN");var Uf=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let r=i*16;for(let n=0;n<16;++n)e[r+n]=t[i]+t[n]}return e}();function rt(t){return typeof BigInt>"u"?Wf:t}s(rt,"defineBigIntMethod");function Wf(){throw new Error("BigInt not supported")}s(Wf,"BufferBigIntNotDefined")});var L=A((d_,aa)=>{"use strict";aa.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var ti=A((h_,Nr)=>{"use strict";var{AbortController:la,AbortSignal:ph}=typeof self<"u"?self:typeof window<"u"?window:void 0;Nr.exports=la;Nr.exports.AbortSignal=ph;Nr.exports.default=la});var Ui=A((p_,ho)=>{"use strict";var ii=typeof Reflect=="object"?Reflect:null,ca=ii&&typeof ii.apply=="function"?ii.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Ar;ii&&typeof ii.ownKeys=="function"?Ar=ii.ownKeys:Object.getOwnPropertySymbols?Ar=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ar=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function yh(t){console&&console.warn&&console.warn(t)}s(yh,"ProcessEmitWarning");var fa=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function T(){T.init.call(this)}s(T,"EventEmitter");ho.exports=T;ho.exports.once=wh;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var ua=10;function Fr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Fr,"checkListener");Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return ua},set:function(t){if(typeof t!="number"||t<0||fa(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ua=t}});T.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};T.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||fa(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function da(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}s(da,"_getMaxListeners");T.prototype.getMaxListeners=s(function(){return da(this)},"getMaxListeners");T.prototype.emit=s(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")ca(c,this,i);else for(var f=c.length,d=ba(c,f),r=0;r<f;++r)ca(d[r],this,i);return!0},"emit");function ha(t,e,i,r){var n,o,a;if(Fr(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=da(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,yh(l)}return t}s(ha,"_addListener");T.prototype.addListener=s(function(e,i){return ha(this,e,i,!1)},"addListener");T.prototype.on=T.prototype.addListener;T.prototype.prependListener=s(function(e,i){return ha(this,e,i,!0)},"prependListener");function mh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(mh,"onceWrapper");function pa(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=mh.bind(r);return n.listener=i,r.wrapFn=n,n}s(pa,"_onceWrap");T.prototype.once=s(function(e,i){return Fr(i),this.on(e,pa(this,e,i)),this},"once");T.prototype.prependOnceListener=s(function(e,i){return Fr(i),this.prependListener(e,pa(this,e,i)),this},"prependOnceListener");T.prototype.removeListener=s(function(e,i){var r,n,o,a,l;if(Fr(i),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||i));else if(typeof r!="function"){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){l=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():bh(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=s(function(e){var i,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(e,i[n]);return this},"removeAllListeners");function ya(t,e,i){var r=t._events;if(r===void 0)return[];var n=r[e];return n===void 0?[]:typeof n=="function"?i?[n.listener||n]:[n]:i?gh(n):ba(n,n.length)}s(ya,"_listeners");T.prototype.listeners=s(function(e){return ya(this,e,!0)},"listeners");T.prototype.rawListeners=s(function(e){return ya(this,e,!1)},"rawListeners");T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ma.call(t,e)};T.prototype.listenerCount=ma;function ma(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(ma,"listenerCount");T.prototype.eventNames=s(function(){return this._eventsCount>0?Ar(this._events):[]},"eventNames");function ba(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(ba,"arrayClone");function bh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(bh,"spliceOne");function gh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(gh,"unwrapListeners");function wh(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,o),r(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),ga(t,e,o,{once:!0}),e!=="error"&&Sh(t,n,{once:!0})})}s(wh,"once");function Sh(t,e,i){typeof t.on=="function"&&ga(t,"error",e,i)}s(Sh,"addErrorHandlerIfEventEmitter");function ga(t,e,i,r){if(typeof t.on=="function")r.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){r.once&&t.removeEventListener(e,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(ga,"eventTargetAgnosticAddListener")});var J=A((m_,po)=>{"use strict";var _h=Se(),{kResistStopPropagation:Eh,SymbolDispose:xh}=L(),vh=globalThis.AbortSignal||ti().AbortSignal,kh=globalThis.AbortController||ti().AbortController,Nh=Object.getPrototypeOf(async function(){}).constructor,wa=globalThis.Blob||_h.Blob,Ah=s(typeof wa<"u"?function(e){return e instanceof wa}:function(e){return!1},"isBlob"),Sa=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Fh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Tr=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=e}};s(Tr,"AggregateError");po.exports={AggregateError:Tr,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Nh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Ah,deprecate(t,e){return t},addAbortListener:Ui().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Sa(e,"signal"),Fh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Eh]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[xh](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:vh.any||s(function(e){if(e.length===1)return e[0];let i=new kh,r=s(()=>i.abort(),"abort");return e.forEach(n=>{Sa(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};po.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ee=A((g_,xa)=>{"use strict";var{format:Th,inspect:Pr,AggregateError:Ih}=J(),Ph=globalThis.AggregateError||Ih,Ch=Symbol("kIsNodeError"),Lh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Oh=/^([A-Z][a-z0-9]*)+$/,Rh="__node_internal_",Cr={};function Et(t,e){if(!t)throw new Cr.ERR_INTERNAL_ASSERTION(e)}s(Et,"assert");function _a(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(_a,"addNumericalSeparator");function Bh(t,e,i){if(typeof e=="function")return Et(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let r=(e.match(/%[dfijoOs]/g)||[]).length;return Et(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Th(e,...i)}s(Bh,"getMessage");function X(t,e,i){i||(i=Error);class r extends i{constructor(...o){super(Bh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(r,"NodeError"),Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[Ch]=!0,Cr[t]=r}s(X,"E");function Ea(t){let e=Rh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(Ea,"hideStackFrames");function Dh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Ph([e,t],e.message);return i.code=e.code,i}return t||e}s(Dh,"aggregateTwoErrors");var Ir=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Cr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(Ir,"AbortError");X("ERR_ASSERTION","%s",Error);X("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Et(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";t.endsWith(" argument")?r+=`${t} `:r+=`"${t}" ${t.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let c of e)Et(typeof c=="string","All expected entries have to be of type string"),Lh.includes(c)?n.push(c.toLowerCase()):Oh.test(c)?o.push(c):(Et(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();r+=`one of type ${n.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();r+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();r+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)r+=`. Received an instance of ${i.constructor.name}`;else{let c=Pr(i,{depth:-1});r+=`. Received ${c}`}}else{let c=Pr(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),r+=`. Received type ${typeof i} (${c})`}return r},TypeError);X("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=Pr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);X("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var r;let n=i!=null&&(r=i.constructor)!==null&&r!==void 0&&r.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);X("ERR_MISSING_ARGS",(...t)=>{Et(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(r=>`"${r}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);X("ERR_OUT_OF_RANGE",(t,e,i)=>{Et(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=_a(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=_a(r)),r+="n"):r=Pr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);X("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);X("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);X("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);X("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);X("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);X("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);X("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);X("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);X("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);X("ERR_STREAM_WRITE_AFTER_END","write after end",Error);X("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);xa.exports={AbortError:Ir,aggregateTwoErrors:Ea(Dh),hideStackFrames:Ea,codes:Cr}});var ni=A((S_,La)=>{"use strict";var{ArrayIsArray:mo,ArrayPrototypeIncludes:Aa,ArrayPrototypeJoin:Fa,ArrayPrototypeMap:Mh,NumberIsInteger:bo,NumberIsNaN:Uh,NumberMAX_SAFE_INTEGER:Wh,NumberMIN_SAFE_INTEGER:qh,NumberParseInt:jh,ObjectPrototypeHasOwnProperty:$h,RegExpPrototypeExec:Ta,String:Vh,StringPrototypeToUpperCase:zh,StringPrototypeTrim:Hh}=L(),{hideStackFrames:ye,codes:{ERR_SOCKET_BAD_PORT:Kh,ERR_INVALID_ARG_TYPE:Q,ERR_INVALID_ARG_VALUE:ri,ERR_OUT_OF_RANGE:xt,ERR_UNKNOWN_SIGNAL:va}}=ee(),{normalizeEncoding:Gh}=J(),{isAsyncFunction:Yh,isArrayBufferView:Xh}=J().types,ka={};function Jh(t){return t===(t|0)}s(Jh,"isInt32");function Qh(t){return t===t>>>0}s(Qh,"isUint32");var Zh=/^[0-7]+$/,ep="must be a 32-bit unsigned integer or an octal string";function tp(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(Ta(Zh,t)===null)throw new ri(e,t,ep);t=jh(t,8)}return Ia(t,e),t}s(tp,"parseFileMode");var ip=ye((t,e,i=qh,r=Wh)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!bo(t))throw new xt(e,"an integer",t);if(t<i||t>r)throw new xt(e,`>= ${i} && <= ${r}`,t)}),rp=ye((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!bo(t))throw new xt(e,"an integer",t);if(t<i||t>r)throw new xt(e,`>= ${i} && <= ${r}`,t)}),Ia=ye((t,e,i=!1)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!bo(t))throw new xt(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new xt(e,`>= ${r} && <= ${n}`,t)});function go(t,e){if(typeof t!="string")throw new Q(e,"string",t)}s(go,"validateString");function np(t,e,i=void 0,r){if(typeof t!="number")throw new Q(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Uh(t))throw new xt(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(np,"validateNumber");var op=ye((t,e,i)=>{if(!Aa(i,t)){let n="must be one of: "+Fa(Mh(i,o=>typeof o=="string"?`'${o}'`:Vh(o)),", ");throw new ri(e,t,n)}});function Pa(t,e){if(typeof t!="boolean")throw new Q(e,"boolean",t)}s(Pa,"validateBoolean");function yo(t,e,i){return t==null||!$h(t,e)?i:t[e]}s(yo,"getOwnPropertyValueOrDefault");var sp=ye((t,e,i=null)=>{let r=yo(i,"allowArray",!1),n=yo(i,"allowFunction",!1);if(!yo(i,"nullable",!1)&&t===null||!r&&mo(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Q(e,"Object",t)}),ap=ye((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Q(e,"a dictionary",t)}),Lr=ye((t,e,i=0)=>{if(!mo(t))throw new Q(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ri(e,t,r)}});function lp(t,e){Lr(t,e);for(let i=0;i<t.length;i++)go(t[i],`${e}[${i}]`)}s(lp,"validateStringArray");function cp(t,e){Lr(t,e);for(let i=0;i<t.length;i++)Pa(t[i],`${e}[${i}]`)}s(cp,"validateBooleanArray");function up(t,e){Lr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new Q(n,"AbortSignal",r);Ca(r,n)}}s(up,"validateAbortSignalArray");function fp(t,e="signal"){if(go(t,e),ka[t]===void 0)throw ka[zh(t)]!==void 0?new va(t+" (signals must use all capital letters)"):new va(t)}s(fp,"validateSignalName");var dp=ye((t,e="buffer")=>{if(!Xh(t))throw new Q(e,["Buffer","TypedArray","DataView"],t)});function hp(t,e){let i=Gh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ri("encoding",e,`is invalid for data of length ${r}`)}s(hp,"validateEncoding");function pp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Hh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Kh(e,t,i);return t|0}s(pp,"validatePort");var Ca=ye((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Q(e,"AbortSignal",t)}),yp=ye((t,e)=>{if(typeof t!="function")throw new Q(e,"Function",t)}),mp=ye((t,e)=>{if(typeof t!="function"||Yh(t))throw new Q(e,"Function",t)}),bp=ye((t,e)=>{if(t!==void 0)throw new Q(e,"undefined",t)});function gp(t,e,i){if(!Aa(i,t))throw new Q(e,`('${Fa(i,"|")}')`,t)}s(gp,"validateUnion");var wp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Na(t,e){if(typeof t>"u"||!Ta(wp,t))throw new ri(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Na,"validateLinkHeaderFormat");function Sp(t){if(typeof t=="string")return Na(t,"hints"),t;if(mo(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];Na(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ri("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Sp,"validateLinkHeaderValue");La.exports={isInt32:Jh,isUint32:Qh,parseFileMode:tp,validateArray:Lr,validateStringArray:lp,validateBooleanArray:cp,validateAbortSignalArray:up,validateBoolean:Pa,validateBuffer:dp,validateDictionary:ap,validateEncoding:hp,validateFunction:yp,validateInt32:rp,validateInteger:ip,validateNumber:np,validateObject:sp,validateOneOf:op,validatePlainFunction:mp,validatePort:pp,validateSignalName:fp,validateString:go,validateUint32:Ia,validateUndefined:bp,validateUnion:gp,validateAbortSignal:Ca,validateLinkHeaderValue:Sp}});var ct=A((E_,Da)=>{var M=Da.exports={},Re,Be;function wo(){throw new Error("setTimeout has not been defined")}s(wo,"defaultSetTimout");function So(){throw new Error("clearTimeout has not been defined")}s(So,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Re=setTimeout:Re=wo}catch{Re=wo}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=So}catch{Be=So}})();function Oa(t){if(Re===setTimeout)return setTimeout(t,0);if((Re===wo||!Re)&&setTimeout)return Re=setTimeout,setTimeout(t,0);try{return Re(t,0)}catch{try{return Re.call(null,t,0)}catch{return Re.call(this,t,0)}}}s(Oa,"runTimeout");function _p(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===So||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}s(_p,"runClearTimeout");var He=[],oi=!1,vt,Or=-1;function Ep(){!oi||!vt||(oi=!1,vt.length?He=vt.concat(He):Or=-1,He.length&&Ra())}s(Ep,"cleanUpNextTick");function Ra(){if(!oi){var t=Oa(Ep);oi=!0;for(var e=He.length;e;){for(vt=He,He=[];++Or<e;)vt&&vt[Or].run();Or=-1,e=He.length}vt=null,oi=!1,_p(t)}}s(Ra,"drainQueue");M.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];He.push(new Ba(t,e)),He.length===1&&!oi&&Oa(Ra)};function Ba(t,e){this.fun=t,this.array=e}s(Ba,"Item");Ba.prototype.run=function(){this.fun.apply(null,this.array)};M.title="browser";M.browser=!0;M.env={};M.argv=[];M.version="";M.versions={};function Ke(){}s(Ke,"noop");M.on=Ke;M.addListener=Ke;M.once=Ke;M.off=Ke;M.removeListener=Ke;M.removeAllListeners=Ke;M.emit=Ke;M.prependListener=Ke;M.prependOnceListener=Ke;M.listeners=function(t){return[]};M.binding=function(t){throw new Error("process.binding is not supported")};M.cwd=function(){return"/"};M.chdir=function(t){throw new Error("process.chdir is not supported")};M.umask=function(){return 0}});var Me=A((v_,Qa)=>{"use strict";var{SymbolAsyncIterator:Ma,SymbolIterator:Ua,SymbolFor:kt}=L(),Wa=kt("nodejs.stream.destroyed"),qa=kt("nodejs.stream.errored"),_o=kt("nodejs.stream.readable"),Eo=kt("nodejs.stream.writable"),ja=kt("nodejs.stream.disturbed"),xp=kt("nodejs.webstream.isClosedPromise"),vp=kt("nodejs.webstream.controllerErrorFunction");function Rr(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Rr,"isReadableNodeStream");function Br(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Br,"isWritableNodeStream");function kp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(kp,"isDuplexNodeStream");function De(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(De,"isNodeStream");function $a(t){return!!(t&&!De(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s($a,"isReadableStream");function Va(t){return!!(t&&!De(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Va,"isWritableStream");function za(t){return!!(t&&!De(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(za,"isTransformStream");function Np(t){return $a(t)||Va(t)||za(t)}s(Np,"isWebStream");function Ap(t,e){return t==null?!1:e===!0?typeof t[Ma]=="function":e===!1?typeof t[Ua]=="function":typeof t[Ma]=="function"||typeof t[Ua]=="function"}s(Ap,"isIterable");function Dr(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[Wa]||r!=null&&r.destroyed)}s(Dr,"isDestroyed");function Ha(t){if(!Br(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ha,"isWritableEnded");function Fp(t,e){if(!Br(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(Fp,"isWritableFinished");function Tp(t){if(!Rr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Tp,"isReadableEnded");function Ka(t,e){if(!Rr(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Ka,"isReadableFinished");function Ga(t){return t&&t[_o]!=null?t[_o]:typeof t?.readable!="boolean"?null:Dr(t)?!1:Rr(t)&&t.readable&&!Ka(t)}s(Ga,"isReadable");function Ya(t){return t&&t[Eo]!=null?t[Eo]:typeof t?.writable!="boolean"?null:Dr(t)?!1:Br(t)&&t.writable&&!Ha(t)}s(Ya,"isWritable");function Ip(t,e){return De(t)?Dr(t)?!0:!(e?.readable!==!1&&Ga(t)||e?.writable!==!1&&Ya(t)):null}s(Ip,"isFinished");function Pp(t){var e,i;return De(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Pp,"isWritableErrored");function Cp(t){var e,i;return De(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Cp,"isReadableErrored");function Lp(t){if(!De(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&Xa(t)?t._closed:null}s(Lp,"isClosed");function Xa(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Xa,"isOutgoingMessage");function Ja(t){return typeof t._sent100=="boolean"&&Xa(t)}s(Ja,"isServerResponse");function Op(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Op,"isServerRequest");function Rp(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Ja(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(Rp,"willEmitClose");function Bp(t){var e;return!!(t&&((e=t[ja])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Bp,"isDisturbed");function Dp(t){var e,i,r,n,o,a,l,c,f,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[qa])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Dp,"isErrored");Qa.exports={isDestroyed:Dr,kIsDestroyed:Wa,isDisturbed:Bp,kIsDisturbed:ja,isErrored:Dp,kIsErrored:qa,isReadable:Ga,kIsReadable:_o,kIsClosedPromise:xp,kControllerErrorFunction:vp,kIsWritable:Eo,isClosed:Lp,isDuplexNodeStream:kp,isFinished:Ip,isIterable:Ap,isReadableNodeStream:Rr,isReadableStream:$a,isReadableEnded:Tp,isReadableFinished:Ka,isReadableErrored:Cp,isNodeStream:De,isWebStream:Np,isWritable:Ya,isWritableNodeStream:Br,isWritableStream:Va,isWritableEnded:Ha,isWritableFinished:Fp,isWritableErrored:Pp,isServerRequest:Op,isServerResponse:Ja,willEmitClose:Rp,isTransformStream:za}});var Ge=A((N_,Ao)=>{var ut=ct(),{AbortError:al,codes:Mp}=ee(),{ERR_INVALID_ARG_TYPE:Up,ERR_STREAM_PREMATURE_CLOSE:Za}=Mp,{kEmptyObject:vo,once:ko}=J(),{validateAbortSignal:Wp,validateFunction:qp,validateObject:jp,validateBoolean:$p}=ni(),{Promise:Vp,PromisePrototypeThen:zp,SymbolDispose:ll}=L(),{isClosed:Hp,isReadable:el,isReadableNodeStream:xo,isReadableStream:Kp,isReadableFinished:tl,isReadableErrored:il,isWritable:rl,isWritableNodeStream:nl,isWritableStream:Gp,isWritableFinished:ol,isWritableErrored:sl,isNodeStream:Yp,willEmitClose:Xp,kIsClosedPromise:Jp}=Me(),si;function Qp(t){return t.setHeader&&typeof t.abort=="function"}s(Qp,"isRequest");var No=s(()=>{},"nop");function cl(t,e,i){var r,n;if(arguments.length===2?(i=e,e=vo):e==null?e=vo:jp(e,"options"),qp(i,"callback"),Wp(e.signal,"options.signal"),i=ko(i),Kp(t)||Gp(t))return Zp(t,e,i);if(!Yp(t))throw new Up("stream",["ReadableStream","WritableStream","Stream"],t);let o=(r=e.readable)!==null&&r!==void 0?r:xo(t),a=(n=e.writable)!==null&&n!==void 0?n:nl(t),l=t._writableState,c=t._readableState,f=s(()=>{t.writable||m()},"onlegacyfinish"),d=Xp(t)&&xo(t)===o&&nl(t)===a,h=ol(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||y)&&i.call(t)},"onfinish"),y=tl(t,!1),w=s(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),b=s(W=>{i.call(t,W)},"onerror"),g=Hp(t),S=s(()=>{g=!0;let W=sl(t)||il(t);if(W&&typeof W!="boolean")return i.call(t,W);if(o&&!y&&xo(t,!0)&&!tl(t,!1))return i.call(t,new Za);if(a&&!h&&!ol(t,!1))return i.call(t,new Za);i.call(t)},"onclose"),F=s(()=>{g=!0;let W=sl(t)||il(t);if(W&&typeof W!="boolean")return i.call(t,W);i.call(t)},"onclosed"),R=s(()=>{t.req.on("finish",m)},"onrequest");Qp(t)?(t.on("complete",m),d||t.on("abort",S),t.req?R():t.on("request",R)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",b),t.on("close",S),g?ut.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||ut.nextTick(F):(!o&&(!d||el(t))&&(h||rl(t)===!1)||!a&&(!d||rl(t))&&(y||el(t)===!1)||c&&t.req&&t.aborted)&&ut.nextTick(F);let N=s(()=>{i=No,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",R),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",b),t.removeListener("close",S)},"cleanup");if(e.signal&&!g){let W=s(()=>{let dt=i;N(),dt.call(t,new al(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick(W);else{si=si||J().addAbortListener;let dt=si(e.signal,W),ce=i;i=ko((...Rt)=>{dt[ll](),ce.apply(t,Rt)})}}return N}s(cl,"eos");function Zp(t,e,i){let r=!1,n=No;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new al(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{si=si||J().addAbortListener;let a=si(e.signal,n),l=i;i=ko((...c)=>{a[ll](),l.apply(t,c)})}let o=s((...a)=>{r||ut.nextTick(()=>i.apply(t,a))},"resolverFn");return zp(t[Jp].promise,o,o),No}s(Zp,"eosWeb");function ey(t,e){var i;let r=!1;return e===null&&(e=vo),(i=e)!==null&&i!==void 0&&i.cleanup&&($p(e.cleanup,"cleanup"),r=e.cleanup),new Vp((n,o)=>{let a=cl(t,e,l=>{r&&a(),l?o(l):n()})})}s(ey,"finished");Ao.exports=cl;Ao.exports.finished=ey});var Nt=A((F_,bl)=>{"use strict";var Ue=ct(),{aggregateTwoErrors:ty,codes:{ERR_MULTIPLE_CALLBACK:iy},AbortError:ry}=ee(),{Symbol:dl}=L(),{kIsDestroyed:ny,isDestroyed:oy,isFinished:sy,isServerRequest:ay}=Me(),hl=dl("kDestroy"),Fo=dl("kConstruct");function pl(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(pl,"checkError");function ly(t,e){let i=this._readableState,r=this._writableState,n=r||i;return r!=null&&r.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(pl(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?ul(this,t,e):this.once(hl,function(o){ul(this,ty(o,t),e)}),this)}s(ly,"destroy");function ul(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,l=t._writableState;pl(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ue.nextTick(cy,t,o):Ue.nextTick(yl,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(ul,"_destroy");function cy(t,e){To(t,e),yl(t)}s(cy,"emitErrorCloseNT");function yl(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(yl,"emitCloseNT");function To(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(To,"emitErrorNT");function uy(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(uy,"undestroy");function Io(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?Ue.nextTick(To,t,e):To(t,e))}s(Io,"errorOrDestroy");function fy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,r=t._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),t.once(Fo,e),!(t.listenerCount(Fo)>1)&&Ue.nextTick(dy,t)}s(fy,"construct");function dy(t){let e=!1;function i(r){if(e){Io(t,r??new iy);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(hl,r):r?Io(t,r,!0):Ue.nextTick(hy,t)}s(i,"onConstruct");try{t._construct(r=>{Ue.nextTick(i,r)})}catch(r){Ue.nextTick(i,r)}}s(dy,"constructNT");function hy(t){t.emit(Fo)}s(hy,"emitConstructNT");function fl(t){return t?.setHeader&&typeof t.abort=="function"}s(fl,"isRequest");function ml(t){t.emit("close")}s(ml,"emitCloseLegacy");function py(t,e){t.emit("error",e),Ue.nextTick(ml,t)}s(py,"emitErrorCloseLegacy");function yy(t,e){!t||oy(t)||(!e&&!sy(t)&&(e=new ry),ay(t)?(t.socket=null,t.destroy(e)):fl(t)?t.abort():fl(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ue.nextTick(py,t,e):Ue.nextTick(ml,t),t.destroyed||(t[ny]=!0))}s(yy,"destroyer");bl.exports={construct:fy,destroyer:yy,destroy:ly,undestroy:uy,errorOrDestroy:Io}});var Wr=A((I_,wl)=>{"use strict";var{ArrayIsArray:my,ObjectSetPrototypeOf:gl}=L(),{EventEmitter:Mr}=Ui();function Ur(t){Mr.call(this,t)}s(Ur,"Stream");gl(Ur.prototype,Mr.prototype);gl(Ur,Mr);Ur.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(d){f(),Mr.listenerCount(this,"error")===0&&this.emit("error",d)}s(c,"onerror"),Po(i,"error",c),Po(t,"error",c);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function Po(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):my(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Po,"prependListener");wl.exports={Stream:Ur,prependListener:Po}});var Wi=A((C_,qr)=>{"use strict";var{SymbolDispose:by}=L(),{AbortError:Sl,codes:gy}=ee(),{isNodeStream:_l,isWebStream:wy,kControllerErrorFunction:Sy}=Me(),_y=Ge(),{ERR_INVALID_ARG_TYPE:El}=gy,Co,Ey=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new El(e,"AbortSignal",t)},"validateAbortSignal");qr.exports.addAbortSignal=s(function(e,i){if(Ey(e,"signal"),!_l(i)&&!wy(i))throw new El("stream",["ReadableStream","WritableStream","Stream"],i);return qr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");qr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=_l(e)?()=>{e.destroy(new Sl(void 0,{cause:t.reason}))}:()=>{e[Sy](new Sl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Co=Co||J().addAbortListener;let r=Co(t,i);_y(e,r[by])}return e}});var kl=A((R_,vl)=>{"use strict";var{StringPrototypeSlice:xl,SymbolIterator:xy,TypedArrayPrototypeSet:jr,Uint8Array:vy}=L(),{Buffer:Lo}=Se(),{inspect:ky}=J();vl.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return Lo.alloc(0);let i=Lo.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)jr(i,r.data,n),n+=r.data.length,r=r.next;return i}consume(e,i){let r=this.head.data;if(e<r.length){let n=r.slice(0,e);return this.head.data=r.slice(e),n}return e===r.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[xy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let o=r.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=xl(o,0,e),this.head=r,r.data=xl(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=Lo.allocUnsafe(e),r=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)jr(i,a,r-e),e-=a.length;else{e===a.length?(jr(i,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(jr(i,new vy(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return ky(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var qi=A((D_,Tl)=>{"use strict";var{MathFloor:Ny,NumberIsInteger:Ay}=L(),{validateInteger:Fy}=ni(),{ERR_INVALID_ARG_VALUE:Ty}=ee().codes,Nl=16*1024,Al=16;function Iy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Iy,"highWaterMarkFrom");function Fl(t){return t?Al:Nl}s(Fl,"getDefaultHighWaterMark");function Py(t,e){Fy(e,"value",0),t?Al=e:Nl=e}s(Py,"setDefaultHighWaterMark");function Cy(t,e,i,r){let n=Iy(e,r,i);if(n!=null){if(!Ay(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new Ty(o,n)}return Ny(n)}return Fl(t.objectMode)}s(Cy,"getHighWaterMark");Tl.exports={getHighWaterMark:Cy,getDefaultHighWaterMark:Fl,setDefaultHighWaterMark:Py}});var Cl=A((Oo,Pl)=>{var $r=Se(),We=$r.Buffer;function Il(t,e){for(var i in t)e[i]=t[i]}s(Il,"copyProps");We.from&&We.alloc&&We.allocUnsafe&&We.allocUnsafeSlow?Pl.exports=$r:(Il($r,Oo),Oo.Buffer=At);function At(t,e,i){return We(t,e,i)}s(At,"SafeBuffer");At.prototype=Object.create(We.prototype);Il(We,At);At.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return We(t,e,i)};At.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=We(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};At.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return We(t)};At.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return $r.SlowBuffer(t)}});var Rl=A(Ol=>{"use strict";var Bo=Cl().Buffer,Ll=Bo.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ly(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Ly,"_normalizeEncoding");function Oy(t){var e=Ly(t);if(typeof e!="string"&&(Bo.isEncoding===Ll||!Ll(t)))throw new Error("Unknown encoding: "+t);return e||t}s(Oy,"normalizeEncoding");Ol.StringDecoder=ji;function ji(t){this.encoding=Oy(t);var e;switch(this.encoding){case"utf16le":this.text=Wy,this.end=qy,e=4;break;case"utf8":this.fillLast=Dy,e=4;break;case"base64":this.text=jy,this.end=$y,e=3;break;default:this.write=Vy,this.end=zy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bo.allocUnsafe(e)}s(ji,"StringDecoder");ji.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};ji.prototype.end=Uy;ji.prototype.text=My;ji.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ro(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Ro,"utf8CheckByte");function Ry(t,e,i){var r=e.length-1;if(r<i)return 0;var n=Ro(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=Ro(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=Ro(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(Ry,"utf8CheckIncomplete");function By(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(By,"utf8CheckExtraBytes");function Dy(t){var e=this.lastTotal-this.lastNeed,i=By(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Dy,"utf8FillLast");function My(t,e){var i=Ry(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}s(My,"utf8Text");function Uy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Uy,"utf8End");function Wy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Wy,"utf16Text");function qy(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(qy,"utf16End");function jy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(jy,"base64Text");function $y(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s($y,"base64End");function Vy(t){return t.toString(this.encoding)}s(Vy,"simpleWrite");function zy(t){return t&&t.length?this.write(t):""}s(zy,"simpleEnd")});var Do=A((j_,Ul)=>{"use strict";var Bl=ct(),{PromisePrototypeThen:Hy,SymbolAsyncIterator:Dl,SymbolIterator:Ml}=L(),{Buffer:Ky}=Se(),{ERR_INVALID_ARG_TYPE:Gy,ERR_STREAM_NULL_VALUES:Yy}=ee().codes;function Xy(t,e,i){let r;if(typeof e=="string"||e instanceof Ky)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[Dl])n=!0,r=e[Dl]();else if(e&&e[Ml])n=!1,r=e[Ml]();else throw new Gy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(f,d){Hy(l(f),()=>Bl.nextTick(d,f),h=>Bl.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof r.throw=="function";if(d&&h){let{value:m,done:y}=await r.throw(f);if(await m,y)return}if(typeof r.return=="function"){let{value:m}=await r.return();await m}}s(l,"close");async function c(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Yy;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(c,"next"),o}s(Xy,"from");Ul.exports=Xy});var Vi=A((V_,rc)=>{var ke=ct(),{ArrayPrototypeIndexOf:Jy,NumberIsInteger:Qy,NumberIsNaN:Zy,NumberParseInt:em,ObjectDefineProperties:zo,ObjectKeys:tm,ObjectSetPrototypeOf:jl,Promise:$l,SafeSet:im,SymbolAsyncDispose:rm,SymbolAsyncIterator:nm,Symbol:om}=L();rc.exports=E;E.ReadableState=Kr;var{EventEmitter:sm}=Ui(),{Stream:ft,prependListener:am}=Wr(),{Buffer:Mo}=Se(),{addAbortSignal:lm}=Wi(),Vl=Ge(),k=J().debuglog("stream",t=>{k=t}),cm=kl(),ci=Nt(),{getHighWaterMark:um,getDefaultHighWaterMark:fm}=qi(),{aggregateTwoErrors:Wl,codes:{ERR_INVALID_ARG_TYPE:dm,ERR_METHOD_NOT_IMPLEMENTED:hm,ERR_OUT_OF_RANGE:pm,ERR_STREAM_PUSH_AFTER_EOF:ym,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:mm},AbortError:bm}=ee(),{validateObject:gm}=ni(),Ft=om("kPaused"),{StringDecoder:zl}=Rl(),wm=Do();jl(E.prototype,ft.prototype);jl(E,ft);var Uo=s(()=>{},"nop"),{errorOrDestroy:ai}=ci,li=1<<0,Sm=1<<1,Hl=1<<2,$i=1<<3,Kl=1<<4,Vr=1<<5,zr=1<<6,Gl=1<<7,_m=1<<8,Em=1<<9,xm=1<<10,$o=1<<11,Vo=1<<12,vm=1<<13,km=1<<14,Nm=1<<15,Yl=1<<16,Am=1<<17,Fm=1<<18;function V(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(V,"makeBitMapDescriptor");zo(Kr.prototype,{objectMode:V(li),ended:V(Sm),endEmitted:V(Hl),reading:V($i),constructed:V(Kl),sync:V(Vr),needReadable:V(zr),emittedReadable:V(Gl),readableListening:V(_m),resumeScheduled:V(Em),errorEmitted:V(xm),emitClose:V($o),autoDestroy:V(Vo),destroyed:V(vm),closed:V(km),closeEmitted:V(Nm),multiAwaitDrain:V(Yl),readingMore:V(Am),dataEmitted:V(Fm)});function Kr(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.state=$o|Vo|Kl|Vr,t&&t.objectMode&&(this.state|=li),i&&t&&t.readableObjectMode&&(this.state|=li),this.highWaterMark=t?um(this,t,"readableHighWaterMark",i):fm(!1),this.buffer=new cm,this.length=0,this.pipes=[],this.flowing=null,this[Ft]=null,t&&t.emitClose===!1&&(this.state&=~$o),t&&t.autoDestroy===!1&&(this.state&=~Vo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new zl(t.encoding),this.encoding=t.encoding)}s(Kr,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof qe();this._readableState=new Kr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&lm(t.signal,this)),ft.call(this,t),ci.construct(this,()=>{this._readableState.needReadable&&Hr(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=ci.destroy;E.prototype._undestroy=ci.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[sm.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[rm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new bm,this.destroy(t)),new $l((e,i)=>Vl(this,r=>r&&r!==t?i(r):e(null)))};E.prototype.push=function(t,e){return Xl(this,t,e,!1)};E.prototype.unshift=function(t,e){return Xl(this,t,e,!0)};function Xl(t,e,i,r){k("readableAddChunk",e);let n=t._readableState,o;if(n.state&li||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=Mo.from(e,i).toString(n.encoding):(e=Mo.from(e,i),i=""))):e instanceof Mo?i="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new dm("chunk",["string","Buffer","Uint8Array"],e))),o)ai(t,o);else if(e===null)n.state&=~$i,Pm(t,n);else if(n.state&li||e&&e.length>0)if(r)if(n.state&Hl)ai(t,new mm);else{if(n.destroyed||n.errored)return!1;Wo(t,n,e,!0)}else if(n.ended)ai(t,new ym);else{if(n.destroyed||n.errored)return!1;n.state&=~$i,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Wo(t,n,e,!1):Hr(t,n)):Wo(t,n,e,!1)}else r||(n.state&=~$i,Hr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Xl,"readableAddChunk");function Wo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Yl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.state&zr&&Gr(t)),Hr(t,e)}s(Wo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[Ft]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new zl(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,r="";for(let n of i)r+=e.write(n);return i.clear(),r!==""&&i.push(r),this._readableState.length=r.length,this};var Tm=1073741824;function Im(t){if(t>Tm)throw new pm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Im,"computeNewHighWaterMark");function ql(t,e){return t<=0||e.length===0&&e.ended?0:e.state&li?1:Zy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(ql,"howMuchToRead");E.prototype.read=function(t){k("read",t),t===void 0?t=NaN:Qy(t)||(t=em(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Im(t)),t!==0&&(e.state&=~Gl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?qo(this):Gr(this),null;if(t=ql(t,e),t===0&&e.ended)return e.length===0&&qo(this),null;let r=(e.state&zr)!==0;if(k("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,k("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,k("reading, ended or constructing",r);else if(r){k("do read"),e.state|=$i|Vr,e.length===0&&(e.state|=zr);try{this._read(e.highWaterMark)}catch(o){ai(this,o)}e.state&=~Vr,e.reading||(t=ql(i,e))}let n;return t>0?n=tc(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&qo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Pm(t,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?Gr(t):(e.needReadable=!1,e.emittedReadable=!0,Jl(t))}}s(Pm,"onEofChunk");function Gr(t){let e=t._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(Jl,t))}s(Gr,"emitReadable");function Jl(t){let e=t._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Zl(t)}s(Jl,"emitReadable_");function Hr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick(Cm,t,e))}s(Hr,"maybeReadMore");function Cm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(k("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Cm,"maybeReadMore_");E.prototype._read=function(t){throw new hm("_read()")};E.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new im(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),k("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?l:g;r.endEmitted?ke.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,F){k("onunpipe"),S===i&&F&&F.hasUnpiped===!1&&(F.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){k("onend"),t.end()}s(l,"onend");let c,f=!1;function d(){k("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),c&&t.removeListener("drain",c),t.removeListener("error",y),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",g),i.removeListener("data",m),f=!0,c&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(d,"cleanup");function h(){f||(r.pipes.length===1&&r.pipes[0]===t?(k("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(k("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),c||(c=Lm(i,t),t.on("drain",c))}s(h,"pause"),i.on("data",m);function m(S){k("ondata");let F=t.write(S);k("dest.write",F),F===!1&&h()}s(m,"ondata");function y(S){if(k("onerror",S),g(),t.removeListener("error",y),t.listenerCount("error")===0){let F=t._writableState||t._readableState;F&&!F.errorEmitted?ai(t,S):t.emit("error",S)}}s(y,"onerror"),am(t,"error",y);function w(){t.removeListener("finish",b),g()}s(w,"onclose"),t.once("close",w);function b(){k("onfinish"),t.removeListener("close",w),g()}s(b,"onfinish"),t.once("finish",b);function g(){k("unpipe"),i.unpipe(t)}return s(g,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(k("pipe resume"),i.resume()),t};function Lm(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(k("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(k("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Lm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=Jy(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=ft.prototype.on.call(this,t,e),r=this._readableState;return t==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):t==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,k("on readable",r.length,r.reading),r.length?Gr(this):r.reading||ke.nextTick(Om,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=ft.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(Ql,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(Ql,this),e};function Ql(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ft]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Ql,"updateReadableListening");function Om(t){k("readable nexttick read 0"),t.read(0)}s(Om,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(k("resume"),t.flowing=!t.readableListening,Rm(this,t)),t[Ft]=!1,this};function Rm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Bm,t,e))}s(Rm,"resume");function Bm(t,e){k("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Zl(t),e.flowing&&!e.reading&&t.read(0)}s(Bm,"resume_");E.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ft]=!0,this};function Zl(t){let e=t._readableState;for(k("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Zl,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",r=>{!this.push(r)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",r=>{ai(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=tm(t);for(let r=1;r<i.length;r++){let n=i[r];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};E.prototype[nm]=function(){return ec(this)};E.prototype.iterator=function(t){return t!==void 0&&gm(t,"options"),ec(this,t)};function ec(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Dm(t,e);return i.stream=t,i}s(ec,"streamToAsyncIterator");async function*Dm(t,e){let i=Uo;function r(a){this===t?(i(),i=Uo):i=a}s(r,"next"),t.on("readable",r);let n,o=Vl(t,{writable:!1},a=>{n=a?Wl(n,a):null,i(),i=Uo});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new $l(r)}}}catch(a){throw n=Wl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?ci.destroyer(t,null):(t.off("readable",r),o())}}s(Dm,"createAsyncIterator");zo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});zo(Kr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Ft]!==!1},set(t){this[Ft]=!!t}}});E._fromList=tc;function tc(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(tc,"fromList");function qo(t){let e=t._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Mm,e,t))}s(qo,"endReadable");function Mm(t,e){if(k("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ke.nextTick(Um,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Mm,"endReadableNT");function Um(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Um,"endWritableNT");E.from=function(t,e){return wm(E,t,e)};var jo;function ic(){return jo===void 0&&(jo={}),jo}s(ic,"lazyWebStreams");E.fromWeb=function(t,e){return ic().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return ic().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,r;return new E({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,o){ci.destroyer(t,n),o(n)}}).wrap(t)}});var Zr=A((H_,yc)=>{var Tt=ct(),{ArrayPrototypeSlice:sc,Error:Wm,FunctionPrototypeSymbolHasInstance:ac,ObjectDefineProperty:lc,ObjectDefineProperties:qm,ObjectSetPrototypeOf:cc,StringPrototypeToLowerCase:jm,Symbol:$m,SymbolHasInstance:Vm}=L();yc.exports=O;O.WritableState=Ki;var{EventEmitter:zm}=Ui(),zi=Wr().Stream,{Buffer:Yr}=Se(),Qr=Nt(),{addAbortSignal:Hm}=Wi(),{getHighWaterMark:Km,getDefaultHighWaterMark:Gm}=qi(),{ERR_INVALID_ARG_TYPE:Ym,ERR_METHOD_NOT_IMPLEMENTED:Xm,ERR_MULTIPLE_CALLBACK:uc,ERR_STREAM_CANNOT_PIPE:Jm,ERR_STREAM_DESTROYED:Hi,ERR_STREAM_ALREADY_FINISHED:Qm,ERR_STREAM_NULL_VALUES:Zm,ERR_STREAM_WRITE_AFTER_END:eb,ERR_UNKNOWN_ENCODING:fc}=ee().codes,{errorOrDestroy:ui}=Qr;cc(O.prototype,zi.prototype);cc(O,zi);function Go(){}s(Go,"nop");var fi=$m("kOnFinished");function Ki(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Km(this,t,"writableHighWaterMark",i):Gm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(t&&t.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ib.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Jr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[fi]=[]}s(Ki,"WritableState");function Jr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(Jr,"resetBuffer");Ki.prototype.getBuffer=s(function(){return sc(this.buffered,this.bufferedIndex)},"getBuffer");lc(Ki.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(t){let e=this instanceof qe();if(!e&&!ac(O,this))return new O(t);this._writableState=new Ki(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Hm(t.signal,this)),zi.call(this,t),Qr.construct(this,()=>{let i=this._writableState;i.writing||Xo(this,i),Jo(this,i)})}s(O,"Writable");lc(O,Vm,{__proto__:null,value:function(t){return ac(this,t)?!0:this!==O?!1:t&&t._writableState instanceof Ki}});O.prototype.pipe=function(){ui(this,new Jm)};function dc(t,e,i,r){let n=t._writableState;if(typeof i=="function")r=i,i=n.defaultEncoding;else{if(!i)i=n.defaultEncoding;else if(i!=="buffer"&&!Yr.isEncoding(i))throw new fc(i);typeof r!="function"&&(r=Go)}if(e===null)throw new Zm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Yr.from(e,i),i="buffer");else if(e instanceof Yr)i="buffer";else if(zi._isUint8Array(e))e=zi._uint8ArrayToBuffer(e),i="buffer";else throw new Ym("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new eb:n.destroyed&&(o=new Hi("write")),o?(Tt.nextTick(r,o),ui(t,o,!0),o):(n.pendingcb++,tb(t,n,e,i,r))}s(dc,"_write");O.prototype.write=function(t,e,i){return dc(this,t,e,i)===!0};O.prototype.cork=function(){this._writableState.corked++};O.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Xo(this,t))};O.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=jm(e)),!Yr.isEncoding(e))throw new fc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function tb(t,e,i,r,n){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:r,callback:n}),e.allBuffers&&r!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Go&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(tb,"writeOrBuffer");function nc(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Hi("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(nc,"doWrite");function oc(t,e,i,r){--e.pendingcb,r(i),Yo(e),ui(t,i)}s(oc,"onwriteError");function ib(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){ui(t,new uc);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),r?Tt.nextTick(oc,t,i,e,n):oc(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Xo(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},Tt.nextTick(rb,i.afterWriteTickInfo)):hc(t,i,1,n))}s(ib,"onwrite");function rb({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,hc(t,e,i,r)}s(rb,"afterWriteTick");function hc(t,e,i,r){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,r();e.destroyed&&Yo(e),Jo(t,e)}s(hc,"afterWrite");function Yo(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Hi("write"))}let i=t[fi].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Hi("end"))}Jr(t)}s(Yo,"errorBuffer");function Xo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,o=i.length-r;if(!o)return;let a=r;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Go:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},c=e.allNoop&&a===0?i:sc(i,a);c.allBuffers=e.allBuffers,nc(t,e,!0,e.length,c,"",l),Jr(e)}else{do{let{chunk:l,encoding:c,callback:f}=i[a];i[a++]=null;let d=n?1:l.length;nc(t,e,!1,d,l,c,f)}while(a<i.length&&!e.writing);a===i.length?Jr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Xo,"clearBuffer");O.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Xm("_write()")};O.prototype._writev=null;O.prototype.end=function(t,e,i){let r=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let n;if(t!=null){let o=dc(this,t,e);o instanceof Wm&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Jo(this,r,!0),r.ended=!0):r.finished?n=new Qm("end"):r.destroyed&&(n=new Hi("end"))),typeof i=="function"&&(n||r.finished?Tt.nextTick(i,n):r[fi].push(i)),this};function Xr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(Xr,"needFinish");function nb(t,e){let i=!1;function r(n){if(i){ui(t,n??uc());return}if(i=!0,e.pendingcb--,n){let o=e[fi].splice(0);for(let a=0;a<o.length;a++)o[a](n);ui(t,n,e.sync)}else Xr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Tt.nextTick(Ko,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(nb,"callFinal");function ob(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,nb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(ob,"prefinish");function Jo(t,e,i){Xr(e)&&(ob(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Tt.nextTick((r,n)=>{Xr(n)?Ko(r,n):n.pendingcb--},t,e)):Xr(e)&&(e.pendingcb++,Ko(t,e))))}s(Jo,"finishMaybe");function Ko(t,e){e.pendingcb--,e.finished=!0;let i=e[fi].splice(0);for(let r=0;r<i.length;r++)i[r]();if(t.emit("finish"),e.autoDestroy){let r=t._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&t.destroy()}}s(Ko,"finish");qm(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var sb=Qr.destroy;O.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[fi].length)&&Tt.nextTick(Yo,i),sb.call(this,t,e),this};O.prototype._undestroy=Qr.undestroy;O.prototype._destroy=function(t,e){e(t)};O.prototype[zm.captureRejectionSymbol]=function(t){this.destroy(t)};var Ho;function pc(){return Ho===void 0&&(Ho={}),Ho}s(pc,"lazyWebStreams");O.fromWeb=function(t,e){return pc().newStreamWritableFromWritableStream(t,e)};O.toWeb=function(t){return pc().newWritableStreamFromStreamWritable(t)}});var Ic=A((G_,Tc)=>{var Qo=ct(),ab=Se(),{isReadable:lb,isWritable:cb,isIterable:mc,isNodeStream:ub,isReadableNodeStream:bc,isWritableNodeStream:gc,isDuplexNodeStream:fb,isReadableStream:wc,isWritableStream:Sc}=Me(),_c=Ge(),{AbortError:Ac,codes:{ERR_INVALID_ARG_TYPE:db,ERR_INVALID_RETURN_VALUE:Ec}}=ee(),{destroyer:hi}=Nt(),hb=qe(),Fc=Vi(),pb=Zr(),{createDeferredPromise:xc}=J(),vc=Do(),kc=globalThis.Blob||ab.Blob,yb=s(typeof kc<"u"?function(e){return e instanceof kc}:function(e){return!1},"isBlob"),mb=globalThis.AbortController||ti().AbortController,{FunctionPrototypeCall:Nc}=L(),Ye=class extends hb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Ye,"Duplexify");Tc.exports=s(function t(e,i){if(fb(e))return e;if(bc(e))return di({readable:e});if(gc(e))return di({writable:e});if(ub(e))return di({writable:!1,readable:!1});if(wc(e))return di({readable:Fc.fromWeb(e)});if(Sc(e))return di({writable:pb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=bb(e);if(mc(n))return vc(Ye,n,{objectMode:!0,write:o,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let f,d=Nc(c,n,h=>{if(h!=null)throw new Ec("nully","body",h)},h=>{hi(f,h)});return f=new Ye({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Qo.nextTick(h,null)}catch(m){Qo.nextTick(h,m)}})},destroy:l})}throw new Ec("Iterable, AsyncIterable or AsyncFunction",i,n)}if(yb(e))return t(e.arrayBuffer());if(mc(e))return vc(Ye,e,{objectMode:!0,writable:!1});if(wc(e?.readable)&&Sc(e?.writable))return Ye.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?bc(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?gc(e?.writable)?e?.writable:t(e.writable):void 0;return di({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return Nc(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{hi(n,o)}),n=new Ye({objectMode:!0,writable:!1,read(){}})}throw new db(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function bb(t){let{promise:e,resolve:i}=xc(),r=new mb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:f}=await a;if(Qo.nextTick(f),c)return;if(n.aborted)throw new Ac(void 0,{cause:n.reason});({promise:e,resolve:i}=xc()),yield l}}(),{signal:n}),write(a,l,c){let f=i;i=null,f({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}s(bb,"fromAsyncGen");function di(t){let e=t.readable&&typeof t.readable.read!="function"?Fc.wrap(t.readable):t.readable,i=t.writable,r=!!lb(e),n=!!cb(i),o,a,l,c,f;function d(h){let m=c;c=null,m?m(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Ye({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(_c(i,h=>{n=!1,h&&hi(e,h),d(h)}),f._write=function(h,m,y){i.write(h,m)?y():o=y},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(_c(e,h=>{r=!1,h&&hi(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&c!==null&&(h=new Ac),l=null,o=null,a=null,c===null?m(h):(c=m,hi(i,h),hi(e,h))},f}s(di,"_duplexify")});var qe=A((X_,Lc)=>{"use strict";var{ObjectDefineProperties:gb,ObjectGetOwnPropertyDescriptor:Xe,ObjectKeys:wb,ObjectSetPrototypeOf:Pc}=L();Lc.exports=Ne;var ts=Vi(),me=Zr();Pc(Ne.prototype,ts.prototype);Pc(Ne,ts);{let t=wb(me.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ne.prototype[i]||(Ne.prototype[i]=me.prototype[i])}}function Ne(t){if(!(this instanceof Ne))return new Ne(t);ts.call(this,t),me.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ne,"Duplex");gb(Ne.prototype,{writable:{__proto__:null,...Xe(me.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Xe(me.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Xe(me.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Xe(me.prototype,"writableBuffer")},writableLength:{__proto__:null,...Xe(me.prototype,"writableLength")},writableFinished:{__proto__:null,...Xe(me.prototype,"writableFinished")},writableCorked:{__proto__:null,...Xe(me.prototype,"writableCorked")},writableEnded:{__proto__:null,...Xe(me.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Xe(me.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Zo;function Cc(){return Zo===void 0&&(Zo={}),Zo}s(Cc,"lazyWebStreams");Ne.fromWeb=function(t,e){return Cc().newStreamDuplexFromReadableWritablePair(t,e)};Ne.toWeb=function(t){return Cc().newReadableWritablePairFromDuplex(t)};var es;Ne.from=function(t){return es||(es=Ic()),es(t,"body")}});var ns=A((Q_,Rc)=>{"use strict";var{ObjectSetPrototypeOf:Oc,Symbol:Sb}=L();Rc.exports=Je;var{ERR_METHOD_NOT_IMPLEMENTED:_b}=ee().codes,rs=qe(),{getHighWaterMark:Eb}=qi();Oc(Je.prototype,rs.prototype);Oc(Je,rs);var Gi=Sb("kCallback");function Je(t){if(!(this instanceof Je))return new Je(t);let e=t?Eb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),rs.call(this,t),this._readableState.sync=!1,this[Gi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",xb)}s(Je,"Transform");function is(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(is,"final");function xb(){this._final!==is&&is.call(this)}s(xb,"prefinish");Je.prototype._final=is;Je.prototype._transform=function(t,e,i){throw new _b("_transform()")};Je.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),n.ended||o===r.length||r.length<r.highWaterMark?i():this[Gi]=i})};Je.prototype._read=function(){if(this[Gi]){let t=this[Gi];this[Gi]=null,t()}}});var ss=A((e0,Dc)=>{"use strict";var{ObjectSetPrototypeOf:Bc}=L();Dc.exports=pi;var os=ns();Bc(pi.prototype,os.prototype);Bc(pi,os);function pi(t){if(!(this instanceof pi))return new pi(t);os.call(this,t)}s(pi,"PassThrough");pi.prototype._transform=function(t,e,i){i(null,t)}});var nn=A((i0,jc)=>{var Yi=ct(),{ArrayIsArray:vb,Promise:kb,SymbolAsyncIterator:Nb,SymbolDispose:Ab}=L(),rn=Ge(),{once:Fb}=J(),Tb=Nt(),Mc=qe(),{aggregateTwoErrors:Ib,codes:{ERR_INVALID_ARG_TYPE:ys,ERR_INVALID_RETURN_VALUE:as,ERR_MISSING_ARGS:Pb,ERR_STREAM_DESTROYED:Cb,ERR_STREAM_PREMATURE_CLOSE:Lb},AbortError:Ob}=ee(),{validateFunction:Rb,validateAbortSignal:Bb}=ni(),{isIterable:It,isReadable:ls,isReadableNodeStream:tn,isNodeStream:Uc,isTransformStream:yi,isWebStream:Db,isReadableStream:cs,isReadableFinished:Mb}=Me(),Ub=globalThis.AbortController||ti().AbortController,us,fs,ds;function Wc(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=rn(t,{readable:e,writable:i},o=>{r=!o});return{destroy:o=>{r||(r=!0,Tb.destroyer(t,o||new Cb("pipe")))},cleanup:n}}s(Wc,"destroyer");function Wb(t){return Rb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Wb,"popCallback");function hs(t){if(It(t))return t;if(tn(t))return qb(t);throw new ys("val",["Readable","Iterable","AsyncIterable"],t)}s(hs,"makeAsyncIterable");async function*qb(t){fs||(fs=Vi()),yield*fs.prototype[Nb].call(t)}s(qb,"fromReadable");async function en(t,e,i,{end:r}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let d=o;o=null,d()}},"resume"),l=s(()=>new kb((f,d)=>{n?d(n):o=s(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let c=rn(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();r&&(e.end(),await l()),i()}catch(f){i(n!==f?Ib(n,f):f)}finally{c(),e.off("drain",a)}}s(en,"pumpToNode");async function ps(t,e,i,{end:r}){yi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(ps,"pumpToWeb");function jb(...t){return qc(t,Fb(Wb(t)))}s(jb,"pipeline");function qc(t,e,i){if(t.length===1&&vb(t[0])&&(t=t[0]),t.length<2)throw new Pb("streams");let r=new Ub,n=r.signal,o=i?.signal,a=[];Bb(o,"options.signal");function l(){w(new Ob)}s(l,"abort"),ds=ds||J().addAbortListener;let c;o&&(c=ds(o,l));let f,d,h=[],m=0;function y(R){w(R,--m===0)}s(y,"finish");function w(R,N){var W;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!N)){for(;h.length;)h.shift()(f);(W=c)===null||W===void 0||W[Ab](),r.abort(),N&&(f||a.forEach(dt=>dt()),Yi.nextTick(e,f,d))}}s(w,"finishImpl");let b;for(let R=0;R<t.length;R++){let N=t[R],W=R<t.length-1,dt=R>0,ce=W||i?.end!==!1,Rt=R===t.length-1;if(Uc(N)){let te=function($e){$e&&$e.name!=="AbortError"&&$e.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y($e)};var F=te;if(s(te,"onError"),ce){let{destroy:$e,cleanup:yn}=Wc(N,W,dt);h.push($e),ls(N)&&Rt&&a.push(yn)}N.on("error",te),ls(N)&&Rt&&a.push(()=>{N.removeListener("error",te)})}if(R===0)if(typeof N=="function"){if(b=N({signal:n}),!It(b))throw new as("Iterable, AsyncIterable or Stream","source",b)}else It(N)||tn(N)||yi(N)?b=N:b=Mc.from(N);else if(typeof N=="function"){if(yi(b)){var g;b=hs((g=b)===null||g===void 0?void 0:g.readable)}else b=hs(b);if(b=N(b,{signal:n}),W){if(!It(b,!0))throw new as("AsyncIterable",`transform[${R-1}]`,b)}else{var S;us||(us=ss());let te=new us({objectMode:!0}),$e=(S=b)===null||S===void 0?void 0:S.then;if(typeof $e=="function")m++,$e.call(b,et=>{d=et,et!=null&&te.write(et),ce&&te.end(),Yi.nextTick(y)},et=>{te.destroy(et),Yi.nextTick(y,et)});else if(It(b,!0))m++,en(b,te,y,{end:ce});else if(cs(b)||yi(b)){let et=b.readable||b;m++,en(et,te,y,{end:ce})}else throw new as("AsyncIterable or Promise","destination",b);b=te;let{destroy:yn,cleanup:bu}=Wc(b,!1,!0);h.push(yn),Rt&&a.push(bu)}}else if(Uc(N)){if(tn(b)){m+=2;let te=$b(b,N,y,{end:ce});ls(N)&&Rt&&a.push(te)}else if(yi(b)||cs(b)){let te=b.readable||b;m++,en(te,N,y,{end:ce})}else if(It(b))m++,en(b,N,y,{end:ce});else throw new ys("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=N}else if(Db(N)){if(tn(b))m++,ps(hs(b),N,y,{end:ce});else if(cs(b)||It(b))m++,ps(b,N,y,{end:ce});else if(yi(b))m++,ps(b.readable,N,y,{end:ce});else throw new ys("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=N}else b=Mc.from(N)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Yi.nextTick(l),b}s(qc,"pipelineImpl");function $b(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Lb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Mb(t)?Yi.nextTick(a):t.once("end",a)}else i();return rn(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),rn(e,{readable:!1,writable:!0},i)}s($b,"pipe");jc.exports={pipelineImpl:qc,pipeline:jb}});var bs=A((n0,Gc)=>{"use strict";var{pipeline:Vb}=nn(),on=qe(),{destroyer:zb}=Nt(),{isNodeStream:sn,isReadable:$c,isWritable:Vc,isWebStream:ms,isTransformStream:Pt,isWritableStream:zc,isReadableStream:Hc}=Me(),{AbortError:Hb,codes:{ERR_INVALID_ARG_VALUE:Kc,ERR_MISSING_ARGS:Kb}}=ee(),Gb=Ge();Gc.exports=s(function(...e){if(e.length===0)throw new Kb("streams");if(e.length===1)return on.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=on.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=on.from(e[y])}for(let y=0;y<e.length;++y)if(!(!sn(e[y])&&!ms(e[y]))){if(y<e.length-1&&!($c(e[y])||Hc(e[y])||Pt(e[y])))throw new Kc(`streams[${y}]`,i[y],"must be readable");if(y>0&&!(Vc(e[y])||zc(e[y])||Pt(e[y])))throw new Kc(`streams[${y}]`,i[y],"must be writable")}let r,n,o,a,l;function c(y){let w=a;a=null,w?w(y):y?l.destroy(y):!m&&!h&&l.destroy()}s(c,"onfinished");let f=e[0],d=Vb(e,c),h=!!(Vc(f)||zc(f)||Pt(f)),m=!!($c(d)||Hc(d)||Pt(d));if(l=new on({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(sn(f))l._write=function(w,b,g){f.write(w,b)?g():r=g},l._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ms(f)){let b=(Pt(f)?f.writable:f).getWriter();l._write=async function(g,S,F){try{await b.ready,b.write(g).catch(()=>{}),F()}catch(R){F(R)}},l._final=async function(g){try{await b.ready,b.close().catch(()=>{}),n=g}catch(S){g(S)}}}let y=Pt(d)?d.readable:d;Gb(y,()=>{if(n){let w=n;n=null,w()}})}if(m){if(sn(d))d.on("readable",function(){if(o){let y=o;o=null,y()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let y=d.read();if(y===null){o=l._read;return}if(!l.push(y))return}};else if(ms(d)){let w=(Pt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:b,done:g}=await w.read();if(!l.push(b))return;if(g){l.push(null);return}}catch{return}}}}return l._destroy=function(y,w){!y&&a!==null&&(y=new Hb),o=null,r=null,n=null,a===null?w(y):(a=w,sn(d)&&zb(d,y))},l},"compose")});var nu=A((s0,ws)=>{"use strict";var Yb=globalThis.AbortController||ti().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Xb,ERR_INVALID_ARG_TYPE:Xi,ERR_MISSING_ARGS:Jb,ERR_OUT_OF_RANGE:Qb},AbortError:je}=ee(),{validateAbortSignal:Ct,validateInteger:Yc,validateObject:Lt}=ni(),Zb=L().Symbol("kWeak"),eg=L().Symbol("kResistStopPropagation"),{finished:tg}=Ge(),ig=bs(),{addAbortSignalNoValidate:rg}=Wi(),{isWritable:ng,isNodeStream:og}=Me(),{deprecate:sg}=J(),{ArrayPrototypePush:ag,Boolean:lg,MathFloor:Xc,Number:cg,NumberIsNaN:ug,Promise:Jc,PromiseReject:Qc,PromiseResolve:fg,PromisePrototypeThen:Zc,Symbol:tu}=L(),ln=tu("kEmpty"),eu=tu("kEof");function dg(t,e){if(e!=null&&Lt(e,"options"),e?.signal!=null&&Ct(e.signal,"options.signal"),og(t)&&!ng(t))throw new Xb("stream",t,"must be writable");let i=ig(this,t);return e!=null&&e.signal&&rg(e.signal,i),i}s(dg,"compose");function cn(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);e!=null&&Lt(e,"options"),e?.signal!=null&&Ct(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Xc(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Xc(e.highWaterMark)),Yc(i,"options.concurrency",1),Yc(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=J().AbortSignalAny([e?.signal].filter(lg)),a=this,l=[],c={signal:o},f,d,h=!1,m=0;function y(){h=!0,w()}s(y,"onCatch");function w(){m-=1,b()}s(w,"afterItemProcessed");function b(){d&&!h&&m<i&&l.length<r&&(d(),d=null)}s(b,"maybeResume");async function g(){try{for await(let S of a){if(h)return;if(o.aborted)throw new je;try{if(S=t(S,c),S===ln)continue;S=fg(S)}catch(F){S=Qc(F)}m+=1,Zc(S,w,y),l.push(S),f&&(f(),f=null),!h&&(l.length>=r||m>=i)&&await new Jc(F=>{d=F})}l.push(eu)}catch(S){let F=Qc(S);Zc(F,w,y),l.push(F)}finally{h=!0,f&&(f(),f=null)}}s(g,"pump"),g();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===eu)return;if(o.aborted)throw new je;S!==ln&&(yield S),l.shift(),b()}await new Jc(S=>{f=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(cn,"map");function hg(t=void 0){return t!=null&&Lt(t,"options"),t?.signal!=null&&Ct(t.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new je({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(hg,"asIndexedPairs");async function iu(t,e=void 0){for await(let i of gs.call(this,t,e))return!0;return!1}s(iu,"some");async function pg(t,e=void 0){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);return!await iu.call(this,async(...i)=>!await t(...i),e)}s(pg,"every");async function yg(t,e){for await(let i of gs.call(this,t,e))return i}s(yg,"find");async function mg(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),ln}s(i,"forEachFn");for await(let r of cn.call(this,i,e));}s(mg,"forEach");function gs(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:ln}return s(i,"filterFn"),cn.call(this,i,e)}s(gs,"filter");var an=class extends Jb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(an,"ReduceAwareErrMissingArgs");async function bg(t,e,i){var r;if(typeof t!="function")throw new Xi("reducer",["Function","AsyncFunction"],t);i!=null&&Lt(i,"options"),i?.signal!=null&&Ct(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new je(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await tg(this.destroy(f)),f}let o=new Yb,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[Zb]:this,[eg]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let l=!1;try{for await(let f of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new je;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new an}finally{o.abort()}return e}s(bg,"reduce");async function gg(t){t!=null&&Lt(t,"options"),t?.signal!=null&&Ct(t.signal,"options.signal");let e=[];for await(let r of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new je(void 0,{cause:t.signal.reason});ag(e,r)}return e}s(gg,"toArray");function wg(t,e){let i=cn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(wg,"flatMap");function ru(t){if(t=cg(t),ug(t))return 0;if(t<0)throw new Qb("number",">= 0",t);return t}s(ru,"toIntegerOrInfinity");function Sg(t,e=void 0){return e!=null&&Lt(e,"options"),e?.signal!=null&&Ct(e.signal,"options.signal"),t=ru(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;t--<=0&&(yield o)}},"drop").call(this)}s(Sg,"drop");function _g(t,e=void 0){return e!=null&&Lt(e,"options"),e?.signal!=null&&Ct(e.signal,"options.signal"),t=ru(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(_g,"take");ws.exports.streamReturningOperators={asIndexedPairs:sg(hg,"readable.asIndexedPairs will be removed in a future version."),drop:Sg,filter:gs,flatMap:wg,map:cn,take:_g,compose:dg};ws.exports.promiseReturningOperators={every:pg,forEach:mg,reduce:bg,toArray:gg,some:iu,find:yg}});var Ss=A((l0,ou)=>{"use strict";var{ArrayPrototypePop:Eg,Promise:xg}=L(),{isIterable:vg,isNodeStream:kg,isWebStream:Ng}=Me(),{pipelineImpl:Ag}=nn(),{finished:Fg}=Ge();_s();function Tg(...t){return new xg((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!kg(o)&&!vg(o)&&!Ng(o)){let a=Eg(t);r=a.signal,n=a.end}Ag(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}s(Tg,"pipeline");ou.exports={finished:Fg,pipeline:Tg}});var _s=A((u0,pu)=>{var{Buffer:Ig}=Se(),{ObjectDefineProperty:Qe,ObjectKeys:lu,ReflectApply:cu}=L(),{promisify:{custom:uu}}=J(),{streamReturningOperators:su,promiseReturningOperators:au}=nu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:fu}}=ee(),Pg=bs(),{setDefaultHighWaterMark:Cg,getDefaultHighWaterMark:Lg}=qi(),{pipeline:du}=nn(),{destroyer:Og}=Nt(),hu=Ge(),Es=Ss(),Ji=Me(),C=pu.exports=Wr().Stream;C.isDestroyed=Ji.isDestroyed;C.isDisturbed=Ji.isDisturbed;C.isErrored=Ji.isErrored;C.isReadable=Ji.isReadable;C.isWritable=Ji.isWritable;C.Readable=Vi();for(let t of lu(su)){let i=function(...r){if(new.target)throw fu();return C.Readable.from(cu(e,this,r))};Bg=i,s(i,"fn");let e=su[t];Qe(i,"name",{__proto__:null,value:e.name}),Qe(i,"length",{__proto__:null,value:e.length}),Qe(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Bg;for(let t of lu(au)){let i=function(...n){if(new.target)throw fu();return cu(e,this,n)};Bg=i,s(i,"fn");let e=au[t];Qe(i,"name",{__proto__:null,value:e.name}),Qe(i,"length",{__proto__:null,value:e.length}),Qe(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Bg;C.Writable=Zr();C.Duplex=qe();C.Transform=ns();C.PassThrough=ss();C.pipeline=du;var{addAbortSignal:Rg}=Wi();C.addAbortSignal=Rg;C.finished=hu;C.destroy=Og;C.compose=Pg;C.setDefaultHighWaterMark=Cg;C.getDefaultHighWaterMark=Lg;Qe(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Es}});Qe(du,uu,{__proto__:null,enumerable:!0,get(){return Es.pipeline}});Qe(hu,uu,{__proto__:null,enumerable:!0,get(){return Es.finished}});C.Stream=C;C._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(e){return Ig.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var yu=A((d0,U)=>{"use strict";var z=_s(),Dg=Ss(),Mg=z.Readable.destroy;U.exports=z.Readable;U.exports._uint8ArrayToBuffer=z._uint8ArrayToBuffer;U.exports._isUint8Array=z._isUint8Array;U.exports.isDisturbed=z.isDisturbed;U.exports.isErrored=z.isErrored;U.exports.isReadable=z.isReadable;U.exports.Readable=z.Readable;U.exports.Writable=z.Writable;U.exports.Duplex=z.Duplex;U.exports.Transform=z.Transform;U.exports.PassThrough=z.PassThrough;U.exports.addAbortSignal=z.addAbortSignal;U.exports.finished=z.finished;U.exports.destroy=z.destroy;U.exports.destroy=Mg;U.exports.pipeline=z.pipeline;U.exports.compose=z.compose;Object.defineProperty(z,"promises",{configurable:!0,enumerable:!0,get(){return Dg}});U.exports.Stream=z.Stream;U.exports.default=U.exports});var qg={};er(qg,{ActionType:()=>fr,ApiError:()=>u,Async:()=>_i,AsyncFile:()=>qt,AsyncFileIndexFS:()=>pn,AsyncMirror:()=>af,AsyncMirrorFS:()=>mt,AsyncStoreFS:()=>hr,BigIntStats:()=>K,BigIntStatsFs:()=>lr,ErrorCode:()=>j,ErrorStrings:()=>bn,File:()=>vi,FileIndex:()=>Ot,FileIndexFS:()=>bi,FileSystem:()=>Y,FileType:()=>D,InMemory:()=>kn,InMemoryStore:()=>Ti,IndexDirInode:()=>Ze,IndexFileInode:()=>Zi,IndexInode:()=>mi,Inode:()=>ue,LockedFS:()=>zt,MirrorFile:()=>Ai,Mutex:()=>Vt,NoSyncFile:()=>yt,Overlay:()=>lf,OverlayFS:()=>Kt,OverlayFile:()=>Ht,PreloadFile:()=>ne,Readonly:()=>Sn,SimpleSyncTransaction:()=>jt,Stats:()=>B,StatsCommon:()=>Mt,StatsFs:()=>Ut,Sync:()=>pt,SyncFile:()=>ur,SyncFileIndexFS:()=>hn,SyncStoreFS:()=>$t,SyncStoreFile:()=>Fi,UnlockedOverlayFS:()=>Ii,checkOptions:()=>wn,configure:()=>Ug,createBackend:()=>Fu,decode:()=>rr,decodeDirListing:()=>wi,default:()=>Wg,encode:()=>Fe,encodeDirListing:()=>se,flagToMode:()=>tt,flagToNumber:()=>sf,flagToString:()=>Ts,fs:()=>Qi,initialize:()=>mu,isAppendable:()=>it,isBackend:()=>Si,isBackendConfig:()=>As,isExclusive:()=>Ps,isReadable:()=>Ve,isSynchronous:()=>xi,isTruncating:()=>Is,isWriteable:()=>de,levenshtein:()=>gn,mkdirpSync:()=>Ns,parseFlag:()=>P,pathExistsAction:()=>ki,pathNotExistsAction:()=>Ni,randomIno:()=>Wt,resolveBackend:()=>nr,rootCred:()=>we,rootIno:()=>fe,setImmediate:()=>Au,size_max:()=>cr,wait:()=>Nu});var j=(g=>(g[g.EPERM=1]="EPERM",g[g.ENOENT=2]="ENOENT",g[g.EIO=5]="EIO",g[g.EBADF=9]="EBADF",g[g.EACCES=13]="EACCES",g[g.EBUSY=16]="EBUSY",g[g.EEXIST=17]="EEXIST",g[g.ENOTDIR=20]="ENOTDIR",g[g.EISDIR=21]="EISDIR",g[g.EINVAL=22]="EINVAL",g[g.EFBIG=27]="EFBIG",g[g.ENOSPC=28]="ENOSPC",g[g.EROFS=30]="EROFS",g[g.EDEADLK=35]="EDEADLK",g[g.ENOTEMPTY=39]="ENOTEMPTY",g[g.ENOTSUP=95]="ENOTSUP",g))(j||{}),bn={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[35]:"Resource deadlock would occur",[39]:"Directory is not empty.",[95]:"Operation is not supported."},u=class extends Error{constructor(i,r=bn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=j[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new u(i.errno,i.message,i.path,i.syscall);return r.code=i.code,r.stack=i.stack,r}static With(i,r,n){return new u(j[i],bn[j[i]],r,n)}code;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(u,"ApiError");var vu="/";var vs="/";function ht(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(ht,"validateString");function ks(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",r=0):(i=i.slice(0,c),r=i.length-1-i.lastIndexOf("/")),n=l,o=0;continue}else if(i.length!==0){i="",r=0,n=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,l):i=t.slice(n+1,l),r=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(ks,"normalizeString");function Ae(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:vu;ht(n,`paths[${r}]`),n.length&&(e=`${n}/${e}`,i=n[0]=="/")}return e=ks(e,!i),i?`/${e}`:e.length>0?e:"/"}s(Ae,"resolve");function ku(t){if(ht(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=ks(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s(ku,"normalize");function ie(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];ht(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":ku(e)}s(ie,"join");function x(t){if(ht(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function I(t,e){e!==void 0&&ht(e,"ext"),ht(t,"path");let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){i=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(r=l):(o=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":t.slice(i,r)}s(I,"basename");function tr(t){ht(t,"path");let e=t[0]==="/",i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let r=e?1:0,n=-1,o=0,a=-1,l=!0,c=t.length-1,f=0;for(;c>=r;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?n===-1?n=c:f!==1&&(f=1):n!==-1&&(f=-1)}if(a!==-1){let d=o===0&&e?1:o;n===-1||f===0||f===1&&n===a-1&&n===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,n),i.base=t.slice(d,a),i.ext=t.slice(n,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(tr,"parse");function Ns(t,e,i,r){r.existsSync(t,i)||(Ns(x(t),e,i,r),r.mkdirSync(t,e,i))}s(Ns,"mkdirpSync");function ir(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(ir,"_min");function gn(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,r=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(n+m),o[m]=++m;let a,l,c,f,d;for(a=0;a+3<r;){let m=e.charCodeAt(n+(l=a)),y=e.charCodeAt(n+(c=a+1)),w=e.charCodeAt(n+(f=a+2)),b=e.charCodeAt(n+(d=a+3)),g=a+=4;for(let S=0;S<i;){let F=o[i+S],R=o[S];l=ir(R,l,c,m,F),c=ir(l,c,f,y,F),f=ir(c,f,d,w,F),g=ir(f,d,g,b,F),o[S++]=g,d=f,f=c,c=l,l=R}}let h=0;for(;a<r;){let m=e.charCodeAt(n+(l=a));h=++a;for(let y=0;y<i;y++){let w=o[y];o[y]=h=w<l||h<l?w>h?h+1:w+1:m===o[i+y]?l:l+1,l=w}}return h}s(gn,"levenshtein");function Nu(t){return new Promise(e=>{setTimeout(e,t)})}s(Nu,"wait");var Au=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Fe(t){if(typeof t!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Fe,"encode");function rr(t){if(!(t instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(rr,"decode");function wi(t){return JSON.parse(rr(t),(e,i)=>e==""?i:BigInt(i))}s(wi,"decodeDirListing");function se(t){return Fe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(se,"encodeDirListing");function Si(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(Si,"isBackend");async function wn(t,e){if(typeof e!="object"||e===null)throw new u(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:gn(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new u(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new u(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}`);r.validator&&await r.validator(n)}}s(wn,"checkOptions");function Fu(t,e){return wn(t,e),t.create(e).ready()}s(Fu,"createBackend");function As(t){return t!=null&&typeof t=="object"&&"backend"in t}s(As,"isBackendConfig");async function nr(t,e=0){if(typeof t!="object"||t==null)throw new u(22,"Invalid options on configuration object.");let{backend:i}=t;if(!Si(i))throw new u(22,"Missing or invalid backend");let r=Object.keys(t).filter(o=>o!="backend");for(let o of r){let a=t[o];if(Si(a)&&(a={backend:a}),As(a)){if(e>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");t[o]=await nr(a,++e)}}if(!await i.isAvailable())throw new u(1,"Backend not available: "+i);wn(i,t);let n=i.create(t);return await n.ready(),n}s(nr,"resolveBackend");var Y=class{metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(Y,"FileSystem");function pt(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!0}}async ready(){return this}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,o){return this.renameSync(r,n,o)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,o,a){return this.createFileSync(r,n,o,a)}async openFile(r,n,o){return this.openFileSync(r,n,o)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,o){return this.mkdirSync(r,n,o)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,o){return this.linkSync(r,n,o)}async sync(r,n,o){return this.syncSync(r,n,o)}}return s(e,"_SyncFileSystem"),e}s(pt,"Sync");function _i(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!1}}renameSync(r,n,o){throw new u(95)}statSync(r,n){throw new u(95)}createFileSync(r,n,o,a){throw new u(95)}openFileSync(r,n,o){throw new u(95)}unlinkSync(r,n){throw new u(95)}rmdirSync(r,n){throw new u(95)}mkdirSync(r,n,o){throw new u(95)}readdirSync(r,n){throw new u(95)}linkSync(r,n,o){throw new u(95)}syncSync(r,n,o){throw new u(95)}}return s(e,"_AsyncFileSystem"),e}s(_i,"Async");function Sn(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new u(30)}renameSync(r,n,o){throw new u(30)}async createFile(r,n,o,a){throw new u(30)}createFileSync(r,n,o,a){throw new u(30)}async unlink(r,n){throw new u(30)}unlinkSync(r,n){throw new u(30)}async rmdir(r,n){throw new u(30)}rmdirSync(r,n){throw new u(30)}async mkdir(r,n,o){throw new u(30)}mkdirSync(r,n,o){throw new u(30)}async link(r,n,o){throw new u(30)}linkSync(r,n,o){throw new u(30)}async sync(r,n,o){throw new u(30)}syncSync(r,n,o){throw new u(30)}}return s(e,"_ReadonlyFileSystem"),e}s(Sn,"Readonly");var Ei={};er(Ei,{COPYFILE_EXCL:()=>Iu,COPYFILE_FICLONE:()=>Pu,COPYFILE_FICLONE_FORCE:()=>Cu,F_OK:()=>_n,O_APPEND:()=>Ce,O_CREAT:()=>H,O_DIRECT:()=>Uu,O_DIRECTORY:()=>Ou,O_DSYNC:()=>Du,O_EXCL:()=>Ie,O_NOATIME:()=>Ru,O_NOCTTY:()=>Lu,O_NOFOLLOW:()=>Bu,O_NONBLOCK:()=>Wu,O_RDONLY:()=>Bt,O_RDWR:()=>re,O_SYMLINK:()=>Mu,O_SYNC:()=>Dt,O_TRUNC:()=>Pe,O_WRONLY:()=>Te,R_OK:()=>be,S_IFBLK:()=>ju,S_IFCHR:()=>$u,S_IFDIR:()=>ar,S_IFIFO:()=>Vu,S_IFLNK:()=>or,S_IFMT:()=>ge,S_IFREG:()=>sr,S_IFSOCK:()=>qu,S_IRGRP:()=>Ju,S_IROTH:()=>ef,S_IRUSR:()=>Gu,S_IRWXG:()=>xn,S_IRWXO:()=>vn,S_IRWXU:()=>En,S_ISGID:()=>Hu,S_ISUID:()=>zu,S_ISVTX:()=>Ku,S_IWGRP:()=>Qu,S_IWOTH:()=>tf,S_IWUSR:()=>Yu,S_IXGRP:()=>Zu,S_IXOTH:()=>rf,S_IXUSR:()=>Xu,UV_FS_O_FILEMAP:()=>nf,W_OK:()=>ae,X_OK:()=>Tu});var _n=0,be=4,ae=2,Tu=1,Iu=1,Pu=2,Cu=4,Bt=0,Te=1,re=2,H=64,Ie=128,Lu=256,Pe=512,Ce=1024,Ou=65536,Ru=262144,Bu=131072,Dt=1052672,Du=4096,Mu=32768,Uu=16384,Wu=2048,ge=61440,qu=49152,or=40960,sr=32768,ju=24576,ar=16384,$u=8192,Vu=4096,zu=2048,Hu=1024,Ku=512,En=448,Gu=256,Yu=128,Xu=64,xn=56,Ju=32,Qu=16,Zu=8,vn=7,ef=4,tf=2,rf=1,nf=0;var D=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(D||{}),Mt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:l,mode:c}={}){let f=Date.now(),d=s((m,y)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:y),"resolveT");this.atimeMs=d(e,f),this.mtimeMs=d(i,f),this.ctimeMs=d(r,f),this.birthtimeMs=d(n,f),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(c)&61440||D.FILE;if(c)this.mode=this._convert(c);else switch(h){case D.FILE:this.mode=this._convert(420);break;case D.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let r=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&r)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};s(Mt,"StatsCommon");var B=class extends Mt{_isBigint=!1;static clone(e){return new B(e)}};s(B,"Stats");var K=class extends Mt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new K(e)}};s(K,"BigIntStats");var Ut=class{type;bsize;blocks;bfree;bavail;files;ffree};s(Ut,"StatsFs");var lr=class{type;bsize;blocks;bfree;bavail;files;ffree};s(lr,"BigIntStatsFs");var cr=2**32-1,fe=0n;function Fs(){return Math.round(Math.random()*2**32).toString(16)}s(Fs,"_random");function Wt(){return BigInt("0x"+Fs()+Fs())}s(Wt,"randomIno");var ue=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Wt(),this.nlink=1,this.size=4096;let r=Date.now();this.atimeMs=r,this.mtimeMs=r,this.ctimeMs=r,this.birthtimeMs=r}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new B(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(ue,"Inode");var fr=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(fr||{}),of=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function P(t){if(typeof t=="number")return Ts(t);if(!of.includes(t))throw new Error("Invalid flag string: "+t);return t}s(P,"parseFlag");function Ts(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(Ts,"flagToString");function sf(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(sf,"flagToNumber");function tt(t){let e=0;return e<<=1,e+=+Ve(t),e<<=1,e+=+de(t),e<<=1,e}s(tt,"flagToMode");function Ve(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(Ve,"isReadable");function de(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(de,"isWriteable");function Is(t){return t.indexOf("w")!==-1}s(Is,"isTruncating");function it(t){return t.indexOf("a")!==-1}s(it,"isAppendable");function xi(t){return t.indexOf("s")!==-1}s(xi,"isSynchronous");function Ps(t){return t.indexOf("x")!==-1}s(Ps,"isExclusive");function ki(t){return Ps(t)?1:Is(t)?2:0}s(ki,"pathExistsAction");function Ni(t){return(de(t)||it(t))&&t!=="r+"?3:1}s(Ni,"pathNotExistsAction");var vi=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(vi,"File");var ne=class extends vi{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:cr}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(Ve(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return it(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async stat(){return new B(this.stats)}statSync(){return new B(this.stats)}truncate(i){if(this.truncateSync(i),xi(this.flag)&&!this.fs.metadata().synchronous)return this.sync()}truncateSync(i){if(this._dirty=!0,!de(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.length,this._buffer.length),xi(this.flag)&&this.fs.metadata().synchronous&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),xi(this.flag)&&this.fs.metadata().synchronous&&this.syncSync()}async write(i,r=0,n=this.stats.size,o=0){return this.writeSync(i,r,n,o)}writeSync(i,r=0,n=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!de(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let f=new Uint8Array(new ArrayBuffer(a,{maxByteLength:cr}));f.set(this._buffer),this._buffer=f}let l=i.slice(r,r+n);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),xi(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,r=0,n=this.stats.size,o=0){return{bytesRead:this.readSync(i,r,n,o),buffer:i}}readSync(i,r=0,n=this.stats.size,o=0){if(!Ve(this.flag))throw new u(1,"File not opened with a readable mode.");o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||new Uint8Array(i.buffer).set(this._buffer.slice(o,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){this._dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(ne,"PreloadFile");var ur=class extends ne{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(ur,"SyncFile");var yt=class extends ne{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(yt,"NoSyncFile");var we={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Ai=class extends ne{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Ai,"MirrorFile");var mt=class extends pt(Y){_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:i}){super(),this._sync=e,this._async=i,this._ready=this._initialize()}metadata(){return{...super.metadata(),name:mt.name,synchronous:!0,supportsProperties:this._sync.metadata().supportsProperties&&this._async.metadata().supportsProperties}}syncSync(e,i,r){this._sync.syncSync(e,i,r),this.enqueue({apiMethod:"sync",arguments:[e,i,r]})}openFileSync(e,i,r){return this._sync.openFileSync(e,i,r)}createFileSync(e,i,r,n){let o=this._sync.createFileSync(e,i,r,n);this.enqueue({apiMethod:"createFile",arguments:[e,i,r,n]});let a=o.statSync(),l=new Uint8Array(a.size);return o.readSync(l),new Ai(this,e,i,a,l)}linkSync(e,i,r){this._sync.linkSync(e,i,r),this.enqueue({apiMethod:"link",arguments:[e,i,r]})}renameSync(e,i,r){this._sync.renameSync(e,i,r),this.enqueue({apiMethod:"rename",arguments:[e,i,r]})}statSync(e,i){return this._sync.statSync(e,i)}unlinkSync(e,i){this._sync.unlinkSync(e,i),this.enqueue({apiMethod:"unlink",arguments:[e,i]})}rmdirSync(e,i){this._sync.rmdirSync(e,i),this.enqueue({apiMethod:"rmdir",arguments:[e,i]})}mkdirSync(e,i,r){this._sync.mkdirSync(e,i,r),this.enqueue({apiMethod:"mkdir",arguments:[e,i,r]})}readdirSync(e,i){return this._sync.readdirSync(e,i)}existsSync(e,i){return this._sync.existsSync(e,i)}async crossCopyDirectory(e,i){if(e!=="/"){let n=await this._async.stat(e,we);this._sync.mkdirSync(e,i,n.cred())}let r=await this._async.readdir(e,we);for(let n of r)await this.crossCopy(ie(e,n))}async crossCopyFile(e,i){let r=await this._async.openFile(e,P("r"),we),n=this._sync.createFileSync(e,P("w"),i,we);try{let{size:o}=await r.stat(),a=new Uint8Array(o);await r.read(a),n.writeSync(a)}finally{await r.close(),n.closeSync()}}async crossCopy(e){let i=await this._async.stat(e,we);i.isDirectory()?await this.crossCopyDirectory(e,i.mode):await this.crossCopyFile(e,i.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(i){throw new u(5,"AsyncMirror desync: "+i)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};s(mt,"AsyncMirrorFS");var af={name:"AsyncMirror",options:{sync:{type:"object",required:!0,description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if("metadata"in t&&!t.metadata().synchronous)throw new u(22,'"sync" option must be a file system that supports synchronous operations')}},async:{type:"object",required:!0,description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new mt(t)}};var dr=class{constructor(e){this.limit=e}cache=[];set(e,i){let r=this.cache.findIndex(n=>n.key===e);r!=-1?this.cache.splice(r,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(r=>r.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(r=>r.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(dr,"LRUCache");var qt=class extends ne{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this.resetDirty())}syncSync(){throw new u(95)}async close(){this.sync()}closeSync(){throw new u(95)}};s(qt,"AsyncFile");var hr=class extends _i(Y){store;_cache;_ready;ready(){return this._ready}metadata(){return{...super.metadata(),name:this.store.name}}constructor({store:e,cacheSize:i}){super(),i>0&&(this._cache=new dr(i)),this._ready=this._initialize(e)}async _initialize(e){return this.store=await e,await this.makeRootDirectory(),this}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,i,r){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let o=this.store.beginTransaction(),a=x(e),l=I(e),c=x(i),f=I(i),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,r))throw u.With("EACCES",e,"rename");if(!h[l])throw u.With("ENOENT",e,"rename");let m=h[l];if(delete h[l],(c+"/").indexOf(e+"/")===0)throw new u(16,a);let y,w;if(c===a?(y=d,w=h):(y=await this.findINode(o,c),w=await this.getDirListing(o,y,c)),w[f]){let b=await this.getINode(o,w[f],i);if(b.toStats().isFile())try{await o.remove(b.ino),await o.remove(w[f])}catch(g){throw await o.abort(),g}else throw u.With("EPERM",i,"rename")}w[f]=m;try{await o.put(d.ino,se(h),!0),await o.put(y.ino,se(w),!0)}catch(b){throw await o.abort(),b}await o.commit()}finally{n&&(this._cache=n)}}async stat(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n)throw u.With("ENOENT",e,"stat");let o=n.toStats();if(!o.hasAccess(4,i))throw u.With("EACCES",e,"stat");return o}async createFile(e,i,r,n){let o=this.store.beginTransaction(),a=new Uint8Array(0),l=await this.commitNewFile(o,e,D.FILE,r,n,a);return new qt(this,e,i,l.toStats(),a)}async openFile(e,i,r){let n=this.store.beginTransaction(),o=await this.findINode(n,e),a=await n.get(o.ino);if(!o.toStats().hasAccess(tt(i),r))throw u.With("EACCES",e,"openFile");if(!a)throw u.With("ENOENT",e,"openFile");return new qt(this,e,i,o.toStats(),a)}async unlink(e,i){return this.removeEntry(e,!1,i)}async rmdir(e,i){if((await this.readdir(e,i)).length>0)throw u.With("ENOTEMPTY",e,"rmdir");await this.removeEntry(e,!0,i)}async mkdir(e,i,r){let n=this.store.beginTransaction(),o=Fe("{}");await this.commitNewFile(n,e,D.DIRECTORY,i,r,o)}async readdir(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw u.With("EACCES",e,"readdur");return Object.keys(await this.getDirListing(r,n,e))}async sync(e,i,r){let n=this.store.beginTransaction(),o=await this._findINode(n,x(e),I(e)),a=await this.getINode(n,o,e),l=a.update(r);try{await n.put(a.ino,i,!0),l&&await n.put(o,a.data,!0)}catch(c){throw await n.abort(),c}await n.commit()}async link(e,i,r){let n=this.store.beginTransaction(),o=x(e);if(!(await this.findINode(n,o)).toStats().hasAccess(4,r))throw u.With("EACCES",o,"link");let l=x(i),c=await this.findINode(n,l),f=await this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw u.With("EACCES",l,"link");let d=await this._findINode(n,o,I(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw u.With("EACCES",i,"link");h.nlink++,f[I(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(f),!0)}catch(m){throw n.abort(),m}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction();if(await e.get(fe)===void 0){let i=new ue;i.mode=511|D.DIRECTORY,await e.put(i.ino,Fe("{}"),!1),await e.put(fe,i.data,!1),await e.commit()}}async _findINode(e,i,r,n=new Set){let o=ie(i,r);if(n.has(o))throw new u(5,"Infinite loop detected while finding inode",o);if(n.add(o),this._cache){let a=this._cache.get(o);if(a)return a}if(i==="/"){if(r==="")return this._cache&&this._cache.set(o,fe),fe;{let a=await this.getINode(e,fe,i),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(o,c),c}else throw u.With("ENOENT",Ae(i,r),"_findINode")}}else{let a=await this.findINode(e,i,n),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(o,c),c}else throw u.With("ENOENT",Ae(i,r),"_findINode")}}async findINode(e,i,r=new Set){let n=await this._findINode(e,x(i),I(i),r);return this.getINode(e,n,i)}async getINode(e,i,r){let n=await e.get(i);if(!n)throw u.With("ENOENT",r,"getINode");return new ue(n.buffer)}async getDirListing(e,i,r){if(!i.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let n=await e.get(i.ino);if(!n)throw u.With("ENOENT",r,"getDirListing");return wi(n)}async addNewNode(e,i,r=5){if(r<=0)throw new u(5,"Unable to commit data to key-value store.");let n=Wt();return await e.put(n,i,!1)?n:await this.addNewNode(e,i,--r)}async commitNewFile(e,i,r,n,o,a){let l=x(i),c=I(i),f=await this.findINode(e,l),d=await this.getDirListing(e,f,l);if(!f.toStats().hasAccess(2,o))throw u.With("EACCES",i,"commitNewFile");if(i==="/")throw u.With("EEXIST",i,"commitNewFile");if(d[c])throw await e.abort(),u.With("EEXIST",i,"commitNewFile");try{let h=new ue;return h.ino=await this.addNewNode(e,a),h.mode=n|r,h.uid=o.uid,h.gid=o.gid,h.size=a.length,d[c]=await this.addNewNode(e,h.data),await e.put(f.ino,se(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,i,r){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction(),o=x(e),a=await this.findINode(n,o),l=await this.getDirListing(n,a,o),c=I(e);if(!l[c])throw u.With("ENOENT",e,"removeEntry");let f=l[c],d=await this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw u.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw u.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw u.With("ENOTDIR",e,"removeEntry");try{await n.put(a.ino,se(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(f))}catch(h){throw await n.abort(),h}await n.commit()}};s(hr,"AsyncStoreFS");var jt=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,r){return this.markModified(e),this.store.put(e,i,r)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(jt,"SimpleSyncTransaction");var Fi=class extends ne{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Fi,"SyncStoreFile");var $t=class extends pt(Y){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction(),o=x(e),a=I(e),l=x(i),c=I(i),f=this.findINode(n,o),d=this.getDirListing(n,f,o);if(!f.toStats().hasAccess(2,r))throw u.With("EACCES",e,"renameSync");if(!d[a])throw u.With("ENOENT",e,"renameSync");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new u(16,o);let m,y;if(l===o?(m=f,y=d):(m=this.findINode(n,l),y=this.getDirListing(n,m,l)),y[c]){let w=this.getINode(n,y[c],i);if(w.toStats().isFile())try{n.remove(w.ino),n.remove(y[c])}catch(b){throw n.abort(),b}else throw u.With("EPERM",i,"renameSync")}y[c]=h;try{n.put(f.ino,se(d),!0),n.put(m.ino,se(y),!0)}catch(w){throw n.abort(),w}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction(),e).toStats();if(!r.hasAccess(4,i))throw u.With("EACCES",e,"statSync");return r}createFileSync(e,i,r,n){return this.commitNewFile(e,D.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction(),o=this.findINode(n,e),a=n.get(o.ino);if(!o.toStats().hasAccess(tt(i),r))throw u.With("EACCES",e,"openFileSync");if(a===null)throw u.With("ENOENT",e,"openFileSync");return new Fi(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw u.With("ENOTEMPTY",e,"rmdirSync");this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,D.DIRECTORY,i,r,Fe("{}"))}readdirSync(e,i){let r=this.store.beginTransaction(),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw u.With("EACCES",e,"readdirSync");return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction(),o=this._findINode(n,x(e),I(e)),a=this.getINode(n,o,e),l=a.update(r);try{n.put(a.ino,i,!0),l&&n.put(o,a.data,!0)}catch(c){throw n.abort(),c}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction(),o=x(e);if(!this.findINode(n,o).toStats().hasAccess(4,r))throw u.With("EACCES",o,"linkSync");let l=x(i),c=this.findINode(n,l),f=this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw u.With("EACCES",l,"linkSync");let d=this._findINode(n,o,I(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw u.With("EACCES",i,"linkSync");h.nlink++,f[I(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(f),!0)}catch(m){throw n.abort(),m}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(fe))return;let i=new ue;i.mode=511|D.DIRECTORY,e.put(i.ino,Fe("{}"),!1),e.put(fe,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let o=ie(i,r);if(n.has(o))throw new u(5,"Infinite loop detected while finding inode",o);if(n.add(o),i!="/"){let a=this._findINode(e,x(i),I(i),n),l=this.getDirListing(e,this.getINode(e,a,i+vs+r),i);if(!(r in l))throw u.With("ENOENT",Ae(i,r),"_findINode");return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,fe,i),i);if(!(r in a))throw u.With("ENOENT",Ae(i,r),"_findINode");return a[r]}return fe}findINode(e,i){let r=this._findINode(e,x(i),I(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw u.With("ENOENT",r,"getINode");return new ue(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let n=e.get(i.ino);if(!n)throw u.With("ENOENT",r,"getDirListing");return wi(n)}addNewNode(e,i,r=5){for(let n=0;n<r;n++){let o=Wt();if(e.put(o,i,!1))return o}throw new u(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),c=I(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw u.With("EACCES",e,"commitNewFile");if(e==="/")throw u.With("EEXIST",e,"commitNewFile");if(d[c])throw u.With("EEXIST",e,"commitNewFile");let h=new ue;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=r|i,h.uid=n.uid,h.gid=n.gid,d[c]=this.addNewNode(a,h.data),a.put(f.ino,se(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction(),o=x(e),a=this.findINode(n,o),l=this.getDirListing(n,a,o),c=I(e),f=l[c];if(!f)throw u.With("ENOENT",e,"removeEntry");let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw u.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw u.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw u.With("ENOTDIR",e,"removeEntry");try{n.put(a.ino,se(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};s($t,"SyncStoreFS");var Ti=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new jt(this)}get(e){return this.store.get(e)}put(e,i,r){return!r&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s(Ti,"InMemoryStore");var kn={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new $t({store:new Ti(t)})}};var Vt=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(Vt,"Mutex");var zt=class{constructor(e){this.fs=e}_mu=new Vt;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){await this._mu.lock(e),await this.fs.rename(e,i,r),this._mu.unlock(e)}renameSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,r)}async stat(e,i){await this._mu.lock(e);let r=await this.fs.stat(e,i);return this._mu.unlock(e),r}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,r){await this._mu.lock(e);let n=await this.fs.openFile(e,i,r);return this._mu.unlock(e),n}openFileSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this._mu.lock(e);let o=await this.fs.createFile(e,i,r,n);return this._mu.unlock(e),o}createFileSync(e,i,r,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this._mu.lock(e),await this.fs.mkdir(e,i,r),this._mu.unlock(e)}mkdirSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this._mu.lock(e);let r=await this.fs.readdir(e,i);return this._mu.unlock(e),r}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let r=await this.fs.exists(e,i);return this._mu.unlock(e),r}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,r){await this._mu.lock(e),await this.fs.link(e,i,r),this._mu.unlock(e)}linkSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this._mu.lock(e),await this.fs.sync(e,i,r),this._mu.unlock(e)}syncSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,r)}};s(zt,"LockedFS");var Nn="/.deleted",Ht=class extends ne{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};s(Ht,"OverlayFile");var Ii=class extends Y{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:Kt.name,synchronous:this._readable.metadata().synchronous&&this._writable.metadata().synchronous,supportsProperties:this._readable.metadata().supportsProperties&&this._writable.metadata().supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,r){let n=r.cred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.cred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(Nn,P("r"),we),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=rr(r)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,r)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"rename")}}renameSync(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,r)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"renameSync")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"stat");let n=new B(await this._readable.stat(e,i));return n.mode|=146,n}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"statSync");let n=new B(this._readable.statSync(e,i));return n.mode|=146,n}}async openFile(e,i,r){if(await this._writable.exists(e,r))return this._writable.openFile(e,i,r);let n=await this._readable.openFile(e,P("r"),r),o=new B(await n.stat()),{buffer:a}=await n.read(new Uint8Array(o.size));return new Ht(this,e,i,o,a)}openFileSync(e,i,r){if(this._writable.existsSync(e,r))return this._writable.openFileSync(e,i,r);let n=this._readable.openFileSync(e,P("r"),r),o=B.clone(n.statSync()),a=new Uint8Array(o.size);return n.readSync(a),new Ht(this,e,i,o,a)}async createFile(e,i,r,n){return this.checkInitialized(),await this._writable.createFile(e,i,r,n),this.openFile(e,i,n)}createFileSync(e,i,r,n){return this.checkInitialized(),this._writable.createFileSync(e,i,r,n),this.openFileSync(e,i,n)}async link(e,i,r){this.checkInitialized(),await this._writable.link(e,i,r)}linkSync(e,i,r){this.checkInitialized(),this._writable.linkSync(e,i,r)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw u.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw u.With("ENOENT",e,"unlinkSync");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw u.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw u.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw u.With("ENOENT",e,"rmdirSync");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw u.With("ENOTEMPTY",e,"rmdirSync");this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw u.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw u.With("EEXIST",e,"mkdirSync");this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw u.With("ENOTDIR",e,"readdir");let n=[];try{n.push(...await this._writable.readdir(e,i))}catch{}try{n.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw u.With("ENOTDIR",e,"readdirSync");let n=[];try{n=n.concat(this._writable.readdirSync(e,i))}catch{}try{n=n.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
-
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(
|
|
4
|
-
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==Nn)throw u.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let r=x(e),n=[];for(;!this._writable.existsSync(r,i);)n.push(r),r=x(r);n=n.reverse();for(let o of n)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let r=x(e),n=[];for(;!await this._writable.exists(r,i);)n.push(r),r=x(r);n=n.reverse();for(let o of n){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw u.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw u.With("ENOENT",e,"operateOnWritableAsync");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let r=this.statSync(e,i);if(r.isDirectory()){this._writable.mkdirSync(e,r.mode,i);return}let n=new Uint8Array(r.size),o=this._readable.openFileSync(e,P("r"),i);o.readSync(n),o.closeSync();let a=this._writable.openFileSync(e,P("w"),i);a.writeSync(n),a.closeSync()}async copyToWritable(e,i){let r=await this.stat(e,i);if(r.isDirectory()){await this._writable.mkdir(e,r.mode,i);return}let n=new Uint8Array(r.size),o=await this._readable.openFile(e,P("r"),i);await o.read(n),await o.close();let a=await this._writable.openFile(e,P("w"),i);await a.write(n),await a.close()}};s(Ii,"UnlockedOverlayFS");var Kt=class extends zt{async ready(){return await super.ready(),this}constructor(e){super(new Ii(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(Kt,"OverlayFS");var lf={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new Kt(t)}};var Qi={};er(Qi,{BigIntStats:()=>K,Dir:()=>Sr,Dirent:()=>st,ReadStream:()=>un,Stats:()=>B,StatsFs:()=>Ut,WriteStream:()=>fn,_toUnixTimestamp:()=>Zs,access:()=>Zd,accessSync:()=>cd,appendFile:()=>Td,appendFileSync:()=>Kf,chmod:()=>Gd,chmodSync:()=>od,chown:()=>Hd,chownSync:()=>rd,close:()=>Pd,closeSync:()=>ot,constants:()=>Ei,copyFile:()=>ah,copyFileSync:()=>dd,cp:()=>fh,cpSync:()=>md,createReadStream:()=>rh,createWriteStream:()=>nh,exists:()=>_d,existsSync:()=>Mn,fchmod:()=>Md,fchmodSync:()=>jn,fchown:()=>Dd,fchownSync:()=>qn,fdatasync:()=>Od,fdatasyncSync:()=>Xf,fstat:()=>Id,fstatSync:()=>Gf,fsync:()=>Ld,fsyncSync:()=>Yf,ftruncate:()=>Cd,ftruncateSync:()=>na,futimes:()=>Ud,futimesSync:()=>$n,initialize:()=>gr,lchmod:()=>Yd,lchmodSync:()=>sd,lchown:()=>Kd,lchownSync:()=>nd,link:()=>$d,linkSync:()=>td,lopenSync:()=>wr,lstat:()=>xd,lstatSync:()=>$f,lutimes:()=>Jd,lutimesSync:()=>ld,mkdir:()=>qd,mkdirSync:()=>ed,mkdtemp:()=>sh,mkdtempSync:()=>fd,mount:()=>br,mounts:()=>_e,open:()=>Nd,openAsBlob:()=>hh,openSync:()=>Li,opendir:()=>uh,opendirSync:()=>yd,promises:()=>kr,read:()=>Bd,readFile:()=>Ad,readFileSync:()=>ra,readSync:()=>Qf,readdir:()=>jd,readdirSync:()=>Vn,readlink:()=>zd,readlinkSync:()=>oa,readv:()=>lh,readvSync:()=>hd,realpath:()=>Qd,realpathSync:()=>Ci,rename:()=>Sd,renameSync:()=>jf,rm:()=>oh,rmSync:()=>ud,rmdir:()=>Wd,rmdirSync:()=>Zf,stat:()=>Ed,statSync:()=>Un,statfs:()=>dh,statfsSync:()=>bd,symlink:()=>Vd,symlinkSync:()=>id,truncate:()=>vd,truncateSync:()=>Vf,umount:()=>Dn,unlink:()=>kd,unlinkSync:()=>ta,unwatchFile:()=>th,utimes:()=>Xd,utimesSync:()=>ad,watch:()=>ih,watchFile:()=>eh,write:()=>Rd,writeFile:()=>Fd,writeFileSync:()=>Wn,writeSync:()=>Jf,writev:()=>ch,writevSync:()=>pd});var kr={};er(kr,{FileHandle:()=>Z,access:()=>oo,appendFile:()=>Gn,chmod:()=>to,chown:()=>Zn,constants:()=>Ei,copyFile:()=>lo,cp:()=>uo,exists:()=>Ri,lchmod:()=>io,lchown:()=>eo,link:()=>Jn,lopen:()=>Er,lstat:()=>Hn,lutimes:()=>no,mkdir:()=>Xn,mkdtemp:()=>ao,open:()=>lt,opendir:()=>co,readFile:()=>xr,readdir:()=>Oi,readlink:()=>vr,realpath:()=>_t,rename:()=>zn,rm:()=>so,rmdir:()=>Yn,stat:()=>Bi,statfs:()=>fo,symlink:()=>Qn,truncate:()=>Kn,unlink:()=>_r,utimes:()=>ro,watch:()=>wd,writeFile:()=>Mi});var at=mn(Se(),1);var St=mn(Se(),1);function Zs(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Zs,"_toUnixTimestamp");function Ee(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new u(22,"Invalid mode: "+t?.toString())}s(Ee,"normalizeMode");function Qt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new u(22,"Invalid time.")}s(Qt,"normalizeTime");function $(t){if(t.includes("\0"))throw new u(22,"Path must be a string without null bytes.");if(t.length==0)throw new u(22,"Path must not be empty.");return Ae(t.replaceAll(/[/\\]+/g,"/"))}s($,"normalizePath");function xe(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:Ee("mode"in t?t?.mode:null,r)}}s(xe,"normalizeOptions");function _(){}s(_,"nop");var v=we;function ea(t){v=t}s(ea,"setCred");var wt=new Map,qf=100;function Zt(t){let e=qf++;return wt.set(e,t),e}s(Zt,"getFdForFile");function q(t){if(!wt.has(t))throw new u(9);return wt.get(t)}s(q,"fd2file");var _e=new Map;br("/",kn.create({name:"root"}));function br(t,e){if(t[0]!=="/"&&(t="/"+t),t=Ae(t),_e.has(t))throw new u(22,"Mount point "+t+" is already in use.");_e.set(t,e)}s(br,"mount");function Dn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Ae(t),!_e.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");_e.delete(t)}s(Dn,"umount");function pe(t){t=$(t);let e=[..._e].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(pe,"resolveFS");function Qs(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(Qs,"fixPaths");function nt(t,e){return typeof t.stack=="string"&&(t.stack=Qs(t.stack,e)),t.message=Qs(t.message,e),t}s(nt,"fixError");function gr(t){"/"in t&&Dn("/");for(let[e,i]of Object.entries(t))br(e,i)}s(gr,"initialize");function le(...[t,e,i,...r]){i=$(i);let{fs:n,path:o}=pe(e&&Mn(i)?Ci(i):i);try{return n[t](o,...r)}catch(a){throw nt(a,{[o]:i})}}s(le,"doOp");function jf(t,e){t=$(t),e=$(e);let i=pe(t),r=pe(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,v);Wn(e,ra(t)),ta(t)}catch(o){throw nt(o,n)}}s(jf,"renameSync");function Mn(t){t=$(t);try{let{fs:e,path:i}=pe(Ci(t));return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Mn,"existsSync");function Un(t,e){let i=le("statSync",!0,t,v);return e?.bigint?new K(i):i}s(Un,"statSync");function $f(t,e){let i=le("statSync",!1,t,v);return e?.bigint?new K(i):i}s($f,"lstatSync");function Vf(t,e=0){let i=Li(t,"r+");try{na(i,e)}finally{ot(i)}}s(Vf,"truncateSync");function ta(t){return le("unlinkSync",!1,t,v)}s(ta,"unlinkSync");function ei(t,e,i,r){let n=$(t),o=Ee(i,420),a=P(e),l;try{l=le("statSync",r,n,v)}catch{switch(Ni(a)){case 3:if(!le("statSync",r,x(n),v).isDirectory())throw u.With("ENOTDIR",x(n),"_openSync");return le("createFileSync",r,n,a,o,v);case 1:throw u.With("ENOENT",n,"_openSync");default:throw new u(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,v))throw u.With("EACCES",n,"_openSync");switch(ki(a)){case 1:throw u.With("EEXIST",n,"_openSync");case 2:return le("unlinkSync",r,n,v),le("createFileSync",r,n,a,l.mode,v);case 0:return le("openFileSync",r,n,a,v);default:throw new u(22,"Invalid FileFlag object.")}}s(ei,"_openSync");function Li(t,e,i){return Zt(ei(t,e,i,!0))}s(Li,"openSync");function wr(t,e,i){return Zt(ei(t,e,i,!1))}s(wr,"lopenSync");function ia(t,e,i){let r=ei(t,e,420,i);try{let n=r.statSync(),o=new Uint8Array(n.size);return r.readSync(o,0,n.size,0),r.closeSync(),o}finally{r.closeSync()}}s(ia,"_readFileSync");function ra(t,e={}){let i=xe(e,null,"r",420),r=P(i.flag);if(!Ve(r))throw new u(22,"Flag passed to readFile must allow for reading.");let n=St.Buffer.from(ia(t,i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(ra,"readFileSync");function zf(t,e,i,r,n){let o=ei(t,i,r,n);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(zf,"_writeFileSync");function Wn(t,e,i){let r=xe(i,"utf8","w",420),n=P(r.flag);if(!de(n))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?St.Buffer.from(e,r.encoding):e;if(o===void 0)throw new u(22,"Data not specified");zf(t,o,r.flag,r.mode,!0)}s(Wn,"writeFileSync");function Hf(t,e,i,r,n){let o=ei(t,i,r,n);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(Hf,"_appendFileSync");function Kf(t,e,i){let r=xe(i,"utf8","a",420),n=P(r.flag);if(!it(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?St.Buffer.from(e,r.encoding):e;Hf(t,o,r.flag,r.mode,!0)}s(Kf,"appendFileSync");function Gf(t,e){let i=q(t).statSync();return e?.bigint?new K(i):i}s(Gf,"fstatSync");function ot(t){q(t).closeSync(),wt.delete(t)}s(ot,"closeSync");function na(t,e=0){if(e<0)throw new u(22);q(t).truncateSync(e)}s(na,"ftruncateSync");function Yf(t){q(t).syncSync()}s(Yf,"fsyncSync");function Xf(t){q(t).datasyncSync()}s(Xf,"fdatasyncSync");function Jf(t,e,i,r,n){let o,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=St.Buffer.from(e,d),l=o.length}else o=e,a=i,l=r,c=typeof n=="number"?n:null;let f=q(t);return c==null&&(c=f.position),f.writeSync(o,a,l,c)}s(Jf,"writeSync");function Qf(t,e,i,r,n){let o=q(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=o.position),o.readSync(e,a,r,n)}s(Qf,"readSync");function qn(t,e,i){q(t).chownSync(e,i)}s(qn,"fchownSync");function jn(t,e){let i=Ee(e,-1);if(i<0)throw new u(22,"Invalid mode.");q(t).chmodSync(i)}s(jn,"fchmodSync");function $n(t,e,i){q(t).utimesSync(Qt(e),Qt(i))}s($n,"futimesSync");function Zf(t){return le("rmdirSync",!0,t,v)}s(Zf,"rmdirSync");function ed(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;le("mkdirSync",!0,t,Ee(i,511),v)}s(ed,"mkdirSync");function Vn(t,e){t=$(t);let i=le("readdirSync",!0,t,v);for(let r of _e.keys()){if(!r.startsWith(t))continue;let n=r.slice(t.length);n.includes("/")||n.length==0||i.push(n)}return i.map(r=>typeof e=="object"&&e?.withFileTypes?new st(r,Un(ie(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?St.Buffer.from(r):r)}s(Vn,"readdirSync");function td(t,e){return e=$(e),le("linkSync",!1,t,e,v)}s(td,"linkSync");function id(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Mn(e))throw u.With("EEXIST",e,"symlinkSync");Wn(e,t),ei(e,"r+",420,!1)._setTypeSync(D.SYMLINK)}s(id,"symlinkSync");function oa(t,e){let i=St.Buffer.from(ia(t,"r",!1)),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:i.toString(r)}s(oa,"readlinkSync");function rd(t,e,i){let r=Li(t,"r+");qn(r,e,i),ot(r)}s(rd,"chownSync");function nd(t,e,i){let r=wr(t,"r+");qn(r,e,i),ot(r)}s(nd,"lchownSync");function od(t,e){let i=Li(t,"r+");jn(i,e),ot(i)}s(od,"chmodSync");function sd(t,e){let i=wr(t,"r+");jn(i,e),ot(i)}s(sd,"lchmodSync");function ad(t,e,i){let r=Li(t,"r+");$n(r,e,i),ot(r)}s(ad,"utimesSync");function ld(t,e,i){let r=wr(t,"r+");$n(r,e,i),ot(r)}s(ld,"lutimesSync");function Ci(t,e){t=$(t);let{base:i,dir:r}=tr(t),n=ie(r=="/"?"/":Ci(r),i),{fs:o,path:a,mountPoint:l}=pe(n);try{return o.statSync(a,v).isSymbolicLink()?Ci(l+oa(n)):n}catch(c){throw nt(c,{[a]:n})}}s(Ci,"realpathSync");function cd(t,e=384){if(!Un(t).hasAccess(e,v))throw new u(13)}s(cd,"accessSync");function ud(t){throw u.With("ENOTSUP",t,"rmSync")}s(ud,"rmSync");function fd(t,e){throw u.With("ENOTSUP",t,"mkdtempSync")}s(fd,"mkdtempSync");function dd(t,e,i){throw u.With("ENOTSUP",t,"copyFileSync")}s(dd,"copyFileSync");function hd(t,e,i){throw u.With("ENOTSUP",q(t).path,"readvSync")}s(hd,"readvSync");function pd(t,e,i){throw u.With("ENOTSUP",q(t).path,"writevSync")}s(pd,"writevSync");function yd(t,e){throw u.With("ENOTSUP",t,"opendirSync")}s(yd,"opendirSync");function md(t,e,i){throw u.With("ENOTSUP",t,"cpSync")}s(md,"cpSync");function bd(t,e){throw u.With("ENOTSUP",t,"statfsSync")}s(bd,"statfsSync");var st=class{constructor(e,i){this.path=e;this.stats=i}get name(){return I(this.path)}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(st,"Dirent");var Sr=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Oi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=Vn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(Sr,"Dir");var Z=class{constructor(e){this.fd=e}get file(){return q(this.fd)}get path(){return this.file.path}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=Ee(e,-1);if(i<0)throw new u(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e<0)throw new u(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Qt(e),Qt(i))}async appendFile(e,i){let r=xe(i,"utf8","a",420),n=P(r.flag);if(!it(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?at.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(e,i,r,n)}async readFile(e){let i=xe(e,null,"r",292),r=P(i.flag);if(!Ve(r))throw new u(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),o=new Uint8Array(n);await this.file.read(o,0,n,0);let a=at.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e){throw u.With("ENOTSUP",this.path,"FileHandle.readableWebStream")}readLines(e){throw u.With("ENOTSUP",this.path,"FileHandle.readLines")}[Symbol.asyncDispose](){throw u.With("ENOTSUP",this.path,"FileHandle.@@asyncDispose")}async stat(e){let i=await this.file.stat();return e?.bigint?new K(i):i}async write(e,i,r,n){let o,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,o=at.Buffer.from(e,f),l=o.length}else o=e,a=i,l=r,n=typeof n=="number"?n:null;n??=this.file.position;let c=await this.file.write(o,a,l,n);return{buffer:o,bytesWritten:c}}async writeFile(e,i){let r=xe(i,"utf8","w",420),n=P(r.flag);if(!de(n))throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?at.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),wt.delete(this.fd)}writev(e,i){throw u.With("ENOTSUP",this.path,"FileHandle.writev")}readv(e,i){throw u.With("ENOTSUP",this.path,"FileHandle.readv")}createReadStream(e){throw u.With("ENOTSUP",this.path,"createReadStream")}createWriteStream(e){throw u.With("ENOTSUP",this.path,"createWriteStream")}};s(Z,"FileHandle");async function ve(...[t,e,i,...r]){i=$(i);let n=e&&await Ri(i)?await _t(i):i,{fs:o,path:a}=pe(n);try{return o[t](a,...r)}catch(l){throw nt(l,{[a]:i})}}s(ve,"doOp");async function zn(t,e){t=$(t),e=$(e);let i=pe(t),r=pe(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,v);return}await Mi(e,await xr(t)),await _r(t)}catch(n){throw nt(n,{[i.path]:t,[r.path]:e})}}s(zn,"rename");async function Ri(t){try{let{fs:e,path:i}=pe(await _t(t));return await e.exists(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Ri,"exists");async function Bi(t,e){let i=await ve("stat",!0,t,v);return e?.bigint?new K(i):i}s(Bi,"stat");async function Hn(t,e){let i=await ve("stat",!1,t,v);return e?.bigint?new K(i):i}s(Hn,"lstat");async function Kn(t,e=0){let i=await lt(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Kn,"truncate");async function _r(t){return ve("unlink",!1,t,v)}s(_r,"unlink");async function Di(t,e,i=420,r){let n=$(t),o=Ee(i,420),a=P(e);try{switch(ki(a)){case 1:throw u.With("EEXIST",n,"_open");case 2:let l=await ve("openFile",r,n,a,v);if(!l)throw new u(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await ve("openFile",r,n,a,v);default:throw new u(22,"Invalid file flag")}}catch{switch(Ni(a)){case 3:let c=await ve("stat",r,x(n),v);if(c&&!c.isDirectory())throw u.With("ENOTDIR",x(n),"_open");return await ve("createFile",r,n,a,o,v);case 1:throw u.With("ENOENT",n,"_open");default:throw new u(22,"Invalid file flag")}}}s(Di,"_open");async function lt(t,e,i=420){let r=await Di(t,e,i,!0);return new Z(Zt(r))}s(lt,"open");async function Er(t,e,i=420){let r=await Di(t,e,i,!1);return new Z(Zt(r))}s(Er,"lopen");async function sa(t,e,i){let r=await Di($(t),e,420,i);try{let n=await r.stat(),o=new Uint8Array(n.size);return await r.read(o,0,n.size,0),await r.close(),o}catch(n){throw await r.close(),n}}s(sa,"_readFile");async function xr(t,e){let i=xe(e,null,"r",null),r=P(i.flag);if(!Ve(r))throw new u(22,"Flag passed must allow for reading.");let n=at.Buffer.from(await sa(t,i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(xr,"readFile");async function Mi(t,e,i){let r=xe(i,"utf8","w",420),n=await lt(t,r.flag,r.mode);try{await n.writeFile(e,r)}finally{await n.close()}}s(Mi,"writeFile");async function gd(t,e,i,r,n){let o=await Di(t,i,r,n);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(gd,"_appendFile");async function Gn(t,e,i){let r=xe(i,"utf8","a",420),n=P(r.flag);if(!it(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?at.Buffer.from(e,r.encoding):e;await gd(t,o,r.flag,r.mode,!0)}s(Gn,"appendFile");async function Yn(t){return ve("rmdir",!0,t,v)}s(Yn,"rmdir");async function Xn(t,e){await ve("mkdir",!0,t,Ee(typeof e=="object"?e?.mode:e,511),v)}s(Xn,"mkdir");async function Oi(t,e){t=$(t);let i=await ve("readdir",!0,t,v),r=[..._e.keys()];for(let o of r)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let n=[];for(let o of i)n.push(typeof e=="object"&&e?.withFileTypes?new st(o,await Bi(ie(t,o))):o);return n}s(Oi,"readdir");async function Jn(t,e){return e=$(e),ve("link",!1,t,e,v)}s(Jn,"link");async function Qn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await Ri(e))throw u.With("EEXIST",e,"symlink");await Mi(e,t),await(await Di(e,"r+",420,!1))._setType(D.SYMLINK)}s(Qn,"symlink");async function vr(t,e){let i=at.Buffer.from(await sa(t,"r",!1)),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:i.toString(r)}s(vr,"readlink");async function Zn(t,e,i){let r=await lt(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(Zn,"chown");async function eo(t,e,i){let r=await Er(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(eo,"lchown");async function to(t,e){let i=await lt(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(to,"chmod");async function io(t,e){let i=await Er(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(io,"lchmod");async function ro(t,e,i){let r=await lt(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(ro,"utimes");async function no(t,e,i){let r=await Er(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(no,"lutimes");async function _t(t,e){t=$(t);let{base:i,dir:r}=tr(t),n=ie(r=="/"?"/":await _t(r),i),{fs:o,path:a,mountPoint:l}=pe(n);try{return(await o.stat(a,v)).isSymbolicLink()?_t(l+await vr(n)):n}catch(c){throw nt(c,{[a]:n})}}s(_t,"realpath");function wd(t,e){throw u.With("ENOTSUP",t,"watch")}s(wd,"watch");async function oo(t,e=0){if(!(await Bi(t)).hasAccess(e,v))throw new u(13)}s(oo,"access");async function so(t,e){throw u.With("ENOTSUP",t,"rm")}s(so,"rm");async function ao(t,e){throw u.With("ENOTSUP",t,"mkdtemp")}s(ao,"mkdtemp");async function lo(t,e,i){throw u.With("ENOTSUP",t,"copyFile")}s(lo,"copyFile");async function co(t,e){throw u.With("ENOTSUP",t,"opendir")}s(co,"opendir");async function uo(t,e,i){throw u.With("ENOTSUP",t,"cp")}s(uo,"cp");async function fo(t,e){throw u.With("ENOTSUP",t,"statfs")}s(fo,"statfs");function Sd(t,e,i=_){zn(t,e).then(()=>i()).catch(i)}s(Sd,"rename");function _d(t,e=_){Ri(t).then(e).catch(()=>e(!1))}s(_d,"exists");function Ed(t,e,i=_){i=typeof e=="function"?e:i,Bi(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(Ed,"stat");function xd(t,e,i=_){i=typeof e=="function"?e:i,Hn(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(xd,"lstat");function vd(t,e=0,i=_){i=typeof e=="function"?e:i,Kn(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(vd,"truncate");function kd(t,e=_){_r(t).then(()=>e()).catch(e)}s(kd,"unlink");function Nd(t,e,i,r=_){let n=Ee(i,420);r=typeof i=="function"?i:r,lt(t,e,n).then(o=>r(null,o.fd)).catch(r)}s(Nd,"open");function Ad(t,e,i=_){i=typeof e=="function"?e:i,xr(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(Ad,"readFile");function Fd(t,e,i,r=_){r=typeof i=="function"?i:r,Mi(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}s(Fd,"writeFile");function Td(t,e,i,r=_){r=typeof i=="function"?i:r,Gn(t,e,typeof i=="function"?null:i).then(()=>r()).catch(r)}s(Td,"appendFile");function Id(t,e,i=_){i=typeof e=="function"?e:i,q(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?new K(r):r)).catch(i)}s(Id,"fstat");function Pd(t,e=_){new Z(t).close().then(()=>e()).catch(e)}s(Pd,"close");function Cd(t,e,i=_){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=q(t);if(r<0)throw new u(22);n.truncate(r).then(()=>i()).catch(i)}s(Cd,"ftruncate");function Ld(t,e=_){q(t).sync().then(()=>e()).catch(e)}s(Ld,"fsync");function Od(t,e=_){q(t).datasync().then(()=>e()).catch(e)}s(Od,"fdatasync");function Rd(t,e,i,r,n,o=_){let a,l,c,f=null,d,h=new Z(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof r=="string"?r:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof r=="function"?r:typeof n=="function"?n:o,o(new u(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let m=o;h.write(a,l,c,f).then(({bytesWritten:y})=>m(null,y,a.toString(d))).catch(m)}else{a=Buffer.from(e),l=i,c=r,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;h.write(a,l,c,f).then(({bytesWritten:y})=>m(null,y,a)).catch(m)}}s(Rd,"write");function Bd(t,e,i,r,n,o=_){new Z(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(Bd,"read");function Dd(t,e,i,r=_){new Z(t).chown(e,i).then(()=>r()).catch(r)}s(Dd,"fchown");function Md(t,e,i){new Z(t).chmod(e).then(()=>i()).catch(i)}s(Md,"fchmod");function Ud(t,e,i,r=_){new Z(t).utimes(e,i).then(()=>r()).catch(r)}s(Ud,"futimes");function Wd(t,e=_){Yn(t).then(()=>e()).catch(e)}s(Wd,"rmdir");function qd(t,e,i=_){Xn(t,e).then(()=>i()).catch(i)}s(qd,"mkdir");function jd(t,e,i=_){i=typeof e=="function"?e:i,Oi(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(jd,"readdir");function $d(t,e,i=_){Jn(t,e).then(()=>i()).catch(i)}s($d,"link");function Vd(t,e,i,r=_){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Qn(t,e,n).then(()=>r()).catch(r)}s(Vd,"symlink");function zd(t,e,i=_){i=typeof e=="function"?e:i,vr(t).then(r=>i(null,r)).catch(i)}s(zd,"readlink");function Hd(t,e,i,r=_){Zn(t,e,i).then(()=>r()).catch(r)}s(Hd,"chown");function Kd(t,e,i,r=_){eo(t,e,i).then(()=>r()).catch(r)}s(Kd,"lchown");function Gd(t,e,i=_){to(t,e).then(()=>i()).catch(i)}s(Gd,"chmod");function Yd(t,e,i=_){io(t,e).then(()=>i()).catch(i)}s(Yd,"lchmod");function Xd(t,e,i,r=_){ro(t,e,i).then(()=>r()).catch(r)}s(Xd,"utimes");function Jd(t,e,i,r=_){no(t,e,i).then(()=>r()).catch(r)}s(Jd,"lutimes");function Qd(t,e,i=_){i=typeof e=="function"?e:i,_t(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(Qd,"realpath");function Zd(t,e,i=_){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,oo(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(Zd,"access");function eh(t,e,i=_){throw u.With("ENOTSUP",t,"watchFile")}s(eh,"watchFile");function th(t,e=_){throw u.With("ENOTSUP",t,"unwatchFile")}s(th,"unwatchFile");function ih(t,e,i=_){throw u.With("ENOTSUP",t,"watch")}s(ih,"watch");function rh(t,e){throw u.With("ENOTSUP",t,"createReadStream")}s(rh,"createReadStream");function nh(t,e){throw u.With("ENOTSUP",t,"createWriteStream")}s(nh,"createWriteStream");function oh(t,e,i=_){i=typeof e=="function"?e:i,so(t,typeof e=="function"?null:e).then(()=>i(null)).catch(i)}s(oh,"rm");function sh(t,e,i=_){i=typeof e=="function"?e:i,ao(t,typeof e!="function"?e:null).then(r=>i(null,r)).catch(i)}s(sh,"mkdtemp");function ah(t,e,i,r){r=typeof i=="function"?i:r,lo(t,e,typeof i=="function"?null:i).then(()=>r(null)).catch(r)}s(ah,"copyFile");function lh(t,e,i,r=_){r=typeof i=="function"?i:r,new Z(t).readv(e,typeof i=="function"?null:i).then(({buffers:n,bytesRead:o})=>r(null,o,n)).catch(r)}s(lh,"readv");function ch(t,e,i,r=_){r=typeof i=="function"?i:r,new Z(t).writev(e,typeof i=="function"?null:i).then(({buffers:n,bytesWritten:o})=>r(null,o,n)).catch(r)}s(ch,"writev");function uh(t,e,i=_){i=typeof e=="function"?e:i,co(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(uh,"opendir");function fh(t,e,i,r){r=typeof i=="function"?i:r,uo(t,e,typeof i=="function"?null:i).then(()=>r(null)).catch(r)}s(fh,"cp");function dh(t,e,i=_){i=typeof e=="function"?e:i,fo(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(dh,"statfs");function hh(t,e){throw u.With("ENOTSUP",t,"openAsBlob")}s(hh,"openAsBlob");var dn=mn(yu(),1);var un=class extends dn.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(un,"ReadStream");var fn=class extends dn.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(fn,"WriteStream");function mu(t,e=0,i=0){ea({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),gr(t)}s(mu,"initialize");async function Ug(t){("backend"in t||t instanceof Y)&&(t={"/":t});for(let[e,i]of Object.entries(t))typeof i!="number"&&(i instanceof Y||(Si(i)&&(i={backend:i}),t[e]=await nr(i)));mu(t)}s(Ug,"configure");var Ot=class{static FromListing(e){let i=new Ot,r=new Ze;i._index.set("/",r);let n=[{pwd:"",tree:e,parent:r}];for(;n.length>0;){let o,{tree:a,pwd:l,parent:c}=n.pop();for(let f in a){if(!Object.hasOwn(a,f))continue;let d=a[f];if(d){let h=l+"/"+f;o=new Ze,i._index.set(h,o),n.push({pwd:h,tree:d,parent:o})}else o=new Zi(new B({mode:D.FILE|365}));c&&c._listing.set(f,o)}}return i}_index=new Map;constructor(){this.add("/",new Ze)}files(){let e=[];for(let i of this._index.values())for(let r of i.listing){let n=i.get(r);n?.isFile()&&e.push(n)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let r=x(e),n=this._index.get(r);return!n&&e!="/"&&(n=new Ze,!this.add(r,n))||e!="/"&&!n.add(I(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let r=x(e),n=I(e),o=this._index.get(r);return o||(o=new Ze,this.addFast(r,o)),o.add(n,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),r=this._index.get(i);if(!r)return;let n=r.remove(I(e));if(!n)return;if(!n.isDirectory())return n;let o=n.listing;for(let a of o)this.remove(ie(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),r=this._index.get(i);return i==e?r:r?.get(I(e))}};s(Ot,"FileIndex");var mi=class{constructor(e){this.data=e}};s(mi,"IndexInode");var Zi=class extends mi{isFile(){return!0}isDirectory(){return!1}toStats(){return new B({mode:D.FILE|438,size:4096})}};s(Zi,"IndexFileInode");var Ze=class extends mi{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new B({mode:D.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(Ze,"IndexDirInode");var bi=class extends Sn(Y){_index;constructor(e){super(),this._index=Ot.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new u(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"statSync");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new u(22,"Invalid inode.")}async openFile(e,i,r){if(de(i))throw new u(1,e);let n=this._index.get(e);if(!n)throw u.With("ENOENT",e,"openFile");if(!n.toStats().hasAccess(tt(i),r))throw u.With("EACCESS",e,"openFile");if(n.isDirectory()){let o=n.stats;return new yt(this,e,i,o,o.fileData)}return this.openFileInode(n,e,i)}openFileSync(e,i,r){if(de(i))throw new u(1,e);let n=this._index.get(e);if(!n)throw u.With("ENOENT",e,"openFileSync");if(!n.toStats().hasAccess(tt(i),r))throw u.With("EACCES",e,"openFileSync");if(n.isDirectory()){let o=n.stats;return new yt(this,e,i,o,o.fileData)}return this.openFileInodeSync(n,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw u.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"readdirSync");if(i.isDirectory())return i.listing;throw u.With("ENOTDIR",e,"readdirSync")}};s(bi,"FileIndexFS");var hn=class extends pt(bi){async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,r){return this.openFileInodeSync(e,i,r)}};s(hn,"SyncFileIndexFS");var pn=class extends _i(bi){statFileInodeSync(){throw new u(95)}openFileInodeSync(){throw new u(95)}};s(pn,"AsyncFileIndexFS");var Wg=Qi;return xu(qg);})();
|
|
1
|
+
var ZenFS=(()=>{var Rf=Object.create;var bi=Object.defineProperty;var Bf=Object.getOwnPropertyDescriptor;var Df=Object.getOwnPropertyNames;var Mf=Object.getPrototypeOf,Wf=Object.prototype.hasOwnProperty;var s=(t,e)=>bi(t,"name",{value:e,configurable:!0});var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ir=(t,e)=>{for(var i in e)bi(t,i,{get:e[i],enumerable:!0})},vs=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Df(e))!Wf.call(t,n)&&n!==i&&bi(t,n,{get:()=>e[n],enumerable:!(r=Bf(e,n))||r.enumerable});return t};var gn=(t,e,i)=>(i=t!=null?Rf(Mf(t)):{},vs(e||!t||!t.__esModule?bi(i,"default",{value:t,enumerable:!0}):i,t)),Uf=t=>vs(bi({},"__esModule",{value:!0}),t);var Os=A(yr=>{"use strict";yr.byteLength=kd;yr.toByteArray=Ad;yr.fromByteArray=Fd;var Ce=[],he=[],vd=typeof Uint8Array<"u"?Uint8Array:Array,In="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yt=0,Ps=In.length;yt<Ps;++yt)Ce[yt]=In[yt],he[In.charCodeAt(yt)]=yt;var yt,Ps;he["-".charCodeAt(0)]=62;he["_".charCodeAt(0)]=63;function Cs(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var r=i===e?0:4-i%4;return[i,r]}s(Cs,"getLens");function kd(t){var e=Cs(t),i=e[0],r=e[1];return(i+r)*3/4-r}s(kd,"byteLength");function Nd(t,e,i){return(e+i)*3/4-i}s(Nd,"_byteLength");function Ad(t){var e,i=Cs(t),r=i[0],n=i[1],o=new vd(Nd(t,r,n)),a=0,l=n>0?r-4:r,c;for(c=0;c<l;c+=4)e=he[t.charCodeAt(c)]<<18|he[t.charCodeAt(c+1)]<<12|he[t.charCodeAt(c+2)]<<6|he[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=he[t.charCodeAt(c)]<<2|he[t.charCodeAt(c+1)]>>4,o[a++]=e&255),n===1&&(e=he[t.charCodeAt(c)]<<10|he[t.charCodeAt(c+1)]<<4|he[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Ad,"toByteArray");function Td(t){return Ce[t>>18&63]+Ce[t>>12&63]+Ce[t>>6&63]+Ce[t&63]}s(Td,"tripletToBase64");function Id(t,e,i){for(var r,n=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(Td(r));return n.join("")}s(Id,"encodeChunk");function Fd(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,l=i-r;a<l;a+=o)n.push(Id(t,a,a+o>l?l:a+o));return r===1?(e=t[i-1],n.push(Ce[e>>2]+Ce[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(Ce[e>>10]+Ce[e>>4&63]+Ce[e<<2&63]+"=")),n.join("")}s(Fd,"fromByteArray")});var Rs=A(Fn=>{Fn.read=function(t,e,i,r,n){var o,a,l=n*8-r-1,c=(1<<l)-1,u=c>>1,d=-7,h=i?n-1:0,m=i?-1:1,y=t[e+h];for(h+=m,o=y&(1<<-d)-1,y>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-u}return(y?-1:1)*a*Math.pow(2,o-r)};Fn.write=function(t,e,i,r,n,o){var a,l,c,u=o*8-n-1,d=(1<<u)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:o-1,w=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=m/c:e+=m*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+y]=l&255,y+=w,l/=256,n-=8);for(a=a<<n|l,u+=n;u>0;t[i+y]=a&255,y+=w,a/=256,u-=8);t[i+y-w]|=b*128}});var _e=A(Gt=>{"use strict";var Ln=Os(),Ht=Rs(),Bs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Gt.Buffer=p;Gt.SlowBuffer=Bd;Gt.INSPECT_MAX_BYTES=50;var mr=2147483647;Gt.kMaxLength=mr;p.TYPED_ARRAY_SUPPORT=Ld();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ld(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Ld,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function ze(t){if(t>mr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}s(ze,"createBuffer");function p(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Rn(t)}return Us(t,e,i)}s(p,"Buffer");p.poolSize=8192;function Us(t,e,i){if(typeof t=="string")return Cd(t,e);if(ArrayBuffer.isView(t))return Od(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Oe(t,ArrayBuffer)||t&&Oe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(t,SharedArrayBuffer)||t&&Oe(t.buffer,SharedArrayBuffer)))return Cn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return p.from(r,e,i);let n=Rd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(Us,"from");p.from=function(t,e,i){return Us(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function qs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(qs,"assertSize");function Pd(t,e,i){return qs(t),t<=0?ze(t):e!==void 0?typeof i=="string"?ze(t).fill(e,i):ze(t).fill(e):ze(t)}s(Pd,"alloc");p.alloc=function(t,e,i){return Pd(t,e,i)};function Rn(t){return qs(t),ze(t<0?0:Bn(t)|0)}s(Rn,"allocUnsafe");p.allocUnsafe=function(t){return Rn(t)};p.allocUnsafeSlow=function(t){return Rn(t)};function Cd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=js(t,e)|0,r=ze(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(Cd,"fromString");function Pn(t){let e=t.length<0?0:Bn(t.length)|0,i=ze(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(Pn,"fromArrayLike");function Od(t){if(Oe(t,Uint8Array)){let e=new Uint8Array(t);return Cn(e.buffer,e.byteOffset,e.byteLength)}return Pn(t)}s(Od,"fromArrayView");function Cn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,p.prototype),r}s(Cn,"fromArrayBuffer");function Rd(t){if(p.isBuffer(t)){let e=Bn(t.length)|0,i=ze(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Mn(t.length)?ze(0):Pn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Pn(t.data)}s(Rd,"fromObject");function Bn(t){if(t>=mr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+mr.toString(16)+" bytes");return t|0}s(Bn,"checked");function Bd(t){return+t!=t&&(t=0),p.alloc(+t)}s(Bd,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,i){if(Oe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Oe(i,Uint8Array)&&(i=p.from(i,i.offset,i.byteLength)),!p.isBuffer(e)||!p.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==i[o]){r=e[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");p.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=p.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(Oe(a,Uint8Array))o+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(p.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function js(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Oe(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return On(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Js(t).length;default:if(n)return r?-1:On(t).length;e=(""+e).toLowerCase(),n=!0}}s(js,"byteLength");p.byteLength=js;function Dd(t,e,i){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Kd(this,e,i);case"utf8":case"utf-8":return Vs(this,e,i);case"ascii":return zd(this,e,i);case"latin1":case"binary":return Hd(this,e,i);case"base64":return $d(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gd(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(Dd,"slowToString");p.prototype._isBuffer=!0;function mt(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(mt,"swap");p.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)mt(this,i,i+1);return this},"swap16");p.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)mt(this,i,i+3),mt(this,i+1,i+2);return this},"swap32");p.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)mt(this,i,i+7),mt(this,i+1,i+6),mt(this,i+2,i+5),mt(this,i+3,i+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Vs(this,0,e):Dd.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=s(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=s(function(){let e="",i=Gt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Bs&&(p.prototype[Bs]=p.prototype.inspect);p.prototype.compare=s(function(e,i,r,n,o){if(Oe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,l=r-i,c=Math.min(a,l),u=this.slice(n,o),d=e.slice(i,r);for(let h=0;h<c;++h)if(u[h]!==d[h]){a=u[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function $s(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Mn(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=p.from(e,r)),p.isBuffer(e))return e.length===0?-1:Ds(t,e,i,r,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Ds(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s($s,"bidirectionalIndexOf");function Ds(t,e,i,r,n){let o=1,a=t.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(c,"read");let u;if(n){let d=-1;for(u=i;u<a;u++)if(c(t,u)===c(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===l)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(i+l>a&&(i=a-l),u=i;u>=0;u--){let d=!0;for(let h=0;h<l;h++)if(c(t,u+h)!==c(e,h)){d=!1;break}if(d)return u}return-1}s(Ds,"arrayIndexOf");p.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");p.prototype.indexOf=s(function(e,i,r){return $s(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,i,r){return $s(this,e,i,r,!1)},"lastIndexOf");function Md(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=e.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let l=parseInt(e.substr(a*2,2),16);if(Mn(l))return a;t[i+a]=l}return a}s(Md,"hexWrite");function Wd(t,e,i,r){return br(On(e,t.length-i),t,i,r)}s(Wd,"utf8Write");function Ud(t,e,i,r){return br(Qd(e),t,i,r)}s(Ud,"asciiWrite");function qd(t,e,i,r){return br(Js(e),t,i,r)}s(qd,"base64Write");function jd(t,e,i,r){return br(Zd(e,t.length-i),t,i,r)}s(jd,"ucs2Write");p.prototype.write=s(function(e,i,r,n){if(i===void 0)n="utf8",r=this.length,i=0;else if(r===void 0&&typeof i=="string")n=i,r=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return Md(this,e,i,r);case"utf8":case"utf-8":return Wd(this,e,i,r);case"ascii":case"latin1":case"binary":return Ud(this,e,i,r);case"base64":return qd(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jd(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function $d(t,e,i){return e===0&&i===t.length?Ln.fromByteArray(t):Ln.fromByteArray(t.slice(e,i))}s($d,"base64Slice");function Vs(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=i){let c,u,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[n+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[n+1],u=t[n+2],(c&192)===128&&(u&192)===128&&(h=(o&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[n+1],u=t[n+2],d=t[n+3],(c&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(c&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=l}return Vd(r)}s(Vs,"utf8Slice");var Ms=4096;function Vd(t){let e=t.length;if(e<=Ms)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=Ms));return i}s(Vd,"decodeCodePointsArray");function zd(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]&127);return r}s(zd,"asciiSlice");function Hd(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}s(Hd,"latin1Slice");function Kd(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=e;o<i;++o)n+=eh[t[o]];return n}s(Kd,"hexSlice");function Gd(t,e,i){let r=t.slice(e,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(Gd,"utf16leSlice");p.prototype.slice=s(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=ot(s(function(e){e=e>>>0,Kt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=ot(s(function(e){e=e>>>0,Kt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");p.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=i,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");p.prototype.readInt8=s(function(e,i){return e=e>>>0,i||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||G(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");p.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||G(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");p.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=ot(s(function(e){e=e>>>0,Kt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=ot(s(function(e){e=e>>>0,Kt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),Ht.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||G(e,4,this.length),Ht.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||G(e,8,this.length),Ht.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||G(e,8,this.length),Ht.read(this,e,!1,52,8)},"readDoubleBE");function oe(t,e,i,r,n,o){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}s(oe,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;oe(this,e,i,r,l,0)}let o=1,a=0;for(this[i]=e&255;++a<r&&(o*=256);)this[i+a]=e/o&255;return i+r},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;oe(this,e,i,r,l,0)}let o=r-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+r},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function zs(t,e,i,r,n){Xs(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(zs,"wrtBigUInt64LE");function Hs(t,e,i,r,n){Xs(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(Hs,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=ot(s(function(e,i=0){return zs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=ot(s(function(e,i=0){return Hs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);oe(this,e,i,r,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+r},"writeIntLE");p.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);oe(this,e,i,r,c-1,-c)}let o=r-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+r},"writeIntBE");p.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");p.prototype.writeBigInt64LE=ot(s(function(e,i=0){return zs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=ot(s(function(e,i=0){return Hs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ks(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Ks,"checkIEEE754");function Gs(t,e,i,r,n){return e=+e,i=i>>>0,n||Ks(t,e,i,4,34028234663852886e22,-34028234663852886e22),Ht.write(t,e,i,r,23,4),i+4}s(Gs,"writeFloat");p.prototype.writeFloatLE=s(function(e,i,r){return Gs(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,i,r){return Gs(this,e,i,!1,r)},"writeFloatBE");function Ys(t,e,i,r,n){return e=+e,i=i>>>0,n||Ks(t,e,i,8,17976931348623157e292,-17976931348623157e292),Ht.write(t,e,i,r,52,8),i+8}s(Ys,"writeDouble");p.prototype.writeDoubleLE=s(function(e,i,r){return Ys(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,i,r){return Ys(this,e,i,!1,r)},"writeDoubleBE");p.prototype.copy=s(function(e,i,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-i<n-r&&(n=e.length-i+r);let o=n-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),i),o},"copy");p.prototype.fill=s(function(e,i,r,n){if(typeof e=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<r;++o)this[o]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%l]}return this},"fill");var zt={};function Dn(t,e,i){zt[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Dn,"E");Dn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Dn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Dn("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Ws(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=Ws(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function Ws(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ws,"addNumericalSeparator");function Yd(t,e,i){Kt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Ti(e,t.length-(i+1))}s(Yd,"checkBounds");function Xs(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new zt.ERR_OUT_OF_RANGE("value",l,t)}Yd(r,n,o)}s(Xs,"checkIntBI");function Kt(t,e){if(typeof t!="number")throw new zt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Kt,"validateNumber");function Ti(t,e,i){throw Math.floor(t)!==t?(Kt(t,i),new zt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new zt.ERR_BUFFER_OUT_OF_BOUNDS:new zt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Ti,"boundsError");var Xd=/[^+/0-9A-Za-z-_]/g;function Jd(t){if(t=t.split("=")[0],t=t.trim().replace(Xd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(Jd,"base64clean");function On(t,e){e=e||1/0;let i,r=t.length,n=null,o=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(On,"utf8ToBytes");function Qd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Qd,"asciiToBytes");function Zd(t,e){let i,r,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(Zd,"utf16leToBytes");function Js(t){return Ln.toByteArray(Jd(t))}s(Js,"base64ToBytes");function br(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}s(br,"blitBuffer");function Oe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(Oe,"isInstance");function Mn(t){return t!==t}s(Mn,"numberIsNaN");var eh=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let r=i*16;for(let n=0;n<16;++n)e[r+n]=t[i]+t[n]}return e}();function ot(t){return typeof BigInt>"u"?th:t}s(ot,"defineBigIntMethod");function th(){throw new Error("BigInt not supported")}s(th,"BufferBigIntNotDefined")});var C=A((QS,vl)=>{"use strict";vl.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var ei=A((ZS,Fr)=>{"use strict";var{AbortController:kl,AbortSignal:ah}=typeof self<"u"?self:typeof window<"u"?window:void 0;Fr.exports=kl;Fr.exports.AbortSignal=ah;Fr.exports.default=kl});var Wi=A((e_,fo)=>{"use strict";var ti=typeof Reflect=="object"?Reflect:null,Nl=ti&&typeof ti.apply=="function"?ti.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Lr;ti&&typeof ti.ownKeys=="function"?Lr=ti.ownKeys:Object.getOwnPropertySymbols?Lr=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Lr=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function lh(t){console&&console.warn&&console.warn(t)}s(lh,"ProcessEmitWarning");var Tl=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function I(){I.init.call(this)}s(I,"EventEmitter");fo.exports=I;fo.exports.once=dh;I.EventEmitter=I;I.prototype._events=void 0;I.prototype._eventsCount=0;I.prototype._maxListeners=void 0;var Al=10;function Pr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Pr,"checkListener");Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return Al},set:function(t){if(typeof t!="number"||t<0||Tl(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Al=t}});I.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};I.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Tl(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function Il(t){return t._maxListeners===void 0?I.defaultMaxListeners:t._maxListeners}s(Il,"_getMaxListeners");I.prototype.getMaxListeners=s(function(){return Il(this)},"getMaxListeners");I.prototype.emit=s(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Nl(c,this,i);else for(var u=c.length,d=Ol(c,u),r=0;r<u;++r)Nl(d[r],this,i);return!0},"emit");function Fl(t,e,i,r){var n,o,a;if(Pr(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=Il(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,lh(l)}return t}s(Fl,"_addListener");I.prototype.addListener=s(function(e,i){return Fl(this,e,i,!1)},"addListener");I.prototype.on=I.prototype.addListener;I.prototype.prependListener=s(function(e,i){return Fl(this,e,i,!0)},"prependListener");function ch(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(ch,"onceWrapper");function Ll(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=ch.bind(r);return n.listener=i,r.wrapFn=n,n}s(Ll,"_onceWrap");I.prototype.once=s(function(e,i){return Pr(i),this.on(e,Ll(this,e,i)),this},"once");I.prototype.prependOnceListener=s(function(e,i){return Pr(i),this.prependListener(e,Ll(this,e,i)),this},"prependOnceListener");I.prototype.removeListener=s(function(e,i){var r,n,o,a,l;if(Pr(i),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||i));else if(typeof r!="function"){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){l=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():uh(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=s(function(e){var i,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(e,i[n]);return this},"removeAllListeners");function Pl(t,e,i){var r=t._events;if(r===void 0)return[];var n=r[e];return n===void 0?[]:typeof n=="function"?i?[n.listener||n]:[n]:i?fh(n):Ol(n,n.length)}s(Pl,"_listeners");I.prototype.listeners=s(function(e){return Pl(this,e,!0)},"listeners");I.prototype.rawListeners=s(function(e){return Pl(this,e,!1)},"rawListeners");I.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Cl.call(t,e)};I.prototype.listenerCount=Cl;function Cl(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Cl,"listenerCount");I.prototype.eventNames=s(function(){return this._eventsCount>0?Lr(this._events):[]},"eventNames");function Ol(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(Ol,"arrayClone");function uh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(uh,"spliceOne");function fh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(fh,"unwrapListeners");function dh(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,o),r(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),Rl(t,e,o,{once:!0}),e!=="error"&&hh(t,n,{once:!0})})}s(dh,"once");function hh(t,e,i){typeof t.on=="function"&&Rl(t,"error",e,i)}s(hh,"addErrorHandlerIfEventEmitter");function Rl(t,e,i,r){if(typeof t.on=="function")r.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){r.once&&t.removeEventListener(e,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(Rl,"eventTargetAgnosticAddListener")});var X=A((i_,ho)=>{"use strict";var ph=_e(),{kResistStopPropagation:yh,SymbolDispose:mh}=C(),bh=globalThis.AbortSignal||ei().AbortSignal,gh=globalThis.AbortController||ei().AbortController,wh=Object.getPrototypeOf(async function(){}).constructor,Bl=globalThis.Blob||ph.Blob,Sh=s(typeof Bl<"u"?function(e){return e instanceof Bl}:function(e){return!1},"isBlob"),Dl=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),_h=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Cr=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=e}};s(Cr,"AggregateError");ho.exports={AggregateError:Cr,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof wh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Sh,deprecate(t,e){return t},addAbortListener:Wi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Dl(e,"signal"),_h(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[yh]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[mh](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:bh.any||s(function(e){if(e.length===1)return e[0];let i=new gh,r=s(()=>i.abort(),"abort");return e.forEach(n=>{Dl(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};ho.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var te=A((n_,Ul)=>{"use strict";var{format:Eh,inspect:Rr,AggregateError:xh}=X(),vh=globalThis.AggregateError||xh,kh=Symbol("kIsNodeError"),Nh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Ah=/^([A-Z][a-z0-9]*)+$/,Th="__node_internal_",Br={};function St(t,e){if(!t)throw new Br.ERR_INTERNAL_ASSERTION(e)}s(St,"assert");function Ml(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ml,"addNumericalSeparator");function Ih(t,e,i){if(typeof e=="function")return St(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let r=(e.match(/%[dfijoOs]/g)||[]).length;return St(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Eh(e,...i)}s(Ih,"getMessage");function Y(t,e,i){i||(i=Error);class r extends i{constructor(...o){super(Ih(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(r,"NodeError"),Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[kh]=!0,Br[t]=r}s(Y,"E");function Wl(t){let e=Th+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(Wl,"hideStackFrames");function Fh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new vh([e,t],e.message);return i.code=e.code,i}return t||e}s(Fh,"aggregateTwoErrors");var Or=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Br.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(Or,"AbortError");Y("ERR_ASSERTION","%s",Error);Y("ERR_INVALID_ARG_TYPE",(t,e,i)=>{St(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";t.endsWith(" argument")?r+=`${t} `:r+=`"${t}" ${t.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let c of e)St(typeof c=="string","All expected entries have to be of type string"),Nh.includes(c)?n.push(c.toLowerCase()):Ah.test(c)?o.push(c):(St(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();r+=`one of type ${n.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();r+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();r+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)r+=`. Received an instance of ${i.constructor.name}`;else{let c=Rr(i,{depth:-1});r+=`. Received ${c}`}}else{let c=Rr(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),r+=`. Received type ${typeof i} (${c})`}return r},TypeError);Y("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=Rr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);Y("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var r;let n=i!=null&&(r=i.constructor)!==null&&r!==void 0&&r.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);Y("ERR_MISSING_ARGS",(...t)=>{St(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(r=>`"${r}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);Y("ERR_OUT_OF_RANGE",(t,e,i)=>{St(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Ml(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=Ml(r)),r+="n"):r=Rr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);Y("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Y("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Y("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Y("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Y("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Y("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Y("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Y("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Y("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Y("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Y("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Ul.exports={AbortError:Or,aggregateTwoErrors:Wl(Fh),hideStackFrames:Wl,codes:Br}});var ri=A((s_,Xl)=>{"use strict";var{ArrayIsArray:yo,ArrayPrototypeIncludes:Vl,ArrayPrototypeJoin:zl,ArrayPrototypeMap:Lh,NumberIsInteger:mo,NumberIsNaN:Ph,NumberMAX_SAFE_INTEGER:Ch,NumberMIN_SAFE_INTEGER:Oh,NumberParseInt:Rh,ObjectPrototypeHasOwnProperty:Bh,RegExpPrototypeExec:Hl,String:Dh,StringPrototypeToUpperCase:Mh,StringPrototypeTrim:Wh}=C(),{hideStackFrames:me,codes:{ERR_SOCKET_BAD_PORT:Uh,ERR_INVALID_ARG_TYPE:J,ERR_INVALID_ARG_VALUE:ii,ERR_OUT_OF_RANGE:_t,ERR_UNKNOWN_SIGNAL:ql}}=te(),{normalizeEncoding:qh}=X(),{isAsyncFunction:jh,isArrayBufferView:$h}=X().types,jl={};function Vh(t){return t===(t|0)}s(Vh,"isInt32");function zh(t){return t===t>>>0}s(zh,"isUint32");var Hh=/^[0-7]+$/,Kh="must be a 32-bit unsigned integer or an octal string";function Gh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(Hl(Hh,t)===null)throw new ii(e,t,Kh);t=Rh(t,8)}return Kl(t,e),t}s(Gh,"parseFileMode");var Yh=me((t,e,i=Oh,r=Ch)=>{if(typeof t!="number")throw new J(e,"number",t);if(!mo(t))throw new _t(e,"an integer",t);if(t<i||t>r)throw new _t(e,`>= ${i} && <= ${r}`,t)}),Xh=me((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new J(e,"number",t);if(!mo(t))throw new _t(e,"an integer",t);if(t<i||t>r)throw new _t(e,`>= ${i} && <= ${r}`,t)}),Kl=me((t,e,i=!1)=>{if(typeof t!="number")throw new J(e,"number",t);if(!mo(t))throw new _t(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new _t(e,`>= ${r} && <= ${n}`,t)});function bo(t,e){if(typeof t!="string")throw new J(e,"string",t)}s(bo,"validateString");function Jh(t,e,i=void 0,r){if(typeof t!="number")throw new J(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Ph(t))throw new _t(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(Jh,"validateNumber");var Qh=me((t,e,i)=>{if(!Vl(i,t)){let n="must be one of: "+zl(Lh(i,o=>typeof o=="string"?`'${o}'`:Dh(o)),", ");throw new ii(e,t,n)}});function Gl(t,e){if(typeof t!="boolean")throw new J(e,"boolean",t)}s(Gl,"validateBoolean");function po(t,e,i){return t==null||!Bh(t,e)?i:t[e]}s(po,"getOwnPropertyValueOrDefault");var Zh=me((t,e,i=null)=>{let r=po(i,"allowArray",!1),n=po(i,"allowFunction",!1);if(!po(i,"nullable",!1)&&t===null||!r&&yo(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new J(e,"Object",t)}),ep=me((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new J(e,"a dictionary",t)}),Dr=me((t,e,i=0)=>{if(!yo(t))throw new J(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ii(e,t,r)}});function tp(t,e){Dr(t,e);for(let i=0;i<t.length;i++)bo(t[i],`${e}[${i}]`)}s(tp,"validateStringArray");function ip(t,e){Dr(t,e);for(let i=0;i<t.length;i++)Gl(t[i],`${e}[${i}]`)}s(ip,"validateBooleanArray");function rp(t,e){Dr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new J(n,"AbortSignal",r);Yl(r,n)}}s(rp,"validateAbortSignalArray");function np(t,e="signal"){if(bo(t,e),jl[t]===void 0)throw jl[Mh(t)]!==void 0?new ql(t+" (signals must use all capital letters)"):new ql(t)}s(np,"validateSignalName");var op=me((t,e="buffer")=>{if(!$h(t))throw new J(e,["Buffer","TypedArray","DataView"],t)});function sp(t,e){let i=qh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ii("encoding",e,`is invalid for data of length ${r}`)}s(sp,"validateEncoding");function ap(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Wh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Uh(e,t,i);return t|0}s(ap,"validatePort");var Yl=me((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new J(e,"AbortSignal",t)}),lp=me((t,e)=>{if(typeof t!="function")throw new J(e,"Function",t)}),cp=me((t,e)=>{if(typeof t!="function"||jh(t))throw new J(e,"Function",t)}),up=me((t,e)=>{if(t!==void 0)throw new J(e,"undefined",t)});function fp(t,e,i){if(!Vl(i,t))throw new J(e,`('${zl(i,"|")}')`,t)}s(fp,"validateUnion");var dp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $l(t,e){if(typeof t>"u"||!Hl(dp,t))throw new ii(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s($l,"validateLinkHeaderFormat");function hp(t){if(typeof t=="string")return $l(t,"hints"),t;if(yo(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];$l(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ii("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(hp,"validateLinkHeaderValue");Xl.exports={isInt32:Vh,isUint32:zh,parseFileMode:Gh,validateArray:Dr,validateStringArray:tp,validateBooleanArray:ip,validateAbortSignalArray:rp,validateBoolean:Gl,validateBuffer:op,validateDictionary:ep,validateEncoding:sp,validateFunction:lp,validateInt32:Xh,validateInteger:Yh,validateNumber:Jh,validateObject:Zh,validateOneOf:Qh,validatePlainFunction:cp,validatePort:ap,validateSignalName:np,validateString:bo,validateUint32:Kl,validateUndefined:up,validateUnion:fp,validateAbortSignal:Yl,validateLinkHeaderValue:hp}});var ct=A((l_,ec)=>{var M=ec.exports={},Re,Be;function go(){throw new Error("setTimeout has not been defined")}s(go,"defaultSetTimout");function wo(){throw new Error("clearTimeout has not been defined")}s(wo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Re=setTimeout:Re=go}catch{Re=go}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=wo}catch{Be=wo}})();function Jl(t){if(Re===setTimeout)return setTimeout(t,0);if((Re===go||!Re)&&setTimeout)return Re=setTimeout,setTimeout(t,0);try{return Re(t,0)}catch{try{return Re.call(null,t,0)}catch{return Re.call(this,t,0)}}}s(Jl,"runTimeout");function pp(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===wo||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}s(pp,"runClearTimeout");var Ge=[],ni=!1,Et,Mr=-1;function yp(){!ni||!Et||(ni=!1,Et.length?Ge=Et.concat(Ge):Mr=-1,Ge.length&&Ql())}s(yp,"cleanUpNextTick");function Ql(){if(!ni){var t=Jl(yp);ni=!0;for(var e=Ge.length;e;){for(Et=Ge,Ge=[];++Mr<e;)Et&&Et[Mr].run();Mr=-1,e=Ge.length}Et=null,ni=!1,pp(t)}}s(Ql,"drainQueue");M.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];Ge.push(new Zl(t,e)),Ge.length===1&&!ni&&Jl(Ql)};function Zl(t,e){this.fun=t,this.array=e}s(Zl,"Item");Zl.prototype.run=function(){this.fun.apply(null,this.array)};M.title="browser";M.browser=!0;M.env={};M.argv=[];M.version="";M.versions={};function Ye(){}s(Ye,"noop");M.on=Ye;M.addListener=Ye;M.once=Ye;M.off=Ye;M.removeListener=Ye;M.removeAllListeners=Ye;M.emit=Ye;M.prependListener=Ye;M.prependOnceListener=Ye;M.listeners=function(t){return[]};M.binding=function(t){throw new Error("process.binding is not supported")};M.cwd=function(){return"/"};M.chdir=function(t){throw new Error("process.chdir is not supported")};M.umask=function(){return 0}});var Me=A((u_,yc)=>{"use strict";var{SymbolAsyncIterator:tc,SymbolIterator:ic,SymbolFor:xt}=C(),rc=xt("nodejs.stream.destroyed"),nc=xt("nodejs.stream.errored"),So=xt("nodejs.stream.readable"),_o=xt("nodejs.stream.writable"),oc=xt("nodejs.stream.disturbed"),mp=xt("nodejs.webstream.isClosedPromise"),bp=xt("nodejs.webstream.controllerErrorFunction");function Wr(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Wr,"isReadableNodeStream");function Ur(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Ur,"isWritableNodeStream");function gp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(gp,"isDuplexNodeStream");function De(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(De,"isNodeStream");function sc(t){return!!(t&&!De(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(sc,"isReadableStream");function ac(t){return!!(t&&!De(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(ac,"isWritableStream");function lc(t){return!!(t&&!De(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(lc,"isTransformStream");function wp(t){return sc(t)||ac(t)||lc(t)}s(wp,"isWebStream");function Sp(t,e){return t==null?!1:e===!0?typeof t[tc]=="function":e===!1?typeof t[ic]=="function":typeof t[tc]=="function"||typeof t[ic]=="function"}s(Sp,"isIterable");function qr(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[rc]||r!=null&&r.destroyed)}s(qr,"isDestroyed");function cc(t){if(!Ur(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(cc,"isWritableEnded");function _p(t,e){if(!Ur(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(_p,"isWritableFinished");function Ep(t){if(!Wr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ep,"isReadableEnded");function uc(t,e){if(!Wr(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(uc,"isReadableFinished");function fc(t){return t&&t[So]!=null?t[So]:typeof t?.readable!="boolean"?null:qr(t)?!1:Wr(t)&&t.readable&&!uc(t)}s(fc,"isReadable");function dc(t){return t&&t[_o]!=null?t[_o]:typeof t?.writable!="boolean"?null:qr(t)?!1:Ur(t)&&t.writable&&!cc(t)}s(dc,"isWritable");function xp(t,e){return De(t)?qr(t)?!0:!(e?.readable!==!1&&fc(t)||e?.writable!==!1&&dc(t)):null}s(xp,"isFinished");function vp(t){var e,i;return De(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(vp,"isWritableErrored");function kp(t){var e,i;return De(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(kp,"isReadableErrored");function Np(t){if(!De(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&hc(t)?t._closed:null}s(Np,"isClosed");function hc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(hc,"isOutgoingMessage");function pc(t){return typeof t._sent100=="boolean"&&hc(t)}s(pc,"isServerResponse");function Ap(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Ap,"isServerRequest");function Tp(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&pc(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(Tp,"willEmitClose");function Ip(t){var e;return!!(t&&((e=t[oc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Ip,"isDisturbed");function Fp(t){var e,i,r,n,o,a,l,c,u,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[nc])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Fp,"isErrored");yc.exports={isDestroyed:qr,kIsDestroyed:rc,isDisturbed:Ip,kIsDisturbed:oc,isErrored:Fp,kIsErrored:nc,isReadable:fc,kIsReadable:So,kIsClosedPromise:mp,kControllerErrorFunction:bp,kIsWritable:_o,isClosed:Np,isDuplexNodeStream:gp,isFinished:xp,isIterable:Sp,isReadableNodeStream:Wr,isReadableStream:sc,isReadableEnded:Ep,isReadableFinished:uc,isReadableErrored:kp,isNodeStream:De,isWebStream:wp,isWritable:dc,isWritableNodeStream:Ur,isWritableStream:ac,isWritableEnded:cc,isWritableFinished:_p,isWritableErrored:vp,isServerRequest:Ap,isServerResponse:pc,willEmitClose:Tp,isTransformStream:lc}});var Xe=A((d_,No)=>{var ut=ct(),{AbortError:vc,codes:Lp}=te(),{ERR_INVALID_ARG_TYPE:Pp,ERR_STREAM_PREMATURE_CLOSE:mc}=Lp,{kEmptyObject:xo,once:vo}=X(),{validateAbortSignal:Cp,validateFunction:Op,validateObject:Rp,validateBoolean:Bp}=ri(),{Promise:Dp,PromisePrototypeThen:Mp,SymbolDispose:kc}=C(),{isClosed:Wp,isReadable:bc,isReadableNodeStream:Eo,isReadableStream:Up,isReadableFinished:gc,isReadableErrored:wc,isWritable:Sc,isWritableNodeStream:_c,isWritableStream:qp,isWritableFinished:Ec,isWritableErrored:xc,isNodeStream:jp,willEmitClose:$p,kIsClosedPromise:Vp}=Me(),oi;function zp(t){return t.setHeader&&typeof t.abort=="function"}s(zp,"isRequest");var ko=s(()=>{},"nop");function Nc(t,e,i){var r,n;if(arguments.length===2?(i=e,e=xo):e==null?e=xo:Rp(e,"options"),Op(i,"callback"),Cp(e.signal,"options.signal"),i=vo(i),Up(t)||qp(t))return Hp(t,e,i);if(!jp(t))throw new Pp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(r=e.readable)!==null&&r!==void 0?r:Eo(t),a=(n=e.writable)!==null&&n!==void 0?n:_c(t),l=t._writableState,c=t._readableState,u=s(()=>{t.writable||m()},"onlegacyfinish"),d=$p(t)&&Eo(t)===o&&_c(t)===a,h=Ec(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||y)&&i.call(t)},"onfinish"),y=gc(t,!1),w=s(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),b=s(U=>{i.call(t,U)},"onerror"),g=Wp(t),S=s(()=>{g=!0;let U=xc(t)||wc(t);if(U&&typeof U!="boolean")return i.call(t,U);if(o&&!y&&Eo(t,!0)&&!gc(t,!1))return i.call(t,new mc);if(a&&!h&&!Ec(t,!1))return i.call(t,new mc);i.call(t)},"onclose"),T=s(()=>{g=!0;let U=xc(t)||wc(t);if(U&&typeof U!="boolean")return i.call(t,U);i.call(t)},"onclosed"),R=s(()=>{t.req.on("finish",m)},"onrequest");zp(t)?(t.on("complete",m),d||t.on("abort",S),t.req?R():t.on("request",R)):a&&!l&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",b),t.on("close",S),g?ut.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||ut.nextTick(T):(!o&&(!d||bc(t))&&(h||Sc(t)===!1)||!a&&(!d||Sc(t))&&(y||bc(t)===!1)||c&&t.req&&t.aborted)&&ut.nextTick(T);let N=s(()=>{i=ko,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",R),t.req&&t.req.removeListener("finish",m),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",b),t.removeListener("close",S)},"cleanup");if(e.signal&&!g){let U=s(()=>{let dt=i;N(),dt.call(t,new vc(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick(U);else{oi=oi||X().addAbortListener;let dt=oi(e.signal,U),ce=i;i=vo((...Ct)=>{dt[kc](),ce.apply(t,Ct)})}}return N}s(Nc,"eos");function Hp(t,e,i){let r=!1,n=ko;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new vc(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{oi=oi||X().addAbortListener;let a=oi(e.signal,n),l=i;i=vo((...c)=>{a[kc](),l.apply(t,c)})}let o=s((...a)=>{r||ut.nextTick(()=>i.apply(t,a))},"resolverFn");return Mp(t[Vp].promise,o,o),ko}s(Hp,"eosWeb");function Kp(t,e){var i;let r=!1;return e===null&&(e=xo),(i=e)!==null&&i!==void 0&&i.cleanup&&(Bp(e.cleanup,"cleanup"),r=e.cleanup),new Dp((n,o)=>{let a=Nc(t,e,l=>{r&&a(),l?o(l):n()})})}s(Kp,"finished");No.exports=Nc;No.exports.finished=Kp});var vt=A((p_,Oc)=>{"use strict";var We=ct(),{aggregateTwoErrors:Gp,codes:{ERR_MULTIPLE_CALLBACK:Yp},AbortError:Xp}=te(),{Symbol:Ic}=C(),{kIsDestroyed:Jp,isDestroyed:Qp,isFinished:Zp,isServerRequest:ey}=Me(),Fc=Ic("kDestroy"),Ao=Ic("kConstruct");function Lc(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Lc,"checkError");function ty(t,e){let i=this._readableState,r=this._writableState,n=r||i;return r!=null&&r.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(Lc(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Ac(this,t,e):this.once(Fc,function(o){Ac(this,Gp(o,t),e)}),this)}s(ty,"destroy");function Ac(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,l=t._writableState;Lc(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?We.nextTick(iy,t,o):We.nextTick(Pc,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Ac,"_destroy");function iy(t,e){To(t,e),Pc(t)}s(iy,"emitErrorCloseNT");function Pc(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Pc,"emitCloseNT");function To(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(To,"emitErrorNT");function ry(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(ry,"undestroy");function Io(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?We.nextTick(To,t,e):To(t,e))}s(Io,"errorOrDestroy");function ny(t,e){if(typeof t._construct!="function")return;let i=t._readableState,r=t._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),t.once(Ao,e),!(t.listenerCount(Ao)>1)&&We.nextTick(oy,t)}s(ny,"construct");function oy(t){let e=!1;function i(r){if(e){Io(t,r??new Yp);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Fc,r):r?Io(t,r,!0):We.nextTick(sy,t)}s(i,"onConstruct");try{t._construct(r=>{We.nextTick(i,r)})}catch(r){We.nextTick(i,r)}}s(oy,"constructNT");function sy(t){t.emit(Ao)}s(sy,"emitConstructNT");function Tc(t){return t?.setHeader&&typeof t.abort=="function"}s(Tc,"isRequest");function Cc(t){t.emit("close")}s(Cc,"emitCloseLegacy");function ay(t,e){t.emit("error",e),We.nextTick(Cc,t)}s(ay,"emitErrorCloseLegacy");function ly(t,e){!t||Qp(t)||(!e&&!Zp(t)&&(e=new Xp),ey(t)?(t.socket=null,t.destroy(e)):Tc(t)?t.abort():Tc(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?We.nextTick(ay,t,e):We.nextTick(Cc,t),t.destroyed||(t[Jp]=!0))}s(ly,"destroyer");Oc.exports={construct:ny,destroyer:ly,destroy:ty,undestroy:ry,errorOrDestroy:Io}});var Vr=A((m_,Bc)=>{"use strict";var{ArrayIsArray:cy,ObjectSetPrototypeOf:Rc}=C(),{EventEmitter:jr}=Wi();function $r(t){jr.call(this,t)}s($r,"Stream");Rc($r.prototype,jr.prototype);Rc($r,jr);$r.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(d){u(),jr.listenerCount(this,"error")===0&&this.emit("error",d)}s(c,"onerror"),Fo(i,"error",c),Fo(t,"error",c);function u(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return s(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function Fo(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):cy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Fo,"prependListener");Bc.exports={Stream:$r,prependListener:Fo}});var Ui=A((g_,zr)=>{"use strict";var{SymbolDispose:uy}=C(),{AbortError:Dc,codes:fy}=te(),{isNodeStream:Mc,isWebStream:dy,kControllerErrorFunction:hy}=Me(),py=Xe(),{ERR_INVALID_ARG_TYPE:Wc}=fy,Lo,yy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Wc(e,"AbortSignal",t)},"validateAbortSignal");zr.exports.addAbortSignal=s(function(e,i){if(yy(e,"signal"),!Mc(i)&&!dy(i))throw new Wc("stream",["ReadableStream","WritableStream","Stream"],i);return zr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");zr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=Mc(e)?()=>{e.destroy(new Dc(void 0,{cause:t.reason}))}:()=>{e[hy](new Dc(void 0,{cause:t.reason}))};if(t.aborted)i();else{Lo=Lo||X().addAbortListener;let r=Lo(t,i);py(e,r[uy])}return e}});var jc=A((__,qc)=>{"use strict";var{StringPrototypeSlice:Uc,SymbolIterator:my,TypedArrayPrototypeSet:Hr,Uint8Array:by}=C(),{Buffer:Po}=_e(),{inspect:gy}=X();qc.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return Po.alloc(0);let i=Po.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Hr(i,r.data,n),n+=r.data.length,r=r.next;return i}consume(e,i){let r=this.head.data;if(e<r.length){let n=r.slice(0,e);return this.head.data=r.slice(e),n}return e===r.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[my](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let o=r.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=Uc(o,0,e),this.head=r,r.data=Uc(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=Po.allocUnsafe(e),r=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Hr(i,a,r-e),e-=a.length;else{e===a.length?(Hr(i,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Hr(i,new by(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return gy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var qi=A((x_,Hc)=>{"use strict";var{MathFloor:wy,NumberIsInteger:Sy}=C(),{validateInteger:_y}=ri(),{ERR_INVALID_ARG_VALUE:Ey}=te().codes,$c=16*1024,Vc=16;function xy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(xy,"highWaterMarkFrom");function zc(t){return t?Vc:$c}s(zc,"getDefaultHighWaterMark");function vy(t,e){_y(e,"value",0),t?Vc=e:$c=e}s(vy,"setDefaultHighWaterMark");function ky(t,e,i,r){let n=xy(e,r,i);if(n!=null){if(!Sy(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new Ey(o,n)}return wy(n)}return zc(t.objectMode)}s(ky,"getHighWaterMark");Hc.exports={getHighWaterMark:ky,getDefaultHighWaterMark:zc,setDefaultHighWaterMark:vy}});var Yc=A((Co,Gc)=>{var Kr=_e(),Ue=Kr.Buffer;function Kc(t,e){for(var i in t)e[i]=t[i]}s(Kc,"copyProps");Ue.from&&Ue.alloc&&Ue.allocUnsafe&&Ue.allocUnsafeSlow?Gc.exports=Kr:(Kc(Kr,Co),Co.Buffer=kt);function kt(t,e,i){return Ue(t,e,i)}s(kt,"SafeBuffer");kt.prototype=Object.create(Ue.prototype);Kc(Ue,kt);kt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ue(t,e,i)};kt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ue(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};kt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ue(t)};kt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Kr.SlowBuffer(t)}});var Qc=A(Jc=>{"use strict";var Ro=Yc().Buffer,Xc=Ro.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ny(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Ny,"_normalizeEncoding");function Ay(t){var e=Ny(t);if(typeof e!="string"&&(Ro.isEncoding===Xc||!Xc(t)))throw new Error("Unknown encoding: "+t);return e||t}s(Ay,"normalizeEncoding");Jc.StringDecoder=ji;function ji(t){this.encoding=Ay(t);var e;switch(this.encoding){case"utf16le":this.text=Cy,this.end=Oy,e=4;break;case"utf8":this.fillLast=Fy,e=4;break;case"base64":this.text=Ry,this.end=By,e=3;break;default:this.write=Dy,this.end=My;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ro.allocUnsafe(e)}s(ji,"StringDecoder");ji.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};ji.prototype.end=Py;ji.prototype.text=Ly;ji.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Oo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Oo,"utf8CheckByte");function Ty(t,e,i){var r=e.length-1;if(r<i)return 0;var n=Oo(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=Oo(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=Oo(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(Ty,"utf8CheckIncomplete");function Iy(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(Iy,"utf8CheckExtraBytes");function Fy(t){var e=this.lastTotal-this.lastNeed,i=Iy(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Fy,"utf8FillLast");function Ly(t,e){var i=Ty(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}s(Ly,"utf8Text");function Py(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Py,"utf8End");function Cy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Cy,"utf16Text");function Oy(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Oy,"utf16End");function Ry(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Ry,"base64Text");function By(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(By,"base64End");function Dy(t){return t.toString(this.encoding)}s(Dy,"simpleWrite");function My(t){return t&&t.length?this.write(t):""}s(My,"simpleEnd")});var Bo=A((T_,iu)=>{"use strict";var Zc=ct(),{PromisePrototypeThen:Wy,SymbolAsyncIterator:eu,SymbolIterator:tu}=C(),{Buffer:Uy}=_e(),{ERR_INVALID_ARG_TYPE:qy,ERR_STREAM_NULL_VALUES:jy}=te().codes;function $y(t,e,i){let r;if(typeof e=="string"||e instanceof Uy)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[eu])n=!0,r=e[eu]();else if(e&&e[tu])n=!1,r=e[tu]();else throw new qy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,d){Wy(l(u),()=>Zc.nextTick(d,u),h=>Zc.nextTick(d,h||u))};async function l(u){let d=u!=null,h=typeof r.throw=="function";if(d&&h){let{value:m,done:y}=await r.throw(u);if(await m,y)return}if(typeof r.return=="function"){let{value:m}=await r.return();await m}}s(l,"close");async function c(){for(;;){try{let{value:u,done:d}=n?await r.next():r.next();if(d)o.push(null);else{let h=u&&typeof u.then=="function"?await u:u;if(h===null)throw a=!1,new jy;if(o.push(h))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s($y,"from");iu.exports=$y});var Vi=A((F_,Su)=>{var ke=ct(),{ArrayPrototypeIndexOf:Vy,NumberIsInteger:zy,NumberIsNaN:Hy,NumberParseInt:Ky,ObjectDefineProperties:Vo,ObjectKeys:Gy,ObjectSetPrototypeOf:ou,Promise:su,SafeSet:Yy,SymbolAsyncDispose:Xy,SymbolAsyncIterator:Jy,Symbol:Qy}=C();Su.exports=E;E.ReadableState=Jr;var{EventEmitter:Zy}=Wi(),{Stream:ft,prependListener:em}=Vr(),{Buffer:Do}=_e(),{addAbortSignal:tm}=Ui(),au=Xe(),k=X().debuglog("stream",t=>{k=t}),im=jc(),li=vt(),{getHighWaterMark:rm,getDefaultHighWaterMark:nm}=qi(),{aggregateTwoErrors:ru,codes:{ERR_INVALID_ARG_TYPE:om,ERR_METHOD_NOT_IMPLEMENTED:sm,ERR_OUT_OF_RANGE:am,ERR_STREAM_PUSH_AFTER_EOF:lm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:cm},AbortError:um}=te(),{validateObject:fm}=ri(),Nt=Qy("kPaused"),{StringDecoder:lu}=Qc(),dm=Bo();ou(E.prototype,ft.prototype);ou(E,ft);var Mo=s(()=>{},"nop"),{errorOrDestroy:si}=li,ai=1<<0,hm=1<<1,cu=1<<2,$i=1<<3,uu=1<<4,Gr=1<<5,Yr=1<<6,fu=1<<7,pm=1<<8,ym=1<<9,mm=1<<10,jo=1<<11,$o=1<<12,bm=1<<13,gm=1<<14,wm=1<<15,du=1<<16,Sm=1<<17,_m=1<<18;function V(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(V,"makeBitMapDescriptor");Vo(Jr.prototype,{objectMode:V(ai),ended:V(hm),endEmitted:V(cu),reading:V($i),constructed:V(uu),sync:V(Gr),needReadable:V(Yr),emittedReadable:V(fu),readableListening:V(pm),resumeScheduled:V(ym),errorEmitted:V(mm),emitClose:V(jo),autoDestroy:V($o),destroyed:V(bm),closed:V(gm),closeEmitted:V(wm),multiAwaitDrain:V(du),readingMore:V(Sm),dataEmitted:V(_m)});function Jr(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.state=jo|$o|uu|Gr,t&&t.objectMode&&(this.state|=ai),i&&t&&t.readableObjectMode&&(this.state|=ai),this.highWaterMark=t?rm(this,t,"readableHighWaterMark",i):nm(!1),this.buffer=new im,this.length=0,this.pipes=[],this.flowing=null,this[Nt]=null,t&&t.emitClose===!1&&(this.state&=~jo),t&&t.autoDestroy===!1&&(this.state&=~$o),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new lu(t.encoding),this.encoding=t.encoding)}s(Jr,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof qe();this._readableState=new Jr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&tm(t.signal,this)),ft.call(this,t),li.construct(this,()=>{this._readableState.needReadable&&Xr(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=li.destroy;E.prototype._undestroy=li.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Zy.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[Xy]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new um,this.destroy(t)),new su((e,i)=>au(this,r=>r&&r!==t?i(r):e(null)))};E.prototype.push=function(t,e){return hu(this,t,e,!1)};E.prototype.unshift=function(t,e){return hu(this,t,e,!0)};function hu(t,e,i,r){k("readableAddChunk",e);let n=t._readableState,o;if(n.state&ai||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=Do.from(e,i).toString(n.encoding):(e=Do.from(e,i),i=""))):e instanceof Do?i="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new om("chunk",["string","Buffer","Uint8Array"],e))),o)si(t,o);else if(e===null)n.state&=~$i,vm(t,n);else if(n.state&ai||e&&e.length>0)if(r)if(n.state&cu)si(t,new cm);else{if(n.destroyed||n.errored)return!1;Wo(t,n,e,!0)}else if(n.ended)si(t,new lm);else{if(n.destroyed||n.errored)return!1;n.state&=~$i,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Wo(t,n,e,!1):Xr(t,n)):Wo(t,n,e,!1)}else r||(n.state&=~$i,Xr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(hu,"readableAddChunk");function Wo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&du?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.state&Yr&&Qr(t)),Xr(t,e)}s(Wo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[Nt]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new lu(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,r="";for(let n of i)r+=e.write(n);return i.clear(),r!==""&&i.push(r),this._readableState.length=r.length,this};var Em=1073741824;function xm(t){if(t>Em)throw new am("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(xm,"computeNewHighWaterMark");function nu(t,e){return t<=0||e.length===0&&e.ended?0:e.state&ai?1:Hy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(nu,"howMuchToRead");E.prototype.read=function(t){k("read",t),t===void 0?t=NaN:zy(t)||(t=Ky(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=xm(t)),t!==0&&(e.state&=~fu),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Uo(this):Qr(this),null;if(t=nu(t,e),t===0&&e.ended)return e.length===0&&Uo(this),null;let r=(e.state&Yr)!==0;if(k("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,k("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,k("reading, ended or constructing",r);else if(r){k("do read"),e.state|=$i|Gr,e.length===0&&(e.state|=Yr);try{this._read(e.highWaterMark)}catch(o){si(this,o)}e.state&=~Gr,e.reading||(t=nu(i,e))}let n;return t>0?n=gu(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Uo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function vm(t,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?Qr(t):(e.needReadable=!1,e.emittedReadable=!0,pu(t))}}s(vm,"onEofChunk");function Qr(t){let e=t._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(pu,t))}s(Qr,"emitReadable");function pu(t){let e=t._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,mu(t)}s(pu,"emitReadable_");function Xr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick(km,t,e))}s(Xr,"maybeReadMore");function km(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(k("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(km,"maybeReadMore_");E.prototype._read=function(t){throw new sm("_read()")};E.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new Yy(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),k("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?l:g;r.endEmitted?ke.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,T){k("onunpipe"),S===i&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){k("onend"),t.end()}s(l,"onend");let c,u=!1;function d(){k("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),c&&t.removeListener("drain",c),t.removeListener("error",y),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",g),i.removeListener("data",m),u=!0,c&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(d,"cleanup");function h(){u||(r.pipes.length===1&&r.pipes[0]===t?(k("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(k("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),c||(c=Nm(i,t),t.on("drain",c))}s(h,"pause"),i.on("data",m);function m(S){k("ondata");let T=t.write(S);k("dest.write",T),T===!1&&h()}s(m,"ondata");function y(S){if(k("onerror",S),g(),t.removeListener("error",y),t.listenerCount("error")===0){let T=t._writableState||t._readableState;T&&!T.errorEmitted?si(t,S):t.emit("error",S)}}s(y,"onerror"),em(t,"error",y);function w(){t.removeListener("finish",b),g()}s(w,"onclose"),t.once("close",w);function b(){k("onfinish"),t.removeListener("close",w),g()}s(b,"onfinish"),t.once("finish",b);function g(){k("unpipe"),i.unpipe(t)}return s(g,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(k("pipe resume"),i.resume()),t};function Nm(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(k("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(k("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Nm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=Vy(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=ft.prototype.on.call(this,t,e),r=this._readableState;return t==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):t==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,k("on readable",r.length,r.reading),r.length?Qr(this):r.reading||ke.nextTick(Am,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=ft.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(yu,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(yu,this),e};function yu(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Nt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(yu,"updateReadableListening");function Am(t){k("readable nexttick read 0"),t.read(0)}s(Am,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(k("resume"),t.flowing=!t.readableListening,Tm(this,t)),t[Nt]=!1,this};function Tm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Im,t,e))}s(Tm,"resume");function Im(t,e){k("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),mu(t),e.flowing&&!e.reading&&t.read(0)}s(Im,"resume_");E.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Nt]=!0,this};function mu(t){let e=t._readableState;for(k("flow",e.flowing);e.flowing&&t.read()!==null;);}s(mu,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",r=>{!this.push(r)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",r=>{si(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Gy(t);for(let r=1;r<i.length;r++){let n=i[r];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};E.prototype[Jy]=function(){return bu(this)};E.prototype.iterator=function(t){return t!==void 0&&fm(t,"options"),bu(this,t)};function bu(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Fm(t,e);return i.stream=t,i}s(bu,"streamToAsyncIterator");async function*Fm(t,e){let i=Mo;function r(a){this===t?(i(),i=Mo):i=a}s(r,"next"),t.on("readable",r);let n,o=au(t,{writable:!1},a=>{n=a?ru(n,a):null,i(),i=Mo});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new su(r)}}}catch(a){throw n=ru(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?li.destroyer(t,null):(t.off("readable",r),o())}}s(Fm,"createAsyncIterator");Vo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Vo(Jr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Nt]!==!1},set(t){this[Nt]=!!t}}});E._fromList=gu;function gu(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(gu,"fromList");function Uo(t){let e=t._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Lm,e,t))}s(Uo,"endReadable");function Lm(t,e){if(k("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ke.nextTick(Pm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Lm,"endReadableNT");function Pm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Pm,"endWritableNT");E.from=function(t,e){return dm(E,t,e)};var qo;function wu(){return qo===void 0&&(qo={}),qo}s(wu,"lazyWebStreams");E.fromWeb=function(t,e){return wu().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return wu().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,r;return new E({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,o){li.destroyer(t,n),o(n)}}).wrap(t)}});var nn=A((P_,Pu)=>{var At=ct(),{ArrayPrototypeSlice:xu,Error:Cm,FunctionPrototypeSymbolHasInstance:vu,ObjectDefineProperty:ku,ObjectDefineProperties:Om,ObjectSetPrototypeOf:Nu,StringPrototypeToLowerCase:Rm,Symbol:Bm,SymbolHasInstance:Dm}=C();Pu.exports=O;O.WritableState=Ki;var{EventEmitter:Mm}=Wi(),zi=Vr().Stream,{Buffer:Zr}=_e(),rn=vt(),{addAbortSignal:Wm}=Ui(),{getHighWaterMark:Um,getDefaultHighWaterMark:qm}=qi(),{ERR_INVALID_ARG_TYPE:jm,ERR_METHOD_NOT_IMPLEMENTED:$m,ERR_MULTIPLE_CALLBACK:Au,ERR_STREAM_CANNOT_PIPE:Vm,ERR_STREAM_DESTROYED:Hi,ERR_STREAM_ALREADY_FINISHED:zm,ERR_STREAM_NULL_VALUES:Hm,ERR_STREAM_WRITE_AFTER_END:Km,ERR_UNKNOWN_ENCODING:Tu}=te().codes,{errorOrDestroy:ci}=rn;Nu(O.prototype,zi.prototype);Nu(O,zi);function Ko(){}s(Ko,"nop");var ui=Bm("kOnFinished");function Ki(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Um(this,t,"writableHighWaterMark",i):qm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(t&&t.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Ym.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,tn(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ui]=[]}s(Ki,"WritableState");function tn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(tn,"resetBuffer");Ki.prototype.getBuffer=s(function(){return xu(this.buffered,this.bufferedIndex)},"getBuffer");ku(Ki.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(t){let e=this instanceof qe();if(!e&&!vu(O,this))return new O(t);this._writableState=new Ki(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Wm(t.signal,this)),zi.call(this,t),rn.construct(this,()=>{let i=this._writableState;i.writing||Yo(this,i),Xo(this,i)})}s(O,"Writable");ku(O,Dm,{__proto__:null,value:function(t){return vu(this,t)?!0:this!==O?!1:t&&t._writableState instanceof Ki}});O.prototype.pipe=function(){ci(this,new Vm)};function Iu(t,e,i,r){let n=t._writableState;if(typeof i=="function")r=i,i=n.defaultEncoding;else{if(!i)i=n.defaultEncoding;else if(i!=="buffer"&&!Zr.isEncoding(i))throw new Tu(i);typeof r!="function"&&(r=Ko)}if(e===null)throw new Hm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Zr.from(e,i),i="buffer");else if(e instanceof Zr)i="buffer";else if(zi._isUint8Array(e))e=zi._uint8ArrayToBuffer(e),i="buffer";else throw new jm("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new Km:n.destroyed&&(o=new Hi("write")),o?(At.nextTick(r,o),ci(t,o,!0),o):(n.pendingcb++,Gm(t,n,e,i,r))}s(Iu,"_write");O.prototype.write=function(t,e,i){return Iu(this,t,e,i)===!0};O.prototype.cork=function(){this._writableState.corked++};O.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Yo(this,t))};O.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Rm(e)),!Zr.isEncoding(e))throw new Tu(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Gm(t,e,i,r,n){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:r,callback:n}),e.allBuffers&&r!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ko&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(Gm,"writeOrBuffer");function _u(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Hi("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(_u,"doWrite");function Eu(t,e,i,r){--e.pendingcb,r(i),Go(e),ci(t,i)}s(Eu,"onwriteError");function Ym(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){ci(t,new Au);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),r?At.nextTick(Eu,t,i,e,n):Eu(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Yo(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},At.nextTick(Xm,i.afterWriteTickInfo)):Fu(t,i,1,n))}s(Ym,"onwrite");function Xm({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Fu(t,e,i,r)}s(Xm,"afterWriteTick");function Fu(t,e,i,r){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,r();e.destroyed&&Go(e),Xo(t,e)}s(Fu,"afterWrite");function Go(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Hi("write"))}let i=t[ui].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Hi("end"))}tn(t)}s(Go,"errorBuffer");function Yo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,o=i.length-r;if(!o)return;let a=r;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Ko:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},c=e.allNoop&&a===0?i:xu(i,a);c.allBuffers=e.allBuffers,_u(t,e,!0,e.length,c,"",l),tn(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let d=n?1:l.length;_u(t,e,!1,d,l,c,u)}while(a<i.length&&!e.writing);a===i.length?tn(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Yo,"clearBuffer");O.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new $m("_write()")};O.prototype._writev=null;O.prototype.end=function(t,e,i){let r=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let n;if(t!=null){let o=Iu(this,t,e);o instanceof Cm&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Xo(this,r,!0),r.ended=!0):r.finished?n=new zm("end"):r.destroyed&&(n=new Hi("end"))),typeof i=="function"&&(n||r.finished?At.nextTick(i,n):r[ui].push(i)),this};function en(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(en,"needFinish");function Jm(t,e){let i=!1;function r(n){if(i){ci(t,n??Au());return}if(i=!0,e.pendingcb--,n){let o=e[ui].splice(0);for(let a=0;a<o.length;a++)o[a](n);ci(t,n,e.sync)}else en(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,At.nextTick(Ho,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(Jm,"callFinal");function Qm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Jm(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(Qm,"prefinish");function Xo(t,e,i){en(e)&&(Qm(t,e),e.pendingcb===0&&(i?(e.pendingcb++,At.nextTick((r,n)=>{en(n)?Ho(r,n):n.pendingcb--},t,e)):en(e)&&(e.pendingcb++,Ho(t,e))))}s(Xo,"finishMaybe");function Ho(t,e){e.pendingcb--,e.finished=!0;let i=e[ui].splice(0);for(let r=0;r<i.length;r++)i[r]();if(t.emit("finish"),e.autoDestroy){let r=t._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&t.destroy()}}s(Ho,"finish");Om(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Zm=rn.destroy;O.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[ui].length)&&At.nextTick(Go,i),Zm.call(this,t,e),this};O.prototype._undestroy=rn.undestroy;O.prototype._destroy=function(t,e){e(t)};O.prototype[Mm.captureRejectionSymbol]=function(t){this.destroy(t)};var zo;function Lu(){return zo===void 0&&(zo={}),zo}s(Lu,"lazyWebStreams");O.fromWeb=function(t,e){return Lu().newStreamWritableFromWritableStream(t,e)};O.toWeb=function(t){return Lu().newWritableStreamFromStreamWritable(t)}});var Ku=A((O_,Hu)=>{var Jo=ct(),eb=_e(),{isReadable:tb,isWritable:ib,isIterable:Cu,isNodeStream:rb,isReadableNodeStream:Ou,isWritableNodeStream:Ru,isDuplexNodeStream:nb,isReadableStream:Bu,isWritableStream:Du}=Me(),Mu=Xe(),{AbortError:Vu,codes:{ERR_INVALID_ARG_TYPE:ob,ERR_INVALID_RETURN_VALUE:Wu}}=te(),{destroyer:di}=vt(),sb=qe(),zu=Vi(),ab=nn(),{createDeferredPromise:Uu}=X(),qu=Bo(),ju=globalThis.Blob||eb.Blob,lb=s(typeof ju<"u"?function(e){return e instanceof ju}:function(e){return!1},"isBlob"),cb=globalThis.AbortController||ei().AbortController,{FunctionPrototypeCall:$u}=C(),Je=class extends sb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Je,"Duplexify");Hu.exports=s(function t(e,i){if(nb(e))return e;if(Ou(e))return fi({readable:e});if(Ru(e))return fi({writable:e});if(rb(e))return fi({writable:!1,readable:!1});if(Bu(e))return fi({readable:zu.fromWeb(e)});if(Du(e))return fi({writable:ab.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=ub(e);if(Cu(n))return qu(Je,n,{objectMode:!0,write:o,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let u,d=$u(c,n,h=>{if(h!=null)throw new Wu("nully","body",h)},h=>{di(u,h)});return u=new Je({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Jo.nextTick(h,null)}catch(m){Jo.nextTick(h,m)}})},destroy:l})}throw new Wu("Iterable, AsyncIterable or AsyncFunction",i,n)}if(lb(e))return t(e.arrayBuffer());if(Cu(e))return qu(Je,e,{objectMode:!0,writable:!1});if(Bu(e?.readable)&&Du(e?.writable))return Je.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Ou(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?Ru(e?.writable)?e?.writable:t(e.writable):void 0;return fi({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return $u(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{di(n,o)}),n=new Je({objectMode:!0,writable:!1,read(){}})}throw new ob(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ub(t){let{promise:e,resolve:i}=Uu(),r=new cb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Jo.nextTick(u),c)return;if(n.aborted)throw new Vu(void 0,{cause:n.reason});({promise:e,resolve:i}=Uu()),yield l}}(),{signal:n}),write(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}s(ub,"fromAsyncGen");function fi(t){let e=t.readable&&typeof t.readable.read!="function"?zu.wrap(t.readable):t.readable,i=t.writable,r=!!tb(e),n=!!ib(i),o,a,l,c,u;function d(h){let m=c;c=null,m?m(h):h&&u.destroy(h)}return s(d,"onfinished"),u=new Je({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(Mu(i,h=>{n=!1,h&&di(e,h),d(h)}),u._write=function(h,m,y){i.write(h,m)?y():o=y},u._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(Mu(e,h=>{r=!1,h&&di(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){l=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,m){!h&&c!==null&&(h=new Vu),l=null,o=null,a=null,c===null?m(h):(c=m,di(i,h),di(e,h))},u}s(fi,"_duplexify")});var qe=A((B_,Xu)=>{"use strict";var{ObjectDefineProperties:fb,ObjectGetOwnPropertyDescriptor:Qe,ObjectKeys:db,ObjectSetPrototypeOf:Gu}=C();Xu.exports=Ne;var es=Vi(),be=nn();Gu(Ne.prototype,es.prototype);Gu(Ne,es);{let t=db(be.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ne.prototype[i]||(Ne.prototype[i]=be.prototype[i])}}function Ne(t){if(!(this instanceof Ne))return new Ne(t);es.call(this,t),be.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ne,"Duplex");fb(Ne.prototype,{writable:{__proto__:null,...Qe(be.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Qe(be.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Qe(be.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Qe(be.prototype,"writableBuffer")},writableLength:{__proto__:null,...Qe(be.prototype,"writableLength")},writableFinished:{__proto__:null,...Qe(be.prototype,"writableFinished")},writableCorked:{__proto__:null,...Qe(be.prototype,"writableCorked")},writableEnded:{__proto__:null,...Qe(be.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Qe(be.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Qo;function Yu(){return Qo===void 0&&(Qo={}),Qo}s(Yu,"lazyWebStreams");Ne.fromWeb=function(t,e){return Yu().newStreamDuplexFromReadableWritablePair(t,e)};Ne.toWeb=function(t){return Yu().newReadableWritablePairFromDuplex(t)};var Zo;Ne.from=function(t){return Zo||(Zo=Ku()),Zo(t,"body")}});var rs=A((M_,Qu)=>{"use strict";var{ObjectSetPrototypeOf:Ju,Symbol:hb}=C();Qu.exports=Ze;var{ERR_METHOD_NOT_IMPLEMENTED:pb}=te().codes,is=qe(),{getHighWaterMark:yb}=qi();Ju(Ze.prototype,is.prototype);Ju(Ze,is);var Gi=hb("kCallback");function Ze(t){if(!(this instanceof Ze))return new Ze(t);let e=t?yb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),is.call(this,t),this._readableState.sync=!1,this[Gi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",mb)}s(Ze,"Transform");function ts(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(ts,"final");function mb(){this._final!==ts&&ts.call(this)}s(mb,"prefinish");Ze.prototype._final=ts;Ze.prototype._transform=function(t,e,i){throw new pb("_transform()")};Ze.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),n.ended||o===r.length||r.length<r.highWaterMark?i():this[Gi]=i})};Ze.prototype._read=function(){if(this[Gi]){let t=this[Gi];this[Gi]=null,t()}}});var os=A((U_,ef)=>{"use strict";var{ObjectSetPrototypeOf:Zu}=C();ef.exports=hi;var ns=rs();Zu(hi.prototype,ns.prototype);Zu(hi,ns);function hi(t){if(!(this instanceof hi))return new hi(t);ns.call(this,t)}s(hi,"PassThrough");hi.prototype._transform=function(t,e,i){i(null,t)}});var ln=A((j_,sf)=>{var Yi=ct(),{ArrayIsArray:bb,Promise:gb,SymbolAsyncIterator:wb,SymbolDispose:Sb}=C(),an=Xe(),{once:_b}=X(),Eb=vt(),tf=qe(),{aggregateTwoErrors:xb,codes:{ERR_INVALID_ARG_TYPE:ps,ERR_INVALID_RETURN_VALUE:ss,ERR_MISSING_ARGS:vb,ERR_STREAM_DESTROYED:kb,ERR_STREAM_PREMATURE_CLOSE:Nb},AbortError:Ab}=te(),{validateFunction:Tb,validateAbortSignal:Ib}=ri(),{isIterable:Tt,isReadable:as,isReadableNodeStream:sn,isNodeStream:rf,isTransformStream:pi,isWebStream:Fb,isReadableStream:ls,isReadableFinished:Lb}=Me(),Pb=globalThis.AbortController||ei().AbortController,cs,us,fs;function nf(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=an(t,{readable:e,writable:i},o=>{r=!o});return{destroy:o=>{r||(r=!0,Eb.destroyer(t,o||new kb("pipe")))},cleanup:n}}s(nf,"destroyer");function Cb(t){return Tb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Cb,"popCallback");function ds(t){if(Tt(t))return t;if(sn(t))return Ob(t);throw new ps("val",["Readable","Iterable","AsyncIterable"],t)}s(ds,"makeAsyncIterable");async function*Ob(t){us||(us=Vi()),yield*us.prototype[wb].call(t)}s(Ob,"fromReadable");async function on(t,e,i,{end:r}){let n,o=null,a=s(u=>{if(u&&(n=u),o){let d=o;o=null,d()}},"resume"),l=s(()=>new gb((u,d)=>{n?d(n):o=s(()=>{n?d(n):u()},"onresolve")}),"wait");e.on("drain",a);let c=an(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();r&&(e.end(),await l()),i()}catch(u){i(n!==u?xb(n,u):u)}finally{c(),e.off("drain",a)}}s(on,"pumpToNode");async function hs(t,e,i,{end:r}){pi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(hs,"pumpToWeb");function Rb(...t){return of(t,_b(Cb(t)))}s(Rb,"pipeline");function of(t,e,i){if(t.length===1&&bb(t[0])&&(t=t[0]),t.length<2)throw new vb("streams");let r=new Pb,n=r.signal,o=i?.signal,a=[];Ib(o,"options.signal");function l(){w(new Ab)}s(l,"abort"),fs=fs||X().addAbortListener;let c;o&&(c=fs(o,l));let u,d,h=[],m=0;function y(R){w(R,--m===0)}s(y,"finish");function w(R,N){var U;if(R&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=R),!(!u&&!N)){for(;h.length;)h.shift()(u);(U=c)===null||U===void 0||U[Sb](),r.abort(),N&&(u||a.forEach(dt=>dt()),Yi.nextTick(e,u,d))}}s(w,"finishImpl");let b;for(let R=0;R<t.length;R++){let N=t[R],U=R<t.length-1,dt=R>0,ce=U||i?.end!==!1,Ct=R===t.length-1;if(rf(N)){let ie=function($e){$e&&$e.name!=="AbortError"&&$e.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y($e)};var T=ie;if(s(ie,"onError"),ce){let{destroy:$e,cleanup:bn}=nf(N,U,dt);h.push($e),as(N)&&Ct&&a.push(bn)}N.on("error",ie),as(N)&&Ct&&a.push(()=>{N.removeListener("error",ie)})}if(R===0)if(typeof N=="function"){if(b=N({signal:n}),!Tt(b))throw new ss("Iterable, AsyncIterable or Stream","source",b)}else Tt(N)||sn(N)||pi(N)?b=N:b=tf.from(N);else if(typeof N=="function"){if(pi(b)){var g;b=ds((g=b)===null||g===void 0?void 0:g.readable)}else b=ds(b);if(b=N(b,{signal:n}),U){if(!Tt(b,!0))throw new ss("AsyncIterable",`transform[${R-1}]`,b)}else{var S;cs||(cs=os());let ie=new cs({objectMode:!0}),$e=(S=b)===null||S===void 0?void 0:S.then;if(typeof $e=="function")m++,$e.call(b,it=>{d=it,it!=null&&ie.write(it),ce&&ie.end(),Yi.nextTick(y)},it=>{ie.destroy(it),Yi.nextTick(y,it)});else if(Tt(b,!0))m++,on(b,ie,y,{end:ce});else if(ls(b)||pi(b)){let it=b.readable||b;m++,on(it,ie,y,{end:ce})}else throw new ss("AsyncIterable or Promise","destination",b);b=ie;let{destroy:bn,cleanup:Of}=nf(b,!1,!0);h.push(bn),Ct&&a.push(Of)}}else if(rf(N)){if(sn(b)){m+=2;let ie=Bb(b,N,y,{end:ce});as(N)&&Ct&&a.push(ie)}else if(pi(b)||ls(b)){let ie=b.readable||b;m++,on(ie,N,y,{end:ce})}else if(Tt(b))m++,on(b,N,y,{end:ce});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=N}else if(Fb(N)){if(sn(b))m++,hs(ds(b),N,y,{end:ce});else if(ls(b)||Tt(b))m++,hs(b,N,y,{end:ce});else if(pi(b))m++,hs(b.readable,N,y,{end:ce});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=N}else b=tf.from(N)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Yi.nextTick(l),b}s(of,"pipelineImpl");function Bb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Nb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Lb(t)?Yi.nextTick(a):t.once("end",a)}else i();return an(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),an(e,{readable:!1,writable:!0},i)}s(Bb,"pipe");sf.exports={pipelineImpl:of,pipeline:Rb}});var ms=A((V_,df)=>{"use strict";var{pipeline:Db}=ln(),cn=qe(),{destroyer:Mb}=vt(),{isNodeStream:un,isReadable:af,isWritable:lf,isWebStream:ys,isTransformStream:It,isWritableStream:cf,isReadableStream:uf}=Me(),{AbortError:Wb,codes:{ERR_INVALID_ARG_VALUE:ff,ERR_MISSING_ARGS:Ub}}=te(),qb=Xe();df.exports=s(function(...e){if(e.length===0)throw new Ub("streams");if(e.length===1)return cn.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=cn.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=cn.from(e[y])}for(let y=0;y<e.length;++y)if(!(!un(e[y])&&!ys(e[y]))){if(y<e.length-1&&!(af(e[y])||uf(e[y])||It(e[y])))throw new ff(`streams[${y}]`,i[y],"must be readable");if(y>0&&!(lf(e[y])||cf(e[y])||It(e[y])))throw new ff(`streams[${y}]`,i[y],"must be writable")}let r,n,o,a,l;function c(y){let w=a;a=null,w?w(y):y?l.destroy(y):!m&&!h&&l.destroy()}s(c,"onfinished");let u=e[0],d=Db(e,c),h=!!(lf(u)||cf(u)||It(u)),m=!!(af(d)||uf(d)||It(d));if(l=new cn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(un(u))l._write=function(w,b,g){u.write(w,b)?g():r=g},l._final=function(w){u.end(),n=w},u.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ys(u)){let b=(It(u)?u.writable:u).getWriter();l._write=async function(g,S,T){try{await b.ready,b.write(g).catch(()=>{}),T()}catch(R){T(R)}},l._final=async function(g){try{await b.ready,b.close().catch(()=>{}),n=g}catch(S){g(S)}}}let y=It(d)?d.readable:d;qb(y,()=>{if(n){let w=n;n=null,w()}})}if(m){if(un(d))d.on("readable",function(){if(o){let y=o;o=null,y()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let y=d.read();if(y===null){o=l._read;return}if(!l.push(y))return}};else if(ys(d)){let w=(It(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:b,done:g}=await w.read();if(!l.push(b))return;if(g){l.push(null);return}}catch{return}}}}return l._destroy=function(y,w){!y&&a!==null&&(y=new Wb),o=null,r=null,n=null,a===null?w(y):(a=w,un(d)&&Mb(d,y))},l},"compose")});var Ef=A((H_,gs)=>{"use strict";var jb=globalThis.AbortController||ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:$b,ERR_INVALID_ARG_TYPE:Xi,ERR_MISSING_ARGS:Vb,ERR_OUT_OF_RANGE:zb},AbortError:je}=te(),{validateAbortSignal:Ft,validateInteger:hf,validateObject:Lt}=ri(),Hb=C().Symbol("kWeak"),Kb=C().Symbol("kResistStopPropagation"),{finished:Gb}=Xe(),Yb=ms(),{addAbortSignalNoValidate:Xb}=Ui(),{isWritable:Jb,isNodeStream:Qb}=Me(),{deprecate:Zb}=X(),{ArrayPrototypePush:eg,Boolean:tg,MathFloor:pf,Number:ig,NumberIsNaN:rg,Promise:yf,PromiseReject:mf,PromiseResolve:ng,PromisePrototypeThen:bf,Symbol:wf}=C(),dn=wf("kEmpty"),gf=wf("kEof");function og(t,e){if(e!=null&&Lt(e,"options"),e?.signal!=null&&Ft(e.signal,"options.signal"),Qb(t)&&!Jb(t))throw new $b("stream",t,"must be writable");let i=Yb(this,t);return e!=null&&e.signal&&Xb(e.signal,i),i}s(og,"compose");function hn(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);e!=null&&Lt(e,"options"),e?.signal!=null&&Ft(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=pf(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=pf(e.highWaterMark)),hf(i,"options.concurrency",1),hf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=X().AbortSignalAny([e?.signal].filter(tg)),a=this,l=[],c={signal:o},u,d,h=!1,m=0;function y(){h=!0,w()}s(y,"onCatch");function w(){m-=1,b()}s(w,"afterItemProcessed");function b(){d&&!h&&m<i&&l.length<r&&(d(),d=null)}s(b,"maybeResume");async function g(){try{for await(let S of a){if(h)return;if(o.aborted)throw new je;try{if(S=t(S,c),S===dn)continue;S=ng(S)}catch(T){S=mf(T)}m+=1,bf(S,w,y),l.push(S),u&&(u(),u=null),!h&&(l.length>=r||m>=i)&&await new yf(T=>{d=T})}l.push(gf)}catch(S){let T=mf(S);bf(T,w,y),l.push(T)}finally{h=!0,u&&(u(),u=null)}}s(g,"pump"),g();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===gf)return;if(o.aborted)throw new je;S!==dn&&(yield S),l.shift(),b()}await new yf(S=>{u=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(hn,"map");function sg(t=void 0){return t!=null&&Lt(t,"options"),t?.signal!=null&&Ft(t.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new je({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(sg,"asIndexedPairs");async function Sf(t,e=void 0){for await(let i of bs.call(this,t,e))return!0;return!1}s(Sf,"some");async function ag(t,e=void 0){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);return!await Sf.call(this,async(...i)=>!await t(...i),e)}s(ag,"every");async function lg(t,e){for await(let i of bs.call(this,t,e))return i}s(lg,"find");async function cg(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),dn}s(i,"forEachFn");for await(let r of hn.call(this,i,e));}s(cg,"forEach");function bs(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:dn}return s(i,"filterFn"),hn.call(this,i,e)}s(bs,"filter");var fn=class extends Vb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(fn,"ReduceAwareErrMissingArgs");async function ug(t,e,i){var r;if(typeof t!="function")throw new Xi("reducer",["Function","AsyncFunction"],t);i!=null&&Lt(i,"options"),i?.signal!=null&&Ft(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let u=new je(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Gb(this.destroy(u)),u}let o=new jb,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[Hb]:this,[Kb]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new je;n?e=await t(e,u,{signal:a}):(e=u,n=!0)}if(!l&&!n)throw new fn}finally{o.abort()}return e}s(ug,"reduce");async function fg(t){t!=null&&Lt(t,"options"),t?.signal!=null&&Ft(t.signal,"options.signal");let e=[];for await(let r of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new je(void 0,{cause:t.signal.reason});eg(e,r)}return e}s(fg,"toArray");function dg(t,e){let i=hn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(dg,"flatMap");function _f(t){if(t=ig(t),rg(t))return 0;if(t<0)throw new zb("number",">= 0",t);return t}s(_f,"toIntegerOrInfinity");function hg(t,e=void 0){return e!=null&&Lt(e,"options"),e?.signal!=null&&Ft(e.signal,"options.signal"),t=_f(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;t--<=0&&(yield o)}},"drop").call(this)}s(hg,"drop");function pg(t,e=void 0){return e!=null&&Lt(e,"options"),e?.signal!=null&&Ft(e.signal,"options.signal"),t=_f(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(pg,"take");gs.exports.streamReturningOperators={asIndexedPairs:Zb(sg,"readable.asIndexedPairs will be removed in a future version."),drop:hg,filter:bs,flatMap:dg,map:hn,take:pg,compose:og};gs.exports.promiseReturningOperators={every:ag,forEach:cg,reduce:ug,toArray:fg,some:Sf,find:lg}});var ws=A((G_,xf)=>{"use strict";var{ArrayPrototypePop:yg,Promise:mg}=C(),{isIterable:bg,isNodeStream:gg,isWebStream:wg}=Me(),{pipelineImpl:Sg}=ln(),{finished:_g}=Xe();Ss();function Eg(...t){return new mg((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!gg(o)&&!bg(o)&&!wg(o)){let a=yg(t);r=a.signal,n=a.end}Sg(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}s(Eg,"pipeline");xf.exports={finished:_g,pipeline:Eg}});var Ss=A((X_,Pf)=>{var{Buffer:xg}=_e(),{ObjectDefineProperty:et,ObjectKeys:Nf,ReflectApply:Af}=C(),{promisify:{custom:Tf}}=X(),{streamReturningOperators:vf,promiseReturningOperators:kf}=Ef(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:If}}=te(),vg=ms(),{setDefaultHighWaterMark:kg,getDefaultHighWaterMark:Ng}=qi(),{pipeline:Ff}=ln(),{destroyer:Ag}=vt(),Lf=Xe(),_s=ws(),Ji=Me(),P=Pf.exports=Vr().Stream;P.isDestroyed=Ji.isDestroyed;P.isDisturbed=Ji.isDisturbed;P.isErrored=Ji.isErrored;P.isReadable=Ji.isReadable;P.isWritable=Ji.isWritable;P.Readable=Vi();for(let t of Nf(vf)){let i=function(...r){if(new.target)throw If();return P.Readable.from(Af(e,this,r))};Ig=i,s(i,"fn");let e=vf[t];et(i,"name",{__proto__:null,value:e.name}),et(i,"length",{__proto__:null,value:e.length}),et(P.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ig;for(let t of Nf(kf)){let i=function(...n){if(new.target)throw If();return Af(e,this,n)};Ig=i,s(i,"fn");let e=kf[t];et(i,"name",{__proto__:null,value:e.name}),et(i,"length",{__proto__:null,value:e.length}),et(P.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ig;P.Writable=nn();P.Duplex=qe();P.Transform=rs();P.PassThrough=os();P.pipeline=Ff;var{addAbortSignal:Tg}=Ui();P.addAbortSignal=Tg;P.finished=Lf;P.destroy=Ag;P.compose=vg;P.setDefaultHighWaterMark=kg;P.getDefaultHighWaterMark=Ng;et(P,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return _s}});et(Ff,Tf,{__proto__:null,enumerable:!0,get(){return _s.pipeline}});et(Lf,Tf,{__proto__:null,enumerable:!0,get(){return _s.finished}});P.Stream=P;P._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");P._uint8ArrayToBuffer=s(function(e){return xg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Cf=A((Q_,W)=>{"use strict";var z=Ss(),Fg=ws(),Lg=z.Readable.destroy;W.exports=z.Readable;W.exports._uint8ArrayToBuffer=z._uint8ArrayToBuffer;W.exports._isUint8Array=z._isUint8Array;W.exports.isDisturbed=z.isDisturbed;W.exports.isErrored=z.isErrored;W.exports.isReadable=z.isReadable;W.exports.Readable=z.Readable;W.exports.Writable=z.Writable;W.exports.Duplex=z.Duplex;W.exports.Transform=z.Transform;W.exports.PassThrough=z.PassThrough;W.exports.addAbortSignal=z.addAbortSignal;W.exports.finished=z.finished;W.exports.destroy=z.destroy;W.exports.destroy=Lg;W.exports.pipeline=z.pipeline;W.exports.compose=z.compose;Object.defineProperty(z,"promises",{configurable:!0,enumerable:!0,get(){return Fg}});W.exports.Stream=z.Stream;W.exports.default=W.exports});var Og={};ir(Og,{ActionType:()=>dr,ApiError:()=>f,Async:()=>vi,AsyncFileIndexFS:()=>mn,AsyncStoreFS:()=>pr,BigIntStats:()=>K,BigIntStatsFs:()=>ur,Dir:()=>Pi,Dirent:()=>Ke,ErrorCode:()=>j,ErrorStrings:()=>wn,File:()=>_i,FileIndex:()=>Pt,FileIndexFS:()=>mi,FileSystem:()=>Z,FileType:()=>D,InMemory:()=>Ni,InMemoryStore:()=>ki,IndexDirInode:()=>tt,IndexFileInode:()=>tr,IndexInode:()=>yi,Inode:()=>ue,LockedFS:()=>$t,Mutex:()=>jt,NoSyncFile:()=>pt,Overlay:()=>xd,OverlayFS:()=>Vt,PreloadFile:()=>Q,ReadStream:()=>Qi,Readonly:()=>An,SimpleSyncTransaction:()=>Ut,Stats:()=>B,StatsCommon:()=>Dt,StatsFs:()=>Mt,Sync:()=>Nn,SyncFileIndexFS:()=>yn,SyncStoreFS:()=>qt,UnlockedOverlayFS:()=>Ai,WriteStream:()=>Zi,_toUnixTimestamp:()=>Wn,access:()=>cl,accessSync:()=>Sa,appendFile:()=>Wa,appendFileSync:()=>na,checkOptions:()=>sr,chmod:()=>nl,chmodSync:()=>ma,chown:()=>il,chownSync:()=>pa,close:()=>qa,closeSync:()=>He,configure:()=>Pg,constants:()=>Bt,copyFile:()=>bl,copyFileSync:()=>xa,cp:()=>_l,cpSync:()=>Aa,createBackend:()=>zf,createReadStream:()=>hl,createWriteStream:()=>pl,decode:()=>or,decodeDirListing:()=>gi,default:()=>Cg,encode:()=>Te,encodeDirListing:()=>se,exists:()=>La,existsSync:()=>wr,fchmod:()=>Ga,fchmodSync:()=>xr,fchown:()=>Ka,fchownSync:()=>Er,fdatasync:()=>Va,fdatasyncSync:()=>aa,flagToMode:()=>rt,flagToNumber:()=>Ed,flagToString:()=>Is,fs:()=>er,fstat:()=>Ua,fstatSync:()=>oa,fsync:()=>$a,fsyncSync:()=>sa,ftruncate:()=>ja,ftruncateSync:()=>jn,futimes:()=>Ya,futimesSync:()=>vr,isAppendable:()=>nt,isBackend:()=>wi,isBackendConfig:()=>_n,isExclusive:()=>Ls,isReadable:()=>Ve,isSynchronous:()=>Si,isTruncating:()=>Fs,isWriteable:()=>de,lchmod:()=>ol,lchmodSync:()=>ba,lchown:()=>rl,lchownSync:()=>ya,levenshtein:()=>Sn,link:()=>Za,linkSync:()=>da,lopenSync:()=>Li,lstat:()=>Ca,lstatSync:()=>ta,lutimes:()=>al,lutimesSync:()=>wa,mkdir:()=>Ja,mkdirSync:()=>fa,mkdirpSync:()=>As,mkdtemp:()=>ml,mkdtempSync:()=>Ea,mount:()=>Ii,mountMapping:()=>Fi,mounts:()=>pe,open:()=>Ba,openAsBlob:()=>xl,openSync:()=>Zt,opendir:()=>Sl,opendirSync:()=>Na,parseFlag:()=>L,pathExistsAction:()=>Ei,pathNotExistsAction:()=>xi,promises:()=>Mi,randomIno:()=>Wt,read:()=>Ha,readFile:()=>Da,readFileSync:()=>qn,readSync:()=>ca,readdir:()=>Qa,readdirSync:()=>kr,readlink:()=>tl,readlinkSync:()=>$n,readv:()=>gl,readvSync:()=>va,realpath:()=>ll,realpathSync:()=>Jt,rename:()=>Fa,renameSync:()=>ea,resolveMountConfig:()=>xs,rm:()=>yl,rmSync:()=>_a,rmdir:()=>Xa,rmdirSync:()=>ua,rootCred:()=>Se,rootIno:()=>fe,setImmediate:()=>Vf,size_max:()=>fr,stat:()=>Pa,statSync:()=>Sr,statfs:()=>El,statfsSync:()=>Ta,symlink:()=>el,symlinkSync:()=>ha,truncate:()=>Oa,truncateSync:()=>ia,umount:()=>gr,unlink:()=>Ra,unlinkSync:()=>Un,unwatchFile:()=>fl,utimes:()=>sl,utimesSync:()=>ga,wait:()=>$f,watch:()=>dl,watchFile:()=>ul,write:()=>za,writeFile:()=>Ma,writeFileSync:()=>_r,writeSync:()=>la,writev:()=>wl,writevSync:()=>ka});var j=(g=>(g[g.EPERM=1]="EPERM",g[g.ENOENT=2]="ENOENT",g[g.EIO=5]="EIO",g[g.EBADF=9]="EBADF",g[g.EACCES=13]="EACCES",g[g.EBUSY=16]="EBUSY",g[g.EEXIST=17]="EEXIST",g[g.ENOTDIR=20]="ENOTDIR",g[g.EISDIR=21]="EISDIR",g[g.EINVAL=22]="EINVAL",g[g.EFBIG=27]="EFBIG",g[g.ENOSPC=28]="ENOSPC",g[g.EROFS=30]="EROFS",g[g.EDEADLK=35]="EDEADLK",g[g.ENOTEMPTY=39]="ENOTEMPTY",g[g.ENOTSUP=95]="ENOTSUP",g))(j||{}),wn={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[35]:"Resource deadlock would occur",[39]:"Directory is not empty.",[95]:"Operation is not supported."},f=class extends Error{constructor(i,r=wn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=j[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new f(i.errno,i.message,i.path,i.syscall);return r.code=i.code,r.stack=i.stack,r}static With(i,r,n){return new f(j[i],wn[j[i]],r,n)}code;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(f,"ApiError");var qf="/";var ks="/";function ht(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(ht,"validateString");function Ns(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",r=0):(i=i.slice(0,c),r=i.length-1-i.lastIndexOf("/")),n=l,o=0;continue}else if(i.length!==0){i="",r=0,n=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,l):i=t.slice(n+1,l),r=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Ns,"normalizeString");function Ae(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:qf;ht(n,`paths[${r}]`),n.length&&(e=`${n}/${e}`,i=n[0]=="/")}return e=Ns(e,!i),i?`/${e}`:e.length>0?e:"/"}s(Ae,"resolve");function jf(t){if(ht(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=Ns(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s(jf,"normalize");function re(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];ht(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":jf(e)}s(re,"join");function x(t){if(ht(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function F(t,e){e!==void 0&&ht(e,"ext"),ht(t,"path");let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){i=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(r=l):(o=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":t.slice(i,r)}s(F,"basename");function rr(t){ht(t,"path");let e=t[0]==="/",i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let r=e?1:0,n=-1,o=0,a=-1,l=!0,c=t.length-1,u=0;for(;c>=r;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?n===-1?n=c:u!==1&&(u=1):n!==-1&&(u=-1)}if(a!==-1){let d=o===0&&e?1:o;n===-1||u===0||u===1&&n===a-1&&n===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,n),i.base=t.slice(d,a),i.ext=t.slice(n,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(rr,"parse");function As(t,e,i,r){r.existsSync(t,i)||(As(x(t),e,i,r),r.mkdirSync(t,e,i))}s(As,"mkdirpSync");function nr(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(nr,"_min");function Sn(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,r=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(n+m),o[m]=++m;let a,l,c,u,d;for(a=0;a+3<r;){let m=e.charCodeAt(n+(l=a)),y=e.charCodeAt(n+(c=a+1)),w=e.charCodeAt(n+(u=a+2)),b=e.charCodeAt(n+(d=a+3)),g=a+=4;for(let S=0;S<i;){let T=o[i+S],R=o[S];l=nr(R,l,c,m,T),c=nr(l,c,u,y,T),u=nr(c,u,d,w,T),g=nr(u,d,g,b,T),o[S++]=g,d=u,u=c,c=l,l=R}}let h=0;for(;a<r;){let m=e.charCodeAt(n+(l=a));h=++a;for(let y=0;y<i;y++){let w=o[y];o[y]=h=w<l||h<l?w>h?h+1:w+1:m===o[i+y]?l:l+1,l=w}}return h}s(Sn,"levenshtein");function $f(t){return new Promise(e=>{setTimeout(e,t)})}s($f,"wait");var Vf=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Te(t){if(typeof t!="string")throw new f(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Te,"encode");function or(t){if(!(t instanceof Uint8Array))throw new f(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(or,"decode");function gi(t){return JSON.parse(or(t),(e,i)=>e==""?i:BigInt(i))}s(gi,"decodeDirListing");function se(t){return Te(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(se,"encodeDirListing");function wi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(wi,"isBackend");async function sr(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:Sn(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new f(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}`);r.validator&&await r.validator(n)}}s(sr,"checkOptions");function zf(t,e){return sr(t,e),t.create(e).ready()}s(zf,"createBackend");function _n(t){return t!=null&&typeof t=="object"&&"backend"in t&&wi(t.backend)}s(_n,"isBackendConfig");var Bt={};ir(Bt,{COPYFILE_EXCL:()=>Kf,COPYFILE_FICLONE:()=>Gf,COPYFILE_FICLONE_FORCE:()=>Yf,F_OK:()=>En,O_APPEND:()=>Pe,O_CREAT:()=>H,O_DIRECT:()=>id,O_DIRECTORY:()=>Jf,O_DSYNC:()=>ed,O_EXCL:()=>Fe,O_NOATIME:()=>Qf,O_NOCTTY:()=>Xf,O_NOFOLLOW:()=>Zf,O_NONBLOCK:()=>rd,O_RDONLY:()=>Ot,O_RDWR:()=>ne,O_SYMLINK:()=>td,O_SYNC:()=>Rt,O_TRUNC:()=>Le,O_WRONLY:()=>Ie,R_OK:()=>ge,S_IFBLK:()=>od,S_IFCHR:()=>sd,S_IFDIR:()=>cr,S_IFIFO:()=>ad,S_IFLNK:()=>ar,S_IFMT:()=>we,S_IFREG:()=>lr,S_IFSOCK:()=>nd,S_IRGRP:()=>pd,S_IROTH:()=>bd,S_IRUSR:()=>fd,S_IRWXG:()=>vn,S_IRWXO:()=>kn,S_IRWXU:()=>xn,S_ISGID:()=>cd,S_ISUID:()=>ld,S_ISVTX:()=>ud,S_IWGRP:()=>yd,S_IWOTH:()=>gd,S_IWUSR:()=>dd,S_IXGRP:()=>md,S_IXOTH:()=>wd,S_IXUSR:()=>hd,UV_FS_O_FILEMAP:()=>Sd,W_OK:()=>ae,X_OK:()=>Hf});var En=0,ge=4,ae=2,Hf=1,Kf=1,Gf=2,Yf=4,Ot=0,Ie=1,ne=2,H=64,Fe=128,Xf=256,Le=512,Pe=1024,Jf=65536,Qf=262144,Zf=131072,Rt=1052672,ed=4096,td=32768,id=16384,rd=2048,we=61440,nd=49152,ar=40960,lr=32768,od=24576,cr=16384,sd=8192,ad=4096,ld=2048,cd=1024,ud=512,xn=448,fd=256,dd=128,hd=64,vn=56,pd=32,yd=16,md=8,kn=7,bd=4,gd=2,wd=1,Sd=0;var D=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(D||{}),Dt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:l,mode:c}={}){let u=Date.now(),d=s((m,y)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:y),"resolveT");this.atimeMs=d(e,u),this.mtimeMs=d(i,u),this.ctimeMs=d(r,u),this.birthtimeMs=d(n,u),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(c)&61440||D.FILE;if(c)this.mode=this._convert(c);else switch(h){case D.FILE:this.mode=this._convert(420);break;case D.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let r=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&r)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};s(Dt,"StatsCommon");var B=class extends Dt{_isBigint=!1;static clone(e){return new B(e)}};s(B,"Stats");var K=class extends Dt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new K(e)}};s(K,"BigIntStats");var Mt=class{type;bsize;blocks;bfree;bavail;files;ffree};s(Mt,"StatsFs");var ur=class{type;bsize;blocks;bfree;bavail;files;ffree};s(ur,"BigIntStatsFs");var fr=2**32-1,fe=0n;function Ts(){return Math.round(Math.random()*2**32).toString(16)}s(Ts,"_random");function Wt(){return BigInt("0x"+Ts()+Ts())}s(Wt,"randomIno");var ue=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Wt(),this.nlink=1,this.size=4096;let r=Date.now();this.atimeMs=r,this.mtimeMs=r,this.ctimeMs=r,this.birthtimeMs=r}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new B(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(ue,"Inode");var dr=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(dr||{}),_d=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return Is(t);if(!_d.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function Is(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(Is,"flagToString");function Ed(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(Ed,"flagToNumber");function rt(t){let e=0;return e<<=1,e+=+Ve(t),e<<=1,e+=+de(t),e<<=1,e}s(rt,"flagToMode");function Ve(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(Ve,"isReadable");function de(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(de,"isWriteable");function Fs(t){return t.indexOf("w")!==-1}s(Fs,"isTruncating");function nt(t){return t.indexOf("a")!==-1}s(nt,"isAppendable");function Si(t){return t.indexOf("s")!==-1}s(Si,"isSynchronous");function Ls(t){return t.indexOf("x")!==-1}s(Ls,"isExclusive");function Ei(t){return Ls(t)?1:Fs(t)?2:0}s(Ei,"pathExistsAction");function xi(t){return(de(t)||nt(t))&&t!=="r+"?3:1}s(xi,"pathNotExistsAction");var _i=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(_i,"File");var Q=class extends _i{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:fr}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(Ve(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return nt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new B(this.stats)}statSync(){return new B(this.stats)}truncate(i){if(this.truncateSync(i),Si(this.flag))return this.sync()}truncateSync(i){if(this._dirty=!0,!de(this.flag))throw new f(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.length,this._buffer.length),Si(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),Si(this.flag)&&this.syncSync()}async write(i,r=0,n=this.stats.size,o=0){return this.writeSync(i,r,n,o)}writeSync(i,r=0,n=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!de(this.flag))throw new f(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:fr}));u.set(this._buffer),this._buffer=u}let l=i.slice(r,r+n);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),Si(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,r=0,n=this.stats.size,o=0){return{bytesRead:this.readSync(i,r,n,o),buffer:i}}readSync(i,r=0,n=this.stats.size,o=0){if(!Ve(this.flag))throw new f(1,"File not opened with a readable mode.");o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||new Uint8Array(i.buffer).set(this._buffer.slice(o,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){this._dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(Q,"PreloadFile");var pt=class extends Q{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(pt,"NoSyncFile");var Se={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Z=class{metadata(){return{name:this.constructor.name,readonly:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(Z,"FileSystem");function Nn(t){class e extends t{async ready(){return this}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,o){return this.renameSync(r,n,o)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,o,a){return this.createFileSync(r,n,o,a)}async openFile(r,n,o){return this.openFileSync(r,n,o)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,o){return this.mkdirSync(r,n,o)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,o){return this.linkSync(r,n,o)}async sync(r,n,o){return this.syncSync(r,n,o)}}return s(e,"_SyncFileSystem"),e}s(Nn,"Sync");function vi(t){class e extends t{_queue=[];_queueRunning=!1;_isInitialized=!1;async ready(){return await this._initialize(),this}renameSync(r,n,o){this._sync.renameSync(r,n,o),this.queue("rename",r,n,o)}statSync(r,n){return this._sync.statSync(r,n)}createFileSync(r,n,o,a){let l=this._sync.createFileSync(r,n,o,a);this.queue("createFile",r,n,o,a);let c=l.statSync(),u=new Uint8Array(c.size);return l.readSync(u),new Q(this,r,n,c,u)}openFileSync(r,n,o){return this._sync.openFileSync(r,n,o)}unlinkSync(r,n){this._sync.unlinkSync(r,n),this.queue("unlink",r,n)}rmdirSync(r,n){this._sync.rmdirSync(r,n),this.queue("rmdir",r,n)}mkdirSync(r,n,o){this._sync.mkdirSync(r,n,o),this.queue("mkdir",r,n,o)}readdirSync(r,n){return this._sync.readdirSync(r,n)}linkSync(r,n,o){this._sync.linkSync(r,n,o),this.queue("link",r,n,o)}syncSync(r,n,o){this._sync.syncSync(r,n,o),this.queue("sync",r,n,o)}existsSync(r,n){return this._sync.existsSync(r,n)}async crossCopy(r){let n=await this.stat(r,Se);if(n.isDirectory()){if(r!=="/"){let a=await this.stat(r,Se);this._sync.mkdirSync(r,a.mode,a.cred())}let o=await this.readdir(r,Se);for(let a of o)await this.crossCopy(re(r,a))}else{let o=await this.openFile(r,L("r"),Se),a=this._sync.createFileSync(r,L("w"),n.mode,Se);try{let{size:l}=await o.stat(),c=new Uint8Array(l);await o.read(c),a.writeSync(c)}finally{await o.close(),a.closeSync()}}}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,r}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let[r,...n]=this._queue.shift();await this[r](...n),await this._next()}queue(...r){this._queue.push(r),!this._queueRunning&&(this._queueRunning=!0,this._next())}}return s(e,"_AsyncFileSystem"),e}s(vi,"Async");function An(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new f(30)}renameSync(r,n,o){throw new f(30)}async createFile(r,n,o,a){throw new f(30)}createFileSync(r,n,o,a){throw new f(30)}async unlink(r,n){throw new f(30)}unlinkSync(r,n){throw new f(30)}async rmdir(r,n){throw new f(30)}rmdirSync(r,n){throw new f(30)}async mkdir(r,n,o){throw new f(30)}mkdirSync(r,n,o){throw new f(30)}async link(r,n,o){throw new f(30)}linkSync(r,n,o){throw new f(30)}async sync(r,n,o){throw new f(30)}syncSync(r,n,o){throw new f(30)}}return s(e,"_ReadonlyFileSystem"),e}s(An,"Readonly");var Ut=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,r){return this.markModified(e),this.store.put(e,i,r)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(Ut,"SimpleSyncTransaction");var qt=class extends Nn(Z){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction(),o=x(e),a=F(e),l=x(i),c=F(i),u=this.findINode(n,o),d=this.getDirListing(n,u,o);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",e,"renameSync");if(!d[a])throw f.With("ENOENT",e,"renameSync");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new f(16,o);let m,y;if(l===o?(m=u,y=d):(m=this.findINode(n,l),y=this.getDirListing(n,m,l)),y[c]){let w=this.getINode(n,y[c],i);if(w.toStats().isFile())try{n.remove(w.ino),n.remove(y[c])}catch(b){throw n.abort(),b}else throw f.With("EPERM",i,"renameSync")}y[c]=h;try{n.put(u.ino,se(d),!0),n.put(m.ino,se(y),!0)}catch(w){throw n.abort(),w}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction(),e).toStats();if(!r.hasAccess(4,i))throw f.With("EACCES",e,"statSync");return r}createFileSync(e,i,r,n){return this.commitNewFile(e,D.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction(),o=this.findINode(n,e),a=n.get(o.ino);if(!o.toStats().hasAccess(rt(i),r))throw f.With("EACCES",e,"openFileSync");if(a===null)throw f.With("ENOENT",e,"openFileSync");return new Q(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdirSync");this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,D.DIRECTORY,i,r,Te("{}"))}readdirSync(e,i){let r=this.store.beginTransaction(),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw f.With("EACCES",e,"readdirSync");return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction(),o=this._findINode(n,x(e),F(e)),a=this.getINode(n,o,e),l=a.update(r);try{n.put(a.ino,i,!0),l&&n.put(o,a.data,!0)}catch(c){throw n.abort(),c}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction(),o=x(e);if(!this.findINode(n,o).toStats().hasAccess(4,r))throw f.With("EACCES",o,"linkSync");let l=x(i),c=this.findINode(n,l),u=this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw f.With("EACCES",l,"linkSync");let d=this._findINode(n,o,F(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"linkSync");h.nlink++,u[F(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(u),!0)}catch(m){throw n.abort(),m}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(fe))return;let i=new ue;i.mode=511|D.DIRECTORY,e.put(i.ino,Te("{}"),!1),e.put(fe,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let o=re(i,r);if(n.has(o))throw new f(5,"Infinite loop detected while finding inode",o);if(n.add(o),i!="/"){let a=this._findINode(e,x(i),F(i),n),l=this.getDirListing(e,this.getINode(e,a,i+ks+r),i);if(!(r in l))throw f.With("ENOENT",Ae(i,r),"_findINode");return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,fe,i),i);if(!(r in a))throw f.With("ENOENT",Ae(i,r),"_findINode");return a[r]}return fe}findINode(e,i){let r=this._findINode(e,x(i),F(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw f.With("ENOENT",r,"getINode");return new ue(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let n=e.get(i.ino);if(!n)throw f.With("ENOENT",r,"getDirListing");return gi(n)}addNewNode(e,i,r=5){for(let n=0;n<r;n++){let o=Wt();if(e.put(o,i,!1))return o}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),c=F(e),u=this.findINode(a,l),d=this.getDirListing(a,u,l);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",e,"commitNewFile");if(e==="/")throw f.With("EEXIST",e,"commitNewFile");if(d[c])throw f.With("EEXIST",e,"commitNewFile");let h=new ue;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=r|i,h.uid=n.uid,h.gid=n.gid,d[c]=this.addNewNode(a,h.data),a.put(u.ino,se(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction(),o=x(e),a=this.findINode(n,o),l=this.getDirListing(n,a,o),c=F(e),u=l[c];if(!u)throw f.With("ENOENT",e,"removeEntry");let d=this.getINode(n,u,e);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw f.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw f.With("ENOTDIR",e,"removeEntry");try{n.put(a.ino,se(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(u))}catch(h){throw n.abort(),h}n.commit()}};s(qt,"SyncStoreFS");var ki=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Ut(this)}get(e){return this.store.get(e)}put(e,i,r){return!r&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s(ki,"InMemoryStore");var Ni={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new qt({store:new ki(t)})}};var hr=class{constructor(e){this.limit=e}cache=[];set(e,i){let r=this.cache.findIndex(n=>n.key===e);r!=-1?this.cache.splice(r,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(r=>r.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(r=>r.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(hr,"LRUCache");var pr=class extends vi(Z){store;_cache;_sync;_ready;async ready(){return await super.ready(),await this._ready,this}metadata(){return{...super.metadata(),name:this.store.name}}constructor(e){super(),this._ready=this._initialize(e)}async _initialize({store:e,lruCacheSize:i,sync:r}){i>0&&(this._cache=new hr(i)),this.store=await e,await this.makeRootDirectory(),this._sync=r||Ni.create({name:"test"})}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,i,r){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let o=this.store.beginTransaction(),a=x(e),l=F(e),c=x(i),u=F(i),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",e,"rename");if(!h[l])throw f.With("ENOENT",e,"rename");let m=h[l];if(delete h[l],(c+"/").indexOf(e+"/")===0)throw new f(16,a);let y,w;if(c===a?(y=d,w=h):(y=await this.findINode(o,c),w=await this.getDirListing(o,y,c)),w[u]){let b=await this.getINode(o,w[u],i);if(b.toStats().isFile())try{await o.remove(b.ino),await o.remove(w[u])}catch(g){throw await o.abort(),g}else throw f.With("EPERM",i,"rename")}w[u]=m;try{await o.put(d.ino,se(h),!0),await o.put(y.ino,se(w),!0)}catch(b){throw await o.abort(),b}await o.commit()}finally{n&&(this._cache=n)}}async stat(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n)throw f.With("ENOENT",e,"stat");let o=n.toStats();if(!o.hasAccess(4,i))throw f.With("EACCES",e,"stat");return o}async createFile(e,i,r,n){let o=this.store.beginTransaction(),a=new Uint8Array(0),l=await this.commitNewFile(o,e,D.FILE,r,n,a);return new Q(this,e,i,l.toStats(),a)}async openFile(e,i,r){let n=this.store.beginTransaction(),o=await this.findINode(n,e),a=await n.get(o.ino);if(!o.toStats().hasAccess(rt(i),r))throw f.With("EACCES",e,"openFile");if(!a)throw f.With("ENOENT",e,"openFile");return new Q(this,e,i,o.toStats(),a)}async unlink(e,i){return this.removeEntry(e,!1,i)}async rmdir(e,i){if((await this.readdir(e,i)).length>0)throw f.With("ENOTEMPTY",e,"rmdir");await this.removeEntry(e,!0,i)}async mkdir(e,i,r){let n=this.store.beginTransaction(),o=Te("{}");await this.commitNewFile(n,e,D.DIRECTORY,i,r,o)}async readdir(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw f.With("EACCES",e,"readdur");return Object.keys(await this.getDirListing(r,n,e))}async sync(e,i,r){let n=this.store.beginTransaction(),o=await this._findINode(n,x(e),F(e)),a=await this.getINode(n,o,e),l=a.update(r);try{await n.put(a.ino,i,!0),l&&await n.put(o,a.data,!0)}catch(c){throw await n.abort(),c}await n.commit()}async link(e,i,r){let n=this.store.beginTransaction(),o=x(e);if(!(await this.findINode(n,o)).toStats().hasAccess(4,r))throw f.With("EACCES",o,"link");let l=x(i),c=await this.findINode(n,l),u=await this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw f.With("EACCES",l,"link");let d=await this._findINode(n,o,F(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"link");h.nlink++,u[F(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(u),!0)}catch(m){throw n.abort(),m}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction();if(await e.get(fe)===void 0){let i=new ue;i.mode=511|D.DIRECTORY,await e.put(i.ino,Te("{}"),!1),await e.put(fe,i.data,!1),await e.commit()}}async _findINode(e,i,r,n=new Set){let o=re(i,r);if(n.has(o))throw new f(5,"Infinite loop detected while finding inode",o);if(n.add(o),this._cache){let a=this._cache.get(o);if(a)return a}if(i==="/"){if(r==="")return this._cache&&this._cache.set(o,fe),fe;{let a=await this.getINode(e,fe,i),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(o,c),c}else throw f.With("ENOENT",Ae(i,r),"_findINode")}}else{let a=await this.findINode(e,i,n),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(o,c),c}else throw f.With("ENOENT",Ae(i,r),"_findINode")}}async findINode(e,i,r=new Set){let n=await this._findINode(e,x(i),F(i),r);return this.getINode(e,n,i)}async getINode(e,i,r){let n=await e.get(i);if(!n)throw f.With("ENOENT",r,"getINode");return new ue(n.buffer)}async getDirListing(e,i,r){if(!i.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let n=await e.get(i.ino);if(!n)throw f.With("ENOENT",r,"getDirListing");return gi(n)}async addNewNode(e,i,r=5){if(r<=0)throw new f(5,"Unable to commit data to key-value store.");let n=Wt();return await e.put(n,i,!1)?n:await this.addNewNode(e,i,--r)}async commitNewFile(e,i,r,n,o,a){let l=x(i),c=F(i),u=await this.findINode(e,l),d=await this.getDirListing(e,u,l);if(!u.toStats().hasAccess(2,o))throw f.With("EACCES",i,"commitNewFile");if(i==="/")throw f.With("EEXIST",i,"commitNewFile");if(d[c])throw await e.abort(),f.With("EEXIST",i,"commitNewFile");try{let h=new ue;return h.ino=await this.addNewNode(e,a),h.mode=n|r,h.uid=o.uid,h.gid=o.gid,h.size=a.length,d[c]=await this.addNewNode(e,h.data),await e.put(u.ino,se(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,i,r){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction(),o=x(e),a=await this.findINode(n,o),l=await this.getDirListing(n,a,o),c=F(e);if(!l[c])throw f.With("ENOENT",e,"removeEntry");let u=l[c],d=await this.getINode(n,u,e);if(!d.toStats().hasAccess(2,r))throw f.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw f.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw f.With("ENOTDIR",e,"removeEntry");try{await n.put(a.ino,se(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(u))}catch(h){throw await n.abort(),h}await n.commit()}};s(pr,"AsyncStoreFS");var jt=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(jt,"Mutex");var $t=class{constructor(e){this.fs=e}_mu=new jt;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){await this._mu.lock(e),await this.fs.rename(e,i,r),this._mu.unlock(e)}renameSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,r)}async stat(e,i){await this._mu.lock(e);let r=await this.fs.stat(e,i);return this._mu.unlock(e),r}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,r){await this._mu.lock(e);let n=await this.fs.openFile(e,i,r);return this._mu.unlock(e),n}openFileSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this._mu.lock(e);let o=await this.fs.createFile(e,i,r,n);return this._mu.unlock(e),o}createFileSync(e,i,r,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this._mu.lock(e),await this.fs.mkdir(e,i,r),this._mu.unlock(e)}mkdirSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this._mu.lock(e);let r=await this.fs.readdir(e,i);return this._mu.unlock(e),r}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let r=await this.fs.exists(e,i);return this._mu.unlock(e),r}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,r){await this._mu.lock(e),await this.fs.link(e,i,r),this._mu.unlock(e)}linkSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this._mu.lock(e),await this.fs.sync(e,i,r),this._mu.unlock(e)}syncSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,r)}};s($t,"LockedFS");var Tn="/.deleted",Ai=class extends Z{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:Vt.name,supportsProperties:this._readable.metadata().supportsProperties&&this._writable.metadata().supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,r){let n=r.cred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.cred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(Tn,L("r"),Se),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=or(r)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,r)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"rename")}}renameSync(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,r)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"renameSync")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"stat");let n=new B(await this._readable.stat(e,i));return n.mode|=146,n}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"statSync");let n=new B(this._readable.statSync(e,i));return n.mode|=146,n}}async openFile(e,i,r){if(await this._writable.exists(e,r))return this._writable.openFile(e,i,r);let n=await this._readable.openFile(e,L("r"),r),o=new B(await n.stat()),{buffer:a}=await n.read(new Uint8Array(o.size));return new Q(this,e,i,o,a)}openFileSync(e,i,r){if(this._writable.existsSync(e,r))return this._writable.openFileSync(e,i,r);let n=this._readable.openFileSync(e,L("r"),r),o=B.clone(n.statSync()),a=new Uint8Array(o.size);return n.readSync(a),new Q(this,e,i,o,a)}async createFile(e,i,r,n){return this.checkInitialized(),await this._writable.createFile(e,i,r,n),this.openFile(e,i,n)}createFileSync(e,i,r,n){return this.checkInitialized(),this._writable.createFileSync(e,i,r,n),this.openFileSync(e,i,n)}async link(e,i,r){this.checkInitialized(),await this._writable.link(e,i,r)}linkSync(e,i,r){this.checkInitialized(),this._writable.linkSync(e,i,r)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw f.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw f.With("ENOENT",e,"unlinkSync");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw f.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw f.With("ENOENT",e,"rmdirSync");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdirSync");this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw f.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw f.With("EEXIST",e,"mkdirSync");this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw f.With("ENOTDIR",e,"readdir");let n=[];try{n.push(...await this._writable.readdir(e,i))}catch{}try{n.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw f.With("ENOTDIR",e,"readdirSync");let n=[];try{n=n.concat(this._writable.readdirSync(e,i))}catch{}try{n=n.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
+
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(Tn,L("w"),i);try{await r.write(Te(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}catch(n){this._deleteLogError=n}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
|
|
4
|
+
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==Tn)throw f.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let r=x(e),n=[];for(;!this._writable.existsSync(r,i);)n.push(r),r=x(r);n=n.reverse();for(let o of n)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let r=x(e),n=[];for(;!await this._writable.exists(r,i);)n.push(r),r=x(r);n=n.reverse();for(let o of n){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw f.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw f.With("ENOENT",e,"operateOnWritableAsync");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let r=this.statSync(e,i);if(r.isDirectory()){this._writable.mkdirSync(e,r.mode,i);return}let n=new Uint8Array(r.size),o=this._readable.openFileSync(e,L("r"),i);o.readSync(n),o.closeSync();let a=this._writable.openFileSync(e,L("w"),i);a.writeSync(n),a.closeSync()}async copyToWritable(e,i){let r=await this.stat(e,i);if(r.isDirectory()){await this._writable.mkdir(e,r.mode,i);return}let n=new Uint8Array(r.size),o=await this._readable.openFile(e,L("r"),i);await o.read(n),await o.close();let a=await this._writable.openFile(e,L("w"),i);await a.write(n),await a.close()}};s(Ai,"UnlockedOverlayFS");var Vt=class extends $t{async ready(){return await super.ready(),this}constructor(e){super(new Ai(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(Vt,"OverlayFS");var xd={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new Vt(t)}};var er={};ir(er,{BigIntStats:()=>K,Dir:()=>Pi,Dirent:()=>Ke,ReadStream:()=>Qi,Stats:()=>B,StatsFs:()=>Mt,WriteStream:()=>Zi,_toUnixTimestamp:()=>Wn,access:()=>cl,accessSync:()=>Sa,appendFile:()=>Wa,appendFileSync:()=>na,chmod:()=>nl,chmodSync:()=>ma,chown:()=>il,chownSync:()=>pa,close:()=>qa,closeSync:()=>He,constants:()=>Bt,copyFile:()=>bl,copyFileSync:()=>xa,cp:()=>_l,cpSync:()=>Aa,createReadStream:()=>hl,createWriteStream:()=>pl,exists:()=>La,existsSync:()=>wr,fchmod:()=>Ga,fchmodSync:()=>xr,fchown:()=>Ka,fchownSync:()=>Er,fdatasync:()=>Va,fdatasyncSync:()=>aa,fstat:()=>Ua,fstatSync:()=>oa,fsync:()=>$a,fsyncSync:()=>sa,ftruncate:()=>ja,ftruncateSync:()=>jn,futimes:()=>Ya,futimesSync:()=>vr,lchmod:()=>ol,lchmodSync:()=>ba,lchown:()=>rl,lchownSync:()=>ya,link:()=>Za,linkSync:()=>da,lopenSync:()=>Li,lstat:()=>Ca,lstatSync:()=>ta,lutimes:()=>al,lutimesSync:()=>wa,mkdir:()=>Ja,mkdirSync:()=>fa,mkdtemp:()=>ml,mkdtempSync:()=>Ea,mount:()=>Ii,mountMapping:()=>Fi,mounts:()=>pe,open:()=>Ba,openAsBlob:()=>xl,openSync:()=>Zt,opendir:()=>Sl,opendirSync:()=>Na,promises:()=>Mi,read:()=>Ha,readFile:()=>Da,readFileSync:()=>qn,readSync:()=>ca,readdir:()=>Qa,readdirSync:()=>kr,readlink:()=>tl,readlinkSync:()=>$n,readv:()=>gl,readvSync:()=>va,realpath:()=>ll,realpathSync:()=>Jt,rename:()=>Fa,renameSync:()=>ea,rm:()=>yl,rmSync:()=>_a,rmdir:()=>Xa,rmdirSync:()=>ua,stat:()=>Pa,statSync:()=>Sr,statfs:()=>El,statfsSync:()=>Ta,symlink:()=>el,symlinkSync:()=>ha,truncate:()=>Oa,truncateSync:()=>ia,umount:()=>gr,unlink:()=>Ra,unlinkSync:()=>Un,unwatchFile:()=>fl,utimes:()=>sl,utimesSync:()=>ga,watch:()=>dl,watchFile:()=>ul,write:()=>za,writeFile:()=>Ma,writeFileSync:()=>_r,writeSync:()=>la,writev:()=>wl,writevSync:()=>ka});var Mi={};ir(Mi,{FileHandle:()=>ee,access:()=>no,appendFile:()=>Kn,chmod:()=>eo,chown:()=>Qn,constants:()=>Bt,copyFile:()=>ao,cp:()=>co,exists:()=>Oi,lchmod:()=>to,lchown:()=>Zn,link:()=>Xn,lopen:()=>Ar,lstat:()=>zn,lutimes:()=>ro,mkdir:()=>Yn,mkdtemp:()=>so,open:()=>lt,opendir:()=>lo,readFile:()=>Tr,readdir:()=>Ci,readlink:()=>Ir,realpath:()=>wt,rename:()=>Vn,rm:()=>oo,rmdir:()=>Gn,stat:()=>Ri,statfs:()=>uo,symlink:()=>Jn,truncate:()=>Hn,unlink:()=>Nr,utimes:()=>io,watch:()=>sh,writeFile:()=>Di});var at=gn(_e(),1);var gt=gn(_e(),1);function Wn(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Wn,"_toUnixTimestamp");function Ee(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}s(Ee,"normalizeMode");function Yt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new f(22,"Invalid time.")}s(Yt,"normalizeTime");function $(t){if(t.includes("\0"))throw new f(22,"Path must be a string without null bytes.");if(t.length==0)throw new f(22,"Path must not be empty.");return Ae(t.replaceAll(/[/\\]+/g,"/"))}s($,"normalizePath");function xe(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:Ee("mode"in t?t?.mode:null,r)}}s(xe,"normalizeOptions");function _(){}s(_,"nop");var v=Se;function Zs(t){v=t}s(Zs,"setCred");var bt=new Map,ih=100;function Xt(t){let e=ih++;return bt.set(e,t),e}s(Xt,"getFdForFile");function q(t){if(!bt.has(t))throw new f(9);return bt.get(t)}s(q,"fd2file");var pe=new Map;Ii("/",Ni.create({name:"root"}));function Ii(t,e){if(t[0]!=="/"&&(t="/"+t),t=Ae(t),pe.has(t))throw new f(22,"Mount point "+t+" is already in use.");pe.set(t,e)}s(Ii,"mount");function gr(t){if(t[0]!=="/"&&(t=`/${t}`),t=Ae(t),!pe.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");pe.delete(t)}s(gr,"umount");function ye(t){t=$(t);let e=[...pe].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new f(5,"ZenFS not initialized with a file system")}s(ye,"resolveMount");function Qs(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(Qs,"fixPaths");function st(t,e){return typeof t.stack=="string"&&(t.stack=Qs(t.stack,e)),t.message=Qs(t.message,e),t}s(st,"fixError");function Fi(t){"/"in t&&gr("/");for(let[e,i]of Object.entries(t))Ii(e,i)}s(Fi,"mountMapping");function le(...[t,e,i,...r]){i=$(i);let{fs:n,path:o}=ye(e&&wr(i)?Jt(i):i);try{return n[t](o,...r)}catch(a){throw st(a,{[o]:i})}}s(le,"doOp");function ea(t,e){t=$(t),e=$(e);let i=ye(t),r=ye(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,v);_r(e,qn(t)),Un(t)}catch(o){throw st(o,n)}}s(ea,"renameSync");function wr(t){t=$(t);try{let{fs:e,path:i}=ye(Jt(t));return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(wr,"existsSync");function Sr(t,e){let i=le("statSync",!0,t,v);return e?.bigint?new K(i):i}s(Sr,"statSync");function ta(t,e){let i=le("statSync",!1,t,v);return e?.bigint?new K(i):i}s(ta,"lstatSync");function ia(t,e=0){let i=Zt(t,"r+");try{jn(i,e)}finally{He(i)}}s(ia,"truncateSync");function Un(t){return le("unlinkSync",!1,t,v)}s(Un,"unlinkSync");function Qt(t,e,i,r){let n=$(t),o=Ee(i,420),a=L(e),l;try{l=le("statSync",r,n,v)}catch{switch(xi(a)){case 3:if(!le("statSync",r,x(n),v).isDirectory())throw f.With("ENOTDIR",x(n),"_openSync");return le("createFileSync",r,n,a,o,v);case 1:throw f.With("ENOENT",n,"_openSync");default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,v))throw f.With("EACCES",n,"_openSync");switch(Ei(a)){case 1:throw f.With("EEXIST",n,"_openSync");case 2:return le("unlinkSync",r,n,v),le("createFileSync",r,n,a,l.mode,v);case 0:return le("openFileSync",r,n,a,v);default:throw new f(22,"Invalid FileFlag object.")}}s(Qt,"_openSync");function Zt(t,e,i){return Xt(Qt(t,e,i,!0))}s(Zt,"openSync");function Li(t,e,i){return Xt(Qt(t,e,i,!1))}s(Li,"lopenSync");function ra(t,e,i){let r=Qt(t,e,420,i);try{let n=r.statSync(),o=new Uint8Array(n.size);return r.readSync(o,0,n.size,0),r.closeSync(),o}finally{r.closeSync()}}s(ra,"_readFileSync");function qn(t,e={}){let i=xe(e,null,"r",420),r=L(i.flag);if(!Ve(r))throw new f(22,"Flag passed to readFile must allow for reading.");let n=gt.Buffer.from(ra(t,i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(qn,"readFileSync");function rh(t,e,i,r,n){let o=Qt(t,i,r,n);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(rh,"_writeFileSync");function _r(t,e,i){let r=xe(i,"utf8","w",420),n=L(r.flag);if(!de(n))throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?gt.Buffer.from(e,r.encoding):e;if(o===void 0)throw new f(22,"Data not specified");rh(t,o,r.flag,r.mode,!0)}s(_r,"writeFileSync");function nh(t,e,i,r,n){let o=Qt(t,i,r,n);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(nh,"_appendFileSync");function na(t,e,i){let r=xe(i,"utf8","a",420),n=L(r.flag);if(!nt(n))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?gt.Buffer.from(e,r.encoding):e;nh(t,o,r.flag,r.mode,!0)}s(na,"appendFileSync");function oa(t,e){let i=q(t).statSync();return e?.bigint?new K(i):i}s(oa,"fstatSync");function He(t){q(t).closeSync(),bt.delete(t)}s(He,"closeSync");function jn(t,e=0){if(e<0)throw new f(22);q(t).truncateSync(e)}s(jn,"ftruncateSync");function sa(t){q(t).syncSync()}s(sa,"fsyncSync");function aa(t){q(t).datasyncSync()}s(aa,"fdatasyncSync");function la(t,e,i,r,n){let o,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=gt.Buffer.from(e,d),l=o.length}else o=e,a=i,l=r,c=typeof n=="number"?n:null;let u=q(t);return c==null&&(c=u.position),u.writeSync(o,a,l,c)}s(la,"writeSync");function ca(t,e,i,r,n){let o=q(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=o.position),o.readSync(e,a,r,n)}s(ca,"readSync");function Er(t,e,i){q(t).chownSync(e,i)}s(Er,"fchownSync");function xr(t,e){let i=Ee(e,-1);if(i<0)throw new f(22,"Invalid mode.");q(t).chmodSync(i)}s(xr,"fchmodSync");function vr(t,e,i){q(t).utimesSync(Yt(e),Yt(i))}s(vr,"futimesSync");function ua(t){return le("rmdirSync",!0,t,v)}s(ua,"rmdirSync");function fa(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;le("mkdirSync",!0,t,Ee(i,511),v)}s(fa,"mkdirSync");function kr(t,e){t=$(t);let i=le("readdirSync",!0,t,v);for(let r of pe.keys()){if(!r.startsWith(t))continue;let n=r.slice(t.length);n.includes("/")||n.length==0||i.push(n)}return i.map(r=>typeof e=="object"&&e?.withFileTypes?new Ke(r,Sr(re(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?gt.Buffer.from(r):r)}s(kr,"readdirSync");function da(t,e){return e=$(e),le("linkSync",!1,t,e,v)}s(da,"linkSync");function ha(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(wr(e))throw f.With("EEXIST",e,"symlinkSync");_r(e,t),Qt(e,"r+",420,!1)._setTypeSync(D.SYMLINK)}s(ha,"symlinkSync");function $n(t,e){let i=gt.Buffer.from(ra(t,"r",!1)),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:i.toString(r)}s($n,"readlinkSync");function pa(t,e,i){let r=Zt(t,"r+");Er(r,e,i),He(r)}s(pa,"chownSync");function ya(t,e,i){let r=Li(t,"r+");Er(r,e,i),He(r)}s(ya,"lchownSync");function ma(t,e){let i=Zt(t,"r+");xr(i,e),He(i)}s(ma,"chmodSync");function ba(t,e){let i=Li(t,"r+");xr(i,e),He(i)}s(ba,"lchmodSync");function ga(t,e,i){let r=Zt(t,"r+");vr(r,e,i),He(r)}s(ga,"utimesSync");function wa(t,e,i){let r=Li(t,"r+");vr(r,e,i),He(r)}s(wa,"lutimesSync");function Jt(t,e){t=$(t);let{base:i,dir:r}=rr(t),n=re(r=="/"?"/":Jt(r),i),{fs:o,path:a,mountPoint:l}=ye(n);try{return o.statSync(a,v).isSymbolicLink()?Jt(l+$n(n)):n}catch(c){throw st(c,{[a]:n})}}s(Jt,"realpathSync");function Sa(t,e=384){if(!Sr(t).hasAccess(e,v))throw new f(13)}s(Sa,"accessSync");function _a(t){throw f.With("ENOTSUP",t,"rmSync")}s(_a,"rmSync");function Ea(t,e){throw f.With("ENOTSUP",t,"mkdtempSync")}s(Ea,"mkdtempSync");function xa(t,e,i){throw f.With("ENOTSUP",t,"copyFileSync")}s(xa,"copyFileSync");function va(t,e,i){throw f.With("ENOTSUP",q(t).path,"readvSync")}s(va,"readvSync");function ka(t,e,i){throw f.With("ENOTSUP",q(t).path,"writevSync")}s(ka,"writevSync");function Na(t,e){throw f.With("ENOTSUP",t,"opendirSync")}s(Na,"opendirSync");function Aa(t,e,i){throw f.With("ENOTSUP",t,"cpSync")}s(Aa,"cpSync");function Ta(t,e){throw f.With("ENOTSUP",t,"statfsSync")}s(Ta,"statfsSync");var Ke=class{constructor(e,i){this.path=e;this.stats=i}get name(){return F(this.path)}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(Ke,"Dirent");var Pi=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Ci(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=kr(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(Pi,"Dir");var ee=class{constructor(e){this.fd=e}get file(){return q(this.fd)}get path(){return this.file.path}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=Ee(e,-1);if(i<0)throw new f(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Yt(e),Yt(i))}async appendFile(e,i){let r=xe(i,"utf8","a",420),n=L(r.flag);if(!nt(n))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?at.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(e,i,r,n)}async readFile(e){let i=xe(e,null,"r",292),r=L(i.flag);if(!Ve(r))throw new f(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),o=new Uint8Array(n);await this.file.read(o,0,n,0);let a=at.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e){throw f.With("ENOTSUP",this.path,"FileHandle.readableWebStream")}readLines(e){throw f.With("ENOTSUP",this.path,"FileHandle.readLines")}[Symbol.asyncDispose](){throw f.With("ENOTSUP",this.path,"FileHandle.@@asyncDispose")}async stat(e){let i=await this.file.stat();return e?.bigint?new K(i):i}async write(e,i,r,n){let o,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let u=typeof r=="string"?r:"utf8";a=0,o=at.Buffer.from(e,u),l=o.length}else o=e,a=i,l=r,n=typeof n=="number"?n:null;n??=this.file.position;let c=await this.file.write(o,a,l,n);return{buffer:o,bytesWritten:c}}async writeFile(e,i){let r=xe(i,"utf8","w",420),n=L(r.flag);if(!de(n))throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?at.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),bt.delete(this.fd)}writev(e,i){throw f.With("ENOTSUP",this.path,"FileHandle.writev")}readv(e,i){throw f.With("ENOTSUP",this.path,"FileHandle.readv")}createReadStream(e){throw f.With("ENOTSUP",this.path,"createReadStream")}createWriteStream(e){throw f.With("ENOTSUP",this.path,"createWriteStream")}};s(ee,"FileHandle");async function ve(...[t,e,i,...r]){i=$(i);let n=e&&await Oi(i)?await wt(i):i,{fs:o,path:a}=ye(n);try{return o[t](a,...r)}catch(l){throw st(l,{[a]:i})}}s(ve,"doOp");async function Vn(t,e){t=$(t),e=$(e);let i=ye(t),r=ye(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,v);return}await Di(e,await Tr(t)),await Nr(t)}catch(n){throw st(n,{[i.path]:t,[r.path]:e})}}s(Vn,"rename");async function Oi(t){try{let{fs:e,path:i}=ye(await wt(t));return await e.exists(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Oi,"exists");async function Ri(t,e){let i=await ve("stat",!0,t,v);return e?.bigint?new K(i):i}s(Ri,"stat");async function zn(t,e){let i=await ve("stat",!1,t,v);return e?.bigint?new K(i):i}s(zn,"lstat");async function Hn(t,e=0){let i=await lt(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Hn,"truncate");async function Nr(t){return ve("unlink",!1,t,v)}s(Nr,"unlink");async function Bi(t,e,i=420,r){let n=$(t),o=Ee(i,420),a=L(e);try{switch(Ei(a)){case 1:throw f.With("EEXIST",n,"_open");case 2:let l=await ve("openFile",r,n,a,v);if(!l)throw new f(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await ve("openFile",r,n,a,v);default:throw new f(22,"Invalid file flag")}}catch{switch(xi(a)){case 3:let c=await ve("stat",r,x(n),v);if(c&&!c.isDirectory())throw f.With("ENOTDIR",x(n),"_open");return await ve("createFile",r,n,a,o,v);case 1:throw f.With("ENOENT",n,"_open");default:throw new f(22,"Invalid file flag")}}}s(Bi,"_open");async function lt(t,e,i=420){let r=await Bi(t,e,i,!0);return new ee(Xt(r))}s(lt,"open");async function Ar(t,e,i=420){let r=await Bi(t,e,i,!1);return new ee(Xt(r))}s(Ar,"lopen");async function Ia(t,e,i){let r=await Bi($(t),e,420,i);try{let n=await r.stat(),o=new Uint8Array(n.size);return await r.read(o,0,n.size,0),await r.close(),o}catch(n){throw await r.close(),n}}s(Ia,"_readFile");async function Tr(t,e){let i=xe(e,null,"r",0),r=L(i.flag);if(!Ve(r))throw new f(22,"Flag passed must allow for reading.");let n=at.Buffer.from(await Ia(t,i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Tr,"readFile");async function Di(t,e,i){let r=xe(i,"utf8","w",420),n=await lt(t,r.flag,r.mode);try{await n.writeFile(e,r)}finally{await n.close()}}s(Di,"writeFile");async function oh(t,e,i,r,n){let o=await Bi(t,i,r,n);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(oh,"_appendFile");async function Kn(t,e,i){let r=xe(i,"utf8","a",420),n=L(r.flag);if(!nt(n))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?at.Buffer.from(e,r.encoding):e;await oh(t,o,r.flag,r.mode,!0)}s(Kn,"appendFile");async function Gn(t){return ve("rmdir",!0,t,v)}s(Gn,"rmdir");async function Yn(t,e){await ve("mkdir",!0,t,Ee(typeof e=="object"?e?.mode:e,511),v)}s(Yn,"mkdir");async function Ci(t,e){t=$(t);let i=await ve("readdir",!0,t,v),r=[...pe.keys()];for(let o of r)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let n=[];for(let o of i)n.push(typeof e=="object"&&e?.withFileTypes?new Ke(o,await Ri(re(t,o))):o);return n}s(Ci,"readdir");async function Xn(t,e){return e=$(e),ve("link",!1,t,e,v)}s(Xn,"link");async function Jn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Oi(e))throw f.With("EEXIST",e,"symlink");await Di(e,t),await(await Bi(e,"r+",420,!1))._setType(D.SYMLINK)}s(Jn,"symlink");async function Ir(t,e){let i=at.Buffer.from(await Ia(t,"r",!1)),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:i.toString(r)}s(Ir,"readlink");async function Qn(t,e,i){let r=await lt(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(Qn,"chown");async function Zn(t,e,i){let r=await Ar(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(Zn,"lchown");async function eo(t,e){let i=await lt(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(eo,"chmod");async function to(t,e){let i=await Ar(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(to,"lchmod");async function io(t,e,i){let r=await lt(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(io,"utimes");async function ro(t,e,i){let r=await Ar(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(ro,"lutimes");async function wt(t,e){t=$(t);let{base:i,dir:r}=rr(t),n=re(r=="/"?"/":await wt(r),i),{fs:o,path:a,mountPoint:l}=ye(n);try{return(await o.stat(a,v)).isSymbolicLink()?wt(l+await Ir(n)):n}catch(c){throw st(c,{[a]:n})}}s(wt,"realpath");function sh(t,e){throw f.With("ENOTSUP",t,"watch")}s(sh,"watch");async function no(t,e=0){if(!(await Ri(t)).hasAccess(e,v))throw new f(13)}s(no,"access");async function oo(t,e){throw f.With("ENOTSUP",t,"rm")}s(oo,"rm");async function so(t,e){throw f.With("ENOTSUP",t,"mkdtemp")}s(so,"mkdtemp");async function ao(t,e,i){throw f.With("ENOTSUP",t,"copyFile")}s(ao,"copyFile");async function lo(t,e){throw f.With("ENOTSUP",t,"opendir")}s(lo,"opendir");async function co(t,e,i){throw f.With("ENOTSUP",t,"cp")}s(co,"cp");async function uo(t,e){throw f.With("ENOTSUP",t,"statfs")}s(uo,"statfs");function Fa(t,e,i=_){Vn(t,e).then(()=>i()).catch(i)}s(Fa,"rename");function La(t,e=_){Oi(t).then(e).catch(()=>e(!1))}s(La,"exists");function Pa(t,e,i=_){i=typeof e=="function"?e:i,Ri(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(Pa,"stat");function Ca(t,e,i=_){i=typeof e=="function"?e:i,zn(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(Ca,"lstat");function Oa(t,e=0,i=_){i=typeof e=="function"?e:i,Hn(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(Oa,"truncate");function Ra(t,e=_){Nr(t).then(()=>e()).catch(e)}s(Ra,"unlink");function Ba(t,e,i,r=_){let n=Ee(i,420);r=typeof i=="function"?i:r,lt(t,e,n).then(o=>r(null,o.fd)).catch(r)}s(Ba,"open");function Da(t,e,i=_){i=typeof e=="function"?e:i,Tr(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(Da,"readFile");function Ma(t,e,i,r=_){r=typeof i=="function"?i:r,Di(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}s(Ma,"writeFile");function Wa(t,e,i,r=_){r=typeof i=="function"?i:r,Kn(t,e,typeof i=="function"?null:i).then(()=>r()).catch(r)}s(Wa,"appendFile");function Ua(t,e,i=_){i=typeof e=="function"?e:i,q(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?new K(r):r)).catch(i)}s(Ua,"fstat");function qa(t,e=_){new ee(t).close().then(()=>e()).catch(e)}s(qa,"close");function ja(t,e,i=_){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=q(t);if(r<0)throw new f(22);n.truncate(r).then(()=>i()).catch(i)}s(ja,"ftruncate");function $a(t,e=_){q(t).sync().then(()=>e()).catch(e)}s($a,"fsync");function Va(t,e=_){q(t).datasync().then(()=>e()).catch(e)}s(Va,"fdatasync");function za(t,e,i,r,n,o=_){let a,l,c,u=null,d,h=new ee(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":u=i,d=typeof r=="string"?r:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof r=="function"?r:typeof n=="function"?n:o,o(new f(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let m=o;h.write(a,l,c,u).then(({bytesWritten:y})=>m(null,y,a.toString(d))).catch(m)}else{a=Buffer.from(e),l=i,c=r,u=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;h.write(a,l,c,u).then(({bytesWritten:y})=>m(null,y,a)).catch(m)}}s(za,"write");function Ha(t,e,i,r,n,o=_){new ee(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(Ha,"read");function Ka(t,e,i,r=_){new ee(t).chown(e,i).then(()=>r()).catch(r)}s(Ka,"fchown");function Ga(t,e,i){new ee(t).chmod(e).then(()=>i()).catch(i)}s(Ga,"fchmod");function Ya(t,e,i,r=_){new ee(t).utimes(e,i).then(()=>r()).catch(r)}s(Ya,"futimes");function Xa(t,e=_){Gn(t).then(()=>e()).catch(e)}s(Xa,"rmdir");function Ja(t,e,i=_){Yn(t,e).then(()=>i()).catch(i)}s(Ja,"mkdir");function Qa(t,e,i=_){i=typeof e=="function"?e:i,Ci(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Qa,"readdir");function Za(t,e,i=_){Xn(t,e).then(()=>i()).catch(i)}s(Za,"link");function el(t,e,i,r=_){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Jn(t,e,n).then(()=>r()).catch(r)}s(el,"symlink");function tl(t,e,i=_){i=typeof e=="function"?e:i,Ir(t).then(r=>i(null,r)).catch(i)}s(tl,"readlink");function il(t,e,i,r=_){Qn(t,e,i).then(()=>r()).catch(r)}s(il,"chown");function rl(t,e,i,r=_){Zn(t,e,i).then(()=>r()).catch(r)}s(rl,"lchown");function nl(t,e,i=_){eo(t,e).then(()=>i()).catch(i)}s(nl,"chmod");function ol(t,e,i=_){to(t,e).then(()=>i()).catch(i)}s(ol,"lchmod");function sl(t,e,i,r=_){io(t,e,i).then(()=>r()).catch(r)}s(sl,"utimes");function al(t,e,i,r=_){ro(t,e,i).then(()=>r()).catch(r)}s(al,"lutimes");function ll(t,e,i=_){i=typeof e=="function"?e:i,wt(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(ll,"realpath");function cl(t,e,i=_){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,no(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(cl,"access");function ul(t,e,i=_){throw f.With("ENOTSUP",t,"watchFile")}s(ul,"watchFile");function fl(t,e=_){throw f.With("ENOTSUP",t,"unwatchFile")}s(fl,"unwatchFile");function dl(t,e,i=_){throw f.With("ENOTSUP",t,"watch")}s(dl,"watch");function hl(t,e){throw f.With("ENOTSUP",t,"createReadStream")}s(hl,"createReadStream");function pl(t,e){throw f.With("ENOTSUP",t,"createWriteStream")}s(pl,"createWriteStream");function yl(t,e,i=_){i=typeof e=="function"?e:i,oo(t,typeof e=="function"?null:e).then(()=>i(null)).catch(i)}s(yl,"rm");function ml(t,e,i=_){i=typeof e=="function"?e:i,so(t,typeof e!="function"?e:null).then(r=>i(null,r)).catch(i)}s(ml,"mkdtemp");function bl(t,e,i,r){r=typeof i=="function"?i:r,ao(t,e,typeof i=="function"?null:i).then(()=>r(null)).catch(r)}s(bl,"copyFile");function gl(t,e,i,r=_){r=typeof i=="function"?i:r,new ee(t).readv(e,typeof i=="function"?null:i).then(({buffers:n,bytesRead:o})=>r(null,o,n)).catch(r)}s(gl,"readv");function wl(t,e,i,r=_){r=typeof i=="function"?i:r,new ee(t).writev(e,typeof i=="function"?null:i).then(({buffers:n,bytesWritten:o})=>r(null,o,n)).catch(r)}s(wl,"writev");function Sl(t,e,i=_){i=typeof e=="function"?e:i,lo(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(Sl,"opendir");function _l(t,e,i,r){r=typeof i=="function"?i:r,co(t,e,typeof i=="function"?null:i).then(()=>r(null)).catch(r)}s(_l,"cp");function El(t,e,i=_){i=typeof e=="function"?e:i,uo(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(El,"statfs");function xl(t,e){throw f.With("ENOTSUP",t,"openAsBlob")}s(xl,"openAsBlob");var pn=gn(Cf(),1);var Qi=class extends pn.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(Qi,"ReadStream");var Zi=class extends pn.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(Zi,"WriteStream");function Es(t){return _n(t)||wi(t)||t instanceof Z}s(Es,"isMountConfig");async function xs(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!Es(t))throw new f(22,"Invalid mount configuration");if(t instanceof Z)return t;wi(t)&&(t={backend:t});for(let[n,o]of Object.entries(t))if(n!="backend"&&Es(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[n]=await xs(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);sr(i,t);let r=i.create(t);return await r.ready(),r}s(xs,"resolveMountConfig");async function Pg(t){let e="uid"in t&&+t.uid||0,i="gid"in t&&+t.gid||0;Es(t)&&(t={"/":t});for(let[r,n]of Object.entries(t))r=="uid"||r=="gid"||typeof n=="number"||(t[r]=await xs(n));Fi(t),Zs({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Pg,"configure");var Pt=class{static FromListing(e){let i=new Pt,r=new tt;i._index.set("/",r);let n=[{pwd:"",tree:e,parent:r}];for(;n.length>0;){let o,{tree:a,pwd:l,parent:c}=n.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let d=a[u];if(d){let h=l+"/"+u;o=new tt,i._index.set(h,o),n.push({pwd:h,tree:d,parent:o})}else o=new tr(new B({mode:D.FILE|365}));c&&c._listing.set(u,o)}}return i}_index=new Map;constructor(){this.add("/",new tt)}files(){let e=[];for(let i of this._index.values())for(let r of i.listing){let n=i.get(r);n?.isFile()&&e.push(n)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let r=x(e),n=this._index.get(r);return!n&&e!="/"&&(n=new tt,!this.add(r,n))||e!="/"&&!n.add(F(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let r=x(e),n=F(e),o=this._index.get(r);return o||(o=new tt,this.addFast(r,o)),o.add(n,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),r=this._index.get(i);if(!r)return;let n=r.remove(F(e));if(!n)return;if(!n.isDirectory())return n;let o=n.listing;for(let a of o)this.remove(re(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),r=this._index.get(i);return i==e?r:r?.get(F(e))}};s(Pt,"FileIndex");var yi=class{constructor(e){this.data=e}};s(yi,"IndexInode");var tr=class extends yi{isFile(){return!0}isDirectory(){return!1}toStats(){return new B({mode:D.FILE|438,size:4096})}};s(tr,"IndexFileInode");var tt=class extends yi{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new B({mode:D.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(tt,"IndexDirInode");var mi=class extends An(Z){_index;constructor(e){super(),this._index=Pt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new f(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"statSync");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new f(22,"Invalid inode.")}async openFile(e,i,r){if(de(i))throw new f(1,e);let n=this._index.get(e);if(!n)throw f.With("ENOENT",e,"openFile");if(!n.toStats().hasAccess(rt(i),r))throw f.With("EACCESS",e,"openFile");if(n.isDirectory()){let o=n.stats;return new pt(this,e,i,o,o.fileData)}return this.openFileInode(n,e,i)}openFileSync(e,i,r){if(de(i))throw new f(1,e);let n=this._index.get(e);if(!n)throw f.With("ENOENT",e,"openFileSync");if(!n.toStats().hasAccess(rt(i),r))throw f.With("EACCES",e,"openFileSync");if(n.isDirectory()){let o=n.stats;return new pt(this,e,i,o,o.fileData)}return this.openFileInodeSync(n,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdirSync");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdirSync")}};s(mi,"FileIndexFS");var yn=class extends mi{async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,r){return this.openFileInodeSync(e,i,r)}};s(yn,"SyncFileIndexFS");var mn=class extends vi(mi){statFileInodeSync(){throw new f(95)}openFileInodeSync(){throw new f(95)}};s(mn,"AsyncFileIndexFS");var Cg=er;return Uf(Og);})();
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
ieee754/index.js:
|