@zenfs/core 0.12.2 → 0.12.3
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/backends/backend.d.ts +1 -1
- package/dist/backends/fetch.d.ts +1 -1
- package/dist/backends/index/fs.d.ts +2 -2
- package/dist/backends/index/index.d.ts +2 -1
- package/dist/backends/overlay.d.ts +4 -3
- package/dist/backends/port/fs.d.ts +5 -2
- package/dist/backends/port/fs.js +13 -10
- package/dist/browser.min.js +4 -4
- package/dist/browser.min.js.map +3 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/cred.d.ts +2 -1
- package/dist/emulation/async.d.ts +2 -1
- package/dist/emulation/promises.d.ts +1 -1
- package/dist/emulation/promises.js +27 -35
- package/dist/emulation/shared.d.ts +2 -2
- package/dist/emulation/shared.js +1 -2
- package/dist/emulation/streams.d.ts +1 -1
- package/dist/emulation/sync.d.ts +1 -1
- package/dist/emulation/sync.js +24 -32
- package/dist/error.d.ts +1 -1
- package/dist/error.js +1 -1
- package/dist/file.d.ts +2 -13
- package/dist/file.js +3 -33
- package/dist/filesystem.d.ts +18 -36
- package/dist/filesystem.js +9 -13
- package/dist/stats.d.ts +1 -1
- package/dist/utils.d.ts +2 -2
- package/license.md +2 -26
- package/package.json +2 -2
- package/readme.md +1 -1
- package/src/backends/backend.ts +1 -1
- package/src/backends/fetch.ts +1 -1
- package/src/backends/index/fs.ts +2 -1
- package/src/backends/index/index.ts +2 -1
- package/src/backends/overlay.ts +6 -3
- package/src/backends/port/fs.ts +14 -10
- package/src/config.ts +1 -1
- package/src/cred.ts +2 -1
- package/src/emulation/async.ts +2 -1
- package/src/emulation/promises.ts +28 -33
- package/src/emulation/shared.ts +4 -4
- package/src/emulation/streams.ts +1 -1
- package/src/emulation/sync.ts +28 -33
- package/src/error.ts +1 -1
- package/src/file.ts +5 -39
- package/src/filesystem.ts +19 -38
- package/src/stats.ts +1 -1
- package/src/utils.ts +2 -2
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var ZenFS=(()=>{var ed=Object.create;var ki=Object.defineProperty;var td=Object.getOwnPropertyDescriptor;var id=Object.getOwnPropertyNames;var rd=Object.getPrototypeOf,nd=Object.prototype.hasOwnProperty;var s=(t,e)=>ki(t,"name",{value:e,configurable:!0});var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pr=(t,e)=>{for(var i in e)ki(t,i,{get:e[i],enumerable:!0})},js=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of id(e))!nd.call(t,n)&&n!==i&&ki(t,n,{get:()=>e[n],enumerable:!(r=td(e,n))||r.enumerable});return t};var yr=(t,e,i)=>(i=t!=null?ed(rd(t)):{},js(e||!t||!t.__esModule?ki(i,"default",{value:t,enumerable:!0}):i,t)),od=t=>js(ki({},"__esModule",{value:!0}),t);var aa=P(Ir=>{"use strict";Ir.byteLength=Xd;Ir.toByteArray=Qd;Ir.fromByteArray=th;var Ue=[],ge=[],Kd=typeof Uint8Array<"u"?Uint8Array:Array,Vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(At=0,oa=Vn.length;At<oa;++At)Ue[At]=Vn[At],ge[Vn.charCodeAt(At)]=At;var At,oa;ge[45]=62;ge[95]=63;function sa(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(sa,"getLens");function Xd(t){var e=sa(t),i=e[0],r=e[1];return(i+r)*3/4-r}s(Xd,"byteLength");function Jd(t,e,i){return(e+i)*3/4-i}s(Jd,"_byteLength");function Qd(t){var e,i=sa(t),r=i[0],n=i[1],o=new Kd(Jd(t,r,n)),a=0,c=n>0?r-4:r,l;for(l=0;l<c;l+=4)e=ge[t.charCodeAt(l)]<<18|ge[t.charCodeAt(l+1)]<<12|ge[t.charCodeAt(l+2)]<<6|ge[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=ge[t.charCodeAt(l)]<<2|ge[t.charCodeAt(l+1)]>>4,o[a++]=e&255),n===1&&(e=ge[t.charCodeAt(l)]<<10|ge[t.charCodeAt(l+1)]<<4|ge[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Qd,"toByteArray");function Zd(t){return Ue[t>>18&63]+Ue[t>>12&63]+Ue[t>>6&63]+Ue[t&63]}s(Zd,"tripletToBase64");function eh(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(Zd(r));return n.join("")}s(eh,"encodeChunk");function th(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,c=i-r;a<c;a+=o)n.push(eh(t,a,a+o>c?c:a+o));return r===1?(e=t[i-1],n.push(Ue[e>>2]+Ue[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(Ue[e>>10]+Ue[e>>4&63]+Ue[e<<2&63]+"=")),n.join("")}s(th,"fromByteArray")});var ca=P(Hn=>{Hn.read=function(t,e,i,r,n){var o,a,c=n*8-r-1,l=(1<<c)-1,u=l>>1,d=-7,h=i?n-1:0,b=i?-1:1,m=t[e+h];for(h+=b,o=m&(1<<-d)-1,m>>=-d,d+=c;d>0;o=o*256+t[e+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=b,d-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-u}return(m?-1:1)*a*Math.pow(2,o-r)};Hn.write=function(t,e,i,r,n,o){var a,c,l,u=o*8-n-1,d=(1<<u)-1,h=d>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,w=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?e+=b/l:e+=b*Math.pow(2,1-h),e*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(e*l-1)*Math.pow(2,n),a=a+h):(c=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+m]=c&255,m+=w,c/=256,n-=8);for(a=a<<n|c,u+=n;u>0;t[i+m]=a&255,m+=w,a/=256,u-=8);t[i+m-w]|=g*128}});var we=P(ii=>{"use strict";var Yn=aa(),ei=ca(),la=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ii.Buffer=y;ii.SlowBuffer=ah;ii.INSPECT_MAX_BYTES=50;var Pr=2147483647;ii.kMaxLength=Pr;y.TYPED_ARRAY_SUPPORT=ih();!y.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 ih(){try{let t=new Uint8Array(1),e={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(ih,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function it(t){if(t>Pr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(it,"createBuffer");function y(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 Jn(t)}return ha(t,e,i)}s(y,"Buffer");y.poolSize=8192;function ha(t,e,i){if(typeof t=="string")return nh(t,e);if(ArrayBuffer.isView(t))return oh(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(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Kn(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 y.from(r,e,i);let n=sh(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.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(ha,"from");y.from=function(t,e,i){return ha(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function pa(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(pa,"assertSize");function rh(t,e,i){return pa(t),t<=0?it(t):e!==void 0?typeof i=="string"?it(t).fill(e,i):it(t).fill(e):it(t)}s(rh,"alloc");y.alloc=function(t,e,i){return rh(t,e,i)};function Jn(t){return pa(t),it(t<0?0:Qn(t)|0)}s(Jn,"allocUnsafe");y.allocUnsafe=function(t){return Jn(t)};y.allocUnsafeSlow=function(t){return Jn(t)};function nh(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=ya(t,e)|0,r=it(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(nh,"fromString");function Gn(t){let e=t.length<0?0:Qn(t.length)|0,i=it(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(Gn,"fromArrayLike");function oh(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Kn(e.buffer,e.byteOffset,e.byteLength)}return Gn(t)}s(oh,"fromArrayView");function Kn(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,y.prototype),r}s(Kn,"fromArrayBuffer");function sh(t){if(y.isBuffer(t)){let e=Qn(t.length)|0,i=it(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||eo(t.length)?it(0):Gn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Gn(t.data)}s(sh,"fromObject");function Qn(t){if(t>=Pr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Pr.toString(16)+" bytes");return t|0}s(Qn,"checked");function ah(t){return+t!=t&&(t=0),y.alloc(+t)}s(ah,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.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");y.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");y.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 y.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=y.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(We(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.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 ya(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(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 Xn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return ka(t).length;default:if(n)return r?-1:Xn(t).length;e=(""+e).toLowerCase(),n=!0}}s(ya,"byteLength");y.byteLength=ya;function ch(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 gh(this,e,i);case"utf8":case"utf-8":return ba(this,e,i);case"ascii":return mh(this,e,i);case"latin1":case"binary":return bh(this,e,i);case"base64":return ph(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wh(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(ch,"slowToString");y.prototype._isBuffer=!0;function Ot(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(Ot,"swap");y.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)Ot(this,i,i+1);return this},"swap16");y.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)Ot(this,i,i+3),Ot(this,i+1,i+2);return this},"swap32");y.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)Ot(this,i,i+7),Ot(this,i+1,i+6),Ot(this,i+2,i+5),Ot(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?ba(this,0,e):ch.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=ii.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");la&&(y.prototype[la]=y.prototype.inspect);y.prototype.compare=s(function(e,i,r,n,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.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,c=r-i,l=Math.min(a,c),u=this.slice(n,o),d=e.slice(i,r);for(let h=0;h<l;++h)if(u[h]!==d[h]){a=u[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function ma(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,eo(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=y.from(e,r)),y.isBuffer(e))return e.length===0?-1:fa(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):fa(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(ma,"bidirectionalIndexOf");function fa(t,e,i,r,n){let o=1,a=t.length,c=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,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let u;if(n){let d=-1;for(u=i;u<a;u++)if(l(t,u)===l(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===c)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(i+c>a&&(i=a-c),u=i;u>=0;u--){let d=!0;for(let h=0;h<c;h++)if(l(t,u+h)!==l(e,h)){d=!1;break}if(d)return u}return-1}s(fa,"arrayIndexOf");y.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");y.prototype.indexOf=s(function(e,i,r){return ma(this,e,i,r,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,r){return ma(this,e,i,r,!1)},"lastIndexOf");function lh(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 c=parseInt(e.substr(a*2,2),16);if(eo(c))return a;t[i+a]=c}return a}s(lh,"hexWrite");function fh(t,e,i,r){return Ar(Xn(e,t.length-i),t,i,r)}s(fh,"utf8Write");function uh(t,e,i,r){return Ar(xh(e),t,i,r)}s(uh,"asciiWrite");function dh(t,e,i,r){return Ar(ka(e),t,i,r)}s(dh,"base64Write");function hh(t,e,i,r){return Ar(kh(e,t.length-i),t,i,r)}s(hh,"ucs2Write");y.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 lh(this,e,i,r);case"utf8":case"utf-8":return fh(this,e,i,r);case"ascii":case"latin1":case"binary":return uh(this,e,i,r);case"base64":return dh(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hh(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ph(t,e,i){return e===0&&i===t.length?Yn.fromByteArray(t):Yn.fromByteArray(t.slice(e,i))}s(ph,"base64Slice");function ba(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=i){let l,u,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=t[n+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=t[n+1],u=t[n+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=t[n+1],u=t[n+2],d=t[n+3],(l&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=c}return yh(r)}s(ba,"utf8Slice");var ua=4096;function yh(t){let e=t.length;if(e<=ua)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=ua));return i}s(yh,"decodeCodePointsArray");function mh(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(mh,"asciiSlice");function bh(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(bh,"latin1Slice");function gh(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+=vh[t[o]];return n}s(gh,"hexSlice");function wh(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(wh,"utf16leSlice");y.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,y.prototype),n},"slice");function J(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(J,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(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");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||J(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||J(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||J(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=pt(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readBigUInt64BE=pt(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(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");y.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(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");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||J(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||J(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||J(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=pt(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readBigInt64BE=pt(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),ei.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),ei.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||J(e,8,this.length),ei.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||J(e,8,this.length),ei.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,r,n,o){if(!y.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(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ae(this,e,i,r,c,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");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ae(this,e,i,r,c,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");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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 ga(t,e,i,r,n){xa(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(ga,"wrtBigUInt64LE");function wa(t,e,i,r,n){xa(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(wa,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=pt(s(function(e,i=0){return ga(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=pt(s(function(e,i=0){return wa(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ae(this,e,i,r,l-1,-l)}let o=0,a=1,c=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ae(this,e,i,r,l-1,-l)}let o=r-1,a=1,c=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntBE");y.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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");y.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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");y.prototype.writeBigInt64LE=pt(s(function(e,i=0){return ga(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=pt(s(function(e,i=0){return wa(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Sa(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(Sa,"checkIEEE754");function Ea(t,e,i,r,n){return e=+e,i=i>>>0,n||Sa(t,e,i,4,34028234663852886e22,-34028234663852886e22),ei.write(t,e,i,r,23,4),i+4}s(Ea,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,r){return Ea(this,e,i,!0,r)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,r){return Ea(this,e,i,!1,r)},"writeFloatBE");function _a(t,e,i,r,n){return e=+e,i=i>>>0,n||Sa(t,e,i,8,17976931348623157e292,-17976931348623157e292),ei.write(t,e,i,r,52,8),i+8}s(_a,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,r){return _a(this,e,i,!0,r)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,r){return _a(this,e,i,!1,r)},"writeDoubleBE");y.prototype.copy=s(function(e,i,r,n){if(!y.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");y.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"&&!y.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=y.isBuffer(e)?e:y.from(e,n),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%c]}return this},"fill");var Zt={};function Zn(t,e,i){Zt[t]=class extends i{static{s(this,"NodeError")}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}`}}}s(Zn,"E");Zn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Zn("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=da(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=da(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function da(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(da,"addNumericalSeparator");function Sh(t,e,i){ti(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&$i(e,t.length-(i+1))}s(Sh,"checkBounds");function xa(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",c;throw o>3?e===0||e===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${e}${a} and <= ${i}${a}`,new Zt.ERR_OUT_OF_RANGE("value",c,t)}Sh(r,n,o)}s(xa,"checkIntBI");function ti(t,e){if(typeof t!="number")throw new Zt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(ti,"validateNumber");function $i(t,e,i){throw Math.floor(t)!==t?(ti(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($i,"boundsError");var Eh=/[^+/0-9A-Za-z-_]/g;function _h(t){if(t=t.split("=")[0],t=t.trim().replace(Eh,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(_h,"base64clean");function Xn(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(Xn,"utf8ToBytes");function xh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(xh,"asciiToBytes");function kh(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(kh,"utf16leToBytes");function ka(t){return Yn.toByteArray(_h(t))}s(ka,"base64ToBytes");function Ar(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(Ar,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function eo(t){return t!==t}s(eo,"numberIsNaN");var vh=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 pt(t){return typeof BigInt>"u"?Fh:t}s(pt,"defineBigIntMethod");function Fh(){throw new Error("BigInt not supported")}s(Fh,"BufferBigIntNotDefined")});var D=P((c_,Ka)=>{"use strict";Ka.exports={ArrayIsArray:s(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"FunctionPrototypeSymbolHasInstance"),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:s(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:s(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:s(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(t){return t.trim()},"StringPrototypeTrim"),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:s(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var si=P((f_,Mr)=>{"use strict";var{AbortController:Xa,AbortSignal:Ph}=typeof self<"u"?self:typeof window<"u"?window:void 0;Mr.exports=Xa;Mr.exports.AbortSignal=Ph;Mr.exports.default=Xa});var Xi=P((u_,lo)=>{"use strict";var ai=typeof Reflect=="object"?Reflect:null,Ja=ai&&typeof ai.apply=="function"?ai.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Ur;ai&&typeof ai.ownKeys=="function"?Ur=ai.ownKeys:Object.getOwnPropertySymbols?Ur=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ur=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function Ah(t){console&&console.warn&&console.warn(t)}s(Ah,"ProcessEmitWarning");var Za=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function C(){C.init.call(this)}s(C,"EventEmitter");lo.exports=C;lo.exports.once=Rh;C.EventEmitter=C;C.prototype._events=void 0;C.prototype._eventsCount=0;C.prototype._maxListeners=void 0;var Qa=10;function Wr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Wr,"checkListener");Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Qa},"get"),set:s(function(t){if(typeof t!="number"||t<0||Za(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qa=t},"set")});C.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};C.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Za(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 ec(t){return t._maxListeners===void 0?C.defaultMaxListeners:t._maxListeners}s(ec,"_getMaxListeners");C.prototype.getMaxListeners=s(function(){return ec(this)},"getMaxListeners");C.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 c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")Ja(l,this,i);else for(var u=l.length,d=oc(l,u),r=0;r<u;++r)Ja(d[r],this,i);return!0},"emit");function tc(t,e,i,r){var n,o,a;if(Wr(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=ec(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,Ah(c)}return t}s(tc,"_addListener");C.prototype.addListener=s(function(e,i){return tc(this,e,i,!1)},"addListener");C.prototype.on=C.prototype.addListener;C.prototype.prependListener=s(function(e,i){return tc(this,e,i,!0)},"prependListener");function Oh(){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(Oh,"onceWrapper");function ic(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=Oh.bind(r);return n.listener=i,r.wrapFn=n,n}s(ic,"_onceWrap");C.prototype.once=s(function(e,i){return Wr(i),this.on(e,ic(this,e,i)),this},"once");C.prototype.prependOnceListener=s(function(e,i){return Wr(i),this.prependListener(e,ic(this,e,i)),this},"prependOnceListener");C.prototype.removeListener=s(function(e,i){var r,n,o,a,c;if(Wr(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){c=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():Th(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,c||i)}return this},"removeListener");C.prototype.off=C.prototype.removeListener;C.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 rc(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?Ch(n):oc(n,n.length)}s(rc,"_listeners");C.prototype.listeners=s(function(e){return rc(this,e,!0)},"listeners");C.prototype.rawListeners=s(function(e){return rc(this,e,!1)},"rawListeners");C.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):nc.call(t,e)};C.prototype.listenerCount=nc;function nc(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(nc,"listenerCount");C.prototype.eventNames=s(function(){return this._eventsCount>0?Ur(this._events):[]},"eventNames");function oc(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(oc,"arrayClone");function Th(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(Th,"spliceOne");function Ch(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(Ch,"unwrapListeners");function Rh(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"),sc(t,e,o,{once:!0}),e!=="error"&&Nh(t,n,{once:!0})})}s(Rh,"once");function Nh(t,e,i){typeof t.on=="function"&&sc(t,"error",e,i)}s(Nh,"addErrorHandlerIfEventEmitter");function sc(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(sc,"eventTargetAgnosticAddListener")});var ee=P((h_,uo)=>{"use strict";var Lh=we(),{kResistStopPropagation:Bh,SymbolDispose:Dh}=D(),Mh=globalThis.AbortSignal||si().AbortSignal,Uh=globalThis.AbortController||si().AbortController,Wh=Object.getPrototypeOf(async function(){}).constructor,ac=globalThis.Blob||Lh.Blob,jh=s(typeof ac<"u"?function(e){return e instanceof ac}:function(e){return!1},"isBlob"),cc=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"),qh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),fo=class extends Error{static{s(this,"AggregateError")}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}};uo.exports={AggregateError:fo,kEmptyObject:Object.freeze({}),once:s(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:s(function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},"createDeferredPromise"),promisify:s(function(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(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()})},"format"),inspect:s(function(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"{}"}},"inspect"),types:{isAsyncFunction:s(function(t){return t instanceof Wh},"isAsyncFunction"),isArrayBufferView:s(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:jh,deprecate:s(function(t,e){return t},"deprecate"),addAbortListener:Xi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);cc(e,"signal"),qh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Bh]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Dh](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:Mh.any||s(function(e){if(e.length===1)return e[0];let i=new Uh,r=s(()=>i.abort(),"abort");return e.forEach(n=>{cc(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};uo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var re=P((y_,uc)=>{"use strict";var{format:$h,inspect:jr,AggregateError:zh}=ee(),Vh=globalThis.AggregateError||zh,Hh=Symbol("kIsNodeError"),Yh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Gh=/^([A-Z][a-z0-9]*)+$/,Kh="__node_internal_",qr={};function Rt(t,e){if(!t)throw new qr.ERR_INTERNAL_ASSERTION(e)}s(Rt,"assert");function lc(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(lc,"addNumericalSeparator");function Xh(t,e,i){if(typeof e=="function")return Rt(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 Rt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:$h(e,...i)}s(Xh,"getMessage");function Q(t,e,i){i||(i=Error);class r extends i{static{s(this,"NodeError")}constructor(...o){super(Xh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[Hh]=!0,qr[t]=r}s(Q,"E");function fc(t){let e=Kh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(fc,"hideStackFrames");function Jh(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(Jh,"aggregateTwoErrors");var ho=class extends Error{static{s(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new qr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Rt(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 l of e)Rt(typeof l=="string","All expected entries have to be of type string"),Yh.includes(l)?n.push(l.toLowerCase()):Gh.test(l)?o.push(l):(Rt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,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 l=n.pop();r+=`one of type ${n.join(", ")}, or ${l}`}}(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 l=o.pop();r+=`an instance of ${o.join(", ")}, or ${l}`}}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 l=a.pop();r+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${i.constructor.name}`;else{let l=jr(i,{depth:-1});r+=`. Received ${l}`}}else{let l=jr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof i} (${l})`}return r},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=jr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);Q("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);Q("ERR_MISSING_ARGS",(...t)=>{Rt(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);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{Rt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=lc(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=lc(r)),r+="n"):r=jr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);uc.exports={AbortError:ho,aggregateTwoErrors:fc(Jh),hideStackFrames:fc,codes:qr}});var li=P((b_,Ec)=>{"use strict";var{ArrayIsArray:yo,ArrayPrototypeIncludes:yc,ArrayPrototypeJoin:mc,ArrayPrototypeMap:Qh,NumberIsInteger:mo,NumberIsNaN:Zh,NumberMAX_SAFE_INTEGER:ep,NumberMIN_SAFE_INTEGER:tp,NumberParseInt:ip,ObjectPrototypeHasOwnProperty:rp,RegExpPrototypeExec:bc,String:np,StringPrototypeToUpperCase:op,StringPrototypeTrim:sp}=D(),{hideStackFrames:Ee,codes:{ERR_SOCKET_BAD_PORT:ap,ERR_INVALID_ARG_TYPE:te,ERR_INVALID_ARG_VALUE:ci,ERR_OUT_OF_RANGE:Nt,ERR_UNKNOWN_SIGNAL:dc}}=re(),{normalizeEncoding:cp}=ee(),{isAsyncFunction:lp,isArrayBufferView:fp}=ee().types,hc={};function up(t){return t===(t|0)}s(up,"isInt32");function dp(t){return t===t>>>0}s(dp,"isUint32");var hp=/^[0-7]+$/,pp="must be a 32-bit unsigned integer or an octal string";function yp(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(bc(hp,t)===null)throw new ci(e,t,pp);t=ip(t,8)}return gc(t,e),t}s(yp,"parseFileMode");var mp=Ee((t,e,i=tp,r=ep)=>{if(typeof t!="number")throw new te(e,"number",t);if(!mo(t))throw new Nt(e,"an integer",t);if(t<i||t>r)throw new Nt(e,`>= ${i} && <= ${r}`,t)}),bp=Ee((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new te(e,"number",t);if(!mo(t))throw new Nt(e,"an integer",t);if(t<i||t>r)throw new Nt(e,`>= ${i} && <= ${r}`,t)}),gc=Ee((t,e,i=!1)=>{if(typeof t!="number")throw new te(e,"number",t);if(!mo(t))throw new Nt(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new Nt(e,`>= ${r} && <= ${n}`,t)});function bo(t,e){if(typeof t!="string")throw new te(e,"string",t)}s(bo,"validateString");function gp(t,e,i=void 0,r){if(typeof t!="number")throw new te(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Zh(t))throw new Nt(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(gp,"validateNumber");var wp=Ee((t,e,i)=>{if(!yc(i,t)){let n="must be one of: "+mc(Qh(i,o=>typeof o=="string"?`'${o}'`:np(o)),", ");throw new ci(e,t,n)}});function wc(t,e){if(typeof t!="boolean")throw new te(e,"boolean",t)}s(wc,"validateBoolean");function po(t,e,i){return t==null||!rp(t,e)?i:t[e]}s(po,"getOwnPropertyValueOrDefault");var Sp=Ee((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 te(e,"Object",t)}),Ep=Ee((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new te(e,"a dictionary",t)}),$r=Ee((t,e,i=0)=>{if(!yo(t))throw new te(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ci(e,t,r)}});function _p(t,e){$r(t,e);for(let i=0;i<t.length;i++)bo(t[i],`${e}[${i}]`)}s(_p,"validateStringArray");function xp(t,e){$r(t,e);for(let i=0;i<t.length;i++)wc(t[i],`${e}[${i}]`)}s(xp,"validateBooleanArray");function kp(t,e){$r(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new te(n,"AbortSignal",r);Sc(r,n)}}s(kp,"validateAbortSignalArray");function vp(t,e="signal"){if(bo(t,e),hc[t]===void 0)throw hc[op(t)]!==void 0?new dc(t+" (signals must use all capital letters)"):new dc(t)}s(vp,"validateSignalName");var Fp=Ee((t,e="buffer")=>{if(!fp(t))throw new te(e,["Buffer","TypedArray","DataView"],t)});function Ip(t,e){let i=cp(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ci("encoding",e,`is invalid for data of length ${r}`)}s(Ip,"validateEncoding");function Pp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&sp(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new ap(e,t,i);return t|0}s(Pp,"validatePort");var Sc=Ee((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new te(e,"AbortSignal",t)}),Ap=Ee((t,e)=>{if(typeof t!="function")throw new te(e,"Function",t)}),Op=Ee((t,e)=>{if(typeof t!="function"||lp(t))throw new te(e,"Function",t)}),Tp=Ee((t,e)=>{if(t!==void 0)throw new te(e,"undefined",t)});function Cp(t,e,i){if(!yc(i,t))throw new te(e,`('${mc(i,"|")}')`,t)}s(Cp,"validateUnion");var Rp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function pc(t,e){if(typeof t>"u"||!bc(Rp,t))throw new ci(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(pc,"validateLinkHeaderFormat");function Np(t){if(typeof t=="string")return pc(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];pc(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ci("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Np,"validateLinkHeaderValue");Ec.exports={isInt32:up,isUint32:dp,parseFileMode:yp,validateArray:$r,validateStringArray:_p,validateBooleanArray:xp,validateAbortSignalArray:kp,validateBoolean:wc,validateBuffer:Fp,validateDictionary:Ep,validateEncoding:Ip,validateFunction:Ap,validateInt32:bp,validateInteger:mp,validateNumber:gp,validateObject:Sp,validateOneOf:wp,validatePlainFunction:Op,validatePort:Pp,validateSignalName:vp,validateString:bo,validateUint32:gc,validateUndefined:Tp,validateUnion:Cp,validateAbortSignal:Sc,validateLinkHeaderValue:Np}});var gt=P((w_,vc)=>{var $=vc.exports={},$e,ze;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"?$e=setTimeout:$e=go}catch{$e=go}try{typeof clearTimeout=="function"?ze=clearTimeout:ze=wo}catch{ze=wo}})();function _c(t){if($e===setTimeout)return setTimeout(t,0);if(($e===go||!$e)&&setTimeout)return $e=setTimeout,setTimeout(t,0);try{return $e(t,0)}catch{try{return $e.call(null,t,0)}catch{return $e.call(this,t,0)}}}s(_c,"runTimeout");function Lp(t){if(ze===clearTimeout)return clearTimeout(t);if((ze===wo||!ze)&&clearTimeout)return ze=clearTimeout,clearTimeout(t);try{return ze(t)}catch{try{return ze.call(null,t)}catch{return ze.call(this,t)}}}s(Lp,"runClearTimeout");var nt=[],fi=!1,Lt,zr=-1;function Bp(){!fi||!Lt||(fi=!1,Lt.length?nt=Lt.concat(nt):zr=-1,nt.length&&xc())}s(Bp,"cleanUpNextTick");function xc(){if(!fi){var t=_c(Bp);fi=!0;for(var e=nt.length;e;){for(Lt=nt,nt=[];++zr<e;)Lt&&Lt[zr].run();zr=-1,e=nt.length}Lt=null,fi=!1,Lp(t)}}s(xc,"drainQueue");$.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];nt.push(new kc(t,e)),nt.length===1&&!fi&&_c(xc)};function kc(t,e){this.fun=t,this.array=e}s(kc,"Item");kc.prototype.run=function(){this.fun.apply(null,this.array)};$.title="browser";$.browser=!0;$.env={};$.argv=[];$.version="";$.versions={};function ot(){}s(ot,"noop");$.on=ot;$.addListener=ot;$.once=ot;$.off=ot;$.removeListener=ot;$.removeAllListeners=ot;$.emit=ot;$.prependListener=ot;$.prependOnceListener=ot;$.listeners=function(t){return[]};$.binding=function(t){throw new Error("process.binding is not supported")};$.cwd=function(){return"/"};$.chdir=function(t){throw new Error("process.chdir is not supported")};$.umask=function(){return 0}});var He=P((E_,Wc)=>{"use strict";var{SymbolAsyncIterator:Fc,SymbolIterator:Ic,SymbolFor:Bt}=D(),Pc=Bt("nodejs.stream.destroyed"),Ac=Bt("nodejs.stream.errored"),So=Bt("nodejs.stream.readable"),Eo=Bt("nodejs.stream.writable"),Oc=Bt("nodejs.stream.disturbed"),Dp=Bt("nodejs.webstream.isClosedPromise"),Mp=Bt("nodejs.webstream.controllerErrorFunction");function Vr(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(Vr,"isReadableNodeStream");function Hr(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(Hr,"isWritableNodeStream");function Up(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Up,"isDuplexNodeStream");function Ve(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(Ve,"isNodeStream");function Tc(t){return!!(t&&!Ve(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(Tc,"isReadableStream");function Cc(t){return!!(t&&!Ve(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Cc,"isWritableStream");function Rc(t){return!!(t&&!Ve(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Rc,"isTransformStream");function Wp(t){return Tc(t)||Cc(t)||Rc(t)}s(Wp,"isWebStream");function jp(t,e){return t==null?!1:e===!0?typeof t[Fc]=="function":e===!1?typeof t[Ic]=="function":typeof t[Fc]=="function"||typeof t[Ic]=="function"}s(jp,"isIterable");function Yr(t){if(!Ve(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[Pc]||r!=null&&r.destroyed)}s(Yr,"isDestroyed");function Nc(t){if(!Hr(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(Nc,"isWritableEnded");function qp(t,e){if(!Hr(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(qp,"isWritableFinished");function $p(t){if(!Vr(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($p,"isReadableEnded");function Lc(t,e){if(!Vr(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(Lc,"isReadableFinished");function Bc(t){return t&&t[So]!=null?t[So]:typeof t?.readable!="boolean"?null:Yr(t)?!1:Vr(t)&&t.readable&&!Lc(t)}s(Bc,"isReadable");function Dc(t){return t&&t[Eo]!=null?t[Eo]:typeof t?.writable!="boolean"?null:Yr(t)?!1:Hr(t)&&t.writable&&!Nc(t)}s(Dc,"isWritable");function zp(t,e){return Ve(t)?Yr(t)?!0:!(e?.readable!==!1&&Bc(t)||e?.writable!==!1&&Dc(t)):null}s(zp,"isFinished");function Vp(t){var e,i;return Ve(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 Hp(t){var e,i;return Ve(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(Hp,"isReadableErrored");function Yp(t){if(!Ve(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"&&Mc(t)?t._closed:null}s(Yp,"isClosed");function Mc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Mc,"isOutgoingMessage");function Uc(t){return typeof t._sent100=="boolean"&&Mc(t)}s(Uc,"isServerResponse");function Gp(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(Gp,"isServerRequest");function Kp(t){if(!Ve(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Uc(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(Kp,"willEmitClose");function Xp(t){var e;return!!(t&&((e=t[Oc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Xp,"isDisturbed");function Jp(t){var e,i,r,n,o,a,c,l,u,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[Ac])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(c=t._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(l=t._writableState)===null||l===void 0?void 0:l.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(Jp,"isErrored");Wc.exports={isDestroyed:Yr,kIsDestroyed:Pc,isDisturbed:Xp,kIsDisturbed:Oc,isErrored:Jp,kIsErrored:Ac,isReadable:Bc,kIsReadable:So,kIsClosedPromise:Dp,kControllerErrorFunction:Mp,kIsWritable:Eo,isClosed:Yp,isDuplexNodeStream:Up,isFinished:zp,isIterable:jp,isReadableNodeStream:Vr,isReadableStream:Tc,isReadableEnded:$p,isReadableFinished:Lc,isReadableErrored:Hp,isNodeStream:Ve,isWebStream:Wp,isWritable:Dc,isWritableNodeStream:Hr,isWritableStream:Cc,isWritableEnded:Nc,isWritableFinished:qp,isWritableErrored:Vp,isServerRequest:Gp,isServerResponse:Uc,willEmitClose:Kp,isTransformStream:Rc}});var st=P((x_,Fo)=>{var wt=gt(),{AbortError:Kc,codes:Qp}=re(),{ERR_INVALID_ARG_TYPE:Zp,ERR_STREAM_PREMATURE_CLOSE:jc}=Qp,{kEmptyObject:xo,once:ko}=ee(),{validateAbortSignal:ey,validateFunction:ty,validateObject:iy,validateBoolean:ry}=li(),{Promise:ny,PromisePrototypeThen:oy,SymbolDispose:Xc}=D(),{isClosed:sy,isReadable:qc,isReadableNodeStream:_o,isReadableStream:ay,isReadableFinished:$c,isReadableErrored:zc,isWritable:Vc,isWritableNodeStream:Hc,isWritableStream:cy,isWritableFinished:Yc,isWritableErrored:Gc,isNodeStream:ly,willEmitClose:fy,kIsClosedPromise:uy}=He(),ui;function dy(t){return t.setHeader&&typeof t.abort=="function"}s(dy,"isRequest");var vo=s(()=>{},"nop");function Jc(t,e,i){var r,n;if(arguments.length===2?(i=e,e=xo):e==null?e=xo:iy(e,"options"),ty(i,"callback"),ey(e.signal,"options.signal"),i=ko(i),ay(t)||cy(t))return hy(t,e,i);if(!ly(t))throw new Zp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(r=e.readable)!==null&&r!==void 0?r:_o(t),a=(n=e.writable)!==null&&n!==void 0?n:Hc(t),c=t._writableState,l=t._readableState,u=s(()=>{t.writable||b()},"onlegacyfinish"),d=fy(t)&&_o(t)===o&&Hc(t)===a,h=Yc(t,!1),b=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||m)&&i.call(t)},"onfinish"),m=$c(t,!1),w=s(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=s(V=>{i.call(t,V)},"onerror"),F=sy(t),_=s(()=>{F=!0;let V=Gc(t)||zc(t);if(V&&typeof V!="boolean")return i.call(t,V);if(o&&!m&&_o(t,!0)&&!$c(t,!1))return i.call(t,new jc);if(a&&!h&&!Yc(t,!1))return i.call(t,new jc);i.call(t)},"onclose"),O=s(()=>{F=!0;let V=Gc(t)||zc(t);if(V&&typeof V!="boolean")return i.call(t,V);i.call(t)},"onclosed"),U=s(()=>{t.req.on("finish",b)},"onrequest");dy(t)?(t.on("complete",b),d||t.on("abort",_),t.req?U():t.on("request",U)):a&&!c&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",_),t.on("end",w),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",_),F?wt.nextTick(_):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||wt.nextTick(O):(!o&&(!d||qc(t))&&(h||Vc(t)===!1)||!a&&(!d||Vc(t))&&(m||qc(t)===!1)||l&&t.req&&t.aborted)&&wt.nextTick(O);let I=s(()=>{i=vo,t.removeListener("aborted",_),t.removeListener("complete",b),t.removeListener("abort",_),t.removeListener("request",U),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",_)},"cleanup");if(e.signal&&!F){let V=s(()=>{let kt=i;I(),kt.call(t,new Kc(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)wt.nextTick(V);else{ui=ui||ee().addAbortListener;let kt=ui(e.signal,V),ue=i;i=ko((...Ht)=>{kt[Xc](),ue.apply(t,Ht)})}}return I}s(Jc,"eos");function hy(t,e,i){let r=!1,n=vo;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new Kc(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)wt.nextTick(n);else{ui=ui||ee().addAbortListener;let a=ui(e.signal,n),c=i;i=ko((...l)=>{a[Xc](),c.apply(t,l)})}let o=s((...a)=>{r||wt.nextTick(()=>i.apply(t,a))},"resolverFn");return oy(t[uy].promise,o,o),vo}s(hy,"eosWeb");function py(t,e){var i;let r=!1;return e===null&&(e=xo),(i=e)!==null&&i!==void 0&&i.cleanup&&(ry(e.cleanup,"cleanup"),r=e.cleanup),new ny((n,o)=>{let a=Jc(t,e,c=>{r&&a(),c?o(c):n()})})}s(py,"finished");Fo.exports=Jc;Fo.exports.finished=py});var Dt=P((v_,ol)=>{"use strict";var Ye=gt(),{aggregateTwoErrors:yy,codes:{ERR_MULTIPLE_CALLBACK:my},AbortError:by}=re(),{Symbol:el}=D(),{kIsDestroyed:gy,isDestroyed:wy,isFinished:Sy,isServerRequest:Ey}=He(),tl=el("kDestroy"),Io=el("kConstruct");function il(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(il,"checkError");function _y(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):(il(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Qc(this,t,e):this.once(tl,function(o){Qc(this,yy(o,t),e)}),this)}s(_y,"destroy");function Qc(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,c=t._writableState;il(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ye.nextTick(xy,t,o):Ye.nextTick(rl,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Qc,"_destroy");function xy(t,e){Po(t,e),rl(t)}s(xy,"emitErrorCloseNT");function rl(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(rl,"emitCloseNT");function Po(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(Po,"emitErrorNT");function ky(){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(ky,"undestroy");function Ao(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?Ye.nextTick(Po,t,e):Po(t,e))}s(Ao,"errorOrDestroy");function vy(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(Io,e),!(t.listenerCount(Io)>1)&&Ye.nextTick(Fy,t)}s(vy,"construct");function Fy(t){let e=!1;function i(r){if(e){Ao(t,r??new my);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(tl,r):r?Ao(t,r,!0):Ye.nextTick(Iy,t)}s(i,"onConstruct");try{t._construct(r=>{Ye.nextTick(i,r)})}catch(r){Ye.nextTick(i,r)}}s(Fy,"constructNT");function Iy(t){t.emit(Io)}s(Iy,"emitConstructNT");function Zc(t){return t?.setHeader&&typeof t.abort=="function"}s(Zc,"isRequest");function nl(t){t.emit("close")}s(nl,"emitCloseLegacy");function Py(t,e){t.emit("error",e),Ye.nextTick(nl,t)}s(Py,"emitErrorCloseLegacy");function Ay(t,e){!t||wy(t)||(!e&&!Sy(t)&&(e=new by),Ey(t)?(t.socket=null,t.destroy(e)):Zc(t)?t.abort():Zc(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ye.nextTick(Py,t,e):Ye.nextTick(nl,t),t.destroyed||(t[gy]=!0))}s(Ay,"destroyer");ol.exports={construct:vy,destroyer:Ay,destroy:_y,undestroy:ky,errorOrDestroy:Ao}});var Xr=P((I_,al)=>{"use strict";var{ArrayIsArray:Oy,ObjectSetPrototypeOf:sl}=D(),{EventEmitter:Gr}=Xi();function Kr(t){Gr.call(this,t)}s(Kr,"Stream");sl(Kr.prototype,Gr.prototype);sl(Kr,Gr);Kr.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",c));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function c(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(c,"onclose");function l(d){u(),Gr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Oo(i,"error",l),Oo(t,"error",l);function u(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),t.removeListener("error",l),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 Oo(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):Oy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Oo,"prependListener");al.exports={Stream:Kr,prependListener:Oo}});var Ji=P((A_,Jr)=>{"use strict";var{SymbolDispose:Ty}=D(),{AbortError:cl,codes:Cy}=re(),{isNodeStream:ll,isWebStream:Ry,kControllerErrorFunction:Ny}=He(),Ly=st(),{ERR_INVALID_ARG_TYPE:fl}=Cy,To,By=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new fl(e,"AbortSignal",t)},"validateAbortSignal");Jr.exports.addAbortSignal=s(function(e,i){if(By(e,"signal"),!ll(i)&&!Ry(i))throw new fl("stream",["ReadableStream","WritableStream","Stream"],i);return Jr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Jr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=ll(e)?()=>{e.destroy(new cl(void 0,{cause:t.reason}))}:()=>{e[Ny](new cl(void 0,{cause:t.reason}))};if(t.aborted)i();else{To=To||ee().addAbortListener;let r=To(t,i);Ly(e,r[Ty])}return e}});var hl=P((C_,dl)=>{"use strict";var{StringPrototypeSlice:ul,SymbolIterator:Dy,TypedArrayPrototypeSet:Qr,Uint8Array:My}=D(),{Buffer:Co}=we(),{inspect:Uy}=ee();dl.exports=class{static{s(this,"BufferList")}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 Co.alloc(0);let i=Co.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Qr(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}*[Dy](){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+=ul(o,0,e),this.head=r,r.data=ul(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=Co.allocUnsafe(e),r=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Qr(i,a,r-e),e-=a.length;else{e===a.length?(Qr(i,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Qr(i,new My(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 Uy(this,{...i,depth:0,customInspect:!1})}}});var Qi=P((N_,bl)=>{"use strict";var{MathFloor:Wy,NumberIsInteger:jy}=D(),{validateInteger:qy}=li(),{ERR_INVALID_ARG_VALUE:$y}=re().codes,pl=16*1024,yl=16;function zy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(zy,"highWaterMarkFrom");function ml(t){return t?yl:pl}s(ml,"getDefaultHighWaterMark");function Vy(t,e){qy(e,"value",0),t?yl=e:pl=e}s(Vy,"setDefaultHighWaterMark");function Hy(t,e,i,r){let n=zy(e,r,i);if(n!=null){if(!jy(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new $y(o,n)}return Wy(n)}return ml(t.objectMode)}s(Hy,"getHighWaterMark");bl.exports={getHighWaterMark:Hy,getDefaultHighWaterMark:ml,setDefaultHighWaterMark:Vy}});var Sl=P((Ro,wl)=>{var Zr=we(),Ge=Zr.Buffer;function gl(t,e){for(var i in t)e[i]=t[i]}s(gl,"copyProps");Ge.from&&Ge.alloc&&Ge.allocUnsafe&&Ge.allocUnsafeSlow?wl.exports=Zr:(gl(Zr,Ro),Ro.Buffer=Mt);function Mt(t,e,i){return Ge(t,e,i)}s(Mt,"SafeBuffer");Mt.prototype=Object.create(Ge.prototype);gl(Ge,Mt);Mt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ge(t,e,i)};Mt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ge(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};Mt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ge(t)};Mt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Zr.SlowBuffer(t)}});var xl=P(_l=>{"use strict";var Lo=Sl().Buffer,El=Lo.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 Yy(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(Yy,"_normalizeEncoding");function Gy(t){var e=Yy(t);if(typeof e!="string"&&(Lo.isEncoding===El||!El(t)))throw new Error("Unknown encoding: "+t);return e||t}s(Gy,"normalizeEncoding");_l.StringDecoder=Zi;function Zi(t){this.encoding=Gy(t);var e;switch(this.encoding){case"utf16le":this.text=em,this.end=tm,e=4;break;case"utf8":this.fillLast=Jy,e=4;break;case"base64":this.text=im,this.end=rm,e=3;break;default:this.write=nm,this.end=om;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Lo.allocUnsafe(e)}s(Zi,"StringDecoder");Zi.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||""};Zi.prototype.end=Zy;Zi.prototype.text=Qy;Zi.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 No(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(No,"utf8CheckByte");function Ky(t,e,i){var r=e.length-1;if(r<i)return 0;var n=No(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=No(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=No(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(Ky,"utf8CheckIncomplete");function Xy(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(Xy,"utf8CheckExtraBytes");function Jy(t){var e=this.lastTotal-this.lastNeed,i=Xy(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(Jy,"utf8FillLast");function Qy(t,e){var i=Ky(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(Qy,"utf8Text");function Zy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Zy,"utf8End");function em(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(em,"utf16Text");function tm(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(tm,"utf16End");function im(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(im,"base64Text");function rm(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(rm,"base64End");function nm(t){return t.toString(this.encoding)}s(nm,"simpleWrite");function om(t){return t&&t.length?this.write(t):""}s(om,"simpleEnd")});var Bo=P((U_,Il)=>{"use strict";var kl=gt(),{PromisePrototypeThen:sm,SymbolAsyncIterator:vl,SymbolIterator:Fl}=D(),{Buffer:am}=we(),{ERR_INVALID_ARG_TYPE:cm,ERR_STREAM_NULL_VALUES:lm}=re().codes;function fm(t,e,i){let r;if(typeof e=="string"||e instanceof am)return new t({objectMode:!0,...i,read:s(function(){this.push(e),this.push(null)},"read")});let n;if(e&&e[vl])n=!0,r=e[vl]();else if(e&&e[Fl])n=!1,r=e[Fl]();else throw new cm("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(u,d){sm(c(u),()=>kl.nextTick(d,u),h=>kl.nextTick(d,h||u))};async function c(u){let d=u!=null,h=typeof r.throw=="function";if(d&&h){let{value:b,done:m}=await r.throw(u);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}s(c,"close");async function l(){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 lm;if(o.push(h))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(l,"next"),o}s(fm,"from");Il.exports=fm});var tr=P((j_,Vl)=>{var ke=gt(),{ArrayPrototypeIndexOf:um,NumberIsInteger:dm,NumberIsNaN:hm,NumberParseInt:pm,ObjectDefineProperties:zo,ObjectKeys:ym,ObjectSetPrototypeOf:Ol,Promise:Tl,SafeSet:mm,SymbolAsyncDispose:bm,SymbolAsyncIterator:gm,Symbol:wm}=D();Vl.exports=x;x.ReadableState=nn;var{EventEmitter:Sm}=Xi(),{Stream:St,prependListener:Em}=Xr(),{Buffer:Do}=we(),{addAbortSignal:_m}=Ji(),Cl=st(),v=ee().debuglog("stream",t=>{v=t}),xm=hl(),pi=Dt(),{getHighWaterMark:km,getDefaultHighWaterMark:vm}=Qi(),{aggregateTwoErrors:Pl,codes:{ERR_INVALID_ARG_TYPE:Fm,ERR_METHOD_NOT_IMPLEMENTED:Im,ERR_OUT_OF_RANGE:Pm,ERR_STREAM_PUSH_AFTER_EOF:Am,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Om},AbortError:Tm}=re(),{validateObject:Cm}=li(),Ut=wm("kPaused"),{StringDecoder:Rl}=xl(),Rm=Bo();Ol(x.prototype,St.prototype);Ol(x,St);var Mo=s(()=>{},"nop"),{errorOrDestroy:di}=pi,hi=1,Nm=2,Nl=4,er=8,Ll=16,en=32,tn=64,Bl=128,Lm=256,Bm=512,Dm=1024,qo=2048,$o=4096,Mm=8192,Um=16384,Wm=32768,Dl=65536,jm=1<<17,qm=1<<18;function G(t){return{enumerable:!1,get:s(function(){return(this.state&t)!==0},"get"),set:s(function(e){e?this.state|=t:this.state&=~t},"set")}}s(G,"makeBitMapDescriptor");zo(nn.prototype,{objectMode:G(hi),ended:G(Nm),endEmitted:G(Nl),reading:G(er),constructed:G(Ll),sync:G(en),needReadable:G(tn),emittedReadable:G(Bl),readableListening:G(Lm),resumeScheduled:G(Bm),errorEmitted:G(Dm),emitClose:G(qo),autoDestroy:G($o),destroyed:G(Mm),closed:G(Um),closeEmitted:G(Wm),multiAwaitDrain:G(Dl),readingMore:G(jm),dataEmitted:G(qm)});function nn(t,e,i){typeof i!="boolean"&&(i=e instanceof Ke()),this.state=qo|$o|Ll|en,t&&t.objectMode&&(this.state|=hi),i&&t&&t.readableObjectMode&&(this.state|=hi),this.highWaterMark=t?km(this,t,"readableHighWaterMark",i):vm(!1),this.buffer=new xm,this.length=0,this.pipes=[],this.flowing=null,this[Ut]=null,t&&t.emitClose===!1&&(this.state&=~qo),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 Rl(t.encoding),this.encoding=t.encoding)}s(nn,"ReadableState");function x(t){if(!(this instanceof x))return new x(t);let e=this instanceof Ke();this._readableState=new nn(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&&_m(t.signal,this)),St.call(this,t),pi.construct(this,()=>{this._readableState.needReadable&&rn(this,this._readableState)})}s(x,"Readable");x.prototype.destroy=pi.destroy;x.prototype._undestroy=pi.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[Sm.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype[bm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Tm,this.destroy(t)),new Tl((e,i)=>Cl(this,r=>r&&r!==t?i(r):e(null)))};x.prototype.push=function(t,e){return Ml(this,t,e,!1)};x.prototype.unshift=function(t,e){return Ml(this,t,e,!0)};function Ml(t,e,i,r){v("readableAddChunk",e);let n=t._readableState,o;if(n.state&hi||(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="":St._isUint8Array(e)?(e=St._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new Fm("chunk",["string","Buffer","Uint8Array"],e))),o)di(t,o);else if(e===null)n.state&=~er,Vm(t,n);else if(n.state&hi||e&&e.length>0)if(r)if(n.state&Nl)di(t,new Om);else{if(n.destroyed||n.errored)return!1;Uo(t,n,e,!0)}else if(n.ended)di(t,new Am);else{if(n.destroyed||n.errored)return!1;n.state&=~er,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Uo(t,n,e,!1):rn(t,n)):Uo(t,n,e,!1)}else r||(n.state&=~er,rn(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Ml,"readableAddChunk");function Uo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Dl?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&tn&&on(t)),rn(t,e)}s(Uo,"addChunk");x.prototype.isPaused=function(){let t=this._readableState;return t[Ut]===!0||t.flowing===!1};x.prototype.setEncoding=function(t){let e=new Rl(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 $m=1073741824;function zm(t){if(t>$m)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(zm,"computeNewHighWaterMark");function Al(t,e){return t<=0||e.length===0&&e.ended?0:e.state&hi?1:hm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(Al,"howMuchToRead");x.prototype.read=function(t){v("read",t),t===void 0?t=NaN:dm(t)||(t=pm(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=zm(t)),t!==0&&(e.state&=~Bl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return v("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Wo(this):on(this),null;if(t=Al(t,e),t===0&&e.ended)return e.length===0&&Wo(this),null;let r=(e.state&tn)!==0;if(v("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,v("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,v("reading, ended or constructing",r);else if(r){v("do read"),e.state|=er|en,e.length===0&&(e.state|=tn);try{this._read(e.highWaterMark)}catch(o){di(this,o)}e.state&=~en,e.reading||(t=Al(i,e))}let n;return t>0?n=$l(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&&Wo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Vm(t,e){if(v("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?on(t):(e.needReadable=!1,e.emittedReadable=!0,Ul(t))}}s(Vm,"onEofChunk");function on(t){let e=t._readableState;v("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(v("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(Ul,t))}s(on,"emitReadable");function Ul(t){let e=t._readableState;v("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,jl(t)}s(Ul,"emitReadable_");function rn(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick(Hm,t,e))}s(rn,"maybeReadMore");function Hm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(v("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Hm,"maybeReadMore_");x.prototype._read=function(t){throw new Im("_read()")};x.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new mm(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),v("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?c:F;r.endEmitted?ke.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(_,O){v("onunpipe"),_===i&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){v("onend"),t.end()}s(c,"onend");let l,u=!1;function d(){v("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",F),i.removeListener("data",b),u=!0,l&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}s(d,"cleanup");function h(){u||(r.pipes.length===1&&r.pipes[0]===t?(v("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(v("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),l||(l=Ym(i,t),t.on("drain",l))}s(h,"pause"),i.on("data",b);function b(_){v("ondata");let O=t.write(_);v("dest.write",O),O===!1&&h()}s(b,"ondata");function m(_){if(v("onerror",_),F(),t.removeListener("error",m),t.listenerCount("error")===0){let O=t._writableState||t._readableState;O&&!O.errorEmitted?di(t,_):t.emit("error",_)}}s(m,"onerror"),Em(t,"error",m);function w(){t.removeListener("finish",g),F()}s(w,"onclose"),t.once("close",w);function g(){v("onfinish"),t.removeListener("close",w),F()}s(g,"onfinish"),t.once("finish",g);function F(){v("unpipe"),i.unpipe(t)}return s(F,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(v("pipe resume"),i.resume()),t};function Ym(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(v("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(v("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Ym,"pipeOnDrain");x.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=um(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};x.prototype.on=function(t,e){let i=St.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,v("on readable",r.length,r.reading),r.length?on(this):r.reading||ke.nextTick(Gm,this)),i};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let i=St.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(Wl,this),i};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=St.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(Wl,this),e};function Wl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ut]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Wl,"updateReadableListening");function Gm(t){v("readable nexttick read 0"),t.read(0)}s(Gm,"nReadingNextTick");x.prototype.resume=function(){let t=this._readableState;return t.flowing||(v("resume"),t.flowing=!t.readableListening,Km(this,t)),t[Ut]=!1,this};function Km(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Xm,t,e))}s(Km,"resume");function Xm(t,e){v("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),jl(t),e.flowing&&!e.reading&&t.read(0)}s(Xm,"resume_");x.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ut]=!0,this};function jl(t){let e=t._readableState;for(v("flow",e.flowing);e.flowing&&t.read()!==null;);}s(jl,"flow");x.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=>{di(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=ym(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};x.prototype[gm]=function(){return ql(this)};x.prototype.iterator=function(t){return t!==void 0&&Cm(t,"options"),ql(this,t)};function ql(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let i=Jm(t,e);return i.stream=t,i}s(ql,"streamToAsyncIterator");async function*Jm(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=Cl(t,{writable:!1},a=>{n=a?Pl(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 Tl(r)}}}catch(a){throw n=Pl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?pi.destroyer(t,null):(t.off("readable",r),o())}}s(Jm,"createAsyncIterator");zo(x.prototype,{readable:{__proto__:null,get:s(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:s(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});zo(nn.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Ut]!==!1},"get"),set:s(function(t){this[Ut]=!!t},"set")}});x._fromList=$l;function $l(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($l,"fromList");function Wo(t){let e=t._readableState;v("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Qm,e,t))}s(Wo,"endReadable");function Qm(t,e){if(v("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(Zm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Qm,"endReadableNT");function Zm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Zm,"endWritableNT");x.from=function(t,e){return Rm(x,t,e)};var jo;function zl(){return jo===void 0&&(jo={}),jo}s(zl,"lazyWebStreams");x.fromWeb=function(t,e){return zl().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return zl().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var i,r;return new x({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:s(function(n,o){pi.destroyer(t,n),o(n)},"destroy")}).wrap(t)}});var fn=P(($_,nf)=>{var Wt=gt(),{ArrayPrototypeSlice:Gl,Error:eb,FunctionPrototypeSymbolHasInstance:Kl,ObjectDefineProperty:Xl,ObjectDefineProperties:tb,ObjectSetPrototypeOf:Jl,StringPrototypeToLowerCase:ib,Symbol:rb,SymbolHasInstance:nb}=D();nf.exports=M;M.WritableState=nr;var{EventEmitter:ob}=Xi(),ir=Xr().Stream,{Buffer:sn}=we(),ln=Dt(),{addAbortSignal:sb}=Ji(),{getHighWaterMark:ab,getDefaultHighWaterMark:cb}=Qi(),{ERR_INVALID_ARG_TYPE:lb,ERR_METHOD_NOT_IMPLEMENTED:fb,ERR_MULTIPLE_CALLBACK:Ql,ERR_STREAM_CANNOT_PIPE:ub,ERR_STREAM_DESTROYED:rr,ERR_STREAM_ALREADY_FINISHED:db,ERR_STREAM_NULL_VALUES:hb,ERR_STREAM_WRITE_AFTER_END:pb,ERR_UNKNOWN_ENCODING:Zl}=re().codes,{errorOrDestroy:yi}=ln;Jl(M.prototype,ir.prototype);Jl(M,ir);function Yo(){}s(Yo,"nop");var mi=rb("kOnFinished");function nr(t,e,i){typeof i!="boolean"&&(i=e instanceof Ke()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?ab(this,t,"writableHighWaterMark",i):cb(!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=mb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,cn(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[mi]=[]}s(nr,"WritableState");function cn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(cn,"resetBuffer");nr.prototype.getBuffer=s(function(){return Gl(this.buffered,this.bufferedIndex)},"getBuffer");Xl(nr.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function M(t){let e=this instanceof Ke();if(!e&&!Kl(M,this))return new M(t);this._writableState=new nr(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&&sb(t.signal,this)),ir.call(this,t),ln.construct(this,()=>{let i=this._writableState;i.writing||Ko(this,i),Xo(this,i)})}s(M,"Writable");Xl(M,nb,{__proto__:null,value:s(function(t){return Kl(this,t)?!0:this!==M?!1:t&&t._writableState instanceof nr},"value")});M.prototype.pipe=function(){yi(this,new ub)};function ef(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"&&!sn.isEncoding(i))throw new Zl(i);typeof r!="function"&&(r=Yo)}if(e===null)throw new hb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=sn.from(e,i),i="buffer");else if(e instanceof sn)i="buffer";else if(ir._isUint8Array(e))e=ir._uint8ArrayToBuffer(e),i="buffer";else throw new lb("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new pb:n.destroyed&&(o=new rr("write")),o?(Wt.nextTick(r,o),yi(t,o,!0),o):(n.pendingcb++,yb(t,n,e,i,r))}s(ef,"_write");M.prototype.write=function(t,e,i){return ef(this,t,e,i)===!0};M.prototype.cork=function(){this._writableState.corked++};M.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ko(this,t))};M.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=ib(e)),!sn.isEncoding(e))throw new Zl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function yb(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!==Yo&&(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(yb,"writeOrBuffer");function Hl(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new rr("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(Hl,"doWrite");function Yl(t,e,i,r){--e.pendingcb,r(i),Go(e),yi(t,i)}s(Yl,"onwriteError");function mb(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){yi(t,new Ql);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?Wt.nextTick(Yl,t,i,e,n):Yl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Ko(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},Wt.nextTick(bb,i.afterWriteTickInfo)):tf(t,i,1,n))}s(mb,"onwrite");function bb({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,tf(t,e,i,r)}s(bb,"afterWriteTick");function tf(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(tf,"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],c=t.objectMode?1:o.length;t.length-=c,a((e=t.errored)!==null&&e!==void 0?e:new rr("write"))}let i=t[mi].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new rr("end"))}cn(t)}s(Go,"errorBuffer");function Ko(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 c=e.allNoop?Yo:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},l=e.allNoop&&a===0?i:Gl(i,a);l.allBuffers=e.allBuffers,Hl(t,e,!0,e.length,l,"",c),cn(e)}else{do{let{chunk:c,encoding:l,callback:u}=i[a];i[a++]=null;let d=n?1:c.length;Hl(t,e,!1,d,c,l,u)}while(a<i.length&&!e.writing);a===i.length?cn(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Ko,"clearBuffer");M.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new fb("_write()")};M.prototype._writev=null;M.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=ef(this,t,e);o instanceof eb&&(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 db("end"):r.destroyed&&(n=new rr("end"))),typeof i=="function"&&(n||r.finished?Wt.nextTick(i,n):r[mi].push(i)),this};function an(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(an,"needFinish");function gb(t,e){let i=!1;function r(n){if(i){yi(t,n??Ql());return}if(i=!0,e.pendingcb--,n){let o=e[mi].splice(0);for(let a=0;a<o.length;a++)o[a](n);yi(t,n,e.sync)}else an(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Wt.nextTick(Ho,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(gb,"callFinal");function wb(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,gb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(wb,"prefinish");function Xo(t,e,i){an(e)&&(wb(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Wt.nextTick((r,n)=>{an(n)?Ho(r,n):n.pendingcb--},t,e)):an(e)&&(e.pendingcb++,Ho(t,e))))}s(Xo,"finishMaybe");function Ho(t,e){e.pendingcb--,e.finished=!0;let i=e[mi].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");tb(M.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:s(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:s(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var Sb=ln.destroy;M.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[mi].length)&&Wt.nextTick(Go,i),Sb.call(this,t,e),this};M.prototype._undestroy=ln.undestroy;M.prototype._destroy=function(t,e){e(t)};M.prototype[ob.captureRejectionSymbol]=function(t){this.destroy(t)};var Vo;function rf(){return Vo===void 0&&(Vo={}),Vo}s(rf,"lazyWebStreams");M.fromWeb=function(t,e){return rf().newStreamWritableFromWritableStream(t,e)};M.toWeb=function(t){return rf().newWritableStreamFromStreamWritable(t)}});var wf=P((V_,gf)=>{var Jo=gt(),Eb=we(),{isReadable:_b,isWritable:xb,isIterable:of,isNodeStream:kb,isReadableNodeStream:sf,isWritableNodeStream:af,isDuplexNodeStream:vb,isReadableStream:cf,isWritableStream:lf}=He(),ff=st(),{AbortError:mf,codes:{ERR_INVALID_ARG_TYPE:Fb,ERR_INVALID_RETURN_VALUE:uf}}=re(),{destroyer:gi}=Dt(),Ib=Ke(),bf=tr(),Pb=fn(),{createDeferredPromise:df}=ee(),hf=Bo(),pf=globalThis.Blob||Eb.Blob,Ab=s(typeof pf<"u"?function(e){return e instanceof pf}:function(e){return!1},"isBlob"),Ob=globalThis.AbortController||si().AbortController,{FunctionPrototypeCall:yf}=D(),Et=class extends Ib{static{s(this,"Duplexify")}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)}};gf.exports=s(function t(e,i){if(vb(e))return e;if(sf(e))return bi({readable:e});if(af(e))return bi({writable:e});if(kb(e))return bi({writable:!1,readable:!1});if(cf(e))return bi({readable:bf.fromWeb(e)});if(lf(e))return bi({writable:Pb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:c}=Tb(e);if(of(n))return hf(Et,n,{objectMode:!0,write:o,final:a,destroy:c});let l=n?.then;if(typeof l=="function"){let u,d=yf(l,n,h=>{if(h!=null)throw new uf("nully","body",h)},h=>{gi(u,h)});return u=new Et({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,Jo.nextTick(h,null)}catch(b){Jo.nextTick(h,b)}})},"final"),destroy:c})}throw new uf("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Ab(e))return t(e.arrayBuffer());if(of(e))return hf(Et,e,{objectMode:!0,writable:!1});if(cf(e?.readable)&&lf(e?.writable))return Et.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?sf(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?af(e?.writable)?e?.writable:t(e.writable):void 0;return bi({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return yf(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{gi(n,o)}),n=new Et({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new Fb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function Tb(t){let{promise:e,resolve:i}=df(),r=new Ob,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:c,done:l,cb:u}=await a;if(Jo.nextTick(u),l)return;if(n.aborted)throw new mf(void 0,{cause:n.reason});({promise:e,resolve:i}=df()),yield c}}(),{signal:n}),write:s(function(a,c,l){let u=i;i=null,u({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){r.abort(),c(a)},"destroy")}}s(Tb,"fromAsyncGen");function bi(t){let e=t.readable&&typeof t.readable.read!="function"?bf.wrap(t.readable):t.readable,i=t.writable,r=!!_b(e),n=!!xb(i),o,a,c,l,u;function d(h){let b=l;l=null,b?b(h):h&&u.destroy(h)}return s(d,"onfinished"),u=new Et({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(ff(i,h=>{n=!1,h&&gi(e,h),d(h)}),u._write=function(h,b,m){i.write(h,b)?m():o=m},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&&(ff(e,h=>{r=!1,h&&gi(e,h),d(h)}),e.on("readable",function(){if(c){let h=c;c=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){c=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,b){!h&&l!==null&&(h=new mf),c=null,o=null,a=null,l===null?b(h):(l=b,gi(i,h),gi(e,h))},u}s(bi,"_duplexify")});var Ke=P((Y_,_f)=>{"use strict";var{ObjectDefineProperties:Cb,ObjectGetOwnPropertyDescriptor:at,ObjectKeys:Rb,ObjectSetPrototypeOf:Sf}=D();_f.exports=ve;var es=tr(),_e=fn();Sf(ve.prototype,es.prototype);Sf(ve,es);{let t=Rb(_e.prototype);for(let e=0;e<t.length;e++){let i=t[e];ve.prototype[i]||(ve.prototype[i]=_e.prototype[i])}}function ve(t){if(!(this instanceof ve))return new ve(t);es.call(this,t),_e.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(ve,"Duplex");Cb(ve.prototype,{writable:{__proto__:null,...at(_e.prototype,"writable")},writableHighWaterMark:{__proto__:null,...at(_e.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...at(_e.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...at(_e.prototype,"writableBuffer")},writableLength:{__proto__:null,...at(_e.prototype,"writableLength")},writableFinished:{__proto__:null,...at(_e.prototype,"writableFinished")},writableCorked:{__proto__:null,...at(_e.prototype,"writableCorked")},writableEnded:{__proto__:null,...at(_e.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...at(_e.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var Qo;function Ef(){return Qo===void 0&&(Qo={}),Qo}s(Ef,"lazyWebStreams");ve.fromWeb=function(t,e){return Ef().newStreamDuplexFromReadableWritablePair(t,e)};ve.toWeb=function(t){return Ef().newReadableWritablePairFromDuplex(t)};var Zo;ve.from=function(t){return Zo||(Zo=wf()),Zo(t,"body")}});var rs=P((K_,kf)=>{"use strict";var{ObjectSetPrototypeOf:xf,Symbol:Nb}=D();kf.exports=ct;var{ERR_METHOD_NOT_IMPLEMENTED:Lb}=re().codes,is=Ke(),{getHighWaterMark:Bb}=Qi();xf(ct.prototype,is.prototype);xf(ct,is);var or=Nb("kCallback");function ct(t){if(!(this instanceof ct))return new ct(t);let e=t?Bb(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[or]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Db)}s(ct,"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 Db(){this._final!==ts&&ts.call(this)}s(Db,"prefinish");ct.prototype._final=ts;ct.prototype._transform=function(t,e,i){throw new Lb("_transform()")};ct.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),n.ended||o===r.length||r.length<r.highWaterMark?i():this[or]=i})};ct.prototype._read=function(){if(this[or]){let t=this[or];this[or]=null,t()}}});var os=P((J_,Ff)=>{"use strict";var{ObjectSetPrototypeOf:vf}=D();Ff.exports=wi;var ns=rs();vf(wi.prototype,ns.prototype);vf(wi,ns);function wi(t){if(!(this instanceof wi))return new wi(t);ns.call(this,t)}s(wi,"PassThrough");wi.prototype._transform=function(t,e,i){i(null,t)}});var pn=P((Z_,Tf)=>{var sr=gt(),{ArrayIsArray:Mb,Promise:Ub,SymbolAsyncIterator:Wb,SymbolDispose:jb}=D(),hn=st(),{once:qb}=ee(),$b=Dt(),If=Ke(),{aggregateTwoErrors:zb,codes:{ERR_INVALID_ARG_TYPE:ps,ERR_INVALID_RETURN_VALUE:ss,ERR_MISSING_ARGS:Vb,ERR_STREAM_DESTROYED:Hb,ERR_STREAM_PREMATURE_CLOSE:Yb},AbortError:Gb}=re(),{validateFunction:Kb,validateAbortSignal:Xb}=li(),{isIterable:jt,isReadable:as,isReadableNodeStream:dn,isNodeStream:Pf,isTransformStream:Si,isWebStream:Jb,isReadableStream:cs,isReadableFinished:Qb}=He(),Zb=globalThis.AbortController||si().AbortController,ls,fs,us;function Af(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=hn(t,{readable:e,writable:i},o=>{r=!o});return{destroy:s(o=>{r||(r=!0,$b.destroyer(t,o||new Hb("pipe")))},"destroy"),cleanup:n}}s(Af,"destroyer");function eg(t){return Kb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(eg,"popCallback");function ds(t){if(jt(t))return t;if(dn(t))return tg(t);throw new ps("val",["Readable","Iterable","AsyncIterable"],t)}s(ds,"makeAsyncIterable");async function*tg(t){fs||(fs=tr()),yield*fs.prototype[Wb].call(t)}s(tg,"fromReadable");async function un(t,e,i,{end:r}){let n,o=null,a=s(u=>{if(u&&(n=u),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Ub((u,d)=>{n?d(n):o=s(()=>{n?d(n):u()},"onresolve")}),"wait");e.on("drain",a);let l=hn(e,{readable:!1},a);try{e.writableNeedDrain&&await c();for await(let u of t)e.write(u)||await c();r&&(e.end(),await c()),i()}catch(u){i(n!==u?zb(n,u):u)}finally{l(),e.off("drain",a)}}s(un,"pumpToNode");async function hs(t,e,i,{end:r}){Si(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 ig(...t){return Of(t,qb(eg(t)))}s(ig,"pipeline");function Of(t,e,i){if(t.length===1&&Mb(t[0])&&(t=t[0]),t.length<2)throw new Vb("streams");let r=new Zb,n=r.signal,o=i?.signal,a=[];Xb(o,"options.signal");function c(){w(new Gb)}s(c,"abort"),us=us||ee().addAbortListener;let l;o&&(l=us(o,c));let u,d,h=[],b=0;function m(U){w(U,--b===0)}s(m,"finish");function w(U,I){var V;if(U&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=U),!(!u&&!I)){for(;h.length;)h.shift()(u);(V=l)===null||V===void 0||V[jb](),r.abort(),I&&(u||a.forEach(kt=>kt()),sr.nextTick(e,u,d))}}s(w,"finishImpl");let g;for(let U=0;U<t.length;U++){let I=t[U],V=U<t.length-1,kt=U>0,ue=V||i?.end!==!1,Ht=U===t.length-1;if(Pf(I)){let ne=function(Je){Je&&Je.name!=="AbortError"&&Je.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Je)};var O=ne;if(s(ne,"onError"),ue){let{destroy:Je,cleanup:In}=Af(I,V,kt);h.push(Je),as(I)&&Ht&&a.push(In)}I.on("error",ne),as(I)&&Ht&&a.push(()=>{I.removeListener("error",ne)})}if(U===0)if(typeof I=="function"){if(g=I({signal:n}),!jt(g))throw new ss("Iterable, AsyncIterable or Stream","source",g)}else jt(I)||dn(I)||Si(I)?g=I:g=If.from(I);else if(typeof I=="function"){if(Si(g)){var F;g=ds((F=g)===null||F===void 0?void 0:F.readable)}else g=ds(g);if(g=I(g,{signal:n}),V){if(!jt(g,!0))throw new ss("AsyncIterable",`transform[${U-1}]`,g)}else{var _;ls||(ls=os());let ne=new ls({objectMode:!0}),Je=(_=g)===null||_===void 0?void 0:_.then;if(typeof Je=="function")b++,Je.call(g,ft=>{d=ft,ft!=null&&ne.write(ft),ue&&ne.end(),sr.nextTick(m)},ft=>{ne.destroy(ft),sr.nextTick(m,ft)});else if(jt(g,!0))b++,un(g,ne,m,{end:ue});else if(cs(g)||Si(g)){let ft=g.readable||g;b++,un(ft,ne,m,{end:ue})}else throw new ss("AsyncIterable or Promise","destination",g);g=ne;let{destroy:In,cleanup:Zu}=Af(g,!1,!0);h.push(In),Ht&&a.push(Zu)}}else if(Pf(I)){if(dn(g)){b+=2;let ne=rg(g,I,m,{end:ue});as(I)&&Ht&&a.push(ne)}else if(Si(g)||cs(g)){let ne=g.readable||g;b++,un(ne,I,m,{end:ue})}else if(jt(g))b++,un(g,I,m,{end:ue});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else if(Jb(I)){if(dn(g))b++,hs(ds(g),I,m,{end:ue});else if(cs(g)||jt(g))b++,hs(g,I,m,{end:ue});else if(Si(g))b++,hs(g.readable,I,m,{end:ue});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else g=If.from(I)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&sr.nextTick(c),g}s(Of,"pipelineImpl");function rg(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Yb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Qb(t)?sr.nextTick(a):t.once("end",a)}else i();return hn(t,{readable:!0,writable:!1},a=>{let c=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?t.once("end",i).once("error",i):i(a)}),hn(e,{readable:!1,writable:!0},i)}s(rg,"pipe");Tf.exports={pipelineImpl:Of,pipeline:ig}});var ms=P((tx,Df)=>{"use strict";var{pipeline:ng}=pn(),yn=Ke(),{destroyer:og}=Dt(),{isNodeStream:mn,isReadable:Cf,isWritable:Rf,isWebStream:ys,isTransformStream:qt,isWritableStream:Nf,isReadableStream:Lf}=He(),{AbortError:sg,codes:{ERR_INVALID_ARG_VALUE:Bf,ERR_MISSING_ARGS:ag}}=re(),cg=st();Df.exports=s(function(...e){if(e.length===0)throw new ag("streams");if(e.length===1)return yn.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=yn.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=yn.from(e[m])}for(let m=0;m<e.length;++m)if(!(!mn(e[m])&&!ys(e[m]))){if(m<e.length-1&&!(Cf(e[m])||Lf(e[m])||qt(e[m])))throw new Bf(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(Rf(e[m])||Nf(e[m])||qt(e[m])))throw new Bf(`streams[${m}]`,i[m],"must be writable")}let r,n,o,a,c;function l(m){let w=a;a=null,w?w(m):m?c.destroy(m):!b&&!h&&c.destroy()}s(l,"onfinished");let u=e[0],d=ng(e,l),h=!!(Rf(u)||Nf(u)||qt(u)),b=!!(Cf(d)||Lf(d)||qt(d));if(c=new yn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(mn(u))c._write=function(w,g,F){u.write(w,g)?F():r=F},c._final=function(w){u.end(),n=w},u.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ys(u)){let g=(qt(u)?u.writable:u).getWriter();c._write=async function(F,_,O){try{await g.ready,g.write(F).catch(()=>{}),O()}catch(U){O(U)}},c._final=async function(F){try{await g.ready,g.close().catch(()=>{}),n=F}catch(_){F(_)}}}let m=qt(d)?d.readable:d;cg(m,()=>{if(n){let w=n;n=null,w()}})}if(b){if(mn(d))d.on("readable",function(){if(o){let m=o;o=null,m()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let m=d.read();if(m===null){o=c._read;return}if(!c.push(m))return}};else if(ys(d)){let w=(qt(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:F}=await w.read();if(!c.push(g))return;if(F){c.push(null);return}}catch{return}}}}return c._destroy=function(m,w){!m&&a!==null&&(m=new sg),o=null,r=null,n=null,a===null?w(m):(a=w,mn(d)&&og(d,m))},c},"compose")});var Yf=P((rx,ws)=>{"use strict";var lg=globalThis.AbortController||si().AbortController,{codes:{ERR_INVALID_ARG_VALUE:fg,ERR_INVALID_ARG_TYPE:ar,ERR_MISSING_ARGS:ug,ERR_OUT_OF_RANGE:dg},AbortError:Xe}=re(),{validateAbortSignal:$t,validateInteger:Mf,validateObject:zt}=li(),hg=D().Symbol("kWeak"),pg=D().Symbol("kResistStopPropagation"),{finished:yg}=st(),mg=ms(),{addAbortSignalNoValidate:bg}=Ji(),{isWritable:gg,isNodeStream:wg}=He(),{deprecate:Sg}=ee(),{ArrayPrototypePush:Eg,Boolean:_g,MathFloor:Uf,Number:xg,NumberIsNaN:kg,Promise:Wf,PromiseReject:jf,PromiseResolve:vg,PromisePrototypeThen:qf,Symbol:zf}=D(),bn=zf("kEmpty"),$f=zf("kEof");function Fg(t,e){if(e!=null&&zt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),wg(t)&&!gg(t))throw new fg("stream",t,"must be writable");let i=mg(this,t);return e!=null&&e.signal&&bg(e.signal,i),i}s(Fg,"compose");function gn(t,e){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);e!=null&&zt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Uf(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Uf(e.highWaterMark)),Mf(i,"options.concurrency",1),Mf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=ee().AbortSignalAny([e?.signal].filter(_g)),a=this,c=[],l={signal:o},u,d,h=!1,b=0;function m(){h=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<r&&(d(),d=null)}s(g,"maybeResume");async function F(){try{for await(let _ of a){if(h)return;if(o.aborted)throw new Xe;try{if(_=t(_,l),_===bn)continue;_=vg(_)}catch(O){_=jf(O)}b+=1,qf(_,w,m),c.push(_),u&&(u(),u=null),!h&&(c.length>=r||b>=i)&&await new Wf(O=>{d=O})}c.push($f)}catch(_){let O=jf(_);qf(O,w,m),c.push(O)}finally{h=!0,u&&(u(),u=null)}}s(F,"pump"),F();try{for(;;){for(;c.length>0;){let _=await c[0];if(_===$f)return;if(o.aborted)throw new Xe;_!==bn&&(yield _),c.shift(),g()}await new Wf(_=>{u=_})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(gn,"map");function Ig(t=void 0){return t!=null&&zt(t,"options"),t?.signal!=null&&$t(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 Xe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(Ig,"asIndexedPairs");async function Vf(t,e=void 0){for await(let i of gs.call(this,t,e))return!0;return!1}s(Vf,"some");async function Pg(t,e=void 0){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);return!await Vf.call(this,async(...i)=>!await t(...i),e)}s(Pg,"every");async function Ag(t,e){for await(let i of gs.call(this,t,e))return i}s(Ag,"find");async function Og(t,e){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),bn}s(i,"forEachFn");for await(let r of gn.call(this,i,e));}s(Og,"forEach");function gs(t,e){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:bn}return s(i,"filterFn"),gn.call(this,i,e)}s(gs,"filter");var bs=class extends ug{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Tg(t,e,i){var r;if(typeof t!="function")throw new ar("reducer",["Function","AsyncFunction"],t);i!=null&&zt(i,"options"),i?.signal!=null&&$t(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let u=new Xe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await yg(this.destroy(u)),u}let o=new lg,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[hg]:this,[pg]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let c=!1;try{for await(let u of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new Xe;n?e=await t(e,u,{signal:a}):(e=u,n=!0)}if(!c&&!n)throw new bs}finally{o.abort()}return e}s(Tg,"reduce");async function Cg(t){t!=null&&zt(t,"options"),t?.signal!=null&&$t(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 Xe(void 0,{cause:t.signal.reason});Eg(e,r)}return e}s(Cg,"toArray");function Rg(t,e){let i=gn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(Rg,"flatMap");function Hf(t){if(t=xg(t),kg(t))return 0;if(t<0)throw new dg("number",">= 0",t);return t}s(Hf,"toIntegerOrInfinity");function Ng(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),t=Hf(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Xe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Xe;t--<=0&&(yield o)}},"drop").call(this)}s(Ng,"drop");function Lg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),t=Hf(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Xe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Xe;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(Lg,"take");ws.exports.streamReturningOperators={asIndexedPairs:Sg(Ig,"readable.asIndexedPairs will be removed in a future version."),drop:Ng,filter:gs,flatMap:Rg,map:gn,take:Lg,compose:Fg};ws.exports.promiseReturningOperators={every:Pg,forEach:Og,reduce:Tg,toArray:Cg,some:Vf,find:Ag}});var Ss=P((ox,Gf)=>{"use strict";var{ArrayPrototypePop:Bg,Promise:Dg}=D(),{isIterable:Mg,isNodeStream:Ug,isWebStream:Wg}=He(),{pipelineImpl:jg}=pn(),{finished:qg}=st();Es();function $g(...t){return new Dg((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Ug(o)&&!Mg(o)&&!Wg(o)){let a=Bg(t);r=a.signal,n=a.end}jg(t,(a,c)=>{a?i(a):e(c)},{signal:r,end:n})})}s($g,"pipeline");Gf.exports={finished:qg,pipeline:$g}});var Es=P((ax,ru)=>{var{Buffer:zg}=we(),{ObjectDefineProperty:lt,ObjectKeys:Jf,ReflectApply:Qf}=D(),{promisify:{custom:Zf}}=ee(),{streamReturningOperators:Kf,promiseReturningOperators:Xf}=Yf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:eu}}=re(),Vg=ms(),{setDefaultHighWaterMark:Hg,getDefaultHighWaterMark:Yg}=Qi(),{pipeline:tu}=pn(),{destroyer:Gg}=Dt(),iu=st(),_s=Ss(),cr=He(),R=ru.exports=Xr().Stream;R.isDestroyed=cr.isDestroyed;R.isDisturbed=cr.isDisturbed;R.isErrored=cr.isErrored;R.isReadable=cr.isReadable;R.isWritable=cr.isWritable;R.Readable=tr();for(let t of Jf(Kf)){let i=function(...r){if(new.target)throw eu();return R.Readable.from(Qf(e,this,r))};xs=i,s(i,"fn");let e=Kf[t];lt(i,"name",{__proto__:null,value:e.name}),lt(i,"length",{__proto__:null,value:e.length}),lt(R.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var xs;for(let t of Jf(Xf)){let i=function(...n){if(new.target)throw eu();return Qf(e,this,n)};xs=i,s(i,"fn");let e=Xf[t];lt(i,"name",{__proto__:null,value:e.name}),lt(i,"length",{__proto__:null,value:e.length}),lt(R.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var xs;R.Writable=fn();R.Duplex=Ke();R.Transform=rs();R.PassThrough=os();R.pipeline=tu;var{addAbortSignal:Kg}=Ji();R.addAbortSignal=Kg;R.finished=iu;R.destroy=Gg;R.compose=Vg;R.setDefaultHighWaterMark=Hg;R.getDefaultHighWaterMark=Yg;lt(R,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return _s},"get")});lt(tu,Zf,{__proto__:null,enumerable:!0,get:s(function(){return _s.pipeline},"get")});lt(iu,Zf,{__proto__:null,enumerable:!0,get:s(function(){return _s.finished},"get")});R.Stream=R;R._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");R._uint8ArrayToBuffer=s(function(e){return zg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var nu=P((lx,z)=>{"use strict";var K=Es(),Xg=Ss(),Jg=K.Readable.destroy;z.exports=K.Readable;z.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer;z.exports._isUint8Array=K._isUint8Array;z.exports.isDisturbed=K.isDisturbed;z.exports.isErrored=K.isErrored;z.exports.isReadable=K.isReadable;z.exports.Readable=K.Readable;z.exports.Writable=K.Writable;z.exports.Duplex=K.Duplex;z.exports.Transform=K.Transform;z.exports.PassThrough=K.PassThrough;z.exports.addAbortSignal=K.addAbortSignal;z.exports.finished=K.finished;z.exports.destroy=K.destroy;z.exports.destroy=Jg;z.exports.pipeline=K.pipeline;z.exports.compose=K.compose;Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get:s(function(){return Xg},"get")});z.exports.Stream=K.Stream;z.exports.default=z.exports});var tw={};pr(tw,{ActionType:()=>mr,Async:()=>Rn,AsyncTransaction:()=>Bn,BigIntStats:()=>ce,BigIntStatsFs:()=>Ai,Dir:()=>bt,Dirent:()=>mt,Errno:()=>N,ErrnoError:()=>f,Fetch:()=>Yd,FetchFS:()=>kr,File:()=>Ft,FileSystem:()=>se,FileType:()=>Z,InMemory:()=>Bi,InMemoryStore:()=>Sr,IndexFS:()=>Mi,Inode:()=>Be,LockedFS:()=>Wi,Mutex:()=>Ui,NoSyncFile:()=>Kt,Overlay:()=>Gd,OverlayFS:()=>ji,Port:()=>qd,PortFS:()=>_r,PortFile:()=>Di,PreloadFile:()=>le,ReadStream:()=>_t,Readonly:()=>Nn,SimpleAsyncStore:()=>Dn,SimpleTransaction:()=>Jt,Stats:()=>Y,StatsCommon:()=>Ii,StatsFs:()=>Pi,StoreFS:()=>Ri,Sync:()=>Ld,SyncTransaction:()=>Li,Transaction:()=>Ni,UnlockedOverlayFS:()=>vr,WriteStream:()=>xt,ZenFsType:()=>Cn,_toUnixTimestamp:()=>Dd,access:()=>Mu,accessSync:()=>$a,appendFile:()=>pu,appendFileSync:()=>Oa,attachFS:()=>Wd,checkOptions:()=>zn,chmod:()=>Ru,chmodSync:()=>Wa,chown:()=>Tu,chownSync:()=>Ma,close:()=>mu,closeSync:()=>rt,configure:()=>Zg,constants:()=>vt,copyFile:()=>Hu,copyFileSync:()=>ao,cp:()=>Xu,cpSync:()=>co,createReadStream:()=>qu,createWriteStream:()=>$u,decode:()=>Xt,decodeDirListing:()=>wr,default:()=>ew,detachFS:()=>jd,encode:()=>xe,encodeDirListing:()=>ye,errorMessages:()=>Pn,exists:()=>su,existsSync:()=>qe,fchmod:()=>xu,fchmodSync:()=>Lr,fchown:()=>_u,fchownSync:()=>Nr,fdatasync:()=>wu,fdatasyncSync:()=>Ra,flagToMode:()=>It,flagToNumber:()=>Td,flagToString:()=>$s,fs:()=>hr,fstat:()=>yu,fstatSync:()=>Ta,fsync:()=>gu,fsyncSync:()=>Ca,ftruncate:()=>bu,ftruncateSync:()=>io,futimes:()=>ku,futimesSync:()=>Br,isAppendable:()=>dt,isBackend:()=>qi,isBackendConfig:()=>Fr,isExclusive:()=>Vs,isReadable:()=>ut,isSynchronous:()=>Cd,isTruncating:()=>zs,isWriteable:()=>pe,lchmod:()=>Nu,lchmodSync:()=>ja,lchown:()=>Cu,lchownSync:()=>Ua,levenshtein:()=>Ln,link:()=>Pu,linkSync:()=>Ba,lopenSync:()=>Gi,lstat:()=>cu,lstatSync:()=>to,lutimes:()=>Bu,lutimesSync:()=>qa,mkdir:()=>Fu,mkdirSync:()=>Dr,mkdirpSync:()=>Ys,mkdtemp:()=>Vu,mkdtempSync:()=>za,mount:()=>Vi,mountObject:()=>Hi,mounts:()=>Se,nop:()=>S,normalizeMode:()=>me,normalizeOptions:()=>be,normalizePath:()=>E,normalizeTime:()=>Pt,open:()=>uu,openAsBlob:()=>Qu,openSync:()=>ni,opendir:()=>Ku,opendirSync:()=>Ya,parseFlag:()=>L,pathExistsAction:()=>Ti,pathNotExistsAction:()=>Ci,promises:()=>dr,randomIno:()=>Oi,read:()=>Eu,readFile:()=>du,readFileSync:()=>Rr,readSync:()=>La,readdir:()=>Iu,readdirSync:()=>oi,readlink:()=>Ou,readlinkSync:()=>no,readv:()=>Yu,readvSync:()=>Va,realpath:()=>Du,realpathSync:()=>je,rename:()=>ou,renameSync:()=>Ia,resolveMountConfig:()=>Ws,rm:()=>zu,rmSync:()=>so,rmdir:()=>vu,rmdirSync:()=>ro,rootCred:()=>Me,rootIno:()=>De,setImmediate:()=>Bd,size_max:()=>he,stat:()=>au,statSync:()=>Yi,statfs:()=>Ju,statfsSync:()=>Ga,symlink:()=>Au,symlinkSync:()=>Da,truncate:()=>lu,truncateSync:()=>Pa,umount:()=>Or,unlink:()=>fu,unlinkSync:()=>Cr,unwatchFile:()=>Wu,utimes:()=>Lu,utimesSync:()=>oo,watch:()=>ju,watchFile:()=>Uu,write:()=>Su,writeFile:()=>hu,writeFileSync:()=>Ki,writeSync:()=>Na,writev:()=>Gu,writevSync:()=>Ha});var N=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EINTR=4]="EINTR",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))(N||{}),Pn={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},f=class t extends Error{constructor(i,r=Pn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=N[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let r=new t(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 t(N[i],Pn[N[i]],r,n)}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}};var vt={};pr(vt,{COPYFILE_EXCL:()=>Fi,COPYFILE_FICLONE:()=>ad,COPYFILE_FICLONE_FORCE:()=>cd,F_OK:()=>vi,O_APPEND:()=>Ce,O_CREAT:()=>X,O_DIRECT:()=>yd,O_DIRECTORY:()=>fd,O_DSYNC:()=>hd,O_EXCL:()=>Oe,O_NOATIME:()=>ud,O_NOCTTY:()=>ld,O_NOFOLLOW:()=>dd,O_NONBLOCK:()=>md,O_RDONLY:()=>Yt,O_RDWR:()=>oe,O_SYMLINK:()=>pd,O_SYNC:()=>Gt,O_TRUNC:()=>Te,O_WRONLY:()=>Ae,R_OK:()=>Pe,S_IFBLK:()=>Ze,S_IFCHR:()=>et,S_IFDIR:()=>Le,S_IFIFO:()=>tt,S_IFLNK:()=>Re,S_IFMT:()=>W,S_IFREG:()=>Ne,S_IFSOCK:()=>Qe,S_IRGRP:()=>xd,S_IROTH:()=>Fd,S_IRUSR:()=>Sd,S_IRWXG:()=>On,S_IRWXO:()=>Tn,S_IRWXU:()=>An,S_ISGID:()=>gd,S_ISUID:()=>bd,S_ISVTX:()=>wd,S_IWGRP:()=>kd,S_IWOTH:()=>Id,S_IWUSR:()=>Ed,S_IXGRP:()=>vd,S_IXOTH:()=>Pd,S_IXUSR:()=>_d,UV_FS_O_FILEMAP:()=>Ad,W_OK:()=>de,X_OK:()=>sd});var vi=0,Pe=4,de=2,sd=1,Fi=1,ad=2,cd=4,Yt=0,Ae=1,oe=2,X=64,Oe=128,ld=256,Te=512,Ce=1024,fd=65536,ud=262144,dd=131072,Gt=1052672,hd=4096,pd=32768,yd=16384,md=2048,W=61440,Qe=49152,Re=40960,Ne=32768,Ze=24576,Le=16384,et=8192,tt=4096,bd=2048,gd=1024,wd=512,An=448,Sd=256,Ed=128,_d=64,On=56,xd=32,kd=16,vd=8,Tn=7,Fd=4,Id=2,Pd=1,Ad=0;var Z=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(Z||{}),Ii=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:c,mode:l,ino:u}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(e??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(r??d),this.birthtimeMs=this._convert(n??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(u??0);let h=Number(l)&61440||Z.FILE;if(l)this.mode=this._convert(l);else switch(h){case Z.FILE:this.mode=this._convert(420);break;case Z.DIRECTORY:default:this.mode=this._convert(511)}this.mode&61440||(this.mode=this.mode|this._convert(h))}static{s(this,"StatsCommon")}_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}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))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}},Y=class extends Ii{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},ce=class extends Ii{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}},Cn=525687744115,Pi=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=he;this.ffree=he}static{s(this,"StatsFs")}},Ai=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(he);this.ffree=BigInt(he)}static{s(this,"BigIntStatsFs")}};var he=2**32-1,De=0n;function qs(){return Math.round(Math.random()*2**32).toString(16)}s(qs,"_random");function Oi(){return BigInt("0x"+qs()+qs())}s(Oi,"randomIno");var Be=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}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=Oi(),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 Y(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}};var mr=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(mr||{}),Od=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return $s(t);if(!Od.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function $s(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($s,"flagToString");function Td(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(Td,"flagToNumber");function It(t){let e=0;return e<<=1,e+=+ut(t),e<<=1,e+=+pe(t),e<<=1,e}s(It,"flagToMode");function ut(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(ut,"isReadable");function pe(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(pe,"isWriteable");function zs(t){return t.indexOf("w")!==-1}s(zs,"isTruncating");function dt(t){return t.indexOf("a")!==-1}s(dt,"isAppendable");function Cd(t){return t.indexOf("s")!==-1}s(Cd,"isSynchronous");function Vs(t){return t.indexOf("x")!==-1}s(Vs,"isExclusive");function Ti(t){return Vs(t)?1:zs(t)?2:0}s(Ti,"pathExistsAction");function Ci(t){return(pe(t)||dt(t))&&t!=="r+"?3:1}s(Ci,"pathNotExistsAction");var Ft=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},le=class extends Ft{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:he}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;if(this.stats.size!=a.byteLength){if(ut(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return dt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new Y(this.stats)}statSync(){return new Y(this.stats)}async truncate(i){return this.truncateSync(i),this.sync()}truncateSync(i){if(this.dirty=!0,!pe(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);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i),this.syncSync()}async write(i,r=0,n=this.stats.size,o=0){let a=this.writeSync(i,r,n,o);return await this.sync(),a}writeSync(i,r=0,n=this.stats.size,o=0){if(this.dirty=!0,o??=this.position,!pe(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,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:he}));u.set(this._buffer),this._buffer=u}let c=i.slice(r,r+n);this._buffer.set(c,o);let l=c.byteLength;return this.stats.mtimeMs=Date.now(),this.position=o+l,this.syncSync(),l}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){if(!ut(this.flag))throw new f(1,"File not opened with a readable mode.");this.dirty=!0,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 c=a-o;return this.syncSync(),c==0||new Uint8Array(i.buffer,r,n).set(this._buffer.slice(o,a)),c}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()}_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()}},Kt=class extends le{static{s(this,"NoSyncFile")}constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};var Me={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Rd="/";function Hs(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let c=0;c<=t.length;++c){if(c<t.length)a=t[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===c-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",r=0):(i=i.slice(0,l),r=i.length-1-i.lastIndexOf("/")),n=c,o=0;continue}else if(i.length!==0){i="",r=0,n=c,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,c):i=t.slice(n+1,c),r=c-n-1;n=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Hs,"normalizeString");function ht(...t){let e="";for(let r of[...t.reverse(),Rd])if(r.length&&(e=`${r}/${e}`,r.startsWith("/")))break;let i=e.startsWith("/");return e=Hs(e,!i),i?`/${e}`:e.length?e:"/"}s(ht,"resolve");function Nd(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=Hs(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}s(Nd,"normalize");function j(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Nd(e):"."}s(j,"join");function A(t){if(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(A,"dirname");function q(t,e){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 c=t.length-1;c>=0;--c)if(t[c]==="/"){if(!n){i=c+1;break}}else a===-1&&(n=!1,a=c+1),o>=0&&(t[c]===e[o]?--o===-1&&(r=c):(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(q,"basename");function br(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let r=e?1:0,n=-1,o=0,a=-1,c=!0,l=t.length-1,u=0;for(;l>=r;--l){if(t[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t[l]==="."?n===-1?n=l: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(br,"parse");var se=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:!1,type:this._type}}constructor(){}async ready(){}async exists(e,i){try{return await this.stat(e,i),!0}catch(r){return r.code!="ENOENT"}}existsSync(e,i){try{return this.statSync(e,i),!0}catch(r){return r.code!="ENOENT"}}};function Ld(t){class e extends t{static{s(this,"_SyncFS")}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 e}s(Ld,"Sync");function Rn(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1;this._disableSync=!1}static{s(this,"_AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let o=s(()=>this._queueRunning?setTimeout(o):n(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}}}metadata(){return{...super.metadata(),noAsyncCache:this._disableSync}}checkSync(n,o){if(this._disableSync)throw new f(95,"Sync caching has been disabled for this async file system",n,o);if(!this._sync)throw new f(95,"No sync cache is attached to this async file system",n,o)}renameSync(n,o,a){this.checkSync(n,"rename"),this._sync.renameSync(n,o,a),this.queue("rename",n,o,a)}statSync(n,o){return this.checkSync(n,"stat"),this._sync.statSync(n,o)}createFileSync(n,o,a,c){return this.checkSync(n,"createFile"),this._sync.createFileSync(n,o,a,c),this.queue("createFile",n,o,a,c),this.openFileSync(n,o,c)}openFileSync(n,o,a){this.checkSync(n,"openFile");let c=this._sync.openFileSync(n,o,a),l=c.statSync(),u=new Uint8Array(l.size);return c.readSync(u),new le(this,n,o,l,u)}unlinkSync(n,o){this.checkSync(n,"unlinkSync"),this._sync.unlinkSync(n,o),this.queue("unlink",n,o)}rmdirSync(n,o){this.checkSync(n,"rmdir"),this._sync.rmdirSync(n,o),this.queue("rmdir",n,o)}mkdirSync(n,o,a){this.checkSync(n,"mkdir"),this._sync.mkdirSync(n,o,a),this.queue("mkdir",n,o,a)}readdirSync(n,o){return this.checkSync(n,"readdir"),this._sync.readdirSync(n,o)}linkSync(n,o,a){this.checkSync(n,"link"),this._sync.linkSync(n,o,a),this.queue("link",n,o,a)}syncSync(n,o,a){this.checkSync(n,"sync"),this._sync.syncSync(n,o,a),this.queue("sync",n,o,a)}existsSync(n,o){return this.checkSync(n,"exists"),this._sync.existsSync(n,o)}async crossCopy(n){this.checkSync(n,"crossCopy");let o=await this.stat(n,Me);if(o.isDirectory()){if(n!=="/"){let c=await this.stat(n,Me);this._sync.mkdirSync(n,c.mode,c.cred())}let a=await this.readdir(n,Me);for(let c of a)await this.crossCopy(j(n,c))}else{let a=await this.openFile(n,L("r"),Me),c=this._sync.createFileSync(n,L("w"),o.mode,o.cred());try{let l=new Uint8Array(o.size);await a.read(l),c.writeSync(l,0,o.size)}finally{await a.close(),c.closeSync()}}}async _next(){if(!this._queueRunning)return;let[n,...o]=this._queue.shift();await this[n](...o),await this._next()}queue(...n){this._queue.push(n),this._next()}}return e}s(Rn,"Async");function Nn(t){class e extends t{static{s(this,"_ReadonlyFS")}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 e}s(Nn,"Readonly");function Ys(t,e,i,r){r.existsSync(t,i)||(Ys(A(t),e,i,r),r.mkdirSync(t,e,i))}s(Ys,"mkdirpSync");function gr(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(gr,"_min");function Ln(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 b=0;b<i;)o[i+b]=t.charCodeAt(n+b),o[b]=++b;let a,c,l,u,d;for(a=0;a+3<r;){let b=e.charCodeAt(n+(c=a)),m=e.charCodeAt(n+(l=a+1)),w=e.charCodeAt(n+(u=a+2)),g=e.charCodeAt(n+(d=a+3)),F=a+=4;for(let _=0;_<i;){let O=o[i+_],U=o[_];c=gr(U,c,l,b,O),l=gr(c,l,u,m,O),u=gr(l,u,d,w,O),F=gr(u,d,F,g,O),o[_++]=F,d=u,u=l,l=c,c=U}}let h=0;for(;a<r;){let b=e.charCodeAt(n+(c=a));h=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=h=w<c||h<c?w>h?h+1:w+1:b===o[i+m]?c:c+1,c=w}}return h}s(Ln,"levenshtein");var Bd=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function xe(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(xe,"encode");function Xt(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(Xt,"decode");function wr(t){return JSON.parse(Xt(t),(e,i)=>e==""?i:BigInt(i))}s(wr,"decodeDirListing");function ye(t){return xe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ye,"encodeDirListing");function Dd(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(Dd,"_toUnixTimestamp");function me(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(me,"normalizeMode");function Pt(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(Pt,"normalizeTime");function E(t){if(t=t.toString(),t.includes("\0"))throw new f(22,"Path can not contain null character");if(t.length==0)throw new f(22,"Path can not be empty");return ht(t.replaceAll(/[/\\]+/g,"/"))}s(E,"normalizePath");function be(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:me("mode"in t?t?.mode:null,r)}}s(be,"normalizeOptions");function S(){}s(S,"nop");var Gs=5,Ri=class extends se{constructor(i){super();this.$store=i;this._initialized=!1;i instanceof Promise||(this._store=i,this._initialized=!0,this.makeRootDirectorySync())}static{s(this,"StoreFS")}get store(){if(!this._store)throw new f(61,"No store attached");return this._store}async ready(){await super.ready(),!this._initialized&&(this._initialized=!0,this._store=await this.$store)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.makeRootDirectory()}emptySync(){this.store.clearSync(),this.makeRootDirectorySync()}async rename(i,r,n){let o=this.store.transaction(),a=A(i),c=q(i),l=A(r),u=q(r),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",i,"rename");if(!h[c])throw f.With("ENOENT",i,"rename");let b=h[c];if(delete h[c],(l+"/").indexOf(i+"/")===0)throw new f(16,a);let m,w;if(l===a?(m=d,w=h):(m=await this.findINode(o,l),w=await this.getDirListing(o,m,l)),w[u]){let g=await this.getINode(o,w[u],r);if(g.toStats().isFile())try{await o.remove(g.ino),await o.remove(w[u])}catch(F){throw await o.abort(),F}else throw f.With("EPERM",r,"rename")}w[u]=b;try{await o.set(d.ino,ye(h)),await o.set(m.ino,ye(w))}catch(g){throw await o.abort(),g}await o.commit()}renameSync(i,r,n){let o=this.store.transaction(),a=A(i),c=q(i),l=A(r),u=q(r),d=this.findINodeSync(o,a),h=this.getDirListingSync(o,d,a);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",i,"rename");if(!h[c])throw f.With("ENOENT",i,"rename");let b=h[c];if(delete h[c],(l+"/").indexOf(i+"/")==0)throw new f(16,a);let m,w;if(l===a?(m=d,w=h):(m=this.findINodeSync(o,l),w=this.getDirListingSync(o,m,l)),w[u]){let g=this.getINodeSync(o,w[u],r);if(g.toStats().isFile())try{o.removeSync(g.ino),o.removeSync(w[u])}catch(F){throw o.abortSync(),F}else throw f.With("EPERM",r,"rename")}w[u]=b;try{o.setSync(d.ino,ye(h)),o.setSync(m.ino,ye(w))}catch(g){throw o.abortSync(),g}o.commitSync()}async stat(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,r))throw f.With("EACCES",i,"stat");return a}statSync(i,r){let n=this.findINodeSync(this.store.transaction(),i).toStats();if(!n.hasAccess(4,r))throw f.With("EACCES",i,"stat");return n}async createFile(i,r,n,o){let a=new Uint8Array(0),c=await this.commitNew(this.store.transaction(),i,Z.FILE,n,o,a);return new le(this,i,r,c.toStats(),a)}createFileSync(i,r,n,o){return this.commitNewSync(i,Z.FILE,n,o),this.openFileSync(i,r,o)}async openFile(i,r,n){let o=this.store.transaction(),a=await this.findINode(o,i),c=await o.get(a.ino);if(!a.toStats().hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");if(!c)throw f.With("ENOENT",i,"openFile");return new le(this,i,r,a.toStats(),c)}openFileSync(i,r,n){let o=this.store.transaction(),a=this.findINodeSync(o,i),c=o.getSync(a.ino);if(!a.toStats().hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");if(!c)throw f.With("ENOENT",i,"openFile");return new le(this,i,r,a.toStats(),c)}async unlink(i,r){return this.remove(i,!1,r)}unlinkSync(i,r){this.removeSync(i,!1,r)}async rmdir(i,r){if((await this.readdir(i,r)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,r)}rmdirSync(i,r){if(this.readdirSync(i,r).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,r)}async mkdir(i,r,n){let o=this.store.transaction(),a=xe("{}");await this.commitNew(o,i,Z.DIRECTORY,r,n,a)}mkdirSync(i,r,n){this.commitNewSync(i,Z.DIRECTORY,r,n,xe("{}"))}async readdir(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o.toStats().hasAccess(4,r))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(n,o,i))}readdirSync(i,r){let n=this.store.transaction(),o=this.findINodeSync(n,i);if(!o.toStats().hasAccess(4,r))throw f.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(n,o,i))}async sync(i,r,n){let o=this.store.transaction(),a=await this._findINode(o,A(i),q(i)),c=await this.getINode(o,a,i),l=c.update(n);try{await o.set(c.ino,r),l&&await o.set(a,c.data)}catch(u){throw await o.abort(),u}await o.commit()}syncSync(i,r,n){let o=this.store.transaction(),a=this._findINodeSync(o,A(i),q(i)),c=this.getINodeSync(o,a,i),l=c.update(n);try{o.setSync(c.ino,r),l&&o.setSync(a,c.data)}catch(u){throw o.abortSync(),u}o.commitSync()}async link(i,r,n){let o=this.store.transaction(),a=A(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,n))throw f.With("EACCES",a,"link");let l=A(r),u=await this.findINode(o,l),d=await this.getDirListing(o,u,l);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",l,"link");let h=await this._findINode(o,a,q(i)),b=await this.getINode(o,h,i);if(!b.toStats().hasAccess(2,n))throw f.With("EACCES",r,"link");b.nlink++,d[q(r)]=h;try{o.setSync(h,b.data),o.setSync(u.ino,ye(d))}catch(m){throw o.abortSync(),m}o.commitSync()}linkSync(i,r,n){let o=this.store.transaction(),a=A(i);if(!this.findINodeSync(o,a).toStats().hasAccess(4,n))throw f.With("EACCES",a,"link");let l=A(r),u=this.findINodeSync(o,l),d=this.getDirListingSync(o,u,l);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",l,"link");let h=this._findINodeSync(o,a,q(i)),b=this.getINodeSync(o,h,i);if(!b.toStats().hasAccess(2,n))throw f.With("EACCES",r,"link");b.nlink++,d[q(r)]=h;try{o.setSync(h,b.data),o.setSync(u.ino,ye(d))}catch(m){throw o.abortSync(),m}o.commitSync()}async makeRootDirectory(){let i=this.store.transaction();if(await i.get(De))return;let r=new Be;r.mode=511|Z.DIRECTORY,await i.set(r.ino,xe("{}")),await i.set(De,r.data),await i.commit()}makeRootDirectorySync(){let i=this.store.transaction();if(i.getSync(De))return;let r=new Be;r.mode=511|Z.DIRECTORY,i.setSync(r.ino,xe("{}")),i.setSync(De,r.data),i.commitSync()}async _findINode(i,r,n,o=new Set){let a=j(r,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return De;let c=r=="/"?await this.getINode(i,De,r):await this.findINode(i,r,o),l=await this.getDirListing(i,c,r);if(!(n in l))throw f.With("ENOENT",ht(r,n),"_findINode");return l[n]}_findINodeSync(i,r,n,o=new Set){let a=j(r,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return De;let c=r=="/"?this.getINodeSync(i,De,r):this.findINodeSync(i,r,o),l=this.getDirListingSync(i,c,r);if(!(n in l))throw f.With("ENOENT",ht(r,n),"_findINode");return l[n]}async findINode(i,r,n=new Set){let o=await this._findINode(i,A(r),q(r),n);return this.getINode(i,o,r)}findINodeSync(i,r,n=new Set){let o=this._findINodeSync(i,A(r),q(r),n);return this.getINodeSync(i,o,r)}async getINode(i,r,n){let o=await i.get(r);if(!o)throw f.With("ENOENT",n,"getINode");return new Be(o.buffer)}getINodeSync(i,r,n){let o=i.getSync(r);if(!o)throw f.With("ENOENT",n,"getINode");return new Be(o.buffer)}async getDirListing(i,r,n){if(!r.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let o=await i.get(r.ino);if(!o)throw f.With("ENOENT",n,"getDirListing");return wr(o)}getDirListingSync(i,r,n){if(!r.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let o=i.getSync(r.ino);if(!o)throw f.With("ENOENT",n,"getDirListing");return wr(o)}async addNew(i,r,n){for(let o=0;o<Gs;o++){let a=Oi();if(!await i.get(a))return await i.set(a,r),a}throw new f(28,"No inode IDs available",n,"addNewNode")}addNewSync(i,r,n){for(let o=0;o<Gs;o++){let a=Oi();if(!i.getSync(a))return i.setSync(a,r),a}throw new f(28,"No inode IDs available",n,"addNewNode")}async commitNew(i,r,n,o,a,c){let l=A(r),u=await this.findINode(i,l);if(!u.toStats().hasAccess(2,a))throw f.With("EACCES",r,"commitNewFile");let d=q(r),h=await this.getDirListing(i,u,l);if(r==="/")throw f.With("EEXIST",r,"commitNewFile");if(h[d])throw await i.abort(),f.With("EEXIST",r,"commitNewFile");try{let b=new Be;return b.ino=await this.addNew(i,c,r),b.mode=o|n,b.uid=a.uid,b.gid=a.gid,b.size=c.length,h[d]=await this.addNew(i,b.data,r),await i.set(u.ino,ye(h)),await i.commit(),b}catch(b){throw i.abort(),b}}commitNewSync(i,r,n,o,a=new Uint8Array){let c=this.store.transaction(),l=A(i),u=this.findINodeSync(c,l);if(!u.toStats().hasAccess(2,o))throw f.With("EACCES",i,"commitNewFile");let d=q(i),h=this.getDirListingSync(c,u,l);if(i==="/")throw f.With("EEXIST",i,"commitNewFile");if(h[d])throw f.With("EEXIST",i,"commitNewFile");let b=new Be;try{b.ino=this.addNewSync(c,a,i),b.size=a.length,b.mode=n|r,b.uid=o.uid,b.gid=o.gid,h[d]=this.addNewSync(c,b.data,i),c.setSync(u.ino,ye(h))}catch(m){throw c.abortSync(),m}return c.commitSync(),b}async remove(i,r,n){let o=this.store.transaction(),a=A(i),c=await this.findINode(o,a),l=await this.getDirListing(o,c,a),u=q(i);if(!l[u])throw f.With("ENOENT",i,"removeEntry");let d=l[u],h=await this.getINode(o,d,i);if(!h.toStats().hasAccess(2,n))throw f.With("EACCES",i,"removeEntry");if(delete l[u],!r&&h.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(r&&!h.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.set(c.ino,ye(l)),--h.nlink<1&&(await o.remove(h.ino),await o.remove(d))}catch(b){throw await o.abort(),b}await o.commit()}removeSync(i,r,n){let o=this.store.transaction(),a=A(i),c=this.findINodeSync(o,a),l=this.getDirListingSync(o,c,a),u=q(i),d=l[u];if(!d)throw f.With("ENOENT",i,"removeEntry");let h=this.getINodeSync(o,d,i);if(!h.toStats().hasAccess(2,n))throw f.With("EACCES",i,"removeEntry");if(delete l[u],!r&&h.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(r&&!h.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{o.setSync(c.ino,ye(l)),--h.nlink<1&&(o.removeSync(h.ino),o.removeSync(d))}catch(b){throw o.abortSync(),b}o.commitSync()}};var Ni=class{constructor(){this.aborted=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.aborted||await this.commit()}[Symbol.dispose](){this.aborted||this.commitSync()}},Li=class extends Ni{static{s(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},Bn=class extends Ni{static{s(this,"AsyncTransaction")}getSync(e){throw f.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(e,i){throw f.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(e){throw f.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw f.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw f.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var Dn=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(e){return this.cache.get(e)}set(e,i){this.cache.set(e,i),this.queue.add(this._set(e,i))}delete(e){this.cache.delete(e),this.queue.add(this._delete(e))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[e,i]of await this.entries())this.cache.has(e)||this.cache.set(e,i);for(let e of this.queue)await e}transaction(){return new Jt(this)}},Jt=class extends Li{constructor(i){super();this.store=i;this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let r=this.store.get(i);return this.stashOldValue(i,r),r}setSync(i,r){return this.markModified(i),this.store.set(i,r)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){}abortSync(){for(let i of this.modifiedKeys){let r=this.originalData.get(i);r?this.store.set(i,r):this.store.delete(i)}}stashOldValue(i,r){this.originalData.has(i)||this.originalData.set(i,r)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var Sr=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new Jt(this)}},Bi={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:t}){return new Ri(new Sr(t))},"create")};function Md(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}s(Md,"isFileData");function Mn(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}s(Mn,"isMessage");var Qt=new Map;function Un(t,{port:e,timeout:i=1e3,fs:r}={}){let n=new Error().stack.slice(6);if(!e)throw f.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);Qt.set(c,{resolve:o,reject:a,fs:r}),e.postMessage({...t,_zenfs:!0,id:c,stack:n});let l=setTimeout(()=>{let u=new f(5,"RPC Failed");u.stack+=n,a(u),typeof l=="object"&&l.unref()},i)})}s(Un,"request");function Ks(t){if(!Mn(t))return;let{id:e,value:i,error:r,stack:n}=t;if(!Qt.has(e)){let l=new f(5,"Invalid RPC id:"+e);throw l.stack+=n,l}let{resolve:o,reject:a,fs:c}=Qt.get(e);if(r){let l=f.fromJSON(i);l.stack+=n,a(l),Qt.delete(e);return}if(Md(i)){let{fd:l,path:u,position:d}=i,h=new Di(c,l,u,d);o(h),Qt.delete(e);return}o(i),Qt.delete(e)}s(Ks,"handleResponse");function Wn(t,e){if(!t)throw f.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(Wn,"attach");function Xs(t,e){if(!t)throw f.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(Xs,"detach");var Di=class extends Ft{constructor(i,r,n,o){super();this.fs=i;this.fd=r;this.path=n;this.position=o}static{s(this,"PortFile")}rpc(i,...r){return Un({scope:"file",fd:this.fd,method:i,args:r},this.fs.options)}stat(){return this.rpc("stat")}statSync(){throw f.With("ENOSYS",this.path,"PortFile.stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){throw f.With("ENOSYS",this.path,"PortFile.truncate")}write(i,r,n,o){return this.rpc("write",i,r,n,o)}writeSync(){throw f.With("ENOSYS",this.path,"PortFile.write")}async read(i,r,n,o){return await this.rpc("read",i,r,n,o)}readSync(){throw f.With("ENOSYS",this.path,"PortFile.read")}chown(i,r){return this.rpc("chown",i,r)}chownSync(){throw f.With("ENOSYS",this.path,"PortFile.chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){throw f.With("ENOSYS",this.path,"PortFile.chmod")}utimes(i,r){return this.rpc("utimes",i,r)}utimesSync(){throw f.With("ENOSYS",this.path,"PortFile.utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){throw f.With("ENOSYS",this.path,"PortFile._setType")}close(){return this.rpc("close")}closeSync(){throw f.With("ENOSYS",this.path,"PortFile.close")}sync(){return this.rpc("sync")}syncSync(){throw f.With("ENOSYS",this.path,"PortFile.sync")}},_r=class extends Rn(se){constructor(i){super();this.options=i;this._sync=Bi.create({name:"port-tmpfs"});this.port=i.port,Wn(this.port,Ks)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...r){return Un({scope:"fs",method:i,args:r},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,r,n){return this.rpc("rename",i,r,n)}async stat(i,r){return new Y(await this.rpc("stat",i,r))}sync(i,r,n){return this.rpc("sync",i,r,n)}openFile(i,r,n){return this.rpc("openFile",i,r,n)}createFile(i,r,n,o){return this.rpc("createFile",i,r,n,o)}unlink(i,r){return this.rpc("unlink",i,r)}rmdir(i,r){return this.rpc("rmdir",i,r)}mkdir(i,r,n){return this.rpc("mkdir",i,r,n)}readdir(i,r){return this.rpc("readdir",i,r)}exists(i,r){return this.rpc("exists",i,r)}link(i,r,n){return this.rpc("link",i,r,n)}},Js=0,Er=new Map;async function Qs(t,e,i){if(!Mn(i))return;let{method:r,args:n,id:o,scope:a,stack:c}=i,l,u=!1;try{switch(a){case"fs":l=await e[r](...n),l instanceof Ft&&(Er.set(++Js,l),l={fd:Js,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Er.has(d))throw new f(9);l=await Er.get(d)[r](...n),r=="close"&&Er.delete(d);break;default:return}}catch(d){l=d,u=!0}t.postMessage({_zenfs:!0,scope:a,id:o,error:u,method:r,stack:c,value:l instanceof f?l.toJSON():l})}s(Qs,"handleRequest");function Wd(t,e){Wn(t,i=>Qs(t,e,i))}s(Wd,"attachFS");function jd(t,e){Xs(t,i=>Qs(t,e,i))}s(jd,"detachFS");var qd={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(t){if(typeof t?.postMessage!="function")throw new f(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(t){return new _r(t)},"create")};function Zs(t){try{return JSON.parse(t),!0}catch{return!1}}s(Zs,"isJSON");function jn(t){return t.at(0).toUpperCase()+t.slice(1)}s(jn,"capitalize");var qn=Symbol("struct_init"),$d=Symbol("struct");var ea=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],ta=[...ea,...ea.map(t=>jn(t)),"char"];function ia(t,e){return function(i,r){let n=typeof r=="object"?r.name:r;if(typeof n=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+n.toString()),n=n.toString()),!n)throw new ReferenceError("Invalid name for struct member");if(typeof i!="object")throw new TypeError("Invalid member for struct field");if(!("constructor"in i))throw new TypeError("Invalid member for struct field");let o=i.constructor;o[qn]||=[],o[qn].push({name:n,type:t,length:e})}}s(ia,"member");function Hd(t){function e(i,r){return typeof i=="number"?ia(t,i):ia(t)(i,r)}return s(e,"_"),e}s(Hd,"_member");var PS=Object.fromEntries(ta.map(t=>[t,Hd(t)]));var ra=1,xr=class t extends Map{static{s(this,"Index")}constructor(){super()}files(){let e=new Map;for(let[i,r]of this)r.isFile()&&e.set(i,r);return e}toJSON(){return{version:ra,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(e){let i=[];for(let r of this.keys())A(r)==e&&i.push(q(r));return i}fromJSON(e){if(e.version!=ra)throw new f(22,"Index version mismatch");this.clear();for(let[i,r]of Object.entries(e.entries)){let n=new Y(r);n.isDirectory()&&(n.fileData=xe(JSON.stringify(this.dirEntries(i)))),this.set(i,n)}}static parse(e){if(!Zs(e))throw new f(22,"Invalid JSON");let i=JSON.parse(e),r=new t;return r.fromJSON(i),r}};var Mi=class extends Nn(se){constructor(i){super();this.indexData=i;this.index=new xr;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=await this.getData(i,r)}reloadFilesSync(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=this.getDataSync(i,r)}async stat(i){return this.statSync(i)}statSync(i){if(!this.index.has(i))throw f.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,r,n){if(pe(r))throw new f(1,i);let o=this.index.get(i);if(!o)throw f.With("ENOENT",i,"openFile");if(!o.hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");return new Kt(this,i,r,o,o.isDirectory()?o.fileData:await this.getData(i,o))}openFileSync(i,r,n){if(pe(r))throw new f(1,i);let o=this.index.get(i);if(!o)throw f.With("ENOENT",i,"openFile");if(!o.hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");return new Kt(this,i,r,o,o.isDirectory()?o.fileData:this.getDataSync(i,o))}async readdir(i){return this.readdirSync(i)}readdirSync(i){let r=this.index.get(i);if(!r)throw f.With("ENOENT",i,"readdir");if(!r.isDirectory())throw f.With("ENOTDIR",i,"readdir");return JSON.parse(Xt(r.fileData))}};async function na(t,e){let i=await fetch(t).catch(r=>{throw new f(5,r.message)});if(!i.ok)throw new f(5,"fetch failed: response returned code "+i.status);switch(e){case"buffer":let r=await i.arrayBuffer().catch(n=>{throw new f(5,n.message)});return new Uint8Array(r);case"json":return i.json().catch(n=>{throw new f(5,n.message)});default:throw new f(22,"Invalid download type: "+e)}}s(na,"fetchFile");var kr=class t extends Mi{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized){await super.ready();for(let[e,i]of this.index.files())await this.getData(e,i)}}constructor({index:e="index.json",baseUrl:i=""}){super(typeof e!="string"?e:na(e,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}preload(e,i){let r=this.index.get(e);if(!r)throw f.With("ENOENT",e,"preloadFile");if(!r.isFile())throw f.With("EISDIR",e,"preloadFile");r.size=i.length,r.fileData=i}async getData(e,i){if(i.fileData)return i.fileData;let r=await na(this.baseUrl+(e.startsWith("/")?e.slice(1):e),"buffer");return i.fileData=r,r}getDataSync(e,i){if(i.fileData)return i.fileData;throw new f(61,"",e,"getData")}},Yd={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(t){return new kr(t)},"create")};var Ui=class{constructor(){this.locks=new Map}static{s(this,"Mutex")}lock(e){return new Promise(i=>{this.locks.has(e)?this.locks.get(e).push(i):this.locks.set(e,[i])})}unlock(e){if(!this.locks.has(e))throw new f(1,"Can not unlock an already unlocked path",e);let i=this.locks.get(e)?.shift();if(i){setTimeout(i);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)}};var Wi=class{constructor(e){this.fs=e;this.mutex=new Ui}static{s(this,"LockedFS")}async ready(){await this.fs.ready()}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){await this.mutex.lock(e),await this.fs.rename(e,i,r),this.mutex.unlock(e)}renameSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"rename");return this.fs.renameSync(e,i,r)}async stat(e,i){await this.mutex.lock(e);let r=await this.fs.stat(e,i);return this.mutex.unlock(e),r}statSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"stat");return this.fs.statSync(e,i)}async openFile(e,i,r){await this.mutex.lock(e);let n=await this.fs.openFile(e,i,r);return this.mutex.unlock(e),n}openFileSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"openFile");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this.mutex.lock(e);let o=await this.fs.createFile(e,i,r,n);return this.mutex.unlock(e),o}createFileSync(e,i,r,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"createFile");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this.mutex.lock(e),await this.fs.unlink(e,i),this.mutex.unlock(e)}unlinkSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"unlink");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this.mutex.lock(e),await this.fs.rmdir(e,i),this.mutex.unlock(e)}rmdirSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"rmdir");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this.mutex.lock(e),await this.fs.mkdir(e,i,r),this.mutex.unlock(e)}mkdirSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"mkdir");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this.mutex.lock(e);let r=await this.fs.readdir(e,i);return this.mutex.unlock(e),r}readdirSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"readdir");return this.fs.readdirSync(e,i)}async exists(e,i){await this.mutex.lock(e);let r=await this.fs.exists(e,i);return this.mutex.unlock(e),r}existsSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"exists");return this.fs.existsSync(e,i)}async link(e,i,r){await this.mutex.lock(e),await this.fs.link(e,i,r),this.mutex.unlock(e)}linkSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"link");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this.mutex.lock(e),await this.fs.sync(e,i,r),this.mutex.unlock(e)}syncSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"sync");return this.fs.syncSync(e,i,r)}};var $n="/.deleted",vr=class extends se{constructor({writable:i,readable:r}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this._writable=i,this._readable=r,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnlockedOverlayFS")}async ready(){await this._readable.ready(),await this._writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:ji.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(i,r,n){let o=n.cred(0,0);await this.createParentDirectories(i,o),await this._writable.sync(i,r,n)}syncSync(i,r,n){let o=n.cred(0,0);this.createParentDirectoriesSync(i,o),this._writable.syncSync(i,r,n)}async _initialize(){if(!this._isInitialized){try{let i=await this._writable.openFile($n,L("r"),Me),{size:r}=await i.stat(),{buffer:n}=await i.read(new Uint8Array(r));this._deleteLog=Xt(n)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(i,r){this._deleteLog=i,this._reparseDeletionLog(),this.updateLog("",r)}async rename(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{await this._writable.rename(i,r,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}renameSync(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{this._writable.renameSync(i,r,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}async stat(i,r){this.checkInitialized();try{return this._writable.stat(i,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new Y(await this._readable.stat(i,r));return o.mode|=146,o}}statSync(i,r){this.checkInitialized();try{return this._writable.statSync(i,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new Y(this._readable.statSync(i,r));return o.mode|=146,o}}async openFile(i,r,n){if(await this._writable.exists(i,n))return this._writable.openFile(i,r,n);let o=await this._readable.openFile(i,L("r"),n),a=new Y(await o.stat()),{buffer:c}=await o.read(new Uint8Array(a.size));return new le(this,i,r,a,c)}openFileSync(i,r,n){if(this._writable.existsSync(i,n))return this._writable.openFileSync(i,r,n);let o=this._readable.openFileSync(i,L("r"),n),a=new Y(o.statSync()),c=new Uint8Array(a.size);return o.readSync(c),new le(this,i,r,a,c)}async createFile(i,r,n,o){return this.checkInitialized(),await this._writable.createFile(i,r,n,o),this.openFile(i,r,o)}createFileSync(i,r,n,o){return this.checkInitialized(),this._writable.createFileSync(i,r,n,o),this.openFileSync(i,r,o)}async link(i,r,n){this.checkInitialized(),await this._writable.link(i,r,n)}linkSync(i,r,n){this.checkInitialized(),this._writable.linkSync(i,r,n)}async unlink(i,r){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,r))throw f.With("ENOENT",i,"unlink");await this._writable.exists(i,r)&&await this._writable.unlink(i,r),await this.exists(i,r)&&this.deletePath(i,r)}unlinkSync(i,r){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,r))throw f.With("ENOENT",i,"unlink");this._writable.existsSync(i,r)&&this._writable.unlinkSync(i,r),this.existsSync(i,r)&&this.deletePath(i,r)}async rmdir(i,r){if(this.checkInitialized(),!await this.exists(i,r))throw f.With("ENOENT",i,"rmdir");if(await this._writable.exists(i,r)&&await this._writable.rmdir(i,r),await this.exists(i,r)){if((await this.readdir(i,r)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}rmdirSync(i,r){if(this.checkInitialized(),!this.existsSync(i,r))throw f.With("ENOENT",i,"rmdir");if(this._writable.existsSync(i,r)&&this._writable.rmdirSync(i,r),this.existsSync(i,r)){if(this.readdirSync(i,r).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}async mkdir(i,r,n){if(this.checkInitialized(),await this.exists(i,n))throw f.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,n),await this._writable.mkdir(i,r,n)}mkdirSync(i,r,n){if(this.checkInitialized(),this.existsSync(i,n))throw f.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,n),this._writable.mkdirSync(i,r,n)}async readdir(i,r){if(this.checkInitialized(),!(await this.stat(i,r)).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this._writable.readdir(i,r))}catch{}try{o.push(...(await this._readable.readdir(i,r)).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}readdirSync(i,r){if(this.checkInitialized(),!this.statSync(i,r).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this._writable.readdirSync(i,r))}catch{}try{o=o.concat(this._readable.readdirSync(i,r).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}deletePath(i,r){this._deletedFiles.add(i),this.updateLog(`d${i}
|
|
3
|
-
`,r)}async updateLog(i,r){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(
|
|
4
|
-
`))i.startsWith("d")&&this._deletedFiles.add(i.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 i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==$n)throw f.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i,r){let n=A(i),o=[];for(;!this._writable.existsSync(n,r);)o.push(n),n=A(n);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,r).mode,r)}async createParentDirectories(i,r){let n=A(i),o=[];for(;!await this._writable.exists(n,r);)o.push(n),n=A(n);o=o.reverse();for(let a of o){let c=await this.stat(a,r);await this._writable.mkdir(a,c.mode,r)}}operateOnWritable(i,r){if(!this.existsSync(i,r))throw f.With("ENOENT",i,"operateOnWriteable");this._writable.existsSync(i,r)||this.copyToWritableSync(i,r)}async operateOnWritableAsync(i,r){if(!await this.exists(i,r))throw f.With("ENOENT",i,"operateOnWritable");if(!await this._writable.exists(i,r))return this.copyToWritable(i,r)}copyToWritableSync(i,r){let n=this.statSync(i,r);if(n.isDirectory()){this._writable.mkdirSync(i,n.mode,r);return}let o=new Uint8Array(n.size),a=this._readable.openFileSync(i,L("r"),r);a.readSync(o),a.closeSync();let c=this._writable.openFileSync(i,L("w"),r);c.writeSync(o),c.closeSync()}async copyToWritable(i,r){let n=await this.stat(i,r);if(n.isDirectory()){await this._writable.mkdir(i,n.mode,r);return}let o=new Uint8Array(n.size),a=await this._readable.openFile(i,L("r"),r);await a.read(o),await a.close();let c=await this._writable.openFile(i,L("w"),r);await c.write(o),await c.close()}},ji=class extends Wi{static{s(this,"OverlayFS")}constructor(e){super(new vr(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}},Gd={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:s(function(){return!0},"isAvailable"),create:s(function(t){return new ji(t)},"create")};function qi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(qi,"isBackend");async function zn(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(c=>!(c in t.options)).map(c=>({str:c,distance:Ln(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.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(zn,"checkOptions");function Fr(t){return t!=null&&typeof t=="object"&&"backend"in t&&qi(t.backend)}s(Fr,"isBackendConfig");var hr={};pr(hr,{BigIntStatsFs:()=>Ai,Dir:()=>bt,Dirent:()=>mt,ReadStream:()=>_t,Stats:()=>Y,StatsFs:()=>Pi,WriteStream:()=>xt,access:()=>Mu,accessSync:()=>$a,appendFile:()=>pu,appendFileSync:()=>Oa,chmod:()=>Ru,chmodSync:()=>Wa,chown:()=>Tu,chownSync:()=>Ma,close:()=>mu,closeSync:()=>rt,constants:()=>vt,copyFile:()=>Hu,copyFileSync:()=>ao,cp:()=>Xu,cpSync:()=>co,createReadStream:()=>qu,createWriteStream:()=>$u,exists:()=>su,existsSync:()=>qe,fchmod:()=>xu,fchmodSync:()=>Lr,fchown:()=>_u,fchownSync:()=>Nr,fdatasync:()=>wu,fdatasyncSync:()=>Ra,fstat:()=>yu,fstatSync:()=>Ta,fsync:()=>gu,fsyncSync:()=>Ca,ftruncate:()=>bu,ftruncateSync:()=>io,futimes:()=>ku,futimesSync:()=>Br,lchmod:()=>Nu,lchmodSync:()=>ja,lchown:()=>Cu,lchownSync:()=>Ua,link:()=>Pu,linkSync:()=>Ba,lopenSync:()=>Gi,lstat:()=>cu,lstatSync:()=>to,lutimes:()=>Bu,lutimesSync:()=>qa,mkdir:()=>Fu,mkdirSync:()=>Dr,mkdtemp:()=>Vu,mkdtempSync:()=>za,mount:()=>Vi,mountObject:()=>Hi,mounts:()=>Se,open:()=>uu,openAsBlob:()=>Qu,openSync:()=>ni,opendir:()=>Ku,opendirSync:()=>Ya,promises:()=>dr,read:()=>Eu,readFile:()=>du,readFileSync:()=>Rr,readSync:()=>La,readdir:()=>Iu,readdirSync:()=>oi,readlink:()=>Ou,readlinkSync:()=>no,readv:()=>Yu,readvSync:()=>Va,realpath:()=>Du,realpathSync:()=>je,rename:()=>ou,renameSync:()=>Ia,rm:()=>zu,rmSync:()=>so,rmdir:()=>vu,rmdirSync:()=>ro,stat:()=>au,statSync:()=>Yi,statfs:()=>Ju,statfsSync:()=>Ga,symlink:()=>Au,symlinkSync:()=>Da,truncate:()=>lu,truncateSync:()=>Pa,umount:()=>Or,unlink:()=>fu,unlinkSync:()=>Cr,unwatchFile:()=>Wu,utimes:()=>Lu,utimesSync:()=>oo,watch:()=>ju,watchFile:()=>Uu,write:()=>Su,writeFile:()=>hu,writeFileSync:()=>Ki,writeSync:()=>Na,writev:()=>Gu,writevSync:()=>Ha});var Ms=yr(we(),1);var dr={};pr(dr,{FileHandle:()=>ie,access:()=>Ns,appendFile:()=>Fs,chmod:()=>Ts,chown:()=>As,constants:()=>vt,copyFile:()=>vn,cp:()=>Fn,exists:()=>Ie,lchmod:()=>Cs,lchown:()=>Os,link:()=>Is,lstat:()=>Sn,lutimes:()=>Rs,mkdir:()=>ur,mkdtemp:()=>Ls,open:()=>fe,opendir:()=>Bs,readFile:()=>fr,readdir:()=>Ct,readlink:()=>_n,realpath:()=>Fe,rename:()=>ks,rm:()=>kn,rmdir:()=>En,stat:()=>Ei,statfs:()=>Ds,symlink:()=>Ps,truncate:()=>vs,unlink:()=>lr,utimes:()=>xn,watch:()=>Qg,writeFile:()=>xi});var Vt=yr(we(),1);var yt=yr(we(),1);var k=Me;function Fa(t){k=t}s(Fa,"setCred");var Tt=new Map,Ih=100;function zi(t){let e=Ih++;return Tt.set(e,t),e}s(zi,"file2fd");function B(t){if(!Tt.has(t))throw new f(9);return Tt.get(t)}s(B,"fd2file");var Se=new Map;Vi("/",Bi.create({name:"root"}));function Vi(t,e){if(t[0]!=="/"&&(t="/"+t),t=ht(t),Se.has(t))throw new f(22,"Mount point "+t+" is already in use.");Se.set(t,e)}s(Vi,"mount");function Or(t){if(t[0]!=="/"&&(t=`/${t}`),t=ht(t),!Se.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");Se.delete(t)}s(Or,"umount");function T(t){t=E(t);let e=[...Se].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(T,"resolveMount");function va(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(va,"fixPaths");function H(t,e){return typeof t.stack=="string"&&(t.stack=va(t.stack,e)),t.message=va(t.message,e),t}s(H,"fixError");function Hi(t){"/"in t&&Or("/");for(let[e,i]of Object.entries(t))Vi(e,i)}s(Hi,"mountObject");function Tr(t,e){let i=t.metadata(),r=i.blockSize||4096;return{type:(e?BigInt:Number)(i.type||Cn),bsize:(e?BigInt:Number)(r),ffree:(e?BigInt:Number)(i.freeNodes||he),files:(e?BigInt:Number)(i.totalNodes||he),bavail:(e?BigInt:Number)(i.freeSpace/r),bfree:(e?BigInt:Number)(i.freeSpace/r),blocks:(e?BigInt:Number)(i.totalSpace/r)}}s(Tr,"_statfs");function Ia(t,e){t=E(t),e=E(e);let i=T(t),r=T(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,k);Ki(e,Rr(t)),Cr(t)}catch(o){throw H(o,n)}}s(Ia,"renameSync");function qe(t){t=E(t);try{let{fs:e,path:i}=T(je(t));return e.existsSync(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(qe,"existsSync");function Yi(t,e){t=E(t);let{fs:i,path:r}=T(qe(t)?je(t):t);try{let n=i.statSync(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(Yi,"statSync");function to(t,e){t=E(t);let{fs:i,path:r}=T(t);try{let n=i.statSync(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(to,"lstatSync");function Pa(t,e=0){let i=ni(t,"r+");try{io(i,e)}finally{rt(i)}}s(Pa,"truncateSync");function Cr(t){t=E(t);let{fs:e,path:i}=T(t);try{return e.unlinkSync(i,k)}catch(r){throw H(r,{[i]:t})}}s(Cr,"unlinkSync");function ri(t,e,i,r=!0){t=E(t);let n=me(i,420),o=L(e);t=r&&qe(t)?je(t):t;let{fs:a,path:c}=T(t);if(!a.existsSync(c,k))switch(Ci(o)){case 3:if(!a.statSync(A(c),k).isDirectory())throw f.With("ENOTDIR",A(t),"_open");return a.createFileSync(c,o,n,k);case 1:throw f.With("ENOENT",t,"_open");default:throw new f(22,"Invalid FileFlag object.")}let l=a.statSync(c,k);if(!l.hasAccess(n,k))throw f.With("EACCES",t,"_open");switch(Ti(o)){case 1:throw f.With("EEXIST",t,"_open");case 2:return a.unlinkSync(c,k),a.createFileSync(c,o,l.mode,k);case 0:return a.openFileSync(c,o,k);default:throw new f(22,"Invalid FileFlag object.")}}s(ri,"_openSync");function ni(t,e,i=0){return zi(ri(t,e,i,!0))}s(ni,"openSync");function Gi(t,e,i){return zi(ri(t,e,i,!1))}s(Gi,"lopenSync");function Aa(t,e,i){let r=ri(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(Aa,"_readFileSync");function Rr(t,e={}){let i=be(e,null,"r",420),r=L(i.flag);if(!ut(r))throw new f(22,"Flag passed to readFile must allow for reading.");let n=yt.Buffer.from(Aa(typeof t=="number"?B(t).path:t.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Rr,"readFileSync");function Ki(t,e,i={}){let r=be(i,"utf8","w+",420),n=L(r.flag);if(!pe(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"?yt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new f(22,"Data not specified");let a=ri(typeof t=="number"?B(t).path:t.toString(),n,r.mode,!0);try{a.writeSync(o,0,o.byteLength,0)}finally{a.closeSync()}}s(Ki,"writeFileSync");function Oa(t,e,i={}){let r=be(i,"utf8","a",420),n=L(r.flag);if(!dt(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"?yt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=ri(typeof t=="number"?B(t).path:t.toString(),n,r.mode,!0);try{a.writeSync(o,0,o.byteLength,null)}finally{a.closeSync()}}s(Oa,"appendFileSync");function Ta(t,e){let i=B(t).statSync();return e?.bigint?new ce(i):i}s(Ta,"fstatSync");function rt(t){B(t).closeSync(),Tt.delete(t)}s(rt,"closeSync");function io(t,e=0){if(e||=0,e<0)throw new f(22);B(t).truncateSync(e)}s(io,"ftruncateSync");function Ca(t){B(t).syncSync()}s(Ca,"fsyncSync");function Ra(t){B(t).datasyncSync()}s(Ra,"fdatasyncSync");function Na(t,e,i,r,n){let o,a,c,l;if(typeof e=="string"){l=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=yt.Buffer.from(e,d),c=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,l=typeof n=="number"?n:null;let u=B(t);return l??=u.position,u.writeSync(o,a,c,l)}s(Na,"writeSync");function La(t,e,i,r,n){let o=B(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(La,"readSync");function Nr(t,e,i){B(t).chownSync(e,i)}s(Nr,"fchownSync");function Lr(t,e){let i=me(e,-1);if(i<0)throw new f(22,"Invalid mode.");B(t).chmodSync(i)}s(Lr,"fchmodSync");function Br(t,e,i){B(t).utimesSync(Pt(e),Pt(i))}s(Br,"futimesSync");function ro(t){t=E(t);let{fs:e,path:i}=T(qe(t)?je(t):t);try{e.rmdirSync(i,k)}catch(r){throw H(r,{[i]:t})}}s(ro,"rmdirSync");function Dr(t,e){let i=me(typeof e=="number"||typeof e=="string"?e:e?.mode,511),r=typeof e=="object"&&e?.recursive;t=E(t);let{fs:n,path:o}=T(qe(t)?je(t):t);try{return n.mkdirSync(o,i,k)}catch(a){throw H(a,{[o]:t})}}s(Dr,"mkdirSync");function oi(t,e){t=E(t);let{fs:i,path:r}=T(qe(t)?je(t):t),n;try{n=i.readdirSync(r,k)}catch(o){throw H(o,{[r]:t})}for(let o of Se.keys()){if(!o.startsWith(t))continue;let a=o.slice(t.length);a.includes("/")||a.length==0||n.push(a)}return n.map(o=>typeof e=="object"&&e?.withFileTypes?new mt(o,Yi(j(t.toString(),o))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?yt.Buffer.from(o):o)}s(oi,"readdirSync");function Ba(t,e){t=E(t),e=E(e);let{fs:i,path:r}=T(t);try{return i.linkSync(r,e,k)}catch(n){throw H(n,{[r]:t})}}s(Ba,"linkSync");function Da(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(qe(e))throw f.With("EEXIST",e.toString(),"symlink");Ki(e,t.toString()),ri(e,"r+",420,!1)._setTypeSync(Z.SYMLINK)}s(Da,"symlinkSync");function no(t,e){let i=yt.Buffer.from(Aa(t.toString(),"r",!1)),r=typeof e=="object"?e?.encoding:e;return r=="buffer"?i:i.toString(r)}s(no,"readlinkSync");function Ma(t,e,i){let r=ni(t,"r+");Nr(r,e,i),rt(r)}s(Ma,"chownSync");function Ua(t,e,i){let r=Gi(t,"r+");Nr(r,e,i),rt(r)}s(Ua,"lchownSync");function Wa(t,e){let i=ni(t,"r+");Lr(i,e),rt(i)}s(Wa,"chmodSync");function ja(t,e){let i=Gi(t,"r+");Lr(i,e),rt(i)}s(ja,"lchmodSync");function oo(t,e,i){let r=ni(t,"r+");Br(r,e,i),rt(r)}s(oo,"utimesSync");function qa(t,e,i){let r=Gi(t,"r+");Br(r,e,i),rt(r)}s(qa,"lutimesSync");function je(t,e){t=E(t);let{base:i,dir:r}=br(t),n=j(r=="/"?"/":je(r),i),{fs:o,path:a,mountPoint:c}=T(n);try{return o.statSync(a,k).isSymbolicLink()?je(c+no(n)):n}catch(l){throw H(l,{[a]:n})}}s(je,"realpathSync");function $a(t,e=384){if(!Yi(t).hasAccess(e,k))throw new f(13)}s($a,"accessSync");function so(t,e){switch(t=E(t),Yi(t).mode&61440){case 16384:if(e?.recursive)for(let r of oi(t))so(j(t,r));ro(t);return;case 32768:case 40960:Cr(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(so,"rmSync");function za(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Dr(n),i=="buffer"?yt.Buffer.from(n):n}s(za,"mkdtempSync");function ao(t,e,i){if(t=E(t),e=E(e),i&&i&1&&qe(e))throw new f(17,"Destination file already exists.",e,"copyFile");Ki(e,Rr(t))}s(ao,"copyFileSync");function Va(t,e,i){let r=B(t),n=0;for(let o of e)n+=r.readSync(o,0,o.byteLength,i+n);return n}s(Va,"readvSync");function Ha(t,e,i){let r=B(t),n=0;for(let o of e)n+=r.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+n);return n}s(Ha,"writevSync");function Ya(t,e){return t=E(t),new bt(t)}s(Ya,"opendirSync");function co(t,e,i){t=E(t),e=E(e);let r=to(t);if(i?.errorOnExist&&qe(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");Dr(e,{recursive:!0});for(let n of oi(t,{withFileTypes:!0}))i.filter&&!i.filter(j(t,n.name),j(e,n.name))||co(j(t,n.name),j(e,n.name),i);break;case 32768:case 40960:ao(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&oo(e,r.atime,r.mtime)}s(co,"cpSync");function Ga(t,e){t=E(t);let{fs:i}=T(t);return Tr(i,e?.bigint)}s(Ga,"statfsSync");var mt=class{constructor(e,i){this.path=e;this.stats=i}static{s(this,"Dirent")}get name(){return q(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()}},bt=class{constructor(e){this.path=e;this.closed=!1;this._entries=[]}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Ct(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this._entries||(this._entries=oi(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})},"next")}}};var wn=yr(nu(),1);var _t=class extends wn.Readable{static{s(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}},xt=class extends wn.Writable{static{s(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}};var ie=class{static{s(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?zi(e):e,this.file=i?e:B(e)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=me(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,e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Pt(e),Pt(i))}async appendFile(e,i={}){let r=be(i,"utf8","a",420),n=L(r.flag);if(!dt(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"?Vt.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=be(e,null,"r",292),r=L(i.flag);if(!ut(r))throw new f(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(n),0,n,0),a=Vt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async({close:r,enqueue:n,error:o})=>{try{let l=0,u=0,d=NaN;for(;d>0;){let h=await this.read(new Uint8Array(65536),0,65536,u);if(!h.bytesRead){r();return}if(n(h.buffer.slice(0,h.bytesRead)),u+=h.bytesRead,++l>=1e7)throw new f(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");d=h.bytesRead}}catch(a){o(a)}},"start");return new globalThis.ReadableStream({start:i,type:e.type})}readLines(e){throw f.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new ce(i):i}async write(e,i,r,n){let o,a,c;if(typeof e=="string"){n=typeof i=="number"?i:null;let u=typeof r=="string"?r:"utf8";a=0,o=Vt.Buffer.from(e,u),c=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,n=typeof n=="number"?n:null;n??=this.file.position;let l=await this.file.write(o,a,c,n);return{buffer:o,bytesWritten:l}}async writeFile(e,i={}){let r=be(i,"utf8","w",420),n=L(r.flag);if(!pe(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"?Vt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Tt.delete(this.fd)}async writev(e,i){let r=0;for(let n of e)r+=(await this.write(n,0,n.length,i+r)).bytesWritten;return{bytesWritten:r,buffers:e}}async readv(e,i){let r=0;for(let n of e)r+=(await this.read(n,0,n.byteLength,i+r)).bytesRead;return{bytesRead:r,buffers:e}}createReadStream(e){let i=new _t({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:s(async r=>{try{let n=await this.read(new Uint8Array(r),0,r,this.file.position);i.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(n){i.destroy(n)}},"read")});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:s(async(n,o,a)=>{try{let{bytesWritten:c}=await this.write(n,null,o);a(c==n.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},r=new xt(i);return r.path=this.file.path,r}};async function ks(t,e){t=E(t),e=E(e);let i=T(t),r=T(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,k);return}await xi(e,await fr(t)),await lr(t)}catch(n){throw H(n,{[i.path]:t,[r.path]:e})}}s(ks,"rename");async function Ie(t){try{let{fs:e,path:i}=T(await Fe(t));return await e.exists(i,k)}catch(e){if(e instanceof f&&e.code=="ENOENT")return!1;throw e}}s(Ie,"exists");async function Ei(t,e){t=E(t);let{fs:i,path:r}=T(await Ie(t)?await Fe(t):t);try{let n=await i.stat(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(Ei,"stat");async function Sn(t,e){t=E(t);let{fs:i,path:r}=T(t);try{let n=await i.stat(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(Sn,"lstat");async function vs(t,e=0){let i=await fe(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(vs,"truncate");async function lr(t){t=E(t);let{fs:e,path:i}=T(t);try{await e.unlink(i,k)}catch(r){throw H(r,{[i]:t})}}s(lr,"unlink");async function _i(t,e,i=420,r){t=E(t);let n=me(i,420),o=L(e);t=r&&await Ie(t)?await Fe(t):t;let{fs:a,path:c}=T(t);if(!await a.exists(t,k))switch(Ci(o)){case 3:let l=await a.stat(A(c),k);if(l&&!l.isDirectory())throw f.With("ENOTDIR",A(t),"_open");return new ie(await a.createFile(c,o,n,k));case 1:throw f.With("ENOENT",t,"_open");default:throw new f(22,"Invalid file flag")}switch(Ti(o)){case 1:throw f.With("EEXIST",t,"_open");case 2:let l=await a.openFile(c,o,k);return await l.truncate(0),await l.sync(),new ie(l);case 0:return new ie(await a.openFile(c,o,k));default:throw new f(22,"Invalid file flag")}}s(_i,"_open");async function fe(t,e="r",i=420){return await _i(t,e,i,!0)}s(fe,"open");async function fr(t,e){let i=be(e,null,"r",420),r=typeof t=="object"&&"fd"in t?t:await fe(t,i.flag,i.mode);try{return await r.readFile(i)}finally{await r.close()}}s(fr,"readFile");async function xi(t,e,i){let r=be(i,"utf8","w+",420),n=t instanceof ie?t:await fe(t.toString(),r.flag,r.mode);try{let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new f(22,"Iterables and streams not supported",n.file.path,"writeFile");await n.writeFile(o,r)}finally{await n.close()}}s(xi,"writeFile");async function Fs(t,e,i){let r=be(i,"utf8","a",420),n=L(r.flag);if(!dt(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"?Vt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=typeof t=="object"&&"fd"in t?t:await fe(t,r.flag,r.mode);try{await a.appendFile(o,r)}finally{await a.close()}}s(Fs,"appendFile");async function En(t){t=E(t),t=await Ie(t)?await Fe(t):t;let{fs:e,path:i}=T(t);try{await e.rmdir(i,k)}catch(r){throw H(r,{[i]:t})}}s(En,"rmdir");async function ur(t,e){t=E(t),t=await Ie(t)?await Fe(t):t;let{fs:i,path:r}=T(t);try{await i.mkdir(r,me(typeof e=="object"?e?.mode:e,511),k)}catch(n){throw H(n,{[r]:t})}}s(ur,"mkdir");async function Ct(t,e){t=E(t),t=await Ie(t)?await Fe(t):t;let{fs:i,path:r}=T(t),n;try{n=await i.readdir(r,k)}catch(a){throw H(a,{[r]:t})}for(let a of Se.keys())if(a.startsWith(t)){let c=a.slice(t.length);if(c.includes("/")||c.length==0)continue;n.push(c)}let o=[];for(let a of n)o.push(typeof e=="object"&&e?.withFileTypes?new mt(a,await Ei(j(t,a))):a);return o}s(Ct,"readdir");async function Is(t,e){t=E(t),e=E(e);let{fs:i,path:r}=T(e);try{return await i.link(t,e,k)}catch(n){throw H(n,{[r]:e})}}s(Is,"link");async function Ps(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Ie(e))throw f.With("EEXIST",e.toString(),"symlink");await xi(e,t.toString()),await(await _i(e,"r+",420,!1)).file._setType(Z.SYMLINK)}s(Ps,"symlink");async function _n(t,e){let i=await _i(E(t),"r",420,!1);try{let r=await i.readFile(),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?r:r.toString(n)}finally{await i.close()}}s(_n,"readlink");async function As(t,e,i){let r=await fe(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(As,"chown");async function Os(t,e,i){let r=await _i(t,"r+",420,!1);try{await r.chown(e,i)}finally{await r.close()}}s(Os,"lchown");async function Ts(t,e){let i=await fe(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Ts,"chmod");async function Cs(t,e){let i=await _i(t,"r+",420,!1);try{await i.chmod(e)}finally{await i.close()}}s(Cs,"lchmod");async function xn(t,e,i){let r=await fe(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(xn,"utimes");async function Rs(t,e,i){let r=await _i(t,"r+",420,!1);try{await r.utimes(new Date(e),new Date(i))}finally{await r.close()}}s(Rs,"lutimes");async function Fe(t,e){t=E(t);let{base:i,dir:r}=br(t),n=j(r=="/"?"/":await Fe(r),i),{fs:o,path:a,mountPoint:c}=T(n);try{return(await o.stat(a,k)).isSymbolicLink()?Fe(c+await _n(n)):n}catch(l){throw H(l,{[a]:n})}}s(Fe,"realpath");function Qg(t,e={}){throw f.With("ENOSYS",t.toString(),"watch")}s(Qg,"watch");async function Ns(t,e=0){if(!(await Ei(t)).hasAccess(e,k))throw new f(13)}s(Ns,"access");async function kn(t,e){switch(t=E(t),(await Ei(t)).mode&61440){case 16384:if(e?.recursive)for(let r of await Ct(t))await kn(j(t,r));await En(t);return;case 32768:case 40960:await lr(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(kn,"rm");async function Ls(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await ur(n),i=="buffer"?Vt.Buffer.from(n):n}s(Ls,"mkdtemp");async function vn(t,e,i){if(t=E(t),e=E(e),i&&i&1&&await Ie(e))throw new f(17,"Destination file already exists.",e,"copyFile");await xi(e,await fr(t))}s(vn,"copyFile");async function Bs(t,e){return t=E(t),new bt(t)}s(Bs,"opendir");async function Fn(t,e,i){t=E(t),e=E(e);let r=await Sn(t);if(i?.errorOnExist&&await Ie(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");await ur(e,{recursive:!0});for(let n of await Ct(t,{withFileTypes:!0}))i.filter&&!i.filter(j(t,n.name),j(e,n.name))||await Fn(j(t,n.name),j(e,n.name),i);break;case 32768:case 40960:await vn(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await xn(e,r.atime,r.mtime)}s(Fn,"cp");async function Ds(t,e){t=E(t);let{fs:i}=T(t);return Tr(i,e?.bigint)}s(Ds,"statfs");function ou(t,e,i=S){ks(t,e).then(()=>i()).catch(i)}s(ou,"rename");function su(t,e=S){Ie(t).then(e).catch(()=>e(!1))}s(su,"exists");function au(t,e,i=S){i=typeof e=="function"?e:i,Ei(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(au,"stat");function cu(t,e,i=S){i=typeof e=="function"?e:i,Sn(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(cu,"lstat");function lu(t,e=0,i=S){i=typeof e=="function"?e:i,vs(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(lu,"truncate");function fu(t,e=S){lr(t).then(()=>e()).catch(e)}s(fu,"unlink");function uu(t,e,i,r=S){let n=me(i,420);r=typeof i=="function"?i:r,fe(t,e,n).then(o=>r(void 0,o.fd)).catch(r)}s(uu,"open");function du(t,e,i=S){i=typeof e=="function"?e:i,fr(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(du,"readFile");function hu(t,e,i,r=S){r=typeof i=="function"?i:r,xi(t,e,typeof i!="function"?i:null).then(()=>r(void 0)).catch(r)}s(hu,"writeFile");function pu(t,e,i,r=S){r=typeof i=="function"?i:r,Fs(t,e,typeof i=="function"?null:i).then(()=>r()).catch(r)}s(pu,"appendFile");function yu(t,e,i=S){i=typeof e=="function"?e:i,B(t).stat().then(r=>i(void 0,typeof e=="object"&&e?.bigint?new ce(r):r)).catch(i)}s(yu,"fstat");function mu(t,e=S){new ie(t).close().then(()=>e()).catch(e)}s(mu,"close");function bu(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=B(t);if(r<0)throw new f(22);n.truncate(r).then(()=>i()).catch(i)}s(bu,"ftruncate");function gu(t,e=S){B(t).sync().then(()=>e()).catch(e)}s(gu,"fsync");function wu(t,e=S){B(t).datasync().then(()=>e()).catch(e)}s(wu,"fdatasync");function Su(t,e,i,r,n,o=S){let a,c,l,u,d,h=new ie(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=Ms.Buffer.from(e),c=0,l=a.length;let b=o;h.write(a,c,l,u).then(({bytesWritten:m})=>b(void 0,m,a.toString(d))).catch(b)}else{a=Ms.Buffer.from(e.buffer),c=i,l=r,u=typeof n=="number"?n:null;let b=typeof n=="function"?n:o;h.write(a,c,l,u).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(Su,"write");function Eu(t,e,i,r,n,o=S){new ie(t).read(e,i,r,n).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(Eu,"read");function _u(t,e,i,r=S){new ie(t).chown(e,i).then(()=>r()).catch(r)}s(_u,"fchown");function xu(t,e,i){new ie(t).chmod(e).then(()=>i()).catch(i)}s(xu,"fchmod");function ku(t,e,i,r=S){new ie(t).utimes(e,i).then(()=>r()).catch(r)}s(ku,"futimes");function vu(t,e=S){En(t).then(()=>e()).catch(e)}s(vu,"rmdir");function Fu(t,e,i=S){ur(t,e).then(()=>i()).catch(i)}s(Fu,"mkdir");function Iu(t,e,i=S){i=typeof e=="function"?e:i,Ct(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(Iu,"readdir");function Pu(t,e,i=S){Is(t,e).then(()=>i()).catch(i)}s(Pu,"link");function Au(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Ps(t,e,n).then(()=>r()).catch(r)}s(Au,"symlink");function Ou(t,e,i=S){i=typeof e=="function"?e:i,_n(t).then(r=>i(void 0,r)).catch(i)}s(Ou,"readlink");function Tu(t,e,i,r=S){As(t,e,i).then(()=>r()).catch(r)}s(Tu,"chown");function Cu(t,e,i,r=S){Os(t,e,i).then(()=>r()).catch(r)}s(Cu,"lchown");function Ru(t,e,i=S){Ts(t,e).then(()=>i()).catch(i)}s(Ru,"chmod");function Nu(t,e,i=S){Cs(t,e).then(()=>i()).catch(i)}s(Nu,"lchmod");function Lu(t,e,i,r=S){xn(t,e,i).then(()=>r()).catch(r)}s(Lu,"utimes");function Bu(t,e,i,r=S){Rs(t,e,i).then(()=>r()).catch(r)}s(Bu,"lutimes");function Du(t,e,i=S){i=typeof e=="function"?e:i,Fe(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(Du,"realpath");function Mu(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Ns(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(Mu,"access");function Uu(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watchFile")}s(Uu,"watchFile");function Wu(t,e=S){throw f.With("ENOSYS",t.toString(),"unwatchFile")}s(Wu,"unwatchFile");function ju(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watch")}s(ju,"watch");function qu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new _t({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{r||=await fe(t,"r",i?.mode);let a=await r.read(new Uint8Array(o),0,o,r.file.position);n.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),r.file.position+=a.bytesRead,a.bytesRead||await r.close()}catch(a){await r?.close(),n.destroy(a)}},"read"),destroy:s(function(o,a){r?.close().then(()=>a(o)).catch(a)},"destroy")});return n.path=t.toString(),n}s(qu,"createReadStream");function $u(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new xt({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{r||=await fe(t,"w",i?.mode||438),await r.write(o,0,a),c(void 0)}catch(l){await r?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),r?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){r?.close().then(()=>o()).catch(o)},"final")});return n.path=t.toString(),n}s($u,"createWriteStream");function zu(t,e,i=S){i=typeof e=="function"?e:i,kn(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(zu,"rm");function Vu(t,e,i=S){i=typeof e=="function"?e:i,Ls(t,typeof e!="function"?e:null).then(r=>i(void 0,r)).catch(i)}s(Vu,"mkdtemp");function Hu(t,e,i,r=S){r=typeof i=="function"?i:r,vn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Hu,"copyFile");function Yu(t,e,i,r=S){r=typeof i=="function"?i:r,new ie(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesRead:o})=>r(void 0,o,n)).catch(r)}s(Yu,"readv");function Gu(t,e,i,r=S){r=typeof i=="function"?i:r,new ie(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesWritten:o})=>r(void 0,o,n)).catch(r)}s(Gu,"writev");function Ku(t,e,i=S){i=typeof e=="function"?e:i,Bs(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(Ku,"opendir");function Xu(t,e,i,r=S){r=typeof i=="function"?i:r,Fn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Xu,"cp");function Ju(t,e,i=S){i=typeof e=="function"?e:i,Ds(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(Ju,"statfs");async function Qu(t,e){let i=await fe(t.toString(),"r"),r=await i.readFile();return await i.close(),new Blob([r],e)}s(Qu,"openAsBlob");function Us(t){return Fr(t)||qi(t)||t instanceof se}s(Us,"isMountConfig");async function Ws(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!Us(t))throw new f(22,"Invalid mount configuration");if(t instanceof se)return t;qi(t)&&(t={backend:t});for(let[n,o]of Object.entries(t))if(n!="backend"&&Us(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[n]=await Ws(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);zn(i,t);let r=await i.create(t);return"_disableSync"in r&&(r._disableSync=t.disableAsyncCache||!1),await r.ready(),r}s(Ws,"resolveMountConfig");async function Zg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;if(Us(t)&&(t={mounts:{"/":t}}),Fa({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),!!t.mounts){for(let[r,n]of Object.entries(t.mounts)){if(!r.startsWith("/"))throw new f(22,"Mount points must have absolute paths");Fr(n)&&(n.disableAsyncCache??=t.disableAsyncCache||!1),t.mounts[r]=await Ws(n)}Hi(t.mounts)}}s(Zg,"configure");var ew=hr;return od(tw);})();
|
|
1
|
+
"use strict";var ZenFS=(()=>{var Ju=Object.create;var ki=Object.defineProperty;var Qu=Object.getOwnPropertyDescriptor;var Zu=Object.getOwnPropertyNames;var ed=Object.getPrototypeOf,td=Object.prototype.hasOwnProperty;var s=(t,e)=>ki(t,"name",{value:e,configurable:!0});var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hr=(t,e)=>{for(var i in e)ki(t,i,{get:e[i],enumerable:!0})},Ws=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Zu(e))!td.call(t,n)&&n!==i&&ki(t,n,{get:()=>e[n],enumerable:!(r=Qu(e,n))||r.enumerable});return t};var yr=(t,e,i)=>(i=t!=null?Ju(ed(t)):{},Ws(e||!t||!t.__esModule?ki(i,"default",{value:t,enumerable:!0}):i,t)),id=t=>Ws(ki({},"__esModule",{value:!0}),t);var na=P(Fr=>{"use strict";Fr.byteLength=Yd;Fr.toByteArray=Kd;Fr.fromByteArray=Qd;var Ue=[],ge=[],Hd=typeof Uint8Array<"u"?Uint8Array:Array,zn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(At=0,ia=zn.length;At<ia;++At)Ue[At]=zn[At],ge[zn.charCodeAt(At)]=At;var At,ia;ge[45]=62;ge[95]=63;function ra(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(ra,"getLens");function Yd(t){var e=ra(t),i=e[0],r=e[1];return(i+r)*3/4-r}s(Yd,"byteLength");function Gd(t,e,i){return(e+i)*3/4-i}s(Gd,"_byteLength");function Kd(t){var e,i=ra(t),r=i[0],n=i[1],o=new Hd(Gd(t,r,n)),a=0,c=n>0?r-4:r,l;for(l=0;l<c;l+=4)e=ge[t.charCodeAt(l)]<<18|ge[t.charCodeAt(l+1)]<<12|ge[t.charCodeAt(l+2)]<<6|ge[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=ge[t.charCodeAt(l)]<<2|ge[t.charCodeAt(l+1)]>>4,o[a++]=e&255),n===1&&(e=ge[t.charCodeAt(l)]<<10|ge[t.charCodeAt(l+1)]<<4|ge[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Kd,"toByteArray");function Xd(t){return Ue[t>>18&63]+Ue[t>>12&63]+Ue[t>>6&63]+Ue[t&63]}s(Xd,"tripletToBase64");function Jd(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(Xd(r));return n.join("")}s(Jd,"encodeChunk");function Qd(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,c=i-r;a<c;a+=o)n.push(Jd(t,a,a+o>c?c:a+o));return r===1?(e=t[i-1],n.push(Ue[e>>2]+Ue[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(Ue[e>>10]+Ue[e>>4&63]+Ue[e<<2&63]+"=")),n.join("")}s(Qd,"fromByteArray")});var oa=P(Vn=>{Vn.read=function(t,e,i,r,n){var o,a,c=n*8-r-1,l=(1<<c)-1,u=l>>1,d=-7,p=i?n-1:0,b=i?-1:1,m=t[e+p];for(p+=b,o=m&(1<<-d)-1,m>>=-d,d+=c;d>0;o=o*256+t[e+p],p+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+p],p+=b,d-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-u}return(m?-1:1)*a*Math.pow(2,o-r)};Vn.write=function(t,e,i,r,n,o){var a,c,l,u=o*8-n-1,d=(1<<u)-1,p=d>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,w=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?e+=b/l:e+=b*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=d?(c=0,a=d):a+p>=1?(c=(e*l-1)*Math.pow(2,n),a=a+p):(c=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;t[i+m]=c&255,m+=w,c/=256,n-=8);for(a=a<<n|c,u+=n;u>0;t[i+m]=a&255,m+=w,a/=256,u-=8);t[i+m-w]|=g*128}});var we=P(ii=>{"use strict";var Hn=na(),ei=oa(),sa=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ii.Buffer=y;ii.SlowBuffer=np;ii.INSPECT_MAX_BYTES=50;var Ir=2147483647;ii.kMaxLength=Ir;y.TYPED_ARRAY_SUPPORT=Zd();!y.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 Zd(){try{let t=new Uint8Array(1),e={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Zd,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function rt(t){if(t>Ir)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(rt,"createBuffer");function y(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 Xn(t)}return fa(t,e,i)}s(y,"Buffer");y.poolSize=8192;function fa(t,e,i){if(typeof t=="string")return tp(t,e);if(ArrayBuffer.isView(t))return ip(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(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Gn(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 y.from(r,e,i);let n=rp(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.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(fa,"from");y.from=function(t,e,i){return fa(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function ua(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(ua,"assertSize");function ep(t,e,i){return ua(t),t<=0?rt(t):e!==void 0?typeof i=="string"?rt(t).fill(e,i):rt(t).fill(e):rt(t)}s(ep,"alloc");y.alloc=function(t,e,i){return ep(t,e,i)};function Xn(t){return ua(t),rt(t<0?0:Jn(t)|0)}s(Xn,"allocUnsafe");y.allocUnsafe=function(t){return Xn(t)};y.allocUnsafeSlow=function(t){return Xn(t)};function tp(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=da(t,e)|0,r=rt(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(tp,"fromString");function Yn(t){let e=t.length<0?0:Jn(t.length)|0,i=rt(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(Yn,"fromArrayLike");function ip(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Gn(e.buffer,e.byteOffset,e.byteLength)}return Yn(t)}s(ip,"fromArrayView");function Gn(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,y.prototype),r}s(Gn,"fromArrayBuffer");function rp(t){if(y.isBuffer(t)){let e=Jn(t.length)|0,i=rt(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Zn(t.length)?rt(0):Yn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Yn(t.data)}s(rp,"fromObject");function Jn(t){if(t>=Ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ir.toString(16)+" bytes");return t|0}s(Jn,"checked");function np(t){return+t!=t&&(t=0),y.alloc(+t)}s(np,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.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");y.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");y.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 y.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=y.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(We(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.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 da(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(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 Kn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Ea(t).length;default:if(n)return r?-1:Kn(t).length;e=(""+e).toLowerCase(),n=!0}}s(da,"byteLength");y.byteLength=da;function op(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 yp(this,e,i);case"utf8":case"utf-8":return ha(this,e,i);case"ascii":return pp(this,e,i);case"latin1":case"binary":return hp(this,e,i);case"base64":return up(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mp(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(op,"slowToString");y.prototype._isBuffer=!0;function Ot(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(Ot,"swap");y.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)Ot(this,i,i+1);return this},"swap16");y.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)Ot(this,i,i+3),Ot(this,i+1,i+2);return this},"swap32");y.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)Ot(this,i,i+7),Ot(this,i+1,i+6),Ot(this,i+2,i+5),Ot(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?ha(this,0,e):op.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=ii.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");sa&&(y.prototype[sa]=y.prototype.inspect);y.prototype.compare=s(function(e,i,r,n,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.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,c=r-i,l=Math.min(a,c),u=this.slice(n,o),d=e.slice(i,r);for(let p=0;p<l;++p)if(u[p]!==d[p]){a=u[p],c=d[p];break}return a<c?-1:c<a?1:0},"compare");function pa(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,Zn(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=y.from(e,r)),y.isBuffer(e))return e.length===0?-1:aa(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):aa(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(pa,"bidirectionalIndexOf");function aa(t,e,i,r,n){let o=1,a=t.length,c=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,c/=2,i/=2}function l(d,p){return o===1?d[p]:d.readUInt16BE(p*o)}s(l,"read");let u;if(n){let d=-1;for(u=i;u<a;u++)if(l(t,u)===l(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===c)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(i+c>a&&(i=a-c),u=i;u>=0;u--){let d=!0;for(let p=0;p<c;p++)if(l(t,u+p)!==l(e,p)){d=!1;break}if(d)return u}return-1}s(aa,"arrayIndexOf");y.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");y.prototype.indexOf=s(function(e,i,r){return pa(this,e,i,r,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,r){return pa(this,e,i,r,!1)},"lastIndexOf");function sp(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 c=parseInt(e.substr(a*2,2),16);if(Zn(c))return a;t[i+a]=c}return a}s(sp,"hexWrite");function ap(t,e,i,r){return Pr(Kn(e,t.length-i),t,i,r)}s(ap,"utf8Write");function cp(t,e,i,r){return Pr(Sp(e),t,i,r)}s(cp,"asciiWrite");function lp(t,e,i,r){return Pr(Ea(e),t,i,r)}s(lp,"base64Write");function fp(t,e,i,r){return Pr(Ep(e,t.length-i),t,i,r)}s(fp,"ucs2Write");y.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 sp(this,e,i,r);case"utf8":case"utf-8":return ap(this,e,i,r);case"ascii":case"latin1":case"binary":return cp(this,e,i,r);case"base64":return lp(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fp(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function up(t,e,i){return e===0&&i===t.length?Hn.fromByteArray(t):Hn.fromByteArray(t.slice(e,i))}s(up,"base64Slice");function ha(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=i){let l,u,d,p;switch(c){case 1:o<128&&(a=o);break;case 2:l=t[n+1],(l&192)===128&&(p=(o&31)<<6|l&63,p>127&&(a=p));break;case 3:l=t[n+1],u=t[n+2],(l&192)===128&&(u&192)===128&&(p=(o&15)<<12|(l&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:l=t[n+1],u=t[n+2],d=t[n+3],(l&192)===128&&(u&192)===128&&(d&192)===128&&(p=(o&15)<<18|(l&63)<<12|(u&63)<<6|d&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=c}return dp(r)}s(ha,"utf8Slice");var ca=4096;function dp(t){let e=t.length;if(e<=ca)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=ca));return i}s(dp,"decodeCodePointsArray");function pp(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(pp,"asciiSlice");function hp(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(hp,"latin1Slice");function yp(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+=_p[t[o]];return n}s(yp,"hexSlice");function mp(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(mp,"utf16leSlice");y.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,y.prototype),n},"slice");function J(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(J,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(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");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||J(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||J(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||J(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=ht(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readBigUInt64BE=ht(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(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");y.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||J(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");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||J(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||J(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||J(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=ht(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readBigInt64BE=ht(s(function(e){e=e>>>0,ti(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&$i(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"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),ei.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||J(e,4,this.length),ei.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||J(e,8,this.length),ei.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||J(e,8,this.length),ei.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,r,n,o){if(!y.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(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ae(this,e,i,r,c,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");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ae(this,e,i,r,c,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");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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 ya(t,e,i,r,n){Sa(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(ya,"wrtBigUInt64LE");function ma(t,e,i,r,n){Sa(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(ma,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=ht(s(function(e,i=0){return ya(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=ht(s(function(e,i=0){return ma(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ae(this,e,i,r,l-1,-l)}let o=0,a=1,c=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ae(this,e,i,r,l-1,-l)}let o=r-1,a=1,c=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntBE");y.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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");y.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ae(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");y.prototype.writeBigInt64LE=ht(s(function(e,i=0){return ya(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=ht(s(function(e,i=0){return ma(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function ba(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(ba,"checkIEEE754");function ga(t,e,i,r,n){return e=+e,i=i>>>0,n||ba(t,e,i,4,34028234663852886e22,-34028234663852886e22),ei.write(t,e,i,r,23,4),i+4}s(ga,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,r){return ga(this,e,i,!0,r)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,r){return ga(this,e,i,!1,r)},"writeFloatBE");function wa(t,e,i,r,n){return e=+e,i=i>>>0,n||ba(t,e,i,8,17976931348623157e292,-17976931348623157e292),ei.write(t,e,i,r,52,8),i+8}s(wa,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,r){return wa(this,e,i,!0,r)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,r){return wa(this,e,i,!1,r)},"writeDoubleBE");y.prototype.copy=s(function(e,i,r,n){if(!y.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");y.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"&&!y.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=y.isBuffer(e)?e:y.from(e,n),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%c]}return this},"fill");var Zt={};function Qn(t,e,i){Zt[t]=class extends i{static{s(this,"NodeError")}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}`}}}s(Qn,"E");Qn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Qn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Qn("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=la(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=la(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function la(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(la,"addNumericalSeparator");function bp(t,e,i){ti(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&$i(e,t.length-(i+1))}s(bp,"checkBounds");function Sa(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",c;throw o>3?e===0||e===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${e}${a} and <= ${i}${a}`,new Zt.ERR_OUT_OF_RANGE("value",c,t)}bp(r,n,o)}s(Sa,"checkIntBI");function ti(t,e){if(typeof t!="number")throw new Zt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(ti,"validateNumber");function $i(t,e,i){throw Math.floor(t)!==t?(ti(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($i,"boundsError");var gp=/[^+/0-9A-Za-z-_]/g;function wp(t){if(t=t.split("=")[0],t=t.trim().replace(gp,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(wp,"base64clean");function Kn(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(Kn,"utf8ToBytes");function Sp(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Sp,"asciiToBytes");function Ep(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(Ep,"utf16leToBytes");function Ea(t){return Hn.toByteArray(wp(t))}s(Ea,"base64ToBytes");function Pr(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(Pr,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function Zn(t){return t!==t}s(Zn,"numberIsNaN");var _p=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 ht(t){return typeof BigInt>"u"?xp:t}s(ht,"defineBigIntMethod");function xp(){throw new Error("BigInt not supported")}s(xp,"BufferBigIntNotDefined")});var D=P((QE,Ha)=>{"use strict";Ha.exports={ArrayIsArray:s(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"FunctionPrototypeSymbolHasInstance"),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:s(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:s(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:s(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(t){return t.trim()},"StringPrototypeTrim"),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:s(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var si=P((e_,Dr)=>{"use strict";var{AbortController:Ya,AbortSignal:vp}=typeof self<"u"?self:typeof window<"u"?window:void 0;Dr.exports=Ya;Dr.exports.AbortSignal=vp;Dr.exports.default=Ya});var Xi=P((t_,co)=>{"use strict";var ai=typeof Reflect=="object"?Reflect:null,Ga=ai&&typeof ai.apply=="function"?ai.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Mr;ai&&typeof ai.ownKeys=="function"?Mr=ai.ownKeys:Object.getOwnPropertySymbols?Mr=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Mr=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function Fp(t){console&&console.warn&&console.warn(t)}s(Fp,"ProcessEmitWarning");var Xa=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function C(){C.init.call(this)}s(C,"EventEmitter");co.exports=C;co.exports.once=Op;C.EventEmitter=C;C.prototype._events=void 0;C.prototype._eventsCount=0;C.prototype._maxListeners=void 0;var Ka=10;function Ur(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Ur,"checkListener");Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Ka},"get"),set:s(function(t){if(typeof t!="number"||t<0||Xa(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ka=t},"set")});C.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};C.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Xa(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 Ja(t){return t._maxListeners===void 0?C.defaultMaxListeners:t._maxListeners}s(Ja,"_getMaxListeners");C.prototype.getMaxListeners=s(function(){return Ja(this)},"getMaxListeners");C.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 c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")Ga(l,this,i);else for(var u=l.length,d=ic(l,u),r=0;r<u;++r)Ga(d[r],this,i);return!0},"emit");function Qa(t,e,i,r){var n,o,a;if(Ur(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=Ja(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,Fp(c)}return t}s(Qa,"_addListener");C.prototype.addListener=s(function(e,i){return Qa(this,e,i,!1)},"addListener");C.prototype.on=C.prototype.addListener;C.prototype.prependListener=s(function(e,i){return Qa(this,e,i,!0)},"prependListener");function Ip(){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(Ip,"onceWrapper");function Za(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=Ip.bind(r);return n.listener=i,r.wrapFn=n,n}s(Za,"_onceWrap");C.prototype.once=s(function(e,i){return Ur(i),this.on(e,Za(this,e,i)),this},"once");C.prototype.prependOnceListener=s(function(e,i){return Ur(i),this.prependListener(e,Za(this,e,i)),this},"prependOnceListener");C.prototype.removeListener=s(function(e,i){var r,n,o,a,c;if(Ur(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){c=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():Pp(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,c||i)}return this},"removeListener");C.prototype.off=C.prototype.removeListener;C.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 ec(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?Ap(n):ic(n,n.length)}s(ec,"_listeners");C.prototype.listeners=s(function(e){return ec(this,e,!0)},"listeners");C.prototype.rawListeners=s(function(e){return ec(this,e,!1)},"rawListeners");C.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):tc.call(t,e)};C.prototype.listenerCount=tc;function tc(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(tc,"listenerCount");C.prototype.eventNames=s(function(){return this._eventsCount>0?Mr(this._events):[]},"eventNames");function ic(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(ic,"arrayClone");function Pp(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(Pp,"spliceOne");function Ap(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(Ap,"unwrapListeners");function Op(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"),rc(t,e,o,{once:!0}),e!=="error"&&Tp(t,n,{once:!0})})}s(Op,"once");function Tp(t,e,i){typeof t.on=="function"&&rc(t,"error",e,i)}s(Tp,"addErrorHandlerIfEventEmitter");function rc(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(rc,"eventTargetAgnosticAddListener")});var ee=P((r_,fo)=>{"use strict";var Cp=we(),{kResistStopPropagation:Rp,SymbolDispose:Np}=D(),Lp=globalThis.AbortSignal||si().AbortSignal,Bp=globalThis.AbortController||si().AbortController,Dp=Object.getPrototypeOf(async function(){}).constructor,nc=globalThis.Blob||Cp.Blob,Mp=s(typeof nc<"u"?function(e){return e instanceof nc}:function(e){return!1},"isBlob"),oc=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"),Up=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),lo=class extends Error{static{s(this,"AggregateError")}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}};fo.exports={AggregateError:lo,kEmptyObject:Object.freeze({}),once:s(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:s(function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},"createDeferredPromise"),promisify:s(function(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(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()})},"format"),inspect:s(function(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"{}"}},"inspect"),types:{isAsyncFunction:s(function(t){return t instanceof Dp},"isAsyncFunction"),isArrayBufferView:s(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:Mp,deprecate:s(function(t,e){return t},"deprecate"),addAbortListener:Xi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);oc(e,"signal"),Up(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Rp]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Np](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:Lp.any||s(function(e){if(e.length===1)return e[0];let i=new Bp,r=s(()=>i.abort(),"abort");return e.forEach(n=>{oc(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};fo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var re=P((o_,cc)=>{"use strict";var{format:Wp,inspect:Wr,AggregateError:jp}=ee(),qp=globalThis.AggregateError||jp,$p=Symbol("kIsNodeError"),zp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Vp=/^([A-Z][a-z0-9]*)+$/,Hp="__node_internal_",jr={};function Rt(t,e){if(!t)throw new jr.ERR_INTERNAL_ASSERTION(e)}s(Rt,"assert");function sc(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(sc,"addNumericalSeparator");function Yp(t,e,i){if(typeof e=="function")return Rt(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 Rt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Wp(e,...i)}s(Yp,"getMessage");function Q(t,e,i){i||(i=Error);class r extends i{static{s(this,"NodeError")}constructor(...o){super(Yp(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[$p]=!0,jr[t]=r}s(Q,"E");function ac(t){let e=Hp+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(ac,"hideStackFrames");function Gp(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new qp([e,t],e.message);return i.code=e.code,i}return t||e}s(Gp,"aggregateTwoErrors");var uo=class extends Error{static{s(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new jr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Rt(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 l of e)Rt(typeof l=="string","All expected entries have to be of type string"),zp.includes(l)?n.push(l.toLowerCase()):Vp.test(l)?o.push(l):(Rt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,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 l=n.pop();r+=`one of type ${n.join(", ")}, or ${l}`}}(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 l=o.pop();r+=`an instance of ${o.join(", ")}, or ${l}`}}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 l=a.pop();r+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${i.constructor.name}`;else{let l=Wr(i,{depth:-1});r+=`. Received ${l}`}}else{let l=Wr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof i} (${l})`}return r},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=Wr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);Q("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);Q("ERR_MISSING_ARGS",(...t)=>{Rt(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);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{Rt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=sc(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=sc(r)),r+="n"):r=Wr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);cc.exports={AbortError:uo,aggregateTwoErrors:ac(Gp),hideStackFrames:ac,codes:jr}});var li=P((a_,gc)=>{"use strict";var{ArrayIsArray:ho,ArrayPrototypeIncludes:dc,ArrayPrototypeJoin:pc,ArrayPrototypeMap:Kp,NumberIsInteger:yo,NumberIsNaN:Xp,NumberMAX_SAFE_INTEGER:Jp,NumberMIN_SAFE_INTEGER:Qp,NumberParseInt:Zp,ObjectPrototypeHasOwnProperty:eh,RegExpPrototypeExec:hc,String:th,StringPrototypeToUpperCase:ih,StringPrototypeTrim:rh}=D(),{hideStackFrames:Ee,codes:{ERR_SOCKET_BAD_PORT:nh,ERR_INVALID_ARG_TYPE:te,ERR_INVALID_ARG_VALUE:ci,ERR_OUT_OF_RANGE:Nt,ERR_UNKNOWN_SIGNAL:lc}}=re(),{normalizeEncoding:oh}=ee(),{isAsyncFunction:sh,isArrayBufferView:ah}=ee().types,fc={};function ch(t){return t===(t|0)}s(ch,"isInt32");function lh(t){return t===t>>>0}s(lh,"isUint32");var fh=/^[0-7]+$/,uh="must be a 32-bit unsigned integer or an octal string";function dh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(hc(fh,t)===null)throw new ci(e,t,uh);t=Zp(t,8)}return yc(t,e),t}s(dh,"parseFileMode");var ph=Ee((t,e,i=Qp,r=Jp)=>{if(typeof t!="number")throw new te(e,"number",t);if(!yo(t))throw new Nt(e,"an integer",t);if(t<i||t>r)throw new Nt(e,`>= ${i} && <= ${r}`,t)}),hh=Ee((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new te(e,"number",t);if(!yo(t))throw new Nt(e,"an integer",t);if(t<i||t>r)throw new Nt(e,`>= ${i} && <= ${r}`,t)}),yc=Ee((t,e,i=!1)=>{if(typeof t!="number")throw new te(e,"number",t);if(!yo(t))throw new Nt(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new Nt(e,`>= ${r} && <= ${n}`,t)});function mo(t,e){if(typeof t!="string")throw new te(e,"string",t)}s(mo,"validateString");function yh(t,e,i=void 0,r){if(typeof t!="number")throw new te(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Xp(t))throw new Nt(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(yh,"validateNumber");var mh=Ee((t,e,i)=>{if(!dc(i,t)){let n="must be one of: "+pc(Kp(i,o=>typeof o=="string"?`'${o}'`:th(o)),", ");throw new ci(e,t,n)}});function mc(t,e){if(typeof t!="boolean")throw new te(e,"boolean",t)}s(mc,"validateBoolean");function po(t,e,i){return t==null||!eh(t,e)?i:t[e]}s(po,"getOwnPropertyValueOrDefault");var bh=Ee((t,e,i=null)=>{let r=po(i,"allowArray",!1),n=po(i,"allowFunction",!1);if(!po(i,"nullable",!1)&&t===null||!r&&ho(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new te(e,"Object",t)}),gh=Ee((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new te(e,"a dictionary",t)}),qr=Ee((t,e,i=0)=>{if(!ho(t))throw new te(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ci(e,t,r)}});function wh(t,e){qr(t,e);for(let i=0;i<t.length;i++)mo(t[i],`${e}[${i}]`)}s(wh,"validateStringArray");function Sh(t,e){qr(t,e);for(let i=0;i<t.length;i++)mc(t[i],`${e}[${i}]`)}s(Sh,"validateBooleanArray");function Eh(t,e){qr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new te(n,"AbortSignal",r);bc(r,n)}}s(Eh,"validateAbortSignalArray");function _h(t,e="signal"){if(mo(t,e),fc[t]===void 0)throw fc[ih(t)]!==void 0?new lc(t+" (signals must use all capital letters)"):new lc(t)}s(_h,"validateSignalName");var xh=Ee((t,e="buffer")=>{if(!ah(t))throw new te(e,["Buffer","TypedArray","DataView"],t)});function kh(t,e){let i=oh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ci("encoding",e,`is invalid for data of length ${r}`)}s(kh,"validateEncoding");function vh(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&rh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new nh(e,t,i);return t|0}s(vh,"validatePort");var bc=Ee((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new te(e,"AbortSignal",t)}),Fh=Ee((t,e)=>{if(typeof t!="function")throw new te(e,"Function",t)}),Ih=Ee((t,e)=>{if(typeof t!="function"||sh(t))throw new te(e,"Function",t)}),Ph=Ee((t,e)=>{if(t!==void 0)throw new te(e,"undefined",t)});function Ah(t,e,i){if(!dc(i,t))throw new te(e,`('${pc(i,"|")}')`,t)}s(Ah,"validateUnion");var Oh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function uc(t,e){if(typeof t>"u"||!hc(Oh,t))throw new ci(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(uc,"validateLinkHeaderFormat");function Th(t){if(typeof t=="string")return uc(t,"hints"),t;if(ho(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];uc(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ci("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Th,"validateLinkHeaderValue");gc.exports={isInt32:ch,isUint32:lh,parseFileMode:dh,validateArray:qr,validateStringArray:wh,validateBooleanArray:Sh,validateAbortSignalArray:Eh,validateBoolean:mc,validateBuffer:xh,validateDictionary:gh,validateEncoding:kh,validateFunction:Fh,validateInt32:hh,validateInteger:ph,validateNumber:yh,validateObject:bh,validateOneOf:mh,validatePlainFunction:Ih,validatePort:vh,validateSignalName:_h,validateString:mo,validateUint32:yc,validateUndefined:Ph,validateUnion:Ah,validateAbortSignal:bc,validateLinkHeaderValue:Th}});var gt=P((l_,_c)=>{var $=_c.exports={},$e,ze;function bo(){throw new Error("setTimeout has not been defined")}s(bo,"defaultSetTimout");function go(){throw new Error("clearTimeout has not been defined")}s(go,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?$e=setTimeout:$e=bo}catch{$e=bo}try{typeof clearTimeout=="function"?ze=clearTimeout:ze=go}catch{ze=go}})();function wc(t){if($e===setTimeout)return setTimeout(t,0);if(($e===bo||!$e)&&setTimeout)return $e=setTimeout,setTimeout(t,0);try{return $e(t,0)}catch{try{return $e.call(null,t,0)}catch{return $e.call(this,t,0)}}}s(wc,"runTimeout");function Ch(t){if(ze===clearTimeout)return clearTimeout(t);if((ze===go||!ze)&&clearTimeout)return ze=clearTimeout,clearTimeout(t);try{return ze(t)}catch{try{return ze.call(null,t)}catch{return ze.call(this,t)}}}s(Ch,"runClearTimeout");var ot=[],fi=!1,Lt,$r=-1;function Rh(){!fi||!Lt||(fi=!1,Lt.length?ot=Lt.concat(ot):$r=-1,ot.length&&Sc())}s(Rh,"cleanUpNextTick");function Sc(){if(!fi){var t=wc(Rh);fi=!0;for(var e=ot.length;e;){for(Lt=ot,ot=[];++$r<e;)Lt&&Lt[$r].run();$r=-1,e=ot.length}Lt=null,fi=!1,Ch(t)}}s(Sc,"drainQueue");$.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];ot.push(new Ec(t,e)),ot.length===1&&!fi&&wc(Sc)};function Ec(t,e){this.fun=t,this.array=e}s(Ec,"Item");Ec.prototype.run=function(){this.fun.apply(null,this.array)};$.title="browser";$.browser=!0;$.env={};$.argv=[];$.version="";$.versions={};function st(){}s(st,"noop");$.on=st;$.addListener=st;$.once=st;$.off=st;$.removeListener=st;$.removeAllListeners=st;$.emit=st;$.prependListener=st;$.prependOnceListener=st;$.listeners=function(t){return[]};$.binding=function(t){throw new Error("process.binding is not supported")};$.cwd=function(){return"/"};$.chdir=function(t){throw new Error("process.chdir is not supported")};$.umask=function(){return 0}});var He=P((u_,Dc)=>{"use strict";var{SymbolAsyncIterator:xc,SymbolIterator:kc,SymbolFor:Bt}=D(),vc=Bt("nodejs.stream.destroyed"),Fc=Bt("nodejs.stream.errored"),wo=Bt("nodejs.stream.readable"),So=Bt("nodejs.stream.writable"),Ic=Bt("nodejs.stream.disturbed"),Nh=Bt("nodejs.webstream.isClosedPromise"),Lh=Bt("nodejs.webstream.controllerErrorFunction");function zr(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(zr,"isReadableNodeStream");function Vr(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(Vr,"isWritableNodeStream");function Bh(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Bh,"isDuplexNodeStream");function Ve(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(Ve,"isNodeStream");function Pc(t){return!!(t&&!Ve(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(Pc,"isReadableStream");function Ac(t){return!!(t&&!Ve(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Ac,"isWritableStream");function Oc(t){return!!(t&&!Ve(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Oc,"isTransformStream");function Dh(t){return Pc(t)||Ac(t)||Oc(t)}s(Dh,"isWebStream");function Mh(t,e){return t==null?!1:e===!0?typeof t[xc]=="function":e===!1?typeof t[kc]=="function":typeof t[xc]=="function"||typeof t[kc]=="function"}s(Mh,"isIterable");function Hr(t){if(!Ve(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[vc]||r!=null&&r.destroyed)}s(Hr,"isDestroyed");function Tc(t){if(!Vr(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(Tc,"isWritableEnded");function Uh(t,e){if(!Vr(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(Uh,"isWritableFinished");function Wh(t){if(!zr(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(Wh,"isReadableEnded");function Cc(t,e){if(!zr(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(Cc,"isReadableFinished");function Rc(t){return t&&t[wo]!=null?t[wo]:typeof t?.readable!="boolean"?null:Hr(t)?!1:zr(t)&&t.readable&&!Cc(t)}s(Rc,"isReadable");function Nc(t){return t&&t[So]!=null?t[So]:typeof t?.writable!="boolean"?null:Hr(t)?!1:Vr(t)&&t.writable&&!Tc(t)}s(Nc,"isWritable");function jh(t,e){return Ve(t)?Hr(t)?!0:!(e?.readable!==!1&&Rc(t)||e?.writable!==!1&&Nc(t)):null}s(jh,"isFinished");function qh(t){var e,i;return Ve(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(qh,"isWritableErrored");function $h(t){var e,i;return Ve(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($h,"isReadableErrored");function zh(t){if(!Ve(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"&&Lc(t)?t._closed:null}s(zh,"isClosed");function Lc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Lc,"isOutgoingMessage");function Bc(t){return typeof t._sent100=="boolean"&&Lc(t)}s(Bc,"isServerResponse");function Vh(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(Vh,"isServerRequest");function Hh(t){if(!Ve(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Bc(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(Hh,"willEmitClose");function Yh(t){var e;return!!(t&&((e=t[Ic])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Yh,"isDisturbed");function Gh(t){var e,i,r,n,o,a,c,l,u,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[Fc])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(c=t._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(l=t._writableState)===null||l===void 0?void 0:l.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(Gh,"isErrored");Dc.exports={isDestroyed:Hr,kIsDestroyed:vc,isDisturbed:Yh,kIsDisturbed:Ic,isErrored:Gh,kIsErrored:Fc,isReadable:Rc,kIsReadable:wo,kIsClosedPromise:Nh,kControllerErrorFunction:Lh,kIsWritable:So,isClosed:zh,isDuplexNodeStream:Bh,isFinished:jh,isIterable:Mh,isReadableNodeStream:zr,isReadableStream:Pc,isReadableEnded:Wh,isReadableFinished:Cc,isReadableErrored:$h,isNodeStream:Ve,isWebStream:Dh,isWritable:Nc,isWritableNodeStream:Vr,isWritableStream:Ac,isWritableEnded:Tc,isWritableFinished:Uh,isWritableErrored:qh,isServerRequest:Vh,isServerResponse:Bc,willEmitClose:Hh,isTransformStream:Oc}});var at=P((p_,vo)=>{var wt=gt(),{AbortError:Hc,codes:Kh}=re(),{ERR_INVALID_ARG_TYPE:Xh,ERR_STREAM_PREMATURE_CLOSE:Mc}=Kh,{kEmptyObject:_o,once:xo}=ee(),{validateAbortSignal:Jh,validateFunction:Qh,validateObject:Zh,validateBoolean:ey}=li(),{Promise:ty,PromisePrototypeThen:iy,SymbolDispose:Yc}=D(),{isClosed:ry,isReadable:Uc,isReadableNodeStream:Eo,isReadableStream:ny,isReadableFinished:Wc,isReadableErrored:jc,isWritable:qc,isWritableNodeStream:$c,isWritableStream:oy,isWritableFinished:zc,isWritableErrored:Vc,isNodeStream:sy,willEmitClose:ay,kIsClosedPromise:cy}=He(),ui;function ly(t){return t.setHeader&&typeof t.abort=="function"}s(ly,"isRequest");var ko=s(()=>{},"nop");function Gc(t,e,i){var r,n;if(arguments.length===2?(i=e,e=_o):e==null?e=_o:Zh(e,"options"),Qh(i,"callback"),Jh(e.signal,"options.signal"),i=xo(i),ny(t)||oy(t))return fy(t,e,i);if(!sy(t))throw new Xh("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),c=t._writableState,l=t._readableState,u=s(()=>{t.writable||b()},"onlegacyfinish"),d=ay(t)&&Eo(t)===o&&$c(t)===a,p=zc(t,!1),b=s(()=>{p=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||m)&&i.call(t)},"onfinish"),m=Wc(t,!1),w=s(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||p)&&i.call(t)},"onend"),g=s(V=>{i.call(t,V)},"onerror"),F=ry(t),_=s(()=>{F=!0;let V=Vc(t)||jc(t);if(V&&typeof V!="boolean")return i.call(t,V);if(o&&!m&&Eo(t,!0)&&!Wc(t,!1))return i.call(t,new Mc);if(a&&!p&&!zc(t,!1))return i.call(t,new Mc);i.call(t)},"onclose"),O=s(()=>{F=!0;let V=Vc(t)||jc(t);if(V&&typeof V!="boolean")return i.call(t,V);i.call(t)},"onclosed"),U=s(()=>{t.req.on("finish",b)},"onrequest");ly(t)?(t.on("complete",b),d||t.on("abort",_),t.req?U():t.on("request",U)):a&&!c&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",_),t.on("end",w),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",_),F?wt.nextTick(_):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||wt.nextTick(O):(!o&&(!d||Uc(t))&&(p||qc(t)===!1)||!a&&(!d||qc(t))&&(m||Uc(t)===!1)||l&&t.req&&t.aborted)&&wt.nextTick(O);let I=s(()=>{i=ko,t.removeListener("aborted",_),t.removeListener("complete",b),t.removeListener("abort",_),t.removeListener("request",U),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",_)},"cleanup");if(e.signal&&!F){let V=s(()=>{let kt=i;I(),kt.call(t,new Hc(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)wt.nextTick(V);else{ui=ui||ee().addAbortListener;let kt=ui(e.signal,V),de=i;i=xo((...Ht)=>{kt[Yc](),de.apply(t,Ht)})}}return I}s(Gc,"eos");function fy(t,e,i){let r=!1,n=ko;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new Hc(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)wt.nextTick(n);else{ui=ui||ee().addAbortListener;let a=ui(e.signal,n),c=i;i=xo((...l)=>{a[Yc](),c.apply(t,l)})}let o=s((...a)=>{r||wt.nextTick(()=>i.apply(t,a))},"resolverFn");return iy(t[cy].promise,o,o),ko}s(fy,"eosWeb");function uy(t,e){var i;let r=!1;return e===null&&(e=_o),(i=e)!==null&&i!==void 0&&i.cleanup&&(ey(e.cleanup,"cleanup"),r=e.cleanup),new ty((n,o)=>{let a=Gc(t,e,c=>{r&&a(),c?o(c):n()})})}s(uy,"finished");vo.exports=Gc;vo.exports.finished=uy});var Dt=P((y_,il)=>{"use strict";var Ye=gt(),{aggregateTwoErrors:dy,codes:{ERR_MULTIPLE_CALLBACK:py},AbortError:hy}=re(),{Symbol:Jc}=D(),{kIsDestroyed:yy,isDestroyed:my,isFinished:by,isServerRequest:gy}=He(),Qc=Jc("kDestroy"),Fo=Jc("kConstruct");function Zc(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Zc,"checkError");function wy(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):(Zc(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Kc(this,t,e):this.once(Qc,function(o){Kc(this,dy(o,t),e)}),this)}s(wy,"destroy");function Kc(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,c=t._writableState;Zc(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ye.nextTick(Sy,t,o):Ye.nextTick(el,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Kc,"_destroy");function Sy(t,e){Io(t,e),el(t)}s(Sy,"emitErrorCloseNT");function el(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(el,"emitCloseNT");function Io(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(Io,"emitErrorNT");function Ey(){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(Ey,"undestroy");function Po(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?Ye.nextTick(Io,t,e):Io(t,e))}s(Po,"errorOrDestroy");function _y(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)&&Ye.nextTick(xy,t)}s(_y,"construct");function xy(t){let e=!1;function i(r){if(e){Po(t,r??new py);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(Qc,r):r?Po(t,r,!0):Ye.nextTick(ky,t)}s(i,"onConstruct");try{t._construct(r=>{Ye.nextTick(i,r)})}catch(r){Ye.nextTick(i,r)}}s(xy,"constructNT");function ky(t){t.emit(Fo)}s(ky,"emitConstructNT");function Xc(t){return t?.setHeader&&typeof t.abort=="function"}s(Xc,"isRequest");function tl(t){t.emit("close")}s(tl,"emitCloseLegacy");function vy(t,e){t.emit("error",e),Ye.nextTick(tl,t)}s(vy,"emitErrorCloseLegacy");function Fy(t,e){!t||my(t)||(!e&&!by(t)&&(e=new hy),gy(t)?(t.socket=null,t.destroy(e)):Xc(t)?t.abort():Xc(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ye.nextTick(vy,t,e):Ye.nextTick(tl,t),t.destroyed||(t[yy]=!0))}s(Fy,"destroyer");il.exports={construct:_y,destroyer:Fy,destroy:wy,undestroy:Ey,errorOrDestroy:Po}});var Kr=P((b_,nl)=>{"use strict";var{ArrayIsArray:Iy,ObjectSetPrototypeOf:rl}=D(),{EventEmitter:Yr}=Xi();function Gr(t){Yr.call(this,t)}s(Gr,"Stream");rl(Gr.prototype,Yr.prototype);rl(Gr,Yr);Gr.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",c));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function c(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(c,"onclose");function l(d){u(),Yr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ao(i,"error",l),Ao(t,"error",l);function u(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),t.removeListener("error",l),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 Ao(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):Iy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Ao,"prependListener");nl.exports={Stream:Gr,prependListener:Ao}});var Ji=P((w_,Xr)=>{"use strict";var{SymbolDispose:Py}=D(),{AbortError:ol,codes:Ay}=re(),{isNodeStream:sl,isWebStream:Oy,kControllerErrorFunction:Ty}=He(),Cy=at(),{ERR_INVALID_ARG_TYPE:al}=Ay,Oo,Ry=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new al(e,"AbortSignal",t)},"validateAbortSignal");Xr.exports.addAbortSignal=s(function(e,i){if(Ry(e,"signal"),!sl(i)&&!Oy(i))throw new al("stream",["ReadableStream","WritableStream","Stream"],i);return Xr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Xr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=sl(e)?()=>{e.destroy(new ol(void 0,{cause:t.reason}))}:()=>{e[Ty](new ol(void 0,{cause:t.reason}))};if(t.aborted)i();else{Oo=Oo||ee().addAbortListener;let r=Oo(t,i);Cy(e,r[Py])}return e}});var fl=P((__,ll)=>{"use strict";var{StringPrototypeSlice:cl,SymbolIterator:Ny,TypedArrayPrototypeSet:Jr,Uint8Array:Ly}=D(),{Buffer:To}=we(),{inspect:By}=ee();ll.exports=class{static{s(this,"BufferList")}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 To.alloc(0);let i=To.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}*[Ny](){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+=cl(o,0,e),this.head=r,r.data=cl(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=To.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 Ly(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 By(this,{...i,depth:0,customInspect:!1})}}});var Qi=P((k_,hl)=>{"use strict";var{MathFloor:Dy,NumberIsInteger:My}=D(),{validateInteger:Uy}=li(),{ERR_INVALID_ARG_VALUE:Wy}=re().codes,ul=16*1024,dl=16;function jy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(jy,"highWaterMarkFrom");function pl(t){return t?dl:ul}s(pl,"getDefaultHighWaterMark");function qy(t,e){Uy(e,"value",0),t?dl=e:ul=e}s(qy,"setDefaultHighWaterMark");function $y(t,e,i,r){let n=jy(e,r,i);if(n!=null){if(!My(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new Wy(o,n)}return Dy(n)}return pl(t.objectMode)}s($y,"getHighWaterMark");hl.exports={getHighWaterMark:$y,getDefaultHighWaterMark:pl,setDefaultHighWaterMark:qy}});var bl=P((Co,ml)=>{var Qr=we(),Ge=Qr.Buffer;function yl(t,e){for(var i in t)e[i]=t[i]}s(yl,"copyProps");Ge.from&&Ge.alloc&&Ge.allocUnsafe&&Ge.allocUnsafeSlow?ml.exports=Qr:(yl(Qr,Co),Co.Buffer=Mt);function Mt(t,e,i){return Ge(t,e,i)}s(Mt,"SafeBuffer");Mt.prototype=Object.create(Ge.prototype);yl(Ge,Mt);Mt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ge(t,e,i)};Mt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ge(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};Mt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ge(t)};Mt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Qr.SlowBuffer(t)}});var Sl=P(wl=>{"use strict";var No=bl().Buffer,gl=No.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 zy(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(zy,"_normalizeEncoding");function Vy(t){var e=zy(t);if(typeof e!="string"&&(No.isEncoding===gl||!gl(t)))throw new Error("Unknown encoding: "+t);return e||t}s(Vy,"normalizeEncoding");wl.StringDecoder=Zi;function Zi(t){this.encoding=Vy(t);var e;switch(this.encoding){case"utf16le":this.text=Jy,this.end=Qy,e=4;break;case"utf8":this.fillLast=Gy,e=4;break;case"base64":this.text=Zy,this.end=em,e=3;break;default:this.write=tm,this.end=im;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=No.allocUnsafe(e)}s(Zi,"StringDecoder");Zi.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||""};Zi.prototype.end=Xy;Zi.prototype.text=Ky;Zi.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 Hy(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(Hy,"utf8CheckIncomplete");function Yy(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(Yy,"utf8CheckExtraBytes");function Gy(t){var e=this.lastTotal-this.lastNeed,i=Yy(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(Gy,"utf8FillLast");function Ky(t,e){var i=Hy(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(Ky,"utf8Text");function Xy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Xy,"utf8End");function Jy(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(Jy,"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 Zy(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(Zy,"base64Text");function em(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(em,"base64End");function tm(t){return t.toString(this.encoding)}s(tm,"simpleWrite");function im(t){return t&&t.length?this.write(t):""}s(im,"simpleEnd")});var Lo=P((A_,kl)=>{"use strict";var El=gt(),{PromisePrototypeThen:rm,SymbolAsyncIterator:_l,SymbolIterator:xl}=D(),{Buffer:nm}=we(),{ERR_INVALID_ARG_TYPE:om,ERR_STREAM_NULL_VALUES:sm}=re().codes;function am(t,e,i){let r;if(typeof e=="string"||e instanceof nm)return new t({objectMode:!0,...i,read:s(function(){this.push(e),this.push(null)},"read")});let n;if(e&&e[_l])n=!0,r=e[_l]();else if(e&&e[xl])n=!1,r=e[xl]();else throw new om("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(u,d){rm(c(u),()=>El.nextTick(d,u),p=>El.nextTick(d,p||u))};async function c(u){let d=u!=null,p=typeof r.throw=="function";if(d&&p){let{value:b,done:m}=await r.throw(u);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:u,done:d}=n?await r.next():r.next();if(d)o.push(null);else{let p=u&&typeof u.then=="function"?await u:u;if(p===null)throw a=!1,new sm;if(o.push(p))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(l,"next"),o}s(am,"from");kl.exports=am});var tr=P((T_,ql)=>{var ke=gt(),{ArrayPrototypeIndexOf:cm,NumberIsInteger:lm,NumberIsNaN:fm,NumberParseInt:um,ObjectDefineProperties:$o,ObjectKeys:dm,ObjectSetPrototypeOf:Il,Promise:Pl,SafeSet:pm,SymbolAsyncDispose:hm,SymbolAsyncIterator:ym,Symbol:mm}=D();ql.exports=x;x.ReadableState=rn;var{EventEmitter:bm}=Xi(),{Stream:St,prependListener:gm}=Kr(),{Buffer:Bo}=we(),{addAbortSignal:wm}=Ji(),Al=at(),v=ee().debuglog("stream",t=>{v=t}),Sm=fl(),hi=Dt(),{getHighWaterMark:Em,getDefaultHighWaterMark:_m}=Qi(),{aggregateTwoErrors:vl,codes:{ERR_INVALID_ARG_TYPE:xm,ERR_METHOD_NOT_IMPLEMENTED:km,ERR_OUT_OF_RANGE:vm,ERR_STREAM_PUSH_AFTER_EOF:Fm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Im},AbortError:Pm}=re(),{validateObject:Am}=li(),Ut=mm("kPaused"),{StringDecoder:Ol}=Sl(),Om=Lo();Il(x.prototype,St.prototype);Il(x,St);var Do=s(()=>{},"nop"),{errorOrDestroy:di}=hi,pi=1,Tm=2,Tl=4,er=8,Cl=16,Zr=32,en=64,Rl=128,Cm=256,Rm=512,Nm=1024,jo=2048,qo=4096,Lm=8192,Bm=16384,Dm=32768,Nl=65536,Mm=1<<17,Um=1<<18;function G(t){return{enumerable:!1,get:s(function(){return(this.state&t)!==0},"get"),set:s(function(e){e?this.state|=t:this.state&=~t},"set")}}s(G,"makeBitMapDescriptor");$o(rn.prototype,{objectMode:G(pi),ended:G(Tm),endEmitted:G(Tl),reading:G(er),constructed:G(Cl),sync:G(Zr),needReadable:G(en),emittedReadable:G(Rl),readableListening:G(Cm),resumeScheduled:G(Rm),errorEmitted:G(Nm),emitClose:G(jo),autoDestroy:G(qo),destroyed:G(Lm),closed:G(Bm),closeEmitted:G(Dm),multiAwaitDrain:G(Nl),readingMore:G(Mm),dataEmitted:G(Um)});function rn(t,e,i){typeof i!="boolean"&&(i=e instanceof Ke()),this.state=jo|qo|Cl|Zr,t&&t.objectMode&&(this.state|=pi),i&&t&&t.readableObjectMode&&(this.state|=pi),this.highWaterMark=t?Em(this,t,"readableHighWaterMark",i):_m(!1),this.buffer=new Sm,this.length=0,this.pipes=[],this.flowing=null,this[Ut]=null,t&&t.emitClose===!1&&(this.state&=~jo),t&&t.autoDestroy===!1&&(this.state&=~qo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Ol(t.encoding),this.encoding=t.encoding)}s(rn,"ReadableState");function x(t){if(!(this instanceof x))return new x(t);let e=this instanceof Ke();this._readableState=new rn(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&&wm(t.signal,this)),St.call(this,t),hi.construct(this,()=>{this._readableState.needReadable&&tn(this,this._readableState)})}s(x,"Readable");x.prototype.destroy=hi.destroy;x.prototype._undestroy=hi.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[bm.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype[hm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Pm,this.destroy(t)),new Pl((e,i)=>Al(this,r=>r&&r!==t?i(r):e(null)))};x.prototype.push=function(t,e){return Ll(this,t,e,!1)};x.prototype.unshift=function(t,e){return Ll(this,t,e,!0)};function Ll(t,e,i,r){v("readableAddChunk",e);let n=t._readableState,o;if(n.state&pi||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=Bo.from(e,i).toString(n.encoding):(e=Bo.from(e,i),i=""))):e instanceof Bo?i="":St._isUint8Array(e)?(e=St._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new xm("chunk",["string","Buffer","Uint8Array"],e))),o)di(t,o);else if(e===null)n.state&=~er,qm(t,n);else if(n.state&pi||e&&e.length>0)if(r)if(n.state&Tl)di(t,new Im);else{if(n.destroyed||n.errored)return!1;Mo(t,n,e,!0)}else if(n.ended)di(t,new Fm);else{if(n.destroyed||n.errored)return!1;n.state&=~er,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Mo(t,n,e,!1):tn(t,n)):Mo(t,n,e,!1)}else r||(n.state&=~er,tn(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Ll,"readableAddChunk");function Mo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Nl?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&en&&nn(t)),tn(t,e)}s(Mo,"addChunk");x.prototype.isPaused=function(){let t=this._readableState;return t[Ut]===!0||t.flowing===!1};x.prototype.setEncoding=function(t){let e=new Ol(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 Wm=1073741824;function jm(t){if(t>Wm)throw new vm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(jm,"computeNewHighWaterMark");function Fl(t,e){return t<=0||e.length===0&&e.ended?0:e.state&pi?1:fm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(Fl,"howMuchToRead");x.prototype.read=function(t){v("read",t),t===void 0?t=NaN:lm(t)||(t=um(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=jm(t)),t!==0&&(e.state&=~Rl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return v("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Uo(this):nn(this),null;if(t=Fl(t,e),t===0&&e.ended)return e.length===0&&Uo(this),null;let r=(e.state&en)!==0;if(v("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,v("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,v("reading, ended or constructing",r);else if(r){v("do read"),e.state|=er|Zr,e.length===0&&(e.state|=en);try{this._read(e.highWaterMark)}catch(o){di(this,o)}e.state&=~Zr,e.reading||(t=Fl(i,e))}let n;return t>0?n=Wl(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 qm(t,e){if(v("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?nn(t):(e.needReadable=!1,e.emittedReadable=!0,Bl(t))}}s(qm,"onEofChunk");function nn(t){let e=t._readableState;v("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(v("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(Bl,t))}s(nn,"emitReadable");function Bl(t){let e=t._readableState;v("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,Ml(t)}s(Bl,"emitReadable_");function tn(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick($m,t,e))}s(tn,"maybeReadMore");function $m(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(v("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s($m,"maybeReadMore_");x.prototype._read=function(t){throw new km("_read()")};x.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new pm(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),v("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?c:F;r.endEmitted?ke.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(_,O){v("onunpipe"),_===i&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){v("onend"),t.end()}s(c,"onend");let l,u=!1;function d(){v("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",F),i.removeListener("data",b),u=!0,l&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}s(d,"cleanup");function p(){u||(r.pipes.length===1&&r.pipes[0]===t?(v("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(v("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),l||(l=zm(i,t),t.on("drain",l))}s(p,"pause"),i.on("data",b);function b(_){v("ondata");let O=t.write(_);v("dest.write",O),O===!1&&p()}s(b,"ondata");function m(_){if(v("onerror",_),F(),t.removeListener("error",m),t.listenerCount("error")===0){let O=t._writableState||t._readableState;O&&!O.errorEmitted?di(t,_):t.emit("error",_)}}s(m,"onerror"),gm(t,"error",m);function w(){t.removeListener("finish",g),F()}s(w,"onclose"),t.once("close",w);function g(){v("onfinish"),t.removeListener("close",w),F()}s(g,"onfinish"),t.once("finish",g);function F(){v("unpipe"),i.unpipe(t)}return s(F,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?p():r.flowing||(v("pipe resume"),i.resume()),t};function zm(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(v("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(v("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(zm,"pipeOnDrain");x.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=cm(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};x.prototype.on=function(t,e){let i=St.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,v("on readable",r.length,r.reading),r.length?nn(this):r.reading||ke.nextTick(Vm,this)),i};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let i=St.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(Dl,this),i};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=St.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(Dl,this),e};function Dl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ut]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Dl,"updateReadableListening");function Vm(t){v("readable nexttick read 0"),t.read(0)}s(Vm,"nReadingNextTick");x.prototype.resume=function(){let t=this._readableState;return t.flowing||(v("resume"),t.flowing=!t.readableListening,Hm(this,t)),t[Ut]=!1,this};function Hm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Ym,t,e))}s(Hm,"resume");function Ym(t,e){v("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ml(t),e.flowing&&!e.reading&&t.read(0)}s(Ym,"resume_");x.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ut]=!0,this};function Ml(t){let e=t._readableState;for(v("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Ml,"flow");x.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=>{di(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=dm(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};x.prototype[ym]=function(){return Ul(this)};x.prototype.iterator=function(t){return t!==void 0&&Am(t,"options"),Ul(this,t)};function Ul(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let i=Gm(t,e);return i.stream=t,i}s(Ul,"streamToAsyncIterator");async function*Gm(t,e){let i=Do;function r(a){this===t?(i(),i=Do):i=a}s(r,"next"),t.on("readable",r);let n,o=Al(t,{writable:!1},a=>{n=a?vl(n,a):null,i(),i=Do});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 Pl(r)}}}catch(a){throw n=vl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?hi.destroyer(t,null):(t.off("readable",r),o())}}s(Gm,"createAsyncIterator");$o(x.prototype,{readable:{__proto__:null,get:s(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:s(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});$o(rn.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Ut]!==!1},"get"),set:s(function(t){this[Ut]=!!t},"set")}});x._fromList=Wl;function Wl(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(Wl,"fromList");function Uo(t){let e=t._readableState;v("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Km,e,t))}s(Uo,"endReadable");function Km(t,e){if(v("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(Xm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Km,"endReadableNT");function Xm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Xm,"endWritableNT");x.from=function(t,e){return Om(x,t,e)};var Wo;function jl(){return Wo===void 0&&(Wo={}),Wo}s(jl,"lazyWebStreams");x.fromWeb=function(t,e){return jl().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return jl().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var i,r;return new x({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:s(function(n,o){hi.destroyer(t,n),o(n)},"destroy")}).wrap(t)}});var ln=P((R_,ef)=>{var Wt=gt(),{ArrayPrototypeSlice:Vl,Error:Jm,FunctionPrototypeSymbolHasInstance:Hl,ObjectDefineProperty:Yl,ObjectDefineProperties:Qm,ObjectSetPrototypeOf:Gl,StringPrototypeToLowerCase:Zm,Symbol:eb,SymbolHasInstance:tb}=D();ef.exports=M;M.WritableState=nr;var{EventEmitter:ib}=Xi(),ir=Kr().Stream,{Buffer:on}=we(),cn=Dt(),{addAbortSignal:rb}=Ji(),{getHighWaterMark:nb,getDefaultHighWaterMark:ob}=Qi(),{ERR_INVALID_ARG_TYPE:sb,ERR_METHOD_NOT_IMPLEMENTED:ab,ERR_MULTIPLE_CALLBACK:Kl,ERR_STREAM_CANNOT_PIPE:cb,ERR_STREAM_DESTROYED:rr,ERR_STREAM_ALREADY_FINISHED:lb,ERR_STREAM_NULL_VALUES:fb,ERR_STREAM_WRITE_AFTER_END:ub,ERR_UNKNOWN_ENCODING:Xl}=re().codes,{errorOrDestroy:yi}=cn;Gl(M.prototype,ir.prototype);Gl(M,ir);function Ho(){}s(Ho,"nop");var mi=eb("kOnFinished");function nr(t,e,i){typeof i!="boolean"&&(i=e instanceof Ke()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?nb(this,t,"writableHighWaterMark",i):ob(!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=pb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,an(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[mi]=[]}s(nr,"WritableState");function an(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(an,"resetBuffer");nr.prototype.getBuffer=s(function(){return Vl(this.buffered,this.bufferedIndex)},"getBuffer");Yl(nr.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function M(t){let e=this instanceof Ke();if(!e&&!Hl(M,this))return new M(t);this._writableState=new nr(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&&rb(t.signal,this)),ir.call(this,t),cn.construct(this,()=>{let i=this._writableState;i.writing||Go(this,i),Ko(this,i)})}s(M,"Writable");Yl(M,tb,{__proto__:null,value:s(function(t){return Hl(this,t)?!0:this!==M?!1:t&&t._writableState instanceof nr},"value")});M.prototype.pipe=function(){yi(this,new cb)};function Jl(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"&&!on.isEncoding(i))throw new Xl(i);typeof r!="function"&&(r=Ho)}if(e===null)throw new fb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=on.from(e,i),i="buffer");else if(e instanceof on)i="buffer";else if(ir._isUint8Array(e))e=ir._uint8ArrayToBuffer(e),i="buffer";else throw new sb("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new ub:n.destroyed&&(o=new rr("write")),o?(Wt.nextTick(r,o),yi(t,o,!0),o):(n.pendingcb++,db(t,n,e,i,r))}s(Jl,"_write");M.prototype.write=function(t,e,i){return Jl(this,t,e,i)===!0};M.prototype.cork=function(){this._writableState.corked++};M.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Go(this,t))};M.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Zm(e)),!on.isEncoding(e))throw new Xl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function db(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!==Ho&&(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(db,"writeOrBuffer");function $l(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new rr("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s($l,"doWrite");function zl(t,e,i,r){--e.pendingcb,r(i),Yo(e),yi(t,i)}s(zl,"onwriteError");function pb(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){yi(t,new Kl);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?Wt.nextTick(zl,t,i,e,n):zl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Go(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},Wt.nextTick(hb,i.afterWriteTickInfo)):Ql(t,i,1,n))}s(pb,"onwrite");function hb({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Ql(t,e,i,r)}s(hb,"afterWriteTick");function Ql(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),Ko(t,e)}s(Ql,"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],c=t.objectMode?1:o.length;t.length-=c,a((e=t.errored)!==null&&e!==void 0?e:new rr("write"))}let i=t[mi].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new rr("end"))}an(t)}s(Yo,"errorBuffer");function Go(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 c=e.allNoop?Ho:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},l=e.allNoop&&a===0?i:Vl(i,a);l.allBuffers=e.allBuffers,$l(t,e,!0,e.length,l,"",c),an(e)}else{do{let{chunk:c,encoding:l,callback:u}=i[a];i[a++]=null;let d=n?1:c.length;$l(t,e,!1,d,c,l,u)}while(a<i.length&&!e.writing);a===i.length?an(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Go,"clearBuffer");M.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new ab("_write()")};M.prototype._writev=null;M.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=Jl(this,t,e);o instanceof Jm&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Ko(this,r,!0),r.ended=!0):r.finished?n=new lb("end"):r.destroyed&&(n=new rr("end"))),typeof i=="function"&&(n||r.finished?Wt.nextTick(i,n):r[mi].push(i)),this};function sn(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(sn,"needFinish");function yb(t,e){let i=!1;function r(n){if(i){yi(t,n??Kl());return}if(i=!0,e.pendingcb--,n){let o=e[mi].splice(0);for(let a=0;a<o.length;a++)o[a](n);yi(t,n,e.sync)}else sn(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Wt.nextTick(Vo,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(yb,"callFinal");function mb(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,yb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(mb,"prefinish");function Ko(t,e,i){sn(e)&&(mb(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Wt.nextTick((r,n)=>{sn(n)?Vo(r,n):n.pendingcb--},t,e)):sn(e)&&(e.pendingcb++,Vo(t,e))))}s(Ko,"finishMaybe");function Vo(t,e){e.pendingcb--,e.finished=!0;let i=e[mi].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(Vo,"finish");Qm(M.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:s(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:s(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var bb=cn.destroy;M.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[mi].length)&&Wt.nextTick(Yo,i),bb.call(this,t,e),this};M.prototype._undestroy=cn.undestroy;M.prototype._destroy=function(t,e){e(t)};M.prototype[ib.captureRejectionSymbol]=function(t){this.destroy(t)};var zo;function Zl(){return zo===void 0&&(zo={}),zo}s(Zl,"lazyWebStreams");M.fromWeb=function(t,e){return Zl().newStreamWritableFromWritableStream(t,e)};M.toWeb=function(t){return Zl().newWritableStreamFromStreamWritable(t)}});var mf=P((L_,yf)=>{var Xo=gt(),gb=we(),{isReadable:wb,isWritable:Sb,isIterable:tf,isNodeStream:Eb,isReadableNodeStream:rf,isWritableNodeStream:nf,isDuplexNodeStream:_b,isReadableStream:of,isWritableStream:sf}=He(),af=at(),{AbortError:pf,codes:{ERR_INVALID_ARG_TYPE:xb,ERR_INVALID_RETURN_VALUE:cf}}=re(),{destroyer:gi}=Dt(),kb=Ke(),hf=tr(),vb=ln(),{createDeferredPromise:lf}=ee(),ff=Lo(),uf=globalThis.Blob||gb.Blob,Fb=s(typeof uf<"u"?function(e){return e instanceof uf}:function(e){return!1},"isBlob"),Ib=globalThis.AbortController||si().AbortController,{FunctionPrototypeCall:df}=D(),Et=class extends kb{static{s(this,"Duplexify")}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)}};yf.exports=s(function t(e,i){if(_b(e))return e;if(rf(e))return bi({readable:e});if(nf(e))return bi({writable:e});if(Eb(e))return bi({writable:!1,readable:!1});if(of(e))return bi({readable:hf.fromWeb(e)});if(sf(e))return bi({writable:vb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:c}=Pb(e);if(tf(n))return ff(Et,n,{objectMode:!0,write:o,final:a,destroy:c});let l=n?.then;if(typeof l=="function"){let u,d=df(l,n,p=>{if(p!=null)throw new cf("nully","body",p)},p=>{gi(u,p)});return u=new Et({objectMode:!0,readable:!1,write:o,final:s(function(p){a(async()=>{try{await d,Xo.nextTick(p,null)}catch(b){Xo.nextTick(p,b)}})},"final"),destroy:c})}throw new cf("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Fb(e))return t(e.arrayBuffer());if(tf(e))return ff(Et,e,{objectMode:!0,writable:!1});if(of(e?.readable)&&sf(e?.writable))return Et.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?rf(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?nf(e?.writable)?e?.writable:t(e.writable):void 0;return bi({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return df(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{gi(n,o)}),n=new Et({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new xb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function Pb(t){let{promise:e,resolve:i}=lf(),r=new Ib,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:c,done:l,cb:u}=await a;if(Xo.nextTick(u),l)return;if(n.aborted)throw new pf(void 0,{cause:n.reason});({promise:e,resolve:i}=lf()),yield c}}(),{signal:n}),write:s(function(a,c,l){let u=i;i=null,u({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){r.abort(),c(a)},"destroy")}}s(Pb,"fromAsyncGen");function bi(t){let e=t.readable&&typeof t.readable.read!="function"?hf.wrap(t.readable):t.readable,i=t.writable,r=!!wb(e),n=!!Sb(i),o,a,c,l,u;function d(p){let b=l;l=null,b?b(p):p&&u.destroy(p)}return s(d,"onfinished"),u=new Et({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(af(i,p=>{n=!1,p&&gi(e,p),d(p)}),u._write=function(p,b,m){i.write(p,b)?m():o=m},u._final=function(p){i.end(),a=p},i.on("drain",function(){if(o){let p=o;o=null,p()}}),i.on("finish",function(){if(a){let p=a;a=null,p()}})),r&&(af(e,p=>{r=!1,p&&gi(e,p),d(p)}),e.on("readable",function(){if(c){let p=c;c=null,p()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let p=e.read();if(p===null){c=u._read;return}if(!u.push(p))return}}),u._destroy=function(p,b){!p&&l!==null&&(p=new pf),c=null,o=null,a=null,l===null?b(p):(l=b,gi(i,p),gi(e,p))},u}s(bi,"_duplexify")});var Ke=P((D_,wf)=>{"use strict";var{ObjectDefineProperties:Ab,ObjectGetOwnPropertyDescriptor:ct,ObjectKeys:Ob,ObjectSetPrototypeOf:bf}=D();wf.exports=ve;var Zo=tr(),_e=ln();bf(ve.prototype,Zo.prototype);bf(ve,Zo);{let t=Ob(_e.prototype);for(let e=0;e<t.length;e++){let i=t[e];ve.prototype[i]||(ve.prototype[i]=_e.prototype[i])}}function ve(t){if(!(this instanceof ve))return new ve(t);Zo.call(this,t),_e.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(ve,"Duplex");Ab(ve.prototype,{writable:{__proto__:null,...ct(_e.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ct(_e.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ct(_e.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ct(_e.prototype,"writableBuffer")},writableLength:{__proto__:null,...ct(_e.prototype,"writableLength")},writableFinished:{__proto__:null,...ct(_e.prototype,"writableFinished")},writableCorked:{__proto__:null,...ct(_e.prototype,"writableCorked")},writableEnded:{__proto__:null,...ct(_e.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ct(_e.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var Jo;function gf(){return Jo===void 0&&(Jo={}),Jo}s(gf,"lazyWebStreams");ve.fromWeb=function(t,e){return gf().newStreamDuplexFromReadableWritablePair(t,e)};ve.toWeb=function(t){return gf().newReadableWritablePairFromDuplex(t)};var Qo;ve.from=function(t){return Qo||(Qo=mf()),Qo(t,"body")}});var is=P((U_,Ef)=>{"use strict";var{ObjectSetPrototypeOf:Sf,Symbol:Tb}=D();Ef.exports=lt;var{ERR_METHOD_NOT_IMPLEMENTED:Cb}=re().codes,ts=Ke(),{getHighWaterMark:Rb}=Qi();Sf(lt.prototype,ts.prototype);Sf(lt,ts);var or=Tb("kCallback");function lt(t){if(!(this instanceof lt))return new lt(t);let e=t?Rb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ts.call(this,t),this._readableState.sync=!1,this[or]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Nb)}s(lt,"Transform");function es(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(es,"final");function Nb(){this._final!==es&&es.call(this)}s(Nb,"prefinish");lt.prototype._final=es;lt.prototype._transform=function(t,e,i){throw new Cb("_transform()")};lt.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),n.ended||o===r.length||r.length<r.highWaterMark?i():this[or]=i})};lt.prototype._read=function(){if(this[or]){let t=this[or];this[or]=null,t()}}});var ns=P((j_,xf)=>{"use strict";var{ObjectSetPrototypeOf:_f}=D();xf.exports=wi;var rs=is();_f(wi.prototype,rs.prototype);_f(wi,rs);function wi(t){if(!(this instanceof wi))return new wi(t);rs.call(this,t)}s(wi,"PassThrough");wi.prototype._transform=function(t,e,i){i(null,t)}});var pn=P(($_,Pf)=>{var sr=gt(),{ArrayIsArray:Lb,Promise:Bb,SymbolAsyncIterator:Db,SymbolDispose:Mb}=D(),dn=at(),{once:Ub}=ee(),Wb=Dt(),kf=Ke(),{aggregateTwoErrors:jb,codes:{ERR_INVALID_ARG_TYPE:ps,ERR_INVALID_RETURN_VALUE:os,ERR_MISSING_ARGS:qb,ERR_STREAM_DESTROYED:$b,ERR_STREAM_PREMATURE_CLOSE:zb},AbortError:Vb}=re(),{validateFunction:Hb,validateAbortSignal:Yb}=li(),{isIterable:jt,isReadable:ss,isReadableNodeStream:un,isNodeStream:vf,isTransformStream:Si,isWebStream:Gb,isReadableStream:as,isReadableFinished:Kb}=He(),Xb=globalThis.AbortController||si().AbortController,cs,ls,fs;function Ff(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=dn(t,{readable:e,writable:i},o=>{r=!o});return{destroy:s(o=>{r||(r=!0,Wb.destroyer(t,o||new $b("pipe")))},"destroy"),cleanup:n}}s(Ff,"destroyer");function Jb(t){return Hb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Jb,"popCallback");function us(t){if(jt(t))return t;if(un(t))return Qb(t);throw new ps("val",["Readable","Iterable","AsyncIterable"],t)}s(us,"makeAsyncIterable");async function*Qb(t){ls||(ls=tr()),yield*ls.prototype[Db].call(t)}s(Qb,"fromReadable");async function fn(t,e,i,{end:r}){let n,o=null,a=s(u=>{if(u&&(n=u),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Bb((u,d)=>{n?d(n):o=s(()=>{n?d(n):u()},"onresolve")}),"wait");e.on("drain",a);let l=dn(e,{readable:!1},a);try{e.writableNeedDrain&&await c();for await(let u of t)e.write(u)||await c();r&&(e.end(),await c()),i()}catch(u){i(n!==u?jb(n,u):u)}finally{l(),e.off("drain",a)}}s(fn,"pumpToNode");async function ds(t,e,i,{end:r}){Si(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(ds,"pumpToWeb");function Zb(...t){return If(t,Ub(Jb(t)))}s(Zb,"pipeline");function If(t,e,i){if(t.length===1&&Lb(t[0])&&(t=t[0]),t.length<2)throw new qb("streams");let r=new Xb,n=r.signal,o=i?.signal,a=[];Yb(o,"options.signal");function c(){w(new Vb)}s(c,"abort"),fs=fs||ee().addAbortListener;let l;o&&(l=fs(o,c));let u,d,p=[],b=0;function m(U){w(U,--b===0)}s(m,"finish");function w(U,I){var V;if(U&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=U),!(!u&&!I)){for(;p.length;)p.shift()(u);(V=l)===null||V===void 0||V[Mb](),r.abort(),I&&(u||a.forEach(kt=>kt()),sr.nextTick(e,u,d))}}s(w,"finishImpl");let g;for(let U=0;U<t.length;U++){let I=t[U],V=U<t.length-1,kt=U>0,de=V||i?.end!==!1,Ht=U===t.length-1;if(vf(I)){let ne=function(Je){Je&&Je.name!=="AbortError"&&Je.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Je)};var O=ne;if(s(ne,"onError"),de){let{destroy:Je,cleanup:Fn}=Ff(I,V,kt);p.push(Je),ss(I)&&Ht&&a.push(Fn)}I.on("error",ne),ss(I)&&Ht&&a.push(()=>{I.removeListener("error",ne)})}if(U===0)if(typeof I=="function"){if(g=I({signal:n}),!jt(g))throw new os("Iterable, AsyncIterable or Stream","source",g)}else jt(I)||un(I)||Si(I)?g=I:g=kf.from(I);else if(typeof I=="function"){if(Si(g)){var F;g=us((F=g)===null||F===void 0?void 0:F.readable)}else g=us(g);if(g=I(g,{signal:n}),V){if(!jt(g,!0))throw new os("AsyncIterable",`transform[${U-1}]`,g)}else{var _;cs||(cs=ns());let ne=new cs({objectMode:!0}),Je=(_=g)===null||_===void 0?void 0:_.then;if(typeof Je=="function")b++,Je.call(g,ut=>{d=ut,ut!=null&&ne.write(ut),de&&ne.end(),sr.nextTick(m)},ut=>{ne.destroy(ut),sr.nextTick(m,ut)});else if(jt(g,!0))b++,fn(g,ne,m,{end:de});else if(as(g)||Si(g)){let ut=g.readable||g;b++,fn(ut,ne,m,{end:de})}else throw new os("AsyncIterable or Promise","destination",g);g=ne;let{destroy:Fn,cleanup:Xu}=Ff(g,!1,!0);p.push(Fn),Ht&&a.push(Xu)}}else if(vf(I)){if(un(g)){b+=2;let ne=eg(g,I,m,{end:de});ss(I)&&Ht&&a.push(ne)}else if(Si(g)||as(g)){let ne=g.readable||g;b++,fn(ne,I,m,{end:de})}else if(jt(g))b++,fn(g,I,m,{end:de});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else if(Gb(I)){if(un(g))b++,ds(us(g),I,m,{end:de});else if(as(g)||jt(g))b++,ds(g,I,m,{end:de});else if(Si(g))b++,ds(g.readable,I,m,{end:de});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else g=kf.from(I)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&sr.nextTick(c),g}s(If,"pipelineImpl");function eg(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new zb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Kb(t)?sr.nextTick(a):t.once("end",a)}else i();return dn(t,{readable:!0,writable:!1},a=>{let c=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?t.once("end",i).once("error",i):i(a)}),dn(e,{readable:!1,writable:!0},i)}s(eg,"pipe");Pf.exports={pipelineImpl:If,pipeline:Zb}});var ys=P((V_,Nf)=>{"use strict";var{pipeline:tg}=pn(),hn=Ke(),{destroyer:ig}=Dt(),{isNodeStream:yn,isReadable:Af,isWritable:Of,isWebStream:hs,isTransformStream:qt,isWritableStream:Tf,isReadableStream:Cf}=He(),{AbortError:rg,codes:{ERR_INVALID_ARG_VALUE:Rf,ERR_MISSING_ARGS:ng}}=re(),og=at();Nf.exports=s(function(...e){if(e.length===0)throw new ng("streams");if(e.length===1)return hn.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=hn.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=hn.from(e[m])}for(let m=0;m<e.length;++m)if(!(!yn(e[m])&&!hs(e[m]))){if(m<e.length-1&&!(Af(e[m])||Cf(e[m])||qt(e[m])))throw new Rf(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(Of(e[m])||Tf(e[m])||qt(e[m])))throw new Rf(`streams[${m}]`,i[m],"must be writable")}let r,n,o,a,c;function l(m){let w=a;a=null,w?w(m):m?c.destroy(m):!b&&!p&&c.destroy()}s(l,"onfinished");let u=e[0],d=tg(e,l),p=!!(Of(u)||Tf(u)||qt(u)),b=!!(Af(d)||Cf(d)||qt(d));if(c=new hn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:p,readable:b}),p){if(yn(u))c._write=function(w,g,F){u.write(w,g)?F():r=F},c._final=function(w){u.end(),n=w},u.on("drain",function(){if(r){let w=r;r=null,w()}});else if(hs(u)){let g=(qt(u)?u.writable:u).getWriter();c._write=async function(F,_,O){try{await g.ready,g.write(F).catch(()=>{}),O()}catch(U){O(U)}},c._final=async function(F){try{await g.ready,g.close().catch(()=>{}),n=F}catch(_){F(_)}}}let m=qt(d)?d.readable:d;og(m,()=>{if(n){let w=n;n=null,w()}})}if(b){if(yn(d))d.on("readable",function(){if(o){let m=o;o=null,m()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let m=d.read();if(m===null){o=c._read;return}if(!c.push(m))return}};else if(hs(d)){let w=(qt(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:F}=await w.read();if(!c.push(g))return;if(F){c.push(null);return}}catch{return}}}}return c._destroy=function(m,w){!m&&a!==null&&(m=new rg),o=null,r=null,n=null,a===null?w(m):(a=w,yn(d)&&ig(d,m))},c},"compose")});var zf=P((Y_,gs)=>{"use strict";var sg=globalThis.AbortController||si().AbortController,{codes:{ERR_INVALID_ARG_VALUE:ag,ERR_INVALID_ARG_TYPE:ar,ERR_MISSING_ARGS:cg,ERR_OUT_OF_RANGE:lg},AbortError:Xe}=re(),{validateAbortSignal:$t,validateInteger:Lf,validateObject:zt}=li(),fg=D().Symbol("kWeak"),ug=D().Symbol("kResistStopPropagation"),{finished:dg}=at(),pg=ys(),{addAbortSignalNoValidate:hg}=Ji(),{isWritable:yg,isNodeStream:mg}=He(),{deprecate:bg}=ee(),{ArrayPrototypePush:gg,Boolean:wg,MathFloor:Bf,Number:Sg,NumberIsNaN:Eg,Promise:Df,PromiseReject:Mf,PromiseResolve:_g,PromisePrototypeThen:Uf,Symbol:jf}=D(),mn=jf("kEmpty"),Wf=jf("kEof");function xg(t,e){if(e!=null&&zt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),mg(t)&&!yg(t))throw new ag("stream",t,"must be writable");let i=pg(this,t);return e!=null&&e.signal&&hg(e.signal,i),i}s(xg,"compose");function bn(t,e){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);e!=null&&zt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Bf(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Bf(e.highWaterMark)),Lf(i,"options.concurrency",1),Lf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=ee().AbortSignalAny([e?.signal].filter(wg)),a=this,c=[],l={signal:o},u,d,p=!1,b=0;function m(){p=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!p&&b<i&&c.length<r&&(d(),d=null)}s(g,"maybeResume");async function F(){try{for await(let _ of a){if(p)return;if(o.aborted)throw new Xe;try{if(_=t(_,l),_===mn)continue;_=_g(_)}catch(O){_=Mf(O)}b+=1,Uf(_,w,m),c.push(_),u&&(u(),u=null),!p&&(c.length>=r||b>=i)&&await new Df(O=>{d=O})}c.push(Wf)}catch(_){let O=Mf(_);Uf(O,w,m),c.push(O)}finally{p=!0,u&&(u(),u=null)}}s(F,"pump"),F();try{for(;;){for(;c.length>0;){let _=await c[0];if(_===Wf)return;if(o.aborted)throw new Xe;_!==mn&&(yield _),c.shift(),g()}await new Df(_=>{u=_})}}finally{p=!0,d&&(d(),d=null)}},"map").call(this)}s(bn,"map");function kg(t=void 0){return t!=null&&zt(t,"options"),t?.signal!=null&&$t(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 Xe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(kg,"asIndexedPairs");async function qf(t,e=void 0){for await(let i of bs.call(this,t,e))return!0;return!1}s(qf,"some");async function vg(t,e=void 0){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);return!await qf.call(this,async(...i)=>!await t(...i),e)}s(vg,"every");async function Fg(t,e){for await(let i of bs.call(this,t,e))return i}s(Fg,"find");async function Ig(t,e){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),mn}s(i,"forEachFn");for await(let r of bn.call(this,i,e));}s(Ig,"forEach");function bs(t,e){if(typeof t!="function")throw new ar("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:mn}return s(i,"filterFn"),bn.call(this,i,e)}s(bs,"filter");var ms=class extends cg{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Pg(t,e,i){var r;if(typeof t!="function")throw new ar("reducer",["Function","AsyncFunction"],t);i!=null&&zt(i,"options"),i?.signal!=null&&$t(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let u=new Xe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await dg(this.destroy(u)),u}let o=new sg,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[fg]:this,[ug]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let c=!1;try{for await(let u of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new Xe;n?e=await t(e,u,{signal:a}):(e=u,n=!0)}if(!c&&!n)throw new ms}finally{o.abort()}return e}s(Pg,"reduce");async function Ag(t){t!=null&&zt(t,"options"),t?.signal!=null&&$t(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 Xe(void 0,{cause:t.signal.reason});gg(e,r)}return e}s(Ag,"toArray");function Og(t,e){let i=bn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(Og,"flatMap");function $f(t){if(t=Sg(t),Eg(t))return 0;if(t<0)throw new lg("number",">= 0",t);return t}s($f,"toIntegerOrInfinity");function Tg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&$t(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 Xe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Xe;t--<=0&&(yield o)}},"drop").call(this)}s(Tg,"drop");function Cg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&$t(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 Xe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Xe;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(Cg,"take");gs.exports.streamReturningOperators={asIndexedPairs:bg(kg,"readable.asIndexedPairs will be removed in a future version."),drop:Tg,filter:bs,flatMap:Og,map:bn,take:Cg,compose:xg};gs.exports.promiseReturningOperators={every:vg,forEach:Ig,reduce:Pg,toArray:Ag,some:qf,find:Fg}});var ws=P((K_,Vf)=>{"use strict";var{ArrayPrototypePop:Rg,Promise:Ng}=D(),{isIterable:Lg,isNodeStream:Bg,isWebStream:Dg}=He(),{pipelineImpl:Mg}=pn(),{finished:Ug}=at();Ss();function Wg(...t){return new Ng((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Bg(o)&&!Lg(o)&&!Dg(o)){let a=Rg(t);r=a.signal,n=a.end}Mg(t,(a,c)=>{a?i(a):e(c)},{signal:r,end:n})})}s(Wg,"pipeline");Vf.exports={finished:Ug,pipeline:Wg}});var Ss=P((J_,eu)=>{var{Buffer:jg}=we(),{ObjectDefineProperty:ft,ObjectKeys:Gf,ReflectApply:Kf}=D(),{promisify:{custom:Xf}}=ee(),{streamReturningOperators:Hf,promiseReturningOperators:Yf}=zf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Jf}}=re(),qg=ys(),{setDefaultHighWaterMark:$g,getDefaultHighWaterMark:zg}=Qi(),{pipeline:Qf}=pn(),{destroyer:Vg}=Dt(),Zf=at(),Es=ws(),cr=He(),R=eu.exports=Kr().Stream;R.isDestroyed=cr.isDestroyed;R.isDisturbed=cr.isDisturbed;R.isErrored=cr.isErrored;R.isReadable=cr.isReadable;R.isWritable=cr.isWritable;R.Readable=tr();for(let t of Gf(Hf)){let i=function(...r){if(new.target)throw Jf();return R.Readable.from(Kf(e,this,r))};_s=i,s(i,"fn");let e=Hf[t];ft(i,"name",{__proto__:null,value:e.name}),ft(i,"length",{__proto__:null,value:e.length}),ft(R.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var _s;for(let t of Gf(Yf)){let i=function(...n){if(new.target)throw Jf();return Kf(e,this,n)};_s=i,s(i,"fn");let e=Yf[t];ft(i,"name",{__proto__:null,value:e.name}),ft(i,"length",{__proto__:null,value:e.length}),ft(R.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var _s;R.Writable=ln();R.Duplex=Ke();R.Transform=is();R.PassThrough=ns();R.pipeline=Qf;var{addAbortSignal:Hg}=Ji();R.addAbortSignal=Hg;R.finished=Zf;R.destroy=Vg;R.compose=qg;R.setDefaultHighWaterMark=$g;R.getDefaultHighWaterMark=zg;ft(R,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return Es},"get")});ft(Qf,Xf,{__proto__:null,enumerable:!0,get:s(function(){return Es.pipeline},"get")});ft(Zf,Xf,{__proto__:null,enumerable:!0,get:s(function(){return Es.finished},"get")});R.Stream=R;R._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");R._uint8ArrayToBuffer=s(function(e){return jg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var tu=P((Z_,z)=>{"use strict";var K=Ss(),Yg=ws(),Gg=K.Readable.destroy;z.exports=K.Readable;z.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer;z.exports._isUint8Array=K._isUint8Array;z.exports.isDisturbed=K.isDisturbed;z.exports.isErrored=K.isErrored;z.exports.isReadable=K.isReadable;z.exports.Readable=K.Readable;z.exports.Writable=K.Writable;z.exports.Duplex=K.Duplex;z.exports.Transform=K.Transform;z.exports.PassThrough=K.PassThrough;z.exports.addAbortSignal=K.addAbortSignal;z.exports.finished=K.finished;z.exports.destroy=K.destroy;z.exports.destroy=Gg;z.exports.pipeline=K.pipeline;z.exports.compose=K.compose;Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get:s(function(){return Yg},"get")});z.exports.Stream=K.Stream;z.exports.default=z.exports});var Qg={};hr(Qg,{Async:()=>Cn,AsyncTransaction:()=>Ln,BigIntStats:()=>ce,BigIntStatsFs:()=>Ai,Dir:()=>bt,Dirent:()=>mt,Errno:()=>N,ErrnoError:()=>f,Fetch:()=>zd,FetchFS:()=>xr,File:()=>Ft,FileSystem:()=>se,FileType:()=>Z,InMemory:()=>Bi,InMemoryStore:()=>wr,IndexFS:()=>Mi,Inode:()=>Be,LockedFS:()=>Wi,Mutex:()=>Ui,NoSyncFile:()=>Kt,Overlay:()=>Vd,OverlayFS:()=>ji,Port:()=>Ud,PortFS:()=>Er,PortFile:()=>Di,PreloadFile:()=>fe,ReadStream:()=>_t,Readonly:()=>Rn,SimpleAsyncStore:()=>Bn,SimpleTransaction:()=>Jt,Stats:()=>Y,StatsCommon:()=>Ii,StatsFs:()=>Pi,StoreFS:()=>Ri,Sync:()=>Cd,SyncTransaction:()=>Li,Transaction:()=>Ni,UnlockedOverlayFS:()=>kr,WriteStream:()=>xt,ZenFsType:()=>Tn,_toUnixTimestamp:()=>Nd,access:()=>Lu,accessSync:()=>Wa,appendFile:()=>uu,appendFileSync:()=>Ia,attachFS:()=>Dd,checkOptions:()=>$n,chmod:()=>Ou,chmodSync:()=>Da,chown:()=>Pu,chownSync:()=>La,close:()=>pu,closeSync:()=>nt,configure:()=>Xg,constants:()=>vt,copyFile:()=>$u,copyFileSync:()=>so,cp:()=>Yu,cpSync:()=>ao,createReadStream:()=>Uu,createWriteStream:()=>Wu,decode:()=>Xt,decodeDirListing:()=>gr,default:()=>Jg,detachFS:()=>Md,encode:()=>xe,encodeDirListing:()=>ye,errorMessages:()=>In,exists:()=>ru,existsSync:()=>qe,fchmod:()=>Su,fchmodSync:()=>Nr,fchown:()=>wu,fchownSync:()=>Rr,fdatasync:()=>mu,fdatasyncSync:()=>Oa,flagToMode:()=>It,flagToNumber:()=>Pd,flagToString:()=>qs,fs:()=>pr,fstat:()=>du,fstatSync:()=>Pa,fsync:()=>yu,fsyncSync:()=>Aa,ftruncate:()=>hu,ftruncateSync:()=>to,futimes:()=>Eu,futimesSync:()=>Lr,isAppendable:()=>it,isBackend:()=>qi,isBackendConfig:()=>vr,isExclusive:()=>Ci,isReadable:()=>dt,isSynchronous:()=>Ad,isTruncating:()=>Ti,isWriteable:()=>le,lchmod:()=>Tu,lchmodSync:()=>Ma,lchown:()=>Au,lchownSync:()=>Ba,levenshtein:()=>Nn,link:()=>vu,linkSync:()=>Ra,lopenSync:()=>Gi,lstat:()=>ou,lstatSync:()=>eo,lutimes:()=>Ru,lutimesSync:()=>Ua,mkdir:()=>xu,mkdirSync:()=>Br,mkdirpSync:()=>zs,mkdtemp:()=>qu,mkdtempSync:()=>ja,mount:()=>Vi,mountObject:()=>Hi,mounts:()=>Se,nop:()=>S,normalizeMode:()=>me,normalizeOptions:()=>be,normalizePath:()=>E,normalizeTime:()=>Pt,open:()=>cu,openAsBlob:()=>Ku,openSync:()=>ni,opendir:()=>Hu,opendirSync:()=>za,parseFlag:()=>L,promises:()=>dr,randomIno:()=>Oi,read:()=>gu,readFile:()=>lu,readFileSync:()=>Cr,readSync:()=>Ca,readdir:()=>ku,readdirSync:()=>oi,readlink:()=>Iu,readlinkSync:()=>ro,readv:()=>zu,readvSync:()=>qa,realpath:()=>Nu,realpathSync:()=>je,rename:()=>iu,renameSync:()=>ka,resolveMountConfig:()=>Us,rm:()=>ju,rmSync:()=>oo,rmdir:()=>_u,rmdirSync:()=>io,rootCred:()=>Me,rootIno:()=>De,setImmediate:()=>Rd,size_max:()=>he,stat:()=>nu,statSync:()=>Yi,statfs:()=>Gu,statfsSync:()=>Va,symlink:()=>Fu,symlinkSync:()=>Na,truncate:()=>su,truncateSync:()=>va,umount:()=>Ar,unlink:()=>au,unlinkSync:()=>Tr,unwatchFile:()=>Du,utimes:()=>Cu,utimesSync:()=>no,watch:()=>Mu,watchFile:()=>Bu,write:()=>bu,writeFile:()=>fu,writeFileSync:()=>Ki,writeSync:()=>Ta,writev:()=>Vu,writevSync:()=>$a});var N=(h=>(h[h.EPERM=1]="EPERM",h[h.ENOENT=2]="ENOENT",h[h.EINTR=4]="EINTR",h[h.EIO=5]="EIO",h[h.ENXIO=6]="ENXIO",h[h.EBADF=9]="EBADF",h[h.EAGAIN=11]="EAGAIN",h[h.ENOMEM=12]="ENOMEM",h[h.EACCES=13]="EACCES",h[h.EFAULT=14]="EFAULT",h[h.ENOTBLK=15]="ENOTBLK",h[h.EBUSY=16]="EBUSY",h[h.EEXIST=17]="EEXIST",h[h.EXDEV=18]="EXDEV",h[h.ENODEV=19]="ENODEV",h[h.ENOTDIR=20]="ENOTDIR",h[h.EISDIR=21]="EISDIR",h[h.EINVAL=22]="EINVAL",h[h.ENFILE=23]="ENFILE",h[h.EMFILE=24]="EMFILE",h[h.ETXTBSY=26]="ETXTBSY",h[h.EFBIG=27]="EFBIG",h[h.ENOSPC=28]="ENOSPC",h[h.ESPIPE=29]="ESPIPE",h[h.EROFS=30]="EROFS",h[h.EMLINK=31]="EMLINK",h[h.EPIPE=32]="EPIPE",h[h.EDOM=33]="EDOM",h[h.ERANGE=34]="ERANGE",h[h.EDEADLK=35]="EDEADLK",h[h.ENAMETOOLONG=36]="ENAMETOOLONG",h[h.ENOLCK=37]="ENOLCK",h[h.ENOSYS=38]="ENOSYS",h[h.ENOTEMPTY=39]="ENOTEMPTY",h[h.ELOOP=40]="ELOOP",h[h.ENOMSG=42]="ENOMSG",h[h.EBADE=52]="EBADE",h[h.EBADR=53]="EBADR",h[h.EXFULL=54]="EXFULL",h[h.ENOANO=55]="ENOANO",h[h.EBADRQC=56]="EBADRQC",h[h.ENOSTR=60]="ENOSTR",h[h.ENODATA=61]="ENODATA",h[h.ETIME=62]="ETIME",h[h.ENOSR=63]="ENOSR",h[h.ENONET=64]="ENONET",h[h.EREMOTE=66]="EREMOTE",h[h.ENOLINK=67]="ENOLINK",h[h.ECOMM=70]="ECOMM",h[h.EPROTO=71]="EPROTO",h[h.EBADMSG=74]="EBADMSG",h[h.EOVERFLOW=75]="EOVERFLOW",h[h.EBADFD=77]="EBADFD",h[h.ESTRPIPE=86]="ESTRPIPE",h[h.ENOTSOCK=88]="ENOTSOCK",h[h.EDESTADDRREQ=89]="EDESTADDRREQ",h[h.EMSGSIZE=90]="EMSGSIZE",h[h.EPROTOTYPE=91]="EPROTOTYPE",h[h.ENOPROTOOPT=92]="ENOPROTOOPT",h[h.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",h[h.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",h[h.ENOTSUP=95]="ENOTSUP",h[h.ENETDOWN=100]="ENETDOWN",h[h.ENETUNREACH=101]="ENETUNREACH",h[h.ENETRESET=102]="ENETRESET",h[h.ETIMEDOUT=110]="ETIMEDOUT",h[h.ECONNREFUSED=111]="ECONNREFUSED",h[h.EHOSTDOWN=112]="EHOSTDOWN",h[h.EHOSTUNREACH=113]="EHOSTUNREACH",h[h.EALREADY=114]="EALREADY",h[h.EINPROGRESS=115]="EINPROGRESS",h[h.ESTALE=116]="ESTALE",h[h.EREMOTEIO=121]="EREMOTEIO",h[h.EDQUOT=122]="EDQUOT",h))(N||{}),In={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},f=class t extends Error{constructor(i,r=In[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=N[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let r=new t(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 t(N[i],In[N[i]],r,n)}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}};var vt={};hr(vt,{COPYFILE_EXCL:()=>Fi,COPYFILE_FICLONE:()=>nd,COPYFILE_FICLONE_FORCE:()=>od,F_OK:()=>vi,O_APPEND:()=>Ce,O_CREAT:()=>X,O_DIRECT:()=>dd,O_DIRECTORY:()=>ad,O_DSYNC:()=>fd,O_EXCL:()=>Oe,O_NOATIME:()=>cd,O_NOCTTY:()=>sd,O_NOFOLLOW:()=>ld,O_NONBLOCK:()=>pd,O_RDONLY:()=>Yt,O_RDWR:()=>oe,O_SYMLINK:()=>ud,O_SYNC:()=>Gt,O_TRUNC:()=>Te,O_WRONLY:()=>Ae,R_OK:()=>Pe,S_IFBLK:()=>Ze,S_IFCHR:()=>et,S_IFDIR:()=>Le,S_IFIFO:()=>tt,S_IFLNK:()=>Re,S_IFMT:()=>W,S_IFREG:()=>Ne,S_IFSOCK:()=>Qe,S_IRGRP:()=>Sd,S_IROTH:()=>xd,S_IRUSR:()=>bd,S_IRWXG:()=>An,S_IRWXO:()=>On,S_IRWXU:()=>Pn,S_ISGID:()=>yd,S_ISUID:()=>hd,S_ISVTX:()=>md,S_IWGRP:()=>Ed,S_IWOTH:()=>kd,S_IWUSR:()=>gd,S_IXGRP:()=>_d,S_IXOTH:()=>vd,S_IXUSR:()=>wd,UV_FS_O_FILEMAP:()=>Fd,W_OK:()=>pe,X_OK:()=>rd});var vi=0,Pe=4,pe=2,rd=1,Fi=1,nd=2,od=4,Yt=0,Ae=1,oe=2,X=64,Oe=128,sd=256,Te=512,Ce=1024,ad=65536,cd=262144,ld=131072,Gt=1052672,fd=4096,ud=32768,dd=16384,pd=2048,W=61440,Qe=49152,Re=40960,Ne=32768,Ze=24576,Le=16384,et=8192,tt=4096,hd=2048,yd=1024,md=512,Pn=448,bd=256,gd=128,wd=64,An=56,Sd=32,Ed=16,_d=8,On=7,xd=4,kd=2,vd=1,Fd=0;var Z=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(Z||{}),Ii=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:c,mode:l,ino:u}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(e??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(r??d),this.birthtimeMs=this._convert(n??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(u??0);let p=Number(l)&61440||Z.FILE;if(l)this.mode=this._convert(l);else switch(p){case Z.FILE:this.mode=this._convert(420);break;case Z.DIRECTORY:default:this.mode=this._convert(511)}this.mode&61440||(this.mode=this.mode|this._convert(p))}static{s(this,"StatsCommon")}_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}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))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}},Y=class extends Ii{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},ce=class extends Ii{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}},Tn=525687744115,Pi=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=he;this.ffree=he}static{s(this,"StatsFs")}},Ai=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(he);this.ffree=BigInt(he)}static{s(this,"BigIntStatsFs")}};var he=2**32-1,De=0n;function js(){return Math.round(Math.random()*2**32).toString(16)}s(js,"_random");function Oi(){return BigInt("0x"+js()+js())}s(Oi,"randomIno");var Be=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}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=Oi(),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 Y(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}};var Id=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return qs(t);if(!Id.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function qs(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(qs,"flagToString");function Pd(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(Pd,"flagToNumber");function It(t){let e=0;return e<<=1,e+=+dt(t),e<<=1,e+=+le(t),e<<=1,e}s(It,"flagToMode");function dt(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(dt,"isReadable");function le(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(le,"isWriteable");function Ti(t){return t.indexOf("w")!==-1}s(Ti,"isTruncating");function it(t){return t.indexOf("a")!==-1}s(it,"isAppendable");function Ad(t){return t.indexOf("s")!==-1}s(Ad,"isSynchronous");function Ci(t){return t.indexOf("x")!==-1}s(Ci,"isExclusive");var Ft=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},fe=class extends Ft{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:he}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;if(this.stats.size!=a.byteLength){if(dt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return it(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new Y(this.stats)}statSync(){return new Y(this.stats)}async truncate(i){return this.truncateSync(i),this.sync()}truncateSync(i){if(this.dirty=!0,!le(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);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i),this.syncSync()}async write(i,r=0,n=this.stats.size,o=this.position){let a=this.writeSync(i,r,n,o);return await this.sync(),a}writeSync(i,r=0,n=this.stats.size,o=this.position){if(this.dirty=!0,!le(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,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:he}));u.set(this._buffer),this._buffer=u}let c=i.slice(r,r+n);this._buffer.set(c,o);let l=c.byteLength;return this.stats.mtimeMs=Date.now(),this.position=o+l,this.syncSync(),l}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){if(!dt(this.flag))throw new f(1,"File not opened with a readable mode.");this.dirty=!0,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 c=a-o;return this.syncSync(),c==0||new Uint8Array(i.buffer,r,n).set(this._buffer.slice(o,a)),c}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()}_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()}},Kt=class extends fe{static{s(this,"NoSyncFile")}constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};var Me={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Od="/";function $s(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let c=0;c<=t.length;++c){if(c<t.length)a=t[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===c-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",r=0):(i=i.slice(0,l),r=i.length-1-i.lastIndexOf("/")),n=c,o=0;continue}else if(i.length!==0){i="",r=0,n=c,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,c):i=t.slice(n+1,c),r=c-n-1;n=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s($s,"normalizeString");function pt(...t){let e="";for(let r of[...t.reverse(),Od])if(r.length&&(e=`${r}/${e}`,r.startsWith("/")))break;let i=e.startsWith("/");return e=$s(e,!i),i?`/${e}`:e.length?e:"/"}s(pt,"resolve");function Td(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=$s(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}s(Td,"normalize");function j(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Td(e):"."}s(j,"join");function A(t){if(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(A,"dirname");function q(t,e){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 c=t.length-1;c>=0;--c)if(t[c]==="/"){if(!n){i=c+1;break}}else a===-1&&(n=!1,a=c+1),o>=0&&(t[c]===e[o]?--o===-1&&(r=c):(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(q,"basename");function mr(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let r=e?1:0,n=-1,o=0,a=-1,c=!0,l=t.length-1,u=0;for(;l>=r;--l){if(t[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t[l]==="."?n===-1?n=l: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(mr,"parse");var se=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:!1,type:Tn}}constructor(){}async ready(){}async exists(e,i){try{return await this.stat(e,i),!0}catch(r){return r.code!="ENOENT"}}existsSync(e,i){try{return this.statSync(e,i),!0}catch(r){return r.code!="ENOENT"}}};function Cd(t){class e extends t{static{s(this,"_SyncFS")}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 e}s(Cd,"Sync");function Cn(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1;this._disableSync=!1}static{s(this,"_AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let o=s(()=>this._queueRunning?setTimeout(o):n(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}}}metadata(){return{...super.metadata(),noAsyncCache:this._disableSync}}checkSync(n,o){if(this._disableSync)throw new f(95,"Sync caching has been disabled for this async file system",n,o);if(!this._sync)throw new f(95,"No sync cache is attached to this async file system",n,o)}renameSync(n,o,a){this.checkSync(n,"rename"),this._sync.renameSync(n,o,a),this.queue("rename",n,o,a)}statSync(n,o){return this.checkSync(n,"stat"),this._sync.statSync(n,o)}createFileSync(n,o,a,c){return this.checkSync(n,"createFile"),this._sync.createFileSync(n,o,a,c),this.queue("createFile",n,o,a,c),this.openFileSync(n,o,c)}openFileSync(n,o,a){this.checkSync(n,"openFile");let c=this._sync.openFileSync(n,o,a),l=c.statSync(),u=new Uint8Array(l.size);return c.readSync(u),new fe(this,n,o,l,u)}unlinkSync(n,o){this.checkSync(n,"unlinkSync"),this._sync.unlinkSync(n,o),this.queue("unlink",n,o)}rmdirSync(n,o){this.checkSync(n,"rmdir"),this._sync.rmdirSync(n,o),this.queue("rmdir",n,o)}mkdirSync(n,o,a){this.checkSync(n,"mkdir"),this._sync.mkdirSync(n,o,a),this.queue("mkdir",n,o,a)}readdirSync(n,o){return this.checkSync(n,"readdir"),this._sync.readdirSync(n,o)}linkSync(n,o,a){this.checkSync(n,"link"),this._sync.linkSync(n,o,a),this.queue("link",n,o,a)}syncSync(n,o,a){this.checkSync(n,"sync"),this._sync.syncSync(n,o,a),this.queue("sync",n,o,a)}existsSync(n,o){return this.checkSync(n,"exists"),this._sync.existsSync(n,o)}async crossCopy(n){this.checkSync(n,"crossCopy");let o=await this.stat(n,Me);if(o.isDirectory()){if(n!=="/"){let c=await this.stat(n,Me);this._sync.mkdirSync(n,c.mode,c.cred())}let a=await this.readdir(n,Me);for(let c of a)await this.crossCopy(j(n,c))}else{let a=await this.openFile(n,L("r"),Me),c=this._sync.createFileSync(n,L("w"),o.mode,o.cred());try{let l=new Uint8Array(o.size);await a.read(l),c.writeSync(l,0,o.size)}finally{await a.close(),c.closeSync()}}}async _next(){if(!this._queueRunning)return;let[n,...o]=this._queue.shift();await this[n](...o),await this._next()}queue(...n){this._queue.push(n),this._next()}}return e}s(Cn,"Async");function Rn(t){class e extends t{static{s(this,"_ReadonlyFS")}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 e}s(Rn,"Readonly");function zs(t,e,i,r){r.existsSync(t,i)||(zs(A(t),e,i,r),r.mkdirSync(t,e,i))}s(zs,"mkdirpSync");function br(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(br,"_min");function Nn(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 b=0;b<i;)o[i+b]=t.charCodeAt(n+b),o[b]=++b;let a,c,l,u,d;for(a=0;a+3<r;){let b=e.charCodeAt(n+(c=a)),m=e.charCodeAt(n+(l=a+1)),w=e.charCodeAt(n+(u=a+2)),g=e.charCodeAt(n+(d=a+3)),F=a+=4;for(let _=0;_<i;){let O=o[i+_],U=o[_];c=br(U,c,l,b,O),l=br(c,l,u,m,O),u=br(l,u,d,w,O),F=br(u,d,F,g,O),o[_++]=F,d=u,u=l,l=c,c=U}}let p=0;for(;a<r;){let b=e.charCodeAt(n+(c=a));p=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=p=w<c||p<c?w>p?p+1:w+1:b===o[i+m]?c:c+1,c=w}}return p}s(Nn,"levenshtein");var Rd=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function xe(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(xe,"encode");function Xt(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(Xt,"decode");function gr(t){return JSON.parse(Xt(t),(e,i)=>e==""?i:BigInt(i))}s(gr,"decodeDirListing");function ye(t){return xe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ye,"encodeDirListing");function Nd(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(Nd,"_toUnixTimestamp");function me(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(me,"normalizeMode");function Pt(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(Pt,"normalizeTime");function E(t){if(t=t.toString(),t.includes("\0"))throw new f(22,"Path can not contain null character");if(t.length==0)throw new f(22,"Path can not be empty");return pt(t.replaceAll(/[/\\]+/g,"/"))}s(E,"normalizePath");function be(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:me("mode"in t?t?.mode:null,r)}}s(be,"normalizeOptions");function S(){}s(S,"nop");var Vs=5,Ri=class extends se{constructor(i){super();this.$store=i;this._initialized=!1;i instanceof Promise||(this._store=i,this._initialized=!0,this.makeRootDirectorySync())}static{s(this,"StoreFS")}get store(){if(!this._store)throw new f(61,"No store attached");return this._store}async ready(){await super.ready(),!this._initialized&&(this._initialized=!0,this._store=await this.$store)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.makeRootDirectory()}emptySync(){this.store.clearSync(),this.makeRootDirectorySync()}async rename(i,r,n){let o=this.store.transaction(),a=A(i),c=q(i),l=A(r),u=q(r),d=await this.findINode(o,a),p=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",i,"rename");if(!p[c])throw f.With("ENOENT",i,"rename");let b=p[c];if(delete p[c],(l+"/").indexOf(i+"/")===0)throw new f(16,a);let m,w;if(l===a?(m=d,w=p):(m=await this.findINode(o,l),w=await this.getDirListing(o,m,l)),w[u]){let g=await this.getINode(o,w[u],r);if(g.toStats().isFile())try{await o.remove(g.ino),await o.remove(w[u])}catch(F){throw await o.abort(),F}else throw f.With("EPERM",r,"rename")}w[u]=b;try{await o.set(d.ino,ye(p)),await o.set(m.ino,ye(w))}catch(g){throw await o.abort(),g}await o.commit()}renameSync(i,r,n){let o=this.store.transaction(),a=A(i),c=q(i),l=A(r),u=q(r),d=this.findINodeSync(o,a),p=this.getDirListingSync(o,d,a);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",i,"rename");if(!p[c])throw f.With("ENOENT",i,"rename");let b=p[c];if(delete p[c],(l+"/").indexOf(i+"/")==0)throw new f(16,a);let m,w;if(l===a?(m=d,w=p):(m=this.findINodeSync(o,l),w=this.getDirListingSync(o,m,l)),w[u]){let g=this.getINodeSync(o,w[u],r);if(g.toStats().isFile())try{o.removeSync(g.ino),o.removeSync(w[u])}catch(F){throw o.abortSync(),F}else throw f.With("EPERM",r,"rename")}w[u]=b;try{o.setSync(d.ino,ye(p)),o.setSync(m.ino,ye(w))}catch(g){throw o.abortSync(),g}o.commitSync()}async stat(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,r))throw f.With("EACCES",i,"stat");return a}statSync(i,r){let n=this.findINodeSync(this.store.transaction(),i).toStats();if(!n.hasAccess(4,r))throw f.With("EACCES",i,"stat");return n}async createFile(i,r,n,o){let a=new Uint8Array(0),c=await this.commitNew(this.store.transaction(),i,Z.FILE,n,o,a);return new fe(this,i,r,c.toStats(),a)}createFileSync(i,r,n,o){return this.commitNewSync(i,Z.FILE,n,o),this.openFileSync(i,r,o)}async openFile(i,r,n){let o=this.store.transaction(),a=await this.findINode(o,i),c=await o.get(a.ino);if(!a.toStats().hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");if(!c)throw f.With("ENOENT",i,"openFile");return new fe(this,i,r,a.toStats(),c)}openFileSync(i,r,n){let o=this.store.transaction(),a=this.findINodeSync(o,i),c=o.getSync(a.ino);if(!a.toStats().hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");if(!c)throw f.With("ENOENT",i,"openFile");return new fe(this,i,r,a.toStats(),c)}async unlink(i,r){return this.remove(i,!1,r)}unlinkSync(i,r){this.removeSync(i,!1,r)}async rmdir(i,r){if((await this.readdir(i,r)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,r)}rmdirSync(i,r){if(this.readdirSync(i,r).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,r)}async mkdir(i,r,n){let o=this.store.transaction(),a=xe("{}");await this.commitNew(o,i,Z.DIRECTORY,r,n,a)}mkdirSync(i,r,n){this.commitNewSync(i,Z.DIRECTORY,r,n,xe("{}"))}async readdir(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o.toStats().hasAccess(4,r))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(n,o,i))}readdirSync(i,r){let n=this.store.transaction(),o=this.findINodeSync(n,i);if(!o.toStats().hasAccess(4,r))throw f.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(n,o,i))}async sync(i,r,n){let o=this.store.transaction(),a=await this._findINode(o,A(i),q(i)),c=await this.getINode(o,a,i),l=c.update(n);try{await o.set(c.ino,r),l&&await o.set(a,c.data)}catch(u){throw await o.abort(),u}await o.commit()}syncSync(i,r,n){let o=this.store.transaction(),a=this._findINodeSync(o,A(i),q(i)),c=this.getINodeSync(o,a,i),l=c.update(n);try{o.setSync(c.ino,r),l&&o.setSync(a,c.data)}catch(u){throw o.abortSync(),u}o.commitSync()}async link(i,r,n){let o=this.store.transaction(),a=A(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,n))throw f.With("EACCES",a,"link");let l=A(r),u=await this.findINode(o,l),d=await this.getDirListing(o,u,l);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",l,"link");let p=await this._findINode(o,a,q(i)),b=await this.getINode(o,p,i);if(!b.toStats().hasAccess(2,n))throw f.With("EACCES",r,"link");b.nlink++,d[q(r)]=p;try{o.setSync(p,b.data),o.setSync(u.ino,ye(d))}catch(m){throw o.abortSync(),m}o.commitSync()}linkSync(i,r,n){let o=this.store.transaction(),a=A(i);if(!this.findINodeSync(o,a).toStats().hasAccess(4,n))throw f.With("EACCES",a,"link");let l=A(r),u=this.findINodeSync(o,l),d=this.getDirListingSync(o,u,l);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",l,"link");let p=this._findINodeSync(o,a,q(i)),b=this.getINodeSync(o,p,i);if(!b.toStats().hasAccess(2,n))throw f.With("EACCES",r,"link");b.nlink++,d[q(r)]=p;try{o.setSync(p,b.data),o.setSync(u.ino,ye(d))}catch(m){throw o.abortSync(),m}o.commitSync()}async makeRootDirectory(){let i=this.store.transaction();if(await i.get(De))return;let r=new Be;r.mode=511|Z.DIRECTORY,await i.set(r.ino,xe("{}")),await i.set(De,r.data),await i.commit()}makeRootDirectorySync(){let i=this.store.transaction();if(i.getSync(De))return;let r=new Be;r.mode=511|Z.DIRECTORY,i.setSync(r.ino,xe("{}")),i.setSync(De,r.data),i.commitSync()}async _findINode(i,r,n,o=new Set){let a=j(r,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return De;let c=r=="/"?await this.getINode(i,De,r):await this.findINode(i,r,o),l=await this.getDirListing(i,c,r);if(!(n in l))throw f.With("ENOENT",pt(r,n),"_findINode");return l[n]}_findINodeSync(i,r,n,o=new Set){let a=j(r,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return De;let c=r=="/"?this.getINodeSync(i,De,r):this.findINodeSync(i,r,o),l=this.getDirListingSync(i,c,r);if(!(n in l))throw f.With("ENOENT",pt(r,n),"_findINode");return l[n]}async findINode(i,r,n=new Set){let o=await this._findINode(i,A(r),q(r),n);return this.getINode(i,o,r)}findINodeSync(i,r,n=new Set){let o=this._findINodeSync(i,A(r),q(r),n);return this.getINodeSync(i,o,r)}async getINode(i,r,n){let o=await i.get(r);if(!o)throw f.With("ENOENT",n,"getINode");return new Be(o.buffer)}getINodeSync(i,r,n){let o=i.getSync(r);if(!o)throw f.With("ENOENT",n,"getINode");return new Be(o.buffer)}async getDirListing(i,r,n){if(!r.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let o=await i.get(r.ino);if(!o)throw f.With("ENOENT",n,"getDirListing");return gr(o)}getDirListingSync(i,r,n){if(!r.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let o=i.getSync(r.ino);if(!o)throw f.With("ENOENT",n,"getDirListing");return gr(o)}async addNew(i,r,n){for(let o=0;o<Vs;o++){let a=Oi();if(!await i.get(a))return await i.set(a,r),a}throw new f(28,"No inode IDs available",n,"addNewNode")}addNewSync(i,r,n){for(let o=0;o<Vs;o++){let a=Oi();if(!i.getSync(a))return i.setSync(a,r),a}throw new f(28,"No inode IDs available",n,"addNewNode")}async commitNew(i,r,n,o,a,c){let l=A(r),u=await this.findINode(i,l);if(!u.toStats().hasAccess(2,a))throw f.With("EACCES",r,"commitNewFile");let d=q(r),p=await this.getDirListing(i,u,l);if(r==="/")throw f.With("EEXIST",r,"commitNewFile");if(p[d])throw await i.abort(),f.With("EEXIST",r,"commitNewFile");try{let b=new Be;return b.ino=await this.addNew(i,c,r),b.mode=o|n,b.uid=a.uid,b.gid=a.gid,b.size=c.length,p[d]=await this.addNew(i,b.data,r),await i.set(u.ino,ye(p)),await i.commit(),b}catch(b){throw i.abort(),b}}commitNewSync(i,r,n,o,a=new Uint8Array){let c=this.store.transaction(),l=A(i),u=this.findINodeSync(c,l);if(!u.toStats().hasAccess(2,o))throw f.With("EACCES",i,"commitNewFile");let d=q(i),p=this.getDirListingSync(c,u,l);if(i==="/")throw f.With("EEXIST",i,"commitNewFile");if(p[d])throw f.With("EEXIST",i,"commitNewFile");let b=new Be;try{b.ino=this.addNewSync(c,a,i),b.size=a.length,b.mode=n|r,b.uid=o.uid,b.gid=o.gid,p[d]=this.addNewSync(c,b.data,i),c.setSync(u.ino,ye(p))}catch(m){throw c.abortSync(),m}return c.commitSync(),b}async remove(i,r,n){let o=this.store.transaction(),a=A(i),c=await this.findINode(o,a),l=await this.getDirListing(o,c,a),u=q(i);if(!l[u])throw f.With("ENOENT",i,"removeEntry");let d=l[u],p=await this.getINode(o,d,i);if(!p.toStats().hasAccess(2,n))throw f.With("EACCES",i,"removeEntry");if(delete l[u],!r&&p.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.set(c.ino,ye(l)),--p.nlink<1&&(await o.remove(p.ino),await o.remove(d))}catch(b){throw await o.abort(),b}await o.commit()}removeSync(i,r,n){let o=this.store.transaction(),a=A(i),c=this.findINodeSync(o,a),l=this.getDirListingSync(o,c,a),u=q(i),d=l[u];if(!d)throw f.With("ENOENT",i,"removeEntry");let p=this.getINodeSync(o,d,i);if(!p.toStats().hasAccess(2,n))throw f.With("EACCES",i,"removeEntry");if(delete l[u],!r&&p.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{o.setSync(c.ino,ye(l)),--p.nlink<1&&(o.removeSync(p.ino),o.removeSync(d))}catch(b){throw o.abortSync(),b}o.commitSync()}};var Ni=class{constructor(){this.aborted=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.aborted||await this.commit()}[Symbol.dispose](){this.aborted||this.commitSync()}},Li=class extends Ni{static{s(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},Ln=class extends Ni{static{s(this,"AsyncTransaction")}getSync(e){throw f.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(e,i){throw f.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(e){throw f.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw f.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw f.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var Bn=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(e){return this.cache.get(e)}set(e,i){this.cache.set(e,i),this.queue.add(this._set(e,i))}delete(e){this.cache.delete(e),this.queue.add(this._delete(e))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[e,i]of await this.entries())this.cache.has(e)||this.cache.set(e,i);for(let e of this.queue)await e}transaction(){return new Jt(this)}},Jt=class extends Li{constructor(i){super();this.store=i;this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let r=this.store.get(i);return this.stashOldValue(i,r),r}setSync(i,r){return this.markModified(i),this.store.set(i,r)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){}abortSync(){for(let i of this.modifiedKeys){let r=this.originalData.get(i);r?this.store.set(i,r):this.store.delete(i)}}stashOldValue(i,r){this.originalData.has(i)||this.originalData.set(i,r)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var wr=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new Jt(this)}},Bi={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:t}){return new Ri(new wr(t))},"create")};function Ld(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}s(Ld,"isFileData");function Dn(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}s(Dn,"isMessage");var Qt=new Map;function Mn(t,{port:e,timeout:i=1e3,fs:r}={}){let n=new Error().stack.slice(6);if(!e)throw f.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);Qt.set(c,{resolve:o,reject:a,fs:r}),e.postMessage({...t,_zenfs:!0,id:c,stack:n});let l=setTimeout(()=>{let u=new f(5,"RPC Failed");u.stack+=n,a(u),typeof l=="object"&&l.unref()},i)})}s(Mn,"request");function Hs(t){if(!Dn(t))return;let{id:e,value:i,error:r,stack:n}=t;if(!Qt.has(e)){let l=new f(5,"Invalid RPC id:"+e);throw l.stack+=n,l}let{resolve:o,reject:a,fs:c}=Qt.get(e);if(r){let l=f.fromJSON(i);l.stack+=n,a(l),Qt.delete(e);return}if(Ld(i)){let{fd:l,path:u,position:d}=i,p=new Di(c,l,u,d);o(p),Qt.delete(e);return}o(i),Qt.delete(e)}s(Hs,"handleResponse");function Un(t,e){if(!t)throw f.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(Un,"attach");function Ys(t,e){if(!t)throw f.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(Ys,"detach");var Di=class extends Ft{constructor(i,r,n,o){super();this.fs=i;this.fd=r;this.path=n;this.position=o}static{s(this,"PortFile")}rpc(i,...r){return Mn({scope:"file",fd:this.fd,method:i,args:r},this.fs.options)}_throwNoSync(i){throw new f(95,"Syncrohnous operations not support on PortFile",this.path,i)}stat(){return this.rpc("stat")}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,r,n,o){return this.rpc("write",i,r,n,o)}writeSync(){this._throwNoSync("write")}async read(i,r,n,o){return await this.rpc("read",i,r,n,o)}readSync(){this._throwNoSync("read")}chown(i,r){return this.rpc("chown",i,r)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,r){return this.rpc("utimes",i,r)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}},Er=class extends Cn(se){constructor(i){super();this.options=i;this._sync=Bi.create({name:"port-tmpfs"});this.port=i.port,Un(this.port,Hs)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...r){return Mn({scope:"fs",method:i,args:r},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,r,n){return this.rpc("rename",i,r,n)}async stat(i,r){return new Y(await this.rpc("stat",i,r))}sync(i,r,n){return this.rpc("sync",i,r,n)}openFile(i,r,n){return this.rpc("openFile",i,r,n)}createFile(i,r,n,o){return this.rpc("createFile",i,r,n,o)}unlink(i,r){return this.rpc("unlink",i,r)}rmdir(i,r){return this.rpc("rmdir",i,r)}mkdir(i,r,n){return this.rpc("mkdir",i,r,n)}readdir(i,r){return this.rpc("readdir",i,r)}exists(i,r){return this.rpc("exists",i,r)}link(i,r,n){return this.rpc("link",i,r,n)}},Gs=0,Sr=new Map;async function Ks(t,e,i){if(!Dn(i))return;let{method:r,args:n,id:o,scope:a,stack:c}=i,l,u=!1;try{switch(a){case"fs":l=await e[r](...n),l instanceof Ft&&(Sr.set(++Gs,l),l={fd:Gs,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Sr.has(d))throw new f(9);l=await Sr.get(d)[r](...n),r=="close"&&Sr.delete(d);break;default:return}}catch(d){l=d,u=!0}t.postMessage({_zenfs:!0,scope:a,id:o,error:u,method:r,stack:c,value:l instanceof f?l.toJSON():l})}s(Ks,"handleRequest");function Dd(t,e){Un(t,i=>Ks(t,e,i))}s(Dd,"attachFS");function Md(t,e){Ys(t,i=>Ks(t,e,i))}s(Md,"detachFS");var Ud={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(t){if(typeof t?.postMessage!="function")throw new f(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(t){return new Er(t)},"create")};function Xs(t){try{return JSON.parse(t),!0}catch{return!1}}s(Xs,"isJSON");function Wn(t){return t.at(0).toUpperCase()+t.slice(1)}s(Wn,"capitalize");var jn=Symbol("struct_init"),Wd=Symbol("struct");var Js=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],Qs=[...Js,...Js.map(t=>Wn(t)),"char"];function Zs(t,e){return function(i,r){let n=typeof r=="object"?r.name:r;if(typeof n=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+n.toString()),n=n.toString()),!n)throw new ReferenceError("Invalid name for struct member");if(typeof i!="object")throw new TypeError("Invalid member for struct field");if(!("constructor"in i))throw new TypeError("Invalid member for struct field");let o=i.constructor;o[jn]||=[],o[jn].push({name:n,type:t,length:e})}}s(Zs,"member");function $d(t){function e(i,r){return typeof i=="number"?Zs(t,i):Zs(t)(i,r)}return s(e,"_"),e}s($d,"_member");var FS=Object.fromEntries(Qs.map(t=>[t,$d(t)]));var ea=1,_r=class t extends Map{static{s(this,"Index")}constructor(){super()}files(){let e=new Map;for(let[i,r]of this)r.isFile()&&e.set(i,r);return e}toJSON(){return{version:ea,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(e){let i=[];for(let r of this.keys())A(r)==e&&i.push(q(r));return i}fromJSON(e){if(e.version!=ea)throw new f(22,"Index version mismatch");this.clear();for(let[i,r]of Object.entries(e.entries)){let n=new Y(r);n.isDirectory()&&(n.fileData=xe(JSON.stringify(this.dirEntries(i)))),this.set(i,n)}}static parse(e){if(!Xs(e))throw new f(22,"Invalid JSON");let i=JSON.parse(e),r=new t;return r.fromJSON(i),r}};var Mi=class extends Rn(se){constructor(i){super();this.indexData=i;this.index=new _r;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=await this.getData(i,r)}reloadFilesSync(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=this.getDataSync(i,r)}async stat(i){return this.statSync(i)}statSync(i){if(!this.index.has(i))throw f.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,r,n){if(le(r))throw new f(1,i);let o=this.index.get(i);if(!o)throw f.With("ENOENT",i,"openFile");if(!o.hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");return new Kt(this,i,r,o,o.isDirectory()?o.fileData:await this.getData(i,o))}openFileSync(i,r,n){if(le(r))throw new f(1,i);let o=this.index.get(i);if(!o)throw f.With("ENOENT",i,"openFile");if(!o.hasAccess(It(r),n))throw f.With("EACCES",i,"openFile");return new Kt(this,i,r,o,o.isDirectory()?o.fileData:this.getDataSync(i,o))}async readdir(i){return this.readdirSync(i)}readdirSync(i){let r=this.index.get(i);if(!r)throw f.With("ENOENT",i,"readdir");if(!r.isDirectory())throw f.With("ENOTDIR",i,"readdir");return JSON.parse(Xt(r.fileData))}};async function ta(t,e){let i=await fetch(t).catch(r=>{throw new f(5,r.message)});if(!i.ok)throw new f(5,"fetch failed: response returned code "+i.status);switch(e){case"buffer":let r=await i.arrayBuffer().catch(n=>{throw new f(5,n.message)});return new Uint8Array(r);case"json":return i.json().catch(n=>{throw new f(5,n.message)});default:throw new f(22,"Invalid download type: "+e)}}s(ta,"fetchFile");var xr=class t extends Mi{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized){await super.ready();for(let[e,i]of this.index.files())await this.getData(e,i)}}constructor({index:e="index.json",baseUrl:i=""}){super(typeof e!="string"?e:ta(e,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}preload(e,i){let r=this.index.get(e);if(!r)throw f.With("ENOENT",e,"preloadFile");if(!r.isFile())throw f.With("EISDIR",e,"preloadFile");r.size=i.length,r.fileData=i}async getData(e,i){if(i.fileData)return i.fileData;let r=await ta(this.baseUrl+(e.startsWith("/")?e.slice(1):e),"buffer");return i.fileData=r,r}getDataSync(e,i){if(i.fileData)return i.fileData;throw new f(61,"",e,"getData")}},zd={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(t){return new xr(t)},"create")};var Ui=class{constructor(){this.locks=new Map}static{s(this,"Mutex")}lock(e){return new Promise(i=>{this.locks.has(e)?this.locks.get(e).push(i):this.locks.set(e,[i])})}unlock(e){if(!this.locks.has(e))throw new f(1,"Can not unlock an already unlocked path",e);let i=this.locks.get(e)?.shift();if(i){setTimeout(i);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)}};var Wi=class{constructor(e){this.fs=e;this.mutex=new Ui}static{s(this,"LockedFS")}async ready(){await this.fs.ready()}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){await this.mutex.lock(e),await this.fs.rename(e,i,r),this.mutex.unlock(e)}renameSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"rename");return this.fs.renameSync(e,i,r)}async stat(e,i){await this.mutex.lock(e);let r=await this.fs.stat(e,i);return this.mutex.unlock(e),r}statSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"stat");return this.fs.statSync(e,i)}async openFile(e,i,r){await this.mutex.lock(e);let n=await this.fs.openFile(e,i,r);return this.mutex.unlock(e),n}openFileSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"openFile");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this.mutex.lock(e);let o=await this.fs.createFile(e,i,r,n);return this.mutex.unlock(e),o}createFileSync(e,i,r,n){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"createFile");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this.mutex.lock(e),await this.fs.unlink(e,i),this.mutex.unlock(e)}unlinkSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"unlink");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this.mutex.lock(e),await this.fs.rmdir(e,i),this.mutex.unlock(e)}rmdirSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"rmdir");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this.mutex.lock(e),await this.fs.mkdir(e,i,r),this.mutex.unlock(e)}mkdirSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"mkdir");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this.mutex.lock(e);let r=await this.fs.readdir(e,i);return this.mutex.unlock(e),r}readdirSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"readdir");return this.fs.readdirSync(e,i)}async exists(e,i){await this.mutex.lock(e);let r=await this.fs.exists(e,i);return this.mutex.unlock(e),r}existsSync(e,i){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"exists");return this.fs.existsSync(e,i)}async link(e,i,r){await this.mutex.lock(e),await this.fs.link(e,i,r),this.mutex.unlock(e)}linkSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"link");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this.mutex.lock(e),await this.fs.sync(e,i,r),this.mutex.unlock(e)}syncSync(e,i,r){if(this.mutex.isLocked(e))throw f.With("EBUSY",e,"sync");return this.fs.syncSync(e,i,r)}};var qn="/.deleted",kr=class extends se{constructor({writable:i,readable:r}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this._writable=i,this._readable=r,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnlockedOverlayFS")}async ready(){await this._readable.ready(),await this._writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:ji.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(i,r,n){let o=n.cred(0,0);await this.createParentDirectories(i,o),await this._writable.sync(i,r,n)}syncSync(i,r,n){let o=n.cred(0,0);this.createParentDirectoriesSync(i,o),this._writable.syncSync(i,r,n)}async _initialize(){if(!this._isInitialized){try{let i=await this._writable.openFile(qn,L("r"),Me),{size:r}=await i.stat(),{buffer:n}=await i.read(new Uint8Array(r));this._deleteLog=Xt(n)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(i,r){this._deleteLog=i,this._reparseDeletionLog(),this.updateLog("",r)}async rename(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{await this._writable.rename(i,r,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}renameSync(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{this._writable.renameSync(i,r,n)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"rename")}}async stat(i,r){this.checkInitialized();try{return this._writable.stat(i,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new Y(await this._readable.stat(i,r));return o.mode|=146,o}}statSync(i,r){this.checkInitialized();try{return this._writable.statSync(i,r)}catch{if(this._deletedFiles.has(i))throw f.With("ENOENT",i,"stat");let o=new Y(this._readable.statSync(i,r));return o.mode|=146,o}}async openFile(i,r,n){if(await this._writable.exists(i,n))return this._writable.openFile(i,r,n);let o=await this._readable.openFile(i,L("r"),n),a=new Y(await o.stat()),{buffer:c}=await o.read(new Uint8Array(a.size));return new fe(this,i,r,a,c)}openFileSync(i,r,n){if(this._writable.existsSync(i,n))return this._writable.openFileSync(i,r,n);let o=this._readable.openFileSync(i,L("r"),n),a=new Y(o.statSync()),c=new Uint8Array(a.size);return o.readSync(c),new fe(this,i,r,a,c)}async createFile(i,r,n,o){return this.checkInitialized(),await this._writable.createFile(i,r,n,o),this.openFile(i,r,o)}createFileSync(i,r,n,o){return this.checkInitialized(),this._writable.createFileSync(i,r,n,o),this.openFileSync(i,r,o)}async link(i,r,n){this.checkInitialized(),await this._writable.link(i,r,n)}linkSync(i,r,n){this.checkInitialized(),this._writable.linkSync(i,r,n)}async unlink(i,r){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,r))throw f.With("ENOENT",i,"unlink");await this._writable.exists(i,r)&&await this._writable.unlink(i,r),await this.exists(i,r)&&this.deletePath(i,r)}unlinkSync(i,r){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,r))throw f.With("ENOENT",i,"unlink");this._writable.existsSync(i,r)&&this._writable.unlinkSync(i,r),this.existsSync(i,r)&&this.deletePath(i,r)}async rmdir(i,r){if(this.checkInitialized(),!await this.exists(i,r))throw f.With("ENOENT",i,"rmdir");if(await this._writable.exists(i,r)&&await this._writable.rmdir(i,r),await this.exists(i,r)){if((await this.readdir(i,r)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}rmdirSync(i,r){if(this.checkInitialized(),!this.existsSync(i,r))throw f.With("ENOENT",i,"rmdir");if(this._writable.existsSync(i,r)&&this._writable.rmdirSync(i,r),this.existsSync(i,r)){if(this.readdirSync(i,r).length>0)throw f.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}async mkdir(i,r,n){if(this.checkInitialized(),await this.exists(i,n))throw f.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,n),await this._writable.mkdir(i,r,n)}mkdirSync(i,r,n){if(this.checkInitialized(),this.existsSync(i,n))throw f.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,n),this._writable.mkdirSync(i,r,n)}async readdir(i,r){if(this.checkInitialized(),!(await this.stat(i,r)).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this._writable.readdir(i,r))}catch{}try{o.push(...(await this._readable.readdir(i,r)).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}readdirSync(i,r){if(this.checkInitialized(),!this.statSync(i,r).isDirectory())throw f.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this._writable.readdirSync(i,r))}catch{}try{o=o.concat(this._readable.readdirSync(i,r).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}deletePath(i,r){this._deletedFiles.add(i),this.updateLog(`d${i}
|
|
3
|
+
`,r)}async updateLog(i,r){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(qn,L("w"),r);try{await n.write(xe(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",r))}catch(o){this._deleteLogError=o}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
|
|
4
|
+
`))i.startsWith("d")&&this._deletedFiles.add(i.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 i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==qn)throw f.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i,r){let n=A(i),o=[];for(;!this._writable.existsSync(n,r);)o.push(n),n=A(n);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,r).mode,r)}async createParentDirectories(i,r){let n=A(i),o=[];for(;!await this._writable.exists(n,r);)o.push(n),n=A(n);o=o.reverse();for(let a of o){let c=await this.stat(a,r);await this._writable.mkdir(a,c.mode,r)}}operateOnWritable(i,r){if(!this.existsSync(i,r))throw f.With("ENOENT",i,"operateOnWriteable");this._writable.existsSync(i,r)||this.copyToWritableSync(i,r)}async operateOnWritableAsync(i,r){if(!await this.exists(i,r))throw f.With("ENOENT",i,"operateOnWritable");if(!await this._writable.exists(i,r))return this.copyToWritable(i,r)}copyToWritableSync(i,r){let n=this.statSync(i,r);if(n.isDirectory()){this._writable.mkdirSync(i,n.mode,r);return}let o=new Uint8Array(n.size),a=this._readable.openFileSync(i,L("r"),r);a.readSync(o),a.closeSync();let c=this._writable.openFileSync(i,L("w"),r);c.writeSync(o),c.closeSync()}async copyToWritable(i,r){let n=await this.stat(i,r);if(n.isDirectory()){await this._writable.mkdir(i,n.mode,r);return}let o=new Uint8Array(n.size),a=await this._readable.openFile(i,L("r"),r);await a.read(o),await a.close();let c=await this._writable.openFile(i,L("w"),r);await c.write(o),await c.close()}},ji=class extends Wi{static{s(this,"OverlayFS")}constructor(e){super(new kr(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}},Vd={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:s(function(){return!0},"isAvailable"),create:s(function(t){return new ji(t)},"create")};function qi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(qi,"isBackend");async function $n(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(c=>!(c in t.options)).map(c=>({str:c,distance:Nn(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.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($n,"checkOptions");function vr(t){return t!=null&&typeof t=="object"&&"backend"in t&&qi(t.backend)}s(vr,"isBackendConfig");var pr={};hr(pr,{BigIntStatsFs:()=>Ai,Dir:()=>bt,Dirent:()=>mt,ReadStream:()=>_t,Stats:()=>Y,StatsFs:()=>Pi,WriteStream:()=>xt,access:()=>Lu,accessSync:()=>Wa,appendFile:()=>uu,appendFileSync:()=>Ia,chmod:()=>Ou,chmodSync:()=>Da,chown:()=>Pu,chownSync:()=>La,close:()=>pu,closeSync:()=>nt,constants:()=>vt,copyFile:()=>$u,copyFileSync:()=>so,cp:()=>Yu,cpSync:()=>ao,createReadStream:()=>Uu,createWriteStream:()=>Wu,exists:()=>ru,existsSync:()=>qe,fchmod:()=>Su,fchmodSync:()=>Nr,fchown:()=>wu,fchownSync:()=>Rr,fdatasync:()=>mu,fdatasyncSync:()=>Oa,fstat:()=>du,fstatSync:()=>Pa,fsync:()=>yu,fsyncSync:()=>Aa,ftruncate:()=>hu,ftruncateSync:()=>to,futimes:()=>Eu,futimesSync:()=>Lr,lchmod:()=>Tu,lchmodSync:()=>Ma,lchown:()=>Au,lchownSync:()=>Ba,link:()=>vu,linkSync:()=>Ra,lopenSync:()=>Gi,lstat:()=>ou,lstatSync:()=>eo,lutimes:()=>Ru,lutimesSync:()=>Ua,mkdir:()=>xu,mkdirSync:()=>Br,mkdtemp:()=>qu,mkdtempSync:()=>ja,mount:()=>Vi,mountObject:()=>Hi,mounts:()=>Se,open:()=>cu,openAsBlob:()=>Ku,openSync:()=>ni,opendir:()=>Hu,opendirSync:()=>za,promises:()=>dr,read:()=>gu,readFile:()=>lu,readFileSync:()=>Cr,readSync:()=>Ca,readdir:()=>ku,readdirSync:()=>oi,readlink:()=>Iu,readlinkSync:()=>ro,readv:()=>zu,readvSync:()=>qa,realpath:()=>Nu,realpathSync:()=>je,rename:()=>iu,renameSync:()=>ka,rm:()=>ju,rmSync:()=>oo,rmdir:()=>_u,rmdirSync:()=>io,stat:()=>nu,statSync:()=>Yi,statfs:()=>Gu,statfsSync:()=>Va,symlink:()=>Fu,symlinkSync:()=>Na,truncate:()=>su,truncateSync:()=>va,umount:()=>Ar,unlink:()=>au,unlinkSync:()=>Tr,unwatchFile:()=>Du,utimes:()=>Cu,utimesSync:()=>no,watch:()=>Mu,watchFile:()=>Bu,write:()=>bu,writeFile:()=>fu,writeFileSync:()=>Ki,writeSync:()=>Ta,writev:()=>Vu,writevSync:()=>$a});var Ds=yr(we(),1);var dr={};hr(dr,{FileHandle:()=>ie,access:()=>Rs,appendFile:()=>vs,chmod:()=>Os,chown:()=>Ps,constants:()=>vt,copyFile:()=>kn,cp:()=>vn,exists:()=>Ie,lchmod:()=>Ts,lchown:()=>As,link:()=>Fs,lstat:()=>wn,lutimes:()=>Cs,mkdir:()=>ur,mkdtemp:()=>Ns,open:()=>ue,opendir:()=>Ls,readFile:()=>fr,readdir:()=>Ct,readlink:()=>En,realpath:()=>Fe,rename:()=>xs,rm:()=>xn,rmdir:()=>Sn,stat:()=>Ei,statfs:()=>Bs,symlink:()=>Is,truncate:()=>ks,unlink:()=>lr,utimes:()=>_n,watch:()=>Kg,writeFile:()=>xi});var Vt=yr(we(),1);var yt=yr(we(),1);var k=Me;function xa(t){k=t}s(xa,"setCred");var Tt=new Map,kp=100;function zi(t){let e=kp++;return Tt.set(e,t),e}s(zi,"file2fd");function B(t){if(!Tt.has(t))throw new f(9);return Tt.get(t)}s(B,"fd2file");var Se=new Map;Vi("/",Bi.create({name:"root"}));function Vi(t,e){if(t[0]!=="/"&&(t="/"+t),t=pt(t),Se.has(t))throw new f(22,"Mount point "+t+" is already in use.");Se.set(t,e)}s(Vi,"mount");function Ar(t){if(t[0]!=="/"&&(t=`/${t}`),t=pt(t),!Se.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");Se.delete(t)}s(Ar,"umount");function T(t){t=E(t);let e=[...Se].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(T,"resolveMount");function _a(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(_a,"fixPaths");function H(t,e){return typeof t.stack=="string"&&(t.stack=_a(t.stack,e)),t.message=_a(t.message,e),t}s(H,"fixError");function Hi(t){"/"in t&&Ar("/");for(let[e,i]of Object.entries(t))Vi(e,i)}s(Hi,"mountObject");function Or(t,e){let i=t.metadata(),r=i.blockSize||4096;return{type:(e?BigInt:Number)(i.type),bsize:(e?BigInt:Number)(r),ffree:(e?BigInt:Number)(i.freeNodes||he),files:(e?BigInt:Number)(i.totalNodes||he),bavail:(e?BigInt:Number)(i.freeSpace/r),bfree:(e?BigInt:Number)(i.freeSpace/r),blocks:(e?BigInt:Number)(i.totalSpace/r)}}s(Or,"_statfs");function ka(t,e){t=E(t),e=E(e);let i=T(t),r=T(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,k);Ki(e,Cr(t)),Tr(t)}catch(o){throw H(o,n)}}s(ka,"renameSync");function qe(t){t=E(t);try{let{fs:e,path:i}=T(je(t));return e.existsSync(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(qe,"existsSync");function Yi(t,e){t=E(t);let{fs:i,path:r}=T(qe(t)?je(t):t);try{let n=i.statSync(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(Yi,"statSync");function eo(t,e){t=E(t);let{fs:i,path:r}=T(t);try{let n=i.statSync(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(eo,"lstatSync");function va(t,e=0){let i=ni(t,"r+");try{to(i,e)}finally{nt(i)}}s(va,"truncateSync");function Tr(t){t=E(t);let{fs:e,path:i}=T(t);try{return e.unlinkSync(i,k)}catch(r){throw H(r,{[i]:t})}}s(Tr,"unlinkSync");function ri(t,e,i,r=!0){t=E(t);let n=me(i,420),o=L(e);t=r&&qe(t)?je(t):t;let{fs:a,path:c}=T(t);if(!a.existsSync(c,k)){if(!le(o)&&!it(o)||o=="r+")throw f.With("ENOENT",t,"_open");if(!a.statSync(A(c),k).isDirectory())throw f.With("ENOTDIR",A(t),"_open");return a.createFileSync(c,o,n,k)}let l=a.statSync(c,k);if(!l.hasAccess(n,k))throw f.With("EACCES",t,"_open");if(Ci(o))throw f.With("EEXIST",t,"_open");return Ti(o)?(a.unlinkSync(c,k),a.createFileSync(c,o,l.mode,k)):a.openFileSync(c,o,k)}s(ri,"_openSync");function ni(t,e,i=0){return zi(ri(t,e,i,!0))}s(ni,"openSync");function Gi(t,e,i){return zi(ri(t,e,i,!1))}s(Gi,"lopenSync");function Fa(t,e,i){let r=ri(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(Fa,"_readFileSync");function Cr(t,e={}){let i=be(e,null,"r",420),r=L(i.flag);if(!dt(r))throw new f(22,"Flag passed to readFile must allow for reading.");let n=yt.Buffer.from(Fa(typeof t=="number"?B(t).path:t.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Cr,"readFileSync");function Ki(t,e,i={}){let r=be(i,"utf8","w+",420),n=L(r.flag);if(!le(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"?yt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new f(22,"Data not specified");let a=ri(typeof t=="number"?B(t).path:t.toString(),n,r.mode,!0);try{a.writeSync(o,0,o.byteLength,0)}finally{a.closeSync()}}s(Ki,"writeFileSync");function Ia(t,e,i={}){let r=be(i,"utf8","a",420),n=L(r.flag);if(!it(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"?yt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=ri(typeof t=="number"?B(t).path:t.toString(),n,r.mode,!0);try{a.writeSync(o,0,o.byteLength)}finally{a.closeSync()}}s(Ia,"appendFileSync");function Pa(t,e){let i=B(t).statSync();return e?.bigint?new ce(i):i}s(Pa,"fstatSync");function nt(t){B(t).closeSync(),Tt.delete(t)}s(nt,"closeSync");function to(t,e=0){if(e||=0,e<0)throw new f(22);B(t).truncateSync(e)}s(to,"ftruncateSync");function Aa(t){B(t).syncSync()}s(Aa,"fsyncSync");function Oa(t){B(t).datasyncSync()}s(Oa,"fdatasyncSync");function Ta(t,e,i,r,n){let o,a,c,l;if(typeof e=="string"){l=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=yt.Buffer.from(e,d),c=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,l=typeof n=="number"?n:null;let u=B(t);return l??=u.position,u.writeSync(o,a,c,l)}s(Ta,"writeSync");function Ca(t,e,i,r,n){let o=B(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 Rr(t,e,i){B(t).chownSync(e,i)}s(Rr,"fchownSync");function Nr(t,e){let i=me(e,-1);if(i<0)throw new f(22,"Invalid mode.");B(t).chmodSync(i)}s(Nr,"fchmodSync");function Lr(t,e,i){B(t).utimesSync(Pt(e),Pt(i))}s(Lr,"futimesSync");function io(t){t=E(t);let{fs:e,path:i}=T(qe(t)?je(t):t);try{e.rmdirSync(i,k)}catch(r){throw H(r,{[i]:t})}}s(io,"rmdirSync");function Br(t,e){let i=me(typeof e=="number"||typeof e=="string"?e:e?.mode,511),r=typeof e=="object"&&e?.recursive;t=E(t);let{fs:n,path:o}=T(qe(t)?je(t):t);try{return n.mkdirSync(o,i,k)}catch(a){throw H(a,{[o]:t})}}s(Br,"mkdirSync");function oi(t,e){t=E(t);let{fs:i,path:r}=T(qe(t)?je(t):t),n;try{n=i.readdirSync(r,k)}catch(o){throw H(o,{[r]:t})}for(let o of Se.keys()){if(!o.startsWith(t))continue;let a=o.slice(t.length);a.includes("/")||a.length==0||n.push(a)}return n.map(o=>typeof e=="object"&&e?.withFileTypes?new mt(o,Yi(j(t.toString(),o))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?yt.Buffer.from(o):o)}s(oi,"readdirSync");function Ra(t,e){t=E(t),e=E(e);let{fs:i,path:r}=T(t);try{return i.linkSync(r,e,k)}catch(n){throw H(n,{[r]:t})}}s(Ra,"linkSync");function Na(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(qe(e))throw f.With("EEXIST",e.toString(),"symlink");Ki(e,t.toString()),ri(e,"r+",420,!1)._setTypeSync(Z.SYMLINK)}s(Na,"symlinkSync");function ro(t,e){let i=yt.Buffer.from(Fa(t.toString(),"r",!1)),r=typeof e=="object"?e?.encoding:e;return r=="buffer"?i:i.toString(r)}s(ro,"readlinkSync");function La(t,e,i){let r=ni(t,"r+");Rr(r,e,i),nt(r)}s(La,"chownSync");function Ba(t,e,i){let r=Gi(t,"r+");Rr(r,e,i),nt(r)}s(Ba,"lchownSync");function Da(t,e){let i=ni(t,"r+");Nr(i,e),nt(i)}s(Da,"chmodSync");function Ma(t,e){let i=Gi(t,"r+");Nr(i,e),nt(i)}s(Ma,"lchmodSync");function no(t,e,i){let r=ni(t,"r+");Lr(r,e,i),nt(r)}s(no,"utimesSync");function Ua(t,e,i){let r=Gi(t,"r+");Lr(r,e,i),nt(r)}s(Ua,"lutimesSync");function je(t,e){t=E(t);let{base:i,dir:r}=mr(t),n=j(r=="/"?"/":je(r),i),{fs:o,path:a,mountPoint:c}=T(n);try{return o.statSync(a,k).isSymbolicLink()?je(c+ro(n)):n}catch(l){throw H(l,{[a]:n})}}s(je,"realpathSync");function Wa(t,e=384){if(!Yi(t).hasAccess(e,k))throw new f(13)}s(Wa,"accessSync");function oo(t,e){switch(t=E(t),Yi(t).mode&61440){case 16384:if(e?.recursive)for(let r of oi(t))oo(j(t,r));io(t);return;case 32768:case 40960:Tr(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(oo,"rmSync");function ja(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Br(n),i=="buffer"?yt.Buffer.from(n):n}s(ja,"mkdtempSync");function so(t,e,i){if(t=E(t),e=E(e),i&&i&1&&qe(e))throw new f(17,"Destination file already exists.",e,"copyFile");Ki(e,Cr(t))}s(so,"copyFileSync");function qa(t,e,i){let r=B(t),n=0;for(let o of e)n+=r.readSync(o,0,o.byteLength,i+n);return n}s(qa,"readvSync");function $a(t,e,i){let r=B(t),n=0;for(let o of e)n+=r.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+n);return n}s($a,"writevSync");function za(t,e){return t=E(t),new bt(t)}s(za,"opendirSync");function ao(t,e,i){t=E(t),e=E(e);let r=eo(t);if(i?.errorOnExist&&qe(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");Br(e,{recursive:!0});for(let n of oi(t,{withFileTypes:!0}))i.filter&&!i.filter(j(t,n.name),j(e,n.name))||ao(j(t,n.name),j(e,n.name),i);break;case 32768:case 40960:so(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&no(e,r.atime,r.mtime)}s(ao,"cpSync");function Va(t,e){t=E(t);let{fs:i}=T(t);return Or(i,e?.bigint)}s(Va,"statfsSync");var mt=class{constructor(e,i){this.path=e;this.stats=i}static{s(this,"Dirent")}get name(){return q(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()}},bt=class{constructor(e){this.path=e;this.closed=!1;this._entries=[]}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Ct(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this._entries||(this._entries=oi(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})},"next")}}};var gn=yr(tu(),1);var _t=class extends gn.Readable{static{s(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}},xt=class extends gn.Writable{static{s(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new f(5,i.toString()))}}};var ie=class{static{s(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?zi(e):e,this.file=i?e:B(e)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=me(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,e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Pt(e),Pt(i))}async appendFile(e,i={}){let r=be(i,"utf8","a",420),n=L(r.flag);if(!it(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"?Vt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length)}read(e,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(e,i,r,n)}async readFile(e){let i=be(e,null,"r",292),r=L(i.flag);if(!dt(r))throw new f(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(n),0,n,0),a=Vt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async({close:r,enqueue:n,error:o})=>{try{let l=0,u=0,d=NaN;for(;d>0;){let p=await this.read(new Uint8Array(65536),0,65536,u);if(!p.bytesRead){r();return}if(n(p.buffer.slice(0,p.bytesRead)),u+=p.bytesRead,++l>=1e7)throw new f(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");d=p.bytesRead}}catch(a){o(a)}},"start");return new globalThis.ReadableStream({start:i,type:e.type})}readLines(e){throw f.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new ce(i):i}async write(e,i,r,n){let o,a,c;if(typeof e=="string"){n=typeof i=="number"?i:null;let u=typeof r=="string"?r:"utf8";a=0,o=Vt.Buffer.from(e,u),c=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,n=typeof n=="number"?n:null;n??=this.file.position;let l=await this.file.write(o,a,c,n);return{buffer:o,bytesWritten:l}}async writeFile(e,i={}){let r=be(i,"utf8","w",420),n=L(r.flag);if(!le(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"?Vt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Tt.delete(this.fd)}async writev(e,i){let r=0;for(let n of e)r+=(await this.write(n,0,n.length,i+r)).bytesWritten;return{bytesWritten:r,buffers:e}}async readv(e,i){let r=0;for(let n of e)r+=(await this.read(n,0,n.byteLength,i+r)).bytesRead;return{bytesRead:r,buffers:e}}createReadStream(e){let i=new _t({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:s(async r=>{try{let n=await this.read(new Uint8Array(r),0,r,this.file.position);i.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(n){i.destroy(n)}},"read")});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:s(async(n,o,a)=>{try{let{bytesWritten:c}=await this.write(n,null,o);a(c==n.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},r=new xt(i);return r.path=this.file.path,r}};async function xs(t,e){t=E(t),e=E(e);let i=T(t),r=T(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,k);return}await xi(e,await fr(t)),await lr(t)}catch(n){throw H(n,{[i.path]:t,[r.path]:e})}}s(xs,"rename");async function Ie(t){try{let{fs:e,path:i}=T(await Fe(t));return await e.exists(i,k)}catch(e){if(e instanceof f&&e.code=="ENOENT")return!1;throw e}}s(Ie,"exists");async function Ei(t,e){t=E(t);let{fs:i,path:r}=T(await Ie(t)?await Fe(t):t);try{let n=await i.stat(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(Ei,"stat");async function wn(t,e){t=E(t);let{fs:i,path:r}=T(t);try{let n=await i.stat(r,k);return e?.bigint?new ce(n):n}catch(n){throw H(n,{[r]:t})}}s(wn,"lstat");async function ks(t,e=0){let i=await ue(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(ks,"truncate");async function lr(t){t=E(t);let{fs:e,path:i}=T(t);try{await e.unlink(i,k)}catch(r){throw H(r,{[i]:t})}}s(lr,"unlink");async function _i(t,e,i=420,r){t=E(t);let n=me(i,420),o=L(e);t=r&&await Ie(t)?await Fe(t):t;let{fs:a,path:c}=T(t);if(!await a.exists(t,k)){if(!le(o)&&!it(o)||o=="r+")throw f.With("ENOENT",t,"_open");let u=await a.stat(A(c),k);if(u&&!u.isDirectory())throw f.With("ENOTDIR",A(t),"_open");return new ie(await a.createFile(c,o,n,k))}if(Ci(o))throw f.With("EEXIST",t,"_open");if(!Ti(o))return new ie(await a.openFile(c,o,k));let l=await a.openFile(c,o,k);return await l.truncate(0),await l.sync(),new ie(l)}s(_i,"_open");async function ue(t,e="r",i=420){return await _i(t,e,i,!0)}s(ue,"open");async function fr(t,e){let i=be(e,null,"r",420),r=typeof t=="object"&&"fd"in t?t:await ue(t,i.flag,i.mode);try{return await r.readFile(i)}finally{await r.close()}}s(fr,"readFile");async function xi(t,e,i){let r=be(i,"utf8","w+",420),n=t instanceof ie?t:await ue(t.toString(),r.flag,r.mode);try{let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new f(22,"Iterables and streams not supported",n.file.path,"writeFile");await n.writeFile(o,r)}finally{await n.close()}}s(xi,"writeFile");async function vs(t,e,i){let r=be(i,"utf8","a",420),n=L(r.flag);if(!it(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"?Vt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=typeof t=="object"&&"fd"in t?t:await ue(t,r.flag,r.mode);try{await a.appendFile(o,r)}finally{await a.close()}}s(vs,"appendFile");async function Sn(t){t=E(t),t=await Ie(t)?await Fe(t):t;let{fs:e,path:i}=T(t);try{await e.rmdir(i,k)}catch(r){throw H(r,{[i]:t})}}s(Sn,"rmdir");async function ur(t,e){t=E(t),t=await Ie(t)?await Fe(t):t;let{fs:i,path:r}=T(t);try{await i.mkdir(r,me(typeof e=="object"?e?.mode:e,511),k)}catch(n){throw H(n,{[r]:t})}}s(ur,"mkdir");async function Ct(t,e){t=E(t),t=await Ie(t)?await Fe(t):t;let{fs:i,path:r}=T(t),n;try{n=await i.readdir(r,k)}catch(a){throw H(a,{[r]:t})}for(let a of Se.keys())if(a.startsWith(t)){let c=a.slice(t.length);if(c.includes("/")||c.length==0)continue;n.push(c)}let o=[];for(let a of n)o.push(typeof e=="object"&&e?.withFileTypes?new mt(a,await Ei(j(t,a))):a);return o}s(Ct,"readdir");async function Fs(t,e){t=E(t),e=E(e);let{fs:i,path:r}=T(e);try{return await i.link(t,e,k)}catch(n){throw H(n,{[r]:e})}}s(Fs,"link");async function Is(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Ie(e))throw f.With("EEXIST",e.toString(),"symlink");await xi(e,t.toString()),await(await _i(e,"r+",420,!1)).file._setType(Z.SYMLINK)}s(Is,"symlink");async function En(t,e){let i=await _i(E(t),"r",420,!1);try{let r=await i.readFile(),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?r:r.toString(n)}finally{await i.close()}}s(En,"readlink");async function Ps(t,e,i){let r=await ue(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(Ps,"chown");async function As(t,e,i){let r=await _i(t,"r+",420,!1);try{await r.chown(e,i)}finally{await r.close()}}s(As,"lchown");async function Os(t,e){let i=await ue(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Os,"chmod");async function Ts(t,e){let i=await _i(t,"r+",420,!1);try{await i.chmod(e)}finally{await i.close()}}s(Ts,"lchmod");async function _n(t,e,i){let r=await ue(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(_n,"utimes");async function Cs(t,e,i){let r=await _i(t,"r+",420,!1);try{await r.utimes(new Date(e),new Date(i))}finally{await r.close()}}s(Cs,"lutimes");async function Fe(t,e){t=E(t);let{base:i,dir:r}=mr(t),n=j(r=="/"?"/":await Fe(r),i),{fs:o,path:a,mountPoint:c}=T(n);try{return(await o.stat(a,k)).isSymbolicLink()?Fe(c+await En(n)):n}catch(l){throw H(l,{[a]:n})}}s(Fe,"realpath");function Kg(t,e={}){throw f.With("ENOSYS",t.toString(),"watch")}s(Kg,"watch");async function Rs(t,e=0){if(!(await Ei(t)).hasAccess(e,k))throw new f(13)}s(Rs,"access");async function xn(t,e){switch(t=E(t),(await Ei(t)).mode&61440){case 16384:if(e?.recursive)for(let r of await Ct(t))await xn(j(t,r));await Sn(t);return;case 32768:case 40960:await lr(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(xn,"rm");async function Ns(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await ur(n),i=="buffer"?Vt.Buffer.from(n):n}s(Ns,"mkdtemp");async function kn(t,e,i){if(t=E(t),e=E(e),i&&i&1&&await Ie(e))throw new f(17,"Destination file already exists.",e,"copyFile");await xi(e,await fr(t))}s(kn,"copyFile");async function Ls(t,e){return t=E(t),new bt(t)}s(Ls,"opendir");async function vn(t,e,i){t=E(t),e=E(e);let r=await wn(t);if(i?.errorOnExist&&await Ie(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");await ur(e,{recursive:!0});for(let n of await Ct(t,{withFileTypes:!0}))i.filter&&!i.filter(j(t,n.name),j(e,n.name))||await vn(j(t,n.name),j(e,n.name),i);break;case 32768:case 40960:await kn(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await _n(e,r.atime,r.mtime)}s(vn,"cp");async function Bs(t,e){t=E(t);let{fs:i}=T(t);return Or(i,e?.bigint)}s(Bs,"statfs");function iu(t,e,i=S){xs(t,e).then(()=>i()).catch(i)}s(iu,"rename");function ru(t,e=S){Ie(t).then(e).catch(()=>e(!1))}s(ru,"exists");function nu(t,e,i=S){i=typeof e=="function"?e:i,Ei(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(nu,"stat");function ou(t,e,i=S){i=typeof e=="function"?e:i,wn(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(ou,"lstat");function su(t,e=0,i=S){i=typeof e=="function"?e:i,ks(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(su,"truncate");function au(t,e=S){lr(t).then(()=>e()).catch(e)}s(au,"unlink");function cu(t,e,i,r=S){let n=me(i,420);r=typeof i=="function"?i:r,ue(t,e,n).then(o=>r(void 0,o.fd)).catch(r)}s(cu,"open");function lu(t,e,i=S){i=typeof e=="function"?e:i,fr(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(lu,"readFile");function fu(t,e,i,r=S){r=typeof i=="function"?i:r,xi(t,e,typeof i!="function"?i:null).then(()=>r(void 0)).catch(r)}s(fu,"writeFile");function uu(t,e,i,r=S){r=typeof i=="function"?i:r,vs(t,e,typeof i=="function"?null:i).then(()=>r()).catch(r)}s(uu,"appendFile");function du(t,e,i=S){i=typeof e=="function"?e:i,B(t).stat().then(r=>i(void 0,typeof e=="object"&&e?.bigint?new ce(r):r)).catch(i)}s(du,"fstat");function pu(t,e=S){new ie(t).close().then(()=>e()).catch(e)}s(pu,"close");function hu(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=B(t);if(r<0)throw new f(22);n.truncate(r).then(()=>i()).catch(i)}s(hu,"ftruncate");function yu(t,e=S){B(t).sync().then(()=>e()).catch(e)}s(yu,"fsync");function mu(t,e=S){B(t).datasync().then(()=>e()).catch(e)}s(mu,"fdatasync");function bu(t,e,i,r,n,o=S){let a,c,l,u,d,p=new ie(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=Ds.Buffer.from(e),c=0,l=a.length;let b=o;p.write(a,c,l,u).then(({bytesWritten:m})=>b(void 0,m,a.toString(d))).catch(b)}else{a=Ds.Buffer.from(e.buffer),c=i,l=r,u=typeof n=="number"?n:null;let b=typeof n=="function"?n:o;p.write(a,c,l,u).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(bu,"write");function gu(t,e,i,r,n,o=S){new ie(t).read(e,i,r,n).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(gu,"read");function wu(t,e,i,r=S){new ie(t).chown(e,i).then(()=>r()).catch(r)}s(wu,"fchown");function Su(t,e,i){new ie(t).chmod(e).then(()=>i()).catch(i)}s(Su,"fchmod");function Eu(t,e,i,r=S){new ie(t).utimes(e,i).then(()=>r()).catch(r)}s(Eu,"futimes");function _u(t,e=S){Sn(t).then(()=>e()).catch(e)}s(_u,"rmdir");function xu(t,e,i=S){ur(t,e).then(()=>i()).catch(i)}s(xu,"mkdir");function ku(t,e,i=S){i=typeof e=="function"?e:i,Ct(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(ku,"readdir");function vu(t,e,i=S){Fs(t,e).then(()=>i()).catch(i)}s(vu,"link");function Fu(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Is(t,e,n).then(()=>r()).catch(r)}s(Fu,"symlink");function Iu(t,e,i=S){i=typeof e=="function"?e:i,En(t).then(r=>i(void 0,r)).catch(i)}s(Iu,"readlink");function Pu(t,e,i,r=S){Ps(t,e,i).then(()=>r()).catch(r)}s(Pu,"chown");function Au(t,e,i,r=S){As(t,e,i).then(()=>r()).catch(r)}s(Au,"lchown");function Ou(t,e,i=S){Os(t,e).then(()=>i()).catch(i)}s(Ou,"chmod");function Tu(t,e,i=S){Ts(t,e).then(()=>i()).catch(i)}s(Tu,"lchmod");function Cu(t,e,i,r=S){_n(t,e,i).then(()=>r()).catch(r)}s(Cu,"utimes");function Ru(t,e,i,r=S){Cs(t,e,i).then(()=>r()).catch(r)}s(Ru,"lutimes");function Nu(t,e,i=S){i=typeof e=="function"?e:i,Fe(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(Nu,"realpath");function Lu(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Rs(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(Lu,"access");function Bu(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watchFile")}s(Bu,"watchFile");function Du(t,e=S){throw f.With("ENOSYS",t.toString(),"unwatchFile")}s(Du,"unwatchFile");function Mu(t,e,i=S){throw f.With("ENOSYS",t.toString(),"watch")}s(Mu,"watch");function Uu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new _t({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{r||=await ue(t,"r",i?.mode);let a=await r.read(new Uint8Array(o),0,o,r.file.position);n.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),r.file.position+=a.bytesRead,a.bytesRead||await r.close()}catch(a){await r?.close(),n.destroy(a)}},"read"),destroy:s(function(o,a){r?.close().then(()=>a(o)).catch(a)},"destroy")});return n.path=t.toString(),n}s(Uu,"createReadStream");function Wu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new xt({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{r||=await ue(t,"w",i?.mode||438),await r.write(o,0,a),c(void 0)}catch(l){await r?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),r?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){r?.close().then(()=>o()).catch(o)},"final")});return n.path=t.toString(),n}s(Wu,"createWriteStream");function ju(t,e,i=S){i=typeof e=="function"?e:i,xn(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(ju,"rm");function qu(t,e,i=S){i=typeof e=="function"?e:i,Ns(t,typeof e!="function"?e:null).then(r=>i(void 0,r)).catch(i)}s(qu,"mkdtemp");function $u(t,e,i,r=S){r=typeof i=="function"?i:r,kn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s($u,"copyFile");function zu(t,e,i,r=S){r=typeof i=="function"?i:r,new ie(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesRead:o})=>r(void 0,o,n)).catch(r)}s(zu,"readv");function Vu(t,e,i,r=S){r=typeof i=="function"?i:r,new ie(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesWritten:o})=>r(void 0,o,n)).catch(r)}s(Vu,"writev");function Hu(t,e,i=S){i=typeof e=="function"?e:i,Ls(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(Hu,"opendir");function Yu(t,e,i,r=S){r=typeof i=="function"?i:r,vn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Yu,"cp");function Gu(t,e,i=S){i=typeof e=="function"?e:i,Bs(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(Gu,"statfs");async function Ku(t,e){let i=await ue(t.toString(),"r"),r=await i.readFile();return await i.close(),new Blob([r],e)}s(Ku,"openAsBlob");function Ms(t){return vr(t)||qi(t)||t instanceof se}s(Ms,"isMountConfig");async function Us(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!Ms(t))throw new f(22,"Invalid mount configuration");if(t instanceof se)return t;qi(t)&&(t={backend:t});for(let[n,o]of Object.entries(t))if(n!="backend"&&Ms(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[n]=await Us(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);$n(i,t);let r=await i.create(t);return"_disableSync"in r&&(r._disableSync=t.disableAsyncCache||!1),await r.ready(),r}s(Us,"resolveMountConfig");async function Xg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;if(Ms(t)&&(t={mounts:{"/":t}}),xa({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),!!t.mounts){for(let[r,n]of Object.entries(t.mounts)){if(!r.startsWith("/"))throw new f(22,"Mount points must have absolute paths");vr(n)&&(n.disableAsyncCache??=t.disableAsyncCache||!1),t.mounts[r]=await Us(n)}Hi(t.mounts)}}s(Xg,"configure");var Jg=pr;return id(Qg);})();
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
ieee754/index.js:
|