@zenfs/core 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApiError.d.ts +4 -3
- package/dist/ApiError.js +1 -1
- package/dist/backends/AsyncStore.d.ts +3 -2
- package/dist/backends/AsyncStore.js +12 -5
- package/dist/backends/InMemory.d.ts +1 -1
- package/dist/backends/Index.d.ts +7 -10
- package/dist/backends/Index.js +7 -5
- package/dist/backends/Overlay.js +1 -1
- package/dist/backends/SyncStore.d.ts +6 -6
- package/dist/backends/SyncStore.js +4 -4
- package/dist/backends/backend.d.ts +5 -4
- package/dist/backends/backend.js +2 -2
- package/dist/browser.min.js +4 -4
- package/dist/browser.min.js.map +3 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -2
- package/dist/emulation/async.d.ts +76 -77
- package/dist/emulation/async.js +42 -42
- package/dist/emulation/dir.js +6 -5
- package/dist/emulation/promises.d.ts +106 -102
- package/dist/emulation/promises.js +61 -65
- package/dist/emulation/shared.d.ts +1 -7
- package/dist/emulation/shared.js +1 -1
- package/dist/emulation/streams.js +3 -2
- package/dist/emulation/sync.d.ts +71 -64
- package/dist/emulation/sync.js +39 -40
- package/dist/file.d.ts +4 -4
- package/dist/file.js +7 -5
- package/dist/filesystem.d.ts +1 -1
- package/dist/filesystem.js +3 -0
- package/dist/mutex.js +2 -2
- package/dist/stats.d.ts +7 -7
- package/dist/stats.js +50 -10
- package/dist/utils.d.ts +5 -5
- package/dist/utils.js +4 -3
- package/package.json +3 -3
- package/readme.md +2 -2
- package/src/ApiError.ts +3 -1
- package/src/backends/AsyncStore.ts +14 -8
- package/src/backends/Index.ts +14 -10
- package/src/backends/Overlay.ts +3 -3
- package/src/backends/SyncStore.ts +8 -8
- package/src/backends/backend.ts +7 -5
- package/src/config.ts +5 -5
- package/src/emulation/async.ts +188 -196
- package/src/emulation/dir.ts +6 -6
- package/src/emulation/promises.ts +181 -173
- package/src/emulation/shared.ts +2 -9
- package/src/emulation/streams.ts +9 -8
- package/src/emulation/sync.ts +159 -159
- package/src/file.ts +11 -9
- package/src/filesystem.ts +11 -7
- package/src/mutex.ts +3 -3
- package/src/stats.ts +32 -23
- package/src/utils.ts +10 -9
- package/tsconfig.json +2 -1
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var ZenFS=(()=>{var Uf=Object.create;var Li=Object.defineProperty;var qf=Object.getOwnPropertyDescriptor;var jf=Object.getOwnPropertyNames;var $f=Object.getPrototypeOf,Vf=Object.prototype.hasOwnProperty;var s=(t,e)=>Li(t,"name",{value:e,configurable:!0});var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gn=(t,e)=>{for(var i in e)Li(t,i,{get:e[i],enumerable:!0})},Ds=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of jf(e))!Vf.call(t,r)&&r!==i&&Li(t,r,{get:()=>e[r],enumerable:!(n=qf(e,r))||n.enumerable});return t};var Rr=(t,e,i)=>(i=t!=null?Uf($f(t)):{},Ds(e||!t||!t.__esModule?Li(i,"default",{value:t,enumerable:!0}):i,t)),zf=t=>Ds(Li({},"__esModule",{value:!0}),t);var Hs=A(Tn=>{"use strict";Tn.byteLength=Nd;Tn.toByteArray=Fd;Tn.fromByteArray=Td;var Me=[],be=[],kd=typeof Uint8Array<"u"?Uint8Array:Array,zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tt=0,Vs=zr.length;Tt<Vs;++Tt)Me[Tt]=zr[Tt],be[zr.charCodeAt(Tt)]=Tt;var Tt,Vs;be["-".charCodeAt(0)]=62;be["_".charCodeAt(0)]=63;function zs(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 n=i===e?0:4-i%4;return[i,n]}s(zs,"getLens");function Nd(t){var e=zs(t),i=e[0],n=e[1];return(i+n)*3/4-n}s(Nd,"byteLength");function Id(t,e,i){return(e+i)*3/4-i}s(Id,"_byteLength");function Fd(t){var e,i=zs(t),n=i[0],r=i[1],o=new kd(Id(t,n,r)),a=0,l=r>0?n-4:n,c;for(c=0;c<l;c+=4)e=be[t.charCodeAt(c)]<<18|be[t.charCodeAt(c+1)]<<12|be[t.charCodeAt(c+2)]<<6|be[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=be[t.charCodeAt(c)]<<2|be[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=be[t.charCodeAt(c)]<<10|be[t.charCodeAt(c+1)]<<4|be[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Fd,"toByteArray");function vd(t){return Me[t>>18&63]+Me[t>>12&63]+Me[t>>6&63]+Me[t&63]}s(vd,"tripletToBase64");function Ad(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(vd(n));return r.join("")}s(Ad,"encodeChunk");function Td(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(Ad(t,a,a+o>l?l:a+o));return n===1?(e=t[i-1],r.push(Me[e>>2]+Me[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Me[e>>10]+Me[e>>4&63]+Me[e<<2&63]+"=")),r.join("")}s(Td,"fromByteArray")});var Ks=A(Hr=>{Hr.read=function(t,e,i,n,r){var o,a,l=r*8-n-1,c=(1<<l)-1,u=c>>1,d=-7,h=i?r-1:0,b=i?-1:1,m=t[e+h];for(h+=b,o=m&(1<<-d)-1,m>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+h],h+=b,d-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(m?-1:1)*a*Math.pow(2,o-n)};Hr.write=function(t,e,i,n,r,o){var a,l,c,u=o*8-r-1,d=(1<<u)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,w=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=b/c:e+=b*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,r),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[i+m]=l&255,m+=w,l/=256,r-=8);for(a=a<<r|l,u+=r;u>0;t[i+m]=a&255,m+=w,a/=256,u-=8);t[i+m-w]|=g*128}});var ke=A(ui=>{"use strict";var Kr=Hs(),li=Ks(),Gs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=y;ui.SlowBuffer=Dd;ui.INSPECT_MAX_BYTES=50;var On=2147483647;ui.kMaxLength=On;y.TYPED_ARRAY_SUPPORT=Od();!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 Od(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Od,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function Je(t){if(t>On)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(Je,"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 Jr(t)}return Qs(t,e,i)}s(y,"Buffer");y.poolSize=8192;function Qs(t,e,i){if(typeof t=="string")return Rd(t,e);if(ArrayBuffer.isView(t))return Ld(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Yr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return y.from(n,e,i);let r=Cd(t);if(r)return r;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(Qs,"from");y.from=function(t,e,i){return Qs(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function Zs(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(Zs,"assertSize");function Pd(t,e,i){return Zs(t),t<=0?Je(t):e!==void 0?typeof i=="string"?Je(t).fill(e,i):Je(t).fill(e):Je(t)}s(Pd,"alloc");y.alloc=function(t,e,i){return Pd(t,e,i)};function Jr(t){return Zs(t),Je(t<0?0:Qr(t)|0)}s(Jr,"allocUnsafe");y.allocUnsafe=function(t){return Jr(t)};y.allocUnsafeSlow=function(t){return Jr(t)};function Rd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=ea(t,e)|0,n=Je(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}s(Rd,"fromString");function Gr(t){let e=t.length<0?0:Qr(t.length)|0,i=Je(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}s(Gr,"fromArrayLike");function Ld(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Yr(e.buffer,e.byteOffset,e.byteLength)}return Gr(t)}s(Ld,"fromArrayView");function Yr(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 n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,y.prototype),n}s(Yr,"fromArrayBuffer");function Cd(t){if(y.isBuffer(t)){let e=Qr(t.length)|0,i=Je(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)?Je(0):Gr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Gr(t.data)}s(Cd,"fromObject");function Qr(t){if(t>=On)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+On.toString(16)+" bytes");return t|0}s(Qr,"checked");function Dd(t){return+t!=t&&(t=0),y.alloc(+t)}s(Dd,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==i[o]){n=e[o],r=i[o];break}return n<r?-1:r<n?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 n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=y.allocUnsafe(i),o=0;for(n=0;n<e.length;++n){let a=e[n];if(We(a,Uint8Array))o+a.length>r.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(y.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function ea(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Xr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return ca(t).length;default:if(r)return n?-1:Xr(t).length;e=(""+e).toLowerCase(),r=!0}}s(ea,"byteLength");y.byteLength=ea;function Bd(t,e,i){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Kd(this,e,i);case"utf8":case"utf-8":return ia(this,e,i);case"ascii":return zd(this,e,i);case"latin1":case"binary":return Hd(this,e,i);case"base64":return $d(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gd(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s(Bd,"slowToString");y.prototype._isBuffer=!0;function Ot(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}s(Ot,"swap");y.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)Ot(this,i,i+1);return this},"swap16");y.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)Ot(this,i,i+3),Ot(this,i+1,i+2);return this},"swap32");y.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)Ot(this,i,i+7),Ot(this,i+1,i+6),Ot(this,i+2,i+5),Ot(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?ia(this,0,e):Bd.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=ui.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Gs&&(y.prototype[Gs]=y.prototype.inspect);y.prototype.compare=s(function(e,i,n,r,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;let a=o-r,l=n-i,c=Math.min(a,l),u=this.slice(r,o),d=e.slice(i,n);for(let h=0;h<c;++h)if(u[h]!==d[h]){a=u[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function ta(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,eo(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),y.isBuffer(e))return e.length===0?-1:Ys(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Ys(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(ta,"bidirectionalIndexOf");function Ys(t,e,i,n,r){let o=1,a=t.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(c,"read");let u;if(r){let d=-1;for(u=i;u<a;u++)if(c(t,u)===c(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===l)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(i+l>a&&(i=a-l),u=i;u>=0;u--){let d=!0;for(let h=0;h<l;h++)if(c(t,u+h)!==c(e,h)){d=!1;break}if(d)return u}return-1}s(Ys,"arrayIndexOf");y.prototype.includes=s(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");y.prototype.indexOf=s(function(e,i,n){return ta(this,e,i,n,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,n){return ta(this,e,i,n,!1)},"lastIndexOf");function Md(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let l=parseInt(e.substr(a*2,2),16);if(eo(l))return a;t[i+a]=l}return a}s(Md,"hexWrite");function Wd(t,e,i,n){return Pn(Xr(e,t.length-i),t,i,n)}s(Wd,"utf8Write");function Ud(t,e,i,n){return Pn(Qd(e),t,i,n)}s(Ud,"asciiWrite");function qd(t,e,i,n){return Pn(ca(e),t,i,n)}s(qd,"base64Write");function jd(t,e,i,n){return Pn(Zd(e,t.length-i),t,i,n)}s(jd,"ucs2Write");y.prototype.write=s(function(e,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return Md(this,e,i,n);case"utf8":case"utf-8":return Wd(this,e,i,n);case"ascii":case"latin1":case"binary":return Ud(this,e,i,n);case"base64":return qd(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jd(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function $d(t,e,i){return e===0&&i===t.length?Kr.fromByteArray(t):Kr.fromByteArray(t.slice(e,i))}s($d,"base64Slice");function ia(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let o=t[r],a=null,l=o>239?4:o>223?3:o>191?2:1;if(r+l<=i){let c,u,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[r+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[r+1],u=t[r+2],(c&192)===128&&(u&192)===128&&(h=(o&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[r+1],u=t[r+2],d=t[r+3],(c&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(c&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=l}return Vd(n)}s(ia,"utf8Slice");var Xs=4096;function Vd(t){let e=t.length;if(e<=Xs)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=Xs));return i}s(Vd,"decodeCodePointsArray");function zd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}s(zd,"asciiSlice");function Hd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}s(Hd,"latin1Slice");function Kd(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=e;o<i;++o)r+=eh[t[o]];return r}s(Kd,"hexSlice");function Gd(t,e,i){let n=t.slice(e,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Gd,"utf16leSlice");y.prototype.slice=s(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,y.prototype),r},"slice");function X(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(X,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return r},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e+--i],o=1;for(;i>0&&(o*=256);)r+=this[e+--i]*o;return r},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||X(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||X(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||X(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||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=pt(s(function(e){e=e>>>0,ci(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=pt(s(function(e){e=e>>>0,ci(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=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+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");y.prototype.readIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=i,o=1,a=this[e+--r];for(;r>0&&(o*=256);)a+=this[e+--r]*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||X(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||X(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||X(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||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=pt(s(function(e){e=e>>>0,ci(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=pt(s(function(e){e=e>>>0,ci(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Hi(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),li.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),li.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),li.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),li.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,n,r,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}s(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=1,a=0;for(this[i]=e&255;++a<n&&(o*=256);)this[i+a]=e/o&255;return i+n},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=n-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+n},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function na(t,e,i,n,r){la(e,n,r,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(na,"wrtBigUInt64LE");function ra(t,e,i,n,r){la(e,n,r,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(ra,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=pt(s(function(e,i=0){return na(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=pt(s(function(e,i=0){return ra(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<n&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=n-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntBE");y.prototype.writeInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=pt(s(function(e,i=0){return na(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=pt(s(function(e,i=0){return ra(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function oa(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(oa,"checkIEEE754");function sa(t,e,i,n,r){return e=+e,i=i>>>0,r||oa(t,e,i,4,34028234663852886e22,-34028234663852886e22),li.write(t,e,i,n,23,4),i+4}s(sa,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,n){return sa(this,e,i,!0,n)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,n){return sa(this,e,i,!1,n)},"writeFloatBE");function aa(t,e,i,n,r){return e=+e,i=i>>>0,r||oa(t,e,i,8,17976931348623157e292,-17976931348623157e292),li.write(t,e,i,n,52,8),i+8}s(aa,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,n){return aa(this,e,i,!0,n)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,n){return aa(this,e,i,!1,n)},"writeDoubleBE");y.prototype.copy=s(function(e,i,n,r){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-i<r-n&&(r=e.length-i+n);let o=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),o},"copy");y.prototype.fill=s(function(e,i,n,r){if(typeof e=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!y.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<n;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,r),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%l]}return this},"fill");var ai={};function Zr(t,e,i){ai[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Zr,"E");Zr("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zr("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Zr("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Js(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=Js(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function Js(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Js,"addNumericalSeparator");function Yd(t,e,i){ci(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Hi(e,t.length-(i+1))}s(Yd,"checkBounds");function la(t,e,i,n,r,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new ai.ERR_OUT_OF_RANGE("value",l,t)}Yd(n,r,o)}s(la,"checkIntBI");function ci(t,e){if(typeof t!="number")throw new ai.ERR_INVALID_ARG_TYPE(e,"number",t)}s(ci,"validateNumber");function Hi(t,e,i){throw Math.floor(t)!==t?(ci(t,i),new ai.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new ai.ERR_BUFFER_OUT_OF_BOUNDS:new ai.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Hi,"boundsError");var Xd=/[^+/0-9A-Za-z-_]/g;function Jd(t){if(t=t.split("=")[0],t=t.trim().replace(Xd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(Jd,"base64clean");function Xr(t,e){e=e||1/0;let i,n=t.length,r=null,o=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=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(Xr,"utf8ToBytes");function Qd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Qd,"asciiToBytes");function Zd(t,e){let i,n,r,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Zd,"utf16leToBytes");function ca(t){return Kr.toByteArray(Jd(t))}s(ca,"base64ToBytes");function Pn(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}s(Pn,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function eo(t){return t!==t}s(eo,"numberIsNaN");var eh=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function pt(t){return typeof BigInt>"u"?th:t}s(pt,"defineBigIntMethod");function th(){throw new Error("BigInt not supported")}s(th,"BufferBigIntNotDefined")});var D=A((zS,La)=>{"use strict";La.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var bi=A((HS,Un)=>{"use strict";var{AbortController:Ca,AbortSignal:oh}=typeof self<"u"?self:typeof window<"u"?window:void 0;Un.exports=Ca;Un.exports.AbortSignal=oh;Un.exports.default=Ca});var Qi=A((KS,co)=>{"use strict";var gi=typeof Reflect=="object"?Reflect:null,Da=gi&&typeof gi.apply=="function"?gi.apply:s(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),qn;gi&&typeof gi.ownKeys=="function"?qn=gi.ownKeys:Object.getOwnPropertySymbols?qn=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):qn=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function sh(t){console&&console.warn&&console.warn(t)}s(sh,"ProcessEmitWarning");var Ma=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function O(){O.init.call(this)}s(O,"EventEmitter");co.exports=O;co.exports.once=uh;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var Ba=10;function jn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(jn,"checkListener");Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return Ba},set:function(t){if(typeof t!="number"||t<0||Ma(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ba=t}});O.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};O.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ma(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 Wa(t){return t._maxListeners===void 0?O.defaultMaxListeners:t._maxListeners}s(Wa,"_getMaxListeners");O.prototype.getMaxListeners=s(function(){return Wa(this)},"getMaxListeners");O.prototype.emit=s(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Da(c,this,i);else for(var u=c.length,d=Va(c,u),n=0;n<u;++n)Da(d[n],this,i);return!0},"emit");function Ua(t,e,i,n){var r,o,a;if(jn(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]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Wa(t),r>0&&a.length>r&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,sh(l)}return t}s(Ua,"_addListener");O.prototype.addListener=s(function(e,i){return Ua(this,e,i,!1)},"addListener");O.prototype.on=O.prototype.addListener;O.prototype.prependListener=s(function(e,i){return Ua(this,e,i,!0)},"prependListener");function ah(){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(ah,"onceWrapper");function qa(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=ah.bind(n);return r.listener=i,n.wrapFn=r,r}s(qa,"_onceWrap");O.prototype.once=s(function(e,i){return jn(i),this.on(e,qa(this,e,i)),this},"once");O.prototype.prependOnceListener=s(function(e,i){return jn(i),this.prependListener(e,qa(this,e,i)),this},"prependOnceListener");O.prototype.removeListener=s(function(e,i){var n,r,o,a,l;if(jn(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){l=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():lh(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=s(function(e){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function ja(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?ch(r):Va(r,r.length)}s(ja,"_listeners");O.prototype.listeners=s(function(e){return ja(this,e,!0)},"listeners");O.prototype.rawListeners=s(function(e){return ja(this,e,!1)},"rawListeners");O.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):$a.call(t,e)};O.prototype.listenerCount=$a;function $a(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($a,"listenerCount");O.prototype.eventNames=s(function(){return this._eventsCount>0?qn(this._events):[]},"eventNames");function Va(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}s(Va,"arrayClone");function lh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(lh,"spliceOne");function ch(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(ch,"unwrapListeners");function uh(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,o),n(a)}s(r,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),za(t,e,o,{once:!0}),e!=="error"&&fh(t,r,{once:!0})})}s(uh,"once");function fh(t,e,i){typeof t.on=="function"&&za(t,"error",e,i)}s(fh,"addErrorHandlerIfEventEmitter");function za(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function r(o){n.once&&t.removeEventListener(e,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(za,"eventTargetAgnosticAddListener")});var Z=A((YS,uo)=>{"use strict";var dh=ke(),{kResistStopPropagation:hh,SymbolDispose:ph}=D(),yh=globalThis.AbortSignal||bi().AbortSignal,mh=globalThis.AbortController||bi().AbortController,bh=Object.getPrototypeOf(async function(){}).constructor,Ha=globalThis.Blob||dh.Blob,gh=s(typeof Ha<"u"?function(e){return e instanceof Ha}:function(e){return!1},"isBlob"),Ka=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"),wh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),$n=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=e}};s($n,"AggregateError");uo.exports={AggregateError:$n,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof bh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:gh,deprecate(t,e){return t},addAbortListener:Qi().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Ka(e,"signal"),wh(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[hh]:!0}),n=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[ph](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:yh.any||s(function(e){if(e.length===1)return e[0];let i=new mh,n=s(()=>i.abort(),"abort");return e.forEach(r=>{Ka(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};uo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ne=A((JS,Xa)=>{"use strict";var{format:Sh,inspect:zn,AggregateError:_h}=Z(),Eh=globalThis.AggregateError||_h,xh=Symbol("kIsNodeError"),kh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Nh=/^([A-Z][a-z0-9]*)+$/,Ih="__node_internal_",Hn={};function Lt(t,e){if(!t)throw new Hn.ERR_INTERNAL_ASSERTION(e)}s(Lt,"assert");function Ga(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ga,"addNumericalSeparator");function Fh(t,e,i){if(typeof e=="function")return Lt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Lt(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:Sh(e,...i)}s(Fh,"getMessage");function Q(t,e,i){i||(i=Error);class n extends i{constructor(...o){super(Fh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(n,"NodeError"),Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[xh]=!0,Hn[t]=n}s(Q,"E");function Ya(t){let e=Ih+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(Ya,"hideStackFrames");function vh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Eh([e,t],e.message);return i.code=e.code,i}return t||e}s(vh,"aggregateTwoErrors");var Vn=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Hn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(Vn,"AbortError");Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Lt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let c of e)Lt(typeof c=="string","All expected entries have to be of type string"),kh.includes(c)?r.push(c.toLowerCase()):Nh.test(c)?o.push(c):(Lt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let c=r.pop();n+=`one of type ${r.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();n+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${i.constructor.name}`;else{let c=zn(i,{depth:-1});n+=`. Received ${c}`}}else{let c=zn(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof i} (${c})`}return n},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let n=zn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{Lt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{Lt(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Ga(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Ga(n)),n+="n"):n=zn(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Xa.exports={AbortError:Vn,aggregateTwoErrors:Ya(vh),hideStackFrames:Ya,codes:Hn}});var Si=A((ZS,sl)=>{"use strict";var{ArrayIsArray:ho,ArrayPrototypeIncludes:el,ArrayPrototypeJoin:tl,ArrayPrototypeMap:Ah,NumberIsInteger:po,NumberIsNaN:Th,NumberMAX_SAFE_INTEGER:Oh,NumberMIN_SAFE_INTEGER:Ph,NumberParseInt:Rh,ObjectPrototypeHasOwnProperty:Lh,RegExpPrototypeExec:il,String:Ch,StringPrototypeToUpperCase:Dh,StringPrototypeTrim:Bh}=D(),{hideStackFrames:Se,codes:{ERR_SOCKET_BAD_PORT:Mh,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:wi,ERR_OUT_OF_RANGE:Ct,ERR_UNKNOWN_SIGNAL:Ja}}=ne(),{normalizeEncoding:Wh}=Z(),{isAsyncFunction:Uh,isArrayBufferView:qh}=Z().types,Qa={};function jh(t){return t===(t|0)}s(jh,"isInt32");function $h(t){return t===t>>>0}s($h,"isUint32");var Vh=/^[0-7]+$/,zh="must be a 32-bit unsigned integer or an octal string";function Hh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(il(Vh,t)===null)throw new wi(e,t,zh);t=Rh(t,8)}return nl(t,e),t}s(Hh,"parseFileMode");var Kh=Se((t,e,i=Ph,n=Oh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!po(t))throw new Ct(e,"an integer",t);if(t<i||t>n)throw new Ct(e,`>= ${i} && <= ${n}`,t)}),Gh=Se((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!po(t))throw new Ct(e,"an integer",t);if(t<i||t>n)throw new Ct(e,`>= ${i} && <= ${n}`,t)}),nl=Se((t,e,i=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!po(t))throw new Ct(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new Ct(e,`>= ${n} && <= ${r}`,t)});function yo(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(yo,"validateString");function Yh(t,e,i=void 0,n){if(typeof t!="number")throw new ee(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&Th(t))throw new Ct(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}s(Yh,"validateNumber");var Xh=Se((t,e,i)=>{if(!el(i,t)){let r="must be one of: "+tl(Ah(i,o=>typeof o=="string"?`'${o}'`:Ch(o)),", ");throw new wi(e,t,r)}});function rl(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(rl,"validateBoolean");function fo(t,e,i){return t==null||!Lh(t,e)?i:t[e]}s(fo,"getOwnPropertyValueOrDefault");var Jh=Se((t,e,i=null)=>{let n=fo(i,"allowArray",!1),r=fo(i,"allowFunction",!1);if(!fo(i,"nullable",!1)&&t===null||!n&&ho(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new ee(e,"Object",t)}),Qh=Se((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),Kn=Se((t,e,i=0)=>{if(!ho(t))throw new ee(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new wi(e,t,n)}});function Zh(t,e){Kn(t,e);for(let i=0;i<t.length;i++)yo(t[i],`${e}[${i}]`)}s(Zh,"validateStringArray");function ep(t,e){Kn(t,e);for(let i=0;i<t.length;i++)rl(t[i],`${e}[${i}]`)}s(ep,"validateBooleanArray");function tp(t,e){Kn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new ee(r,"AbortSignal",n);ol(n,r)}}s(tp,"validateAbortSignalArray");function ip(t,e="signal"){if(yo(t,e),Qa[t]===void 0)throw Qa[Dh(t)]!==void 0?new Ja(t+" (signals must use all capital letters)"):new Ja(t)}s(ip,"validateSignalName");var np=Se((t,e="buffer")=>{if(!qh(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function rp(t,e){let i=Wh(e),n=t.length;if(i==="hex"&&n%2!==0)throw new wi("encoding",e,`is invalid for data of length ${n}`)}s(rp,"validateEncoding");function op(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Bh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Mh(e,t,i);return t|0}s(op,"validatePort");var ol=Se((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),sp=Se((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),ap=Se((t,e)=>{if(typeof t!="function"||Uh(t))throw new ee(e,"Function",t)}),lp=Se((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function cp(t,e,i){if(!el(i,t))throw new ee(e,`('${tl(i,"|")}')`,t)}s(cp,"validateUnion");var up=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Za(t,e){if(typeof t>"u"||!il(up,t))throw new wi(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Za,"validateLinkHeaderFormat");function fp(t){if(typeof t=="string")return Za(t,"hints"),t;if(ho(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];Za(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new wi("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(fp,"validateLinkHeaderValue");sl.exports={isInt32:jh,isUint32:$h,parseFileMode:Hh,validateArray:Kn,validateStringArray:Zh,validateBooleanArray:ep,validateAbortSignalArray:tp,validateBoolean:rl,validateBuffer:np,validateDictionary:Qh,validateEncoding:rp,validateFunction:sp,validateInt32:Gh,validateInteger:Kh,validateNumber:Yh,validateObject:Jh,validateOneOf:Xh,validatePlainFunction:ap,validatePort:op,validateSignalName:ip,validateString:yo,validateUint32:nl,validateUndefined:lp,validateUnion:cp,validateAbortSignal:ol,validateLinkHeaderValue:fp}});var bt=A((t_,ul)=>{var q=ul.exports={},Ue,qe;function mo(){throw new Error("setTimeout has not been defined")}s(mo,"defaultSetTimout");function bo(){throw new Error("clearTimeout has not been defined")}s(bo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ue=setTimeout:Ue=mo}catch{Ue=mo}try{typeof clearTimeout=="function"?qe=clearTimeout:qe=bo}catch{qe=bo}})();function al(t){if(Ue===setTimeout)return setTimeout(t,0);if((Ue===mo||!Ue)&&setTimeout)return Ue=setTimeout,setTimeout(t,0);try{return Ue(t,0)}catch{try{return Ue.call(null,t,0)}catch{return Ue.call(this,t,0)}}}s(al,"runTimeout");function dp(t){if(qe===clearTimeout)return clearTimeout(t);if((qe===bo||!qe)&&clearTimeout)return qe=clearTimeout,clearTimeout(t);try{return qe(t)}catch{try{return qe.call(null,t)}catch{return qe.call(this,t)}}}s(dp,"runClearTimeout");var tt=[],_i=!1,Dt,Gn=-1;function hp(){!_i||!Dt||(_i=!1,Dt.length?tt=Dt.concat(tt):Gn=-1,tt.length&&ll())}s(hp,"cleanUpNextTick");function ll(){if(!_i){var t=al(hp);_i=!0;for(var e=tt.length;e;){for(Dt=tt,tt=[];++Gn<e;)Dt&&Dt[Gn].run();Gn=-1,e=tt.length}Dt=null,_i=!1,dp(t)}}s(ll,"drainQueue");q.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];tt.push(new cl(t,e)),tt.length===1&&!_i&&al(ll)};function cl(t,e){this.fun=t,this.array=e}s(cl,"Item");cl.prototype.run=function(){this.fun.apply(null,this.array)};q.title="browser";q.browser=!0;q.env={};q.argv=[];q.version="";q.versions={};function it(){}s(it,"noop");q.on=it;q.addListener=it;q.once=it;q.off=it;q.removeListener=it;q.removeAllListeners=it;q.emit=it;q.prependListener=it;q.prependOnceListener=it;q.listeners=function(t){return[]};q.binding=function(t){throw new Error("process.binding is not supported")};q.cwd=function(){return"/"};q.chdir=function(t){throw new Error("process.chdir is not supported")};q.umask=function(){return 0}});var $e=A((n_,Nl)=>{"use strict";var{SymbolAsyncIterator:fl,SymbolIterator:dl,SymbolFor:Bt}=D(),hl=Bt("nodejs.stream.destroyed"),pl=Bt("nodejs.stream.errored"),go=Bt("nodejs.stream.readable"),wo=Bt("nodejs.stream.writable"),yl=Bt("nodejs.stream.disturbed"),pp=Bt("nodejs.webstream.isClosedPromise"),yp=Bt("nodejs.webstream.controllerErrorFunction");function Yn(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(Yn,"isReadableNodeStream");function Xn(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(Xn,"isWritableNodeStream");function mp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(mp,"isDuplexNodeStream");function je(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(je,"isNodeStream");function ml(t){return!!(t&&!je(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(ml,"isReadableStream");function bl(t){return!!(t&&!je(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(bl,"isWritableStream");function gl(t){return!!(t&&!je(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(gl,"isTransformStream");function bp(t){return ml(t)||bl(t)||gl(t)}s(bp,"isWebStream");function gp(t,e){return t==null?!1:e===!0?typeof t[fl]=="function":e===!1?typeof t[dl]=="function":typeof t[fl]=="function"||typeof t[dl]=="function"}s(gp,"isIterable");function Jn(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[hl]||n!=null&&n.destroyed)}s(Jn,"isDestroyed");function wl(t){if(!Xn(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(wl,"isWritableEnded");function wp(t,e){if(!Xn(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(wp,"isWritableFinished");function Sp(t){if(!Yn(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(Sp,"isReadableEnded");function Sl(t,e){if(!Yn(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(Sl,"isReadableFinished");function _l(t){return t&&t[go]!=null?t[go]:typeof t?.readable!="boolean"?null:Jn(t)?!1:Yn(t)&&t.readable&&!Sl(t)}s(_l,"isReadable");function El(t){return t&&t[wo]!=null?t[wo]:typeof t?.writable!="boolean"?null:Jn(t)?!1:Xn(t)&&t.writable&&!wl(t)}s(El,"isWritable");function _p(t,e){return je(t)?Jn(t)?!0:!(e?.readable!==!1&&_l(t)||e?.writable!==!1&&El(t)):null}s(_p,"isFinished");function Ep(t){var e,i;return je(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(Ep,"isWritableErrored");function xp(t){var e,i;return je(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(xp,"isReadableErrored");function kp(t){if(!je(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"&&xl(t)?t._closed:null}s(kp,"isClosed");function xl(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(xl,"isOutgoingMessage");function kl(t){return typeof t._sent100=="boolean"&&xl(t)}s(kl,"isServerResponse");function Np(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(Np,"isServerRequest");function Ip(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&kl(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(Ip,"willEmitClose");function Fp(t){var e;return!!(t&&((e=t[yl])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Fp,"isDisturbed");function vp(t){var e,i,n,r,o,a,l,c,u,d;return!!(t&&((e=(i=(n=(r=(o=(a=t[pl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(vp,"isErrored");Nl.exports={isDestroyed:Jn,kIsDestroyed:hl,isDisturbed:Fp,kIsDisturbed:yl,isErrored:vp,kIsErrored:pl,isReadable:_l,kIsReadable:go,kIsClosedPromise:pp,kControllerErrorFunction:yp,kIsWritable:wo,isClosed:kp,isDuplexNodeStream:mp,isFinished:_p,isIterable:gp,isReadableNodeStream:Yn,isReadableStream:ml,isReadableEnded:Sp,isReadableFinished:Sl,isReadableErrored:xp,isNodeStream:je,isWebStream:bp,isWritable:El,isWritableNodeStream:Xn,isWritableStream:bl,isWritableEnded:wl,isWritableFinished:wp,isWritableErrored:Ep,isServerRequest:Np,isServerResponse:kl,willEmitClose:Ip,isTransformStream:gl}});var nt=A((o_,ko)=>{var gt=bt(),{AbortError:Ll,codes:Ap}=ne(),{ERR_INVALID_ARG_TYPE:Tp,ERR_STREAM_PREMATURE_CLOSE:Il}=Ap,{kEmptyObject:_o,once:Eo}=Z(),{validateAbortSignal:Op,validateFunction:Pp,validateObject:Rp,validateBoolean:Lp}=Si(),{Promise:Cp,PromisePrototypeThen:Dp,SymbolDispose:Cl}=D(),{isClosed:Bp,isReadable:Fl,isReadableNodeStream:So,isReadableStream:Mp,isReadableFinished:vl,isReadableErrored:Al,isWritable:Tl,isWritableNodeStream:Ol,isWritableStream:Wp,isWritableFinished:Pl,isWritableErrored:Rl,isNodeStream:Up,willEmitClose:qp,kIsClosedPromise:jp}=$e(),Ei;function $p(t){return t.setHeader&&typeof t.abort=="function"}s($p,"isRequest");var xo=s(()=>{},"nop");function Dl(t,e,i){var n,r;if(arguments.length===2?(i=e,e=_o):e==null?e=_o:Rp(e,"options"),Pp(i,"callback"),Op(e.signal,"options.signal"),i=Eo(i),Mp(t)||Wp(t))return Vp(t,e,i);if(!Up(t))throw new Tp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:So(t),a=(r=e.writable)!==null&&r!==void 0?r:Ol(t),l=t._writableState,c=t._readableState,u=s(()=>{t.writable||b()},"onlegacyfinish"),d=qp(t)&&So(t)===o&&Ol(t)===a,h=Pl(t,!1),b=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||m)&&i.call(t)},"onfinish"),m=vl(t,!1),w=s(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=s($=>{i.call(t,$)},"onerror"),I=Bp(t),S=s(()=>{I=!0;let $=Rl(t)||Al(t);if($&&typeof $!="boolean")return i.call(t,$);if(o&&!m&&So(t,!0)&&!vl(t,!1))return i.call(t,new Il);if(a&&!h&&!Pl(t,!1))return i.call(t,new Il);i.call(t)},"onclose"),T=s(()=>{I=!0;let $=Rl(t)||Al(t);if($&&typeof $!="boolean")return i.call(t,$);i.call(t)},"onclosed"),M=s(()=>{t.req.on("finish",b)},"onrequest");$p(t)?(t.on("complete",b),d||t.on("abort",S),t.req?M():t.on("request",M)):a&&!l&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",S),I?gt.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||gt.nextTick(T):(!o&&(!d||Fl(t))&&(h||Tl(t)===!1)||!a&&(!d||Tl(t))&&(m||Fl(t)===!1)||c&&t.req&&t.aborted)&>.nextTick(T);let F=s(()=>{i=xo,t.removeListener("aborted",S),t.removeListener("complete",b),t.removeListener("abort",S),t.removeListener("request",M),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",S)},"cleanup");if(e.signal&&!I){let $=s(()=>{let St=i;F(),St.call(t,new Ll(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)gt.nextTick($);else{Ei=Ei||Z().addAbortListener;let St=Ei(e.signal,$),fe=i;i=Eo((...Gt)=>{St[Cl](),fe.apply(t,Gt)})}}return F}s(Dl,"eos");function Vp(t,e,i){let n=!1,r=xo;if(e.signal)if(r=s(()=>{n=!0,i.call(t,new Ll(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)gt.nextTick(r);else{Ei=Ei||Z().addAbortListener;let a=Ei(e.signal,r),l=i;i=Eo((...c)=>{a[Cl](),l.apply(t,c)})}let o=s((...a)=>{n||gt.nextTick(()=>i.apply(t,a))},"resolverFn");return Dp(t[jp].promise,o,o),xo}s(Vp,"eosWeb");function zp(t,e){var i;let n=!1;return e===null&&(e=_o),(i=e)!==null&&i!==void 0&&i.cleanup&&(Lp(e.cleanup,"cleanup"),n=e.cleanup),new Cp((r,o)=>{let a=Dl(t,e,l=>{n&&a(),l?o(l):r()})})}s(zp,"finished");ko.exports=Dl;ko.exports.finished=zp});var Mt=A((a_,Vl)=>{"use strict";var Ve=bt(),{aggregateTwoErrors:Hp,codes:{ERR_MULTIPLE_CALLBACK:Kp},AbortError:Gp}=ne(),{Symbol:Wl}=D(),{kIsDestroyed:Yp,isDestroyed:Xp,isFinished:Jp,isServerRequest:Qp}=$e(),Ul=Wl("kDestroy"),No=Wl("kConstruct");function ql(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(ql,"checkError");function Zp(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(ql(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Bl(this,t,e):this.once(Ul,function(o){Bl(this,Hp(o,t),e)}),this)}s(Zp,"destroy");function Bl(t,e,i){let n=!1;function r(o){if(n)return;n=!0;let a=t._readableState,l=t._writableState;ql(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ve.nextTick(ey,t,o):Ve.nextTick(jl,t)}s(r,"onDestroy");try{t._destroy(e||null,r)}catch(o){r(o)}}s(Bl,"_destroy");function ey(t,e){Io(t,e),jl(t)}s(ey,"emitErrorCloseNT");function jl(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(jl,"emitCloseNT");function Io(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(Io,"emitErrorNT");function ty(){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(ty,"undestroy");function Fo(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?Ve.nextTick(Io,t,e):Io(t,e))}s(Fo,"errorOrDestroy");function iy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(No,e),!(t.listenerCount(No)>1)&&Ve.nextTick(ny,t)}s(iy,"construct");function ny(t){let e=!1;function i(n){if(e){Fo(t,n??new Kp);return}e=!0;let r=t._readableState,o=t._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Ul,n):n?Fo(t,n,!0):Ve.nextTick(ry,t)}s(i,"onConstruct");try{t._construct(n=>{Ve.nextTick(i,n)})}catch(n){Ve.nextTick(i,n)}}s(ny,"constructNT");function ry(t){t.emit(No)}s(ry,"emitConstructNT");function Ml(t){return t?.setHeader&&typeof t.abort=="function"}s(Ml,"isRequest");function $l(t){t.emit("close")}s($l,"emitCloseLegacy");function oy(t,e){t.emit("error",e),Ve.nextTick($l,t)}s(oy,"emitErrorCloseLegacy");function sy(t,e){!t||Xp(t)||(!e&&!Jp(t)&&(e=new Gp),Qp(t)?(t.socket=null,t.destroy(e)):Ml(t)?t.abort():Ml(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ve.nextTick(oy,t,e):Ve.nextTick($l,t),t.destroyed||(t[Yp]=!0))}s(sy,"destroyer");Vl.exports={construct:iy,destroyer:sy,destroy:Zp,undestroy:ty,errorOrDestroy:Fo}});var er=A((c_,Hl)=>{"use strict";var{ArrayIsArray:ay,ObjectSetPrototypeOf:zl}=D(),{EventEmitter:Qn}=Qi();function Zn(t){Qn.call(this,t)}s(Zn,"Stream");zl(Zn.prototype,Qn.prototype);zl(Zn,Qn);Zn.prototype.pipe=function(t,e){let i=this;function n(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(d){u(),Qn.listenerCount(this,"error")===0&&this.emit("error",d)}s(c,"onerror"),vo(i,"error",c),vo(t,"error",c);function u(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return s(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function vo(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):ay(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(vo,"prependListener");Hl.exports={Stream:Zn,prependListener:vo}});var Zi=A((f_,tr)=>{"use strict";var{SymbolDispose:ly}=D(),{AbortError:Kl,codes:cy}=ne(),{isNodeStream:Gl,isWebStream:uy,kControllerErrorFunction:fy}=$e(),dy=nt(),{ERR_INVALID_ARG_TYPE:Yl}=cy,Ao,hy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Yl(e,"AbortSignal",t)},"validateAbortSignal");tr.exports.addAbortSignal=s(function(e,i){if(hy(e,"signal"),!Gl(i)&&!uy(i))throw new Yl("stream",["ReadableStream","WritableStream","Stream"],i);return tr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");tr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=Gl(e)?()=>{e.destroy(new Kl(void 0,{cause:t.reason}))}:()=>{e[fy](new Kl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Ao=Ao||Z().addAbortListener;let n=Ao(t,i);dy(e,n[ly])}return e}});var Ql=A((p_,Jl)=>{"use strict";var{StringPrototypeSlice:Xl,SymbolIterator:py,TypedArrayPrototypeSet:ir,Uint8Array:yy}=D(),{Buffer:To}=ke(),{inspect:my}=Z();Jl.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return To.alloc(0);let i=To.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)ir(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[py](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",n=this.head,r=0;do{let o=n.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=Xl(o,0,e),this.head=n,n.data=Xl(o,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=To.allocUnsafe(e),n=e,r=this.head,o=0;do{let a=r.data;if(e>a.length)ir(i,a,n-e),e-=a.length;else{e===a.length?(ir(i,a,n-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(ir(i,new yy(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return my(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var en=A((m_,ic)=>{"use strict";var{MathFloor:by,NumberIsInteger:gy}=D(),{validateInteger:wy}=Si(),{ERR_INVALID_ARG_VALUE:Sy}=ne().codes,Zl=16*1024,ec=16;function _y(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(_y,"highWaterMarkFrom");function tc(t){return t?ec:Zl}s(tc,"getDefaultHighWaterMark");function Ey(t,e){wy(e,"value",0),t?ec=e:Zl=e}s(Ey,"setDefaultHighWaterMark");function xy(t,e,i,n){let r=_y(e,n,i);if(r!=null){if(!gy(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Sy(o,r)}return by(r)}return tc(t.objectMode)}s(xy,"getHighWaterMark");ic.exports={getHighWaterMark:xy,getDefaultHighWaterMark:tc,setDefaultHighWaterMark:Ey}});var oc=A((Oo,rc)=>{var nr=ke(),ze=nr.Buffer;function nc(t,e){for(var i in t)e[i]=t[i]}s(nc,"copyProps");ze.from&&ze.alloc&&ze.allocUnsafe&&ze.allocUnsafeSlow?rc.exports=nr:(nc(nr,Oo),Oo.Buffer=Wt);function Wt(t,e,i){return ze(t,e,i)}s(Wt,"SafeBuffer");Wt.prototype=Object.create(ze.prototype);nc(ze,Wt);Wt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ze(t,e,i)};Wt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ze(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Wt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ze(t)};Wt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return nr.SlowBuffer(t)}});var lc=A(ac=>{"use strict";var Ro=oc().Buffer,sc=Ro.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ky(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(ky,"_normalizeEncoding");function Ny(t){var e=ky(t);if(typeof e!="string"&&(Ro.isEncoding===sc||!sc(t)))throw new Error("Unknown encoding: "+t);return e||t}s(Ny,"normalizeEncoding");ac.StringDecoder=tn;function tn(t){this.encoding=Ny(t);var e;switch(this.encoding){case"utf16le":this.text=Oy,this.end=Py,e=4;break;case"utf8":this.fillLast=vy,e=4;break;case"base64":this.text=Ry,this.end=Ly,e=3;break;default:this.write=Cy,this.end=Dy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ro.allocUnsafe(e)}s(tn,"StringDecoder");tn.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||""};tn.prototype.end=Ty;tn.prototype.text=Ay;tn.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 Po(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Po,"utf8CheckByte");function Iy(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Po(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Po(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Po(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}s(Iy,"utf8CheckIncomplete");function Fy(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(Fy,"utf8CheckExtraBytes");function vy(t){var e=this.lastTotal-this.lastNeed,i=Fy(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(vy,"utf8FillLast");function Ay(t,e){var i=Iy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}s(Ay,"utf8Text");function Ty(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Ty,"utf8End");function Oy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=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(Oy,"utf16Text");function Py(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(Py,"utf16End");function Ry(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Ry,"base64Text");function Ly(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Ly,"base64End");function Cy(t){return t.toString(this.encoding)}s(Cy,"simpleWrite");function Dy(t){return t&&t.length?this.write(t):""}s(Dy,"simpleEnd")});var Lo=A((__,dc)=>{"use strict";var cc=bt(),{PromisePrototypeThen:By,SymbolAsyncIterator:uc,SymbolIterator:fc}=D(),{Buffer:My}=ke(),{ERR_INVALID_ARG_TYPE:Wy,ERR_STREAM_NULL_VALUES:Uy}=ne().codes;function qy(t,e,i){let n;if(typeof e=="string"||e instanceof My)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let r;if(e&&e[uc])r=!0,n=e[uc]();else if(e&&e[fc])r=!1,n=e[fc]();else throw new Wy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,d){By(l(u),()=>cc.nextTick(d,u),h=>cc.nextTick(d,h||u))};async function l(u){let d=u!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:m}=await n.throw(u);if(await b,m)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(l,"close");async function c(){for(;;){try{let{value:u,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=u&&typeof u.then=="function"?await u:u;if(h===null)throw a=!1,new Uy;if(o.push(h))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s(qy,"from");dc.exports=qy});var rn=A((x_,Tc)=>{var Ne=bt(),{ArrayPrototypeIndexOf:jy,NumberIsInteger:$y,NumberIsNaN:Vy,NumberParseInt:zy,ObjectDefineProperties:jo,ObjectKeys:Hy,ObjectSetPrototypeOf:yc,Promise:mc,SafeSet:Ky,SymbolAsyncDispose:Gy,SymbolAsyncIterator:Yy,Symbol:Xy}=D();Tc.exports=E;E.ReadableState=ar;var{EventEmitter:Jy}=Qi(),{Stream:wt,prependListener:Qy}=er(),{Buffer:Co}=ke(),{addAbortSignal:Zy}=Zi(),bc=nt(),N=Z().debuglog("stream",t=>{N=t}),em=Ql(),Ni=Mt(),{getHighWaterMark:tm,getDefaultHighWaterMark:im}=en(),{aggregateTwoErrors:hc,codes:{ERR_INVALID_ARG_TYPE:nm,ERR_METHOD_NOT_IMPLEMENTED:rm,ERR_OUT_OF_RANGE:om,ERR_STREAM_PUSH_AFTER_EOF:sm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:am},AbortError:lm}=ne(),{validateObject:cm}=Si(),Ut=Xy("kPaused"),{StringDecoder:gc}=lc(),um=Lo();yc(E.prototype,wt.prototype);yc(E,wt);var Do=s(()=>{},"nop"),{errorOrDestroy:xi}=Ni,ki=1<<0,fm=1<<1,wc=1<<2,nn=1<<3,Sc=1<<4,rr=1<<5,or=1<<6,_c=1<<7,dm=1<<8,hm=1<<9,pm=1<<10,Uo=1<<11,qo=1<<12,ym=1<<13,mm=1<<14,bm=1<<15,Ec=1<<16,gm=1<<17,wm=1<<18;function H(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(H,"makeBitMapDescriptor");jo(ar.prototype,{objectMode:H(ki),ended:H(fm),endEmitted:H(wc),reading:H(nn),constructed:H(Sc),sync:H(rr),needReadable:H(or),emittedReadable:H(_c),readableListening:H(dm),resumeScheduled:H(hm),errorEmitted:H(pm),emitClose:H(Uo),autoDestroy:H(qo),destroyed:H(ym),closed:H(mm),closeEmitted:H(bm),multiAwaitDrain:H(Ec),readingMore:H(gm),dataEmitted:H(wm)});function ar(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.state=Uo|qo|Sc|rr,t&&t.objectMode&&(this.state|=ki),i&&t&&t.readableObjectMode&&(this.state|=ki),this.highWaterMark=t?tm(this,t,"readableHighWaterMark",i):im(!1),this.buffer=new em,this.length=0,this.pipes=[],this.flowing=null,this[Ut]=null,t&&t.emitClose===!1&&(this.state&=~Uo),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 gc(t.encoding),this.encoding=t.encoding)}s(ar,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof He();this._readableState=new ar(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&&Zy(t.signal,this)),wt.call(this,t),Ni.construct(this,()=>{this._readableState.needReadable&&sr(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=Ni.destroy;E.prototype._undestroy=Ni.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Jy.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[Gy]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new lm,this.destroy(t)),new mc((e,i)=>bc(this,n=>n&&n!==t?i(n):e(null)))};E.prototype.push=function(t,e){return xc(this,t,e,!1)};E.prototype.unshift=function(t,e){return xc(this,t,e,!0)};function xc(t,e,i,n){N("readableAddChunk",e);let r=t._readableState,o;if(r.state&ki||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=Co.from(e,i).toString(r.encoding):(e=Co.from(e,i),i=""))):e instanceof Co?i="":wt._isUint8Array(e)?(e=wt._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new nm("chunk",["string","Buffer","Uint8Array"],e))),o)xi(t,o);else if(e===null)r.state&=~nn,Em(t,r);else if(r.state&ki||e&&e.length>0)if(n)if(r.state&wc)xi(t,new am);else{if(r.destroyed||r.errored)return!1;Bo(t,r,e,!0)}else if(r.ended)xi(t,new sm);else{if(r.destroyed||r.errored)return!1;r.state&=~nn,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?Bo(t,r,e,!1):sr(t,r)):Bo(t,r,e,!1)}else n||(r.state&=~nn,sr(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(xc,"readableAddChunk");function Bo(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Ec?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&or&&lr(t)),sr(t,e)}s(Bo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[Ut]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new gc(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Sm=1073741824;function _m(t){if(t>Sm)throw new om("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(_m,"computeNewHighWaterMark");function pc(t,e){return t<=0||e.length===0&&e.ended?0:e.state&ki?1:Vy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(pc,"howMuchToRead");E.prototype.read=function(t){N("read",t),t===void 0?t=NaN:$y(t)||(t=zy(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=_m(t)),t!==0&&(e.state&=~_c),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return N("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Mo(this):lr(this),null;if(t=pc(t,e),t===0&&e.ended)return e.length===0&&Mo(this),null;let n=(e.state&or)!==0;if(N("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,N("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,N("reading, ended or constructing",n);else if(n){N("do read"),e.state|=nn|rr,e.length===0&&(e.state|=or);try{this._read(e.highWaterMark)}catch(o){xi(this,o)}e.state&=~rr,e.reading||(t=pc(i,e))}let r;return t>0?r=vc(t,e):r=null,r===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&&Mo(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function Em(t,e){if(N("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?lr(t):(e.needReadable=!1,e.emittedReadable=!0,kc(t))}}s(Em,"onEofChunk");function lr(t){let e=t._readableState;N("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(N("emitReadable",e.flowing),e.emittedReadable=!0,Ne.nextTick(kc,t))}s(lr,"emitReadable");function kc(t){let e=t._readableState;N("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,Ic(t)}s(kc,"emitReadable_");function sr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ne.nextTick(xm,t,e))}s(sr,"maybeReadMore");function xm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(N("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(xm,"maybeReadMore_");E.prototype._read=function(t){throw new rm("_read()")};E.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Ky(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),N("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ne.stdout&&t!==Ne.stderr?l:I;n.endEmitted?Ne.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,T){N("onunpipe"),S===i&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){N("onend"),t.end()}s(l,"onend");let c,u=!1;function d(){N("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",I),i.removeListener("data",b),u=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(d,"cleanup");function h(){u||(n.pipes.length===1&&n.pipes[0]===t?(N("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(N("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),c||(c=km(i,t),t.on("drain",c))}s(h,"pause"),i.on("data",b);function b(S){N("ondata");let T=t.write(S);N("dest.write",T),T===!1&&h()}s(b,"ondata");function m(S){if(N("onerror",S),I(),t.removeListener("error",m),t.listenerCount("error")===0){let T=t._writableState||t._readableState;T&&!T.errorEmitted?xi(t,S):t.emit("error",S)}}s(m,"onerror"),Qy(t,"error",m);function w(){t.removeListener("finish",g),I()}s(w,"onclose"),t.once("close",w);function g(){N("onfinish"),t.removeListener("close",w),I()}s(g,"onfinish"),t.once("finish",g);function I(){N("unpipe"),i.unpipe(t)}return s(I,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():n.flowing||(N("pipe resume"),i.resume()),t};function km(t,e){return s(function(){let n=t._readableState;n.awaitDrainWriters===e?(N("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(N("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(km,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=jy(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=wt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,N("on readable",n.length,n.reading),n.length?lr(this):n.reading||Ne.nextTick(Nm,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=wt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ne.nextTick(Nc,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=wt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ne.nextTick(Nc,this),e};function Nc(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ut]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Nc,"updateReadableListening");function Nm(t){N("readable nexttick read 0"),t.read(0)}s(Nm,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(N("resume"),t.flowing=!t.readableListening,Im(this,t)),t[Ut]=!1,this};function Im(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ne.nextTick(Fm,t,e))}s(Im,"resume");function Fm(t,e){N("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ic(t),e.flowing&&!e.reading&&t.read(0)}s(Fm,"resume_");E.prototype.pause=function(){return N("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(N("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ut]=!0,this};function Ic(t){let e=t._readableState;for(N("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Ic,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{xi(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Hy(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};E.prototype[Yy]=function(){return Fc(this)};E.prototype.iterator=function(t){return t!==void 0&&cm(t,"options"),Fc(this,t)};function Fc(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=vm(t,e);return i.stream=t,i}s(Fc,"streamToAsyncIterator");async function*vm(t,e){let i=Do;function n(a){this===t?(i(),i=Do):i=a}s(n,"next"),t.on("readable",n);let r,o=bc(t,{writable:!1},a=>{r=a?hc(r,a):null,i(),i=Do});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new mc(n)}}}catch(a){throw r=hc(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?Ni.destroyer(t,null):(t.off("readable",n),o())}}s(vm,"createAsyncIterator");jo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});jo(ar.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Ut]!==!1},set(t){this[Ut]=!!t}}});E._fromList=vc;function vc(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(vc,"fromList");function Mo(t){let e=t._readableState;N("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ne.nextTick(Am,e,t))}s(Mo,"endReadable");function Am(t,e){if(N("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)Ne.nextTick(Tm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Am,"endReadableNT");function Tm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Tm,"endWritableNT");E.from=function(t,e){return um(E,t,e)};var Wo;function Ac(){return Wo===void 0&&(Wo={}),Wo}s(Ac,"lazyWebStreams");E.fromWeb=function(t,e){return Ac().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Ac().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,n;return new E({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(r,o){Ni.destroyer(t,r),o(r)}}).wrap(t)}});var hr=A((N_,jc)=>{var qt=bt(),{ArrayPrototypeSlice:Rc,Error:Om,FunctionPrototypeSymbolHasInstance:Lc,ObjectDefineProperty:Cc,ObjectDefineProperties:Pm,ObjectSetPrototypeOf:Dc,StringPrototypeToLowerCase:Rm,Symbol:Lm,SymbolHasInstance:Cm}=D();jc.exports=B;B.WritableState=an;var{EventEmitter:Dm}=Qi(),on=er().Stream,{Buffer:cr}=ke(),dr=Mt(),{addAbortSignal:Bm}=Zi(),{getHighWaterMark:Mm,getDefaultHighWaterMark:Wm}=en(),{ERR_INVALID_ARG_TYPE:Um,ERR_METHOD_NOT_IMPLEMENTED:qm,ERR_MULTIPLE_CALLBACK:Bc,ERR_STREAM_CANNOT_PIPE:jm,ERR_STREAM_DESTROYED:sn,ERR_STREAM_ALREADY_FINISHED:$m,ERR_STREAM_NULL_VALUES:Vm,ERR_STREAM_WRITE_AFTER_END:zm,ERR_UNKNOWN_ENCODING:Mc}=ne().codes,{errorOrDestroy:Ii}=dr;Dc(B.prototype,on.prototype);Dc(B,on);function zo(){}s(zo,"nop");var Fi=Lm("kOnFinished");function an(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Mm(this,t,"writableHighWaterMark",i):Wm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Km.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,fr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Fi]=[]}s(an,"WritableState");function fr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(fr,"resetBuffer");an.prototype.getBuffer=s(function(){return Rc(this.buffered,this.bufferedIndex)},"getBuffer");Cc(an.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(t){let e=this instanceof He();if(!e&&!Lc(B,this))return new B(t);this._writableState=new an(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&&Bm(t.signal,this)),on.call(this,t),dr.construct(this,()=>{let i=this._writableState;i.writing||Ko(this,i),Go(this,i)})}s(B,"Writable");Cc(B,Cm,{__proto__:null,value:function(t){return Lc(this,t)?!0:this!==B?!1:t&&t._writableState instanceof an}});B.prototype.pipe=function(){Ii(this,new jm)};function Wc(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!cr.isEncoding(i))throw new Mc(i);typeof n!="function"&&(n=zo)}if(e===null)throw new Vm;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=cr.from(e,i),i="buffer");else if(e instanceof cr)i="buffer";else if(on._isUint8Array(e))e=on._uint8ArrayToBuffer(e),i="buffer";else throw new Um("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new zm:r.destroyed&&(o=new sn("write")),o?(qt.nextTick(n,o),Ii(t,o,!0),o):(r.pendingcb++,Hm(t,r,e,i,n))}s(Wc,"_write");B.prototype.write=function(t,e,i){return Wc(this,t,e,i)===!0};B.prototype.cork=function(){this._writableState.corked++};B.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ko(this,t))};B.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Rm(e)),!cr.isEncoding(e))throw new Mc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Hm(t,e,i,n,r){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:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==zo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(Hm,"writeOrBuffer");function Oc(t,e,i,n,r,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new sn("write")):i?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}s(Oc,"doWrite");function Pc(t,e,i,n){--e.pendingcb,n(i),Ho(e),Ii(t,i)}s(Pc,"onwriteError");function Km(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Ii(t,new Bc);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),n?qt.nextTick(Pc,t,i,e,r):Pc(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&Ko(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},qt.nextTick(Gm,i.afterWriteTickInfo)):Uc(t,i,1,r))}s(Km,"onwrite");function Gm({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,Uc(t,e,i,n)}s(Gm,"afterWriteTick");function Uc(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&Ho(e),Go(t,e)}s(Uc,"afterWrite");function Ho(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:a}=t.buffered[r],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new sn("write"))}let i=t[Fi].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new sn("end"))}fr(t)}s(Ho,"errorBuffer");function Ko(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?zo:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},c=e.allNoop&&a===0?i:Rc(i,a);c.allBuffers=e.allBuffers,Oc(t,e,!0,e.length,c,"",l),fr(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let d=r?1:l.length;Oc(t,e,!1,d,l,c,u)}while(a<i.length&&!e.writing);a===i.length?fr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Ko,"clearBuffer");B.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new qm("_write()")};B.prototype._writev=null;B.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let o=Wc(this,t,e);o instanceof Om&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Go(this,n,!0),n.ended=!0):n.finished?r=new $m("end"):n.destroyed&&(r=new sn("end"))),typeof i=="function"&&(r||n.finished?qt.nextTick(i,r):n[Fi].push(i)),this};function ur(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(ur,"needFinish");function Ym(t,e){let i=!1;function n(r){if(i){Ii(t,r??Bc());return}if(i=!0,e.pendingcb--,r){let o=e[Fi].splice(0);for(let a=0;a<o.length;a++)o[a](r);Ii(t,r,e.sync)}else ur(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,qt.nextTick(Vo,t,e))}s(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}s(Ym,"callFinal");function Xm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Ym(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(Xm,"prefinish");function Go(t,e,i){ur(e)&&(Xm(t,e),e.pendingcb===0&&(i?(e.pendingcb++,qt.nextTick((n,r)=>{ur(r)?Vo(n,r):r.pendingcb--},t,e)):ur(e)&&(e.pendingcb++,Vo(t,e))))}s(Go,"finishMaybe");function Vo(t,e){e.pendingcb--,e.finished=!0;let i=e[Fi].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}s(Vo,"finish");Pm(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Jm=dr.destroy;B.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Fi].length)&&qt.nextTick(Ho,i),Jm.call(this,t,e),this};B.prototype._undestroy=dr.undestroy;B.prototype._destroy=function(t,e){e(t)};B.prototype[Dm.captureRejectionSymbol]=function(t){this.destroy(t)};var $o;function qc(){return $o===void 0&&($o={}),$o}s(qc,"lazyWebStreams");B.fromWeb=function(t,e){return qc().newStreamWritableFromWritableStream(t,e)};B.toWeb=function(t){return qc().newWritableStreamFromStreamWritable(t)}});var nu=A((F_,iu)=>{var Yo=bt(),Qm=ke(),{isReadable:Zm,isWritable:eb,isIterable:$c,isNodeStream:tb,isReadableNodeStream:Vc,isWritableNodeStream:zc,isDuplexNodeStream:ib,isReadableStream:Hc,isWritableStream:Kc}=$e(),Gc=nt(),{AbortError:eu,codes:{ERR_INVALID_ARG_TYPE:nb,ERR_INVALID_RETURN_VALUE:Yc}}=ne(),{destroyer:Ai}=Mt(),rb=He(),tu=rn(),ob=hr(),{createDeferredPromise:Xc}=Z(),Jc=Lo(),Qc=globalThis.Blob||Qm.Blob,sb=s(typeof Qc<"u"?function(e){return e instanceof Qc}:function(e){return!1},"isBlob"),ab=globalThis.AbortController||bi().AbortController,{FunctionPrototypeCall:Zc}=D(),rt=class extends rb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(rt,"Duplexify");iu.exports=s(function t(e,i){if(ib(e))return e;if(Vc(e))return vi({readable:e});if(zc(e))return vi({writable:e});if(tb(e))return vi({writable:!1,readable:!1});if(Hc(e))return vi({readable:tu.fromWeb(e)});if(Kc(e))return vi({writable:ob.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:a,destroy:l}=lb(e);if($c(r))return Jc(rt,r,{objectMode:!0,write:o,final:a,destroy:l});let c=r?.then;if(typeof c=="function"){let u,d=Zc(c,r,h=>{if(h!=null)throw new Yc("nully","body",h)},h=>{Ai(u,h)});return u=new rt({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Yo.nextTick(h,null)}catch(b){Yo.nextTick(h,b)}})},destroy:l})}throw new Yc("Iterable, AsyncIterable or AsyncFunction",i,r)}if(sb(e))return t(e.arrayBuffer());if($c(e))return Jc(rt,e,{objectMode:!0,writable:!1});if(Hc(e?.readable)&&Kc(e?.writable))return rt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?Vc(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?zc(e?.writable)?e?.writable:t(e.writable):void 0;return vi({readable:r,writable:o})}let n=e?.then;if(typeof n=="function"){let r;return Zc(n,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ai(r,o)}),r=new rt({objectMode:!0,writable:!1,read(){}})}throw new nb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function lb(t){let{promise:e,resolve:i}=Xc(),n=new ab,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Yo.nextTick(u),c)return;if(r.aborted)throw new eu(void 0,{cause:r.reason});({promise:e,resolve:i}=Xc()),yield l}}(),{signal:r}),write(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){n.abort(),l(a)}}}s(lb,"fromAsyncGen");function vi(t){let e=t.readable&&typeof t.readable.read!="function"?tu.wrap(t.readable):t.readable,i=t.writable,n=!!Zm(e),r=!!eb(i),o,a,l,c,u;function d(h){let b=c;c=null,b?b(h):h&&u.destroy(h)}return s(d,"onfinished"),u=new rt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Gc(i,h=>{r=!1,h&&Ai(e,h),d(h)}),u._write=function(h,b,m){i.write(h,b)?m():o=m},u._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),n&&(Gc(e,h=>{n=!1,h&&Ai(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){l=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,b){!h&&c!==null&&(h=new eu),l=null,o=null,a=null,c===null?b(h):(c=b,Ai(i,h),Ai(e,h))},u}s(vi,"_duplexify")});var He=A((A_,su)=>{"use strict";var{ObjectDefineProperties:cb,ObjectGetOwnPropertyDescriptor:ot,ObjectKeys:ub,ObjectSetPrototypeOf:ru}=D();su.exports=Ie;var Qo=rn(),_e=hr();ru(Ie.prototype,Qo.prototype);ru(Ie,Qo);{let t=ub(_e.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ie.prototype[i]||(Ie.prototype[i]=_e.prototype[i])}}function Ie(t){if(!(this instanceof Ie))return new Ie(t);Qo.call(this,t),_e.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ie,"Duplex");cb(Ie.prototype,{writable:{__proto__:null,...ot(_e.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ot(_e.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ot(_e.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ot(_e.prototype,"writableBuffer")},writableLength:{__proto__:null,...ot(_e.prototype,"writableLength")},writableFinished:{__proto__:null,...ot(_e.prototype,"writableFinished")},writableCorked:{__proto__:null,...ot(_e.prototype,"writableCorked")},writableEnded:{__proto__:null,...ot(_e.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ot(_e.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Xo;function ou(){return Xo===void 0&&(Xo={}),Xo}s(ou,"lazyWebStreams");Ie.fromWeb=function(t,e){return ou().newStreamDuplexFromReadableWritablePair(t,e)};Ie.toWeb=function(t){return ou().newReadableWritablePairFromDuplex(t)};var Jo;Ie.from=function(t){return Jo||(Jo=nu()),Jo(t,"body")}});var ts=A((O_,lu)=>{"use strict";var{ObjectSetPrototypeOf:au,Symbol:fb}=D();lu.exports=st;var{ERR_METHOD_NOT_IMPLEMENTED:db}=ne().codes,es=He(),{getHighWaterMark:hb}=en();au(st.prototype,es.prototype);au(st,es);var ln=fb("kCallback");function st(t){if(!(this instanceof st))return new st(t);let e=t?hb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),es.call(this,t),this._readableState.sync=!1,this[ln]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",pb)}s(st,"Transform");function Zo(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(Zo,"final");function pb(){this._final!==Zo&&Zo.call(this)}s(pb,"prefinish");st.prototype._final=Zo;st.prototype._transform=function(t,e,i){throw new db("_transform()")};st.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),r.ended||o===n.length||n.length<n.highWaterMark?i():this[ln]=i})};st.prototype._read=function(){if(this[ln]){let t=this[ln];this[ln]=null,t()}}});var ns=A((R_,uu)=>{"use strict";var{ObjectSetPrototypeOf:cu}=D();uu.exports=Ti;var is=ts();cu(Ti.prototype,is.prototype);cu(Ti,is);function Ti(t){if(!(this instanceof Ti))return new Ti(t);is.call(this,t)}s(Ti,"PassThrough");Ti.prototype._transform=function(t,e,i){i(null,t)}});var br=A((C_,yu)=>{var cn=bt(),{ArrayIsArray:yb,Promise:mb,SymbolAsyncIterator:bb,SymbolDispose:gb}=D(),mr=nt(),{once:wb}=Z(),Sb=Mt(),fu=He(),{aggregateTwoErrors:_b,codes:{ERR_INVALID_ARG_TYPE:ds,ERR_INVALID_RETURN_VALUE:rs,ERR_MISSING_ARGS:Eb,ERR_STREAM_DESTROYED:xb,ERR_STREAM_PREMATURE_CLOSE:kb},AbortError:Nb}=ne(),{validateFunction:Ib,validateAbortSignal:Fb}=Si(),{isIterable:jt,isReadable:os,isReadableNodeStream:yr,isNodeStream:du,isTransformStream:Oi,isWebStream:vb,isReadableStream:ss,isReadableFinished:Ab}=$e(),Tb=globalThis.AbortController||bi().AbortController,as,ls,cs;function hu(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=mr(t,{readable:e,writable:i},o=>{n=!o});return{destroy:o=>{n||(n=!0,Sb.destroyer(t,o||new xb("pipe")))},cleanup:r}}s(hu,"destroyer");function Ob(t){return Ib(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Ob,"popCallback");function us(t){if(jt(t))return t;if(yr(t))return Pb(t);throw new ds("val",["Readable","Iterable","AsyncIterable"],t)}s(us,"makeAsyncIterable");async function*Pb(t){ls||(ls=rn()),yield*ls.prototype[bb].call(t)}s(Pb,"fromReadable");async function pr(t,e,i,{end:n}){let r,o=null,a=s(u=>{if(u&&(r=u),o){let d=o;o=null,d()}},"resume"),l=s(()=>new mb((u,d)=>{r?d(r):o=s(()=>{r?d(r):u()},"onresolve")}),"wait");e.on("drain",a);let c=mr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();n&&(e.end(),await l()),i()}catch(u){i(r!==u?_b(r,u):u)}finally{c(),e.off("drain",a)}}s(pr,"pumpToNode");async function fs(t,e,i,{end:n}){Oi(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(fs,"pumpToWeb");function Rb(...t){return pu(t,wb(Ob(t)))}s(Rb,"pipeline");function pu(t,e,i){if(t.length===1&&yb(t[0])&&(t=t[0]),t.length<2)throw new Eb("streams");let n=new Tb,r=n.signal,o=i?.signal,a=[];Fb(o,"options.signal");function l(){w(new Nb)}s(l,"abort"),cs=cs||Z().addAbortListener;let c;o&&(c=cs(o,l));let u,d,h=[],b=0;function m(M){w(M,--b===0)}s(m,"finish");function w(M,F){var $;if(M&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=M),!(!u&&!F)){for(;h.length;)h.shift()(u);($=c)===null||$===void 0||$[gb](),n.abort(),F&&(u||a.forEach(St=>St()),cn.nextTick(e,u,d))}}s(w,"finishImpl");let g;for(let M=0;M<t.length;M++){let F=t[M],$=M<t.length-1,St=M>0,fe=$||i?.end!==!1,Gt=M===t.length-1;if(du(F)){let oe=function(Ge){Ge&&Ge.name!=="AbortError"&&Ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Ge)};var T=oe;if(s(oe,"onError"),fe){let{destroy:Ge,cleanup:Pr}=hu(F,$,St);h.push(Ge),os(F)&&Gt&&a.push(Pr)}F.on("error",oe),os(F)&&Gt&&a.push(()=>{F.removeListener("error",oe)})}if(M===0)if(typeof F=="function"){if(g=F({signal:r}),!jt(g))throw new rs("Iterable, AsyncIterable or Stream","source",g)}else jt(F)||yr(F)||Oi(F)?g=F:g=fu.from(F);else if(typeof F=="function"){if(Oi(g)){var I;g=us((I=g)===null||I===void 0?void 0:I.readable)}else g=us(g);if(g=F(g,{signal:r}),$){if(!jt(g,!0))throw new rs("AsyncIterable",`transform[${M-1}]`,g)}else{var S;as||(as=ns());let oe=new as({objectMode:!0}),Ge=(S=g)===null||S===void 0?void 0:S.then;if(typeof Ge=="function")b++,Ge.call(g,ft=>{d=ft,ft!=null&&oe.write(ft),fe&&oe.end(),cn.nextTick(m)},ft=>{oe.destroy(ft),cn.nextTick(m,ft)});else if(jt(g,!0))b++,pr(g,oe,m,{end:fe});else if(ss(g)||Oi(g)){let ft=g.readable||g;b++,pr(ft,oe,m,{end:fe})}else throw new rs("AsyncIterable or Promise","destination",g);g=oe;let{destroy:Pr,cleanup:Wf}=hu(g,!1,!0);h.push(Pr),Gt&&a.push(Wf)}}else if(du(F)){if(yr(g)){b+=2;let oe=Lb(g,F,m,{end:fe});os(F)&&Gt&&a.push(oe)}else if(Oi(g)||ss(g)){let oe=g.readable||g;b++,pr(oe,F,m,{end:fe})}else if(jt(g))b++,pr(g,F,m,{end:fe});else throw new ds("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if(vb(F)){if(yr(g))b++,fs(us(g),F,m,{end:fe});else if(ss(g)||jt(g))b++,fs(g,F,m,{end:fe});else if(Oi(g))b++,fs(g.readable,F,m,{end:fe});else throw new ds("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=fu.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&cn.nextTick(l),g}s(pu,"pipelineImpl");function Lb(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new kb)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var o=a;s(a,"endFn"),Ab(t)?cn.nextTick(a):t.once("end",a)}else i();return mr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),mr(e,{readable:!1,writable:!0},i)}s(Lb,"pipe");yu.exports={pipelineImpl:pu,pipeline:Rb}});var ps=A((B_,_u)=>{"use strict";var{pipeline:Cb}=br(),gr=He(),{destroyer:Db}=Mt(),{isNodeStream:wr,isReadable:mu,isWritable:bu,isWebStream:hs,isTransformStream:$t,isWritableStream:gu,isReadableStream:wu}=$e(),{AbortError:Bb,codes:{ERR_INVALID_ARG_VALUE:Su,ERR_MISSING_ARGS:Mb}}=ne(),Wb=nt();_u.exports=s(function(...e){if(e.length===0)throw new Mb("streams");if(e.length===1)return gr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=gr.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=gr.from(e[m])}for(let m=0;m<e.length;++m)if(!(!wr(e[m])&&!hs(e[m]))){if(m<e.length-1&&!(mu(e[m])||wu(e[m])||$t(e[m])))throw new Su(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(bu(e[m])||gu(e[m])||$t(e[m])))throw new Su(`streams[${m}]`,i[m],"must be writable")}let n,r,o,a,l;function c(m){let w=a;a=null,w?w(m):m?l.destroy(m):!b&&!h&&l.destroy()}s(c,"onfinished");let u=e[0],d=Cb(e,c),h=!!(bu(u)||gu(u)||$t(u)),b=!!(mu(d)||wu(d)||$t(d));if(l=new gr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(wr(u))l._write=function(w,g,I){u.write(w,g)?I():n=I},l._final=function(w){u.end(),r=w},u.on("drain",function(){if(n){let w=n;n=null,w()}});else if(hs(u)){let g=($t(u)?u.writable:u).getWriter();l._write=async function(I,S,T){try{await g.ready,g.write(I).catch(()=>{}),T()}catch(M){T(M)}},l._final=async function(I){try{await g.ready,g.close().catch(()=>{}),r=I}catch(S){I(S)}}}let m=$t(d)?d.readable:d;Wb(m,()=>{if(r){let w=r;r=null,w()}})}if(b){if(wr(d))d.on("readable",function(){if(o){let m=o;o=null,m()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=d.read();if(m===null){o=l._read;return}if(!l.push(m))return}};else if(hs(d)){let w=($t(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:g,done:I}=await w.read();if(!l.push(g))return;if(I){l.push(null);return}}catch{return}}}}return l._destroy=function(m,w){!m&&a!==null&&(m=new Bb),o=null,n=null,r=null,a===null?w(m):(a=w,wr(d)&&Db(d,m))},l},"compose")});var Ou=A((W_,ms)=>{"use strict";var Ub=globalThis.AbortController||bi().AbortController,{codes:{ERR_INVALID_ARG_VALUE:qb,ERR_INVALID_ARG_TYPE:un,ERR_MISSING_ARGS:jb,ERR_OUT_OF_RANGE:$b},AbortError:Ke}=ne(),{validateAbortSignal:Vt,validateInteger:Eu,validateObject:zt}=Si(),Vb=D().Symbol("kWeak"),zb=D().Symbol("kResistStopPropagation"),{finished:Hb}=nt(),Kb=ps(),{addAbortSignalNoValidate:Gb}=Zi(),{isWritable:Yb,isNodeStream:Xb}=$e(),{deprecate:Jb}=Z(),{ArrayPrototypePush:Qb,Boolean:Zb,MathFloor:xu,Number:eg,NumberIsNaN:tg,Promise:ku,PromiseReject:Nu,PromiseResolve:ig,PromisePrototypeThen:Iu,Symbol:vu}=D(),_r=vu("kEmpty"),Fu=vu("kEof");function ng(t,e){if(e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),Xb(t)&&!Yb(t))throw new qb("stream",t,"must be writable");let i=Kb(this,t);return e!=null&&e.signal&&Gb(e.signal,i),i}s(ng,"compose");function Er(t,e){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=xu(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=xu(e.highWaterMark)),Eu(i,"options.concurrency",1),Eu(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(Zb)),a=this,l=[],c={signal:o},u,d,h=!1,b=0;function m(){h=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&l.length<n&&(d(),d=null)}s(g,"maybeResume");async function I(){try{for await(let S of a){if(h)return;if(o.aborted)throw new Ke;try{if(S=t(S,c),S===_r)continue;S=ig(S)}catch(T){S=Nu(T)}b+=1,Iu(S,w,m),l.push(S),u&&(u(),u=null),!h&&(l.length>=n||b>=i)&&await new ku(T=>{d=T})}l.push(Fu)}catch(S){let T=Nu(S);Iu(T,w,m),l.push(T)}finally{h=!0,u&&(u(),u=null)}}s(I,"pump"),I();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Fu)return;if(o.aborted)throw new Ke;S!==_r&&(yield S),l.shift(),g()}await new ku(S=>{u=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Er,"map");function rg(t=void 0){return t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ke({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(rg,"asIndexedPairs");async function Au(t,e=void 0){for await(let i of ys.call(this,t,e))return!0;return!1}s(Au,"some");async function og(t,e=void 0){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);return!await Au.call(this,async(...i)=>!await t(...i),e)}s(og,"every");async function sg(t,e){for await(let i of ys.call(this,t,e))return i}s(sg,"find");async function ag(t,e){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),_r}s(i,"forEachFn");for await(let n of Er.call(this,i,e));}s(ag,"forEach");function ys(t,e){if(typeof t!="function")throw new un("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:_r}return s(i,"filterFn"),Er.call(this,i,e)}s(ys,"filter");var Sr=class extends jb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(Sr,"ReduceAwareErrMissingArgs");async function lg(t,e,i){var n;if(typeof t!="function")throw new un("reducer",["Function","AsyncFunction"],t);i!=null&&zt(i,"options"),i?.signal!=null&&Vt(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let u=new Ke(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Hb(this.destroy(u)),u}let o=new Ub,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[Vb]:this,[zb]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Ke;r?e=await t(e,u,{signal:a}):(e=u,r=!0)}if(!l&&!r)throw new Sr}finally{o.abort()}return e}s(lg,"reduce");async function cg(t){t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Ke(void 0,{cause:t.signal.reason});Qb(e,n)}return e}s(cg,"toArray");function ug(t,e){let i=Er.call(this,t,e);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(ug,"flatMap");function Tu(t){if(t=eg(t),tg(t))return 0;if(t<0)throw new $b("number",">= 0",t);return t}s(Tu,"toIntegerOrInfinity");function fg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=Tu(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ke;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ke;t--<=0&&(yield o)}},"drop").call(this)}s(fg,"drop");function dg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=Tu(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ke;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ke;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(dg,"take");ms.exports.streamReturningOperators={asIndexedPairs:Jb(rg,"readable.asIndexedPairs will be removed in a future version."),drop:fg,filter:ys,flatMap:ug,map:Er,take:dg,compose:ng};ms.exports.promiseReturningOperators={every:og,forEach:ag,reduce:lg,toArray:cg,some:Au,find:sg}});var bs=A((q_,Pu)=>{"use strict";var{ArrayPrototypePop:hg,Promise:pg}=D(),{isIterable:yg,isNodeStream:mg,isWebStream:bg}=$e(),{pipelineImpl:gg}=br(),{finished:wg}=nt();gs();function Sg(...t){return new pg((e,i)=>{let n,r,o=t[t.length-1];if(o&&typeof o=="object"&&!mg(o)&&!yg(o)&&!bg(o)){let a=hg(t);n=a.signal,r=a.end}gg(t,(a,l)=>{a?i(a):e(l)},{signal:n,end:r})})}s(Sg,"pipeline");Pu.exports={finished:wg,pipeline:Sg}});var gs=A(($_,qu)=>{var{Buffer:_g}=ke(),{ObjectDefineProperty:at,ObjectKeys:Cu,ReflectApply:Du}=D(),{promisify:{custom:Bu}}=Z(),{streamReturningOperators:Ru,promiseReturningOperators:Lu}=Ou(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Mu}}=ne(),Eg=ps(),{setDefaultHighWaterMark:xg,getDefaultHighWaterMark:kg}=en(),{pipeline:Wu}=br(),{destroyer:Ng}=Mt(),Uu=nt(),ws=bs(),fn=$e(),L=qu.exports=er().Stream;L.isDestroyed=fn.isDestroyed;L.isDisturbed=fn.isDisturbed;L.isErrored=fn.isErrored;L.isReadable=fn.isReadable;L.isWritable=fn.isWritable;L.Readable=rn();for(let t of Cu(Ru)){let i=function(...n){if(new.target)throw Mu();return L.Readable.from(Du(e,this,n))};Fg=i,s(i,"fn");let e=Ru[t];at(i,"name",{__proto__:null,value:e.name}),at(i,"length",{__proto__:null,value:e.length}),at(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fg;for(let t of Cu(Lu)){let i=function(...r){if(new.target)throw Mu();return Du(e,this,r)};Fg=i,s(i,"fn");let e=Lu[t];at(i,"name",{__proto__:null,value:e.name}),at(i,"length",{__proto__:null,value:e.length}),at(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fg;L.Writable=hr();L.Duplex=He();L.Transform=ts();L.PassThrough=ns();L.pipeline=Wu;var{addAbortSignal:Ig}=Zi();L.addAbortSignal=Ig;L.finished=Uu;L.destroy=Ng;L.compose=Eg;L.setDefaultHighWaterMark=xg;L.getDefaultHighWaterMark=kg;at(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ws}});at(Wu,Bu,{__proto__:null,enumerable:!0,get(){return ws.pipeline}});at(Uu,Bu,{__proto__:null,enumerable:!0,get(){return ws.finished}});L.Stream=L;L._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=s(function(e){return _g.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var ju=A((z_,j)=>{"use strict";var K=gs(),vg=bs(),Ag=K.Readable.destroy;j.exports=K.Readable;j.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer;j.exports._isUint8Array=K._isUint8Array;j.exports.isDisturbed=K.isDisturbed;j.exports.isErrored=K.isErrored;j.exports.isReadable=K.isReadable;j.exports.Readable=K.Readable;j.exports.Writable=K.Writable;j.exports.Duplex=K.Duplex;j.exports.Transform=K.Transform;j.exports.PassThrough=K.PassThrough;j.exports.addAbortSignal=K.addAbortSignal;j.exports.finished=K.finished;j.exports.destroy=K.destroy;j.exports.destroy=Ag;j.exports.pipeline=K.pipeline;j.exports.compose=K.compose;Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return vg}});j.exports.Stream=K.Stream;j.exports.default=j.exports});var Lg={};gn(Lg,{ActionType:()=>En,ApiError:()=>f,Async:()=>Ur,AsyncIndexFS:()=>vn,AsyncStoreFS:()=>In,BigIntStats:()=>Y,BigIntStatsFs:()=>Sn,Dir:()=>et,Dirent:()=>Ze,ErrorCode:()=>z,File:()=>Bi,FileIndex:()=>At,FileSystem:()=>ie,FileType:()=>U,InMemory:()=>ji,InMemoryStore:()=>qi,IndexDirInode:()=>Xe,IndexFS:()=>ni,IndexFileInode:()=>$i,IndexInode:()=>ii,Inode:()=>de,LockedFS:()=>oi,Mutex:()=>ri,NoSyncFile:()=>Ft,Overlay:()=>Ed,OverlayFS:()=>si,PreloadFile:()=>te,ReadStream:()=>lt,Readonly:()=>qr,SimpleSyncTransaction:()=>ei,Stats:()=>W,StatsCommon:()=>Jt,StatsFs:()=>Qt,Sync:()=>Wr,SyncIndexFS:()=>Fn,SyncStoreFS:()=>ti,UnlockedOverlayFS:()=>Vi,WriteStream:()=>ct,_toUnixTimestamp:()=>_d,access:()=>kf,accessSync:()=>va,appendFile:()=>Zu,appendFileSync:()=>ya,checkOptions:()=>An,chmod:()=>wf,chmodSync:()=>Na,chown:()=>bf,chownSync:()=>xa,close:()=>tf,closeSync:()=>Qe,configure:()=>Pg,constants:()=>It,copyFile:()=>Pf,copyFileSync:()=>ao,cp:()=>Df,cpSync:()=>lo,createBackend:()=>xd,createReadStream:()=>vf,createWriteStream:()=>Af,decode:()=>kn,decodeDirListing:()=>Ui,default:()=>Rg,encode:()=>Be,encodeDirListing:()=>ce,errorMessages:()=>Lr,exists:()=>zu,existsSync:()=>hi,fchmod:()=>cf,fchmodSync:()=>Bn,fchown:()=>lf,fchownSync:()=>Dn,fdatasync:()=>of,fdatasyncSync:()=>ga,flagToMode:()=>dt,flagToNumber:()=>wd,flagToString:()=>Us,fs:()=>bn,fstat:()=>ef,fstatSync:()=>ma,fsync:()=>rf,fsyncSync:()=>ba,ftruncate:()=>nf,ftruncateSync:()=>io,futimes:()=>uf,futimesSync:()=>Mn,isAppendable:()=>ht,isBackend:()=>zi,isBackendConfig:()=>Vr,isExclusive:()=>js,isReadable:()=>Ye,isSynchronous:()=>Di,isTruncating:()=>qs,isWriteable:()=>pe,lchmod:()=>Sf,lchmodSync:()=>Ia,lchown:()=>gf,lchownSync:()=>ka,levenshtein:()=>jr,link:()=>pf,linkSync:()=>_a,lopenSync:()=>Xi,lstat:()=>Ku,lstatSync:()=>to,lutimes:()=>Ef,lutimesSync:()=>Fa,mkdir:()=>df,mkdirSync:()=>Wn,mkdirpSync:()=>$s,mkdtemp:()=>Of,mkdtempSync:()=>Aa,mount:()=>Ki,mountMapping:()=>Gi,mounts:()=>ge,nop:()=>_,normalizeMode:()=>ye,normalizeOptions:()=>me,normalizePath:()=>v,normalizeTime:()=>vt,open:()=>Xu,openAsBlob:()=>Mf,openSync:()=>yi,opendir:()=>Cf,opendirSync:()=>Pa,parseFlag:()=>R,pathExistsAction:()=>Mi,pathNotExistsAction:()=>Wi,promises:()=>mn,randomIno:()=>Zt,read:()=>af,readFile:()=>Ju,readFileSync:()=>Cn,readSync:()=>Sa,readdir:()=>hf,readdirSync:()=>mi,readlink:()=>mf,readlinkSync:()=>ro,readv:()=>Rf,readvSync:()=>Ta,realpath:()=>xf,realpathSync:()=>di,rename:()=>Vu,renameSync:()=>da,resolveMountConfig:()=>Cs,rm:()=>Tf,rmSync:()=>so,rmdir:()=>ff,rmdirSync:()=>no,rootCred:()=>De,rootIno:()=>he,setImmediate:()=>Sd,size_max:()=>_n,stat:()=>Hu,statSync:()=>Yi,statfs:()=>Bf,statfsSync:()=>Ra,symlink:()=>yf,symlinkSync:()=>Ea,truncate:()=>Gu,truncateSync:()=>ha,umount:()=>Rn,unlink:()=>Yu,unlinkSync:()=>Ln,unwatchFile:()=>If,utimes:()=>_f,utimesSync:()=>oo,watch:()=>Ff,watchFile:()=>Nf,write:()=>sf,writeFile:()=>Qu,writeFileSync:()=>Ji,writeSync:()=>wa,writev:()=>Lf,writevSync:()=>Oa});var z=(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))(z||{}),Lr={[1]:"Operation not permitted",[2]:"No such file or directory",[4]:"Interrupted system call",[5]:"Input/output error",[6]:"No such device or address",[9]:"Bad file descriptor",[11]:"Resource temporarily unavailable",[12]:"Cannot allocate memory",[13]:"Permission denied",[14]:"Bad address",[15]:"Block device required",[16]:"Resource busy or locked",[17]:"File exists",[18]:"Invalid cross-device link",[19]:"No such device",[20]:"File is not a directory",[21]:"File is a directory",[22]:"Invalid argument",[23]:"Too many open files in system",[24]:"Too many open files",[26]:"Text file busy",[27]:"File is too big",[28]:"No space left on disk",[29]:"Illegal seek",[30]:"Cannot modify a read-only file system",[31]:"Too many links",[32]:"Broken pipe",[33]:"Numerical argument out of domain",[34]:"Numerical result out of range",[35]:"Resource deadlock would occur",[36]:"File name too long",[37]:"No locks available",[38]:"Function not implemented",[39]:"Directory is not empty",[40]:"Too many levels of symbolic links",[42]:"No message of desired type",[52]:"Invalid exchange",[53]:"Invalid request descriptor",[54]:"Exchange full",[55]:"No anode",[56]:"Invalid request code",[60]:"Device not a stream",[61]:"No data available",[62]:"Timer expired",[63]:"Out of streams resources",[64]:"Machine is not on the network",[66]:"Object is remote",[67]:"Link has been severed",[70]:"Communication error on send",[71]:"Protocol error",[74]:"Bad message",[75]:"Value too large for defined data type",[77]:"File descriptor in bad state",[86]:"Streams pipe error",[88]:"Socket operation on non-socket",[89]:"Destination address required",[90]:"Message too long",[91]:"Protocol wrong type for socket",[92]:"Protocol not available",[93]:"Protocol not supported",[94]:"Socket type not supported",[95]:"Operation is not supported",[100]:"Network is down",[101]:"Network is unreachable",[102]:"Network dropped connection on reset",[110]:"Connection timed out",[111]:"Connection refused",[112]:"Host is down",[113]:"No route to host",[114]:"Operation already in progress",[115]:"Operation now in progress",[116]:"Stale file handle",[121]:"Remote I/O error",[122]:"Disk quota exceeded"},f=class extends Error{constructor(i,n=Lr[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=z[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new f(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new f(z[i],Lr[z[i]],n,r)}code;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(f,"ApiError");var Hf="/";var Bs="/";function _t(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(_t,"validateString");function Ms(t,e){let i="",n=0,r=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===l-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=l,o=0;continue}else if(i.length!==0){i="",n=0,r=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,l):i=t.slice(r+1,l),n=l-r-1;r=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Ms,"normalizeString");function Ee(...t){let e="",i=!1;for(let n=t.length-1;n>=-1&&!i;n--){let r=n>=0?t[n]:Hf;_t(r,`paths[${n}]`),r.length&&(e=`${r}/${e}`,i=r[0]=="/")}return e=Ms(e,!i),i?`/${e}`:e.length>0?e:"/"}s(Ee,"resolve");function Kf(t){if(_t(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=Ms(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s(Kf,"normalize");function C(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let n=t[i];_t(n,"path"),n.length>0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Kf(e)}s(C,"join");function x(t){if(_t(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function P(t,e){e!==void 0&&_t(e,"ext"),_t(t,"path");let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!r){i=l+1;break}}else a===-1&&(r=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(n=l):(o=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":t.slice(i,n)}s(P,"basename");function wn(t){_t(t,"path");let e=t[0]==="/",i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,o=0,a=-1,l=!0,c=t.length-1,u=0;for(;c>=n;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}if(a!==-1){let d=o===0&&e?1:o;r===-1||u===0||u===1&&r===a-1&&r===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,r),i.base=t.slice(d,a),i.ext=t.slice(r,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(wn,"parse");var It={};gn(It,{COPYFILE_EXCL:()=>Ci,COPYFILE_FICLONE:()=>Yf,COPYFILE_FICLONE_FORCE:()=>Xf,F_OK:()=>Cr,O_APPEND:()=>Pe,O_CREAT:()=>G,O_DIRECT:()=>nd,O_DIRECTORY:()=>Qf,O_DSYNC:()=>td,O_EXCL:()=>Te,O_NOATIME:()=>Zf,O_NOCTTY:()=>Jf,O_NOFOLLOW:()=>ed,O_NONBLOCK:()=>rd,O_RDONLY:()=>Yt,O_RDWR:()=>se,O_SYMLINK:()=>id,O_SYNC:()=>Xt,O_TRUNC:()=>Oe,O_WRONLY:()=>Ae,R_OK:()=>xe,S_IFBLK:()=>xt,S_IFCHR:()=>kt,S_IFDIR:()=>Ce,S_IFIFO:()=>Nt,S_IFLNK:()=>Re,S_IFMT:()=>J,S_IFREG:()=>Le,S_IFSOCK:()=>Et,S_IRGRP:()=>fd,S_IROTH:()=>pd,S_IRUSR:()=>ld,S_IRWXG:()=>Br,S_IRWXO:()=>Mr,S_IRWXU:()=>Dr,S_ISGID:()=>sd,S_ISUID:()=>od,S_ISVTX:()=>ad,S_IWGRP:()=>dd,S_IWOTH:()=>yd,S_IWUSR:()=>cd,S_IXGRP:()=>hd,S_IXOTH:()=>md,S_IXUSR:()=>ud,UV_FS_O_FILEMAP:()=>bd,W_OK:()=>le,X_OK:()=>Gf});var Cr=0,xe=4,le=2,Gf=1,Ci=1,Yf=2,Xf=4,Yt=0,Ae=1,se=2,G=64,Te=128,Jf=256,Oe=512,Pe=1024,Qf=65536,Zf=262144,ed=131072,Xt=1052672,td=4096,id=32768,nd=16384,rd=2048,J=61440,Et=49152,Re=40960,Le=32768,xt=24576,Ce=16384,kt=8192,Nt=4096,od=2048,sd=1024,ad=512,Dr=448,ld=256,cd=128,ud=64,Br=56,fd=32,dd=16,hd=8,Mr=7,pd=4,yd=2,md=1,bd=0;var U=(n=>(n[n.FILE=32768]="FILE",n[n.DIRECTORY=16384]="DIRECTORY",n[n.SYMLINK=40960]="SYMLINK",n))(U||{}),Jt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:l,mode:c,ino:u}={}){let d=Date.now(),h=s((m,w)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:w),"resolveT");this.atimeMs=h(e,d),this.mtimeMs=h(i,d),this.ctimeMs=h(n,d),this.birthtimeMs=h(r,d),this.uid=h(o,0),this.gid=h(a,0),this.size=this._convert(l),this.ino=this._convert(u);let b=Number(c)&61440||U.FILE;if(c)this.mode=this._convert(c);else switch(b){case U.FILE:this.mode=this._convert(420);break;case U.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(b))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let n=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&n)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};s(Jt,"StatsCommon");var W=class extends Jt{_isBigint=!1;static clone(e){return new W(e)}};s(W,"Stats");var Y=class extends Jt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new Y(e)}};s(Y,"BigIntStats");var Qt=class{type;bsize;blocks;bfree;bavail;files;ffree};s(Qt,"StatsFs");var Sn=class{type;bsize;blocks;bfree;bavail;files;ffree};s(Sn,"BigIntStatsFs");var _n=2**32-1,he=0n;function Ws(){return Math.round(Math.random()*2**32).toString(16)}s(Ws,"_random");function Zt(){return BigInt("0x"+Ws()+Ws())}s(Zt,"randomIno");var de=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Zt(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new W(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(de,"Inode");var En=(r=>(r[r.NOP=0]="NOP",r[r.THROW=1]="THROW",r[r.TRUNCATE=2]="TRUNCATE",r[r.CREATE=3]="CREATE",r))(En||{}),gd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function R(t){if(typeof t=="number")return Us(t);if(!gd.includes(t))throw new Error("Invalid flag string: "+t);return t}s(R,"parseFlag");function Us(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(Us,"flagToString");function wd(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(wd,"flagToNumber");function dt(t){let e=0;return e<<=1,e+=+Ye(t),e<<=1,e+=+pe(t),e<<=1,e}s(dt,"flagToMode");function Ye(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(Ye,"isReadable");function pe(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(pe,"isWriteable");function qs(t){return t.indexOf("w")!==-1}s(qs,"isTruncating");function ht(t){return t.indexOf("a")!==-1}s(ht,"isAppendable");function Di(t){return t.indexOf("s")!==-1}s(Di,"isSynchronous");function js(t){return t.indexOf("x")!==-1}s(js,"isExclusive");function Mi(t){return js(t)?1:qs(t)?2:0}s(Mi,"pathExistsAction");function Wi(t){return(pe(t)||ht(t))&&t!=="r+"?3:1}s(Wi,"pathNotExistsAction");var Bi=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Bi,"File");var te=class extends Bi{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:_n}))){super();this.fs=i;this.path=n;this.flag=r;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(Ye(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return ht(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new W(this.stats)}statSync(){return new W(this.stats)}truncate(i){if(this.truncateSync(i),Di(this.flag))return this.sync()}truncateSync(i){if(this._dirty=!0,!pe(this.flag))throw new f(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length),Di(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),Di(this.flag)&&this.syncSync()}async write(i,n=0,r=this.stats.size,o=0){return this.writeSync(i,n,r,o)}writeSync(i,n=0,r=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!pe(this.flag))throw new f(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:_n}));u.set(this._buffer),this._buffer=u}let l=i.slice(n,n+r);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),Di(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,n=0,r=this.stats.size,o=0){return{bytesRead:this.readSync(i,n,r,o),buffer:i}}readSync(i,n=0,r=this.stats.size,o=0){if(!Ye(this.flag))throw new f(1,"File not opened with a readable mode.");o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||new Uint8Array(i.buffer).set(this._buffer.slice(o,a),n),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){this.chownSync(i,n)}chownSync(i,n){this._dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){this.utimesSync(i,n)}utimesSync(i,n){this._dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(te,"PreloadFile");var Ft=class extends te{constructor(e,i,n,r,o){super(e,i,n,r,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(Ft,"NoSyncFile");var De={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var ie=class{metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0}}constructor(e){}async ready(){return this}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(ie,"FileSystem");function Wr(t){class e extends t{async exists(n,r){return this.existsSync(n,r)}async rename(n,r,o){return this.renameSync(n,r,o)}async stat(n,r){return this.statSync(n,r)}async createFile(n,r,o,a){return this.createFileSync(n,r,o,a)}async openFile(n,r,o){return this.openFileSync(n,r,o)}async unlink(n,r){return this.unlinkSync(n,r)}async rmdir(n,r){return this.rmdirSync(n,r)}async mkdir(n,r,o){return this.mkdirSync(n,r,o)}async readdir(n,r){return this.readdirSync(n,r)}async link(n,r,o){return this.linkSync(n,r,o)}async sync(n,r,o){return this.syncSync(n,r,o)}}return s(e,"_SyncFileSystem"),e}s(Wr,"Sync");function Ur(t){class e extends t{_queue=[];get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let r=s(()=>this._queueRunning?setTimeout(r):n(),"check");r()})}_isInitialized=!1;async ready(){if(await this._sync.ready(),await super.ready(),this._isInitialized)return this;try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}return this}renameSync(n,r,o){this._sync.renameSync(n,r,o),this.queue("rename",n,r,o)}statSync(n,r){return this._sync.statSync(n,r)}createFileSync(n,r,o,a){let l=this._sync.createFileSync(n,r,o,a);this.queue("createFile",n,r,o,a);let c=l.statSync(),u=new Uint8Array(c.size);return l.readSync(u),new te(this,n,r,c,u)}openFileSync(n,r,o){return this._sync.openFileSync(n,r,o)}unlinkSync(n,r){this._sync.unlinkSync(n,r),this.queue("unlink",n,r)}rmdirSync(n,r){this._sync.rmdirSync(n,r),this.queue("rmdir",n,r)}mkdirSync(n,r,o){this._sync.mkdirSync(n,r,o),this.queue("mkdir",n,r,o)}readdirSync(n,r){return this._sync.readdirSync(n,r)}linkSync(n,r,o){this._sync.linkSync(n,r,o),this.queue("link",n,r,o)}syncSync(n,r,o){this._sync.syncSync(n,r,o),this.queue("sync",n,r,o)}existsSync(n,r){return this._sync.existsSync(n,r)}async crossCopy(n){let r=await this.stat(n,De);if(r.isDirectory()){if(n!=="/"){let a=await this.stat(n,De);this._sync.mkdirSync(n,a.mode,a.cred())}let o=await this.readdir(n,De);for(let a of o)await this.crossCopy(C(n,a))}else{let o=await this.openFile(n,R("r"),De),a=this._sync.createFileSync(n,R("w"),r.mode,r.cred());try{let l=new Uint8Array(r.size);await o.read(l),a.writeSync(l,0,r.size)}finally{await o.close(),a.closeSync()}}}async _next(){if(!this._queueRunning)return;let[n,...r]=this._queue.shift();await this[n](...r),await this._next()}queue(...n){this._queue.push(n),this._next()}}return s(e,"_AsyncFileSystem"),e}s(Ur,"Async");function qr(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r,o){throw new f(30)}renameSync(n,r,o){throw new f(30)}async createFile(n,r,o,a){throw new f(30)}createFileSync(n,r,o,a){throw new f(30)}async unlink(n,r){throw new f(30)}unlinkSync(n,r){throw new f(30)}async rmdir(n,r){throw new f(30)}rmdirSync(n,r){throw new f(30)}async mkdir(n,r,o){throw new f(30)}mkdirSync(n,r,o){throw new f(30)}async link(n,r,o){throw new f(30)}linkSync(n,r,o){throw new f(30)}async sync(n,r,o){throw new f(30)}syncSync(n,r,o){throw new f(30)}}return s(e,"_ReadonlyFileSystem"),e}s(qr,"Readonly");function $s(t,e,i,n){n.existsSync(t,i)||($s(x(t),e,i,n),n.mkdirSync(t,e,i))}s($s,"mkdirpSync");function xn(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}s(xn,"_min");function jr(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=t.charCodeAt(r+b),o[b]=++b;let a,l,c,u,d;for(a=0;a+3<n;){let b=e.charCodeAt(r+(l=a)),m=e.charCodeAt(r+(c=a+1)),w=e.charCodeAt(r+(u=a+2)),g=e.charCodeAt(r+(d=a+3)),I=a+=4;for(let S=0;S<i;){let T=o[i+S],M=o[S];l=xn(M,l,c,b,T),c=xn(l,c,u,m,T),u=xn(c,u,d,w,T),I=xn(u,d,I,g,T),o[S++]=I,d=u,u=c,c=l,l=M}}let h=0;for(;a<n;){let b=e.charCodeAt(r+(l=a));h=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=h=w<l||h<l?w>h?h+1:w+1:b===o[i+m]?l:l+1,l=w}}return h}s(jr,"levenshtein");var Sd=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Be(t){if(typeof t!="string")throw new f(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Be,"encode");function kn(t){if(!(t instanceof Uint8Array))throw new f(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(kn,"decode");function Ui(t){return JSON.parse(kn(t),(e,i)=>e==""?i:BigInt(i))}s(Ui,"decodeDirListing");function ce(t){return Be(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ce,"encodeDirListing");function _d(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(_d,"_toUnixTimestamp");function ye(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}s(ye,"normalizeMode");function vt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new f(22,"Invalid time.")}s(vt,"normalizeTime");function v(t){if(t.includes("\0"))throw new f(22,"Path must be a string without null bytes.");if(t.length==0)throw new f(22,"Path must not be empty.");return Ee(t.replaceAll(/[/\\]+/g,"/"))}s(v,"normalizePath");function me(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:ye("mode"in t?t?.mode:null,n)}}s(me,"normalizeOptions");function _(){}s(_,"nop");var ei=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,n){return this.markModified(e),this.store.put(e,i,n)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(ei,"SimpleSyncTransaction");var ti=class extends Wr(ie){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=P(e),l=x(i),c=P(i),u=this.findINode(r,o),d=this.getDirListing(r,u,o);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",e,"rename");if(!d[a])throw f.With("ENOENT",e,"rename");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new f(16,o);let b,m;if(l===o?(b=u,m=d):(b=this.findINode(r,l),m=this.getDirListing(r,b,l)),m[c]){let w=this.getINode(r,m[c],i);if(w.toStats().isFile())try{r.remove(w.ino),r.remove(m[c])}catch(g){throw r.abort(),g}else throw f.With("EPERM",i,"rename")}m[c]=h;try{r.put(u.ino,ce(d),!0),r.put(b.ino,ce(m),!0)}catch(w){throw r.abort(),w}r.commit()}statSync(e,i){let n=this.findINode(this.store.beginTransaction(),e).toStats();if(!n.hasAccess(4,i))throw f.With("EACCES",e,"stat");return n}createFileSync(e,i,n,r){return this.commitNewFile(e,U.FILE,n,r),this.openFileSync(e,i,r)}openFileSync(e,i,n){let r=this.store.beginTransaction(),o=this.findINode(r,e),a=r.get(o.ino);if(!o.toStats().hasAccess(dt(i),n))throw f.With("EACCES",e,"openFile");if(a===null)throw f.With("ENOENT",e,"openFile");return new te(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.removeEntry(e,!0,i)}mkdirSync(e,i,n){this.commitNewFile(e,U.DIRECTORY,i,n,Be("{}"))}readdirSync(e,i){let n=this.store.beginTransaction(),r=this.findINode(n,e);if(!r.toStats().hasAccess(4,i))throw f.With("EACCES",e,"readdir");return Object.keys(this.getDirListing(n,r,e))}syncSync(e,i,n){let r=this.store.beginTransaction(),o=this._findINode(r,x(e),P(e)),a=this.getINode(r,o,e),l=a.update(n);try{r.put(a.ino,i,!0),l&&r.put(o,a.data,!0)}catch(c){throw r.abort(),c}r.commit()}linkSync(e,i,n){let r=this.store.beginTransaction(),o=x(e);if(!this.findINode(r,o).toStats().hasAccess(4,n))throw f.With("EACCES",o,"link");let l=x(i),c=this.findINode(r,l),u=this.getDirListing(r,c,l);if(!c.toStats().hasAccess(2,n))throw f.With("EACCES",l,"link");let d=this._findINode(r,o,P(e)),h=this.getINode(r,d,e);if(!h.toStats().hasAccess(2,n))throw f.With("EACCES",i,"link");h.nlink++,u[P(i)]=d;try{r.put(d,h.data,!0),r.put(c.ino,ce(u),!0)}catch(b){throw r.abort(),b}r.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(he))return;let i=new de;i.mode=511|U.DIRECTORY,e.put(i.ino,Be("{}"),!1),e.put(he,i.data,!1),e.commit()}_findINode(e,i,n,r=new Set){let o=C(i,n);if(r.has(o))throw new f(5,"Infinite loop detected while finding inode",o);if(r.add(o),i!="/"){let a=this._findINode(e,x(i),P(i),r),l=this.getDirListing(e,this.getINode(e,a,i+Bs+n),i);if(!(n in l))throw f.With("ENOENT",Ee(i,n),"_findINode");return l[n]}if(n!=""){let a=this.getDirListing(e,this.getINode(e,he,i),i);if(!(n in a))throw f.With("ENOENT",Ee(i,n),"_findINode");return a[n]}return he}findINode(e,i){let n=this._findINode(e,x(i),P(i));return this.getINode(e,n,i)}getINode(e,i,n){let r=e.get(i);if(!r)throw f.With("ENOENT",n,"getINode");return new de(r.buffer)}getDirListing(e,i,n){if(!i.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let r=e.get(i.ino);if(!r)throw f.With("ENOENT",n,"getDirListing");return Ui(r)}addNewNode(e,i,n=5){for(let r=0;r<n;r++){let o=Zt();if(e.put(o,i,!1))return o}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,n,r,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),c=P(e),u=this.findINode(a,l),d=this.getDirListing(a,u,l);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",e,"commitNewFile");if(e==="/")throw f.With("EEXIST",e,"commitNewFile");if(d[c])throw f.With("EEXIST",e,"commitNewFile");let h=new de;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=n|i,h.uid=r.uid,h.gid=r.gid,d[c]=this.addNewNode(a,h.data),a.put(u.ino,ce(d),!0)}catch(b){throw a.abort(),b}return a.commit(),h}removeEntry(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=this.findINode(r,o),l=this.getDirListing(r,a,o),c=P(e),u=l[c];if(!u)throw f.With("ENOENT",e,"removeEntry");let d=this.getINode(r,u,e);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw f.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw f.With("ENOTDIR",e,"removeEntry");try{r.put(a.ino,ce(l),!0),--d.nlink<1&&(r.remove(d.ino),r.remove(u))}catch(h){throw r.abort(),h}r.commit()}};s(ti,"SyncStoreFS");var qi=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new ei(this)}get(e){return this.store.get(e)}put(e,i,n){return!n&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s(qi,"InMemoryStore");var ji={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new ti({store:new qi(t)})}};var Nn=class{constructor(e){this.limit=e}cache=[];set(e,i){let n=this.cache.findIndex(r=>r.key===e);n!=-1?this.cache.splice(n,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(n=>n.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(n=>n.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(Nn,"LRUCache");var In=class extends Ur(ie){constructor(i){super();this._options=i}store;_cache;_initialized=!1;_sync;async ready(){return this._initialized?this:(this._initialized=!0,this._options.lruCacheSize>0&&(this._cache=new Nn(this._options.lruCacheSize)),this.store=await this._options.store,this._sync=this._options.sync||ji.create({name:"test"}),await this.makeRootDirectory(),await super.ready(),this)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(i,n,r){await this.queueDone();let o=this._cache;this._cache&&(this._cache=null,o.reset());try{let a=this.store.beginTransaction(),l=x(i),c=P(i),u=x(n),d=P(n),h=await this.findINode(a,l),b=await this.getDirListing(a,h,l);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!b[c])throw f.With("ENOENT",i,"rename");let m=b[c];if(delete b[c],(u+"/").indexOf(i+"/")===0)throw new f(16,l);let w,g;if(u===l?(w=h,g=b):(w=await this.findINode(a,u),g=await this.getDirListing(a,w,u)),g[d]){let I=await this.getINode(a,g[d],n);if(I.toStats().isFile())try{await a.remove(I.ino),await a.remove(g[d])}catch(S){throw await a.abort(),S}else throw f.With("EPERM",n,"rename")}g[d]=m;try{await a.put(h.ino,ce(b),!0),await a.put(w.ino,ce(g),!0)}catch(I){throw await a.abort(),I}await a.commit()}finally{o&&(this._cache=o)}}async stat(i,n){await this.queueDone();let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,n))throw f.With("EACCES",i,"stat");return a}async createFile(i,n,r,o){await this.queueDone();let a=this.store.beginTransaction(),l=new Uint8Array(0),c=await this.commitNewFile(a,i,U.FILE,r,o,l);return new te(this,i,n,c.toStats(),l)}async openFile(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=await this.findINode(o,i),l=await o.get(a.ino);if(!a.toStats().hasAccess(dt(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new te(this,i,n,a.toStats(),l)}async unlink(i,n){return await this.queueDone(),this.removeEntry(i,!1,n)}async rmdir(i,n){if(await this.queueDone(),(await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.removeEntry(i,!0,n)}async mkdir(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=Be("{}");await this.commitNewFile(o,i,U.DIRECTORY,n,r,a)}async readdir(i,n){await this.queueDone();let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(r,o,i))}async sync(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=await this._findINode(o,x(i),P(i)),l=await this.getINode(o,a,i),c=l.update(r);try{await o.put(l.ino,n,!0),c&&await o.put(a,l.data,!0)}catch(u){throw await o.abort(),u}await o.commit()}async link(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=x(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=x(n),u=await this.findINode(o,c),d=await this.getDirListing(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let h=await this._findINode(o,a,P(i)),b=await this.getINode(o,h,i);if(!b.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");b.nlink++,d[P(n)]=h;try{o.put(h,b.data,!0),o.put(u.ino,ce(d),!0)}catch(m){throw o.abort(),m}o.commit()}async makeRootDirectory(){let i=this.store.beginTransaction();if(!await i.get(he)){let n=new de;n.mode=511|U.DIRECTORY,await i.put(n.ino,Be("{}"),!1),await i.put(he,n.data,!1),await i.commit()}}async _findINode(i,n,r,o=new Set){let a=C(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),this._cache){let l=this._cache.get(a);if(l)return l}if(n==="/"){if(r==="")return this._cache&&this._cache.set(a,he),he;{let l=await this.getINode(i,he,n),c=await this.getDirListing(i,l,n);if(c[r]){let u=c[r];return this._cache&&this._cache.set(a,u),u}else throw f.With("ENOENT",Ee(n,r),"_findINode")}}else{let l=await this.findINode(i,n,o),c=await this.getDirListing(i,l,n);if(c[r]){let u=c[r];return this._cache&&this._cache.set(a,u),u}else throw f.With("ENOENT",Ee(n,r),"_findINode")}}async findINode(i,n,r=new Set){let o=await this._findINode(i,x(n),P(n),r);return this.getINode(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw f.With("ENOENT",r,"getINode");return new de(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return Ui(o)}async addNewNode(i,n,r=5){if(r<=0)throw new f(5,"Unable to commit data to key-value store.");let o=Zt();return await i.put(o,n,!1)?o:await this.addNewNode(i,n,--r)}async commitNewFile(i,n,r,o,a,l){let c=x(n),u=P(n),d=await this.findINode(i,c),h=await this.getDirListing(i,d,c);if(!d.toStats().hasAccess(2,a))throw f.With("EACCES",n,"commitNewFile");if(n==="/")throw f.With("EEXIST",n,"commitNewFile");if(h[u])throw await i.abort(),f.With("EEXIST",n,"commitNewFile");try{let b=new de;return b.ino=await this.addNewNode(i,l),b.mode=o|r,b.uid=a.uid,b.gid=a.gid,b.size=l.length,h[u]=await this.addNewNode(i,b.data),await i.put(d.ino,ce(h),!0),await i.commit(),b}catch(b){throw i.abort(),b}}async removeEntry(i,n,r){this._cache&&this._cache.remove(i);let o=this.store.beginTransaction(),a=x(i),l=await this.findINode(o,a),c=await this.getDirListing(o,l,a),u=P(i);if(!c[u])throw f.With("ENOENT",i,"removeEntry");let d=c[u],h=await this.getINode(o,d,i);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&h.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!h.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.put(l.ino,ce(c),!0),--h.nlink<1&&(await o.remove(h.ino),await o.remove(d))}catch(b){throw await o.abort(),b}await o.commit()}};s(In,"AsyncStoreFS");var At=class{static FromListing(e){let i=new At,n=new Xe;i._index.set("/",n);let r=[{pwd:"",tree:e,parent:n}];for(;r.length>0;){let o,{tree:a,pwd:l,parent:c}=r.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let d=a[u];if(d){let h=l+"/"+u;o=new Xe,i._index.set(h,o),r.push({pwd:h,tree:d,parent:o})}else o=new $i(new W({mode:U.FILE|365}));c&&c._listing.set(u,o)}}return i}_index=new Map;constructor(){this.add("/",new Xe)}files(){let e=[];for(let i of this._index.values())for(let n of i.listing){let r=i.get(n);r?.isFile()&&e.push(r)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let n=x(e),r=this._index.get(n);return!r&&e!="/"&&(r=new Xe,!this.add(n,r))||e!="/"&&!r.add(P(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let n=x(e),r=P(e),o=this._index.get(n);return o||(o=new Xe,this.addFast(n,o)),o.add(r,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),n=this._index.get(i);if(!n)return;let r=n.remove(P(e));if(!r)return;if(!r.isDirectory())return r;let o=r.listing;for(let a of o)this.remove(C(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),n=this._index.get(i);return i==e?n:n?.get(P(e))}};s(At,"FileIndex");var ii=class{constructor(e){this.data=e}};s(ii,"IndexInode");var $i=class extends ii{isFile(){return!0}isDirectory(){return!1}toStats(){return new W({mode:U.FILE|438,size:4096})}};s($i,"IndexFileInode");var Xe=class extends ii{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new W({mode:U.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(Xe,"IndexDirInode");var ni=class extends qr(ie){_index;constructor(e){super(),this._index=At.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new f(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new f(22,"Invalid inode.")}async openFile(e,i,n){if(pe(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(dt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ft(this,e,i,o,o.fileData)}return this.openFileInode(r,e,i)}openFileSync(e,i,n){if(pe(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(dt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ft(this,e,i,o,o.fileData)}return this.openFileInodeSync(r,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}};s(ni,"IndexFS");var Fn=class extends ni{async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,n){return this.openFileInodeSync(e,i,n)}};s(Fn,"SyncIndexFS");var vn=class extends ni{statFileInodeSync(e,i){throw f.With("ENOSYS",i,"AsyncIndexFS.statFileInodeSync")}openFileInodeSync(e,i,n){throw f.With("ENOSYS",i,"AsyncIndexFS.openFileInodeSync")}};s(vn,"AsyncIndexFS");var ri=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(ri,"Mutex");var oi=class{constructor(e){this.fs=e}_mu=new ri;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,n){await this._mu.lock(e),await this.fs.rename(e,i,n),this._mu.unlock(e)}renameSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,n)}async stat(e,i){await this._mu.lock(e);let n=await this.fs.stat(e,i);return this._mu.unlock(e),n}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,n){await this._mu.lock(e);let r=await this.fs.openFile(e,i,n);return this._mu.unlock(e),r}openFileSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,n)}async createFile(e,i,n,r){await this._mu.lock(e);let o=await this.fs.createFile(e,i,n,r);return this._mu.unlock(e),o}createFileSync(e,i,n,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,n,r)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,n){await this._mu.lock(e),await this.fs.mkdir(e,i,n),this._mu.unlock(e)}mkdirSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,n)}async readdir(e,i){await this._mu.lock(e);let n=await this.fs.readdir(e,i);return this._mu.unlock(e),n}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let n=await this.fs.exists(e,i);return this._mu.unlock(e),n}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,n){await this._mu.lock(e),await this.fs.link(e,i,n),this._mu.unlock(e)}linkSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,n)}async sync(e,i,n){await this._mu.lock(e),await this.fs.sync(e,i,n),this._mu.unlock(e)}syncSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,n)}};s(oi,"LockedFS");var $r="/.deleted",Vi=class extends ie{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:si.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,n){let r=n.cred(0,0);await this.createParentDirectories(e,r),await this._writable.sync(e,i,n)}syncSync(e,i,n){let r=n.cred(0,0);this.createParentDirectoriesSync(e,r),this._writable.syncSync(e,i,n)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile($r,R("r"),De),{size:i}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(i));this._deleteLog=kn(n)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,n)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"rename")}}renameSync(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,n)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"rename")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"stat");let r=new W(await this._readable.stat(e,i));return r.mode|=146,r}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"stat");let r=new W(this._readable.statSync(e,i));return r.mode|=146,r}}async openFile(e,i,n){if(await this._writable.exists(e,n))return this._writable.openFile(e,i,n);let r=await this._readable.openFile(e,R("r"),n),o=new W(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new te(this,e,i,o,a)}openFileSync(e,i,n){if(this._writable.existsSync(e,n))return this._writable.openFileSync(e,i,n);let r=this._readable.openFileSync(e,R("r"),n),o=W.clone(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new te(this,e,i,o,a)}async createFile(e,i,n,r){return this.checkInitialized(),await this._writable.createFile(e,i,n,r),this.openFile(e,i,r)}createFileSync(e,i,n,r){return this.checkInitialized(),this._writable.createFileSync(e,i,n,r),this.openFileSync(e,i,r)}async link(e,i,n){this.checkInitialized(),await this._writable.link(e,i,n)}linkSync(e,i,n){this.checkInitialized(),this._writable.linkSync(e,i,n)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw f.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw f.With("ENOENT",e,"unlink");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw f.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw f.With("ENOENT",e,"rmdir");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}async mkdir(e,i,n){if(this.checkInitialized(),await this.exists(e,n))throw f.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,n),await this._writable.mkdir(e,i,n)}mkdirSync(e,i,n){if(this.checkInitialized(),this.existsSync(e,n))throw f.With("EEXIST",e,"mkdir");this.createParentDirectoriesSync(e,n),this._writable.mkdirSync(e,i,n)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw f.With("ENOTDIR",e,"readdir");let r=[];try{r.push(...await this._writable.readdir(e,i))}catch{}try{r.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw f.With("ENOTDIR",e,"readdir");let r=[];try{r=r.concat(this._writable.readdirSync(e,i))}catch{}try{r=r.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
-
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(
|
|
4
|
-
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==$r)throw f.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let n=x(e),r=[];for(;!this._writable.existsSync(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let n=x(e),r=[];for(;!await this._writable.exists(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw f.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw f.With("ENOENT",e,"operateOnWritable");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let n=this.statSync(e,i);if(n.isDirectory()){this._writable.mkdirSync(e,n.mode,i);return}let r=new Uint8Array(n.size),o=this._readable.openFileSync(e,R("r"),i);o.readSync(r),o.closeSync();let a=this._writable.openFileSync(e,R("w"),i);a.writeSync(r),a.closeSync()}async copyToWritable(e,i){let n=await this.stat(e,i);if(n.isDirectory()){await this._writable.mkdir(e,n.mode,i);return}let r=new Uint8Array(n.size),o=await this._readable.openFile(e,R("r"),i);await o.read(r),await o.close();let a=await this._writable.openFile(e,R("w"),i);await a.write(r),await a.close()}};s(Vi,"UnlockedOverlayFS");var si=class extends oi{async ready(){return await super.ready(),this}constructor(e){super(new Vi(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(si,"OverlayFS");var Ed={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new si(t)}};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 An(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:jr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new f(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(An,"checkOptions");function xd(t,e){return An(t,e),t.create(e).ready()}s(xd,"createBackend");function Vr(t){return t!=null&&typeof t=="object"&&"backend"in t&&zi(t.backend)}s(Vr,"isBackendConfig");var bn={};gn(bn,{BigIntStats:()=>Y,Dir:()=>et,Dirent:()=>Ze,ReadStream:()=>lt,Stats:()=>W,StatsFs:()=>Qt,WriteStream:()=>ct,access:()=>kf,accessSync:()=>va,appendFile:()=>Zu,appendFileSync:()=>ya,chmod:()=>wf,chmodSync:()=>Na,chown:()=>bf,chownSync:()=>xa,close:()=>tf,closeSync:()=>Qe,constants:()=>It,copyFile:()=>Pf,copyFileSync:()=>ao,cp:()=>Df,cpSync:()=>lo,createReadStream:()=>vf,createWriteStream:()=>Af,exists:()=>zu,existsSync:()=>hi,fchmod:()=>cf,fchmodSync:()=>Bn,fchown:()=>lf,fchownSync:()=>Dn,fdatasync:()=>of,fdatasyncSync:()=>ga,fstat:()=>ef,fstatSync:()=>ma,fsync:()=>rf,fsyncSync:()=>ba,ftruncate:()=>nf,ftruncateSync:()=>io,futimes:()=>uf,futimesSync:()=>Mn,lchmod:()=>Sf,lchmodSync:()=>Ia,lchown:()=>gf,lchownSync:()=>ka,link:()=>pf,linkSync:()=>_a,lopenSync:()=>Xi,lstat:()=>Ku,lstatSync:()=>to,lutimes:()=>Ef,lutimesSync:()=>Fa,mkdir:()=>df,mkdirSync:()=>Wn,mkdtemp:()=>Of,mkdtempSync:()=>Aa,mount:()=>Ki,mountMapping:()=>Gi,mounts:()=>ge,open:()=>Xu,openAsBlob:()=>Mf,openSync:()=>yi,opendir:()=>Cf,opendirSync:()=>Pa,promises:()=>mn,read:()=>af,readFile:()=>Ju,readFileSync:()=>Cn,readSync:()=>Sa,readdir:()=>hf,readdirSync:()=>mi,readlink:()=>mf,readlinkSync:()=>ro,readv:()=>Rf,readvSync:()=>Ta,realpath:()=>xf,realpathSync:()=>di,rename:()=>Vu,renameSync:()=>da,rm:()=>Tf,rmSync:()=>so,rmdir:()=>ff,rmdirSync:()=>no,stat:()=>Hu,statSync:()=>Yi,statfs:()=>Bf,statfsSync:()=>Ra,symlink:()=>yf,symlinkSync:()=>Ea,truncate:()=>Gu,truncateSync:()=>ha,umount:()=>Rn,unlink:()=>Yu,unlinkSync:()=>Ln,unwatchFile:()=>If,utimes:()=>_f,utimesSync:()=>oo,watch:()=>Ff,watchFile:()=>Nf,write:()=>sf,writeFile:()=>Qu,writeFileSync:()=>Ji,writeSync:()=>wa,writev:()=>Lf,writevSync:()=>Oa});var mn={};gn(mn,{FileHandle:()=>re,access:()=>Ts,appendFile:()=>Es,chmod:()=>Fs,chown:()=>Ns,constants:()=>It,copyFile:()=>Tr,cp:()=>Or,exists:()=>Kt,lchmod:()=>vs,lchown:()=>Is,link:()=>xs,lopen:()=>Nr,lstat:()=>kr,lutimes:()=>As,mkdir:()=>yn,mkdtemp:()=>Os,open:()=>ve,opendir:()=>Ps,readFile:()=>pn,readdir:()=>Rt,readlink:()=>Fr,realpath:()=>Ht,rename:()=>Ss,rm:()=>Ar,rmdir:()=>Ir,stat:()=>Pi,statfs:()=>Rs,symlink:()=>ks,truncate:()=>_s,unlink:()=>dn,utimes:()=>vr,watch:()=>Og,writeFile:()=>Ri});var ut=Rr(ke(),1);var mt=Rr(ke(),1);var k=De;function fa(t){k=t}s(fa,"setCred");var Pt=new Map,ih=100;function fi(t){let e=ih++;return Pt.set(e,t),e}s(fi,"getFdForFile");function V(t){if(!Pt.has(t))throw new f(9);return Pt.get(t)}s(V,"fd2file");var ge=new Map;Ki("/",ji.create({name:"root"}));function Ki(t,e){if(t[0]!=="/"&&(t="/"+t),t=Ee(t),ge.has(t))throw new f(22,"Mount point "+t+" is already in use.");ge.set(t,e)}s(Ki,"mount");function Rn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Ee(t),!ge.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");ge.delete(t)}s(Rn,"umount");function we(t){t=v(t);let e=[...ge].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new f(5,"ZenFS not initialized with a file system")}s(we,"resolveMount");function ua(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}s(ua,"fixPaths");function yt(t,e){return typeof t.stack=="string"&&(t.stack=ua(t.stack,e)),t.message=ua(t.message,e),t}s(yt,"fixError");function Gi(t){"/"in t&&Rn("/");for(let[e,i]of Object.entries(t))Ki(e,i)}s(Gi,"mountMapping");function ue(...[t,e,i,...n]){i=v(i);let{fs:r,path:o}=we(e&&hi(i)?di(i):i);try{return r[t](o,...n)}catch(a){throw yt(a,{[o]:i})}}s(ue,"doOp");function da(t,e){t=v(t),e=v(e);let i=we(t),n=we(e),r={[i.path]:t,[n.path]:e};try{if(i===n)return i.fs.renameSync(i.path,n.path,k);Ji(e,Cn(t)),Ln(t)}catch(o){throw yt(o,r)}}s(da,"renameSync");function hi(t){t=v(t);try{let{fs:e,path:i}=we(di(t));return e.existsSync(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(hi,"existsSync");function Yi(t,e){let i=ue("statSync",!0,t,k);return e?.bigint?new Y(i):i}s(Yi,"statSync");function to(t,e){let i=ue("statSync",!1,t,k);return e?.bigint?new Y(i):i}s(to,"lstatSync");function ha(t,e=0){let i=yi(t,"r+");try{io(i,e)}finally{Qe(i)}}s(ha,"truncateSync");function Ln(t){return ue("unlinkSync",!1,t,k)}s(Ln,"unlinkSync");function pi(t,e,i,n){let r=v(t),o=ye(i,420),a=R(e),l;try{l=ue("statSync",n,r,k)}catch{switch(Wi(a)){case 3:if(!ue("statSync",n,x(r),k).isDirectory())throw f.With("ENOTDIR",x(r),"_open");return ue("createFileSync",n,r,a,o,k);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,k))throw f.With("EACCES",r,"_open");switch(Mi(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:return ue("unlinkSync",n,r,k),ue("createFileSync",n,r,a,l.mode,k);case 0:return ue("openFileSync",n,r,a,k);default:throw new f(22,"Invalid FileFlag object.")}}s(pi,"_openSync");function yi(t,e,i){return fi(pi(t,e,i,!0))}s(yi,"openSync");function Xi(t,e,i){return fi(pi(t,e,i,!1))}s(Xi,"lopenSync");function pa(t,e,i){let n=pi(t,e,420,i);try{let r=n.statSync(),o=new Uint8Array(r.size);return n.readSync(o,0,r.size,0),n.closeSync(),o}finally{n.closeSync()}}s(pa,"_readFileSync");function Cn(t,e={}){let i=me(e,null,"r",420),n=R(i.flag);if(!Ye(n))throw new f(22,"Flag passed to readFile must allow for reading.");let r=mt.Buffer.from(pa(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Cn,"readFileSync");function nh(t,e,i,n,r){let o=pi(t,i,n,r);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(nh,"_writeFileSync");function Ji(t,e,i){let n=me(i,"utf8","w+",420),r=R(n.flag);if(!pe(r))throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,n.encoding):e;if(o===void 0)throw new f(22,"Data not specified");nh(t,o,n.flag,n.mode,!0)}s(Ji,"writeFileSync");function rh(t,e,i,n,r){let o=pi(t,i,n,r);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(rh,"_appendFileSync");function ya(t,e,i){let n=me(i,"utf8","a",420),r=R(n.flag);if(!ht(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,n.encoding):e;rh(t,o,n.flag,n.mode,!0)}s(ya,"appendFileSync");function ma(t,e){let i=V(t).statSync();return e?.bigint?new Y(i):i}s(ma,"fstatSync");function Qe(t){V(t).closeSync(),Pt.delete(t)}s(Qe,"closeSync");function io(t,e=0){if(e<0)throw new f(22);V(t).truncateSync(e)}s(io,"ftruncateSync");function ba(t){V(t).syncSync()}s(ba,"fsyncSync");function ga(t){V(t).datasyncSync()}s(ga,"fdatasyncSync");function wa(t,e,i,n,r){let o,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof n=="string"?n:"utf8";a=0,o=mt.Buffer.from(e,d),l=o.length}else o=e,a=i,l=n,c=typeof r=="number"?r:null;let u=V(t);return c==null&&(c=u.position),u.writeSync(o,a,l,c)}s(wa,"writeSync");function Sa(t,e,i,n,r){let o=V(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(e,a,n,r)}s(Sa,"readSync");function Dn(t,e,i){V(t).chownSync(e,i)}s(Dn,"fchownSync");function Bn(t,e){let i=ye(e,-1);if(i<0)throw new f(22,"Invalid mode.");V(t).chmodSync(i)}s(Bn,"fchmodSync");function Mn(t,e,i){V(t).utimesSync(vt(e),vt(i))}s(Mn,"futimesSync");function no(t){return ue("rmdirSync",!0,t,k)}s(no,"rmdirSync");function Wn(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,n=typeof e=="object"&&e?.recursive;ue("mkdirSync",!0,t,ye(i,511),k)}s(Wn,"mkdirSync");function mi(t,e){t=v(t);let i=ue("readdirSync",!0,t,k);for(let n of ge.keys()){if(!n.startsWith(t))continue;let r=n.slice(t.length);r.includes("/")||r.length==0||i.push(r)}return i.map(n=>typeof e=="object"&&e?.withFileTypes?new Ze(n,Yi(C(t,n))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?mt.Buffer.from(n):n)}s(mi,"readdirSync");function _a(t,e){return e=v(e),ue("linkSync",!1,t,e,k)}s(_a,"linkSync");function Ea(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(hi(e))throw f.With("EEXIST",e,"symlink");Ji(e,t),pi(e,"r+",420,!1)._setTypeSync(U.SYMLINK)}s(Ea,"symlinkSync");function ro(t,e){let i=mt.Buffer.from(pa(t,"r",!1)),n=typeof e=="object"?e.encoding:e;return n=="buffer"?i:i.toString(n)}s(ro,"readlinkSync");function xa(t,e,i){let n=yi(t,"r+");Dn(n,e,i),Qe(n)}s(xa,"chownSync");function ka(t,e,i){let n=Xi(t,"r+");Dn(n,e,i),Qe(n)}s(ka,"lchownSync");function Na(t,e){let i=yi(t,"r+");Bn(i,e),Qe(i)}s(Na,"chmodSync");function Ia(t,e){let i=Xi(t,"r+");Bn(i,e),Qe(i)}s(Ia,"lchmodSync");function oo(t,e,i){let n=yi(t,"r+");Mn(n,e,i),Qe(n)}s(oo,"utimesSync");function Fa(t,e,i){let n=Xi(t,"r+");Mn(n,e,i),Qe(n)}s(Fa,"lutimesSync");function di(t,e){t=v(t);let{base:i,dir:n}=wn(t),r=C(n=="/"?"/":di(n),i),{fs:o,path:a,mountPoint:l}=we(r);try{return o.statSync(a,k).isSymbolicLink()?di(l+ro(r)):r}catch(c){throw yt(c,{[a]:r})}}s(di,"realpathSync");function va(t,e=384){if(!Yi(t).hasAccess(e,k))throw new f(13)}s(va,"accessSync");function so(t,e){switch(t=v(t),Yi(t).mode&61440){case 16384:if(e?.recursive)for(let n of mi(t))so(C(t,n));no(t);return;case 32768:case 40960:Ln(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(so,"rmSync");function Aa(t,e){let i=typeof e=="object"?e.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Wn(r),i=="buffer"?mt.Buffer.from(r):r}s(Aa,"mkdtempSync");function ao(t,e,i){if(t=v(t),e=v(e),i&&i&1&&hi(e))throw new f(17,"Destination file already exists.",e,"copyFile");Ji(e,Cn(t))}s(ao,"copyFileSync");function Ta(t,e,i){let n=V(t),r=0;for(let o of e)r+=n.readSync(o,0,o.length,i+r);return r}s(Ta,"readvSync");function Oa(t,e,i){let n=V(t),r=0;for(let o of e)r+=n.writeSync(o,0,o.length,i+r);return r}s(Oa,"writevSync");function Pa(t,e){return t=v(t),new et(t)}s(Pa,"opendirSync");function lo(t,e,i){t=v(t),e=v(e);let n=to(t);if(i?.errorOnExist&&hi(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");Wn(e,{recursive:!0});for(let r of mi(t,{withFileTypes:!0}))i.filter&&!i.filter(C(t,r.name),C(e,r.name))||lo(C(t,r.name),C(e,r.name),i);break;case 32768:case 40960:ao(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&oo(e,n.atime,n.mtime)}s(lo,"cpSync");function Ra(t,e){throw f.With("ENOSYS",t,"statfs")}s(Ra,"statfsSync");var Ze=class{constructor(e,i){this.path=e;this.stats=i}get name(){return P(this.path)}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(Ze,"Dirent");var et=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Rt(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=mi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(et,"Dir");var xr=Rr(ju(),1);var lt=class extends xr.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending};s(lt,"ReadStream");var ct=class extends xr.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending};s(ct,"WriteStream");var re=class{constructor(e){this.fd=e}get file(){return V(this.fd)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=ye(e,-1);if(i<0)throw new f(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(vt(e),vt(i))}async appendFile(e,i){let n=me(i,"utf8","a",420),r=R(n.flag);if(!ht(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e){let i=me(e,null,"r",292),n=R(i.flag);if(!Ye(n))throw new f(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),o=new Uint8Array(r);await this.file.read(o,0,r,0);let a=ut.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e){let i=s(async({close:n,enqueue:r,error:o})=>{try{let c=0,u=0,d;for(;d.bytesRead>0;){if(d=await this.read(new Uint8Array(65536),0,65536,u),!d.bytesRead){n();return}if(r(d.buffer.slice(0,d.bytesRead)),u+=d.bytesRead,++c>=1e7)throw new f(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream")}}catch(a){o(a)}},"start");return new globalThis.ReadableStream({start:i,type:e.type})}readLines(e){throw f.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new Y(i):i}async write(e,i,n,r){let o,a=0,l;if(typeof e=="string"){r=typeof i=="number"?i:null;let u=typeof n=="string"?n:"utf8";a=0,o=ut.Buffer.from(e,u),l=o.length}else o=e,a=i,l=n,r=typeof r=="number"?r:null;r??=this.file.position;let c=await this.file.write(o,a,l,r);return{buffer:o,bytesWritten:c}}async writeFile(e,i){let n=me(i,"utf8","w",420),r=R(n.flag);if(!pe(r))throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Pt.delete(this.fd)}async writev(e,i){let n=0;for(let r of e)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,i){let n=0;for(let r of e)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){let i={highWaterMark:e?.highWaterMark||65536,encoding:e?.encoding,read:async r=>{try{let o=await this.read(new Uint8Array(r),0,r,this.file.position);n.push(o.bytesRead?o.buffer.slice(0,o.bytesRead):null),this.file.position+=o.bytesRead}catch(o){n.destroy(o)}}},n=new lt(i);return n.path=this.file.path,n}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:async(r,o,a)=>{try{let{bytesWritten:l}=await this.write(r,null,o);a(l==r.length?null:new Error("Failed to write full chunk"))}catch(l){a(l)}}},n=new ct(i);return n.path=this.file.path,n}};s(re,"FileHandle");async function Fe(...[t,e,i,...n]){i=v(i);let r=e&&await Kt(i)?await Ht(i):i,{fs:o,path:a}=we(r);try{return o[t](a,...n)}catch(l){throw yt(l,{[a]:i})}}s(Fe,"doOp");async function Ss(t,e){t=v(t),e=v(e);let i=we(t),n=we(e);try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path,k);return}await Ri(e,await pn(t)),await dn(t)}catch(r){throw yt(r,{[i.path]:t,[n.path]:e})}}s(Ss,"rename");async function Kt(t){try{let{fs:e,path:i}=we(await Ht(t));return await e.exists(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(Kt,"exists");async function Pi(t,e){let i=await Fe("stat",!0,t,k);return e?.bigint?new Y(i):i}s(Pi,"stat");async function kr(t,e){let i=await Fe("stat",!1,t,k);return e?.bigint?new Y(i):i}s(kr,"lstat");async function _s(t,e=0){let i=await ve(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(_s,"truncate");async function dn(t){return Fe("unlink",!1,t,k)}s(dn,"unlink");async function hn(t,e,i=420,n){let r=v(t),o=ye(i,420),a=R(e);try{switch(Mi(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:let l=await Fe("openFile",n,r,a,k);if(!l)throw new f(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Fe("openFile",n,r,a,k);default:throw new f(22,"Invalid file flag")}}catch{switch(Wi(a)){case 3:let c=await Fe("stat",n,x(r),k);if(c&&!c.isDirectory())throw f.With("ENOTDIR",x(r),"_open");return await Fe("createFile",n,r,a,o,k);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid file flag")}}}s(hn,"_open");async function ve(t,e,i=420){let n=await hn(t,e,i,!0);return new re(fi(n))}s(ve,"open");async function Nr(t,e,i=420){let n=await hn(t,e,i,!1);return new re(fi(n))}s(Nr,"lopen");async function $u(t,e,i){let n=await hn(v(t),e,420,i);try{let r=await n.stat(),o=new Uint8Array(r.size);return await n.read(o,0,r.size,0),await n.close(),o}catch(r){throw await n.close(),r}}s($u,"_readFile");async function pn(t,e){let i=me(e,null,"r",0),n=R(i.flag);if(!Ye(n))throw new f(22,"Flag passed must allow for reading.");let r=ut.Buffer.from(await $u(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(pn,"readFile");async function Ri(t,e,i){let n=me(i,"utf8","w+",420),r=await ve(t,n.flag,n.mode);try{await r.writeFile(e,n)}finally{await r.close()}}s(Ri,"writeFile");async function Tg(t,e,i,n,r){let o=await hn(t,i,n,r);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(Tg,"_appendFile");async function Es(t,e,i){let n=me(i,"utf8","a",420),r=R(n.flag);if(!ht(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ut.Buffer.from(e,n.encoding):e;await Tg(t,o,n.flag,n.mode,!0)}s(Es,"appendFile");async function Ir(t){return Fe("rmdir",!0,t,k)}s(Ir,"rmdir");async function yn(t,e){await Fe("mkdir",!0,t,ye(typeof e=="object"?e?.mode:e,511),k)}s(yn,"mkdir");async function Rt(t,e){t=v(t);let i=await Fe("readdir",!0,t,k),n=[...ge.keys()];for(let o of n)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let r=[];for(let o of i)r.push(typeof e=="object"&&e?.withFileTypes?new Ze(o,await Pi(C(t,o))):o);return r}s(Rt,"readdir");async function xs(t,e){return e=v(e),Fe("link",!1,t,e,k)}s(xs,"link");async function ks(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Kt(e))throw f.With("EEXIST",e,"symlink");await Ri(e,t),await(await hn(e,"r+",420,!1))._setType(U.SYMLINK)}s(ks,"symlink");async function Fr(t,e){let i=ut.Buffer.from(await $u(t,"r",!1)),n=typeof e=="object"?e.encoding:e;return n=="buffer"?i:i.toString(n)}s(Fr,"readlink");async function Ns(t,e,i){let n=await ve(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(Ns,"chown");async function Is(t,e,i){let n=await Nr(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(Is,"lchown");async function Fs(t,e){let i=await ve(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Fs,"chmod");async function vs(t,e){let i=await Nr(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(vs,"lchmod");async function vr(t,e,i){let n=await ve(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(vr,"utimes");async function As(t,e,i){let n=await Nr(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(As,"lutimes");async function Ht(t,e){t=v(t);let{base:i,dir:n}=wn(t),r=C(n=="/"?"/":await Ht(n),i),{fs:o,path:a,mountPoint:l}=we(r);try{return(await o.stat(a,k)).isSymbolicLink()?Ht(l+await Fr(r)):r}catch(c){throw yt(c,{[a]:r})}}s(Ht,"realpath");function Og(t,e){throw f.With("ENOSYS",t,"watch")}s(Og,"watch");async function Ts(t,e=0){if(!(await Pi(t)).hasAccess(e,k))throw new f(13)}s(Ts,"access");async function Ar(t,e){switch(t=v(t),(await Pi(t)).mode&61440){case 16384:if(e?.recursive)for(let n of await Rt(t))await Ar(C(t,n));await Ir(t);return;case 32768:case 40960:await dn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(Ar,"rm");async function Os(t,e){let i=typeof e=="object"?e.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await yn(r),i=="buffer"?ut.Buffer.from(r):r}s(Os,"mkdtemp");async function Tr(t,e,i){if(t=v(t),e=v(e),i&&i&1&&await Kt(e))throw new f(17,"Destination file already exists.",e,"copyFile");await Ri(e,await pn(t))}s(Tr,"copyFile");async function Ps(t,e){return t=v(t),new et(t)}s(Ps,"opendir");async function Or(t,e,i){t=v(t),e=v(e);let n=await kr(t);if(i?.errorOnExist&&await Kt(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");await yn(e,{recursive:!0});for(let r of await Rt(t,{withFileTypes:!0}))i.filter&&!i.filter(C(t,r.name),C(e,r.name))||await Or(C(t,r.name),C(e,r.name),i);break;case 32768:case 40960:await Tr(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await vr(e,n.atime,n.mtime)}s(Or,"cp");async function Rs(t,e){throw f.With("ENOSYS",t,"statfs")}s(Rs,"statfs");function Vu(t,e,i=_){Ss(t,e).then(()=>i()).catch(i)}s(Vu,"rename");function zu(t,e=_){Kt(t).then(e).catch(()=>e(!1))}s(zu,"exists");function Hu(t,e,i=_){i=typeof e=="function"?e:i,Pi(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Hu,"stat");function Ku(t,e,i=_){i=typeof e=="function"?e:i,kr(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Ku,"lstat");function Gu(t,e=0,i=_){i=typeof e=="function"?e:i,_s(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(Gu,"truncate");function Yu(t,e=_){dn(t).then(()=>e()).catch(e)}s(Yu,"unlink");function Xu(t,e,i,n=_){let r=ye(i,420);n=typeof i=="function"?i:n,ve(t,e,r).then(o=>n(null,o.fd)).catch(n)}s(Xu,"open");function Ju(t,e,i=_){i=typeof e=="function"?e:i,pn(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Ju,"readFile");function Qu(t,e,i,n=_){n=typeof i=="function"?i:n,Ri(t,e,typeof i!="function"?i:null).then(()=>n(null)).catch(n)}s(Qu,"writeFile");function Zu(t,e,i,n=_){n=typeof i=="function"?i:n,Es(t,e,typeof i=="function"?null:i).then(()=>n()).catch(n)}s(Zu,"appendFile");function ef(t,e,i=_){i=typeof e=="function"?e:i,V(t).stat().then(n=>i(null,typeof e=="object"&&e?.bigint?new Y(n):n)).catch(i)}s(ef,"fstat");function tf(t,e=_){new re(t).close().then(()=>e()).catch(e)}s(tf,"close");function nf(t,e,i=_){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=V(t);if(n<0)throw new f(22);r.truncate(n).then(()=>i()).catch(i)}s(nf,"ftruncate");function rf(t,e=_){V(t).sync().then(()=>e()).catch(e)}s(rf,"fsync");function of(t,e=_){V(t).datasync().then(()=>e()).catch(e)}s(of,"fdatasync");function sf(t,e,i,n,r,o=_){let a,l,c,u=null,d,h=new re(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":u=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new f(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let b=o;h.write(a,l,c,u).then(({bytesWritten:m})=>b(null,m,a.toString(d))).catch(b)}else{a=Buffer.from(e),l=i,c=n,u=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,l,c,u).then(({bytesWritten:m})=>b(null,m,a)).catch(b)}}s(sf,"write");function af(t,e,i,n,r,o=_){new re(t).read(e,i,n,r).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(af,"read");function lf(t,e,i,n=_){new re(t).chown(e,i).then(()=>n()).catch(n)}s(lf,"fchown");function cf(t,e,i){new re(t).chmod(e).then(()=>i()).catch(i)}s(cf,"fchmod");function uf(t,e,i,n=_){new re(t).utimes(e,i).then(()=>n()).catch(n)}s(uf,"futimes");function ff(t,e=_){Ir(t).then(()=>e()).catch(e)}s(ff,"rmdir");function df(t,e,i=_){yn(t,e).then(()=>i()).catch(i)}s(df,"mkdir");function hf(t,e,i=_){i=typeof e=="function"?e:i,Rt(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(hf,"readdir");function pf(t,e,i=_){xs(t,e).then(()=>i()).catch(i)}s(pf,"link");function yf(t,e,i,n=_){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,ks(t,e,r).then(()=>n()).catch(n)}s(yf,"symlink");function mf(t,e,i=_){i=typeof e=="function"?e:i,Fr(t).then(n=>i(null,n)).catch(i)}s(mf,"readlink");function bf(t,e,i,n=_){Ns(t,e,i).then(()=>n()).catch(n)}s(bf,"chown");function gf(t,e,i,n=_){Is(t,e,i).then(()=>n()).catch(n)}s(gf,"lchown");function wf(t,e,i=_){Fs(t,e).then(()=>i()).catch(i)}s(wf,"chmod");function Sf(t,e,i=_){vs(t,e).then(()=>i()).catch(i)}s(Sf,"lchmod");function _f(t,e,i,n=_){vr(t,e,i).then(()=>n()).catch(n)}s(_f,"utimes");function Ef(t,e,i,n=_){As(t,e,i).then(()=>n()).catch(n)}s(Ef,"lutimes");function xf(t,e,i=_){i=typeof e=="function"?e:i,Ht(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(xf,"realpath");function kf(t,e,i=_){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Ts(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(kf,"access");function Nf(t,e,i=_){throw f.With("ENOSYS",t,"watchFile")}s(Nf,"watchFile");function If(t,e=_){throw f.With("ENOSYS",t,"unwatchFile")}s(If,"unwatchFile");function Ff(t,e,i=_){throw f.With("ENOSYS",t,"watch")}s(Ff,"watch");function vf(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new lt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",async read(o){try{n||=await ve(t,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},destroy(o,a){n?.close().then(()=>a(o)).catch(a)}});return r.path=t,r}s(vf,"createReadStream");function Af(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new ct({highWaterMark:i?.highWaterMark,async write(o,a,l){try{n||=await ve(t,"w",i?.mode||438),await n.write(o,null,a),l(null)}catch(c){await n?.close(),l(c)}},destroy(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},final(o){n?.close().then(()=>o()).catch(o)}});return r.path=t,r}s(Af,"createWriteStream");function Tf(t,e,i=_){i=typeof e=="function"?e:i,Ar(t,typeof e=="function"?null:e).then(()=>i(null)).catch(i)}s(Tf,"rm");function Of(t,e,i=_){i=typeof e=="function"?e:i,Os(t,typeof e!="function"?e:null).then(n=>i(null,n)).catch(i)}s(Of,"mkdtemp");function Pf(t,e,i,n){n=typeof i=="function"?i:n,Tr(t,e,typeof i=="function"?null:i).then(()=>n(null)).catch(n)}s(Pf,"copyFile");function Rf(t,e,i,n=_){n=typeof i=="function"?i:n,new re(t).readv(e,typeof i=="function"?null:i).then(({buffers:r,bytesRead:o})=>n(null,o,r)).catch(n)}s(Rf,"readv");function Lf(t,e,i,n=_){n=typeof i=="function"?i:n,new re(t).writev(e,typeof i=="function"?null:i).then(({buffers:r,bytesWritten:o})=>n(null,o,r)).catch(n)}s(Lf,"writev");function Cf(t,e,i=_){i=typeof e=="function"?e:i,Ps(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Cf,"opendir");function Df(t,e,i,n){n=typeof i=="function"?i:n,Or(t,e,typeof i=="function"?null:i).then(()=>n(null)).catch(n)}s(Df,"cp");function Bf(t,e,i=_){i=typeof e=="function"?e:i,Rs(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Bf,"statfs");async function Mf(t,e){let i=await ve(t,"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}s(Mf,"openAsBlob");function Ls(t){return Vr(t)||zi(t)||t instanceof ie}s(Ls,"isMountConfig");async function Cs(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!Ls(t))throw new f(22,"Invalid mount configuration");if(t instanceof ie)return t;zi(t)&&(t={backend:t});for(let[r,o]of Object.entries(t))if(r!="backend"&&Ls(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[r]=await Cs(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);An(i,t);let n=i.create(t);return await n.ready(),n}s(Cs,"resolveMountConfig");async function Pg(t){let e="uid"in t&&+t.uid||0,i="gid"in t&&+t.gid||0;Ls(t)&&(t={"/":t});for(let[n,r]of Object.entries(t))n=="uid"||n=="gid"||typeof r=="number"||(t[n]=await Cs(r));Gi(t),fa({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Pg,"configure");var Rg=bn;return zf(Lg);})();
|
|
1
|
+
"use strict";var ZenFS=(()=>{var Wu=Object.create;var Ci=Object.defineProperty;var Uu=Object.getOwnPropertyDescriptor;var qu=Object.getOwnPropertyNames;var ju=Object.getPrototypeOf,$u=Object.prototype.hasOwnProperty;var s=(t,e)=>Ci(t,"name",{value:e,configurable:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wn=(t,e)=>{for(var i in e)Ci(t,i,{get:e[i],enumerable:!0})},Cs=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qu(e))!$u.call(t,r)&&r!==i&&Ci(t,r,{get:()=>e[r],enumerable:!(n=Uu(e,r))||n.enumerable});return t};var Lr=(t,e,i)=>(i=t!=null?Wu(ju(t)):{},Cs(e||!t||!t.__esModule?Ci(i,"default",{value:t,enumerable:!0}):i,t)),Vu=t=>Cs(Ci({},"__esModule",{value:!0}),t);var zs=T(Pn=>{"use strict";Pn.byteLength=kd;Pn.toByteArray=Fd;Pn.fromByteArray=Td;var Me=[],be=[],xd=typeof Uint8Array<"u"?Uint8Array:Array,Vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ot=0,$s=Vr.length;Ot<$s;++Ot)Me[Ot]=Vr[Ot],be[Vr.charCodeAt(Ot)]=Ot;var Ot,$s;be["-".charCodeAt(0)]=62;be["_".charCodeAt(0)]=63;function Vs(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 n=i===e?0:4-i%4;return[i,n]}s(Vs,"getLens");function kd(t){var e=Vs(t),i=e[0],n=e[1];return(i+n)*3/4-n}s(kd,"byteLength");function Id(t,e,i){return(e+i)*3/4-i}s(Id,"_byteLength");function Fd(t){var e,i=Vs(t),n=i[0],r=i[1],o=new xd(Id(t,n,r)),a=0,l=r>0?n-4:n,c;for(c=0;c<l;c+=4)e=be[t.charCodeAt(c)]<<18|be[t.charCodeAt(c+1)]<<12|be[t.charCodeAt(c+2)]<<6|be[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=be[t.charCodeAt(c)]<<2|be[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=be[t.charCodeAt(c)]<<10|be[t.charCodeAt(c+1)]<<4|be[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Fd,"toByteArray");function vd(t){return Me[t>>18&63]+Me[t>>12&63]+Me[t>>6&63]+Me[t&63]}s(vd,"tripletToBase64");function Ad(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(vd(n));return r.join("")}s(Ad,"encodeChunk");function Td(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(Ad(t,a,a+o>l?l:a+o));return n===1?(e=t[i-1],r.push(Me[e>>2]+Me[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Me[e>>10]+Me[e>>4&63]+Me[e<<2&63]+"=")),r.join("")}s(Td,"fromByteArray")});var Hs=T(zr=>{zr.read=function(t,e,i,n,r){var o,a,l=r*8-n-1,c=(1<<l)-1,f=c>>1,d=-7,h=i?r-1:0,b=i?-1:1,m=t[e+h];for(h+=b,o=m&(1<<-d)-1,m>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+h],h+=b,d-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(m?-1:1)*a*Math.pow(2,o-n)};zr.write=function(t,e,i,n,r,o){var a,l,c,f=o*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,w=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=b/c:e+=b*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,r),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[i+m]=l&255,m+=w,l/=256,r-=8);for(a=a<<r|l,f+=r;f>0;t[i+m]=a&255,m+=w,a/=256,f-=8);t[i+m-w]|=g*128}});var ke=T(ui=>{"use strict";var Hr=zs(),ci=Hs(),Ks=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=y;ui.SlowBuffer=Cd;ui.INSPECT_MAX_BYTES=50;var Rn=2147483647;ui.kMaxLength=Rn;y.TYPED_ARRAY_SUPPORT=Od();!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 Od(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Od,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function Je(t){if(t>Rn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(Je,"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 Xr(t)}return Js(t,e,i)}s(y,"Buffer");y.poolSize=8192;function Js(t,e,i){if(typeof t=="string")return Rd(t,e);if(ArrayBuffer.isView(t))return Ld(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Gr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return y.from(n,e,i);let r=Nd(t);if(r)return r;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(Js,"from");y.from=function(t,e,i){return Js(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function Qs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(Qs,"assertSize");function Pd(t,e,i){return Qs(t),t<=0?Je(t):e!==void 0?typeof i=="string"?Je(t).fill(e,i):Je(t).fill(e):Je(t)}s(Pd,"alloc");y.alloc=function(t,e,i){return Pd(t,e,i)};function Xr(t){return Qs(t),Je(t<0?0:Jr(t)|0)}s(Xr,"allocUnsafe");y.allocUnsafe=function(t){return Xr(t)};y.allocUnsafeSlow=function(t){return Xr(t)};function Rd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=Zs(t,e)|0,n=Je(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}s(Rd,"fromString");function Kr(t){let e=t.length<0?0:Jr(t.length)|0,i=Je(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}s(Kr,"fromArrayLike");function Ld(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Gr(e.buffer,e.byteOffset,e.byteLength)}return Kr(t)}s(Ld,"fromArrayView");function Gr(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 n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,y.prototype),n}s(Gr,"fromArrayBuffer");function Nd(t){if(y.isBuffer(t)){let e=Jr(t.length)|0,i=Je(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Zr(t.length)?Je(0):Kr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Kr(t.data)}s(Nd,"fromObject");function Jr(t){if(t>=Rn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Rn.toString(16)+" bytes");return t|0}s(Jr,"checked");function Cd(t){return+t!=t&&(t=0),y.alloc(+t)}s(Cd,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==i[o]){n=e[o],r=i[o];break}return n<r?-1:r<n?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 n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=y.allocUnsafe(i),o=0;for(n=0;n<e.length;++n){let a=e[n];if(We(a,Uint8Array))o+a.length>r.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(y.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function Zs(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Yr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return la(t).length;default:if(r)return n?-1:Yr(t).length;e=(""+e).toLowerCase(),r=!0}}s(Zs,"byteLength");y.byteLength=Zs;function Dd(t,e,i){let n=!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 Hd(this,e,i);case"utf8":case"utf-8":return ta(this,e,i);case"ascii":return Vd(this,e,i);case"latin1":case"binary":return zd(this,e,i);case"base64":return jd(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kd(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s(Dd,"slowToString");y.prototype._isBuffer=!0;function Pt(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}s(Pt,"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)Pt(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)Pt(this,i,i+3),Pt(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)Pt(this,i,i+7),Pt(this,i+1,i+6),Pt(this,i+2,i+5),Pt(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?ta(this,0,e):Dd.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=ui.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Ks&&(y.prototype[Ks]=y.prototype.inspect);y.prototype.compare=s(function(e,i,n,r,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;let a=o-r,l=n-i,c=Math.min(a,l),f=this.slice(r,o),d=e.slice(i,n);for(let h=0;h<c;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function ea(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Zr(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),y.isBuffer(e))return e.length===0?-1:Gs(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Gs(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(ea,"bidirectionalIndexOf");function Gs(t,e,i,n,r){let o=1,a=t.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(c,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(c(t,f)===c(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+l>a&&(i=a-l),f=i;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(c(t,f+h)!==c(e,h)){d=!1;break}if(d)return f}return-1}s(Gs,"arrayIndexOf");y.prototype.includes=s(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");y.prototype.indexOf=s(function(e,i,n){return ea(this,e,i,n,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,n){return ea(this,e,i,n,!1)},"lastIndexOf");function Bd(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let l=parseInt(e.substr(a*2,2),16);if(Zr(l))return a;t[i+a]=l}return a}s(Bd,"hexWrite");function Md(t,e,i,n){return Ln(Yr(e,t.length-i),t,i,n)}s(Md,"utf8Write");function Wd(t,e,i,n){return Ln(Jd(e),t,i,n)}s(Wd,"asciiWrite");function Ud(t,e,i,n){return Ln(la(e),t,i,n)}s(Ud,"base64Write");function qd(t,e,i,n){return Ln(Qd(e,t.length-i),t,i,n)}s(qd,"ucs2Write");y.prototype.write=s(function(e,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return Bd(this,e,i,n);case"utf8":case"utf-8":return Md(this,e,i,n);case"ascii":case"latin1":case"binary":return Wd(this,e,i,n);case"base64":return Ud(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qd(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function jd(t,e,i){return e===0&&i===t.length?Hr.fromByteArray(t):Hr.fromByteArray(t.slice(e,i))}s(jd,"base64Slice");function ta(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let o=t[r],a=null,l=o>239?4:o>223?3:o>191?2:1;if(r+l<=i){let c,f,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[r+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[r+1],f=t[r+2],(c&192)===128&&(f&192)===128&&(h=(o&15)<<12|(c&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[r+1],f=t[r+2],d=t[r+3],(c&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(c&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=l}return $d(n)}s(ta,"utf8Slice");var Ys=4096;function $d(t){let e=t.length;if(e<=Ys)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=Ys));return i}s($d,"decodeCodePointsArray");function Vd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}s(Vd,"asciiSlice");function zd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}s(zd,"latin1Slice");function Hd(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=e;o<i;++o)r+=Zd[t[o]];return r}s(Hd,"hexSlice");function Kd(t,e,i){let n=t.slice(e,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Kd,"utf16leSlice");y.prototype.slice=s(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,y.prototype),r},"slice");function X(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(X,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return r},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e+--i],o=1;for(;i>0&&(o*=256);)r+=this[e+--i]*o;return r},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||X(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||X(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||X(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||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=pt(s(function(e){e=e>>>0,fi(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Gi(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=pt(s(function(e){e=e>>>0,fi(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Gi(e,this.length-8);let r=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+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");y.prototype.readIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=i,o=1,a=this[e+--r];for(;r>0&&(o*=256);)a+=this[e+--r]*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||X(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||X(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||X(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||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=pt(s(function(e){e=e>>>0,fi(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Gi(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=pt(s(function(e){e=e>>>0,fi(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Gi(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),ci.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),ci.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),ci.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),ci.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,n,r,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}s(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=1,a=0;for(this[i]=e&255;++a<n&&(o*=256);)this[i+a]=e/o&255;return i+n},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=n-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+n},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function ia(t,e,i,n,r){aa(e,n,r,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(ia,"wrtBigUInt64LE");function na(t,e,i,n,r){aa(e,n,r,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(na,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=pt(s(function(e,i=0){return ia(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=pt(s(function(e,i=0){return na(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<n&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=n-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntBE");y.prototype.writeInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=pt(s(function(e,i=0){return ia(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=pt(s(function(e,i=0){return na(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function ra(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(ra,"checkIEEE754");function oa(t,e,i,n,r){return e=+e,i=i>>>0,r||ra(t,e,i,4,34028234663852886e22,-34028234663852886e22),ci.write(t,e,i,n,23,4),i+4}s(oa,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,n){return oa(this,e,i,!0,n)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,n){return oa(this,e,i,!1,n)},"writeFloatBE");function sa(t,e,i,n,r){return e=+e,i=i>>>0,r||ra(t,e,i,8,17976931348623157e292,-17976931348623157e292),ci.write(t,e,i,n,52,8),i+8}s(sa,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,n){return sa(this,e,i,!0,n)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,n){return sa(this,e,i,!1,n)},"writeDoubleBE");y.prototype.copy=s(function(e,i,n,r){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-i<r-n&&(r=e.length-i+n);let o=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),o},"copy");y.prototype.fill=s(function(e,i,n,r){if(typeof e=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!y.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=i;o<n;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,r),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%l]}return this},"fill");var li={};function Qr(t,e,i){li[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Qr,"E");Qr("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Qr("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Qr("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Xs(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=Xs(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function Xs(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Xs,"addNumericalSeparator");function Gd(t,e,i){fi(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Gi(e,t.length-(i+1))}s(Gd,"checkBounds");function aa(t,e,i,n,r,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new li.ERR_OUT_OF_RANGE("value",l,t)}Gd(n,r,o)}s(aa,"checkIntBI");function fi(t,e){if(typeof t!="number")throw new li.ERR_INVALID_ARG_TYPE(e,"number",t)}s(fi,"validateNumber");function Gi(t,e,i){throw Math.floor(t)!==t?(fi(t,i),new li.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new li.ERR_BUFFER_OUT_OF_BOUNDS:new li.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Gi,"boundsError");var Yd=/[^+/0-9A-Za-z-_]/g;function Xd(t){if(t=t.split("=")[0],t=t.trim().replace(Yd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(Xd,"base64clean");function Yr(t,e){e=e||1/0;let i,n=t.length,r=null,o=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=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(Yr,"utf8ToBytes");function Jd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Jd,"asciiToBytes");function Qd(t,e){let i,n,r,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Qd,"utf16leToBytes");function la(t){return Hr.toByteArray(Xd(t))}s(la,"base64ToBytes");function Ln(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}s(Ln,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function Zr(t){return t!==t}s(Zr,"numberIsNaN");var Zd=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function pt(t){return typeof BigInt>"u"?eh:t}s(pt,"defineBigIntMethod");function eh(){throw new Error("BigInt not supported")}s(eh,"BufferBigIntNotDefined")});var B=T(($S,La)=>{"use strict";La.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var gi=T((VS,qn)=>{"use strict";var{AbortController:Na,AbortSignal:rh}=typeof self<"u"?self:typeof window<"u"?window:void 0;qn.exports=Na;qn.exports.AbortSignal=rh;qn.exports.default=Na});var en=T((zS,lo)=>{"use strict";var wi=typeof Reflect=="object"?Reflect:null,Ca=wi&&typeof wi.apply=="function"?wi.apply:s(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),jn;wi&&typeof wi.ownKeys=="function"?jn=wi.ownKeys:Object.getOwnPropertySymbols?jn=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):jn=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function oh(t){console&&console.warn&&console.warn(t)}s(oh,"ProcessEmitWarning");var Ba=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function P(){P.init.call(this)}s(P,"EventEmitter");lo.exports=P;lo.exports.once=ch;P.EventEmitter=P;P.prototype._events=void 0;P.prototype._eventsCount=0;P.prototype._maxListeners=void 0;var Da=10;function $n(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s($n,"checkListener");Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return Da},set:function(t){if(typeof t!="number"||t<0||Ba(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Da=t}});P.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};P.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ba(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 Ma(t){return t._maxListeners===void 0?P.defaultMaxListeners:t._maxListeners}s(Ma,"_getMaxListeners");P.prototype.getMaxListeners=s(function(){return Ma(this)},"getMaxListeners");P.prototype.emit=s(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Ca(c,this,i);else for(var f=c.length,d=$a(c,f),n=0;n<f;++n)Ca(d[n],this,i);return!0},"emit");function Wa(t,e,i,n){var r,o,a;if($n(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]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Ma(t),r>0&&a.length>r&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,oh(l)}return t}s(Wa,"_addListener");P.prototype.addListener=s(function(e,i){return Wa(this,e,i,!1)},"addListener");P.prototype.on=P.prototype.addListener;P.prototype.prependListener=s(function(e,i){return Wa(this,e,i,!0)},"prependListener");function sh(){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(sh,"onceWrapper");function Ua(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=sh.bind(n);return r.listener=i,n.wrapFn=r,r}s(Ua,"_onceWrap");P.prototype.once=s(function(e,i){return $n(i),this.on(e,Ua(this,e,i)),this},"once");P.prototype.prependOnceListener=s(function(e,i){return $n(i),this.prependListener(e,Ua(this,e,i)),this},"prependOnceListener");P.prototype.removeListener=s(function(e,i){var n,r,o,a,l;if($n(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){l=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():ah(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");P.prototype.off=P.prototype.removeListener;P.prototype.removeAllListeners=s(function(e){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function qa(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?lh(r):$a(r,r.length)}s(qa,"_listeners");P.prototype.listeners=s(function(e){return qa(this,e,!0)},"listeners");P.prototype.rawListeners=s(function(e){return qa(this,e,!1)},"rawListeners");P.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ja.call(t,e)};P.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");P.prototype.eventNames=s(function(){return this._eventsCount>0?jn(this._events):[]},"eventNames");function $a(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}s($a,"arrayClone");function ah(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(ah,"spliceOne");function lh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(lh,"unwrapListeners");function ch(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,o),n(a)}s(r,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),Va(t,e,o,{once:!0}),e!=="error"&&fh(t,r,{once:!0})})}s(ch,"once");function fh(t,e,i){typeof t.on=="function"&&Va(t,"error",e,i)}s(fh,"addErrorHandlerIfEventEmitter");function Va(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function r(o){n.once&&t.removeEventListener(e,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(Va,"eventTargetAgnosticAddListener")});var ee=T((KS,co)=>{"use strict";var uh=ke(),{kResistStopPropagation:dh,SymbolDispose:hh}=B(),ph=globalThis.AbortSignal||gi().AbortSignal,yh=globalThis.AbortController||gi().AbortController,mh=Object.getPrototypeOf(async function(){}).constructor,za=globalThis.Blob||uh.Blob,bh=s(typeof za<"u"?function(e){return e instanceof za}:function(e){return!1},"isBlob"),Ha=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"),gh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Vn=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=e}};s(Vn,"AggregateError");co.exports={AggregateError:Vn,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof mh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:bh,deprecate(t,e){return t},addAbortListener:en().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Ha(e,"signal"),gh(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[dh]:!0}),n=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[hh](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:ph.any||s(function(e){if(e.length===1)return e[0];let i=new yh,n=s(()=>i.abort(),"abort");return e.forEach(r=>{Ha(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};co.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var re=T((YS,Ya)=>{"use strict";var{format:wh,inspect:Hn,AggregateError:Sh}=ee(),_h=globalThis.AggregateError||Sh,Eh=Symbol("kIsNodeError"),xh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],kh=/^([A-Z][a-z0-9]*)+$/,Ih="__node_internal_",Kn={};function Nt(t,e){if(!t)throw new Kn.ERR_INTERNAL_ASSERTION(e)}s(Nt,"assert");function Ka(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ka,"addNumericalSeparator");function Fh(t,e,i){if(typeof e=="function")return Nt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Nt(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:wh(e,...i)}s(Fh,"getMessage");function Z(t,e,i){i||(i=Error);class n extends i{constructor(...o){super(Fh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(n,"NodeError"),Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[Eh]=!0,Kn[t]=n}s(Z,"E");function Ga(t){let e=Ih+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(Ga,"hideStackFrames");function vh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new _h([e,t],e.message);return i.code=e.code,i}return t||e}s(vh,"aggregateTwoErrors");var zn=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Kn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(zn,"AbortError");Z("ERR_ASSERTION","%s",Error);Z("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Nt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let c of e)Nt(typeof c=="string","All expected entries have to be of type string"),xh.includes(c)?r.push(c.toLowerCase()):kh.test(c)?o.push(c):(Nt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let c=r.pop();n+=`one of type ${r.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();n+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${i.constructor.name}`;else{let c=Hn(i,{depth:-1});n+=`. Received ${c}`}}else{let c=Hn(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof i} (${c})`}return n},TypeError);Z("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let n=Hn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);Z("ERR_INVALID_RETURN_VALUE",(t,e,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);Z("ERR_MISSING_ARGS",(...t)=>{Nt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Z("ERR_OUT_OF_RANGE",(t,e,i)=>{Nt(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Ka(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Ka(n)),n+="n"):n=Hn(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Z("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Z("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Z("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Z("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Z("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Z("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Z("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Z("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Z("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Z("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Z("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Ya.exports={AbortError:zn,aggregateTwoErrors:Ga(vh),hideStackFrames:Ga,codes:Kn}});var _i=T((JS,ol)=>{"use strict";var{ArrayIsArray:uo,ArrayPrototypeIncludes:Za,ArrayPrototypeJoin:el,ArrayPrototypeMap:Ah,NumberIsInteger:ho,NumberIsNaN:Th,NumberMAX_SAFE_INTEGER:Oh,NumberMIN_SAFE_INTEGER:Ph,NumberParseInt:Rh,ObjectPrototypeHasOwnProperty:Lh,RegExpPrototypeExec:tl,String:Nh,StringPrototypeToUpperCase:Ch,StringPrototypeTrim:Dh}=B(),{hideStackFrames:Se,codes:{ERR_SOCKET_BAD_PORT:Bh,ERR_INVALID_ARG_TYPE:te,ERR_INVALID_ARG_VALUE:Si,ERR_OUT_OF_RANGE:Ct,ERR_UNKNOWN_SIGNAL:Xa}}=re(),{normalizeEncoding:Mh}=ee(),{isAsyncFunction:Wh,isArrayBufferView:Uh}=ee().types,Ja={};function qh(t){return t===(t|0)}s(qh,"isInt32");function jh(t){return t===t>>>0}s(jh,"isUint32");var $h=/^[0-7]+$/,Vh="must be a 32-bit unsigned integer or an octal string";function zh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(tl($h,t)===null)throw new Si(e,t,Vh);t=Rh(t,8)}return il(t,e),t}s(zh,"parseFileMode");var Hh=Se((t,e,i=Ph,n=Oh)=>{if(typeof t!="number")throw new te(e,"number",t);if(!ho(t))throw new Ct(e,"an integer",t);if(t<i||t>n)throw new Ct(e,`>= ${i} && <= ${n}`,t)}),Kh=Se((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new te(e,"number",t);if(!ho(t))throw new Ct(e,"an integer",t);if(t<i||t>n)throw new Ct(e,`>= ${i} && <= ${n}`,t)}),il=Se((t,e,i=!1)=>{if(typeof t!="number")throw new te(e,"number",t);if(!ho(t))throw new Ct(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new Ct(e,`>= ${n} && <= ${r}`,t)});function po(t,e){if(typeof t!="string")throw new te(e,"string",t)}s(po,"validateString");function Gh(t,e,i=void 0,n){if(typeof t!="number")throw new te(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&Th(t))throw new Ct(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}s(Gh,"validateNumber");var Yh=Se((t,e,i)=>{if(!Za(i,t)){let r="must be one of: "+el(Ah(i,o=>typeof o=="string"?`'${o}'`:Nh(o)),", ");throw new Si(e,t,r)}});function nl(t,e){if(typeof t!="boolean")throw new te(e,"boolean",t)}s(nl,"validateBoolean");function fo(t,e,i){return t==null||!Lh(t,e)?i:t[e]}s(fo,"getOwnPropertyValueOrDefault");var Xh=Se((t,e,i=null)=>{let n=fo(i,"allowArray",!1),r=fo(i,"allowFunction",!1);if(!fo(i,"nullable",!1)&&t===null||!n&&uo(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new te(e,"Object",t)}),Jh=Se((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new te(e,"a dictionary",t)}),Gn=Se((t,e,i=0)=>{if(!uo(t))throw new te(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new Si(e,t,n)}});function Qh(t,e){Gn(t,e);for(let i=0;i<t.length;i++)po(t[i],`${e}[${i}]`)}s(Qh,"validateStringArray");function Zh(t,e){Gn(t,e);for(let i=0;i<t.length;i++)nl(t[i],`${e}[${i}]`)}s(Zh,"validateBooleanArray");function ep(t,e){Gn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new te(r,"AbortSignal",n);rl(n,r)}}s(ep,"validateAbortSignalArray");function tp(t,e="signal"){if(po(t,e),Ja[t]===void 0)throw Ja[Ch(t)]!==void 0?new Xa(t+" (signals must use all capital letters)"):new Xa(t)}s(tp,"validateSignalName");var ip=Se((t,e="buffer")=>{if(!Uh(t))throw new te(e,["Buffer","TypedArray","DataView"],t)});function np(t,e){let i=Mh(e),n=t.length;if(i==="hex"&&n%2!==0)throw new Si("encoding",e,`is invalid for data of length ${n}`)}s(np,"validateEncoding");function rp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Dh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Bh(e,t,i);return t|0}s(rp,"validatePort");var rl=Se((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new te(e,"AbortSignal",t)}),op=Se((t,e)=>{if(typeof t!="function")throw new te(e,"Function",t)}),sp=Se((t,e)=>{if(typeof t!="function"||Wh(t))throw new te(e,"Function",t)}),ap=Se((t,e)=>{if(t!==void 0)throw new te(e,"undefined",t)});function lp(t,e,i){if(!Za(i,t))throw new te(e,`('${el(i,"|")}')`,t)}s(lp,"validateUnion");var cp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Qa(t,e){if(typeof t>"u"||!tl(cp,t))throw new Si(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Qa,"validateLinkHeaderFormat");function fp(t){if(typeof t=="string")return Qa(t,"hints"),t;if(uo(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];Qa(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new Si("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(fp,"validateLinkHeaderValue");ol.exports={isInt32:qh,isUint32:jh,parseFileMode:zh,validateArray:Gn,validateStringArray:Qh,validateBooleanArray:Zh,validateAbortSignalArray:ep,validateBoolean:nl,validateBuffer:ip,validateDictionary:Jh,validateEncoding:np,validateFunction:op,validateInt32:Kh,validateInteger:Hh,validateNumber:Gh,validateObject:Xh,validateOneOf:Yh,validatePlainFunction:sp,validatePort:rp,validateSignalName:tp,validateString:po,validateUint32:il,validateUndefined:ap,validateUnion:lp,validateAbortSignal:rl,validateLinkHeaderValue:fp}});var bt=T((ZS,cl)=>{var j=cl.exports={},Ue,qe;function yo(){throw new Error("setTimeout has not been defined")}s(yo,"defaultSetTimout");function mo(){throw new Error("clearTimeout has not been defined")}s(mo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ue=setTimeout:Ue=yo}catch{Ue=yo}try{typeof clearTimeout=="function"?qe=clearTimeout:qe=mo}catch{qe=mo}})();function sl(t){if(Ue===setTimeout)return setTimeout(t,0);if((Ue===yo||!Ue)&&setTimeout)return Ue=setTimeout,setTimeout(t,0);try{return Ue(t,0)}catch{try{return Ue.call(null,t,0)}catch{return Ue.call(this,t,0)}}}s(sl,"runTimeout");function up(t){if(qe===clearTimeout)return clearTimeout(t);if((qe===mo||!qe)&&clearTimeout)return qe=clearTimeout,clearTimeout(t);try{return qe(t)}catch{try{return qe.call(null,t)}catch{return qe.call(this,t)}}}s(up,"runClearTimeout");var tt=[],Ei=!1,Dt,Yn=-1;function dp(){!Ei||!Dt||(Ei=!1,Dt.length?tt=Dt.concat(tt):Yn=-1,tt.length&&al())}s(dp,"cleanUpNextTick");function al(){if(!Ei){var t=sl(dp);Ei=!0;for(var e=tt.length;e;){for(Dt=tt,tt=[];++Yn<e;)Dt&&Dt[Yn].run();Yn=-1,e=tt.length}Dt=null,Ei=!1,up(t)}}s(al,"drainQueue");j.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];tt.push(new ll(t,e)),tt.length===1&&!Ei&&sl(al)};function ll(t,e){this.fun=t,this.array=e}s(ll,"Item");ll.prototype.run=function(){this.fun.apply(null,this.array)};j.title="browser";j.browser=!0;j.env={};j.argv=[];j.version="";j.versions={};function it(){}s(it,"noop");j.on=it;j.addListener=it;j.once=it;j.off=it;j.removeListener=it;j.removeAllListeners=it;j.emit=it;j.prependListener=it;j.prependOnceListener=it;j.listeners=function(t){return[]};j.binding=function(t){throw new Error("process.binding is not supported")};j.cwd=function(){return"/"};j.chdir=function(t){throw new Error("process.chdir is not supported")};j.umask=function(){return 0}});var $e=T((t_,kl)=>{"use strict";var{SymbolAsyncIterator:fl,SymbolIterator:ul,SymbolFor:Bt}=B(),dl=Bt("nodejs.stream.destroyed"),hl=Bt("nodejs.stream.errored"),bo=Bt("nodejs.stream.readable"),go=Bt("nodejs.stream.writable"),pl=Bt("nodejs.stream.disturbed"),hp=Bt("nodejs.webstream.isClosedPromise"),pp=Bt("nodejs.webstream.controllerErrorFunction");function Xn(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(Xn,"isReadableNodeStream");function Jn(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(Jn,"isWritableNodeStream");function yp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(yp,"isDuplexNodeStream");function je(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(je,"isNodeStream");function yl(t){return!!(t&&!je(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(yl,"isReadableStream");function ml(t){return!!(t&&!je(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(ml,"isWritableStream");function bl(t){return!!(t&&!je(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(bl,"isTransformStream");function mp(t){return yl(t)||ml(t)||bl(t)}s(mp,"isWebStream");function bp(t,e){return t==null?!1:e===!0?typeof t[fl]=="function":e===!1?typeof t[ul]=="function":typeof t[fl]=="function"||typeof t[ul]=="function"}s(bp,"isIterable");function Qn(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[dl]||n!=null&&n.destroyed)}s(Qn,"isDestroyed");function gl(t){if(!Jn(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(gl,"isWritableEnded");function gp(t,e){if(!Jn(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(gp,"isWritableFinished");function wp(t){if(!Xn(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(wp,"isReadableEnded");function wl(t,e){if(!Xn(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(wl,"isReadableFinished");function Sl(t){return t&&t[bo]!=null?t[bo]:typeof t?.readable!="boolean"?null:Qn(t)?!1:Xn(t)&&t.readable&&!wl(t)}s(Sl,"isReadable");function _l(t){return t&&t[go]!=null?t[go]:typeof t?.writable!="boolean"?null:Qn(t)?!1:Jn(t)&&t.writable&&!gl(t)}s(_l,"isWritable");function Sp(t,e){return je(t)?Qn(t)?!0:!(e?.readable!==!1&&Sl(t)||e?.writable!==!1&&_l(t)):null}s(Sp,"isFinished");function _p(t){var e,i;return je(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(_p,"isWritableErrored");function Ep(t){var e,i;return je(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(Ep,"isReadableErrored");function xp(t){if(!je(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"&&El(t)?t._closed:null}s(xp,"isClosed");function El(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(El,"isOutgoingMessage");function xl(t){return typeof t._sent100=="boolean"&&El(t)}s(xl,"isServerResponse");function kp(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(kp,"isServerRequest");function Ip(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&xl(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(Ip,"willEmitClose");function Fp(t){var e;return!!(t&&((e=t[pl])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Fp,"isDisturbed");function vp(t){var e,i,n,r,o,a,l,c,f,d;return!!(t&&((e=(i=(n=(r=(o=(a=t[hl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(vp,"isErrored");kl.exports={isDestroyed:Qn,kIsDestroyed:dl,isDisturbed:Fp,kIsDisturbed:pl,isErrored:vp,kIsErrored:hl,isReadable:Sl,kIsReadable:bo,kIsClosedPromise:hp,kControllerErrorFunction:pp,kIsWritable:go,isClosed:xp,isDuplexNodeStream:yp,isFinished:Sp,isIterable:bp,isReadableNodeStream:Xn,isReadableStream:yl,isReadableEnded:wp,isReadableFinished:wl,isReadableErrored:Ep,isNodeStream:je,isWebStream:mp,isWritable:_l,isWritableNodeStream:Jn,isWritableStream:ml,isWritableEnded:gl,isWritableFinished:gp,isWritableErrored:_p,isServerRequest:kp,isServerResponse:xl,willEmitClose:Ip,isTransformStream:bl}});var nt=T((n_,xo)=>{var gt=bt(),{AbortError:Ll,codes:Ap}=re(),{ERR_INVALID_ARG_TYPE:Tp,ERR_STREAM_PREMATURE_CLOSE:Il}=Ap,{kEmptyObject:So,once:_o}=ee(),{validateAbortSignal:Op,validateFunction:Pp,validateObject:Rp,validateBoolean:Lp}=_i(),{Promise:Np,PromisePrototypeThen:Cp,SymbolDispose:Nl}=B(),{isClosed:Dp,isReadable:Fl,isReadableNodeStream:wo,isReadableStream:Bp,isReadableFinished:vl,isReadableErrored:Al,isWritable:Tl,isWritableNodeStream:Ol,isWritableStream:Mp,isWritableFinished:Pl,isWritableErrored:Rl,isNodeStream:Wp,willEmitClose:Up,kIsClosedPromise:qp}=$e(),xi;function jp(t){return t.setHeader&&typeof t.abort=="function"}s(jp,"isRequest");var Eo=s(()=>{},"nop");function Cl(t,e,i){var n,r;if(arguments.length===2?(i=e,e=So):e==null?e=So:Rp(e,"options"),Pp(i,"callback"),Op(e.signal,"options.signal"),i=_o(i),Bp(t)||Mp(t))return $p(t,e,i);if(!Wp(t))throw new Tp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:wo(t),a=(r=e.writable)!==null&&r!==void 0?r:Ol(t),l=t._writableState,c=t._readableState,f=s(()=>{t.writable||b()},"onlegacyfinish"),d=Up(t)&&wo(t)===o&&Ol(t)===a,h=Pl(t,!1),b=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||m)&&i.call(t)},"onfinish"),m=vl(t,!1),w=s(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=s(V=>{i.call(t,V)},"onerror"),F=Dp(t),S=s(()=>{F=!0;let V=Rl(t)||Al(t);if(V&&typeof V!="boolean")return i.call(t,V);if(o&&!m&&wo(t,!0)&&!vl(t,!1))return i.call(t,new Il);if(a&&!h&&!Pl(t,!1))return i.call(t,new Il);i.call(t)},"onclose"),O=s(()=>{F=!0;let V=Rl(t)||Al(t);if(V&&typeof V!="boolean")return i.call(t,V);i.call(t)},"onclosed"),W=s(()=>{t.req.on("finish",b)},"onrequest");jp(t)?(t.on("complete",b),d||t.on("abort",S),t.req?W():t.on("request",W)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",S),F?gt.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||gt.nextTick(O):(!o&&(!d||Fl(t))&&(h||Tl(t)===!1)||!a&&(!d||Tl(t))&&(m||Fl(t)===!1)||c&&t.req&&t.aborted)&>.nextTick(O);let v=s(()=>{i=Eo,t.removeListener("aborted",S),t.removeListener("complete",b),t.removeListener("abort",S),t.removeListener("request",W),t.req&&t.req.removeListener("finish",b),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",b),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",S)},"cleanup");if(e.signal&&!F){let V=s(()=>{let St=i;v(),St.call(t,new Ll(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)gt.nextTick(V);else{xi=xi||ee().addAbortListener;let St=xi(e.signal,V),ue=i;i=_o((...Yt)=>{St[Nl](),ue.apply(t,Yt)})}}return v}s(Cl,"eos");function $p(t,e,i){let n=!1,r=Eo;if(e.signal)if(r=s(()=>{n=!0,i.call(t,new Ll(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)gt.nextTick(r);else{xi=xi||ee().addAbortListener;let a=xi(e.signal,r),l=i;i=_o((...c)=>{a[Nl](),l.apply(t,c)})}let o=s((...a)=>{n||gt.nextTick(()=>i.apply(t,a))},"resolverFn");return Cp(t[qp].promise,o,o),Eo}s($p,"eosWeb");function Vp(t,e){var i;let n=!1;return e===null&&(e=So),(i=e)!==null&&i!==void 0&&i.cleanup&&(Lp(e.cleanup,"cleanup"),n=e.cleanup),new Np((r,o)=>{let a=Cl(t,e,l=>{n&&a(),l?o(l):r()})})}s(Vp,"finished");xo.exports=Cl;xo.exports.finished=Vp});var Mt=T((o_,$l)=>{"use strict";var Ve=bt(),{aggregateTwoErrors:zp,codes:{ERR_MULTIPLE_CALLBACK:Hp},AbortError:Kp}=re(),{Symbol:Ml}=B(),{kIsDestroyed:Gp,isDestroyed:Yp,isFinished:Xp,isServerRequest:Jp}=$e(),Wl=Ml("kDestroy"),ko=Ml("kConstruct");function Ul(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Ul,"checkError");function Qp(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(Ul(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Dl(this,t,e):this.once(Wl,function(o){Dl(this,zp(o,t),e)}),this)}s(Qp,"destroy");function Dl(t,e,i){let n=!1;function r(o){if(n)return;n=!0;let a=t._readableState,l=t._writableState;Ul(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ve.nextTick(Zp,t,o):Ve.nextTick(ql,t)}s(r,"onDestroy");try{t._destroy(e||null,r)}catch(o){r(o)}}s(Dl,"_destroy");function Zp(t,e){Io(t,e),ql(t)}s(Zp,"emitErrorCloseNT");function ql(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(ql,"emitCloseNT");function Io(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(Io,"emitErrorNT");function ey(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(ey,"undestroy");function Fo(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?Ve.nextTick(Io,t,e):Io(t,e))}s(Fo,"errorOrDestroy");function ty(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(ko,e),!(t.listenerCount(ko)>1)&&Ve.nextTick(iy,t)}s(ty,"construct");function iy(t){let e=!1;function i(n){if(e){Fo(t,n??new Hp);return}e=!0;let r=t._readableState,o=t._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Wl,n):n?Fo(t,n,!0):Ve.nextTick(ny,t)}s(i,"onConstruct");try{t._construct(n=>{Ve.nextTick(i,n)})}catch(n){Ve.nextTick(i,n)}}s(iy,"constructNT");function ny(t){t.emit(ko)}s(ny,"emitConstructNT");function Bl(t){return t?.setHeader&&typeof t.abort=="function"}s(Bl,"isRequest");function jl(t){t.emit("close")}s(jl,"emitCloseLegacy");function ry(t,e){t.emit("error",e),Ve.nextTick(jl,t)}s(ry,"emitErrorCloseLegacy");function oy(t,e){!t||Yp(t)||(!e&&!Xp(t)&&(e=new Kp),Jp(t)?(t.socket=null,t.destroy(e)):Bl(t)?t.abort():Bl(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ve.nextTick(ry,t,e):Ve.nextTick(jl,t),t.destroyed||(t[Gp]=!0))}s(oy,"destroyer");$l.exports={construct:ty,destroyer:oy,destroy:Qp,undestroy:ey,errorOrDestroy:Fo}});var tr=T((a_,zl)=>{"use strict";var{ArrayIsArray:sy,ObjectSetPrototypeOf:Vl}=B(),{EventEmitter:Zn}=en();function er(t){Zn.call(this,t)}s(er,"Stream");Vl(er.prototype,Zn.prototype);Vl(er,Zn);er.prototype.pipe=function(t,e){let i=this;function n(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(d){f(),Zn.listenerCount(this,"error")===0&&this.emit("error",d)}s(c,"onerror"),vo(i,"error",c),vo(t,"error",c);function f(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function vo(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):sy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(vo,"prependListener");zl.exports={Stream:er,prependListener:vo}});var tn=T((c_,ir)=>{"use strict";var{SymbolDispose:ay}=B(),{AbortError:Hl,codes:ly}=re(),{isNodeStream:Kl,isWebStream:cy,kControllerErrorFunction:fy}=$e(),uy=nt(),{ERR_INVALID_ARG_TYPE:Gl}=ly,Ao,dy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Gl(e,"AbortSignal",t)},"validateAbortSignal");ir.exports.addAbortSignal=s(function(e,i){if(dy(e,"signal"),!Kl(i)&&!cy(i))throw new Gl("stream",["ReadableStream","WritableStream","Stream"],i);return ir.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");ir.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=Kl(e)?()=>{e.destroy(new Hl(void 0,{cause:t.reason}))}:()=>{e[fy](new Hl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Ao=Ao||ee().addAbortListener;let n=Ao(t,i);uy(e,n[ay])}return e}});var Jl=T((d_,Xl)=>{"use strict";var{StringPrototypeSlice:Yl,SymbolIterator:hy,TypedArrayPrototypeSet:nr,Uint8Array:py}=B(),{Buffer:To}=ke(),{inspect:yy}=ee();Xl.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return To.alloc(0);let i=To.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)nr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[hy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",n=this.head,r=0;do{let o=n.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=Yl(o,0,e),this.head=n,n.data=Yl(o,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=To.allocUnsafe(e),n=e,r=this.head,o=0;do{let a=r.data;if(e>a.length)nr(i,a,n-e),e-=a.length;else{e===a.length?(nr(i,a,n-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(nr(i,new py(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return yy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var nn=T((p_,tc)=>{"use strict";var{MathFloor:my,NumberIsInteger:by}=B(),{validateInteger:gy}=_i(),{ERR_INVALID_ARG_VALUE:wy}=re().codes,Ql=16*1024,Zl=16;function Sy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Sy,"highWaterMarkFrom");function ec(t){return t?Zl:Ql}s(ec,"getDefaultHighWaterMark");function _y(t,e){gy(e,"value",0),t?Zl=e:Ql=e}s(_y,"setDefaultHighWaterMark");function Ey(t,e,i,n){let r=Sy(e,n,i);if(r!=null){if(!by(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new wy(o,r)}return my(r)}return ec(t.objectMode)}s(Ey,"getHighWaterMark");tc.exports={getHighWaterMark:Ey,getDefaultHighWaterMark:ec,setDefaultHighWaterMark:_y}});var rc=T((Oo,nc)=>{var rr=ke(),ze=rr.Buffer;function ic(t,e){for(var i in t)e[i]=t[i]}s(ic,"copyProps");ze.from&&ze.alloc&&ze.allocUnsafe&&ze.allocUnsafeSlow?nc.exports=rr:(ic(rr,Oo),Oo.Buffer=Wt);function Wt(t,e,i){return ze(t,e,i)}s(Wt,"SafeBuffer");Wt.prototype=Object.create(ze.prototype);ic(ze,Wt);Wt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ze(t,e,i)};Wt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ze(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Wt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ze(t)};Wt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return rr.SlowBuffer(t)}});var ac=T(sc=>{"use strict";var Ro=rc().Buffer,oc=Ro.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function xy(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(xy,"_normalizeEncoding");function ky(t){var e=xy(t);if(typeof e!="string"&&(Ro.isEncoding===oc||!oc(t)))throw new Error("Unknown encoding: "+t);return e||t}s(ky,"normalizeEncoding");sc.StringDecoder=rn;function rn(t){this.encoding=ky(t);var e;switch(this.encoding){case"utf16le":this.text=Oy,this.end=Py,e=4;break;case"utf8":this.fillLast=vy,e=4;break;case"base64":this.text=Ry,this.end=Ly,e=3;break;default:this.write=Ny,this.end=Cy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ro.allocUnsafe(e)}s(rn,"StringDecoder");rn.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||""};rn.prototype.end=Ty;rn.prototype.text=Ay;rn.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 Po(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Po,"utf8CheckByte");function Iy(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Po(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Po(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Po(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}s(Iy,"utf8CheckIncomplete");function Fy(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(Fy,"utf8CheckExtraBytes");function vy(t){var e=this.lastTotal-this.lastNeed,i=Fy(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(vy,"utf8FillLast");function Ay(t,e){var i=Iy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}s(Ay,"utf8Text");function Ty(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Ty,"utf8End");function Oy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=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(Oy,"utf16Text");function Py(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(Py,"utf16End");function Ry(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Ry,"base64Text");function Ly(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Ly,"base64End");function Ny(t){return t.toString(this.encoding)}s(Ny,"simpleWrite");function Cy(t){return t&&t.length?this.write(t):""}s(Cy,"simpleEnd")});var Lo=T((w_,uc)=>{"use strict";var lc=bt(),{PromisePrototypeThen:Dy,SymbolAsyncIterator:cc,SymbolIterator:fc}=B(),{Buffer:By}=ke(),{ERR_INVALID_ARG_TYPE:My,ERR_STREAM_NULL_VALUES:Wy}=re().codes;function Uy(t,e,i){let n;if(typeof e=="string"||e instanceof By)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let r;if(e&&e[cc])r=!0,n=e[cc]();else if(e&&e[fc])r=!1,n=e[fc]();else throw new My("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(f,d){Dy(l(f),()=>lc.nextTick(d,f),h=>lc.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:m}=await n.throw(f);if(await b,m)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(l,"close");async function c(){for(;;){try{let{value:f,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Wy;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(c,"next"),o}s(Uy,"from");uc.exports=Uy});var sn=T((__,Tc)=>{var Ie=bt(),{ArrayPrototypeIndexOf:qy,NumberIsInteger:jy,NumberIsNaN:$y,NumberParseInt:Vy,ObjectDefineProperties:qo,ObjectKeys:zy,ObjectSetPrototypeOf:pc,Promise:yc,SafeSet:Hy,SymbolAsyncDispose:Ky,SymbolAsyncIterator:Gy,Symbol:Yy}=B();Tc.exports=E;E.ReadableState=lr;var{EventEmitter:Xy}=en(),{Stream:wt,prependListener:Jy}=tr(),{Buffer:No}=ke(),{addAbortSignal:Qy}=tn(),mc=nt(),I=ee().debuglog("stream",t=>{I=t}),Zy=Jl(),Fi=Mt(),{getHighWaterMark:em,getDefaultHighWaterMark:tm}=nn(),{aggregateTwoErrors:dc,codes:{ERR_INVALID_ARG_TYPE:im,ERR_METHOD_NOT_IMPLEMENTED:nm,ERR_OUT_OF_RANGE:rm,ERR_STREAM_PUSH_AFTER_EOF:om,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:sm},AbortError:am}=re(),{validateObject:lm}=_i(),Ut=Yy("kPaused"),{StringDecoder:bc}=ac(),cm=Lo();pc(E.prototype,wt.prototype);pc(E,wt);var Co=s(()=>{},"nop"),{errorOrDestroy:ki}=Fi,Ii=1<<0,fm=1<<1,gc=1<<2,on=1<<3,wc=1<<4,or=1<<5,sr=1<<6,Sc=1<<7,um=1<<8,dm=1<<9,hm=1<<10,Wo=1<<11,Uo=1<<12,pm=1<<13,ym=1<<14,mm=1<<15,_c=1<<16,bm=1<<17,gm=1<<18;function H(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(H,"makeBitMapDescriptor");qo(lr.prototype,{objectMode:H(Ii),ended:H(fm),endEmitted:H(gc),reading:H(on),constructed:H(wc),sync:H(or),needReadable:H(sr),emittedReadable:H(Sc),readableListening:H(um),resumeScheduled:H(dm),errorEmitted:H(hm),emitClose:H(Wo),autoDestroy:H(Uo),destroyed:H(pm),closed:H(ym),closeEmitted:H(mm),multiAwaitDrain:H(_c),readingMore:H(bm),dataEmitted:H(gm)});function lr(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.state=Wo|Uo|wc|or,t&&t.objectMode&&(this.state|=Ii),i&&t&&t.readableObjectMode&&(this.state|=Ii),this.highWaterMark=t?em(this,t,"readableHighWaterMark",i):tm(!1),this.buffer=new Zy,this.length=0,this.pipes=[],this.flowing=null,this[Ut]=null,t&&t.emitClose===!1&&(this.state&=~Wo),t&&t.autoDestroy===!1&&(this.state&=~Uo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new bc(t.encoding),this.encoding=t.encoding)}s(lr,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof He();this._readableState=new lr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Qy(t.signal,this)),wt.call(this,t),Fi.construct(this,()=>{this._readableState.needReadable&&ar(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=Fi.destroy;E.prototype._undestroy=Fi.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Xy.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[Ky]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new am,this.destroy(t)),new yc((e,i)=>mc(this,n=>n&&n!==t?i(n):e(null)))};E.prototype.push=function(t,e){return Ec(this,t,e,!1)};E.prototype.unshift=function(t,e){return Ec(this,t,e,!0)};function Ec(t,e,i,n){I("readableAddChunk",e);let r=t._readableState,o;if(r.state&Ii||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=No.from(e,i).toString(r.encoding):(e=No.from(e,i),i=""))):e instanceof No?i="":wt._isUint8Array(e)?(e=wt._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new im("chunk",["string","Buffer","Uint8Array"],e))),o)ki(t,o);else if(e===null)r.state&=~on,_m(t,r);else if(r.state&Ii||e&&e.length>0)if(n)if(r.state&gc)ki(t,new sm);else{if(r.destroyed||r.errored)return!1;Do(t,r,e,!0)}else if(r.ended)ki(t,new om);else{if(r.destroyed||r.errored)return!1;r.state&=~on,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?Do(t,r,e,!1):ar(t,r)):Do(t,r,e,!1)}else n||(r.state&=~on,ar(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Ec,"readableAddChunk");function Do(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&_c?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&sr&&cr(t)),ar(t,e)}s(Do,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[Ut]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new bc(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var wm=1073741824;function Sm(t){if(t>wm)throw new rm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Sm,"computeNewHighWaterMark");function hc(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Ii?1:$y(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(hc,"howMuchToRead");E.prototype.read=function(t){I("read",t),t===void 0?t=NaN:jy(t)||(t=Vy(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Sm(t)),t!==0&&(e.state&=~Sc),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return I("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Bo(this):cr(this),null;if(t=hc(t,e),t===0&&e.ended)return e.length===0&&Bo(this),null;let n=(e.state&sr)!==0;if(I("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,I("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,I("reading, ended or constructing",n);else if(n){I("do read"),e.state|=on|or,e.length===0&&(e.state|=sr);try{this._read(e.highWaterMark)}catch(o){ki(this,o)}e.state&=~or,e.reading||(t=hc(i,e))}let r;return t>0?r=vc(t,e):r=null,r===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&&Bo(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function _m(t,e){if(I("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?cr(t):(e.needReadable=!1,e.emittedReadable=!0,xc(t))}}s(_m,"onEofChunk");function cr(t){let e=t._readableState;I("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(I("emitReadable",e.flowing),e.emittedReadable=!0,Ie.nextTick(xc,t))}s(cr,"emitReadable");function xc(t){let e=t._readableState;I("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,Ic(t)}s(xc,"emitReadable_");function ar(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ie.nextTick(Em,t,e))}s(ar,"maybeReadMore");function Em(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(I("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Em,"maybeReadMore_");E.prototype._read=function(t){throw new nm("_read()")};E.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Hy(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),I("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ie.stdout&&t!==Ie.stderr?l:F;n.endEmitted?Ie.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,O){I("onunpipe"),S===i&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){I("onend"),t.end()}s(l,"onend");let c,f=!1;function d(){I("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",F),i.removeListener("data",b),f=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(d,"cleanup");function h(){f||(n.pipes.length===1&&n.pipes[0]===t?(I("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(I("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),c||(c=xm(i,t),t.on("drain",c))}s(h,"pause"),i.on("data",b);function b(S){I("ondata");let O=t.write(S);I("dest.write",O),O===!1&&h()}s(b,"ondata");function m(S){if(I("onerror",S),F(),t.removeListener("error",m),t.listenerCount("error")===0){let O=t._writableState||t._readableState;O&&!O.errorEmitted?ki(t,S):t.emit("error",S)}}s(m,"onerror"),Jy(t,"error",m);function w(){t.removeListener("finish",g),F()}s(w,"onclose"),t.once("close",w);function g(){I("onfinish"),t.removeListener("close",w),F()}s(g,"onfinish"),t.once("finish",g);function F(){I("unpipe"),i.unpipe(t)}return s(F,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():n.flowing||(I("pipe resume"),i.resume()),t};function xm(t,e){return s(function(){let n=t._readableState;n.awaitDrainWriters===e?(I("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(I("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(xm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=qy(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=wt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,I("on readable",n.length,n.reading),n.length?cr(this):n.reading||Ie.nextTick(km,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=wt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ie.nextTick(kc,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=wt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ie.nextTick(kc,this),e};function kc(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Ut]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(kc,"updateReadableListening");function km(t){I("readable nexttick read 0"),t.read(0)}s(km,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(I("resume"),t.flowing=!t.readableListening,Im(this,t)),t[Ut]=!1,this};function Im(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ie.nextTick(Fm,t,e))}s(Im,"resume");function Fm(t,e){I("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ic(t),e.flowing&&!e.reading&&t.read(0)}s(Fm,"resume_");E.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Ut]=!0,this};function Ic(t){let e=t._readableState;for(I("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Ic,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{ki(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=zy(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};E.prototype[Gy]=function(){return Fc(this)};E.prototype.iterator=function(t){return t!==void 0&&lm(t,"options"),Fc(this,t)};function Fc(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=vm(t,e);return i.stream=t,i}s(Fc,"streamToAsyncIterator");async function*vm(t,e){let i=Co;function n(a){this===t?(i(),i=Co):i=a}s(n,"next"),t.on("readable",n);let r,o=mc(t,{writable:!1},a=>{r=a?dc(r,a):null,i(),i=Co});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new yc(n)}}}catch(a){throw r=dc(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?Fi.destroyer(t,null):(t.off("readable",n),o())}}s(vm,"createAsyncIterator");qo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});qo(lr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Ut]!==!1},set(t){this[Ut]=!!t}}});E._fromList=vc;function vc(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(vc,"fromList");function Bo(t){let e=t._readableState;I("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ie.nextTick(Am,e,t))}s(Bo,"endReadable");function Am(t,e){if(I("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)Ie.nextTick(Tm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Am,"endReadableNT");function Tm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Tm,"endWritableNT");E.from=function(t,e){return cm(E,t,e)};var Mo;function Ac(){return Mo===void 0&&(Mo={}),Mo}s(Ac,"lazyWebStreams");E.fromWeb=function(t,e){return Ac().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Ac().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,n;return new E({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(r,o){Fi.destroyer(t,r),o(r)}}).wrap(t)}});var pr=T((x_,qc)=>{var qt=bt(),{ArrayPrototypeSlice:Rc,Error:Om,FunctionPrototypeSymbolHasInstance:Lc,ObjectDefineProperty:Nc,ObjectDefineProperties:Pm,ObjectSetPrototypeOf:Cc,StringPrototypeToLowerCase:Rm,Symbol:Lm,SymbolHasInstance:Nm}=B();qc.exports=M;M.WritableState=cn;var{EventEmitter:Cm}=en(),an=tr().Stream,{Buffer:fr}=ke(),hr=Mt(),{addAbortSignal:Dm}=tn(),{getHighWaterMark:Bm,getDefaultHighWaterMark:Mm}=nn(),{ERR_INVALID_ARG_TYPE:Wm,ERR_METHOD_NOT_IMPLEMENTED:Um,ERR_MULTIPLE_CALLBACK:Dc,ERR_STREAM_CANNOT_PIPE:qm,ERR_STREAM_DESTROYED:ln,ERR_STREAM_ALREADY_FINISHED:jm,ERR_STREAM_NULL_VALUES:$m,ERR_STREAM_WRITE_AFTER_END:Vm,ERR_UNKNOWN_ENCODING:Bc}=re().codes,{errorOrDestroy:vi}=hr;Cc(M.prototype,an.prototype);Cc(M,an);function Vo(){}s(Vo,"nop");var Ai=Lm("kOnFinished");function cn(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Bm(this,t,"writableHighWaterMark",i):Mm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Hm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,dr(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[Ai]=[]}s(cn,"WritableState");function dr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(dr,"resetBuffer");cn.prototype.getBuffer=s(function(){return Rc(this.buffered,this.bufferedIndex)},"getBuffer");Nc(cn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function M(t){let e=this instanceof He();if(!e&&!Lc(M,this))return new M(t);this._writableState=new cn(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&&Dm(t.signal,this)),an.call(this,t),hr.construct(this,()=>{let i=this._writableState;i.writing||Ho(this,i),Ko(this,i)})}s(M,"Writable");Nc(M,Nm,{__proto__:null,value:function(t){return Lc(this,t)?!0:this!==M?!1:t&&t._writableState instanceof cn}});M.prototype.pipe=function(){vi(this,new qm)};function Mc(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!fr.isEncoding(i))throw new Bc(i);typeof n!="function"&&(n=Vo)}if(e===null)throw new $m;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=fr.from(e,i),i="buffer");else if(e instanceof fr)i="buffer";else if(an._isUint8Array(e))e=an._uint8ArrayToBuffer(e),i="buffer";else throw new Wm("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new Vm:r.destroyed&&(o=new ln("write")),o?(qt.nextTick(n,o),vi(t,o,!0),o):(r.pendingcb++,zm(t,r,e,i,n))}s(Mc,"_write");M.prototype.write=function(t,e,i){return Mc(this,t,e,i)===!0};M.prototype.cork=function(){this._writableState.corked++};M.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ho(this,t))};M.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Rm(e)),!fr.isEncoding(e))throw new Bc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function zm(t,e,i,n,r){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:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==Vo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(zm,"writeOrBuffer");function Oc(t,e,i,n,r,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new ln("write")):i?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}s(Oc,"doWrite");function Pc(t,e,i,n){--e.pendingcb,n(i),zo(e),vi(t,i)}s(Pc,"onwriteError");function Hm(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){vi(t,new Dc);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),n?qt.nextTick(Pc,t,i,e,r):Pc(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&Ho(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},qt.nextTick(Km,i.afterWriteTickInfo)):Wc(t,i,1,r))}s(Hm,"onwrite");function Km({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,Wc(t,e,i,n)}s(Km,"afterWriteTick");function Wc(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&zo(e),Ko(t,e)}s(Wc,"afterWrite");function zo(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:a}=t.buffered[r],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new ln("write"))}let i=t[Ai].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new ln("end"))}dr(t)}s(zo,"errorBuffer");function Ho(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Vo:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},c=e.allNoop&&a===0?i:Rc(i,a);c.allBuffers=e.allBuffers,Oc(t,e,!0,e.length,c,"",l),dr(e)}else{do{let{chunk:l,encoding:c,callback:f}=i[a];i[a++]=null;let d=r?1:l.length;Oc(t,e,!1,d,l,c,f)}while(a<i.length&&!e.writing);a===i.length?dr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Ho,"clearBuffer");M.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Um("_write()")};M.prototype._writev=null;M.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let o=Mc(this,t,e);o instanceof Om&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Ko(this,n,!0),n.ended=!0):n.finished?r=new jm("end"):n.destroyed&&(r=new ln("end"))),typeof i=="function"&&(r||n.finished?qt.nextTick(i,r):n[Ai].push(i)),this};function ur(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(ur,"needFinish");function Gm(t,e){let i=!1;function n(r){if(i){vi(t,r??Dc());return}if(i=!0,e.pendingcb--,r){let o=e[Ai].splice(0);for(let a=0;a<o.length;a++)o[a](r);vi(t,r,e.sync)}else ur(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,qt.nextTick($o,t,e))}s(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}s(Gm,"callFinal");function Ym(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Gm(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(Ym,"prefinish");function Ko(t,e,i){ur(e)&&(Ym(t,e),e.pendingcb===0&&(i?(e.pendingcb++,qt.nextTick((n,r)=>{ur(r)?$o(n,r):r.pendingcb--},t,e)):ur(e)&&(e.pendingcb++,$o(t,e))))}s(Ko,"finishMaybe");function $o(t,e){e.pendingcb--,e.finished=!0;let i=e[Ai].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}s($o,"finish");Pm(M.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Xm=hr.destroy;M.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ai].length)&&qt.nextTick(zo,i),Xm.call(this,t,e),this};M.prototype._undestroy=hr.undestroy;M.prototype._destroy=function(t,e){e(t)};M.prototype[Cm.captureRejectionSymbol]=function(t){this.destroy(t)};var jo;function Uc(){return jo===void 0&&(jo={}),jo}s(Uc,"lazyWebStreams");M.fromWeb=function(t,e){return Uc().newStreamWritableFromWritableStream(t,e)};M.toWeb=function(t){return Uc().newWritableStreamFromStreamWritable(t)}});var nf=T((I_,tf)=>{var Go=bt(),Jm=ke(),{isReadable:Qm,isWritable:Zm,isIterable:jc,isNodeStream:eb,isReadableNodeStream:$c,isWritableNodeStream:Vc,isDuplexNodeStream:tb,isReadableStream:zc,isWritableStream:Hc}=$e(),Kc=nt(),{AbortError:Zc,codes:{ERR_INVALID_ARG_TYPE:ib,ERR_INVALID_RETURN_VALUE:Gc}}=re(),{destroyer:Oi}=Mt(),nb=He(),ef=sn(),rb=pr(),{createDeferredPromise:Yc}=ee(),Xc=Lo(),Jc=globalThis.Blob||Jm.Blob,ob=s(typeof Jc<"u"?function(e){return e instanceof Jc}:function(e){return!1},"isBlob"),sb=globalThis.AbortController||gi().AbortController,{FunctionPrototypeCall:Qc}=B(),rt=class extends nb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(rt,"Duplexify");tf.exports=s(function t(e,i){if(tb(e))return e;if($c(e))return Ti({readable:e});if(Vc(e))return Ti({writable:e});if(eb(e))return Ti({writable:!1,readable:!1});if(zc(e))return Ti({readable:ef.fromWeb(e)});if(Hc(e))return Ti({writable:rb.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:a,destroy:l}=ab(e);if(jc(r))return Xc(rt,r,{objectMode:!0,write:o,final:a,destroy:l});let c=r?.then;if(typeof c=="function"){let f,d=Qc(c,r,h=>{if(h!=null)throw new Gc("nully","body",h)},h=>{Oi(f,h)});return f=new rt({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Go.nextTick(h,null)}catch(b){Go.nextTick(h,b)}})},destroy:l})}throw new Gc("Iterable, AsyncIterable or AsyncFunction",i,r)}if(ob(e))return t(e.arrayBuffer());if(jc(e))return Xc(rt,e,{objectMode:!0,writable:!1});if(zc(e?.readable)&&Hc(e?.writable))return rt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?$c(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?Vc(e?.writable)?e?.writable:t(e.writable):void 0;return Ti({readable:r,writable:o})}let n=e?.then;if(typeof n=="function"){let r;return Qc(n,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{Oi(r,o)}),r=new rt({objectMode:!0,writable:!1,read(){}})}throw new ib(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ab(t){let{promise:e,resolve:i}=Yc(),n=new sb,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:f}=await a;if(Go.nextTick(f),c)return;if(r.aborted)throw new Zc(void 0,{cause:r.reason});({promise:e,resolve:i}=Yc()),yield l}}(),{signal:r}),write(a,l,c){let f=i;i=null,f({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){n.abort(),l(a)}}}s(ab,"fromAsyncGen");function Ti(t){let e=t.readable&&typeof t.readable.read!="function"?ef.wrap(t.readable):t.readable,i=t.writable,n=!!Qm(e),r=!!Zm(i),o,a,l,c,f;function d(h){let b=c;c=null,b?b(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new rt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Kc(i,h=>{r=!1,h&&Oi(e,h),d(h)}),f._write=function(h,b,m){i.write(h,b)?m():o=m},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()}})),n&&(Kc(e,h=>{n=!1,h&&Oi(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&c!==null&&(h=new Zc),l=null,o=null,a=null,c===null?b(h):(c=b,Oi(i,h),Oi(e,h))},f}s(Ti,"_duplexify")});var He=T((v_,sf)=>{"use strict";var{ObjectDefineProperties:lb,ObjectGetOwnPropertyDescriptor:ot,ObjectKeys:cb,ObjectSetPrototypeOf:rf}=B();sf.exports=Fe;var Jo=sn(),_e=pr();rf(Fe.prototype,Jo.prototype);rf(Fe,Jo);{let t=cb(_e.prototype);for(let e=0;e<t.length;e++){let i=t[e];Fe.prototype[i]||(Fe.prototype[i]=_e.prototype[i])}}function Fe(t){if(!(this instanceof Fe))return new Fe(t);Jo.call(this,t),_e.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Fe,"Duplex");lb(Fe.prototype,{writable:{__proto__:null,...ot(_e.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ot(_e.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ot(_e.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ot(_e.prototype,"writableBuffer")},writableLength:{__proto__:null,...ot(_e.prototype,"writableLength")},writableFinished:{__proto__:null,...ot(_e.prototype,"writableFinished")},writableCorked:{__proto__:null,...ot(_e.prototype,"writableCorked")},writableEnded:{__proto__:null,...ot(_e.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ot(_e.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Yo;function of(){return Yo===void 0&&(Yo={}),Yo}s(of,"lazyWebStreams");Fe.fromWeb=function(t,e){return of().newStreamDuplexFromReadableWritablePair(t,e)};Fe.toWeb=function(t){return of().newReadableWritablePairFromDuplex(t)};var Xo;Fe.from=function(t){return Xo||(Xo=nf()),Xo(t,"body")}});var es=T((T_,lf)=>{"use strict";var{ObjectSetPrototypeOf:af,Symbol:fb}=B();lf.exports=st;var{ERR_METHOD_NOT_IMPLEMENTED:ub}=re().codes,Zo=He(),{getHighWaterMark:db}=nn();af(st.prototype,Zo.prototype);af(st,Zo);var fn=fb("kCallback");function st(t){if(!(this instanceof st))return new st(t);let e=t?db(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Zo.call(this,t),this._readableState.sync=!1,this[fn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",hb)}s(st,"Transform");function Qo(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(Qo,"final");function hb(){this._final!==Qo&&Qo.call(this)}s(hb,"prefinish");st.prototype._final=Qo;st.prototype._transform=function(t,e,i){throw new ub("_transform()")};st.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),r.ended||o===n.length||n.length<n.highWaterMark?i():this[fn]=i})};st.prototype._read=function(){if(this[fn]){let t=this[fn];this[fn]=null,t()}}});var is=T((P_,ff)=>{"use strict";var{ObjectSetPrototypeOf:cf}=B();ff.exports=Pi;var ts=es();cf(Pi.prototype,ts.prototype);cf(Pi,ts);function Pi(t){if(!(this instanceof Pi))return new Pi(t);ts.call(this,t)}s(Pi,"PassThrough");Pi.prototype._transform=function(t,e,i){i(null,t)}});var gr=T((L_,yf)=>{var un=bt(),{ArrayIsArray:pb,Promise:yb,SymbolAsyncIterator:mb,SymbolDispose:bb}=B(),br=nt(),{once:gb}=ee(),wb=Mt(),uf=He(),{aggregateTwoErrors:Sb,codes:{ERR_INVALID_ARG_TYPE:us,ERR_INVALID_RETURN_VALUE:ns,ERR_MISSING_ARGS:_b,ERR_STREAM_DESTROYED:Eb,ERR_STREAM_PREMATURE_CLOSE:xb},AbortError:kb}=re(),{validateFunction:Ib,validateAbortSignal:Fb}=_i(),{isIterable:jt,isReadable:rs,isReadableNodeStream:mr,isNodeStream:df,isTransformStream:Ri,isWebStream:vb,isReadableStream:os,isReadableFinished:Ab}=$e(),Tb=globalThis.AbortController||gi().AbortController,ss,as,ls;function hf(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=br(t,{readable:e,writable:i},o=>{n=!o});return{destroy:o=>{n||(n=!0,wb.destroyer(t,o||new Eb("pipe")))},cleanup:r}}s(hf,"destroyer");function Ob(t){return Ib(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Ob,"popCallback");function cs(t){if(jt(t))return t;if(mr(t))return Pb(t);throw new us("val",["Readable","Iterable","AsyncIterable"],t)}s(cs,"makeAsyncIterable");async function*Pb(t){as||(as=sn()),yield*as.prototype[mb].call(t)}s(Pb,"fromReadable");async function yr(t,e,i,{end:n}){let r,o=null,a=s(f=>{if(f&&(r=f),o){let d=o;o=null,d()}},"resume"),l=s(()=>new yb((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");e.on("drain",a);let c=br(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();n&&(e.end(),await l()),i()}catch(f){i(r!==f?Sb(r,f):f)}finally{c(),e.off("drain",a)}}s(yr,"pumpToNode");async function fs(t,e,i,{end:n}){Ri(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(fs,"pumpToWeb");function Rb(...t){return pf(t,gb(Ob(t)))}s(Rb,"pipeline");function pf(t,e,i){if(t.length===1&&pb(t[0])&&(t=t[0]),t.length<2)throw new _b("streams");let n=new Tb,r=n.signal,o=i?.signal,a=[];Fb(o,"options.signal");function l(){w(new kb)}s(l,"abort"),ls=ls||ee().addAbortListener;let c;o&&(c=ls(o,l));let f,d,h=[],b=0;function m(W){w(W,--b===0)}s(m,"finish");function w(W,v){var V;if(W&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=W),!(!f&&!v)){for(;h.length;)h.shift()(f);(V=c)===null||V===void 0||V[bb](),n.abort(),v&&(f||a.forEach(St=>St()),un.nextTick(e,f,d))}}s(w,"finishImpl");let g;for(let W=0;W<t.length;W++){let v=t[W],V=W<t.length-1,St=W>0,ue=V||i?.end!==!1,Yt=W===t.length-1;if(df(v)){let oe=function(Ge){Ge&&Ge.name!=="AbortError"&&Ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Ge)};var O=oe;if(s(oe,"onError"),ue){let{destroy:Ge,cleanup:Rr}=hf(v,V,St);h.push(Ge),rs(v)&&Yt&&a.push(Rr)}v.on("error",oe),rs(v)&&Yt&&a.push(()=>{v.removeListener("error",oe)})}if(W===0)if(typeof v=="function"){if(g=v({signal:r}),!jt(g))throw new ns("Iterable, AsyncIterable or Stream","source",g)}else jt(v)||mr(v)||Ri(v)?g=v:g=uf.from(v);else if(typeof v=="function"){if(Ri(g)){var F;g=cs((F=g)===null||F===void 0?void 0:F.readable)}else g=cs(g);if(g=v(g,{signal:r}),V){if(!jt(g,!0))throw new ns("AsyncIterable",`transform[${W-1}]`,g)}else{var S;ss||(ss=is());let oe=new ss({objectMode:!0}),Ge=(S=g)===null||S===void 0?void 0:S.then;if(typeof Ge=="function")b++,Ge.call(g,ut=>{d=ut,ut!=null&&oe.write(ut),ue&&oe.end(),un.nextTick(m)},ut=>{oe.destroy(ut),un.nextTick(m,ut)});else if(jt(g,!0))b++,yr(g,oe,m,{end:ue});else if(os(g)||Ri(g)){let ut=g.readable||g;b++,yr(ut,oe,m,{end:ue})}else throw new ns("AsyncIterable or Promise","destination",g);g=oe;let{destroy:Rr,cleanup:Mu}=hf(g,!1,!0);h.push(Rr),Yt&&a.push(Mu)}}else if(df(v)){if(mr(g)){b+=2;let oe=Lb(g,v,m,{end:ue});rs(v)&&Yt&&a.push(oe)}else if(Ri(g)||os(g)){let oe=g.readable||g;b++,yr(oe,v,m,{end:ue})}else if(jt(g))b++,yr(g,v,m,{end:ue});else throw new us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=v}else if(vb(v)){if(mr(g))b++,fs(cs(g),v,m,{end:ue});else if(os(g)||jt(g))b++,fs(g,v,m,{end:ue});else if(Ri(g))b++,fs(g.readable,v,m,{end:ue});else throw new us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=v}else g=uf.from(v)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&un.nextTick(l),g}s(pf,"pipelineImpl");function Lb(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new xb)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var o=a;s(a,"endFn"),Ab(t)?un.nextTick(a):t.once("end",a)}else i();return br(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),br(e,{readable:!1,writable:!0},i)}s(Lb,"pipe");yf.exports={pipelineImpl:pf,pipeline:Rb}});var hs=T((C_,_f)=>{"use strict";var{pipeline:Nb}=gr(),wr=He(),{destroyer:Cb}=Mt(),{isNodeStream:Sr,isReadable:mf,isWritable:bf,isWebStream:ds,isTransformStream:$t,isWritableStream:gf,isReadableStream:wf}=$e(),{AbortError:Db,codes:{ERR_INVALID_ARG_VALUE:Sf,ERR_MISSING_ARGS:Bb}}=re(),Mb=nt();_f.exports=s(function(...e){if(e.length===0)throw new Bb("streams");if(e.length===1)return wr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=wr.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=wr.from(e[m])}for(let m=0;m<e.length;++m)if(!(!Sr(e[m])&&!ds(e[m]))){if(m<e.length-1&&!(mf(e[m])||wf(e[m])||$t(e[m])))throw new Sf(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(bf(e[m])||gf(e[m])||$t(e[m])))throw new Sf(`streams[${m}]`,i[m],"must be writable")}let n,r,o,a,l;function c(m){let w=a;a=null,w?w(m):m?l.destroy(m):!b&&!h&&l.destroy()}s(c,"onfinished");let f=e[0],d=Nb(e,c),h=!!(bf(f)||gf(f)||$t(f)),b=!!(mf(d)||wf(d)||$t(d));if(l=new wr({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Sr(f))l._write=function(w,g,F){f.write(w,g)?F():n=F},l._final=function(w){f.end(),r=w},f.on("drain",function(){if(n){let w=n;n=null,w()}});else if(ds(f)){let g=($t(f)?f.writable:f).getWriter();l._write=async function(F,S,O){try{await g.ready,g.write(F).catch(()=>{}),O()}catch(W){O(W)}},l._final=async function(F){try{await g.ready,g.close().catch(()=>{}),r=F}catch(S){F(S)}}}let m=$t(d)?d.readable:d;Mb(m,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Sr(d))d.on("readable",function(){if(o){let m=o;o=null,m()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=d.read();if(m===null){o=l._read;return}if(!l.push(m))return}};else if(ds(d)){let w=($t(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:g,done:F}=await w.read();if(!l.push(g))return;if(F){l.push(null);return}}catch{return}}}}return l._destroy=function(m,w){!m&&a!==null&&(m=new Db),o=null,n=null,r=null,a===null?w(m):(a=w,Sr(d)&&Cb(d,m))},l},"compose")});var Pf=T((B_,ys)=>{"use strict";var Wb=globalThis.AbortController||gi().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Ub,ERR_INVALID_ARG_TYPE:dn,ERR_MISSING_ARGS:qb,ERR_OUT_OF_RANGE:jb},AbortError:Ke}=re(),{validateAbortSignal:Vt,validateInteger:Ef,validateObject:zt}=_i(),$b=B().Symbol("kWeak"),Vb=B().Symbol("kResistStopPropagation"),{finished:zb}=nt(),Hb=hs(),{addAbortSignalNoValidate:Kb}=tn(),{isWritable:Gb,isNodeStream:Yb}=$e(),{deprecate:Xb}=ee(),{ArrayPrototypePush:Jb,Boolean:Qb,MathFloor:xf,Number:Zb,NumberIsNaN:eg,Promise:kf,PromiseReject:If,PromiseResolve:tg,PromisePrototypeThen:Ff,Symbol:Af}=B(),Er=Af("kEmpty"),vf=Af("kEof");function ig(t,e){if(e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),Yb(t)&&!Gb(t))throw new Ub("stream",t,"must be writable");let i=Hb(this,t);return e!=null&&e.signal&&Kb(e.signal,i),i}s(ig,"compose");function xr(t,e){if(typeof t!="function")throw new dn("fn",["Function","AsyncFunction"],t);e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=xf(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=xf(e.highWaterMark)),Ef(i,"options.concurrency",1),Ef(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=ee().AbortSignalAny([e?.signal].filter(Qb)),a=this,l=[],c={signal:o},f,d,h=!1,b=0;function m(){h=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&l.length<n&&(d(),d=null)}s(g,"maybeResume");async function F(){try{for await(let S of a){if(h)return;if(o.aborted)throw new Ke;try{if(S=t(S,c),S===Er)continue;S=tg(S)}catch(O){S=If(O)}b+=1,Ff(S,w,m),l.push(S),f&&(f(),f=null),!h&&(l.length>=n||b>=i)&&await new kf(O=>{d=O})}l.push(vf)}catch(S){let O=If(S);Ff(O,w,m),l.push(O)}finally{h=!0,f&&(f(),f=null)}}s(F,"pump"),F();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===vf)return;if(o.aborted)throw new Ke;S!==Er&&(yield S),l.shift(),g()}await new kf(S=>{f=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(xr,"map");function ng(t=void 0){return t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ke({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(ng,"asIndexedPairs");async function Tf(t,e=void 0){for await(let i of ps.call(this,t,e))return!0;return!1}s(Tf,"some");async function rg(t,e=void 0){if(typeof t!="function")throw new dn("fn",["Function","AsyncFunction"],t);return!await Tf.call(this,async(...i)=>!await t(...i),e)}s(rg,"every");async function og(t,e){for await(let i of ps.call(this,t,e))return i}s(og,"find");async function sg(t,e){if(typeof t!="function")throw new dn("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),Er}s(i,"forEachFn");for await(let n of xr.call(this,i,e));}s(sg,"forEach");function ps(t,e){if(typeof t!="function")throw new dn("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:Er}return s(i,"filterFn"),xr.call(this,i,e)}s(ps,"filter");var _r=class extends qb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(_r,"ReduceAwareErrMissingArgs");async function ag(t,e,i){var n;if(typeof t!="function")throw new dn("reducer",["Function","AsyncFunction"],t);i!=null&&zt(i,"options"),i?.signal!=null&&Vt(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new Ke(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await zb(this.destroy(f)),f}let o=new Wb,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[$b]:this,[Vb]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let l=!1;try{for await(let f of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Ke;r?e=await t(e,f,{signal:a}):(e=f,r=!0)}if(!l&&!r)throw new _r}finally{o.abort()}return e}s(ag,"reduce");async function lg(t){t!=null&&zt(t,"options"),t?.signal!=null&&Vt(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Ke(void 0,{cause:t.signal.reason});Jb(e,n)}return e}s(lg,"toArray");function cg(t,e){let i=xr.call(this,t,e);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(cg,"flatMap");function Of(t){if(t=Zb(t),eg(t))return 0;if(t<0)throw new jb("number",">= 0",t);return t}s(Of,"toIntegerOrInfinity");function fg(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=Of(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ke;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ke;t--<=0&&(yield o)}},"drop").call(this)}s(fg,"drop");function ug(t,e=void 0){return e!=null&&zt(e,"options"),e?.signal!=null&&Vt(e.signal,"options.signal"),t=Of(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ke;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ke;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(ug,"take");ys.exports.streamReturningOperators={asIndexedPairs:Xb(ng,"readable.asIndexedPairs will be removed in a future version."),drop:fg,filter:ps,flatMap:cg,map:xr,take:ug,compose:ig};ys.exports.promiseReturningOperators={every:rg,forEach:sg,reduce:ag,toArray:lg,some:Tf,find:og}});var ms=T((W_,Rf)=>{"use strict";var{ArrayPrototypePop:dg,Promise:hg}=B(),{isIterable:pg,isNodeStream:yg,isWebStream:mg}=$e(),{pipelineImpl:bg}=gr(),{finished:gg}=nt();bs();function wg(...t){return new hg((e,i)=>{let n,r,o=t[t.length-1];if(o&&typeof o=="object"&&!yg(o)&&!pg(o)&&!mg(o)){let a=dg(t);n=a.signal,r=a.end}bg(t,(a,l)=>{a?i(a):e(l)},{signal:n,end:r})})}s(wg,"pipeline");Rf.exports={finished:gg,pipeline:wg}});var bs=T((q_,qf)=>{var{Buffer:Sg}=ke(),{ObjectDefineProperty:at,ObjectKeys:Cf,ReflectApply:Df}=B(),{promisify:{custom:Bf}}=ee(),{streamReturningOperators:Lf,promiseReturningOperators:Nf}=Pf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Mf}}=re(),_g=hs(),{setDefaultHighWaterMark:Eg,getDefaultHighWaterMark:xg}=nn(),{pipeline:Wf}=gr(),{destroyer:kg}=Mt(),Uf=nt(),gs=ms(),hn=$e(),N=qf.exports=tr().Stream;N.isDestroyed=hn.isDestroyed;N.isDisturbed=hn.isDisturbed;N.isErrored=hn.isErrored;N.isReadable=hn.isReadable;N.isWritable=hn.isWritable;N.Readable=sn();for(let t of Cf(Lf)){let i=function(...n){if(new.target)throw Mf();return N.Readable.from(Df(e,this,n))};Fg=i,s(i,"fn");let e=Lf[t];at(i,"name",{__proto__:null,value:e.name}),at(i,"length",{__proto__:null,value:e.length}),at(N.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fg;for(let t of Cf(Nf)){let i=function(...r){if(new.target)throw Mf();return Df(e,this,r)};Fg=i,s(i,"fn");let e=Nf[t];at(i,"name",{__proto__:null,value:e.name}),at(i,"length",{__proto__:null,value:e.length}),at(N.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fg;N.Writable=pr();N.Duplex=He();N.Transform=es();N.PassThrough=is();N.pipeline=Wf;var{addAbortSignal:Ig}=tn();N.addAbortSignal=Ig;N.finished=Uf;N.destroy=kg;N.compose=_g;N.setDefaultHighWaterMark=Eg;N.getDefaultHighWaterMark=xg;at(N,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return gs}});at(Wf,Bf,{__proto__:null,enumerable:!0,get(){return gs.pipeline}});at(Uf,Bf,{__proto__:null,enumerable:!0,get(){return gs.finished}});N.Stream=N;N._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");N._uint8ArrayToBuffer=s(function(e){return Sg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var jf=T(($_,$)=>{"use strict";var K=bs(),vg=ms(),Ag=K.Readable.destroy;$.exports=K.Readable;$.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer;$.exports._isUint8Array=K._isUint8Array;$.exports.isDisturbed=K.isDisturbed;$.exports.isErrored=K.isErrored;$.exports.isReadable=K.isReadable;$.exports.Readable=K.Readable;$.exports.Writable=K.Writable;$.exports.Duplex=K.Duplex;$.exports.Transform=K.Transform;$.exports.PassThrough=K.PassThrough;$.exports.addAbortSignal=K.addAbortSignal;$.exports.finished=K.finished;$.exports.destroy=K.destroy;$.exports.destroy=Ag;$.exports.pipeline=K.pipeline;$.exports.compose=K.compose;Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return vg}});$.exports.Stream=K.Stream;$.exports.default=$.exports});var Lg={};wn(Lg,{ActionType:()=>xn,ApiError:()=>u,Async:()=>Wr,AsyncIndexFS:()=>Tn,AsyncStoreFS:()=>vn,BigIntStats:()=>Y,BigIntStatsFs:()=>_n,Dir:()=>et,Dirent:()=>Ze,ErrorCode:()=>z,File:()=>Wi,FileIndex:()=>Tt,FileSystem:()=>ne,FileType:()=>q,InMemory:()=>Vi,InMemoryStore:()=>$i,IndexDirInode:()=>Xe,IndexFS:()=>ri,IndexFileInode:()=>zi,IndexInode:()=>ni,Inode:()=>de,LockedFS:()=>si,Mutex:()=>oi,NoSyncFile:()=>vt,Overlay:()=>_d,OverlayFS:()=>ai,PreloadFile:()=>ie,ReadStream:()=>lt,Readonly:()=>Ur,SimpleSyncTransaction:()=>ti,Stats:()=>U,StatsCommon:()=>Qt,StatsFs:()=>Zt,Sync:()=>Mr,SyncIndexFS:()=>An,SyncStoreFS:()=>ii,UnlockedOverlayFS:()=>Hi,WriteStream:()=>ct,_toUnixTimestamp:()=>Sd,access:()=>xu,accessSync:()=>va,appendFile:()=>Zf,appendFileSync:()=>pa,checkOptions:()=>On,chmod:()=>gu,chmodSync:()=>ka,chown:()=>mu,chownSync:()=>Ea,close:()=>tu,closeSync:()=>Qe,configure:()=>Pg,constants:()=>Ft,copyFile:()=>Pu,copyFileSync:()=>so,cp:()=>Cu,cpSync:()=>ao,createBackend:()=>Ed,createReadStream:()=>vu,createWriteStream:()=>Au,decode:()=>In,decodeDirListing:()=>ji,default:()=>Rg,encode:()=>Be,encodeDirListing:()=>ce,errorMessages:()=>Nr,exists:()=>zf,existsSync:()=>pi,fchmod:()=>lu,fchmodSync:()=>Mn,fchown:()=>au,fchownSync:()=>Bn,fdatasync:()=>ru,fdatasyncSync:()=>ba,flagToMode:()=>dt,flagToNumber:()=>gd,flagToString:()=>Ws,fs:()=>gn,fstat:()=>eu,fstatSync:()=>ya,fsync:()=>nu,fsyncSync:()=>ma,ftruncate:()=>iu,ftruncateSync:()=>to,futimes:()=>cu,futimesSync:()=>Wn,isAppendable:()=>ht,isBackend:()=>Ki,isBackendConfig:()=>$r,isExclusive:()=>qs,isReadable:()=>Ye,isSynchronous:()=>Mi,isTruncating:()=>Us,isWriteable:()=>pe,lchmod:()=>wu,lchmodSync:()=>Ia,lchown:()=>bu,lchownSync:()=>xa,levenshtein:()=>qr,link:()=>hu,linkSync:()=>Sa,lopenSync:()=>Qi,lstat:()=>Kf,lstatSync:()=>eo,lutimes:()=>_u,lutimesSync:()=>Fa,mkdir:()=>uu,mkdirSync:()=>Un,mkdirpSync:()=>js,mkdtemp:()=>Ou,mkdtempSync:()=>Aa,mount:()=>Yi,mountMapping:()=>Xi,mounts:()=>ge,nop:()=>_,normalizeMode:()=>ye,normalizeOptions:()=>me,normalizePath:()=>A,normalizeTime:()=>At,open:()=>Xf,openAsBlob:()=>Bu,openSync:()=>mi,opendir:()=>Nu,opendirSync:()=>Pa,parseFlag:()=>L,pathExistsAction:()=>Ui,pathNotExistsAction:()=>qi,promises:()=>bn,randomIno:()=>ei,read:()=>su,readFile:()=>Jf,readFileSync:()=>Dn,readSync:()=>wa,readdir:()=>du,readdirSync:()=>bi,readlink:()=>yu,readlinkSync:()=>no,readv:()=>Ru,readvSync:()=>Ta,realpath:()=>Eu,realpathSync:()=>hi,rename:()=>Vf,renameSync:()=>ua,resolveMountConfig:()=>Ns,rm:()=>Tu,rmSync:()=>oo,rmdir:()=>fu,rmdirSync:()=>io,rootCred:()=>De,rootIno:()=>he,setImmediate:()=>wd,size_max:()=>En,stat:()=>Hf,statSync:()=>Ji,statfs:()=>Du,statfsSync:()=>Ra,symlink:()=>pu,symlinkSync:()=>_a,truncate:()=>Gf,truncateSync:()=>da,umount:()=>Nn,unlink:()=>Yf,unlinkSync:()=>Cn,unwatchFile:()=>Iu,utimes:()=>Su,utimesSync:()=>ro,watch:()=>Fu,watchFile:()=>ku,write:()=>ou,writeFile:()=>Qf,writeFileSync:()=>Zi,writeSync:()=>ga,writev:()=>Lu,writevSync:()=>Oa});var z=(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))(z||{}),Nr={[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 extends Error{constructor(i,n=Nr[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=z[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new u(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new u(z[i],Nr[z[i]],n,r)}code;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(u,"ApiError");var zu="/";var Ds="/";function _t(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(_t,"validateString");function Bs(t,e){let i="",n=0,r=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===l-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=l,o=0;continue}else if(i.length!==0){i="",n=0,r=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,l):i=t.slice(r+1,l),n=l-r-1;r=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Bs,"normalizeString");function Ee(...t){let e="",i=!1;for(let n=t.length-1;n>=-1&&!i;n--){let r=n>=0?t[n]:zu;_t(r,`paths[${n}]`),r.length&&(e=`${r}/${e}`,i=r[0]=="/")}return e=Bs(e,!i),i?`/${e}`:e.length>0?e:"/"}s(Ee,"resolve");function Hu(t){if(_t(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=Bs(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s(Hu,"normalize");function C(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let n=t[i];_t(n,"path"),n.length>0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Hu(e)}s(C,"join");function x(t){if(_t(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function R(t,e){e!==void 0&&_t(e,"ext"),_t(t,"path");let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!r){i=l+1;break}}else a===-1&&(r=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(n=l):(o=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":t.slice(i,n)}s(R,"basename");function Sn(t){_t(t,"path");let e=t[0]==="/",i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,o=0,a=-1,l=!0,c=t.length-1,f=0;for(;c>=n;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?r===-1?r=c:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=o===0&&e?1:o;r===-1||f===0||f===1&&r===a-1&&r===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,r),i.base=t.slice(d,a),i.ext=t.slice(r,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(Sn,"parse");var Ft={};wn(Ft,{COPYFILE_EXCL:()=>Bi,COPYFILE_FICLONE:()=>Gu,COPYFILE_FICLONE_FORCE:()=>Yu,F_OK:()=>Di,O_APPEND:()=>Re,O_CREAT:()=>G,O_DIRECT:()=>id,O_DIRECTORY:()=>Ju,O_DSYNC:()=>ed,O_EXCL:()=>Oe,O_NOATIME:()=>Qu,O_NOCTTY:()=>Xu,O_NOFOLLOW:()=>Zu,O_NONBLOCK:()=>nd,O_RDONLY:()=>Xt,O_RDWR:()=>se,O_SYMLINK:()=>td,O_SYNC:()=>Jt,O_TRUNC:()=>Pe,O_WRONLY:()=>Te,R_OK:()=>xe,S_IFBLK:()=>xt,S_IFCHR:()=>kt,S_IFDIR:()=>Ce,S_IFIFO:()=>It,S_IFLNK:()=>Le,S_IFMT:()=>Q,S_IFREG:()=>Ne,S_IFSOCK:()=>Et,S_IRGRP:()=>fd,S_IROTH:()=>hd,S_IRUSR:()=>ad,S_IRWXG:()=>Dr,S_IRWXO:()=>Br,S_IRWXU:()=>Cr,S_ISGID:()=>od,S_ISUID:()=>rd,S_ISVTX:()=>sd,S_IWGRP:()=>ud,S_IWOTH:()=>pd,S_IWUSR:()=>ld,S_IXGRP:()=>dd,S_IXOTH:()=>yd,S_IXUSR:()=>cd,UV_FS_O_FILEMAP:()=>md,W_OK:()=>le,X_OK:()=>Ku});var Di=0,xe=4,le=2,Ku=1,Bi=1,Gu=2,Yu=4,Xt=0,Te=1,se=2,G=64,Oe=128,Xu=256,Pe=512,Re=1024,Ju=65536,Qu=262144,Zu=131072,Jt=1052672,ed=4096,td=32768,id=16384,nd=2048,Q=61440,Et=49152,Le=40960,Ne=32768,xt=24576,Ce=16384,kt=8192,It=4096,rd=2048,od=1024,sd=512,Cr=448,ad=256,ld=128,cd=64,Dr=56,fd=32,ud=16,dd=8,Br=7,hd=4,pd=2,yd=1,md=0;var q=(n=>(n[n.FILE=32768]="FILE",n[n.DIRECTORY=16384]="DIRECTORY",n[n.SYMLINK=40960]="SYMLINK",n))(q||{}),Qt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:l,mode:c,ino:f}={}){let d=Date.now(),h=s((m,w)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:w),"resolveT");this.atimeMs=h(e,d),this.mtimeMs=h(i,d),this.ctimeMs=h(n,d),this.birthtimeMs=h(r,d),this.uid=h(o,0),this.gid=h(a,0),this.size=h(l,0),this.ino=h(f,0);let b=Number(c)&61440||q.FILE;if(c)this.mode=this._convert(c);else switch(b){case q.FILE:this.mode=this._convert(420);break;case q.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(b))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let n=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&n)==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)}get mtimeNs(){return BigInt(this.mtimeMs)}get ctimeNs(){return BigInt(this.ctimeMs)}get birthtimeNs(){return BigInt(this.birthtimeMs)}};s(Qt,"StatsCommon");var U=class extends Qt{_isBigint=!1;static clone(e){return new U(e)}};s(U,"Stats");var Y=class extends Qt{_isBigint=!0;static clone(e){return new Y(e)}};s(Y,"BigIntStats");var Zt=class{type=0;bsize=0;blocks=0;bfree=0;bavail=0;files=0;ffree=0};s(Zt,"StatsFs");var _n=class{type=0n;bsize=0n;blocks=0n;bfree=0n;bavail=0n;files=0n;ffree=0n};s(_n,"BigIntStatsFs");var En=2**32-1,he=0n;function Ms(){return Math.round(Math.random()*2**32).toString(16)}s(Ms,"_random");function ei(){return BigInt("0x"+Ms()+Ms())}s(ei,"randomIno");var de=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=ei(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new U(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(de,"Inode");var xn=(r=>(r[r.NOP=0]="NOP",r[r.THROW=1]="THROW",r[r.TRUNCATE=2]="TRUNCATE",r[r.CREATE=3]="CREATE",r))(xn||{}),bd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return Ws(t);if(!bd.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function Ws(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(Ws,"flagToString");function gd(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(gd,"flagToNumber");function dt(t){let e=0;return e<<=1,e+=+Ye(t),e<<=1,e+=+pe(t),e<<=1,e}s(dt,"flagToMode");function Ye(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(Ye,"isReadable");function pe(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(pe,"isWriteable");function Us(t){return t.indexOf("w")!==-1}s(Us,"isTruncating");function ht(t){return t.indexOf("a")!==-1}s(ht,"isAppendable");function Mi(t){return t.indexOf("s")!==-1}s(Mi,"isSynchronous");function qs(t){return t.indexOf("x")!==-1}s(qs,"isExclusive");function Ui(t){return qs(t)?1:Us(t)?2:0}s(Ui,"pathExistsAction");function qi(t){return(pe(t)||ht(t))&&t!=="r+"?3:1}s(qi,"pathNotExistsAction");var Wi=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Wi,"File");var ie=class extends Wi{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:En}))){super();this.fs=i;this.path=n;this.flag=r;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(Ye(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return ht(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new U(this.stats)}statSync(){return new U(this.stats)}async truncate(i){if(this.truncateSync(i),Mi(this.flag))return this.sync()}truncateSync(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 n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length),Mi(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),Mi(this.flag)&&this.syncSync()}async write(i,n=0,r=this.stats.size,o=0){let a=this.writeSync(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!pe(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let f=new Uint8Array(new ArrayBuffer(a,{maxByteLength:En}));f.set(this._buffer),this._buffer=f}let l=i.slice(n,n+r);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),Mi(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,n=0,r=this.stats.size,o=0){return{bytesRead:this.readSync(i,n,r,o),buffer:i}}readSync(i,n=0,r=this.stats.size,o){if(!Ye(this.flag))throw new u(1,"File not opened with a readable mode.");o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||new Uint8Array(i.buffer,0,r).set(this._buffer.slice(o,a),n),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){this.chownSync(i,n)}chownSync(i,n){this._dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){this.utimesSync(i,n)}utimesSync(i,n){this._dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(ie,"PreloadFile");var vt=class extends ie{constructor(e,i,n,r,o){super(e,i,n,r,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(vt,"NoSyncFile");var De={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var ne=class{metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0}}constructor(e){}async ready(){return this}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(ne,"FileSystem");function Mr(t){class e extends t{async exists(n,r){return this.existsSync(n,r)}async rename(n,r,o){return this.renameSync(n,r,o)}async stat(n,r){return this.statSync(n,r)}async createFile(n,r,o,a){return this.createFileSync(n,r,o,a)}async openFile(n,r,o){return this.openFileSync(n,r,o)}async unlink(n,r){return this.unlinkSync(n,r)}async rmdir(n,r){return this.rmdirSync(n,r)}async mkdir(n,r,o){return this.mkdirSync(n,r,o)}async readdir(n,r){return this.readdirSync(n,r)}async link(n,r,o){return this.linkSync(n,r,o)}async sync(n,r,o){return this.syncSync(n,r,o)}}return s(e,"_SyncFileSystem"),e}s(Mr,"Sync");function Wr(t){class e extends t{_queue=[];get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let r=s(()=>this._queueRunning?setTimeout(r):n(),"check");r()})}_isInitialized=!1;async ready(){if(await this._sync.ready(),await super.ready(),this._isInitialized)return this;try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}return this}renameSync(n,r,o){this._sync.renameSync(n,r,o),this.queue("rename",n,r,o)}statSync(n,r){return this._sync.statSync(n,r)}createFileSync(n,r,o,a){let l=this._sync.createFileSync(n,r,o,a);this.queue("createFile",n,r,o,a);let c=l.statSync(),f=new Uint8Array(c.size);return l.readSync(f),new ie(this,n,r,c,f)}openFileSync(n,r,o){return this._sync.openFileSync(n,r,o)}unlinkSync(n,r){this._sync.unlinkSync(n,r),this.queue("unlink",n,r)}rmdirSync(n,r){this._sync.rmdirSync(n,r),this.queue("rmdir",n,r)}mkdirSync(n,r,o){this._sync.mkdirSync(n,r,o),this.queue("mkdir",n,r,o)}readdirSync(n,r){return this._sync.readdirSync(n,r)}linkSync(n,r,o){this._sync.linkSync(n,r,o),this.queue("link",n,r,o)}syncSync(n,r,o){this._sync.syncSync(n,r,o),this.queue("sync",n,r,o)}existsSync(n,r){return this._sync.existsSync(n,r)}async crossCopy(n){let r=await this.stat(n,De);if(r.isDirectory()){if(n!=="/"){let a=await this.stat(n,De);this._sync.mkdirSync(n,a.mode,a.cred())}let o=await this.readdir(n,De);for(let a of o)await this.crossCopy(C(n,a))}else{let o=await this.openFile(n,L("r"),De),a=this._sync.createFileSync(n,L("w"),r.mode,r.cred());try{let l=new Uint8Array(r.size);await o.read(l),a.writeSync(l,0,r.size)}finally{await o.close(),a.closeSync()}}}async _next(){if(!this._queueRunning)return;let[n,...r]=this._queue.shift();await this[n](...r),await this._next()}queue(...n){this._queue.push(n),this._next()}}return s(e,"_AsyncFileSystem"),e}s(Wr,"Async");function Ur(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r,o){throw new u(30)}renameSync(n,r,o){throw new u(30)}async createFile(n,r,o,a){throw new u(30)}createFileSync(n,r,o,a){throw new u(30)}async unlink(n,r){throw new u(30)}unlinkSync(n,r){throw new u(30)}async rmdir(n,r){throw new u(30)}rmdirSync(n,r){throw new u(30)}async mkdir(n,r,o){throw new u(30)}mkdirSync(n,r,o){throw new u(30)}async link(n,r,o){throw new u(30)}linkSync(n,r,o){throw new u(30)}async sync(n,r,o){throw new u(30)}syncSync(n,r,o){throw new u(30)}}return s(e,"_ReadonlyFileSystem"),e}s(Ur,"Readonly");function js(t,e,i,n){n.existsSync(t,i)||(js(x(t),e,i,n),n.mkdirSync(t,e,i))}s(js,"mkdirpSync");function kn(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}s(kn,"_min");function qr(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=t.charCodeAt(r+b),o[b]=++b;let a,l,c,f,d;for(a=0;a+3<n;){let b=e.charCodeAt(r+(l=a)),m=e.charCodeAt(r+(c=a+1)),w=e.charCodeAt(r+(f=a+2)),g=e.charCodeAt(r+(d=a+3)),F=a+=4;for(let S=0;S<i;){let O=o[i+S],W=o[S];l=kn(W,l,c,b,O),c=kn(l,c,f,m,O),f=kn(c,f,d,w,O),F=kn(f,d,F,g,O),o[S++]=F,d=f,f=c,c=l,l=W}}let h=0;for(;a<n;){let b=e.charCodeAt(r+(l=a));h=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=h=w<l||h<l?w>h?h+1:w+1:b===o[i+m]?l:l+1,l=w}}return h}s(qr,"levenshtein");var wd=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Be(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(Be,"encode");function In(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(In,"decode");function ji(t){return JSON.parse(In(t),(e,i)=>e==""?i:BigInt(i))}s(ji,"decodeDirListing");function ce(t){return Be(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ce,"encodeDirListing");function Sd(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Sd,"_toUnixTimestamp");function ye(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(ye,"normalizeMode");function At(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(At,"normalizeTime");function A(t){if(t=t.toString(),t.includes("\0"))throw new u(22,"Path must be a string without null bytes.");if(t.length==0)throw new u(22,"Path must not be empty.");return Ee(t.replaceAll(/[/\\]+/g,"/"))}s(A,"normalizePath");function me(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:ye("mode"in t?t?.mode:null,n)}}s(me,"normalizeOptions");function _(){}s(_,"nop");var ti=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,n){return this.markModified(e),this.store.put(e,i,n)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(ti,"SimpleSyncTransaction");var ii=class extends Mr(ne){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=R(e),l=x(i),c=R(i),f=this.findINode(r,o),d=this.getDirListing(r,f,o);if(!f.toStats().hasAccess(2,n))throw u.With("EACCES",e,"rename");if(!d[a])throw u.With("ENOENT",e,"rename");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new u(16,o);let b,m;if(l===o?(b=f,m=d):(b=this.findINode(r,l),m=this.getDirListing(r,b,l)),m[c]){let w=this.getINode(r,m[c],i);if(w.toStats().isFile())try{r.remove(w.ino),r.remove(m[c])}catch(g){throw r.abort(),g}else throw u.With("EPERM",i,"rename")}m[c]=h;try{r.put(f.ino,ce(d),!0),r.put(b.ino,ce(m),!0)}catch(w){throw r.abort(),w}r.commit()}statSync(e,i){let n=this.findINode(this.store.beginTransaction(),e).toStats();if(!n.hasAccess(4,i))throw u.With("EACCES",e,"stat");return n}createFileSync(e,i,n,r){return this.commitNewFile(e,q.FILE,n,r),this.openFileSync(e,i,r)}openFileSync(e,i,n){let r=this.store.beginTransaction(),o=this.findINode(r,e),a=r.get(o.ino);if(!o.toStats().hasAccess(dt(i),n))throw u.With("EACCES",e,"openFile");if(!a)throw u.With("ENOENT",e,"openFile");return new ie(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw u.With("ENOTEMPTY",e,"rmdir");this.removeEntry(e,!0,i)}mkdirSync(e,i,n){this.commitNewFile(e,q.DIRECTORY,i,n,Be("{}"))}readdirSync(e,i){let n=this.store.beginTransaction(),r=this.findINode(n,e);if(!r.toStats().hasAccess(4,i))throw u.With("EACCES",e,"readdir");return Object.keys(this.getDirListing(n,r,e))}syncSync(e,i,n){let r=this.store.beginTransaction(),o=this._findINode(r,x(e),R(e)),a=this.getINode(r,o,e),l=a.update(n);try{r.put(a.ino,i,!0),l&&r.put(o,a.data,!0)}catch(c){throw r.abort(),c}r.commit()}linkSync(e,i,n){let r=this.store.beginTransaction(),o=x(e);if(!this.findINode(r,o).toStats().hasAccess(4,n))throw u.With("EACCES",o,"link");let l=x(i),c=this.findINode(r,l),f=this.getDirListing(r,c,l);if(!c.toStats().hasAccess(2,n))throw u.With("EACCES",l,"link");let d=this._findINode(r,o,R(e)),h=this.getINode(r,d,e);if(!h.toStats().hasAccess(2,n))throw u.With("EACCES",i,"link");h.nlink++,f[R(i)]=d;try{r.put(d,h.data,!0),r.put(c.ino,ce(f),!0)}catch(b){throw r.abort(),b}r.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(he))return;let i=new de;i.mode=511|q.DIRECTORY,e.put(i.ino,Be("{}"),!1),e.put(he,i.data,!1),e.commit()}_findINode(e,i,n,r=new Set){let o=C(i,n);if(r.has(o))throw new u(5,"Infinite loop detected while finding inode",o);if(r.add(o),i!="/"){let a=this._findINode(e,x(i),R(i),r),l=this.getDirListing(e,this.getINode(e,a,i+Ds+n),i);if(!(n in l))throw u.With("ENOENT",Ee(i,n),"_findINode");return l[n]}if(n!=""){let a=this.getDirListing(e,this.getINode(e,he,i),i);if(!(n in a))throw u.With("ENOENT",Ee(i,n),"_findINode");return a[n]}return he}findINode(e,i){let n=this._findINode(e,x(i),R(i));return this.getINode(e,n,i)}getINode(e,i,n){let r=e.get(i);if(!r)throw u.With("ENOENT",n,"getINode");return new de(r.buffer)}getDirListing(e,i,n){if(!i.toStats().isDirectory())throw u.With("ENOTDIR",n,"getDirListing");let r=e.get(i.ino);if(!r)throw u.With("ENOENT",n,"getDirListing");return ji(r)}addNewNode(e,i,n=5){for(let r=0;r<n;r++){let o=ei();if(e.put(o,i,!1))return o}throw new u(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,n,r,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),c=R(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,r))throw u.With("EACCES",e,"commitNewFile");if(e==="/")throw u.With("EEXIST",e,"commitNewFile");if(d[c])throw u.With("EEXIST",e,"commitNewFile");let h=new de;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=n|i,h.uid=r.uid,h.gid=r.gid,d[c]=this.addNewNode(a,h.data),a.put(f.ino,ce(d),!0)}catch(b){throw a.abort(),b}return a.commit(),h}removeEntry(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=this.findINode(r,o),l=this.getDirListing(r,a,o),c=R(e),f=l[c];if(!f)throw u.With("ENOENT",e,"removeEntry");let d=this.getINode(r,f,e);if(!d.toStats().hasAccess(2,n))throw u.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw u.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw u.With("ENOTDIR",e,"removeEntry");try{r.put(a.ino,ce(l),!0),--d.nlink<1&&(r.remove(d.ino),r.remove(f))}catch(h){throw r.abort(),h}r.commit()}};s(ii,"SyncStoreFS");var $i=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new ti(this)}get(e){return this.store.get(e)}put(e,i,n){return!n&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s($i,"InMemoryStore");var Vi={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new ii({store:new $i(t)})}};var Fn=class{constructor(e){this.limit=e}cache=[];set(e,i){let n=this.cache.findIndex(r=>r.key===e);n!=-1?this.cache.splice(n,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(n=>n.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(n=>n.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(Fn,"LRUCache");var vn=class extends Wr(ne){constructor(i){super();this._options=i}_store;get store(){if(!this._store)throw new ReferenceError("AsyncStoreFS not attached to a store");return this._store}_cache;_initialized=!1;_sync=Vi.create({name:"test"});async ready(){return this._initialized?this:(this._initialized=!0,this._options.lruCacheSize&&(this._cache=new Fn(this._options.lruCacheSize)),this._store=await this._options.store,this._sync=this._options.sync||this._sync,await this.makeRootDirectory(),await super.ready(),this)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(i,n,r){await this.queueDone();let o=this._cache;this._cache&&(delete this._cache,o?.reset());try{let a=this.store.beginTransaction(),l=x(i),c=R(i),f=x(n),d=R(n),h=await this.findINode(a,l),b=await this.getDirListing(a,h,l);if(!h.toStats().hasAccess(2,r))throw u.With("EACCES",i,"rename");if(!b[c])throw u.With("ENOENT",i,"rename");let m=b[c];if(delete b[c],(f+"/").indexOf(i+"/")===0)throw new u(16,l);let w,g;if(f===l?(w=h,g=b):(w=await this.findINode(a,f),g=await this.getDirListing(a,w,f)),g[d]){let F=await this.getINode(a,g[d],n);if(F.toStats().isFile())try{await a.remove(F.ino),await a.remove(g[d])}catch(S){throw await a.abort(),S}else throw u.With("EPERM",n,"rename")}g[d]=m;try{await a.put(h.ino,ce(b),!0),await a.put(w.ino,ce(g),!0)}catch(F){throw await a.abort(),F}await a.commit()}finally{o&&(this._cache=o)}}async stat(i,n){await this.queueDone();let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o)throw u.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,n))throw u.With("EACCES",i,"stat");return a}async createFile(i,n,r,o){await this.queueDone();let a=this.store.beginTransaction(),l=new Uint8Array(0),c=await this.commitNewFile(a,i,q.FILE,r,o,l);return new ie(this,i,n,c.toStats(),l)}async openFile(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=await this.findINode(o,i),l=await o.get(a.ino);if(!a.toStats().hasAccess(dt(n),r))throw u.With("EACCES",i,"openFile");if(!l)throw u.With("ENOENT",i,"openFile");return new ie(this,i,n,a.toStats(),l)}async unlink(i,n){return await this.queueDone(),this.removeEntry(i,!1,n)}async rmdir(i,n){if(await this.queueDone(),(await this.readdir(i,n)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.removeEntry(i,!0,n)}async mkdir(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=Be("{}");await this.commitNewFile(o,i,q.DIRECTORY,n,r,a)}async readdir(i,n){await this.queueDone();let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o.toStats().hasAccess(4,n))throw u.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(r,o,i))}async sync(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=await this._findINode(o,x(i),R(i)),l=await this.getINode(o,a,i),c=l.update(r);try{await o.put(l.ino,n,!0),c&&await o.put(a,l.data,!0)}catch(f){throw await o.abort(),f}await o.commit()}async link(i,n,r){await this.queueDone();let o=this.store.beginTransaction(),a=x(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,r))throw u.With("EACCES",a,"link");let c=x(n),f=await this.findINode(o,c),d=await this.getDirListing(o,f,c);if(!f.toStats().hasAccess(2,r))throw u.With("EACCES",c,"link");let h=await this._findINode(o,a,R(i)),b=await this.getINode(o,h,i);if(!b.toStats().hasAccess(2,r))throw u.With("EACCES",n,"link");b.nlink++,d[R(n)]=h;try{o.put(h,b.data,!0),o.put(f.ino,ce(d),!0)}catch(m){throw o.abort(),m}o.commit()}async makeRootDirectory(){let i=this.store.beginTransaction();if(!await i.get(he)){let n=new de;n.mode=511|q.DIRECTORY,await i.put(n.ino,Be("{}"),!1),await i.put(he,n.data,!1),await i.commit()}}async _findINode(i,n,r,o=new Set){let a=C(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),this._cache){let l=this._cache.get(a);if(l)return l}if(n==="/"){if(r==="")return this._cache&&this._cache.set(a,he),he;{let l=await this.getINode(i,he,n),c=await this.getDirListing(i,l,n);if(c[r]){let f=c[r];return this._cache&&this._cache.set(a,f),f}else throw u.With("ENOENT",Ee(n,r),"_findINode")}}else{let l=await this.findINode(i,n,o),c=await this.getDirListing(i,l,n);if(c[r]){let f=c[r];return this._cache&&this._cache.set(a,f),f}else throw u.With("ENOENT",Ee(n,r),"_findINode")}}async findINode(i,n,r=new Set){let o=await this._findINode(i,x(n),R(n),r);return this.getINode(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw u.With("ENOENT",r,"getINode");return new de(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return ji(o)}async addNewNode(i,n,r=5){if(r<=0)throw new u(5,"Unable to commit data to key-value store.");let o=ei();return await i.put(o,n,!1)?o:await this.addNewNode(i,n,--r)}async commitNewFile(i,n,r,o,a,l){let c=x(n),f=R(n),d=await this.findINode(i,c),h=await this.getDirListing(i,d,c);if(!d.toStats().hasAccess(2,a))throw u.With("EACCES",n,"commitNewFile");if(n==="/")throw u.With("EEXIST",n,"commitNewFile");if(h[f])throw await i.abort(),u.With("EEXIST",n,"commitNewFile");try{let b=new de;return b.ino=await this.addNewNode(i,l),b.mode=o|r,b.uid=a.uid,b.gid=a.gid,b.size=l.length,h[f]=await this.addNewNode(i,b.data),await i.put(d.ino,ce(h),!0),await i.commit(),b}catch(b){throw i.abort(),b}}async removeEntry(i,n,r){this._cache&&this._cache.remove(i);let o=this.store.beginTransaction(),a=x(i),l=await this.findINode(o,a),c=await this.getDirListing(o,l,a),f=R(i);if(!c[f])throw u.With("ENOENT",i,"removeEntry");let d=c[f],h=await this.getINode(o,d,i);if(!h.toStats().hasAccess(2,r))throw u.With("EACCES",i,"removeEntry");if(delete c[f],!n&&h.toStats().isDirectory())throw u.With("EISDIR",i,"removeEntry");if(n&&!h.toStats().isDirectory())throw u.With("ENOTDIR",i,"removeEntry");try{await o.put(l.ino,ce(c),!0),--h.nlink<1&&(await o.remove(h.ino),await o.remove(d))}catch(b){throw await o.abort(),b}await o.commit()}};s(vn,"AsyncStoreFS");var Tt=class{static FromListing(e){let i=new Tt,n=new Xe;i._index.set("/",n);let r=[{pwd:"",tree:e,parent:n}];for(;r.length>0;){let o,{tree:a,pwd:l,parent:c}=r.pop();for(let f in a){if(!Object.hasOwn(a,f))continue;let d=a[f];if(d){let h=l+"/"+f;o=new Xe,i._index.set(h,o),r.push({pwd:h,tree:d,parent:o})}else o=new zi(new U({mode:q.FILE|365}));c&&c._listing.set(f,o)}}return i}_index=new Map;constructor(){this.add("/",new Xe)}files(){let e=[];for(let i of this._index.values())for(let n of i.listing){let r=i.get(n);r&&r.isFile()&&e.push(r)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let n=x(e),r=this._index.has(n),o=r?this._index.get(n):new Xe;return!r&&e!="/"&&!this.add(n,o)||e!="/"&&!o.add(R(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let n=x(e),r=R(e),o=this._index.get(n);return o||(o=new Xe,this.addFast(n,o)),o.add(r,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),n=this._index.get(i);if(!n)return;let r=n.remove(R(e));if(!r)return;if(!r.isDirectory())return r;let o=r.listing;for(let a of o)this.remove(C(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),n=this._index.get(i);return i==e?n:n?.get(R(e))}};s(Tt,"FileIndex");var ni=class{constructor(e){this.data=e}};s(ni,"IndexInode");var zi=class extends ni{isFile(){return!0}isDirectory(){return!1}toStats(){return new U({mode:q.FILE|438,size:4096})}};s(zi,"IndexFileInode");var Xe=class extends ni{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new U({mode:q.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(Xe,"IndexDirInode");var ri=class extends Ur(ne){_index;constructor(e){super(),this._index=Tt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new u(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new u(22,"Invalid inode.")}async openFile(e,i,n){if(pe(i))throw new u(1,e);let r=this._index.get(e);if(!r)throw u.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(dt(i),n))throw u.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new vt(this,e,i,o,o.fileData)}return this.openFileInode(r,e,i)}openFileSync(e,i,n){if(pe(i))throw new u(1,e);let r=this._index.get(e);if(!r)throw u.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(dt(i),n))throw u.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new vt(this,e,i,o,o.fileData)}return this.openFileInodeSync(r,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw u.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw u.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw u.With("ENOTDIR",e,"readdir")}};s(ri,"IndexFS");var An=class extends ri{async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,n){return this.openFileInodeSync(e,i,n)}};s(An,"SyncIndexFS");var Tn=class extends ri{statFileInodeSync(e,i){throw u.With("ENOSYS",i,"AsyncIndexFS.statFileInodeSync")}openFileInodeSync(e,i,n){throw u.With("ENOSYS",i,"AsyncIndexFS.openFileInodeSync")}};s(Tn,"AsyncIndexFS");var oi=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[i])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e)?.shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(oi,"Mutex");var si=class{constructor(e){this.fs=e}_mu=new oi;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,n){await this._mu.lock(e),await this.fs.rename(e,i,n),this._mu.unlock(e)}renameSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,n)}async stat(e,i){await this._mu.lock(e);let n=await this.fs.stat(e,i);return this._mu.unlock(e),n}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,n){await this._mu.lock(e);let r=await this.fs.openFile(e,i,n);return this._mu.unlock(e),r}openFileSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,n)}async createFile(e,i,n,r){await this._mu.lock(e);let o=await this.fs.createFile(e,i,n,r);return this._mu.unlock(e),o}createFileSync(e,i,n,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,n,r)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,n){await this._mu.lock(e),await this.fs.mkdir(e,i,n),this._mu.unlock(e)}mkdirSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,n)}async readdir(e,i){await this._mu.lock(e);let n=await this.fs.readdir(e,i);return this._mu.unlock(e),n}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let n=await this.fs.exists(e,i);return this._mu.unlock(e),n}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,n){await this._mu.lock(e),await this.fs.link(e,i,n),this._mu.unlock(e)}linkSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,n)}async sync(e,i,n){await this._mu.lock(e),await this.fs.sync(e,i,n),this._mu.unlock(e)}syncSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,n)}};s(si,"LockedFS");var jr="/.deleted",Hi=class extends ne{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:ai.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,n){let r=n.cred(0,0);await this.createParentDirectories(e,r),await this._writable.sync(e,i,n)}syncSync(e,i,n){let r=n.cred(0,0);this.createParentDirectoriesSync(e,r),this._writable.syncSync(e,i,n)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(jr,L("r"),De),{size:i}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(i));this._deleteLog=In(n)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,n)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"rename")}}renameSync(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,n)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"rename")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"stat");let r=new U(await this._readable.stat(e,i));return r.mode|=146,r}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw u.With("ENOENT",e,"stat");let r=new U(this._readable.statSync(e,i));return r.mode|=146,r}}async openFile(e,i,n){if(await this._writable.exists(e,n))return this._writable.openFile(e,i,n);let r=await this._readable.openFile(e,L("r"),n),o=new U(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new ie(this,e,i,o,a)}openFileSync(e,i,n){if(this._writable.existsSync(e,n))return this._writable.openFileSync(e,i,n);let r=this._readable.openFileSync(e,L("r"),n),o=U.clone(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new ie(this,e,i,o,a)}async createFile(e,i,n,r){return this.checkInitialized(),await this._writable.createFile(e,i,n,r),this.openFile(e,i,r)}createFileSync(e,i,n,r){return this.checkInitialized(),this._writable.createFileSync(e,i,n,r),this.openFileSync(e,i,r)}async link(e,i,n){this.checkInitialized(),await this._writable.link(e,i,n)}linkSync(e,i,n){this.checkInitialized(),this._writable.linkSync(e,i,n)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw u.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw u.With("ENOENT",e,"unlink");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw u.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw u.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw u.With("ENOENT",e,"rmdir");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw u.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}async mkdir(e,i,n){if(this.checkInitialized(),await this.exists(e,n))throw u.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,n),await this._writable.mkdir(e,i,n)}mkdirSync(e,i,n){if(this.checkInitialized(),this.existsSync(e,n))throw u.With("EEXIST",e,"mkdir");this.createParentDirectoriesSync(e,n),this._writable.mkdirSync(e,i,n)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw u.With("ENOTDIR",e,"readdir");let r=[];try{r.push(...await this._writable.readdir(e,i))}catch{}try{r.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw u.With("ENOTDIR",e,"readdir");let r=[];try{r=r.concat(this._writable.readdirSync(e,i))}catch{}try{r=r.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
+
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(jr,L("w"),i);try{await n.write(Be(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}catch(r){this._deleteLogError=r}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
|
|
4
|
+
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw delete this._deleteLogError,e}checkPath(e){if(e==jr)throw u.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let n=x(e),r=[];for(;!this._writable.existsSync(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let n=x(e),r=[];for(;!await this._writable.exists(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw u.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw u.With("ENOENT",e,"operateOnWritable");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let n=this.statSync(e,i);if(n.isDirectory()){this._writable.mkdirSync(e,n.mode,i);return}let r=new Uint8Array(n.size),o=this._readable.openFileSync(e,L("r"),i);o.readSync(r),o.closeSync();let a=this._writable.openFileSync(e,L("w"),i);a.writeSync(r),a.closeSync()}async copyToWritable(e,i){let n=await this.stat(e,i);if(n.isDirectory()){await this._writable.mkdir(e,n.mode,i);return}let r=new Uint8Array(n.size),o=await this._readable.openFile(e,L("r"),i);await o.read(r),await o.close();let a=await this._writable.openFile(e,L("w"),i);await a.write(r),await a.close()}};s(Hi,"UnlockedOverlayFS");var ai=class extends si{async ready(){return await super.ready(),this}constructor(e){super(new Hi(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(ai,"OverlayFS");var _d={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new ai(t)}};function Ki(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(Ki,"isBackend");async function On(t,e){if(typeof e!="object"||e===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:qr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new u(22,`${t.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new u(22,`${t.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(On,"checkOptions");async function Ed(t,e={}){return await On(t,e),t.create(e).ready()}s(Ed,"createBackend");function $r(t){return t!=null&&typeof t=="object"&&"backend"in t&&Ki(t.backend)}s($r,"isBackendConfig");var gn={};wn(gn,{BigIntStats:()=>Y,Dir:()=>et,Dirent:()=>Ze,ReadStream:()=>lt,Stats:()=>U,StatsFs:()=>Zt,WriteStream:()=>ct,access:()=>xu,accessSync:()=>va,appendFile:()=>Zf,appendFileSync:()=>pa,chmod:()=>gu,chmodSync:()=>ka,chown:()=>mu,chownSync:()=>Ea,close:()=>tu,closeSync:()=>Qe,constants:()=>Ft,copyFile:()=>Pu,copyFileSync:()=>so,cp:()=>Cu,cpSync:()=>ao,createReadStream:()=>vu,createWriteStream:()=>Au,exists:()=>zf,existsSync:()=>pi,fchmod:()=>lu,fchmodSync:()=>Mn,fchown:()=>au,fchownSync:()=>Bn,fdatasync:()=>ru,fdatasyncSync:()=>ba,fstat:()=>eu,fstatSync:()=>ya,fsync:()=>nu,fsyncSync:()=>ma,ftruncate:()=>iu,ftruncateSync:()=>to,futimes:()=>cu,futimesSync:()=>Wn,lchmod:()=>wu,lchmodSync:()=>Ia,lchown:()=>bu,lchownSync:()=>xa,link:()=>hu,linkSync:()=>Sa,lopenSync:()=>Qi,lstat:()=>Kf,lstatSync:()=>eo,lutimes:()=>_u,lutimesSync:()=>Fa,mkdir:()=>uu,mkdirSync:()=>Un,mkdtemp:()=>Ou,mkdtempSync:()=>Aa,mount:()=>Yi,mountMapping:()=>Xi,mounts:()=>ge,open:()=>Xf,openAsBlob:()=>Bu,openSync:()=>mi,opendir:()=>Nu,opendirSync:()=>Pa,promises:()=>bn,read:()=>su,readFile:()=>Jf,readFileSync:()=>Dn,readSync:()=>wa,readdir:()=>du,readdirSync:()=>bi,readlink:()=>yu,readlinkSync:()=>no,readv:()=>Ru,readvSync:()=>Ta,realpath:()=>Eu,realpathSync:()=>hi,rename:()=>Vf,renameSync:()=>ua,rm:()=>Tu,rmSync:()=>oo,rmdir:()=>fu,rmdirSync:()=>io,stat:()=>Hf,statSync:()=>Ji,statfs:()=>Du,statfsSync:()=>Ra,symlink:()=>pu,symlinkSync:()=>_a,truncate:()=>Gf,truncateSync:()=>da,umount:()=>Nn,unlink:()=>Yf,unlinkSync:()=>Cn,unwatchFile:()=>Iu,utimes:()=>Su,utimesSync:()=>ro,watch:()=>Fu,watchFile:()=>ku,write:()=>ou,writeFile:()=>Qf,writeFileSync:()=>Zi,writeSync:()=>ga,writev:()=>Lu,writevSync:()=>Oa});var bn={};wn(bn,{FileHandle:()=>J,access:()=>Ts,appendFile:()=>_s,chmod:()=>Fs,chown:()=>ks,constants:()=>Ft,copyFile:()=>Or,cp:()=>Pr,exists:()=>Kt,lchmod:()=>vs,lchown:()=>Is,link:()=>Es,lstat:()=>Ir,lutimes:()=>As,mkdir:()=>mn,mkdtemp:()=>Os,open:()=>Ae,opendir:()=>Ps,readFile:()=>yn,readdir:()=>Lt,readlink:()=>vr,realpath:()=>Ht,rename:()=>ws,rm:()=>Tr,rmdir:()=>Fr,stat:()=>Li,statfs:()=>Rs,symlink:()=>xs,truncate:()=>Ss,unlink:()=>pn,utimes:()=>Ar,watch:()=>Og,writeFile:()=>Ni});var ft=Lr(ke(),1);var mt=Lr(ke(),1);var k=De;function fa(t){k=t}s(fa,"setCred");var Rt=new Map,th=100;function di(t){let e=th++;return Rt.set(e,t),e}s(di,"file2fd");function D(t){if(!Rt.has(t))throw new u(9);return Rt.get(t)}s(D,"fd2file");var ge=new Map;Yi("/",Vi.create({name:"root"}));function Yi(t,e){if(t[0]!=="/"&&(t="/"+t),t=Ee(t),ge.has(t))throw new u(22,"Mount point "+t+" is already in use.");ge.set(t,e)}s(Yi,"mount");function Nn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Ee(t),!ge.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");ge.delete(t)}s(Nn,"umount");function we(t){t=A(t);let e=[...ge].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(we,"resolveMount");function ca(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}s(ca,"fixPaths");function yt(t,e){return typeof t.stack=="string"&&(t.stack=ca(t.stack,e)),t.message=ca(t.message,e),t}s(yt,"fixError");function Xi(t){"/"in t&&Nn("/");for(let[e,i]of Object.entries(t))Yi(e,i)}s(Xi,"mountMapping");function fe(...[t,e,i,...n]){i=A(i);let{fs:r,path:o}=we(e&&pi(i)?hi(i):i);try{return r[t](o,...n)}catch(a){throw yt(a,{[o]:i})}}s(fe,"doOp");function ua(t,e){t=A(t),e=A(e);let i=we(t),n=we(e),r={[i.path]:t,[n.path]:e};try{if(i===n)return i.fs.renameSync(i.path,n.path,k);Zi(e,Dn(t)),Cn(t)}catch(o){throw yt(o,r)}}s(ua,"renameSync");function pi(t){t=A(t);try{let{fs:e,path:i}=we(hi(t));return e.existsSync(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(pi,"existsSync");function Ji(t,e){let i=fe("statSync",!0,t.toString(),k);return e?.bigint?new Y(i):i}s(Ji,"statSync");function eo(t,e){let i=fe("statSync",!1,t.toString(),k);return e?.bigint?new Y(i):i}s(eo,"lstatSync");function da(t,e=0){let i=mi(t,"r+");try{to(i,e)}finally{Qe(i)}}s(da,"truncateSync");function Cn(t){return fe("unlinkSync",!1,t.toString(),k)}s(Cn,"unlinkSync");function yi(t,e,i,n=!0){let r=A(t),o=ye(i,420),a=L(e),l;try{l=fe("statSync",n,r,k)}catch{switch(qi(a)){case 3:if(!fe("statSync",n,x(r),k).isDirectory())throw u.With("ENOTDIR",x(r),"_open");return fe("createFileSync",n,r,a,o,k);case 1:throw u.With("ENOENT",r,"_open");default:throw new u(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,k))throw u.With("EACCES",r,"_open");switch(Ui(a)){case 1:throw u.With("EEXIST",r,"_open");case 2:return fe("unlinkSync",n,r,k),fe("createFileSync",n,r,a,l.mode,k);case 0:return fe("openFileSync",n,r,a,k);default:throw new u(22,"Invalid FileFlag object.")}}s(yi,"_openSync");function mi(t,e,i=0){return di(yi(t,e,i,!0))}s(mi,"openSync");function Qi(t,e,i){return di(yi(t,e,i,!1))}s(Qi,"lopenSync");function ha(t,e,i){let n=yi(t,e,420,i);try{let r=n.statSync(),o=new Uint8Array(r.size);return n.readSync(o,0,r.size,0),n.closeSync(),o}finally{n.closeSync()}}s(ha,"_readFileSync");function Dn(t,e={}){let i=me(e,null,"r",420),n=L(i.flag);if(!Ye(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=mt.Buffer.from(ha(typeof t=="number"?D(t).path:t.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Dn,"readFileSync");function ih(t,e,i,n,r){let o=yi(t,i,n,r);try{o.writeSync(e,0,e.byteLength,0)}finally{o.closeSync()}}s(ih,"_writeFileSync");function Zi(t,e,i={}){let n=me(i,"utf8","w+",420),r=L(n.flag);if(!pe(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!o)throw new u(22,"Data not specified");ih(typeof t=="number"?D(t).path:t.toString(),o,n.flag,n.mode,!0)}s(Zi,"writeFileSync");function nh(t,e,i,n,r){let o=yi(t,i,n,r);try{o.writeSync(e,0,e.byteLength,null)}finally{o.closeSync()}}s(nh,"_appendFileSync");function pa(t,e,i={}){let n=me(i,"utf8","a",420),r=L(n.flag);if(!ht(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);nh(typeof t=="number"?D(t).path:t.toString(),o,n.flag,n.mode,!0)}s(pa,"appendFileSync");function ya(t,e){let i=D(t).statSync();return e?.bigint?new Y(i):i}s(ya,"fstatSync");function Qe(t){D(t).closeSync(),Rt.delete(t)}s(Qe,"closeSync");function to(t,e=0){if(e||=0,e<0)throw new u(22);D(t).truncateSync(e)}s(to,"ftruncateSync");function ma(t){D(t).syncSync()}s(ma,"fsyncSync");function ba(t){D(t).datasyncSync()}s(ba,"fdatasyncSync");function ga(t,e,i,n,r){let o,a,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof n=="string"?n:"utf8";a=0,o=mt.Buffer.from(e,d),l=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,l=n,c=typeof r=="number"?r:null;let f=D(t);return c??=f.position,f.writeSync(o,a,l,c)}s(ga,"writeSync");function wa(t,e,i,n,r){let o=D(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(e,a,n,r)}s(wa,"readSync");function Bn(t,e,i){D(t).chownSync(e,i)}s(Bn,"fchownSync");function Mn(t,e){let i=ye(e,-1);if(i<0)throw new u(22,"Invalid mode.");D(t).chmodSync(i)}s(Mn,"fchmodSync");function Wn(t,e,i){D(t).utimesSync(At(e),At(i))}s(Wn,"futimesSync");function io(t){return fe("rmdirSync",!0,t.toString(),k)}s(io,"rmdirSync");function Un(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,n=typeof e=="object"&&e?.recursive;fe("mkdirSync",!0,t.toString(),ye(i,511),k)}s(Un,"mkdirSync");function bi(t,e){t=A(t);let i=fe("readdirSync",!0,t,k);for(let n of ge.keys()){if(!n.startsWith(t))continue;let r=n.slice(t.length);r.includes("/")||r.length==0||i.push(r)}return i.map(n=>typeof e=="object"&&e?.withFileTypes?new Ze(n,Ji(C(t.toString(),n))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?mt.Buffer.from(n):n)}s(bi,"readdirSync");function Sa(t,e){return e=A(e),fe("linkSync",!1,t.toString(),e.toString(),k)}s(Sa,"linkSync");function _a(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(pi(e))throw u.With("EEXIST",e.toString(),"symlink");Zi(e,t.toString()),yi(e,"r+",420,!1)._setTypeSync(q.SYMLINK)}s(_a,"symlinkSync");function no(t,e){let i=mt.Buffer.from(ha(t.toString(),"r",!1)),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?i:i.toString(n)}s(no,"readlinkSync");function Ea(t,e,i){let n=mi(t,"r+");Bn(n,e,i),Qe(n)}s(Ea,"chownSync");function xa(t,e,i){let n=Qi(t,"r+");Bn(n,e,i),Qe(n)}s(xa,"lchownSync");function ka(t,e){let i=mi(t,"r+");Mn(i,e),Qe(i)}s(ka,"chmodSync");function Ia(t,e){let i=Qi(t,"r+");Mn(i,e),Qe(i)}s(Ia,"lchmodSync");function ro(t,e,i){let n=mi(t,"r+");Wn(n,e,i),Qe(n)}s(ro,"utimesSync");function Fa(t,e,i){let n=Qi(t,"r+");Wn(n,e,i),Qe(n)}s(Fa,"lutimesSync");function hi(t,e){t=A(t);let{base:i,dir:n}=Sn(t),r=C(n=="/"?"/":hi(n),i),{fs:o,path:a,mountPoint:l}=we(r);try{return o.statSync(a,k).isSymbolicLink()?hi(l+no(r)):r}catch(c){throw yt(c,{[a]:r})}}s(hi,"realpathSync");function va(t,e=384){if(!Ji(t).hasAccess(e,k))throw new u(13)}s(va,"accessSync");function oo(t,e){switch(t=A(t),Ji(t).mode&61440){case 16384:if(e?.recursive)for(let n of bi(t))oo(C(t,n));io(t);return;case 32768:case 40960:Cn(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 Aa(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Un(r),i=="buffer"?mt.Buffer.from(r):r}s(Aa,"mkdtempSync");function so(t,e,i){if(t=A(t),e=A(e),i&&i&1&&pi(e))throw new u(17,"Destination file already exists.",e,"copyFile");Zi(e,Dn(t))}s(so,"copyFileSync");function Ta(t,e,i){let n=D(t),r=0;for(let o of e)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(Ta,"readvSync");function Oa(t,e,i){let n=D(t),r=0;for(let o of e)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(Oa,"writevSync");function Pa(t,e){return t=A(t),new et(t)}s(Pa,"opendirSync");function ao(t,e,i){t=A(t),e=A(e);let n=eo(t);if(i?.errorOnExist&&pi(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");Un(e,{recursive:!0});for(let r of bi(t,{withFileTypes:!0}))i.filter&&!i.filter(C(t,r.name),C(e,r.name))||ao(C(t,r.name),C(e,r.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&&ro(e,n.atime,n.mtime)}s(ao,"cpSync");function Ra(t,e){throw u.With("ENOSYS",t.toString(),"statfs")}s(Ra,"statfsSync");var Ze=class{constructor(e,i){this.path=e;this.stats=i}get name(){return R(this.path)}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(Ze,"Dirent");var et=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}_entries=[];close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Lt(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=bi(this.path,{withFileTypes:!0})),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(et,"Dir");var kr=Lr(jf(),1);var lt=class extends kr.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}};s(lt,"ReadStream");var ct=class extends kr.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}};s(ct,"WriteStream");var J=class{constructor(e){this.fd=e}get file(){return D(this.fd)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=ye(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(At(e),At(i))}async appendFile(e,i={}){let n=me(i,"utf8","a",420),r=L(n.flag);if(!ht(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?ft.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e={}){let i=me(e,null,"r",292),n=L(i.flag);if(!Ye(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),o=new Uint8Array(r);await this.file.read(o,0,r,0);let a=ft.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=s(async({close:n,enqueue:r,error:o})=>{try{let c=0,f=0,d=NaN;for(;d>0;){let h=await this.read(new Uint8Array(65536),0,65536,f);if(!h.bytesRead){n();return}if(r(h.buffer.slice(0,h.bytesRead)),f+=h.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");d=h.bytesRead}}catch(a){o(a)}},"start");return new globalThis.ReadableStream({start:i,type:e.type})}readLines(e){throw 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 Y(i):i}async write(e,i,n,r){let o,a,l;if(typeof e=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,o=ft.Buffer.from(e,f),l=o.length}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,l=n,r=typeof r=="number"?r:null;r??=this.file.position;let c=await this.file.write(o,a,l,r);return{buffer:o,bytesWritten:c}}async writeFile(e,i={}){let n=me(i,"utf8","w",420),r=L(n.flag);if(!pe(r))throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?ft.Buffer.from(e,n.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 n=0;for(let r of e)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,i){let n=0;for(let r of e)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){let i=new lt({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}}});return i.path=this.file.path,i}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:async(r,o,a)=>{try{let{bytesWritten:l}=await this.write(r,null,o);a(l==r.length?null:new Error("Failed to write full chunk"))}catch(l){a(l)}}},n=new ct(i);return n.path=this.file.path,n}};s(J,"FileHandle");async function ve(...[t,e,i,...n]){i=A(i);let r=e&&await Kt(i)?await Ht(i):i,{fs:o,path:a}=we(r);try{return o[t](a,...n)}catch(l){throw yt(l,{[a]:i})}}s(ve,"doOp");async function ws(t,e){t=A(t),e=A(e);let i=we(t),n=we(e);try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path,k);return}await Ni(e,await yn(t)),await pn(t)}catch(r){throw yt(r,{[i.path]:t,[n.path]:e})}}s(ws,"rename");async function Kt(t){try{let{fs:e,path:i}=we(await Ht(t));return await e.exists(i,k)}catch(e){if(e.errno==2)return!1;throw e}}s(Kt,"exists");async function Li(t,e){let i=await ve("stat",!0,t.toString(),k);return e?.bigint?new Y(i):i}s(Li,"stat");async function Ir(t,e){let i=await ve("stat",!1,t.toString(),k);return e?.bigint?new Y(i):i}s(Ir,"lstat");async function Ss(t,e=0){let i=await Ae(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Ss,"truncate");async function pn(t){return ve("unlink",!1,t.toString(),k)}s(pn,"unlink");async function Gt(t,e,i=420,n){let r=A(t),o=ye(i,420),a=L(e);try{switch(Ui(a)){case 1:throw u.With("EEXIST",r,"_open");case 2:let l=await ve("openFile",n,r,a,k);if(!l)throw new u(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await ve("openFile",n,r,a,k);default:throw new u(22,"Invalid file flag")}}catch{switch(qi(a)){case 3:let c=await ve("stat",n,x(r),k);if(c&&!c.isDirectory())throw u.With("ENOTDIR",x(r),"_open");return await ve("createFile",n,r,a,o,k);case 1:throw u.With("ENOENT",r,"_open");default:throw new u(22,"Invalid file flag")}}}s(Gt,"_open");async function Ae(t,e="r",i=420){let n=await Gt(t,e,i,!0);return new J(di(n))}s(Ae,"open");async function $f(t,e,i){let n=await Gt(A(t),e,420,i);try{let r=await n.stat(),o=new Uint8Array(r.size);return await n.read(o,0,r.size,0),await n.close(),o}catch(r){throw await n.close(),r}}s($f,"_readFile");async function yn(t,e){let i=me(e,null,"r",0),n=L(i.flag);if(!Ye(n))throw new u(22,"Flag passed must allow for reading.");t=t instanceof J?t.file.path:t.toString();let r=ft.Buffer.from(await $f(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(yn,"readFile");async function Ni(t,e,i){let n=me(i,"utf8","w+",420),r=t instanceof J?t:await Ae(t.toString(),n.flag,n.mode);try{let o=e;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}finally{await r.close()}}s(Ni,"writeFile");async function Tg(t,e,i,n,r){let o=await Gt(t,i,n,r);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(Tg,"_appendFile");async function _s(t,e,i){let n=me(i,"utf8","a",420),r=L(n.flag);if(!ht(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof e=="string"?ft.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);await Tg(t instanceof J?t.file.path:t.toString(),o,n.flag,n.mode,!0)}s(_s,"appendFile");async function Fr(t){return ve("rmdir",!0,t.toString(),k)}s(Fr,"rmdir");async function mn(t,e){await ve("mkdir",!0,t.toString(),ye(typeof e=="object"?e?.mode:e,511),k)}s(mn,"mkdir");async function Lt(t,e){t=A(t);let i=await ve("readdir",!0,t,k),n=[...ge.keys()];for(let o of n)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let r=[];for(let o of i)r.push(typeof e=="object"&&e?.withFileTypes?new Ze(o,await Li(C(t,o))):o);return r}s(Lt,"readdir");async function Es(t,e){return e=A(e),ve("link",!1,t.toString(),e,k)}s(Es,"link");async function xs(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await Kt(e))throw u.With("EEXIST",e.toString(),"symlink");await Ni(e,t.toString()),await(await Gt(e,"r+",420,!1))._setType(q.SYMLINK)}s(xs,"symlink");async function vr(t,e){let i=ft.Buffer.from(await $f(t.toString(),"r",!1)),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?i:i.toString(n)}s(vr,"readlink");async function ks(t,e,i){let n=await Ae(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(ks,"chown");async function Is(t,e,i){let n=await Gt(t,"r+",420,!1);try{await n.chown(e,i)}finally{await n.close()}}s(Is,"lchown");async function Fs(t,e){let i=await Ae(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Fs,"chmod");async function vs(t,e){let i=await Gt(t,"r+",420,!1);try{await new J(di(i)).chmod(e)}finally{await i.close()}}s(vs,"lchmod");async function Ar(t,e,i){let n=await Ae(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(Ar,"utimes");async function As(t,e,i){let n=await Gt(t,"r+",420,!1);try{await n.utimes(new Date(e),new Date(i))}finally{await n.close()}}s(As,"lutimes");async function Ht(t,e){t=A(t);let{base:i,dir:n}=Sn(t),r=C(n=="/"?"/":await Ht(n),i),{fs:o,path:a,mountPoint:l}=we(r);try{return(await o.stat(a,k)).isSymbolicLink()?Ht(l+await vr(r)):r}catch(c){throw yt(c,{[a]:r})}}s(Ht,"realpath");function Og(t,e={}){throw u.With("ENOSYS",t.toString(),"watch")}s(Og,"watch");async function Ts(t,e=0){if(!(await Li(t)).hasAccess(e,k))throw new u(13)}s(Ts,"access");async function Tr(t,e){switch(t=A(t),(await Li(t)).mode&61440){case 16384:if(e?.recursive)for(let n of await Lt(t))await Tr(C(t,n));await Fr(t);return;case 32768:case 40960:await pn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}s(Tr,"rm");async function Os(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await mn(r),i=="buffer"?ft.Buffer.from(r):r}s(Os,"mkdtemp");async function Or(t,e,i){if(t=A(t),e=A(e),i&&i&1&&await Kt(e))throw new u(17,"Destination file already exists.",e,"copyFile");await Ni(e,await yn(t))}s(Or,"copyFile");async function Ps(t,e){return t=A(t),new et(t)}s(Ps,"opendir");async function Pr(t,e,i){t=A(t),e=A(e);let n=await Ir(t);if(i?.errorOnExist&&await Kt(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");await mn(e,{recursive:!0});for(let r of await Lt(t,{withFileTypes:!0}))i.filter&&!i.filter(C(t,r.name),C(e,r.name))||await Pr(C(t,r.name),C(e,r.name),i);break;case 32768:case 40960:await Or(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 Ar(e,n.atime,n.mtime)}s(Pr,"cp");async function Rs(t,e){throw u.With("ENOSYS",t.toString(),"statfs")}s(Rs,"statfs");function Vf(t,e,i=_){ws(t,e).then(()=>i()).catch(i)}s(Vf,"rename");function zf(t,e=_){Kt(t).then(e).catch(()=>e(!1))}s(zf,"exists");function Hf(t,e,i=_){i=typeof e=="function"?e:i,Li(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(Hf,"stat");function Kf(t,e,i=_){i=typeof e=="function"?e:i,Ir(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}s(Kf,"lstat");function Gf(t,e=0,i=_){i=typeof e=="function"?e:i,Ss(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(Gf,"truncate");function Yf(t,e=_){pn(t).then(()=>e()).catch(e)}s(Yf,"unlink");function Xf(t,e,i,n=_){let r=ye(i,420);n=typeof i=="function"?i:n,Ae(t,e,r).then(o=>n(void 0,o.fd)).catch(n)}s(Xf,"open");function Jf(t,e,i=_){i=typeof e=="function"?e:i,yn(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}s(Jf,"readFile");function Qf(t,e,i,n=_){n=typeof i=="function"?i:n,Ni(t,e,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(Qf,"writeFile");function Zf(t,e,i,n=_){n=typeof i=="function"?i:n,_s(t,e,typeof i=="function"?null:i).then(()=>n()).catch(n)}s(Zf,"appendFile");function eu(t,e,i=_){i=typeof e=="function"?e:i,D(t).stat().then(n=>i(void 0,typeof e=="object"&&e?.bigint?new Y(n):n)).catch(i)}s(eu,"fstat");function tu(t,e=_){new J(t).close().then(()=>e()).catch(e)}s(tu,"close");function iu(t,e,i=_){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=D(t);if(n<0)throw new u(22);r.truncate(n).then(()=>i()).catch(i)}s(iu,"ftruncate");function nu(t,e=_){D(t).sync().then(()=>e()).catch(e)}s(nu,"fsync");function ru(t,e=_){D(t).datasync().then(()=>e()).catch(e)}s(ru,"fdatasync");function ou(t,e,i,n,r,o=_){let a,l,c,f,d,h=new J(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new u(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let b=o;h.write(a,l,c,f).then(({bytesWritten:m})=>b(void 0,m,a.toString(d))).catch(b)}else{a=Buffer.from(e.buffer),l=i,c=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,l,c,f).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(ou,"write");function su(t,e,i,n,r,o=_){new J(t).read(e,i,n,r).then(({bytesRead:a,buffer:l})=>o(void 0,a,l)).catch(o)}s(su,"read");function au(t,e,i,n=_){new J(t).chown(e,i).then(()=>n()).catch(n)}s(au,"fchown");function lu(t,e,i){new J(t).chmod(e).then(()=>i()).catch(i)}s(lu,"fchmod");function cu(t,e,i,n=_){new J(t).utimes(e,i).then(()=>n()).catch(n)}s(cu,"futimes");function fu(t,e=_){Fr(t).then(()=>e()).catch(e)}s(fu,"rmdir");function uu(t,e,i=_){mn(t,e).then(()=>i()).catch(i)}s(uu,"mkdir");function du(t,e,i=_){i=typeof e=="function"?e:i,Lt(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}s(du,"readdir");function hu(t,e,i=_){Es(t,e).then(()=>i()).catch(i)}s(hu,"link");function pu(t,e,i,n=_){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,xs(t,e,r).then(()=>n()).catch(n)}s(pu,"symlink");function yu(t,e,i=_){i=typeof e=="function"?e:i,vr(t).then(n=>i(void 0,n)).catch(i)}s(yu,"readlink");function mu(t,e,i,n=_){ks(t,e,i).then(()=>n()).catch(n)}s(mu,"chown");function bu(t,e,i,n=_){Is(t,e,i).then(()=>n()).catch(n)}s(bu,"lchown");function gu(t,e,i=_){Fs(t,e).then(()=>i()).catch(i)}s(gu,"chmod");function wu(t,e,i=_){vs(t,e).then(()=>i()).catch(i)}s(wu,"lchmod");function Su(t,e,i,n=_){Ar(t,e,i).then(()=>n()).catch(n)}s(Su,"utimes");function _u(t,e,i,n=_){As(t,e,i).then(()=>n()).catch(n)}s(_u,"lutimes");function Eu(t,e,i=_){i=typeof e=="function"?e:i,Ht(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}s(Eu,"realpath");function xu(t,e,i=_){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Ts(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(xu,"access");function ku(t,e,i=_){throw u.With("ENOSYS",t.toString(),"watchFile")}s(ku,"watchFile");function Iu(t,e=_){throw u.With("ENOSYS",t.toString(),"unwatchFile")}s(Iu,"unwatchFile");function Fu(t,e,i=_){throw u.With("ENOSYS",t.toString(),"watch")}s(Fu,"watch");function vu(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new lt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",async read(o){try{n||=await Ae(t,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},destroy(o,a){n?.close().then(()=>a(o)).catch(a)}});return r.path=t.toString(),r}s(vu,"createReadStream");function Au(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new ct({highWaterMark:i?.highWaterMark,async write(o,a,l){try{n||=await Ae(t,"w",i?.mode||438),await n.write(o,0,a),l(void 0)}catch(c){await n?.close(),l(c)}},destroy(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},final(o){n?.close().then(()=>o()).catch(o)}});return r.path=t.toString(),r}s(Au,"createWriteStream");function Tu(t,e,i=_){i=typeof e=="function"?e:i,Tr(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}s(Tu,"rm");function Ou(t,e,i=_){i=typeof e=="function"?e:i,Os(t,typeof e!="function"?e:null).then(n=>i(void 0,n)).catch(i)}s(Ou,"mkdtemp");function Pu(t,e,i,n=_){n=typeof i=="function"?i:n,Or(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Pu,"copyFile");function Ru(t,e,i,n=_){n=typeof i=="function"?i:n,new J(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s(Ru,"readv");function Lu(t,e,i,n=_){n=typeof i=="function"?i:n,new J(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s(Lu,"writev");function Nu(t,e,i=_){i=typeof e=="function"?e:i,Ps(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}s(Nu,"opendir");function Cu(t,e,i,n=_){n=typeof i=="function"?i:n,Pr(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Cu,"cp");function Du(t,e,i=_){i=typeof e=="function"?e:i,Rs(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}s(Du,"statfs");async function Bu(t,e){let i=await Ae(t.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}s(Bu,"openAsBlob");function Ls(t){return $r(t)||Ki(t)||t instanceof ne}s(Ls,"isMountConfig");async function Ns(t,e=0){if(typeof t!="object"||t==null)throw new u(22,"Invalid options on mount configuration");if(!Ls(t))throw new u(22,"Invalid mount configuration");if(t instanceof ne)return t;Ki(t)&&(t={backend:t});for(let[r,o]of Object.entries(t))if(r!="backend"&&Ls(o)){if(e>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");t[r]=await Ns(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i);On(i,t);let n=i.create(t);return await n.ready(),n}s(Ns,"resolveMountConfig");async function Pg(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;Ls(t)&&(t={"/":t});for(let[n,r]of Object.entries(t))n=="uid"||n=="gid"||typeof r=="number"||(t[n]=await Ns(r));Xi(t),fa({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Pg,"configure");var Rg=gn;return Vu(Lg);})();
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
ieee754/index.js:
|