@zenfs/core 0.16.2 → 0.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- "use strict";var ZenFS=(()=>{var id=Object.create;var Ai=Object.defineProperty;var rd=Object.getOwnPropertyDescriptor;var nd=Object.getOwnPropertyNames;var od=Object.getPrototypeOf,sd=Object.prototype.hasOwnProperty;var js=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),qs=t=>{throw TypeError(t)};var s=(t,e)=>Ai(t,"name",{value:e,configurable:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wr=(t,e)=>{for(var i in e)Ai(t,i,{get:e[i],enumerable:!0})},$s=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nd(e))!sd.call(t,n)&&n!==i&&Ai(t,n,{get:()=>e[n],enumerable:!(r=rd(e,n))||r.enumerable});return t};var Sr=(t,e,i)=>(i=t!=null?id(od(t)):{},$s(e||!t||!t.__esModule?Ai(i,"default",{value:t,enumerable:!0}):i,t)),ad=t=>$s(Ai({},"__esModule",{value:!0}),t);var x=(t,e,i)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&qs("Object expected");var r;i&&(r=e[js("asyncDispose")]),r===void 0&&(r=e[js("dispose")]),typeof r!="function"&&qs("Object not disposable"),t.push([i,r,e])}else i&&t.push([i]);return e},k=(t,e,i)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},n=a=>e=i?new r(a,e,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=t.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(n(l),o()))}catch(l){n(l)}if(i)throw e};return o()};var Zs=T(Fr=>{"use strict";Fr.byteLength=$d;Fr.toByteArray=Vd;Fr.fromByteArray=Kd;var je=[],Ee=[],qd=typeof Uint8Array<"u"?Uint8Array:Array,Vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tt=0,Js=Vn.length;Tt<Js;++Tt)je[Tt]=Vn[Tt],Ee[Vn.charCodeAt(Tt)]=Tt;var Tt,Js;Ee[45]=62;Ee[95]=63;function Qs(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var r=i===e?0:4-i%4;return[i,r]}s(Qs,"getLens");function $d(t){var e=Qs(t),i=e[0],r=e[1];return(i+r)*3/4-r}s($d,"byteLength");function zd(t,e,i){return(e+i)*3/4-i}s(zd,"_byteLength");function Vd(t){var e,i=Qs(t),r=i[0],n=i[1],o=new qd(zd(t,r,n)),a=0,c=n>0?r-4:r,l;for(l=0;l<c;l+=4)e=Ee[t.charCodeAt(l)]<<18|Ee[t.charCodeAt(l+1)]<<12|Ee[t.charCodeAt(l+2)]<<6|Ee[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=Ee[t.charCodeAt(l)]<<2|Ee[t.charCodeAt(l+1)]>>4,o[a++]=e&255),n===1&&(e=Ee[t.charCodeAt(l)]<<10|Ee[t.charCodeAt(l+1)]<<4|Ee[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Vd,"toByteArray");function Hd(t){return je[t>>18&63]+je[t>>12&63]+je[t>>6&63]+je[t&63]}s(Hd,"tripletToBase64");function Gd(t,e,i){for(var r,n=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(Hd(r));return n.join("")}s(Gd,"encodeChunk");function Kd(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,c=i-r;a<c;a+=o)n.push(Gd(t,a,a+o>c?c:a+o));return r===1?(e=t[i-1],n.push(je[e>>2]+je[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(je[e>>10]+je[e>>4&63]+je[e<<2&63]+"=")),n.join("")}s(Kd,"fromByteArray")});var ea=T(Hn=>{Hn.read=function(t,e,i,r,n){var o,a,c=n*8-r-1,l=(1<<c)-1,f=l>>1,d=-7,p=i?n-1:0,m=i?-1:1,b=t[e+p];for(p+=m,o=b&(1<<-d)-1,b>>=-d,d+=c;d>0;o=o*256+t[e+p],p+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+p],p+=m,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(b?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-f}return(b?-1:1)*a*Math.pow(2,o-r)};Hn.write=function(t,e,i,r,n,o){var a,c,l,f=o*8-n-1,d=(1<<f)-1,p=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=r?0:o-1,w=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?e+=m/l:e+=m*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=d?(c=0,a=d):a+p>=1?(c=(e*l-1)*Math.pow(2,n),a=a+p):(c=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;t[i+b]=c&255,b+=w,c/=256,n-=8);for(a=a<<n|c,f+=n;f>0;t[i+b]=a&255,b+=w,a/=256,f-=8);t[i+b-w]|=g*128}});var xe=T(si=>{"use strict";var Gn=Zs(),ni=ea(),ta=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;si.Buffer=y;si.SlowBuffer=ep;si.INSPECT_MAX_BYTES=50;var Ir=2147483647;si.kMaxLength=Ir;y.TYPED_ARRAY_SUPPORT=Yd();!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Yd(){try{let t=new Uint8Array(1),e={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Yd,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function ot(t){if(t>Ir)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(ot,"createBuffer");function y(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jn(t)}return oa(t,e,i)}s(y,"Buffer");y.poolSize=8192;function oa(t,e,i){if(typeof t=="string")return Jd(t,e);if(ArrayBuffer.isView(t))return Qd(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(qe(t,ArrayBuffer)||t&&qe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(t,SharedArrayBuffer)||t&&qe(t.buffer,SharedArrayBuffer)))return Yn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return y.from(r,e,i);let n=Zd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(oa,"from");y.from=function(t,e,i){return oa(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function sa(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(sa,"assertSize");function Xd(t,e,i){return sa(t),t<=0?ot(t):e!==void 0?typeof i=="string"?ot(t).fill(e,i):ot(t).fill(e):ot(t)}s(Xd,"alloc");y.alloc=function(t,e,i){return Xd(t,e,i)};function Jn(t){return sa(t),ot(t<0?0:Qn(t)|0)}s(Jn,"allocUnsafe");y.allocUnsafe=function(t){return Jn(t)};y.allocUnsafeSlow=function(t){return Jn(t)};function Jd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=aa(t,e)|0,r=ot(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(Jd,"fromString");function Kn(t){let e=t.length<0?0:Qn(t.length)|0,i=ot(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(Kn,"fromArrayLike");function Qd(t){if(qe(t,Uint8Array)){let e=new Uint8Array(t);return Yn(e.buffer,e.byteOffset,e.byteLength)}return Kn(t)}s(Qd,"fromArrayView");function Yn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,y.prototype),r}s(Yn,"fromArrayBuffer");function Zd(t){if(y.isBuffer(t)){let e=Qn(t.length)|0,i=ot(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||eo(t.length)?ot(0):Kn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Kn(t.data)}s(Zd,"fromObject");function Qn(t){if(t>=Ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ir.toString(16)+" bytes");return t|0}s(Qn,"checked");function ep(t){return+t!=t&&(t=0),y.alloc(+t)}s(ep,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(qe(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),qe(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==i[o]){r=e[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");y.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");y.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=y.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(qe(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function aa(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||qe(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Xn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return ma(t).length;default:if(n)return r?-1:Xn(t).length;e=(""+e).toLowerCase(),n=!0}}s(aa,"byteLength");y.byteLength=aa;function tp(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 up(this,e,i);case"utf8":case"utf-8":return la(this,e,i);case"ascii":return lp(this,e,i);case"latin1":case"binary":return fp(this,e,i);case"base64":return ap(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dp(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(tp,"slowToString");y.prototype._isBuffer=!0;function Ct(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(Ct,"swap");y.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)Ct(this,i,i+1);return this},"swap16");y.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)Ct(this,i,i+3),Ct(this,i+1,i+2);return this},"swap32");y.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)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");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?la(this,0,e):tp.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=si.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");ta&&(y.prototype[ta]=y.prototype.inspect);y.prototype.compare=s(function(e,i,r,n,o){if(qe(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,c=r-i,l=Math.min(a,c),f=this.slice(n,o),d=e.slice(i,r);for(let p=0;p<l;++p)if(f[p]!==d[p]){a=f[p],c=d[p];break}return a<c?-1:c<a?1:0},"compare");function ca(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,eo(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,r)),y.isBuffer(e))return e.length===0?-1:ia(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):ia(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(ca,"bidirectionalIndexOf");function ia(t,e,i,r,n){let o=1,a=t.length,c=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,p){return o===1?d[p]:d.readUInt16BE(p*o)}s(l,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(l(t,f)===l(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let p=0;p<c;p++)if(l(t,f+p)!==l(e,p)){d=!1;break}if(d)return f}return-1}s(ia,"arrayIndexOf");y.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");y.prototype.indexOf=s(function(e,i,r){return ca(this,e,i,r,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,r){return ca(this,e,i,r,!1)},"lastIndexOf");function ip(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=e.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let c=parseInt(e.substr(a*2,2),16);if(eo(c))return a;t[i+a]=c}return a}s(ip,"hexWrite");function rp(t,e,i,r){return Pr(Xn(e,t.length-i),t,i,r)}s(rp,"utf8Write");function np(t,e,i,r){return Pr(mp(e),t,i,r)}s(np,"asciiWrite");function op(t,e,i,r){return Pr(ma(e),t,i,r)}s(op,"base64Write");function sp(t,e,i,r){return Pr(bp(e,t.length-i),t,i,r)}s(sp,"ucs2Write");y.prototype.write=s(function(e,i,r,n){if(i===void 0)n="utf8",r=this.length,i=0;else if(r===void 0&&typeof i=="string")n=i,r=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return ip(this,e,i,r);case"utf8":case"utf-8":return rp(this,e,i,r);case"ascii":case"latin1":case"binary":return np(this,e,i,r);case"base64":return op(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sp(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ap(t,e,i){return e===0&&i===t.length?Gn.fromByteArray(t):Gn.fromByteArray(t.slice(e,i))}s(ap,"base64Slice");function la(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=i){let l,f,d,p;switch(c){case 1:o<128&&(a=o);break;case 2:l=t[n+1],(l&192)===128&&(p=(o&31)<<6|l&63,p>127&&(a=p));break;case 3:l=t[n+1],f=t[n+2],(l&192)===128&&(f&192)===128&&(p=(o&15)<<12|(l&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:l=t[n+1],f=t[n+2],d=t[n+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(p=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=c}return cp(r)}s(la,"utf8Slice");var ra=4096;function cp(t){let e=t.length;if(e<=ra)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=ra));return i}s(cp,"decodeCodePointsArray");function lp(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]&127);return r}s(lp,"asciiSlice");function fp(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}s(fp,"latin1Slice");function up(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=e;o<i;++o)n+=gp[t[o]];return n}s(up,"hexSlice");function dp(t,e,i){let r=t.slice(e,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(dp,"utf16leSlice");y.prototype.slice=s(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,y.prototype),n},"slice");function ee(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(ee,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||ee(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||ee(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||ee(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");y.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=i,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||ee(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||ee(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||ee(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),ni.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),ni.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||ee(e,8,this.length),ni.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||ee(e,8,this.length),ni.read(this,e,!1,52,8)},"readDoubleBE");function ue(t,e,i,r,n,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}s(ue,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ue(this,e,i,r,c,0)}let o=1,a=0;for(this[i]=e&255;++a<r&&(o*=256);)this[i+a]=e/o&255;return i+r},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ue(this,e,i,r,c,0)}let o=r-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+r},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(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 fa(t,e,i,r,n){ya(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(fa,"wrtBigUInt64LE");function ua(t,e,i,r,n){ya(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(ua,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=yt(s(function(e,i=0){return fa(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=yt(s(function(e,i=0){return ua(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ue(this,e,i,r,l-1,-l)}let o=0,a=1,c=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ue(this,e,i,r,l-1,-l)}let o=r-1,a=1,c=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntBE");y.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=yt(s(function(e,i=0){return fa(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=yt(s(function(e,i=0){return ua(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function da(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(da,"checkIEEE754");function pa(t,e,i,r,n){return e=+e,i=i>>>0,n||da(t,e,i,4,34028234663852886e22,-34028234663852886e22),ni.write(t,e,i,r,23,4),i+4}s(pa,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,r){return pa(this,e,i,!0,r)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,r){return pa(this,e,i,!1,r)},"writeFloatBE");function ha(t,e,i,r,n){return e=+e,i=i>>>0,n||da(t,e,i,8,17976931348623157e292,-17976931348623157e292),ni.write(t,e,i,r,52,8),i+8}s(ha,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,r){return ha(this,e,i,!0,r)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,r){return ha(this,e,i,!1,r)},"writeDoubleBE");y.prototype.copy=s(function(e,i,r,n){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-i<n-r&&(n=e.length-i+r);let o=n-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),i),o},"copy");y.prototype.fill=s(function(e,i,r,n){if(typeof e=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<r;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,n),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%c]}return this},"fill");var ri={};function Zn(t,e,i){ri[t]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}s(Zn,"E");Zn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Zn("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=na(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=na(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function na(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(na,"addNumericalSeparator");function pp(t,e,i){oi(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Hi(e,t.length-(i+1))}s(pp,"checkBounds");function ya(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",c;throw o>3?e===0||e===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${e}${a} and <= ${i}${a}`,new ri.ERR_OUT_OF_RANGE("value",c,t)}pp(r,n,o)}s(ya,"checkIntBI");function oi(t,e){if(typeof t!="number")throw new ri.ERR_INVALID_ARG_TYPE(e,"number",t)}s(oi,"validateNumber");function Hi(t,e,i){throw Math.floor(t)!==t?(oi(t,i),new ri.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new ri.ERR_BUFFER_OUT_OF_BOUNDS:new ri.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Hi,"boundsError");var hp=/[^+/0-9A-Za-z-_]/g;function yp(t){if(t=t.split("=")[0],t=t.trim().replace(hp,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(yp,"base64clean");function Xn(t,e){e=e||1/0;let i,r=t.length,n=null,o=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(Xn,"utf8ToBytes");function mp(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(mp,"asciiToBytes");function bp(t,e){let i,r,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(bp,"utf16leToBytes");function ma(t){return Gn.toByteArray(yp(t))}s(ma,"base64ToBytes");function Pr(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}s(Pr,"blitBuffer");function qe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(qe,"isInstance");function eo(t){return t!==t}s(eo,"numberIsNaN");var gp=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 yt(t){return typeof BigInt>"u"?wp:t}s(yt,"defineBigIntMethod");function wp(){throw new Error("BigInt not supported")}s(wp,"BufferBigIntNotDefined")});var W=T((jS,qa)=>{"use strict";qa.exports={ArrayIsArray:s(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"FunctionPrototypeSymbolHasInstance"),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:s(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:s(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:s(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(t){return t.trim()},"StringPrototypeTrim"),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:s(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var li=T(($S,Br)=>{"use strict";var{AbortController:$a,AbortSignal:_p}=typeof self<"u"?self:typeof window<"u"?window:void 0;Br.exports=$a;Br.exports.AbortSignal=_p;Br.exports.default=$a});var Zi=T((zS,co)=>{"use strict";var fi=typeof Reflect=="object"?Reflect:null,za=fi&&typeof fi.apply=="function"?fi.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Dr;fi&&typeof fi.ownKeys=="function"?Dr=fi.ownKeys:Object.getOwnPropertySymbols?Dr=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Dr=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function Ep(t){console&&console.warn&&console.warn(t)}s(Ep,"ProcessEmitWarning");var Ha=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function N(){N.init.call(this)}s(N,"EventEmitter");co.exports=N;co.exports.once=Fp;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var Va=10;function Mr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Mr,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Va},"get"),set:s(function(t){if(typeof t!="number"||t<0||Ha(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Va=t},"set")});N.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};N.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ha(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 Ga(t){return t._maxListeners===void 0?N.defaultMaxListeners:t._maxListeners}s(Ga,"_getMaxListeners");N.prototype.getMaxListeners=s(function(){return Ga(this)},"getMaxListeners");N.prototype.emit=s(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")za(l,this,i);else for(var f=l.length,d=Qa(l,f),r=0;r<f;++r)za(d[r],this,i);return!0},"emit");function Ka(t,e,i,r){var n,o,a;if(Mr(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=Ga(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,Ep(c)}return t}s(Ka,"_addListener");N.prototype.addListener=s(function(e,i){return Ka(this,e,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=s(function(e,i){return Ka(this,e,i,!0)},"prependListener");function xp(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(xp,"onceWrapper");function Ya(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=xp.bind(r);return n.listener=i,r.wrapFn=n,n}s(Ya,"_onceWrap");N.prototype.once=s(function(e,i){return Mr(i),this.on(e,Ya(this,e,i)),this},"once");N.prototype.prependOnceListener=s(function(e,i){return Mr(i),this.prependListener(e,Ya(this,e,i)),this},"prependOnceListener");N.prototype.removeListener=s(function(e,i){var r,n,o,a,c;if(Mr(i),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||i));else if(typeof r!="function"){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){c=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():kp(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=s(function(e){var i,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(e,i[n]);return this},"removeAllListeners");function Xa(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?vp(n):Qa(n,n.length)}s(Xa,"_listeners");N.prototype.listeners=s(function(e){return Xa(this,e,!0)},"listeners");N.prototype.rawListeners=s(function(e){return Xa(this,e,!1)},"rawListeners");N.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ja.call(t,e)};N.prototype.listenerCount=Ja;function Ja(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Ja,"listenerCount");N.prototype.eventNames=s(function(){return this._eventsCount>0?Dr(this._events):[]},"eventNames");function Qa(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(Qa,"arrayClone");function kp(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(kp,"spliceOne");function vp(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(vp,"unwrapListeners");function Fp(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,o),r(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),Za(t,e,o,{once:!0}),e!=="error"&&Ip(t,n,{once:!0})})}s(Fp,"once");function Ip(t,e,i){typeof t.on=="function"&&Za(t,"error",e,i)}s(Ip,"addErrorHandlerIfEventEmitter");function Za(t,e,i,r){if(typeof t.on=="function")r.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){r.once&&t.removeEventListener(e,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(Za,"eventTargetAgnosticAddListener")});var re=T((HS,fo)=>{"use strict";var Pp=xe(),{kResistStopPropagation:Ap,SymbolDispose:Op}=W(),Tp=globalThis.AbortSignal||li().AbortSignal,Cp=globalThis.AbortController||li().AbortController,Rp=Object.getPrototypeOf(async function(){}).constructor,ec=globalThis.Blob||Pp.Blob,Np=s(typeof ec<"u"?function(e){return e instanceof ec}:function(e){return!1},"isBlob"),tc=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Lp=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),lo=class extends Error{static{s(this,"AggregateError")}constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
2
- `;super(i),this.name="AggregateError",this.errors=e}};fo.exports={AggregateError:lo,kEmptyObject:Object.freeze({}),once:s(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:s(function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},"createDeferredPromise"),promisify:s(function(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},"format"),inspect:s(function(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(t){return t instanceof Rp},"isAsyncFunction"),isArrayBufferView:s(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:Np,deprecate:s(function(t,e){return t},"deprecate"),addAbortListener:Zi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);tc(e,"signal"),Lp(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Ap]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Op](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:Tp.any||s(function(e){if(e.length===1)return e[0];let i=new Cp,r=s(()=>i.abort(),"abort");return e.forEach(n=>{tc(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};fo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var se=T((KS,nc)=>{"use strict";var{format:Bp,inspect:Ur,AggregateError:Dp}=re(),Mp=globalThis.AggregateError||Dp,Up=Symbol("kIsNodeError"),Wp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],jp=/^([A-Z][a-z0-9]*)+$/,qp="__node_internal_",Wr={};function Dt(t,e){if(!t)throw new Wr.ERR_INTERNAL_ASSERTION(e)}s(Dt,"assert");function ic(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(ic,"addNumericalSeparator");function $p(t,e,i){if(typeof e=="function")return Dt(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 Dt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Bp(e,...i)}s($p,"getMessage");function te(t,e,i){i||(i=Error);class r extends i{static{s(this,"NodeError")}constructor(...o){super($p(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[Up]=!0,Wr[t]=r}s(te,"E");function rc(t){let e=qp+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(rc,"hideStackFrames");function zp(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Mp([e,t],e.message);return i.code=e.code,i}return t||e}s(zp,"aggregateTwoErrors");var uo=class extends Error{static{s(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Wr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Dt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";t.endsWith(" argument")?r+=`${t} `:r+=`"${t}" ${t.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let l of e)Dt(typeof l=="string","All expected entries have to be of type string"),Wp.includes(l)?n.push(l.toLowerCase()):jp.test(l)?o.push(l):(Dt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();r+=`one of type ${n.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();r+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();r+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${i.constructor.name}`;else{let l=Ur(i,{depth:-1});r+=`. Received ${l}`}}else{let l=Ur(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof i} (${l})`}return r},TypeError);te("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=Ur(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);te("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);te("ERR_MISSING_ARGS",(...t)=>{Dt(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);te("ERR_OUT_OF_RANGE",(t,e,i)=>{Dt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=ic(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=ic(r)),r+="n"):r=Ur(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);nc.exports={AbortError:uo,aggregateTwoErrors:rc(zp),hideStackFrames:rc,codes:Wr}});var di=T((XS,hc)=>{"use strict";var{ArrayIsArray:ho,ArrayPrototypeIncludes:cc,ArrayPrototypeJoin:lc,ArrayPrototypeMap:Vp,NumberIsInteger:yo,NumberIsNaN:Hp,NumberMAX_SAFE_INTEGER:Gp,NumberMIN_SAFE_INTEGER:Kp,NumberParseInt:Yp,ObjectPrototypeHasOwnProperty:Xp,RegExpPrototypeExec:fc,String:Jp,StringPrototypeToUpperCase:Qp,StringPrototypeTrim:Zp}=W(),{hideStackFrames:ve,codes:{ERR_SOCKET_BAD_PORT:eh,ERR_INVALID_ARG_TYPE:ne,ERR_INVALID_ARG_VALUE:ui,ERR_OUT_OF_RANGE:Mt,ERR_UNKNOWN_SIGNAL:oc}}=se(),{normalizeEncoding:th}=re(),{isAsyncFunction:ih,isArrayBufferView:rh}=re().types,sc={};function nh(t){return t===(t|0)}s(nh,"isInt32");function oh(t){return t===t>>>0}s(oh,"isUint32");var sh=/^[0-7]+$/,ah="must be a 32-bit unsigned integer or an octal string";function ch(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(fc(sh,t)===null)throw new ui(e,t,ah);t=Yp(t,8)}return uc(t,e),t}s(ch,"parseFileMode");var lh=ve((t,e,i=Kp,r=Gp)=>{if(typeof t!="number")throw new ne(e,"number",t);if(!yo(t))throw new Mt(e,"an integer",t);if(t<i||t>r)throw new Mt(e,`>= ${i} && <= ${r}`,t)}),fh=ve((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new ne(e,"number",t);if(!yo(t))throw new Mt(e,"an integer",t);if(t<i||t>r)throw new Mt(e,`>= ${i} && <= ${r}`,t)}),uc=ve((t,e,i=!1)=>{if(typeof t!="number")throw new ne(e,"number",t);if(!yo(t))throw new Mt(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new Mt(e,`>= ${r} && <= ${n}`,t)});function mo(t,e){if(typeof t!="string")throw new ne(e,"string",t)}s(mo,"validateString");function uh(t,e,i=void 0,r){if(typeof t!="number")throw new ne(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Hp(t))throw new Mt(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(uh,"validateNumber");var dh=ve((t,e,i)=>{if(!cc(i,t)){let n="must be one of: "+lc(Vp(i,o=>typeof o=="string"?`'${o}'`:Jp(o)),", ");throw new ui(e,t,n)}});function dc(t,e){if(typeof t!="boolean")throw new ne(e,"boolean",t)}s(dc,"validateBoolean");function po(t,e,i){return t==null||!Xp(t,e)?i:t[e]}s(po,"getOwnPropertyValueOrDefault");var ph=ve((t,e,i=null)=>{let r=po(i,"allowArray",!1),n=po(i,"allowFunction",!1);if(!po(i,"nullable",!1)&&t===null||!r&&ho(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new ne(e,"Object",t)}),hh=ve((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ne(e,"a dictionary",t)}),jr=ve((t,e,i=0)=>{if(!ho(t))throw new ne(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ui(e,t,r)}});function yh(t,e){jr(t,e);for(let i=0;i<t.length;i++)mo(t[i],`${e}[${i}]`)}s(yh,"validateStringArray");function mh(t,e){jr(t,e);for(let i=0;i<t.length;i++)dc(t[i],`${e}[${i}]`)}s(mh,"validateBooleanArray");function bh(t,e){jr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new ne(n,"AbortSignal",r);pc(r,n)}}s(bh,"validateAbortSignalArray");function gh(t,e="signal"){if(mo(t,e),sc[t]===void 0)throw sc[Qp(t)]!==void 0?new oc(t+" (signals must use all capital letters)"):new oc(t)}s(gh,"validateSignalName");var wh=ve((t,e="buffer")=>{if(!rh(t))throw new ne(e,["Buffer","TypedArray","DataView"],t)});function Sh(t,e){let i=th(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ui("encoding",e,`is invalid for data of length ${r}`)}s(Sh,"validateEncoding");function _h(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Zp(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new eh(e,t,i);return t|0}s(_h,"validatePort");var pc=ve((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ne(e,"AbortSignal",t)}),Eh=ve((t,e)=>{if(typeof t!="function")throw new ne(e,"Function",t)}),xh=ve((t,e)=>{if(typeof t!="function"||ih(t))throw new ne(e,"Function",t)}),kh=ve((t,e)=>{if(t!==void 0)throw new ne(e,"undefined",t)});function vh(t,e,i){if(!cc(i,t))throw new ne(e,`('${lc(i,"|")}')`,t)}s(vh,"validateUnion");var Fh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ac(t,e){if(typeof t>"u"||!fc(Fh,t))throw new ui(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ac,"validateLinkHeaderFormat");function Ih(t){if(typeof t=="string")return ac(t,"hints"),t;if(ho(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];ac(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ui("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Ih,"validateLinkHeaderValue");hc.exports={isInt32:nh,isUint32:oh,parseFileMode:ch,validateArray:jr,validateStringArray:yh,validateBooleanArray:mh,validateAbortSignalArray:bh,validateBoolean:dc,validateBuffer:wh,validateDictionary:hh,validateEncoding:Sh,validateFunction:Eh,validateInt32:fh,validateInteger:lh,validateNumber:uh,validateObject:ph,validateOneOf:dh,validatePlainFunction:xh,validatePort:_h,validateSignalName:gh,validateString:mo,validateUint32:uc,validateUndefined:kh,validateUnion:vh,validateAbortSignal:pc,validateLinkHeaderValue:Ih}});var St=T((QS,gc)=>{var V=gc.exports={},Ve,He;function bo(){throw new Error("setTimeout has not been defined")}s(bo,"defaultSetTimout");function go(){throw new Error("clearTimeout has not been defined")}s(go,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ve=setTimeout:Ve=bo}catch{Ve=bo}try{typeof clearTimeout=="function"?He=clearTimeout:He=go}catch{He=go}})();function yc(t){if(Ve===setTimeout)return setTimeout(t,0);if((Ve===bo||!Ve)&&setTimeout)return Ve=setTimeout,setTimeout(t,0);try{return Ve(t,0)}catch{try{return Ve.call(null,t,0)}catch{return Ve.call(this,t,0)}}}s(yc,"runTimeout");function Ph(t){if(He===clearTimeout)return clearTimeout(t);if((He===go||!He)&&clearTimeout)return He=clearTimeout,clearTimeout(t);try{return He(t)}catch{try{return He.call(null,t)}catch{return He.call(this,t)}}}s(Ph,"runClearTimeout");var st=[],pi=!1,Ut,qr=-1;function Ah(){!pi||!Ut||(pi=!1,Ut.length?st=Ut.concat(st):qr=-1,st.length&&mc())}s(Ah,"cleanUpNextTick");function mc(){if(!pi){var t=yc(Ah);pi=!0;for(var e=st.length;e;){for(Ut=st,st=[];++qr<e;)Ut&&Ut[qr].run();qr=-1,e=st.length}Ut=null,pi=!1,Ph(t)}}s(mc,"drainQueue");V.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];st.push(new bc(t,e)),st.length===1&&!pi&&yc(mc)};function bc(t,e){this.fun=t,this.array=e}s(bc,"Item");bc.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function at(){}s(at,"noop");V.on=at;V.addListener=at;V.once=at;V.off=at;V.removeListener=at;V.removeAllListeners=at;V.emit=at;V.prependListener=at;V.prependOnceListener=at;V.listeners=function(t){return[]};V.binding=function(t){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(t){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var Ke=T((e_,Rc)=>{"use strict";var{SymbolAsyncIterator:wc,SymbolIterator:Sc,SymbolFor:Wt}=W(),_c=Wt("nodejs.stream.destroyed"),Ec=Wt("nodejs.stream.errored"),wo=Wt("nodejs.stream.readable"),So=Wt("nodejs.stream.writable"),xc=Wt("nodejs.stream.disturbed"),Oh=Wt("nodejs.webstream.isClosedPromise"),Th=Wt("nodejs.webstream.controllerErrorFunction");function $r(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s($r,"isReadableNodeStream");function zr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(zr,"isWritableNodeStream");function Ch(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Ch,"isDuplexNodeStream");function Ge(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(Ge,"isNodeStream");function kc(t){return!!(t&&!Ge(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(kc,"isReadableStream");function vc(t){return!!(t&&!Ge(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(vc,"isWritableStream");function Fc(t){return!!(t&&!Ge(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Fc,"isTransformStream");function Rh(t){return kc(t)||vc(t)||Fc(t)}s(Rh,"isWebStream");function Nh(t,e){return t==null?!1:e===!0?typeof t[wc]=="function":e===!1?typeof t[Sc]=="function":typeof t[wc]=="function"||typeof t[Sc]=="function"}s(Nh,"isIterable");function Vr(t){if(!Ge(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[_c]||r!=null&&r.destroyed)}s(Vr,"isDestroyed");function Ic(t){if(!zr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ic,"isWritableEnded");function Lh(t,e){if(!zr(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(Lh,"isWritableFinished");function Bh(t){if(!$r(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Bh,"isReadableEnded");function Pc(t,e){if(!$r(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Pc,"isReadableFinished");function Ac(t){return t&&t[wo]!=null?t[wo]:typeof t?.readable!="boolean"?null:Vr(t)?!1:$r(t)&&t.readable&&!Pc(t)}s(Ac,"isReadable");function Oc(t){return t&&t[So]!=null?t[So]:typeof t?.writable!="boolean"?null:Vr(t)?!1:zr(t)&&t.writable&&!Ic(t)}s(Oc,"isWritable");function Dh(t,e){return Ge(t)?Vr(t)?!0:!(e?.readable!==!1&&Ac(t)||e?.writable!==!1&&Oc(t)):null}s(Dh,"isFinished");function Mh(t){var e,i;return Ge(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Mh,"isWritableErrored");function Uh(t){var e,i;return Ge(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Uh,"isReadableErrored");function Wh(t){if(!Ge(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"&&Tc(t)?t._closed:null}s(Wh,"isClosed");function Tc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Tc,"isOutgoingMessage");function Cc(t){return typeof t._sent100=="boolean"&&Tc(t)}s(Cc,"isServerResponse");function jh(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(jh,"isServerRequest");function qh(t){if(!Ge(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Cc(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(qh,"willEmitClose");function $h(t){var e;return!!(t&&((e=t[xc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s($h,"isDisturbed");function zh(t){var e,i,r,n,o,a,c,l,f,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[Ec])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(c=t._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(zh,"isErrored");Rc.exports={isDestroyed:Vr,kIsDestroyed:_c,isDisturbed:$h,kIsDisturbed:xc,isErrored:zh,kIsErrored:Ec,isReadable:Ac,kIsReadable:wo,kIsClosedPromise:Oh,kControllerErrorFunction:Th,kIsWritable:So,isClosed:Wh,isDuplexNodeStream:Ch,isFinished:Dh,isIterable:Nh,isReadableNodeStream:$r,isReadableStream:kc,isReadableEnded:Bh,isReadableFinished:Pc,isReadableErrored:Uh,isNodeStream:Ge,isWebStream:Rh,isWritable:Oc,isWritableNodeStream:zr,isWritableStream:vc,isWritableEnded:Ic,isWritableFinished:Lh,isWritableErrored:Mh,isServerRequest:jh,isServerResponse:Cc,willEmitClose:qh,isTransformStream:Fc}});var ct=T((i_,vo)=>{var _t=St(),{AbortError:qc,codes:Vh}=se(),{ERR_INVALID_ARG_TYPE:Hh,ERR_STREAM_PREMATURE_CLOSE:Nc}=Vh,{kEmptyObject:Eo,once:xo}=re(),{validateAbortSignal:Gh,validateFunction:Kh,validateObject:Yh,validateBoolean:Xh}=di(),{Promise:Jh,PromisePrototypeThen:Qh,SymbolDispose:$c}=W(),{isClosed:Zh,isReadable:Lc,isReadableNodeStream:_o,isReadableStream:ey,isReadableFinished:Bc,isReadableErrored:Dc,isWritable:Mc,isWritableNodeStream:Uc,isWritableStream:ty,isWritableFinished:Wc,isWritableErrored:jc,isNodeStream:iy,willEmitClose:ry,kIsClosedPromise:ny}=Ke(),hi;function oy(t){return t.setHeader&&typeof t.abort=="function"}s(oy,"isRequest");var ko=s(()=>{},"nop");function zc(t,e,i){var r,n;if(arguments.length===2?(i=e,e=Eo):e==null?e=Eo:Yh(e,"options"),Kh(i,"callback"),Gh(e.signal,"options.signal"),i=xo(i),ey(t)||ty(t))return sy(t,e,i);if(!iy(t))throw new Hh("stream",["ReadableStream","WritableStream","Stream"],t);let o=(r=e.readable)!==null&&r!==void 0?r:_o(t),a=(n=e.writable)!==null&&n!==void 0?n:Uc(t),c=t._writableState,l=t._readableState,f=s(()=>{t.writable||m()},"onlegacyfinish"),d=ry(t)&&_o(t)===o&&Uc(t)===a,p=Wc(t,!1),m=s(()=>{p=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||b)&&i.call(t)},"onfinish"),b=Bc(t,!1),w=s(()=>{b=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||p)&&i.call(t)},"onend"),g=s(G=>{i.call(t,G)},"onerror"),A=Zh(t),E=s(()=>{A=!0;let G=jc(t)||Dc(t);if(G&&typeof G!="boolean")return i.call(t,G);if(o&&!b&&_o(t,!0)&&!Bc(t,!1))return i.call(t,new Nc);if(a&&!p&&!Wc(t,!1))return i.call(t,new Nc);i.call(t)},"onclose"),C=s(()=>{A=!0;let G=jc(t)||Dc(t);if(G&&typeof G!="boolean")return i.call(t,G);i.call(t)},"onclosed"),q=s(()=>{t.req.on("finish",m)},"onrequest");oy(t)?(t.on("complete",m),d||t.on("abort",E),t.req?q():t.on("request",q)):a&&!c&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",E),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",g),t.on("close",E),A?_t.nextTick(E):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||_t.nextTick(C):(!o&&(!d||Lc(t))&&(p||Mc(t)===!1)||!a&&(!d||Mc(t))&&(b||Lc(t)===!1)||l&&t.req&&t.aborted)&&_t.nextTick(C);let O=s(()=>{i=ko,t.removeListener("aborted",E),t.removeListener("complete",m),t.removeListener("abort",E),t.removeListener("request",q),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",E)},"cleanup");if(e.signal&&!A){let G=s(()=>{let Ft=i;O(),Ft.call(t,new qc(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)_t.nextTick(G);else{hi=hi||re().addAbortListener;let Ft=hi(e.signal,G),me=i;i=xo((...Xt)=>{Ft[$c](),me.apply(t,Xt)})}}return O}s(zc,"eos");function sy(t,e,i){let r=!1,n=ko;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new qc(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)_t.nextTick(n);else{hi=hi||re().addAbortListener;let a=hi(e.signal,n),c=i;i=xo((...l)=>{a[$c](),c.apply(t,l)})}let o=s((...a)=>{r||_t.nextTick(()=>i.apply(t,a))},"resolverFn");return Qh(t[ny].promise,o,o),ko}s(sy,"eosWeb");function ay(t,e){var i;let r=!1;return e===null&&(e=Eo),(i=e)!==null&&i!==void 0&&i.cleanup&&(Xh(e.cleanup,"cleanup"),r=e.cleanup),new Jh((n,o)=>{let a=zc(t,e,c=>{r&&a(),c?o(c):n()})})}s(ay,"finished");vo.exports=zc;vo.exports.finished=ay});var jt=T((n_,Qc)=>{"use strict";var Ye=St(),{aggregateTwoErrors:cy,codes:{ERR_MULTIPLE_CALLBACK:ly},AbortError:fy}=se(),{Symbol:Gc}=W(),{kIsDestroyed:uy,isDestroyed:dy,isFinished:py,isServerRequest:hy}=Ke(),Kc=Gc("kDestroy"),Fo=Gc("kConstruct");function Yc(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Yc,"checkError");function yy(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):(Yc(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Vc(this,t,e):this.once(Kc,function(o){Vc(this,cy(o,t),e)}),this)}s(yy,"destroy");function Vc(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,c=t._writableState;Yc(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ye.nextTick(my,t,o):Ye.nextTick(Xc,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Vc,"_destroy");function my(t,e){Io(t,e),Xc(t)}s(my,"emitErrorCloseNT");function Xc(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Xc,"emitCloseNT");function Io(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(Io,"emitErrorNT");function by(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(by,"undestroy");function Po(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?Ye.nextTick(Io,t,e):Io(t,e))}s(Po,"errorOrDestroy");function gy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,r=t._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),t.once(Fo,e),!(t.listenerCount(Fo)>1)&&Ye.nextTick(wy,t)}s(gy,"construct");function wy(t){let e=!1;function i(r){if(e){Po(t,r??new ly);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Kc,r):r?Po(t,r,!0):Ye.nextTick(Sy,t)}s(i,"onConstruct");try{t._construct(r=>{Ye.nextTick(i,r)})}catch(r){Ye.nextTick(i,r)}}s(wy,"constructNT");function Sy(t){t.emit(Fo)}s(Sy,"emitConstructNT");function Hc(t){return t?.setHeader&&typeof t.abort=="function"}s(Hc,"isRequest");function Jc(t){t.emit("close")}s(Jc,"emitCloseLegacy");function _y(t,e){t.emit("error",e),Ye.nextTick(Jc,t)}s(_y,"emitErrorCloseLegacy");function Ey(t,e){!t||dy(t)||(!e&&!py(t)&&(e=new fy),hy(t)?(t.socket=null,t.destroy(e)):Hc(t)?t.abort():Hc(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ye.nextTick(_y,t,e):Ye.nextTick(Jc,t),t.destroyed||(t[uy]=!0))}s(Ey,"destroyer");Qc.exports={construct:gy,destroyer:Ey,destroy:yy,undestroy:by,errorOrDestroy:Po}});var Kr=T((s_,el)=>{"use strict";var{ArrayIsArray:xy,ObjectSetPrototypeOf:Zc}=W(),{EventEmitter:Hr}=Zi();function Gr(t){Hr.call(this,t)}s(Gr,"Stream");Zc(Gr.prototype,Hr.prototype);Zc(Gr,Hr);Gr.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function c(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(c,"onclose");function l(d){f(),Hr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ao(i,"error",l),Ao(t,"error",l);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),t.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function Ao(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):xy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Ao,"prependListener");el.exports={Stream:Gr,prependListener:Ao}});var er=T((c_,Yr)=>{"use strict";var{SymbolDispose:ky}=W(),{AbortError:tl,codes:vy}=se(),{isNodeStream:il,isWebStream:Fy,kControllerErrorFunction:Iy}=Ke(),Py=ct(),{ERR_INVALID_ARG_TYPE:rl}=vy,Oo,Ay=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new rl(e,"AbortSignal",t)},"validateAbortSignal");Yr.exports.addAbortSignal=s(function(e,i){if(Ay(e,"signal"),!il(i)&&!Fy(i))throw new rl("stream",["ReadableStream","WritableStream","Stream"],i);return Yr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Yr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=il(e)?()=>{e.destroy(new tl(void 0,{cause:t.reason}))}:()=>{e[Iy](new tl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Oo=Oo||re().addAbortListener;let r=Oo(t,i);Py(e,r[ky])}return e}});var sl=T((u_,ol)=>{"use strict";var{StringPrototypeSlice:nl,SymbolIterator:Oy,TypedArrayPrototypeSet:Xr,Uint8Array:Ty}=W(),{Buffer:To}=xe(),{inspect:Cy}=re();ol.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return To.alloc(0);let i=To.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Xr(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}*[Oy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let o=r.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=nl(o,0,e),this.head=r,r.data=nl(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=To.allocUnsafe(e),r=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Xr(i,a,r-e),e-=a.length;else{e===a.length?(Xr(i,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Xr(i,new Ty(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return Cy(this,{...i,depth:0,customInspect:!1})}}});var tr=T((p_,fl)=>{"use strict";var{MathFloor:Ry,NumberIsInteger:Ny}=W(),{validateInteger:Ly}=di(),{ERR_INVALID_ARG_VALUE:By}=se().codes,al=16*1024,cl=16;function Dy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Dy,"highWaterMarkFrom");function ll(t){return t?cl:al}s(ll,"getDefaultHighWaterMark");function My(t,e){Ly(e,"value",0),t?cl=e:al=e}s(My,"setDefaultHighWaterMark");function Uy(t,e,i,r){let n=Dy(e,r,i);if(n!=null){if(!Ny(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new By(o,n)}return Ry(n)}return ll(t.objectMode)}s(Uy,"getHighWaterMark");fl.exports={getHighWaterMark:Uy,getDefaultHighWaterMark:ll,setDefaultHighWaterMark:My}});var pl=T((Co,dl)=>{var Jr=xe(),Xe=Jr.Buffer;function ul(t,e){for(var i in t)e[i]=t[i]}s(ul,"copyProps");Xe.from&&Xe.alloc&&Xe.allocUnsafe&&Xe.allocUnsafeSlow?dl.exports=Jr:(ul(Jr,Co),Co.Buffer=qt);function qt(t,e,i){return Xe(t,e,i)}s(qt,"SafeBuffer");qt.prototype=Object.create(Xe.prototype);ul(Xe,qt);qt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Xe(t,e,i)};qt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Xe(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};qt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Xe(t)};qt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Jr.SlowBuffer(t)}});var ml=T(yl=>{"use strict";var No=pl().Buffer,hl=No.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Wy(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Wy,"_normalizeEncoding");function jy(t){var e=Wy(t);if(typeof e!="string"&&(No.isEncoding===hl||!hl(t)))throw new Error("Unknown encoding: "+t);return e||t}s(jy,"normalizeEncoding");yl.StringDecoder=ir;function ir(t){this.encoding=jy(t);var e;switch(this.encoding){case"utf16le":this.text=Gy,this.end=Ky,e=4;break;case"utf8":this.fillLast=zy,e=4;break;case"base64":this.text=Yy,this.end=Xy,e=3;break;default:this.write=Jy,this.end=Qy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=No.allocUnsafe(e)}s(ir,"StringDecoder");ir.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||""};ir.prototype.end=Hy;ir.prototype.text=Vy;ir.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ro(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Ro,"utf8CheckByte");function qy(t,e,i){var r=e.length-1;if(r<i)return 0;var n=Ro(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=Ro(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=Ro(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(qy,"utf8CheckIncomplete");function $y(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s($y,"utf8CheckExtraBytes");function zy(t){var e=this.lastTotal-this.lastNeed,i=$y(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(zy,"utf8FillLast");function Vy(t,e){var i=qy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}s(Vy,"utf8Text");function Hy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Hy,"utf8End");function Gy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Gy,"utf16Text");function Ky(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Ky,"utf16End");function Yy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Yy,"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}s(Xy,"base64End");function Jy(t){return t.toString(this.encoding)}s(Jy,"simpleWrite");function Qy(t){return t&&t.length?this.write(t):""}s(Qy,"simpleEnd")});var Lo=T((g_,Sl)=>{"use strict";var bl=St(),{PromisePrototypeThen:Zy,SymbolAsyncIterator:gl,SymbolIterator:wl}=W(),{Buffer:em}=xe(),{ERR_INVALID_ARG_TYPE:tm,ERR_STREAM_NULL_VALUES:im}=se().codes;function rm(t,e,i){let r;if(typeof e=="string"||e instanceof em)return new t({objectMode:!0,...i,read:s(function(){this.push(e),this.push(null)},"read")});let n;if(e&&e[gl])n=!0,r=e[gl]();else if(e&&e[wl])n=!1,r=e[wl]();else throw new tm("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,d){Zy(c(f),()=>bl.nextTick(d,f),p=>bl.nextTick(d,p||f))};async function c(f){let d=f!=null,p=typeof r.throw=="function";if(d&&p){let{value:m,done:b}=await r.throw(f);if(await m,b)return}if(typeof r.return=="function"){let{value:m}=await r.return();await m}}s(c,"close");async function l(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)o.push(null);else{let p=f&&typeof f.then=="function"?await f:f;if(p===null)throw a=!1,new im;if(o.push(p))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(rm,"from");Sl.exports=rm});var nr=T((S_,Ml)=>{var Ae=St(),{ArrayPrototypeIndexOf:nm,NumberIsInteger:om,NumberIsNaN:sm,NumberParseInt:am,ObjectDefineProperties:$o,ObjectKeys:cm,ObjectSetPrototypeOf:xl,Promise:kl,SafeSet:lm,SymbolAsyncDispose:fm,SymbolAsyncIterator:um,Symbol:dm}=W();Ml.exports=F;F.ReadableState=tn;var{EventEmitter:pm}=Zi(),{Stream:Et,prependListener:hm}=Kr(),{Buffer:Bo}=xe(),{addAbortSignal:ym}=er(),vl=ct(),P=re().debuglog("stream",t=>{P=t}),mm=sl(),bi=jt(),{getHighWaterMark:bm,getDefaultHighWaterMark:gm}=tr(),{aggregateTwoErrors:_l,codes:{ERR_INVALID_ARG_TYPE:wm,ERR_METHOD_NOT_IMPLEMENTED:Sm,ERR_OUT_OF_RANGE:_m,ERR_STREAM_PUSH_AFTER_EOF:Em,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:xm},AbortError:km}=se(),{validateObject:vm}=di(),$t=dm("kPaused"),{StringDecoder:Fl}=ml(),Fm=Lo();xl(F.prototype,Et.prototype);xl(F,Et);var Do=s(()=>{},"nop"),{errorOrDestroy:yi}=bi,mi=1,Im=2,Il=4,rr=8,Pl=16,Qr=32,Zr=64,Al=128,Pm=256,Am=512,Om=1024,jo=2048,qo=4096,Tm=8192,Cm=16384,Rm=32768,Ol=65536,Nm=1<<17,Lm=1<<18;function J(t){return{enumerable:!1,get:s(function(){return(this.state&t)!==0},"get"),set:s(function(e){e?this.state|=t:this.state&=~t},"set")}}s(J,"makeBitMapDescriptor");$o(tn.prototype,{objectMode:J(mi),ended:J(Im),endEmitted:J(Il),reading:J(rr),constructed:J(Pl),sync:J(Qr),needReadable:J(Zr),emittedReadable:J(Al),readableListening:J(Pm),resumeScheduled:J(Am),errorEmitted:J(Om),emitClose:J(jo),autoDestroy:J(qo),destroyed:J(Tm),closed:J(Cm),closeEmitted:J(Rm),multiAwaitDrain:J(Ol),readingMore:J(Nm),dataEmitted:J(Lm)});function tn(t,e,i){typeof i!="boolean"&&(i=e instanceof Je()),this.state=jo|qo|Pl|Qr,t&&t.objectMode&&(this.state|=mi),i&&t&&t.readableObjectMode&&(this.state|=mi),this.highWaterMark=t?bm(this,t,"readableHighWaterMark",i):gm(!1),this.buffer=new mm,this.length=0,this.pipes=[],this.flowing=null,this[$t]=null,t&&t.emitClose===!1&&(this.state&=~jo),t&&t.autoDestroy===!1&&(this.state&=~qo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Fl(t.encoding),this.encoding=t.encoding)}s(tn,"ReadableState");function F(t){if(!(this instanceof F))return new F(t);let e=this instanceof Je();this._readableState=new tn(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&&ym(t.signal,this)),Et.call(this,t),bi.construct(this,()=>{this._readableState.needReadable&&en(this,this._readableState)})}s(F,"Readable");F.prototype.destroy=bi.destroy;F.prototype._undestroy=bi.undestroy;F.prototype._destroy=function(t,e){e(t)};F.prototype[pm.captureRejectionSymbol]=function(t){this.destroy(t)};F.prototype[fm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new km,this.destroy(t)),new kl((e,i)=>vl(this,r=>r&&r!==t?i(r):e(null)))};F.prototype.push=function(t,e){return Tl(this,t,e,!1)};F.prototype.unshift=function(t,e){return Tl(this,t,e,!0)};function Tl(t,e,i,r){P("readableAddChunk",e);let n=t._readableState,o;if(n.state&mi||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=Bo.from(e,i).toString(n.encoding):(e=Bo.from(e,i),i=""))):e instanceof Bo?i="":Et._isUint8Array(e)?(e=Et._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new wm("chunk",["string","Buffer","Uint8Array"],e))),o)yi(t,o);else if(e===null)n.state&=~rr,Mm(t,n);else if(n.state&mi||e&&e.length>0)if(r)if(n.state&Il)yi(t,new xm);else{if(n.destroyed||n.errored)return!1;Mo(t,n,e,!0)}else if(n.ended)yi(t,new Em);else{if(n.destroyed||n.errored)return!1;n.state&=~rr,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Mo(t,n,e,!1):en(t,n)):Mo(t,n,e,!1)}else r||(n.state&=~rr,en(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Tl,"readableAddChunk");function Mo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Ol?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.state&Zr&&rn(t)),en(t,e)}s(Mo,"addChunk");F.prototype.isPaused=function(){let t=this._readableState;return t[$t]===!0||t.flowing===!1};F.prototype.setEncoding=function(t){let e=new Fl(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 Bm=1073741824;function Dm(t){if(t>Bm)throw new _m("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Dm,"computeNewHighWaterMark");function El(t,e){return t<=0||e.length===0&&e.ended?0:e.state&mi?1:sm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(El,"howMuchToRead");F.prototype.read=function(t){P("read",t),t===void 0?t=NaN:om(t)||(t=am(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Dm(t)),t!==0&&(e.state&=~Al),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return P("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Uo(this):rn(this),null;if(t=El(t,e),t===0&&e.ended)return e.length===0&&Uo(this),null;let r=(e.state&Zr)!==0;if(P("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,P("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,P("reading, ended or constructing",r);else if(r){P("do read"),e.state|=rr|Qr,e.length===0&&(e.state|=Zr);try{this._read(e.highWaterMark)}catch(o){yi(this,o)}e.state&=~Qr,e.reading||(t=El(i,e))}let n;return t>0?n=Bl(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Uo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Mm(t,e){if(P("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?rn(t):(e.needReadable=!1,e.emittedReadable=!0,Cl(t))}}s(Mm,"onEofChunk");function rn(t){let e=t._readableState;P("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(P("emitReadable",e.flowing),e.emittedReadable=!0,Ae.nextTick(Cl,t))}s(rn,"emitReadable");function Cl(t){let e=t._readableState;P("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,Nl(t)}s(Cl,"emitReadable_");function en(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ae.nextTick(Um,t,e))}s(en,"maybeReadMore");function Um(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(P("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Um,"maybeReadMore_");F.prototype._read=function(t){throw new Sm("_read()")};F.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new lm(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),P("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ae.stdout&&t!==Ae.stderr?c:A;r.endEmitted?Ae.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(E,C){P("onunpipe"),E===i&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){P("onend"),t.end()}s(c,"onend");let l,f=!1;function d(){P("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",b),t.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",A),i.removeListener("data",m),f=!0,l&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}s(d,"cleanup");function p(){f||(r.pipes.length===1&&r.pipes[0]===t?(P("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(P("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),l||(l=Wm(i,t),t.on("drain",l))}s(p,"pause"),i.on("data",m);function m(E){P("ondata");let C=t.write(E);P("dest.write",C),C===!1&&p()}s(m,"ondata");function b(E){if(P("onerror",E),A(),t.removeListener("error",b),t.listenerCount("error")===0){let C=t._writableState||t._readableState;C&&!C.errorEmitted?yi(t,E):t.emit("error",E)}}s(b,"onerror"),hm(t,"error",b);function w(){t.removeListener("finish",g),A()}s(w,"onclose"),t.once("close",w);function g(){P("onfinish"),t.removeListener("close",w),A()}s(g,"onfinish"),t.once("finish",g);function A(){P("unpipe"),i.unpipe(t)}return s(A,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?p():r.flowing||(P("pipe resume"),i.resume()),t};function Wm(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(P("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(P("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Wm,"pipeOnDrain");F.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=nm(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};F.prototype.on=function(t,e){let i=Et.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,P("on readable",r.length,r.reading),r.length?rn(this):r.reading||Ae.nextTick(jm,this)),i};F.prototype.addListener=F.prototype.on;F.prototype.removeListener=function(t,e){let i=Et.prototype.removeListener.call(this,t,e);return t==="readable"&&Ae.nextTick(Rl,this),i};F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners=function(t){let e=Et.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ae.nextTick(Rl,this),e};function Rl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[$t]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Rl,"updateReadableListening");function jm(t){P("readable nexttick read 0"),t.read(0)}s(jm,"nReadingNextTick");F.prototype.resume=function(){let t=this._readableState;return t.flowing||(P("resume"),t.flowing=!t.readableListening,qm(this,t)),t[$t]=!1,this};function qm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ae.nextTick($m,t,e))}s(qm,"resume");function $m(t,e){P("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Nl(t),e.flowing&&!e.reading&&t.read(0)}s($m,"resume_");F.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[$t]=!0,this};function Nl(t){let e=t._readableState;for(P("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Nl,"flow");F.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=>{yi(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=cm(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};F.prototype[um]=function(){return Ll(this)};F.prototype.iterator=function(t){return t!==void 0&&vm(t,"options"),Ll(this,t)};function Ll(t,e){typeof t.read!="function"&&(t=F.wrap(t,{objectMode:!0}));let i=zm(t,e);return i.stream=t,i}s(Ll,"streamToAsyncIterator");async function*zm(t,e){let i=Do;function r(a){this===t?(i(),i=Do):i=a}s(r,"next"),t.on("readable",r);let n,o=vl(t,{writable:!1},a=>{n=a?_l(n,a):null,i(),i=Do});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new kl(r)}}}catch(a){throw n=_l(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?bi.destroyer(t,null):(t.off("readable",r),o())}}s(zm,"createAsyncIterator");$o(F.prototype,{readable:{__proto__:null,get:s(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:s(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});$o(tn.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[$t]!==!1},"get"),set:s(function(t){this[$t]=!!t},"set")}});F._fromList=Bl;function Bl(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(Bl,"fromList");function Uo(t){let e=t._readableState;P("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ae.nextTick(Vm,e,t))}s(Uo,"endReadable");function Vm(t,e){if(P("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)Ae.nextTick(Hm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Vm,"endReadableNT");function Hm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Hm,"endWritableNT");F.from=function(t,e){return Fm(F,t,e)};var Wo;function Dl(){return Wo===void 0&&(Wo={}),Wo}s(Dl,"lazyWebStreams");F.fromWeb=function(t,e){return Dl().newStreamReadableFromReadableStream(t,e)};F.toWeb=function(t,e){return Dl().newReadableStreamFromStreamReadable(t,e)};F.wrap=function(t,e){var i,r;return new F({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:s(function(n,o){bi.destroyer(t,n),o(n)},"destroy")}).wrap(t)}});var cn=T((E_,Xl)=>{var zt=St(),{ArrayPrototypeSlice:jl,Error:Gm,FunctionPrototypeSymbolHasInstance:ql,ObjectDefineProperty:$l,ObjectDefineProperties:Km,ObjectSetPrototypeOf:zl,StringPrototypeToLowerCase:Ym,Symbol:Xm,SymbolHasInstance:Jm}=W();Xl.exports=j;j.WritableState=ar;var{EventEmitter:Qm}=Zi(),or=Kr().Stream,{Buffer:nn}=xe(),an=jt(),{addAbortSignal:Zm}=er(),{getHighWaterMark:eb,getDefaultHighWaterMark:tb}=tr(),{ERR_INVALID_ARG_TYPE:ib,ERR_METHOD_NOT_IMPLEMENTED:rb,ERR_MULTIPLE_CALLBACK:Vl,ERR_STREAM_CANNOT_PIPE:nb,ERR_STREAM_DESTROYED:sr,ERR_STREAM_ALREADY_FINISHED:ob,ERR_STREAM_NULL_VALUES:sb,ERR_STREAM_WRITE_AFTER_END:ab,ERR_UNKNOWN_ENCODING:Hl}=se().codes,{errorOrDestroy:gi}=an;zl(j.prototype,or.prototype);zl(j,or);function Ho(){}s(Ho,"nop");var wi=Xm("kOnFinished");function ar(t,e,i){typeof i!="boolean"&&(i=e instanceof Je()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?eb(this,t,"writableHighWaterMark",i):tb(!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=lb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,sn(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[wi]=[]}s(ar,"WritableState");function sn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(sn,"resetBuffer");ar.prototype.getBuffer=s(function(){return jl(this.buffered,this.bufferedIndex)},"getBuffer");$l(ar.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function j(t){let e=this instanceof Je();if(!e&&!ql(j,this))return new j(t);this._writableState=new ar(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&&Zm(t.signal,this)),or.call(this,t),an.construct(this,()=>{let i=this._writableState;i.writing||Ko(this,i),Yo(this,i)})}s(j,"Writable");$l(j,Jm,{__proto__:null,value:s(function(t){return ql(this,t)?!0:this!==j?!1:t&&t._writableState instanceof ar},"value")});j.prototype.pipe=function(){gi(this,new nb)};function Gl(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"&&!nn.isEncoding(i))throw new Hl(i);typeof r!="function"&&(r=Ho)}if(e===null)throw new sb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=nn.from(e,i),i="buffer");else if(e instanceof nn)i="buffer";else if(or._isUint8Array(e))e=or._uint8ArrayToBuffer(e),i="buffer";else throw new ib("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new ab:n.destroyed&&(o=new sr("write")),o?(zt.nextTick(r,o),gi(t,o,!0),o):(n.pendingcb++,cb(t,n,e,i,r))}s(Gl,"_write");j.prototype.write=function(t,e,i){return Gl(this,t,e,i)===!0};j.prototype.cork=function(){this._writableState.corked++};j.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ko(this,t))};j.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Ym(e)),!nn.isEncoding(e))throw new Hl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function cb(t,e,i,r,n){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:r,callback:n}),e.allBuffers&&r!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ho&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(cb,"writeOrBuffer");function Ul(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new sr("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(Ul,"doWrite");function Wl(t,e,i,r){--e.pendingcb,r(i),Go(e),gi(t,i)}s(Wl,"onwriteError");function lb(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){gi(t,new Vl);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?zt.nextTick(Wl,t,i,e,n):Wl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Ko(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},zt.nextTick(fb,i.afterWriteTickInfo)):Kl(t,i,1,n))}s(lb,"onwrite");function fb({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Kl(t,e,i,r)}s(fb,"afterWriteTick");function Kl(t,e,i,r){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,r();e.destroyed&&Go(e),Yo(t,e)}s(Kl,"afterWrite");function Go(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],c=t.objectMode?1:o.length;t.length-=c,a((e=t.errored)!==null&&e!==void 0?e:new sr("write"))}let i=t[wi].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new sr("end"))}sn(t)}s(Go,"errorBuffer");function Ko(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,o=i.length-r;if(!o)return;let a=r;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let c=e.allNoop?Ho:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=e.allNoop&&a===0?i:jl(i,a);l.allBuffers=e.allBuffers,Ul(t,e,!0,e.length,l,"",c),sn(e)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=n?1:c.length;Ul(t,e,!1,d,c,l,f)}while(a<i.length&&!e.writing);a===i.length?sn(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Ko,"clearBuffer");j.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new rb("_write()")};j.prototype._writev=null;j.prototype.end=function(t,e,i){let r=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let n;if(t!=null){let o=Gl(this,t,e);o instanceof Gm&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Yo(this,r,!0),r.ended=!0):r.finished?n=new ob("end"):r.destroyed&&(n=new sr("end"))),typeof i=="function"&&(n||r.finished?zt.nextTick(i,n):r[wi].push(i)),this};function on(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(on,"needFinish");function ub(t,e){let i=!1;function r(n){if(i){gi(t,n??Vl());return}if(i=!0,e.pendingcb--,n){let o=e[wi].splice(0);for(let a=0;a<o.length;a++)o[a](n);gi(t,n,e.sync)}else on(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,zt.nextTick(Vo,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(ub,"callFinal");function db(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,ub(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(db,"prefinish");function Yo(t,e,i){on(e)&&(db(t,e),e.pendingcb===0&&(i?(e.pendingcb++,zt.nextTick((r,n)=>{on(n)?Vo(r,n):n.pendingcb--},t,e)):on(e)&&(e.pendingcb++,Vo(t,e))))}s(Yo,"finishMaybe");function Vo(t,e){e.pendingcb--,e.finished=!0;let i=e[wi].splice(0);for(let r=0;r<i.length;r++)i[r]();if(t.emit("finish"),e.autoDestroy){let r=t._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&t.destroy()}}s(Vo,"finish");Km(j.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:s(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:s(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var pb=an.destroy;j.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[wi].length)&&zt.nextTick(Go,i),pb.call(this,t,e),this};j.prototype._undestroy=an.undestroy;j.prototype._destroy=function(t,e){e(t)};j.prototype[Qm.captureRejectionSymbol]=function(t){this.destroy(t)};var zo;function Yl(){return zo===void 0&&(zo={}),zo}s(Yl,"lazyWebStreams");j.fromWeb=function(t,e){return Yl().newStreamWritableFromWritableStream(t,e)};j.toWeb=function(t){return Yl().newWritableStreamFromStreamWritable(t)}});var df=T((k_,uf)=>{var Xo=St(),hb=xe(),{isReadable:yb,isWritable:mb,isIterable:Jl,isNodeStream:bb,isReadableNodeStream:Ql,isWritableNodeStream:Zl,isDuplexNodeStream:gb,isReadableStream:ef,isWritableStream:tf}=Ke(),rf=ct(),{AbortError:lf,codes:{ERR_INVALID_ARG_TYPE:wb,ERR_INVALID_RETURN_VALUE:nf}}=se(),{destroyer:_i}=jt(),Sb=Je(),ff=nr(),_b=cn(),{createDeferredPromise:of}=re(),sf=Lo(),af=globalThis.Blob||hb.Blob,Eb=s(typeof af<"u"?function(e){return e instanceof af}:function(e){return!1},"isBlob"),xb=globalThis.AbortController||li().AbortController,{FunctionPrototypeCall:cf}=W(),xt=class extends Sb{static{s(this,"Duplexify")}constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};uf.exports=s(function t(e,i){if(gb(e))return e;if(Ql(e))return Si({readable:e});if(Zl(e))return Si({writable:e});if(bb(e))return Si({writable:!1,readable:!1});if(ef(e))return Si({readable:ff.fromWeb(e)});if(tf(e))return Si({writable:_b.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:c}=kb(e);if(Jl(n))return sf(xt,n,{objectMode:!0,write:o,final:a,destroy:c});let l=n?.then;if(typeof l=="function"){let f,d=cf(l,n,p=>{if(p!=null)throw new nf("nully","body",p)},p=>{_i(f,p)});return f=new xt({objectMode:!0,readable:!1,write:o,final:s(function(p){a(async()=>{try{await d,Xo.nextTick(p,null)}catch(m){Xo.nextTick(p,m)}})},"final"),destroy:c})}throw new nf("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Eb(e))return t(e.arrayBuffer());if(Jl(e))return sf(xt,e,{objectMode:!0,writable:!1});if(ef(e?.readable)&&tf(e?.writable))return xt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Ql(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?Zl(e?.writable)?e?.writable:t(e.writable):void 0;return Si({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return cf(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{_i(n,o)}),n=new xt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new wb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function kb(t){let{promise:e,resolve:i}=of(),r=new xb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:c,done:l,cb:f}=await a;if(Xo.nextTick(f),l)return;if(n.aborted)throw new lf(void 0,{cause:n.reason});({promise:e,resolve:i}=of()),yield c}}(),{signal:n}),write:s(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){r.abort(),c(a)},"destroy")}}s(kb,"fromAsyncGen");function Si(t){let e=t.readable&&typeof t.readable.read!="function"?ff.wrap(t.readable):t.readable,i=t.writable,r=!!yb(e),n=!!mb(i),o,a,c,l,f;function d(p){let m=l;l=null,m?m(p):p&&f.destroy(p)}return s(d,"onfinished"),f=new xt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(rf(i,p=>{n=!1,p&&_i(e,p),d(p)}),f._write=function(p,m,b){i.write(p,m)?b():o=b},f._final=function(p){i.end(),a=p},i.on("drain",function(){if(o){let p=o;o=null,p()}}),i.on("finish",function(){if(a){let p=a;a=null,p()}})),r&&(rf(e,p=>{r=!1,p&&_i(e,p),d(p)}),e.on("readable",function(){if(c){let p=c;c=null,p()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let p=e.read();if(p===null){c=f._read;return}if(!f.push(p))return}}),f._destroy=function(p,m){!p&&l!==null&&(p=new lf),c=null,o=null,a=null,l===null?m(p):(l=m,_i(i,p),_i(e,p))},f}s(Si,"_duplexify")});var Je=T((F_,yf)=>{"use strict";var{ObjectDefineProperties:vb,ObjectGetOwnPropertyDescriptor:lt,ObjectKeys:Fb,ObjectSetPrototypeOf:pf}=W();yf.exports=Oe;var Zo=nr(),Fe=cn();pf(Oe.prototype,Zo.prototype);pf(Oe,Zo);{let t=Fb(Fe.prototype);for(let e=0;e<t.length;e++){let i=t[e];Oe.prototype[i]||(Oe.prototype[i]=Fe.prototype[i])}}function Oe(t){if(!(this instanceof Oe))return new Oe(t);Zo.call(this,t),Fe.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Oe,"Duplex");vb(Oe.prototype,{writable:{__proto__:null,...lt(Fe.prototype,"writable")},writableHighWaterMark:{__proto__:null,...lt(Fe.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...lt(Fe.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...lt(Fe.prototype,"writableBuffer")},writableLength:{__proto__:null,...lt(Fe.prototype,"writableLength")},writableFinished:{__proto__:null,...lt(Fe.prototype,"writableFinished")},writableCorked:{__proto__:null,...lt(Fe.prototype,"writableCorked")},writableEnded:{__proto__:null,...lt(Fe.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...lt(Fe.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var Jo;function hf(){return Jo===void 0&&(Jo={}),Jo}s(hf,"lazyWebStreams");Oe.fromWeb=function(t,e){return hf().newStreamDuplexFromReadableWritablePair(t,e)};Oe.toWeb=function(t){return hf().newReadableWritablePairFromDuplex(t)};var Qo;Oe.from=function(t){return Qo||(Qo=df()),Qo(t,"body")}});var is=T((P_,bf)=>{"use strict";var{ObjectSetPrototypeOf:mf,Symbol:Ib}=W();bf.exports=ft;var{ERR_METHOD_NOT_IMPLEMENTED:Pb}=se().codes,ts=Je(),{getHighWaterMark:Ab}=tr();mf(ft.prototype,ts.prototype);mf(ft,ts);var cr=Ib("kCallback");function ft(t){if(!(this instanceof ft))return new ft(t);let e=t?Ab(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ts.call(this,t),this._readableState.sync=!1,this[cr]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ob)}s(ft,"Transform");function es(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(es,"final");function Ob(){this._final!==es&&es.call(this)}s(Ob,"prefinish");ft.prototype._final=es;ft.prototype._transform=function(t,e,i){throw new Pb("_transform()")};ft.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),n.ended||o===r.length||r.length<r.highWaterMark?i():this[cr]=i})};ft.prototype._read=function(){if(this[cr]){let t=this[cr];this[cr]=null,t()}}});var ns=T((O_,wf)=>{"use strict";var{ObjectSetPrototypeOf:gf}=W();wf.exports=Ei;var rs=is();gf(Ei.prototype,rs.prototype);gf(Ei,rs);function Ei(t){if(!(this instanceof Ei))return new Ei(t);rs.call(this,t)}s(Ei,"PassThrough");Ei.prototype._transform=function(t,e,i){i(null,t)}});var dn=T((C_,kf)=>{var lr=St(),{ArrayIsArray:Tb,Promise:Cb,SymbolAsyncIterator:Rb,SymbolDispose:Nb}=W(),un=ct(),{once:Lb}=re(),Bb=jt(),Sf=Je(),{aggregateTwoErrors:Db,codes:{ERR_INVALID_ARG_TYPE:ps,ERR_INVALID_RETURN_VALUE:os,ERR_MISSING_ARGS:Mb,ERR_STREAM_DESTROYED:Ub,ERR_STREAM_PREMATURE_CLOSE:Wb},AbortError:jb}=se(),{validateFunction:qb,validateAbortSignal:$b}=di(),{isIterable:Vt,isReadable:ss,isReadableNodeStream:fn,isNodeStream:_f,isTransformStream:xi,isWebStream:zb,isReadableStream:as,isReadableFinished:Vb}=Ke(),Hb=globalThis.AbortController||li().AbortController,cs,ls,fs;function Ef(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=un(t,{readable:e,writable:i},o=>{r=!o});return{destroy:s(o=>{r||(r=!0,Bb.destroyer(t,o||new Ub("pipe")))},"destroy"),cleanup:n}}s(Ef,"destroyer");function Gb(t){return qb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Gb,"popCallback");function us(t){if(Vt(t))return t;if(fn(t))return Kb(t);throw new ps("val",["Readable","Iterable","AsyncIterable"],t)}s(us,"makeAsyncIterable");async function*Kb(t){ls||(ls=nr()),yield*ls.prototype[Rb].call(t)}s(Kb,"fromReadable");async function ln(t,e,i,{end:r}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Cb((f,d)=>{n?d(n):o=s(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let l=un(e,{readable:!1},a);try{e.writableNeedDrain&&await c();for await(let f of t)e.write(f)||await c();r&&(e.end(),await c()),i()}catch(f){i(n!==f?Db(n,f):f)}finally{l(),e.off("drain",a)}}s(ln,"pumpToNode");async function ds(t,e,i,{end:r}){xi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(ds,"pumpToWeb");function Yb(...t){return xf(t,Lb(Gb(t)))}s(Yb,"pipeline");function xf(t,e,i){if(t.length===1&&Tb(t[0])&&(t=t[0]),t.length<2)throw new Mb("streams");let r=new Hb,n=r.signal,o=i?.signal,a=[];$b(o,"options.signal");function c(){w(new jb)}s(c,"abort"),fs=fs||re().addAbortListener;let l;o&&(l=fs(o,c));let f,d,p=[],m=0;function b(q){w(q,--m===0)}s(b,"finish");function w(q,O){var G;if(q&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=q),!(!f&&!O)){for(;p.length;)p.shift()(f);(G=l)===null||G===void 0||G[Nb](),r.abort(),O&&(f||a.forEach(Ft=>Ft()),lr.nextTick(e,f,d))}}s(w,"finishImpl");let g;for(let q=0;q<t.length;q++){let O=t[q],G=q<t.length-1,Ft=q>0,me=G||i?.end!==!1,Xt=q===t.length-1;if(_f(O)){let ae=function(Ze){Ze&&Ze.name!=="AbortError"&&Ze.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(Ze)};var C=ae;if(s(ae,"onError"),me){let{destroy:Ze,cleanup:On}=Ef(O,G,Ft);p.push(Ze),ss(O)&&Xt&&a.push(On)}O.on("error",ae),ss(O)&&Xt&&a.push(()=>{O.removeListener("error",ae)})}if(q===0)if(typeof O=="function"){if(g=O({signal:n}),!Vt(g))throw new os("Iterable, AsyncIterable or Stream","source",g)}else Vt(O)||fn(O)||xi(O)?g=O:g=Sf.from(O);else if(typeof O=="function"){if(xi(g)){var A;g=us((A=g)===null||A===void 0?void 0:A.readable)}else g=us(g);if(g=O(g,{signal:n}),G){if(!Vt(g,!0))throw new os("AsyncIterable",`transform[${q-1}]`,g)}else{var E;cs||(cs=ns());let ae=new cs({objectMode:!0}),Ze=(E=g)===null||E===void 0?void 0:E.then;if(typeof Ze=="function")m++,Ze.call(g,dt=>{d=dt,dt!=null&&ae.write(dt),me&&ae.end(),lr.nextTick(b)},dt=>{ae.destroy(dt),lr.nextTick(b,dt)});else if(Vt(g,!0))m++,ln(g,ae,b,{end:me});else if(as(g)||xi(g)){let dt=g.readable||g;m++,ln(dt,ae,b,{end:me})}else throw new os("AsyncIterable or Promise","destination",g);g=ae;let{destroy:On,cleanup:td}=Ef(g,!1,!0);p.push(On),Xt&&a.push(td)}}else if(_f(O)){if(fn(g)){m+=2;let ae=Xb(g,O,b,{end:me});ss(O)&&Xt&&a.push(ae)}else if(xi(g)||as(g)){let ae=g.readable||g;m++,ln(ae,O,b,{end:me})}else if(Vt(g))m++,ln(g,O,b,{end:me});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=O}else if(zb(O)){if(fn(g))m++,ds(us(g),O,b,{end:me});else if(as(g)||Vt(g))m++,ds(g,O,b,{end:me});else if(xi(g))m++,ds(g.readable,O,b,{end:me});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=O}else g=Sf.from(O)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&lr.nextTick(c),g}s(xf,"pipelineImpl");function Xb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Wb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Vb(t)?lr.nextTick(a):t.once("end",a)}else i();return un(t,{readable:!0,writable:!1},a=>{let c=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?t.once("end",i).once("error",i):i(a)}),un(e,{readable:!1,writable:!0},i)}s(Xb,"pipe");kf.exports={pipelineImpl:xf,pipeline:Yb}});var ys=T((N_,Of)=>{"use strict";var{pipeline:Jb}=dn(),pn=Je(),{destroyer:Qb}=jt(),{isNodeStream:hn,isReadable:vf,isWritable:Ff,isWebStream:hs,isTransformStream:Ht,isWritableStream:If,isReadableStream:Pf}=Ke(),{AbortError:Zb,codes:{ERR_INVALID_ARG_VALUE:Af,ERR_MISSING_ARGS:eg}}=se(),tg=ct();Of.exports=s(function(...e){if(e.length===0)throw new eg("streams");if(e.length===1)return pn.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=pn.from(e[0])),typeof e[e.length-1]=="function"){let b=e.length-1;e[b]=pn.from(e[b])}for(let b=0;b<e.length;++b)if(!(!hn(e[b])&&!hs(e[b]))){if(b<e.length-1&&!(vf(e[b])||Pf(e[b])||Ht(e[b])))throw new Af(`streams[${b}]`,i[b],"must be readable");if(b>0&&!(Ff(e[b])||If(e[b])||Ht(e[b])))throw new Af(`streams[${b}]`,i[b],"must be writable")}let r,n,o,a,c;function l(b){let w=a;a=null,w?w(b):b?c.destroy(b):!m&&!p&&c.destroy()}s(l,"onfinished");let f=e[0],d=Jb(e,l),p=!!(Ff(f)||If(f)||Ht(f)),m=!!(vf(d)||Pf(d)||Ht(d));if(c=new pn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:p,readable:m}),p){if(hn(f))c._write=function(w,g,A){f.write(w,g)?A():r=A},c._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(hs(f)){let g=(Ht(f)?f.writable:f).getWriter();c._write=async function(A,E,C){try{await g.ready,g.write(A).catch(()=>{}),C()}catch(q){C(q)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),n=A}catch(E){A(E)}}}let b=Ht(d)?d.readable:d;tg(b,()=>{if(n){let w=n;n=null,w()}})}if(m){if(hn(d))d.on("readable",function(){if(o){let b=o;o=null,b()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let b=d.read();if(b===null){o=c._read;return}if(!c.push(b))return}};else if(hs(d)){let w=(Ht(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(b,w){!b&&a!==null&&(b=new Zb),o=null,r=null,n=null,a===null?w(b):(a=w,hn(d)&&Qb(d,b))},c},"compose")});var Wf=T((B_,gs)=>{"use strict";var ig=globalThis.AbortController||li().AbortController,{codes:{ERR_INVALID_ARG_VALUE:rg,ERR_INVALID_ARG_TYPE:fr,ERR_MISSING_ARGS:ng,ERR_OUT_OF_RANGE:og},AbortError:Qe}=se(),{validateAbortSignal:Gt,validateInteger:Tf,validateObject:Kt}=di(),sg=W().Symbol("kWeak"),ag=W().Symbol("kResistStopPropagation"),{finished:cg}=ct(),lg=ys(),{addAbortSignalNoValidate:fg}=er(),{isWritable:ug,isNodeStream:dg}=Ke(),{deprecate:pg}=re(),{ArrayPrototypePush:hg,Boolean:yg,MathFloor:Cf,Number:mg,NumberIsNaN:bg,Promise:Rf,PromiseReject:Nf,PromiseResolve:gg,PromisePrototypeThen:Lf,Symbol:Df}=W(),yn=Df("kEmpty"),Bf=Df("kEof");function wg(t,e){if(e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal"),dg(t)&&!ug(t))throw new rg("stream",t,"must be writable");let i=lg(this,t);return e!=null&&e.signal&&fg(e.signal,i),i}s(wg,"compose");function mn(t,e){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Cf(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Cf(e.highWaterMark)),Tf(i,"options.concurrency",1),Tf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=re().AbortSignalAny([e?.signal].filter(yg)),a=this,c=[],l={signal:o},f,d,p=!1,m=0;function b(){p=!0,w()}s(b,"onCatch");function w(){m-=1,g()}s(w,"afterItemProcessed");function g(){d&&!p&&m<i&&c.length<r&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let E of a){if(p)return;if(o.aborted)throw new Qe;try{if(E=t(E,l),E===yn)continue;E=gg(E)}catch(C){E=Nf(C)}m+=1,Lf(E,w,b),c.push(E),f&&(f(),f=null),!p&&(c.length>=r||m>=i)&&await new Rf(C=>{d=C})}c.push(Bf)}catch(E){let C=Nf(E);Lf(C,w,b),c.push(C)}finally{p=!0,f&&(f(),f=null)}}s(A,"pump"),A();try{for(;;){for(;c.length>0;){let E=await c[0];if(E===Bf)return;if(o.aborted)throw new Qe;E!==yn&&(yield E),c.shift(),g()}await new Rf(E=>{f=E})}}finally{p=!0,d&&(d(),d=null)}},"map").call(this)}s(mn,"map");function Sg(t=void 0){return t!=null&&Kt(t,"options"),t?.signal!=null&&Gt(t.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Qe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(Sg,"asIndexedPairs");async function Mf(t,e=void 0){for await(let i of bs.call(this,t,e))return!0;return!1}s(Mf,"some");async function _g(t,e=void 0){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);return!await Mf.call(this,async(...i)=>!await t(...i),e)}s(_g,"every");async function Eg(t,e){for await(let i of bs.call(this,t,e))return i}s(Eg,"find");async function xg(t,e){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),yn}s(i,"forEachFn");for await(let r of mn.call(this,i,e));}s(xg,"forEach");function bs(t,e){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:yn}return s(i,"filterFn"),mn.call(this,i,e)}s(bs,"filter");var ms=class extends ng{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function kg(t,e,i){var r;if(typeof t!="function")throw new fr("reducer",["Function","AsyncFunction"],t);i!=null&&Kt(i,"options"),i?.signal!=null&&Gt(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new Qe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await cg(this.destroy(f)),f}let o=new ig,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[sg]:this,[ag]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new Qe;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!c&&!n)throw new ms}finally{o.abort()}return e}s(kg,"reduce");async function vg(t){t!=null&&Kt(t,"options"),t?.signal!=null&&Gt(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 Qe(void 0,{cause:t.signal.reason});hg(e,r)}return e}s(vg,"toArray");function Fg(t,e){let i=mn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(Fg,"flatMap");function Uf(t){if(t=mg(t),bg(t))return 0;if(t<0)throw new og("number",">= 0",t);return t}s(Uf,"toIntegerOrInfinity");function Ig(t,e=void 0){return e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal"),t=Uf(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Qe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Qe;t--<=0&&(yield o)}},"drop").call(this)}s(Ig,"drop");function Pg(t,e=void 0){return e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal"),t=Uf(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Qe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Qe;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(Pg,"take");gs.exports.streamReturningOperators={asIndexedPairs:pg(Sg,"readable.asIndexedPairs will be removed in a future version."),drop:Ig,filter:bs,flatMap:Fg,map:mn,take:Pg,compose:wg};gs.exports.promiseReturningOperators={every:_g,forEach:xg,reduce:kg,toArray:vg,some:Mf,find:Eg}});var ws=T((M_,jf)=>{"use strict";var{ArrayPrototypePop:Ag,Promise:Og}=W(),{isIterable:Tg,isNodeStream:Cg,isWebStream:Rg}=Ke(),{pipelineImpl:Ng}=dn(),{finished:Lg}=ct();Ss();function Bg(...t){return new Og((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Cg(o)&&!Tg(o)&&!Rg(o)){let a=Ag(t);r=a.signal,n=a.end}Ng(t,(a,c)=>{a?i(a):e(c)},{signal:r,end:n})})}s(Bg,"pipeline");jf.exports={finished:Lg,pipeline:Bg}});var Ss=T((W_,Xf)=>{var{Buffer:Dg}=xe(),{ObjectDefineProperty:ut,ObjectKeys:zf,ReflectApply:Vf}=W(),{promisify:{custom:Hf}}=re(),{streamReturningOperators:qf,promiseReturningOperators:$f}=Wf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Gf}}=se(),Mg=ys(),{setDefaultHighWaterMark:Ug,getDefaultHighWaterMark:Wg}=tr(),{pipeline:Kf}=dn(),{destroyer:jg}=jt(),Yf=ct(),_s=ws(),ur=Ke(),L=Xf.exports=Kr().Stream;L.isDestroyed=ur.isDestroyed;L.isDisturbed=ur.isDisturbed;L.isErrored=ur.isErrored;L.isReadable=ur.isReadable;L.isWritable=ur.isWritable;L.Readable=nr();for(let t of zf(qf)){let i=function(...r){if(new.target)throw Gf();return L.Readable.from(Vf(e,this,r))};Es=i,s(i,"fn");let e=qf[t];ut(i,"name",{__proto__:null,value:e.name}),ut(i,"length",{__proto__:null,value:e.length}),ut(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Es;for(let t of zf($f)){let i=function(...n){if(new.target)throw Gf();return Vf(e,this,n)};Es=i,s(i,"fn");let e=$f[t];ut(i,"name",{__proto__:null,value:e.name}),ut(i,"length",{__proto__:null,value:e.length}),ut(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Es;L.Writable=cn();L.Duplex=Je();L.Transform=is();L.PassThrough=ns();L.pipeline=Kf;var{addAbortSignal:qg}=er();L.addAbortSignal=qg;L.finished=Yf;L.destroy=jg;L.compose=Mg;L.setDefaultHighWaterMark=Ug;L.getDefaultHighWaterMark=Wg;ut(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return _s},"get")});ut(Kf,Hf,{__proto__:null,enumerable:!0,get:s(function(){return _s.pipeline},"get")});ut(Yf,Hf,{__proto__:null,enumerable:!0,get:s(function(){return _s.finished},"get")});L.Stream=L;L._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=s(function(e){return Dg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Jf=T((q_,H)=>{"use strict";var Q=Ss(),$g=ws(),zg=Q.Readable.destroy;H.exports=Q.Readable;H.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer;H.exports._isUint8Array=Q._isUint8Array;H.exports.isDisturbed=Q.isDisturbed;H.exports.isErrored=Q.isErrored;H.exports.isReadable=Q.isReadable;H.exports.Readable=Q.Readable;H.exports.Writable=Q.Writable;H.exports.Duplex=Q.Duplex;H.exports.Transform=Q.Transform;H.exports.PassThrough=Q.PassThrough;H.exports.addAbortSignal=Q.addAbortSignal;H.exports.finished=Q.finished;H.exports.destroy=Q.destroy;H.exports.destroy=zg;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return $g},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var ow={};wr(ow,{Async:()=>Bn,AsyncTransaction:()=>Un,BigIntStats:()=>de,BigIntStatsFs:()=>Ni,Dir:()=>wt,Dirent:()=>gt,Errno:()=>B,ErrnoError:()=>u,Fetch:()=>tw,FetchFS:()=>Pn,File:()=>Pt,FileSystem:()=>ie,InMemory:()=>ji,InMemoryStore:()=>kr,IndexFS:()=>br,Inode:()=>Me,Locked:()=>iw,LockedFS:()=>Pi,NoSyncFile:()=>Zt,Overlay:()=>rw,OverlayFS:()=>gr,Port:()=>Yg,PortFS:()=>Fn,PortFile:()=>qi,PreloadFile:()=>he,ReadStream:()=>kt,Readonly:()=>Dn,SimpleAsyncStore:()=>Wn,SimpleTransaction:()=>ti,Stats:()=>X,StatsCommon:()=>Ci,StatsFs:()=>Ri,StoreFS:()=>Mi,Sync:()=>Dd,SyncTransaction:()=>Wi,Transaction:()=>Ui,UnlockedOverlayFS:()=>An,WriteStream:()=>vt,ZenFsType:()=>Ln,_toUnixTimestamp:()=>Ud,access:()=>Tu,accessSync:()=>Ba,appendFile:()=>au,appendFileSync:()=>Ea,attachFS:()=>Ku,checkOptions:()=>zn,chmod:()=>Fu,chmodSync:()=>Ra,chown:()=>ku,chownSync:()=>Ta,close:()=>lu,closeSync:()=>bt,configure:()=>Gg,configureSingle:()=>Hg,constants:()=>It,copyFile:()=>Uu,copyFileSync:()=>so,cp:()=>$u,cpSync:()=>ao,createReadStream:()=>Lu,createWriteStream:()=>Bu,decode:()=>ei,decodeDirListing:()=>xr,default:()=>nw,detachFS:()=>Kg,encode:()=>Pe,encodeDirListing:()=>we,errorMessages:()=>Tn,exists:()=>Zf,existsSync:()=>ze,fchmod:()=>mu,fchmodSync:()=>Rr,fchown:()=>yu,fchownSync:()=>Cr,fdatasync:()=>du,fdatasyncSync:()=>Fa,flagToMode:()=>At,flagToNumber:()=>Rd,flagToString:()=>Vs,fs:()=>mr,fstat:()=>cu,fstatSync:()=>xa,fsync:()=>uu,fsyncSync:()=>va,ftruncate:()=>fu,ftruncateSync:()=>ka,futimes:()=>bu,futimesSync:()=>Nr,handleRequest:()=>$i,isAppendable:()=>nt,isBackend:()=>zi,isBackendConfig:()=>Vi,isExclusive:()=>Di,isReadable:()=>pt,isSynchronous:()=>Nd,isTruncating:()=>Bi,isWriteable:()=>pe,lchmod:()=>Iu,lchmodSync:()=>Na,lchown:()=>vu,lchownSync:()=>Ca,levenshtein:()=>Mn,link:()=>_u,linkSync:()=>Aa,lopenSync:()=>Ji,lstat:()=>tu,lstatSync:()=>to,lutimes:()=>Au,lutimesSync:()=>La,mkdir:()=>wu,mkdirSync:()=>Lr,mkdirpSync:()=>Gs,mkdtemp:()=>Mu,mkdtempSync:()=>Da,mount:()=>Nt,mountObject:()=>Ki,mounts:()=>ke,nop:()=>S,normalizeMode:()=>Se,normalizeOptions:()=>_e,normalizePath:()=>_,normalizeTime:()=>Ot,open:()=>nu,openAsBlob:()=>Vu,openSync:()=>Xi,opendir:()=>qu,opendirSync:()=>Wa,parseFlag:()=>D,promises:()=>yr,randomIno:()=>Li,read:()=>hu,readFile:()=>ou,readFileSync:()=>Tr,readSync:()=>Pa,readdir:()=>Su,readdirSync:()=>ci,readlink:()=>xu,readlinkSync:()=>ro,readv:()=>Wu,readvSync:()=>Ma,realpath:()=>Ou,realpathSync:()=>$e,rename:()=>Qf,renameSync:()=>wa,resolveMountConfig:()=>Ii,resolveRemoteMount:()=>Xg,rm:()=>Du,rmSync:()=>oo,rmdir:()=>gu,rmdirSync:()=>io,rootCred:()=>We,rootIno:()=>Ue,setImmediate:()=>Md,size_max:()=>ge,stat:()=>eu,statSync:()=>Yi,statfs:()=>zu,statfsSync:()=>ja,symlink:()=>Eu,symlinkSync:()=>Oa,truncate:()=>iu,truncateSync:()=>Sa,umount:()=>ai,unlink:()=>ru,unlinkSync:()=>Or,unwatchFile:()=>Ru,utimes:()=>Pu,utimesSync:()=>no,watch:()=>Nu,watchFile:()=>Cu,write:()=>pu,writeFile:()=>su,writeFileSync:()=>Qi,writeSync:()=>Ia,writev:()=>ju,writevSync:()=>Ua});var B=(h=>(h[h.EPERM=1]="EPERM",h[h.ENOENT=2]="ENOENT",h[h.EINTR=4]="EINTR",h[h.EIO=5]="EIO",h[h.ENXIO=6]="ENXIO",h[h.EBADF=9]="EBADF",h[h.EAGAIN=11]="EAGAIN",h[h.ENOMEM=12]="ENOMEM",h[h.EACCES=13]="EACCES",h[h.EFAULT=14]="EFAULT",h[h.ENOTBLK=15]="ENOTBLK",h[h.EBUSY=16]="EBUSY",h[h.EEXIST=17]="EEXIST",h[h.EXDEV=18]="EXDEV",h[h.ENODEV=19]="ENODEV",h[h.ENOTDIR=20]="ENOTDIR",h[h.EISDIR=21]="EISDIR",h[h.EINVAL=22]="EINVAL",h[h.ENFILE=23]="ENFILE",h[h.EMFILE=24]="EMFILE",h[h.ETXTBSY=26]="ETXTBSY",h[h.EFBIG=27]="EFBIG",h[h.ENOSPC=28]="ENOSPC",h[h.ESPIPE=29]="ESPIPE",h[h.EROFS=30]="EROFS",h[h.EMLINK=31]="EMLINK",h[h.EPIPE=32]="EPIPE",h[h.EDOM=33]="EDOM",h[h.ERANGE=34]="ERANGE",h[h.EDEADLK=35]="EDEADLK",h[h.ENAMETOOLONG=36]="ENAMETOOLONG",h[h.ENOLCK=37]="ENOLCK",h[h.ENOSYS=38]="ENOSYS",h[h.ENOTEMPTY=39]="ENOTEMPTY",h[h.ELOOP=40]="ELOOP",h[h.ENOMSG=42]="ENOMSG",h[h.EBADE=52]="EBADE",h[h.EBADR=53]="EBADR",h[h.EXFULL=54]="EXFULL",h[h.ENOANO=55]="ENOANO",h[h.EBADRQC=56]="EBADRQC",h[h.ENOSTR=60]="ENOSTR",h[h.ENODATA=61]="ENODATA",h[h.ETIME=62]="ETIME",h[h.ENOSR=63]="ENOSR",h[h.ENONET=64]="ENONET",h[h.EREMOTE=66]="EREMOTE",h[h.ENOLINK=67]="ENOLINK",h[h.ECOMM=70]="ECOMM",h[h.EPROTO=71]="EPROTO",h[h.EBADMSG=74]="EBADMSG",h[h.EOVERFLOW=75]="EOVERFLOW",h[h.EBADFD=77]="EBADFD",h[h.ESTRPIPE=86]="ESTRPIPE",h[h.ENOTSOCK=88]="ENOTSOCK",h[h.EDESTADDRREQ=89]="EDESTADDRREQ",h[h.EMSGSIZE=90]="EMSGSIZE",h[h.EPROTOTYPE=91]="EPROTOTYPE",h[h.ENOPROTOOPT=92]="ENOPROTOOPT",h[h.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",h[h.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",h[h.ENOTSUP=95]="ENOTSUP",h[h.ENETDOWN=100]="ENETDOWN",h[h.ENETUNREACH=101]="ENETUNREACH",h[h.ENETRESET=102]="ENETRESET",h[h.ETIMEDOUT=110]="ETIMEDOUT",h[h.ECONNREFUSED=111]="ECONNREFUSED",h[h.EHOSTDOWN=112]="EHOSTDOWN",h[h.EHOSTUNREACH=113]="EHOSTUNREACH",h[h.EALREADY=114]="EALREADY",h[h.EINPROGRESS=115]="EINPROGRESS",h[h.ESTALE=116]="ESTALE",h[h.EREMOTEIO=121]="EREMOTEIO",h[h.EDQUOT=122]="EDQUOT",h))(B||{}),Tn={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},u=class t extends Error{constructor(i,r=Tn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=B[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let r=new t(i.errno,i.message,i.path,i.syscall);return r.code=i.code,r.stack=i.stack,r}static With(i,r,n){return new t(B[i],Tn[B[i]],r,n)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};var It={};wr(It,{COPYFILE_EXCL:()=>Ti,COPYFILE_FICLONE:()=>ld,COPYFILE_FICLONE_FORCE:()=>fd,F_OK:()=>Oi,O_APPEND:()=>De,O_CREAT:()=>Z,O_DIRECT:()=>bd,O_DIRECTORY:()=>dd,O_DSYNC:()=>yd,O_EXCL:()=>Le,O_NOATIME:()=>pd,O_NOCTTY:()=>ud,O_NOFOLLOW:()=>hd,O_NONBLOCK:()=>gd,O_RDONLY:()=>Jt,O_RDWR:()=>ce,O_SYMLINK:()=>md,O_SYNC:()=>Qt,O_TRUNC:()=>Be,O_WRONLY:()=>Ne,R_OK:()=>Re,S_IFBLK:()=>tt,S_IFCHR:()=>it,S_IFDIR:()=>fe,S_IFIFO:()=>rt,S_IFLNK:()=>Ie,S_IFMT:()=>K,S_IFREG:()=>le,S_IFSOCK:()=>et,S_IRGRP:()=>vd,S_IROTH:()=>Pd,S_IRUSR:()=>Ed,S_IRWXG:()=>Rn,S_IRWXO:()=>Nn,S_IRWXU:()=>Cn,S_ISGID:()=>Sd,S_ISUID:()=>wd,S_ISVTX:()=>_d,S_IWGRP:()=>Fd,S_IWOTH:()=>Ad,S_IWUSR:()=>xd,S_IXGRP:()=>Id,S_IXOTH:()=>Od,S_IXUSR:()=>kd,UV_FS_O_FILEMAP:()=>Td,W_OK:()=>be,X_OK:()=>cd});var Oi=0,Re=4,be=2,cd=1,Ti=1,ld=2,fd=4,Jt=0,Ne=1,ce=2,Z=64,Le=128,ud=256,Be=512,De=1024,dd=65536,pd=262144,hd=131072,Qt=1052672,yd=4096,md=32768,bd=16384,gd=2048,K=61440,et=49152,Ie=40960,le=32768,tt=24576,fe=16384,it=8192,rt=4096,wd=2048,Sd=1024,_d=512,Cn=448,Ed=256,xd=128,kd=64,Rn=56,vd=32,Fd=16,Id=8,Nn=7,Pd=4,Ad=2,Od=1,Td=0;var Ci=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(e??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(r??d),this.birthtimeMs=this._convert(n??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}static{s(this,"StatsCommon")}_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let r=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&r)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}},X=class extends Ci{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},de=class extends Ci{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}},Ln=525687744115,Ri=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=ge;this.ffree=ge}static{s(this,"StatsFs")}},Ni=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(ge);this.ffree=BigInt(ge)}static{s(this,"BigIntStatsFs")}};var ge=2**32-1,Ue=0n;function zs(){return Math.round(Math.random()*2**32).toString(16)}s(zs,"_random");function Li(){return BigInt("0x"+zs()+zs())}s(Li,"randomIno");var M={ino:0,size:8,mode:12,nlink:14,uid:18,gid:22,atime:26,birthtime:34,mtime:42,ctime:50,end:58};var Me=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(e){let i=!e;if(e??=new ArrayBuffer(M.end),e?.byteLength<M.end)throw new RangeError(`Can not create an inode from a buffer less than ${M.end} bytes`);if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Li(),this.nlink=1,this.size=4096;let r=Date.now();this.atimeMs=r,this.mtimeMs=r,this.ctimeMs=r,this.birthtimeMs=r}get ino(){return this.view.getBigUint64(M.ino,!0)}set ino(e){this.view.setBigUint64(M.ino,e,!0)}get size(){return this.view.getUint32(M.size,!0)}set size(e){this.view.setUint32(M.size,e,!0)}get mode(){return this.view.getUint16(M.mode,!0)}set mode(e){this.view.setUint16(M.mode,e,!0)}get nlink(){return this.view.getUint32(M.nlink,!0)}set nlink(e){this.view.setUint32(M.nlink,e,!0)}get uid(){return this.view.getUint32(M.uid,!0)}set uid(e){this.view.setUint32(M.uid,e,!0)}get gid(){return this.view.getUint32(M.gid,!0)}set gid(e){this.view.setUint32(M.gid,e,!0)}get atimeMs(){return this.view.getFloat64(M.atime,!0)}set atimeMs(e){this.view.setFloat64(M.atime,e,!0)}get birthtimeMs(){return this.view.getFloat64(M.birthtime,!0)}set birthtimeMs(e){this.view.setFloat64(M.birthtime,e,!0)}get mtimeMs(){return this.view.getFloat64(M.mtime,!0)}set mtimeMs(e){this.view.setFloat64(M.mtime,e,!0)}get ctimeMs(){return this.view.getFloat64(M.ctime,!0)}set ctimeMs(e){this.view.setFloat64(M.ctime,e,!0)}toStats(){return new X(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};Promise.withResolvers??=function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Cd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function D(t){if(typeof t=="number")return Vs(t);if(!Cd.includes(t))throw new Error("Invalid flag string: "+t);return t}s(D,"parseFlag");function Vs(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(Vs,"flagToString");function Rd(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(Rd,"flagToNumber");function At(t){let e=0;return e<<=1,e+=+pt(t),e<<=1,e+=+pe(t),e<<=1,e}s(At,"flagToMode");function pt(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(pt,"isReadable");function pe(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(pe,"isWriteable");function Bi(t){return t.indexOf("w")!==-1}s(Bi,"isTruncating");function nt(t){return t.indexOf("a")!==-1}s(nt,"isAppendable");function Nd(t){return t.indexOf("s")!==-1}s(Nd,"isSynchronous");function Di(t){return t.indexOf("x")!==-1}s(Di,"isExclusive");var Pt=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},he=class extends Pt{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:ge}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;if(this.stats.size!=a.byteLength){if(pt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return nt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}stat(){return Promise.resolve(new X(this.stats))}statSync(){return new X(this.stats)}_truncate(i){if(this.dirty=!0,!pe(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,r=0,n=this.stats.size,o=this.position){if(this.dirty=!0,!pe(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:ge}));l.set(this._buffer),this._buffer=l}let c=i.slice(r,r+n);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,r,n,o){let a=this._write(i,r,n,o);return await this.sync(),a}writeSync(i,r=0,n=this.stats.size,o=this.position){let a=this._write(i,r,n,o);return this.syncSync(),a}_read(i,r=0,n=this.stats.size,o){if(!pt(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,r,n).set(this._buffer.slice(o,a)),c}async read(i,r,n,o){let a=this._read(i,r,n,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,r,n,o){let a=this._read(i,r,n,o);return this.statSync(),a}async chmod(i){this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.dirty=!0,this.stats.chown(i,r),await this.sync()}chownSync(i,r){this.dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,await this.sync()}utimesSync(i,r){this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}async _setType(i){this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}},Zt=class extends he{static{s(this,"NoSyncFile")}constructor(e,i,r,n,o){super(e,i,r,n,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var We={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Ld="/";function Hs(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let c=0;c<=t.length;++c){if(c<t.length)a=t[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===c-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",r=0):(i=i.slice(0,l),r=i.length-1-i.lastIndexOf("/")),n=c,o=0;continue}else if(i.length!==0){i="",r=0,n=c,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,c):i=t.slice(n+1,c),r=c-n-1;n=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Hs,"normalizeString");function ht(...t){let e="";for(let r of[...t.reverse(),Ld])if(r.length&&(e=`${r}/${e}`,r.startsWith("/")))break;let i=e.startsWith("/");return e=Hs(e,!i),i?`/${e}`:e.length?e:"/"}s(ht,"resolve");function Bd(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=Hs(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}s(Bd,"normalize");function $(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Bd(e):"."}s($,"join");function I(t){if(t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(I,"dirname");function z(t,e){let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let c=t.length-1;c>=0;--c)if(t[c]==="/"){if(!n){i=c+1;break}}else a===-1&&(n=!1,a=c+1),o>=0&&(t[c]===e[o]?--o===-1&&(r=c):(o=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":t.slice(i,r)}s(z,"basename");function _r(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let r=e?1:0,n=-1,o=0,a=-1,c=!0,l=t.length-1,f=0;for(;l>=r;--l){if(t[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t[l]==="."?n===-1?n=l:f!==1&&(f=1):n!==-1&&(f=-1)}if(a!==-1){let d=o===0&&e?1:o;n===-1||f===0||f===1&&n===a-1&&n===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,n),i.base=t.slice(d,a),i.ext=t.slice(n,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(_r,"parse");var ie=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Ln}}constructor(...e){}async ready(){}async exists(e,i){try{return await this.stat(e,i),!0}catch(r){return r.code!="ENOENT"}}existsSync(e,i){try{return this.statSync(e,i),!0}catch(r){return r.code!="ENOENT"}}};function Dd(t){class e extends t{static{s(this,"SyncFS")}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,o){return this.renameSync(r,n,o)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,o,a){return this.createFileSync(r,n,o,a)}async openFile(r,n,o){return this.openFileSync(r,n,o)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,o){return this.mkdirSync(r,n,o)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,o){return this.linkSync(r,n,o)}async sync(r,n,o){return this.syncSync(r,n,o)}}return e}s(Dd,"Sync");function Bn(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let o=s(()=>this._queueRunning?setTimeout(o):n(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}}}checkSync(n,o){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",n,o);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",n,o)}renameSync(n,o,a){this.checkSync(n,"rename"),this._sync.renameSync(n,o,a),this.queue("rename",n,o,a)}statSync(n,o){return this.checkSync(n,"stat"),this._sync.statSync(n,o)}createFileSync(n,o,a,c){return this.checkSync(n,"createFile"),this._sync.createFileSync(n,o,a,c),this.queue("createFile",n,o,a,c),this.openFileSync(n,o,c)}openFileSync(n,o,a){this.checkSync(n,"openFile");let c=this._sync.openFileSync(n,o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new he(this,n,o,l,f)}unlinkSync(n,o){this.checkSync(n,"unlinkSync"),this._sync.unlinkSync(n,o),this.queue("unlink",n,o)}rmdirSync(n,o){this.checkSync(n,"rmdir"),this._sync.rmdirSync(n,o),this.queue("rmdir",n,o)}mkdirSync(n,o,a){this.checkSync(n,"mkdir"),this._sync.mkdirSync(n,o,a),this.queue("mkdir",n,o,a)}readdirSync(n,o){return this.checkSync(n,"readdir"),this._sync.readdirSync(n,o)}linkSync(n,o,a){this.checkSync(n,"link"),this._sync.linkSync(n,o,a),this.queue("link",n,o,a)}syncSync(n,o,a){this.checkSync(n,"sync"),this._sync.syncSync(n,o,a),this.queue("sync",n,o,a)}existsSync(n,o){return this.checkSync(n,"exists"),this._sync.existsSync(n,o)}async crossCopy(n){this.checkSync(n,"crossCopy");let o=await this.stat(n,We);if(o.isDirectory()){if(n!=="/"){let m=await this.stat(n,We);this._sync.mkdirSync(n,m.mode,m.cred())}let p=await this.readdir(n,We);for(let m of p)await this.crossCopy($(n,m))}else{var a=[];try{let p=x(a,await this.openFile(n,D("r"),We),!0);let m=x(a,this._sync.createFileSync(n,D("w"),o.mode,o.cred()));let b=new Uint8Array(o.size);await p.read(b);m.writeSync(b,0,o.size)}catch(c){var l=c,f=!0}finally{var d=k(a,l,f);d&&await d}}}async _next(){if(!this._queueRunning)return;let[n,...o]=this._queue.shift();await this[n](...o),await this._next()}queue(...n){this._queue.push(n),this._next()}}return e}s(Bn,"Async");function Dn(t){class e extends t{static{s(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new u(30)}renameSync(r,n,o){throw new u(30)}async createFile(r,n,o,a){throw new u(30)}createFileSync(r,n,o,a){throw new u(30)}async unlink(r,n){throw new u(30)}unlinkSync(r,n){throw new u(30)}async rmdir(r,n){throw new u(30)}rmdirSync(r,n){throw new u(30)}async mkdir(r,n,o){throw new u(30)}mkdirSync(r,n,o){throw new u(30)}async link(r,n,o){throw new u(30)}linkSync(r,n,o){throw new u(30)}async sync(r,n,o){throw new u(30)}syncSync(r,n,o){throw new u(30)}}return e}s(Dn,"Readonly");function Gs(t,e,i,r){r.existsSync(t,i)||(Gs(I(t),e,i,r),r.mkdirSync(t,e,i))}s(Gs,"mkdirpSync");function Er(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(Er,"_min");function Mn(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,r=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(n+m),o[m]=++m;let a,c,l,f,d;for(a=0;a+3<r;){let m=e.charCodeAt(n+(c=a)),b=e.charCodeAt(n+(l=a+1)),w=e.charCodeAt(n+(f=a+2)),g=e.charCodeAt(n+(d=a+3)),A=a+=4;for(let E=0;E<i;){let C=o[i+E],q=o[E];c=Er(q,c,l,m,C),l=Er(c,l,f,b,C),f=Er(l,f,d,w,C),A=Er(f,d,A,g,C),o[E++]=A,d=f,f=l,l=c,c=q}}let p=0;for(;a<r;){let m=e.charCodeAt(n+(c=a));p=++a;for(let b=0;b<i;b++){let w=o[b];o[b]=p=w<c||p<c?w>p?p+1:w+1:m===o[i+b]?c:c+1,c=w}}return p}s(Mn,"levenshtein");var Md=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Pe(t){if(typeof t!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Pe,"encode");function ei(t){if(!(t instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(ei,"decode");function xr(t){return JSON.parse(ei(t),(e,i)=>e==""?i:BigInt(i))}s(xr,"decodeDirListing");function we(t){return Pe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(we,"encodeDirListing");function Ud(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")}s(Ud,"_toUnixTimestamp");function Se(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new u(22,"Invalid mode: "+t?.toString())}s(Se,"normalizeMode");function Ot(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new u(22,"Invalid time.")}s(Ot,"normalizeTime");function _(t){if(t=t.toString(),t.includes("\0"))throw new u(22,"Path can not contain null character");if(t.length==0)throw new u(22,"Path can not be empty");return ht(t.replaceAll(/[/\\]+/g,"/"))}s(_,"normalizePath");function _e(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:Se("mode"in t?t?.mode:null,r)}}s(_e,"normalizeOptions");function S(){}s(S,"nop");var Ks=5,Mi=class extends ie{constructor(i){super();this.store=i;this._initialized=!1}static{s(this,"StoreFS")}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,r,n){let o=this.store.transaction(),a=I(i),c=z(i),l=I(r),f=z(r),d=await this.findINode(o,a),p=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,n))throw u.With("EACCES",i,"rename");if(!p[c])throw u.With("ENOENT",i,"rename");let m=p[c];if(delete p[c],(l+"/").indexOf(i+"/")===0)throw new u(16,a);let b,w;if(l===a?(b=d,w=p):(b=await this.findINode(o,l),w=await this.getDirListing(o,b,l)),w[f]){let g=await this.getINode(o,w[f],r);if(g.toStats().isFile())try{await o.remove(g.ino),await o.remove(w[f])}catch(A){throw await o.abort(),A}else throw u.With("EPERM",r,"rename")}w[f]=m;try{await o.set(d.ino,we(p)),await o.set(b.ino,we(w))}catch(g){throw await o.abort(),g}await o.commit()}renameSync(i,r,n){let o=this.store.transaction(),a=I(i),c=z(i),l=I(r),f=z(r),d=this.findINodeSync(o,a),p=this.getDirListingSync(o,d,a);if(!d.toStats().hasAccess(2,n))throw u.With("EACCES",i,"rename");if(!p[c])throw u.With("ENOENT",i,"rename");let m=p[c];if(delete p[c],(l+"/").indexOf(i+"/")==0)throw new u(16,a);let b,w;if(l===a?(b=d,w=p):(b=this.findINodeSync(o,l),w=this.getDirListingSync(o,b,l)),w[f]){let g=this.getINodeSync(o,w[f],r);if(g.toStats().isFile())try{o.removeSync(g.ino),o.removeSync(w[f])}catch(A){throw o.abortSync(),A}else throw u.With("EPERM",r,"rename")}w[f]=m;try{o.setSync(d.ino,we(p)),o.setSync(b.ino,we(w))}catch(g){throw o.abortSync(),g}o.commitSync()}async stat(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o)throw u.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,r))throw u.With("EACCES",i,"stat");return a}statSync(i,r){let n=this.findINodeSync(this.store.transaction(),i).toStats();if(!n.hasAccess(4,r))throw u.With("EACCES",i,"stat");return n}async createFile(i,r,n,o){let a=new Uint8Array(0),c=await this.commitNew(this.store.transaction(),i,32768,n,o,a);return new he(this,i,r,c.toStats(),a)}createFileSync(i,r,n,o){return this.commitNewSync(i,32768,n,o),this.openFileSync(i,r,o)}async openFile(i,r,n){let o=this.store.transaction(),a=await this.findINode(o,i),c=await o.get(a.ino);if(!a.toStats().hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");if(!c)throw u.With("ENOENT",i,"openFile");return new he(this,i,r,a.toStats(),c)}openFileSync(i,r,n){let o=this.store.transaction(),a=this.findINodeSync(o,i),c=o.getSync(a.ino);if(!a.toStats().hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");if(!c)throw u.With("ENOENT",i,"openFile");return new he(this,i,r,a.toStats(),c)}async unlink(i,r){return this.remove(i,!1,r)}unlinkSync(i,r){this.removeSync(i,!1,r)}async rmdir(i,r){if((await this.readdir(i,r)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,r)}rmdirSync(i,r){if(this.readdirSync(i,r).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,r)}async mkdir(i,r,n){let o=this.store.transaction(),a=Pe("{}");await this.commitNew(o,i,16384,r,n,a)}mkdirSync(i,r,n){this.commitNewSync(i,16384,r,n,Pe("{}"))}async readdir(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o.toStats().hasAccess(4,r))throw u.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(n,o,i))}readdirSync(i,r){let n=this.store.transaction(),o=this.findINodeSync(n,i);if(!o.toStats().hasAccess(4,r))throw u.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(n,o,i))}async sync(i,r,n){let o=this.store.transaction(),a=await this._findINode(o,I(i),z(i)),c=await this.getINode(o,a,i),l=c.update(n);try{await o.set(c.ino,r),l&&await o.set(a,c.data)}catch(f){throw await o.abort(),f}await o.commit()}syncSync(i,r,n){let o=this.store.transaction(),a=this._findINodeSync(o,I(i),z(i)),c=this.getINodeSync(o,a,i),l=c.update(n);try{o.setSync(c.ino,r),l&&o.setSync(a,c.data)}catch(f){throw o.abortSync(),f}o.commitSync()}async link(i,r,n){let o=this.store.transaction(),a=I(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,n))throw u.With("EACCES",a,"link");let l=I(r),f=await this.findINode(o,l),d=await this.getDirListing(o,f,l);if(!f.toStats().hasAccess(2,n))throw u.With("EACCES",l,"link");let p=await this._findINode(o,a,z(i)),m=await this.getINode(o,p,i);if(!m.toStats().hasAccess(2,n))throw u.With("EACCES",r,"link");m.nlink++,d[z(r)]=p;try{o.setSync(p,m.data),o.setSync(f.ino,we(d))}catch(b){throw o.abortSync(),b}o.commitSync()}linkSync(i,r,n){let o=this.store.transaction(),a=I(i);if(!this.findINodeSync(o,a).toStats().hasAccess(4,n))throw u.With("EACCES",a,"link");let l=I(r),f=this.findINodeSync(o,l),d=this.getDirListingSync(o,f,l);if(!f.toStats().hasAccess(2,n))throw u.With("EACCES",l,"link");let p=this._findINodeSync(o,a,z(i)),m=this.getINodeSync(o,p,i);if(!m.toStats().hasAccess(2,n))throw u.With("EACCES",r,"link");m.nlink++,d[z(r)]=p;try{o.setSync(p,m.data),o.setSync(f.ino,we(d))}catch(b){throw o.abortSync(),b}o.commitSync()}async checkRoot(){let i=this.store.transaction();if(await i.get(Ue))return;let r=new Me;r.mode=16895,await i.set(r.ino,Pe("{}")),await i.set(Ue,r.data),await i.commit()}checkRootSync(){let i=this.store.transaction();if(i.getSync(Ue))return;let r=new Me;r.mode=16895,i.setSync(r.ino,Pe("{}")),i.setSync(Ue,r.data),i.commitSync()}async _findINode(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return Ue;let c=r=="/"?await this.getINode(i,Ue,r):await this.findINode(i,r,o),l=await this.getDirListing(i,c,r);if(!(n in l))throw u.With("ENOENT",ht(r,n),"_findINode");return l[n]}_findINodeSync(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return Ue;let c=r=="/"?this.getINodeSync(i,Ue,r):this.findINodeSync(i,r,o),l=this.getDirListingSync(i,c,r);if(!(n in l))throw u.With("ENOENT",ht(r,n),"_findINode");return l[n]}async findINode(i,r,n=new Set){let o=await this._findINode(i,I(r),z(r),n);return this.getINode(i,o,r)}findINodeSync(i,r,n=new Set){let o=this._findINodeSync(i,I(r),z(r),n);return this.getINodeSync(i,o,r)}async getINode(i,r,n){let o=await i.get(r);if(!o)throw u.With("ENOENT",n,"getINode");return new Me(o.buffer)}getINodeSync(i,r,n){let o=i.getSync(r);if(!o)throw u.With("ENOENT",n,"getINode");return new Me(o.buffer)}async getDirListing(i,r,n){if(!r.toStats().isDirectory())throw u.With("ENOTDIR",n,"getDirListing");let o=await i.get(r.ino);if(!o)throw u.With("ENOENT",n,"getDirListing");return xr(o)}getDirListingSync(i,r,n){if(!r.toStats().isDirectory())throw u.With("ENOTDIR",n,"getDirListing");let o=i.getSync(r.ino);if(!o)throw u.With("ENOENT",n,"getDirListing");return xr(o)}async addNew(i,r,n){for(let o=0;o<Ks;o++){let a=Li();if(!await i.get(a))return await i.set(a,r),a}throw new u(28,"No inode IDs available",n,"addNewNode")}addNewSync(i,r,n){for(let o=0;o<Ks;o++){let a=Li();if(!i.getSync(a))return i.setSync(a,r),a}throw new u(28,"No inode IDs available",n,"addNewNode")}async commitNew(i,r,n,o,a,c){let l=I(r),f=await this.findINode(i,l);if(!f.toStats().hasAccess(2,a))throw u.With("EACCES",r,"commitNewFile");let d=z(r),p=await this.getDirListing(i,f,l);if(r==="/")throw u.With("EEXIST",r,"commitNewFile");if(p[d])throw await i.abort(),u.With("EEXIST",r,"commitNewFile");try{let m=new Me;return m.ino=await this.addNew(i,c,r),m.mode=o|n,m.uid=a.uid,m.gid=a.gid,m.size=c.length,p[d]=await this.addNew(i,m.data,r),await i.set(f.ino,we(p)),await i.commit(),m}catch(m){throw await i.abort(),m}}commitNewSync(i,r,n,o,a=new Uint8Array){let c=this.store.transaction(),l=I(i),f=this.findINodeSync(c,l);if(!f.toStats().hasAccess(2,o))throw u.With("EACCES",i,"commitNewFile");let d=z(i),p=this.getDirListingSync(c,f,l);if(i==="/")throw u.With("EEXIST",i,"commitNewFile");if(p[d])throw u.With("EEXIST",i,"commitNewFile");let m=new Me;try{m.ino=this.addNewSync(c,a,i),m.size=a.length,m.mode=n|r,m.uid=o.uid,m.gid=o.gid,p[d]=this.addNewSync(c,m.data,i),c.setSync(f.ino,we(p))}catch(b){throw c.abortSync(),b}return c.commitSync(),m}async remove(i,r,n){let o=this.store.transaction(),a=I(i),c=await this.findINode(o,a),l=await this.getDirListing(o,c,a),f=z(i);if(!l[f])throw u.With("ENOENT",i,"removeEntry");let d=l[f],p=await this.getINode(o,d,i);if(!p.toStats().hasAccess(2,n))throw u.With("EACCES",i,"removeEntry");if(delete l[f],!r&&p.toStats().isDirectory())throw u.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw u.With("ENOTDIR",i,"removeEntry");try{await o.set(c.ino,we(l)),--p.nlink<1&&(await o.remove(p.ino),await o.remove(d))}catch(m){throw await o.abort(),m}await o.commit()}removeSync(i,r,n){let o=this.store.transaction(),a=I(i),c=this.findINodeSync(o,a),l=this.getDirListingSync(o,c,a),f=z(i),d=l[f];if(!d)throw u.With("ENOENT",i,"removeEntry");let p=this.getINodeSync(o,d,i);if(!p.toStats().hasAccess(2,n))throw u.With("EACCES",i,"removeEntry");if(delete l[f],!r&&p.toStats().isDirectory())throw u.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw u.With("ENOTDIR",i,"removeEntry");try{o.setSync(c.ino,we(l)),--p.nlink<1&&(o.removeSync(p.ino),o.removeSync(d))}catch(m){throw o.abortSync(),m}o.commitSync()}};var Ui=class{constructor(e){this.store=e;this.aborted=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.aborted||await this.commit()}[Symbol.dispose](){this.aborted||this.commitSync()}},Wi=class extends Ui{static{s(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},Un=class extends Ui{static{s(this,"AsyncTransaction")}getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var Wn=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(e){return this.cache.get(e)}set(e,i){this.cache.set(e,i),this.queue.add(this._set(e,i))}delete(e){this.cache.delete(e),this.queue.add(this._delete(e))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[e,i]of await this.entries())this.cache.has(e)||this.cache.set(e,i);for(let e of this.queue)await e}transaction(){return new ti(this)}},ti=class extends Wi{constructor(i){super(i);this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let r=this.store.get(i);return this.stashOldValue(i,r),r}setSync(i,r){return this.markModified(i),this.store.set(i,r)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){}abortSync(){for(let i of this.modifiedKeys){let r=this.originalData.get(i);r?this.store.set(i,r):this.store.delete(i)}}stashOldValue(i,r){this.originalData.has(i)||this.originalData.set(i,r)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var kr=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new ti(this)}},ji={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:t}){let e=new Mi(new kr(t));return e.checkRootSync(),e},"create")};function Wd(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}s(Wd,"isFileData");function jn(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}s(jn,"isMessage");var ii=new Map;function qn(t,{port:e,timeout:i=1e3,fs:r}={}){let n=new Error().stack.slice(6);if(!e)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ii.set(c,{resolve:o,reject:a,fs:r}),e.postMessage({...t,_zenfs:!0,id:c,stack:n});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=n,a(f),typeof l=="object"&&l.unref()},i)})}s(qn,"request");function Ys(t){if(!jn(t))return;let{id:e,value:i,error:r,stack:n}=t;if(!ii.has(e)){let l=new u(5,"Invalid RPC id:"+e);throw l.stack+=n,l}let{resolve:o,reject:a,fs:c}=ii.get(e);if(r){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=n,a(l),ii.delete(e);return}if(Wd(i)){let{fd:l,path:f,position:d}=i,p=new qi(c,l,f,d);o(p),ii.delete(e);return}o(i),ii.delete(e)}s(Ys,"handleResponse");function vr(t,e){if(!t)throw u.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(vr,"attach");function $n(t,e){if(!t)throw u.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}s($n,"detach");function Xs(t){let e=[],i=e.push.bind(e);return vr(t,i),function(r){$n(t,i);for(let n of e){let o="data"in n?n.data:n;$i(t,r,o)}}}s(Xs,"catchMessages");function zi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(zi,"isBackend");async function zn(t,e){if(typeof e!="object"||e===null)throw new u(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(c=>!(c in t.options)).map(c=>({str:c,distance:Mn(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new u(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}`);r.validator&&await r.validator(n)}}s(zn,"checkOptions");function Vi(t){return t!=null&&typeof t=="object"&&"backend"in t&&zi(t.backend)}s(Vi,"isBackendConfig");var mr={};wr(mr,{BigIntStatsFs:()=>Ni,Dir:()=>wt,Dirent:()=>gt,ReadStream:()=>kt,Stats:()=>X,StatsFs:()=>Ri,WriteStream:()=>vt,access:()=>Tu,accessSync:()=>Ba,appendFile:()=>au,appendFileSync:()=>Ea,chmod:()=>Fu,chmodSync:()=>Ra,chown:()=>ku,chownSync:()=>Ta,close:()=>lu,closeSync:()=>bt,constants:()=>It,copyFile:()=>Uu,copyFileSync:()=>so,cp:()=>$u,cpSync:()=>ao,createReadStream:()=>Lu,createWriteStream:()=>Bu,exists:()=>Zf,existsSync:()=>ze,fchmod:()=>mu,fchmodSync:()=>Rr,fchown:()=>yu,fchownSync:()=>Cr,fdatasync:()=>du,fdatasyncSync:()=>Fa,fstat:()=>cu,fstatSync:()=>xa,fsync:()=>uu,fsyncSync:()=>va,ftruncate:()=>fu,ftruncateSync:()=>ka,futimes:()=>bu,futimesSync:()=>Nr,lchmod:()=>Iu,lchmodSync:()=>Na,lchown:()=>vu,lchownSync:()=>Ca,link:()=>_u,linkSync:()=>Aa,lopenSync:()=>Ji,lstat:()=>tu,lstatSync:()=>to,lutimes:()=>Au,lutimesSync:()=>La,mkdir:()=>wu,mkdirSync:()=>Lr,mkdtemp:()=>Mu,mkdtempSync:()=>Da,mount:()=>Nt,mountObject:()=>Ki,mounts:()=>ke,open:()=>nu,openAsBlob:()=>Vu,openSync:()=>Xi,opendir:()=>qu,opendirSync:()=>Wa,promises:()=>yr,read:()=>hu,readFile:()=>ou,readFileSync:()=>Tr,readSync:()=>Pa,readdir:()=>Su,readdirSync:()=>ci,readlink:()=>xu,readlinkSync:()=>ro,readv:()=>Wu,readvSync:()=>Ma,realpath:()=>Ou,realpathSync:()=>$e,rename:()=>Qf,renameSync:()=>wa,rm:()=>Du,rmSync:()=>oo,rmdir:()=>gu,rmdirSync:()=>io,stat:()=>eu,statSync:()=>Yi,statfs:()=>zu,statfsSync:()=>ja,symlink:()=>Eu,symlinkSync:()=>Oa,truncate:()=>iu,truncateSync:()=>Sa,umount:()=>ai,unlink:()=>ru,unlinkSync:()=>Or,unwatchFile:()=>Ru,utimes:()=>Pu,utimesSync:()=>no,watch:()=>Nu,watchFile:()=>Cu,write:()=>pu,writeFile:()=>su,writeFileSync:()=>Qi,writeSync:()=>Ia,writev:()=>ju,writevSync:()=>Ua});var Ds=Sr(xe(),1);var yr={};wr(yr,{FileHandle:()=>oe,access:()=>Rs,appendFile:()=>vs,chmod:()=>Os,chown:()=>Ps,constants:()=>It,copyFile:()=>xn,cp:()=>kn,exists:()=>Ce,lchmod:()=>Ts,lchown:()=>As,link:()=>Fs,lstat:()=>gn,lutimes:()=>Cs,mkdir:()=>hr,mkdtemp:()=>Ns,open:()=>ye,opendir:()=>Ls,readFile:()=>pr,readdir:()=>Bt,readlink:()=>Sn,realpath:()=>Te,rename:()=>xs,rm:()=>En,rmdir:()=>wn,stat:()=>ki,statfs:()=>Bs,symlink:()=>Is,truncate:()=>ks,unlink:()=>dr,utimes:()=>_n,watch:()=>Vg,writeFile:()=>Fi});var Yt=Sr(xe(),1);var mt=Sr(xe(),1);var v=We;function ga(t){v=t}s(ga,"setCred");var Rt=new Map,Sp=100;function Gi(t){let e=Sp++;return Rt.set(e,t),e}s(Gi,"file2fd");function U(t){if(!Rt.has(t))throw new u(9);return Rt.get(t)}s(U,"fd2file");var ke=new Map;Nt("/",ji.create({name:"root"}));function Nt(t,e){if(t[0]!=="/"&&(t="/"+t),t=ht(t),ke.has(t))throw new u(22,"Mount point "+t+" is already in use.");ke.set(t,e)}s(Nt,"mount");function ai(t){if(t[0]!=="/"&&(t=`/${t}`),t=ht(t),!ke.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");ke.delete(t)}s(ai,"umount");function R(t){t=_(t);let e=[...ke].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function ba(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(ba,"fixPaths");function Y(t,e){return typeof t.stack=="string"&&(t.stack=ba(t.stack,e)),t.message=ba(t.message,e),t}s(Y,"fixError");function Ki(t){"/"in t&&ai("/");for(let[e,i]of Object.entries(t))Nt(e,i)}s(Ki,"mountObject");function Ar(t,e){let i=t.metadata(),r=i.blockSize||4096;return{type:(e?BigInt:Number)(i.type),bsize:(e?BigInt:Number)(r),ffree:(e?BigInt:Number)(i.freeNodes||ge),files:(e?BigInt:Number)(i.totalNodes||ge),bavail:(e?BigInt:Number)(i.freeSpace/r),bfree:(e?BigInt:Number)(i.freeSpace/r),blocks:(e?BigInt:Number)(i.totalSpace/r)}}s(Ar,"_statfs");function wa(t,e){t=_(t),e=_(e);let i=R(t),r=R(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,v);Qi(e,Tr(t)),Or(t)}catch(o){throw Y(o,n)}}s(wa,"renameSync");function ze(t){t=_(t);try{let{fs:e,path:i}=R($e(t));return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(ze,"existsSync");function Yi(t,e){t=_(t);let{fs:i,path:r}=R(ze(t)?$e(t):t);try{let n=i.statSync(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(Yi,"statSync");function to(t,e){t=_(t);let{fs:i,path:r}=R(t);try{let n=i.statSync(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(to,"lstatSync");function Sa(t,e=0){var r=[];try{let i=x(r,Lt(t,"r+"));e||=0;if(e<0)throw new u(22);i.truncateSync(e)}catch(n){var o=n,a=!0}finally{k(r,o,a)}}s(Sa,"truncateSync");function Or(t){t=_(t);let{fs:e,path:i}=R(t);try{return e.unlinkSync(i,v)}catch(r){throw Y(r,{[i]:t})}}s(Or,"unlinkSync");function Lt(t,e,i,r=!0){t=_(t);let n=Se(i,420),o=D(e);t=r&&ze(t)?$e(t):t;let{fs:a,path:c}=R(t);if(!a.existsSync(c,v)){if(!pe(o)&&!nt(o)||o=="r+")throw u.With("ENOENT",t,"_open");if(!a.statSync(I(c),v).isDirectory())throw u.With("ENOTDIR",I(t),"_open");return a.createFileSync(c,o,n,v)}let l=a.statSync(c,v);if(!l.hasAccess(n,v))throw u.With("EACCES",t,"_open");if(Di(o))throw u.With("EEXIST",t,"_open");return Bi(o)?(a.unlinkSync(c,v),a.createFileSync(c,o,l.mode,v)):a.openFileSync(c,o,v)}s(Lt,"_openSync");function Xi(t,e,i=0){return Gi(Lt(t,e,i,!0))}s(Xi,"openSync");function Ji(t,e,i){return Gi(Lt(t,e,i,!1))}s(Ji,"lopenSync");function _a(t,e,i){var a=[];try{let r=x(a,Lt(t,e,420,i));let n=r.statSync();let o=new Uint8Array(n.size);r.readSync(o,0,n.size,0);r.closeSync();return o}catch(c){var l=c,f=!0}finally{k(a,l,f)}}s(_a,"_readFileSync");function Tr(t,e={}){let i=_e(e,null,"r",420),r=D(i.flag);if(!pt(r))throw new u(22,"Flag passed to readFile must allow for reading.");let n=mt.Buffer.from(_a(typeof t=="number"?U(t).path:t.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Tr,"readFileSync");function Qi(t,e,i={}){var c=[];try{let r=_e(i,"utf8","w+",420);let n=D(r.flag);if(!pe(n))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new u(22,"Data not specified");let a=x(c,Lt(typeof t=="number"?U(t).path:t.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength,0)}catch(l){var f=l,d=!0}finally{k(c,f,d)}}s(Qi,"writeFileSync");function Ea(t,e,i={}){var c=[];try{let r=_e(i,"utf8","a",420);let n=D(r.flag);if(!nt(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=x(c,Lt(typeof t=="number"?U(t).path:t.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{k(c,f,d)}}s(Ea,"appendFileSync");function xa(t,e){let i=U(t).statSync();return e?.bigint?new de(i):i}s(xa,"fstatSync");function bt(t){U(t).closeSync(),Rt.delete(t)}s(bt,"closeSync");function ka(t,e=0){if(e||=0,e<0)throw new u(22);U(t).truncateSync(e)}s(ka,"ftruncateSync");function va(t){U(t).syncSync()}s(va,"fsyncSync");function Fa(t){U(t).datasyncSync()}s(Fa,"fdatasyncSync");function Ia(t,e,i,r,n){let o,a,c,l;if(typeof e=="string"){l=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=mt.Buffer.from(e,d),c=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,l=typeof n=="number"?n:null;let f=U(t);return l??=f.position,f.writeSync(o,a,c,l)}s(Ia,"writeSync");function Pa(t,e,i,r,n){let o=U(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=o.position),o.readSync(e,a,r,n)}s(Pa,"readSync");function Cr(t,e,i){U(t).chownSync(e,i)}s(Cr,"fchownSync");function Rr(t,e){let i=Se(e,-1);if(i<0)throw new u(22,"Invalid mode.");U(t).chmodSync(i)}s(Rr,"fchmodSync");function Nr(t,e,i){U(t).utimesSync(Ot(e),Ot(i))}s(Nr,"futimesSync");function io(t){t=_(t);let{fs:e,path:i}=R(ze(t)?$e(t):t);try{e.rmdirSync(i,v)}catch(r){throw Y(r,{[i]:t})}}s(io,"rmdirSync");function Lr(t,e){e=typeof e=="object"?e:{mode:e};let i=Se(e?.mode,511);t=_(t),t=ze(t)?$e(t):t;let{fs:r,path:n}=R(t),o={[n]:t};try{if(!e?.recursive)return r.mkdirSync(n,i,v);let a=[];for(let c=n,l=t;!r.existsSync(c,v);c=I(c),l=I(l))a.unshift(c),o[c]=l;for(let c of a)r.mkdirSync(c,i,v);return a[0]}catch(a){throw Y(a,o)}}s(Lr,"mkdirSync");function ci(t,e){t=_(t);let{fs:i,path:r}=R(ze(t)?$e(t):t),n;try{n=i.readdirSync(r,v)}catch(o){throw Y(o,{[r]:t})}for(let o of ke.keys()){if(!o.startsWith(t))continue;let a=o.slice(t.length);a.includes("/")||a.length==0||n.push(a)}return n.map(o=>typeof e=="object"&&e?.withFileTypes?new gt(o,Yi($(t.toString(),o))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?mt.Buffer.from(o):o)}s(ci,"readdirSync");function Aa(t,e){t=_(t),e=_(e);let{fs:i,path:r}=R(t);try{return i.linkSync(r,e,v)}catch(n){throw Y(n,{[r]:t})}}s(Aa,"linkSync");function Oa(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(ze(e))throw u.With("EEXIST",e.toString(),"symlink");Qi(e,t.toString()),Lt(e,"r+",420,!1)._setTypeSync(40960)}s(Oa,"symlinkSync");function ro(t,e){let i=mt.Buffer.from(_a(t.toString(),"r",!1)),r=typeof e=="object"?e?.encoding:e;return r=="buffer"?i:i.toString(r)}s(ro,"readlinkSync");function Ta(t,e,i){let r=Xi(t,"r+");Cr(r,e,i),bt(r)}s(Ta,"chownSync");function Ca(t,e,i){let r=Ji(t,"r+");Cr(r,e,i),bt(r)}s(Ca,"lchownSync");function Ra(t,e){let i=Xi(t,"r+");Rr(i,e),bt(i)}s(Ra,"chmodSync");function Na(t,e){let i=Ji(t,"r+");Rr(i,e),bt(i)}s(Na,"lchmodSync");function no(t,e,i){let r=Xi(t,"r+");Nr(r,e,i),bt(r)}s(no,"utimesSync");function La(t,e,i){let r=Ji(t,"r+");Nr(r,e,i),bt(r)}s(La,"lutimesSync");function $e(t,e){t=_(t);let{base:i,dir:r}=_r(t),n=$(r=="/"?"/":$e(r),i),{fs:o,path:a,mountPoint:c}=R(n);try{return o.statSync(a,v).isSymbolicLink()?$e(c+ro(n,e).toString()):n}catch(l){throw Y(l,{[a]:n})}}s($e,"realpathSync");function Ba(t,e=384){if(!Yi(t).hasAccess(e,v))throw new u(13)}s(Ba,"accessSync");function oo(t,e){switch(t=_(t),Yi(t).mode&61440){case 16384:if(e?.recursive)for(let r of ci(t))oo($(t,r));io(t);return;case 32768:case 40960:Or(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}s(oo,"rmSync");function Da(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Lr(n),i=="buffer"?mt.Buffer.from(n):n}s(Da,"mkdtempSync");function so(t,e,i){if(t=_(t),e=_(e),i&&i&1&&ze(e))throw new u(17,"Destination file already exists.",e,"copyFile");Qi(e,Tr(t))}s(so,"copyFileSync");function Ma(t,e,i){let r=U(t),n=0;for(let o of e)n+=r.readSync(o,0,o.byteLength,i+n);return n}s(Ma,"readvSync");function Ua(t,e,i){let r=U(t),n=0;for(let o of e)n+=r.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+n);return n}s(Ua,"writevSync");function Wa(t,e){return t=_(t),new wt(t)}s(Wa,"opendirSync");function ao(t,e,i){t=_(t),e=_(e);let r=to(t);if(i?.errorOnExist&&ze(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");Lr(e,{recursive:!0});for(let n of ci(t,{withFileTypes:!0}))i.filter&&!i.filter($(t,n.name),$(e,n.name))||ao($(t,n.name),$(e,n.name),i);break;case 32768:case 40960:so(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&no(e,r.atime,r.mtime)}s(ao,"cpSync");function ja(t,e){t=_(t);let{fs:i}=R(t);return Ar(i,e?.bigint)}s(ja,"statfsSync");var gt=class{constructor(e,i){this.path=e;this.stats=i}static{s(this,"Dirent")}get name(){return z(this.path)}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}},wt=class{constructor(e){this.path=e;this.closed=!1;this._entries=[]}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Bt(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this._entries||(this._entries=ci(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})},"next")}}};var bn=Sr(Jf(),1);var kt=class extends bn.Readable{static{s(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}},vt=class extends bn.Writable{static{s(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}};var oe=class{static{s(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?Gi(e):e,this.file=i?e:U(e)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=Se(e,-1);if(i<0)throw new u(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e||=0,e<0)throw new u(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Ot(e),Ot(i))}async appendFile(e,i={}){let r=_e(i,"utf8","a",420),n=D(r.flag);if(!nt(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?Yt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length)}read(e,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(e,i,r,n)}async readFile(e){let i=_e(e,null,"r",292),r=D(i.flag);if(!pt(r))throw new u(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(n),0,n,0),a=Yt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async n=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){n.close();return}if(n.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){n.error(o)}},"start"),r=globalThis;if(!("ReadableStream"in r))throw new u(38,"ReadableStream is missing on globalThis");return new r.ReadableStream({start:i,type:e.type})}readLines(e){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new de(i):i}async write(e,i,r,n){let o,a,c;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,o=Yt.Buffer.from(e,f),c=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,n=typeof n=="number"?n:null;n??=this.file.position;let l=await this.file.write(o,a,c,n);return{buffer:o,bytesWritten:l}}async writeFile(e,i={}){let r=_e(i,"utf8","w",420),n=D(r.flag);if(!pe(n))throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?Yt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Rt.delete(this.fd)}async writev(e,i){let r=0;for(let n of e)r+=(await this.write(n,0,n.length,i+r)).bytesWritten;return{bytesWritten:r,buffers:e}}async readv(e,i){let r=0;for(let n of e)r+=(await this.read(n,0,n.byteLength,i+r)).bytesRead;return{bytesRead:r,buffers:e}}createReadStream(e){let i=new kt({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:s(async r=>{try{let n=await this.read(new Uint8Array(r),0,r,this.file.position);i.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(n){i.destroy(n)}},"read")});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:s(async(n,o,a)=>{try{let{bytesWritten:c}=await this.write(n,null,o);a(c==n.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},r=new vt(i);return r.path=this.file.path,r}};async function xs(t,e){t=_(t),e=_(e);let i=R(t),r=R(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,v);return}await Fi(e,await pr(t)),await dr(t)}catch(n){throw Y(n,{[i.path]:t,[r.path]:e})}}s(xs,"rename");async function Ce(t){try{let{fs:e,path:i}=R(await Te(t));return await e.exists(i,v)}catch(e){if(e instanceof u&&e.code=="ENOENT")return!1;throw e}}s(Ce,"exists");async function ki(t,e){t=_(t);let{fs:i,path:r}=R(await Ce(t)?await Te(t):t);try{let n=await i.stat(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(ki,"stat");async function gn(t,e){t=_(t);let{fs:i,path:r}=R(t);try{let n=await i.stat(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(gn,"lstat");async function ks(t,e=0){var r=[];try{let i=x(r,await ye(t,"r+"),!0);await i.truncate(e)}catch(n){var o=n,a=!0}finally{var c=k(r,o,a);c&&await c}}s(ks,"truncate");async function dr(t){t=_(t);let{fs:e,path:i}=R(t);try{await e.unlink(i,v)}catch(r){throw Y(r,{[i]:t})}}s(dr,"unlink");async function vi(t,e,i=420,r){t=_(t);let n=Se(i,420),o=D(e);t=r&&await Ce(t)?await Te(t):t;let{fs:a,path:c}=R(t);if(!await a.exists(c,v)){if(!pe(o)&&!nt(o)||o=="r+")throw u.With("ENOENT",t,"_open");let f=await a.stat(I(c),v);if(f&&!f.isDirectory())throw u.With("ENOTDIR",I(t),"_open");return new oe(await a.createFile(c,o,n,v))}if(Di(o))throw u.With("EEXIST",t,"_open");if(!Bi(o))return new oe(await a.openFile(c,o,v));let l=await a.openFile(c,o,v);return await l.truncate(0),await l.sync(),new oe(l)}s(vi,"_open");async function ye(t,e="r",i=420){return await vi(t,e,i,!0)}s(ye,"open");async function pr(t,e){var n=[];try{let i=_e(e,null,"r",420);let r=x(n,typeof t=="object"&&"fd"in t?t:await ye(t,i.flag,i.mode),!0);return await r.readFile(i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(pr,"readFile");async function Fi(t,e,i){var a=[];try{let r=_e(i,"utf8","w+",420);let n=x(a,t instanceof oe?t:await ye(t.toString(),r.flag,r.mode),!0);let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",n.file.path,"writeFile");await n.writeFile(o,r)}catch(c){var l=c,f=!0}finally{var d=k(a,l,f);d&&await d}}s(Fi,"writeFile");async function vs(t,e,i){var c=[];try{let r=_e(i,"utf8","a",420);let n=D(r.flag);if(!nt(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?Yt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=x(c,typeof t=="object"&&"fd"in t?t:await ye(t,r.flag,r.mode),!0);await a.appendFile(o,r)}catch(l){var f=l,d=!0}finally{var p=k(c,f,d);p&&await p}}s(vs,"appendFile");async function wn(t){t=_(t),t=await Ce(t)?await Te(t):t;let{fs:e,path:i}=R(t);try{await e.rmdir(i,v)}catch(r){throw Y(r,{[i]:t})}}s(wn,"rmdir");async function hr(t,e){e=typeof e=="object"?e:{mode:e};let i=Se(e?.mode,511);t=_(t),t=await Ce(t)?await Te(t):t;let{fs:r,path:n}=R(t),o={[n]:t};try{e?.recursive||await r.mkdir(n,i,v);let a=[];for(let c=n,l=t;!await r.exists(c,v);c=I(c),l=I(l))a.unshift(c),o[c]=l;for(let c of a)await r.mkdir(c,i,v);return a[0]}catch(a){throw Y(a,o)}}s(hr,"mkdir");async function Bt(t,e){t=_(t),t=await Ce(t)?await Te(t):t;let{fs:i,path:r}=R(t),n;try{n=await i.readdir(r,v)}catch(a){throw Y(a,{[r]:t})}for(let a of ke.keys())if(a.startsWith(t)){let c=a.slice(t.length);if(c.includes("/")||c.length==0)continue;n.push(c)}let o=[];for(let a of n)o.push(typeof e=="object"&&e?.withFileTypes?new gt(a,await ki($(t,a))):a);return o}s(Bt,"readdir");async function Fs(t,e){t=_(t),e=_(e);let{fs:i,path:r}=R(e);try{return await i.link(t,e,v)}catch(n){throw Y(n,{[r]:e})}}s(Fs,"link");async function Is(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await Ce(e))throw u.With("EEXIST",e.toString(),"symlink");await Fi(e,t.toString()),await(await vi(e,"r+",420,!1)).file._setType(40960)}s(Is,"symlink");async function Sn(t,e){var o=[];try{let i=x(o,await vi(_(t),"r",420,!1),!0);let r=await i.readFile();let n=typeof e=="object"?e?.encoding:e;return n=="buffer"?r:r.toString(n)}catch(a){var c=a,l=!0}finally{var f=k(o,c,l);f&&await f}}s(Sn,"readlink");async function Ps(t,e,i){var n=[];try{let r=x(n,await ye(t,"r+"),!0);await r.chown(e,i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(Ps,"chown");async function As(t,e,i){var n=[];try{let r=x(n,await vi(t,"r+",420,!1),!0);await r.chown(e,i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(As,"lchown");async function Os(t,e){var r=[];try{let i=x(r,await ye(t,"r+"),!0);await i.chmod(e)}catch(n){var o=n,a=!0}finally{var c=k(r,o,a);c&&await c}}s(Os,"chmod");async function Ts(t,e){var r=[];try{let i=x(r,await vi(t,"r+",420,!1),!0);await i.chmod(e)}catch(n){var o=n,a=!0}finally{var c=k(r,o,a);c&&await c}}s(Ts,"lchmod");async function _n(t,e,i){var n=[];try{let r=x(n,await ye(t,"r+"),!0);await r.utimes(e,i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(_n,"utimes");async function Cs(t,e,i){var n=[];try{let r=x(n,await vi(t,"r+",420,!1),!0);await r.utimes(new Date(e),new Date(i))}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(Cs,"lutimes");async function Te(t,e){t=_(t);let{base:i,dir:r}=_r(t),n=$(r=="/"?"/":await Te(r),i),{fs:o,path:a,mountPoint:c}=R(n);try{return(await o.stat(a,v)).isSymbolicLink()?Te(c+await Sn(n)):n}catch(l){throw Y(l,{[a]:n})}}s(Te,"realpath");function Vg(t,e={}){throw u.With("ENOSYS",t.toString(),"watch")}s(Vg,"watch");async function Rs(t,e=0){if(!(await ki(t)).hasAccess(e,v))throw new u(13)}s(Rs,"access");async function En(t,e){switch(t=_(t),(await ki(t)).mode&61440){case 16384:if(e?.recursive)for(let r of await Bt(t))await En($(t,r));await wn(t);return;case 32768:case 40960:await dr(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}s(En,"rm");async function Ns(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await hr(n),i=="buffer"?Yt.Buffer.from(n):n}s(Ns,"mkdtemp");async function xn(t,e,i){if(t=_(t),e=_(e),i&&i&1&&await Ce(e))throw new u(17,"Destination file already exists.",e,"copyFile");await Fi(e,await pr(t))}s(xn,"copyFile");async function Ls(t,e){return t=_(t),new wt(t)}s(Ls,"opendir");async function kn(t,e,i){t=_(t),e=_(e);let r=await gn(t);if(i?.errorOnExist&&await Ce(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");await hr(e,{recursive:!0});for(let n of await Bt(t,{withFileTypes:!0}))i.filter&&!i.filter($(t,n.name),$(e,n.name))||await kn($(t,n.name),$(e,n.name),i);break;case 32768:case 40960:await xn(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await _n(e,r.atime,r.mtime)}s(kn,"cp");async function Bs(t,e){t=_(t);let{fs:i}=R(t);return Ar(i,e?.bigint)}s(Bs,"statfs");function Qf(t,e,i=S){xs(t,e).then(()=>i()).catch(i)}s(Qf,"rename");function Zf(t,e=S){Ce(t).then(e).catch(()=>e(!1))}s(Zf,"exists");function eu(t,e,i=S){i=typeof e=="function"?e:i,ki(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(eu,"stat");function tu(t,e,i=S){i=typeof e=="function"?e:i,gn(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(tu,"lstat");function iu(t,e=0,i=S){i=typeof e=="function"?e:i,ks(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(iu,"truncate");function ru(t,e=S){dr(t).then(()=>e()).catch(e)}s(ru,"unlink");function nu(t,e,i,r=S){let n=Se(i,420);r=typeof i=="function"?i:r,ye(t,e,n).then(o=>r(void 0,o.fd)).catch(r)}s(nu,"open");function ou(t,e,i=S){i=typeof e=="function"?e:i,pr(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(ou,"readFile");function su(t,e,i,r=S){r=typeof i=="function"?i:r,Fi(t,e,typeof i!="function"?i:null).then(()=>r(void 0)).catch(r)}s(su,"writeFile");function au(t,e,i,r=S){let n=typeof i!="function"?i:void 0;r=typeof i=="function"?i:r,vs(t,e,n).then(()=>r()).catch(r)}s(au,"appendFile");function cu(t,e,i=S){i=typeof e=="function"?e:i,U(t).stat().then(r=>i(void 0,typeof e=="object"&&e?.bigint?new de(r):r)).catch(i)}s(cu,"fstat");function lu(t,e=S){new oe(t).close().then(()=>e()).catch(e)}s(lu,"close");function fu(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=U(t);if(r<0)throw new u(22);n.truncate(r).then(()=>i()).catch(i)}s(fu,"ftruncate");function uu(t,e=S){U(t).sync().then(()=>e()).catch(e)}s(uu,"fsync");function du(t,e=S){U(t).datasync().then(()=>e()).catch(e)}s(du,"fdatasync");function pu(t,e,i,r,n,o=S){let a,c,l,f,d,p=new oe(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof r=="string"?r:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof r=="function"?r:typeof n=="function"?n:o,o(new u(22,"Invalid arguments."));return}a=Ds.Buffer.from(e),c=0,l=a.length;let m=o;p.write(a,c,l,f).then(({bytesWritten:b})=>m(void 0,b,a.toString(d))).catch(m)}else{a=Ds.Buffer.from(e.buffer),c=i,l=r,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;p.write(a,c,l,f).then(({bytesWritten:b})=>m(void 0,b,a)).catch(m)}}s(pu,"write");function hu(t,e,i,r,n,o=S){new oe(t).read(e,i,r,n).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(hu,"read");function yu(t,e,i,r=S){new oe(t).chown(e,i).then(()=>r()).catch(r)}s(yu,"fchown");function mu(t,e,i){new oe(t).chmod(e).then(()=>i()).catch(i)}s(mu,"fchmod");function bu(t,e,i,r=S){new oe(t).utimes(e,i).then(()=>r()).catch(r)}s(bu,"futimes");function gu(t,e=S){wn(t).then(()=>e()).catch(e)}s(gu,"rmdir");function wu(t,e,i=S){hr(t,e).then(()=>i()).catch(i)}s(wu,"mkdir");function Su(t,e,i=S){i=typeof e=="function"?e:i,Bt(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(Su,"readdir");function _u(t,e,i=S){Fs(t,e).then(()=>i()).catch(i)}s(_u,"link");function Eu(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Is(t,e,n).then(()=>r()).catch(r)}s(Eu,"symlink");function xu(t,e,i=S){i=typeof e=="function"?e:i,Sn(t).then(r=>i(void 0,r)).catch(i)}s(xu,"readlink");function ku(t,e,i,r=S){Ps(t,e,i).then(()=>r()).catch(r)}s(ku,"chown");function vu(t,e,i,r=S){As(t,e,i).then(()=>r()).catch(r)}s(vu,"lchown");function Fu(t,e,i=S){Os(t,e).then(()=>i()).catch(i)}s(Fu,"chmod");function Iu(t,e,i=S){Ts(t,e).then(()=>i()).catch(i)}s(Iu,"lchmod");function Pu(t,e,i,r=S){_n(t,e,i).then(()=>r()).catch(r)}s(Pu,"utimes");function Au(t,e,i,r=S){Cs(t,e,i).then(()=>r()).catch(r)}s(Au,"lutimes");function Ou(t,e,i=S){i=typeof e=="function"?e:i,Te(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(Ou,"realpath");function Tu(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Rs(t,r).then(()=>i()).catch(i)}s(Tu,"access");function Cu(t,e,i=S){throw u.With("ENOSYS",t.toString(),"watchFile")}s(Cu,"watchFile");function Ru(t,e=S){throw u.With("ENOSYS",t.toString(),"unwatchFile")}s(Ru,"unwatchFile");function Nu(t,e,i=S){throw u.With("ENOSYS",t.toString(),"watch")}s(Nu,"watch");function Lu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new kt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{r||=await ye(t,"r",i?.mode);let a=await r.read(new Uint8Array(o),0,o,r.file.position);n.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),r.file.position+=a.bytesRead,a.bytesRead||await r.close()}catch(a){await r?.close(),n.destroy(a)}},"read"),destroy:s(function(o,a){r?.close().then(()=>a(o)).catch(a)},"destroy")});return n.path=t.toString(),n}s(Lu,"createReadStream");function Bu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new vt({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{r||=await ye(t,"w",i?.mode||438),await r.write(o,0,a),c(void 0)}catch(l){await r?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),r?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){r?.close().then(()=>o()).catch(o)},"final")});return n.path=t.toString(),n}s(Bu,"createWriteStream");function Du(t,e,i=S){i=typeof e=="function"?e:i,En(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(Du,"rm");function Mu(t,e,i=S){i=typeof e=="function"?e:i,Ns(t,typeof e!="function"?e:null).then(r=>i(void 0,r)).catch(i)}s(Mu,"mkdtemp");function Uu(t,e,i,r=S){r=typeof i=="function"?i:r,xn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Uu,"copyFile");function Wu(t,e,i,r=S){r=typeof i=="function"?i:r,new oe(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesRead:o})=>r(void 0,o,n)).catch(r)}s(Wu,"readv");function ju(t,e,i,r=S){r=typeof i=="function"?i:r,new oe(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesWritten:o})=>r(void 0,o,n)).catch(r)}s(ju,"writev");function qu(t,e,i=S){i=typeof e=="function"?e:i,Ls(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(qu,"opendir");function $u(t,e,i,r=S){r=typeof i=="function"?i:r,kn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s($u,"cp");function zu(t,e,i=S){i=typeof e=="function"?e:i,Bs(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(zu,"statfs");async function Vu(t,e){let i=await ye(t.toString(),"r"),r=await i.readFile();return await i.close(),new Blob([r],e)}s(Vu,"openAsBlob");function Hu(t){return Vi(t)||zi(t)||t instanceof ie}s(Hu,"isMountConfig");async function Ii(t,e=0){if(typeof t!="object"||t==null)throw new u(22,"Invalid options on mount configuration");if(!Hu(t))throw new u(22,"Invalid mount configuration");if(t instanceof ie)return t;zi(t)&&(t={backend:t});for(let[n,o]of Object.entries(t))if(n!="backend"&&Hu(o)){if(e>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");t[n]=await Ii(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await zn(i,t);let r=await i.create(t);return"_disableSync"in r&&(r._disableSync=t.disableAsyncCache||!1),await r.ready(),r}s(Ii,"resolveMountConfig");async function Hg(t){if(!Vi(t))throw new TypeError("Invalid single mount point configuration");let e=await Ii(t);ai("/"),Nt("/",e)}s(Hg,"configureSingle");async function Gg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;if(ga({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),!!t.mounts){for(let[r,n]of Object.entries(t.mounts)){if(!r.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Vi(n)&&(n.disableAsyncCache??=t.disableAsyncCache||!1),t.mounts[r]=await Ii(n)}Ki(t.mounts)}}s(Gg,"configure");var qi=class extends Pt{constructor(i,r,n,o){super();this.fs=i;this.fd=r;this.path=n;this.position=o}static{s(this,"PortFile")}rpc(i,...r){return qn({scope:"file",fd:this.fd,method:i,args:r},this.fs.options)}_throwNoSync(i){throw new u(95,"Syncrohnous operations not support on PortFile",this.path,i)}stat(){return this.rpc("stat")}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,r,n,o){return this.rpc("write",i,r,n,o)}writeSync(){this._throwNoSync("write")}async read(i,r,n,o){return await this.rpc("read",i,r,n,o)}readSync(){this._throwNoSync("read")}chown(i,r){return this.rpc("chown",i,r)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,r){return this.rpc("utimes",i,r)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}},Fn=class extends Bn(ie){constructor(i){super();this.options=i;this._sync=ji.create({name:"port-tmpfs"});this.port=i.port,vr(this.port,Ys)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...r){return qn({scope:"fs",method:i,args:r},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,r,n){return this.rpc("rename",i,r,n)}async stat(i,r){return new X(await this.rpc("stat",i,r))}sync(i,r,n){return this.rpc("sync",i,r,n)}openFile(i,r,n){return this.rpc("openFile",i,r,n)}createFile(i,r,n,o){return this.rpc("createFile",i,r,n,o)}unlink(i,r){return this.rpc("unlink",i,r)}rmdir(i,r){return this.rpc("rmdir",i,r)}mkdir(i,r,n){return this.rpc("mkdir",i,r,n)}readdir(i,r){return this.rpc("readdir",i,r)}exists(i,r){return this.rpc("exists",i,r)}link(i,r,n){return this.rpc("link",i,r,n)}},Gu=0,vn=new Map;async function $i(t,e,i){if(!jn(i))return;let{method:r,args:n,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await e[r](...n),l instanceof Pt&&(vn.set(++Gu,l),l={fd:Gu,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!vn.has(d))throw new u(9);l=await vn.get(d)[r](...n),r=="close"&&vn.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}t.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:r,stack:c,value:l})}s($i,"handleRequest");function Ku(t,e){vr(t,i=>$i(t,e,i))}s(Ku,"attachFS");function Kg(t,e){$n(t,i=>$i(t,e,i))}s(Kg,"detachFS");var Yg={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(t){if(typeof t?.postMessage!="function")throw new u(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(t){return new Fn(t)},"create")};async function Xg(t,e,i=0){let r=Xs(t),n=await Ii(e,i);return Ku(t,n),r(n),n}s(Xg,"resolveRemoteMount");function Yu(t){try{return JSON.parse(t),!0}catch{return!1}}s(Yu,"isJSON");function Ms(t){return t.at(0).toUpperCase()+t.slice(1)}s(Ms,"capitalize");var Us=Symbol("struct_init"),Jg=Symbol("struct");var Xu=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],Ju=[...Xu,...Xu.map(t=>Ms(t)),"char"];function Qu(t,e){return function(i,r){let n=typeof r=="object"?r.name:r;if(typeof n=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+n.toString()),n=n.toString()),!n)throw new ReferenceError("Invalid name for struct member");if(typeof i!="object")throw new TypeError("Invalid member for struct field");if(!("constructor"in i))throw new TypeError("Invalid member for struct field");let o=i.constructor;o[Us]||=[],o[Us].push({name:n,type:t,length:e})}}s(Qu,"member");function ew(t){function e(i,r){return typeof i=="number"?Qu(t,i):Qu(t)(i,r)}return s(e,"_"),e}s(ew,"_member");var QE=Object.fromEntries(Ju.map(t=>[t,ew(t)]));var Zu=1,In=class t extends Map{static{s(this,"Index")}constructor(){super()}files(){let e=new Map;for(let[i,r]of this)r.isFile()&&e.set(i,r);return e}toJSON(){return{version:Zu,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(e){let i=[];for(let r of this.keys())I(r)==e&&i.push(z(r));return i}fromJSON(e){if(e.version!=Zu)throw new u(22,"Index version mismatch");this.clear();for(let[i,r]of Object.entries(e.entries)){let n=new X(r);n.isDirectory()&&(n.fileData=Pe(JSON.stringify(this.dirEntries(i)))),this.set(i,n)}}static parse(e){if(!Yu(e))throw new u(22,"Invalid JSON");let i=JSON.parse(e),r=new t;return r.fromJSON(i),r}};var br=class extends Dn(ie){constructor(i){super();this.indexData=i;this.index=new In;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=await this.getData(i,r)}reloadFilesSync(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=this.getDataSync(i,r)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,r,n){if(pe(r))throw new u(1,i);let o=this.index.get(i);if(!o)throw u.With("ENOENT",i,"openFile");if(!o.hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");return new Zt(this,i,r,o,o.isDirectory()?o.fileData:await this.getData(i,o))}openFileSync(i,r,n){if(pe(r))throw new u(1,i);let o=this.index.get(i);if(!o)throw u.With("ENOENT",i,"openFile");if(!o.hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");return new Zt(this,i,r,o,o.isDirectory()?o.fileData:this.getDataSync(i,o))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"readdir");if(!r.isDirectory())throw u.With("ENOTDIR",i,"readdir");let n=JSON.parse(ei(r.fileData));if(!Array.isArray(n))throw u.With("ENODATA",i,"readdir");if(!n.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return n}};async function ed(t,e){let i=await fetch(t).catch(r=>{throw new u(5,r.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(e){case"buffer":{let r=await i.arrayBuffer().catch(n=>{throw new u(5,n.message)});return new Uint8Array(r)}case"json":return i.json().catch(r=>{throw new u(5,r.message)});default:throw new u(22,"Invalid download type: "+e)}}s(ed,"fetchFile");var Pn=class t extends br{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[e,i]of this.index.files())await this.getData(e,i)}constructor({index:e="index.json",baseUrl:i=""}){super(typeof e!="string"?e:ed(e,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}preload(e,i){let r=this.index.get(e);if(!r)throw u.With("ENOENT",e,"preloadFile");if(!r.isFile())throw u.With("EISDIR",e,"preloadFile");r.size=i.length,r.fileData=i}async getData(e,i){if(i.fileData)return i.fileData;let r=await ed(this.baseUrl+(e.startsWith("/")?e.slice(1):e),"buffer");return i.fileData=r,r}getDataSync(e,i){if(i.fileData)return i.fileData;throw new u(61,"",e,"getData")}},tw={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(t){return new Pn(t)},"create")};var Pi=class{constructor(e){this.fs=e;this.locks=new Map}static{s(this,"LockedFS")}addLock(e){let i={...Promise.withResolvers(),[Symbol.dispose]:()=>{this.unlock(e)}};return this.locks.set(e,i),i}async lock(e){return this.locks.has(e)&&await this.locks.get(e).promise,this.addLock(e)}lockSync(e){if(this.locks.has(e))throw u.With("EBUSY",e,"lockSync");return this.addLock(e)}unlock(e,i=!1){if(!this.locks.has(e)){if(i)return!1;throw new u(1,"Can not unlock an already unlocked path",e)}return this.locks.get(e).resolve(),this.locks.delete(e),!0}isLocked(e){return this.locks.has(e)}async ready(){await this.fs.ready()}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.rename(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}renameSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.renameSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async stat(e,i){var n=[];try{let r=x(n,await this.lock(e));return await this.fs.stat(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}statSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.statSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async openFile(e,i,r){var o=[];try{let n=x(o,await this.lock(e));return await this.fs.openFile(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}openFileSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.openFileSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async createFile(e,i,r,n){var a=[];try{let o=x(a,await this.lock(e));return await this.fs.createFile(e,i,r,n)}catch(c){var l=c,f=!0}finally{k(a,l,f)}}createFileSync(e,i,r,n){var a=[];try{let o=x(a,this.lockSync(e));return this.fs.createFileSync(e,i,r,n)}catch(c){var l=c,f=!0}finally{k(a,l,f)}}async unlink(e,i){var n=[];try{let r=x(n,await this.lock(e));await this.fs.unlink(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}unlinkSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.unlinkSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async rmdir(e,i){var n=[];try{let r=x(n,await this.lock(e));await this.fs.rmdir(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}rmdirSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.rmdirSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async mkdir(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.mkdir(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}mkdirSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.mkdirSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async readdir(e,i){var n=[];try{let r=x(n,await this.lock(e));return await this.fs.readdir(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}readdirSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.readdirSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async exists(e,i){var n=[];try{let r=x(n,await this.lock(e));return await this.fs.exists(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}existsSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.existsSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async link(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.link(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}linkSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.linkSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async sync(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.sync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}syncSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.syncSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}},iw={name:"Locked",options:{fs:{type:"object",required:!0,description:"",validator:s(function(t){if(!(t instanceof ie))throw new u(22,"fs passed to LockedFS must be a FileSystem")},"validator")}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function({fs:t}){return new Pi(t)},"create")};var Ws="/.deleted",An=class extends ie{constructor({writable:i,readable:r}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this._writable=i,this._readable=r,this._writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnlockedOverlayFS")}async ready(){await this._readable.ready(),await this._writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:gr.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(i,r,n){let o=n.cred(0,0);await this.createParentDirectories(i,o),await this._writable.exists(i,o)||await this._writable.createFile(i,"w",420,o),await this._writable.sync(i,r,n)}syncSync(i,r,n){let o=n.cred(0,0);this.createParentDirectoriesSync(i,o),this._writable.syncSync(i,r,n)}async _initialize(){if(!this._isInitialized){try{let i=await this._writable.openFile(Ws,D("r"),We),{size:r}=await i.stat(),{buffer:n}=await i.read(new Uint8Array(r));this._deleteLog=ei(n)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i,r){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("",r)}async rename(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{await this._writable.rename(i,r,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{this._writable.renameSync(i,r,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i,r){this.checkInitialized();try{return await this._writable.stat(i,r)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let o=new X(await this._readable.stat(i,r));return o.mode|=146,o}}statSync(i,r){this.checkInitialized();try{return this._writable.statSync(i,r)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let o=new X(this._readable.statSync(i,r));return o.mode|=146,o}}async openFile(i,r,n){if(await this._writable.exists(i,n))return this._writable.openFile(i,r,n);let o=await this._readable.openFile(i,D("r"),n),a=new X(await o.stat()),{buffer:c}=await o.read(new Uint8Array(a.size));return new he(this,i,r,a,c)}openFileSync(i,r,n){if(this._writable.existsSync(i,n))return this._writable.openFileSync(i,r,n);let o=this._readable.openFileSync(i,D("r"),n),a=new X(o.statSync()),c=new Uint8Array(a.size);return o.readSync(c),new he(this,i,r,a,c)}async createFile(i,r,n,o){return this.checkInitialized(),await this._writable.createFile(i,r,n,o),this.openFile(i,r,o)}createFileSync(i,r,n,o){return this.checkInitialized(),this._writable.createFileSync(i,r,n,o),this.openFileSync(i,r,o)}async link(i,r,n){this.checkInitialized(),await this._writable.link(i,r,n)}linkSync(i,r,n){this.checkInitialized(),this._writable.linkSync(i,r,n)}async unlink(i,r){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,r))throw u.With("ENOENT",i,"unlink");await this._writable.exists(i,r)&&await this._writable.unlink(i,r),await this.exists(i,r)&&await this.deletePath(i,r)}unlinkSync(i,r){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,r))throw u.With("ENOENT",i,"unlink");this._writable.existsSync(i,r)&&this._writable.unlinkSync(i,r),this.existsSync(i,r)&&this.deletePath(i,r)}async rmdir(i,r){if(this.checkInitialized(),!await this.exists(i,r))throw u.With("ENOENT",i,"rmdir");if(await this._writable.exists(i,r)&&await this._writable.rmdir(i,r),await this.exists(i,r)){if((await this.readdir(i,r)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i,r)}}rmdirSync(i,r){if(this.checkInitialized(),!this.existsSync(i,r))throw u.With("ENOENT",i,"rmdir");if(this._writable.existsSync(i,r)&&this._writable.rmdirSync(i,r),this.existsSync(i,r)){if(this.readdirSync(i,r).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}async mkdir(i,r,n){if(this.checkInitialized(),await this.exists(i,n))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,n),await this._writable.mkdir(i,r,n)}mkdirSync(i,r,n){if(this.checkInitialized(),this.existsSync(i,n))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,n),this._writable.mkdirSync(i,r,n)}async readdir(i,r){if(this.checkInitialized(),!(await this.stat(i,r)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this._writable.readdir(i,r))}catch{}try{o.push(...(await this._readable.readdir(i,r)).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}readdirSync(i,r){if(this.checkInitialized(),!this.statSync(i,r).isDirectory())throw u.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this._writable.readdirSync(i,r))}catch{}try{o=o.concat(this._readable.readdirSync(i,r).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}async deletePath(i,r){this._deletedFiles.add(i),await this.updateLog(`d${i}
1
+ "use strict";var ZenFS=(()=>{var id=Object.create;var Ai=Object.defineProperty;var rd=Object.getOwnPropertyDescriptor;var nd=Object.getOwnPropertyNames;var od=Object.getPrototypeOf,sd=Object.prototype.hasOwnProperty;var js=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),qs=t=>{throw TypeError(t)};var s=(t,e)=>Ai(t,"name",{value:e,configurable:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wr=(t,e)=>{for(var i in e)Ai(t,i,{get:e[i],enumerable:!0})},$s=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nd(e))!sd.call(t,n)&&n!==i&&Ai(t,n,{get:()=>e[n],enumerable:!(r=rd(e,n))||r.enumerable});return t};var Sr=(t,e,i)=>(i=t!=null?id(od(t)):{},$s(e||!t||!t.__esModule?Ai(i,"default",{value:t,enumerable:!0}):i,t)),ad=t=>$s(Ai({},"__esModule",{value:!0}),t);var x=(t,e,i)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&qs("Object expected");var r;i&&(r=e[js("asyncDispose")]),r===void 0&&(r=e[js("dispose")]),typeof r!="function"&&qs("Object not disposable"),t.push([i,r,e])}else i&&t.push([i]);return e},k=(t,e,i)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},n=a=>e=i?new r(a,e,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=t.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(n(l),o()))}catch(l){n(l)}if(i)throw e};return o()};var Zs=T(Fr=>{"use strict";Fr.byteLength=$d;Fr.toByteArray=Vd;Fr.fromByteArray=Kd;var je=[],Ee=[],qd=typeof Uint8Array<"u"?Uint8Array:Array,Vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tt=0,Js=Vn.length;Tt<Js;++Tt)je[Tt]=Vn[Tt],Ee[Vn.charCodeAt(Tt)]=Tt;var Tt,Js;Ee[45]=62;Ee[95]=63;function Qs(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var r=i===e?0:4-i%4;return[i,r]}s(Qs,"getLens");function $d(t){var e=Qs(t),i=e[0],r=e[1];return(i+r)*3/4-r}s($d,"byteLength");function zd(t,e,i){return(e+i)*3/4-i}s(zd,"_byteLength");function Vd(t){var e,i=Qs(t),r=i[0],n=i[1],o=new qd(zd(t,r,n)),a=0,c=n>0?r-4:r,l;for(l=0;l<c;l+=4)e=Ee[t.charCodeAt(l)]<<18|Ee[t.charCodeAt(l+1)]<<12|Ee[t.charCodeAt(l+2)]<<6|Ee[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=Ee[t.charCodeAt(l)]<<2|Ee[t.charCodeAt(l+1)]>>4,o[a++]=e&255),n===1&&(e=Ee[t.charCodeAt(l)]<<10|Ee[t.charCodeAt(l+1)]<<4|Ee[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Vd,"toByteArray");function Hd(t){return je[t>>18&63]+je[t>>12&63]+je[t>>6&63]+je[t&63]}s(Hd,"tripletToBase64");function Gd(t,e,i){for(var r,n=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(Hd(r));return n.join("")}s(Gd,"encodeChunk");function Kd(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,c=i-r;a<c;a+=o)n.push(Gd(t,a,a+o>c?c:a+o));return r===1?(e=t[i-1],n.push(je[e>>2]+je[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(je[e>>10]+je[e>>4&63]+je[e<<2&63]+"=")),n.join("")}s(Kd,"fromByteArray")});var ea=T(Hn=>{Hn.read=function(t,e,i,r,n){var o,a,c=n*8-r-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?n-1:0,m=i?-1:1,b=t[e+h];for(h+=m,o=b&(1<<-d)-1,b>>=-d,d+=c;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(b?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-f}return(b?-1:1)*a*Math.pow(2,o-r)};Hn.write=function(t,e,i,r,n,o){var a,c,l,f=o*8-n-1,d=(1<<f)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=r?0:o-1,w=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?e+=m/l:e+=m*Math.pow(2,1-h),e*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(e*l-1)*Math.pow(2,n),a=a+h):(c=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+b]=c&255,b+=w,c/=256,n-=8);for(a=a<<n|c,f+=n;f>0;t[i+b]=a&255,b+=w,a/=256,f-=8);t[i+b-w]|=g*128}});var xe=T(si=>{"use strict";var Gn=Zs(),ni=ea(),ta=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;si.Buffer=y;si.SlowBuffer=eh;si.INSPECT_MAX_BYTES=50;var Ir=2147483647;si.kMaxLength=Ir;y.TYPED_ARRAY_SUPPORT=Yd();!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Yd(){try{let t=new Uint8Array(1),e={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Yd,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function ot(t){if(t>Ir)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(ot,"createBuffer");function y(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jn(t)}return oa(t,e,i)}s(y,"Buffer");y.poolSize=8192;function oa(t,e,i){if(typeof t=="string")return Jd(t,e);if(ArrayBuffer.isView(t))return Qd(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(qe(t,ArrayBuffer)||t&&qe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(t,SharedArrayBuffer)||t&&qe(t.buffer,SharedArrayBuffer)))return Yn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return y.from(r,e,i);let n=Zd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(oa,"from");y.from=function(t,e,i){return oa(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function sa(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(sa,"assertSize");function Xd(t,e,i){return sa(t),t<=0?ot(t):e!==void 0?typeof i=="string"?ot(t).fill(e,i):ot(t).fill(e):ot(t)}s(Xd,"alloc");y.alloc=function(t,e,i){return Xd(t,e,i)};function Jn(t){return sa(t),ot(t<0?0:Qn(t)|0)}s(Jn,"allocUnsafe");y.allocUnsafe=function(t){return Jn(t)};y.allocUnsafeSlow=function(t){return Jn(t)};function Jd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=aa(t,e)|0,r=ot(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(Jd,"fromString");function Kn(t){let e=t.length<0?0:Qn(t.length)|0,i=ot(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(Kn,"fromArrayLike");function Qd(t){if(qe(t,Uint8Array)){let e=new Uint8Array(t);return Yn(e.buffer,e.byteOffset,e.byteLength)}return Kn(t)}s(Qd,"fromArrayView");function Yn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,y.prototype),r}s(Yn,"fromArrayBuffer");function Zd(t){if(y.isBuffer(t)){let e=Qn(t.length)|0,i=ot(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||eo(t.length)?ot(0):Kn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Kn(t.data)}s(Zd,"fromObject");function Qn(t){if(t>=Ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ir.toString(16)+" bytes");return t|0}s(Qn,"checked");function eh(t){return+t!=t&&(t=0),y.alloc(+t)}s(eh,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(qe(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),qe(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==i[o]){r=e[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");y.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");y.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=y.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(qe(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function aa(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||qe(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Xn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return ma(t).length;default:if(n)return r?-1:Xn(t).length;e=(""+e).toLowerCase(),n=!0}}s(aa,"byteLength");y.byteLength=aa;function th(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 uh(this,e,i);case"utf8":case"utf-8":return la(this,e,i);case"ascii":return lh(this,e,i);case"latin1":case"binary":return fh(this,e,i);case"base64":return ah(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dh(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(th,"slowToString");y.prototype._isBuffer=!0;function Ct(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(Ct,"swap");y.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)Ct(this,i,i+1);return this},"swap16");y.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)Ct(this,i,i+3),Ct(this,i+1,i+2);return this},"swap32");y.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)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");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?la(this,0,e):th.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=si.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");ta&&(y.prototype[ta]=y.prototype.inspect);y.prototype.compare=s(function(e,i,r,n,o){if(qe(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,c=r-i,l=Math.min(a,c),f=this.slice(n,o),d=e.slice(i,r);for(let h=0;h<l;++h)if(f[h]!==d[h]){a=f[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function ca(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,eo(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,r)),y.isBuffer(e))return e.length===0?-1:ia(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):ia(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(ca,"bidirectionalIndexOf");function ia(t,e,i,r,n){let o=1,a=t.length,c=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(l(t,f)===l(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let h=0;h<c;h++)if(l(t,f+h)!==l(e,h)){d=!1;break}if(d)return f}return-1}s(ia,"arrayIndexOf");y.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");y.prototype.indexOf=s(function(e,i,r){return ca(this,e,i,r,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,r){return ca(this,e,i,r,!1)},"lastIndexOf");function ih(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=e.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let c=parseInt(e.substr(a*2,2),16);if(eo(c))return a;t[i+a]=c}return a}s(ih,"hexWrite");function rh(t,e,i,r){return Pr(Xn(e,t.length-i),t,i,r)}s(rh,"utf8Write");function nh(t,e,i,r){return Pr(mh(e),t,i,r)}s(nh,"asciiWrite");function oh(t,e,i,r){return Pr(ma(e),t,i,r)}s(oh,"base64Write");function sh(t,e,i,r){return Pr(bh(e,t.length-i),t,i,r)}s(sh,"ucs2Write");y.prototype.write=s(function(e,i,r,n){if(i===void 0)n="utf8",r=this.length,i=0;else if(r===void 0&&typeof i=="string")n=i,r=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return ih(this,e,i,r);case"utf8":case"utf-8":return rh(this,e,i,r);case"ascii":case"latin1":case"binary":return nh(this,e,i,r);case"base64":return oh(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sh(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ah(t,e,i){return e===0&&i===t.length?Gn.fromByteArray(t):Gn.fromByteArray(t.slice(e,i))}s(ah,"base64Slice");function la(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=i){let l,f,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=t[n+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=t[n+1],f=t[n+2],(l&192)===128&&(f&192)===128&&(h=(o&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=t[n+1],f=t[n+2],d=t[n+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=c}return ch(r)}s(la,"utf8Slice");var ra=4096;function ch(t){let e=t.length;if(e<=ra)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=ra));return i}s(ch,"decodeCodePointsArray");function lh(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]&127);return r}s(lh,"asciiSlice");function fh(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}s(fh,"latin1Slice");function uh(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=e;o<i;++o)n+=gh[t[o]];return n}s(uh,"hexSlice");function dh(t,e,i){let r=t.slice(e,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(dh,"utf16leSlice");y.prototype.slice=s(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,y.prototype),n},"slice");function ee(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(ee,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||ee(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||ee(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||ee(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");y.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||ee(e,i,this.length);let n=i,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||ee(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||ee(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||ee(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=yt(s(function(e){e=e>>>0,oi(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Hi(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),ni.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||ee(e,4,this.length),ni.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||ee(e,8,this.length),ni.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||ee(e,8,this.length),ni.read(this,e,!1,52,8)},"readDoubleBE");function ue(t,e,i,r,n,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}s(ue,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ue(this,e,i,r,c,0)}let o=1,a=0;for(this[i]=e&255;++a<r&&(o*=256);)this[i+a]=e/o&255;return i+r},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;ue(this,e,i,r,c,0)}let o=r-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+r},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(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 fa(t,e,i,r,n){ya(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(fa,"wrtBigUInt64LE");function ua(t,e,i,r,n){ya(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(ua,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=yt(s(function(e,i=0){return fa(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=yt(s(function(e,i=0){return ua(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ue(this,e,i,r,l-1,-l)}let o=0,a=1,c=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let l=Math.pow(2,8*r-1);ue(this,e,i,r,l-1,-l)}let o=r-1,a=1,c=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(e/a>>0)-c&255;return i+r},"writeIntBE");y.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||ue(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=yt(s(function(e,i=0){return fa(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=yt(s(function(e,i=0){return ua(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function da(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(da,"checkIEEE754");function ha(t,e,i,r,n){return e=+e,i=i>>>0,n||da(t,e,i,4,34028234663852886e22,-34028234663852886e22),ni.write(t,e,i,r,23,4),i+4}s(ha,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,r){return ha(this,e,i,!0,r)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,r){return ha(this,e,i,!1,r)},"writeFloatBE");function pa(t,e,i,r,n){return e=+e,i=i>>>0,n||da(t,e,i,8,17976931348623157e292,-17976931348623157e292),ni.write(t,e,i,r,52,8),i+8}s(pa,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,r){return pa(this,e,i,!0,r)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,r){return pa(this,e,i,!1,r)},"writeDoubleBE");y.prototype.copy=s(function(e,i,r,n){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-i<n-r&&(n=e.length-i+r);let o=n-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),i),o},"copy");y.prototype.fill=s(function(e,i,r,n){if(typeof e=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<r;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,n),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%c]}return this},"fill");var ri={};function Zn(t,e,i){ri[t]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}s(Zn,"E");Zn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Zn("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=na(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=na(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function na(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(na,"addNumericalSeparator");function hh(t,e,i){oi(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Hi(e,t.length-(i+1))}s(hh,"checkBounds");function ya(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",c;throw o>3?e===0||e===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${e}${a} and <= ${i}${a}`,new ri.ERR_OUT_OF_RANGE("value",c,t)}hh(r,n,o)}s(ya,"checkIntBI");function oi(t,e){if(typeof t!="number")throw new ri.ERR_INVALID_ARG_TYPE(e,"number",t)}s(oi,"validateNumber");function Hi(t,e,i){throw Math.floor(t)!==t?(oi(t,i),new ri.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new ri.ERR_BUFFER_OUT_OF_BOUNDS:new ri.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Hi,"boundsError");var ph=/[^+/0-9A-Za-z-_]/g;function yh(t){if(t=t.split("=")[0],t=t.trim().replace(ph,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(yh,"base64clean");function Xn(t,e){e=e||1/0;let i,r=t.length,n=null,o=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(Xn,"utf8ToBytes");function mh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(mh,"asciiToBytes");function bh(t,e){let i,r,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(bh,"utf16leToBytes");function ma(t){return Gn.toByteArray(yh(t))}s(ma,"base64ToBytes");function Pr(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}s(Pr,"blitBuffer");function qe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(qe,"isInstance");function eo(t){return t!==t}s(eo,"numberIsNaN");var gh=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 yt(t){return typeof BigInt>"u"?wh:t}s(yt,"defineBigIntMethod");function wh(){throw new Error("BigInt not supported")}s(wh,"BufferBigIntNotDefined")});var W=T((jS,qa)=>{"use strict";qa.exports={ArrayIsArray:s(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"FunctionPrototypeSymbolHasInstance"),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:s(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:s(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:s(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(t){return t.trim()},"StringPrototypeTrim"),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:s(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var li=T(($S,Br)=>{"use strict";var{AbortController:$a,AbortSignal:_h}=typeof self<"u"?self:typeof window<"u"?window:void 0;Br.exports=$a;Br.exports.AbortSignal=_h;Br.exports.default=$a});var Zi=T((zS,co)=>{"use strict";var fi=typeof Reflect=="object"?Reflect:null,za=fi&&typeof fi.apply=="function"?fi.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Dr;fi&&typeof fi.ownKeys=="function"?Dr=fi.ownKeys:Object.getOwnPropertySymbols?Dr=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Dr=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function Eh(t){console&&console.warn&&console.warn(t)}s(Eh,"ProcessEmitWarning");var Ha=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function N(){N.init.call(this)}s(N,"EventEmitter");co.exports=N;co.exports.once=Fh;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var Va=10;function Mr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Mr,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Va},"get"),set:s(function(t){if(typeof t!="number"||t<0||Ha(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Va=t},"set")});N.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};N.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ha(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 Ga(t){return t._maxListeners===void 0?N.defaultMaxListeners:t._maxListeners}s(Ga,"_getMaxListeners");N.prototype.getMaxListeners=s(function(){return Ga(this)},"getMaxListeners");N.prototype.emit=s(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")za(l,this,i);else for(var f=l.length,d=Qa(l,f),r=0;r<f;++r)za(d[r],this,i);return!0},"emit");function Ka(t,e,i,r){var n,o,a;if(Mr(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=Ga(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,Eh(c)}return t}s(Ka,"_addListener");N.prototype.addListener=s(function(e,i){return Ka(this,e,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=s(function(e,i){return Ka(this,e,i,!0)},"prependListener");function xh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(xh,"onceWrapper");function Ya(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=xh.bind(r);return n.listener=i,r.wrapFn=n,n}s(Ya,"_onceWrap");N.prototype.once=s(function(e,i){return Mr(i),this.on(e,Ya(this,e,i)),this},"once");N.prototype.prependOnceListener=s(function(e,i){return Mr(i),this.prependListener(e,Ya(this,e,i)),this},"prependOnceListener");N.prototype.removeListener=s(function(e,i){var r,n,o,a,c;if(Mr(i),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||i));else if(typeof r!="function"){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){c=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():kh(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=s(function(e){var i,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(e,i[n]);return this},"removeAllListeners");function Xa(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?vh(n):Qa(n,n.length)}s(Xa,"_listeners");N.prototype.listeners=s(function(e){return Xa(this,e,!0)},"listeners");N.prototype.rawListeners=s(function(e){return Xa(this,e,!1)},"rawListeners");N.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ja.call(t,e)};N.prototype.listenerCount=Ja;function Ja(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Ja,"listenerCount");N.prototype.eventNames=s(function(){return this._eventsCount>0?Dr(this._events):[]},"eventNames");function Qa(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(Qa,"arrayClone");function kh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(kh,"spliceOne");function vh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(vh,"unwrapListeners");function Fh(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,o),r(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),Za(t,e,o,{once:!0}),e!=="error"&&Ih(t,n,{once:!0})})}s(Fh,"once");function Ih(t,e,i){typeof t.on=="function"&&Za(t,"error",e,i)}s(Ih,"addErrorHandlerIfEventEmitter");function Za(t,e,i,r){if(typeof t.on=="function")r.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){r.once&&t.removeEventListener(e,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(Za,"eventTargetAgnosticAddListener")});var re=T((HS,fo)=>{"use strict";var Ph=xe(),{kResistStopPropagation:Ah,SymbolDispose:Oh}=W(),Th=globalThis.AbortSignal||li().AbortSignal,Ch=globalThis.AbortController||li().AbortController,Rh=Object.getPrototypeOf(async function(){}).constructor,ec=globalThis.Blob||Ph.Blob,Nh=s(typeof ec<"u"?function(e){return e instanceof ec}:function(e){return!1},"isBlob"),tc=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Lh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),lo=class extends Error{static{s(this,"AggregateError")}constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
2
+ `;super(i),this.name="AggregateError",this.errors=e}};fo.exports={AggregateError:lo,kEmptyObject:Object.freeze({}),once:s(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:s(function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},"createDeferredPromise"),promisify:s(function(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},"format"),inspect:s(function(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(t){return t instanceof Rh},"isAsyncFunction"),isArrayBufferView:s(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:Nh,deprecate:s(function(t,e){return t},"deprecate"),addAbortListener:Zi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);tc(e,"signal"),Lh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Ah]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Oh](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:Th.any||s(function(e){if(e.length===1)return e[0];let i=new Ch,r=s(()=>i.abort(),"abort");return e.forEach(n=>{tc(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};fo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var se=T((KS,nc)=>{"use strict";var{format:Bh,inspect:Ur,AggregateError:Dh}=re(),Mh=globalThis.AggregateError||Dh,Uh=Symbol("kIsNodeError"),Wh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],jh=/^([A-Z][a-z0-9]*)+$/,qh="__node_internal_",Wr={};function Dt(t,e){if(!t)throw new Wr.ERR_INTERNAL_ASSERTION(e)}s(Dt,"assert");function ic(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(ic,"addNumericalSeparator");function $h(t,e,i){if(typeof e=="function")return Dt(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 Dt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Bh(e,...i)}s($h,"getMessage");function te(t,e,i){i||(i=Error);class r extends i{static{s(this,"NodeError")}constructor(...o){super($h(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[Uh]=!0,Wr[t]=r}s(te,"E");function rc(t){let e=qh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(rc,"hideStackFrames");function zh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Mh([e,t],e.message);return i.code=e.code,i}return t||e}s(zh,"aggregateTwoErrors");var uo=class extends Error{static{s(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Wr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Dt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";t.endsWith(" argument")?r+=`${t} `:r+=`"${t}" ${t.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let l of e)Dt(typeof l=="string","All expected entries have to be of type string"),Wh.includes(l)?n.push(l.toLowerCase()):jh.test(l)?o.push(l):(Dt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();r+=`one of type ${n.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();r+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();r+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${i.constructor.name}`;else{let l=Ur(i,{depth:-1});r+=`. Received ${l}`}}else{let l=Ur(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof i} (${l})`}return r},TypeError);te("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=Ur(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);te("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);te("ERR_MISSING_ARGS",(...t)=>{Dt(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);te("ERR_OUT_OF_RANGE",(t,e,i)=>{Dt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=ic(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=ic(r)),r+="n"):r=Ur(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);nc.exports={AbortError:uo,aggregateTwoErrors:rc(zh),hideStackFrames:rc,codes:Wr}});var di=T((XS,pc)=>{"use strict";var{ArrayIsArray:po,ArrayPrototypeIncludes:cc,ArrayPrototypeJoin:lc,ArrayPrototypeMap:Vh,NumberIsInteger:yo,NumberIsNaN:Hh,NumberMAX_SAFE_INTEGER:Gh,NumberMIN_SAFE_INTEGER:Kh,NumberParseInt:Yh,ObjectPrototypeHasOwnProperty:Xh,RegExpPrototypeExec:fc,String:Jh,StringPrototypeToUpperCase:Qh,StringPrototypeTrim:Zh}=W(),{hideStackFrames:ve,codes:{ERR_SOCKET_BAD_PORT:ep,ERR_INVALID_ARG_TYPE:ne,ERR_INVALID_ARG_VALUE:ui,ERR_OUT_OF_RANGE:Mt,ERR_UNKNOWN_SIGNAL:oc}}=se(),{normalizeEncoding:tp}=re(),{isAsyncFunction:ip,isArrayBufferView:rp}=re().types,sc={};function np(t){return t===(t|0)}s(np,"isInt32");function op(t){return t===t>>>0}s(op,"isUint32");var sp=/^[0-7]+$/,ap="must be a 32-bit unsigned integer or an octal string";function cp(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(fc(sp,t)===null)throw new ui(e,t,ap);t=Yh(t,8)}return uc(t,e),t}s(cp,"parseFileMode");var lp=ve((t,e,i=Kh,r=Gh)=>{if(typeof t!="number")throw new ne(e,"number",t);if(!yo(t))throw new Mt(e,"an integer",t);if(t<i||t>r)throw new Mt(e,`>= ${i} && <= ${r}`,t)}),fp=ve((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new ne(e,"number",t);if(!yo(t))throw new Mt(e,"an integer",t);if(t<i||t>r)throw new Mt(e,`>= ${i} && <= ${r}`,t)}),uc=ve((t,e,i=!1)=>{if(typeof t!="number")throw new ne(e,"number",t);if(!yo(t))throw new Mt(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new Mt(e,`>= ${r} && <= ${n}`,t)});function mo(t,e){if(typeof t!="string")throw new ne(e,"string",t)}s(mo,"validateString");function up(t,e,i=void 0,r){if(typeof t!="number")throw new ne(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Hh(t))throw new Mt(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(up,"validateNumber");var dp=ve((t,e,i)=>{if(!cc(i,t)){let n="must be one of: "+lc(Vh(i,o=>typeof o=="string"?`'${o}'`:Jh(o)),", ");throw new ui(e,t,n)}});function dc(t,e){if(typeof t!="boolean")throw new ne(e,"boolean",t)}s(dc,"validateBoolean");function ho(t,e,i){return t==null||!Xh(t,e)?i:t[e]}s(ho,"getOwnPropertyValueOrDefault");var hp=ve((t,e,i=null)=>{let r=ho(i,"allowArray",!1),n=ho(i,"allowFunction",!1);if(!ho(i,"nullable",!1)&&t===null||!r&&po(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new ne(e,"Object",t)}),pp=ve((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ne(e,"a dictionary",t)}),jr=ve((t,e,i=0)=>{if(!po(t))throw new ne(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ui(e,t,r)}});function yp(t,e){jr(t,e);for(let i=0;i<t.length;i++)mo(t[i],`${e}[${i}]`)}s(yp,"validateStringArray");function mp(t,e){jr(t,e);for(let i=0;i<t.length;i++)dc(t[i],`${e}[${i}]`)}s(mp,"validateBooleanArray");function bp(t,e){jr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new ne(n,"AbortSignal",r);hc(r,n)}}s(bp,"validateAbortSignalArray");function gp(t,e="signal"){if(mo(t,e),sc[t]===void 0)throw sc[Qh(t)]!==void 0?new oc(t+" (signals must use all capital letters)"):new oc(t)}s(gp,"validateSignalName");var wp=ve((t,e="buffer")=>{if(!rp(t))throw new ne(e,["Buffer","TypedArray","DataView"],t)});function Sp(t,e){let i=tp(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ui("encoding",e,`is invalid for data of length ${r}`)}s(Sp,"validateEncoding");function _p(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Zh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new ep(e,t,i);return t|0}s(_p,"validatePort");var hc=ve((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ne(e,"AbortSignal",t)}),Ep=ve((t,e)=>{if(typeof t!="function")throw new ne(e,"Function",t)}),xp=ve((t,e)=>{if(typeof t!="function"||ip(t))throw new ne(e,"Function",t)}),kp=ve((t,e)=>{if(t!==void 0)throw new ne(e,"undefined",t)});function vp(t,e,i){if(!cc(i,t))throw new ne(e,`('${lc(i,"|")}')`,t)}s(vp,"validateUnion");var Fp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ac(t,e){if(typeof t>"u"||!fc(Fp,t))throw new ui(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ac,"validateLinkHeaderFormat");function Ip(t){if(typeof t=="string")return ac(t,"hints"),t;if(po(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];ac(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ui("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Ip,"validateLinkHeaderValue");pc.exports={isInt32:np,isUint32:op,parseFileMode:cp,validateArray:jr,validateStringArray:yp,validateBooleanArray:mp,validateAbortSignalArray:bp,validateBoolean:dc,validateBuffer:wp,validateDictionary:pp,validateEncoding:Sp,validateFunction:Ep,validateInt32:fp,validateInteger:lp,validateNumber:up,validateObject:hp,validateOneOf:dp,validatePlainFunction:xp,validatePort:_p,validateSignalName:gp,validateString:mo,validateUint32:uc,validateUndefined:kp,validateUnion:vp,validateAbortSignal:hc,validateLinkHeaderValue:Ip}});var St=T((QS,gc)=>{var V=gc.exports={},Ve,He;function bo(){throw new Error("setTimeout has not been defined")}s(bo,"defaultSetTimout");function go(){throw new Error("clearTimeout has not been defined")}s(go,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ve=setTimeout:Ve=bo}catch{Ve=bo}try{typeof clearTimeout=="function"?He=clearTimeout:He=go}catch{He=go}})();function yc(t){if(Ve===setTimeout)return setTimeout(t,0);if((Ve===bo||!Ve)&&setTimeout)return Ve=setTimeout,setTimeout(t,0);try{return Ve(t,0)}catch{try{return Ve.call(null,t,0)}catch{return Ve.call(this,t,0)}}}s(yc,"runTimeout");function Pp(t){if(He===clearTimeout)return clearTimeout(t);if((He===go||!He)&&clearTimeout)return He=clearTimeout,clearTimeout(t);try{return He(t)}catch{try{return He.call(null,t)}catch{return He.call(this,t)}}}s(Pp,"runClearTimeout");var st=[],hi=!1,Ut,qr=-1;function Ap(){!hi||!Ut||(hi=!1,Ut.length?st=Ut.concat(st):qr=-1,st.length&&mc())}s(Ap,"cleanUpNextTick");function mc(){if(!hi){var t=yc(Ap);hi=!0;for(var e=st.length;e;){for(Ut=st,st=[];++qr<e;)Ut&&Ut[qr].run();qr=-1,e=st.length}Ut=null,hi=!1,Pp(t)}}s(mc,"drainQueue");V.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];st.push(new bc(t,e)),st.length===1&&!hi&&yc(mc)};function bc(t,e){this.fun=t,this.array=e}s(bc,"Item");bc.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function at(){}s(at,"noop");V.on=at;V.addListener=at;V.once=at;V.off=at;V.removeListener=at;V.removeAllListeners=at;V.emit=at;V.prependListener=at;V.prependOnceListener=at;V.listeners=function(t){return[]};V.binding=function(t){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(t){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var Ke=T((e_,Rc)=>{"use strict";var{SymbolAsyncIterator:wc,SymbolIterator:Sc,SymbolFor:Wt}=W(),_c=Wt("nodejs.stream.destroyed"),Ec=Wt("nodejs.stream.errored"),wo=Wt("nodejs.stream.readable"),So=Wt("nodejs.stream.writable"),xc=Wt("nodejs.stream.disturbed"),Op=Wt("nodejs.webstream.isClosedPromise"),Tp=Wt("nodejs.webstream.controllerErrorFunction");function $r(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s($r,"isReadableNodeStream");function zr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(zr,"isWritableNodeStream");function Cp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Cp,"isDuplexNodeStream");function Ge(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(Ge,"isNodeStream");function kc(t){return!!(t&&!Ge(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(kc,"isReadableStream");function vc(t){return!!(t&&!Ge(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(vc,"isWritableStream");function Fc(t){return!!(t&&!Ge(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Fc,"isTransformStream");function Rp(t){return kc(t)||vc(t)||Fc(t)}s(Rp,"isWebStream");function Np(t,e){return t==null?!1:e===!0?typeof t[wc]=="function":e===!1?typeof t[Sc]=="function":typeof t[wc]=="function"||typeof t[Sc]=="function"}s(Np,"isIterable");function Vr(t){if(!Ge(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[_c]||r!=null&&r.destroyed)}s(Vr,"isDestroyed");function Ic(t){if(!zr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ic,"isWritableEnded");function Lp(t,e){if(!zr(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(Lp,"isWritableFinished");function Bp(t){if(!$r(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Bp,"isReadableEnded");function Pc(t,e){if(!$r(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Pc,"isReadableFinished");function Ac(t){return t&&t[wo]!=null?t[wo]:typeof t?.readable!="boolean"?null:Vr(t)?!1:$r(t)&&t.readable&&!Pc(t)}s(Ac,"isReadable");function Oc(t){return t&&t[So]!=null?t[So]:typeof t?.writable!="boolean"?null:Vr(t)?!1:zr(t)&&t.writable&&!Ic(t)}s(Oc,"isWritable");function Dp(t,e){return Ge(t)?Vr(t)?!0:!(e?.readable!==!1&&Ac(t)||e?.writable!==!1&&Oc(t)):null}s(Dp,"isFinished");function Mp(t){var e,i;return Ge(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Mp,"isWritableErrored");function Up(t){var e,i;return Ge(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Up,"isReadableErrored");function Wp(t){if(!Ge(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"&&Tc(t)?t._closed:null}s(Wp,"isClosed");function Tc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Tc,"isOutgoingMessage");function Cc(t){return typeof t._sent100=="boolean"&&Tc(t)}s(Cc,"isServerResponse");function jp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(jp,"isServerRequest");function qp(t){if(!Ge(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Cc(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(qp,"willEmitClose");function $p(t){var e;return!!(t&&((e=t[xc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s($p,"isDisturbed");function zp(t){var e,i,r,n,o,a,c,l,f,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[Ec])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(c=t._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(zp,"isErrored");Rc.exports={isDestroyed:Vr,kIsDestroyed:_c,isDisturbed:$p,kIsDisturbed:xc,isErrored:zp,kIsErrored:Ec,isReadable:Ac,kIsReadable:wo,kIsClosedPromise:Op,kControllerErrorFunction:Tp,kIsWritable:So,isClosed:Wp,isDuplexNodeStream:Cp,isFinished:Dp,isIterable:Np,isReadableNodeStream:$r,isReadableStream:kc,isReadableEnded:Bp,isReadableFinished:Pc,isReadableErrored:Up,isNodeStream:Ge,isWebStream:Rp,isWritable:Oc,isWritableNodeStream:zr,isWritableStream:vc,isWritableEnded:Ic,isWritableFinished:Lp,isWritableErrored:Mp,isServerRequest:jp,isServerResponse:Cc,willEmitClose:qp,isTransformStream:Fc}});var ct=T((i_,vo)=>{var _t=St(),{AbortError:qc,codes:Vp}=se(),{ERR_INVALID_ARG_TYPE:Hp,ERR_STREAM_PREMATURE_CLOSE:Nc}=Vp,{kEmptyObject:Eo,once:xo}=re(),{validateAbortSignal:Gp,validateFunction:Kp,validateObject:Yp,validateBoolean:Xp}=di(),{Promise:Jp,PromisePrototypeThen:Qp,SymbolDispose:$c}=W(),{isClosed:Zp,isReadable:Lc,isReadableNodeStream:_o,isReadableStream:ey,isReadableFinished:Bc,isReadableErrored:Dc,isWritable:Mc,isWritableNodeStream:Uc,isWritableStream:ty,isWritableFinished:Wc,isWritableErrored:jc,isNodeStream:iy,willEmitClose:ry,kIsClosedPromise:ny}=Ke(),pi;function oy(t){return t.setHeader&&typeof t.abort=="function"}s(oy,"isRequest");var ko=s(()=>{},"nop");function zc(t,e,i){var r,n;if(arguments.length===2?(i=e,e=Eo):e==null?e=Eo:Yp(e,"options"),Kp(i,"callback"),Gp(e.signal,"options.signal"),i=xo(i),ey(t)||ty(t))return sy(t,e,i);if(!iy(t))throw new Hp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(r=e.readable)!==null&&r!==void 0?r:_o(t),a=(n=e.writable)!==null&&n!==void 0?n:Uc(t),c=t._writableState,l=t._readableState,f=s(()=>{t.writable||m()},"onlegacyfinish"),d=ry(t)&&_o(t)===o&&Uc(t)===a,h=Wc(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||b)&&i.call(t)},"onfinish"),b=Bc(t,!1),w=s(()=>{b=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=s(G=>{i.call(t,G)},"onerror"),A=Zp(t),E=s(()=>{A=!0;let G=jc(t)||Dc(t);if(G&&typeof G!="boolean")return i.call(t,G);if(o&&!b&&_o(t,!0)&&!Bc(t,!1))return i.call(t,new Nc);if(a&&!h&&!Wc(t,!1))return i.call(t,new Nc);i.call(t)},"onclose"),C=s(()=>{A=!0;let G=jc(t)||Dc(t);if(G&&typeof G!="boolean")return i.call(t,G);i.call(t)},"onclosed"),q=s(()=>{t.req.on("finish",m)},"onrequest");oy(t)?(t.on("complete",m),d||t.on("abort",E),t.req?q():t.on("request",q)):a&&!c&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",E),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",g),t.on("close",E),A?_t.nextTick(E):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||_t.nextTick(C):(!o&&(!d||Lc(t))&&(h||Mc(t)===!1)||!a&&(!d||Mc(t))&&(b||Lc(t)===!1)||l&&t.req&&t.aborted)&&_t.nextTick(C);let O=s(()=>{i=ko,t.removeListener("aborted",E),t.removeListener("complete",m),t.removeListener("abort",E),t.removeListener("request",q),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",E)},"cleanup");if(e.signal&&!A){let G=s(()=>{let Ft=i;O(),Ft.call(t,new qc(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)_t.nextTick(G);else{pi=pi||re().addAbortListener;let Ft=pi(e.signal,G),me=i;i=xo((...Xt)=>{Ft[$c](),me.apply(t,Xt)})}}return O}s(zc,"eos");function sy(t,e,i){let r=!1,n=ko;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new qc(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)_t.nextTick(n);else{pi=pi||re().addAbortListener;let a=pi(e.signal,n),c=i;i=xo((...l)=>{a[$c](),c.apply(t,l)})}let o=s((...a)=>{r||_t.nextTick(()=>i.apply(t,a))},"resolverFn");return Qp(t[ny].promise,o,o),ko}s(sy,"eosWeb");function ay(t,e){var i;let r=!1;return e===null&&(e=Eo),(i=e)!==null&&i!==void 0&&i.cleanup&&(Xp(e.cleanup,"cleanup"),r=e.cleanup),new Jp((n,o)=>{let a=zc(t,e,c=>{r&&a(),c?o(c):n()})})}s(ay,"finished");vo.exports=zc;vo.exports.finished=ay});var jt=T((n_,Qc)=>{"use strict";var Ye=St(),{aggregateTwoErrors:cy,codes:{ERR_MULTIPLE_CALLBACK:ly},AbortError:fy}=se(),{Symbol:Gc}=W(),{kIsDestroyed:uy,isDestroyed:dy,isFinished:hy,isServerRequest:py}=Ke(),Kc=Gc("kDestroy"),Fo=Gc("kConstruct");function Yc(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Yc,"checkError");function yy(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):(Yc(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Vc(this,t,e):this.once(Kc,function(o){Vc(this,cy(o,t),e)}),this)}s(yy,"destroy");function Vc(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,c=t._writableState;Yc(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ye.nextTick(my,t,o):Ye.nextTick(Xc,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Vc,"_destroy");function my(t,e){Io(t,e),Xc(t)}s(my,"emitErrorCloseNT");function Xc(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Xc,"emitCloseNT");function Io(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(Io,"emitErrorNT");function by(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(by,"undestroy");function Po(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?Ye.nextTick(Io,t,e):Io(t,e))}s(Po,"errorOrDestroy");function gy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,r=t._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),t.once(Fo,e),!(t.listenerCount(Fo)>1)&&Ye.nextTick(wy,t)}s(gy,"construct");function wy(t){let e=!1;function i(r){if(e){Po(t,r??new ly);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Kc,r):r?Po(t,r,!0):Ye.nextTick(Sy,t)}s(i,"onConstruct");try{t._construct(r=>{Ye.nextTick(i,r)})}catch(r){Ye.nextTick(i,r)}}s(wy,"constructNT");function Sy(t){t.emit(Fo)}s(Sy,"emitConstructNT");function Hc(t){return t?.setHeader&&typeof t.abort=="function"}s(Hc,"isRequest");function Jc(t){t.emit("close")}s(Jc,"emitCloseLegacy");function _y(t,e){t.emit("error",e),Ye.nextTick(Jc,t)}s(_y,"emitErrorCloseLegacy");function Ey(t,e){!t||dy(t)||(!e&&!hy(t)&&(e=new fy),py(t)?(t.socket=null,t.destroy(e)):Hc(t)?t.abort():Hc(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ye.nextTick(_y,t,e):Ye.nextTick(Jc,t),t.destroyed||(t[uy]=!0))}s(Ey,"destroyer");Qc.exports={construct:gy,destroyer:Ey,destroy:yy,undestroy:by,errorOrDestroy:Po}});var Kr=T((s_,el)=>{"use strict";var{ArrayIsArray:xy,ObjectSetPrototypeOf:Zc}=W(),{EventEmitter:Hr}=Zi();function Gr(t){Hr.call(this,t)}s(Gr,"Stream");Zc(Gr.prototype,Hr.prototype);Zc(Gr,Hr);Gr.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function c(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(c,"onclose");function l(d){f(),Hr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ao(i,"error",l),Ao(t,"error",l);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),t.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function Ao(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):xy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Ao,"prependListener");el.exports={Stream:Gr,prependListener:Ao}});var er=T((c_,Yr)=>{"use strict";var{SymbolDispose:ky}=W(),{AbortError:tl,codes:vy}=se(),{isNodeStream:il,isWebStream:Fy,kControllerErrorFunction:Iy}=Ke(),Py=ct(),{ERR_INVALID_ARG_TYPE:rl}=vy,Oo,Ay=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new rl(e,"AbortSignal",t)},"validateAbortSignal");Yr.exports.addAbortSignal=s(function(e,i){if(Ay(e,"signal"),!il(i)&&!Fy(i))throw new rl("stream",["ReadableStream","WritableStream","Stream"],i);return Yr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Yr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=il(e)?()=>{e.destroy(new tl(void 0,{cause:t.reason}))}:()=>{e[Iy](new tl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Oo=Oo||re().addAbortListener;let r=Oo(t,i);Py(e,r[ky])}return e}});var sl=T((u_,ol)=>{"use strict";var{StringPrototypeSlice:nl,SymbolIterator:Oy,TypedArrayPrototypeSet:Xr,Uint8Array:Ty}=W(),{Buffer:To}=xe(),{inspect:Cy}=re();ol.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return To.alloc(0);let i=To.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Xr(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}*[Oy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let o=r.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=nl(o,0,e),this.head=r,r.data=nl(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=To.allocUnsafe(e),r=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Xr(i,a,r-e),e-=a.length;else{e===a.length?(Xr(i,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Xr(i,new Ty(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return Cy(this,{...i,depth:0,customInspect:!1})}}});var tr=T((h_,fl)=>{"use strict";var{MathFloor:Ry,NumberIsInteger:Ny}=W(),{validateInteger:Ly}=di(),{ERR_INVALID_ARG_VALUE:By}=se().codes,al=16*1024,cl=16;function Dy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Dy,"highWaterMarkFrom");function ll(t){return t?cl:al}s(ll,"getDefaultHighWaterMark");function My(t,e){Ly(e,"value",0),t?cl=e:al=e}s(My,"setDefaultHighWaterMark");function Uy(t,e,i,r){let n=Dy(e,r,i);if(n!=null){if(!Ny(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new By(o,n)}return Ry(n)}return ll(t.objectMode)}s(Uy,"getHighWaterMark");fl.exports={getHighWaterMark:Uy,getDefaultHighWaterMark:ll,setDefaultHighWaterMark:My}});var hl=T((Co,dl)=>{var Jr=xe(),Xe=Jr.Buffer;function ul(t,e){for(var i in t)e[i]=t[i]}s(ul,"copyProps");Xe.from&&Xe.alloc&&Xe.allocUnsafe&&Xe.allocUnsafeSlow?dl.exports=Jr:(ul(Jr,Co),Co.Buffer=qt);function qt(t,e,i){return Xe(t,e,i)}s(qt,"SafeBuffer");qt.prototype=Object.create(Xe.prototype);ul(Xe,qt);qt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Xe(t,e,i)};qt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Xe(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};qt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Xe(t)};qt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Jr.SlowBuffer(t)}});var ml=T(yl=>{"use strict";var No=hl().Buffer,pl=No.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Wy(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Wy,"_normalizeEncoding");function jy(t){var e=Wy(t);if(typeof e!="string"&&(No.isEncoding===pl||!pl(t)))throw new Error("Unknown encoding: "+t);return e||t}s(jy,"normalizeEncoding");yl.StringDecoder=ir;function ir(t){this.encoding=jy(t);var e;switch(this.encoding){case"utf16le":this.text=Gy,this.end=Ky,e=4;break;case"utf8":this.fillLast=zy,e=4;break;case"base64":this.text=Yy,this.end=Xy,e=3;break;default:this.write=Jy,this.end=Qy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=No.allocUnsafe(e)}s(ir,"StringDecoder");ir.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||""};ir.prototype.end=Hy;ir.prototype.text=Vy;ir.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ro(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Ro,"utf8CheckByte");function qy(t,e,i){var r=e.length-1;if(r<i)return 0;var n=Ro(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=Ro(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=Ro(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(qy,"utf8CheckIncomplete");function $y(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s($y,"utf8CheckExtraBytes");function zy(t){var e=this.lastTotal-this.lastNeed,i=$y(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(zy,"utf8FillLast");function Vy(t,e){var i=qy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}s(Vy,"utf8Text");function Hy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Hy,"utf8End");function Gy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Gy,"utf16Text");function Ky(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Ky,"utf16End");function Yy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Yy,"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}s(Xy,"base64End");function Jy(t){return t.toString(this.encoding)}s(Jy,"simpleWrite");function Qy(t){return t&&t.length?this.write(t):""}s(Qy,"simpleEnd")});var Lo=T((g_,Sl)=>{"use strict";var bl=St(),{PromisePrototypeThen:Zy,SymbolAsyncIterator:gl,SymbolIterator:wl}=W(),{Buffer:em}=xe(),{ERR_INVALID_ARG_TYPE:tm,ERR_STREAM_NULL_VALUES:im}=se().codes;function rm(t,e,i){let r;if(typeof e=="string"||e instanceof em)return new t({objectMode:!0,...i,read:s(function(){this.push(e),this.push(null)},"read")});let n;if(e&&e[gl])n=!0,r=e[gl]();else if(e&&e[wl])n=!1,r=e[wl]();else throw new tm("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,d){Zy(c(f),()=>bl.nextTick(d,f),h=>bl.nextTick(d,h||f))};async function c(f){let d=f!=null,h=typeof r.throw=="function";if(d&&h){let{value:m,done:b}=await r.throw(f);if(await m,b)return}if(typeof r.return=="function"){let{value:m}=await r.return();await m}}s(c,"close");async function l(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new im;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(rm,"from");Sl.exports=rm});var nr=T((S_,Ml)=>{var Ae=St(),{ArrayPrototypeIndexOf:nm,NumberIsInteger:om,NumberIsNaN:sm,NumberParseInt:am,ObjectDefineProperties:$o,ObjectKeys:cm,ObjectSetPrototypeOf:xl,Promise:kl,SafeSet:lm,SymbolAsyncDispose:fm,SymbolAsyncIterator:um,Symbol:dm}=W();Ml.exports=F;F.ReadableState=tn;var{EventEmitter:hm}=Zi(),{Stream:Et,prependListener:pm}=Kr(),{Buffer:Bo}=xe(),{addAbortSignal:ym}=er(),vl=ct(),P=re().debuglog("stream",t=>{P=t}),mm=sl(),bi=jt(),{getHighWaterMark:bm,getDefaultHighWaterMark:gm}=tr(),{aggregateTwoErrors:_l,codes:{ERR_INVALID_ARG_TYPE:wm,ERR_METHOD_NOT_IMPLEMENTED:Sm,ERR_OUT_OF_RANGE:_m,ERR_STREAM_PUSH_AFTER_EOF:Em,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:xm},AbortError:km}=se(),{validateObject:vm}=di(),$t=dm("kPaused"),{StringDecoder:Fl}=ml(),Fm=Lo();xl(F.prototype,Et.prototype);xl(F,Et);var Do=s(()=>{},"nop"),{errorOrDestroy:yi}=bi,mi=1,Im=2,Il=4,rr=8,Pl=16,Qr=32,Zr=64,Al=128,Pm=256,Am=512,Om=1024,jo=2048,qo=4096,Tm=8192,Cm=16384,Rm=32768,Ol=65536,Nm=1<<17,Lm=1<<18;function J(t){return{enumerable:!1,get:s(function(){return(this.state&t)!==0},"get"),set:s(function(e){e?this.state|=t:this.state&=~t},"set")}}s(J,"makeBitMapDescriptor");$o(tn.prototype,{objectMode:J(mi),ended:J(Im),endEmitted:J(Il),reading:J(rr),constructed:J(Pl),sync:J(Qr),needReadable:J(Zr),emittedReadable:J(Al),readableListening:J(Pm),resumeScheduled:J(Am),errorEmitted:J(Om),emitClose:J(jo),autoDestroy:J(qo),destroyed:J(Tm),closed:J(Cm),closeEmitted:J(Rm),multiAwaitDrain:J(Ol),readingMore:J(Nm),dataEmitted:J(Lm)});function tn(t,e,i){typeof i!="boolean"&&(i=e instanceof Je()),this.state=jo|qo|Pl|Qr,t&&t.objectMode&&(this.state|=mi),i&&t&&t.readableObjectMode&&(this.state|=mi),this.highWaterMark=t?bm(this,t,"readableHighWaterMark",i):gm(!1),this.buffer=new mm,this.length=0,this.pipes=[],this.flowing=null,this[$t]=null,t&&t.emitClose===!1&&(this.state&=~jo),t&&t.autoDestroy===!1&&(this.state&=~qo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Fl(t.encoding),this.encoding=t.encoding)}s(tn,"ReadableState");function F(t){if(!(this instanceof F))return new F(t);let e=this instanceof Je();this._readableState=new tn(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&&ym(t.signal,this)),Et.call(this,t),bi.construct(this,()=>{this._readableState.needReadable&&en(this,this._readableState)})}s(F,"Readable");F.prototype.destroy=bi.destroy;F.prototype._undestroy=bi.undestroy;F.prototype._destroy=function(t,e){e(t)};F.prototype[hm.captureRejectionSymbol]=function(t){this.destroy(t)};F.prototype[fm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new km,this.destroy(t)),new kl((e,i)=>vl(this,r=>r&&r!==t?i(r):e(null)))};F.prototype.push=function(t,e){return Tl(this,t,e,!1)};F.prototype.unshift=function(t,e){return Tl(this,t,e,!0)};function Tl(t,e,i,r){P("readableAddChunk",e);let n=t._readableState,o;if(n.state&mi||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=Bo.from(e,i).toString(n.encoding):(e=Bo.from(e,i),i=""))):e instanceof Bo?i="":Et._isUint8Array(e)?(e=Et._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new wm("chunk",["string","Buffer","Uint8Array"],e))),o)yi(t,o);else if(e===null)n.state&=~rr,Mm(t,n);else if(n.state&mi||e&&e.length>0)if(r)if(n.state&Il)yi(t,new xm);else{if(n.destroyed||n.errored)return!1;Mo(t,n,e,!0)}else if(n.ended)yi(t,new Em);else{if(n.destroyed||n.errored)return!1;n.state&=~rr,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Mo(t,n,e,!1):en(t,n)):Mo(t,n,e,!1)}else r||(n.state&=~rr,en(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Tl,"readableAddChunk");function Mo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Ol?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.state&Zr&&rn(t)),en(t,e)}s(Mo,"addChunk");F.prototype.isPaused=function(){let t=this._readableState;return t[$t]===!0||t.flowing===!1};F.prototype.setEncoding=function(t){let e=new Fl(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 Bm=1073741824;function Dm(t){if(t>Bm)throw new _m("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Dm,"computeNewHighWaterMark");function El(t,e){return t<=0||e.length===0&&e.ended?0:e.state&mi?1:sm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(El,"howMuchToRead");F.prototype.read=function(t){P("read",t),t===void 0?t=NaN:om(t)||(t=am(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Dm(t)),t!==0&&(e.state&=~Al),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return P("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Uo(this):rn(this),null;if(t=El(t,e),t===0&&e.ended)return e.length===0&&Uo(this),null;let r=(e.state&Zr)!==0;if(P("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,P("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,P("reading, ended or constructing",r);else if(r){P("do read"),e.state|=rr|Qr,e.length===0&&(e.state|=Zr);try{this._read(e.highWaterMark)}catch(o){yi(this,o)}e.state&=~Qr,e.reading||(t=El(i,e))}let n;return t>0?n=Bl(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Uo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Mm(t,e){if(P("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?rn(t):(e.needReadable=!1,e.emittedReadable=!0,Cl(t))}}s(Mm,"onEofChunk");function rn(t){let e=t._readableState;P("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(P("emitReadable",e.flowing),e.emittedReadable=!0,Ae.nextTick(Cl,t))}s(rn,"emitReadable");function Cl(t){let e=t._readableState;P("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,Nl(t)}s(Cl,"emitReadable_");function en(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ae.nextTick(Um,t,e))}s(en,"maybeReadMore");function Um(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(P("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Um,"maybeReadMore_");F.prototype._read=function(t){throw new Sm("_read()")};F.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new lm(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),P("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ae.stdout&&t!==Ae.stderr?c:A;r.endEmitted?Ae.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(E,C){P("onunpipe"),E===i&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){P("onend"),t.end()}s(c,"onend");let l,f=!1;function d(){P("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",b),t.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",A),i.removeListener("data",m),f=!0,l&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}s(d,"cleanup");function h(){f||(r.pipes.length===1&&r.pipes[0]===t?(P("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(P("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),l||(l=Wm(i,t),t.on("drain",l))}s(h,"pause"),i.on("data",m);function m(E){P("ondata");let C=t.write(E);P("dest.write",C),C===!1&&h()}s(m,"ondata");function b(E){if(P("onerror",E),A(),t.removeListener("error",b),t.listenerCount("error")===0){let C=t._writableState||t._readableState;C&&!C.errorEmitted?yi(t,E):t.emit("error",E)}}s(b,"onerror"),pm(t,"error",b);function w(){t.removeListener("finish",g),A()}s(w,"onclose"),t.once("close",w);function g(){P("onfinish"),t.removeListener("close",w),A()}s(g,"onfinish"),t.once("finish",g);function A(){P("unpipe"),i.unpipe(t)}return s(A,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(P("pipe resume"),i.resume()),t};function Wm(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(P("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(P("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Wm,"pipeOnDrain");F.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=nm(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};F.prototype.on=function(t,e){let i=Et.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,P("on readable",r.length,r.reading),r.length?rn(this):r.reading||Ae.nextTick(jm,this)),i};F.prototype.addListener=F.prototype.on;F.prototype.removeListener=function(t,e){let i=Et.prototype.removeListener.call(this,t,e);return t==="readable"&&Ae.nextTick(Rl,this),i};F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners=function(t){let e=Et.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ae.nextTick(Rl,this),e};function Rl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[$t]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Rl,"updateReadableListening");function jm(t){P("readable nexttick read 0"),t.read(0)}s(jm,"nReadingNextTick");F.prototype.resume=function(){let t=this._readableState;return t.flowing||(P("resume"),t.flowing=!t.readableListening,qm(this,t)),t[$t]=!1,this};function qm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ae.nextTick($m,t,e))}s(qm,"resume");function $m(t,e){P("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Nl(t),e.flowing&&!e.reading&&t.read(0)}s($m,"resume_");F.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[$t]=!0,this};function Nl(t){let e=t._readableState;for(P("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Nl,"flow");F.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=>{yi(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=cm(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};F.prototype[um]=function(){return Ll(this)};F.prototype.iterator=function(t){return t!==void 0&&vm(t,"options"),Ll(this,t)};function Ll(t,e){typeof t.read!="function"&&(t=F.wrap(t,{objectMode:!0}));let i=zm(t,e);return i.stream=t,i}s(Ll,"streamToAsyncIterator");async function*zm(t,e){let i=Do;function r(a){this===t?(i(),i=Do):i=a}s(r,"next"),t.on("readable",r);let n,o=vl(t,{writable:!1},a=>{n=a?_l(n,a):null,i(),i=Do});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new kl(r)}}}catch(a){throw n=_l(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?bi.destroyer(t,null):(t.off("readable",r),o())}}s(zm,"createAsyncIterator");$o(F.prototype,{readable:{__proto__:null,get:s(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:s(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});$o(tn.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[$t]!==!1},"get"),set:s(function(t){this[$t]=!!t},"set")}});F._fromList=Bl;function Bl(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(Bl,"fromList");function Uo(t){let e=t._readableState;P("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ae.nextTick(Vm,e,t))}s(Uo,"endReadable");function Vm(t,e){if(P("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)Ae.nextTick(Hm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Vm,"endReadableNT");function Hm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Hm,"endWritableNT");F.from=function(t,e){return Fm(F,t,e)};var Wo;function Dl(){return Wo===void 0&&(Wo={}),Wo}s(Dl,"lazyWebStreams");F.fromWeb=function(t,e){return Dl().newStreamReadableFromReadableStream(t,e)};F.toWeb=function(t,e){return Dl().newReadableStreamFromStreamReadable(t,e)};F.wrap=function(t,e){var i,r;return new F({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:s(function(n,o){bi.destroyer(t,n),o(n)},"destroy")}).wrap(t)}});var cn=T((E_,Xl)=>{var zt=St(),{ArrayPrototypeSlice:jl,Error:Gm,FunctionPrototypeSymbolHasInstance:ql,ObjectDefineProperty:$l,ObjectDefineProperties:Km,ObjectSetPrototypeOf:zl,StringPrototypeToLowerCase:Ym,Symbol:Xm,SymbolHasInstance:Jm}=W();Xl.exports=j;j.WritableState=ar;var{EventEmitter:Qm}=Zi(),or=Kr().Stream,{Buffer:nn}=xe(),an=jt(),{addAbortSignal:Zm}=er(),{getHighWaterMark:eb,getDefaultHighWaterMark:tb}=tr(),{ERR_INVALID_ARG_TYPE:ib,ERR_METHOD_NOT_IMPLEMENTED:rb,ERR_MULTIPLE_CALLBACK:Vl,ERR_STREAM_CANNOT_PIPE:nb,ERR_STREAM_DESTROYED:sr,ERR_STREAM_ALREADY_FINISHED:ob,ERR_STREAM_NULL_VALUES:sb,ERR_STREAM_WRITE_AFTER_END:ab,ERR_UNKNOWN_ENCODING:Hl}=se().codes,{errorOrDestroy:gi}=an;zl(j.prototype,or.prototype);zl(j,or);function Ho(){}s(Ho,"nop");var wi=Xm("kOnFinished");function ar(t,e,i){typeof i!="boolean"&&(i=e instanceof Je()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?eb(this,t,"writableHighWaterMark",i):tb(!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=lb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,sn(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[wi]=[]}s(ar,"WritableState");function sn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(sn,"resetBuffer");ar.prototype.getBuffer=s(function(){return jl(this.buffered,this.bufferedIndex)},"getBuffer");$l(ar.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function j(t){let e=this instanceof Je();if(!e&&!ql(j,this))return new j(t);this._writableState=new ar(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&&Zm(t.signal,this)),or.call(this,t),an.construct(this,()=>{let i=this._writableState;i.writing||Ko(this,i),Yo(this,i)})}s(j,"Writable");$l(j,Jm,{__proto__:null,value:s(function(t){return ql(this,t)?!0:this!==j?!1:t&&t._writableState instanceof ar},"value")});j.prototype.pipe=function(){gi(this,new nb)};function Gl(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"&&!nn.isEncoding(i))throw new Hl(i);typeof r!="function"&&(r=Ho)}if(e===null)throw new sb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=nn.from(e,i),i="buffer");else if(e instanceof nn)i="buffer";else if(or._isUint8Array(e))e=or._uint8ArrayToBuffer(e),i="buffer";else throw new ib("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new ab:n.destroyed&&(o=new sr("write")),o?(zt.nextTick(r,o),gi(t,o,!0),o):(n.pendingcb++,cb(t,n,e,i,r))}s(Gl,"_write");j.prototype.write=function(t,e,i){return Gl(this,t,e,i)===!0};j.prototype.cork=function(){this._writableState.corked++};j.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ko(this,t))};j.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Ym(e)),!nn.isEncoding(e))throw new Hl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function cb(t,e,i,r,n){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:r,callback:n}),e.allBuffers&&r!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ho&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(cb,"writeOrBuffer");function Ul(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new sr("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(Ul,"doWrite");function Wl(t,e,i,r){--e.pendingcb,r(i),Go(e),gi(t,i)}s(Wl,"onwriteError");function lb(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){gi(t,new Vl);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?zt.nextTick(Wl,t,i,e,n):Wl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Ko(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},zt.nextTick(fb,i.afterWriteTickInfo)):Kl(t,i,1,n))}s(lb,"onwrite");function fb({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Kl(t,e,i,r)}s(fb,"afterWriteTick");function Kl(t,e,i,r){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,r();e.destroyed&&Go(e),Yo(t,e)}s(Kl,"afterWrite");function Go(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],c=t.objectMode?1:o.length;t.length-=c,a((e=t.errored)!==null&&e!==void 0?e:new sr("write"))}let i=t[wi].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new sr("end"))}sn(t)}s(Go,"errorBuffer");function Ko(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,o=i.length-r;if(!o)return;let a=r;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let c=e.allNoop?Ho:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=e.allNoop&&a===0?i:jl(i,a);l.allBuffers=e.allBuffers,Ul(t,e,!0,e.length,l,"",c),sn(e)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=n?1:c.length;Ul(t,e,!1,d,c,l,f)}while(a<i.length&&!e.writing);a===i.length?sn(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Ko,"clearBuffer");j.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new rb("_write()")};j.prototype._writev=null;j.prototype.end=function(t,e,i){let r=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let n;if(t!=null){let o=Gl(this,t,e);o instanceof Gm&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Yo(this,r,!0),r.ended=!0):r.finished?n=new ob("end"):r.destroyed&&(n=new sr("end"))),typeof i=="function"&&(n||r.finished?zt.nextTick(i,n):r[wi].push(i)),this};function on(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(on,"needFinish");function ub(t,e){let i=!1;function r(n){if(i){gi(t,n??Vl());return}if(i=!0,e.pendingcb--,n){let o=e[wi].splice(0);for(let a=0;a<o.length;a++)o[a](n);gi(t,n,e.sync)}else on(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,zt.nextTick(Vo,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(ub,"callFinal");function db(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,ub(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(db,"prefinish");function Yo(t,e,i){on(e)&&(db(t,e),e.pendingcb===0&&(i?(e.pendingcb++,zt.nextTick((r,n)=>{on(n)?Vo(r,n):n.pendingcb--},t,e)):on(e)&&(e.pendingcb++,Vo(t,e))))}s(Yo,"finishMaybe");function Vo(t,e){e.pendingcb--,e.finished=!0;let i=e[wi].splice(0);for(let r=0;r<i.length;r++)i[r]();if(t.emit("finish"),e.autoDestroy){let r=t._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&t.destroy()}}s(Vo,"finish");Km(j.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:s(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:s(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var hb=an.destroy;j.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[wi].length)&&zt.nextTick(Go,i),hb.call(this,t,e),this};j.prototype._undestroy=an.undestroy;j.prototype._destroy=function(t,e){e(t)};j.prototype[Qm.captureRejectionSymbol]=function(t){this.destroy(t)};var zo;function Yl(){return zo===void 0&&(zo={}),zo}s(Yl,"lazyWebStreams");j.fromWeb=function(t,e){return Yl().newStreamWritableFromWritableStream(t,e)};j.toWeb=function(t){return Yl().newWritableStreamFromStreamWritable(t)}});var df=T((k_,uf)=>{var Xo=St(),pb=xe(),{isReadable:yb,isWritable:mb,isIterable:Jl,isNodeStream:bb,isReadableNodeStream:Ql,isWritableNodeStream:Zl,isDuplexNodeStream:gb,isReadableStream:ef,isWritableStream:tf}=Ke(),rf=ct(),{AbortError:lf,codes:{ERR_INVALID_ARG_TYPE:wb,ERR_INVALID_RETURN_VALUE:nf}}=se(),{destroyer:_i}=jt(),Sb=Je(),ff=nr(),_b=cn(),{createDeferredPromise:of}=re(),sf=Lo(),af=globalThis.Blob||pb.Blob,Eb=s(typeof af<"u"?function(e){return e instanceof af}:function(e){return!1},"isBlob"),xb=globalThis.AbortController||li().AbortController,{FunctionPrototypeCall:cf}=W(),xt=class extends Sb{static{s(this,"Duplexify")}constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};uf.exports=s(function t(e,i){if(gb(e))return e;if(Ql(e))return Si({readable:e});if(Zl(e))return Si({writable:e});if(bb(e))return Si({writable:!1,readable:!1});if(ef(e))return Si({readable:ff.fromWeb(e)});if(tf(e))return Si({writable:_b.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:c}=kb(e);if(Jl(n))return sf(xt,n,{objectMode:!0,write:o,final:a,destroy:c});let l=n?.then;if(typeof l=="function"){let f,d=cf(l,n,h=>{if(h!=null)throw new nf("nully","body",h)},h=>{_i(f,h)});return f=new xt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,Xo.nextTick(h,null)}catch(m){Xo.nextTick(h,m)}})},"final"),destroy:c})}throw new nf("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Eb(e))return t(e.arrayBuffer());if(Jl(e))return sf(xt,e,{objectMode:!0,writable:!1});if(ef(e?.readable)&&tf(e?.writable))return xt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Ql(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?Zl(e?.writable)?e?.writable:t(e.writable):void 0;return Si({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return cf(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{_i(n,o)}),n=new xt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new wb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function kb(t){let{promise:e,resolve:i}=of(),r=new xb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:c,done:l,cb:f}=await a;if(Xo.nextTick(f),l)return;if(n.aborted)throw new lf(void 0,{cause:n.reason});({promise:e,resolve:i}=of()),yield c}}(),{signal:n}),write:s(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){r.abort(),c(a)},"destroy")}}s(kb,"fromAsyncGen");function Si(t){let e=t.readable&&typeof t.readable.read!="function"?ff.wrap(t.readable):t.readable,i=t.writable,r=!!yb(e),n=!!mb(i),o,a,c,l,f;function d(h){let m=l;l=null,m?m(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new xt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(rf(i,h=>{n=!1,h&&_i(e,h),d(h)}),f._write=function(h,m,b){i.write(h,m)?b():o=b},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(rf(e,h=>{r=!1,h&&_i(e,h),d(h)}),e.on("readable",function(){if(c){let h=c;c=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){c=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&l!==null&&(h=new lf),c=null,o=null,a=null,l===null?m(h):(l=m,_i(i,h),_i(e,h))},f}s(Si,"_duplexify")});var Je=T((F_,yf)=>{"use strict";var{ObjectDefineProperties:vb,ObjectGetOwnPropertyDescriptor:lt,ObjectKeys:Fb,ObjectSetPrototypeOf:hf}=W();yf.exports=Oe;var Zo=nr(),Fe=cn();hf(Oe.prototype,Zo.prototype);hf(Oe,Zo);{let t=Fb(Fe.prototype);for(let e=0;e<t.length;e++){let i=t[e];Oe.prototype[i]||(Oe.prototype[i]=Fe.prototype[i])}}function Oe(t){if(!(this instanceof Oe))return new Oe(t);Zo.call(this,t),Fe.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Oe,"Duplex");vb(Oe.prototype,{writable:{__proto__:null,...lt(Fe.prototype,"writable")},writableHighWaterMark:{__proto__:null,...lt(Fe.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...lt(Fe.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...lt(Fe.prototype,"writableBuffer")},writableLength:{__proto__:null,...lt(Fe.prototype,"writableLength")},writableFinished:{__proto__:null,...lt(Fe.prototype,"writableFinished")},writableCorked:{__proto__:null,...lt(Fe.prototype,"writableCorked")},writableEnded:{__proto__:null,...lt(Fe.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...lt(Fe.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var Jo;function pf(){return Jo===void 0&&(Jo={}),Jo}s(pf,"lazyWebStreams");Oe.fromWeb=function(t,e){return pf().newStreamDuplexFromReadableWritablePair(t,e)};Oe.toWeb=function(t){return pf().newReadableWritablePairFromDuplex(t)};var Qo;Oe.from=function(t){return Qo||(Qo=df()),Qo(t,"body")}});var is=T((P_,bf)=>{"use strict";var{ObjectSetPrototypeOf:mf,Symbol:Ib}=W();bf.exports=ft;var{ERR_METHOD_NOT_IMPLEMENTED:Pb}=se().codes,ts=Je(),{getHighWaterMark:Ab}=tr();mf(ft.prototype,ts.prototype);mf(ft,ts);var cr=Ib("kCallback");function ft(t){if(!(this instanceof ft))return new ft(t);let e=t?Ab(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ts.call(this,t),this._readableState.sync=!1,this[cr]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ob)}s(ft,"Transform");function es(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(es,"final");function Ob(){this._final!==es&&es.call(this)}s(Ob,"prefinish");ft.prototype._final=es;ft.prototype._transform=function(t,e,i){throw new Pb("_transform()")};ft.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),n.ended||o===r.length||r.length<r.highWaterMark?i():this[cr]=i})};ft.prototype._read=function(){if(this[cr]){let t=this[cr];this[cr]=null,t()}}});var ns=T((O_,wf)=>{"use strict";var{ObjectSetPrototypeOf:gf}=W();wf.exports=Ei;var rs=is();gf(Ei.prototype,rs.prototype);gf(Ei,rs);function Ei(t){if(!(this instanceof Ei))return new Ei(t);rs.call(this,t)}s(Ei,"PassThrough");Ei.prototype._transform=function(t,e,i){i(null,t)}});var dn=T((C_,kf)=>{var lr=St(),{ArrayIsArray:Tb,Promise:Cb,SymbolAsyncIterator:Rb,SymbolDispose:Nb}=W(),un=ct(),{once:Lb}=re(),Bb=jt(),Sf=Je(),{aggregateTwoErrors:Db,codes:{ERR_INVALID_ARG_TYPE:hs,ERR_INVALID_RETURN_VALUE:os,ERR_MISSING_ARGS:Mb,ERR_STREAM_DESTROYED:Ub,ERR_STREAM_PREMATURE_CLOSE:Wb},AbortError:jb}=se(),{validateFunction:qb,validateAbortSignal:$b}=di(),{isIterable:Vt,isReadable:ss,isReadableNodeStream:fn,isNodeStream:_f,isTransformStream:xi,isWebStream:zb,isReadableStream:as,isReadableFinished:Vb}=Ke(),Hb=globalThis.AbortController||li().AbortController,cs,ls,fs;function Ef(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=un(t,{readable:e,writable:i},o=>{r=!o});return{destroy:s(o=>{r||(r=!0,Bb.destroyer(t,o||new Ub("pipe")))},"destroy"),cleanup:n}}s(Ef,"destroyer");function Gb(t){return qb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Gb,"popCallback");function us(t){if(Vt(t))return t;if(fn(t))return Kb(t);throw new hs("val",["Readable","Iterable","AsyncIterable"],t)}s(us,"makeAsyncIterable");async function*Kb(t){ls||(ls=nr()),yield*ls.prototype[Rb].call(t)}s(Kb,"fromReadable");async function ln(t,e,i,{end:r}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Cb((f,d)=>{n?d(n):o=s(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let l=un(e,{readable:!1},a);try{e.writableNeedDrain&&await c();for await(let f of t)e.write(f)||await c();r&&(e.end(),await c()),i()}catch(f){i(n!==f?Db(n,f):f)}finally{l(),e.off("drain",a)}}s(ln,"pumpToNode");async function ds(t,e,i,{end:r}){xi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(ds,"pumpToWeb");function Yb(...t){return xf(t,Lb(Gb(t)))}s(Yb,"pipeline");function xf(t,e,i){if(t.length===1&&Tb(t[0])&&(t=t[0]),t.length<2)throw new Mb("streams");let r=new Hb,n=r.signal,o=i?.signal,a=[];$b(o,"options.signal");function c(){w(new jb)}s(c,"abort"),fs=fs||re().addAbortListener;let l;o&&(l=fs(o,c));let f,d,h=[],m=0;function b(q){w(q,--m===0)}s(b,"finish");function w(q,O){var G;if(q&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=q),!(!f&&!O)){for(;h.length;)h.shift()(f);(G=l)===null||G===void 0||G[Nb](),r.abort(),O&&(f||a.forEach(Ft=>Ft()),lr.nextTick(e,f,d))}}s(w,"finishImpl");let g;for(let q=0;q<t.length;q++){let O=t[q],G=q<t.length-1,Ft=q>0,me=G||i?.end!==!1,Xt=q===t.length-1;if(_f(O)){let ae=function(Ze){Ze&&Ze.name!=="AbortError"&&Ze.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(Ze)};var C=ae;if(s(ae,"onError"),me){let{destroy:Ze,cleanup:On}=Ef(O,G,Ft);h.push(Ze),ss(O)&&Xt&&a.push(On)}O.on("error",ae),ss(O)&&Xt&&a.push(()=>{O.removeListener("error",ae)})}if(q===0)if(typeof O=="function"){if(g=O({signal:n}),!Vt(g))throw new os("Iterable, AsyncIterable or Stream","source",g)}else Vt(O)||fn(O)||xi(O)?g=O:g=Sf.from(O);else if(typeof O=="function"){if(xi(g)){var A;g=us((A=g)===null||A===void 0?void 0:A.readable)}else g=us(g);if(g=O(g,{signal:n}),G){if(!Vt(g,!0))throw new os("AsyncIterable",`transform[${q-1}]`,g)}else{var E;cs||(cs=ns());let ae=new cs({objectMode:!0}),Ze=(E=g)===null||E===void 0?void 0:E.then;if(typeof Ze=="function")m++,Ze.call(g,dt=>{d=dt,dt!=null&&ae.write(dt),me&&ae.end(),lr.nextTick(b)},dt=>{ae.destroy(dt),lr.nextTick(b,dt)});else if(Vt(g,!0))m++,ln(g,ae,b,{end:me});else if(as(g)||xi(g)){let dt=g.readable||g;m++,ln(dt,ae,b,{end:me})}else throw new os("AsyncIterable or Promise","destination",g);g=ae;let{destroy:On,cleanup:td}=Ef(g,!1,!0);h.push(On),Xt&&a.push(td)}}else if(_f(O)){if(fn(g)){m+=2;let ae=Xb(g,O,b,{end:me});ss(O)&&Xt&&a.push(ae)}else if(xi(g)||as(g)){let ae=g.readable||g;m++,ln(ae,O,b,{end:me})}else if(Vt(g))m++,ln(g,O,b,{end:me});else throw new hs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=O}else if(zb(O)){if(fn(g))m++,ds(us(g),O,b,{end:me});else if(as(g)||Vt(g))m++,ds(g,O,b,{end:me});else if(xi(g))m++,ds(g.readable,O,b,{end:me});else throw new hs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=O}else g=Sf.from(O)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&lr.nextTick(c),g}s(xf,"pipelineImpl");function Xb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Wb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Vb(t)?lr.nextTick(a):t.once("end",a)}else i();return un(t,{readable:!0,writable:!1},a=>{let c=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?t.once("end",i).once("error",i):i(a)}),un(e,{readable:!1,writable:!0},i)}s(Xb,"pipe");kf.exports={pipelineImpl:xf,pipeline:Yb}});var ys=T((N_,Of)=>{"use strict";var{pipeline:Jb}=dn(),hn=Je(),{destroyer:Qb}=jt(),{isNodeStream:pn,isReadable:vf,isWritable:Ff,isWebStream:ps,isTransformStream:Ht,isWritableStream:If,isReadableStream:Pf}=Ke(),{AbortError:Zb,codes:{ERR_INVALID_ARG_VALUE:Af,ERR_MISSING_ARGS:eg}}=se(),tg=ct();Of.exports=s(function(...e){if(e.length===0)throw new eg("streams");if(e.length===1)return hn.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=hn.from(e[0])),typeof e[e.length-1]=="function"){let b=e.length-1;e[b]=hn.from(e[b])}for(let b=0;b<e.length;++b)if(!(!pn(e[b])&&!ps(e[b]))){if(b<e.length-1&&!(vf(e[b])||Pf(e[b])||Ht(e[b])))throw new Af(`streams[${b}]`,i[b],"must be readable");if(b>0&&!(Ff(e[b])||If(e[b])||Ht(e[b])))throw new Af(`streams[${b}]`,i[b],"must be writable")}let r,n,o,a,c;function l(b){let w=a;a=null,w?w(b):b?c.destroy(b):!m&&!h&&c.destroy()}s(l,"onfinished");let f=e[0],d=Jb(e,l),h=!!(Ff(f)||If(f)||Ht(f)),m=!!(vf(d)||Pf(d)||Ht(d));if(c=new hn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(pn(f))c._write=function(w,g,A){f.write(w,g)?A():r=A},c._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ps(f)){let g=(Ht(f)?f.writable:f).getWriter();c._write=async function(A,E,C){try{await g.ready,g.write(A).catch(()=>{}),C()}catch(q){C(q)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),n=A}catch(E){A(E)}}}let b=Ht(d)?d.readable:d;tg(b,()=>{if(n){let w=n;n=null,w()}})}if(m){if(pn(d))d.on("readable",function(){if(o){let b=o;o=null,b()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let b=d.read();if(b===null){o=c._read;return}if(!c.push(b))return}};else if(ps(d)){let w=(Ht(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(b,w){!b&&a!==null&&(b=new Zb),o=null,r=null,n=null,a===null?w(b):(a=w,pn(d)&&Qb(d,b))},c},"compose")});var Wf=T((B_,gs)=>{"use strict";var ig=globalThis.AbortController||li().AbortController,{codes:{ERR_INVALID_ARG_VALUE:rg,ERR_INVALID_ARG_TYPE:fr,ERR_MISSING_ARGS:ng,ERR_OUT_OF_RANGE:og},AbortError:Qe}=se(),{validateAbortSignal:Gt,validateInteger:Tf,validateObject:Kt}=di(),sg=W().Symbol("kWeak"),ag=W().Symbol("kResistStopPropagation"),{finished:cg}=ct(),lg=ys(),{addAbortSignalNoValidate:fg}=er(),{isWritable:ug,isNodeStream:dg}=Ke(),{deprecate:hg}=re(),{ArrayPrototypePush:pg,Boolean:yg,MathFloor:Cf,Number:mg,NumberIsNaN:bg,Promise:Rf,PromiseReject:Nf,PromiseResolve:gg,PromisePrototypeThen:Lf,Symbol:Df}=W(),yn=Df("kEmpty"),Bf=Df("kEof");function wg(t,e){if(e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal"),dg(t)&&!ug(t))throw new rg("stream",t,"must be writable");let i=lg(this,t);return e!=null&&e.signal&&fg(e.signal,i),i}s(wg,"compose");function mn(t,e){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Cf(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Cf(e.highWaterMark)),Tf(i,"options.concurrency",1),Tf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=re().AbortSignalAny([e?.signal].filter(yg)),a=this,c=[],l={signal:o},f,d,h=!1,m=0;function b(){h=!0,w()}s(b,"onCatch");function w(){m-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&m<i&&c.length<r&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let E of a){if(h)return;if(o.aborted)throw new Qe;try{if(E=t(E,l),E===yn)continue;E=gg(E)}catch(C){E=Nf(C)}m+=1,Lf(E,w,b),c.push(E),f&&(f(),f=null),!h&&(c.length>=r||m>=i)&&await new Rf(C=>{d=C})}c.push(Bf)}catch(E){let C=Nf(E);Lf(C,w,b),c.push(C)}finally{h=!0,f&&(f(),f=null)}}s(A,"pump"),A();try{for(;;){for(;c.length>0;){let E=await c[0];if(E===Bf)return;if(o.aborted)throw new Qe;E!==yn&&(yield E),c.shift(),g()}await new Rf(E=>{f=E})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(mn,"map");function Sg(t=void 0){return t!=null&&Kt(t,"options"),t?.signal!=null&&Gt(t.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Qe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(Sg,"asIndexedPairs");async function Mf(t,e=void 0){for await(let i of bs.call(this,t,e))return!0;return!1}s(Mf,"some");async function _g(t,e=void 0){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);return!await Mf.call(this,async(...i)=>!await t(...i),e)}s(_g,"every");async function Eg(t,e){for await(let i of bs.call(this,t,e))return i}s(Eg,"find");async function xg(t,e){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),yn}s(i,"forEachFn");for await(let r of mn.call(this,i,e));}s(xg,"forEach");function bs(t,e){if(typeof t!="function")throw new fr("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:yn}return s(i,"filterFn"),mn.call(this,i,e)}s(bs,"filter");var ms=class extends ng{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function kg(t,e,i){var r;if(typeof t!="function")throw new fr("reducer",["Function","AsyncFunction"],t);i!=null&&Kt(i,"options"),i?.signal!=null&&Gt(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new Qe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await cg(this.destroy(f)),f}let o=new ig,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[sg]:this,[ag]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new Qe;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!c&&!n)throw new ms}finally{o.abort()}return e}s(kg,"reduce");async function vg(t){t!=null&&Kt(t,"options"),t?.signal!=null&&Gt(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 Qe(void 0,{cause:t.signal.reason});pg(e,r)}return e}s(vg,"toArray");function Fg(t,e){let i=mn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(Fg,"flatMap");function Uf(t){if(t=mg(t),bg(t))return 0;if(t<0)throw new og("number",">= 0",t);return t}s(Uf,"toIntegerOrInfinity");function Ig(t,e=void 0){return e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal"),t=Uf(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Qe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Qe;t--<=0&&(yield o)}},"drop").call(this)}s(Ig,"drop");function Pg(t,e=void 0){return e!=null&&Kt(e,"options"),e?.signal!=null&&Gt(e.signal,"options.signal"),t=Uf(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Qe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Qe;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(Pg,"take");gs.exports.streamReturningOperators={asIndexedPairs:hg(Sg,"readable.asIndexedPairs will be removed in a future version."),drop:Ig,filter:bs,flatMap:Fg,map:mn,take:Pg,compose:wg};gs.exports.promiseReturningOperators={every:_g,forEach:xg,reduce:kg,toArray:vg,some:Mf,find:Eg}});var ws=T((M_,jf)=>{"use strict";var{ArrayPrototypePop:Ag,Promise:Og}=W(),{isIterable:Tg,isNodeStream:Cg,isWebStream:Rg}=Ke(),{pipelineImpl:Ng}=dn(),{finished:Lg}=ct();Ss();function Bg(...t){return new Og((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Cg(o)&&!Tg(o)&&!Rg(o)){let a=Ag(t);r=a.signal,n=a.end}Ng(t,(a,c)=>{a?i(a):e(c)},{signal:r,end:n})})}s(Bg,"pipeline");jf.exports={finished:Lg,pipeline:Bg}});var Ss=T((W_,Xf)=>{var{Buffer:Dg}=xe(),{ObjectDefineProperty:ut,ObjectKeys:zf,ReflectApply:Vf}=W(),{promisify:{custom:Hf}}=re(),{streamReturningOperators:qf,promiseReturningOperators:$f}=Wf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Gf}}=se(),Mg=ys(),{setDefaultHighWaterMark:Ug,getDefaultHighWaterMark:Wg}=tr(),{pipeline:Kf}=dn(),{destroyer:jg}=jt(),Yf=ct(),_s=ws(),ur=Ke(),L=Xf.exports=Kr().Stream;L.isDestroyed=ur.isDestroyed;L.isDisturbed=ur.isDisturbed;L.isErrored=ur.isErrored;L.isReadable=ur.isReadable;L.isWritable=ur.isWritable;L.Readable=nr();for(let t of zf(qf)){let i=function(...r){if(new.target)throw Gf();return L.Readable.from(Vf(e,this,r))};Es=i,s(i,"fn");let e=qf[t];ut(i,"name",{__proto__:null,value:e.name}),ut(i,"length",{__proto__:null,value:e.length}),ut(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Es;for(let t of zf($f)){let i=function(...n){if(new.target)throw Gf();return Vf(e,this,n)};Es=i,s(i,"fn");let e=$f[t];ut(i,"name",{__proto__:null,value:e.name}),ut(i,"length",{__proto__:null,value:e.length}),ut(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Es;L.Writable=cn();L.Duplex=Je();L.Transform=is();L.PassThrough=ns();L.pipeline=Kf;var{addAbortSignal:qg}=er();L.addAbortSignal=qg;L.finished=Yf;L.destroy=jg;L.compose=Mg;L.setDefaultHighWaterMark=Ug;L.getDefaultHighWaterMark=Wg;ut(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return _s},"get")});ut(Kf,Hf,{__proto__:null,enumerable:!0,get:s(function(){return _s.pipeline},"get")});ut(Yf,Hf,{__proto__:null,enumerable:!0,get:s(function(){return _s.finished},"get")});L.Stream=L;L._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=s(function(e){return Dg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Jf=T((q_,H)=>{"use strict";var Q=Ss(),$g=ws(),zg=Q.Readable.destroy;H.exports=Q.Readable;H.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer;H.exports._isUint8Array=Q._isUint8Array;H.exports.isDisturbed=Q.isDisturbed;H.exports.isErrored=Q.isErrored;H.exports.isReadable=Q.isReadable;H.exports.Readable=Q.Readable;H.exports.Writable=Q.Writable;H.exports.Duplex=Q.Duplex;H.exports.Transform=Q.Transform;H.exports.PassThrough=Q.PassThrough;H.exports.addAbortSignal=Q.addAbortSignal;H.exports.finished=Q.finished;H.exports.destroy=Q.destroy;H.exports.destroy=zg;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return $g},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var ow={};wr(ow,{Async:()=>Bn,AsyncTransaction:()=>Un,BigIntStats:()=>de,BigIntStatsFs:()=>Ni,Dir:()=>wt,Dirent:()=>gt,Errno:()=>B,ErrnoError:()=>u,Fetch:()=>tw,FetchFS:()=>Pn,File:()=>Pt,FileSystem:()=>ie,InMemory:()=>ji,InMemoryStore:()=>kr,IndexFS:()=>br,Inode:()=>Me,Locked:()=>iw,LockedFS:()=>Pi,NoSyncFile:()=>Zt,Overlay:()=>rw,OverlayFS:()=>gr,Port:()=>Yg,PortFS:()=>Fn,PortFile:()=>qi,PreloadFile:()=>pe,ReadStream:()=>kt,Readonly:()=>Dn,SimpleAsyncStore:()=>Wn,SimpleTransaction:()=>ti,Stats:()=>X,StatsCommon:()=>Ci,StatsFs:()=>Ri,StoreFS:()=>Mi,Sync:()=>Dd,SyncTransaction:()=>Wi,Transaction:()=>Ui,UnlockedOverlayFS:()=>An,WriteStream:()=>vt,ZenFsType:()=>Ln,_toUnixTimestamp:()=>Ud,access:()=>Tu,accessSync:()=>Ba,appendFile:()=>au,appendFileSync:()=>Ea,attachFS:()=>Ku,checkOptions:()=>zn,chmod:()=>Fu,chmodSync:()=>Ra,chown:()=>ku,chownSync:()=>Ta,close:()=>lu,closeSync:()=>bt,configure:()=>Gg,configureSingle:()=>Hg,constants:()=>It,copyFile:()=>Uu,copyFileSync:()=>so,cp:()=>$u,cpSync:()=>ao,createReadStream:()=>Lu,createWriteStream:()=>Bu,decode:()=>ei,decodeDirListing:()=>xr,default:()=>nw,detachFS:()=>Kg,encode:()=>Pe,encodeDirListing:()=>we,errorMessages:()=>Tn,exists:()=>Zf,existsSync:()=>ze,fchmod:()=>mu,fchmodSync:()=>Rr,fchown:()=>yu,fchownSync:()=>Cr,fdatasync:()=>du,fdatasyncSync:()=>Fa,flagToMode:()=>At,flagToNumber:()=>Rd,flagToString:()=>Vs,fs:()=>mr,fstat:()=>cu,fstatSync:()=>xa,fsync:()=>uu,fsyncSync:()=>va,ftruncate:()=>fu,ftruncateSync:()=>ka,futimes:()=>bu,futimesSync:()=>Nr,handleRequest:()=>$i,isAppendable:()=>nt,isBackend:()=>zi,isBackendConfig:()=>Vi,isExclusive:()=>Di,isReadable:()=>ht,isSynchronous:()=>Nd,isTruncating:()=>Bi,isWriteable:()=>he,lchmod:()=>Iu,lchmodSync:()=>Na,lchown:()=>vu,lchownSync:()=>Ca,levenshtein:()=>Mn,link:()=>_u,linkSync:()=>Aa,lopenSync:()=>Ji,lstat:()=>tu,lstatSync:()=>to,lutimes:()=>Au,lutimesSync:()=>La,mkdir:()=>wu,mkdirSync:()=>Lr,mkdirpSync:()=>Gs,mkdtemp:()=>Mu,mkdtempSync:()=>Da,mount:()=>Nt,mountObject:()=>Ki,mounts:()=>ke,nop:()=>S,normalizeMode:()=>Se,normalizeOptions:()=>_e,normalizePath:()=>_,normalizeTime:()=>Ot,open:()=>nu,openAsBlob:()=>Vu,openSync:()=>Xi,opendir:()=>qu,opendirSync:()=>Wa,parseFlag:()=>D,promises:()=>yr,randomIno:()=>Li,read:()=>pu,readFile:()=>ou,readFileSync:()=>Tr,readSync:()=>Pa,readdir:()=>Su,readdirSync:()=>ci,readlink:()=>xu,readlinkSync:()=>ro,readv:()=>Wu,readvSync:()=>Ma,realpath:()=>Ou,realpathSync:()=>$e,rename:()=>Qf,renameSync:()=>wa,resolveMountConfig:()=>Ii,resolveRemoteMount:()=>Xg,rm:()=>Du,rmSync:()=>oo,rmdir:()=>gu,rmdirSync:()=>io,rootCred:()=>We,rootIno:()=>Ue,setImmediate:()=>Md,size_max:()=>ge,stat:()=>eu,statSync:()=>Yi,statfs:()=>zu,statfsSync:()=>ja,symlink:()=>Eu,symlinkSync:()=>Oa,truncate:()=>iu,truncateSync:()=>Sa,umount:()=>ai,unlink:()=>ru,unlinkSync:()=>Or,unwatchFile:()=>Ru,utimes:()=>Pu,utimesSync:()=>no,watch:()=>Nu,watchFile:()=>Cu,write:()=>hu,writeFile:()=>su,writeFileSync:()=>Qi,writeSync:()=>Ia,writev:()=>ju,writevSync:()=>Ua});var B=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EINTR=4]="EINTR",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))(B||{}),Tn={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},u=class t extends Error{constructor(i,r=Tn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=B[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let r=new t(i.errno,i.message,i.path,i.syscall);return r.code=i.code,r.stack=i.stack,r}static With(i,r,n){return new t(B[i],Tn[B[i]],r,n)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};var It={};wr(It,{COPYFILE_EXCL:()=>Ti,COPYFILE_FICLONE:()=>ld,COPYFILE_FICLONE_FORCE:()=>fd,F_OK:()=>Oi,O_APPEND:()=>De,O_CREAT:()=>Z,O_DIRECT:()=>bd,O_DIRECTORY:()=>dd,O_DSYNC:()=>yd,O_EXCL:()=>Le,O_NOATIME:()=>hd,O_NOCTTY:()=>ud,O_NOFOLLOW:()=>pd,O_NONBLOCK:()=>gd,O_RDONLY:()=>Jt,O_RDWR:()=>ce,O_SYMLINK:()=>md,O_SYNC:()=>Qt,O_TRUNC:()=>Be,O_WRONLY:()=>Ne,R_OK:()=>Re,S_IFBLK:()=>tt,S_IFCHR:()=>it,S_IFDIR:()=>fe,S_IFIFO:()=>rt,S_IFLNK:()=>Ie,S_IFMT:()=>K,S_IFREG:()=>le,S_IFSOCK:()=>et,S_IRGRP:()=>vd,S_IROTH:()=>Pd,S_IRUSR:()=>Ed,S_IRWXG:()=>Rn,S_IRWXO:()=>Nn,S_IRWXU:()=>Cn,S_ISGID:()=>Sd,S_ISUID:()=>wd,S_ISVTX:()=>_d,S_IWGRP:()=>Fd,S_IWOTH:()=>Ad,S_IWUSR:()=>xd,S_IXGRP:()=>Id,S_IXOTH:()=>Od,S_IXUSR:()=>kd,UV_FS_O_FILEMAP:()=>Td,W_OK:()=>be,X_OK:()=>cd});var Oi=0,Re=4,be=2,cd=1,Ti=1,ld=2,fd=4,Jt=0,Ne=1,ce=2,Z=64,Le=128,ud=256,Be=512,De=1024,dd=65536,hd=262144,pd=131072,Qt=1052672,yd=4096,md=32768,bd=16384,gd=2048,K=61440,et=49152,Ie=40960,le=32768,tt=24576,fe=16384,it=8192,rt=4096,wd=2048,Sd=1024,_d=512,Cn=448,Ed=256,xd=128,kd=64,Rn=56,vd=32,Fd=16,Id=8,Nn=7,Pd=4,Ad=2,Od=1,Td=0;var Ci=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(e??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(r??d),this.birthtimeMs=this._convert(n??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}static{s(this,"StatsCommon")}_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let r=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&r)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}},X=class extends Ci{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},de=class extends Ci{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}},Ln=525687744115,Ri=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=ge;this.ffree=ge}static{s(this,"StatsFs")}},Ni=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(ge);this.ffree=BigInt(ge)}static{s(this,"BigIntStatsFs")}};var ge=2**32-1,Ue=0n;function zs(){return Math.round(Math.random()*2**32).toString(16)}s(zs,"_random");function Li(){return BigInt("0x"+zs()+zs())}s(Li,"randomIno");var M={ino:0,size:8,mode:12,nlink:14,uid:18,gid:22,atime:26,birthtime:34,mtime:42,ctime:50,end:58};var Me=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(e){let i=!e;if(e??=new ArrayBuffer(M.end),e?.byteLength<M.end)throw new RangeError(`Can not create an inode from a buffer less than ${M.end} bytes`);if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Li(),this.nlink=1,this.size=4096;let r=Date.now();this.atimeMs=r,this.mtimeMs=r,this.ctimeMs=r,this.birthtimeMs=r}get ino(){return this.view.getBigUint64(M.ino,!0)}set ino(e){this.view.setBigUint64(M.ino,e,!0)}get size(){return this.view.getUint32(M.size,!0)}set size(e){this.view.setUint32(M.size,e,!0)}get mode(){return this.view.getUint16(M.mode,!0)}set mode(e){this.view.setUint16(M.mode,e,!0)}get nlink(){return this.view.getUint32(M.nlink,!0)}set nlink(e){this.view.setUint32(M.nlink,e,!0)}get uid(){return this.view.getUint32(M.uid,!0)}set uid(e){this.view.setUint32(M.uid,e,!0)}get gid(){return this.view.getUint32(M.gid,!0)}set gid(e){this.view.setUint32(M.gid,e,!0)}get atimeMs(){return this.view.getFloat64(M.atime,!0)}set atimeMs(e){this.view.setFloat64(M.atime,e,!0)}get birthtimeMs(){return this.view.getFloat64(M.birthtime,!0)}set birthtimeMs(e){this.view.setFloat64(M.birthtime,e,!0)}get mtimeMs(){return this.view.getFloat64(M.mtime,!0)}set mtimeMs(e){this.view.setFloat64(M.mtime,e,!0)}get ctimeMs(){return this.view.getFloat64(M.ctime,!0)}set ctimeMs(e){this.view.setFloat64(M.ctime,e,!0)}toStats(){return new X(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};Promise.withResolvers??=function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Cd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function D(t){if(typeof t=="number")return Vs(t);if(!Cd.includes(t))throw new Error("Invalid flag string: "+t);return t}s(D,"parseFlag");function Vs(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(Vs,"flagToString");function Rd(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(Rd,"flagToNumber");function At(t){let e=0;return e<<=1,e+=+ht(t),e<<=1,e+=+he(t),e<<=1,e}s(At,"flagToMode");function ht(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(ht,"isReadable");function he(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(he,"isWriteable");function Bi(t){return t.indexOf("w")!==-1}s(Bi,"isTruncating");function nt(t){return t.indexOf("a")!==-1}s(nt,"isAppendable");function Nd(t){return t.indexOf("s")!==-1}s(Nd,"isSynchronous");function Di(t){return t.indexOf("x")!==-1}s(Di,"isExclusive");var Pt=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},pe=class extends Pt{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:ge}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;if(this.stats.size!=a.byteLength){if(ht(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return nt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}stat(){return Promise.resolve(new X(this.stats))}statSync(){return new X(this.stats)}_truncate(i){if(this.dirty=!0,!he(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,r=0,n=this.stats.size,o=this.position){if(this.dirty=!0,!he(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:ge}));l.set(this._buffer),this._buffer=l}let c=i.slice(r,r+n);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,r,n,o){let a=this._write(i,r,n,o);return await this.sync(),a}writeSync(i,r=0,n=this.stats.size,o=this.position){let a=this._write(i,r,n,o);return this.syncSync(),a}_read(i,r=0,n=this.stats.size,o){if(!ht(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,r,n).set(this._buffer.slice(o,a)),c}async read(i,r,n,o){let a=this._read(i,r,n,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,r,n,o){let a=this._read(i,r,n,o);return this.statSync(),a}async chmod(i){this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.dirty=!0,this.stats.chown(i,r),await this.sync()}chownSync(i,r){this.dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,await this.sync()}utimesSync(i,r){this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}async _setType(i){this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}},Zt=class extends pe{static{s(this,"NoSyncFile")}constructor(e,i,r,n,o){super(e,i,r,n,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var We={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Ld="/";function Hs(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let c=0;c<=t.length;++c){if(c<t.length)a=t[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===c-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",r=0):(i=i.slice(0,l),r=i.length-1-i.lastIndexOf("/")),n=c,o=0;continue}else if(i.length!==0){i="",r=0,n=c,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,c):i=t.slice(n+1,c),r=c-n-1;n=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Hs,"normalizeString");function pt(...t){let e="";for(let r of[...t.reverse(),Ld])if(r.length&&(e=`${r}/${e}`,r.startsWith("/")))break;let i=e.startsWith("/");return e=Hs(e,!i),i?`/${e}`:e.length?e:"/"}s(pt,"resolve");function Bd(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=Hs(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}s(Bd,"normalize");function $(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Bd(e):"."}s($,"join");function I(t){if(t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(I,"dirname");function z(t,e){let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let c=t.length-1;c>=0;--c)if(t[c]==="/"){if(!n){i=c+1;break}}else a===-1&&(n=!1,a=c+1),o>=0&&(t[c]===e[o]?--o===-1&&(r=c):(o=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":t.slice(i,r)}s(z,"basename");function _r(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let r=e?1:0,n=-1,o=0,a=-1,c=!0,l=t.length-1,f=0;for(;l>=r;--l){if(t[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t[l]==="."?n===-1?n=l:f!==1&&(f=1):n!==-1&&(f=-1)}if(a!==-1){let d=o===0&&e?1:o;n===-1||f===0||f===1&&n===a-1&&n===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,n),i.base=t.slice(d,a),i.ext=t.slice(n,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(_r,"parse");var ie=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Ln}}constructor(...e){}async ready(){}async exists(e,i){try{return await this.stat(e,i),!0}catch(r){return r.code!="ENOENT"}}existsSync(e,i){try{return this.statSync(e,i),!0}catch(r){return r.code!="ENOENT"}}};function Dd(t){class e extends t{static{s(this,"SyncFS")}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,o){return this.renameSync(r,n,o)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,o,a){return this.createFileSync(r,n,o,a)}async openFile(r,n,o){return this.openFileSync(r,n,o)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,o){return this.mkdirSync(r,n,o)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,o){return this.linkSync(r,n,o)}async sync(r,n,o){return this.syncSync(r,n,o)}}return e}s(Dd,"Sync");function Bn(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let o=s(()=>this._queueRunning?setTimeout(o):n(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}}}checkSync(n,o){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",n,o);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",n,o)}renameSync(n,o,a){this.checkSync(n,"rename"),this._sync.renameSync(n,o,a),this.queue("rename",n,o,a)}statSync(n,o){return this.checkSync(n,"stat"),this._sync.statSync(n,o)}createFileSync(n,o,a,c){return this.checkSync(n,"createFile"),this._sync.createFileSync(n,o,a,c),this.queue("createFile",n,o,a,c),this.openFileSync(n,o,c)}openFileSync(n,o,a){this.checkSync(n,"openFile");let c=this._sync.openFileSync(n,o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new pe(this,n,o,l,f)}unlinkSync(n,o){this.checkSync(n,"unlinkSync"),this._sync.unlinkSync(n,o),this.queue("unlink",n,o)}rmdirSync(n,o){this.checkSync(n,"rmdir"),this._sync.rmdirSync(n,o),this.queue("rmdir",n,o)}mkdirSync(n,o,a){this.checkSync(n,"mkdir"),this._sync.mkdirSync(n,o,a),this.queue("mkdir",n,o,a)}readdirSync(n,o){return this.checkSync(n,"readdir"),this._sync.readdirSync(n,o)}linkSync(n,o,a){this.checkSync(n,"link"),this._sync.linkSync(n,o,a),this.queue("link",n,o,a)}syncSync(n,o,a){this.checkSync(n,"sync"),this._sync.syncSync(n,o,a),this.queue("sync",n,o,a)}existsSync(n,o){return this.checkSync(n,"exists"),this._sync.existsSync(n,o)}async crossCopy(n){this.checkSync(n,"crossCopy");let o=await this.stat(n,We);if(o.isDirectory()){if(n!=="/"){let m=await this.stat(n,We);this._sync.mkdirSync(n,m.mode,m.cred())}let h=await this.readdir(n,We);for(let m of h)await this.crossCopy($(n,m))}else{var a=[];try{let h=x(a,await this.openFile(n,D("r"),We),!0);let m=x(a,this._sync.createFileSync(n,D("w"),o.mode,o.cred()));let b=new Uint8Array(o.size);await h.read(b);m.writeSync(b,0,o.size)}catch(c){var l=c,f=!0}finally{var d=k(a,l,f);d&&await d}}}async _next(){if(!this._queueRunning)return;let[n,...o]=this._queue.shift();await this[n](...o),await this._next()}queue(...n){this._queue.push(n),this._next()}}return e}s(Bn,"Async");function Dn(t){class e extends t{static{s(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new u(30)}renameSync(r,n,o){throw new u(30)}async createFile(r,n,o,a){throw new u(30)}createFileSync(r,n,o,a){throw new u(30)}async unlink(r,n){throw new u(30)}unlinkSync(r,n){throw new u(30)}async rmdir(r,n){throw new u(30)}rmdirSync(r,n){throw new u(30)}async mkdir(r,n,o){throw new u(30)}mkdirSync(r,n,o){throw new u(30)}async link(r,n,o){throw new u(30)}linkSync(r,n,o){throw new u(30)}async sync(r,n,o){throw new u(30)}syncSync(r,n,o){throw new u(30)}}return e}s(Dn,"Readonly");function Gs(t,e,i,r){r.existsSync(t,i)||(Gs(I(t),e,i,r),r.mkdirSync(t,e,i))}s(Gs,"mkdirpSync");function Er(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(Er,"_min");function Mn(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,r=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(n+m),o[m]=++m;let a,c,l,f,d;for(a=0;a+3<r;){let m=e.charCodeAt(n+(c=a)),b=e.charCodeAt(n+(l=a+1)),w=e.charCodeAt(n+(f=a+2)),g=e.charCodeAt(n+(d=a+3)),A=a+=4;for(let E=0;E<i;){let C=o[i+E],q=o[E];c=Er(q,c,l,m,C),l=Er(c,l,f,b,C),f=Er(l,f,d,w,C),A=Er(f,d,A,g,C),o[E++]=A,d=f,f=l,l=c,c=q}}let h=0;for(;a<r;){let m=e.charCodeAt(n+(c=a));h=++a;for(let b=0;b<i;b++){let w=o[b];o[b]=h=w<c||h<c?w>h?h+1:w+1:m===o[i+b]?c:c+1,c=w}}return h}s(Mn,"levenshtein");var Md=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Pe(t){if(typeof t!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Pe,"encode");function ei(t){if(!(t instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(ei,"decode");function xr(t){return JSON.parse(ei(t),(e,i)=>e==""?i:BigInt(i))}s(xr,"decodeDirListing");function we(t){return Pe(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(we,"encodeDirListing");function Ud(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")}s(Ud,"_toUnixTimestamp");function Se(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new u(22,"Invalid mode: "+t?.toString())}s(Se,"normalizeMode");function Ot(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new u(22,"Invalid time.")}s(Ot,"normalizeTime");function _(t){if(t=t.toString(),t.includes("\0"))throw new u(22,"Path can not contain null character");if(t.length==0)throw new u(22,"Path can not be empty");return pt(t.replaceAll(/[/\\]+/g,"/"))}s(_,"normalizePath");function _e(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:Se("mode"in t?t?.mode:null,r)}}s(_e,"normalizeOptions");function S(){}s(S,"nop");var Ks=5,Mi=class extends ie{constructor(i){super();this.store=i;this._initialized=!1}static{s(this,"StoreFS")}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,r,n){let o=this.store.transaction(),a=I(i),c=z(i),l=I(r),f=z(r),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,n))throw u.With("EACCES",i,"rename");if(!h[c])throw u.With("ENOENT",i,"rename");let m=h[c];if(delete h[c],(l+"/").indexOf(i+"/")===0)throw new u(16,a);let b,w;if(l===a?(b=d,w=h):(b=await this.findINode(o,l),w=await this.getDirListing(o,b,l)),w[f]){let g=await this.getINode(o,w[f],r);if(g.toStats().isFile())try{await o.remove(g.ino),await o.remove(w[f])}catch(A){throw await o.abort(),A}else throw u.With("EPERM",r,"rename")}w[f]=m;try{await o.set(d.ino,we(h)),await o.set(b.ino,we(w))}catch(g){throw await o.abort(),g}await o.commit()}renameSync(i,r,n){let o=this.store.transaction(),a=I(i),c=z(i),l=I(r),f=z(r),d=this.findINodeSync(o,a),h=this.getDirListingSync(o,d,a);if(!d.toStats().hasAccess(2,n))throw u.With("EACCES",i,"rename");if(!h[c])throw u.With("ENOENT",i,"rename");let m=h[c];if(delete h[c],(l+"/").indexOf(i+"/")==0)throw new u(16,a);let b,w;if(l===a?(b=d,w=h):(b=this.findINodeSync(o,l),w=this.getDirListingSync(o,b,l)),w[f]){let g=this.getINodeSync(o,w[f],r);if(g.toStats().isFile())try{o.removeSync(g.ino),o.removeSync(w[f])}catch(A){throw o.abortSync(),A}else throw u.With("EPERM",r,"rename")}w[f]=m;try{o.setSync(d.ino,we(h)),o.setSync(b.ino,we(w))}catch(g){throw o.abortSync(),g}o.commitSync()}async stat(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o)throw u.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,r))throw u.With("EACCES",i,"stat");return a}statSync(i,r){let n=this.findINodeSync(this.store.transaction(),i).toStats();if(!n.hasAccess(4,r))throw u.With("EACCES",i,"stat");return n}async createFile(i,r,n,o){let a=new Uint8Array(0),c=await this.commitNew(this.store.transaction(),i,32768,n,o,a);return new pe(this,i,r,c.toStats(),a)}createFileSync(i,r,n,o){return this.commitNewSync(i,32768,n,o),this.openFileSync(i,r,o)}async openFile(i,r,n){let o=this.store.transaction(),a=await this.findINode(o,i),c=await o.get(a.ino);if(!a.toStats().hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");if(!c)throw u.With("ENOENT",i,"openFile");return new pe(this,i,r,a.toStats(),c)}openFileSync(i,r,n){let o=this.store.transaction(),a=this.findINodeSync(o,i),c=o.getSync(a.ino);if(!a.toStats().hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");if(!c)throw u.With("ENOENT",i,"openFile");return new pe(this,i,r,a.toStats(),c)}async unlink(i,r){return this.remove(i,!1,r)}unlinkSync(i,r){this.removeSync(i,!1,r)}async rmdir(i,r){if((await this.readdir(i,r)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,r)}rmdirSync(i,r){if(this.readdirSync(i,r).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,r)}async mkdir(i,r,n){let o=this.store.transaction(),a=Pe("{}");await this.commitNew(o,i,16384,r,n,a)}mkdirSync(i,r,n){this.commitNewSync(i,16384,r,n,Pe("{}"))}async readdir(i,r){let n=this.store.transaction(),o=await this.findINode(n,i);if(!o.toStats().hasAccess(4,r))throw u.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(n,o,i))}readdirSync(i,r){let n=this.store.transaction(),o=this.findINodeSync(n,i);if(!o.toStats().hasAccess(4,r))throw u.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(n,o,i))}async sync(i,r,n){let o=this.store.transaction(),a=await this._findINode(o,I(i),z(i)),c=await this.getINode(o,a,i),l=c.update(n);try{await o.set(c.ino,r),l&&await o.set(a,c.data)}catch(f){throw await o.abort(),f}await o.commit()}syncSync(i,r,n){let o=this.store.transaction(),a=this._findINodeSync(o,I(i),z(i)),c=this.getINodeSync(o,a,i),l=c.update(n);try{o.setSync(c.ino,r),l&&o.setSync(a,c.data)}catch(f){throw o.abortSync(),f}o.commitSync()}async link(i,r,n){let o=this.store.transaction(),a=I(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,n))throw u.With("EACCES",a,"link");let l=I(r),f=await this.findINode(o,l),d=await this.getDirListing(o,f,l);if(!f.toStats().hasAccess(2,n))throw u.With("EACCES",l,"link");let h=await this._findINode(o,a,z(i)),m=await this.getINode(o,h,i);if(!m.toStats().hasAccess(2,n))throw u.With("EACCES",r,"link");m.nlink++,d[z(r)]=h;try{o.setSync(h,m.data),o.setSync(f.ino,we(d))}catch(b){throw o.abortSync(),b}o.commitSync()}linkSync(i,r,n){let o=this.store.transaction(),a=I(i);if(!this.findINodeSync(o,a).toStats().hasAccess(4,n))throw u.With("EACCES",a,"link");let l=I(r),f=this.findINodeSync(o,l),d=this.getDirListingSync(o,f,l);if(!f.toStats().hasAccess(2,n))throw u.With("EACCES",l,"link");let h=this._findINodeSync(o,a,z(i)),m=this.getINodeSync(o,h,i);if(!m.toStats().hasAccess(2,n))throw u.With("EACCES",r,"link");m.nlink++,d[z(r)]=h;try{o.setSync(h,m.data),o.setSync(f.ino,we(d))}catch(b){throw o.abortSync(),b}o.commitSync()}async checkRoot(){let i=this.store.transaction();if(await i.get(Ue))return;let r=new Me;r.mode=16895,await i.set(r.ino,Pe("{}")),await i.set(Ue,r.data),await i.commit()}checkRootSync(){let i=this.store.transaction();if(i.getSync(Ue))return;let r=new Me;r.mode=16895,i.setSync(r.ino,Pe("{}")),i.setSync(Ue,r.data),i.commitSync()}async _findINode(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return Ue;let c=r=="/"?await this.getINode(i,Ue,r):await this.findINode(i,r,o),l=await this.getDirListing(i,c,r);if(!(n in l))throw u.With("ENOENT",pt(r,n),"_findINode");return l[n]}_findINodeSync(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return Ue;let c=r=="/"?this.getINodeSync(i,Ue,r):this.findINodeSync(i,r,o),l=this.getDirListingSync(i,c,r);if(!(n in l))throw u.With("ENOENT",pt(r,n),"_findINode");return l[n]}async findINode(i,r,n=new Set){let o=await this._findINode(i,I(r),z(r),n);return this.getINode(i,o,r)}findINodeSync(i,r,n=new Set){let o=this._findINodeSync(i,I(r),z(r),n);return this.getINodeSync(i,o,r)}async getINode(i,r,n){let o=await i.get(r);if(!o)throw u.With("ENOENT",n,"getINode");return new Me(o.buffer)}getINodeSync(i,r,n){let o=i.getSync(r);if(!o)throw u.With("ENOENT",n,"getINode");return new Me(o.buffer)}async getDirListing(i,r,n){if(!r.toStats().isDirectory())throw u.With("ENOTDIR",n,"getDirListing");let o=await i.get(r.ino);if(!o)throw u.With("ENOENT",n,"getDirListing");return xr(o)}getDirListingSync(i,r,n){if(!r.toStats().isDirectory())throw u.With("ENOTDIR",n,"getDirListing");let o=i.getSync(r.ino);if(!o)throw u.With("ENOENT",n,"getDirListing");return xr(o)}async addNew(i,r,n){for(let o=0;o<Ks;o++){let a=Li();if(!await i.get(a))return await i.set(a,r),a}throw new u(28,"No inode IDs available",n,"addNewNode")}addNewSync(i,r,n){for(let o=0;o<Ks;o++){let a=Li();if(!i.getSync(a))return i.setSync(a,r),a}throw new u(28,"No inode IDs available",n,"addNewNode")}async commitNew(i,r,n,o,a,c){let l=I(r),f=await this.findINode(i,l);if(!f.toStats().hasAccess(2,a))throw u.With("EACCES",r,"commitNewFile");let d=z(r),h=await this.getDirListing(i,f,l);if(r==="/")throw u.With("EEXIST",r,"commitNewFile");if(h[d])throw await i.abort(),u.With("EEXIST",r,"commitNewFile");try{let m=new Me;return m.ino=await this.addNew(i,c,r),m.mode=o|n,m.uid=a.uid,m.gid=a.gid,m.size=c.length,h[d]=await this.addNew(i,m.data,r),await i.set(f.ino,we(h)),await i.commit(),m}catch(m){throw await i.abort(),m}}commitNewSync(i,r,n,o,a=new Uint8Array){let c=this.store.transaction(),l=I(i),f=this.findINodeSync(c,l);if(!f.toStats().hasAccess(2,o))throw u.With("EACCES",i,"commitNewFile");let d=z(i),h=this.getDirListingSync(c,f,l);if(i==="/")throw u.With("EEXIST",i,"commitNewFile");if(h[d])throw u.With("EEXIST",i,"commitNewFile");let m=new Me;try{m.ino=this.addNewSync(c,a,i),m.size=a.length,m.mode=n|r,m.uid=o.uid,m.gid=o.gid,h[d]=this.addNewSync(c,m.data,i),c.setSync(f.ino,we(h))}catch(b){throw c.abortSync(),b}return c.commitSync(),m}async remove(i,r,n){let o=this.store.transaction(),a=I(i),c=await this.findINode(o,a),l=await this.getDirListing(o,c,a),f=z(i);if(!l[f])throw u.With("ENOENT",i,"removeEntry");let d=l[f],h=await this.getINode(o,d,i);if(!h.toStats().hasAccess(2,n))throw u.With("EACCES",i,"removeEntry");if(delete l[f],!r&&h.toStats().isDirectory())throw u.With("EISDIR",i,"removeEntry");if(r&&!h.toStats().isDirectory())throw u.With("ENOTDIR",i,"removeEntry");try{await o.set(c.ino,we(l)),--h.nlink<1&&(await o.remove(h.ino),await o.remove(d))}catch(m){throw await o.abort(),m}await o.commit()}removeSync(i,r,n){let o=this.store.transaction(),a=I(i),c=this.findINodeSync(o,a),l=this.getDirListingSync(o,c,a),f=z(i),d=l[f];if(!d)throw u.With("ENOENT",i,"removeEntry");let h=this.getINodeSync(o,d,i);if(!h.toStats().hasAccess(2,n))throw u.With("EACCES",i,"removeEntry");if(delete l[f],!r&&h.toStats().isDirectory())throw u.With("EISDIR",i,"removeEntry");if(r&&!h.toStats().isDirectory())throw u.With("ENOTDIR",i,"removeEntry");try{o.setSync(c.ino,we(l)),--h.nlink<1&&(o.removeSync(h.ino),o.removeSync(d))}catch(m){throw o.abortSync(),m}o.commitSync()}};var Ui=class{constructor(e){this.store=e;this.aborted=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.aborted||await this.commit()}[Symbol.dispose](){this.aborted||this.commitSync()}},Wi=class extends Ui{static{s(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},Un=class extends Ui{static{s(this,"AsyncTransaction")}getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var Wn=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(e){return this.cache.get(e)}set(e,i){this.cache.set(e,i),this.queue.add(this._set(e,i))}delete(e){this.cache.delete(e),this.queue.add(this._delete(e))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[e,i]of await this.entries())this.cache.has(e)||this.cache.set(e,i);for(let e of this.queue)await e}transaction(){return new ti(this)}},ti=class extends Wi{constructor(i){super(i);this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let r=this.store.get(i);return this.stashOldValue(i,r),r}setSync(i,r){return this.markModified(i),this.store.set(i,r)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){}abortSync(){for(let i of this.modifiedKeys){let r=this.originalData.get(i);r?this.store.set(i,r):this.store.delete(i)}}stashOldValue(i,r){this.originalData.has(i)||this.originalData.set(i,r)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var kr=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new ti(this)}},ji={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:t}){let e=new Mi(new kr(t));return e.checkRootSync(),e},"create")};function Wd(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}s(Wd,"isFileData");function jn(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}s(jn,"isMessage");var ii=new Map;function qn(t,{port:e,timeout:i=1e3,fs:r}={}){let n=new Error().stack.slice(6);if(!e)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ii.set(c,{resolve:o,reject:a,fs:r}),e.postMessage({...t,_zenfs:!0,id:c,stack:n});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=n,a(f),typeof l=="object"&&l.unref()},i)})}s(qn,"request");function Ys(t){if(!jn(t))return;let{id:e,value:i,error:r,stack:n}=t;if(!ii.has(e)){let l=new u(5,"Invalid RPC id:"+e);throw l.stack+=n,l}let{resolve:o,reject:a,fs:c}=ii.get(e);if(r){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=n,a(l),ii.delete(e);return}if(Wd(i)){let{fd:l,path:f,position:d}=i,h=new qi(c,l,f,d);o(h),ii.delete(e);return}o(i),ii.delete(e)}s(Ys,"handleResponse");function vr(t,e){if(!t)throw u.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}s(vr,"attach");function $n(t,e){if(!t)throw u.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}s($n,"detach");function Xs(t){let e=[],i=e.push.bind(e);return vr(t,i),function(r){$n(t,i);for(let n of e){let o="data"in n?n.data:n;$i(t,r,o)}}}s(Xs,"catchMessages");function zi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(zi,"isBackend");async function zn(t,e){if(typeof e!="object"||e===null)throw new u(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(c=>!(c in t.options)).map(c=>({str:c,distance:Mn(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new u(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}`);r.validator&&await r.validator(n)}}s(zn,"checkOptions");function Vi(t){return t!=null&&typeof t=="object"&&"backend"in t&&zi(t.backend)}s(Vi,"isBackendConfig");var mr={};wr(mr,{BigIntStatsFs:()=>Ni,Dir:()=>wt,Dirent:()=>gt,ReadStream:()=>kt,Stats:()=>X,StatsFs:()=>Ri,WriteStream:()=>vt,access:()=>Tu,accessSync:()=>Ba,appendFile:()=>au,appendFileSync:()=>Ea,chmod:()=>Fu,chmodSync:()=>Ra,chown:()=>ku,chownSync:()=>Ta,close:()=>lu,closeSync:()=>bt,constants:()=>It,copyFile:()=>Uu,copyFileSync:()=>so,cp:()=>$u,cpSync:()=>ao,createReadStream:()=>Lu,createWriteStream:()=>Bu,exists:()=>Zf,existsSync:()=>ze,fchmod:()=>mu,fchmodSync:()=>Rr,fchown:()=>yu,fchownSync:()=>Cr,fdatasync:()=>du,fdatasyncSync:()=>Fa,fstat:()=>cu,fstatSync:()=>xa,fsync:()=>uu,fsyncSync:()=>va,ftruncate:()=>fu,ftruncateSync:()=>ka,futimes:()=>bu,futimesSync:()=>Nr,lchmod:()=>Iu,lchmodSync:()=>Na,lchown:()=>vu,lchownSync:()=>Ca,link:()=>_u,linkSync:()=>Aa,lopenSync:()=>Ji,lstat:()=>tu,lstatSync:()=>to,lutimes:()=>Au,lutimesSync:()=>La,mkdir:()=>wu,mkdirSync:()=>Lr,mkdtemp:()=>Mu,mkdtempSync:()=>Da,mount:()=>Nt,mountObject:()=>Ki,mounts:()=>ke,open:()=>nu,openAsBlob:()=>Vu,openSync:()=>Xi,opendir:()=>qu,opendirSync:()=>Wa,promises:()=>yr,read:()=>pu,readFile:()=>ou,readFileSync:()=>Tr,readSync:()=>Pa,readdir:()=>Su,readdirSync:()=>ci,readlink:()=>xu,readlinkSync:()=>ro,readv:()=>Wu,readvSync:()=>Ma,realpath:()=>Ou,realpathSync:()=>$e,rename:()=>Qf,renameSync:()=>wa,rm:()=>Du,rmSync:()=>oo,rmdir:()=>gu,rmdirSync:()=>io,stat:()=>eu,statSync:()=>Yi,statfs:()=>zu,statfsSync:()=>ja,symlink:()=>Eu,symlinkSync:()=>Oa,truncate:()=>iu,truncateSync:()=>Sa,umount:()=>ai,unlink:()=>ru,unlinkSync:()=>Or,unwatchFile:()=>Ru,utimes:()=>Pu,utimesSync:()=>no,watch:()=>Nu,watchFile:()=>Cu,write:()=>hu,writeFile:()=>su,writeFileSync:()=>Qi,writeSync:()=>Ia,writev:()=>ju,writevSync:()=>Ua});var Ds=Sr(xe(),1);var yr={};wr(yr,{FileHandle:()=>oe,access:()=>Rs,appendFile:()=>vs,chmod:()=>Os,chown:()=>Ps,constants:()=>It,copyFile:()=>xn,cp:()=>kn,exists:()=>Ce,lchmod:()=>Ts,lchown:()=>As,link:()=>Fs,lstat:()=>gn,lutimes:()=>Cs,mkdir:()=>pr,mkdtemp:()=>Ns,open:()=>ye,opendir:()=>Ls,readFile:()=>hr,readdir:()=>Bt,readlink:()=>Sn,realpath:()=>Te,rename:()=>xs,rm:()=>En,rmdir:()=>wn,stat:()=>ki,statfs:()=>Bs,symlink:()=>Is,truncate:()=>ks,unlink:()=>dr,utimes:()=>_n,watch:()=>Vg,writeFile:()=>Fi});var Yt=Sr(xe(),1);var mt=Sr(xe(),1);var v=We;function ga(t){v=t}s(ga,"setCred");var Rt=new Map,Sh=100;function Gi(t){let e=Sh++;return Rt.set(e,t),e}s(Gi,"file2fd");function U(t){if(!Rt.has(t))throw new u(9);return Rt.get(t)}s(U,"fd2file");var ke=new Map;Nt("/",ji.create({name:"root"}));function Nt(t,e){if(t[0]!=="/"&&(t="/"+t),t=pt(t),ke.has(t))throw new u(22,"Mount point "+t+" is already in use.");ke.set(t,e)}s(Nt,"mount");function ai(t){if(t[0]!=="/"&&(t=`/${t}`),t=pt(t),!ke.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");ke.delete(t)}s(ai,"umount");function R(t){t=_(t);let e=[...ke].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function ba(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(ba,"fixPaths");function Y(t,e){return typeof t.stack=="string"&&(t.stack=ba(t.stack,e)),t.message=ba(t.message,e),t}s(Y,"fixError");function Ki(t){"/"in t&&ai("/");for(let[e,i]of Object.entries(t))Nt(e,i)}s(Ki,"mountObject");function Ar(t,e){let i=t.metadata(),r=i.blockSize||4096;return{type:(e?BigInt:Number)(i.type),bsize:(e?BigInt:Number)(r),ffree:(e?BigInt:Number)(i.freeNodes||ge),files:(e?BigInt:Number)(i.totalNodes||ge),bavail:(e?BigInt:Number)(i.freeSpace/r),bfree:(e?BigInt:Number)(i.freeSpace/r),blocks:(e?BigInt:Number)(i.totalSpace/r)}}s(Ar,"_statfs");function wa(t,e){t=_(t),e=_(e);let i=R(t),r=R(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,v);Qi(e,Tr(t)),Or(t)}catch(o){throw Y(o,n)}}s(wa,"renameSync");function ze(t){t=_(t);try{let{fs:e,path:i}=R($e(t));return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(ze,"existsSync");function Yi(t,e){t=_(t);let{fs:i,path:r}=R(ze(t)?$e(t):t);try{let n=i.statSync(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(Yi,"statSync");function to(t,e){t=_(t);let{fs:i,path:r}=R(t);try{let n=i.statSync(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(to,"lstatSync");function Sa(t,e=0){var r=[];try{let i=x(r,Lt(t,"r+"));e||=0;if(e<0)throw new u(22);i.truncateSync(e)}catch(n){var o=n,a=!0}finally{k(r,o,a)}}s(Sa,"truncateSync");function Or(t){t=_(t);let{fs:e,path:i}=R(t);try{return e.unlinkSync(i,v)}catch(r){throw Y(r,{[i]:t})}}s(Or,"unlinkSync");function Lt(t,e,i,r=!0){t=_(t);let n=Se(i,420),o=D(e);t=r&&ze(t)?$e(t):t;let{fs:a,path:c}=R(t);if(!a.existsSync(c,v)){if(!he(o)&&!nt(o)||o=="r+")throw u.With("ENOENT",t,"_open");if(!a.statSync(I(c),v).isDirectory())throw u.With("ENOTDIR",I(t),"_open");return a.createFileSync(c,o,n,v)}let l=a.statSync(c,v);if(!l.hasAccess(n,v))throw u.With("EACCES",t,"_open");if(Di(o))throw u.With("EEXIST",t,"_open");return Bi(o)?(a.unlinkSync(c,v),a.createFileSync(c,o,l.mode,v)):a.openFileSync(c,o,v)}s(Lt,"_openSync");function Xi(t,e,i=0){return Gi(Lt(t,e,i,!0))}s(Xi,"openSync");function Ji(t,e,i){return Gi(Lt(t,e,i,!1))}s(Ji,"lopenSync");function _a(t,e,i){var a=[];try{let r=x(a,Lt(t,e,420,i));let n=r.statSync();let o=new Uint8Array(n.size);r.readSync(o,0,n.size,0);r.closeSync();return o}catch(c){var l=c,f=!0}finally{k(a,l,f)}}s(_a,"_readFileSync");function Tr(t,e={}){let i=_e(e,null,"r",420),r=D(i.flag);if(!ht(r))throw new u(22,"Flag passed to readFile must allow for reading.");let n=mt.Buffer.from(_a(typeof t=="number"?U(t).path:t.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Tr,"readFileSync");function Qi(t,e,i={}){var c=[];try{let r=_e(i,"utf8","w+",420);let n=D(r.flag);if(!he(n))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new u(22,"Data not specified");let a=x(c,Lt(typeof t=="number"?U(t).path:t.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength,0)}catch(l){var f=l,d=!0}finally{k(c,f,d)}}s(Qi,"writeFileSync");function Ea(t,e,i={}){var c=[];try{let r=_e(i,"utf8","a",420);let n=D(r.flag);if(!nt(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=x(c,Lt(typeof t=="number"?U(t).path:t.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{k(c,f,d)}}s(Ea,"appendFileSync");function xa(t,e){let i=U(t).statSync();return e?.bigint?new de(i):i}s(xa,"fstatSync");function bt(t){U(t).closeSync(),Rt.delete(t)}s(bt,"closeSync");function ka(t,e=0){if(e||=0,e<0)throw new u(22);U(t).truncateSync(e)}s(ka,"ftruncateSync");function va(t){U(t).syncSync()}s(va,"fsyncSync");function Fa(t){U(t).datasyncSync()}s(Fa,"fdatasyncSync");function Ia(t,e,i,r,n){let o,a,c,l;if(typeof e=="string"){l=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=mt.Buffer.from(e,d),c=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,l=typeof n=="number"?n:null;let f=U(t);return l??=f.position,f.writeSync(o,a,c,l)}s(Ia,"writeSync");function Pa(t,e,i,r,n){let o=U(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=o.position),o.readSync(e,a,r,n)}s(Pa,"readSync");function Cr(t,e,i){U(t).chownSync(e,i)}s(Cr,"fchownSync");function Rr(t,e){let i=Se(e,-1);if(i<0)throw new u(22,"Invalid mode.");U(t).chmodSync(i)}s(Rr,"fchmodSync");function Nr(t,e,i){U(t).utimesSync(Ot(e),Ot(i))}s(Nr,"futimesSync");function io(t){t=_(t);let{fs:e,path:i}=R(ze(t)?$e(t):t);try{e.rmdirSync(i,v)}catch(r){throw Y(r,{[i]:t})}}s(io,"rmdirSync");function Lr(t,e){e=typeof e=="object"?e:{mode:e};let i=Se(e?.mode,511);t=_(t),t=ze(t)?$e(t):t;let{fs:r,path:n}=R(t),o={[n]:t};try{if(!e?.recursive)return r.mkdirSync(n,i,v);let a=[];for(let c=n,l=t;!r.existsSync(c,v);c=I(c),l=I(l))a.unshift(c),o[c]=l;for(let c of a)r.mkdirSync(c,i,v);return a[0]}catch(a){throw Y(a,o)}}s(Lr,"mkdirSync");function ci(t,e){t=_(t);let{fs:i,path:r}=R(ze(t)?$e(t):t),n;try{n=i.readdirSync(r,v)}catch(o){throw Y(o,{[r]:t})}for(let o of ke.keys()){if(!o.startsWith(t))continue;let a=o.slice(t.length);a.includes("/")||a.length==0||n.push(a)}return n.map(o=>typeof e=="object"&&e?.withFileTypes?new gt(o,Yi($(t.toString(),o))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?mt.Buffer.from(o):o)}s(ci,"readdirSync");function Aa(t,e){t=_(t),e=_(e);let{fs:i,path:r}=R(t);try{return i.linkSync(r,e,v)}catch(n){throw Y(n,{[r]:t})}}s(Aa,"linkSync");function Oa(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(ze(e))throw u.With("EEXIST",e.toString(),"symlink");Qi(e,t.toString()),Lt(e,"r+",420,!1)._setTypeSync(40960)}s(Oa,"symlinkSync");function ro(t,e){let i=mt.Buffer.from(_a(t.toString(),"r",!1)),r=typeof e=="object"?e?.encoding:e;return r=="buffer"?i:i.toString(r)}s(ro,"readlinkSync");function Ta(t,e,i){let r=Xi(t,"r+");Cr(r,e,i),bt(r)}s(Ta,"chownSync");function Ca(t,e,i){let r=Ji(t,"r+");Cr(r,e,i),bt(r)}s(Ca,"lchownSync");function Ra(t,e){let i=Xi(t,"r+");Rr(i,e),bt(i)}s(Ra,"chmodSync");function Na(t,e){let i=Ji(t,"r+");Rr(i,e),bt(i)}s(Na,"lchmodSync");function no(t,e,i){let r=Xi(t,"r+");Nr(r,e,i),bt(r)}s(no,"utimesSync");function La(t,e,i){let r=Ji(t,"r+");Nr(r,e,i),bt(r)}s(La,"lutimesSync");function $e(t,e){t=_(t);let{base:i,dir:r}=_r(t),n=$(r=="/"?"/":$e(r),i),{fs:o,path:a,mountPoint:c}=R(n);try{return o.statSync(a,v).isSymbolicLink()?$e(c+ro(n,e).toString()):n}catch(l){throw Y(l,{[a]:n})}}s($e,"realpathSync");function Ba(t,e=384){if(!Yi(t).hasAccess(e,v))throw new u(13)}s(Ba,"accessSync");function oo(t,e){switch(t=_(t),Yi(t).mode&61440){case 16384:if(e?.recursive)for(let r of ci(t))oo($(t,r));io(t);return;case 32768:case 40960:Or(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}s(oo,"rmSync");function Da(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Lr(n),i=="buffer"?mt.Buffer.from(n):n}s(Da,"mkdtempSync");function so(t,e,i){if(t=_(t),e=_(e),i&&i&1&&ze(e))throw new u(17,"Destination file already exists.",e,"copyFile");Qi(e,Tr(t))}s(so,"copyFileSync");function Ma(t,e,i){let r=U(t),n=0;for(let o of e)n+=r.readSync(o,0,o.byteLength,i+n);return n}s(Ma,"readvSync");function Ua(t,e,i){let r=U(t),n=0;for(let o of e)n+=r.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+n);return n}s(Ua,"writevSync");function Wa(t,e){return t=_(t),new wt(t)}s(Wa,"opendirSync");function ao(t,e,i){t=_(t),e=_(e);let r=to(t);if(i?.errorOnExist&&ze(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");Lr(e,{recursive:!0});for(let n of ci(t,{withFileTypes:!0}))i.filter&&!i.filter($(t,n.name),$(e,n.name))||ao($(t,n.name),$(e,n.name),i);break;case 32768:case 40960:so(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&no(e,r.atime,r.mtime)}s(ao,"cpSync");function ja(t,e){t=_(t);let{fs:i}=R(t);return Ar(i,e?.bigint)}s(ja,"statfsSync");var gt=class{constructor(e,i){this.path=e;this.stats=i}static{s(this,"Dirent")}get name(){return z(this.path)}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}},wt=class{constructor(e){this.path=e;this.closed=!1;this._entries=[]}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Bt(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this._entries||(this._entries=ci(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})},"next")}}};var bn=Sr(Jf(),1);var kt=class extends bn.Readable{static{s(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}},vt=class extends bn.Writable{static{s(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}};var oe=class{static{s(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?Gi(e):e,this.file=i?e:U(e)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=Se(e,-1);if(i<0)throw new u(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e||=0,e<0)throw new u(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Ot(e),Ot(i))}async appendFile(e,i={}){let r=_e(i,"utf8","a",420),n=D(r.flag);if(!nt(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?Yt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length)}read(e,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(e,i,r,n)}async readFile(e){let i=_e(e,null,"r",292),r=D(i.flag);if(!ht(r))throw new u(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(n),0,n,0),a=Yt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async n=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){n.close();return}if(n.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){n.error(o)}},"start"),r=globalThis;if(!("ReadableStream"in r))throw new u(38,"ReadableStream is missing on globalThis");return new r.ReadableStream({start:i,type:e.type})}readLines(e){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new de(i):i}async write(e,i,r,n){let o,a,c;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,o=Yt.Buffer.from(e,f),c=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=r,n=typeof n=="number"?n:null;n??=this.file.position;let l=await this.file.write(o,a,c,n);return{buffer:o,bytesWritten:l}}async writeFile(e,i={}){let r=_e(i,"utf8","w",420),n=D(r.flag);if(!he(n))throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?Yt.Buffer.from(e,r.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Rt.delete(this.fd)}async writev(e,i){let r=0;for(let n of e)r+=(await this.write(n,0,n.length,i+r)).bytesWritten;return{bytesWritten:r,buffers:e}}async readv(e,i){let r=0;for(let n of e)r+=(await this.read(n,0,n.byteLength,i+r)).bytesRead;return{bytesRead:r,buffers:e}}createReadStream(e){let i=new kt({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:s(async r=>{try{let n=await this.read(new Uint8Array(r),0,r,this.file.position);i.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(n){i.destroy(n)}},"read")});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:s(async(n,o,a)=>{try{let{bytesWritten:c}=await this.write(n,null,o);a(c==n.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},r=new vt(i);return r.path=this.file.path,r}};async function xs(t,e){t=_(t),e=_(e);let i=R(t),r=R(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,v);return}await Fi(e,await hr(t)),await dr(t)}catch(n){throw Y(n,{[i.path]:t,[r.path]:e})}}s(xs,"rename");async function Ce(t){try{let{fs:e,path:i}=R(await Te(t));return await e.exists(i,v)}catch(e){if(e instanceof u&&e.code=="ENOENT")return!1;throw e}}s(Ce,"exists");async function ki(t,e){t=_(t);let{fs:i,path:r}=R(await Ce(t)?await Te(t):t);try{let n=await i.stat(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(ki,"stat");async function gn(t,e){t=_(t);let{fs:i,path:r}=R(t);try{let n=await i.stat(r,v);return e?.bigint?new de(n):n}catch(n){throw Y(n,{[r]:t})}}s(gn,"lstat");async function ks(t,e=0){var r=[];try{let i=x(r,await ye(t,"r+"),!0);await i.truncate(e)}catch(n){var o=n,a=!0}finally{var c=k(r,o,a);c&&await c}}s(ks,"truncate");async function dr(t){t=_(t);let{fs:e,path:i}=R(t);try{await e.unlink(i,v)}catch(r){throw Y(r,{[i]:t})}}s(dr,"unlink");async function vi(t,e,i=420,r){t=_(t);let n=Se(i,420),o=D(e);t=r&&await Ce(t)?await Te(t):t;let{fs:a,path:c}=R(t);if(!await a.exists(c,v)){if(!he(o)&&!nt(o)||o=="r+")throw u.With("ENOENT",t,"_open");let f=await a.stat(I(c),v);if(f&&!f.isDirectory())throw u.With("ENOTDIR",I(t),"_open");return new oe(await a.createFile(c,o,n,v))}if(Di(o))throw u.With("EEXIST",t,"_open");if(!Bi(o))return new oe(await a.openFile(c,o,v));let l=await a.openFile(c,o,v);return await l.truncate(0),await l.sync(),new oe(l)}s(vi,"_open");async function ye(t,e="r",i=420){return await vi(t,e,i,!0)}s(ye,"open");async function hr(t,e){var n=[];try{let i=_e(e,null,"r",420);let r=x(n,typeof t=="object"&&"fd"in t?t:await ye(t,i.flag,i.mode),!0);return await r.readFile(i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(hr,"readFile");async function Fi(t,e,i){var a=[];try{let r=_e(i,"utf8","w+",420);let n=x(a,t instanceof oe?t:await ye(t.toString(),r.flag,r.mode),!0);let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",n.file.path,"writeFile");await n.writeFile(o,r)}catch(c){var l=c,f=!0}finally{var d=k(a,l,f);d&&await d}}s(Fi,"writeFile");async function vs(t,e,i){var c=[];try{let r=_e(i,"utf8","a",420);let n=D(r.flag);if(!nt(n))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?Yt.Buffer.from(e,r.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=x(c,typeof t=="object"&&"fd"in t?t:await ye(t,r.flag,r.mode),!0);await a.appendFile(o,r)}catch(l){var f=l,d=!0}finally{var h=k(c,f,d);h&&await h}}s(vs,"appendFile");async function wn(t){t=_(t),t=await Ce(t)?await Te(t):t;let{fs:e,path:i}=R(t);try{await e.rmdir(i,v)}catch(r){throw Y(r,{[i]:t})}}s(wn,"rmdir");async function pr(t,e){e=typeof e=="object"?e:{mode:e};let i=Se(e?.mode,511);t=_(t),t=await Ce(t)?await Te(t):t;let{fs:r,path:n}=R(t),o={[n]:t};try{e?.recursive||await r.mkdir(n,i,v);let a=[];for(let c=n,l=t;!await r.exists(c,v);c=I(c),l=I(l))a.unshift(c),o[c]=l;for(let c of a)await r.mkdir(c,i,v);return a[0]}catch(a){throw Y(a,o)}}s(pr,"mkdir");async function Bt(t,e){t=_(t),t=await Ce(t)?await Te(t):t;let{fs:i,path:r}=R(t),n;try{n=await i.readdir(r,v)}catch(a){throw Y(a,{[r]:t})}for(let a of ke.keys())if(a.startsWith(t)){let c=a.slice(t.length);if(c.includes("/")||c.length==0)continue;n.push(c)}let o=[];for(let a of n)o.push(typeof e=="object"&&e?.withFileTypes?new gt(a,await ki($(t,a))):a);return o}s(Bt,"readdir");async function Fs(t,e){t=_(t),e=_(e);let{fs:i,path:r}=R(e);try{return await i.link(t,e,v)}catch(n){throw Y(n,{[r]:e})}}s(Fs,"link");async function Is(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await Ce(e))throw u.With("EEXIST",e.toString(),"symlink");await Fi(e,t.toString()),await(await vi(e,"r+",420,!1)).file._setType(40960)}s(Is,"symlink");async function Sn(t,e){var o=[];try{let i=x(o,await vi(_(t),"r",420,!1),!0);let r=await i.readFile();let n=typeof e=="object"?e?.encoding:e;return n=="buffer"?r:r.toString(n)}catch(a){var c=a,l=!0}finally{var f=k(o,c,l);f&&await f}}s(Sn,"readlink");async function Ps(t,e,i){var n=[];try{let r=x(n,await ye(t,"r+"),!0);await r.chown(e,i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(Ps,"chown");async function As(t,e,i){var n=[];try{let r=x(n,await vi(t,"r+",420,!1),!0);await r.chown(e,i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(As,"lchown");async function Os(t,e){var r=[];try{let i=x(r,await ye(t,"r+"),!0);await i.chmod(e)}catch(n){var o=n,a=!0}finally{var c=k(r,o,a);c&&await c}}s(Os,"chmod");async function Ts(t,e){var r=[];try{let i=x(r,await vi(t,"r+",420,!1),!0);await i.chmod(e)}catch(n){var o=n,a=!0}finally{var c=k(r,o,a);c&&await c}}s(Ts,"lchmod");async function _n(t,e,i){var n=[];try{let r=x(n,await ye(t,"r+"),!0);await r.utimes(e,i)}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(_n,"utimes");async function Cs(t,e,i){var n=[];try{let r=x(n,await vi(t,"r+",420,!1),!0);await r.utimes(new Date(e),new Date(i))}catch(o){var a=o,c=!0}finally{var l=k(n,a,c);l&&await l}}s(Cs,"lutimes");async function Te(t,e){t=_(t);let{base:i,dir:r}=_r(t),n=$(r=="/"?"/":await Te(r),i),{fs:o,path:a,mountPoint:c}=R(n);try{return(await o.stat(a,v)).isSymbolicLink()?Te(c+await Sn(n)):n}catch(l){throw Y(l,{[a]:n})}}s(Te,"realpath");function Vg(t,e={}){throw u.With("ENOSYS",t.toString(),"watch")}s(Vg,"watch");async function Rs(t,e=0){if(!(await ki(t)).hasAccess(e,v))throw new u(13)}s(Rs,"access");async function En(t,e){switch(t=_(t),(await ki(t)).mode&61440){case 16384:if(e?.recursive)for(let r of await Bt(t))await En($(t,r));await wn(t);return;case 32768:case 40960:await dr(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}s(En,"rm");async function Ns(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",n="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await pr(n),i=="buffer"?Yt.Buffer.from(n):n}s(Ns,"mkdtemp");async function xn(t,e,i){if(t=_(t),e=_(e),i&&i&1&&await Ce(e))throw new u(17,"Destination file already exists.",e,"copyFile");await Fi(e,await hr(t))}s(xn,"copyFile");async function Ls(t,e){return t=_(t),new wt(t)}s(Ls,"opendir");async function kn(t,e,i){t=_(t),e=_(e);let r=await gn(t);if(i?.errorOnExist&&await Ce(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");await pr(e,{recursive:!0});for(let n of await Bt(t,{withFileTypes:!0}))i.filter&&!i.filter($(t,n.name),$(e,n.name))||await kn($(t,n.name),$(e,n.name),i);break;case 32768:case 40960:await xn(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await _n(e,r.atime,r.mtime)}s(kn,"cp");async function Bs(t,e){t=_(t);let{fs:i}=R(t);return Ar(i,e?.bigint)}s(Bs,"statfs");function Qf(t,e,i=S){xs(t,e).then(()=>i()).catch(i)}s(Qf,"rename");function Zf(t,e=S){Ce(t).then(e).catch(()=>e(!1))}s(Zf,"exists");function eu(t,e,i=S){i=typeof e=="function"?e:i,ki(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(eu,"stat");function tu(t,e,i=S){i=typeof e=="function"?e:i,gn(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(tu,"lstat");function iu(t,e=0,i=S){i=typeof e=="function"?e:i,ks(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(iu,"truncate");function ru(t,e=S){dr(t).then(()=>e()).catch(e)}s(ru,"unlink");function nu(t,e,i,r=S){let n=Se(i,420);r=typeof i=="function"?i:r,ye(t,e,n).then(o=>r(void 0,o.fd)).catch(r)}s(nu,"open");function ou(t,e,i=S){i=typeof e=="function"?e:i,hr(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(ou,"readFile");function su(t,e,i,r=S){r=typeof i=="function"?i:r,Fi(t,e,typeof i!="function"?i:null).then(()=>r(void 0)).catch(r)}s(su,"writeFile");function au(t,e,i,r=S){let n=typeof i!="function"?i:void 0;r=typeof i=="function"?i:r,vs(t,e,n).then(()=>r()).catch(r)}s(au,"appendFile");function cu(t,e,i=S){i=typeof e=="function"?e:i,U(t).stat().then(r=>i(void 0,typeof e=="object"&&e?.bigint?new de(r):r)).catch(i)}s(cu,"fstat");function lu(t,e=S){new oe(t).close().then(()=>e()).catch(e)}s(lu,"close");function fu(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=U(t);if(r<0)throw new u(22);n.truncate(r).then(()=>i()).catch(i)}s(fu,"ftruncate");function uu(t,e=S){U(t).sync().then(()=>e()).catch(e)}s(uu,"fsync");function du(t,e=S){U(t).datasync().then(()=>e()).catch(e)}s(du,"fdatasync");function hu(t,e,i,r,n,o=S){let a,c,l,f,d,h=new oe(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof r=="string"?r:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof r=="function"?r:typeof n=="function"?n:o,o(new u(22,"Invalid arguments."));return}a=Ds.Buffer.from(e),c=0,l=a.length;let m=o;h.write(a,c,l,f).then(({bytesWritten:b})=>m(void 0,b,a.toString(d))).catch(m)}else{a=Ds.Buffer.from(e.buffer),c=i,l=r,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;h.write(a,c,l,f).then(({bytesWritten:b})=>m(void 0,b,a)).catch(m)}}s(hu,"write");function pu(t,e,i,r,n,o=S){new oe(t).read(e,i,r,n).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(pu,"read");function yu(t,e,i,r=S){new oe(t).chown(e,i).then(()=>r()).catch(r)}s(yu,"fchown");function mu(t,e,i){new oe(t).chmod(e).then(()=>i()).catch(i)}s(mu,"fchmod");function bu(t,e,i,r=S){new oe(t).utimes(e,i).then(()=>r()).catch(r)}s(bu,"futimes");function gu(t,e=S){wn(t).then(()=>e()).catch(e)}s(gu,"rmdir");function wu(t,e,i=S){pr(t,e).then(()=>i()).catch(i)}s(wu,"mkdir");function Su(t,e,i=S){i=typeof e=="function"?e:i,Bt(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(Su,"readdir");function _u(t,e,i=S){Fs(t,e).then(()=>i()).catch(i)}s(_u,"link");function Eu(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Is(t,e,n).then(()=>r()).catch(r)}s(Eu,"symlink");function xu(t,e,i=S){i=typeof e=="function"?e:i,Sn(t).then(r=>i(void 0,r)).catch(i)}s(xu,"readlink");function ku(t,e,i,r=S){Ps(t,e,i).then(()=>r()).catch(r)}s(ku,"chown");function vu(t,e,i,r=S){As(t,e,i).then(()=>r()).catch(r)}s(vu,"lchown");function Fu(t,e,i=S){Os(t,e).then(()=>i()).catch(i)}s(Fu,"chmod");function Iu(t,e,i=S){Ts(t,e).then(()=>i()).catch(i)}s(Iu,"lchmod");function Pu(t,e,i,r=S){_n(t,e,i).then(()=>r()).catch(r)}s(Pu,"utimes");function Au(t,e,i,r=S){Cs(t,e,i).then(()=>r()).catch(r)}s(Au,"lutimes");function Ou(t,e,i=S){i=typeof e=="function"?e:i,Te(t,typeof e=="function"?null:e).then(r=>i(void 0,r)).catch(i)}s(Ou,"realpath");function Tu(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Rs(t,r).then(()=>i()).catch(i)}s(Tu,"access");function Cu(t,e,i=S){throw u.With("ENOSYS",t.toString(),"watchFile")}s(Cu,"watchFile");function Ru(t,e=S){throw u.With("ENOSYS",t.toString(),"unwatchFile")}s(Ru,"unwatchFile");function Nu(t,e,i=S){throw u.With("ENOSYS",t.toString(),"watch")}s(Nu,"watch");function Lu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new kt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{r||=await ye(t,"r",i?.mode);let a=await r.read(new Uint8Array(o),0,o,r.file.position);n.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),r.file.position+=a.bytesRead,a.bytesRead||await r.close()}catch(a){await r?.close(),n.destroy(a)}},"read"),destroy:s(function(o,a){r?.close().then(()=>a(o)).catch(a)},"destroy")});return n.path=t.toString(),n}s(Lu,"createReadStream");function Bu(t,e){let i=typeof e=="object"?e:{encoding:e},r,n=new vt({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{r||=await ye(t,"w",i?.mode||438),await r.write(o,0,a),c(void 0)}catch(l){await r?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),r?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){r?.close().then(()=>o()).catch(o)},"final")});return n.path=t.toString(),n}s(Bu,"createWriteStream");function Du(t,e,i=S){i=typeof e=="function"?e:i,En(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(Du,"rm");function Mu(t,e,i=S){i=typeof e=="function"?e:i,Ns(t,typeof e!="function"?e:null).then(r=>i(void 0,r)).catch(i)}s(Mu,"mkdtemp");function Uu(t,e,i,r=S){r=typeof i=="function"?i:r,xn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Uu,"copyFile");function Wu(t,e,i,r=S){r=typeof i=="function"?i:r,new oe(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesRead:o})=>r(void 0,o,n)).catch(r)}s(Wu,"readv");function ju(t,e,i,r=S){r=typeof i=="function"?i:r,new oe(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:n,bytesWritten:o})=>r(void 0,o,n)).catch(r)}s(ju,"writev");function qu(t,e,i=S){i=typeof e=="function"?e:i,Ls(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(qu,"opendir");function $u(t,e,i,r=S){r=typeof i=="function"?i:r,kn(t,e,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s($u,"cp");function zu(t,e,i=S){i=typeof e=="function"?e:i,Bs(t,typeof e=="function"?void 0:e).then(r=>i(void 0,r)).catch(i)}s(zu,"statfs");async function Vu(t,e){let i=await ye(t.toString(),"r"),r=await i.readFile();return await i.close(),new Blob([r],e)}s(Vu,"openAsBlob");function Hu(t){return Vi(t)||zi(t)||t instanceof ie}s(Hu,"isMountConfig");async function Ii(t,e=0){if(typeof t!="object"||t==null)throw new u(22,"Invalid options on mount configuration");if(!Hu(t))throw new u(22,"Invalid mount configuration");if(t instanceof ie)return t;zi(t)&&(t={backend:t});for(let[n,o]of Object.entries(t))if(n!="backend"&&Hu(o)){if(e>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");t[n]=await Ii(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await zn(i,t);let r=await i.create(t);return r._disableSync=t.disableAsyncCache||!1,await r.ready(),r}s(Ii,"resolveMountConfig");async function Hg(t){if(!Vi(t))throw new TypeError("Invalid single mount point configuration");let e=await Ii(t);ai("/"),Nt("/",e)}s(Hg,"configureSingle");async function Gg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;if(ga({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),!!t.mounts){for(let[r,n]of Object.entries(t.mounts)){if(!r.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Vi(n)&&(n.disableAsyncCache??=t.disableAsyncCache||!1),t.mounts[r]=await Ii(n)}Ki(t.mounts)}}s(Gg,"configure");var qi=class extends Pt{constructor(i,r,n,o){super();this.fs=i;this.fd=r;this.path=n;this.position=o}static{s(this,"PortFile")}rpc(i,...r){return qn({scope:"file",fd:this.fd,method:i,args:r},this.fs.options)}_throwNoSync(i){throw new u(95,"Syncrohnous operations not support on PortFile",this.path,i)}stat(){return this.rpc("stat")}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,r,n,o){return this.rpc("write",i,r,n,o)}writeSync(){this._throwNoSync("write")}async read(i,r,n,o){return await this.rpc("read",i,r,n,o)}readSync(){this._throwNoSync("read")}chown(i,r){return this.rpc("chown",i,r)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,r){return this.rpc("utimes",i,r)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}},Fn=class extends Bn(ie){constructor(i){super();this.options=i;this._sync=ji.create({name:"port-tmpfs"});this.port=i.port,vr(this.port,Ys)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...r){return qn({scope:"fs",method:i,args:r},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,r,n){return this.rpc("rename",i,r,n)}async stat(i,r){return new X(await this.rpc("stat",i,r))}sync(i,r,n){return this.rpc("sync",i,r,n)}openFile(i,r,n){return this.rpc("openFile",i,r,n)}createFile(i,r,n,o){return this.rpc("createFile",i,r,n,o)}unlink(i,r){return this.rpc("unlink",i,r)}rmdir(i,r){return this.rpc("rmdir",i,r)}mkdir(i,r,n){return this.rpc("mkdir",i,r,n)}readdir(i,r){return this.rpc("readdir",i,r)}exists(i,r){return this.rpc("exists",i,r)}link(i,r,n){return this.rpc("link",i,r,n)}},Gu=0,vn=new Map;async function $i(t,e,i){if(!jn(i))return;let{method:r,args:n,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await e[r](...n),l instanceof Pt&&(vn.set(++Gu,l),l={fd:Gu,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!vn.has(d))throw new u(9);l=await vn.get(d)[r](...n),r=="close"&&vn.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}t.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:r,stack:c,value:l})}s($i,"handleRequest");function Ku(t,e){vr(t,i=>$i(t,e,i))}s(Ku,"attachFS");function Kg(t,e){$n(t,i=>$i(t,e,i))}s(Kg,"detachFS");var Yg={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(t){if(typeof t?.postMessage!="function")throw new u(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(t){return new Fn(t)},"create")};async function Xg(t,e,i=0){let r=Xs(t),n=await Ii(e,i);return Ku(t,n),r(n),n}s(Xg,"resolveRemoteMount");function Yu(t){try{return JSON.parse(t),!0}catch{return!1}}s(Yu,"isJSON");function Ms(t){return t.at(0).toUpperCase()+t.slice(1)}s(Ms,"capitalize");var Us=Symbol("struct_init"),Jg=Symbol("struct");var Xu=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],Ju=[...Xu,...Xu.map(t=>Ms(t)),"char"];function Qu(t,e){return function(i,r){let n=typeof r=="object"?r.name:r;if(typeof n=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+n.toString()),n=n.toString()),!n)throw new ReferenceError("Invalid name for struct member");if(typeof i!="object")throw new TypeError("Invalid member for struct field");if(!("constructor"in i))throw new TypeError("Invalid member for struct field");let o=i.constructor;o[Us]||=[],o[Us].push({name:n,type:t,length:e})}}s(Qu,"member");function ew(t){function e(i,r){return typeof i=="number"?Qu(t,i):Qu(t)(i,r)}return s(e,"_"),e}s(ew,"_member");var QE=Object.fromEntries(Ju.map(t=>[t,ew(t)]));var Zu=1,In=class t extends Map{static{s(this,"Index")}constructor(){super()}files(){let e=new Map;for(let[i,r]of this)r.isFile()&&e.set(i,r);return e}toJSON(){return{version:Zu,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(e){let i=[];for(let r of this.keys())I(r)==e&&i.push(z(r));return i}fromJSON(e){if(e.version!=Zu)throw new u(22,"Index version mismatch");this.clear();for(let[i,r]of Object.entries(e.entries)){let n=new X(r);n.isDirectory()&&(n.fileData=Pe(JSON.stringify(this.dirEntries(i)))),this.set(i,n)}}static parse(e){if(!Yu(e))throw new u(22,"Invalid JSON");let i=JSON.parse(e),r=new t;return r.fromJSON(i),r}};var br=class extends Dn(ie){constructor(i){super();this.indexData=i;this.index=new In;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=await this.getData(i,r)}reloadFilesSync(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=this.getDataSync(i,r)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,r,n){if(he(r))throw new u(1,i);let o=this.index.get(i);if(!o)throw u.With("ENOENT",i,"openFile");if(!o.hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");return new Zt(this,i,r,o,o.isDirectory()?o.fileData:await this.getData(i,o))}openFileSync(i,r,n){if(he(r))throw new u(1,i);let o=this.index.get(i);if(!o)throw u.With("ENOENT",i,"openFile");if(!o.hasAccess(At(r),n))throw u.With("EACCES",i,"openFile");return new Zt(this,i,r,o,o.isDirectory()?o.fileData:this.getDataSync(i,o))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"readdir");if(!r.isDirectory())throw u.With("ENOTDIR",i,"readdir");let n=JSON.parse(ei(r.fileData));if(!Array.isArray(n))throw u.With("ENODATA",i,"readdir");if(!n.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return n}};async function ed(t,e){let i=await fetch(t).catch(r=>{throw new u(5,r.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(e){case"buffer":{let r=await i.arrayBuffer().catch(n=>{throw new u(5,n.message)});return new Uint8Array(r)}case"json":return i.json().catch(r=>{throw new u(5,r.message)});default:throw new u(22,"Invalid download type: "+e)}}s(ed,"fetchFile");var Pn=class t extends br{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[e,i]of this.index.files())await this.getData(e,i)}constructor({index:e="index.json",baseUrl:i=""}){super(typeof e!="string"?e:ed(e,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}preload(e,i){let r=this.index.get(e);if(!r)throw u.With("ENOENT",e,"preloadFile");if(!r.isFile())throw u.With("EISDIR",e,"preloadFile");r.size=i.length,r.fileData=i}async getData(e,i){if(i.fileData)return i.fileData;let r=await ed(this.baseUrl+(e.startsWith("/")?e.slice(1):e),"buffer");return i.fileData=r,r}getDataSync(e,i){if(i.fileData)return i.fileData;throw new u(61,"",e,"getData")}},tw={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(t){return new Pn(t)},"create")};var Pi=class{constructor(e){this.fs=e;this.locks=new Map}static{s(this,"LockedFS")}addLock(e){let i={...Promise.withResolvers(),[Symbol.dispose]:()=>{this.unlock(e)}};return this.locks.set(e,i),i}async lock(e){return this.locks.has(e)&&await this.locks.get(e).promise,this.addLock(e)}lockSync(e){if(this.locks.has(e))throw u.With("EBUSY",e,"lockSync");return this.addLock(e)}unlock(e,i=!1){if(!this.locks.has(e)){if(i)return!1;throw new u(1,"Can not unlock an already unlocked path",e)}return this.locks.get(e).resolve(),this.locks.delete(e),!0}isLocked(e){return this.locks.has(e)}async ready(){await this.fs.ready()}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.rename(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}renameSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.renameSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async stat(e,i){var n=[];try{let r=x(n,await this.lock(e));return await this.fs.stat(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}statSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.statSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async openFile(e,i,r){var o=[];try{let n=x(o,await this.lock(e));return await this.fs.openFile(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}openFileSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.openFileSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async createFile(e,i,r,n){var a=[];try{let o=x(a,await this.lock(e));return await this.fs.createFile(e,i,r,n)}catch(c){var l=c,f=!0}finally{k(a,l,f)}}createFileSync(e,i,r,n){var a=[];try{let o=x(a,this.lockSync(e));return this.fs.createFileSync(e,i,r,n)}catch(c){var l=c,f=!0}finally{k(a,l,f)}}async unlink(e,i){var n=[];try{let r=x(n,await this.lock(e));await this.fs.unlink(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}unlinkSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.unlinkSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async rmdir(e,i){var n=[];try{let r=x(n,await this.lock(e));await this.fs.rmdir(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}rmdirSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.rmdirSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async mkdir(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.mkdir(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}mkdirSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.mkdirSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async readdir(e,i){var n=[];try{let r=x(n,await this.lock(e));return await this.fs.readdir(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}readdirSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.readdirSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async exists(e,i){var n=[];try{let r=x(n,await this.lock(e));return await this.fs.exists(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}existsSync(e,i){var n=[];try{let r=x(n,this.lockSync(e));return this.fs.existsSync(e,i)}catch(o){var a=o,c=!0}finally{k(n,a,c)}}async link(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.link(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}linkSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.linkSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}async sync(e,i,r){var o=[];try{let n=x(o,await this.lock(e));await this.fs.sync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}syncSync(e,i,r){var o=[];try{let n=x(o,this.lockSync(e));return this.fs.syncSync(e,i,r)}catch(a){var c=a,l=!0}finally{k(o,c,l)}}},iw={name:"Locked",options:{fs:{type:"object",required:!0,description:"",validator:s(function(t){if(!(t instanceof ie))throw new u(22,"fs passed to LockedFS must be a FileSystem")},"validator")}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function({fs:t}){return new Pi(t)},"create")};var Ws="/.deleted",An=class extends ie{constructor({writable:i,readable:r}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this._writable=i,this._readable=r,this._writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnlockedOverlayFS")}async ready(){await this._readable.ready(),await this._writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:gr.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(i,r,n){let o=n.cred(0,0);await this.createParentDirectories(i,o),await this._writable.exists(i,o)||await this._writable.createFile(i,"w",420,o),await this._writable.sync(i,r,n)}syncSync(i,r,n){let o=n.cred(0,0);this.createParentDirectoriesSync(i,o),this._writable.syncSync(i,r,n)}async _initialize(){if(!this._isInitialized){try{let i=await this._writable.openFile(Ws,D("r"),We),{size:r}=await i.stat(),{buffer:n}=await i.read(new Uint8Array(r));this._deleteLog=ei(n)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i,r){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("",r)}async rename(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{await this._writable.rename(i,r,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{this._writable.renameSync(i,r,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i,r){this.checkInitialized();try{return await this._writable.stat(i,r)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let o=new X(await this._readable.stat(i,r));return o.mode|=146,o}}statSync(i,r){this.checkInitialized();try{return this._writable.statSync(i,r)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let o=new X(this._readable.statSync(i,r));return o.mode|=146,o}}async openFile(i,r,n){if(await this._writable.exists(i,n))return this._writable.openFile(i,r,n);let o=await this._readable.openFile(i,D("r"),n),a=new X(await o.stat()),{buffer:c}=await o.read(new Uint8Array(a.size));return new pe(this,i,r,a,c)}openFileSync(i,r,n){if(this._writable.existsSync(i,n))return this._writable.openFileSync(i,r,n);let o=this._readable.openFileSync(i,D("r"),n),a=new X(o.statSync()),c=new Uint8Array(a.size);return o.readSync(c),new pe(this,i,r,a,c)}async createFile(i,r,n,o){return this.checkInitialized(),await this._writable.createFile(i,r,n,o),this.openFile(i,r,o)}createFileSync(i,r,n,o){return this.checkInitialized(),this._writable.createFileSync(i,r,n,o),this.openFileSync(i,r,o)}async link(i,r,n){this.checkInitialized(),await this._writable.link(i,r,n)}linkSync(i,r,n){this.checkInitialized(),this._writable.linkSync(i,r,n)}async unlink(i,r){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,r))throw u.With("ENOENT",i,"unlink");await this._writable.exists(i,r)&&await this._writable.unlink(i,r),await this.exists(i,r)&&await this.deletePath(i,r)}unlinkSync(i,r){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,r))throw u.With("ENOENT",i,"unlink");this._writable.existsSync(i,r)&&this._writable.unlinkSync(i,r),this.existsSync(i,r)&&this.deletePath(i,r)}async rmdir(i,r){if(this.checkInitialized(),!await this.exists(i,r))throw u.With("ENOENT",i,"rmdir");if(await this._writable.exists(i,r)&&await this._writable.rmdir(i,r),await this.exists(i,r)){if((await this.readdir(i,r)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i,r)}}rmdirSync(i,r){if(this.checkInitialized(),!this.existsSync(i,r))throw u.With("ENOENT",i,"rmdir");if(this._writable.existsSync(i,r)&&this._writable.rmdirSync(i,r),this.existsSync(i,r)){if(this.readdirSync(i,r).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}async mkdir(i,r,n){if(this.checkInitialized(),await this.exists(i,n))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,n),await this._writable.mkdir(i,r,n)}mkdirSync(i,r,n){if(this.checkInitialized(),this.existsSync(i,n))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,n),this._writable.mkdirSync(i,r,n)}async readdir(i,r){if(this.checkInitialized(),!(await this.stat(i,r)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this._writable.readdir(i,r))}catch{}try{o.push(...(await this._readable.readdir(i,r)).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}readdirSync(i,r){if(this.checkInitialized(),!this.statSync(i,r).isDirectory())throw u.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this._writable.readdirSync(i,r))}catch{}try{o=o.concat(this._readable.readdirSync(i,r).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}async deletePath(i,r){this._deletedFiles.add(i),await this.updateLog(`d${i}
3
3
  `,r)}async updateLog(i,r){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(Ws,D("w"),r);try{await n.write(Pe(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog("",r))}catch(o){this._deleteLogError=o}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
4
4
  `))i.startsWith("d")&&this._deletedFiles.add(i.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 i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==Ws)throw u.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i,r){let n=I(i),o=[];for(;!this._writable.existsSync(n,r);)o.push(n),n=I(n);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,r).mode,r)}async createParentDirectories(i,r){let n=I(i),o=[];for(;!await this._writable.exists(n,r);)o.push(n),n=I(n);o=o.reverse();for(let a of o){let c=await this.stat(a,r);await this._writable.mkdir(a,c.mode,r)}}operateOnWritable(i,r){if(!this.existsSync(i,r))throw u.With("ENOENT",i,"operateOnWriteable");this._writable.existsSync(i,r)||this.copyToWritableSync(i,r)}async operateOnWritableAsync(i,r){if(!await this.exists(i,r))throw u.With("ENOENT",i,"operateOnWritable");if(!await this._writable.exists(i,r))return this.copyToWritable(i,r)}copyToWritableSync(i,r){let n=this.statSync(i,r);if(n.isDirectory()){this._writable.mkdirSync(i,n.mode,r);return}let o=new Uint8Array(n.size),a=this._readable.openFileSync(i,D("r"),r);a.readSync(o),a.closeSync();let c=this._writable.openFileSync(i,D("w"),r);c.writeSync(o),c.closeSync()}async copyToWritable(i,r){let n=await this.stat(i,r);if(n.isDirectory()){await this._writable.mkdir(i,n.mode,r);return}let o=new Uint8Array(n.size),a=await this._readable.openFile(i,D("r"),r);await a.read(o),await a.close();let c=await this._writable.openFile(i,D("w"),r);await c.write(o),await c.close()}},gr=class extends Pi{static{s(this,"OverlayFS")}constructor(e){super(new An(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}},rw={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(t){return new gr(t)},"create")};var nw=mr;return ad(ow);})();
5
5
  /*! Bundled license information: