megajs
Version:
Unofficial JavaScript SDK for MEGA
2 lines • 237 kB
JavaScript
var mega=(()=>{var ky=Object.create;var Fs=Object.defineProperty;var Ly=Object.getOwnPropertyDescriptor;var Cy=Object.getOwnPropertyNames;var Ny=Object.getPrototypeOf,qy=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Dy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cy(e))!qy.call(t,i)&&i!==r&&Fs(t,i,{get:()=>e[i],enumerable:!(n=Ly(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?ky(Ny(t)):{},Dy(e||!t||!t.__esModule?Fs(r,"default",{value:t,enumerable:!0}):r,t));var Ws=_(rn=>{"use strict";u();rn.byteLength=jy;rn.toByteArray=Wy;rn.fromByteArray=Gy;var Re=[],he=[],Fy=typeof Uint8Array<"u"?Uint8Array:Array,ji="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,js=ji.length;ut<js;++ut)Re[ut]=ji[ut],he[ji.charCodeAt(ut)]=ut;var ut,js;he[45]=62;he[95]=63;function Us(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function jy(t){var e=Us(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Uy(t,e,r){return(e+r)*3/4-r}function Wy(t){var e,r=Us(t),n=r[0],i=r[1],o=new Fy(Uy(t,n,i)),a=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)e=he[t.charCodeAt(l)]<<18|he[t.charCodeAt(l+1)]<<12|he[t.charCodeAt(l+2)]<<6|he[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=he[t.charCodeAt(l)]<<2|he[t.charCodeAt(l+1)]>>4,o[a++]=e&255),i===1&&(e=he[t.charCodeAt(l)]<<10|he[t.charCodeAt(l+1)]<<4|he[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function $y(t){return Re[t>>18&63]+Re[t>>12&63]+Re[t>>6&63]+Re[t&63]}function Hy(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push($y(n));return i.join("")}function Gy(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,s=r-n;a<s;a+=o)i.push(Hy(t,a,a+o>s?s:a+o));return n===1?(e=t[r-1],i.push(Re[e>>2]+Re[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Re[e>>10]+Re[e>>4&63]+Re[e<<2&63]+"=")),i.join("")}});var $s=_(Ui=>{u();Ui.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,d=r?i-1:0,g=r?-1:1,p=t[e+d];for(d+=g,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=o*256+t[e+d],d+=g,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+d],d+=g,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};Ui.write=function(t,e,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,d=c>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,E=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?e+=g/l:e+=g*Math.pow(2,1-d),e*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(e*l-1)*Math.pow(2,i),a=a+d):(s=e*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=s&255,p+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[r+p]=a&255,p+=E,a/=256,f-=8);t[r+p-E]|=m*128}});var de=_(qt=>{"use strict";u();var Wi=Ws(),Ct=$s(),Hs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qt.Buffer=w;qt.SlowBuffer=Xy;qt.INSPECT_MAX_BYTES=50;var nn=2147483647;qt.kMaxLength=nn;w.TYPED_ARRAY_SUPPORT=Vy();!w.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 Vy(){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}}Object.defineProperty(w.prototype,"parent",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.buffer}});Object.defineProperty(w.prototype,"offset",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.byteOffset}});function je(t){if(t>nn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,w.prototype),e}function w(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Vi(t)}return zs(t,e,r)}w.poolSize=8192;function zs(t,e,r){if(typeof t=="string")return zy(t,e);if(ArrayBuffer.isView(t))return Yy(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(xe(t,ArrayBuffer)||t&&xe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(t,SharedArrayBuffer)||t&&xe(t.buffer,SharedArrayBuffer)))return Hi(t,e,r);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 w.from(n,e,r);let i=Jy(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return w.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}w.from=function(t,e,r){return zs(t,e,r)};Object.setPrototypeOf(w.prototype,Uint8Array.prototype);Object.setPrototypeOf(w,Uint8Array);function Ys(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"')}function Ky(t,e,r){return Ys(t),t<=0?je(t):e!==void 0?typeof r=="string"?je(t).fill(e,r):je(t).fill(e):je(t)}w.alloc=function(t,e,r){return Ky(t,e,r)};function Vi(t){return Ys(t),je(t<0?0:Ki(t)|0)}w.allocUnsafe=function(t){return Vi(t)};w.allocUnsafeSlow=function(t){return Vi(t)};function zy(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!w.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Js(t,e)|0,n=je(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function $i(t){let e=t.length<0?0:Ki(t.length)|0,r=je(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Yy(t){if(xe(t,Uint8Array)){let e=new Uint8Array(t);return Hi(e.buffer,e.byteOffset,e.byteLength)}return $i(t)}function Hi(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,w.prototype),n}function Jy(t){if(w.isBuffer(t)){let e=Ki(t.length)|0,r=je(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Yi(t.length)?je(0):$i(t);if(t.type==="Buffer"&&Array.isArray(t.data))return $i(t.data)}function Ki(t){if(t>=nn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nn.toString(16)+" bytes");return t|0}function Xy(t){return+t!=t&&(t=0),w.alloc(+t)}w.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==w.prototype};w.compare=function(e,r){if(xe(e,Uint8Array)&&(e=w.from(e,e.offset,e.byteLength)),xe(r,Uint8Array)&&(r=w.from(r,r.offset,r.byteLength)),!w.isBuffer(e)||!w.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};w.isEncoding=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}};w.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return w.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=w.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let a=e[n];if(xe(a,Uint8Array))o+a.length>i.length?(w.isBuffer(a)||(a=w.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(w.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Js(t,e){if(w.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||xe(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 r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Gi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ol(t).length;default:if(i)return n?-1:Gi(t).length;e=(""+e).toLowerCase(),i=!0}}w.byteLength=Js;function Qy(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return lg(this,e,r);case"utf8":case"utf-8":return Qs(this,e,r);case"ascii":return ag(this,e,r);case"latin1":case"binary":return sg(this,e,r);case"base64":return ig(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fg(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}w.prototype._isBuffer=!0;function ct(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}w.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ct(this,r,r+1);return this};w.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ct(this,r,r+3),ct(this,r+1,r+2);return this};w.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ct(this,r,r+7),ct(this,r+1,r+6),ct(this,r+2,r+5),ct(this,r+3,r+4);return this};w.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Qs(this,0,e):Qy.apply(this,arguments)};w.prototype.toLocaleString=w.prototype.toString;w.prototype.equals=function(e){if(!w.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:w.compare(this,e)===0};w.prototype.inspect=function(){let e="",r=qt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Hs&&(w.prototype[Hs]=w.prototype.inspect);w.prototype.compare=function(e,r,n,i,o){if(xe(e,Uint8Array)&&(e=w.from(e,e.offset,e.byteLength)),!w.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let a=o-i,s=n-r,l=Math.min(a,s),f=this.slice(i,o),c=e.slice(r,n);for(let d=0;d<l;++d)if(f[d]!==c[d]){a=f[d],s=c[d];break}return a<s?-1:s<a?1:0};function Xs(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yi(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=w.from(e,n)),w.isBuffer(e))return e.length===0?-1:Gs(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Gs(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Gs(t,e,r,n,i){let o=1,a=t.length,s=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,s/=2,r/=2}function l(c,d){return o===1?c[d]:c.readUInt16BE(d*o)}let f;if(i){let c=-1;for(f=r;f<a;f++)if(l(t,f)===l(e,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===s)return c*o}else c!==-1&&(f-=f-c),c=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){let c=!0;for(let d=0;d<s;d++)if(l(t,f+d)!==l(e,d)){c=!1;break}if(c)return f}return-1}w.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};w.prototype.indexOf=function(e,r,n){return Xs(this,e,r,n,!0)};w.prototype.lastIndexOf=function(e,r,n){return Xs(this,e,r,n,!1)};function Zy(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(e.substr(a*2,2),16);if(Yi(s))return a;t[r+a]=s}return a}function eg(t,e,r,n){return on(Gi(e,t.length-r),t,r,n)}function tg(t,e,r,n){return on(hg(e),t,r,n)}function rg(t,e,r,n){return on(ol(e),t,r,n)}function ng(t,e,r,n){return on(pg(e,t.length-r),t,r,n)}w.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return Zy(this,e,r,n);case"utf8":case"utf-8":return eg(this,e,r,n);case"ascii":case"latin1":case"binary":return tg(this,e,r,n);case"base64":return rg(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ng(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ig(t,e,r){return e===0&&r===t.length?Wi.fromByteArray(t):Wi.fromByteArray(t.slice(e,r))}function Qs(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){let l,f,c,d;switch(s){case 1:o<128&&(a=o);break;case 2:l=t[i+1],(l&192)===128&&(d=(o&31)<<6|l&63,d>127&&(a=d));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(d=(o&15)<<12|(l&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:l=t[i+1],f=t[i+2],c=t[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(d=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return og(n)}var Vs=4096;function og(t){let e=t.length;if(e<=Vs)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Vs));return r}function ag(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function sg(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function lg(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=yg[t[o]];return i}function fg(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}w.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,w.prototype),i};function Q(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}w.prototype.readUintLE=w.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return i};w.prototype.readUintBE=w.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};w.prototype.readUint8=w.prototype.readUInt8=function(e,r){return e=e>>>0,r||Q(e,1,this.length),this[e]};w.prototype.readUint16LE=w.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Q(e,2,this.length),this[e]|this[e+1]<<8};w.prototype.readUint16BE=w.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Q(e,2,this.length),this[e]<<8|this[e+1]};w.prototype.readUint32LE=w.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};w.prototype.readUint32BE=w.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};w.prototype.readBigUInt64LE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&_r(e,this.length-8);let i=r+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(i)+(BigInt(o)<<BigInt(32))});w.prototype.readBigUInt64BE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&_r(e,this.length-8);let i=r*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(i)<<BigInt(32))+BigInt(o)});w.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};w.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=r,o=1,a=this[e+--i];for(;i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};w.prototype.readInt8=function(e,r){return e=e>>>0,r||Q(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};w.prototype.readInt16LE=function(e,r){e=e>>>0,r||Q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};w.prototype.readInt16BE=function(e,r){e=e>>>0,r||Q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};w.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};w.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};w.prototype.readBigInt64LE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&_r(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});w.prototype.readBigInt64BE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&_r(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});w.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Ct.read(this,e,!0,23,4)};w.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Ct.read(this,e,!1,23,4)};w.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Ct.read(this,e,!0,52,8)};w.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Ct.read(this,e,!1,52,8)};function fe(t,e,r,n,i,o){if(!w.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}w.prototype.writeUintLE=w.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;fe(this,e,r,n,s,0)}let o=1,a=0;for(this[r]=e&255;++a<n&&(o*=256);)this[r+a]=e/o&255;return r+n};w.prototype.writeUintBE=w.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;fe(this,e,r,n,s,0)}let o=n-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+n};w.prototype.writeUint8=w.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,1,255,0),this[r]=e&255,r+1};w.prototype.writeUint16LE=w.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};w.prototype.writeUint16BE=w.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};w.prototype.writeUint32LE=w.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};w.prototype.writeUint32BE=w.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Zs(t,e,r,n,i){il(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function el(t,e,r,n,i){il(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}w.prototype.writeBigUInt64LE=Ze(function(e,r=0){return Zs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});w.prototype.writeBigUInt64BE=Ze(function(e,r=0){return el(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});w.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fe(this,e,r,n,l-1,-l)}let o=0,a=1,s=0;for(this[r]=e&255;++o<n&&(a*=256);)e<0&&s===0&&this[r+o-1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};w.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fe(this,e,r,n,l-1,-l)}let o=n-1,a=1,s=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&s===0&&this[r+o+1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};w.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};w.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};w.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};w.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};w.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};w.prototype.writeBigInt64LE=Ze(function(e,r=0){return Zs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});w.prototype.writeBigInt64BE=Ze(function(e,r=0){return el(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function tl(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function rl(t,e,r,n,i){return e=+e,r=r>>>0,i||tl(t,e,r,4,34028234663852886e22,-34028234663852886e22),Ct.write(t,e,r,n,23,4),r+4}w.prototype.writeFloatLE=function(e,r,n){return rl(this,e,r,!0,n)};w.prototype.writeFloatBE=function(e,r,n){return rl(this,e,r,!1,n)};function nl(t,e,r,n,i){return e=+e,r=r>>>0,i||tl(t,e,r,8,17976931348623157e292,-17976931348623157e292),Ct.write(t,e,r,n,52,8),r+8}w.prototype.writeDoubleLE=function(e,r,n){return nl(this,e,r,!0,n)};w.prototype.writeDoubleBE=function(e,r,n){return nl(this,e,r,!1,n)};w.prototype.copy=function(e,r,n,i){if(!w.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};w.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!w.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let a=e.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let a=w.isBuffer(e)?e:w.from(e,i),s=a.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=a[o%s]}return this};var Lt={};function zi(t,e,r){Lt[t]=class extends r{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(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}zi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);zi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);zi("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Ks(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Ks(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Ks(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ug(t,e,r){Nt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&_r(e,t.length-(r+1))}function il(t,e,r,n,i,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",s;throw o>3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new Lt.ERR_OUT_OF_RANGE("value",s,t)}ug(n,i,o)}function Nt(t,e){if(typeof t!="number")throw new Lt.ERR_INVALID_ARG_TYPE(e,"number",t)}function _r(t,e,r){throw Math.floor(t)!==t?(Nt(t,r),new Lt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Lt.ERR_BUFFER_OUT_OF_BOUNDS:new Lt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var cg=/[^+/0-9A-Za-z-_]/g;function dg(t){if(t=t.split("=")[0],t=t.trim().replace(cg,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Gi(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function hg(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function pg(t,e){let r,n,i,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function ol(t){return Wi.toByteArray(dg(t))}function on(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function xe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Yi(t){return t!==t}var yg=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Ze(t){return typeof BigInt>"u"?gg:t}function gg(){throw new Error("BigInt not supported")}});var h,y,b,u=_e(()=>{h=ve(de(),1),y={env:{},nextTick:(t,...e)=>{globalThis.setTimeout(t,0,...e)}},b=globalThis});var H=_((UR,al)=>{"use strict";u();al.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,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},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,r){return Object.defineProperty(t,e,r)},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,r){return t.then(e,r)},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,r){return t.slice(e,r)},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,r){return t.set(e,r)},Boolean,Uint8Array}});var Dt=_(($R,an)=>{"use strict";u();var{AbortController:sl,AbortSignal:bg}=typeof self<"u"?self:typeof window<"u"?window:void 0;an.exports=sl;an.exports.AbortSignal=bg;an.exports.default=sl});var Te=_((GR,Ji)=>{"use strict";u();var Ft=typeof Reflect=="object"?Reflect:null,ll=Ft&&typeof Ft.apply=="function"?Ft.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},sn;Ft&&typeof Ft.ownKeys=="function"?sn=Ft.ownKeys:Object.getOwnPropertySymbols?sn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:sn=function(e){return Object.getOwnPropertyNames(e)};function wg(t){console&&console.warn&&console.warn(t)}var ul=Number.isNaN||function(e){return e!==e};function q(){q.init.call(this)}Ji.exports=q;Ji.exports.once=Sg;q.EventEmitter=q;q.prototype._events=void 0;q.prototype._eventsCount=0;q.prototype._maxListeners=void 0;var fl=10;function ln(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(q,"defaultMaxListeners",{enumerable:!0,get:function(){return fl},set:function(t){if(typeof t!="number"||t<0||ul(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");fl=t}});q.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};q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ul(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};function cl(t){return t._maxListeners===void 0?q.defaultMaxListeners:t._maxListeners}q.prototype.getMaxListeners=function(){return cl(this)};q.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")ll(l,this,r);else for(var f=l.length,c=gl(l,f),n=0;n<f;++n)ll(c[n],this,r);return!0};function dl(t,e,r,n){var i,o,a;if(ln(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),a===void 0)a=o[e]=r,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),i=cl(t),i>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,wg(s)}return t}q.prototype.addListener=function(e,r){return dl(this,e,r,!1)};q.prototype.on=q.prototype.addListener;q.prototype.prependListener=function(e,r){return dl(this,e,r,!0)};function mg(){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)}function hl(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=mg.bind(n);return i.listener=r,n.wrapFn=i,i}q.prototype.once=function(e,r){return ln(r),this.on(e,hl(this,e,r)),this};q.prototype.prependOnceListener=function(e,r){return ln(r),this.prependListener(e,hl(this,e,r)),this};q.prototype.removeListener=function(e,r){var n,i,o,a,s;if(ln(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():_g(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};q.prototype.off=q.prototype.removeListener;q.prototype.removeAllListeners=function(e){var r,n,i;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(i=0;i<o.length;++i)a=o[i],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function pl(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Eg(i):gl(i,i.length)}q.prototype.listeners=function(e){return pl(this,e,!0)};q.prototype.rawListeners=function(e){return pl(this,e,!1)};q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):yl.call(t,e)};q.prototype.listenerCount=yl;function yl(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}q.prototype.eventNames=function(){return this._eventsCount>0?sn(this._events):[]};function gl(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function _g(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Eg(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Sg(t,e){return new Promise(function(r,n){function i(a){t.removeListener(e,o),n(a)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}bl(t,e,o,{once:!0}),e!=="error"&&Ag(t,i,{once:!0})})}function Ag(t,e,r){typeof t.on=="function"&&bl(t,"error",e,r)}function bl(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var ne=_((KR,Qi)=>{"use strict";u();var vg=de(),{kResistStopPropagation:Rg,SymbolDispose:xg}=H(),Tg=globalThis.AbortSignal||Dt().AbortSignal,Ig=globalThis.AbortController||Dt().AbortController,Og=Object.getPrototypeOf(async function(){}).constructor,wl=globalThis.Blob||vg.Blob,Pg=typeof wl<"u"?function(e){return e instanceof wl}:function(e){return!1},ml=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},Bg=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},Xi=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n<e.length;n++)r+=` ${e[n].stack}
`;super(r),this.name="AggregateError",this.errors=e}};Qi.exports={AggregateError:Xi,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.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 Og},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Pg,deprecate(t,e){return t},addAbortListener:Te().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);ml(e,"signal"),Bg(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Rg]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[xg](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Tg.any||function(e){if(e.length===1)return e[0];let r=new Ig,n=()=>r.abort();return e.forEach(i=>{ml(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Qi.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=_((YR,Sl)=>{"use strict";u();var{format:Mg,inspect:fn,AggregateError:kg}=ne(),Lg=globalThis.AggregateError||kg,Cg=Symbol("kIsNodeError"),Ng=["string","function","number","object","Function","Object","boolean","bigint","symbol"],qg=/^([A-Z][a-z0-9]*)+$/,Dg="__node_internal_",un={};function dt(t,e){if(!t)throw new un.ERR_INTERNAL_ASSERTION(e)}function _l(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Fg(t,e,r){if(typeof e=="function")return dt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return dt(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:Mg(e,...r)}function te(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(Fg(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.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[Cg]=!0,un[t]=n}function El(t){let e=Dg+t.name;return Object.defineProperty(t,"name",{value:e}),t}function jg(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Lg([e,t],e.message);return r.code=e.code,r}return t||e}var Zi=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new un.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(t,e,r)=>{dt(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 i=[],o=[],a=[];for(let l of e)dt(typeof l=="string","All expected entries have to be of type string"),Ng.includes(l)?i.push(l.toLowerCase()):qg.test(l)?o.push(l):(dt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(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 l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}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 l=a.pop();n+=`one of ${a.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var s;if((s=r.constructor)!==null&&s!==void 0&&s.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=fn(r,{depth:-1});n+=`. Received ${l}`}}else{let l=fn(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);te("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=fn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);te("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);te("ERR_MISSING_ARGS",(...t)=>{dt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){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);te("ERR_OUT_OF_RANGE",(t,e,r)=>{dt(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=_l(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=_l(n)),n+="n"):n=fn(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Sl.exports={AbortError:Zi,aggregateTwoErrors:El(jg),hideStackFrames:El,codes:un}});var Ut=_((XR,Ml)=>{"use strict";u();var{ArrayIsArray:to,ArrayPrototypeIncludes:xl,ArrayPrototypeJoin:Tl,ArrayPrototypeMap:Ug,NumberIsInteger:ro,NumberIsNaN:Wg,NumberMAX_SAFE_INTEGER:$g,NumberMIN_SAFE_INTEGER:Hg,NumberParseInt:Gg,ObjectPrototypeHasOwnProperty:Vg,RegExpPrototypeExec:Il,String:Kg,StringPrototypeToUpperCase:zg,StringPrototypeTrim:Yg}=H(),{hideStackFrames:pe,codes:{ERR_SOCKET_BAD_PORT:Jg,ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_ARG_VALUE:jt,ERR_OUT_OF_RANGE:ht,ERR_UNKNOWN_SIGNAL:Al}}=ae(),{normalizeEncoding:Xg}=ne(),{isAsyncFunction:Qg,isArrayBufferView:Zg}=ne().types,vl={};function eb(t){return t===(t|0)}function tb(t){return t===t>>>0}var rb=/^[0-7]+$/,nb="must be a 32-bit unsigned integer or an octal string";function ib(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Il(rb,t)===null)throw new jt(e,t,nb);t=Gg(t,8)}return Ol(t,e),t}var ob=pe((t,e,r=Hg,n=$g)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!ro(t))throw new ht(e,"an integer",t);if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)}),ab=pe((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!ro(t))throw new ht(e,"an integer",t);if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)}),Ol=pe((t,e,r=!1)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!ro(t))throw new ht(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new ht(e,`>= ${n} && <= ${i}`,t)});function no(t,e){if(typeof t!="string")throw new ie(e,"string",t)}function sb(t,e,r=void 0,n){if(typeof t!="number")throw new ie(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Wg(t))throw new ht(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var lb=pe((t,e,r)=>{if(!xl(r,t)){let i="must be one of: "+Tl(Ug(r,o=>typeof o=="string"?`'${o}'`:Kg(o)),", ");throw new jt(e,t,i)}});function Pl(t,e){if(typeof t!="boolean")throw new ie(e,"boolean",t)}function eo(t,e,r){return t==null||!Vg(t,e)?r:t[e]}var fb=pe((t,e,r=null)=>{let n=eo(r,"allowArray",!1),i=eo(r,"allowFunction",!1);if(!eo(r,"nullable",!1)&&t===null||!n&&to(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new ie(e,"Object",t)}),ub=pe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ie(e,"a dictionary",t)}),cn=pe((t,e,r=0)=>{if(!to(t))throw new ie(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new jt(e,t,n)}});function cb(t,e){cn(t,e);for(let r=0;r<t.length;r++)no(t[r],`${e}[${r}]`)}function db(t,e){cn(t,e);for(let r=0;r<t.length;r++)Pl(t[r],`${e}[${r}]`)}function hb(t,e){cn(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new ie(i,"AbortSignal",n);Bl(n,i)}}function pb(t,e="signal"){if(no(t,e),vl[t]===void 0)throw vl[zg(t)]!==void 0?new Al(t+" (signals must use all capital letters)"):new Al(t)}var yb=pe((t,e="buffer")=>{if(!Zg(t))throw new ie(e,["Buffer","TypedArray","DataView"],t)});function gb(t,e){let r=Xg(e),n=t.length;if(r==="hex"&&n%2!==0)throw new jt("encoding",e,`is invalid for data of length ${n}`)}function bb(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Yg(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Jg(e,t,r);return t|0}var Bl=pe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ie(e,"AbortSignal",t)}),wb=pe((t,e)=>{if(typeof t!="function")throw new ie(e,"Function",t)}),mb=pe((t,e)=>{if(typeof t!="function"||Qg(t))throw new ie(e,"Function",t)}),_b=pe((t,e)=>{if(t!==void 0)throw new ie(e,"undefined",t)});function Eb(t,e,r){if(!xl(r,t))throw new ie(e,`('${Tl(r,"|")}')`,t)}var Sb=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Rl(t,e){if(typeof t>"u"||!Il(Sb,t))throw new jt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ab(t){if(typeof t=="string")return Rl(t,"hints"),t;if(to(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Rl(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new jt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Ml.exports={isInt32:eb,isUint32:tb,parseFileMode:ib,validateArray:cn,validateStringArray:cb,validateBooleanArray:db,validateAbortSignalArray:hb,validateBoolean:Pl,validateBuffer:yb,validateDictionary:ub,validateEncoding:gb,validateFunction:wb,validateInt32:ab,validateInteger:ob,validateNumber:sb,validateObject:fb,validateOneOf:lb,validatePlainFunction:mb,validatePort:bb,validateSignalName:pb,validateString:no,validateUint32:Ol,validateUndefined:_b,validateUnion:Eb,validateAbortSignal:Bl,validateLinkHeaderValue:Ab}});var et=_((ZR,Nl)=>{u();var K=Nl.exports={},Ie,Oe;function io(){throw new Error("setTimeout has not been defined")}function oo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ie=setTimeout:Ie=io}catch{Ie=io}try{typeof clearTimeout=="function"?Oe=clearTimeout:Oe=oo}catch{Oe=oo}})();function kl(t){if(Ie===setTimeout)return setTimeout(t,0);if((Ie===io||!Ie)&&setTimeout)return Ie=setTimeout,setTimeout(t,0);try{return Ie(t,0)}catch{try{return Ie.call(null,t,0)}catch{return Ie.call(this,t,0)}}}function vb(t){if(Oe===clearTimeout)return clearTimeout(t);if((Oe===oo||!Oe)&&clearTimeout)return Oe=clearTimeout,clearTimeout(t);try{return Oe(t)}catch{try{return Oe.call(null,t)}catch{return Oe.call(this,t)}}}var Ue=[],Wt=!1,pt,dn=-1;function Rb(){!Wt||!pt||(Wt=!1,pt.length?Ue=pt.concat(Ue):dn=-1,Ue.length&&Ll())}function Ll(){if(!Wt){var t=kl(Rb);Wt=!0;for(var e=Ue.length;e;){for(pt=Ue,Ue=[];++dn