@elusion-sdk/auth
Version:
TypeScript OAuth client for SMS OTP authentication
2 lines • 705 kB
JavaScript
var M7=Object.create;var{getPrototypeOf:_7,defineProperty:u6,getOwnPropertyNames:z5,getOwnPropertyDescriptor:w7}=Object,G5=Object.prototype.hasOwnProperty;var y7=(m,_,R)=>{R=m!=null?M7(_7(m)):{};let A=_||!m||!m.__esModule?u6(R,"default",{value:m,enumerable:!0}):R;for(let W of z5(m))if(!G5.call(A,W))u6(A,W,{get:()=>m[W],enumerable:!0});return A},Z5=new WeakMap,g7=(m)=>{var _=Z5.get(m),R;if(_)return _;if(_=u6({},"__esModule",{value:!0}),m&&typeof m==="object"||typeof m==="function")z5(m).map((A)=>!G5.call(_,A)&&u6(_,A,{get:()=>m[A],enumerable:!(R=w7(m,A))||R.enumerable}));return Z5.set(m,_),_};var K5=(m,_)=>{for(var R in _)u6(m,R,{get:_[R],enumerable:!0,configurable:!0,set:(A)=>_[R]=()=>A})};var m7=(m,_)=>()=>(m&&(_=m(m=0)),_);var D7={};K5(D7,{webcrypto:()=>J5,timingSafeEqual:()=>a6,randomUUID:()=>$5,getRandomValues:()=>X5,getCurves:()=>H5,default:()=>T7,DEFAULT_ENCODING:()=>P7});function H5(){return D4}var p7,H9,b7,c7,d7,l7,E9=(m,_)=>()=>(m&&(_=m(m=0)),_),z0=(m,_)=>()=>(_||m((_={exports:{}}).exports,_),_.exports),J9=(m,_)=>{for(var R in _)H9(m,R,{get:_[R],enumerable:!0})},X9=(m,_,R,A)=>{if(_&&typeof _=="object"||typeof _=="function")for(let W of c7(_))!l7.call(m,W)&&W!==R&&H9(m,W,{get:()=>_[W],enumerable:!(A=b7(_,W))||A.enumerable});return m},S9=(m,_,R)=>(X9(m,_,"default"),R&&X9(R,_,"default")),x6=(m,_,R)=>(R=m!=null?p7(d7(m)):{},X9(_||!m||!m.__esModule?H9(R,"default",{value:m,enumerable:!0}):R,m)),D6=(m)=>X9(H9({},"__esModule",{value:!0}),m),h7,u7,C6,l0,b6,p0,A6,V5,U9,o7,O5,c6,C5,P5,T5,m6,x9,o6,R9,$9,A9,f7,a7,D5,N5,s7,n7,r7,L5,v9,M9,d6,i7,t7,I5,e7,k5,Q8,_9,V6,k6,w9,P6,Z9,F5,B6,q5,v6,M6,_6,X8,l6,y9,g9,$8,m9,B5,z9,R5,H8,q6,E5,S5,p9,J8,x5,U8,W5,b9,A5,Z8,S6,s6,z8,v5,M5,_5,G8,w5,y5,g5,m5,K8,p5,b5,N6,c9,c5,Y8,F8,W8,j8,V8,n6,O8,C8,P8,T8,D8,d5,j5,l5,d9,G9,N8,h5,u5,K9,L8,I8,l9,k8,q8,w6,o5,B8,R8,h9,f5,a5,E8,S8,x8,s5,A8,n5,h6,r5,i5,p6,u9,v8,M8,t5,e5,_8,w8,y8,o9,f9,g8,R6,Q7,L6,Y9,m8,p8,b8,X7,I6,r6,$7,c8,H7,d8,J7,l8,h8,u8,o8,a9,f8,s9,a8,s8,n8,r8,i8,t8,e8,n9,U7,r9,i9,f6,t9,e9,Z7,Q4,z7,G7,X4,K7,$4,H4,J4,Y7,U4,Z4,z4,G4,F9,F7,K4,Y4,F4,W4,j4,W7,j7,Q5,V7,V4,O4,C4,P4,O7,C7,T4,P7="buffer",X5=(m)=>crypto.getRandomValues(m),$5=()=>crypto.randomUUID(),D4,a6,J5,T7;var N7=m7(()=>{p7=Object.create,H9=Object.defineProperty,b7=Object.getOwnPropertyDescriptor,c7=Object.getOwnPropertyNames,d7=Object.getPrototypeOf,l7=Object.prototype.hasOwnProperty,h7=z0((m)=>{m.byteLength=D,m.toByteArray=O,m.fromByteArray=I;var _=[],R=[],A=typeof Uint8Array<"u"?Uint8Array:Array,W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(S=0,Z=W.length;S<Z;++S)_[S]=W[S],R[W.charCodeAt(S)]=S;var S,Z;R[45]=62,R[95]=63;function j(V){var N=V.length;if(N%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=V.indexOf("=");k===-1&&(k=N);var M=k===N?0:4-k%4;return[k,M]}function D(V){var N=j(V),k=N[0],M=N[1];return(k+M)*3/4-M}function C(V,N,k){return(N+k)*3/4-k}function O(V){var N,k=j(V),M=k[0],x=k[1],v=new A(C(V,M,x)),g=0,b=x>0?M-4:M,d;for(d=0;d<b;d+=4)N=R[V.charCodeAt(d)]<<18|R[V.charCodeAt(d+1)]<<12|R[V.charCodeAt(d+2)]<<6|R[V.charCodeAt(d+3)],v[g++]=N>>16&255,v[g++]=N>>8&255,v[g++]=N&255;return x===2&&(N=R[V.charCodeAt(d)]<<2|R[V.charCodeAt(d+1)]>>4,v[g++]=N&255),x===1&&(N=R[V.charCodeAt(d)]<<10|R[V.charCodeAt(d+1)]<<4|R[V.charCodeAt(d+2)]>>2,v[g++]=N>>8&255,v[g++]=N&255),v}function F(V){return _[V>>18&63]+_[V>>12&63]+_[V>>6&63]+_[V&63]}function T(V,N,k){for(var M,x=[],v=N;v<k;v+=3)M=(V[v]<<16&16711680)+(V[v+1]<<8&65280)+(V[v+2]&255),x.push(F(M));return x.join("")}function I(V){for(var N,k=V.length,M=k%3,x=[],v=16383,g=0,b=k-M;g<b;g+=v)x.push(T(V,g,g+v>b?b:g+v));return M===1?(N=V[k-1],x.push(_[N>>2]+_[N<<4&63]+"==")):M===2&&(N=(V[k-2]<<8)+V[k-1],x.push(_[N>>10]+_[N>>4&63]+_[N<<2&63]+"=")),x.join("")}}),u7=z0((m)=>{m.read=function(_,R,A,W,S){var Z,j,D=S*8-W-1,C=(1<<D)-1,O=C>>1,F=-7,T=A?S-1:0,I=A?-1:1,V=_[R+T];for(T+=I,Z=V&(1<<-F)-1,V>>=-F,F+=D;F>0;Z=Z*256+_[R+T],T+=I,F-=8);for(j=Z&(1<<-F)-1,Z>>=-F,F+=W;F>0;j=j*256+_[R+T],T+=I,F-=8);if(Z===0)Z=1-O;else{if(Z===C)return j?NaN:(V?-1:1)*(1/0);j=j+Math.pow(2,W),Z=Z-O}return(V?-1:1)*j*Math.pow(2,Z-W)},m.write=function(_,R,A,W,S,Z){var j,D,C,O=Z*8-S-1,F=(1<<O)-1,T=F>>1,I=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,V=W?0:Z-1,N=W?1:-1,k=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(D=isNaN(R)?1:0,j=F):(j=Math.floor(Math.log(R)/Math.LN2),R*(C=Math.pow(2,-j))<1&&(j--,C*=2),j+T>=1?R+=I/C:R+=I*Math.pow(2,1-T),R*C>=2&&(j++,C/=2),j+T>=F?(D=0,j=F):j+T>=1?(D=(R*C-1)*Math.pow(2,S),j=j+T):(D=R*Math.pow(2,T-1)*Math.pow(2,S),j=0));S>=8;_[A+V]=D&255,V+=N,D/=256,S-=8);for(j=j<<S|D,O+=S;O>0;_[A+V]=j&255,V+=N,j/=256,O-=8);_[A+V-N]|=k*128}}),C6=z0((m)=>{var _=h7(),R=u7(),A=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;m.Buffer=j,m.SlowBuffer=x,m.INSPECT_MAX_BYTES=50;var W=2147483647;m.kMaxLength=W,j.TYPED_ARRAY_SUPPORT=S(),!j.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 S(){try{let P=new Uint8Array(1),B={foo:function(){return 42}};return Object.setPrototypeOf(B,Uint8Array.prototype),Object.setPrototypeOf(P,B),P.foo()===42}catch{return!1}}Object.defineProperty(j.prototype,"parent",{enumerable:!0,get:function(){if(j.isBuffer(this))return this.buffer}}),Object.defineProperty(j.prototype,"offset",{enumerable:!0,get:function(){if(j.isBuffer(this))return this.byteOffset}});function Z(P){if(P>W)throw new RangeError('The value "'+P+'" is invalid for option "size"');let B=new Uint8Array(P);return Object.setPrototypeOf(B,j.prototype),B}function j(P,B,c){if(typeof P=="number"){if(typeof B=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return F(P)}return D(P,B,c)}j.poolSize=8192;function D(P,B,c){if(typeof P=="string")return T(P,B);if(ArrayBuffer.isView(P))return V(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(G0(P,ArrayBuffer)||P&&G0(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(G0(P,SharedArrayBuffer)||P&&G0(P.buffer,SharedArrayBuffer)))return N(P,B,c);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let h=P.valueOf&&P.valueOf();if(h!=null&&h!==P)return j.from(h,B,c);let o=k(P);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return j.from(P[Symbol.toPrimitive]("string"),B,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}j.from=function(P,B,c){return D(P,B,c)},Object.setPrototypeOf(j.prototype,Uint8Array.prototype),Object.setPrototypeOf(j,Uint8Array);function C(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function O(P,B,c){return C(P),P<=0?Z(P):B!==void 0?typeof c=="string"?Z(P).fill(B,c):Z(P).fill(B):Z(P)}j.alloc=function(P,B,c){return O(P,B,c)};function F(P){return C(P),Z(P<0?0:M(P)|0)}j.allocUnsafe=function(P){return F(P)},j.allocUnsafeSlow=function(P){return F(P)};function T(P,B){if((typeof B!="string"||B==="")&&(B="utf8"),!j.isEncoding(B))throw new TypeError("Unknown encoding: "+B);let c=v(P,B)|0,h=Z(c),o=h.write(P,B);return o!==c&&(h=h.slice(0,o)),h}function I(P){let B=P.length<0?0:M(P.length)|0,c=Z(B);for(let h=0;h<B;h+=1)c[h]=P[h]&255;return c}function V(P){if(G0(P,Uint8Array)){let B=new Uint8Array(P);return N(B.buffer,B.byteOffset,B.byteLength)}return I(P)}function N(P,B,c){if(B<0||P.byteLength<B)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<B+(c||0))throw new RangeError('"length" is outside of buffer bounds');let h;return B===void 0&&c===void 0?h=new Uint8Array(P):c===void 0?h=new Uint8Array(P,B):h=new Uint8Array(P,B,c),Object.setPrototypeOf(h,j.prototype),h}function k(P){if(j.isBuffer(P)){let B=M(P.length)|0,c=Z(B);return c.length===0||P.copy(c,0,0,B),c}if(P.length!==void 0)return typeof P.length!="number"||w0(P.length)?Z(0):I(P);if(P.type==="Buffer"&&Array.isArray(P.data))return I(P.data)}function M(P){if(P>=W)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W.toString(16)+" bytes");return P|0}function x(P){return+P!=P&&(P=0),j.alloc(+P)}j.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==j.prototype},j.compare=function(P,B){if(G0(P,Uint8Array)&&(P=j.from(P,P.offset,P.byteLength)),G0(B,Uint8Array)&&(B=j.from(B,B.offset,B.byteLength)),!j.isBuffer(P)||!j.isBuffer(B))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===B)return 0;let c=P.length,h=B.length;for(let o=0,C0=Math.min(c,h);o<C0;++o)if(P[o]!==B[o]){c=P[o],h=B[o];break}return c<h?-1:h<c?1:0},j.isEncoding=function(P){switch(String(P).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}},j.concat=function(P,B){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return j.alloc(0);let c;if(B===void 0)for(B=0,c=0;c<P.length;++c)B+=P[c].length;let h=j.allocUnsafe(B),o=0;for(c=0;c<P.length;++c){let C0=P[c];if(G0(C0,Uint8Array))o+C0.length>h.length?(j.isBuffer(C0)||(C0=j.from(C0)),C0.copy(h,o)):Uint8Array.prototype.set.call(h,C0,o);else if(j.isBuffer(C0))C0.copy(h,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=C0.length}return h};function v(P,B){if(j.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||G0(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let c=P.length,h=arguments.length>2&&arguments[2]===!0;if(!h&&c===0)return 0;let o=!1;for(;;)switch(B){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return e(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return _0(P).length;default:if(o)return h?-1:e(P).length;B=(""+B).toLowerCase(),o=!0}}j.byteLength=v;function g(P,B,c){let h=!1;if((B===void 0||B<0)&&(B=0),B>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,B>>>=0,c<=B))return"";for(P||(P="utf8");;)switch(P){case"hex":return z(this,B,c);case"utf8":case"utf-8":return J(this,B,c);case"ascii":return K(this,B,c);case"latin1":case"binary":return Y(this,B,c);case"base64":return $(this,B,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,B,c);default:if(h)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),h=!0}}j.prototype._isBuffer=!0;function b(P,B,c){let h=P[B];P[B]=P[c],P[c]=h}j.prototype.swap16=function(){let P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let B=0;B<P;B+=2)b(this,B,B+1);return this},j.prototype.swap32=function(){let P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let B=0;B<P;B+=4)b(this,B,B+3),b(this,B+1,B+2);return this},j.prototype.swap64=function(){let P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let B=0;B<P;B+=8)b(this,B,B+7),b(this,B+1,B+6),b(this,B+2,B+5),b(this,B+3,B+4);return this},j.prototype.toString=function(){let P=this.length;return P===0?"":arguments.length===0?J(this,0,P):g.apply(this,arguments)},j.prototype.toLocaleString=j.prototype.toString,j.prototype.equals=function(P){if(!j.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:j.compare(this,P)===0},j.prototype.inspect=function(){let P="",B=m.INSPECT_MAX_BYTES;return P=this.toString("hex",0,B).replace(/(.{2})/g,"$1 ").trim(),this.length>B&&(P+=" ... "),"<Buffer "+P+">"},A&&(j.prototype[A]=j.prototype.inspect),j.prototype.compare=function(P,B,c,h,o){if(G0(P,Uint8Array)&&(P=j.from(P,P.offset,P.byteLength)),!j.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(B===void 0&&(B=0),c===void 0&&(c=P?P.length:0),h===void 0&&(h=0),o===void 0&&(o=this.length),B<0||c>P.length||h<0||o>this.length)throw new RangeError("out of range index");if(h>=o&&B>=c)return 0;if(h>=o)return-1;if(B>=c)return 1;if(B>>>=0,c>>>=0,h>>>=0,o>>>=0,this===P)return 0;let C0=o-h,J0=c-B,F0=Math.min(C0,J0),b0=this.slice(h,o),j0=P.slice(B,c);for(let W0=0;W0<F0;++W0)if(b0[W0]!==j0[W0]){C0=b0[W0],J0=j0[W0];break}return C0<J0?-1:J0<C0?1:0};function d(P,B,c,h,o){if(P.length===0)return-1;if(typeof c=="string"?(h=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,w0(c)&&(c=o?0:P.length-1),c<0&&(c=P.length+c),c>=P.length){if(o)return-1;c=P.length-1}else if(c<0)if(o)c=0;else return-1;if(typeof B=="string"&&(B=j.from(B,h)),j.isBuffer(B))return B.length===0?-1:n(P,B,c,h,o);if(typeof B=="number")return B=B&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(P,B,c):Uint8Array.prototype.lastIndexOf.call(P,B,c):n(P,[B],c,h,o);throw new TypeError("val must be string, number or Buffer")}function n(P,B,c,h,o){let C0=1,J0=P.length,F0=B.length;if(h!==void 0&&(h=String(h).toLowerCase(),h==="ucs2"||h==="ucs-2"||h==="utf16le"||h==="utf-16le")){if(P.length<2||B.length<2)return-1;C0=2,J0/=2,F0/=2,c/=2}function b0(W0,y0){return C0===1?W0[y0]:W0.readUInt16BE(y0*C0)}let j0;if(o){let W0=-1;for(j0=c;j0<J0;j0++)if(b0(P,j0)===b0(B,W0===-1?0:j0-W0)){if(W0===-1&&(W0=j0),j0-W0+1===F0)return W0*C0}else W0!==-1&&(j0-=j0-W0),W0=-1}else for(c+F0>J0&&(c=J0-F0),j0=c;j0>=0;j0--){let W0=!0;for(let y0=0;y0<F0;y0++)if(b0(P,j0+y0)!==b0(B,y0)){W0=!1;break}if(W0)return j0}return-1}j.prototype.includes=function(P,B,c){return this.indexOf(P,B,c)!==-1},j.prototype.indexOf=function(P,B,c){return d(this,P,B,c,!0)},j.prototype.lastIndexOf=function(P,B,c){return d(this,P,B,c,!1)};function i(P,B,c,h){c=Number(c)||0;let o=P.length-c;h?(h=Number(h),h>o&&(h=o)):h=o;let C0=B.length;h>C0/2&&(h=C0/2);let J0;for(J0=0;J0<h;++J0){let F0=parseInt(B.substr(J0*2,2),16);if(w0(F0))return J0;P[c+J0]=F0}return J0}function H0(P,B,c,h){return Z0(e(B,P.length-c),P,c,h)}function s(P,B,c,h){return Z0(X0(B),P,c,h)}function K0(P,B,c,h){return Z0(_0(B),P,c,h)}function Q(P,B,c,h){return Z0(t(B,P.length-c),P,c,h)}j.prototype.write=function(P,B,c,h){if(B===void 0)h="utf8",c=this.length,B=0;else if(c===void 0&&typeof B=="string")h=B,c=this.length,B=0;else if(isFinite(B))B=B>>>0,isFinite(c)?(c=c>>>0,h===void 0&&(h="utf8")):(h=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-B;if((c===void 0||c>o)&&(c=o),P.length>0&&(c<0||B<0)||B>this.length)throw new RangeError("Attempt to write outside buffer bounds");h||(h="utf8");let C0=!1;for(;;)switch(h){case"hex":return i(this,P,B,c);case"utf8":case"utf-8":return H0(this,P,B,c);case"ascii":case"latin1":case"binary":return s(this,P,B,c);case"base64":return K0(this,P,B,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,P,B,c);default:if(C0)throw new TypeError("Unknown encoding: "+h);h=(""+h).toLowerCase(),C0=!0}},j.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(P,B,c){return B===0&&c===P.length?_.fromByteArray(P):_.fromByteArray(P.slice(B,c))}function J(P,B,c){c=Math.min(P.length,c);let h=[],o=B;for(;o<c;){let C0=P[o],J0=null,F0=C0>239?4:C0>223?3:C0>191?2:1;if(o+F0<=c){let b0,j0,W0,y0;switch(F0){case 1:C0<128&&(J0=C0);break;case 2:b0=P[o+1],(b0&192)===128&&(y0=(C0&31)<<6|b0&63,y0>127&&(J0=y0));break;case 3:b0=P[o+1],j0=P[o+2],(b0&192)===128&&(j0&192)===128&&(y0=(C0&15)<<12|(b0&63)<<6|j0&63,y0>2047&&(y0<55296||y0>57343)&&(J0=y0));break;case 4:b0=P[o+1],j0=P[o+2],W0=P[o+3],(b0&192)===128&&(j0&192)===128&&(W0&192)===128&&(y0=(C0&15)<<18|(b0&63)<<12|(j0&63)<<6|W0&63,y0>65535&&y0<1114112&&(J0=y0))}}J0===null?(J0=65533,F0=1):J0>65535&&(J0-=65536,h.push(J0>>>10&1023|55296),J0=56320|J0&1023),h.push(J0),o+=F0}return U(h)}var H=4096;function U(P){let B=P.length;if(B<=H)return String.fromCharCode.apply(String,P);let c="",h=0;for(;h<B;)c+=String.fromCharCode.apply(String,P.slice(h,h+=H));return c}function K(P,B,c){let h="";c=Math.min(P.length,c);for(let o=B;o<c;++o)h+=String.fromCharCode(P[o]&127);return h}function Y(P,B,c){let h="";c=Math.min(P.length,c);for(let o=B;o<c;++o)h+=String.fromCharCode(P[o]);return h}function z(P,B,c){let h=P.length;(!B||B<0)&&(B=0),(!c||c<0||c>h)&&(c=h);let o="";for(let C0=B;C0<c;++C0)o+=V0[P[C0]];return o}function X(P,B,c){let h=P.slice(B,c),o="";for(let C0=0;C0<h.length-1;C0+=2)o+=String.fromCharCode(h[C0]+h[C0+1]*256);return o}j.prototype.slice=function(P,B){let c=this.length;P=~~P,B=B===void 0?c:~~B,P<0?(P+=c,P<0&&(P=0)):P>c&&(P=c),B<0?(B+=c,B<0&&(B=0)):B>c&&(B=c),B<P&&(B=P);let h=this.subarray(P,B);return Object.setPrototypeOf(h,j.prototype),h};function G(P,B,c){if(P%1!==0||P<0)throw new RangeError("offset is not uint");if(P+B>c)throw new RangeError("Trying to access beyond buffer length")}j.prototype.readUintLE=j.prototype.readUIntLE=function(P,B,c){P=P>>>0,B=B>>>0,c||G(P,B,this.length);let h=this[P],o=1,C0=0;for(;++C0<B&&(o*=256);)h+=this[P+C0]*o;return h},j.prototype.readUintBE=j.prototype.readUIntBE=function(P,B,c){P=P>>>0,B=B>>>0,c||G(P,B,this.length);let h=this[P+--B],o=1;for(;B>0&&(o*=256);)h+=this[P+--B]*o;return h},j.prototype.readUint8=j.prototype.readUInt8=function(P,B){return P=P>>>0,B||G(P,1,this.length),this[P]},j.prototype.readUint16LE=j.prototype.readUInt16LE=function(P,B){return P=P>>>0,B||G(P,2,this.length),this[P]|this[P+1]<<8},j.prototype.readUint16BE=j.prototype.readUInt16BE=function(P,B){return P=P>>>0,B||G(P,2,this.length),this[P]<<8|this[P+1]},j.prototype.readUint32LE=j.prototype.readUInt32LE=function(P,B){return P=P>>>0,B||G(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},j.prototype.readUint32BE=j.prototype.readUInt32BE=function(P,B){return P=P>>>0,B||G(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},j.prototype.readBigUInt64LE=Y0(function(P){P=P>>>0,U0(P,"offset");let B=this[P],c=this[P+7];(B===void 0||c===void 0)&&y(P,this.length-8);let h=B+this[++P]*256+this[++P]*65536+this[++P]*16777216,o=this[++P]+this[++P]*256+this[++P]*65536+c*16777216;return BigInt(h)+(BigInt(o)<<BigInt(32))}),j.prototype.readBigUInt64BE=Y0(function(P){P=P>>>0,U0(P,"offset");let B=this[P],c=this[P+7];(B===void 0||c===void 0)&&y(P,this.length-8);let h=B*16777216+this[++P]*65536+this[++P]*256+this[++P],o=this[++P]*16777216+this[++P]*65536+this[++P]*256+c;return(BigInt(h)<<BigInt(32))+BigInt(o)}),j.prototype.readIntLE=function(P,B,c){P=P>>>0,B=B>>>0,c||G(P,B,this.length);let h=this[P],o=1,C0=0;for(;++C0<B&&(o*=256);)h+=this[P+C0]*o;return o*=128,h>=o&&(h-=Math.pow(2,8*B)),h},j.prototype.readIntBE=function(P,B,c){P=P>>>0,B=B>>>0,c||G(P,B,this.length);let h=B,o=1,C0=this[P+--h];for(;h>0&&(o*=256);)C0+=this[P+--h]*o;return o*=128,C0>=o&&(C0-=Math.pow(2,8*B)),C0},j.prototype.readInt8=function(P,B){return P=P>>>0,B||G(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},j.prototype.readInt16LE=function(P,B){P=P>>>0,B||G(P,2,this.length);let c=this[P]|this[P+1]<<8;return c&32768?c|4294901760:c},j.prototype.readInt16BE=function(P,B){P=P>>>0,B||G(P,2,this.length);let c=this[P+1]|this[P]<<8;return c&32768?c|4294901760:c},j.prototype.readInt32LE=function(P,B){return P=P>>>0,B||G(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},j.prototype.readInt32BE=function(P,B){return P=P>>>0,B||G(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},j.prototype.readBigInt64LE=Y0(function(P){P=P>>>0,U0(P,"offset");let B=this[P],c=this[P+7];(B===void 0||c===void 0)&&y(P,this.length-8);let h=this[P+4]+this[P+5]*256+this[P+6]*65536+(c<<24);return(BigInt(h)<<BigInt(32))+BigInt(B+this[++P]*256+this[++P]*65536+this[++P]*16777216)}),j.prototype.readBigInt64BE=Y0(function(P){P=P>>>0,U0(P,"offset");let B=this[P],c=this[P+7];(B===void 0||c===void 0)&&y(P,this.length-8);let h=(B<<24)+this[++P]*65536+this[++P]*256+this[++P];return(BigInt(h)<<BigInt(32))+BigInt(this[++P]*16777216+this[++P]*65536+this[++P]*256+c)}),j.prototype.readFloatLE=function(P,B){return P=P>>>0,B||G(P,4,this.length),R.read(this,P,!0,23,4)},j.prototype.readFloatBE=function(P,B){return P=P>>>0,B||G(P,4,this.length),R.read(this,P,!1,23,4)},j.prototype.readDoubleLE=function(P,B){return P=P>>>0,B||G(P,8,this.length),R.read(this,P,!0,52,8)},j.prototype.readDoubleBE=function(P,B){return P=P>>>0,B||G(P,8,this.length),R.read(this,P,!1,52,8)};function E(P,B,c,h,o,C0){if(!j.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(B>o||B<C0)throw new RangeError('"value" argument is out of bounds');if(c+h>P.length)throw new RangeError("Index out of range")}j.prototype.writeUintLE=j.prototype.writeUIntLE=function(P,B,c,h){if(P=+P,B=B>>>0,c=c>>>0,!h){let J0=Math.pow(2,8*c)-1;E(this,P,B,c,J0,0)}let o=1,C0=0;for(this[B]=P&255;++C0<c&&(o*=256);)this[B+C0]=P/o&255;return B+c},j.prototype.writeUintBE=j.prototype.writeUIntBE=function(P,B,c,h){if(P=+P,B=B>>>0,c=c>>>0,!h){let J0=Math.pow(2,8*c)-1;E(this,P,B,c,J0,0)}let o=c-1,C0=1;for(this[B+o]=P&255;--o>=0&&(C0*=256);)this[B+o]=P/C0&255;return B+c},j.prototype.writeUint8=j.prototype.writeUInt8=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,1,255,0),this[B]=P&255,B+1},j.prototype.writeUint16LE=j.prototype.writeUInt16LE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,2,65535,0),this[B]=P&255,this[B+1]=P>>>8,B+2},j.prototype.writeUint16BE=j.prototype.writeUInt16BE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,2,65535,0),this[B]=P>>>8,this[B+1]=P&255,B+2},j.prototype.writeUint32LE=j.prototype.writeUInt32LE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,4,4294967295,0),this[B+3]=P>>>24,this[B+2]=P>>>16,this[B+1]=P>>>8,this[B]=P&255,B+4},j.prototype.writeUint32BE=j.prototype.writeUInt32BE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,4,4294967295,0),this[B]=P>>>24,this[B+1]=P>>>16,this[B+2]=P>>>8,this[B+3]=P&255,B+4};function L(P,B,c,h,o){Q0(B,h,o,P,c,7);let C0=Number(B&BigInt(4294967295));P[c++]=C0,C0=C0>>8,P[c++]=C0,C0=C0>>8,P[c++]=C0,C0=C0>>8,P[c++]=C0;let J0=Number(B>>BigInt(32)&BigInt(4294967295));return P[c++]=J0,J0=J0>>8,P[c++]=J0,J0=J0>>8,P[c++]=J0,J0=J0>>8,P[c++]=J0,c}function w(P,B,c,h,o){Q0(B,h,o,P,c,7);let C0=Number(B&BigInt(4294967295));P[c+7]=C0,C0=C0>>8,P[c+6]=C0,C0=C0>>8,P[c+5]=C0,C0=C0>>8,P[c+4]=C0;let J0=Number(B>>BigInt(32)&BigInt(4294967295));return P[c+3]=J0,J0=J0>>8,P[c+2]=J0,J0=J0>>8,P[c+1]=J0,J0=J0>>8,P[c]=J0,c+8}j.prototype.writeBigUInt64LE=Y0(function(P,B=0){return L(this,P,B,BigInt(0),BigInt("0xffffffffffffffff"))}),j.prototype.writeBigUInt64BE=Y0(function(P,B=0){return w(this,P,B,BigInt(0),BigInt("0xffffffffffffffff"))}),j.prototype.writeIntLE=function(P,B,c,h){if(P=+P,B=B>>>0,!h){let F0=Math.pow(2,8*c-1);E(this,P,B,c,F0-1,-F0)}let o=0,C0=1,J0=0;for(this[B]=P&255;++o<c&&(C0*=256);)P<0&&J0===0&&this[B+o-1]!==0&&(J0=1),this[B+o]=(P/C0>>0)-J0&255;return B+c},j.prototype.writeIntBE=function(P,B,c,h){if(P=+P,B=B>>>0,!h){let F0=Math.pow(2,8*c-1);E(this,P,B,c,F0-1,-F0)}let o=c-1,C0=1,J0=0;for(this[B+o]=P&255;--o>=0&&(C0*=256);)P<0&&J0===0&&this[B+o+1]!==0&&(J0=1),this[B+o]=(P/C0>>0)-J0&255;return B+c},j.prototype.writeInt8=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,1,127,-128),P<0&&(P=255+P+1),this[B]=P&255,B+1},j.prototype.writeInt16LE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,2,32767,-32768),this[B]=P&255,this[B+1]=P>>>8,B+2},j.prototype.writeInt16BE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,2,32767,-32768),this[B]=P>>>8,this[B+1]=P&255,B+2},j.prototype.writeInt32LE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,4,2147483647,-2147483648),this[B]=P&255,this[B+1]=P>>>8,this[B+2]=P>>>16,this[B+3]=P>>>24,B+4},j.prototype.writeInt32BE=function(P,B,c){return P=+P,B=B>>>0,c||E(this,P,B,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[B]=P>>>24,this[B+1]=P>>>16,this[B+2]=P>>>8,this[B+3]=P&255,B+4},j.prototype.writeBigInt64LE=Y0(function(P,B=0){return L(this,P,B,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),j.prototype.writeBigInt64BE=Y0(function(P,B=0){return w(this,P,B,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function f(P,B,c,h,o,C0){if(c+h>P.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function r(P,B,c,h,o){return B=+B,c=c>>>0,o||f(P,B,c,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000),R.write(P,B,c,h,23,4),c+4}j.prototype.writeFloatLE=function(P,B,c){return r(this,P,B,!0,c)},j.prototype.writeFloatBE=function(P,B,c){return r(this,P,B,!1,c)};function $0(P,B,c,h,o){return B=+B,c=c>>>0,o||f(P,B,c,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000),R.write(P,B,c,h,52,8),c+8}j.prototype.writeDoubleLE=function(P,B,c){return $0(this,P,B,!0,c)},j.prototype.writeDoubleBE=function(P,B,c){return $0(this,P,B,!1,c)},j.prototype.copy=function(P,B,c,h){if(!j.isBuffer(P))throw new TypeError("argument should be a Buffer");if(c||(c=0),!h&&h!==0&&(h=this.length),B>=P.length&&(B=P.length),B||(B=0),h>0&&h<c&&(h=c),h===c||P.length===0||this.length===0)return 0;if(B<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("sourceEnd out of bounds");h>this.length&&(h=this.length),P.length-B<h-c&&(h=P.length-B+c);let o=h-c;return this===P&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(B,c,h):Uint8Array.prototype.set.call(P,this.subarray(c,h),B),o},j.prototype.fill=function(P,B,c,h){if(typeof P=="string"){if(typeof B=="string"?(h=B,B=0,c=this.length):typeof c=="string"&&(h=c,c=this.length),h!==void 0&&typeof h!="string")throw new TypeError("encoding must be a string");if(typeof h=="string"&&!j.isEncoding(h))throw new TypeError("Unknown encoding: "+h);if(P.length===1){let C0=P.charCodeAt(0);(h==="utf8"&&C0<128||h==="latin1")&&(P=C0)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(B<0||this.length<B||this.length<c)throw new RangeError("Out of range index");if(c<=B)return this;B=B>>>0,c=c===void 0?this.length:c>>>0,P||(P=0);let o;if(typeof P=="number")for(o=B;o<c;++o)this[o]=P;else{let C0=j.isBuffer(P)?P:j.from(P,h),J0=C0.length;if(J0===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(o=0;o<c-B;++o)this[o+B]=C0[o%J0]}return this};var u={};function l(P,B,c){u[P]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:B.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,this.stack,delete this.name}get code(){return P}set code(h){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:h,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}l("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),l("ERR_INVALID_ARG_TYPE",function(P,B){return`The "${P}" argument must be of type number. Received type ${typeof B}`},TypeError),l("ERR_OUT_OF_RANGE",function(P,B,c){let h=`The value of "${P}" is out of range.`,o=c;return Number.isInteger(c)&&Math.abs(c)>4294967296?o=a(String(c)):typeof c=="bigint"&&(o=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(o=a(o)),o+="n"),h+=` It must be ${B}. Received ${o}`,h},RangeError);function a(P){let B="",c=P.length,h=P[0]==="-"?1:0;for(;c>=h+4;c-=3)B=`_${P.slice(c-3,c)}${B}`;return`${P.slice(0,c)}${B}`}function O0(P,B,c){U0(B,"offset"),(P[B]===void 0||P[B+c]===void 0)&&y(B,P.length-(c+1))}function Q0(P,B,c,h,o,C0){if(P>c||P<B){let J0=typeof B=="bigint"?"n":"",F0;throw C0>3?B===0||B===BigInt(0)?F0=`>= 0${J0} and < 2${J0} ** ${(C0+1)*8}${J0}`:F0=`>= -(2${J0} ** ${(C0+1)*8-1}${J0}) and < 2 ** ${(C0+1)*8-1}${J0}`:F0=`>= ${B}${J0} and <= ${c}${J0}`,new u.ERR_OUT_OF_RANGE("value",F0,P)}O0(h,o,C0)}function U0(P,B){if(typeof P!="number")throw new u.ERR_INVALID_ARG_TYPE(B,"number",P)}function y(P,B,c){throw Math.floor(P)!==P?(U0(P,c),new u.ERR_OUT_OF_RANGE(c||"offset","an integer",P)):B<0?new u.ERR_BUFFER_OUT_OF_BOUNDS:new u.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${B}`,P)}var q=/[^+/0-9A-Za-z-_]/g;function p(P){if(P=P.split("=")[0],P=P.trim().replace(q,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function e(P,B){B=B||1/0;let c,h=P.length,o=null,C0=[];for(let J0=0;J0<h;++J0){if(c=P.charCodeAt(J0),c>55295&&c<57344){if(!o){if(c>56319){(B-=3)>-1&&C0.push(239,191,189);continue}else if(J0+1===h){(B-=3)>-1&&C0.push(239,191,189);continue}o=c;continue}if(c<56320){(B-=3)>-1&&C0.push(239,191,189),o=c;continue}c=(o-55296<<10|c-56320)+65536}else o&&(B-=3)>-1&&C0.push(239,191,189);if(o=null,c<128){if((B-=1)<0)break;C0.push(c)}else if(c<2048){if((B-=2)<0)break;C0.push(c>>6|192,c&63|128)}else if(c<65536){if((B-=3)<0)break;C0.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((B-=4)<0)break;C0.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return C0}function X0(P){let B=[];for(let c=0;c<P.length;++c)B.push(P.charCodeAt(c)&255);return B}function t(P,B){let c,h,o,C0=[];for(let J0=0;J0<P.length&&!((B-=2)<0);++J0)c=P.charCodeAt(J0),h=c>>8,o=c%256,C0.push(o),C0.push(h);return C0}function _0(P){return _.toByteArray(p(P))}function Z0(P,B,c,h){let o;for(o=0;o<h&&!(o+c>=B.length||o>=P.length);++o)B[o+c]=P[o];return o}function G0(P,B){return P instanceof B||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===B.name}function w0(P){return P!==P}var V0=function(){let P="0123456789abcdef",B=new Array(256);for(let c=0;c<16;++c){let h=c*16;for(let o=0;o<16;++o)B[h+o]=P[c]+P[o]}return B}();function Y0(P){return typeof BigInt>"u"?d0:P}function d0(){throw new Error("BigInt not supported")}}),l0=z0((m,_)=>{var R=C6(),A=R.Buffer;function W(Z,j){for(var D in Z)j[D]=Z[D]}A.from&&A.alloc&&A.allocUnsafe&&A.allocUnsafeSlow?_.exports=R:(W(R,m),m.Buffer=S);function S(Z,j,D){return A(Z,j,D)}S.prototype=Object.create(A.prototype),W(A,S),S.from=function(Z,j,D){if(typeof Z=="number")throw new TypeError("Argument must not be a number");return A(Z,j,D)},S.alloc=function(Z,j,D){if(typeof Z!="number")throw new TypeError("Argument must be a number");var C=A(Z);return j!==void 0?typeof D=="string"?C.fill(j,D):C.fill(j):C.fill(0),C},S.allocUnsafe=function(Z){if(typeof Z!="number")throw new TypeError("Argument must be a number");return A(Z)},S.allocUnsafeSlow=function(Z){if(typeof Z!="number")throw new TypeError("Argument must be a number");return R.SlowBuffer(Z)}}),b6=z0((m,_)=>{var R=65536,A=4294967295;function W(){throw new Error(`Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11`)}var S=l0().Buffer,Z=global.crypto||global.msCrypto;Z&&Z.getRandomValues?_.exports=j:_.exports=W;function j(D,C){if(D>A)throw new RangeError("requested too many random bytes");var O=S.allocUnsafe(D);if(D>0)if(D>R)for(var F=0;F<D;F+=R)Z.getRandomValues(O.slice(F,F+R));else Z.getRandomValues(O);return typeof C=="function"?process.nextTick(function(){C(null,O)}):O}}),p0=z0((m,_)=>{typeof Object.create=="function"?_.exports=function(R,A){A&&(R.super_=A,R.prototype=Object.create(A.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}))}:_.exports=function(R,A){if(A){R.super_=A;var W=function(){};W.prototype=A.prototype,R.prototype=new W,R.prototype.constructor=R}}}),A6=z0((m,_)=>{var R=typeof Reflect=="object"?Reflect:null,A=R&&typeof R.apply=="function"?R.apply:function(d,n,i){return Function.prototype.apply.call(d,n,i)},W;R&&typeof R.ownKeys=="function"?W=R.ownKeys:Object.getOwnPropertySymbols?W=function(d){return Object.getOwnPropertyNames(d).concat(Object.getOwnPropertySymbols(d))}:W=function(d){return Object.getOwnPropertyNames(d)};function S(d){console&&console.warn&&console.warn(d)}var Z=Number.isNaN||function(d){return d!==d};function j(){j.init.call(this)}_.exports=j,_.exports.once=v,j.EventEmitter=j,j.prototype._events=void 0,j.prototype._eventsCount=0,j.prototype._maxListeners=void 0;var D=10;function C(d){if(typeof d!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof d)}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return D},set:function(d){if(typeof d!="number"||d<0||Z(d))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+d+".");D=d}}),j.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},j.prototype.setMaxListeners=function(d){if(typeof d!="number"||d<0||Z(d))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+d+".");return this._maxListeners=d,this};function O(d){return d._maxListeners===void 0?j.defaultMaxListeners:d._maxListeners}j.prototype.getMaxListeners=function(){return O(this)},j.prototype.emit=function(d){for(var n=[],i=1;i<arguments.length;i++)n.push(arguments[i]);var H0=d==="error",s=this._events;if(s!==void 0)H0=H0&&s.error===void 0;else if(!H0)return!1;if(H0){var K0;if(n.length>0&&(K0=n[0]),K0 instanceof Error)throw K0;var Q=new Error("Unhandled error."+(K0?" ("+K0.message+")":""));throw Q.context=K0,Q}var $=s[d];if($===void 0)return!1;if(typeof $=="function")A($,this,n);else for(var J=$.length,H=k($,J),i=0;i<J;++i)A(H[i],this,n);return!0};function F(d,n,i,H0){var s,K0,Q;if(C(i),K0=d._events,K0===void 0?(K0=d._events=Object.create(null),d._eventsCount=0):(K0.newListener!==void 0&&(d.emit("newListener",n,i.listener?i.listener:i),K0=d._events),Q=K0[n]),Q===void 0)Q=K0[n]=i,++d._eventsCount;else if(typeof Q=="function"?Q=K0[n]=H0?[i,Q]:[Q,i]:H0?Q.unshift(i):Q.push(i),s=O(d),s>0&&Q.length>s&&!Q.warned){Q.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+Q.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=d,$.type=n,$.count=Q.length,S($)}return d}j.prototype.addListener=function(d,n){return F(this,d,n,!1)},j.prototype.on=j.prototype.addListener,j.prototype.prependListener=function(d,n){return F(this,d,n,!0)};function T(){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 I(d,n,i){var H0={fired:!1,wrapFn:void 0,target:d,type:n,listener:i},s=T.bind(H0);return s.listener=i,H0.wrapFn=s,s}j.prototype.once=function(d,n){return C(n),this.on(d,I(this,d,n)),this},j.prototype.prependOnceListener=function(d,n){return C(n),this.prependListener(d,I(this,d,n)),this},j.prototype.removeListener=function(d,n){var i,H0,s,K0,Q;if(C(n),H0=this._events,H0===void 0)return this;if(i=H0[d],i===void 0)return this;if(i===n||i.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete H0[d],H0.removeListener&&this.emit("removeListener",d,i.listener||n));else if(typeof i!="function"){for(s=-1,K0=i.length-1;K0>=0;K0--)if(i[K0]===n||i[K0].listener===n){Q=i[K0].listener,s=K0;break}if(s<0)return this;s===0?i.shift():M(i,s),i.length===1&&(H0[d]=i[0]),H0.removeListener!==void 0&&this.emit("removeListener",d,Q||n)}return this},j.prototype.off=j.prototype.removeListener,j.prototype.removeAllListeners=function(d){var n,i,H0;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[d]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[d]),this;if(arguments.length===0){var s=Object.keys(i),K0;for(H0=0;H0<s.length;++H0)K0=s[H0],K0!=="removeListener"&&this.removeAllListeners(K0);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=i[d],typeof n=="function")this.removeListener(d,n);else if(n!==void 0)for(H0=n.length-1;H0>=0;H0--)this.removeListener(d,n[H0]);return this};function V(d,n,i){var H0=d._events;if(H0===void 0)return[];var s=H0[n];return s===void 0?[]:typeof s=="function"?i?[s.listener||s]:[s]:i?x(s):k(s,s.length)}j.prototype.listeners=function(d){return V(this,d,!0)},j.prototype.rawListeners=function(d){return V(this,d,!1)},j.listenerCount=function(d,n){return typeof d.listenerCount=="function"?d.listenerCount(n):N.call(d,n)},j.prototype.listenerCount=N;function N(d){var n=this._events;if(n!==void 0){var i=n[d];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}j.prototype.eventNames=function(){return this._eventsCount>0?W(this._events):[]};function k(d,n){for(var i=new Array(n),H0=0;H0<n;++H0)i[H0]=d[H0];return i}function M(d,n){for(;n+1<d.length;n++)d[n]=d[n+1];d.pop()}function x(d){for(var n=new Array(d.length),i=0;i<n.length;++i)n[i]=d[i].listener||d[i];return n}function v(d,n){return new Promise(function(i,H0){function s(Q){d.removeListener(n,K0),H0(Q)}function K0(){typeof d.removeListener=="function"&&d.removeListener("error",s),i([].slice.call(arguments))}b(d,n,K0,{once:!0}),n!=="error"&&g(d,s,{once:!0})})}function g(d,n,i){typeof d.on=="function"&&b(d,"error",n,i)}function b(d,n,i,H0){if(typeof d.on=="function")H0.once?d.once(n,i):d.on(n,i);else if(typeof d.addEventListener=="function")d.addEventListener(n,function s(K0){H0.once&&d.removeEventListener(n,s),i(K0)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof d)}}),V5=z0((m,_)=>{_.exports=A6().EventEmitter}),U9=z0(()=>{}),o7=z0((m,_)=>{function R(V,N){var k=Object.keys(V);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(V);N&&(M=M.filter(function(x){return Object.getOwnPropertyDescriptor(V,x).enumerable})),k.push.apply(k,M)}return k}function A(V){for(var N=1;N<arguments.length;N++){var k=arguments[N]!=null?arguments[N]:{};N%2?R(Object(k),!0).forEach(function(M){W(V,M,k[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(V,Object.getOwnPropertyDescriptors(k)):R(Object(k)).forEach(function(M){Object.defineProperty(V,M,Object.getOwnPropertyDescriptor(k,M))})}return V}function W(V,N,k){return N in V?Object.defineProperty(V,N,{value:k,enumerable:!0,configurable:!0,writable:!0}):V[N]=k,V}function S(V,N){if(!(V instanceof N))throw new TypeError("Cannot call a class as a function")}function Z(V,N){for(var k=0;k<N.length;k++){var M=N[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(V,M.key,M)}}function j(V,N,k){return N&&Z(V.prototype,N),k&&Z(V,k),V}var D=C6(),C=D.Buffer,O=U9(),F=O.inspect,T=F&&F.custom||"inspect";function I(V,N,k){C.prototype.copy.call(V,N,k)}_.exports=function(){function V(){S(this,V),this.head=null,this.tail=null,this.length=0}return j(V,[{key:"push",value:function(N){var k={data:N,next:null};this.length>0?this.tail.next=k:this.head=k,this.tail=k,++this.length}},{key:"unshift",value:function(N){var k={data:N,next:this.head};this.length===0&&(this.tail=k),this.head=k,++this.length}},{key:"shift",value:function(){if(this.length!==0){var N=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,N}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(N){if(this.length===0)return"";for(var k=this.head,M=""+k.data;k=k.next;)M+=N+k.data;return M}},{key:"concat",value:function(N){if(this.length===0)return C.alloc(0);for(var k=C.allocUnsafe(N>>>0),M=this.head,x=0;M;)I(M.data,k,x),x+=M.data.length,M=M.next;return k}},{key:"consume",value:function(N,k){var M;return N<this.head.data.length?(M=this.head.data.slice(0,N),this.head.data=this.head.data.slice(N)):N===this.head.data.length?M=this.shift():M=k?this._getString(N):this._getBuffer(N),M}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(N){var k=this.head,M=1,x=k.data;for(N-=x.length;k=k.next;){var v=k.data,g=N>v.length?v.length:N;if(g===v.length?x+=v:x+=v.slice(0,N),N-=g,N===0){g===v.length?(++M,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=v.slice(g));break}++M}return this.length-=M,x}},{key:"_getBuffer",value:function(N){var k=C.allocUnsafe(N),M=this.head,x=1;for(M.data.copy(k),N-=M.data.length;M=M.next;){var v=M.data,g=N>v.length?v.length:N;if(v.copy(k,k.length-N,0,g),N-=g,N===0){g===v.length?(++x,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=v.slice(g));break}++x}return this.length-=x,k}},{key:T,value:function(N,k){return F(this,A({},k,{depth:0,customInspect:!1}))}}]),V}()}),O5=z0((m,_)=>{function R(D,C){var O=this,F=this._readableState&&this._readableState.destroyed,T=this._writableState&&this._writableState.destroyed;return F||T?(C?C(D):D&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Z,this,D)):process.nextTick(Z,this,D)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(D||null,function(I){!C&&I?O._writableState?O._writableState.errorEmitted?process.nextTick(W,O):(O._writableState.errorEmitted=!0,process.nextTick(A,O,I)):process.nextTick(A,O,I):C?(process.nextTick(W,O),C(I)):process.nextTick(W,O)}),this)}function A(D,C){Z(D,C),W(D)}function W(D){D._writableState&&!D._writableState.emitClose||D._readableState&&!D._readableState.emitClose||D.emit("close")}function S(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Z(D,C){D.emit("error",C)}function j(D,C){var{_readableState:O,_writableState:F}=D;O&&O.autoDestroy||F&&F.autoDestroy?D.destroy(C):D.emit("error",C)}_.exports={destroy:R,undestroy:S,errorOrDestroy:j}}),c6=z0((m,_)=>{function R(C,O){C.prototype=Object.create(O.prototype),C.prototype.constructor=C,C.__proto__=O}var A={};function W(C,O,F){F||(F=Error);function T(V,N,k){return typeof O=="string"?O:O(V,N,k)}var I=function(V){R(N,V);function N(k,M,x){return V.call(this,T(k,M,x))||this}return N}(F);I.prototype.name=F.name,I.prototype.code=C,A[C]=I}function S(C,O){if(Array.isArray(C)){var F=C.length;return C=C.map(function(T){return String(T)}),F>2?"one of ".concat(O," ").concat(C.slice(0,F-1).join(", "),", or ")+C[F-1]:F===2?"one of ".concat(O," ").concat(C[0]," or ").concat(C[1]):"of ".concat(O," ").concat(C[0])}else return"of ".concat(O," ").concat(String(C))}function Z(C,O,F){return C.substr(!F||F<0?0:+F,O.length)===O}function j(C,O,F){return(F===void 0||F>C.length)&&(F=C.length),C.substring(F-O.length,F)===O}function D(C,O,F){return typeof F!="number"&&(F=0),F+O.length>C.length?!1:C.indexOf(O,F)!==-1}W("ERR_INVALID_OPT_VALUE",function(C,O){return'The value "'+O+'" is invalid for option "'+C+'"'},TypeError),W("ERR_INVALID_ARG_TYPE",function(C,O,F){var T;typeof O=="string"&&Z(O,"not ")?(T="must not be",O=O.replace(/^not /,"")):T="must be";var I;if(j(C," argument"))I="The ".concat(C," ").concat(T," ").concat(S(O,"type"));else{var V=D(C,".")?"property":"argument";I='The "'.concat(C,'" ').concat(V," ").concat(T," ").concat(S(O,"type"))}return I+=". Received type ".concat(typeof F),I},TypeError),W("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),W("ERR_METHOD_NOT_IMPLEMENTED",function(C){return"The "+C+" method is not implemented"}),W("ERR_STREAM_PREMATURE_CLOSE","Premature close"),W("ERR_STREAM_DESTROYED",function(C){return"Cannot call "+C+" after a stream was destroyed"}),W("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),W("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),W("ERR_STREAM_WRITE_AFTER_END","write after end"),W("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),W("ERR_UNKNOWN_ENCODING",function(C){return"Unknown encoding: "+C},TypeError),W("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_.exports.codes=A}),C5=z0((m,_)=>{var R=c6().codes.ERR_INVALID_OPT_VALUE;function A(S,Z,j){return S.highWaterMark!=null?S.highWaterMark:Z?S[j]:null}function W(S,Z,j,D){var C=A(Z,D,j);if(C!=null){if(!(isFinite(C)&&Math.floor(C)===C)||C<0){var O=D?j:"highWaterMark";throw new R(O,C)}return Math.floor(C)}return S.objectMode?16:16384}_.exports={getHighWaterMark:W}}),P5=z0((m,_)=>{_.exports=R;function R(W,S){if(A("noDeprecation"))return W;var Z=!1;function j(){if(!Z){if(A("throwDeprecation"))throw new Error(S);A("traceDeprecation")?console.trace(S):console.warn(S),Z=!0}return W.apply(this,arguments)}return j}function A(W){try{if(!global.localStorage)return!1}catch{return!1}var S=global.localStorage[W];return S==null?!1:String(S).toLowerCase()==="true"}}),T5=z0((m,_)=>{_.exports=s;function R(u){var l=this;this.next=null,this.entry=null,this.finish=function(){$0(l,u)}}var A;s.WritableState=i;var W={deprecate:P5()},S=V5(),Z=C6().Buffer,j=global.Uint8Array||function(){};function D(u){return Z.from(u)}function C(u){return Z.isBuffer(u)||u instanceof j}var O=O5(),F=C5(),T=F.getHighWaterMark,I=c6().codes,V=I.ERR_INVALID_ARG_TYPE,N=I.ERR_METHOD_NOT_IMPLEMENTED,k=I.ERR_MULTIPLE_CALLBACK,M=I.ERR_STREAM_CANNOT_PIPE,x=I.ERR_STREAM_DESTROYED,v=I.ERR_STREAM_NULL_VALUES,g=I.ERR_STREAM_WRITE_AFTER_END,b=I.ERR_UNKNOWN_ENCODING,d=O.errorOrDestroy;p0()(s,S);function n(){}function i(u,l,a){A=A||m6(),u=u||{},typeof a!="boolean"&&(a=l instanceof A),this.objectMode=!!u.objectMode,a&&(this.objectMode=this.objectMode||!!u.writableObjectMode),this.highWaterMark=T(this,u,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var O0=u.decodeStrings===!1;this.decodeStrings=!O0,this.defaultEncoding=u.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q0){Y(l,Q0)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=u.emitClose!==!1,this.autoDestroy=!!u.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new R(this)}i.prototype.getBuffer=function(){for(var u=this.bufferedRequest,l=[];u;)l.push(u),u=u.next;return l},function(){try{Object.defineProperty(i.prototype,"buffer",{get:W.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var H0;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(H0=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(u){return H0.call(this,u)?!0:this!==s?!1:u&&u._writableState instanceof i}})):H0=function(u){return u instanceof this};function s(u){A=A||m6();var l=this instanceof A;if(!l&&!H0.call(s,this))return new s(u);this._writableState=new i(u,this,l),this.writable=!0,u&&(typeof u.write=="function"&&(this._write=u.write),typeof u.writev=="function"&&(this._writev=u.writev),typeof u.destroy=="function"&&(this._destroy=u.destroy),typeof u.final=="function"&&(this._final=u.final)),S.call(this)}s.prototype.pipe=function(){d(this,new M)};function K0(u,l){var a=new g;d(u,a),process.nextTick(l,a)}function Q(u,l,a,O0){var Q0;return a===null?Q0=new v:typeof a!="string"&&!l.objectMode&&(Q0=new V("chunk",["string","Buffer"],a)),Q0?(d(u,Q0),process.nextTick(O0,Q0),!1):!0}s.prototype.write=function(u,l,a){var O0=this._writableState,Q0=!1,U0=!O0.objectMode&&C(u);return U0&&!Z.isBuffer(u)&&(u=D(u)),typeof l=="function"&&(a=l,l=null),U0?l="buffer":l||(l=O0.defaultEncoding),typeof a!="function"&&(a=n),O0.ending?K0(this,a):(U0||Q(this,O0,u,a))&&(O0.pendingcb++,Q0=J(this,O0,U0,u,l,a)),Q0},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var u=this._writableState;u.corked&&(u.corked--,!u.writing&&!u.corked&&!u.bufferProcessing&&u.bufferedRequest&&G(this,u))},s.prototype.setDefaultEncoding=function(u){if(typeof u=="string"&&(u=u.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((u+"").toLowerCase())>-1))throw new b(u);return this._writableState.defaultEncoding=u,this},Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $(u,l,a){return!u.objectMode&&u.decodeStrings!==!1&&typeof l=="string"&&(l=Z.from(l,a)),l}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function J(u,l,a,O0,Q0,U0){if(!a){var y=$(l,O0,Q0);O0!==y&&(a=!0,Q0="buffer",O0=y)}var q=l.objectMode?1:O0.length;l.length+=q;var p=l.length<l.highWaterMark;if(p||(l.needDrain=!0),l.writing||l.corked){var e=l.lastBufferedRequest;l.lastBu