@zenfs/core 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FileIndex.d.ts +139 -34
- package/dist/FileIndex.js +166 -84
- package/dist/backends/AsyncMirror.d.ts +31 -2
- package/dist/backends/AsyncMirror.js +3 -11
- package/dist/backends/AsyncStore.d.ts +29 -2
- package/dist/backends/AsyncStore.js +2 -2
- package/dist/backends/Locked.d.ts +1 -1
- package/dist/backends/Locked.js +1 -1
- package/dist/backends/Overlay.d.ts +1 -1
- package/dist/backends/Overlay.js +1 -1
- package/dist/backends/SyncStore.d.ts +29 -2
- package/dist/backends/SyncStore.js +3 -2
- package/dist/browser.min.js +5 -5
- package/dist/browser.min.js.map +3 -3
- package/dist/file.d.ts +2 -2
- package/dist/file.js +2 -2
- package/dist/filesystem.d.ts +164 -12
- package/dist/filesystem.js +131 -118
- package/dist/utils.d.ts +1 -6
- package/dist/utils.js +5 -5
- package/package.json +1 -1
package/dist/browser.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var ZenFS=(()=>{var zc=Object.create;var xt=Object.defineProperty;var Vc=Object.getOwnPropertyDescriptor;var Hc=Object.getOwnPropertyNames;var Kc=Object.getPrototypeOf,Yc=Object.prototype.hasOwnProperty;var Gc=(t,e,i)=>e in t?xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var o=(t,e)=>xt(t,"name",{value:e,configurable:!0});var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Oi=(t,e)=>{for(var i in e)xt(t,i,{get:e[i],enumerable:!0})},ts=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Hc(e))!Yc.call(t,n)&&n!==i&&xt(t,n,{get:()=>e[n],enumerable:!(r=Vc(e,n))||r.enumerable});return t};var Xc=(t,e,i)=>(i=t!=null?zc(Kc(t)):{},ts(e||!t||!t.__esModule?xt(i,"default",{value:t,enumerable:!0}):i,t)),Jc=t=>ts(xt({},"__esModule",{value:!0}),t);var li=(t,e,i)=>(Gc(t,typeof e!="symbol"?e+"":e,i),i);var ps=k(rr=>{"use strict";rr.byteLength=bd;rr.toByteArray=wd;rr.fromByteArray=Ed;var ke=[],he=[],md=typeof Uint8Array<"u"?Uint8Array:Array,Fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(lt=0,ds=Fn.length;lt<ds;++lt)ke[lt]=Fn[lt],he[Fn.charCodeAt(lt)]=lt;var lt,ds;he["-".charCodeAt(0)]=62;he["_".charCodeAt(0)]=63;function hs(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]}o(hs,"getLens");function bd(t){var e=hs(t),i=e[0],r=e[1];return(i+r)*3/4-r}o(bd,"byteLength");function gd(t,e,i){return(e+i)*3/4-i}o(gd,"_byteLength");function wd(t){var e,i=hs(t),r=i[0],n=i[1],s=new md(gd(t,r,n)),a=0,l=n>0?r-4:r,c;for(c=0;c<l;c+=4)e=he[t.charCodeAt(c)]<<18|he[t.charCodeAt(c+1)]<<12|he[t.charCodeAt(c+2)]<<6|he[t.charCodeAt(c+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=he[t.charCodeAt(c)]<<2|he[t.charCodeAt(c+1)]>>4,s[a++]=e&255),n===1&&(e=he[t.charCodeAt(c)]<<10|he[t.charCodeAt(c+1)]<<4|he[t.charCodeAt(c+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}o(wd,"toByteArray");function Sd(t){return ke[t>>18&63]+ke[t>>12&63]+ke[t>>6&63]+ke[t&63]}o(Sd,"tripletToBase64");function _d(t,e,i){for(var r,n=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(Sd(r));return n.join("")}o(_d,"encodeChunk");function Ed(t){for(var e,i=t.length,r=i%3,n=[],s=16383,a=0,l=i-r;a<l;a+=s)n.push(_d(t,a,a+s>l?l:a+s));return r===1?(e=t[i-1],n.push(ke[e>>2]+ke[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(ke[e>>10]+ke[e>>4&63]+ke[e<<2&63]+"=")),n.join("")}o(Ed,"fromByteArray")});var ys=k(Pn=>{Pn.read=function(t,e,i,r,n){var s,a,l=n*8-r-1,c=(1<<l)-1,f=c>>1,d=-7,h=i?n-1:0,b=i?-1:1,m=t[e+h];for(h+=b,s=m&(1<<-d)-1,m>>=-d,d+=l;d>0;s=s*256+t[e+h],h+=b,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=b,d-=8);if(s===0)s=1-f;else{if(s===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-f}return(m?-1:1)*a*Math.pow(2,s-r)};Pn.write=function(t,e,i,r,n,s){var a,l,c,f=s*8-n-1,d=(1<<f)-1,h=d>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:s-1,g=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=b/c:e+=b*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+m]=l&255,m+=g,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[i+m]=a&255,m+=g,a/=256,f-=8);t[i+m-g]|=y*128}});var Me=k($t=>{"use strict";var In=ps(),Wt=ys(),ms=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$t.Buffer=p;$t.SlowBuffer=Td;$t.INSPECT_MAX_BYTES=50;var nr=2147483647;$t.kMaxLength=nr;p.TYPED_ARRAY_SUPPORT=xd();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function xd(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}o(xd,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function Ue(t){if(t>nr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}o(Ue,"createBuffer");function p(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return On(t)}return Ss(t,e,i)}o(p,"Buffer");p.poolSize=8192;function Ss(t,e,i){if(typeof t=="string")return Ad(t,e);if(ArrayBuffer.isView(t))return kd(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(Ne(t,ArrayBuffer)||t&&Ne(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ne(t,SharedArrayBuffer)||t&&Ne(t.buffer,SharedArrayBuffer)))return Cn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return p.from(r,e,i);let n=Nd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}o(Ss,"from");p.from=function(t,e,i){return Ss(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function _s(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"')}o(_s,"assertSize");function vd(t,e,i){return _s(t),t<=0?Ue(t):e!==void 0?typeof i=="string"?Ue(t).fill(e,i):Ue(t).fill(e):Ue(t)}o(vd,"alloc");p.alloc=function(t,e,i){return vd(t,e,i)};function On(t){return _s(t),Ue(t<0?0:Bn(t)|0)}o(On,"allocUnsafe");p.allocUnsafe=function(t){return On(t)};p.allocUnsafeSlow=function(t){return On(t)};function Ad(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=Es(t,e)|0,r=Ue(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}o(Ad,"fromString");function Ln(t){let e=t.length<0?0:Bn(t.length)|0,i=Ue(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}o(Ln,"fromArrayLike");function kd(t){if(Ne(t,Uint8Array)){let e=new Uint8Array(t);return Cn(e.buffer,e.byteOffset,e.byteLength)}return Ln(t)}o(kd,"fromArrayView");function Cn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,p.prototype),r}o(Cn,"fromArrayBuffer");function Nd(t){if(p.isBuffer(t)){let e=Bn(t.length)|0,i=Ue(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Un(t.length)?Ue(0):Ln(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ln(t.data)}o(Nd,"fromObject");function Bn(t){if(t>=nr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nr.toString(16)+" bytes");return t|0}o(Bn,"checked");function Td(t){return+t!=t&&(t=0),p.alloc(+t)}o(Td,"SlowBuffer");p.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=o(function(e,i){if(Ne(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Ne(i,Uint8Array)&&(i=p.from(i,i.offset,i.byteLength)),!p.isBuffer(e)||!p.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let s=0,a=Math.min(r,n);s<a;++s)if(e[s]!==i[s]){r=e[s],n=i[s];break}return r<n?-1:n<r?1:0},"compare");p.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=o(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=p.allocUnsafe(i),s=0;for(r=0;r<e.length;++r){let a=e[r];if(Ne(a,Uint8Array))s+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(p.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n},"concat");function Es(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ne(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 Rn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Is(t).length;default:if(n)return r?-1:Rn(t).length;e=(""+e).toLowerCase(),n=!0}}o(Es,"byteLength");p.byteLength=Es;function Fd(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 Md(this,e,i);case"utf8":case"utf-8":return vs(this,e,i);case"ascii":return Dd(this,e,i);case"latin1":case"binary":return Ud(this,e,i);case"base64":return Od(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wd(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}o(Fd,"slowToString");p.prototype._isBuffer=!0;function ct(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}o(ct,"swap");p.prototype.swap16=o(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)ct(this,i,i+1);return this},"swap16");p.prototype.swap32=o(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)ct(this,i,i+3),ct(this,i+1,i+2);return this},"swap32");p.prototype.swap64=o(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)ct(this,i,i+7),ct(this,i+1,i+6),ct(this,i+2,i+5),ct(this,i+3,i+4);return this},"swap64");p.prototype.toString=o(function(){let e=this.length;return e===0?"":arguments.length===0?vs(this,0,e):Fd.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=o(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=o(function(){let e="",i=$t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");ms&&(p.prototype[ms]=p.prototype.inspect);p.prototype.compare=o(function(e,i,r,n,s){if(Ne(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),i<0||r>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&i>=r)return 0;if(n>=s)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,l=r-i,c=Math.min(a,l),f=this.slice(n,s),d=e.slice(i,r);for(let h=0;h<c;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function xs(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,Un(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=p.from(e,r)),p.isBuffer(e))return e.length===0?-1:bs(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):bs(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}o(xs,"bidirectionalIndexOf");function bs(t,e,i,r,n){let s=1,a=t.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,i/=2}function c(d,h){return s===1?d[h]:d.readUInt16BE(h*s)}o(c,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(c(t,f)===c(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*s}else d!==-1&&(f-=f-d),d=-1}else for(i+l>a&&(i=a-l),f=i;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(c(t,f+h)!==c(e,h)){d=!1;break}if(d)return f}return-1}o(bs,"arrayIndexOf");p.prototype.includes=o(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");p.prototype.indexOf=o(function(e,i,r){return xs(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=o(function(e,i,r){return xs(this,e,i,r,!1)},"lastIndexOf");function Pd(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let s=e.length;r>s/2&&(r=s/2);let a;for(a=0;a<r;++a){let l=parseInt(e.substr(a*2,2),16);if(Un(l))return a;t[i+a]=l}return a}o(Pd,"hexWrite");function Id(t,e,i,r){return or(Rn(e,t.length-i),t,i,r)}o(Id,"utf8Write");function Ld(t,e,i,r){return or(zd(e),t,i,r)}o(Ld,"asciiWrite");function Cd(t,e,i,r){return or(Is(e),t,i,r)}o(Cd,"base64Write");function Rd(t,e,i,r){return or(Vd(e,t.length-i),t,i,r)}o(Rd,"ucs2Write");p.prototype.write=o(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 s=this.length-i;if((r===void 0||r>s)&&(r=s),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 Pd(this,e,i,r);case"utf8":case"utf-8":return Id(this,e,i,r);case"ascii":case"latin1":case"binary":return Ld(this,e,i,r);case"base64":return Cd(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rd(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function Od(t,e,i){return e===0&&i===t.length?In.fromByteArray(t):In.fromByteArray(t.slice(e,i))}o(Od,"base64Slice");function vs(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let s=t[n],a=null,l=s>239?4:s>223?3:s>191?2:1;if(n+l<=i){let c,f,d,h;switch(l){case 1:s<128&&(a=s);break;case 2:c=t[n+1],(c&192)===128&&(h=(s&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[n+1],f=t[n+2],(c&192)===128&&(f&192)===128&&(h=(s&15)<<12|(c&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[n+1],f=t[n+2],d=t[n+3],(c&192)===128&&(f&192)===128&&(d&192)===128&&(h=(s&15)<<18|(c&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=l}return Bd(r)}o(vs,"utf8Slice");var gs=4096;function Bd(t){let e=t.length;if(e<=gs)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=gs));return i}o(Bd,"decodeCodePointsArray");function Dd(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}o(Dd,"asciiSlice");function Ud(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}o(Ud,"latin1Slice");function Md(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let s=e;s<i;++s)n+=Hd[t[s]];return n}o(Md,"hexSlice");function Wd(t,e,i){let r=t.slice(e,i),n="";for(let s=0;s<r.length-1;s+=2)n+=String.fromCharCode(r[s]+r[s+1]*256);return n}o(Wd,"utf16leSlice");p.prototype.slice=o(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,p.prototype),n},"slice");function K(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")}o(K,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=this[e],s=1,a=0;for(;++a<i&&(s*=256);)n+=this[e+a]*s;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=this[e+--i],s=1;for(;i>0&&(s*=256);)n+=this[e+--i]*s;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=o(function(e,i){return e=e>>>0,i||K(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=o(function(e,i){return e=e>>>0,i||K(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=o(function(e,i){return e=e>>>0,i||K(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=et(o(function(e){e=e>>>0,qt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&wi(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=et(o(function(e){e=e>>>0,qt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&wi(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(s)},"readBigUInt64BE"));p.prototype.readIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=this[e],s=1,a=0;for(;++a<i&&(s*=256);)n+=this[e+a]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*i)),n},"readIntLE");p.prototype.readIntBE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=i,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*i)),a},"readIntBE");p.prototype.readInt8=o(function(e,i){return e=e>>>0,i||K(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=o(function(e,i){e=e>>>0,i||K(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");p.prototype.readInt16BE=o(function(e,i){e=e>>>0,i||K(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");p.prototype.readInt32LE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=et(o(function(e){e=e>>>0,qt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&wi(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=et(o(function(e){e=e>>>0,qt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&wi(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));p.prototype.readFloatLE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),Wt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),Wt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=o(function(e,i){return e=e>>>0,i||K(e,8,this.length),Wt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=o(function(e,i){return e=e>>>0,i||K(e,8,this.length),Wt.read(this,e,!1,52,8)},"readDoubleBE");function ne(t,e,i,r,n,s){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}o(ne,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=o(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;ne(this,e,i,r,l,0)}let s=1,a=0;for(this[i]=e&255;++a<r&&(s*=256);)this[i+a]=e/s&255;return i+r},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=o(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;ne(this,e,i,r,l,0)}let s=r-1,a=1;for(this[i+s]=e&255;--s>=0&&(a*=256);)this[i+s]=e/a&255;return i+r},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(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 As(t,e,i,r,n){Ps(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s;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}o(As,"wrtBigUInt64LE");function ks(t,e,i,r,n){Ps(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s=s>>8,t[i+6]=s,s=s>>8,t[i+5]=s,s=s>>8,t[i+4]=s;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}o(ks,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=et(o(function(e,i=0){return As(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=et(o(function(e,i=0){return ks(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=o(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);ne(this,e,i,r,c-1,-c)}let s=0,a=1,l=0;for(this[i]=e&255;++s<r&&(a*=256);)e<0&&l===0&&this[i+s-1]!==0&&(l=1),this[i+s]=(e/a>>0)-l&255;return i+r},"writeIntLE");p.prototype.writeIntBE=o(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);ne(this,e,i,r,c-1,-c)}let s=r-1,a=1,l=0;for(this[i+s]=e&255;--s>=0&&(a*=256);)e<0&&l===0&&this[i+s+1]!==0&&(l=1),this[i+s]=(e/a>>0)-l&255;return i+r},"writeIntBE");p.prototype.writeInt8=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");p.prototype.writeInt16LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");p.prototype.writeInt16BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");p.prototype.writeInt32LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");p.prototype.writeInt32BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");p.prototype.writeBigInt64LE=et(o(function(e,i=0){return As(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=et(o(function(e,i=0){return ks(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ns(t,e,i,r,n,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}o(Ns,"checkIEEE754");function Ts(t,e,i,r,n){return e=+e,i=i>>>0,n||Ns(t,e,i,4,34028234663852886e22,-34028234663852886e22),Wt.write(t,e,i,r,23,4),i+4}o(Ts,"writeFloat");p.prototype.writeFloatLE=o(function(e,i,r){return Ts(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=o(function(e,i,r){return Ts(this,e,i,!1,r)},"writeFloatBE");function Fs(t,e,i,r,n){return e=+e,i=i>>>0,n||Ns(t,e,i,8,17976931348623157e292,-17976931348623157e292),Wt.write(t,e,i,r,52,8),i+8}o(Fs,"writeDouble");p.prototype.writeDoubleLE=o(function(e,i,r){return Fs(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=o(function(e,i,r){return Fs(this,e,i,!1,r)},"writeDoubleBE");p.prototype.copy=o(function(e,i,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-i<n-r&&(n=e.length-i+r);let s=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),s},"copy");p.prototype.fill=o(function(e,i,r,n){if(typeof e=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let s;if(typeof e=="number")for(s=i;s<r;++s)this[s]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-i;++s)this[s+i]=a[s%l]}return this},"fill");var Mt={};function Dn(t,e,i){Mt[t]=o(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}o(Dn,"E");Dn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Dn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Dn("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=ws(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=ws(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function ws(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}o(ws,"addNumericalSeparator");function qd(t,e,i){qt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&wi(e,t.length-(i+1))}o(qd,"checkBounds");function Ps(t,e,i,r,n,s){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw s>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:l=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new Mt.ERR_OUT_OF_RANGE("value",l,t)}qd(r,n,s)}o(Ps,"checkIntBI");function qt(t,e){if(typeof t!="number")throw new Mt.ERR_INVALID_ARG_TYPE(e,"number",t)}o(qt,"validateNumber");function wi(t,e,i){throw Math.floor(t)!==t?(qt(t,i),new Mt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Mt.ERR_BUFFER_OUT_OF_BOUNDS:new Mt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}o(wi,"boundsError");var $d=/[^+/0-9A-Za-z-_]/g;function jd(t){if(t=t.split("=")[0],t=t.trim().replace($d,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}o(jd,"base64clean");function Rn(t,e){e=e||1/0;let i,r=t.length,n=null,s=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return s}o(Rn,"utf8ToBytes");function zd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}o(zd,"asciiToBytes");function Vd(t,e){let i,r,n,s=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,s.push(n),s.push(r);return s}o(Vd,"utf16leToBytes");function Is(t){return In.toByteArray(jd(t))}o(Is,"base64ToBytes");function or(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}o(or,"blitBuffer");function Ne(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}o(Ne,"isInstance");function Un(t){return t!==t}o(Un,"numberIsNaN");var Hd=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 et(t){return typeof BigInt>"u"?Kd:t}o(et,"defineBigIntMethod");function Kd(){throw new Error("BigInt not supported")}o(Kd,"BufferBigIntNotDefined")});var C=k((fS,Ls)=>{"use strict";Ls.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var jt=k((dS,sr)=>{"use strict";var{AbortController:Cs,AbortSignal:Yd}=typeof self<"u"?self:typeof window<"u"?window:void 0;sr.exports=Cs;sr.exports.AbortSignal=Yd;sr.exports.default=Cs});var Si=k((hS,Mn)=>{"use strict";var zt=typeof Reflect=="object"?Reflect:null,Rs=zt&&typeof zt.apply=="function"?zt.apply:o(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),ar;zt&&typeof zt.ownKeys=="function"?ar=zt.ownKeys:Object.getOwnPropertySymbols?ar=o(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ar=o(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function Gd(t){console&&console.warn&&console.warn(t)}o(Gd,"ProcessEmitWarning");var Bs=Number.isNaN||o(function(e){return e!==e},"NumberIsNaN");function I(){I.init.call(this)}o(I,"EventEmitter");Mn.exports=I;Mn.exports.once=Zd;I.EventEmitter=I;I.prototype._events=void 0;I.prototype._eventsCount=0;I.prototype._maxListeners=void 0;var Os=10;function lr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(lr,"checkListener");Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return Os},set:function(t){if(typeof t!="number"||t<0||Bs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Os=t}});I.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};I.prototype.setMaxListeners=o(function(e){if(typeof e!="number"||e<0||Bs(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 Ds(t){return t._maxListeners===void 0?I.defaultMaxListeners:t._maxListeners}o(Ds,"_getMaxListeners");I.prototype.getMaxListeners=o(function(){return Ds(this)},"getMaxListeners");I.prototype.emit=o(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Rs(c,this,i);else for(var f=c.length,d=$s(c,f),r=0;r<f;++r)Rs(d[r],this,i);return!0},"emit");function Us(t,e,i,r){var n,s,a;if(lr(i),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),a=s[e]),a===void 0)a=s[e]=i,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=Ds(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,Gd(l)}return t}o(Us,"_addListener");I.prototype.addListener=o(function(e,i){return Us(this,e,i,!1)},"addListener");I.prototype.on=I.prototype.addListener;I.prototype.prependListener=o(function(e,i){return Us(this,e,i,!0)},"prependListener");function Xd(){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)}o(Xd,"onceWrapper");function Ms(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=Xd.bind(r);return n.listener=i,r.wrapFn=n,n}o(Ms,"_onceWrap");I.prototype.once=o(function(e,i){return lr(i),this.on(e,Ms(this,e,i)),this},"once");I.prototype.prependOnceListener=o(function(e,i){return lr(i),this.prependListener(e,Ms(this,e,i)),this},"prependOnceListener");I.prototype.removeListener=o(function(e,i){var r,n,s,a,l;if(lr(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(s=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){l=r[a].listener,s=a;break}if(s<0)return this;s===0?r.shift():Jd(r,s),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=o(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 s=Object.keys(r),a;for(n=0;n<s.length;++n)a=s[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 Ws(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?Qd(n):$s(n,n.length)}o(Ws,"_listeners");I.prototype.listeners=o(function(e){return Ws(this,e,!0)},"listeners");I.prototype.rawListeners=o(function(e){return Ws(this,e,!1)},"rawListeners");I.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):qs.call(t,e)};I.prototype.listenerCount=qs;function qs(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}o(qs,"listenerCount");I.prototype.eventNames=o(function(){return this._eventsCount>0?ar(this._events):[]},"eventNames");function $s(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}o($s,"arrayClone");function Jd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}o(Jd,"spliceOne");function Qd(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}o(Qd,"unwrapListeners");function Zd(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,s),r(a)}o(n,"errorListener");function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}o(s,"resolver"),js(t,e,s,{once:!0}),e!=="error"&&eh(t,n,{once:!0})})}o(Zd,"once");function eh(t,e,i){typeof t.on=="function"&&js(t,"error",e,i)}o(eh,"addErrorHandlerIfEventEmitter");function js(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,o(function n(s){r.once&&t.removeEventListener(e,n),i(s)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}o(js,"eventTargetAgnosticAddListener")});var Q=k((yS,Wn)=>{"use strict";var th=Me(),{kResistStopPropagation:ih,SymbolDispose:rh}=C(),nh=globalThis.AbortSignal||jt().AbortSignal,oh=globalThis.AbortController||jt().AbortController,sh=Object.getPrototypeOf(async function(){}).constructor,zs=globalThis.Blob||th.Blob,ah=o(typeof zs<"u"?function(e){return e instanceof zs}:function(e){return!1},"isBlob"),Vs=o((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),lh=o((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),cr=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=e}};o(cr,"AggregateError");Wn.exports={AggregateError:cr,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof sh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:ah,deprecate(t,e){return t},addAbortListener:Si().addAbortListener||o(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Vs(e,"signal"),lh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[ih]:!0}),r=o(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[rh](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:nh.any||o(function(e){if(e.length===1)return e[0];let i=new oh,r=o(()=>i.abort(),"abort");return e.forEach(n=>{Vs(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};Wn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var te=k((bS,Ys)=>{"use strict";var{format:ch,inspect:fr,AggregateError:uh}=Q(),fh=globalThis.AggregateError||uh,dh=Symbol("kIsNodeError"),hh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],ph=/^([A-Z][a-z0-9]*)+$/,yh="__node_internal_",dr={};function ut(t,e){if(!t)throw new dr.ERR_INTERNAL_ASSERTION(e)}o(ut,"assert");function Hs(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}`}o(Hs,"addNumericalSeparator");function mh(t,e,i){if(typeof e=="function")return ut(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 ut(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:ch(e,...i)}o(mh,"getMessage");function X(t,e,i){i||(i=Error);class r extends i{constructor(...s){super(mh(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}o(r,"NodeError"),Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[dh]=!0,dr[t]=r}o(X,"E");function Ks(t){let e=yh+t.name;return Object.defineProperty(t,"name",{value:e}),t}o(Ks,"hideStackFrames");function bh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new fh([e,t],e.message);return i.code=e.code,i}return t||e}o(bh,"aggregateTwoErrors");var ur=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new dr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};o(ur,"AbortError");X("ERR_ASSERTION","%s",Error);X("ERR_INVALID_ARG_TYPE",(t,e,i)=>{ut(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=[],s=[],a=[];for(let c of e)ut(typeof c=="string","All expected entries have to be of type string"),hh.includes(c)?n.push(c.toLowerCase()):ph.test(c)?s.push(c):(ut(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(s.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();r+=`one of type ${n.join(", ")}, or ${c}`}}(s.length>0||a.length>0)&&(r+=" or ")}if(s.length>0){switch(s.length){case 1:r+=`an instance of ${s[0]}`;break;case 2:r+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();r+=`an instance of ${s.join(", ")}, or ${c}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();r+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)r+=`. Received an instance of ${i.constructor.name}`;else{let c=fr(i,{depth:-1});r+=`. Received ${c}`}}else{let c=fr(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),r+=`. Received type ${typeof i} (${c})`}return r},TypeError);X("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=fr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);X("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var r;let n=i!=null&&(r=i.constructor)!==null&&r!==void 0&&r.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);X("ERR_MISSING_ARGS",(...t)=>{ut(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(r=>`"${r}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);X("ERR_OUT_OF_RANGE",(t,e,i)=>{ut(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Hs(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=Hs(r)),r+="n"):r=fr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);X("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);X("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);X("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);X("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);X("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);X("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);X("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);X("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);X("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);X("ERR_STREAM_WRITE_AFTER_END","write after end",Error);X("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Ys.exports={AbortError:ur,aggregateTwoErrors:Ks(bh),hideStackFrames:Ks,codes:dr}});var Ht=k((wS,na)=>{"use strict";var{ArrayIsArray:$n,ArrayPrototypeIncludes:Qs,ArrayPrototypeJoin:Zs,ArrayPrototypeMap:gh,NumberIsInteger:jn,NumberIsNaN:wh,NumberMAX_SAFE_INTEGER:Sh,NumberMIN_SAFE_INTEGER:_h,NumberParseInt:Eh,ObjectPrototypeHasOwnProperty:xh,RegExpPrototypeExec:ea,String:vh,StringPrototypeToUpperCase:Ah,StringPrototypeTrim:kh}=C(),{hideStackFrames:pe,codes:{ERR_SOCKET_BAD_PORT:Nh,ERR_INVALID_ARG_TYPE:Z,ERR_INVALID_ARG_VALUE:Vt,ERR_OUT_OF_RANGE:ft,ERR_UNKNOWN_SIGNAL:Gs}}=te(),{normalizeEncoding:Th}=Q(),{isAsyncFunction:Fh,isArrayBufferView:Ph}=Q().types,Xs={};function Ih(t){return t===(t|0)}o(Ih,"isInt32");function Lh(t){return t===t>>>0}o(Lh,"isUint32");var Ch=/^[0-7]+$/,Rh="must be a 32-bit unsigned integer or an octal string";function Oh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(ea(Ch,t)===null)throw new Vt(e,t,Rh);t=Eh(t,8)}return ta(t,e),t}o(Oh,"parseFileMode");var Bh=pe((t,e,i=_h,r=Sh)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!jn(t))throw new ft(e,"an integer",t);if(t<i||t>r)throw new ft(e,`>= ${i} && <= ${r}`,t)}),Dh=pe((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!jn(t))throw new ft(e,"an integer",t);if(t<i||t>r)throw new ft(e,`>= ${i} && <= ${r}`,t)}),ta=pe((t,e,i=!1)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!jn(t))throw new ft(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new ft(e,`>= ${r} && <= ${n}`,t)});function zn(t,e){if(typeof t!="string")throw new Z(e,"string",t)}o(zn,"validateString");function Uh(t,e,i=void 0,r){if(typeof t!="number")throw new Z(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&wh(t))throw new ft(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}o(Uh,"validateNumber");var Mh=pe((t,e,i)=>{if(!Qs(i,t)){let n="must be one of: "+Zs(gh(i,s=>typeof s=="string"?`'${s}'`:vh(s)),", ");throw new Vt(e,t,n)}});function ia(t,e){if(typeof t!="boolean")throw new Z(e,"boolean",t)}o(ia,"validateBoolean");function qn(t,e,i){return t==null||!xh(t,e)?i:t[e]}o(qn,"getOwnPropertyValueOrDefault");var Wh=pe((t,e,i=null)=>{let r=qn(i,"allowArray",!1),n=qn(i,"allowFunction",!1);if(!qn(i,"nullable",!1)&&t===null||!r&&$n(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Z(e,"Object",t)}),qh=pe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Z(e,"a dictionary",t)}),hr=pe((t,e,i=0)=>{if(!$n(t))throw new Z(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new Vt(e,t,r)}});function $h(t,e){hr(t,e);for(let i=0;i<t.length;i++)zn(t[i],`${e}[${i}]`)}o($h,"validateStringArray");function jh(t,e){hr(t,e);for(let i=0;i<t.length;i++)ia(t[i],`${e}[${i}]`)}o(jh,"validateBooleanArray");function zh(t,e){hr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new Z(n,"AbortSignal",r);ra(r,n)}}o(zh,"validateAbortSignalArray");function Vh(t,e="signal"){if(zn(t,e),Xs[t]===void 0)throw Xs[Ah(t)]!==void 0?new Gs(t+" (signals must use all capital letters)"):new Gs(t)}o(Vh,"validateSignalName");var Hh=pe((t,e="buffer")=>{if(!Ph(t))throw new Z(e,["Buffer","TypedArray","DataView"],t)});function Kh(t,e){let i=Th(e),r=t.length;if(i==="hex"&&r%2!==0)throw new Vt("encoding",e,`is invalid for data of length ${r}`)}o(Kh,"validateEncoding");function Yh(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&kh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Nh(e,t,i);return t|0}o(Yh,"validatePort");var ra=pe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Z(e,"AbortSignal",t)}),Gh=pe((t,e)=>{if(typeof t!="function")throw new Z(e,"Function",t)}),Xh=pe((t,e)=>{if(typeof t!="function"||Fh(t))throw new Z(e,"Function",t)}),Jh=pe((t,e)=>{if(t!==void 0)throw new Z(e,"undefined",t)});function Qh(t,e,i){if(!Qs(i,t))throw new Z(e,`('${Zs(i,"|")}')`,t)}o(Qh,"validateUnion");var Zh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Js(t,e){if(typeof t>"u"||!ea(Zh,t))throw new Vt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(Js,"validateLinkHeaderFormat");function ep(t){if(typeof t=="string")return Js(t,"hints"),t;if($n(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];Js(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new Vt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(ep,"validateLinkHeaderValue");na.exports={isInt32:Ih,isUint32:Lh,parseFileMode:Oh,validateArray:hr,validateStringArray:$h,validateBooleanArray:jh,validateAbortSignalArray:zh,validateBoolean:ia,validateBuffer:Hh,validateDictionary:qh,validateEncoding:Kh,validateFunction:Gh,validateInt32:Dh,validateInteger:Bh,validateNumber:Uh,validateObject:Wh,validateOneOf:Mh,validatePlainFunction:Xh,validatePort:Yh,validateSignalName:Vh,validateString:zn,validateUint32:ta,validateUndefined:Jh,validateUnion:Qh,validateAbortSignal:ra,validateLinkHeaderValue:ep}});var tt=k((_S,la)=>{var M=la.exports={},Te,Fe;function Vn(){throw new Error("setTimeout has not been defined")}o(Vn,"defaultSetTimout");function Hn(){throw new Error("clearTimeout has not been defined")}o(Hn,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Te=setTimeout:Te=Vn}catch{Te=Vn}try{typeof clearTimeout=="function"?Fe=clearTimeout:Fe=Hn}catch{Fe=Hn}})();function oa(t){if(Te===setTimeout)return setTimeout(t,0);if((Te===Vn||!Te)&&setTimeout)return Te=setTimeout,setTimeout(t,0);try{return Te(t,0)}catch{try{return Te.call(null,t,0)}catch{return Te.call(this,t,0)}}}o(oa,"runTimeout");function tp(t){if(Fe===clearTimeout)return clearTimeout(t);if((Fe===Hn||!Fe)&&clearTimeout)return Fe=clearTimeout,clearTimeout(t);try{return Fe(t)}catch{try{return Fe.call(null,t)}catch{return Fe.call(this,t)}}}o(tp,"runClearTimeout");var We=[],Kt=!1,dt,pr=-1;function ip(){!Kt||!dt||(Kt=!1,dt.length?We=dt.concat(We):pr=-1,We.length&&sa())}o(ip,"cleanUpNextTick");function sa(){if(!Kt){var t=oa(ip);Kt=!0;for(var e=We.length;e;){for(dt=We,We=[];++pr<e;)dt&&dt[pr].run();pr=-1,e=We.length}dt=null,Kt=!1,tp(t)}}o(sa,"drainQueue");M.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];We.push(new aa(t,e)),We.length===1&&!Kt&&oa(sa)};function aa(t,e){this.fun=t,this.array=e}o(aa,"Item");aa.prototype.run=function(){this.fun.apply(null,this.array)};M.title="browser";M.browser=!0;M.env={};M.argv=[];M.version="";M.versions={};function qe(){}o(qe,"noop");M.on=qe;M.addListener=qe;M.once=qe;M.off=qe;M.removeListener=qe;M.removeAllListeners=qe;M.emit=qe;M.prependListener=qe;M.prependOnceListener=qe;M.listeners=function(t){return[]};M.binding=function(t){throw new Error("process.binding is not supported")};M.cwd=function(){return"/"};M.chdir=function(t){throw new Error("process.chdir is not supported")};M.umask=function(){return 0}});var Ie=k((xS,xa)=>{"use strict";var{SymbolAsyncIterator:ca,SymbolIterator:ua,SymbolFor:ht}=C(),fa=ht("nodejs.stream.destroyed"),da=ht("nodejs.stream.errored"),Kn=ht("nodejs.stream.readable"),Yn=ht("nodejs.stream.writable"),ha=ht("nodejs.stream.disturbed"),rp=ht("nodejs.webstream.isClosedPromise"),np=ht("nodejs.webstream.controllerErrorFunction");function yr(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))}o(yr,"isReadableNodeStream");function mr(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))}o(mr,"isWritableNodeStream");function op(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}o(op,"isDuplexNodeStream");function Pe(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}o(Pe,"isNodeStream");function pa(t){return!!(t&&!Pe(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}o(pa,"isReadableStream");function ya(t){return!!(t&&!Pe(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}o(ya,"isWritableStream");function ma(t){return!!(t&&!Pe(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}o(ma,"isTransformStream");function sp(t){return pa(t)||ya(t)||ma(t)}o(sp,"isWebStream");function ap(t,e){return t==null?!1:e===!0?typeof t[ca]=="function":e===!1?typeof t[ua]=="function":typeof t[ca]=="function"||typeof t[ua]=="function"}o(ap,"isIterable");function br(t){if(!Pe(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[fa]||r!=null&&r.destroyed)}o(br,"isDestroyed");function ba(t){if(!mr(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}o(ba,"isWritableEnded");function lp(t,e){if(!mr(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)}o(lp,"isWritableFinished");function cp(t){if(!yr(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}o(cp,"isReadableEnded");function ga(t,e){if(!yr(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)}o(ga,"isReadableFinished");function wa(t){return t&&t[Kn]!=null?t[Kn]:typeof t?.readable!="boolean"?null:br(t)?!1:yr(t)&&t.readable&&!ga(t)}o(wa,"isReadable");function Sa(t){return t&&t[Yn]!=null?t[Yn]:typeof t?.writable!="boolean"?null:br(t)?!1:mr(t)&&t.writable&&!ba(t)}o(Sa,"isWritable");function up(t,e){return Pe(t)?br(t)?!0:!(e?.readable!==!1&&wa(t)||e?.writable!==!1&&Sa(t)):null}o(up,"isFinished");function fp(t){var e,i;return Pe(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(fp,"isWritableErrored");function dp(t){var e,i;return Pe(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(dp,"isReadableErrored");function hp(t){if(!Pe(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"&&_a(t)?t._closed:null}o(hp,"isClosed");function _a(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}o(_a,"isOutgoingMessage");function Ea(t){return typeof t._sent100=="boolean"&&_a(t)}o(Ea,"isServerResponse");function pp(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}o(pp,"isServerRequest");function yp(t){if(!Pe(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Ea(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}o(yp,"willEmitClose");function mp(t){var e;return!!(t&&((e=t[ha])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}o(mp,"isDisturbed");function bp(t){var e,i,r,n,s,a,l,c,f,d;return!!(t&&((e=(i=(r=(n=(s=(a=t[da])!==null&&a!==void 0?a:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}o(bp,"isErrored");xa.exports={isDestroyed:br,kIsDestroyed:fa,isDisturbed:mp,kIsDisturbed:ha,isErrored:bp,kIsErrored:da,isReadable:wa,kIsReadable:Kn,kIsClosedPromise:rp,kControllerErrorFunction:np,kIsWritable:Yn,isClosed:hp,isDuplexNodeStream:op,isFinished:up,isIterable:ap,isReadableNodeStream:yr,isReadableStream:pa,isReadableEnded:cp,isReadableFinished:ga,isReadableErrored:dp,isNodeStream:Pe,isWebStream:sp,isWritable:Sa,isWritableNodeStream:mr,isWritableStream:ya,isWritableEnded:ba,isWritableFinished:lp,isWritableErrored:fp,isServerRequest:pp,isServerResponse:Ea,willEmitClose:yp,isTransformStream:ma}});var $e=k((AS,Zn)=>{var it=tt(),{AbortError:La,codes:gp}=te(),{ERR_INVALID_ARG_TYPE:wp,ERR_STREAM_PREMATURE_CLOSE:va}=gp,{kEmptyObject:Xn,once:Jn}=Q(),{validateAbortSignal:Sp,validateFunction:_p,validateObject:Ep,validateBoolean:xp}=Ht(),{Promise:vp,PromisePrototypeThen:Ap,SymbolDispose:Ca}=C(),{isClosed:kp,isReadable:Aa,isReadableNodeStream:Gn,isReadableStream:Np,isReadableFinished:ka,isReadableErrored:Na,isWritable:Ta,isWritableNodeStream:Fa,isWritableStream:Tp,isWritableFinished:Pa,isWritableErrored:Ia,isNodeStream:Fp,willEmitClose:Pp,kIsClosedPromise:Ip}=Ie(),Yt;function Lp(t){return t.setHeader&&typeof t.abort=="function"}o(Lp,"isRequest");var Qn=o(()=>{},"nop");function Ra(t,e,i){var r,n;if(arguments.length===2?(i=e,e=Xn):e==null?e=Xn:Ep(e,"options"),_p(i,"callback"),Sp(e.signal,"options.signal"),i=Jn(i),Np(t)||Tp(t))return Cp(t,e,i);if(!Fp(t))throw new wp("stream",["ReadableStream","WritableStream","Stream"],t);let s=(r=e.readable)!==null&&r!==void 0?r:Gn(t),a=(n=e.writable)!==null&&n!==void 0?n:Fa(t),l=t._writableState,c=t._readableState,f=o(()=>{t.writable||b()},"onlegacyfinish"),d=Pp(t)&&Gn(t)===s&&Fa(t)===a,h=Pa(t,!1),b=o(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||m)&&i.call(t)},"onfinish"),m=ka(t,!1),g=o(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),y=o(q=>{i.call(t,q)},"onerror"),A=kp(t),w=o(()=>{A=!0;let q=Ia(t)||Na(t);if(q&&typeof q!="boolean")return i.call(t,q);if(s&&!m&&Gn(t,!0)&&!ka(t,!1))return i.call(t,new va);if(a&&!h&&!Pa(t,!1))return i.call(t,new va);i.call(t)},"onclose"),F=o(()=>{A=!0;let q=Ia(t)||Na(t);if(q&&typeof q!="boolean")return i.call(t,q);i.call(t)},"onclosed"),O=o(()=>{t.req.on("finish",b)},"onrequest");Lp(t)?(t.on("complete",b),d||t.on("abort",w),t.req?O():t.on("request",O)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",w),t.on("end",g),t.on("finish",b),e.error!==!1&&t.on("error",y),t.on("close",w),A?it.nextTick(w):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||it.nextTick(F):(!s&&(!d||Aa(t))&&(h||Ta(t)===!1)||!a&&(!d||Ta(t))&&(m||Aa(t)===!1)||c&&t.req&&t.aborted)&&it.nextTick(F);let v=o(()=>{i=Qn,t.removeListener("aborted",w),t.removeListener("complete",b),t.removeListener("abort",w),t.removeListener("request",O),t.req&&t.req.removeListener("finish",b),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",b),t.removeListener("end",g),t.removeListener("error",y),t.removeListener("close",w)},"cleanup");if(e.signal&&!A){let q=o(()=>{let nt=i;v(),nt.call(t,new La(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)it.nextTick(q);else{Yt=Yt||Q().addAbortListener;let nt=Yt(e.signal,q),ce=i;i=Jn((...Et)=>{nt[Ca](),ce.apply(t,Et)})}}return v}o(Ra,"eos");function Cp(t,e,i){let r=!1,n=Qn;if(e.signal)if(n=o(()=>{r=!0,i.call(t,new La(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)it.nextTick(n);else{Yt=Yt||Q().addAbortListener;let a=Yt(e.signal,n),l=i;i=Jn((...c)=>{a[Ca](),l.apply(t,c)})}let s=o((...a)=>{r||it.nextTick(()=>i.apply(t,a))},"resolverFn");return Ap(t[Ip].promise,s,s),Qn}o(Cp,"eosWeb");function Rp(t,e){var i;let r=!1;return e===null&&(e=Xn),(i=e)!==null&&i!==void 0&&i.cleanup&&(xp(e.cleanup,"cleanup"),r=e.cleanup),new vp((n,s)=>{let a=Ra(t,e,l=>{r&&a(),l?s(l):n()})})}o(Rp,"finished");Zn.exports=Ra;Zn.exports.finished=Rp});var pt=k((NS,$a)=>{"use strict";var Le=tt(),{aggregateTwoErrors:Op,codes:{ERR_MULTIPLE_CALLBACK:Bp},AbortError:Dp}=te(),{Symbol:Da}=C(),{kIsDestroyed:Up,isDestroyed:Mp,isFinished:Wp,isServerRequest:qp}=Ie(),Ua=Da("kDestroy"),eo=Da("kConstruct");function Ma(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}o(Ma,"checkError");function $p(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):(Ma(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Oa(this,t,e):this.once(Ua,function(s){Oa(this,Op(s,t),e)}),this)}o($p,"destroy");function Oa(t,e,i){let r=!1;function n(s){if(r)return;r=!0;let a=t._readableState,l=t._writableState;Ma(s,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(s),s?Le.nextTick(jp,t,s):Le.nextTick(Wa,t)}o(n,"onDestroy");try{t._destroy(e||null,n)}catch(s){n(s)}}o(Oa,"_destroy");function jp(t,e){to(t,e),Wa(t)}o(jp,"emitErrorCloseNT");function Wa(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")}o(Wa,"emitCloseNT");function to(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}o(to,"emitErrorNT");function zp(){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)}o(zp,"undestroy");function io(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?Le.nextTick(to,t,e):to(t,e))}o(io,"errorOrDestroy");function Vp(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(eo,e),!(t.listenerCount(eo)>1)&&Le.nextTick(Hp,t)}o(Vp,"construct");function Hp(t){let e=!1;function i(r){if(e){io(t,r??new Bp);return}e=!0;let n=t._readableState,s=t._writableState,a=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),a.destroyed?t.emit(Ua,r):r?io(t,r,!0):Le.nextTick(Kp,t)}o(i,"onConstruct");try{t._construct(r=>{Le.nextTick(i,r)})}catch(r){Le.nextTick(i,r)}}o(Hp,"constructNT");function Kp(t){t.emit(eo)}o(Kp,"emitConstructNT");function Ba(t){return t?.setHeader&&typeof t.abort=="function"}o(Ba,"isRequest");function qa(t){t.emit("close")}o(qa,"emitCloseLegacy");function Yp(t,e){t.emit("error",e),Le.nextTick(qa,t)}o(Yp,"emitErrorCloseLegacy");function Gp(t,e){!t||Mp(t)||(!e&&!Wp(t)&&(e=new Dp),qp(t)?(t.socket=null,t.destroy(e)):Ba(t)?t.abort():Ba(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Le.nextTick(Yp,t,e):Le.nextTick(qa,t),t.destroyed||(t[Up]=!0))}o(Gp,"destroyer");$a.exports={construct:Vp,destroyer:Gp,destroy:$p,undestroy:zp,errorOrDestroy:io}});var Sr=k((FS,za)=>{"use strict";var{ArrayIsArray:Xp,ObjectSetPrototypeOf:ja}=C(),{EventEmitter:gr}=Si();function wr(t){gr.call(this,t)}o(wr,"Stream");ja(wr.prototype,gr.prototype);ja(wr,gr);wr.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}o(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}o(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let s=!1;function a(){s||(s=!0,t.end())}o(a,"onend");function l(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}o(l,"onclose");function c(d){f(),gr.listenerCount(this,"error")===0&&this.emit("error",d)}o(c,"onerror"),ro(i,"error",c),ro(t,"error",c);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return o(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function ro(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):Xp(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}o(ro,"prependListener");za.exports={Stream:wr,prependListener:ro}});var _i=k((IS,_r)=>{"use strict";var{SymbolDispose:Jp}=C(),{AbortError:Va,codes:Qp}=te(),{isNodeStream:Ha,isWebStream:Zp,kControllerErrorFunction:ey}=Ie(),ty=$e(),{ERR_INVALID_ARG_TYPE:Ka}=Qp,no,iy=o((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Ka(e,"AbortSignal",t)},"validateAbortSignal");_r.exports.addAbortSignal=o(function(e,i){if(iy(e,"signal"),!Ha(i)&&!Zp(i))throw new Ka("stream",["ReadableStream","WritableStream","Stream"],i);return _r.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");_r.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=Ha(e)?()=>{e.destroy(new Va(void 0,{cause:t.reason}))}:()=>{e[ey](new Va(void 0,{cause:t.reason}))};if(t.aborted)i();else{no=no||Q().addAbortListener;let r=no(t,i);ty(e,r[Jp])}return e}});var Xa=k((RS,Ga)=>{"use strict";var{StringPrototypeSlice:Ya,SymbolIterator:ry,TypedArrayPrototypeSet:Er,Uint8Array:ny}=C(),{Buffer:oo}=Me(),{inspect:oy}=Q();Ga.exports=o(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return oo.alloc(0);let i=oo.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Er(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}*[ry](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let s=r.data;if(e>s.length)i+=s,e-=s.length;else{e===s.length?(i+=s,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=Ya(s,0,e),this.head=r,r.data=Ya(s,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=oo.allocUnsafe(e),r=e,n=this.head,s=0;do{let a=n.data;if(e>a.length)Er(i,a,r-e),e-=a.length;else{e===a.length?(Er(i,a,r-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(Er(i,new ny(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return oy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var Ei=k((BS,el)=>{"use strict";var{MathFloor:sy,NumberIsInteger:ay}=C(),{validateInteger:ly}=Ht(),{ERR_INVALID_ARG_VALUE:cy}=te().codes,Ja=16*1024,Qa=16;function uy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}o(uy,"highWaterMarkFrom");function Za(t){return t?Qa:Ja}o(Za,"getDefaultHighWaterMark");function fy(t,e){ly(e,"value",0),t?Qa=e:Ja=e}o(fy,"setDefaultHighWaterMark");function dy(t,e,i,r){let n=uy(e,r,i);if(n!=null){if(!ay(n)||n<0){let s=r?`options.${i}`:"options.highWaterMark";throw new cy(s,n)}return sy(n)}return Za(t.objectMode)}o(dy,"getHighWaterMark");el.exports={getHighWaterMark:dy,getDefaultHighWaterMark:Za,setDefaultHighWaterMark:fy}});var rl=k((so,il)=>{var xr=Me(),Ce=xr.Buffer;function tl(t,e){for(var i in t)e[i]=t[i]}o(tl,"copyProps");Ce.from&&Ce.alloc&&Ce.allocUnsafe&&Ce.allocUnsafeSlow?il.exports=xr:(tl(xr,so),so.Buffer=yt);function yt(t,e,i){return Ce(t,e,i)}o(yt,"SafeBuffer");yt.prototype=Object.create(Ce.prototype);tl(Ce,yt);yt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ce(t,e,i)};yt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ce(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};yt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ce(t)};yt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return xr.SlowBuffer(t)}});var sl=k(ol=>{"use strict";var lo=rl().Buffer,nl=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 hy(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}}o(hy,"_normalizeEncoding");function py(t){var e=hy(t);if(typeof e!="string"&&(lo.isEncoding===nl||!nl(t)))throw new Error("Unknown encoding: "+t);return e||t}o(py,"normalizeEncoding");ol.StringDecoder=xi;function xi(t){this.encoding=py(t);var e;switch(this.encoding){case"utf16le":this.text=Sy,this.end=_y,e=4;break;case"utf8":this.fillLast=by,e=4;break;case"base64":this.text=Ey,this.end=xy,e=3;break;default:this.write=vy,this.end=Ay;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lo.allocUnsafe(e)}o(xi,"StringDecoder");xi.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||""};xi.prototype.end=wy;xi.prototype.text=gy;xi.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 ao(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}o(ao,"utf8CheckByte");function yy(t,e,i){var r=e.length-1;if(r<i)return 0;var n=ao(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=ao(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=ao(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}o(yy,"utf8CheckIncomplete");function my(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"}}o(my,"utf8CheckExtraBytes");function by(t){var e=this.lastTotal-this.lastNeed,i=my(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}o(by,"utf8FillLast");function gy(t,e){var i=yy(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)}o(gy,"utf8Text");function wy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}o(wy,"utf8End");function Sy(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)}o(Sy,"utf16Text");function _y(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}o(_y,"utf16End");function Ey(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))}o(Ey,"base64Text");function xy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}o(xy,"base64End");function vy(t){return t.toString(this.encoding)}o(vy,"simpleWrite");function Ay(t){return t&&t.length?this.write(t):""}o(Ay,"simpleEnd")});var co=k((qS,ul)=>{"use strict";var al=tt(),{PromisePrototypeThen:ky,SymbolAsyncIterator:ll,SymbolIterator:cl}=C(),{Buffer:Ny}=Me(),{ERR_INVALID_ARG_TYPE:Ty,ERR_STREAM_NULL_VALUES:Fy}=te().codes;function Py(t,e,i){let r;if(typeof e=="string"||e instanceof Ny)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[ll])n=!0,r=e[ll]();else if(e&&e[cl])n=!1,r=e[cl]();else throw new Ty("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;s._read=function(){a||(a=!0,c())},s._destroy=function(f,d){ky(l(f),()=>al.nextTick(d,f),h=>al.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof r.throw=="function";if(d&&h){let{value:b,done:m}=await r.throw(f);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}o(l,"close");async function c(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Fy;if(s.push(h))continue;a=!1}}catch(f){s.destroy(f)}break}}return o(c,"next"),s}o(Py,"from");ul.exports=Py});var Ai=k((jS,Tl)=>{var _e=tt(),{ArrayPrototypeIndexOf:Iy,NumberIsInteger:Ly,NumberIsNaN:Cy,NumberParseInt:Ry,ObjectDefineProperties:go,ObjectKeys:Oy,ObjectSetPrototypeOf:hl,Promise:pl,SafeSet:By,SymbolAsyncDispose:Dy,SymbolAsyncIterator:Uy,Symbol:My}=C();Tl.exports=_;_.ReadableState=Nr;var{EventEmitter:Wy}=Si(),{Stream:rt,prependListener:qy}=Sr(),{Buffer:uo}=Me(),{addAbortSignal:$y}=_i(),yl=$e(),E=Q().debuglog("stream",t=>{E=t}),jy=Xa(),Jt=pt(),{getHighWaterMark:zy,getDefaultHighWaterMark:Vy}=Ei(),{aggregateTwoErrors:fl,codes:{ERR_INVALID_ARG_TYPE:Hy,ERR_METHOD_NOT_IMPLEMENTED:Ky,ERR_OUT_OF_RANGE:Yy,ERR_STREAM_PUSH_AFTER_EOF:Gy,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Xy},AbortError:Jy}=te(),{validateObject:Qy}=Ht(),mt=My("kPaused"),{StringDecoder:ml}=sl(),Zy=co();hl(_.prototype,rt.prototype);hl(_,rt);var fo=o(()=>{},"nop"),{errorOrDestroy:Gt}=Jt,Xt=1<<0,em=1<<1,bl=1<<2,vi=1<<3,gl=1<<4,vr=1<<5,Ar=1<<6,wl=1<<7,tm=1<<8,im=1<<9,rm=1<<10,mo=1<<11,bo=1<<12,nm=1<<13,om=1<<14,sm=1<<15,Sl=1<<16,am=1<<17,lm=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}o(z,"makeBitMapDescriptor");go(Nr.prototype,{objectMode:z(Xt),ended:z(em),endEmitted:z(bl),reading:z(vi),constructed:z(gl),sync:z(vr),needReadable:z(Ar),emittedReadable:z(wl),readableListening:z(tm),resumeScheduled:z(im),errorEmitted:z(rm),emitClose:z(mo),autoDestroy:z(bo),destroyed:z(nm),closed:z(om),closeEmitted:z(sm),multiAwaitDrain:z(Sl),readingMore:z(am),dataEmitted:z(lm)});function Nr(t,e,i){typeof i!="boolean"&&(i=e instanceof Re()),this.state=mo|bo|gl|vr,t&&t.objectMode&&(this.state|=Xt),i&&t&&t.readableObjectMode&&(this.state|=Xt),this.highWaterMark=t?zy(this,t,"readableHighWaterMark",i):Vy(!1),this.buffer=new jy,this.length=0,this.pipes=[],this.flowing=null,this[mt]=null,t&&t.emitClose===!1&&(this.state&=~mo),t&&t.autoDestroy===!1&&(this.state&=~bo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new ml(t.encoding),this.encoding=t.encoding)}o(Nr,"ReadableState");function _(t){if(!(this instanceof _))return new _(t);let e=this instanceof Re();this._readableState=new Nr(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&&$y(t.signal,this)),rt.call(this,t),Jt.construct(this,()=>{this._readableState.needReadable&&kr(this,this._readableState)})}o(_,"Readable");_.prototype.destroy=Jt.destroy;_.prototype._undestroy=Jt.undestroy;_.prototype._destroy=function(t,e){e(t)};_.prototype[Wy.captureRejectionSymbol]=function(t){this.destroy(t)};_.prototype[Dy]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Jy,this.destroy(t)),new pl((e,i)=>yl(this,r=>r&&r!==t?i(r):e(null)))};_.prototype.push=function(t,e){return _l(this,t,e,!1)};_.prototype.unshift=function(t,e){return _l(this,t,e,!0)};function _l(t,e,i,r){E("readableAddChunk",e);let n=t._readableState,s;if(n.state&Xt||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=uo.from(e,i).toString(n.encoding):(e=uo.from(e,i),i=""))):e instanceof uo?i="":rt._isUint8Array(e)?(e=rt._uint8ArrayToBuffer(e),i=""):e!=null&&(s=new Hy("chunk",["string","Buffer","Uint8Array"],e))),s)Gt(t,s);else if(e===null)n.state&=~vi,fm(t,n);else if(n.state&Xt||e&&e.length>0)if(r)if(n.state&bl)Gt(t,new Xy);else{if(n.destroyed||n.errored)return!1;ho(t,n,e,!0)}else if(n.ended)Gt(t,new Gy);else{if(n.destroyed||n.errored)return!1;n.state&=~vi,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?ho(t,n,e,!1):kr(t,n)):ho(t,n,e,!1)}else r||(n.state&=~vi,kr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}o(_l,"readableAddChunk");function ho(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Sl?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&Ar&&Tr(t)),kr(t,e)}o(ho,"addChunk");_.prototype.isPaused=function(){let t=this._readableState;return t[mt]===!0||t.flowing===!1};_.prototype.setEncoding=function(t){let e=new ml(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 cm=1073741824;function um(t){if(t>cm)throw new Yy("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}o(um,"computeNewHighWaterMark");function dl(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Xt?1:Cy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}o(dl,"howMuchToRead");_.prototype.read=function(t){E("read",t),t===void 0?t=NaN:Ly(t)||(t=Ry(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=um(t)),t!==0&&(e.state&=~wl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return E("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?po(this):Tr(this),null;if(t=dl(t,e),t===0&&e.ended)return e.length===0&&po(this),null;let r=(e.state&Ar)!==0;if(E("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,E("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,E("reading, ended or constructing",r);else if(r){E("do read"),e.state|=vi|vr,e.length===0&&(e.state|=Ar);try{this._read(e.highWaterMark)}catch(s){Gt(this,s)}e.state&=~vr,e.reading||(t=dl(i,e))}let n;return t>0?n=kl(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&&po(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function fm(t,e){if(E("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?Tr(t):(e.needReadable=!1,e.emittedReadable=!0,El(t))}}o(fm,"onEofChunk");function Tr(t){let e=t._readableState;E("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(E("emitReadable",e.flowing),e.emittedReadable=!0,_e.nextTick(El,t))}o(Tr,"emitReadable");function El(t){let e=t._readableState;E("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,vl(t)}o(El,"emitReadable_");function kr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,_e.nextTick(dm,t,e))}o(kr,"maybeReadMore");function dm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(E("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}o(dm,"maybeReadMore_");_.prototype._read=function(t){throw new Ky("_read()")};_.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new By(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),E("pipe count=%d opts=%j",r.pipes.length,e);let s=(!e||e.end!==!1)&&t!==_e.stdout&&t!==_e.stderr?l:A;r.endEmitted?_e.nextTick(s):i.once("end",s),t.on("unpipe",a);function a(w,F){E("onunpipe"),w===i&&F&&F.hasUnpiped===!1&&(F.hasUnpiped=!0,d())}o(a,"onunpipe");function l(){E("onend"),t.end()}o(l,"onend");let c,f=!1;function d(){E("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",A),i.removeListener("data",b),f=!0,c&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}o(d,"cleanup");function h(){f||(r.pipes.length===1&&r.pipes[0]===t?(E("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(E("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),c||(c=hm(i,t),t.on("drain",c))}o(h,"pause"),i.on("data",b);function b(w){E("ondata");let F=t.write(w);E("dest.write",F),F===!1&&h()}o(b,"ondata");function m(w){if(E("onerror",w),A(),t.removeListener("error",m),t.listenerCount("error")===0){let F=t._writableState||t._readableState;F&&!F.errorEmitted?Gt(t,w):t.emit("error",w)}}o(m,"onerror"),qy(t,"error",m);function g(){t.removeListener("finish",y),A()}o(g,"onclose"),t.once("close",g);function y(){E("onfinish"),t.removeListener("close",g),A()}o(y,"onfinish"),t.once("finish",y);function A(){E("unpipe"),i.unpipe(t)}return o(A,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(E("pipe resume"),i.resume()),t};function hm(t,e){return o(function(){let r=t._readableState;r.awaitDrainWriters===e?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}o(hm,"pipeOnDrain");_.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 s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let r=Iy(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};_.prototype.on=function(t,e){let i=rt.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,E("on readable",r.length,r.reading),r.length?Tr(this):r.reading||_e.nextTick(pm,this)),i};_.prototype.addListener=_.prototype.on;_.prototype.removeListener=function(t,e){let i=rt.prototype.removeListener.call(this,t,e);return t==="readable"&&_e.nextTick(xl,this),i};_.prototype.off=_.prototype.removeListener;_.prototype.removeAllListeners=function(t){let e=rt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&_e.nextTick(xl,this),e};function xl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[mt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}o(xl,"updateReadableListening");function pm(t){E("readable nexttick read 0"),t.read(0)}o(pm,"nReadingNextTick");_.prototype.resume=function(){let t=this._readableState;return t.flowing||(E("resume"),t.flowing=!t.readableListening,ym(this,t)),t[mt]=!1,this};function ym(t,e){e.resumeScheduled||(e.resumeScheduled=!0,_e.nextTick(mm,t,e))}o(ym,"resume");function mm(t,e){E("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),vl(t),e.flowing&&!e.reading&&t.read(0)}o(mm,"resume_");_.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[mt]=!0,this};function vl(t){let e=t._readableState;for(E("flow",e.flowing);e.flowing&&t.read()!==null;);}o(vl,"flow");_.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=>{Gt(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Oy(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};_.prototype[Uy]=function(){return Al(this)};_.prototype.iterator=function(t){return t!==void 0&&Qy(t,"options"),Al(this,t)};function Al(t,e){typeof t.read!="function"&&(t=_.wrap(t,{objectMode:!0}));let i=bm(t,e);return i.stream=t,i}o(Al,"streamToAsyncIterator");async function*bm(t,e){let i=fo;function r(a){this===t?(i(),i=fo):i=a}o(r,"next"),t.on("readable",r);let n,s=yl(t,{writable:!1},a=>{n=a?fl(n,a):null,i(),i=fo});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=fl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?Jt.destroyer(t,null):(t.off("readable",r),s())}}o(bm,"createAsyncIterator");go(_.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});go(Nr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[mt]!==!1},set(t){this[mt]=!!t}}});_._fromList=kl;function kl(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}o(kl,"fromList");function po(t){let e=t._readableState;E("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,_e.nextTick(gm,e,t))}o(po,"endReadable");function gm(t,e){if(E("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)_e.nextTick(wm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}o(gm,"endReadableNT");function wm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}o(wm,"endWritableNT");_.from=function(t,e){return Zy(_,t,e)};var yo;function Nl(){return yo===void 0&&(yo={}),yo}o(Nl,"lazyWebStreams");_.fromWeb=function(t,e){return Nl().newStreamReadableFromReadableStream(t,e)};_.toWeb=function(t,e){return Nl().newReadableStreamFromStreamReadable(t,e)};_.wrap=function(t,e){var i,r;return new _({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,s){Jt.destroyer(t,n),s(n)}}).wrap(t)}});var Cr=k((VS,Wl)=>{var bt=tt(),{ArrayPrototypeSlice:Il,Error:Sm,FunctionPrototypeSymbolHasInstance:Ll,ObjectDefineProperty:Cl,ObjectDefineProperties:_m,ObjectSetPrototypeOf:Rl,StringPrototypeToLowerCase:Em,Symbol:xm,SymbolHasInstance:vm}=C();Wl.exports=R;R.WritableState=Ti;var{EventEmitter:Am}=Si(),ki=Sr().Stream,{Buffer:Fr}=Me(),Lr=pt(),{addAbortSignal:km}=_i(),{getHighWaterMark:Nm,getDefaultHighWaterMark:Tm}=Ei(),{ERR_INVALID_ARG_TYPE:Fm,ERR_METHOD_NOT_IMPLEMENTED:Pm,ERR_MULTIPLE_CALLBACK:Ol,ERR_STREAM_CANNOT_PIPE:Im,ERR_STREAM_DESTROYED:Ni,ERR_STREAM_ALREADY_FINISHED:Lm,ERR_STREAM_NULL_VALUES:Cm,ERR_STREAM_WRITE_AFTER_END:Rm,ERR_UNKNOWN_ENCODING:Bl}=te().codes,{errorOrDestroy:Qt}=Lr;Rl(R.prototype,ki.prototype);Rl(R,ki);function _o(){}o(_o,"nop");var Zt=xm("kOnFinished");function Ti(t,e,i){typeof i!="boolean"&&(i=e instanceof Re()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Nm(this,t,"writableHighWaterMark",i):Tm(!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=Bm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Ir(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[Zt]=[]}o(Ti,"WritableState");function Ir(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}o(Ir,"resetBuffer");Ti.prototype.getBuffer=o(function(){return Il(this.buffered,this.bufferedIndex)},"getBuffer");Cl(Ti.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function R(t){let e=this instanceof Re();if(!e&&!Ll(R,this))return new R(t);this._writableState=new Ti(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&&km(t.signal,this)),ki.call(this,t),Lr.construct(this,()=>{let i=this._writableState;i.writing||xo(this,i),vo(this,i)})}o(R,"Writable");Cl(R,vm,{__proto__:null,value:function(t){return Ll(this,t)?!0:this!==R?!1:t&&t._writableState instanceof Ti}});R.prototype.pipe=function(){Qt(this,new Im)};function Dl(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"&&!Fr.isEncoding(i))throw new Bl(i);typeof r!="function"&&(r=_o)}if(e===null)throw new Cm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Fr.from(e,i),i="buffer");else if(e instanceof Fr)i="buffer";else if(ki._isUint8Array(e))e=ki._uint8ArrayToBuffer(e),i="buffer";else throw new Fm("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new Rm:n.destroyed&&(s=new Ni("write")),s?(bt.nextTick(r,s),Qt(t,s,!0),s):(n.pendingcb++,Om(t,n,e,i,r))}o(Dl,"_write");R.prototype.write=function(t,e,i){return Dl(this,t,e,i)===!0};R.prototype.cork=function(){this._writableState.corked++};R.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||xo(this,t))};R.prototype.setDefaultEncoding=o(function(e){if(typeof e=="string"&&(e=Em(e)),!Fr.isEncoding(e))throw new Bl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Om(t,e,i,r,n){let s=e.objectMode?1:i.length;e.length+=s;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!==_o&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}o(Om,"writeOrBuffer");function Fl(t,e,i,r,n,s,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Ni("write")):i?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}o(Fl,"doWrite");function Pl(t,e,i,r){--e.pendingcb,r(i),Eo(e),Qt(t,i)}o(Pl,"onwriteError");function Bm(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){Qt(t,new Ol);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?bt.nextTick(Pl,t,i,e,n):Pl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&xo(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},bt.nextTick(Dm,i.afterWriteTickInfo)):Ul(t,i,1,n))}o(Bm,"onwrite");function Dm({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Ul(t,e,i,r)}o(Dm,"afterWriteTick");function Ul(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&&Eo(e),vo(t,e)}o(Ul,"afterWrite");function Eo(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:a}=t.buffered[n],l=t.objectMode?1:s.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Ni("write"))}let i=t[Zt].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Ni("end"))}Ir(t)}o(Eo,"errorBuffer");function xo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,s=i.length-r;if(!s)return;let a=r;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let l=e.allNoop?_o:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},c=e.allNoop&&a===0?i:Il(i,a);c.allBuffers=e.allBuffers,Fl(t,e,!0,e.length,c,"",l),Ir(e)}else{do{let{chunk:l,encoding:c,callback:f}=i[a];i[a++]=null;let d=n?1:l.length;Fl(t,e,!1,d,l,c,f)}while(a<i.length&&!e.writing);a===i.length?Ir(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}o(xo,"clearBuffer");R.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Pm("_write()")};R.prototype._writev=null;R.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 s=Dl(this,t,e);s instanceof Sm&&(n=s)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,vo(this,r,!0),r.ended=!0):r.finished?n=new Lm("end"):r.destroyed&&(n=new Ni("end"))),typeof i=="function"&&(n||r.finished?bt.nextTick(i,n):r[Zt].push(i)),this};function Pr(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}o(Pr,"needFinish");function Um(t,e){let i=!1;function r(n){if(i){Qt(t,n??Ol());return}if(i=!0,e.pendingcb--,n){let s=e[Zt].splice(0);for(let a=0;a<s.length;a++)s[a](n);Qt(t,n,e.sync)}else Pr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,bt.nextTick(So,t,e))}o(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}o(Um,"callFinal");function Mm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Um(t,e)):(e.prefinished=!0,t.emit("prefinish")))}o(Mm,"prefinish");function vo(t,e,i){Pr(e)&&(Mm(t,e),e.pendingcb===0&&(i?(e.pendingcb++,bt.nextTick((r,n)=>{Pr(n)?So(r,n):n.pendingcb--},t,e)):Pr(e)&&(e.pendingcb++,So(t,e))))}o(vo,"finishMaybe");function So(t,e){e.pendingcb--,e.finished=!0;let i=e[Zt].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()}}o(So,"finish");_m(R.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Wm=Lr.destroy;R.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Zt].length)&&bt.nextTick(Eo,i),Wm.call(this,t,e),this};R.prototype._undestroy=Lr.undestroy;R.prototype._destroy=function(t,e){e(t)};R.prototype[Am.captureRejectionSymbol]=function(t){this.destroy(t)};var wo;function Ml(){return wo===void 0&&(wo={}),wo}o(Ml,"lazyWebStreams");R.fromWeb=function(t,e){return Ml().newStreamWritableFromWritableStream(t,e)};R.toWeb=function(t){return Ml().newWritableStreamFromStreamWritable(t)}});var tc=k((KS,ec)=>{var Ao=tt(),qm=Me(),{isReadable:$m,isWritable:jm,isIterable:ql,isNodeStream:zm,isReadableNodeStream:$l,isWritableNodeStream:jl,isDuplexNodeStream:Vm,isReadableStream:zl,isWritableStream:Vl}=Ie(),Hl=$e(),{AbortError:Ql,codes:{ERR_INVALID_ARG_TYPE:Hm,ERR_INVALID_RETURN_VALUE:Kl}}=te(),{destroyer:ti}=pt(),Km=Re(),Zl=Ai(),Ym=Cr(),{createDeferredPromise:Yl}=Q(),Gl=co(),Xl=globalThis.Blob||qm.Blob,Gm=o(typeof Xl<"u"?function(e){return e instanceof Xl}:function(e){return!1},"isBlob"),Xm=globalThis.AbortController||jt().AbortController,{FunctionPrototypeCall:Jl}=C(),je=class extends Km{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)}};o(je,"Duplexify");ec.exports=o(function t(e,i){if(Vm(e))return e;if($l(e))return ei({readable:e});if(jl(e))return ei({writable:e});if(zm(e))return ei({writable:!1,readable:!1});if(zl(e))return ei({readable:Zl.fromWeb(e)});if(Vl(e))return ei({writable:Ym.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:a,destroy:l}=Jm(e);if(ql(n))return Gl(je,n,{objectMode:!0,write:s,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let f,d=Jl(c,n,h=>{if(h!=null)throw new Kl("nully","body",h)},h=>{ti(f,h)});return f=new je({objectMode:!0,readable:!1,write:s,final(h){a(async()=>{try{await d,Ao.nextTick(h,null)}catch(b){Ao.nextTick(h,b)}})},destroy:l})}throw new Kl("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Gm(e))return t(e.arrayBuffer());if(ql(e))return Gl(je,e,{objectMode:!0,writable:!1});if(zl(e?.readable)&&Vl(e?.writable))return je.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?$l(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?jl(e?.writable)?e?.writable:t(e.writable):void 0;return ei({readable:n,writable:s})}let r=e?.then;if(typeof r=="function"){let n;return Jl(r,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{ti(n,s)}),n=new je({objectMode:!0,writable:!1,read(){}})}throw new Hm(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function Jm(t){let{promise:e,resolve:i}=Yl(),r=new Xm,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:f}=await a;if(Ao.nextTick(f),c)return;if(n.aborted)throw new Ql(void 0,{cause:n.reason});({promise:e,resolve:i}=Yl()),yield l}}(),{signal:n}),write(a,l,c){let f=i;i=null,f({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}o(Jm,"fromAsyncGen");function ei(t){let e=t.readable&&typeof t.readable.read!="function"?Zl.wrap(t.readable):t.readable,i=t.writable,r=!!$m(e),n=!!jm(i),s,a,l,c,f;function d(h){let b=c;c=null,b?b(h):h&&f.destroy(h)}return o(d,"onfinished"),f=new je({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(Hl(i,h=>{n=!1,h&&ti(e,h),d(h)}),f._write=function(h,b,m){i.write(h,b)?m():s=m},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(s){let h=s;s=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(Hl(e,h=>{r=!1,h&&ti(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&c!==null&&(h=new Ql),l=null,s=null,a=null,c===null?b(h):(c=b,ti(i,h),ti(e,h))},f}o(ei,"_duplexify")});var Re=k((GS,nc)=>{"use strict";var{ObjectDefineProperties:Qm,ObjectGetOwnPropertyDescriptor:ze,ObjectKeys:Zm,ObjectSetPrototypeOf:ic}=C();nc.exports=Ee;var To=Ai(),ye=Cr();ic(Ee.prototype,To.prototype);ic(Ee,To);{let t=Zm(ye.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ee.prototype[i]||(Ee.prototype[i]=ye.prototype[i])}}function Ee(t){if(!(this instanceof Ee))return new Ee(t);To.call(this,t),ye.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}o(Ee,"Duplex");Qm(Ee.prototype,{writable:{__proto__:null,...ze(ye.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ze(ye.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ze(ye.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ze(ye.prototype,"writableBuffer")},writableLength:{__proto__:null,...ze(ye.prototype,"writableLength")},writableFinished:{__proto__:null,...ze(ye.prototype,"writableFinished")},writableCorked:{__proto__:null,...ze(ye.prototype,"writableCorked")},writableEnded:{__proto__:null,...ze(ye.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ze(ye.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var ko;function rc(){return ko===void 0&&(ko={}),ko}o(rc,"lazyWebStreams");Ee.fromWeb=function(t,e){return rc().newStreamDuplexFromReadableWritablePair(t,e)};Ee.toWeb=function(t){return rc().newReadableWritablePairFromDuplex(t)};var No;Ee.from=function(t){return No||(No=tc()),No(t,"body")}});var Io=k((JS,sc)=>{"use strict";var{ObjectSetPrototypeOf:oc,Symbol:eb}=C();sc.exports=Ve;var{ERR_METHOD_NOT_IMPLEMENTED:tb}=te().codes,Po=Re(),{getHighWaterMark:ib}=Ei();oc(Ve.prototype,Po.prototype);oc(Ve,Po);var Fi=eb("kCallback");function Ve(t){if(!(this instanceof Ve))return new Ve(t);let e=t?ib(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Po.call(this,t),this._readableState.sync=!1,this[Fi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",rb)}o(Ve,"Transform");function Fo(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())}o(Fo,"final");function rb(){this._final!==Fo&&Fo.call(this)}o(rb,"prefinish");Ve.prototype._final=Fo;Ve.prototype._transform=function(t,e,i){throw new tb("_transform()")};Ve.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,s=r.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),n.ended||s===r.length||r.length<r.highWaterMark?i():this[Fi]=i})};Ve.prototype._read=function(){if(this[Fi]){let t=this[Fi];this[Fi]=null,t()}}});var Co=k((ZS,lc)=>{"use strict";var{ObjectSetPrototypeOf:ac}=C();lc.exports=ii;var Lo=Io();ac(ii.prototype,Lo.prototype);ac(ii,Lo);function ii(t){if(!(this instanceof ii))return new ii(t);Lo.call(this,t)}o(ii,"PassThrough");ii.prototype._transform=function(t,e,i){i(null,t)}});var Dr=k((t_,hc)=>{var Pi=tt(),{ArrayIsArray:nb,Promise:ob,SymbolAsyncIterator:sb,SymbolDispose:ab}=C(),Br=$e(),{once:lb}=Q(),cb=pt(),cc=Re(),{aggregateTwoErrors:ub,codes:{ERR_INVALID_ARG_TYPE:$o,ERR_INVALID_RETURN_VALUE:Ro,ERR_MISSING_ARGS:fb,ERR_STREAM_DESTROYED:db,ERR_STREAM_PREMATURE_CLOSE:hb},AbortError:pb}=te(),{validateFunction:yb,validateAbortSignal:mb}=Ht(),{isIterable:gt,isReadable:Oo,isReadableNodeStream:Or,isNodeStream:uc,isTransformStream:ri,isWebStream:bb,isReadableStream:Bo,isReadableFinished:gb}=Ie(),wb=globalThis.AbortController||jt().AbortController,Do,Uo,Mo;function fc(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=Br(t,{readable:e,writable:i},s=>{r=!s});return{destroy:s=>{r||(r=!0,cb.destroyer(t,s||new db("pipe")))},cleanup:n}}o(fc,"destroyer");function Sb(t){return yb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}o(Sb,"popCallback");function Wo(t){if(gt(t))return t;if(Or(t))return _b(t);throw new $o("val",["Readable","Iterable","AsyncIterable"],t)}o(Wo,"makeAsyncIterable");async function*_b(t){Uo||(Uo=Ai()),yield*Uo.prototype[sb].call(t)}o(_b,"fromReadable");async function Rr(t,e,i,{end:r}){let n,s=null,a=o(f=>{if(f&&(n=f),s){let d=s;s=null,d()}},"resume"),l=o(()=>new ob((f,d)=>{n?d(n):s=o(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let c=Br(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();r&&(e.end(),await l()),i()}catch(f){i(n!==f?ub(n,f):f)}finally{c(),e.off("drain",a)}}o(Rr,"pumpToNode");async function qo(t,e,i,{end:r}){ri(e)&&(e=e.writable);let n=e.getWriter();try{for await(let s of t)await n.ready,n.write(s).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(s){try{await n.abort(s),i(s)}catch(a){i(a)}}}o(qo,"pumpToWeb");function Eb(...t){return dc(t,lb(Sb(t)))}o(Eb,"pipeline");function dc(t,e,i){if(t.length===1&&nb(t[0])&&(t=t[0]),t.length<2)throw new fb("streams");let r=new wb,n=r.signal,s=i?.signal,a=[];mb(s,"options.signal");function l(){g(new pb)}o(l,"abort"),Mo=Mo||Q().addAbortListener;let c;s&&(c=Mo(s,l));let f,d,h=[],b=0;function m(O){g(O,--b===0)}o(m,"finish");function g(O,v){var q;if(O&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=O),!(!f&&!v)){for(;h.length;)h.shift()(f);(q=c)===null||q===void 0||q[ab](),r.abort(),v&&(f||a.forEach(nt=>nt()),Pi.nextTick(e,f,d))}}o(g,"finishImpl");let y;for(let O=0;O<t.length;O++){let v=t[O],q=O<t.length-1,nt=O>0,ce=q||i?.end!==!1,Et=O===t.length-1;if(uc(v)){let ie=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Be)};var F=ie;if(o(ie,"onError"),ce){let{destroy:Be,cleanup:Qr}=fc(v,q,nt);h.push(Be),Oo(v)&&Et&&a.push(Qr)}v.on("error",ie),Oo(v)&&Et&&a.push(()=>{v.removeListener("error",ie)})}if(O===0)if(typeof v=="function"){if(y=v({signal:n}),!gt(y))throw new Ro("Iterable, AsyncIterable or Stream","source",y)}else gt(v)||Or(v)||ri(v)?y=v:y=cc.from(v);else if(typeof v=="function"){if(ri(y)){var A;y=Wo((A=y)===null||A===void 0?void 0:A.readable)}else y=Wo(y);if(y=v(y,{signal:n}),q){if(!gt(y,!0))throw new Ro("AsyncIterable",`transform[${O-1}]`,y)}else{var w;Do||(Do=Co());let ie=new Do({objectMode:!0}),Be=(w=y)===null||w===void 0?void 0:w.then;if(typeof Be=="function")b++,Be.call(y,Ke=>{d=Ke,Ke!=null&&ie.write(Ke),ce&&ie.end(),Pi.nextTick(m)},Ke=>{ie.destroy(Ke),Pi.nextTick(m,Ke)});else if(gt(y,!0))b++,Rr(y,ie,m,{end:ce});else if(Bo(y)||ri(y)){let Ke=y.readable||y;b++,Rr(Ke,ie,m,{end:ce})}else throw new Ro("AsyncIterable or Promise","destination",y);y=ie;let{destroy:Qr,cleanup:jc}=fc(y,!1,!0);h.push(Qr),Et&&a.push(jc)}}else if(uc(v)){if(Or(y)){b+=2;let ie=xb(y,v,m,{end:ce});Oo(v)&&Et&&a.push(ie)}else if(ri(y)||Bo(y)){let ie=y.readable||y;b++,Rr(ie,v,m,{end:ce})}else if(gt(y))b++,Rr(y,v,m,{end:ce});else throw new $o("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=v}else if(bb(v)){if(Or(y))b++,qo(Wo(y),v,m,{end:ce});else if(Bo(y)||gt(y))b++,qo(y,v,m,{end:ce});else if(ri(y))b++,qo(y.readable,v,m,{end:ce});else throw new $o("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=v}else y=cc.from(v)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&Pi.nextTick(l),y}o(dc,"pipelineImpl");function xb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new hb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var s=a;o(a,"endFn"),gb(t)?Pi.nextTick(a):t.once("end",a)}else i();return Br(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),Br(e,{readable:!1,writable:!0},i)}o(xb,"pipe");hc.exports={pipelineImpl:dc,pipeline:Eb}});var zo=k((r_,wc)=>{"use strict";var{pipeline:vb}=Dr(),Ur=Re(),{destroyer:Ab}=pt(),{isNodeStream:Mr,isReadable:pc,isWritable:yc,isWebStream:jo,isTransformStream:wt,isWritableStream:mc,isReadableStream:bc}=Ie(),{AbortError:kb,codes:{ERR_INVALID_ARG_VALUE:gc,ERR_MISSING_ARGS:Nb}}=te(),Tb=$e();wc.exports=o(function(...e){if(e.length===0)throw new Nb("streams");if(e.length===1)return Ur.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=Ur.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=Ur.from(e[m])}for(let m=0;m<e.length;++m)if(!(!Mr(e[m])&&!jo(e[m]))){if(m<e.length-1&&!(pc(e[m])||bc(e[m])||wt(e[m])))throw new gc(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(yc(e[m])||mc(e[m])||wt(e[m])))throw new gc(`streams[${m}]`,i[m],"must be writable")}let r,n,s,a,l;function c(m){let g=a;a=null,g?g(m):m?l.destroy(m):!b&&!h&&l.destroy()}o(c,"onfinished");let f=e[0],d=vb(e,c),h=!!(yc(f)||mc(f)||wt(f)),b=!!(pc(d)||bc(d)||wt(d));if(l=new Ur({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Mr(f))l._write=function(g,y,A){f.write(g,y)?A():r=A},l._final=function(g){f.end(),n=g},f.on("drain",function(){if(r){let g=r;r=null,g()}});else if(jo(f)){let y=(wt(f)?f.writable:f).getWriter();l._write=async function(A,w,F){try{await y.ready,y.write(A).catch(()=>{}),F()}catch(O){F(O)}},l._final=async function(A){try{await y.ready,y.close().catch(()=>{}),n=A}catch(w){A(w)}}}let m=wt(d)?d.readable:d;Tb(m,()=>{if(n){let g=n;n=null,g()}})}if(b){if(Mr(d))d.on("readable",function(){if(s){let m=s;s=null,m()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=d.read();if(m===null){s=l._read;return}if(!l.push(m))return}};else if(jo(d)){let g=(wt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:y,done:A}=await g.read();if(!l.push(y))return;if(A){l.push(null);return}}catch{return}}}}return l._destroy=function(m,g){!m&&a!==null&&(m=new kb),s=null,r=null,n=null,a===null?g(m):(a=g,Mr(d)&&Ab(d,m))},l},"compose")});var Fc=k((o_,Ho)=>{"use strict";var Fb=globalThis.AbortController||jt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Pb,ERR_INVALID_ARG_TYPE:Ii,ERR_MISSING_ARGS:Ib,ERR_OUT_OF_RANGE:Lb},AbortError:Oe}=te(),{validateAbortSignal:St,validateInteger:Sc,validateObject:_t}=Ht(),Cb=C().Symbol("kWeak"),Rb=C().Symbol("kResistStopPropagation"),{finished:Ob}=$e(),Bb=zo(),{addAbortSignalNoValidate:Db}=_i(),{isWritable:Ub,isNodeStream:Mb}=Ie(),{deprecate:Wb}=Q(),{ArrayPrototypePush:qb,Boolean:$b,MathFloor:_c,Number:jb,NumberIsNaN:zb,Promise:Ec,PromiseReject:xc,PromiseResolve:Vb,PromisePrototypeThen:vc,Symbol:kc}=C(),qr=kc("kEmpty"),Ac=kc("kEof");function Hb(t,e){if(e!=null&&_t(e,"options"),e?.signal!=null&&St(e.signal,"options.signal"),Mb(t)&&!Ub(t))throw new Pb("stream",t,"must be writable");let i=Bb(this,t);return e!=null&&e.signal&&Db(e.signal,i),i}o(Hb,"compose");function $r(t,e){if(typeof t!="function")throw new Ii("fn",["Function","AsyncFunction"],t);e!=null&&_t(e,"options"),e?.signal!=null&&St(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=_c(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=_c(e.highWaterMark)),Sc(i,"options.concurrency",1),Sc(r,"options.highWaterMark",0),r+=i,o(async function*(){let s=Q().AbortSignalAny([e?.signal].filter($b)),a=this,l=[],c={signal:s},f,d,h=!1,b=0;function m(){h=!0,g()}o(m,"onCatch");function g(){b-=1,y()}o(g,"afterItemProcessed");function y(){d&&!h&&b<i&&l.length<r&&(d(),d=null)}o(y,"maybeResume");async function A(){try{for await(let w of a){if(h)return;if(s.aborted)throw new Oe;try{if(w=t(w,c),w===qr)continue;w=Vb(w)}catch(F){w=xc(F)}b+=1,vc(w,g,m),l.push(w),f&&(f(),f=null),!h&&(l.length>=r||b>=i)&&await new Ec(F=>{d=F})}l.push(Ac)}catch(w){let F=xc(w);vc(F,g,m),l.push(F)}finally{h=!0,f&&(f(),f=null)}}o(A,"pump"),A();try{for(;;){for(;l.length>0;){let w=await l[0];if(w===Ac)return;if(s.aborted)throw new Oe;w!==qr&&(yield w),l.shift(),y()}await new Ec(w=>{f=w})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}o($r,"map");function Kb(t=void 0){return t!=null&&_t(t,"options"),t?.signal!=null&&St(t.signal,"options.signal"),o(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 Oe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}o(Kb,"asIndexedPairs");async function Nc(t,e=void 0){for await(let i of Vo.call(this,t,e))return!0;return!1}o(Nc,"some");async function Yb(t,e=void 0){if(typeof t!="function")throw new Ii("fn",["Function","AsyncFunction"],t);return!await Nc.call(this,async(...i)=>!await t(...i),e)}o(Yb,"every");async function Gb(t,e){for await(let i of Vo.call(this,t,e))return i}o(Gb,"find");async function Xb(t,e){if(typeof t!="function")throw new Ii("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),qr}o(i,"forEachFn");for await(let r of $r.call(this,i,e));}o(Xb,"forEach");function Vo(t,e){if(typeof t!="function")throw new Ii("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:qr}return o(i,"filterFn"),$r.call(this,i,e)}o(Vo,"filter");var Wr=class extends Ib{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};o(Wr,"ReduceAwareErrMissingArgs");async function Jb(t,e,i){var r;if(typeof t!="function")throw new Ii("reducer",["Function","AsyncFunction"],t);i!=null&&_t(i,"options"),i?.signal!=null&&St(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new Oe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Ob(this.destroy(f)),f}let s=new Fb,a=s.signal;if(i!=null&&i.signal){let f={once:!0,[Cb]:this,[Rb]:!0};i.signal.addEventListener("abort",()=>s.abort(),f)}let l=!1;try{for await(let f of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Oe;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new Wr}finally{s.abort()}return e}o(Jb,"reduce");async function Qb(t){t!=null&&_t(t,"options"),t?.signal!=null&&St(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 Oe(void 0,{cause:t.signal.reason});qb(e,r)}return e}o(Qb,"toArray");function Zb(t,e){let i=$r.call(this,t,e);return o(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}o(Zb,"flatMap");function Tc(t){if(t=jb(t),zb(t))return 0;if(t<0)throw new Lb("number",">= 0",t);return t}o(Tc,"toIntegerOrInfinity");function eg(t,e=void 0){return e!=null&&_t(e,"options"),e?.signal!=null&&St(e.signal,"options.signal"),t=Tc(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Oe;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;t--<=0&&(yield s)}},"drop").call(this)}o(eg,"drop");function tg(t,e=void 0){return e!=null&&_t(e,"options"),e?.signal!=null&&St(e.signal,"options.signal"),t=Tc(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Oe;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;if(t-- >0&&(yield s),t<=0)return}},"take").call(this)}o(tg,"take");Ho.exports.streamReturningOperators={asIndexedPairs:Wb(Kb,"readable.asIndexedPairs will be removed in a future version."),drop:eg,filter:Vo,flatMap:Zb,map:$r,take:tg,compose:Hb};Ho.exports.promiseReturningOperators={every:Yb,forEach:Xb,reduce:Jb,toArray:Qb,some:Nc,find:Gb}});var Ko=k((a_,Pc)=>{"use strict";var{ArrayPrototypePop:ig,Promise:rg}=C(),{isIterable:ng,isNodeStream:og,isWebStream:sg}=Ie(),{pipelineImpl:ag}=Dr(),{finished:lg}=$e();Yo();function cg(...t){return new rg((e,i)=>{let r,n,s=t[t.length-1];if(s&&typeof s=="object"&&!og(s)&&!ng(s)&&!sg(s)){let a=ig(t);r=a.signal,n=a.end}ag(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}o(cg,"pipeline");Pc.exports={finished:lg,pipeline:cg}});var Yo=k((c_,Mc)=>{var{Buffer:ug}=Me(),{ObjectDefineProperty:He,ObjectKeys:Cc,ReflectApply:Rc}=C(),{promisify:{custom:Oc}}=Q(),{streamReturningOperators:Ic,promiseReturningOperators:Lc}=Fc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Bc}}=te(),fg=zo(),{setDefaultHighWaterMark:dg,getDefaultHighWaterMark:hg}=Ei(),{pipeline:Dc}=Dr(),{destroyer:pg}=pt(),Uc=$e(),Go=Ko(),Li=Ie(),L=Mc.exports=Sr().Stream;L.isDestroyed=Li.isDestroyed;L.isDisturbed=Li.isDisturbed;L.isErrored=Li.isErrored;L.isReadable=Li.isReadable;L.isWritable=Li.isWritable;L.Readable=Ai();for(let t of Cc(Ic)){let i=function(...r){if(new.target)throw Bc();return L.Readable.from(Rc(e,this,r))};mg=i,o(i,"fn");let e=Ic[t];He(i,"name",{__proto__:null,value:e.name}),He(i,"length",{__proto__:null,value:e.length}),He(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var mg;for(let t of Cc(Lc)){let i=function(...n){if(new.target)throw Bc();return Rc(e,this,n)};mg=i,o(i,"fn");let e=Lc[t];He(i,"name",{__proto__:null,value:e.name}),He(i,"length",{__proto__:null,value:e.length}),He(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var mg;L.Writable=Cr();L.Duplex=Re();L.Transform=Io();L.PassThrough=Co();L.pipeline=Dc;var{addAbortSignal:yg}=_i();L.addAbortSignal=yg;L.finished=Uc;L.destroy=pg;L.compose=fg;L.setDefaultHighWaterMark=dg;L.getDefaultHighWaterMark=hg;He(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Go}});He(Dc,Oc,{__proto__:null,enumerable:!0,get(){return Go.pipeline}});He(Uc,Oc,{__proto__:null,enumerable:!0,get(){return Go.finished}});L.Stream=L;L._isUint8Array=o(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=o(function(e){return ug.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Wc=k((f_,W)=>{"use strict";var V=Yo(),bg=Ko(),gg=V.Readable.destroy;W.exports=V.Readable;W.exports._uint8ArrayToBuffer=V._uint8ArrayToBuffer;W.exports._isUint8Array=V._isUint8Array;W.exports.isDisturbed=V.isDisturbed;W.exports.isErrored=V.isErrored;W.exports.isReadable=V.isReadable;W.exports.Readable=V.Readable;W.exports.Writable=V.Writable;W.exports.Duplex=V.Duplex;W.exports.Transform=V.Transform;W.exports.PassThrough=V.PassThrough;W.exports.addAbortSignal=V.addAbortSignal;W.exports.finished=V.finished;W.exports.destroy=V.destroy;W.exports.destroy=gg;W.exports.pipeline=V.pipeline;W.exports.compose=V.compose;Object.defineProperty(V,"promises",{configurable:!0,enumerable:!0,get(){return bg}});W.exports.Stream=V.Stream;W.exports.default=W.exports});var xg={};Oi(xg,{ActionType:()=>zi,ApiError:()=>u,AsyncFile:()=>ai,AsyncFileSystem:()=>ot,AsyncMirror:()=>Xo,AsyncStoreFileSystem:()=>Jr,BigIntStats:()=>G,Cred:()=>$,ErrorCode:()=>J,ErrorStrings:()=>Zr,File:()=>ui,FileFlag:()=>P,FileSystem:()=>be,FileType:()=>B,InMemory:()=>hi,Inode:()=>ue,NoSyncFile:()=>ji,Overlay:()=>Qo,PreloadFile:()=>re,ReadonlyAsyncFileSystem:()=>Hi,ReadonlySyncFileSystem:()=>Vi,SimpleSyncRWTransaction:()=>It,Stats:()=>H,StatsCommon:()=>Tt,SyncFile:()=>$i,SyncFileSystem:()=>De,SyncStoreFile:()=>di,SyncStoreFileSystem:()=>Lt,backends:()=>Gr,configure:()=>_g,decode:()=>ee,decodeDirListing:()=>fi,default:()=>Eg,encode:()=>D,encodeDirListing:()=>se,fs:()=>Hr,initialize:()=>$c,levenshtein:()=>tn,mkdirpSync:()=>os,randomIno:()=>Pt,registerBackend:()=>qc,rootIno:()=>fe,setImmediate:()=>Lu,size_max:()=>qi,toPromise:()=>Iu,wait:()=>Pu});var Hr={};Oi(Hr,{BigIntStats:()=>G,Dir:()=>Qi,Dirent:()=>Ze,ReadStream:()=>jr,Stats:()=>H,WriteStream:()=>zr,_toUnixTimestamp:()=>as,access:()=>nd,accessSync:()=>rf,appendFile:()=>Rf,appendFileSync:()=>Mu,chmod:()=>Zf,chmodSync:()=>Qu,chown:()=>Jf,chownSync:()=>Xu,close:()=>Bf,closeSync:()=>Qe,constants:()=>ci,copyFile:()=>dd,copyFileSync:()=>sf,createReadStream:()=>ld,createWriteStream:()=>cd,exists:()=>kf,existsSync:()=>nn,fchmod:()=>jf,fchmodSync:()=>cn,fchown:()=>$f,fchownSync:()=>ln,fdatasync:()=>Mf,fdatasyncSync:()=>$u,fstat:()=>Of,fstatSync:()=>Wu,fsync:()=>Uf,fsyncSync:()=>qu,ftruncate:()=>Df,ftruncateSync:()=>fs,futimes:()=>zf,futimesSync:()=>un,initialize:()=>Xi,lchmod:()=>ed,lchmodSync:()=>Zu,lchown:()=>Qf,lchownSync:()=>Ju,link:()=>Yf,linkSync:()=>Ku,lopenSync:()=>Ji,lstat:()=>Tf,lstatSync:()=>Ou,lutimes:()=>id,lutimesSync:()=>tf,mkdir:()=>Hf,mkdirSync:()=>Hu,mkdtemp:()=>fd,mkdtempSync:()=>of,mount:()=>Gi,mounts:()=>ge,open:()=>If,openSync:()=>pi,opendir:()=>yd,opendirSync:()=>cf,promises:()=>ir,read:()=>qf,readFile:()=>Lf,readFileSync:()=>us,readSync:()=>zu,readdir:()=>Kf,readdirSync:()=>fn,readlink:()=>Xf,readlinkSync:()=>Gu,readv:()=>hd,readvSync:()=>af,realpath:()=>rd,realpathSync:()=>dn,rename:()=>Af,renameSync:()=>Ru,rm:()=>ud,rmSync:()=>nf,rmdir:()=>Vf,rmdirSync:()=>Vu,stat:()=>Nf,statSync:()=>on,symlink:()=>Gf,symlinkSync:()=>Yu,truncate:()=>Ff,truncateSync:()=>Bu,umount:()=>rn,unlink:()=>Pf,unlinkSync:()=>cs,unwatchFile:()=>sd,utimes:()=>td,utimesSync:()=>ef,watch:()=>ad,watchFile:()=>od,write:()=>Wf,writeFile:()=>Cf,writeFileSync:()=>an,writeSync:()=>ju,writev:()=>pd,writevSync:()=>lf});var J=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EIO=5]="EIO",y[y.EBADF=9]="EBADF",y[y.EACCES=13]="EACCES",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.EROFS=30]="EROFS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ENOTSUP=95]="ENOTSUP",y))(J||{}),Zr={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[39]:"Directory is not empty.",[95]:"Operation is not supported."},u=class extends Error{constructor(i,r=Zr[i],n){super(r);this.errno=i;this.path=n;this.code=J[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new u(i.errno,i.message,i.path);return r.code=i.code,r.stack=i.stack,r}static OnPath(i,r){return new u(i,Zr[i],r)}static EACCES(i){return this.OnPath(13,i)}static ENOENT(i){return this.OnPath(2,i)}static EEXIST(i){return this.OnPath(17,i)}static EISDIR(i){return this.OnPath(21,i)}static ENOTDIR(i){return this.OnPath(20,i)}static EPERM(i){return this.OnPath(1,i)}static ENOTEMPTY(i){return this.OnPath(39,i)}code;syscall="";stack;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};o(u,"ApiError");var en=class{constructor(e,i,r,n,s,a){this.uid=e;this.gid=i;this.suid=r;this.sgid=n;this.euid=s;this.egid=a}},$=en;o($,"Cred"),li($,"Root",new en(0,0,0,0,0,0));var ci={};Oi(ci,{COPYFILE_EXCL:()=>eu,COPYFILE_FICLONE:()=>tu,COPYFILE_FICLONE_FORCE:()=>iu,F_OK:()=>Qc,O_APPEND:()=>Nt,O_CREAT:()=>xe,O_DIRECT:()=>cu,O_DIRECTORY:()=>nu,O_DSYNC:()=>au,O_EXCL:()=>At,O_NOATIME:()=>ou,O_NOCTTY:()=>ru,O_NOFOLLOW:()=>su,O_NONBLOCK:()=>uu,O_RDONLY:()=>Bi,O_RDWR:()=>Ye,O_SYMLINK:()=>lu,O_SYNC:()=>Di,O_TRUNC:()=>kt,O_WRONLY:()=>vt,R_OK:()=>me,S_IFBLK:()=>du,S_IFCHR:()=>fu,S_IFDIR:()=>Mi,S_IFIFO:()=>hu,S_IFLNK:()=>Wi,S_IFMT:()=>Y,S_IFREG:()=>Ui,S_IFSOCK:()=>pu,S_IRGRP:()=>Su,S_IROTH:()=>vu,S_IRUSR:()=>mu,S_IRWXG:()=>wu,S_IRWXO:()=>xu,S_IRWXU:()=>yu,S_IWGRP:()=>_u,S_IWOTH:()=>Au,S_IWUSR:()=>bu,S_IXGRP:()=>Eu,S_IXOTH:()=>ku,S_IXUSR:()=>gu,W_OK:()=>oe,X_OK:()=>Zc});var Qc=0,me=4,oe=2,Zc=1,eu=1,tu=2,iu=4,Bi=0,vt=1,Ye=2,xe=64,At=128,ru=256,kt=512,Nt=1024,nu=65536,ou=262144,su=131072,Di=1052672,au=4096,lu=32768,cu=16384,uu=2048,Y=61440,Ui=32768,Mi=16384,fu=8192,du=24576,hu=4096,Wi=40960,pu=49152,yu=448,mu=256,bu=128,gu=64,wu=56,Su=32,_u=16,Eu=8,xu=7,vu=4,Au=2,ku=1;var B=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(B||{}),Tt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor(e=B.FILE,i=-1,r,n,s,a,l,c,f){let d=Date.now(),h=o((b,m)=>typeof b==this._typename?b:this._convert(typeof b==this._typename_inverse?b:m),"resolveT");if(this.atimeMs=h(n,d),this.mtimeMs=h(s,d),this.ctimeMs=h(a,d),this.birthtimeMs=h(f,d),this.uid=h(l,0),this.gid=h(c,0),this.size=this._convert(i),r)this.mode=this._convert(r);else switch(e){case B.FILE:this.mode=this._convert(420);break;case B.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(i)/512)),this.mode&61440||(this.mode=this.mode|this._convert(e))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let r=this.mode&-61441,n=15,s=15,a=15;if(i.euid==this.uid){let f=(3840&r)>>8;n=(e^f)&e}if(i.egid==this.gid){let f=(240&r)>>4;s=(e^f)&e}let l=15&r;return a=(e^l)&e,!(n&s&a)}getCred(e=Number(this.uid),i=Number(this.gid)){return new $(e,i,Number(this.uid),Number(this.gid),e,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))}};o(Tt,"StatsCommon");var H=class extends Tt{_isBigint=!1;static clone(e){return new H(e.mode&61440,e.size,e.mode&-61441,e.atimeMs,e.mtimeMs,e.ctimeMs,e.uid,e.gid,e.birthtimeMs)}};o(H,"Stats");var G=class extends Tt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new G(Number(e.mode)&61440,BigInt(e.size),BigInt(e.mode)&BigInt(-61441),BigInt(e.atimeMs),BigInt(e.mtimeMs),BigInt(e.ctimeMs),BigInt(e.uid),BigInt(e.gid),BigInt(e.birthtimeMs))}};o(G,"BigIntStats");var Nu="/",is="/";function Ft(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}o(Ft,"validateString");function rs(t,e){let i="",r=0,n=-1,s=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||s===1))if(s===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",r=0):(i=i.slice(0,c),r=i.length-1-i.lastIndexOf("/")),n=l,s=0;continue}else if(i.length!==0){i="",r=0,n=l,s=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,l):i=t.slice(n+1,l),r=l-n-1;n=l,s=0}else a==="."&&s!==-1?++s:s=-1}return i}o(rs,"normalizeString");function ve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:Nu;Ft(n,`paths[${r}]`),n.length!==0&&(e=`${n}/${e}`,i=n[0]==="/")}return e=rs(e,!i),i?`/${e}`:e.length>0?e:"."}o(ve,"resolve");function Tu(t){if(Ft(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=rs(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}o(Tu,"normalize");function Ae(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];Ft(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":Tu(e)}o(Ae,"join");function N(t){if(Ft(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}o(N,"dirname");function j(t,e){e!==void 0&&Ft(e,"ext"),Ft(t,"path");let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let s=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){i=l+1;break}}else a===-1&&(n=!1,a=l+1),s>=0&&(t[l]===e[s]?--s===-1&&(r=l):(s=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let s=t.length-1;s>=0;--s)if(t[s]==="/"){if(!n){i=s+1;break}}else r===-1&&(n=!1,r=s+1);return r===-1?"":t.slice(i,r)}o(j,"basename");var qi=2**32-1,fe=0n;function ns(){return Math.round(Math.random()*2**32).toString(16)}o(ns,"_random");function Pt(){return BigInt("0x"+ns()+ns())}o(Pt,"randomIno");var ue=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(50),this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Pt(),this.nlink=1,this.size=4096;let r=Date.now();this.atime=r,this.mtime=r,this.ctime=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 atime(){return this.view.getFloat64(26,!0)}set atime(e){this.view.setFloat64(26,e,!0)}get mtime(){return this.view.getFloat64(34,!0)}set mtime(e){this.view.setFloat64(34,e,!0)}get ctime(){return this.view.getFloat64(42,!0)}set ctime(e){this.view.setFloat64(42,e,!0)}toStats(){return new H((this.mode&61440)===B.DIRECTORY?B.DIRECTORY:B.FILE,this.size,this.mode,this.atime,this.mtime,this.ctime,this.uid,this.gid)}sizeof(){return this.buffer.byteLength}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.atime!==e.atimeMs&&(this.atime=e.atimeMs,i=!0),this.mtime!==e.mtimeMs&&(this.mtime=e.mtimeMs,i=!0),this.ctime!==e.ctimeMs&&(this.ctime=e.ctimeMs,i=!0),i}};o(ue,"Inode");var zi=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(zi||{}),Ge=class{static FromString(e){return Ge.flagCache.has(e)||Ge.flagCache.set(e,new Ge(e)),Ge.flagCache.get(e)}flagStr;constructor(e){if(typeof e=="number"&&(e=Ge.NumberToString(e)),Ge.validFlagStrs.indexOf(e)<0)throw new u(22,"Invalid flag string: "+e);this.flagStr=e}static NumberToString(e){switch(e){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 u(22,"Invalid flag number: "+e)}}toString(){return this.flagStr}get mode(){let e=0;return e<<=1,e+=+this.isReadable(),e<<=1,e+=+this.isWriteable(),e<<=1,e}isReadable(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1}isWriteable(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1}isTruncating(){return this.flagStr.indexOf("w")!==-1}isAppendable(){return this.flagStr.indexOf("a")!==-1}isSynchronous(){return this.flagStr.indexOf("s")!==-1}isExclusive(){return this.flagStr.indexOf("x")!==-1}pathExistsAction(){return this.isExclusive()?1:this.isTruncating()?2:0}pathNotExistsAction(){return(this.isWriteable()||this.isAppendable())&&this.flagStr!=="r+"?3:1}},P=Ge;o(P,"FileFlag"),li(P,"flagCache",new Map),li(P,"validFlagStrs",["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"]);var ui=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};o(ui,"File");var re=class extends ui{constructor(i,r,n,s,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:qi}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=s;this._buffer=a;if(this.stats.size!=a.byteLength){if(this.flag.isReadable())throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return this.flag.isAppendable()?this.stats.size:this._position}set position(i){this._position=i}async stat(){return H.clone(this.stats)}statSync(){return H.clone(this.stats)}truncate(i){if(this.truncateSync(i),this.flag.isSynchronous()&&!this.fs.metadata.synchronous)return this.sync()}truncateSync(i){if(this._dirty=!0,!this.flag.isWriteable())throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.length,this._buffer.length),this.flag.isSynchronous()&&this.fs.metadata.synchronous&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),this.flag.isSynchronous()&&this.fs.metadata.synchronous&&this.syncSync()}async write(i,r=0,n=this.stats.size,s=0){return this.writeSync(i,r,n,s)}writeSync(i,r=0,n=this.stats.size,s=0){if(this._dirty=!0,s??=this.position,!this.flag.isWriteable())throw new u(1,"File not opened with a writeable mode.");let a=s+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 c=new Uint8Array(new ArrayBuffer(a,{maxByteLength:qi}));c.set(this._buffer),this._buffer=c}this._buffer.set(i.slice(r,r+n),s);let l=this._buffer.byteOffset;return this.stats.mtimeMs=Date.now(),this.flag.isSynchronous()?(this.syncSync(),l):(this.position=s+l,l)}async read(i,r=0,n=this.stats.size,s=0){return{bytesRead:this.readSync(i,r,n,s),buffer:i}}readSync(i,r=0,n=this.stats.size,s=0){if(!this.flag.isReadable())throw new u(1,"File not opened with a readable mode.");s??=this.position;let a=s+n;a>this.stats.size&&(a=s+Math.max(this.stats.size-s,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-s;return l==0||i.set(this._buffer.slice(s,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){if(!this.fs.metadata.supportsProperties)throw new u(95);this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){if(!this.fs.metadata.supportsProperties)throw new u(95);this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){if(!this.fs.metadata.supportsProperties)throw new u(95);this._dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};o(re,"PreloadFile");var $i=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o($i,"SyncFile");var ji=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){}syncSync(){}async close(){}closeSync(){}};o(ji,"NoSyncFile");var be=class{static get Name(){return this.name}get metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};o(be,"FileSystem");var De=class extends be{get metadata(){return{...super.metadata,synchronous:!0}}async ready(){return this}async rename(e,i,r){return this.renameSync(e,i,r)}async stat(e,i){return this.statSync(e,i)}async createFile(e,i,r,n){return this.createFileSync(e,i,r,n)}async openFile(e,i,r){return this.openFileSync(e,i,r)}async unlink(e,i){return this.unlinkSync(e,i)}async rmdir(e,i){return this.rmdirSync(e,i)}async mkdir(e,i,r){return this.mkdirSync(e,i,r)}async readdir(e,i){return this.readdirSync(e,i)}async link(e,i,r){return this.linkSync(e,i,r)}async sync(e,i,r){return this.syncSync(e,i,r)}};o(De,"SyncFileSystem");var Vi=class extends De{renameSync(e,i,r){throw new u(30)}createFileSync(e,i,r,n){throw new u(30)}unlinkSync(e,i){throw new u(30)}rmdirSync(e,i){throw new u(30)}mkdirSync(e,i,r){throw new u(30)}linkSync(e,i,r){throw new u(30)}syncSync(e,i,r){throw new u(30)}};o(Vi,"ReadonlySyncFileSystem");var ot=class extends be{renameSync(e,i,r){throw new u(95)}statSync(e,i){throw new u(95)}createFileSync(e,i,r,n){throw new u(95)}openSync(e,i,r,n){throw new u(95)}openFileSync(e,i,r){throw new u(95)}unlinkSync(e,i){throw new u(95)}rmdirSync(e,i){throw new u(95)}mkdirSync(e,i,r){throw new u(95)}readdirSync(e,i){throw new u(95)}linkSync(e,i,r){throw new u(95)}syncSync(e,i,r){throw new u(95)}};o(ot,"AsyncFileSystem");var Hi=class extends ot{async rename(e,i,r){throw new u(30)}async createFile(e,i,r,n){throw new u(30)}async unlink(e,i){throw new u(30)}async rmdir(e,i){throw new u(30)}async mkdir(e,i,r){throw new u(30)}async link(e,i,r){throw new u(30)}async sync(e,i,r){throw new u(30)}};o(Hi,"ReadonlyAsyncFileSystem");function os(t,e,i,r){r.existsSync(t,i)||(os(N(t),e,i,r),r.mkdirSync(t,e,i))}o(os,"mkdirpSync");function Ki(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}o(Ki,"_min");function tn(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 s=new Array(i<<1);for(let b=0;b<i;)s[i+b]=t.charCodeAt(n+b),s[b]=++b;let a,l,c,f,d;for(a=0;a+3<r;){let b=e.charCodeAt(n+(l=a)),m=e.charCodeAt(n+(c=a+1)),g=e.charCodeAt(n+(f=a+2)),y=e.charCodeAt(n+(d=a+3)),A=a+=4;for(let w=0;w<i;){let F=s[i+w],O=s[w];l=Ki(O,l,c,b,F),c=Ki(l,c,f,m,F),f=Ki(c,f,d,g,F),A=Ki(f,d,A,y,F),s[w++]=A,d=f,f=c,c=l,l=O}}let h=0;for(;a<r;){let b=e.charCodeAt(n+(l=a));h=++a;for(let m=0;m<i;m++){let g=s[m];s[m]=h=g<l||h<l?g>h?h+1:g+1:b===s[i+m]?l:l+1,l=g}}return h}o(tn,"levenshtein");function Pu(t){return new Promise(e=>{setTimeout(e,t)})}o(Pu,"wait");function Iu(t){return function(...e){return new Promise((i,r)=>{e.push((n,...s)=>{n?r(n):i(s[0])}),t(...e)})}}o(Iu,"toPromise");var Lu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function D(t,e="utf8"){switch(e){case"ascii":return new TextEncoder().encode(t).map(i=>i&127);case"latin1":case"binary":case"utf8":case"utf-8":case"base64":case"base64url":case"hex":return new TextEncoder().encode(t);case"utf16le":case"ucs2":case"ucs-2":return new TextEncoder().encode(t).slice(0,-1);default:throw new u(22,"Invalid encoding: "+e)}}o(D,"encode");function ee(t,e="utf8"){switch(e){case"ascii":case"utf8":case"utf-8":return new TextDecoder().decode(t);case"latin1":case"binary":return new TextDecoder("latin1").decode(t);case"utf16le":case"ucs2":case"ucs-2":let i="";for(let r=0;r<t.length;r+=2){let n=t[r]|t[r+1]<<8;i+=String.fromCharCode(n)}return i;case"base64":return btoa(Array.from(t).map(r=>String.fromCharCode(r)).join(""));case"base64url":return ee(t,"base64").replace("/","_").replace("+","-");case"hex":return Array.from(t).map(r=>r.toString(16)).join("");default:throw new u(22,"Invalid encoding: "+e)}}o(ee,"decode");function fi(t){return JSON.parse(ee(t),(e,i)=>e==""?i:BigInt(i))}o(fi,"decodeDirListing");function se(t){return D(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}o(se,"encodeDirListing");var It=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,r){return this.markModified(e),this.store.put(e,i,r)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};o(It,"SimpleSyncRWTransaction");var di=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(di,"SyncStoreFile");var Lt=class extends De{store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}get metadata(){return{...super.metadata,name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e),a=j(e),l=N(i),c=j(i),f=this.findINode(n,s),d=this.getDirListing(n,f,s);if(!f.toStats().hasAccess(2,r))throw u.EACCES(e);if(!d[a])throw u.ENOENT(e);let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new u(16,s);let b,m;if(l===s?(b=f,m=d):(b=this.findINode(n,l),m=this.getDirListing(n,b,l)),m[c]){let g=this.getINode(n,m[c],i);if(g.toStats().isFile())try{n.remove(g.ino),n.remove(m[c])}catch(y){throw n.abort(),y}else throw u.EPERM(i)}m[c]=h;try{n.put(f.ino,se(d),!0),n.put(b.ino,se(m),!0)}catch(g){throw n.abort(),g}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction("readonly"),e).toStats();if(!r.hasAccess(4,i))throw u.EACCES(e);return r}createFileSync(e,i,r,n){return this.commitNewFile(e,B.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction("readonly"),s=this.findINode(n,e),a=n.get(s.ino);if(!s.toStats().hasAccess(i.mode,r))throw u.EACCES(e);if(a===null)throw u.ENOENT(e);return new di(this,e,i,s.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw u.ENOTEMPTY(e);this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,B.DIRECTORY,i,r,D("{}"))}readdirSync(e,i){let r=this.store.beginTransaction("readonly"),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw u.EACCES(e);return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=this._findINode(n,N(e),j(e)),a=this.getINode(n,s,e),l=a.update(r);try{n.put(a.ino,i,!0),l&&n.put(s,a.data,!0)}catch(c){throw n.abort(),c}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e);if(!this.findINode(n,s).toStats().hasAccess(4,r))throw u.EACCES(s);let l=N(i),c=this.findINode(n,l),f=this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw u.EACCES(l);let d=this._findINode(n,s,j(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw u.EACCES(i);h.nlink++,f[j(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(f),!0)}catch(b){throw n.abort(),b}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction("readwrite");if(e.get(fe))return;let i=new ue;i.mode=511|B.DIRECTORY,e.put(i.ino,D("{}"),!1),e.put(fe,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let s=Ae(i,r);if(n.has(s))throw new u(5,"Infinite loop detected while finding inode",s);if(n.add(s),i!="/"){let a=this._findINode(e,N(i),j(i),n),l=this.getDirListing(e,this.getINode(e,a,i+is+r),i);if(!(r in l))throw u.ENOENT(ve(i,r));return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,fe,i),i);if(!(r in a))throw u.ENOENT(ve(i,r));return a[r]}return fe}findINode(e,i){let r=this._findINode(e,N(i),j(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw u.ENOENT(r);return new ue(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw u.ENOTDIR(r);let n=e.get(i.ino);if(!n)throw u.ENOENT(r);return fi(n)}addNewNode(e,i){let n;for(;0<5;)try{return n=Pt(),e.put(n,i,!1),n}catch{}throw new u(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,s=new Uint8Array){let a=this.store.beginTransaction("readwrite"),l=N(e),c=j(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw u.EACCES(e);if(e==="/")throw u.EEXIST(e);if(d[c])throw u.EEXIST(e);let h=new ue;try{h.ino=this.addNewNode(a,s),h.size=s.length,h.mode=r|i,h.uid=n.uid,h.gid=n.gid,d[c]=this.addNewNode(a,h.data),a.put(f.ino,se(d),!0)}catch(b){throw a.abort(),b}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e),a=this.findINode(n,s),l=this.getDirListing(n,a,s),c=j(e),f=l[c];if(!f)throw u.ENOENT(e);let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw u.EACCES(e);if(delete l[c],!i&&d.toStats().isDirectory())throw u.EISDIR(e);if(i&&!d.toStats().isDirectory())throw u.ENOTDIR(e);try{n.put(a.ino,se(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};o(Lt,"SyncStoreFileSystem");var Yi=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new It(this)}get(e){return this.store.get(e)}put(e,i,r){return!r&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};o(Yi,"InMemoryStore");var hi={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",description:"The name of the store"}},create({name:t}){return new Lt({store:new Yi(t)})}};function as(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)}o(as,"_toUnixTimestamp");function we(t,e){switch(typeof t){case"number":return t;case"string":let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new u(22,"Invalid mode: "+t?.toString())}o(we,"normalizeMode");function Ct(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new u(22,"Invalid time.")}o(Ct,"normalizeTime");function U(t){if(t.indexOf("\0")>=0)throw new u(22,"Path must be a string without null bytes.");if(t==="")throw new u(22,"Path must not be empty.");return t=t.replaceAll(/\/+/g,"/"),ve(t)}o(U,"normalizePath");function Xe(t,e,i,r){switch(t===null?"null":typeof t){case"object":return{encoding:typeof t.encoding<"u"?t.encoding:e,flag:typeof t.flag<"u"?t.flag:i,mode:we(t.mode,r)};case"string":return{encoding:t,flag:i,mode:r};case"null":case"undefined":case"function":return{encoding:e,flag:i,mode:r};default:throw new TypeError(`"options" must be a string or an object, got ${typeof t} instead.`)}}o(Xe,"normalizeOptions");function S(){}o(S,"nop");var x=$.Root;function ls(t){x=t}o(ls,"setCred");var st=new Map,Cu=100;function Rt(t){let e=Cu++;return st.set(e,t),e}o(Rt,"getFdForFile");function T(t){if(!st.has(t))throw new u(9);return st.get(t)}o(T,"fd2file");var ge=new Map;Gi("/",hi.create({name:"root"}));function Gi(t,e){if(t[0]!=="/"&&(t="/"+t),t=ve(t),ge.has(t))throw new u(22,"Mount point "+t+" is already in use.");ge.set(t,e)}o(Gi,"mount");function rn(t){if(t[0]!=="/"&&(t=`/${t}`),t=ve(t),!ge.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");ge.delete(t)}o(rn,"umount");function de(t){t=U(t);let e=[...ge].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}o(de,"resolveFS");function ss(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}o(ss,"fixPaths");function Je(t,e){return typeof t.stack=="string"&&(t.stack=ss(t.stack,e)),t.message=ss(t.message,e),t}o(Je,"fixError");function Xi(t){"/"in t&&rn("/");for(let[e,i]of Object.entries(t))Gi(e,i)}o(Xi,"initialize");var ir={};Oi(ir,{FileHandle:()=>le,access:()=>Tn,appendFile:()=>tr,chmod:()=>vn,chown:()=>En,constants:()=>ci,copyFile:()=>vf,createReadStream:()=>Sf,createWriteStream:()=>_f,exists:()=>mi,fchmod:()=>yf,fchown:()=>pf,futimes:()=>mf,lchmod:()=>An,lchown:()=>xn,link:()=>wn,lopen:()=>er,lstat:()=>pn,lutimes:()=>Nn,mkdir:()=>gn,mkdtemp:()=>xf,open:()=>at,read:()=>hf,readFile:()=>bi,readdir:()=>yi,readlink:()=>_n,realpath:()=>gi,rename:()=>hn,rm:()=>Ef,rmdir:()=>bn,stat:()=>Bt,symlink:()=>Sn,truncate:()=>yn,unlink:()=>Zi,unwatchFile:()=>gf,utimes:()=>kn,watch:()=>wf,watchFile:()=>bf,write:()=>df,writeFile:()=>Ut});function ae(...[t,e,i,...r]){i=U(i);let{fs:n,path:s}=de(e&&nn(i)?dn(i):i);try{return n[t](s,...r)}catch(a){throw Je(a,{[s]:i})}}o(ae,"doOp");function Ru(t,e){t=U(t),e=U(e);let i=de(t),r=de(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,x);let s=us(t);an(e,s),cs(t)}catch(s){throw Je(s,n)}}o(Ru,"renameSync");function nn(t){t=U(t);try{let{fs:e,path:i}=de(t);return e.existsSync(i,x)}catch(e){if(e.errno==2)return!1;throw e}}o(nn,"existsSync");function on(t,e){let i=ae("statSync",!0,t,x);return e?.bigint?G.clone(i):i}o(on,"statSync");function Ou(t,e){let i=ae("statSync",!1,t,x);return e?.bigint?G.clone(i):i}o(Ou,"lstatSync");function Bu(t,e=0){let i=pi(t,"r+");try{fs(i,e)}finally{Qe(i)}}o(Bu,"truncateSync");function cs(t){return ae("unlinkSync",!1,t,x)}o(cs,"unlinkSync");function Ot(t,e,i,r){let n=U(t),s=we(i,420),a=P.FromString(e),l;try{l=ae("statSync",r,n,x)}catch{switch(a.pathNotExistsAction()){case 3:if(!ae("statSync",r,N(n),x).isDirectory())throw u.ENOTDIR(N(n));return ae("createFileSync",r,n,a,s,x);case 1:throw u.ENOENT(n);default:throw new u(22,"Invalid FileFlag object.")}}if(!l.hasAccess(s,x))throw u.EACCES(n);switch(a.pathExistsAction()){case 1:throw u.EEXIST(n);case 2:return ae("unlinkSync",r,n,x),ae("createFileSync",r,n,a,l.mode,x);case 0:return ae("openFileSync",r,n,a,x);default:throw new u(22,"Invalid FileFlag object.")}}o(Ot,"_openSync");function pi(t,e,i){return Rt(Ot(t,e,i,!0))}o(pi,"openSync");function Ji(t,e,i){return Rt(Ot(t,e,i,!1))}o(Ji,"lopenSync");function sn(t,e,i){let r=Ot(t,e,420,i);try{let n=r.statSync(),s=new Uint8Array(n.size);return r.readSync(s,0,n.size,0),r.closeSync(),s}finally{r.closeSync()}}o(sn,"_readFileSync");function us(t,e={}){let i=Xe(e,null,"r",420);if(!P.FromString(i.flag).isReadable())throw new u(22,"Flag passed to readFile must allow for reading.");let n=sn(t,i.flag,!0);return i.encoding?ee(n,i.encoding):n}o(us,"readFileSync");function Du(t,e,i,r,n){let s=Ot(t,i,r,n);try{s.writeSync(e,0,e.length,0)}finally{s.closeSync()}}o(Du,"_writeFileSync");function an(t,e,i){let r=Xe(i,"utf8","w",420);if(!P.FromString(r.flag).isWriteable())throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e,r.encoding):e;if(s===void 0)throw new u(22,"Data not specified");Du(t,s,r.flag,r.mode,!0)}o(an,"writeFileSync");function Uu(t,e,i,r,n){let s=Ot(t,i,r,n);try{s.writeSync(e,0,e.length,null)}finally{s.closeSync()}}o(Uu,"_appendFileSync");function Mu(t,e,i){let r=Xe(i,"utf8","a",420);if(!P.FromString(r.flag).isAppendable())throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e):e;Uu(t,s,r.flag,r.mode,!0)}o(Mu,"appendFileSync");function Wu(t,e){let i=T(t).statSync();return e?.bigint?G.clone(i):i}o(Wu,"fstatSync");function Qe(t){T(t).closeSync(),st.delete(t)}o(Qe,"closeSync");function fs(t,e=0){if(e<0)throw new u(22);T(t).truncateSync(e)}o(fs,"ftruncateSync");function qu(t){T(t).syncSync()}o(qu,"fsyncSync");function $u(t){T(t).datasyncSync()}o($u,"fdatasyncSync");function ju(t,e,i,r,n){let s,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,s=D(e,d),l=s.length}else s=e,a=i,l=r,c=typeof n=="number"?n:null;let f=T(t);return c==null&&(c=f.position),f.writeSync(s,a,l,c)}o(ju,"writeSync");function zu(t,e,i,r,n){let s=T(t),a=i;return typeof i=="object"&&({offset:a,length:r,position:n}=i),isNaN(+n)&&(n=s.position),s.readSync(e,a,r,n)}o(zu,"readSync");function ln(t,e,i){T(t).chownSync(e,i)}o(ln,"fchownSync");function cn(t,e){let i=we(e,-1);if(i<0)throw new u(22,"Invalid mode.");T(t).chmodSync(i)}o(cn,"fchmodSync");function un(t,e,i){T(t).utimesSync(Ct(e),Ct(i))}o(un,"futimesSync");function Vu(t){return ae("rmdirSync",!0,t,x)}o(Vu,"rmdirSync");function Hu(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;ae("mkdirSync",!0,t,we(i,511),x)}o(Hu,"mkdirSync");function fn(t,e){t=U(t);let i=ae("readdirSync",!0,t,x);for(let r of ge.keys()){if(!r.startsWith(t))continue;let n=r.slice(t.length);n.includes("/")||n.length==0||i.push(n)}return i.map(r=>typeof e=="object"&&e?.withFileTypes?new Ze(r,on(Ae(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?D(r):r)}o(fn,"readdirSync");function Ku(t,e){return e=U(e),ae("linkSync",!1,t,e,x)}o(Ku,"linkSync");function Yu(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(nn(e))throw u.EEXIST(e);an(e,t),Ot(e,"r+",420,!1)._setTypeSync(B.SYMLINK)}o(Yu,"symlinkSync");function Gu(t,e){let i=sn(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:ee(i,r)}o(Gu,"readlinkSync");function Xu(t,e,i){let r=pi(t,"r+");ln(r,e,i),Qe(r)}o(Xu,"chownSync");function Ju(t,e,i){let r=Ji(t,"r+");ln(r,e,i),Qe(r)}o(Ju,"lchownSync");function Qu(t,e){let i=pi(t,"r+");cn(i,e),Qe(i)}o(Qu,"chmodSync");function Zu(t,e){let i=Ji(t,"r+");cn(i,e),Qe(i)}o(Zu,"lchmodSync");function ef(t,e,i){let r=pi(t,"r+");un(r,e,i),Qe(r)}o(ef,"utimesSync");function tf(t,e,i){let r=Ji(t,"r+");un(r,e,i),Qe(r)}o(tf,"lutimesSync");function dn(t,e){t=U(t);let{fs:i,path:r,mountPoint:n}=de(t);try{if(!i.statSync(r,x).isSymbolicLink())return t;let a=U(n+ee(sn(r,"r+",!1)));return dn(a)}catch(s){throw Je(s,{[r]:t})}}o(dn,"realpathSync");function rf(t,e=384){if(!on(t).hasAccess(e,x))throw new u(13)}o(rf,"accessSync");function nf(t){throw new u(95)}o(nf,"rmSync");function of(t,e){throw new u(95)}o(of,"mkdtempSync");function sf(t,e,i){throw new u(95)}o(sf,"copyFileSync");function af(t,e,i){throw new u(95)}o(af,"readvSync");function lf(t,e,i){throw new u(95)}o(lf,"writevSync");function cf(t,e){throw new u(95)}o(cf,"opendirSync");var Ze=class{constructor(e,i){this.name=e;this.stats=i}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()}};o(Ze,"Dirent");var Qi=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await yi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=fn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};o(Qi,"Dir");var le=class{constructor(e){this.fd=e}chown(e,i){return T(this.fd).chown(e,i)}chmod(e){let i=we(e,-1);if(i<0)throw new u(22,"Invalid mode.");return T(this.fd).chmod(i)}datasync(){return T(this.fd).datasync()}sync(){return T(this.fd).sync()}truncate(e){if(e<0)throw new u(22);return T(this.fd).truncate(e)}utimes(e,i){return T(this.fd).utimes(Ct(e),Ct(i))}appendFile(e,i){return tr(T(this.fd).path,e,i)}read(e,i,r,n){return isNaN(+n)&&(n=T(this.fd).position),T(this.fd).read(e,i,r,n)}readFile(e){return bi(T(this.fd).path,e)}stat(e){return Bt(T(this.fd).path,e)}async write(e,i,r,n){let s,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,s=D(e,f),l=s.length}else s=e,a=i,l=r,n=typeof n=="number"?n:null;n??=T(this.fd).position;let c=await T(this.fd).write(s,a,l,n);return{buffer:s,bytesWritten:c}}writeFile(e,i){return Ut(T(this.fd).path,e,i)}writev(e,i){throw new u(95)}readv(e,i){throw new u(95)}async close(){await T(this.fd).close(),st.delete(this.fd)}};o(le,"FileHandle");async function Se(...[t,e,i,...r]){i=U(i);let{fs:n,path:s}=de(e&&await mi(i)?await gi(i):i);try{return n[t](s,...r)}catch(a){throw Je(a,{[s]:i})}}o(Se,"doOp");async function hn(t,e){t=U(t),e=U(e);let{path:i}=de(t),{fs:r,path:n}=de(e);try{let s=await bi(t);await Ut(e,s),await Zi(t)}catch(s){throw Je(s,{[i]:t,[n]:e})}}o(hn,"rename");async function mi(t){try{let{fs:e,path:i}=de(t);return e.exists(i,x)}catch(e){if(e.errno==2)return!1;throw e}}o(mi,"exists");async function Bt(t,e){let i=await Se("stat",!0,t,x);return e?.bigint?G.clone(i):i}o(Bt,"stat");async function pn(t,e){let i=await Se("stat",!1,t,x);return e?.bigint?G.clone(i):i}o(pn,"lstat");async function yn(t,e=0){let i=await at(t,"r+");try{await i.truncate(e)}finally{await i.close()}}o(yn,"truncate");async function Zi(t){return Se("unlink",!1,t,x)}o(Zi,"unlink");async function Dt(t,e,i=420,r){let n=U(t),s=we(i,420),a=P.FromString(e);try{switch(a.pathExistsAction()){case 1:throw u.EEXIST(n);case 2:let l=await Se("openFile",r,n,a,x);if(!l)throw new u(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Se("openFile",r,n,a,x);default:throw new u(22,"Invalid file flag")}}catch{switch(a.pathNotExistsAction()){case 3:let c=await Se("stat",r,N(n),x);if(c&&!c.isDirectory())throw u.ENOTDIR(N(n));return await Se("createFile",r,n,a,s,x);case 1:throw u.ENOENT(n);default:throw new u(22,"Invalid file flag")}}}o(Dt,"_open");async function at(t,e,i=420){let r=await Dt(t,e,i,!0);return new le(Rt(r))}o(at,"open");async function er(t,e,i=420){let r=await Dt(t,e,i,!1);return new le(Rt(r))}o(er,"lopen");async function mn(t,e,i){let r=await Dt(U(t),e,420,i);try{let n=await r.stat(),s=new Uint8Array(n.size);return await r.read(s,0,n.size,0),await r.close(),s}finally{await r.close()}}o(mn,"_readFile");async function bi(t,e){let i=Xe(e,null,"r",null);if(!P.FromString(i.flag).isReadable())throw new u(22,"Flag passed must allow for reading.");let n=await mn(t,i.flag,!0);return i.encoding?ee(n,i.encoding):n}o(bi,"readFile");async function uf(t,e,i,r,n){let s=await Dt(t,i,r,n);try{await s.write(e,0,e.length,0)}finally{await s.close()}}o(uf,"_writeFile");async function Ut(t,e,i){let r=Xe(i,"utf8","w",420);if(!P.FromString(r.flag).isWriteable())throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e,r.encoding):e;await uf(t,s,r.flag,r.mode,!0)}o(Ut,"writeFile");async function ff(t,e,i,r,n){let s=await Dt(t,i,r,n);try{await s.write(e,0,e.length,null)}finally{await s.close()}}o(ff,"_appendFile");async function tr(t,e,i){let r=Xe(i,"utf8","a",420);if(!P.FromString(r.flag).isAppendable())throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e):e;await ff(t,s,r.flag,r.mode,!0)}o(tr,"appendFile");function df(t,e,i,r,n){return t.write(e,i,r,n)}o(df,"write");function hf(t,e,i,r,n){return t.read(e,i,r,n)}o(hf,"read");function pf(t,e,i){return t.chown(e,i)}o(pf,"fchown");function yf(t,e){return t.chmod(e)}o(yf,"fchmod");function mf(t,e,i){return t.utimes(e,i)}o(mf,"futimes");async function bn(t){return Se("rmdir",!0,t,x)}o(bn,"rmdir");async function gn(t,e){await Se("mkdir",!0,t,we(typeof e=="object"?e?.mode:e,511),x)}o(gn,"mkdir");async function yi(t,e){t=U(t);let i=await Se("readdir",!0,t,x),r=[...ge.keys()];for(let s of r)if(s.startsWith(t)){let a=s.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let n=[];for(let s of i)n.push(typeof e=="object"&&e?.withFileTypes?new Ze(s,await Bt(Ae(t,s))):s);return n}o(yi,"readdir");async function wn(t,e){return e=U(e),Se("link",!1,t,e,x)}o(wn,"link");async function Sn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await mi(e))throw u.EEXIST(e);await Ut(e,t),await(await Dt(e,"r+",420,!1))._setType(B.SYMLINK)}o(Sn,"symlink");async function _n(t,e){let i=await mn(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:ee(i,r)}o(_n,"readlink");async function En(t,e,i){let r=await at(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(En,"chown");async function xn(t,e,i){let r=await er(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(xn,"lchown");async function vn(t,e){let i=await at(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(vn,"chmod");async function An(t,e){let i=await er(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(An,"lchmod");async function kn(t,e,i){let r=await at(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(kn,"utimes");async function Nn(t,e,i){let r=await er(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(Nn,"lutimes");async function gi(t,e){t=U(t);let{fs:i,path:r,mountPoint:n}=de(t);try{if(!(await i.stat(r,x)).isSymbolicLink())return t;let a=n+U(ee(await mn(r,"r+",!1)));return gi(a)}catch(s){throw Je(s,{[r]:t})}}o(gi,"realpath");async function bf(t,e,i=S){throw new u(95)}o(bf,"watchFile");async function gf(t,e=S){throw new u(95)}o(gf,"unwatchFile");async function wf(t,e,i=S){throw new u(95)}o(wf,"watch");async function Tn(t,e=384){if(!(await Bt(t)).hasAccess(e,x))throw new u(13)}o(Tn,"access");async function Sf(t,e){throw new u(95)}o(Sf,"createReadStream");async function _f(t,e){throw new u(95)}o(_f,"createWriteStream");async function Ef(t){throw new u(95)}o(Ef,"rm");async function xf(t){throw new u(95)}o(xf,"mkdtemp");async function vf(t){throw new u(95)}o(vf,"copyFile");function Af(t,e,i=S){hn(t,e).then(()=>i()).catch(i)}o(Af,"rename");function kf(t,e=S){mi(t).then(e).catch(()=>e(!1))}o(kf,"exists");function Nf(t,e,i=S){i=typeof e=="function"?e:i,Bt(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(Nf,"stat");function Tf(t,e,i=S){i=typeof e=="function"?e:i,pn(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(Tf,"lstat");function Ff(t,e=0,i=S){i=typeof e=="function"?e:i,yn(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}o(Ff,"truncate");function Pf(t,e=S){Zi(t).then(()=>e()).catch(e)}o(Pf,"unlink");function If(t,e,i,r=S){let n=we(i,420);r=typeof i=="function"?i:r,at(t,e,n).then(s=>r(null,s.fd)).catch(r)}o(If,"open");function Lf(t,e,i=S){i=typeof e=="function"?e:i,bi(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(Lf,"readFile");function Cf(t,e,i,r=S){r=typeof i=="function"?i:r,Ut(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}o(Cf,"writeFile");function Rf(t,e,i,r=S){r=typeof i=="function"?i:r,tr(t,e,typeof i=="function"?null:i)}o(Rf,"appendFile");function Of(t,e,i=S){i=typeof e=="function"?e:i,T(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?G.clone(r):r)).catch(i)}o(Of,"fstat");function Bf(t,e=S){new le(t).close().then(()=>e()).catch(e)}o(Bf,"close");function Df(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=T(t);if(r<0)throw new u(22);n.truncate(r).then(()=>i()).catch(i)}o(Df,"ftruncate");function Uf(t,e=S){T(t).sync().then(()=>e()).catch(e)}o(Uf,"fsync");function Mf(t,e=S){T(t).datasync().then(()=>e()).catch(e)}o(Mf,"fdatasync");function Wf(t,e,i,r,n,s=S){let a,l,c,f=null,d,h=new le(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":s=i;break;case"number":f=i,d=typeof r=="string"?r:"utf8",s=typeof n=="function"?n:s;break;default:s=typeof r=="function"?r:typeof n=="function"?n:s,s(new u(22,"Invalid arguments."));return}a=D(e),l=0,c=a.length;let b=s;h.write(a,l,c,f).then(({bytesWritten:m})=>b(null,m,ee(a))).catch(b)}else{a=e,l=i,c=r,f=typeof n=="number"?n:null;let b=typeof n=="function"?n:s;h.write(a,l,c,f).then(({bytesWritten:m})=>b(null,m,a)).catch(b)}}o(Wf,"write");function qf(t,e,i,r,n,s=S){new le(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>s(null,a,l)).catch(s)}o(qf,"read");function $f(t,e,i,r=S){new le(t).chown(e,i).then(()=>r()).catch(r)}o($f,"fchown");function jf(t,e,i){new le(t).chmod(e).then(()=>i()).catch(i)}o(jf,"fchmod");function zf(t,e,i,r=S){new le(t).utimes(e,i).then(()=>r()).catch(r)}o(zf,"futimes");function Vf(t,e=S){bn(t).then(()=>e()).catch(e)}o(Vf,"rmdir");function Hf(t,e,i=S){gn(t,e).then(()=>i()).catch(i)}o(Hf,"mkdir");function Kf(t,e,i=S){i=typeof e=="function"?e:i,yi(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}o(Kf,"readdir");function Yf(t,e,i=S){wn(t,e).then(()=>i()).catch(i)}o(Yf,"link");function Gf(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Sn(t,e,n).then(()=>r()).catch(r)}o(Gf,"symlink");function Xf(t,e,i=S){i=typeof e=="function"?e:i,_n(t).then(r=>i(null,r)).catch(i)}o(Xf,"readlink");function Jf(t,e,i,r=S){En(t,e,i).then(()=>r()).catch(r)}o(Jf,"chown");function Qf(t,e,i,r=S){xn(t,e,i).then(()=>r()).catch(r)}o(Qf,"lchown");function Zf(t,e,i=S){vn(t,e).then(()=>i()).catch(i)}o(Zf,"chmod");function ed(t,e,i=S){An(t,e).then(()=>i()).catch(i)}o(ed,"lchmod");function td(t,e,i,r=S){kn(t,e,i).then(()=>r()).catch(r)}o(td,"utimes");function id(t,e,i,r=S){Nn(t,e,i).then(()=>r()).catch(r)}o(id,"lutimes");function rd(t,e,i=S){i=typeof e=="function"?e:i,gi(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(rd,"realpath");function nd(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Tn(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}o(nd,"access");function od(t,e,i=S){throw new u(95)}o(od,"watchFile");function sd(t,e=S){throw new u(95)}o(sd,"unwatchFile");function ad(t,e,i=S){throw new u(95)}o(ad,"watch");function ld(t,e){throw new u(95)}o(ld,"createReadStream");function cd(t,e){throw new u(95)}o(cd,"createWriteStream");function ud(t){new u(95)}o(ud,"rm");function fd(t){new u(95)}o(fd,"mkdtemp");function dd(t,e,i,r){new u(95)}o(dd,"copyFile");function hd(t){new u(95)}o(hd,"readv");function pd(t,e,i,r){throw new u(95)}o(pd,"writev");function yd(t){throw new u(95)}o(yd,"opendir");var Vr=Xc(Wc(),1);var jr=class extends Vr.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};o(jr,"ReadStream");var zr=class extends Vr.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};o(zr,"WriteStream");var Kr=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(Kr,"MirrorFile");var ni=class extends De{_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:i}){super(),this._sync=e,this._async=i,this._ready=this._initialize()}get metadata(){return{...super.metadata,name:ni.name,synchronous:!0,supportsProperties:this._sync.metadata.supportsProperties&&this._async.metadata.supportsProperties}}syncSync(e,i,r){this._sync.syncSync(e,i,r),this.enqueue({apiMethod:"sync",arguments:[e,i,r]})}openFileSync(e,i,r){return this._sync.openFileSync(e,i,r)}createFileSync(e,i,r,n){let s=this._sync.createFileSync(e,i,r,n);this.enqueue({apiMethod:"createFile",arguments:[e,i,r,n]});let a=s.statSync(),l=new Uint8Array(a.size);return s.readSync(l),new Kr(this,e,i,a,l)}linkSync(e,i,r){this._sync.linkSync(e,i,r),this.enqueue({apiMethod:"link",arguments:[e,i,r]})}renameSync(e,i,r){this._sync.renameSync(e,i,r),this.enqueue({apiMethod:"rename",arguments:[e,i,r]})}statSync(e,i){return this._sync.statSync(e,i)}unlinkSync(e,i){this._sync.unlinkSync(e,i),this.enqueue({apiMethod:"unlink",arguments:[e,i]})}rmdirSync(e,i){this._sync.rmdirSync(e,i),this.enqueue({apiMethod:"rmdir",arguments:[e,i]})}mkdirSync(e,i,r){this._sync.mkdirSync(e,i,r),this.enqueue({apiMethod:"mkdir",arguments:[e,i,r]})}readdirSync(e,i){return this._sync.readdirSync(e,i)}existsSync(e,i){return this._sync.existsSync(e,i)}async crossCopyDirectory(e,i){if(e!=="/"){let n=await this._async.stat(e,$.Root);this._sync.mkdirSync(e,i,n.getCred())}let r=await this._async.readdir(e,$.Root);for(let n of r)await this.crossCopy(Ae(e,n))}async crossCopyFile(e,i){let r=await this._async.openFile(e,P.FromString("r"),$.Root),n=this._sync.createFileSync(e,P.FromString("w"),i,$.Root);try{let{size:s}=await r.stat(),a=new Uint8Array(s);await r.read(a),n.writeSync(a)}finally{await r.close(),n.closeSync()}}async crossCopy(e){let i=await this._async.stat(e,$.Root);i.isDirectory()?await this.crossCopyDirectory(e,i.mode):await this.crossCopyFile(e,i.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(i){throw new u(5,"AsyncMirror desync: "+i)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};o(ni,"AsyncMirrorFS");var Xo={name:"AsyncMirror",options:{sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if(!t?.metadata.synchronous)throw new u(22,"'sync' option must be a file system that supports synchronous operations")}},async:{type:"object",description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new ni(t)}};var oi=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};o(oi,"Mutex");var si=class{constructor(e){this.fs=e}_mu=new oi;async ready(){return await this.fs.ready(),this}get metadata(){return{...this.fs.metadata,name:"Locked<"+this.fs.metadata.name+">"}}async rename(e,i,r){await this._mu.lock(e),await this.fs.rename(e,i,r),this._mu.unlock(e)}renameSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,r)}async stat(e,i){await this._mu.lock(e);let r=await this.fs.stat(e,i);return this._mu.unlock(e),r}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,r){await this._mu.lock(e);let n=await this.fs.openFile(e,i,r);return this._mu.unlock(e),n}openFileSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this._mu.lock(e);let s=await this.fs.createFile(e,i,r,n);return this._mu.unlock(e),s}createFileSync(e,i,r,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this._mu.lock(e),await this.fs.mkdir(e,i,r),this._mu.unlock(e)}mkdirSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this._mu.lock(e);let r=await this.fs.readdir(e,i);return this._mu.unlock(e),r}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let r=await this.fs.exists(e,i);return this._mu.unlock(e),r}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,r){await this._mu.lock(e),await this.fs.link(e,i,r),this._mu.unlock(e)}linkSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this._mu.lock(e),await this.fs.sync(e,i,r),this._mu.unlock(e)}syncSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,r)}};o(si,"LockedFS");var Jo="/.deleted",Ci=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};o(Ci,"OverlayFile");var Yr=class extends be{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata.readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}get metadata(){return{...super.metadata,name:Ri.name,synchronous:this._readable.metadata.synchronous&&this._writable.metadata.synchronous,supportsProperties:this._readable.metadata.supportsProperties&&this._writable.metadata.supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,r){let n=r.getCred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.getCred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(Jo,P.FromString("r"),$.Root),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=ee(r)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,r)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e)}}renameSync(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,r)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e)}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e);let n=H.clone(await this._readable.stat(e,i));return n.mode|=146,n}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e);let n=H.clone(this._readable.statSync(e,i));return n.mode|=146,n}}async openFile(e,i,r){if(await this._writable.exists(e,r))return this._writable.openFile(e,i,r);let n=await this._readable.openFile(e,P.FromString("r"),r),s=H.clone(await n.stat()),{buffer:a}=await n.read(new Uint8Array(s.size));return new Ci(this,e,i,s,a)}openFileSync(e,i,r){if(this._writable.existsSync(e,r))return this._writable.openFileSync(e,i,r);let n=this._readable.openFileSync(e,P.FromString("r"),r),s=H.clone(n.statSync()),a=new Uint8Array(s.size);return n.readSync(a),new Ci(this,e,i,s,a)}async createFile(e,i,r,n){return this.checkInitialized(),await this._writable.createFile(e,i,r,n),this.openFile(e,i,n)}createFileSync(e,i,r,n){return this.checkInitialized(),this._writable.createFileSync(e,i,r,n),this.openFileSync(e,i,n)}async link(e,i,r){this.checkInitialized(),await this._writable.link(e,i,r)}linkSync(e,i,r){this.checkInitialized(),this._writable.linkSync(e,i,r)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw u.ENOENT(e);await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw u.ENOENT(e);this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw u.ENOENT(e);if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw u.ENOTEMPTY(e);this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw u.ENOENT(e);if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw u.ENOTEMPTY(e);this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw u.EEXIST(e);await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw u.EEXIST(e);this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw u.ENOTDIR(e);let n=[];try{n.push(...await this._writable.readdir(e,i))}catch{}try{n.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let s={};return n.filter(a=>{let l=!s[a];return s[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw u.ENOTDIR(e);let n=[];try{n=n.concat(this._writable.readdirSync(e,i))}catch{}try{n=n.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let s={};return n.filter(a=>{let l=!s[a];return s[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
-
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(
|
|
4
|
-
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==
|
|
5
|
-
Option description: ${r.description}`);r.validator&&await r.validator(n)}}o(
|
|
1
|
+
var ZenFS=(()=>{var $c=Object.create;var _t=Object.defineProperty;var jc=Object.getOwnPropertyDescriptor;var zc=Object.getOwnPropertyNames;var Vc=Object.getPrototypeOf,Hc=Object.prototype.hasOwnProperty;var Kc=(t,e,i)=>e in t?_t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var o=(t,e)=>_t(t,"name",{value:e,configurable:!0});var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ri=(t,e)=>{for(var i in e)_t(t,i,{get:e[i],enumerable:!0})},Zo=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zc(e))!Hc.call(t,n)&&n!==i&&_t(t,n,{get:()=>e[n],enumerable:!(r=jc(e,n))||r.enumerable});return t};var Yc=(t,e,i)=>(i=t!=null?$c(Vc(t)):{},Zo(e||!t||!t.__esModule?_t(i,"default",{value:t,enumerable:!0}):i,t)),Gc=t=>Zo(_t({},"__esModule",{value:!0}),t);var oi=(t,e,i)=>(Kc(t,typeof e!="symbol"?e+"":e,i),i);var ds=k(er=>{"use strict";er.byteLength=md;er.toByteArray=gd;er.fromByteArray=_d;var ke=[],pe=[],yd=typeof Uint8Array<"u"?Uint8Array:Array,Nn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(st=0,us=Nn.length;st<us;++st)ke[st]=Nn[st],pe[Nn.charCodeAt(st)]=st;var st,us;pe["-".charCodeAt(0)]=62;pe["_".charCodeAt(0)]=63;function fs(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]}o(fs,"getLens");function md(t){var e=fs(t),i=e[0],r=e[1];return(i+r)*3/4-r}o(md,"byteLength");function bd(t,e,i){return(e+i)*3/4-i}o(bd,"_byteLength");function gd(t){var e,i=fs(t),r=i[0],n=i[1],s=new yd(bd(t,r,n)),a=0,l=n>0?r-4:r,c;for(c=0;c<l;c+=4)e=pe[t.charCodeAt(c)]<<18|pe[t.charCodeAt(c+1)]<<12|pe[t.charCodeAt(c+2)]<<6|pe[t.charCodeAt(c+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=pe[t.charCodeAt(c)]<<2|pe[t.charCodeAt(c+1)]>>4,s[a++]=e&255),n===1&&(e=pe[t.charCodeAt(c)]<<10|pe[t.charCodeAt(c+1)]<<4|pe[t.charCodeAt(c+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}o(gd,"toByteArray");function wd(t){return ke[t>>18&63]+ke[t>>12&63]+ke[t>>6&63]+ke[t&63]}o(wd,"tripletToBase64");function Sd(t,e,i){for(var r,n=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(wd(r));return n.join("")}o(Sd,"encodeChunk");function _d(t){for(var e,i=t.length,r=i%3,n=[],s=16383,a=0,l=i-r;a<l;a+=s)n.push(Sd(t,a,a+s>l?l:a+s));return r===1?(e=t[i-1],n.push(ke[e>>2]+ke[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(ke[e>>10]+ke[e>>4&63]+ke[e<<2&63]+"=")),n.join("")}o(_d,"fromByteArray")});var hs=k(Tn=>{Tn.read=function(t,e,i,r,n){var s,a,l=n*8-r-1,c=(1<<l)-1,f=c>>1,d=-7,h=i?n-1:0,b=i?-1:1,m=t[e+h];for(h+=b,s=m&(1<<-d)-1,m>>=-d,d+=l;d>0;s=s*256+t[e+h],h+=b,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=b,d-=8);if(s===0)s=1-f;else{if(s===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-f}return(m?-1:1)*a*Math.pow(2,s-r)};Tn.write=function(t,e,i,r,n,s){var a,l,c,f=s*8-n-1,d=(1<<f)-1,h=d>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:s-1,g=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=b/c:e+=b*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+m]=l&255,m+=g,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[i+m]=a&255,m+=g,a/=256,f-=8);t[i+m-g]|=y*128}});var Me=k(Wt=>{"use strict";var Fn=ds(),Mt=hs(),ps=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Wt.Buffer=p;Wt.SlowBuffer=Nd;Wt.INSPECT_MAX_BYTES=50;var tr=2147483647;Wt.kMaxLength=tr;p.TYPED_ARRAY_SUPPORT=Ed();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ed(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}o(Ed,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function De(t){if(t>tr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}o(De,"createBuffer");function p(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Cn(t)}return gs(t,e,i)}o(p,"Buffer");p.poolSize=8192;function gs(t,e,i){if(typeof t=="string")return vd(t,e);if(ArrayBuffer.isView(t))return Ad(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(Ne(t,ArrayBuffer)||t&&Ne(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ne(t,SharedArrayBuffer)||t&&Ne(t.buffer,SharedArrayBuffer)))return In(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return p.from(r,e,i);let n=kd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}o(gs,"from");p.from=function(t,e,i){return gs(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function ws(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"')}o(ws,"assertSize");function xd(t,e,i){return ws(t),t<=0?De(t):e!==void 0?typeof i=="string"?De(t).fill(e,i):De(t).fill(e):De(t)}o(xd,"alloc");p.alloc=function(t,e,i){return xd(t,e,i)};function Cn(t){return ws(t),De(t<0?0:Rn(t)|0)}o(Cn,"allocUnsafe");p.allocUnsafe=function(t){return Cn(t)};p.allocUnsafeSlow=function(t){return Cn(t)};function vd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=Ss(t,e)|0,r=De(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}o(vd,"fromString");function Pn(t){let e=t.length<0?0:Rn(t.length)|0,i=De(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}o(Pn,"fromArrayLike");function Ad(t){if(Ne(t,Uint8Array)){let e=new Uint8Array(t);return In(e.buffer,e.byteOffset,e.byteLength)}return Pn(t)}o(Ad,"fromArrayView");function In(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,p.prototype),r}o(In,"fromArrayBuffer");function kd(t){if(p.isBuffer(t)){let e=Rn(t.length)|0,i=De(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Bn(t.length)?De(0):Pn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Pn(t.data)}o(kd,"fromObject");function Rn(t){if(t>=tr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+tr.toString(16)+" bytes");return t|0}o(Rn,"checked");function Nd(t){return+t!=t&&(t=0),p.alloc(+t)}o(Nd,"SlowBuffer");p.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=o(function(e,i){if(Ne(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Ne(i,Uint8Array)&&(i=p.from(i,i.offset,i.byteLength)),!p.isBuffer(e)||!p.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let s=0,a=Math.min(r,n);s<a;++s)if(e[s]!==i[s]){r=e[s],n=i[s];break}return r<n?-1:n<r?1:0},"compare");p.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=o(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=p.allocUnsafe(i),s=0;for(r=0;r<e.length;++r){let a=e[r];if(Ne(a,Uint8Array))s+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(p.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n},"concat");function Ss(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ne(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 Ln(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Fs(t).length;default:if(n)return r?-1:Ln(t).length;e=(""+e).toLowerCase(),n=!0}}o(Ss,"byteLength");p.byteLength=Ss;function Td(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 Md(this,e,i);case"utf8":case"utf-8":return Es(this,e,i);case"ascii":return Bd(this,e,i);case"latin1":case"binary":return Dd(this,e,i);case"base64":return Rd(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ud(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}o(Td,"slowToString");p.prototype._isBuffer=!0;function at(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}o(at,"swap");p.prototype.swap16=o(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)at(this,i,i+1);return this},"swap16");p.prototype.swap32=o(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)at(this,i,i+3),at(this,i+1,i+2);return this},"swap32");p.prototype.swap64=o(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)at(this,i,i+7),at(this,i+1,i+6),at(this,i+2,i+5),at(this,i+3,i+4);return this},"swap64");p.prototype.toString=o(function(){let e=this.length;return e===0?"":arguments.length===0?Es(this,0,e):Td.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=o(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=o(function(){let e="",i=Wt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");ps&&(p.prototype[ps]=p.prototype.inspect);p.prototype.compare=o(function(e,i,r,n,s){if(Ne(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),i<0||r>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&i>=r)return 0;if(n>=s)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,l=r-i,c=Math.min(a,l),f=this.slice(n,s),d=e.slice(i,r);for(let h=0;h<c;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function _s(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Bn(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=p.from(e,r)),p.isBuffer(e))return e.length===0?-1:ys(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):ys(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}o(_s,"bidirectionalIndexOf");function ys(t,e,i,r,n){let s=1,a=t.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,i/=2}function c(d,h){return s===1?d[h]:d.readUInt16BE(h*s)}o(c,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(c(t,f)===c(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*s}else d!==-1&&(f-=f-d),d=-1}else for(i+l>a&&(i=a-l),f=i;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(c(t,f+h)!==c(e,h)){d=!1;break}if(d)return f}return-1}o(ys,"arrayIndexOf");p.prototype.includes=o(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");p.prototype.indexOf=o(function(e,i,r){return _s(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=o(function(e,i,r){return _s(this,e,i,r,!1)},"lastIndexOf");function Fd(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let s=e.length;r>s/2&&(r=s/2);let a;for(a=0;a<r;++a){let l=parseInt(e.substr(a*2,2),16);if(Bn(l))return a;t[i+a]=l}return a}o(Fd,"hexWrite");function Pd(t,e,i,r){return ir(Ln(e,t.length-i),t,i,r)}o(Pd,"utf8Write");function Id(t,e,i,r){return ir(jd(e),t,i,r)}o(Id,"asciiWrite");function Ld(t,e,i,r){return ir(Fs(e),t,i,r)}o(Ld,"base64Write");function Cd(t,e,i,r){return ir(zd(e,t.length-i),t,i,r)}o(Cd,"ucs2Write");p.prototype.write=o(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 s=this.length-i;if((r===void 0||r>s)&&(r=s),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 Fd(this,e,i,r);case"utf8":case"utf-8":return Pd(this,e,i,r);case"ascii":case"latin1":case"binary":return Id(this,e,i,r);case"base64":return Ld(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Cd(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function Rd(t,e,i){return e===0&&i===t.length?Fn.fromByteArray(t):Fn.fromByteArray(t.slice(e,i))}o(Rd,"base64Slice");function Es(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let s=t[n],a=null,l=s>239?4:s>223?3:s>191?2:1;if(n+l<=i){let c,f,d,h;switch(l){case 1:s<128&&(a=s);break;case 2:c=t[n+1],(c&192)===128&&(h=(s&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[n+1],f=t[n+2],(c&192)===128&&(f&192)===128&&(h=(s&15)<<12|(c&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[n+1],f=t[n+2],d=t[n+3],(c&192)===128&&(f&192)===128&&(d&192)===128&&(h=(s&15)<<18|(c&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=l}return Od(r)}o(Es,"utf8Slice");var ms=4096;function Od(t){let e=t.length;if(e<=ms)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=ms));return i}o(Od,"decodeCodePointsArray");function Bd(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}o(Bd,"asciiSlice");function Dd(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}o(Dd,"latin1Slice");function Md(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let s=e;s<i;++s)n+=Vd[t[s]];return n}o(Md,"hexSlice");function Ud(t,e,i){let r=t.slice(e,i),n="";for(let s=0;s<r.length-1;s+=2)n+=String.fromCharCode(r[s]+r[s+1]*256);return n}o(Ud,"utf16leSlice");p.prototype.slice=o(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,p.prototype),n},"slice");function K(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")}o(K,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=this[e],s=1,a=0;for(;++a<i&&(s*=256);)n+=this[e+a]*s;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=this[e+--i],s=1;for(;i>0&&(s*=256);)n+=this[e+--i]*s;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=o(function(e,i){return e=e>>>0,i||K(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=o(function(e,i){return e=e>>>0,i||K(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=o(function(e,i){return e=e>>>0,i||K(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=Ze(o(function(e){e=e>>>0,Ut(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&bi(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=Ze(o(function(e){e=e>>>0,Ut(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&bi(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(s)},"readBigUInt64BE"));p.prototype.readIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=this[e],s=1,a=0;for(;++a<i&&(s*=256);)n+=this[e+a]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*i)),n},"readIntLE");p.prototype.readIntBE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(e,i,this.length);let n=i,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*i)),a},"readIntBE");p.prototype.readInt8=o(function(e,i){return e=e>>>0,i||K(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=o(function(e,i){e=e>>>0,i||K(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");p.prototype.readInt16BE=o(function(e,i){e=e>>>0,i||K(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");p.prototype.readInt32LE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=Ze(o(function(e){e=e>>>0,Ut(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&bi(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=Ze(o(function(e){e=e>>>0,Ut(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&bi(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));p.prototype.readFloatLE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),Mt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),Mt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=o(function(e,i){return e=e>>>0,i||K(e,8,this.length),Mt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=o(function(e,i){return e=e>>>0,i||K(e,8,this.length),Mt.read(this,e,!1,52,8)},"readDoubleBE");function oe(t,e,i,r,n,s){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}o(oe,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=o(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;oe(this,e,i,r,l,0)}let s=1,a=0;for(this[i]=e&255;++a<r&&(s*=256);)this[i+a]=e/s&255;return i+r},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=o(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;oe(this,e,i,r,l,0)}let s=r-1,a=1;for(this[i+s]=e&255;--s>=0&&(a*=256);)this[i+s]=e/a&255;return i+r},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function xs(t,e,i,r,n){Ts(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s;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}o(xs,"wrtBigUInt64LE");function vs(t,e,i,r,n){Ts(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s=s>>8,t[i+6]=s,s=s>>8,t[i+5]=s,s=s>>8,t[i+4]=s;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}o(vs,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=Ze(o(function(e,i=0){return xs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=Ze(o(function(e,i=0){return vs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=o(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);oe(this,e,i,r,c-1,-c)}let s=0,a=1,l=0;for(this[i]=e&255;++s<r&&(a*=256);)e<0&&l===0&&this[i+s-1]!==0&&(l=1),this[i+s]=(e/a>>0)-l&255;return i+r},"writeIntLE");p.prototype.writeIntBE=o(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let c=Math.pow(2,8*r-1);oe(this,e,i,r,c-1,-c)}let s=r-1,a=1,l=0;for(this[i+s]=e&255;--s>=0&&(a*=256);)e<0&&l===0&&this[i+s+1]!==0&&(l=1),this[i+s]=(e/a>>0)-l&255;return i+r},"writeIntBE");p.prototype.writeInt8=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");p.prototype.writeInt16LE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");p.prototype.writeInt16BE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");p.prototype.writeInt32LE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");p.prototype.writeInt32BE=o(function(e,i,r){return e=+e,i=i>>>0,r||oe(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");p.prototype.writeBigInt64LE=Ze(o(function(e,i=0){return xs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=Ze(o(function(e,i=0){return vs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function As(t,e,i,r,n,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}o(As,"checkIEEE754");function ks(t,e,i,r,n){return e=+e,i=i>>>0,n||As(t,e,i,4,34028234663852886e22,-34028234663852886e22),Mt.write(t,e,i,r,23,4),i+4}o(ks,"writeFloat");p.prototype.writeFloatLE=o(function(e,i,r){return ks(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=o(function(e,i,r){return ks(this,e,i,!1,r)},"writeFloatBE");function Ns(t,e,i,r,n){return e=+e,i=i>>>0,n||As(t,e,i,8,17976931348623157e292,-17976931348623157e292),Mt.write(t,e,i,r,52,8),i+8}o(Ns,"writeDouble");p.prototype.writeDoubleLE=o(function(e,i,r){return Ns(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=o(function(e,i,r){return Ns(this,e,i,!1,r)},"writeDoubleBE");p.prototype.copy=o(function(e,i,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-i<n-r&&(n=e.length-i+r);let s=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),s},"copy");p.prototype.fill=o(function(e,i,r,n){if(typeof e=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let s;if(typeof e=="number")for(s=i;s<r;++s)this[s]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-i;++s)this[s+i]=a[s%l]}return this},"fill");var Dt={};function On(t,e,i){Dt[t]=o(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}o(On,"E");On("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);On("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);On("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=bs(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=bs(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function bs(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}`}o(bs,"addNumericalSeparator");function Wd(t,e,i){Ut(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&bi(e,t.length-(i+1))}o(Wd,"checkBounds");function Ts(t,e,i,r,n,s){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw s>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:l=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new Dt.ERR_OUT_OF_RANGE("value",l,t)}Wd(r,n,s)}o(Ts,"checkIntBI");function Ut(t,e){if(typeof t!="number")throw new Dt.ERR_INVALID_ARG_TYPE(e,"number",t)}o(Ut,"validateNumber");function bi(t,e,i){throw Math.floor(t)!==t?(Ut(t,i),new Dt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Dt.ERR_BUFFER_OUT_OF_BOUNDS:new Dt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}o(bi,"boundsError");var qd=/[^+/0-9A-Za-z-_]/g;function $d(t){if(t=t.split("=")[0],t=t.trim().replace(qd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}o($d,"base64clean");function Ln(t,e){e=e||1/0;let i,r=t.length,n=null,s=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return s}o(Ln,"utf8ToBytes");function jd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}o(jd,"asciiToBytes");function zd(t,e){let i,r,n,s=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,s.push(n),s.push(r);return s}o(zd,"utf16leToBytes");function Fs(t){return Fn.toByteArray($d(t))}o(Fs,"base64ToBytes");function ir(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}o(ir,"blitBuffer");function Ne(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}o(Ne,"isInstance");function Bn(t){return t!==t}o(Bn,"numberIsNaN");var Vd=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 Ze(t){return typeof BigInt>"u"?Hd:t}o(Ze,"defineBigIntMethod");function Hd(){throw new Error("BigInt not supported")}o(Hd,"BufferBigIntNotDefined")});var C=k((uS,Ps)=>{"use strict";Ps.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var qt=k((fS,rr)=>{"use strict";var{AbortController:Is,AbortSignal:Kd}=typeof self<"u"?self:typeof window<"u"?window:void 0;rr.exports=Is;rr.exports.AbortSignal=Kd;rr.exports.default=Is});var gi=k((dS,Dn)=>{"use strict";var $t=typeof Reflect=="object"?Reflect:null,Ls=$t&&typeof $t.apply=="function"?$t.apply:o(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),nr;$t&&typeof $t.ownKeys=="function"?nr=$t.ownKeys:Object.getOwnPropertySymbols?nr=o(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):nr=o(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function Yd(t){console&&console.warn&&console.warn(t)}o(Yd,"ProcessEmitWarning");var Rs=Number.isNaN||o(function(e){return e!==e},"NumberIsNaN");function I(){I.init.call(this)}o(I,"EventEmitter");Dn.exports=I;Dn.exports.once=Qd;I.EventEmitter=I;I.prototype._events=void 0;I.prototype._eventsCount=0;I.prototype._maxListeners=void 0;var Cs=10;function or(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(or,"checkListener");Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return Cs},set:function(t){if(typeof t!="number"||t<0||Rs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Cs=t}});I.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};I.prototype.setMaxListeners=o(function(e){if(typeof e!="number"||e<0||Rs(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 Os(t){return t._maxListeners===void 0?I.defaultMaxListeners:t._maxListeners}o(Os,"_getMaxListeners");I.prototype.getMaxListeners=o(function(){return Os(this)},"getMaxListeners");I.prototype.emit=o(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Ls(c,this,i);else for(var f=c.length,d=Ws(c,f),r=0;r<f;++r)Ls(d[r],this,i);return!0},"emit");function Bs(t,e,i,r){var n,s,a;if(or(i),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),a=s[e]),a===void 0)a=s[e]=i,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=Os(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,Yd(l)}return t}o(Bs,"_addListener");I.prototype.addListener=o(function(e,i){return Bs(this,e,i,!1)},"addListener");I.prototype.on=I.prototype.addListener;I.prototype.prependListener=o(function(e,i){return Bs(this,e,i,!0)},"prependListener");function Gd(){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)}o(Gd,"onceWrapper");function Ds(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=Gd.bind(r);return n.listener=i,r.wrapFn=n,n}o(Ds,"_onceWrap");I.prototype.once=o(function(e,i){return or(i),this.on(e,Ds(this,e,i)),this},"once");I.prototype.prependOnceListener=o(function(e,i){return or(i),this.prependListener(e,Ds(this,e,i)),this},"prependOnceListener");I.prototype.removeListener=o(function(e,i){var r,n,s,a,l;if(or(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(s=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){l=r[a].listener,s=a;break}if(s<0)return this;s===0?r.shift():Xd(r,s),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=o(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 s=Object.keys(r),a;for(n=0;n<s.length;++n)a=s[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 Ms(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?Jd(n):Ws(n,n.length)}o(Ms,"_listeners");I.prototype.listeners=o(function(e){return Ms(this,e,!0)},"listeners");I.prototype.rawListeners=o(function(e){return Ms(this,e,!1)},"rawListeners");I.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Us.call(t,e)};I.prototype.listenerCount=Us;function Us(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}o(Us,"listenerCount");I.prototype.eventNames=o(function(){return this._eventsCount>0?nr(this._events):[]},"eventNames");function Ws(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}o(Ws,"arrayClone");function Xd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}o(Xd,"spliceOne");function Jd(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}o(Jd,"unwrapListeners");function Qd(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,s),r(a)}o(n,"errorListener");function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}o(s,"resolver"),qs(t,e,s,{once:!0}),e!=="error"&&Zd(t,n,{once:!0})})}o(Qd,"once");function Zd(t,e,i){typeof t.on=="function"&&qs(t,"error",e,i)}o(Zd,"addErrorHandlerIfEventEmitter");function qs(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,o(function n(s){r.once&&t.removeEventListener(e,n),i(s)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}o(qs,"eventTargetAgnosticAddListener")});var Q=k((pS,Mn)=>{"use strict";var eh=Me(),{kResistStopPropagation:th,SymbolDispose:ih}=C(),rh=globalThis.AbortSignal||qt().AbortSignal,nh=globalThis.AbortController||qt().AbortController,oh=Object.getPrototypeOf(async function(){}).constructor,$s=globalThis.Blob||eh.Blob,sh=o(typeof $s<"u"?function(e){return e instanceof $s}:function(e){return!1},"isBlob"),js=o((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),ah=o((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),sr=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=e}};o(sr,"AggregateError");Mn.exports={AggregateError:sr,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof oh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:sh,deprecate(t,e){return t},addAbortListener:gi().addAbortListener||o(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);js(e,"signal"),ah(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[th]:!0}),r=o(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[ih](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:rh.any||o(function(e){if(e.length===1)return e[0];let i=new nh,r=o(()=>i.abort(),"abort");return e.forEach(n=>{js(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};Mn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ie=k((mS,Hs)=>{"use strict";var{format:lh,inspect:lr,AggregateError:ch}=Q(),uh=globalThis.AggregateError||ch,fh=Symbol("kIsNodeError"),dh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],hh=/^([A-Z][a-z0-9]*)+$/,ph="__node_internal_",cr={};function lt(t,e){if(!t)throw new cr.ERR_INTERNAL_ASSERTION(e)}o(lt,"assert");function zs(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}`}o(zs,"addNumericalSeparator");function yh(t,e,i){if(typeof e=="function")return lt(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 lt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:lh(e,...i)}o(yh,"getMessage");function X(t,e,i){i||(i=Error);class r extends i{constructor(...s){super(yh(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}o(r,"NodeError"),Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[fh]=!0,cr[t]=r}o(X,"E");function Vs(t){let e=ph+t.name;return Object.defineProperty(t,"name",{value:e}),t}o(Vs,"hideStackFrames");function mh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new uh([e,t],e.message);return i.code=e.code,i}return t||e}o(mh,"aggregateTwoErrors");var ar=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new cr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};o(ar,"AbortError");X("ERR_ASSERTION","%s",Error);X("ERR_INVALID_ARG_TYPE",(t,e,i)=>{lt(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=[],s=[],a=[];for(let c of e)lt(typeof c=="string","All expected entries have to be of type string"),dh.includes(c)?n.push(c.toLowerCase()):hh.test(c)?s.push(c):(lt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(s.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();r+=`one of type ${n.join(", ")}, or ${c}`}}(s.length>0||a.length>0)&&(r+=" or ")}if(s.length>0){switch(s.length){case 1:r+=`an instance of ${s[0]}`;break;case 2:r+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();r+=`an instance of ${s.join(", ")}, or ${c}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();r+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)r+=`. Received an instance of ${i.constructor.name}`;else{let c=lr(i,{depth:-1});r+=`. Received ${c}`}}else{let c=lr(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),r+=`. Received type ${typeof i} (${c})`}return r},TypeError);X("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=lr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);X("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var r;let n=i!=null&&(r=i.constructor)!==null&&r!==void 0&&r.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);X("ERR_MISSING_ARGS",(...t)=>{lt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(r=>`"${r}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);X("ERR_OUT_OF_RANGE",(t,e,i)=>{lt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=zs(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=zs(r)),r+="n"):r=lr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);X("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);X("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);X("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);X("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);X("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);X("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);X("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);X("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);X("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);X("ERR_STREAM_WRITE_AFTER_END","write after end",Error);X("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Hs.exports={AbortError:ar,aggregateTwoErrors:Vs(mh),hideStackFrames:Vs,codes:cr}});var zt=k((gS,ia)=>{"use strict";var{ArrayIsArray:Wn,ArrayPrototypeIncludes:Xs,ArrayPrototypeJoin:Js,ArrayPrototypeMap:bh,NumberIsInteger:qn,NumberIsNaN:gh,NumberMAX_SAFE_INTEGER:wh,NumberMIN_SAFE_INTEGER:Sh,NumberParseInt:_h,ObjectPrototypeHasOwnProperty:Eh,RegExpPrototypeExec:Qs,String:xh,StringPrototypeToUpperCase:vh,StringPrototypeTrim:Ah}=C(),{hideStackFrames:ye,codes:{ERR_SOCKET_BAD_PORT:kh,ERR_INVALID_ARG_TYPE:Z,ERR_INVALID_ARG_VALUE:jt,ERR_OUT_OF_RANGE:ct,ERR_UNKNOWN_SIGNAL:Ks}}=ie(),{normalizeEncoding:Nh}=Q(),{isAsyncFunction:Th,isArrayBufferView:Fh}=Q().types,Ys={};function Ph(t){return t===(t|0)}o(Ph,"isInt32");function Ih(t){return t===t>>>0}o(Ih,"isUint32");var Lh=/^[0-7]+$/,Ch="must be a 32-bit unsigned integer or an octal string";function Rh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(Qs(Lh,t)===null)throw new jt(e,t,Ch);t=_h(t,8)}return Zs(t,e),t}o(Rh,"parseFileMode");var Oh=ye((t,e,i=Sh,r=wh)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!qn(t))throw new ct(e,"an integer",t);if(t<i||t>r)throw new ct(e,`>= ${i} && <= ${r}`,t)}),Bh=ye((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!qn(t))throw new ct(e,"an integer",t);if(t<i||t>r)throw new ct(e,`>= ${i} && <= ${r}`,t)}),Zs=ye((t,e,i=!1)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!qn(t))throw new ct(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new ct(e,`>= ${r} && <= ${n}`,t)});function $n(t,e){if(typeof t!="string")throw new Z(e,"string",t)}o($n,"validateString");function Dh(t,e,i=void 0,r){if(typeof t!="number")throw new Z(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&gh(t))throw new ct(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}o(Dh,"validateNumber");var Mh=ye((t,e,i)=>{if(!Xs(i,t)){let n="must be one of: "+Js(bh(i,s=>typeof s=="string"?`'${s}'`:xh(s)),", ");throw new jt(e,t,n)}});function ea(t,e){if(typeof t!="boolean")throw new Z(e,"boolean",t)}o(ea,"validateBoolean");function Un(t,e,i){return t==null||!Eh(t,e)?i:t[e]}o(Un,"getOwnPropertyValueOrDefault");var Uh=ye((t,e,i=null)=>{let r=Un(i,"allowArray",!1),n=Un(i,"allowFunction",!1);if(!Un(i,"nullable",!1)&&t===null||!r&&Wn(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Z(e,"Object",t)}),Wh=ye((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Z(e,"a dictionary",t)}),ur=ye((t,e,i=0)=>{if(!Wn(t))throw new Z(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new jt(e,t,r)}});function qh(t,e){ur(t,e);for(let i=0;i<t.length;i++)$n(t[i],`${e}[${i}]`)}o(qh,"validateStringArray");function $h(t,e){ur(t,e);for(let i=0;i<t.length;i++)ea(t[i],`${e}[${i}]`)}o($h,"validateBooleanArray");function jh(t,e){ur(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new Z(n,"AbortSignal",r);ta(r,n)}}o(jh,"validateAbortSignalArray");function zh(t,e="signal"){if($n(t,e),Ys[t]===void 0)throw Ys[vh(t)]!==void 0?new Ks(t+" (signals must use all capital letters)"):new Ks(t)}o(zh,"validateSignalName");var Vh=ye((t,e="buffer")=>{if(!Fh(t))throw new Z(e,["Buffer","TypedArray","DataView"],t)});function Hh(t,e){let i=Nh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new jt("encoding",e,`is invalid for data of length ${r}`)}o(Hh,"validateEncoding");function Kh(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Ah(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new kh(e,t,i);return t|0}o(Kh,"validatePort");var ta=ye((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Z(e,"AbortSignal",t)}),Yh=ye((t,e)=>{if(typeof t!="function")throw new Z(e,"Function",t)}),Gh=ye((t,e)=>{if(typeof t!="function"||Th(t))throw new Z(e,"Function",t)}),Xh=ye((t,e)=>{if(t!==void 0)throw new Z(e,"undefined",t)});function Jh(t,e,i){if(!Xs(i,t))throw new Z(e,`('${Js(i,"|")}')`,t)}o(Jh,"validateUnion");var Qh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Gs(t,e){if(typeof t>"u"||!Qs(Qh,t))throw new jt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(Gs,"validateLinkHeaderFormat");function Zh(t){if(typeof t=="string")return Gs(t,"hints"),t;if(Wn(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];Gs(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new jt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(Zh,"validateLinkHeaderValue");ia.exports={isInt32:Ph,isUint32:Ih,parseFileMode:Rh,validateArray:ur,validateStringArray:qh,validateBooleanArray:$h,validateAbortSignalArray:jh,validateBoolean:ea,validateBuffer:Vh,validateDictionary:Wh,validateEncoding:Hh,validateFunction:Yh,validateInt32:Bh,validateInteger:Oh,validateNumber:Dh,validateObject:Uh,validateOneOf:Mh,validatePlainFunction:Gh,validatePort:Kh,validateSignalName:zh,validateString:$n,validateUint32:Zs,validateUndefined:Xh,validateUnion:Jh,validateAbortSignal:ta,validateLinkHeaderValue:Zh}});var et=k((SS,sa)=>{var U=sa.exports={},Te,Fe;function jn(){throw new Error("setTimeout has not been defined")}o(jn,"defaultSetTimout");function zn(){throw new Error("clearTimeout has not been defined")}o(zn,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Te=setTimeout:Te=jn}catch{Te=jn}try{typeof clearTimeout=="function"?Fe=clearTimeout:Fe=zn}catch{Fe=zn}})();function ra(t){if(Te===setTimeout)return setTimeout(t,0);if((Te===jn||!Te)&&setTimeout)return Te=setTimeout,setTimeout(t,0);try{return Te(t,0)}catch{try{return Te.call(null,t,0)}catch{return Te.call(this,t,0)}}}o(ra,"runTimeout");function ep(t){if(Fe===clearTimeout)return clearTimeout(t);if((Fe===zn||!Fe)&&clearTimeout)return Fe=clearTimeout,clearTimeout(t);try{return Fe(t)}catch{try{return Fe.call(null,t)}catch{return Fe.call(this,t)}}}o(ep,"runClearTimeout");var Ue=[],Vt=!1,ut,fr=-1;function tp(){!Vt||!ut||(Vt=!1,ut.length?Ue=ut.concat(Ue):fr=-1,Ue.length&&na())}o(tp,"cleanUpNextTick");function na(){if(!Vt){var t=ra(tp);Vt=!0;for(var e=Ue.length;e;){for(ut=Ue,Ue=[];++fr<e;)ut&&ut[fr].run();fr=-1,e=Ue.length}ut=null,Vt=!1,ep(t)}}o(na,"drainQueue");U.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];Ue.push(new oa(t,e)),Ue.length===1&&!Vt&&ra(na)};function oa(t,e){this.fun=t,this.array=e}o(oa,"Item");oa.prototype.run=function(){this.fun.apply(null,this.array)};U.title="browser";U.browser=!0;U.env={};U.argv=[];U.version="";U.versions={};function We(){}o(We,"noop");U.on=We;U.addListener=We;U.once=We;U.off=We;U.removeListener=We;U.removeAllListeners=We;U.emit=We;U.prependListener=We;U.prependOnceListener=We;U.listeners=function(t){return[]};U.binding=function(t){throw new Error("process.binding is not supported")};U.cwd=function(){return"/"};U.chdir=function(t){throw new Error("process.chdir is not supported")};U.umask=function(){return 0}});var Ie=k((ES,_a)=>{"use strict";var{SymbolAsyncIterator:aa,SymbolIterator:la,SymbolFor:ft}=C(),ca=ft("nodejs.stream.destroyed"),ua=ft("nodejs.stream.errored"),Vn=ft("nodejs.stream.readable"),Hn=ft("nodejs.stream.writable"),fa=ft("nodejs.stream.disturbed"),ip=ft("nodejs.webstream.isClosedPromise"),rp=ft("nodejs.webstream.controllerErrorFunction");function dr(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))}o(dr,"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))}o(hr,"isWritableNodeStream");function np(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}o(np,"isDuplexNodeStream");function Pe(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}o(Pe,"isNodeStream");function da(t){return!!(t&&!Pe(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}o(da,"isReadableStream");function ha(t){return!!(t&&!Pe(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}o(ha,"isWritableStream");function pa(t){return!!(t&&!Pe(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}o(pa,"isTransformStream");function op(t){return da(t)||ha(t)||pa(t)}o(op,"isWebStream");function sp(t,e){return t==null?!1:e===!0?typeof t[aa]=="function":e===!1?typeof t[la]=="function":typeof t[aa]=="function"||typeof t[la]=="function"}o(sp,"isIterable");function pr(t){if(!Pe(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[ca]||r!=null&&r.destroyed)}o(pr,"isDestroyed");function ya(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}o(ya,"isWritableEnded");function ap(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)}o(ap,"isWritableFinished");function lp(t){if(!dr(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}o(lp,"isReadableEnded");function ma(t,e){if(!dr(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)}o(ma,"isReadableFinished");function ba(t){return t&&t[Vn]!=null?t[Vn]:typeof t?.readable!="boolean"?null:pr(t)?!1:dr(t)&&t.readable&&!ma(t)}o(ba,"isReadable");function ga(t){return t&&t[Hn]!=null?t[Hn]:typeof t?.writable!="boolean"?null:pr(t)?!1:hr(t)&&t.writable&&!ya(t)}o(ga,"isWritable");function cp(t,e){return Pe(t)?pr(t)?!0:!(e?.readable!==!1&&ba(t)||e?.writable!==!1&&ga(t)):null}o(cp,"isFinished");function up(t){var e,i;return Pe(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(up,"isWritableErrored");function fp(t){var e,i;return Pe(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(fp,"isReadableErrored");function dp(t){if(!Pe(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"&&wa(t)?t._closed:null}o(dp,"isClosed");function wa(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}o(wa,"isOutgoingMessage");function Sa(t){return typeof t._sent100=="boolean"&&wa(t)}o(Sa,"isServerResponse");function hp(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}o(hp,"isServerRequest");function pp(t){if(!Pe(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Sa(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}o(pp,"willEmitClose");function yp(t){var e;return!!(t&&((e=t[fa])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}o(yp,"isDisturbed");function mp(t){var e,i,r,n,s,a,l,c,f,d;return!!(t&&((e=(i=(r=(n=(s=(a=t[ua])!==null&&a!==void 0?a:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}o(mp,"isErrored");_a.exports={isDestroyed:pr,kIsDestroyed:ca,isDisturbed:yp,kIsDisturbed:fa,isErrored:mp,kIsErrored:ua,isReadable:ba,kIsReadable:Vn,kIsClosedPromise:ip,kControllerErrorFunction:rp,kIsWritable:Hn,isClosed:dp,isDuplexNodeStream:np,isFinished:cp,isIterable:sp,isReadableNodeStream:dr,isReadableStream:da,isReadableEnded:lp,isReadableFinished:ma,isReadableErrored:fp,isNodeStream:Pe,isWebStream:op,isWritable:ga,isWritableNodeStream:hr,isWritableStream:ha,isWritableEnded:ya,isWritableFinished:ap,isWritableErrored:up,isServerRequest:hp,isServerResponse:Sa,willEmitClose:pp,isTransformStream:pa}});var qe=k((vS,Jn)=>{var tt=et(),{AbortError:Pa,codes:bp}=ie(),{ERR_INVALID_ARG_TYPE:gp,ERR_STREAM_PREMATURE_CLOSE:Ea}=bp,{kEmptyObject:Yn,once:Gn}=Q(),{validateAbortSignal:wp,validateFunction:Sp,validateObject:_p,validateBoolean:Ep}=zt(),{Promise:xp,PromisePrototypeThen:vp,SymbolDispose:Ia}=C(),{isClosed:Ap,isReadable:xa,isReadableNodeStream:Kn,isReadableStream:kp,isReadableFinished:va,isReadableErrored:Aa,isWritable:ka,isWritableNodeStream:Na,isWritableStream:Np,isWritableFinished:Ta,isWritableErrored:Fa,isNodeStream:Tp,willEmitClose:Fp,kIsClosedPromise:Pp}=Ie(),Ht;function Ip(t){return t.setHeader&&typeof t.abort=="function"}o(Ip,"isRequest");var Xn=o(()=>{},"nop");function La(t,e,i){var r,n;if(arguments.length===2?(i=e,e=Yn):e==null?e=Yn:_p(e,"options"),Sp(i,"callback"),wp(e.signal,"options.signal"),i=Gn(i),kp(t)||Np(t))return Lp(t,e,i);if(!Tp(t))throw new gp("stream",["ReadableStream","WritableStream","Stream"],t);let s=(r=e.readable)!==null&&r!==void 0?r:Kn(t),a=(n=e.writable)!==null&&n!==void 0?n:Na(t),l=t._writableState,c=t._readableState,f=o(()=>{t.writable||b()},"onlegacyfinish"),d=Fp(t)&&Kn(t)===s&&Na(t)===a,h=Ta(t,!1),b=o(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||m)&&i.call(t)},"onfinish"),m=va(t,!1),g=o(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),y=o(q=>{i.call(t,q)},"onerror"),A=Ap(t),w=o(()=>{A=!0;let q=Fa(t)||Aa(t);if(q&&typeof q!="boolean")return i.call(t,q);if(s&&!m&&Kn(t,!0)&&!va(t,!1))return i.call(t,new Ea);if(a&&!h&&!Ta(t,!1))return i.call(t,new Ea);i.call(t)},"onclose"),F=o(()=>{A=!0;let q=Fa(t)||Aa(t);if(q&&typeof q!="boolean")return i.call(t,q);i.call(t)},"onclosed"),O=o(()=>{t.req.on("finish",b)},"onrequest");Ip(t)?(t.on("complete",b),d||t.on("abort",w),t.req?O():t.on("request",O)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",w),t.on("end",g),t.on("finish",b),e.error!==!1&&t.on("error",y),t.on("close",w),A?tt.nextTick(w):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||tt.nextTick(F):(!s&&(!d||xa(t))&&(h||ka(t)===!1)||!a&&(!d||ka(t))&&(m||xa(t)===!1)||c&&t.req&&t.aborted)&&tt.nextTick(F);let v=o(()=>{i=Xn,t.removeListener("aborted",w),t.removeListener("complete",b),t.removeListener("abort",w),t.removeListener("request",O),t.req&&t.req.removeListener("finish",b),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",b),t.removeListener("end",g),t.removeListener("error",y),t.removeListener("close",w)},"cleanup");if(e.signal&&!A){let q=o(()=>{let rt=i;v(),rt.call(t,new Pa(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)tt.nextTick(q);else{Ht=Ht||Q().addAbortListener;let rt=Ht(e.signal,q),ue=i;i=Gn((...St)=>{rt[Ia](),ue.apply(t,St)})}}return v}o(La,"eos");function Lp(t,e,i){let r=!1,n=Xn;if(e.signal)if(n=o(()=>{r=!0,i.call(t,new Pa(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)tt.nextTick(n);else{Ht=Ht||Q().addAbortListener;let a=Ht(e.signal,n),l=i;i=Gn((...c)=>{a[Ia](),l.apply(t,c)})}let s=o((...a)=>{r||tt.nextTick(()=>i.apply(t,a))},"resolverFn");return vp(t[Pp].promise,s,s),Xn}o(Lp,"eosWeb");function Cp(t,e){var i;let r=!1;return e===null&&(e=Yn),(i=e)!==null&&i!==void 0&&i.cleanup&&(Ep(e.cleanup,"cleanup"),r=e.cleanup),new xp((n,s)=>{let a=La(t,e,l=>{r&&a(),l?s(l):n()})})}o(Cp,"finished");Jn.exports=La;Jn.exports.finished=Cp});var dt=k((kS,Wa)=>{"use strict";var Le=et(),{aggregateTwoErrors:Rp,codes:{ERR_MULTIPLE_CALLBACK:Op},AbortError:Bp}=ie(),{Symbol:Oa}=C(),{kIsDestroyed:Dp,isDestroyed:Mp,isFinished:Up,isServerRequest:Wp}=Ie(),Ba=Oa("kDestroy"),Qn=Oa("kConstruct");function Da(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}o(Da,"checkError");function qp(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):(Da(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Ca(this,t,e):this.once(Ba,function(s){Ca(this,Rp(s,t),e)}),this)}o(qp,"destroy");function Ca(t,e,i){let r=!1;function n(s){if(r)return;r=!0;let a=t._readableState,l=t._writableState;Da(s,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(s),s?Le.nextTick($p,t,s):Le.nextTick(Ma,t)}o(n,"onDestroy");try{t._destroy(e||null,n)}catch(s){n(s)}}o(Ca,"_destroy");function $p(t,e){Zn(t,e),Ma(t)}o($p,"emitErrorCloseNT");function Ma(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")}o(Ma,"emitCloseNT");function Zn(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))}o(Zn,"emitErrorNT");function jp(){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)}o(jp,"undestroy");function eo(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?Le.nextTick(Zn,t,e):Zn(t,e))}o(eo,"errorOrDestroy");function zp(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(Qn,e),!(t.listenerCount(Qn)>1)&&Le.nextTick(Vp,t)}o(zp,"construct");function Vp(t){let e=!1;function i(r){if(e){eo(t,r??new Op);return}e=!0;let n=t._readableState,s=t._writableState,a=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),a.destroyed?t.emit(Ba,r):r?eo(t,r,!0):Le.nextTick(Hp,t)}o(i,"onConstruct");try{t._construct(r=>{Le.nextTick(i,r)})}catch(r){Le.nextTick(i,r)}}o(Vp,"constructNT");function Hp(t){t.emit(Qn)}o(Hp,"emitConstructNT");function Ra(t){return t?.setHeader&&typeof t.abort=="function"}o(Ra,"isRequest");function Ua(t){t.emit("close")}o(Ua,"emitCloseLegacy");function Kp(t,e){t.emit("error",e),Le.nextTick(Ua,t)}o(Kp,"emitErrorCloseLegacy");function Yp(t,e){!t||Mp(t)||(!e&&!Up(t)&&(e=new Bp),Wp(t)?(t.socket=null,t.destroy(e)):Ra(t)?t.abort():Ra(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Le.nextTick(Kp,t,e):Le.nextTick(Ua,t),t.destroyed||(t[Dp]=!0))}o(Yp,"destroyer");Wa.exports={construct:zp,destroyer:Yp,destroy:qp,undestroy:jp,errorOrDestroy:eo}});var br=k((TS,$a)=>{"use strict";var{ArrayIsArray:Gp,ObjectSetPrototypeOf:qa}=C(),{EventEmitter:yr}=gi();function mr(t){yr.call(this,t)}o(mr,"Stream");qa(mr.prototype,yr.prototype);qa(mr,yr);mr.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}o(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}o(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let s=!1;function a(){s||(s=!0,t.end())}o(a,"onend");function l(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}o(l,"onclose");function c(d){f(),yr.listenerCount(this,"error")===0&&this.emit("error",d)}o(c,"onerror"),to(i,"error",c),to(t,"error",c);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return o(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function to(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):Gp(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}o(to,"prependListener");$a.exports={Stream:mr,prependListener:to}});var wi=k((PS,gr)=>{"use strict";var{SymbolDispose:Xp}=C(),{AbortError:ja,codes:Jp}=ie(),{isNodeStream:za,isWebStream:Qp,kControllerErrorFunction:Zp}=Ie(),ey=qe(),{ERR_INVALID_ARG_TYPE:Va}=Jp,io,ty=o((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Va(e,"AbortSignal",t)},"validateAbortSignal");gr.exports.addAbortSignal=o(function(e,i){if(ty(e,"signal"),!za(i)&&!Qp(i))throw new Va("stream",["ReadableStream","WritableStream","Stream"],i);return gr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");gr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=za(e)?()=>{e.destroy(new ja(void 0,{cause:t.reason}))}:()=>{e[Zp](new ja(void 0,{cause:t.reason}))};if(t.aborted)i();else{io=io||Q().addAbortListener;let r=io(t,i);ey(e,r[Xp])}return e}});var Ya=k((CS,Ka)=>{"use strict";var{StringPrototypeSlice:Ha,SymbolIterator:iy,TypedArrayPrototypeSet:wr,Uint8Array:ry}=C(),{Buffer:ro}=Me(),{inspect:ny}=Q();Ka.exports=o(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return ro.alloc(0);let i=ro.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)wr(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}*[iy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let s=r.data;if(e>s.length)i+=s,e-=s.length;else{e===s.length?(i+=s,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=Ha(s,0,e),this.head=r,r.data=Ha(s,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=ro.allocUnsafe(e),r=e,n=this.head,s=0;do{let a=n.data;if(e>a.length)wr(i,a,r-e),e-=a.length;else{e===a.length?(wr(i,a,r-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(wr(i,new ry(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return ny(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var Si=k((OS,Qa)=>{"use strict";var{MathFloor:oy,NumberIsInteger:sy}=C(),{validateInteger:ay}=zt(),{ERR_INVALID_ARG_VALUE:ly}=ie().codes,Ga=16*1024,Xa=16;function cy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}o(cy,"highWaterMarkFrom");function Ja(t){return t?Xa:Ga}o(Ja,"getDefaultHighWaterMark");function uy(t,e){ay(e,"value",0),t?Xa=e:Ga=e}o(uy,"setDefaultHighWaterMark");function fy(t,e,i,r){let n=cy(e,r,i);if(n!=null){if(!sy(n)||n<0){let s=r?`options.${i}`:"options.highWaterMark";throw new ly(s,n)}return oy(n)}return Ja(t.objectMode)}o(fy,"getHighWaterMark");Qa.exports={getHighWaterMark:fy,getDefaultHighWaterMark:Ja,setDefaultHighWaterMark:uy}});var tl=k((no,el)=>{var Sr=Me(),Ce=Sr.Buffer;function Za(t,e){for(var i in t)e[i]=t[i]}o(Za,"copyProps");Ce.from&&Ce.alloc&&Ce.allocUnsafe&&Ce.allocUnsafeSlow?el.exports=Sr:(Za(Sr,no),no.Buffer=ht);function ht(t,e,i){return Ce(t,e,i)}o(ht,"SafeBuffer");ht.prototype=Object.create(Ce.prototype);Za(Ce,ht);ht.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ce(t,e,i)};ht.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ce(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};ht.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ce(t)};ht.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Sr.SlowBuffer(t)}});var nl=k(rl=>{"use strict";var so=tl().Buffer,il=so.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 dy(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}}o(dy,"_normalizeEncoding");function hy(t){var e=dy(t);if(typeof e!="string"&&(so.isEncoding===il||!il(t)))throw new Error("Unknown encoding: "+t);return e||t}o(hy,"normalizeEncoding");rl.StringDecoder=_i;function _i(t){this.encoding=hy(t);var e;switch(this.encoding){case"utf16le":this.text=wy,this.end=Sy,e=4;break;case"utf8":this.fillLast=my,e=4;break;case"base64":this.text=_y,this.end=Ey,e=3;break;default:this.write=xy,this.end=vy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=so.allocUnsafe(e)}o(_i,"StringDecoder");_i.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||""};_i.prototype.end=gy;_i.prototype.text=by;_i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function oo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}o(oo,"utf8CheckByte");function py(t,e,i){var r=e.length-1;if(r<i)return 0;var n=oo(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=oo(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=oo(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}o(py,"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"}}o(yy,"utf8CheckExtraBytes");function my(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}o(my,"utf8FillLast");function by(t,e){var i=py(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)}o(by,"utf8Text");function gy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}o(gy,"utf8End");function wy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}o(wy,"utf16Text");function Sy(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}o(Sy,"utf16End");function _y(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))}o(_y,"base64Text");function Ey(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}o(Ey,"base64End");function xy(t){return t.toString(this.encoding)}o(xy,"simpleWrite");function vy(t){return t&&t.length?this.write(t):""}o(vy,"simpleEnd")});var ao=k((WS,ll)=>{"use strict";var ol=et(),{PromisePrototypeThen:Ay,SymbolAsyncIterator:sl,SymbolIterator:al}=C(),{Buffer:ky}=Me(),{ERR_INVALID_ARG_TYPE:Ny,ERR_STREAM_NULL_VALUES:Ty}=ie().codes;function Fy(t,e,i){let r;if(typeof e=="string"||e instanceof ky)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[sl])n=!0,r=e[sl]();else if(e&&e[al])n=!1,r=e[al]();else throw new Ny("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;s._read=function(){a||(a=!0,c())},s._destroy=function(f,d){Ay(l(f),()=>ol.nextTick(d,f),h=>ol.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof r.throw=="function";if(d&&h){let{value:b,done:m}=await r.throw(f);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}o(l,"close");async function c(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Ty;if(s.push(h))continue;a=!1}}catch(f){s.destroy(f)}break}}return o(c,"next"),s}o(Fy,"from");ll.exports=Fy});var xi=k(($S,kl)=>{var _e=et(),{ArrayPrototypeIndexOf:Py,NumberIsInteger:Iy,NumberIsNaN:Ly,NumberParseInt:Cy,ObjectDefineProperties:mo,ObjectKeys:Ry,ObjectSetPrototypeOf:fl,Promise:dl,SafeSet:Oy,SymbolAsyncDispose:By,SymbolAsyncIterator:Dy,Symbol:My}=C();kl.exports=_;_.ReadableState=vr;var{EventEmitter:Uy}=gi(),{Stream:it,prependListener:Wy}=br(),{Buffer:lo}=Me(),{addAbortSignal:qy}=wi(),hl=qe(),E=Q().debuglog("stream",t=>{E=t}),$y=Ya(),Gt=dt(),{getHighWaterMark:jy,getDefaultHighWaterMark:zy}=Si(),{aggregateTwoErrors:cl,codes:{ERR_INVALID_ARG_TYPE:Vy,ERR_METHOD_NOT_IMPLEMENTED:Hy,ERR_OUT_OF_RANGE:Ky,ERR_STREAM_PUSH_AFTER_EOF:Yy,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Gy},AbortError:Xy}=ie(),{validateObject:Jy}=zt(),pt=My("kPaused"),{StringDecoder:pl}=nl(),Qy=ao();fl(_.prototype,it.prototype);fl(_,it);var co=o(()=>{},"nop"),{errorOrDestroy:Kt}=Gt,Yt=1<<0,Zy=1<<1,yl=1<<2,Ei=1<<3,ml=1<<4,_r=1<<5,Er=1<<6,bl=1<<7,em=1<<8,tm=1<<9,im=1<<10,po=1<<11,yo=1<<12,rm=1<<13,nm=1<<14,om=1<<15,gl=1<<16,sm=1<<17,am=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}o(z,"makeBitMapDescriptor");mo(vr.prototype,{objectMode:z(Yt),ended:z(Zy),endEmitted:z(yl),reading:z(Ei),constructed:z(ml),sync:z(_r),needReadable:z(Er),emittedReadable:z(bl),readableListening:z(em),resumeScheduled:z(tm),errorEmitted:z(im),emitClose:z(po),autoDestroy:z(yo),destroyed:z(rm),closed:z(nm),closeEmitted:z(om),multiAwaitDrain:z(gl),readingMore:z(sm),dataEmitted:z(am)});function vr(t,e,i){typeof i!="boolean"&&(i=e instanceof Re()),this.state=po|yo|ml|_r,t&&t.objectMode&&(this.state|=Yt),i&&t&&t.readableObjectMode&&(this.state|=Yt),this.highWaterMark=t?jy(this,t,"readableHighWaterMark",i):zy(!1),this.buffer=new $y,this.length=0,this.pipes=[],this.flowing=null,this[pt]=null,t&&t.emitClose===!1&&(this.state&=~po),t&&t.autoDestroy===!1&&(this.state&=~yo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new pl(t.encoding),this.encoding=t.encoding)}o(vr,"ReadableState");function _(t){if(!(this instanceof _))return new _(t);let e=this instanceof Re();this._readableState=new vr(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&&qy(t.signal,this)),it.call(this,t),Gt.construct(this,()=>{this._readableState.needReadable&&xr(this,this._readableState)})}o(_,"Readable");_.prototype.destroy=Gt.destroy;_.prototype._undestroy=Gt.undestroy;_.prototype._destroy=function(t,e){e(t)};_.prototype[Uy.captureRejectionSymbol]=function(t){this.destroy(t)};_.prototype[By]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Xy,this.destroy(t)),new dl((e,i)=>hl(this,r=>r&&r!==t?i(r):e(null)))};_.prototype.push=function(t,e){return wl(this,t,e,!1)};_.prototype.unshift=function(t,e){return wl(this,t,e,!0)};function wl(t,e,i,r){E("readableAddChunk",e);let n=t._readableState,s;if(n.state&Yt||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=lo.from(e,i).toString(n.encoding):(e=lo.from(e,i),i=""))):e instanceof lo?i="":it._isUint8Array(e)?(e=it._uint8ArrayToBuffer(e),i=""):e!=null&&(s=new Vy("chunk",["string","Buffer","Uint8Array"],e))),s)Kt(t,s);else if(e===null)n.state&=~Ei,um(t,n);else if(n.state&Yt||e&&e.length>0)if(r)if(n.state&yl)Kt(t,new Gy);else{if(n.destroyed||n.errored)return!1;uo(t,n,e,!0)}else if(n.ended)Kt(t,new Yy);else{if(n.destroyed||n.errored)return!1;n.state&=~Ei,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?uo(t,n,e,!1):xr(t,n)):uo(t,n,e,!1)}else r||(n.state&=~Ei,xr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}o(wl,"readableAddChunk");function uo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&gl?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&Er&&Ar(t)),xr(t,e)}o(uo,"addChunk");_.prototype.isPaused=function(){let t=this._readableState;return t[pt]===!0||t.flowing===!1};_.prototype.setEncoding=function(t){let e=new pl(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 lm=1073741824;function cm(t){if(t>lm)throw new Ky("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}o(cm,"computeNewHighWaterMark");function ul(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Yt?1:Ly(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}o(ul,"howMuchToRead");_.prototype.read=function(t){E("read",t),t===void 0?t=NaN:Iy(t)||(t=Cy(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=cm(t)),t!==0&&(e.state&=~bl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return E("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?fo(this):Ar(this),null;if(t=ul(t,e),t===0&&e.ended)return e.length===0&&fo(this),null;let r=(e.state&Er)!==0;if(E("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,E("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,E("reading, ended or constructing",r);else if(r){E("do read"),e.state|=Ei|_r,e.length===0&&(e.state|=Er);try{this._read(e.highWaterMark)}catch(s){Kt(this,s)}e.state&=~_r,e.reading||(t=ul(i,e))}let n;return t>0?n=vl(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&&fo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function um(t,e){if(E("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?Ar(t):(e.needReadable=!1,e.emittedReadable=!0,Sl(t))}}o(um,"onEofChunk");function Ar(t){let e=t._readableState;E("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(E("emitReadable",e.flowing),e.emittedReadable=!0,_e.nextTick(Sl,t))}o(Ar,"emitReadable");function Sl(t){let e=t._readableState;E("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,El(t)}o(Sl,"emitReadable_");function xr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,_e.nextTick(fm,t,e))}o(xr,"maybeReadMore");function fm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(E("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}o(fm,"maybeReadMore_");_.prototype._read=function(t){throw new Hy("_read()")};_.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new Oy(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),E("pipe count=%d opts=%j",r.pipes.length,e);let s=(!e||e.end!==!1)&&t!==_e.stdout&&t!==_e.stderr?l:A;r.endEmitted?_e.nextTick(s):i.once("end",s),t.on("unpipe",a);function a(w,F){E("onunpipe"),w===i&&F&&F.hasUnpiped===!1&&(F.hasUnpiped=!0,d())}o(a,"onunpipe");function l(){E("onend"),t.end()}o(l,"onend");let c,f=!1;function d(){E("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",A),i.removeListener("data",b),f=!0,c&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}o(d,"cleanup");function h(){f||(r.pipes.length===1&&r.pipes[0]===t?(E("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(E("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),c||(c=dm(i,t),t.on("drain",c))}o(h,"pause"),i.on("data",b);function b(w){E("ondata");let F=t.write(w);E("dest.write",F),F===!1&&h()}o(b,"ondata");function m(w){if(E("onerror",w),A(),t.removeListener("error",m),t.listenerCount("error")===0){let F=t._writableState||t._readableState;F&&!F.errorEmitted?Kt(t,w):t.emit("error",w)}}o(m,"onerror"),Wy(t,"error",m);function g(){t.removeListener("finish",y),A()}o(g,"onclose"),t.once("close",g);function y(){E("onfinish"),t.removeListener("close",g),A()}o(y,"onfinish"),t.once("finish",y);function A(){E("unpipe"),i.unpipe(t)}return o(A,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(E("pipe resume"),i.resume()),t};function dm(t,e){return o(function(){let r=t._readableState;r.awaitDrainWriters===e?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}o(dm,"pipeOnDrain");_.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 s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let r=Py(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};_.prototype.on=function(t,e){let i=it.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,E("on readable",r.length,r.reading),r.length?Ar(this):r.reading||_e.nextTick(hm,this)),i};_.prototype.addListener=_.prototype.on;_.prototype.removeListener=function(t,e){let i=it.prototype.removeListener.call(this,t,e);return t==="readable"&&_e.nextTick(_l,this),i};_.prototype.off=_.prototype.removeListener;_.prototype.removeAllListeners=function(t){let e=it.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&_e.nextTick(_l,this),e};function _l(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[pt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}o(_l,"updateReadableListening");function hm(t){E("readable nexttick read 0"),t.read(0)}o(hm,"nReadingNextTick");_.prototype.resume=function(){let t=this._readableState;return t.flowing||(E("resume"),t.flowing=!t.readableListening,pm(this,t)),t[pt]=!1,this};function pm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,_e.nextTick(ym,t,e))}o(pm,"resume");function ym(t,e){E("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),El(t),e.flowing&&!e.reading&&t.read(0)}o(ym,"resume_");_.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[pt]=!0,this};function El(t){let e=t._readableState;for(E("flow",e.flowing);e.flowing&&t.read()!==null;);}o(El,"flow");_.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=>{Kt(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Ry(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};_.prototype[Dy]=function(){return xl(this)};_.prototype.iterator=function(t){return t!==void 0&&Jy(t,"options"),xl(this,t)};function xl(t,e){typeof t.read!="function"&&(t=_.wrap(t,{objectMode:!0}));let i=mm(t,e);return i.stream=t,i}o(xl,"streamToAsyncIterator");async function*mm(t,e){let i=co;function r(a){this===t?(i(),i=co):i=a}o(r,"next"),t.on("readable",r);let n,s=hl(t,{writable:!1},a=>{n=a?cl(n,a):null,i(),i=co});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 dl(r)}}}catch(a){throw n=cl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?Gt.destroyer(t,null):(t.off("readable",r),s())}}o(mm,"createAsyncIterator");mo(_.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});mo(vr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[pt]!==!1},set(t){this[pt]=!!t}}});_._fromList=vl;function vl(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}o(vl,"fromList");function fo(t){let e=t._readableState;E("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,_e.nextTick(bm,e,t))}o(fo,"endReadable");function bm(t,e){if(E("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)_e.nextTick(gm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}o(bm,"endReadableNT");function gm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}o(gm,"endWritableNT");_.from=function(t,e){return Qy(_,t,e)};var ho;function Al(){return ho===void 0&&(ho={}),ho}o(Al,"lazyWebStreams");_.fromWeb=function(t,e){return Al().newStreamReadableFromReadableStream(t,e)};_.toWeb=function(t,e){return Al().newReadableStreamFromStreamReadable(t,e)};_.wrap=function(t,e){var i,r;return new _({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,s){Gt.destroyer(t,n),s(n)}}).wrap(t)}});var Pr=k((zS,Ml)=>{var yt=et(),{ArrayPrototypeSlice:Fl,Error:wm,FunctionPrototypeSymbolHasInstance:Pl,ObjectDefineProperty:Il,ObjectDefineProperties:Sm,ObjectSetPrototypeOf:Ll,StringPrototypeToLowerCase:_m,Symbol:Em,SymbolHasInstance:xm}=C();Ml.exports=R;R.WritableState=ki;var{EventEmitter:vm}=gi(),vi=br().Stream,{Buffer:kr}=Me(),Fr=dt(),{addAbortSignal:Am}=wi(),{getHighWaterMark:km,getDefaultHighWaterMark:Nm}=Si(),{ERR_INVALID_ARG_TYPE:Tm,ERR_METHOD_NOT_IMPLEMENTED:Fm,ERR_MULTIPLE_CALLBACK:Cl,ERR_STREAM_CANNOT_PIPE:Pm,ERR_STREAM_DESTROYED:Ai,ERR_STREAM_ALREADY_FINISHED:Im,ERR_STREAM_NULL_VALUES:Lm,ERR_STREAM_WRITE_AFTER_END:Cm,ERR_UNKNOWN_ENCODING:Rl}=ie().codes,{errorOrDestroy:Xt}=Fr;Ll(R.prototype,vi.prototype);Ll(R,vi);function wo(){}o(wo,"nop");var Jt=Em("kOnFinished");function ki(t,e,i){typeof i!="boolean"&&(i=e instanceof Re()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?km(this,t,"writableHighWaterMark",i):Nm(!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=Om.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Tr(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[Jt]=[]}o(ki,"WritableState");function Tr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}o(Tr,"resetBuffer");ki.prototype.getBuffer=o(function(){return Fl(this.buffered,this.bufferedIndex)},"getBuffer");Il(ki.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function R(t){let e=this instanceof Re();if(!e&&!Pl(R,this))return new R(t);this._writableState=new ki(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Am(t.signal,this)),vi.call(this,t),Fr.construct(this,()=>{let i=this._writableState;i.writing||_o(this,i),Eo(this,i)})}o(R,"Writable");Il(R,xm,{__proto__:null,value:function(t){return Pl(this,t)?!0:this!==R?!1:t&&t._writableState instanceof ki}});R.prototype.pipe=function(){Xt(this,new Pm)};function Ol(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"&&!kr.isEncoding(i))throw new Rl(i);typeof r!="function"&&(r=wo)}if(e===null)throw new Lm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=kr.from(e,i),i="buffer");else if(e instanceof kr)i="buffer";else if(vi._isUint8Array(e))e=vi._uint8ArrayToBuffer(e),i="buffer";else throw new Tm("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new Cm:n.destroyed&&(s=new Ai("write")),s?(yt.nextTick(r,s),Xt(t,s,!0),s):(n.pendingcb++,Rm(t,n,e,i,r))}o(Ol,"_write");R.prototype.write=function(t,e,i){return Ol(this,t,e,i)===!0};R.prototype.cork=function(){this._writableState.corked++};R.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||_o(this,t))};R.prototype.setDefaultEncoding=o(function(e){if(typeof e=="string"&&(e=_m(e)),!kr.isEncoding(e))throw new Rl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Rm(t,e,i,r,n){let s=e.objectMode?1:i.length;e.length+=s;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!==wo&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}o(Rm,"writeOrBuffer");function Nl(t,e,i,r,n,s,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Ai("write")):i?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}o(Nl,"doWrite");function Tl(t,e,i,r){--e.pendingcb,r(i),So(e),Xt(t,i)}o(Tl,"onwriteError");function Om(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){Xt(t,new Cl);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?yt.nextTick(Tl,t,i,e,n):Tl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&_o(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},yt.nextTick(Bm,i.afterWriteTickInfo)):Bl(t,i,1,n))}o(Om,"onwrite");function Bm({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Bl(t,e,i,r)}o(Bm,"afterWriteTick");function Bl(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&&So(e),Eo(t,e)}o(Bl,"afterWrite");function So(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:a}=t.buffered[n],l=t.objectMode?1:s.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Ai("write"))}let i=t[Jt].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Ai("end"))}Tr(t)}o(So,"errorBuffer");function _o(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,s=i.length-r;if(!s)return;let a=r;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let l=e.allNoop?wo:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},c=e.allNoop&&a===0?i:Fl(i,a);c.allBuffers=e.allBuffers,Nl(t,e,!0,e.length,c,"",l),Tr(e)}else{do{let{chunk:l,encoding:c,callback:f}=i[a];i[a++]=null;let d=n?1:l.length;Nl(t,e,!1,d,l,c,f)}while(a<i.length&&!e.writing);a===i.length?Tr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}o(_o,"clearBuffer");R.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Fm("_write()")};R.prototype._writev=null;R.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 s=Ol(this,t,e);s instanceof wm&&(n=s)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Eo(this,r,!0),r.ended=!0):r.finished?n=new Im("end"):r.destroyed&&(n=new Ai("end"))),typeof i=="function"&&(n||r.finished?yt.nextTick(i,n):r[Jt].push(i)),this};function Nr(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}o(Nr,"needFinish");function Dm(t,e){let i=!1;function r(n){if(i){Xt(t,n??Cl());return}if(i=!0,e.pendingcb--,n){let s=e[Jt].splice(0);for(let a=0;a<s.length;a++)s[a](n);Xt(t,n,e.sync)}else Nr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,yt.nextTick(go,t,e))}o(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}o(Dm,"callFinal");function Mm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Dm(t,e)):(e.prefinished=!0,t.emit("prefinish")))}o(Mm,"prefinish");function Eo(t,e,i){Nr(e)&&(Mm(t,e),e.pendingcb===0&&(i?(e.pendingcb++,yt.nextTick((r,n)=>{Nr(n)?go(r,n):n.pendingcb--},t,e)):Nr(e)&&(e.pendingcb++,go(t,e))))}o(Eo,"finishMaybe");function go(t,e){e.pendingcb--,e.finished=!0;let i=e[Jt].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()}}o(go,"finish");Sm(R.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Um=Fr.destroy;R.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Jt].length)&&yt.nextTick(So,i),Um.call(this,t,e),this};R.prototype._undestroy=Fr.undestroy;R.prototype._destroy=function(t,e){e(t)};R.prototype[vm.captureRejectionSymbol]=function(t){this.destroy(t)};var bo;function Dl(){return bo===void 0&&(bo={}),bo}o(Dl,"lazyWebStreams");R.fromWeb=function(t,e){return Dl().newStreamWritableFromWritableStream(t,e)};R.toWeb=function(t){return Dl().newWritableStreamFromStreamWritable(t)}});var Zl=k((HS,Ql)=>{var xo=et(),Wm=Me(),{isReadable:qm,isWritable:$m,isIterable:Ul,isNodeStream:jm,isReadableNodeStream:Wl,isWritableNodeStream:ql,isDuplexNodeStream:zm,isReadableStream:$l,isWritableStream:jl}=Ie(),zl=qe(),{AbortError:Xl,codes:{ERR_INVALID_ARG_TYPE:Vm,ERR_INVALID_RETURN_VALUE:Vl}}=ie(),{destroyer:Zt}=dt(),Hm=Re(),Jl=xi(),Km=Pr(),{createDeferredPromise:Hl}=Q(),Kl=ao(),Yl=globalThis.Blob||Wm.Blob,Ym=o(typeof Yl<"u"?function(e){return e instanceof Yl}:function(e){return!1},"isBlob"),Gm=globalThis.AbortController||qt().AbortController,{FunctionPrototypeCall:Gl}=C(),$e=class extends Hm{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)}};o($e,"Duplexify");Ql.exports=o(function t(e,i){if(zm(e))return e;if(Wl(e))return Qt({readable:e});if(ql(e))return Qt({writable:e});if(jm(e))return Qt({writable:!1,readable:!1});if($l(e))return Qt({readable:Jl.fromWeb(e)});if(jl(e))return Qt({writable:Km.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:a,destroy:l}=Xm(e);if(Ul(n))return Kl($e,n,{objectMode:!0,write:s,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let f,d=Gl(c,n,h=>{if(h!=null)throw new Vl("nully","body",h)},h=>{Zt(f,h)});return f=new $e({objectMode:!0,readable:!1,write:s,final(h){a(async()=>{try{await d,xo.nextTick(h,null)}catch(b){xo.nextTick(h,b)}})},destroy:l})}throw new Vl("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Ym(e))return t(e.arrayBuffer());if(Ul(e))return Kl($e,e,{objectMode:!0,writable:!1});if($l(e?.readable)&&jl(e?.writable))return $e.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Wl(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?ql(e?.writable)?e?.writable:t(e.writable):void 0;return Qt({readable:n,writable:s})}let r=e?.then;if(typeof r=="function"){let n;return Gl(r,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{Zt(n,s)}),n=new $e({objectMode:!0,writable:!1,read(){}})}throw new Vm(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function Xm(t){let{promise:e,resolve:i}=Hl(),r=new Gm,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:f}=await a;if(xo.nextTick(f),c)return;if(n.aborted)throw new Xl(void 0,{cause:n.reason});({promise:e,resolve:i}=Hl()),yield l}}(),{signal:n}),write(a,l,c){let f=i;i=null,f({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}o(Xm,"fromAsyncGen");function Qt(t){let e=t.readable&&typeof t.readable.read!="function"?Jl.wrap(t.readable):t.readable,i=t.writable,r=!!qm(e),n=!!$m(i),s,a,l,c,f;function d(h){let b=c;c=null,b?b(h):h&&f.destroy(h)}return o(d,"onfinished"),f=new $e({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(zl(i,h=>{n=!1,h&&Zt(e,h),d(h)}),f._write=function(h,b,m){i.write(h,b)?m():s=m},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(s){let h=s;s=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(zl(e,h=>{r=!1,h&&Zt(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&c!==null&&(h=new Xl),l=null,s=null,a=null,c===null?b(h):(c=b,Zt(i,h),Zt(e,h))},f}o(Qt,"_duplexify")});var Re=k((YS,ic)=>{"use strict";var{ObjectDefineProperties:Jm,ObjectGetOwnPropertyDescriptor:je,ObjectKeys:Qm,ObjectSetPrototypeOf:ec}=C();ic.exports=Ee;var ko=xi(),me=Pr();ec(Ee.prototype,ko.prototype);ec(Ee,ko);{let t=Qm(me.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ee.prototype[i]||(Ee.prototype[i]=me.prototype[i])}}function Ee(t){if(!(this instanceof Ee))return new Ee(t);ko.call(this,t),me.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}o(Ee,"Duplex");Jm(Ee.prototype,{writable:{__proto__:null,...je(me.prototype,"writable")},writableHighWaterMark:{__proto__:null,...je(me.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...je(me.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...je(me.prototype,"writableBuffer")},writableLength:{__proto__:null,...je(me.prototype,"writableLength")},writableFinished:{__proto__:null,...je(me.prototype,"writableFinished")},writableCorked:{__proto__:null,...je(me.prototype,"writableCorked")},writableEnded:{__proto__:null,...je(me.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...je(me.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var vo;function tc(){return vo===void 0&&(vo={}),vo}o(tc,"lazyWebStreams");Ee.fromWeb=function(t,e){return tc().newStreamDuplexFromReadableWritablePair(t,e)};Ee.toWeb=function(t){return tc().newReadableWritablePairFromDuplex(t)};var Ao;Ee.from=function(t){return Ao||(Ao=Zl()),Ao(t,"body")}});var Fo=k((XS,nc)=>{"use strict";var{ObjectSetPrototypeOf:rc,Symbol:Zm}=C();nc.exports=ze;var{ERR_METHOD_NOT_IMPLEMENTED:eb}=ie().codes,To=Re(),{getHighWaterMark:tb}=Si();rc(ze.prototype,To.prototype);rc(ze,To);var Ni=Zm("kCallback");function ze(t){if(!(this instanceof ze))return new ze(t);let e=t?tb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),To.call(this,t),this._readableState.sync=!1,this[Ni]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",ib)}o(ze,"Transform");function No(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())}o(No,"final");function ib(){this._final!==No&&No.call(this)}o(ib,"prefinish");ze.prototype._final=No;ze.prototype._transform=function(t,e,i){throw new eb("_transform()")};ze.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,s=r.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),n.ended||s===r.length||r.length<r.highWaterMark?i():this[Ni]=i})};ze.prototype._read=function(){if(this[Ni]){let t=this[Ni];this[Ni]=null,t()}}});var Io=k((QS,sc)=>{"use strict";var{ObjectSetPrototypeOf:oc}=C();sc.exports=ei;var Po=Fo();oc(ei.prototype,Po.prototype);oc(ei,Po);function ei(t){if(!(this instanceof ei))return new ei(t);Po.call(this,t)}o(ei,"PassThrough");ei.prototype._transform=function(t,e,i){i(null,t)}});var Rr=k((e_,fc)=>{var Ti=et(),{ArrayIsArray:rb,Promise:nb,SymbolAsyncIterator:ob,SymbolDispose:sb}=C(),Cr=qe(),{once:ab}=Q(),lb=dt(),ac=Re(),{aggregateTwoErrors:cb,codes:{ERR_INVALID_ARG_TYPE:Wo,ERR_INVALID_RETURN_VALUE:Lo,ERR_MISSING_ARGS:ub,ERR_STREAM_DESTROYED:fb,ERR_STREAM_PREMATURE_CLOSE:db},AbortError:hb}=ie(),{validateFunction:pb,validateAbortSignal:yb}=zt(),{isIterable:mt,isReadable:Co,isReadableNodeStream:Lr,isNodeStream:lc,isTransformStream:ti,isWebStream:mb,isReadableStream:Ro,isReadableFinished:bb}=Ie(),gb=globalThis.AbortController||qt().AbortController,Oo,Bo,Do;function cc(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=Cr(t,{readable:e,writable:i},s=>{r=!s});return{destroy:s=>{r||(r=!0,lb.destroyer(t,s||new fb("pipe")))},cleanup:n}}o(cc,"destroyer");function wb(t){return pb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}o(wb,"popCallback");function Mo(t){if(mt(t))return t;if(Lr(t))return Sb(t);throw new Wo("val",["Readable","Iterable","AsyncIterable"],t)}o(Mo,"makeAsyncIterable");async function*Sb(t){Bo||(Bo=xi()),yield*Bo.prototype[ob].call(t)}o(Sb,"fromReadable");async function Ir(t,e,i,{end:r}){let n,s=null,a=o(f=>{if(f&&(n=f),s){let d=s;s=null,d()}},"resume"),l=o(()=>new nb((f,d)=>{n?d(n):s=o(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let c=Cr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();r&&(e.end(),await l()),i()}catch(f){i(n!==f?cb(n,f):f)}finally{c(),e.off("drain",a)}}o(Ir,"pumpToNode");async function Uo(t,e,i,{end:r}){ti(e)&&(e=e.writable);let n=e.getWriter();try{for await(let s of t)await n.ready,n.write(s).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(s){try{await n.abort(s),i(s)}catch(a){i(a)}}}o(Uo,"pumpToWeb");function _b(...t){return uc(t,ab(wb(t)))}o(_b,"pipeline");function uc(t,e,i){if(t.length===1&&rb(t[0])&&(t=t[0]),t.length<2)throw new ub("streams");let r=new gb,n=r.signal,s=i?.signal,a=[];yb(s,"options.signal");function l(){g(new hb)}o(l,"abort"),Do=Do||Q().addAbortListener;let c;s&&(c=Do(s,l));let f,d,h=[],b=0;function m(O){g(O,--b===0)}o(m,"finish");function g(O,v){var q;if(O&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=O),!(!f&&!v)){for(;h.length;)h.shift()(f);(q=c)===null||q===void 0||q[sb](),r.abort(),v&&(f||a.forEach(rt=>rt()),Ti.nextTick(e,f,d))}}o(g,"finishImpl");let y;for(let O=0;O<t.length;O++){let v=t[O],q=O<t.length-1,rt=O>0,ue=q||i?.end!==!1,St=O===t.length-1;if(lc(v)){let re=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Be)};var F=re;if(o(re,"onError"),ue){let{destroy:Be,cleanup:Gr}=cc(v,q,rt);h.push(Be),Co(v)&&St&&a.push(Gr)}v.on("error",re),Co(v)&&St&&a.push(()=>{v.removeListener("error",re)})}if(O===0)if(typeof v=="function"){if(y=v({signal:n}),!mt(y))throw new Lo("Iterable, AsyncIterable or Stream","source",y)}else mt(v)||Lr(v)||ti(v)?y=v:y=ac.from(v);else if(typeof v=="function"){if(ti(y)){var A;y=Mo((A=y)===null||A===void 0?void 0:A.readable)}else y=Mo(y);if(y=v(y,{signal:n}),q){if(!mt(y,!0))throw new Lo("AsyncIterable",`transform[${O-1}]`,y)}else{var w;Oo||(Oo=Io());let re=new Oo({objectMode:!0}),Be=(w=y)===null||w===void 0?void 0:w.then;if(typeof Be=="function")b++,Be.call(y,He=>{d=He,He!=null&&re.write(He),ue&&re.end(),Ti.nextTick(m)},He=>{re.destroy(He),Ti.nextTick(m,He)});else if(mt(y,!0))b++,Ir(y,re,m,{end:ue});else if(Ro(y)||ti(y)){let He=y.readable||y;b++,Ir(He,re,m,{end:ue})}else throw new Lo("AsyncIterable or Promise","destination",y);y=re;let{destroy:Gr,cleanup:qc}=cc(y,!1,!0);h.push(Gr),St&&a.push(qc)}}else if(lc(v)){if(Lr(y)){b+=2;let re=Eb(y,v,m,{end:ue});Co(v)&&St&&a.push(re)}else if(ti(y)||Ro(y)){let re=y.readable||y;b++,Ir(re,v,m,{end:ue})}else if(mt(y))b++,Ir(y,v,m,{end:ue});else throw new Wo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=v}else if(mb(v)){if(Lr(y))b++,Uo(Mo(y),v,m,{end:ue});else if(Ro(y)||mt(y))b++,Uo(y,v,m,{end:ue});else if(ti(y))b++,Uo(y.readable,v,m,{end:ue});else throw new Wo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=v}else y=ac.from(v)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&Ti.nextTick(l),y}o(uc,"pipelineImpl");function Eb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new db)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var s=a;o(a,"endFn"),bb(t)?Ti.nextTick(a):t.once("end",a)}else i();return Cr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),Cr(e,{readable:!1,writable:!0},i)}o(Eb,"pipe");fc.exports={pipelineImpl:uc,pipeline:_b}});var $o=k((i_,bc)=>{"use strict";var{pipeline:xb}=Rr(),Or=Re(),{destroyer:vb}=dt(),{isNodeStream:Br,isReadable:dc,isWritable:hc,isWebStream:qo,isTransformStream:bt,isWritableStream:pc,isReadableStream:yc}=Ie(),{AbortError:Ab,codes:{ERR_INVALID_ARG_VALUE:mc,ERR_MISSING_ARGS:kb}}=ie(),Nb=qe();bc.exports=o(function(...e){if(e.length===0)throw new kb("streams");if(e.length===1)return Or.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=Or.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=Or.from(e[m])}for(let m=0;m<e.length;++m)if(!(!Br(e[m])&&!qo(e[m]))){if(m<e.length-1&&!(dc(e[m])||yc(e[m])||bt(e[m])))throw new mc(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(hc(e[m])||pc(e[m])||bt(e[m])))throw new mc(`streams[${m}]`,i[m],"must be writable")}let r,n,s,a,l;function c(m){let g=a;a=null,g?g(m):m?l.destroy(m):!b&&!h&&l.destroy()}o(c,"onfinished");let f=e[0],d=xb(e,c),h=!!(hc(f)||pc(f)||bt(f)),b=!!(dc(d)||yc(d)||bt(d));if(l=new Or({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Br(f))l._write=function(g,y,A){f.write(g,y)?A():r=A},l._final=function(g){f.end(),n=g},f.on("drain",function(){if(r){let g=r;r=null,g()}});else if(qo(f)){let y=(bt(f)?f.writable:f).getWriter();l._write=async function(A,w,F){try{await y.ready,y.write(A).catch(()=>{}),F()}catch(O){F(O)}},l._final=async function(A){try{await y.ready,y.close().catch(()=>{}),n=A}catch(w){A(w)}}}let m=bt(d)?d.readable:d;Nb(m,()=>{if(n){let g=n;n=null,g()}})}if(b){if(Br(d))d.on("readable",function(){if(s){let m=s;s=null,m()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=d.read();if(m===null){s=l._read;return}if(!l.push(m))return}};else if(qo(d)){let g=(bt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:y,done:A}=await g.read();if(!l.push(y))return;if(A){l.push(null);return}}catch{return}}}}return l._destroy=function(m,g){!m&&a!==null&&(m=new Ab),s=null,r=null,n=null,a===null?g(m):(a=g,Br(d)&&vb(d,m))},l},"compose")});var Nc=k((n_,zo)=>{"use strict";var Tb=globalThis.AbortController||qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Fb,ERR_INVALID_ARG_TYPE:Fi,ERR_MISSING_ARGS:Pb,ERR_OUT_OF_RANGE:Ib},AbortError:Oe}=ie(),{validateAbortSignal:gt,validateInteger:gc,validateObject:wt}=zt(),Lb=C().Symbol("kWeak"),Cb=C().Symbol("kResistStopPropagation"),{finished:Rb}=qe(),Ob=$o(),{addAbortSignalNoValidate:Bb}=wi(),{isWritable:Db,isNodeStream:Mb}=Ie(),{deprecate:Ub}=Q(),{ArrayPrototypePush:Wb,Boolean:qb,MathFloor:wc,Number:$b,NumberIsNaN:jb,Promise:Sc,PromiseReject:_c,PromiseResolve:zb,PromisePrototypeThen:Ec,Symbol:vc}=C(),Mr=vc("kEmpty"),xc=vc("kEof");function Vb(t,e){if(e!=null&&wt(e,"options"),e?.signal!=null&>(e.signal,"options.signal"),Mb(t)&&!Db(t))throw new Fb("stream",t,"must be writable");let i=Ob(this,t);return e!=null&&e.signal&&Bb(e.signal,i),i}o(Vb,"compose");function Ur(t,e){if(typeof t!="function")throw new Fi("fn",["Function","AsyncFunction"],t);e!=null&&wt(e,"options"),e?.signal!=null&>(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=wc(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=wc(e.highWaterMark)),gc(i,"options.concurrency",1),gc(r,"options.highWaterMark",0),r+=i,o(async function*(){let s=Q().AbortSignalAny([e?.signal].filter(qb)),a=this,l=[],c={signal:s},f,d,h=!1,b=0;function m(){h=!0,g()}o(m,"onCatch");function g(){b-=1,y()}o(g,"afterItemProcessed");function y(){d&&!h&&b<i&&l.length<r&&(d(),d=null)}o(y,"maybeResume");async function A(){try{for await(let w of a){if(h)return;if(s.aborted)throw new Oe;try{if(w=t(w,c),w===Mr)continue;w=zb(w)}catch(F){w=_c(F)}b+=1,Ec(w,g,m),l.push(w),f&&(f(),f=null),!h&&(l.length>=r||b>=i)&&await new Sc(F=>{d=F})}l.push(xc)}catch(w){let F=_c(w);Ec(F,g,m),l.push(F)}finally{h=!0,f&&(f(),f=null)}}o(A,"pump"),A();try{for(;;){for(;l.length>0;){let w=await l[0];if(w===xc)return;if(s.aborted)throw new Oe;w!==Mr&&(yield w),l.shift(),y()}await new Sc(w=>{f=w})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}o(Ur,"map");function Hb(t=void 0){return t!=null&&wt(t,"options"),t?.signal!=null&>(t.signal,"options.signal"),o(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 Oe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}o(Hb,"asIndexedPairs");async function Ac(t,e=void 0){for await(let i of jo.call(this,t,e))return!0;return!1}o(Ac,"some");async function Kb(t,e=void 0){if(typeof t!="function")throw new Fi("fn",["Function","AsyncFunction"],t);return!await Ac.call(this,async(...i)=>!await t(...i),e)}o(Kb,"every");async function Yb(t,e){for await(let i of jo.call(this,t,e))return i}o(Yb,"find");async function Gb(t,e){if(typeof t!="function")throw new Fi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),Mr}o(i,"forEachFn");for await(let r of Ur.call(this,i,e));}o(Gb,"forEach");function jo(t,e){if(typeof t!="function")throw new Fi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:Mr}return o(i,"filterFn"),Ur.call(this,i,e)}o(jo,"filter");var Dr=class extends Pb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};o(Dr,"ReduceAwareErrMissingArgs");async function Xb(t,e,i){var r;if(typeof t!="function")throw new Fi("reducer",["Function","AsyncFunction"],t);i!=null&&wt(i,"options"),i?.signal!=null&>(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new Oe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Rb(this.destroy(f)),f}let s=new Tb,a=s.signal;if(i!=null&&i.signal){let f={once:!0,[Lb]:this,[Cb]:!0};i.signal.addEventListener("abort",()=>s.abort(),f)}let l=!1;try{for await(let f of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Oe;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new Dr}finally{s.abort()}return e}o(Xb,"reduce");async function Jb(t){t!=null&&wt(t,"options"),t?.signal!=null&>(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 Oe(void 0,{cause:t.signal.reason});Wb(e,r)}return e}o(Jb,"toArray");function Qb(t,e){let i=Ur.call(this,t,e);return o(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}o(Qb,"flatMap");function kc(t){if(t=$b(t),jb(t))return 0;if(t<0)throw new Ib("number",">= 0",t);return t}o(kc,"toIntegerOrInfinity");function Zb(t,e=void 0){return e!=null&&wt(e,"options"),e?.signal!=null&>(e.signal,"options.signal"),t=kc(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Oe;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;t--<=0&&(yield s)}},"drop").call(this)}o(Zb,"drop");function eg(t,e=void 0){return e!=null&&wt(e,"options"),e?.signal!=null&>(e.signal,"options.signal"),t=kc(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Oe;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;if(t-- >0&&(yield s),t<=0)return}},"take").call(this)}o(eg,"take");zo.exports.streamReturningOperators={asIndexedPairs:Ub(Hb,"readable.asIndexedPairs will be removed in a future version."),drop:Zb,filter:jo,flatMap:Qb,map:Ur,take:eg,compose:Vb};zo.exports.promiseReturningOperators={every:Kb,forEach:Gb,reduce:Xb,toArray:Jb,some:Ac,find:Yb}});var Vo=k((s_,Tc)=>{"use strict";var{ArrayPrototypePop:tg,Promise:ig}=C(),{isIterable:rg,isNodeStream:ng,isWebStream:og}=Ie(),{pipelineImpl:sg}=Rr(),{finished:ag}=qe();Ho();function lg(...t){return new ig((e,i)=>{let r,n,s=t[t.length-1];if(s&&typeof s=="object"&&!ng(s)&&!rg(s)&&!og(s)){let a=tg(t);r=a.signal,n=a.end}sg(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}o(lg,"pipeline");Tc.exports={finished:ag,pipeline:lg}});var Ho=k((l_,Dc)=>{var{Buffer:cg}=Me(),{ObjectDefineProperty:Ve,ObjectKeys:Ic,ReflectApply:Lc}=C(),{promisify:{custom:Cc}}=Q(),{streamReturningOperators:Fc,promiseReturningOperators:Pc}=Nc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Rc}}=ie(),ug=$o(),{setDefaultHighWaterMark:fg,getDefaultHighWaterMark:dg}=Si(),{pipeline:Oc}=Rr(),{destroyer:hg}=dt(),Bc=qe(),Ko=Vo(),Pi=Ie(),L=Dc.exports=br().Stream;L.isDestroyed=Pi.isDestroyed;L.isDisturbed=Pi.isDisturbed;L.isErrored=Pi.isErrored;L.isReadable=Pi.isReadable;L.isWritable=Pi.isWritable;L.Readable=xi();for(let t of Ic(Fc)){let i=function(...r){if(new.target)throw Rc();return L.Readable.from(Lc(e,this,r))};yg=i,o(i,"fn");let e=Fc[t];Ve(i,"name",{__proto__:null,value:e.name}),Ve(i,"length",{__proto__:null,value:e.length}),Ve(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var yg;for(let t of Ic(Pc)){let i=function(...n){if(new.target)throw Rc();return Lc(e,this,n)};yg=i,o(i,"fn");let e=Pc[t];Ve(i,"name",{__proto__:null,value:e.name}),Ve(i,"length",{__proto__:null,value:e.length}),Ve(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var yg;L.Writable=Pr();L.Duplex=Re();L.Transform=Fo();L.PassThrough=Io();L.pipeline=Oc;var{addAbortSignal:pg}=wi();L.addAbortSignal=pg;L.finished=Bc;L.destroy=hg;L.compose=ug;L.setDefaultHighWaterMark=fg;L.getDefaultHighWaterMark=dg;Ve(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Ko}});Ve(Oc,Cc,{__proto__:null,enumerable:!0,get(){return Ko.pipeline}});Ve(Bc,Cc,{__proto__:null,enumerable:!0,get(){return Ko.finished}});L.Stream=L;L._isUint8Array=o(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=o(function(e){return cg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Mc=k((u_,W)=>{"use strict";var V=Ho(),mg=Vo(),bg=V.Readable.destroy;W.exports=V.Readable;W.exports._uint8ArrayToBuffer=V._uint8ArrayToBuffer;W.exports._isUint8Array=V._isUint8Array;W.exports.isDisturbed=V.isDisturbed;W.exports.isErrored=V.isErrored;W.exports.isReadable=V.isReadable;W.exports.Readable=V.Readable;W.exports.Writable=V.Writable;W.exports.Duplex=V.Duplex;W.exports.Transform=V.Transform;W.exports.PassThrough=V.PassThrough;W.exports.addAbortSignal=V.addAbortSignal;W.exports.finished=V.finished;W.exports.destroy=V.destroy;W.exports.destroy=bg;W.exports.pipeline=V.pipeline;W.exports.compose=V.compose;Object.defineProperty(V,"promises",{configurable:!0,enumerable:!0,get(){return mg}});W.exports.Stream=V.Stream;W.exports.default=W.exports});var Eg={};Ri(Eg,{ActionType:()=>ji,ApiError:()=>u,Async:()=>Qr,AsyncFile:()=>ni,AsyncMirror:()=>Yo,AsyncStoreFileSystem:()=>Yr,BigIntStats:()=>G,Cred:()=>$,ErrorCode:()=>J,ErrorStrings:()=>Xr,File:()=>ai,FileFlag:()=>P,FileSystem:()=>ee,FileType:()=>B,InMemory:()=>fi,Inode:()=>fe,NoSyncFile:()=>$i,Overlay:()=>Xo,PreloadFile:()=>ne,Readonly:()=>Tu,SimpleSyncRWTransaction:()=>Ft,Stats:()=>H,StatsCommon:()=>kt,Sync:()=>li,SyncFile:()=>qi,SyncStoreFile:()=>ui,SyncStoreFileSystem:()=>Pt,backends:()=>Hr,configure:()=>Sg,decode:()=>te,decodeDirListing:()=>ci,default:()=>_g,encode:()=>D,encodeDirListing:()=>ae,fs:()=>jr,initialize:()=>Wc,levenshtein:()=>Zr,mkdirpSync:()=>rs,randomIno:()=>Tt,registerBackend:()=>Uc,rootIno:()=>de,setImmediate:()=>Iu,size_max:()=>Wi,toPromise:()=>Pu,wait:()=>Fu});var jr={};Ri(jr,{BigIntStats:()=>G,Dir:()=>Gi,Dirent:()=>Qe,ReadStream:()=>Wr,Stats:()=>H,WriteStream:()=>qr,_toUnixTimestamp:()=>os,access:()=>rd,accessSync:()=>tf,appendFile:()=>Cf,appendFileSync:()=>Mu,chmod:()=>Qf,chmodSync:()=>Ju,chown:()=>Xf,chownSync:()=>Gu,close:()=>Of,closeSync:()=>Je,constants:()=>si,copyFile:()=>fd,copyFileSync:()=>of,createReadStream:()=>ad,createWriteStream:()=>ld,exists:()=>Af,existsSync:()=>tn,fchmod:()=>$f,fchmodSync:()=>an,fchown:()=>qf,fchownSync:()=>sn,fdatasync:()=>Mf,fdatasyncSync:()=>qu,fstat:()=>Rf,fstatSync:()=>Uu,fsync:()=>Df,fsyncSync:()=>Wu,ftruncate:()=>Bf,ftruncateSync:()=>cs,futimes:()=>jf,futimesSync:()=>ln,initialize:()=>Ki,lchmod:()=>Zf,lchmodSync:()=>Qu,lchown:()=>Jf,lchownSync:()=>Xu,link:()=>Kf,linkSync:()=>Hu,lopenSync:()=>Yi,lstat:()=>Nf,lstatSync:()=>Ru,lutimes:()=>td,lutimesSync:()=>ef,mkdir:()=>Vf,mkdirSync:()=>Vu,mkdtemp:()=>ud,mkdtempSync:()=>nf,mount:()=>Hi,mounts:()=>ge,open:()=>Pf,openSync:()=>di,opendir:()=>pd,opendirSync:()=>lf,promises:()=>Zi,read:()=>Wf,readFile:()=>If,readFileSync:()=>ls,readSync:()=>ju,readdir:()=>Hf,readdirSync:()=>cn,readlink:()=>Gf,readlinkSync:()=>Yu,readv:()=>dd,readvSync:()=>sf,realpath:()=>id,realpathSync:()=>un,rename:()=>vf,renameSync:()=>Cu,rm:()=>cd,rmSync:()=>rf,rmdir:()=>zf,rmdirSync:()=>zu,stat:()=>kf,statSync:()=>rn,symlink:()=>Yf,symlinkSync:()=>Ku,truncate:()=>Tf,truncateSync:()=>Ou,umount:()=>en,unlink:()=>Ff,unlinkSync:()=>as,unwatchFile:()=>od,utimes:()=>ed,utimesSync:()=>Zu,watch:()=>sd,watchFile:()=>nd,write:()=>Uf,writeFile:()=>Lf,writeFileSync:()=>on,writeSync:()=>$u,writev:()=>hd,writevSync:()=>af});var J=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EIO=5]="EIO",y[y.EBADF=9]="EBADF",y[y.EACCES=13]="EACCES",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.EROFS=30]="EROFS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ENOTSUP=95]="ENOTSUP",y))(J||{}),Xr={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[39]:"Directory is not empty.",[95]:"Operation is not supported."},u=class extends Error{constructor(i,r=Xr[i],n){super(r);this.errno=i;this.path=n;this.code=J[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new u(i.errno,i.message,i.path);return r.code=i.code,r.stack=i.stack,r}static OnPath(i,r){return new u(i,Xr[i],r)}static EACCES(i){return this.OnPath(13,i)}static ENOENT(i){return this.OnPath(2,i)}static EEXIST(i){return this.OnPath(17,i)}static EISDIR(i){return this.OnPath(21,i)}static ENOTDIR(i){return this.OnPath(20,i)}static EPERM(i){return this.OnPath(1,i)}static ENOTEMPTY(i){return this.OnPath(39,i)}code;syscall="";stack;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};o(u,"ApiError");var Jr=class{constructor(e,i,r,n,s,a){this.uid=e;this.gid=i;this.suid=r;this.sgid=n;this.euid=s;this.egid=a}},$=Jr;o($,"Cred"),oi($,"Root",new Jr(0,0,0,0,0,0));var si={};Ri(si,{COPYFILE_EXCL:()=>Qc,COPYFILE_FICLONE:()=>Zc,COPYFILE_FICLONE_FORCE:()=>eu,F_OK:()=>Xc,O_APPEND:()=>At,O_CREAT:()=>xe,O_DIRECT:()=>au,O_DIRECTORY:()=>iu,O_DSYNC:()=>ou,O_EXCL:()=>xt,O_NOATIME:()=>ru,O_NOCTTY:()=>tu,O_NOFOLLOW:()=>nu,O_NONBLOCK:()=>lu,O_RDONLY:()=>Oi,O_RDWR:()=>Ke,O_SYMLINK:()=>su,O_SYNC:()=>Bi,O_TRUNC:()=>vt,O_WRONLY:()=>Et,R_OK:()=>be,S_IFBLK:()=>uu,S_IFCHR:()=>cu,S_IFDIR:()=>Mi,S_IFIFO:()=>fu,S_IFLNK:()=>Ui,S_IFMT:()=>Y,S_IFREG:()=>Di,S_IFSOCK:()=>du,S_IRGRP:()=>gu,S_IROTH:()=>Eu,S_IRUSR:()=>pu,S_IRWXG:()=>bu,S_IRWXO:()=>_u,S_IRWXU:()=>hu,S_IWGRP:()=>wu,S_IWOTH:()=>xu,S_IWUSR:()=>yu,S_IXGRP:()=>Su,S_IXOTH:()=>vu,S_IXUSR:()=>mu,W_OK:()=>se,X_OK:()=>Jc});var Xc=0,be=4,se=2,Jc=1,Qc=1,Zc=2,eu=4,Oi=0,Et=1,Ke=2,xe=64,xt=128,tu=256,vt=512,At=1024,iu=65536,ru=262144,nu=131072,Bi=1052672,ou=4096,su=32768,au=16384,lu=2048,Y=61440,Di=32768,Mi=16384,cu=8192,uu=24576,fu=4096,Ui=40960,du=49152,hu=448,pu=256,yu=128,mu=64,bu=56,gu=32,wu=16,Su=8,_u=7,Eu=4,xu=2,vu=1;var B=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(B||{}),kt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor(e=B.FILE,i=-1,r,n,s,a,l,c,f){let d=Date.now(),h=o((b,m)=>typeof b==this._typename?b:this._convert(typeof b==this._typename_inverse?b:m),"resolveT");if(this.atimeMs=h(n,d),this.mtimeMs=h(s,d),this.ctimeMs=h(a,d),this.birthtimeMs=h(f,d),this.uid=h(l,0),this.gid=h(c,0),this.size=this._convert(i),r)this.mode=this._convert(r);else switch(e){case B.FILE:this.mode=this._convert(420);break;case B.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(i)/512)),this.mode&61440||(this.mode=this.mode|this._convert(e))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let r=this.mode&-61441,n=15,s=15,a=15;if(i.euid==this.uid){let f=(3840&r)>>8;n=(e^f)&e}if(i.egid==this.gid){let f=(240&r)>>4;s=(e^f)&e}let l=15&r;return a=(e^l)&e,!(n&s&a)}getCred(e=Number(this.uid),i=Number(this.gid)){return new $(e,i,Number(this.uid),Number(this.gid),e,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))}};o(kt,"StatsCommon");var H=class extends kt{_isBigint=!1;static clone(e){return new H(e.mode&61440,e.size,e.mode&-61441,e.atimeMs,e.mtimeMs,e.ctimeMs,e.uid,e.gid,e.birthtimeMs)}};o(H,"Stats");var G=class extends kt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new G(Number(e.mode)&61440,BigInt(e.size),BigInt(e.mode)&BigInt(-61441),BigInt(e.atimeMs),BigInt(e.mtimeMs),BigInt(e.ctimeMs),BigInt(e.uid),BigInt(e.gid),BigInt(e.birthtimeMs))}};o(G,"BigIntStats");var Au="/",es="/";function Nt(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}o(Nt,"validateString");function ts(t,e){let i="",r=0,n=-1,s=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||s===1))if(s===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",r=0):(i=i.slice(0,c),r=i.length-1-i.lastIndexOf("/")),n=l,s=0;continue}else if(i.length!==0){i="",r=0,n=l,s=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,l):i=t.slice(n+1,l),r=l-n-1;n=l,s=0}else a==="."&&s!==-1?++s:s=-1}return i}o(ts,"normalizeString");function ve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:Au;Nt(n,`paths[${r}]`),n.length!==0&&(e=`${n}/${e}`,i=n[0]==="/")}return e=ts(e,!i),i?`/${e}`:e.length>0?e:"."}o(ve,"resolve");function ku(t){if(Nt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=ts(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}o(ku,"normalize");function Ae(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];Nt(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":ku(e)}o(Ae,"join");function N(t){if(Nt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}o(N,"dirname");function j(t,e){e!==void 0&&Nt(e,"ext"),Nt(t,"path");let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let s=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){i=l+1;break}}else a===-1&&(n=!1,a=l+1),s>=0&&(t[l]===e[s]?--s===-1&&(r=l):(s=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let s=t.length-1;s>=0;--s)if(t[s]==="/"){if(!n){i=s+1;break}}else r===-1&&(n=!1,r=s+1);return r===-1?"":t.slice(i,r)}o(j,"basename");var Wi=2**32-1,de=0n;function is(){return Math.round(Math.random()*2**32).toString(16)}o(is,"_random");function Tt(){return BigInt("0x"+is()+is())}o(Tt,"randomIno");var fe=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(50),this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Tt(),this.nlink=1,this.size=4096;let r=Date.now();this.atime=r,this.mtime=r,this.ctime=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 atime(){return this.view.getFloat64(26,!0)}set atime(e){this.view.setFloat64(26,e,!0)}get mtime(){return this.view.getFloat64(34,!0)}set mtime(e){this.view.setFloat64(34,e,!0)}get ctime(){return this.view.getFloat64(42,!0)}set ctime(e){this.view.setFloat64(42,e,!0)}toStats(){return new H((this.mode&61440)===B.DIRECTORY?B.DIRECTORY:B.FILE,this.size,this.mode,this.atime,this.mtime,this.ctime,this.uid,this.gid)}sizeof(){return this.buffer.byteLength}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.atime!==e.atimeMs&&(this.atime=e.atimeMs,i=!0),this.mtime!==e.mtimeMs&&(this.mtime=e.mtimeMs,i=!0),this.ctime!==e.ctimeMs&&(this.ctime=e.ctimeMs,i=!0),i}};o(fe,"Inode");var ji=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(ji||{}),Ye=class{static FromString(e){return Ye.flagCache.has(e)||Ye.flagCache.set(e,new Ye(e)),Ye.flagCache.get(e)}flagStr;constructor(e){if(typeof e=="number"&&(e=Ye.NumberToString(e)),Ye.validFlagStrs.indexOf(e)<0)throw new u(22,"Invalid flag string: "+e);this.flagStr=e}static NumberToString(e){switch(e){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 u(22,"Invalid flag number: "+e)}}toString(){return this.flagStr}get mode(){let e=0;return e<<=1,e+=+this.isReadable(),e<<=1,e+=+this.isWriteable(),e<<=1,e}isReadable(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1}isWriteable(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1}isTruncating(){return this.flagStr.indexOf("w")!==-1}isAppendable(){return this.flagStr.indexOf("a")!==-1}isSynchronous(){return this.flagStr.indexOf("s")!==-1}isExclusive(){return this.flagStr.indexOf("x")!==-1}pathExistsAction(){return this.isExclusive()?1:this.isTruncating()?2:0}pathNotExistsAction(){return(this.isWriteable()||this.isAppendable())&&this.flagStr!=="r+"?3:1}},P=Ye;o(P,"FileFlag"),oi(P,"flagCache",new Map),oi(P,"validFlagStrs",["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"]);var ai=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};o(ai,"File");var ne=class extends ai{constructor(i,r,n,s,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:Wi}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=s;this._buffer=a;if(this.stats.size!=a.byteLength){if(this.flag.isReadable())throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return this.flag.isAppendable()?this.stats.size:this._position}set position(i){this._position=i}async stat(){return H.clone(this.stats)}statSync(){return H.clone(this.stats)}truncate(i){if(this.truncateSync(i),this.flag.isSynchronous()&&!this.fs.metadata.synchronous)return this.sync()}truncateSync(i){if(this._dirty=!0,!this.flag.isWriteable())throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.length,this._buffer.length),this.flag.isSynchronous()&&this.fs.metadata.synchronous&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),this.flag.isSynchronous()&&this.fs.metadata.synchronous&&this.syncSync()}async write(i,r=0,n=this.stats.size,s=0){return this.writeSync(i,r,n,s)}writeSync(i,r=0,n=this.stats.size,s=0){if(this._dirty=!0,s??=this.position,!this.flag.isWriteable())throw new u(1,"File not opened with a writeable mode.");let a=s+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 c=new Uint8Array(new ArrayBuffer(a,{maxByteLength:Wi}));c.set(this._buffer),this._buffer=c}this._buffer.set(i.slice(r,r+n),s);let l=this._buffer.byteOffset;return this.stats.mtimeMs=Date.now(),this.flag.isSynchronous()?(this.syncSync(),l):(this.position=s+l,l)}async read(i,r=0,n=this.stats.size,s=0){return{bytesRead:this.readSync(i,r,n,s),buffer:i}}readSync(i,r=0,n=this.stats.size,s=0){if(!this.flag.isReadable())throw new u(1,"File not opened with a readable mode.");s??=this.position;let a=s+n;a>this.stats.size&&(a=s+Math.max(this.stats.size-s,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-s;return l==0||i.set(this._buffer.slice(s,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){if(!this.fs.metadata.supportsProperties)throw new u(95);this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){if(!this.fs.metadata.supportsProperties)throw new u(95);this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){if(!this.fs.metadata.supportsProperties)throw new u(95);this._dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};o(ne,"PreloadFile");var qi=class extends ne{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(qi,"SyncFile");var $i=class extends ne{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){}syncSync(){}async close(){}closeSync(){}};o($i,"NoSyncFile");var ee=class{get metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};o(ee,"FileSystem");function li(t){class e extends t{get metadata(){return{...super.metadata,synchronous:!0}}async ready(){return this}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,s){return this.renameSync(r,n,s)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,s,a){return this.createFileSync(r,n,s,a)}async openFile(r,n,s){return this.openFileSync(r,n,s)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,s){return this.mkdirSync(r,n,s)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,s){return this.linkSync(r,n,s)}async sync(r,n,s){return this.syncSync(r,n,s)}}return o(e,"SyncFileSystem"),e}o(li,"Sync");function Qr(t){class e extends t{renameSync(r,n,s){throw new u(95)}statSync(r,n){throw new u(95)}createFileSync(r,n,s,a){throw new u(95)}openFileSync(r,n,s){throw new u(95)}unlinkSync(r,n){throw new u(95)}rmdirSync(r,n){throw new u(95)}mkdirSync(r,n,s){throw new u(95)}readdirSync(r,n){throw new u(95)}linkSync(r,n,s){throw new u(95)}syncSync(r,n,s){throw new u(95)}}return o(e,"AsyncFileSystem"),e}o(Qr,"Async");function Tu(t){class e extends t{async rename(r,n,s){throw new u(30)}renameSync(r,n,s){throw new u(30)}async createFile(r,n,s,a){throw new u(30)}createFileSync(r,n,s,a){throw new u(30)}async unlink(r,n){throw new u(30)}unlinkSync(r,n){throw new u(30)}async rmdir(r,n){throw new u(30)}rmdirSync(r,n){throw new u(30)}async mkdir(r,n,s){throw new u(30)}mkdirSync(r,n,s){throw new u(30)}async link(r,n,s){throw new u(30)}linkSync(r,n,s){throw new u(30)}async sync(r,n,s){throw new u(30)}syncSync(r,n,s){throw new u(30)}}return o(e,"ReadonlyFileSystem"),e}o(Tu,"Readonly");function rs(t,e,i,r){r.existsSync(t,i)||(rs(N(t),e,i,r),r.mkdirSync(t,e,i))}o(rs,"mkdirpSync");function zi(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}o(zi,"_min");function Zr(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 s=new Array(i<<1);for(let b=0;b<i;)s[i+b]=t.charCodeAt(n+b),s[b]=++b;let a,l,c,f,d;for(a=0;a+3<r;){let b=e.charCodeAt(n+(l=a)),m=e.charCodeAt(n+(c=a+1)),g=e.charCodeAt(n+(f=a+2)),y=e.charCodeAt(n+(d=a+3)),A=a+=4;for(let w=0;w<i;){let F=s[i+w],O=s[w];l=zi(O,l,c,b,F),c=zi(l,c,f,m,F),f=zi(c,f,d,g,F),A=zi(f,d,A,y,F),s[w++]=A,d=f,f=c,c=l,l=O}}let h=0;for(;a<r;){let b=e.charCodeAt(n+(l=a));h=++a;for(let m=0;m<i;m++){let g=s[m];s[m]=h=g<l||h<l?g>h?h+1:g+1:b===s[i+m]?l:l+1,l=g}}return h}o(Zr,"levenshtein");function Fu(t){return new Promise(e=>{setTimeout(e,t)})}o(Fu,"wait");function Pu(t){return function(...e){return new Promise((i,r)=>{e.push((n,...s)=>{n?r(n):i(s[0])}),t(...e)})}}o(Pu,"toPromise");var Iu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function D(t,e="utf8"){switch(e){case"ascii":return new globalThis.TextEncoder().encode(t).map(i=>i&127);case"latin1":case"binary":case"utf8":case"utf-8":case"base64":case"base64url":case"hex":return new globalThis.TextEncoder().encode(t);case"utf16le":case"ucs2":case"ucs-2":return new globalThis.TextEncoder().encode(t).slice(0,-1);default:throw new u(22,"Invalid encoding: "+e)}}o(D,"encode");function te(t,e="utf8"){switch(e){case"ascii":case"utf8":case"utf-8":return new globalThis.TextDecoder().decode(t);case"latin1":case"binary":return new globalThis.TextDecoder("latin1").decode(t);case"utf16le":case"ucs2":case"ucs-2":let i="";for(let r=0;r<t.length;r+=2){let n=t[r]|t[r+1]<<8;i+=String.fromCharCode(n)}return i;case"base64":return btoa(Array.from(t).map(r=>String.fromCharCode(r)).join(""));case"base64url":return te(t,"base64").replace("/","_").replace("+","-");case"hex":return Array.from(t).map(r=>r.toString(16)).join("");default:throw new u(22,"Invalid encoding: "+e)}}o(te,"decode");function ci(t){return JSON.parse(te(t),(e,i)=>e==""?i:BigInt(i))}o(ci,"decodeDirListing");function ae(t){return D(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}o(ae,"encodeDirListing");var Ft=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,r){return this.markModified(e),this.store.put(e,i,r)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};o(Ft,"SimpleSyncRWTransaction");var ui=class extends ne{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(ui,"SyncStoreFile");var Pt=class extends li(ee){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}get metadata(){return{...super.metadata,name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e),a=j(e),l=N(i),c=j(i),f=this.findINode(n,s),d=this.getDirListing(n,f,s);if(!f.toStats().hasAccess(2,r))throw u.EACCES(e);if(!d[a])throw u.ENOENT(e);let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new u(16,s);let b,m;if(l===s?(b=f,m=d):(b=this.findINode(n,l),m=this.getDirListing(n,b,l)),m[c]){let g=this.getINode(n,m[c],i);if(g.toStats().isFile())try{n.remove(g.ino),n.remove(m[c])}catch(y){throw n.abort(),y}else throw u.EPERM(i)}m[c]=h;try{n.put(f.ino,ae(d),!0),n.put(b.ino,ae(m),!0)}catch(g){throw n.abort(),g}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction("readonly"),e).toStats();if(!r.hasAccess(4,i))throw u.EACCES(e);return r}createFileSync(e,i,r,n){return this.commitNewFile(e,B.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction("readonly"),s=this.findINode(n,e),a=n.get(s.ino);if(!s.toStats().hasAccess(i.mode,r))throw u.EACCES(e);if(a===null)throw u.ENOENT(e);return new ui(this,e,i,s.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw u.ENOTEMPTY(e);this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,B.DIRECTORY,i,r,D("{}"))}readdirSync(e,i){let r=this.store.beginTransaction("readonly"),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw u.EACCES(e);return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=this._findINode(n,N(e),j(e)),a=this.getINode(n,s,e),l=a.update(r);try{n.put(a.ino,i,!0),l&&n.put(s,a.data,!0)}catch(c){throw n.abort(),c}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e);if(!this.findINode(n,s).toStats().hasAccess(4,r))throw u.EACCES(s);let l=N(i),c=this.findINode(n,l),f=this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw u.EACCES(l);let d=this._findINode(n,s,j(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw u.EACCES(i);h.nlink++,f[j(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,ae(f),!0)}catch(b){throw n.abort(),b}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction("readwrite");if(e.get(de))return;let i=new fe;i.mode=511|B.DIRECTORY,e.put(i.ino,D("{}"),!1),e.put(de,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let s=Ae(i,r);if(n.has(s))throw new u(5,"Infinite loop detected while finding inode",s);if(n.add(s),i!="/"){let a=this._findINode(e,N(i),j(i),n),l=this.getDirListing(e,this.getINode(e,a,i+es+r),i);if(!(r in l))throw u.ENOENT(ve(i,r));return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,de,i),i);if(!(r in a))throw u.ENOENT(ve(i,r));return a[r]}return de}findINode(e,i){let r=this._findINode(e,N(i),j(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw u.ENOENT(r);return new fe(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw u.ENOTDIR(r);let n=e.get(i.ino);if(!n)throw u.ENOENT(r);return ci(n)}addNewNode(e,i){let n;for(;0<5;)try{return n=Tt(),e.put(n,i,!1),n}catch{}throw new u(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,s=new Uint8Array){let a=this.store.beginTransaction("readwrite"),l=N(e),c=j(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw u.EACCES(e);if(e==="/")throw u.EEXIST(e);if(d[c])throw u.EEXIST(e);let h=new fe;try{h.ino=this.addNewNode(a,s),h.size=s.length,h.mode=r|i,h.uid=n.uid,h.gid=n.gid,d[c]=this.addNewNode(a,h.data),a.put(f.ino,ae(d),!0)}catch(b){throw a.abort(),b}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e),a=this.findINode(n,s),l=this.getDirListing(n,a,s),c=j(e),f=l[c];if(!f)throw u.ENOENT(e);let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw u.EACCES(e);if(delete l[c],!i&&d.toStats().isDirectory())throw u.EISDIR(e);if(i&&!d.toStats().isDirectory())throw u.ENOTDIR(e);try{n.put(a.ino,ae(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};o(Pt,"SyncStoreFileSystem");var Vi=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Ft(this)}get(e){return this.store.get(e)}put(e,i,r){return!r&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};o(Vi,"InMemoryStore");var fi={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",description:"The name of the store"}},create({name:t}){return new Pt({store:new Vi(t)})}};function os(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)}o(os,"_toUnixTimestamp");function we(t,e){switch(typeof t){case"number":return t;case"string":let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new u(22,"Invalid mode: "+t?.toString())}o(we,"normalizeMode");function It(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new u(22,"Invalid time.")}o(It,"normalizeTime");function M(t){if(t.indexOf("\0")>=0)throw new u(22,"Path must be a string without null bytes.");if(t==="")throw new u(22,"Path must not be empty.");return t=t.replaceAll(/\/+/g,"/"),ve(t)}o(M,"normalizePath");function Ge(t,e,i,r){switch(t===null?"null":typeof t){case"object":return{encoding:typeof t.encoding<"u"?t.encoding:e,flag:typeof t.flag<"u"?t.flag:i,mode:we(t.mode,r)};case"string":return{encoding:t,flag:i,mode:r};case"null":case"undefined":case"function":return{encoding:e,flag:i,mode:r};default:throw new TypeError(`"options" must be a string or an object, got ${typeof t} instead.`)}}o(Ge,"normalizeOptions");function S(){}o(S,"nop");var x=$.Root;function ss(t){x=t}o(ss,"setCred");var nt=new Map,Lu=100;function Lt(t){let e=Lu++;return nt.set(e,t),e}o(Lt,"getFdForFile");function T(t){if(!nt.has(t))throw new u(9);return nt.get(t)}o(T,"fd2file");var ge=new Map;Hi("/",fi.create({name:"root"}));function Hi(t,e){if(t[0]!=="/"&&(t="/"+t),t=ve(t),ge.has(t))throw new u(22,"Mount point "+t+" is already in use.");ge.set(t,e)}o(Hi,"mount");function en(t){if(t[0]!=="/"&&(t=`/${t}`),t=ve(t),!ge.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");ge.delete(t)}o(en,"umount");function he(t){t=M(t);let e=[...ge].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}o(he,"resolveFS");function ns(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}o(ns,"fixPaths");function Xe(t,e){return typeof t.stack=="string"&&(t.stack=ns(t.stack,e)),t.message=ns(t.message,e),t}o(Xe,"fixError");function Ki(t){"/"in t&&en("/");for(let[e,i]of Object.entries(t))Hi(e,i)}o(Ki,"initialize");var Zi={};Ri(Zi,{FileHandle:()=>ce,access:()=>kn,appendFile:()=>Qi,chmod:()=>En,chown:()=>Sn,constants:()=>si,copyFile:()=>xf,createReadStream:()=>wf,createWriteStream:()=>Sf,exists:()=>pi,fchmod:()=>pf,fchown:()=>hf,futimes:()=>yf,lchmod:()=>xn,lchown:()=>_n,link:()=>bn,lopen:()=>Ji,lstat:()=>dn,lutimes:()=>An,mkdir:()=>mn,mkdtemp:()=>Ef,open:()=>ot,read:()=>df,readFile:()=>yi,readdir:()=>hi,readlink:()=>wn,realpath:()=>mi,rename:()=>fn,rm:()=>_f,rmdir:()=>yn,stat:()=>Rt,symlink:()=>gn,truncate:()=>hn,unlink:()=>Xi,unwatchFile:()=>bf,utimes:()=>vn,watch:()=>gf,watchFile:()=>mf,write:()=>ff,writeFile:()=>Bt});function le(...[t,e,i,...r]){i=M(i);let{fs:n,path:s}=he(e&&tn(i)?un(i):i);try{return n[t](s,...r)}catch(a){throw Xe(a,{[s]:i})}}o(le,"doOp");function Cu(t,e){t=M(t),e=M(e);let i=he(t),r=he(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,x);let s=ls(t);on(e,s),as(t)}catch(s){throw Xe(s,n)}}o(Cu,"renameSync");function tn(t){t=M(t);try{let{fs:e,path:i}=he(t);return e.existsSync(i,x)}catch(e){if(e.errno==2)return!1;throw e}}o(tn,"existsSync");function rn(t,e){let i=le("statSync",!0,t,x);return e?.bigint?G.clone(i):i}o(rn,"statSync");function Ru(t,e){let i=le("statSync",!1,t,x);return e?.bigint?G.clone(i):i}o(Ru,"lstatSync");function Ou(t,e=0){let i=di(t,"r+");try{cs(i,e)}finally{Je(i)}}o(Ou,"truncateSync");function as(t){return le("unlinkSync",!1,t,x)}o(as,"unlinkSync");function Ct(t,e,i,r){let n=M(t),s=we(i,420),a=P.FromString(e),l;try{l=le("statSync",r,n,x)}catch{switch(a.pathNotExistsAction()){case 3:if(!le("statSync",r,N(n),x).isDirectory())throw u.ENOTDIR(N(n));return le("createFileSync",r,n,a,s,x);case 1:throw u.ENOENT(n);default:throw new u(22,"Invalid FileFlag object.")}}if(!l.hasAccess(s,x))throw u.EACCES(n);switch(a.pathExistsAction()){case 1:throw u.EEXIST(n);case 2:return le("unlinkSync",r,n,x),le("createFileSync",r,n,a,l.mode,x);case 0:return le("openFileSync",r,n,a,x);default:throw new u(22,"Invalid FileFlag object.")}}o(Ct,"_openSync");function di(t,e,i){return Lt(Ct(t,e,i,!0))}o(di,"openSync");function Yi(t,e,i){return Lt(Ct(t,e,i,!1))}o(Yi,"lopenSync");function nn(t,e,i){let r=Ct(t,e,420,i);try{let n=r.statSync(),s=new Uint8Array(n.size);return r.readSync(s,0,n.size,0),r.closeSync(),s}finally{r.closeSync()}}o(nn,"_readFileSync");function ls(t,e={}){let i=Ge(e,null,"r",420);if(!P.FromString(i.flag).isReadable())throw new u(22,"Flag passed to readFile must allow for reading.");let n=nn(t,i.flag,!0);return i.encoding?te(n,i.encoding):n}o(ls,"readFileSync");function Bu(t,e,i,r,n){let s=Ct(t,i,r,n);try{s.writeSync(e,0,e.length,0)}finally{s.closeSync()}}o(Bu,"_writeFileSync");function on(t,e,i){let r=Ge(i,"utf8","w",420);if(!P.FromString(r.flag).isWriteable())throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e,r.encoding):e;if(s===void 0)throw new u(22,"Data not specified");Bu(t,s,r.flag,r.mode,!0)}o(on,"writeFileSync");function Du(t,e,i,r,n){let s=Ct(t,i,r,n);try{s.writeSync(e,0,e.length,null)}finally{s.closeSync()}}o(Du,"_appendFileSync");function Mu(t,e,i){let r=Ge(i,"utf8","a",420);if(!P.FromString(r.flag).isAppendable())throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e):e;Du(t,s,r.flag,r.mode,!0)}o(Mu,"appendFileSync");function Uu(t,e){let i=T(t).statSync();return e?.bigint?G.clone(i):i}o(Uu,"fstatSync");function Je(t){T(t).closeSync(),nt.delete(t)}o(Je,"closeSync");function cs(t,e=0){if(e<0)throw new u(22);T(t).truncateSync(e)}o(cs,"ftruncateSync");function Wu(t){T(t).syncSync()}o(Wu,"fsyncSync");function qu(t){T(t).datasyncSync()}o(qu,"fdatasyncSync");function $u(t,e,i,r,n){let s,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,s=D(e,d),l=s.length}else s=e,a=i,l=r,c=typeof n=="number"?n:null;let f=T(t);return c==null&&(c=f.position),f.writeSync(s,a,l,c)}o($u,"writeSync");function ju(t,e,i,r,n){let s=T(t),a=i;return typeof i=="object"&&({offset:a,length:r,position:n}=i),isNaN(+n)&&(n=s.position),s.readSync(e,a,r,n)}o(ju,"readSync");function sn(t,e,i){T(t).chownSync(e,i)}o(sn,"fchownSync");function an(t,e){let i=we(e,-1);if(i<0)throw new u(22,"Invalid mode.");T(t).chmodSync(i)}o(an,"fchmodSync");function ln(t,e,i){T(t).utimesSync(It(e),It(i))}o(ln,"futimesSync");function zu(t){return le("rmdirSync",!0,t,x)}o(zu,"rmdirSync");function Vu(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;le("mkdirSync",!0,t,we(i,511),x)}o(Vu,"mkdirSync");function cn(t,e){t=M(t);let i=le("readdirSync",!0,t,x);for(let r of ge.keys()){if(!r.startsWith(t))continue;let n=r.slice(t.length);n.includes("/")||n.length==0||i.push(n)}return i.map(r=>typeof e=="object"&&e?.withFileTypes?new Qe(r,rn(Ae(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?D(r):r)}o(cn,"readdirSync");function Hu(t,e){return e=M(e),le("linkSync",!1,t,e,x)}o(Hu,"linkSync");function Ku(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(tn(e))throw u.EEXIST(e);on(e,t),Ct(e,"r+",420,!1)._setTypeSync(B.SYMLINK)}o(Ku,"symlinkSync");function Yu(t,e){let i=nn(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:te(i,r)}o(Yu,"readlinkSync");function Gu(t,e,i){let r=di(t,"r+");sn(r,e,i),Je(r)}o(Gu,"chownSync");function Xu(t,e,i){let r=Yi(t,"r+");sn(r,e,i),Je(r)}o(Xu,"lchownSync");function Ju(t,e){let i=di(t,"r+");an(i,e),Je(i)}o(Ju,"chmodSync");function Qu(t,e){let i=Yi(t,"r+");an(i,e),Je(i)}o(Qu,"lchmodSync");function Zu(t,e,i){let r=di(t,"r+");ln(r,e,i),Je(r)}o(Zu,"utimesSync");function ef(t,e,i){let r=Yi(t,"r+");ln(r,e,i),Je(r)}o(ef,"lutimesSync");function un(t,e){t=M(t);let{fs:i,path:r,mountPoint:n}=he(t);try{if(!i.statSync(r,x).isSymbolicLink())return t;let a=M(n+te(nn(r,"r+",!1)));return un(a)}catch(s){throw Xe(s,{[r]:t})}}o(un,"realpathSync");function tf(t,e=384){if(!rn(t).hasAccess(e,x))throw new u(13)}o(tf,"accessSync");function rf(t){throw new u(95)}o(rf,"rmSync");function nf(t,e){throw new u(95)}o(nf,"mkdtempSync");function of(t,e,i){throw new u(95)}o(of,"copyFileSync");function sf(t,e,i){throw new u(95)}o(sf,"readvSync");function af(t,e,i){throw new u(95)}o(af,"writevSync");function lf(t,e){throw new u(95)}o(lf,"opendirSync");var Qe=class{constructor(e,i){this.name=e;this.stats=i}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()}};o(Qe,"Dirent");var Gi=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await hi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=cn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};o(Gi,"Dir");var ce=class{constructor(e){this.fd=e}chown(e,i){return T(this.fd).chown(e,i)}chmod(e){let i=we(e,-1);if(i<0)throw new u(22,"Invalid mode.");return T(this.fd).chmod(i)}datasync(){return T(this.fd).datasync()}sync(){return T(this.fd).sync()}truncate(e){if(e<0)throw new u(22);return T(this.fd).truncate(e)}utimes(e,i){return T(this.fd).utimes(It(e),It(i))}appendFile(e,i){return Qi(T(this.fd).path,e,i)}read(e,i,r,n){return isNaN(+n)&&(n=T(this.fd).position),T(this.fd).read(e,i,r,n)}readFile(e){return yi(T(this.fd).path,e)}stat(e){return Rt(T(this.fd).path,e)}async write(e,i,r,n){let s,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,s=D(e,f),l=s.length}else s=e,a=i,l=r,n=typeof n=="number"?n:null;n??=T(this.fd).position;let c=await T(this.fd).write(s,a,l,n);return{buffer:s,bytesWritten:c}}writeFile(e,i){return Bt(T(this.fd).path,e,i)}writev(e,i){throw new u(95)}readv(e,i){throw new u(95)}async close(){await T(this.fd).close(),nt.delete(this.fd)}};o(ce,"FileHandle");async function Se(...[t,e,i,...r]){i=M(i);let{fs:n,path:s}=he(e&&await pi(i)?await mi(i):i);try{return n[t](s,...r)}catch(a){throw Xe(a,{[s]:i})}}o(Se,"doOp");async function fn(t,e){t=M(t),e=M(e);let{path:i}=he(t),{fs:r,path:n}=he(e);try{let s=await yi(t);await Bt(e,s),await Xi(t)}catch(s){throw Xe(s,{[i]:t,[n]:e})}}o(fn,"rename");async function pi(t){try{let{fs:e,path:i}=he(t);return e.exists(i,x)}catch(e){if(e.errno==2)return!1;throw e}}o(pi,"exists");async function Rt(t,e){let i=await Se("stat",!0,t,x);return e?.bigint?G.clone(i):i}o(Rt,"stat");async function dn(t,e){let i=await Se("stat",!1,t,x);return e?.bigint?G.clone(i):i}o(dn,"lstat");async function hn(t,e=0){let i=await ot(t,"r+");try{await i.truncate(e)}finally{await i.close()}}o(hn,"truncate");async function Xi(t){return Se("unlink",!1,t,x)}o(Xi,"unlink");async function Ot(t,e,i=420,r){let n=M(t),s=we(i,420),a=P.FromString(e);try{switch(a.pathExistsAction()){case 1:throw u.EEXIST(n);case 2:let l=await Se("openFile",r,n,a,x);if(!l)throw new u(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Se("openFile",r,n,a,x);default:throw new u(22,"Invalid file flag")}}catch{switch(a.pathNotExistsAction()){case 3:let c=await Se("stat",r,N(n),x);if(c&&!c.isDirectory())throw u.ENOTDIR(N(n));return await Se("createFile",r,n,a,s,x);case 1:throw u.ENOENT(n);default:throw new u(22,"Invalid file flag")}}}o(Ot,"_open");async function ot(t,e,i=420){let r=await Ot(t,e,i,!0);return new ce(Lt(r))}o(ot,"open");async function Ji(t,e,i=420){let r=await Ot(t,e,i,!1);return new ce(Lt(r))}o(Ji,"lopen");async function pn(t,e,i){let r=await Ot(M(t),e,420,i);try{let n=await r.stat(),s=new Uint8Array(n.size);return await r.read(s,0,n.size,0),await r.close(),s}finally{await r.close()}}o(pn,"_readFile");async function yi(t,e){let i=Ge(e,null,"r",null);if(!P.FromString(i.flag).isReadable())throw new u(22,"Flag passed must allow for reading.");let n=await pn(t,i.flag,!0);return i.encoding?te(n,i.encoding):n}o(yi,"readFile");async function cf(t,e,i,r,n){let s=await Ot(t,i,r,n);try{await s.write(e,0,e.length,0)}finally{await s.close()}}o(cf,"_writeFile");async function Bt(t,e,i){let r=Ge(i,"utf8","w",420);if(!P.FromString(r.flag).isWriteable())throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e,r.encoding):e;await cf(t,s,r.flag,r.mode,!0)}o(Bt,"writeFile");async function uf(t,e,i,r,n){let s=await Ot(t,i,r,n);try{await s.write(e,0,e.length,null)}finally{await s.close()}}o(uf,"_appendFile");async function Qi(t,e,i){let r=Ge(i,"utf8","a",420);if(!P.FromString(r.flag).isAppendable())throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?D(e):e;await uf(t,s,r.flag,r.mode,!0)}o(Qi,"appendFile");function ff(t,e,i,r,n){return t.write(e,i,r,n)}o(ff,"write");function df(t,e,i,r,n){return t.read(e,i,r,n)}o(df,"read");function hf(t,e,i){return t.chown(e,i)}o(hf,"fchown");function pf(t,e){return t.chmod(e)}o(pf,"fchmod");function yf(t,e,i){return t.utimes(e,i)}o(yf,"futimes");async function yn(t){return Se("rmdir",!0,t,x)}o(yn,"rmdir");async function mn(t,e){await Se("mkdir",!0,t,we(typeof e=="object"?e?.mode:e,511),x)}o(mn,"mkdir");async function hi(t,e){t=M(t);let i=await Se("readdir",!0,t,x),r=[...ge.keys()];for(let s of r)if(s.startsWith(t)){let a=s.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let n=[];for(let s of i)n.push(typeof e=="object"&&e?.withFileTypes?new Qe(s,await Rt(Ae(t,s))):s);return n}o(hi,"readdir");async function bn(t,e){return e=M(e),Se("link",!1,t,e,x)}o(bn,"link");async function gn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await pi(e))throw u.EEXIST(e);await Bt(e,t),await(await Ot(e,"r+",420,!1))._setType(B.SYMLINK)}o(gn,"symlink");async function wn(t,e){let i=await pn(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:te(i,r)}o(wn,"readlink");async function Sn(t,e,i){let r=await ot(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(Sn,"chown");async function _n(t,e,i){let r=await Ji(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(_n,"lchown");async function En(t,e){let i=await ot(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(En,"chmod");async function xn(t,e){let i=await Ji(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(xn,"lchmod");async function vn(t,e,i){let r=await ot(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(vn,"utimes");async function An(t,e,i){let r=await Ji(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(An,"lutimes");async function mi(t,e){t=M(t);let{fs:i,path:r,mountPoint:n}=he(t);try{if(!(await i.stat(r,x)).isSymbolicLink())return t;let a=n+M(te(await pn(r,"r+",!1)));return mi(a)}catch(s){throw Xe(s,{[r]:t})}}o(mi,"realpath");async function mf(t,e,i=S){throw new u(95)}o(mf,"watchFile");async function bf(t,e=S){throw new u(95)}o(bf,"unwatchFile");async function gf(t,e,i=S){throw new u(95)}o(gf,"watch");async function kn(t,e=384){if(!(await Rt(t)).hasAccess(e,x))throw new u(13)}o(kn,"access");async function wf(t,e){throw new u(95)}o(wf,"createReadStream");async function Sf(t,e){throw new u(95)}o(Sf,"createWriteStream");async function _f(t){throw new u(95)}o(_f,"rm");async function Ef(t){throw new u(95)}o(Ef,"mkdtemp");async function xf(t){throw new u(95)}o(xf,"copyFile");function vf(t,e,i=S){fn(t,e).then(()=>i()).catch(i)}o(vf,"rename");function Af(t,e=S){pi(t).then(e).catch(()=>e(!1))}o(Af,"exists");function kf(t,e,i=S){i=typeof e=="function"?e:i,Rt(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(kf,"stat");function Nf(t,e,i=S){i=typeof e=="function"?e:i,dn(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(Nf,"lstat");function Tf(t,e=0,i=S){i=typeof e=="function"?e:i,hn(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}o(Tf,"truncate");function Ff(t,e=S){Xi(t).then(()=>e()).catch(e)}o(Ff,"unlink");function Pf(t,e,i,r=S){let n=we(i,420);r=typeof i=="function"?i:r,ot(t,e,n).then(s=>r(null,s.fd)).catch(r)}o(Pf,"open");function If(t,e,i=S){i=typeof e=="function"?e:i,yi(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(If,"readFile");function Lf(t,e,i,r=S){r=typeof i=="function"?i:r,Bt(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}o(Lf,"writeFile");function Cf(t,e,i,r=S){r=typeof i=="function"?i:r,Qi(t,e,typeof i=="function"?null:i)}o(Cf,"appendFile");function Rf(t,e,i=S){i=typeof e=="function"?e:i,T(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?G.clone(r):r)).catch(i)}o(Rf,"fstat");function Of(t,e=S){new ce(t).close().then(()=>e()).catch(e)}o(Of,"close");function Bf(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=T(t);if(r<0)throw new u(22);n.truncate(r).then(()=>i()).catch(i)}o(Bf,"ftruncate");function Df(t,e=S){T(t).sync().then(()=>e()).catch(e)}o(Df,"fsync");function Mf(t,e=S){T(t).datasync().then(()=>e()).catch(e)}o(Mf,"fdatasync");function Uf(t,e,i,r,n,s=S){let a,l,c,f=null,d,h=new ce(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":s=i;break;case"number":f=i,d=typeof r=="string"?r:"utf8",s=typeof n=="function"?n:s;break;default:s=typeof r=="function"?r:typeof n=="function"?n:s,s(new u(22,"Invalid arguments."));return}a=D(e),l=0,c=a.length;let b=s;h.write(a,l,c,f).then(({bytesWritten:m})=>b(null,m,te(a))).catch(b)}else{a=e,l=i,c=r,f=typeof n=="number"?n:null;let b=typeof n=="function"?n:s;h.write(a,l,c,f).then(({bytesWritten:m})=>b(null,m,a)).catch(b)}}o(Uf,"write");function Wf(t,e,i,r,n,s=S){new ce(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>s(null,a,l)).catch(s)}o(Wf,"read");function qf(t,e,i,r=S){new ce(t).chown(e,i).then(()=>r()).catch(r)}o(qf,"fchown");function $f(t,e,i){new ce(t).chmod(e).then(()=>i()).catch(i)}o($f,"fchmod");function jf(t,e,i,r=S){new ce(t).utimes(e,i).then(()=>r()).catch(r)}o(jf,"futimes");function zf(t,e=S){yn(t).then(()=>e()).catch(e)}o(zf,"rmdir");function Vf(t,e,i=S){mn(t,e).then(()=>i()).catch(i)}o(Vf,"mkdir");function Hf(t,e,i=S){i=typeof e=="function"?e:i,hi(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}o(Hf,"readdir");function Kf(t,e,i=S){bn(t,e).then(()=>i()).catch(i)}o(Kf,"link");function Yf(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,gn(t,e,n).then(()=>r()).catch(r)}o(Yf,"symlink");function Gf(t,e,i=S){i=typeof e=="function"?e:i,wn(t).then(r=>i(null,r)).catch(i)}o(Gf,"readlink");function Xf(t,e,i,r=S){Sn(t,e,i).then(()=>r()).catch(r)}o(Xf,"chown");function Jf(t,e,i,r=S){_n(t,e,i).then(()=>r()).catch(r)}o(Jf,"lchown");function Qf(t,e,i=S){En(t,e).then(()=>i()).catch(i)}o(Qf,"chmod");function Zf(t,e,i=S){xn(t,e).then(()=>i()).catch(i)}o(Zf,"lchmod");function ed(t,e,i,r=S){vn(t,e,i).then(()=>r()).catch(r)}o(ed,"utimes");function td(t,e,i,r=S){An(t,e,i).then(()=>r()).catch(r)}o(td,"lutimes");function id(t,e,i=S){i=typeof e=="function"?e:i,mi(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(id,"realpath");function rd(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,kn(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}o(rd,"access");function nd(t,e,i=S){throw new u(95)}o(nd,"watchFile");function od(t,e=S){throw new u(95)}o(od,"unwatchFile");function sd(t,e,i=S){throw new u(95)}o(sd,"watch");function ad(t,e){throw new u(95)}o(ad,"createReadStream");function ld(t,e){throw new u(95)}o(ld,"createWriteStream");function cd(t){new u(95)}o(cd,"rm");function ud(t){new u(95)}o(ud,"mkdtemp");function fd(t,e,i,r){new u(95)}o(fd,"copyFile");function dd(t){new u(95)}o(dd,"readv");function hd(t,e,i,r){throw new u(95)}o(hd,"writev");function pd(t){throw new u(95)}o(pd,"opendir");var $r=Yc(Mc(),1);var Wr=class extends $r.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};o(Wr,"ReadStream");var qr=class extends $r.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};o(qr,"WriteStream");var zr=class extends ne{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(zr,"MirrorFile");var ii=class extends li(ee){_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:i}){super(),this._sync=e,this._async=i,this._ready=this._initialize()}get metadata(){return{...super.metadata,name:ii.name,synchronous:!0,supportsProperties:this._sync.metadata.supportsProperties&&this._async.metadata.supportsProperties}}syncSync(e,i,r){this._sync.syncSync(e,i,r),this.enqueue({apiMethod:"sync",arguments:[e,i,r]})}openFileSync(e,i,r){return this._sync.openFileSync(e,i,r)}createFileSync(e,i,r,n){let s=this._sync.createFileSync(e,i,r,n);this.enqueue({apiMethod:"createFile",arguments:[e,i,r,n]});let a=s.statSync(),l=new Uint8Array(a.size);return s.readSync(l),new zr(this,e,i,a,l)}linkSync(e,i,r){this._sync.linkSync(e,i,r),this.enqueue({apiMethod:"link",arguments:[e,i,r]})}renameSync(e,i,r){this._sync.renameSync(e,i,r),this.enqueue({apiMethod:"rename",arguments:[e,i,r]})}statSync(e,i){return this._sync.statSync(e,i)}unlinkSync(e,i){this._sync.unlinkSync(e,i),this.enqueue({apiMethod:"unlink",arguments:[e,i]})}rmdirSync(e,i){this._sync.rmdirSync(e,i),this.enqueue({apiMethod:"rmdir",arguments:[e,i]})}mkdirSync(e,i,r){this._sync.mkdirSync(e,i,r),this.enqueue({apiMethod:"mkdir",arguments:[e,i,r]})}readdirSync(e,i){return this._sync.readdirSync(e,i)}existsSync(e,i){return this._sync.existsSync(e,i)}async crossCopyDirectory(e,i){if(e!=="/"){let n=await this._async.stat(e,$.Root);this._sync.mkdirSync(e,i,n.getCred())}let r=await this._async.readdir(e,$.Root);for(let n of r)await this.crossCopy(Ae(e,n))}async crossCopyFile(e,i){let r=await this._async.openFile(e,P.FromString("r"),$.Root),n=this._sync.createFileSync(e,P.FromString("w"),i,$.Root);try{let{size:s}=await r.stat(),a=new Uint8Array(s);await r.read(a),n.writeSync(a)}finally{await r.close(),n.closeSync()}}async crossCopy(e){let i=await this._async.stat(e,$.Root);i.isDirectory()?await this.crossCopyDirectory(e,i.mode):await this.crossCopyFile(e,i.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(i){throw new u(5,"AsyncMirror desync: "+i)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};o(ii,"AsyncMirrorFS");var Yo={name:"AsyncMirror",options:{sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if(!t?.metadata.synchronous)throw new u(22,"'sync' option must be a file system that supports synchronous operations")}},async:{type:"object",description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new ii(t)}};var ri=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};o(ri,"Mutex");var Ii=class{constructor(e){this.fs=e}_mu=new ri;async ready(){return await this.fs.ready(),this}get metadata(){return{...this.fs.metadata,name:"Locked<"+this.fs.metadata.name+">"}}async rename(e,i,r){await this._mu.lock(e),await this.fs.rename(e,i,r),this._mu.unlock(e)}renameSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,r)}async stat(e,i){await this._mu.lock(e);let r=await this.fs.stat(e,i);return this._mu.unlock(e),r}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,r){await this._mu.lock(e);let n=await this.fs.openFile(e,i,r);return this._mu.unlock(e),n}openFileSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this._mu.lock(e);let s=await this.fs.createFile(e,i,r,n);return this._mu.unlock(e),s}createFileSync(e,i,r,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this._mu.lock(e),await this.fs.mkdir(e,i,r),this._mu.unlock(e)}mkdirSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this._mu.lock(e);let r=await this.fs.readdir(e,i);return this._mu.unlock(e),r}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let r=await this.fs.exists(e,i);return this._mu.unlock(e),r}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,r){await this._mu.lock(e),await this.fs.link(e,i,r),this._mu.unlock(e)}linkSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this._mu.lock(e),await this.fs.sync(e,i,r),this._mu.unlock(e)}syncSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,r)}};o(Ii,"LockedFS");var Go="/.deleted",Li=class extends ne{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};o(Li,"OverlayFile");var Vr=class extends ee{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata.readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}get metadata(){return{...super.metadata,name:Ci.name,synchronous:this._readable.metadata.synchronous&&this._writable.metadata.synchronous,supportsProperties:this._readable.metadata.supportsProperties&&this._writable.metadata.supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,r){let n=r.getCred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.getCred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(Go,P.FromString("r"),$.Root),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=te(r)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,r)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e)}}renameSync(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,r)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e)}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e);let n=H.clone(await this._readable.stat(e,i));return n.mode|=146,n}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw u.ENOENT(e);let n=H.clone(this._readable.statSync(e,i));return n.mode|=146,n}}async openFile(e,i,r){if(await this._writable.exists(e,r))return this._writable.openFile(e,i,r);let n=await this._readable.openFile(e,P.FromString("r"),r),s=H.clone(await n.stat()),{buffer:a}=await n.read(new Uint8Array(s.size));return new Li(this,e,i,s,a)}openFileSync(e,i,r){if(this._writable.existsSync(e,r))return this._writable.openFileSync(e,i,r);let n=this._readable.openFileSync(e,P.FromString("r"),r),s=H.clone(n.statSync()),a=new Uint8Array(s.size);return n.readSync(a),new Li(this,e,i,s,a)}async createFile(e,i,r,n){return this.checkInitialized(),await this._writable.createFile(e,i,r,n),this.openFile(e,i,n)}createFileSync(e,i,r,n){return this.checkInitialized(),this._writable.createFileSync(e,i,r,n),this.openFileSync(e,i,n)}async link(e,i,r){this.checkInitialized(),await this._writable.link(e,i,r)}linkSync(e,i,r){this.checkInitialized(),this._writable.linkSync(e,i,r)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw u.ENOENT(e);await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw u.ENOENT(e);this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw u.ENOENT(e);if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw u.ENOTEMPTY(e);this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw u.ENOENT(e);if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw u.ENOTEMPTY(e);this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw u.EEXIST(e);await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw u.EEXIST(e);this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw u.ENOTDIR(e);let n=[];try{n.push(...await this._writable.readdir(e,i))}catch{}try{n.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let s={};return n.filter(a=>{let l=!s[a];return s[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw u.ENOTDIR(e);let n=[];try{n=n.concat(this._writable.readdirSync(e,i))}catch{}try{n=n.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let s={};return n.filter(a=>{let l=!s[a];return s[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
+
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(Go,P.FromString("w"),i);try{await r.write(D(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}catch(n){this._deleteLogError=n}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
|
|
4
|
+
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==Go)throw u.EPERM(e)}createParentDirectoriesSync(e,i){let r=N(e),n=[];for(;!this._writable.existsSync(r,i);)n.push(r),r=N(r);n=n.reverse();for(let s of n)this._writable.mkdirSync(s,this.statSync(s,i).mode,i)}async createParentDirectories(e,i){let r=N(e),n=[];for(;!await this._writable.exists(r,i);)n.push(r),r=N(r);n=n.reverse();for(let s of n){let a=await this.stat(s,i);await this._writable.mkdir(s,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw u.ENOENT(e);this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw u.ENOENT(e);if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let r=this.statSync(e,i);if(r.isDirectory()){this._writable.mkdirSync(e,r.mode,i);return}let n=new Uint8Array(r.size),s=this._readable.openFileSync(e,P.FromString("r"),i);s.readSync(n),s.closeSync();let a=this._writable.openFileSync(e,P.FromString("w"),i);a.writeSync(n),a.closeSync()}async copyToWritable(e,i){let r=await this.stat(e,i);if(r.isDirectory()){await this._writable.mkdir(e,r.mode,i);return}let n=new Uint8Array(r.size),s=await this._readable.openFile(e,P.FromString("r"),i);await s.read(n),await s.close();let a=await this._writable.openFile(e,P.FromString("w"),i);await a.write(n),await a.close()}};o(Vr,"UnlockedOverlayFS");var Ci=class extends Ii{async ready(){return await super.ready(),this}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}};o(Ci,"OverlayFS");var Xo={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new Ci(t)}};var Hr={};function Uc(...t){for(let e of t)Hr[e.name]=e}o(Uc,"registerBackend");Uc(Yo,fi,Xo);function Jo(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}o(Jo,"isBackend");async function gg(t,e){if(typeof e!="object"||e===null)throw new u(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e&&r;if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:Zr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new u(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new u(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}
|
|
5
|
+
Option description: ${r.description}`);r.validator&&await r.validator(n)}}o(gg,"checkOptions");function wg(t){return t!=null&&typeof t=="object"&&"backend"in t}o(wg,"isBackendConfig");async function Qo(t){let{backend:e}=t;if(!e)throw new u(1,"Missing backend");if(typeof t!="object"||t==null)throw new u(22,"Invalid options on configuration object.");let i=Object.keys(t).filter(n=>n!="backend");for(let n of i){let s=t[n];Jo(s)&&(s={backend:s}),wg(s)&&(t[n]=await Qo(s))}if(!e)throw new u(1,`Backend "${e}" is not available`);gg(e,t);let r=e.create(t);return await r.ready(),r}o(Qo,"resolveBackendConfig");var Kr=class{constructor(e){this.limit=e}cache=[];set(e,i){let r=this.cache.findIndex(n=>n.key===e);r!=-1?this.cache.splice(r,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(r=>r.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(r=>r.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};o(Kr,"LRUCache");var ni=class extends ne{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this.resetDirty())}syncSync(){throw new u(95)}async close(){this.sync()}closeSync(){throw new u(95)}};o(ni,"AsyncFile");var Yr=class extends Qr(ee){store;_cache;_ready;ready(){return this._ready}get metadata(){return{...super.metadata,name:this.store.name}}constructor({store:e,cacheSize:i}){super(),i>0&&(this._cache=new Kr(i)),this._ready=this._initialize(e)}async _initialize(e){return this.store=await e,await this.makeRootDirectory(),this}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,i,r){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let s=this.store.beginTransaction("readwrite"),a=N(e),l=j(e),c=N(i),f=j(i),d=await this.findINode(s,a),h=await this.getDirListing(s,d,a);if(!d.toStats().hasAccess(2,r))throw u.EACCES(e);if(!h[l])throw u.ENOENT(e);let b=h[l];if(delete h[l],(c+"/").indexOf(e+"/")===0)throw new u(16,a);let m,g;if(c===a?(m=d,g=h):(m=await this.findINode(s,c),g=await this.getDirListing(s,m,c)),g[f]){let y=await this.getINode(s,g[f],i);if(y.toStats().isFile())try{await s.remove(y.ino),await s.remove(g[f])}catch(A){throw await s.abort(),A}else throw u.EPERM(i)}g[f]=b;try{await s.put(d.ino,ae(h),!0),await s.put(m.ino,ae(g),!0)}catch(y){throw await s.abort(),y}await s.commit()}finally{n&&(this._cache=n)}}async stat(e,i){let r=this.store.beginTransaction("readonly"),n=await this.findINode(r,e);if(!n)throw u.ENOENT(e);let s=n.toStats();if(!s.hasAccess(4,i))throw u.EACCES(e);return s}async createFile(e,i,r,n){let s=this.store.beginTransaction("readwrite"),a=new Uint8Array(0),l=await this.commitNewFile(s,e,B.FILE,r,n,a);return new ni(this,e,i,l.toStats(),a)}async openFile(e,i,r){let n=this.store.beginTransaction("readonly"),s=await this.findINode(n,e),a=await n.get(s.ino);if(!s.toStats().hasAccess(i.mode,r))throw u.EACCES(e);if(!a)throw u.ENOENT(e);return new ni(this,e,i,s.toStats(),a)}async unlink(e,i){return this.removeEntry(e,!1,i)}async rmdir(e,i){if((await this.readdir(e,i)).length>0)throw u.ENOTEMPTY(e);await this.removeEntry(e,!0,i)}async mkdir(e,i,r){let n=this.store.beginTransaction("readwrite"),s=D("{}");await this.commitNewFile(n,e,B.DIRECTORY,i,r,s)}async readdir(e,i){let r=this.store.beginTransaction("readonly"),n=await this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw u.EACCES(e);return Object.keys(await this.getDirListing(r,n,e))}async sync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=await this._findINode(n,N(e),j(e)),a=await this.getINode(n,s,e),l=a.update(r);try{await n.put(a.ino,i,!0),l&&await n.put(s,a.data,!0)}catch(c){throw await n.abort(),c}await n.commit()}async link(e,i,r){let n=this.store.beginTransaction("readwrite"),s=N(e);if(!(await this.findINode(n,s)).toStats().hasAccess(4,r))throw u.EACCES(s);let l=N(i),c=await this.findINode(n,l),f=await this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw u.EACCES(l);let d=await this._findINode(n,s,j(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw u.EACCES(i);h.nlink++,f[j(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,ae(f),!0)}catch(b){throw n.abort(),b}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction("readwrite");if(await e.get(de)===void 0){let i=new fe;i.mode=511|B.DIRECTORY,await e.put(i.ino,D("{}"),!1),await e.put(de,i.data,!1),await e.commit()}}async _findINode(e,i,r,n=new Set){let s=Ae(i,r);if(n.has(s))throw new u(5,"Infinite loop detected while finding inode",s);if(n.add(s),this._cache){let a=this._cache.get(s);if(a)return a}if(i==="/"){if(r==="")return this._cache&&this._cache.set(s,de),de;{let a=await this.getINode(e,de,i),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(s,c),c}else throw u.ENOENT(ve(i,r))}}else{let a=await this.findINode(e,i,n),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(s,c),c}else throw u.ENOENT(ve(i,r))}}async findINode(e,i,r=new Set){let n=await this._findINode(e,N(i),j(i),r);return this.getINode(e,n,i)}async getINode(e,i,r){let n=await e.get(i);if(!n)throw u.ENOENT(r);return new fe(n.buffer)}async getDirListing(e,i,r){if(!i.toStats().isDirectory())throw u.ENOTDIR(r);let n=await e.get(i.ino);if(!n)throw u.ENOENT(r);return ci(n)}async addNewNode(e,i){let r=0,n=o(async()=>{if(++r===5)throw new u(5,"Unable to commit data to key-value store.");{let s=Tt();return await e.put(s,i,!1)?s:n()}},"reroll");return n()}async commitNewFile(e,i,r,n,s,a){let l=N(i),c=j(i),f=await this.findINode(e,l),d=await this.getDirListing(e,f,l);if(!f.toStats().hasAccess(2,s))throw u.EACCES(i);if(i==="/")throw u.EEXIST(i);if(d[c])throw await e.abort(),u.EEXIST(i);try{let h=new fe;return h.ino=await this.addNewNode(e,a),h.mode=n|r,h.uid=s.uid,h.gid=s.gid,h.size=a.length,d[c]=await this.addNewNode(e,h.data),await e.put(f.ino,ae(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,i,r){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction("readwrite"),s=N(e),a=await this.findINode(n,s),l=await this.getDirListing(n,a,s),c=j(e);if(!l[c])throw u.ENOENT(e);let f=l[c],d=await this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw u.EACCES(e);if(delete l[c],!i&&d.toStats().isDirectory())throw u.EISDIR(e);if(i&&!d.toStats().isDirectory())throw u.ENOTDIR(e);try{await n.put(a.ino,ae(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(f))}catch(h){throw await n.abort(),h}await n.commit()}};o(Yr,"AsyncStoreFileSystem");function Wc(t,e=0,i=0){ss(new $(e,i,e,i,e,i)),Ki(t)}o(Wc,"initialize");async function Sg(t){("backend"in t||t instanceof ee)&&(t={"/":t});for(let[e,i]of Object.entries(t))typeof i!="number"&&(i instanceof ee||(typeof i=="string"&&(i={backend:Hr[i]}),Jo(i)&&(i={backend:i}),t[e]=await Qo(i)));Wc(t)}o(Sg,"configure");var _g=jr;return Gc(Eg);})();
|
|
6
6
|
/*! Bundled license information:
|
|
7
7
|
|
|
8
8
|
ieee754/index.js:
|