mqtt-json-rpc 1.3.7 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ (function(St,Ut){typeof exports=="object"&&typeof module<"u"?module.exports=Ut():typeof define=="function"&&define.amd?define(Ut):(St=typeof globalThis<"u"?globalThis:St||self,St.MqttJsonRpc=Ut())})(this,(function(){"use strict";var St=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ut(K){return K&&K.__esModule&&Object.prototype.hasOwnProperty.call(K,"default")?K.default:K}var Jt={},Ft={};Ft.byteLength=ae,Ft.toByteArray=fe,Ft.fromByteArray=he;for(var It=[],At=[],oe=typeof Uint8Array<"u"?Uint8Array:Array,Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nt=0,se=Dt.length;Nt<se;++Nt)It[Nt]=Dt[Nt],At[Dt.charCodeAt(Nt)]=Nt;At[45]=62,At[95]=63;function Xt(K){var et=K.length;if(et%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=K.indexOf("=");a===-1&&(a=et);var O=a===et?0:4-a%4;return[a,O]}function ae(K){var et=Xt(K),a=et[0],O=et[1];return(a+O)*3/4-O}function ue(K,et,a){return(et+a)*3/4-a}function fe(K){var et,a=Xt(K),O=a[0],M=a[1],p=new oe(ue(K,O,M)),l=0,b=M>0?O-4:O,B;for(B=0;B<b;B+=4)et=At[K.charCodeAt(B)]<<18|At[K.charCodeAt(B+1)]<<12|At[K.charCodeAt(B+2)]<<6|At[K.charCodeAt(B+3)],p[l++]=et>>16&255,p[l++]=et>>8&255,p[l++]=et&255;return M===2&&(et=At[K.charCodeAt(B)]<<2|At[K.charCodeAt(B+1)]>>4,p[l++]=et&255),M===1&&(et=At[K.charCodeAt(B)]<<10|At[K.charCodeAt(B+1)]<<4|At[K.charCodeAt(B+2)]>>2,p[l++]=et>>8&255,p[l++]=et&255),p}function ce(K){return It[K>>18&63]+It[K>>12&63]+It[K>>6&63]+It[K&63]}function le(K,et,a){for(var O,M=[],p=et;p<a;p+=3)O=(K[p]<<16&16711680)+(K[p+1]<<8&65280)+(K[p+2]&255),M.push(ce(O));return M.join("")}function he(K){for(var et,a=K.length,O=a%3,M=[],p=16383,l=0,b=a-O;l<b;l+=p)M.push(le(K,l,l+p>b?b:l+p));return O===1?(et=K[a-1],M.push(It[et>>2]+It[et<<4&63]+"==")):O===2&&(et=(K[a-2]<<8)+K[a-1],M.push(It[et>>10]+It[et>>4&63]+It[et<<2&63]+"=")),M.join("")}var jt={};jt.read=function(K,et,a,O,M){var p,l,b=M*8-O-1,B=(1<<b)-1,u=B>>1,t=-7,n=a?M-1:0,s=a?-1:1,d=K[et+n];for(n+=s,p=d&(1<<-t)-1,d>>=-t,t+=b;t>0;p=p*256+K[et+n],n+=s,t-=8);for(l=p&(1<<-t)-1,p>>=-t,t+=O;t>0;l=l*256+K[et+n],n+=s,t-=8);if(p===0)p=1-u;else{if(p===B)return l?NaN:(d?-1:1)*(1/0);l=l+Math.pow(2,O),p=p-u}return(d?-1:1)*l*Math.pow(2,p-O)},jt.write=function(K,et,a,O,M,p){var l,b,B,u=p*8-M-1,t=(1<<u)-1,n=t>>1,s=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=O?0:p-1,c=O?1:-1,y=et<0||et===0&&1/et<0?1:0;for(et=Math.abs(et),isNaN(et)||et===1/0?(b=isNaN(et)?1:0,l=t):(l=Math.floor(Math.log(et)/Math.LN2),et*(B=Math.pow(2,-l))<1&&(l--,B*=2),l+n>=1?et+=s/B:et+=s*Math.pow(2,1-n),et*B>=2&&(l++,B/=2),l+n>=t?(b=0,l=t):l+n>=1?(b=(et*B-1)*Math.pow(2,M),l=l+n):(b=et*Math.pow(2,n-1)*Math.pow(2,M),l=0));M>=8;K[a+d]=b&255,d+=c,b/=256,M-=8);for(l=l<<M|b,u+=M;u>0;K[a+d]=l&255,d+=c,l/=256,u-=8);K[a+d-c]|=y*128};(function(K){const et=Ft,a=jt,O=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;K.Buffer=t,K.SlowBuffer=C,K.INSPECT_MAX_BYTES=50;const M=2147483647;K.kMaxLength=M;const{Uint8Array:p,ArrayBuffer:l,SharedArrayBuffer:b}=globalThis;t.TYPED_ARRAY_SUPPORT=B(),!t.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 B(){try{const f=new p(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,p.prototype),Object.setPrototypeOf(f,r),f.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function u(f){if(f>M)throw new RangeError('The value "'+f+'" is invalid for option "size"');const r=new p(f);return Object.setPrototypeOf(r,t.prototype),r}function t(f,r,i){if(typeof f=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(f)}return n(f,r,i)}t.poolSize=8192;function n(f,r,i){if(typeof f=="string")return y(f,r);if(l.isView(f))return m(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(it(f,l)||f&&it(f.buffer,l)||typeof b<"u"&&(it(f,b)||f&&it(f.buffer,b)))return g(f,r,i);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=f.valueOf&&f.valueOf();if(A!=null&&A!==f)return t.from(A,r,i);const W=_(f);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return t.from(f[Symbol.toPrimitive]("string"),r,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}t.from=function(f,r,i){return n(f,r,i)},Object.setPrototypeOf(t.prototype,p.prototype),Object.setPrototypeOf(t,p);function s(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function d(f,r,i){return s(f),f<=0?u(f):r!==void 0?typeof i=="string"?u(f).fill(r,i):u(f).fill(r):u(f)}t.alloc=function(f,r,i){return d(f,r,i)};function c(f){return s(f),u(f<0?0:S(f)|0)}t.allocUnsafe=function(f){return c(f)},t.allocUnsafeSlow=function(f){return c(f)};function y(f,r){if((typeof r!="string"||r==="")&&(r="utf8"),!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const i=I(f,r)|0;let A=u(i);const W=A.write(f,r);return W!==i&&(A=A.slice(0,W)),A}function v(f){const r=f.length<0?0:S(f.length)|0,i=u(r);for(let A=0;A<r;A+=1)i[A]=f[A]&255;return i}function m(f){if(it(f,p)){const r=new p(f);return g(r.buffer,r.byteOffset,r.byteLength)}return v(f)}function g(f,r,i){if(r<0||f.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<r+(i||0))throw new RangeError('"length" is outside of buffer bounds');let A;return r===void 0&&i===void 0?A=new p(f):i===void 0?A=new p(f,r):A=new p(f,r,i),Object.setPrototypeOf(A,t.prototype),A}function _(f){if(t.isBuffer(f)){const r=S(f.length)|0,i=u(r);return i.length===0||f.copy(i,0,0,r),i}if(f.length!==void 0)return typeof f.length!="number"||yt(f.length)?u(0):v(f);if(f.type==="Buffer"&&Array.isArray(f.data))return v(f.data)}function S(f){if(f>=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return f|0}function C(f){return+f!=f&&(f=0),t.alloc(+f)}t.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==t.prototype},t.compare=function(r,i){if(it(r,p)&&(r=t.from(r,r.offset,r.byteLength)),it(i,p)&&(i=t.from(i,i.offset,i.byteLength)),!t.isBuffer(r)||!t.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===i)return 0;let A=r.length,W=i.length;for(let Q=0,ct=Math.min(A,W);Q<ct;++Q)if(r[Q]!==i[Q]){A=r[Q],W=i[Q];break}return A<W?-1:W<A?1:0},t.isEncoding=function(r){switch(String(r).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}},t.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return t.alloc(0);let A;if(i===void 0)for(i=0,A=0;A<r.length;++A)i+=r[A].length;const W=t.allocUnsafe(i);let Q=0;for(A=0;A<r.length;++A){let ct=r[A];if(it(ct,p))Q+ct.length>W.length?(t.isBuffer(ct)||(ct=t.from(ct)),ct.copy(W,Q)):p.prototype.set.call(W,ct,Q);else if(t.isBuffer(ct))ct.copy(W,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=ct.length}return W};function I(f,r){if(t.isBuffer(f))return f.length;if(l.isView(f)||it(f,l))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);const i=f.length,A=arguments.length>2&&arguments[2]===!0;if(!A&&i===0)return 0;let W=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return e(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return j(f).length;default:if(W)return A?-1:e(f).length;r=(""+r).toLowerCase(),W=!0}}t.byteLength=I;function X(f,r,i){let A=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(f||(f="utf8");;)switch(f){case"hex":return w(this,r,i);case"utf8":case"utf-8":return ht(this,r,i);case"ascii":return q(this,r,i);case"latin1":case"binary":return ot(this,r,i);case"base64":return H(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,i);default:if(A)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),A=!0}}t.prototype._isBuffer=!0;function Z(f,r,i){const A=f[r];f[r]=f[i],f[i]=A}t.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<r;i+=2)Z(this,i,i+1);return this},t.prototype.swap32=function(){const r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<r;i+=4)Z(this,i,i+3),Z(this,i+1,i+2);return this},t.prototype.swap64=function(){const r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<r;i+=8)Z(this,i,i+7),Z(this,i+1,i+6),Z(this,i+2,i+5),Z(this,i+3,i+4);return this},t.prototype.toString=function(){const r=this.length;return r===0?"":arguments.length===0?ht(this,0,r):X.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(r){if(!t.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:t.compare(this,r)===0},t.prototype.inspect=function(){let r="";const i=K.INSPECT_MAX_BYTES;return r=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(r+=" ... "),"<Buffer "+r+">"},O&&(t.prototype[O]=t.prototype.inspect),t.prototype.compare=function(r,i,A,W,Q){if(it(r,p)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(i===void 0&&(i=0),A===void 0&&(A=r?r.length:0),W===void 0&&(W=0),Q===void 0&&(Q=this.length),i<0||A>r.length||W<0||Q>this.length)throw new RangeError("out of range index");if(W>=Q&&i>=A)return 0;if(W>=Q)return-1;if(i>=A)return 1;if(i>>>=0,A>>>=0,W>>>=0,Q>>>=0,this===r)return 0;let ct=Q-W,bt=A-i;const Bt=Math.min(ct,bt),vt=this.slice(W,Q),xt=r.slice(i,A);for(let Et=0;Et<Bt;++Et)if(vt[Et]!==xt[Et]){ct=vt[Et],bt=xt[Et];break}return ct<bt?-1:bt<ct?1:0};function L(f,r,i,A,W){if(f.length===0)return-1;if(typeof i=="string"?(A=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,yt(i)&&(i=W?0:f.length-1),i<0&&(i=f.length+i),i>=f.length){if(W)return-1;i=f.length-1}else if(i<0)if(W)i=0;else return-1;if(typeof r=="string"&&(r=t.from(r,A)),t.isBuffer(r))return r.length===0?-1:U(f,r,i,A,W);if(typeof r=="number")return r=r&255,typeof p.prototype.indexOf=="function"?W?p.prototype.indexOf.call(f,r,i):p.prototype.lastIndexOf.call(f,r,i):U(f,[r],i,A,W);throw new TypeError("val must be string, number or Buffer")}function U(f,r,i,A,W){let Q=1,ct=f.length,bt=r.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(f.length<2||r.length<2)return-1;Q=2,ct/=2,bt/=2,i/=2}function Bt(xt,Et){return Q===1?xt[Et]:xt.readUInt16BE(Et*Q)}let vt;if(W){let xt=-1;for(vt=i;vt<ct;vt++)if(Bt(f,vt)===Bt(r,xt===-1?0:vt-xt)){if(xt===-1&&(xt=vt),vt-xt+1===bt)return xt*Q}else xt!==-1&&(vt-=vt-xt),xt=-1}else for(i+bt>ct&&(i=ct-bt),vt=i;vt>=0;vt--){let xt=!0;for(let Et=0;Et<bt;Et++)if(Bt(f,vt+Et)!==Bt(r,Et)){xt=!1;break}if(xt)return vt}return-1}t.prototype.includes=function(r,i,A){return this.indexOf(r,i,A)!==-1},t.prototype.indexOf=function(r,i,A){return L(this,r,i,A,!0)},t.prototype.lastIndexOf=function(r,i,A){return L(this,r,i,A,!1)};function T(f,r,i,A){i=Number(i)||0;const W=f.length-i;A?(A=Number(A),A>W&&(A=W)):A=W;const Q=r.length;A>Q/2&&(A=Q/2);let ct;for(ct=0;ct<A;++ct){const bt=parseInt(r.substr(ct*2,2),16);if(yt(bt))return ct;f[i+ct]=bt}return ct}function F(f,r,i,A){return V(e(r,f.length-i),f,i,A)}function z(f,r,i,A){return V(o(r),f,i,A)}function Y(f,r,i,A){return V(j(r),f,i,A)}function rt(f,r,i,A){return V(h(r,f.length-i),f,i,A)}t.prototype.write=function(r,i,A,W){if(i===void 0)W="utf8",A=this.length,i=0;else if(A===void 0&&typeof i=="string")W=i,A=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(A)?(A=A>>>0,W===void 0&&(W="utf8")):(W=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Q=this.length-i;if((A===void 0||A>Q)&&(A=Q),r.length>0&&(A<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let ct=!1;for(;;)switch(W){case"hex":return T(this,r,i,A);case"utf8":case"utf-8":return F(this,r,i,A);case"ascii":case"latin1":case"binary":return z(this,r,i,A);case"base64":return Y(this,r,i,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rt(this,r,i,A);default:if(ct)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),ct=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(f,r,i){return r===0&&i===f.length?et.fromByteArray(f):et.fromByteArray(f.slice(r,i))}function ht(f,r,i){i=Math.min(f.length,i);const A=[];let W=r;for(;W<i;){const Q=f[W];let ct=null,bt=Q>239?4:Q>223?3:Q>191?2:1;if(W+bt<=i){let Bt,vt,xt,Et;switch(bt){case 1:Q<128&&(ct=Q);break;case 2:Bt=f[W+1],(Bt&192)===128&&(Et=(Q&31)<<6|Bt&63,Et>127&&(ct=Et));break;case 3:Bt=f[W+1],vt=f[W+2],(Bt&192)===128&&(vt&192)===128&&(Et=(Q&15)<<12|(Bt&63)<<6|vt&63,Et>2047&&(Et<55296||Et>57343)&&(ct=Et));break;case 4:Bt=f[W+1],vt=f[W+2],xt=f[W+3],(Bt&192)===128&&(vt&192)===128&&(xt&192)===128&&(Et=(Q&15)<<18|(Bt&63)<<12|(vt&63)<<6|xt&63,Et>65535&&Et<1114112&&(ct=Et))}}ct===null?(ct=65533,bt=1):ct>65535&&(ct-=65536,A.push(ct>>>10&1023|55296),ct=56320|ct&1023),A.push(ct),W+=bt}return P(A)}const E=4096;function P(f){const r=f.length;if(r<=E)return String.fromCharCode.apply(String,f);let i="",A=0;for(;A<r;)i+=String.fromCharCode.apply(String,f.slice(A,A+=E));return i}function q(f,r,i){let A="";i=Math.min(f.length,i);for(let W=r;W<i;++W)A+=String.fromCharCode(f[W]&127);return A}function ot(f,r,i){let A="";i=Math.min(f.length,i);for(let W=r;W<i;++W)A+=String.fromCharCode(f[W]);return A}function w(f,r,i){const A=f.length;(!r||r<0)&&(r=0),(!i||i<0||i>A)&&(i=A);let W="";for(let Q=r;Q<i;++Q)W+=mt[f[Q]];return W}function D(f,r,i){const A=f.slice(r,i);let W="";for(let Q=0;Q<A.length-1;Q+=2)W+=String.fromCharCode(A[Q]+A[Q+1]*256);return W}t.prototype.slice=function(r,i){const A=this.length;r=~~r,i=i===void 0?A:~~i,r<0?(r+=A,r<0&&(r=0)):r>A&&(r=A),i<0?(i+=A,i<0&&(i=0)):i>A&&(i=A),i<r&&(i=r);const W=this.subarray(r,i);return Object.setPrototypeOf(W,t.prototype),W};function k(f,r,i){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+r>i)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(r,i,A){r=r>>>0,i=i>>>0,A||k(r,i,this.length);let W=this[r],Q=1,ct=0;for(;++ct<i&&(Q*=256);)W+=this[r+ct]*Q;return W},t.prototype.readUintBE=t.prototype.readUIntBE=function(r,i,A){r=r>>>0,i=i>>>0,A||k(r,i,this.length);let W=this[r+--i],Q=1;for(;i>0&&(Q*=256);)W+=this[r+--i]*Q;return W},t.prototype.readUint8=t.prototype.readUInt8=function(r,i){return r=r>>>0,i||k(r,1,this.length),this[r]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(r,i){return r=r>>>0,i||k(r,2,this.length),this[r]|this[r+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(r,i){return r=r>>>0,i||k(r,2,this.length),this[r]<<8|this[r+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(r,i){return r=r>>>0,i||k(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(r,i){return r=r>>>0,i||k(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},t.prototype.readBigUInt64LE=wt(function(r){r=r>>>0,lt(r,"offset");const i=this[r],A=this[r+7];(i===void 0||A===void 0)&&pt(r,this.length-8);const W=i+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,Q=this[++r]+this[++r]*2**8+this[++r]*2**16+A*2**24;return BigInt(W)+(BigInt(Q)<<BigInt(32))}),t.prototype.readBigUInt64BE=wt(function(r){r=r>>>0,lt(r,"offset");const i=this[r],A=this[r+7];(i===void 0||A===void 0)&&pt(r,this.length-8);const W=i*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],Q=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+A;return(BigInt(W)<<BigInt(32))+BigInt(Q)}),t.prototype.readIntLE=function(r,i,A){r=r>>>0,i=i>>>0,A||k(r,i,this.length);let W=this[r],Q=1,ct=0;for(;++ct<i&&(Q*=256);)W+=this[r+ct]*Q;return Q*=128,W>=Q&&(W-=Math.pow(2,8*i)),W},t.prototype.readIntBE=function(r,i,A){r=r>>>0,i=i>>>0,A||k(r,i,this.length);let W=i,Q=1,ct=this[r+--W];for(;W>0&&(Q*=256);)ct+=this[r+--W]*Q;return Q*=128,ct>=Q&&(ct-=Math.pow(2,8*i)),ct},t.prototype.readInt8=function(r,i){return r=r>>>0,i||k(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},t.prototype.readInt16LE=function(r,i){r=r>>>0,i||k(r,2,this.length);const A=this[r]|this[r+1]<<8;return A&32768?A|4294901760:A},t.prototype.readInt16BE=function(r,i){r=r>>>0,i||k(r,2,this.length);const A=this[r+1]|this[r]<<8;return A&32768?A|4294901760:A},t.prototype.readInt32LE=function(r,i){return r=r>>>0,i||k(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},t.prototype.readInt32BE=function(r,i){return r=r>>>0,i||k(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},t.prototype.readBigInt64LE=wt(function(r){r=r>>>0,lt(r,"offset");const i=this[r],A=this[r+7];(i===void 0||A===void 0)&&pt(r,this.length-8);const W=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(A<<24);return(BigInt(W)<<BigInt(32))+BigInt(i+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),t.prototype.readBigInt64BE=wt(function(r){r=r>>>0,lt(r,"offset");const i=this[r],A=this[r+7];(i===void 0||A===void 0)&&pt(r,this.length-8);const W=(i<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(W)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+A)}),t.prototype.readFloatLE=function(r,i){return r=r>>>0,i||k(r,4,this.length),a.read(this,r,!0,23,4)},t.prototype.readFloatBE=function(r,i){return r=r>>>0,i||k(r,4,this.length),a.read(this,r,!1,23,4)},t.prototype.readDoubleLE=function(r,i){return r=r>>>0,i||k(r,8,this.length),a.read(this,r,!0,52,8)},t.prototype.readDoubleBE=function(r,i){return r=r>>>0,i||k(r,8,this.length),a.read(this,r,!1,52,8)};function G(f,r,i,A,W,Q){if(!t.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>W||r<Q)throw new RangeError('"value" argument is out of bounds');if(i+A>f.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(r,i,A,W){if(r=+r,i=i>>>0,A=A>>>0,!W){const bt=Math.pow(2,8*A)-1;G(this,r,i,A,bt,0)}let Q=1,ct=0;for(this[i]=r&255;++ct<A&&(Q*=256);)this[i+ct]=r/Q&255;return i+A},t.prototype.writeUintBE=t.prototype.writeUIntBE=function(r,i,A,W){if(r=+r,i=i>>>0,A=A>>>0,!W){const bt=Math.pow(2,8*A)-1;G(this,r,i,A,bt,0)}let Q=A-1,ct=1;for(this[i+Q]=r&255;--Q>=0&&(ct*=256);)this[i+Q]=r/ct&255;return i+A},t.prototype.writeUint8=t.prototype.writeUInt8=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,1,255,0),this[i]=r&255,i+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,2,65535,0),this[i]=r&255,this[i+1]=r>>>8,i+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,2,65535,0),this[i]=r>>>8,this[i+1]=r&255,i+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,4,4294967295,0),this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255,i+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,4,4294967295,0),this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255,i+4};function ut(f,r,i,A,W){at(r,A,W,f,i,7);let Q=Number(r&BigInt(4294967295));f[i++]=Q,Q=Q>>8,f[i++]=Q,Q=Q>>8,f[i++]=Q,Q=Q>>8,f[i++]=Q;let ct=Number(r>>BigInt(32)&BigInt(4294967295));return f[i++]=ct,ct=ct>>8,f[i++]=ct,ct=ct>>8,f[i++]=ct,ct=ct>>8,f[i++]=ct,i}function ft(f,r,i,A,W){at(r,A,W,f,i,7);let Q=Number(r&BigInt(4294967295));f[i+7]=Q,Q=Q>>8,f[i+6]=Q,Q=Q>>8,f[i+5]=Q,Q=Q>>8,f[i+4]=Q;let ct=Number(r>>BigInt(32)&BigInt(4294967295));return f[i+3]=ct,ct=ct>>8,f[i+2]=ct,ct=ct>>8,f[i+1]=ct,ct=ct>>8,f[i]=ct,i+8}t.prototype.writeBigUInt64LE=wt(function(r,i=0){return ut(this,r,i,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=wt(function(r,i=0){return ft(this,r,i,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(r,i,A,W){if(r=+r,i=i>>>0,!W){const Bt=Math.pow(2,8*A-1);G(this,r,i,A,Bt-1,-Bt)}let Q=0,ct=1,bt=0;for(this[i]=r&255;++Q<A&&(ct*=256);)r<0&&bt===0&&this[i+Q-1]!==0&&(bt=1),this[i+Q]=(r/ct>>0)-bt&255;return i+A},t.prototype.writeIntBE=function(r,i,A,W){if(r=+r,i=i>>>0,!W){const Bt=Math.pow(2,8*A-1);G(this,r,i,A,Bt-1,-Bt)}let Q=A-1,ct=1,bt=0;for(this[i+Q]=r&255;--Q>=0&&(ct*=256);)r<0&&bt===0&&this[i+Q+1]!==0&&(bt=1),this[i+Q]=(r/ct>>0)-bt&255;return i+A},t.prototype.writeInt8=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,1,127,-128),r<0&&(r=255+r+1),this[i]=r&255,i+1},t.prototype.writeInt16LE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,2,32767,-32768),this[i]=r&255,this[i+1]=r>>>8,i+2},t.prototype.writeInt16BE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,2,32767,-32768),this[i]=r>>>8,this[i+1]=r&255,i+2},t.prototype.writeInt32LE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,4,2147483647,-2147483648),this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24,i+4},t.prototype.writeInt32BE=function(r,i,A){return r=+r,i=i>>>0,A||G(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255,i+4},t.prototype.writeBigInt64LE=wt(function(r,i=0){return ut(this,r,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=wt(function(r,i=0){return ft(this,r,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function dt(f,r,i,A,W,Q){if(i+A>f.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function J(f,r,i,A,W){return r=+r,i=i>>>0,W||dt(f,r,i,4),a.write(f,r,i,A,23,4),i+4}t.prototype.writeFloatLE=function(r,i,A){return J(this,r,i,!0,A)},t.prototype.writeFloatBE=function(r,i,A){return J(this,r,i,!1,A)};function tt(f,r,i,A,W){return r=+r,i=i>>>0,W||dt(f,r,i,8),a.write(f,r,i,A,52,8),i+8}t.prototype.writeDoubleLE=function(r,i,A){return tt(this,r,i,!0,A)},t.prototype.writeDoubleBE=function(r,i,A){return tt(this,r,i,!1,A)},t.prototype.copy=function(r,i,A,W){if(!t.isBuffer(r))throw new TypeError("argument should be a Buffer");if(A||(A=0),!W&&W!==0&&(W=this.length),i>=r.length&&(i=r.length),i||(i=0),W>0&&W<A&&(W=A),W===A||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),r.length-i<W-A&&(W=r.length-i+A);const Q=W-A;return this===r&&typeof p.prototype.copyWithin=="function"?this.copyWithin(i,A,W):p.prototype.set.call(r,this.subarray(A,W),i),Q},t.prototype.fill=function(r,i,A,W){if(typeof r=="string"){if(typeof i=="string"?(W=i,i=0,A=this.length):typeof A=="string"&&(W=A,A=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!t.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(r.length===1){const ct=r.charCodeAt(0);(W==="utf8"&&ct<128||W==="latin1")&&(r=ct)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(i<0||this.length<i||this.length<A)throw new RangeError("Out of range index");if(A<=i)return this;i=i>>>0,A=A===void 0?this.length:A>>>0,r||(r=0);let Q;if(typeof r=="number")for(Q=i;Q<A;++Q)this[Q]=r;else{const ct=t.isBuffer(r)?r:t.from(r,W),bt=ct.length;if(bt===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(Q=0;Q<A-i;++Q)this[Q+i]=ct[Q%bt]}return this};const nt={};function st(f,r,i){nt[f]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}st("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),st("ERR_INVALID_ARG_TYPE",function(f,r){return`The "${f}" argument must be of type number. Received type ${typeof r}`},TypeError),st("ERR_OUT_OF_RANGE",function(f,r,i){let A=`The value of "${f}" is out of range.`,W=i;return Number.isInteger(i)&&Math.abs(i)>2**32?W=N(String(i)):typeof i=="bigint"&&(W=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(W=N(W)),W+="n"),A+=` It must be ${r}. Received ${W}`,A},RangeError);function N(f){let r="",i=f.length;const A=f[0]==="-"?1:0;for(;i>=A+4;i-=3)r=`_${f.slice(i-3,i)}${r}`;return`${f.slice(0,i)}${r}`}function $(f,r,i){lt(r,"offset"),(f[r]===void 0||f[r+i]===void 0)&&pt(r,f.length-(i+1))}function at(f,r,i,A,W,Q){if(f>i||f<r){const ct=typeof r=="bigint"?"n":"";let bt;throw r===0||r===BigInt(0)?bt=`>= 0${ct} and < 2${ct} ** ${(Q+1)*8}${ct}`:bt=`>= -(2${ct} ** ${(Q+1)*8-1}${ct}) and < 2 ** ${(Q+1)*8-1}${ct}`,new nt.ERR_OUT_OF_RANGE("value",bt,f)}$(A,W,Q)}function lt(f,r){if(typeof f!="number")throw new nt.ERR_INVALID_ARG_TYPE(r,"number",f)}function pt(f,r,i){throw Math.floor(f)!==f?(lt(f,i),new nt.ERR_OUT_OF_RANGE("offset","an integer",f)):r<0?new nt.ERR_BUFFER_OUT_OF_BOUNDS:new nt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${r}`,f)}const x=/[^+/0-9A-Za-z-_]/g;function R(f){if(f=f.split("=")[0],f=f.trim().replace(x,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function e(f,r){r=r||1/0;let i;const A=f.length;let W=null;const Q=[];for(let ct=0;ct<A;++ct){if(i=f.charCodeAt(ct),i>55295&&i<57344){if(!W){if(i>56319){(r-=3)>-1&&Q.push(239,191,189);continue}else if(ct+1===A){(r-=3)>-1&&Q.push(239,191,189);continue}W=i;continue}if(i<56320){(r-=3)>-1&&Q.push(239,191,189),W=i;continue}i=(W-55296<<10|i-56320)+65536}else W&&(r-=3)>-1&&Q.push(239,191,189);if(W=null,i<128){if((r-=1)<0)break;Q.push(i)}else if(i<2048){if((r-=2)<0)break;Q.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;Q.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;Q.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return Q}function o(f){const r=[];for(let i=0;i<f.length;++i)r.push(f.charCodeAt(i)&255);return r}function h(f,r){let i,A,W;const Q=[];for(let ct=0;ct<f.length&&!((r-=2)<0);++ct)i=f.charCodeAt(ct),A=i>>8,W=i%256,Q.push(W),Q.push(A);return Q}function j(f){return et.toByteArray(R(f))}function V(f,r,i,A){let W;for(W=0;W<A&&!(W+i>=r.length||W>=f.length);++W)r[W+i]=f[W];return W}function it(f,r){return f instanceof r||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===r.name}function yt(f){return f!==f}const mt=(function(){const f="0123456789abcdef",r=new Array(256);for(let i=0;i<16;++i){const A=i*16;for(let W=0;W<16;++W)r[A+W]=f[i]+f[W]}return r})();function wt(f){return typeof BigInt>"u"?_t:f}function _t(){throw new Error("BigInt not supported")}})(Jt);const qt=Jt.Buffer;var Lt={exports:{}},de=Lt.exports,Zt;function pe(){return Zt||(Zt=1,(function(K){(function(et,a,O){K.exports=O(et),K.exports.default=K.exports})(de,"UUID",function(){const et=function(w,D,k,G,ut,ft){const dt=function(J,tt){let nt=J.toString(16);return nt.length<2&&(nt="0"+nt),tt&&(nt=nt.toUpperCase()),nt};for(let J=D;J<=k;J++)ut[ft++]=dt(w[J],G);return ut},a=function(w,D,k,G,ut){for(let ft=D;ft<=k;ft+=2)G[ut++]=parseInt(w.substr(ft,2),16)},O="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#".split(""),M=[0,68,0,84,83,82,72,0,75,76,70,65,0,63,62,69,0,1,2,3,4,5,6,7,8,9,64,0,73,66,74,71,81,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,77,0,78,67,0,0,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,79,0,80,0,0],p=function(w,D){let k="",G=0,ut=0;for(;G<D;)if(ut=ut*256+w[G++],G%4===0){let ft=52200625;for(;ft>=1;){const dt=Math.floor(ut/ft)%85;k+=O[dt],ft/=85}ut=0}return k},l=function(w,D){const k=w.length;if(k%5!==0)throw new Error("z85_decode: invalid input length (multiple of 5 expected)");typeof D>"u"&&(D=new Array(k*4/5));let G=0,ut=0,ft=0;for(;G<k;){const dt=w.charCodeAt(G++)-32;if(dt<0||dt>=M.length)break;if(ft=ft*85+M[dt],G%5===0){let J=16777216;for(;J>=1;)D[ut++]=Math.trunc(ft/J%256),J/=256;ft=0}}return D},b=function(w,D){const k={ibits:8,obits:8,obigendian:!0};for(const N in D)typeof k[N]<"u"&&(k[N]=D[N]);const G=[];let ut=0,ft,dt,J=0,tt,nt=0;const st=w.length;for(;J===0&&(dt=w.charCodeAt(ut++)),ft=dt>>k.ibits-(J+8)&255,J=(J+8)%k.ibits,k.obigendian?nt===0?tt=ft<<k.obits-8:tt|=ft<<k.obits-8-nt:nt===0?tt=ft:tt|=ft<<nt,nt=(nt+8)%k.obits,!(nt===0&&(G.push(tt),ut>=st)););return G},B=function(w,D){const k={ibits:32,ibigendian:!0};for(const dt in D)typeof k[dt]<"u"&&(k[dt]=D[dt]);let G="",ut=4294967295;k.ibits<32&&(ut=(1<<k.ibits)-1);const ft=w.length;for(let dt=0;dt<ft;dt++){const J=w[dt]&ut;for(let tt=0;tt<k.ibits;tt+=8)k.ibigendian?G+=String.fromCharCode(J>>k.ibits-8-tt&255):G+=String.fromCharCode(J>>tt&255)}return G},u=8,t=8,n=256,s=function(w,D,k,G,ut,ft,dt,J){return[J,dt,ft,ut,G,k,D,w]},d=function(){return s(0,0,0,0,0,0,0,0)},c=function(w){return w.slice(0)},y=function(w){const D=d();for(let k=0;k<u;k++)D[k]=Math.floor(w%n),w/=n;return D},v=function(w){let D=0;for(let k=u-1;k>=0;k--)D*=n,D+=w[k];return Math.floor(D)},m=function(w,D){let k=0;for(let G=0;G<u;G++)k+=w[G]+D[G],w[G]=Math.floor(k%n),k=Math.floor(k/n);return k},g=function(w,D){let k=0;for(let G=0;G<u;G++)k+=w[G]*D,w[G]=Math.floor(k%n),k=Math.floor(k/n);return k},_=function(w,D){let k,G;const ut=new Array(u+u);for(k=0;k<u+u;k++)ut[k]=0;let ft;for(k=0;k<u;k++){for(ft=0,G=0;G<u;G++)ft+=w[k]*D[G]+ut[k+G],ut[k+G]=ft%n,ft/=n;for(;G<u+u-k;G++)ft+=ut[k+G],ut[k+G]=ft%n,ft/=n}for(k=0;k<u;k++)w[k]=ut[k];return ut.slice(u,u+u)},S=function(w,D){for(let k=0;k<u;k++)w[k]&=D[k];return w},C=function(w,D){for(let k=0;k<u;k++)w[k]|=D[k];return w},I=function(w,D){const k=d(),G=Math.floor(D/t);for(let ut=0;ut<G;ut++){let ft;for(ft=u-1-1;ft>=0;ft--)k[ft+1]=k[ft];for(k[0]=w[0],ft=0;ft<u-1;ft++)w[ft]=w[ft+1];w[ft]=0}return v(k)},X=function(w,D){if(D>u*t)throw new Error("ui64_ror: invalid number of bits to shift");const k=new Array(u+u);let G;for(G=0;G<u;G++)k[G+u]=w[G],k[G]=0;const ut=Math.floor(D/t),ft=D%t;for(G=ut;G<u+u-1;G++)k[G-ut]=(k[G]>>>ft|k[G+1]<<t-ft)&(1<<t)-1;for(k[u+u-1-ut]=k[u+u-1]>>>ft&(1<<t)-1,G=u+u-1-ut+1;G<u+u;G++)k[G]=0;for(G=0;G<u;G++)w[G]=k[G+u];return k.slice(0,u)},Z=function(w,D){if(D>u*t)throw new Error("ui64_rol: invalid number of bits to shift");const k=new Array(u+u);let G;for(G=0;G<u;G++)k[G+u]=0,k[G]=w[G];const ut=Math.floor(D/t),ft=D%t;for(G=u-1-ut;G>0;G--)k[G+ut]=(k[G]<<ft|k[G-1]>>>t-ft)&(1<<t)-1;for(k[0+ut]=k[0]<<ft&(1<<t)-1,G=0+ut-1;G>=0;G--)k[G]=0;for(G=0;G<u;G++)w[G]=k[G];return k.slice(u,u+u)},L=function(w,D){for(let k=0;k<u;k++)w[k]^=D[k]},U=function(w,D){const k=(w&65535)+(D&65535);return(w>>16)+(D>>16)+(k>>16)<<16|k&65535},T=function(w,D){return w<<D&4294967295|w>>>32-D&4294967295},F=function(w,D){function k(st,N,$,at){return st<20?N&$|~N&at:st<40?N^$^at:st<60?N&$|N&at|$&at:N^$^at}function G(st){return st<20?1518500249:st<40?1859775393:st<60?-1894007588:-899497514}w[D>>5]|=128<<24-D%32,w[(D+64>>9<<4)+15]=D;const ut=new Array(80);let ft=1732584193,dt=-271733879,J=-1732584194,tt=271733878,nt=-1009589776;for(let st=0;st<w.length;st+=16){const N=ft,$=dt,at=J,lt=tt,pt=nt;for(let x=0;x<80;x++){x<16?ut[x]=w[st+x]:ut[x]=T(ut[x-3]^ut[x-8]^ut[x-14]^ut[x-16],1);const R=U(U(T(ft,5),k(x,dt,J,tt)),U(U(nt,ut[x]),G(x)));nt=tt,tt=J,J=T(dt,30),dt=ft,ft=R}ft=U(ft,N),dt=U(dt,$),J=U(J,at),tt=U(tt,lt),nt=U(nt,pt)}return[ft,dt,J,tt,nt]},z=function(w){return B(F(b(w,{ibits:8,obits:32,obigendian:!0}),w.length*8),{ibits:32,ibigendian:!0})},Y=function(w,D){function k(N,$,at,lt,pt,x){return U(T(U(U($,N),U(lt,x)),pt),at)}function G(N,$,at,lt,pt,x,R){return k($&at|~$&lt,N,$,pt,x,R)}function ut(N,$,at,lt,pt,x,R){return k($&lt|at&~lt,N,$,pt,x,R)}function ft(N,$,at,lt,pt,x,R){return k($^at^lt,N,$,pt,x,R)}function dt(N,$,at,lt,pt,x,R){return k(at^($|~lt),N,$,pt,x,R)}w[D>>5]|=128<<D%32,w[(D+64>>>9<<4)+14]=D;let J=1732584193,tt=-271733879,nt=-1732584194,st=271733878;for(let N=0;N<w.length;N+=16){const $=J,at=tt,lt=nt,pt=st;J=G(J,tt,nt,st,w[N+0],7,-680876936),st=G(st,J,tt,nt,w[N+1],12,-389564586),nt=G(nt,st,J,tt,w[N+2],17,606105819),tt=G(tt,nt,st,J,w[N+3],22,-1044525330),J=G(J,tt,nt,st,w[N+4],7,-176418897),st=G(st,J,tt,nt,w[N+5],12,1200080426),nt=G(nt,st,J,tt,w[N+6],17,-1473231341),tt=G(tt,nt,st,J,w[N+7],22,-45705983),J=G(J,tt,nt,st,w[N+8],7,1770035416),st=G(st,J,tt,nt,w[N+9],12,-1958414417),nt=G(nt,st,J,tt,w[N+10],17,-42063),tt=G(tt,nt,st,J,w[N+11],22,-1990404162),J=G(J,tt,nt,st,w[N+12],7,1804603682),st=G(st,J,tt,nt,w[N+13],12,-40341101),nt=G(nt,st,J,tt,w[N+14],17,-1502002290),tt=G(tt,nt,st,J,w[N+15],22,1236535329),J=ut(J,tt,nt,st,w[N+1],5,-165796510),st=ut(st,J,tt,nt,w[N+6],9,-1069501632),nt=ut(nt,st,J,tt,w[N+11],14,643717713),tt=ut(tt,nt,st,J,w[N+0],20,-373897302),J=ut(J,tt,nt,st,w[N+5],5,-701558691),st=ut(st,J,tt,nt,w[N+10],9,38016083),nt=ut(nt,st,J,tt,w[N+15],14,-660478335),tt=ut(tt,nt,st,J,w[N+4],20,-405537848),J=ut(J,tt,nt,st,w[N+9],5,568446438),st=ut(st,J,tt,nt,w[N+14],9,-1019803690),nt=ut(nt,st,J,tt,w[N+3],14,-187363961),tt=ut(tt,nt,st,J,w[N+8],20,1163531501),J=ut(J,tt,nt,st,w[N+13],5,-1444681467),st=ut(st,J,tt,nt,w[N+2],9,-51403784),nt=ut(nt,st,J,tt,w[N+7],14,1735328473),tt=ut(tt,nt,st,J,w[N+12],20,-1926607734),J=ft(J,tt,nt,st,w[N+5],4,-378558),st=ft(st,J,tt,nt,w[N+8],11,-2022574463),nt=ft(nt,st,J,tt,w[N+11],16,1839030562),tt=ft(tt,nt,st,J,w[N+14],23,-35309556),J=ft(J,tt,nt,st,w[N+1],4,-1530992060),st=ft(st,J,tt,nt,w[N+4],11,1272893353),nt=ft(nt,st,J,tt,w[N+7],16,-155497632),tt=ft(tt,nt,st,J,w[N+10],23,-1094730640),J=ft(J,tt,nt,st,w[N+13],4,681279174),st=ft(st,J,tt,nt,w[N+0],11,-358537222),nt=ft(nt,st,J,tt,w[N+3],16,-722521979),tt=ft(tt,nt,st,J,w[N+6],23,76029189),J=ft(J,tt,nt,st,w[N+9],4,-640364487),st=ft(st,J,tt,nt,w[N+12],11,-421815835),nt=ft(nt,st,J,tt,w[N+15],16,530742520),tt=ft(tt,nt,st,J,w[N+2],23,-995338651),J=dt(J,tt,nt,st,w[N+0],6,-198630844),st=dt(st,J,tt,nt,w[N+7],10,1126891415),nt=dt(nt,st,J,tt,w[N+14],15,-1416354905),tt=dt(tt,nt,st,J,w[N+5],21,-57434055),J=dt(J,tt,nt,st,w[N+12],6,1700485571),st=dt(st,J,tt,nt,w[N+3],10,-1894986606),nt=dt(nt,st,J,tt,w[N+10],15,-1051523),tt=dt(tt,nt,st,J,w[N+1],21,-2054922799),J=dt(J,tt,nt,st,w[N+8],6,1873313359),st=dt(st,J,tt,nt,w[N+15],10,-30611744),nt=dt(nt,st,J,tt,w[N+6],15,-1560198380),tt=dt(tt,nt,st,J,w[N+13],21,1309151649),J=dt(J,tt,nt,st,w[N+4],6,-145523070),st=dt(st,J,tt,nt,w[N+11],10,-1120210379),nt=dt(nt,st,J,tt,w[N+2],15,718787259),tt=dt(tt,nt,st,J,w[N+9],21,-343485551),J=U(J,$),tt=U(tt,at),nt=U(nt,lt),st=U(st,pt)}return[J,tt,nt,st]},rt=function(w){return B(Y(b(w,{ibits:8,obits:32,obigendian:!1}),w.length*8),{ibits:32,ibigendian:!1})},H=function(w){this.mul=s(88,81,244,45,76,149,127,45),this.inc=s(20,5,123,126,247,103,129,79),this.mask=s(0,0,0,0,255,255,255,255),this.state=c(this.inc),this.next(),S(this.state,this.mask);let D;w!==void 0?w=y(w>>>0):typeof window=="object"&&typeof window.crypto=="object"&&typeof window.crypto.getRandomValues=="function"?(D=new Uint32Array(2),window.crypto.getRandomValues(D),w=C(y(D[0]>>>0),X(y(D[1]>>>0),32))):typeof globalThis=="object"&&typeof globalThis.crypto=="object"&&typeof globalThis.crypto.getRandomValues=="function"?(D=new Uint32Array(2),globalThis.crypto.getRandomValues(D),w=C(y(D[0]>>>0),X(y(D[1]>>>0),32))):(w=y(Math.random()*4294967295>>>0),C(w,X(y(new Date().getTime()),32))),C(this.state,w),this.next()};H.prototype.next=function(){const w=c(this.state);_(this.state,this.mul),m(this.state,this.inc);const D=c(w);X(D,18),L(D,w),X(D,27);const k=c(w);X(k,59),S(D,this.mask);const G=v(k),ut=c(D);return Z(ut,32-G),X(D,G),L(D,ut),v(D)},H.prototype.reseed=function(w){if(typeof w!="string")throw new Error("UUID: PCG: seed: invalid argument (string expected)");const D=F(b(w,{ibits:8,obits:32,obigendian:!0}),w.length*8);for(let k=0;k<D.length;k++)L(ht.state,y(D[k]>>>0))};const ht=new H;H.reseed=function(w){ht.reseed(w)};const E=function(w,D){const k=[];for(let G=0;G<w;G++)k[G]=ht.next()%D;return k};let P=0,q=0;const ot=function(){if(arguments.length===1&&typeof arguments[0]=="string")this.parse.apply(this,arguments);else if(arguments.length>=1&&typeof arguments[0]=="number")this.make.apply(this,arguments);else{if(arguments.length>=1)throw new Error("UUID: constructor: invalid arguments");for(let w=0;w<16;w++)this[w]=0}};return typeof Uint8Array<"u"?ot.prototype=new Uint8Array(16):typeof qt<"u"?ot.prototype=qt.alloc(16):ot.prototype=new Array(16),ot.prototype.constructor=ot,ot.prototype.make=function(w){let D;const k=this;if(w===1){const ut=new Date().getTime();ut!==P?q=0:q++,P=ut;const ft=y(ut);g(ft,1e3*10),m(ft,s(1,178,29,210,19,129,64,0)),q>0&&m(ft,y(q));let dt;dt=I(ft,8),k[3]=dt&255,dt=I(ft,8),k[2]=dt&255,dt=I(ft,8),k[1]=dt&255,dt=I(ft,8),k[0]=dt&255,dt=I(ft,8),k[5]=dt&255,dt=I(ft,8),k[4]=dt&255,dt=I(ft,8),k[7]=dt&255,dt=I(ft,8),k[6]=dt&15;const J=E(2,255);k[8]=J[0],k[9]=J[1];const tt=E(6,255);for(tt[0]|=3,D=0;D<6;D++)k[10+D]=tt[D]}else if(w===4){const G=E(16,255);for(D=0;D<16;D++)this[D]=G[D]}else if(w===3||w===5){let G="";const ut=typeof arguments[1]=="object"&&arguments[1]instanceof ot?arguments[1]:new ot().parse(arguments[1]);for(D=0;D<16;D++)G+=String.fromCharCode(ut[D]);G+=arguments[2];const ft=w===3?rt(G):z(G);for(D=0;D<16;D++)k[D]=ft.charCodeAt(D)}else throw new Error("UUID: make: invalid version");return k[6]&=15,k[6]|=w<<4,k[8]&=63,k[8]|=128,k},ot.prototype.format=function(w){let D,k;if(w==="z85")D=p(this,16);else if(w==="b16")k=new Array(32),et(this,0,15,!0,k,0),D=k.join("");else if(w===void 0||w==="std")k=new Array(36),et(this,0,3,!1,k,0),k[8]="-",et(this,4,5,!1,k,9),k[13]="-",et(this,6,7,!1,k,14),k[18]="-",et(this,8,9,!1,k,19),k[23]="-",et(this,10,15,!1,k,24),D=k.join("");else throw new Error("UUID: format: invalid type argument");return D},ot.prototype.toString=function(w){return this.format(w)},ot.prototype.toJSON=function(){return this.format("std")},ot.prototype.parse=function(w,D){if(typeof w!="string")throw new Error("UUID: parse: invalid argument (type string expected)");if(D==="z85")l(w,this);else if(D==="b16")a(w,0,35,this,0);else if(D===void 0||D==="std"){const k={nil:"00000000-0000-0000-0000-000000000000","ns:DNS":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","ns:URL":"6ba7b811-9dad-11d1-80b4-00c04fd430c8","ns:OID":"6ba7b812-9dad-11d1-80b4-00c04fd430c8","ns:X500":"6ba7b814-9dad-11d1-80b4-00c04fd430c8"};if(k[w]!==void 0)w=k[w];else if(!w.match(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))throw new Error('UUID: parse: invalid string representation (expected "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")');a(w,0,7,this,0),a(w,9,12,this,4),a(w,14,17,this,6),a(w,19,22,this,8),a(w,24,35,this,10)}return this},ot.prototype.export=function(){const w=new Array(16);for(let D=0;D<16;D++)w[D]=this[D];return w},ot.prototype.import=function(w){if(!(typeof w=="object"&&w instanceof Array))throw new Error("UUID: import: invalid argument (type Array expected)");if(w.length!==16)throw new Error("UUID: import: invalid argument (Array of length 16 expected)");for(let D=0;D<16;D++){if(typeof w[D]!="number")throw new Error("UUID: import: invalid array element #"+D+" (type Number expected)");if(!(isFinite(w[D])&&Math.floor(w[D])===w[D]))throw new Error("UUID: import: invalid array element #"+D+" (Number with integer value expected)");if(!(w[D]>=0&&w[D]<=255))throw new Error("UUID: import: invalid array element #"+D+" (Number with integer value in range 0...255 expected)");this[D]=w[D]}return this},ot.prototype.compare=function(w){if(typeof w!="object")throw new Error("UUID: compare: invalid argument (type UUID expected)");if(!(w instanceof ot))throw new Error("UUID: compare: invalid argument (type UUID expected)");for(let D=0;D<16;D++){if(this[D]<w[D])return-1;if(this[D]>w[D])return 1}return 0},ot.prototype.equal=function(w){return this.compare(w)===0},ot.prototype.fold=function(w){if(typeof w>"u")throw new Error("UUID: fold: invalid argument (number of fold operations expected)");if(w<1||w>4)throw new Error("UUID: fold: invalid argument (1-4 fold operations expected)");const D=16/Math.pow(2,w),k=new Array(D);for(let G=0;G<D;G++){let ut=0;for(let ft=0;G+ft<16;ft+=D)ut^=this[G+ft];k[G]=ut}return k},ot.PCG=H,ot})})(Lt)),Lt.exports}var ye=pe();const Qt=Ut(ye),Ot=Object.prototype.hasOwnProperty,Gt=typeof Number.isSafeInteger=="function"?Number.isSafeInteger:function(K){return typeof K=="number"&&isFinite(K)&&K===Math.floor(K)&&Math.abs(K)<=9007199254740991};class Rt{constructor(){this.jsonrpc="2.0"}serialize(){return JSON.stringify(this)}}Rt.VERSION="2.0";class Wt extends Rt{constructor(et,a,O){super(),this.id=et,this.method=a,O!==void 0&&(this.params=O)}}class Yt extends Rt{constructor(et,a){super(),this.method=et,a!==void 0&&(this.params=a)}}class Ht extends Rt{constructor(et,a){super(),this.id=et,this.result=a}}class $t extends Rt{constructor(et,a){super(),this.id=et,this.error=a,this.id=et,this.error=a}}class kt{constructor(et,a){this.payload=et,this.type=a,this.payload=et,this.type=a}}class gt{constructor(et,a,O){this.message=et,this.code=Gt(a)?a:0,O!=null&&(this.data=O)}}gt.invalidRequest=function(K){return new gt("Invalid request",-32600,K)},gt.methodNotFound=function(K){return new gt("Method not found",-32601,K)},gt.invalidParams=function(K){return new gt("Invalid params",-32602,K)},gt.internalError=function(K){return new gt("Internal error",-32603,K)},gt.parseError=function(K){return new gt("Parse error",-32700,K)};function ge(K,et,a){const O=new Wt(K,et,a);return Tt(O,!0),O}function be(K,et){const a=new Yt(K,et);return Tt(a,!0),a}function we(K,et){const a=new Ht(K,et);return Tt(a,!0),a}function me(K,et){const a=new $t(K,et);return Tt(a,!0),a}function te(K){if(!Pt(K))return new kt(gt.invalidRequest(K),"invalid");let et;try{et=JSON.parse(K)}catch{return new kt(gt.parseError(K),"invalid")}return ee(et)}function ee(K){if(!Array.isArray(K))return Vt(K);if(K.length===0)return new kt(gt.invalidRequest(K),"invalid");const et=[];for(let a=0,O=K.length;a<O;a++)et[a]=Vt(K[a]);return et}const Ee=te;function Vt(K){let et=null,a=null,O="invalid";if(K==null||K.jsonrpc!==Rt.VERSION)et=gt.invalidRequest(K),O="invalid";else if(Ot.call(K,"id")){if(Ot.call(K,"method")){const M=K;a=new Wt(M.id,M.method,M.params),et=Tt(a),O="request"}else if(Ot.call(K,"result")){const M=K;a=new Ht(M.id,M.result),et=Tt(a),O="success"}else if(Ot.call(K,"error")){const M=K;if(O="error",M.error==null)et=gt.internalError(M);else{const p=new gt(M.error.message,M.error.code,M.error.data);p.message!==M.error.message||p.code!==M.error.code?et=gt.internalError(M):(a=new $t(M.id,p),et=Tt(a))}}}else{const M=K;a=new Yt(M.method,M.params),et=Tt(a),O="notification"}return et==null&&a!=null?new kt(a,O):new kt(et??gt.invalidRequest(K),"invalid")}function Tt(K,et){let a=null;if(K instanceof Wt?(a=zt(K.id),a==null&&(a=re(K.method)),a==null&&(a=ne(K.params))):K instanceof Yt?(a=re(K.method),a==null&&(a=ne(K.params))):K instanceof Ht?(a=zt(K.id),a==null&&(a=ve(K.result))):K instanceof $t&&(a=zt(K.id,!0),a==null&&(a=_e(K.error))),et&&a!=null)throw a;return a}function zt(K,et){return et&&K===null||Pt(K)||Gt(K)?null:gt.internalError('"id" must be provided, a string or an integer.')}function re(K){return Pt(K)?null:gt.invalidRequest(K)}function ve(K){return K===void 0?gt.internalError("Result must exist for success Response objects"):null}function ne(K){if(K===void 0)return null;if(Array.isArray(K)||Be(K))try{return JSON.stringify(K),null}catch{return gt.parseError(K)}return gt.invalidParams(K)}function _e(K){return K instanceof gt?Gt(K.code)?Pt(K.message)?null:gt.internalError("Message must exist or must be a string."):gt.internalError("Invalid error code. It must be an integer."):gt.internalError("Error must be an instance of JsonRpcError")}function Pt(K){return K!==""&&typeof K=="string"}function Be(K){return K!=null&&typeof K=="object"&&!Array.isArray(K)}const Mt={JsonRpc:Rt,JsonRpcError:gt,request:ge,notification:be,success:we,error:me,parse:te,parseObject:Vt,parseJsonRpcObject:ee,parseJsonRpcString:Ee};function Ct(K){throw new Error('Could not dynamically require "'+K+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Kt={exports:{}},ie;function xe(){return ie||(ie=1,(function(K,et){(function(a){K.exports=a()})(function(){return(function(){function a(O,M,p){function l(u,t){if(!M[u]){if(!O[u]){var n=typeof Ct=="function"&&Ct;if(!t&&n)return n(u,!0);if(b)return b(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var d=M[u]={exports:{}};O[u][0].call(d.exports,function(c){var y=O[u][1][c];return l(y||c)},d,d.exports,a,O,M,p)}return M[u].exports}for(var b=typeof Ct=="function"&&Ct,B=0;B<p.length;B++)l(p[B]);return l}return a})()({1:[function(a,O,M){M.byteLength=s,M.toByteArray=c,M.fromByteArray=m;for(var p=[],l=[],b=typeof Uint8Array<"u"?Uint8Array:Array,B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,t=B.length;u<t;++u)p[u]=B[u],l[B.charCodeAt(u)]=u;function n(g){var _=g.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=g.indexOf("=");return S===-1&&(S=_),[S,S===_?0:4-S%4]}function s(g){var _=n(g),S=_[0],C=_[1];return 3*(S+C)/4-C}function d(g,_,S){return 3*(_+S)/4-S}function c(g){var _,S,C=n(g),I=C[0],X=C[1],Z=new b(d(g,I,X)),L=0,U=X>0?I-4:I;for(S=0;S<U;S+=4)_=l[g.charCodeAt(S)]<<18|l[g.charCodeAt(S+1)]<<12|l[g.charCodeAt(S+2)]<<6|l[g.charCodeAt(S+3)],Z[L++]=_>>16&255,Z[L++]=_>>8&255,Z[L++]=255&_;return X===2&&(_=l[g.charCodeAt(S)]<<2|l[g.charCodeAt(S+1)]>>4,Z[L++]=255&_),X===1&&(_=l[g.charCodeAt(S)]<<10|l[g.charCodeAt(S+1)]<<4|l[g.charCodeAt(S+2)]>>2,Z[L++]=_>>8&255,Z[L++]=255&_),Z}function y(g){return p[g>>18&63]+p[g>>12&63]+p[g>>6&63]+p[63&g]}function v(g,_,S){for(var C,I=[],X=_;X<S;X+=3)C=(g[X]<<16&16711680)+(g[X+1]<<8&65280)+(255&g[X+2]),I.push(y(C));return I.join("")}function m(g){for(var _,S=g.length,C=S%3,I=[],X=0,Z=S-C;X<Z;X+=16383)I.push(v(g,X,X+16383>Z?Z:X+16383));return C===1?(_=g[S-1],I.push(p[_>>2]+p[_<<4&63]+"==")):C===2&&(_=(g[S-2]<<8)+g[S-1],I.push(p[_>>10]+p[_>>4&63]+p[_<<2&63]+"=")),I.join("")}l[45]=62,l[95]=63},{}],2:[function(a,O,M){},{}],3:[function(a,O,M){(function(p){(function(){var l=a("base64-js"),b=a("ieee754");M.Buffer=n,M.SlowBuffer=C,M.INSPECT_MAX_BYTES=50;var B=2147483647;function u(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e.foo()===42}catch{return!1}}function t(e){if(e>B)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return o.__proto__=n.prototype,o}function n(e,o,h){if(typeof e=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(e)}return s(e,o,h)}function s(e,o,h){if(typeof e=="string")return v(e,o);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(x(e,ArrayBuffer)||e&&x(e.buffer,ArrayBuffer))return g(e,o,h);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var j=e.valueOf&&e.valueOf();if(j!=null&&j!==e)return n.from(j,o,h);var V=_(e);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return n.from(e[Symbol.toPrimitive]("string"),o,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,o,h){return d(e),e<=0?t(e):o!==void 0?typeof h=="string"?t(e).fill(o,h):t(e).fill(o):t(e)}function y(e){return d(e),t(e<0?0:0|S(e))}function v(e,o){if(typeof o=="string"&&o!==""||(o="utf8"),!n.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var h=0|I(e,o),j=t(h),V=j.write(e,o);return V!==h&&(j=j.slice(0,V)),j}function m(e){for(var o=e.length<0?0:0|S(e.length),h=t(o),j=0;j<o;j+=1)h[j]=255&e[j];return h}function g(e,o,h){if(o<0||e.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<o+(h||0))throw new RangeError('"length" is outside of buffer bounds');var j;return(j=o===void 0&&h===void 0?new Uint8Array(e):h===void 0?new Uint8Array(e,o):new Uint8Array(e,o,h)).__proto__=n.prototype,j}function _(e){if(n.isBuffer(e)){var o=0|S(e.length),h=t(o);return h.length===0||e.copy(h,0,0,o),h}return e.length!==void 0?typeof e.length!="number"||R(e.length)?t(0):m(e):e.type==="Buffer"&&Array.isArray(e.data)?m(e.data):void 0}function S(e){if(e>=B)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+B.toString(16)+" bytes");return 0|e}function C(e){return+e!=e&&(e=0),n.alloc(+e)}function I(e,o){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||x(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var h=e.length,j=arguments.length>2&&arguments[2]===!0;if(!j&&h===0)return 0;for(var V=!1;;)switch(o){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*h;case"hex":return h>>>1;case"base64":return lt(e).length;default:if(V)return j?-1:N(e).length;o=(""+o).toLowerCase(),V=!0}}function X(e,o,h){var j=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0)<=(o>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,o,h);case"utf8":case"utf-8":return E(this,o,h);case"ascii":return ot(this,o,h);case"latin1":case"binary":return w(this,o,h);case"base64":return ht(this,o,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,o,h);default:if(j)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),j=!0}}function Z(e,o,h){var j=e[o];e[o]=e[h],e[h]=j}function L(e,o,h,j,V){if(e.length===0)return-1;if(typeof h=="string"?(j=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),R(h=+h)&&(h=V?0:e.length-1),h<0&&(h=e.length+h),h>=e.length){if(V)return-1;h=e.length-1}else if(h<0){if(!V)return-1;h=0}if(typeof o=="string"&&(o=n.from(o,j)),n.isBuffer(o))return o.length===0?-1:U(e,o,h,j,V);if(typeof o=="number")return o&=255,typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(e,o,h):Uint8Array.prototype.lastIndexOf.call(e,o,h):U(e,[o],h,j,V);throw new TypeError("val must be string, number or Buffer")}function U(e,o,h,j,V){var it,yt=1,mt=e.length,wt=o.length;if(j!==void 0&&((j=String(j).toLowerCase())==="ucs2"||j==="ucs-2"||j==="utf16le"||j==="utf-16le")){if(e.length<2||o.length<2)return-1;yt=2,mt/=2,wt/=2,h/=2}function _t(A,W){return yt===1?A[W]:A.readUInt16BE(W*yt)}if(V){var f=-1;for(it=h;it<mt;it++)if(_t(e,it)===_t(o,f===-1?0:it-f)){if(f===-1&&(f=it),it-f+1===wt)return f*yt}else f!==-1&&(it-=it-f),f=-1}else for(h+wt>mt&&(h=mt-wt),it=h;it>=0;it--){for(var r=!0,i=0;i<wt;i++)if(_t(e,it+i)!==_t(o,i)){r=!1;break}if(r)return it}return-1}function T(e,o,h,j){h=Number(h)||0;var V=e.length-h;j?(j=Number(j))>V&&(j=V):j=V;var it=o.length;j>it/2&&(j=it/2);for(var yt=0;yt<j;++yt){var mt=parseInt(o.substr(2*yt,2),16);if(R(mt))return yt;e[h+yt]=mt}return yt}function F(e,o,h,j){return pt(N(o,e.length-h),e,h,j)}function z(e,o,h,j){return pt($(o),e,h,j)}function Y(e,o,h,j){return z(e,o,h,j)}function rt(e,o,h,j){return pt(lt(o),e,h,j)}function H(e,o,h,j){return pt(at(o,e.length-h),e,h,j)}function ht(e,o,h){return o===0&&h===e.length?l.fromByteArray(e):l.fromByteArray(e.slice(o,h))}function E(e,o,h){h=Math.min(e.length,h);for(var j=[],V=o;V<h;){var it,yt,mt,wt,_t=e[V],f=null,r=_t>239?4:_t>223?3:_t>191?2:1;if(V+r<=h)switch(r){case 1:_t<128&&(f=_t);break;case 2:(192&(it=e[V+1]))==128&&(wt=(31&_t)<<6|63&it)>127&&(f=wt);break;case 3:it=e[V+1],yt=e[V+2],(192&it)==128&&(192&yt)==128&&(wt=(15&_t)<<12|(63&it)<<6|63&yt)>2047&&(wt<55296||wt>57343)&&(f=wt);break;case 4:it=e[V+1],yt=e[V+2],mt=e[V+3],(192&it)==128&&(192&yt)==128&&(192&mt)==128&&(wt=(15&_t)<<18|(63&it)<<12|(63&yt)<<6|63&mt)>65535&&wt<1114112&&(f=wt)}f===null?(f=65533,r=1):f>65535&&(f-=65536,j.push(f>>>10&1023|55296),f=56320|1023&f),j.push(f),V+=r}return q(j)}M.kMaxLength=B,n.TYPED_ARRAY_SUPPORT=u(),n.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."),Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.poolSize=8192,n.from=function(e,o,h){return s(e,o,h)},n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,n.alloc=function(e,o,h){return c(e,o,h)},n.allocUnsafe=function(e){return y(e)},n.allocUnsafeSlow=function(e){return y(e)},n.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==n.prototype},n.compare=function(e,o){if(x(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),x(o,Uint8Array)&&(o=n.from(o,o.offset,o.byteLength)),!n.isBuffer(e)||!n.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===o)return 0;for(var h=e.length,j=o.length,V=0,it=Math.min(h,j);V<it;++V)if(e[V]!==o[V]){h=e[V],j=o[V];break}return h<j?-1:j<h?1:0},n.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}},n.concat=function(e,o){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return n.alloc(0);var h;if(o===void 0)for(o=0,h=0;h<e.length;++h)o+=e[h].length;var j=n.allocUnsafe(o),V=0;for(h=0;h<e.length;++h){var it=e[h];if(x(it,Uint8Array)&&(it=n.from(it)),!n.isBuffer(it))throw new TypeError('"list" argument must be an Array of Buffers');it.copy(j,V),V+=it.length}return j},n.byteLength=I,n.prototype._isBuffer=!0,n.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<e;o+=2)Z(this,o,o+1);return this},n.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<e;o+=4)Z(this,o,o+3),Z(this,o+1,o+2);return this},n.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<e;o+=8)Z(this,o,o+7),Z(this,o+1,o+6),Z(this,o+2,o+5),Z(this,o+3,o+4);return this},n.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?E(this,0,e):X.apply(this,arguments)},n.prototype.toLocaleString=n.prototype.toString,n.prototype.equals=function(e){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||n.compare(this,e)===0},n.prototype.inspect=function(){var e="",o=M.INSPECT_MAX_BYTES;return e=this.toString("hex",0,o).replace(/(.{2})/g,"$1 ").trim(),this.length>o&&(e+=" ... "),"<Buffer "+e+">"},n.prototype.compare=function(e,o,h,j,V){if(x(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(o===void 0&&(o=0),h===void 0&&(h=e?e.length:0),j===void 0&&(j=0),V===void 0&&(V=this.length),o<0||h>e.length||j<0||V>this.length)throw new RangeError("out of range index");if(j>=V&&o>=h)return 0;if(j>=V)return-1;if(o>=h)return 1;if(this===e)return 0;for(var it=(V>>>=0)-(j>>>=0),yt=(h>>>=0)-(o>>>=0),mt=Math.min(it,yt),wt=this.slice(j,V),_t=e.slice(o,h),f=0;f<mt;++f)if(wt[f]!==_t[f]){it=wt[f],yt=_t[f];break}return it<yt?-1:yt<it?1:0},n.prototype.includes=function(e,o,h){return this.indexOf(e,o,h)!==-1},n.prototype.indexOf=function(e,o,h){return L(this,e,o,h,!0)},n.prototype.lastIndexOf=function(e,o,h){return L(this,e,o,h,!1)},n.prototype.write=function(e,o,h,j){if(o===void 0)j="utf8",h=this.length,o=0;else if(h===void 0&&typeof o=="string")j=o,h=this.length,o=0;else{if(!isFinite(o))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");o>>>=0,isFinite(h)?(h>>>=0,j===void 0&&(j="utf8")):(j=h,h=void 0)}var V=this.length-o;if((h===void 0||h>V)&&(h=V),e.length>0&&(h<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");j||(j="utf8");for(var it=!1;;)switch(j){case"hex":return T(this,e,o,h);case"utf8":case"utf-8":return F(this,e,o,h);case"ascii":return z(this,e,o,h);case"latin1":case"binary":return Y(this,e,o,h);case"base64":return rt(this,e,o,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,e,o,h);default:if(it)throw new TypeError("Unknown encoding: "+j);j=(""+j).toLowerCase(),it=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function q(e){var o=e.length;if(o<=P)return String.fromCharCode.apply(String,e);for(var h="",j=0;j<o;)h+=String.fromCharCode.apply(String,e.slice(j,j+=P));return h}function ot(e,o,h){var j="";h=Math.min(e.length,h);for(var V=o;V<h;++V)j+=String.fromCharCode(127&e[V]);return j}function w(e,o,h){var j="";h=Math.min(e.length,h);for(var V=o;V<h;++V)j+=String.fromCharCode(e[V]);return j}function D(e,o,h){var j=e.length;(!o||o<0)&&(o=0),(!h||h<0||h>j)&&(h=j);for(var V="",it=o;it<h;++it)V+=st(e[it]);return V}function k(e,o,h){for(var j=e.slice(o,h),V="",it=0;it<j.length;it+=2)V+=String.fromCharCode(j[it]+256*j[it+1]);return V}function G(e,o,h){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+o>h)throw new RangeError("Trying to access beyond buffer length")}function ut(e,o,h,j,V,it){if(!n.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>V||o<it)throw new RangeError('"value" argument is out of bounds');if(h+j>e.length)throw new RangeError("Index out of range")}function ft(e,o,h,j,V,it){if(h+j>e.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function dt(e,o,h,j,V){return o=+o,h>>>=0,V||ft(e,o,h,4),b.write(e,o,h,j,23,4),h+4}function J(e,o,h,j,V){return o=+o,h>>>=0,V||ft(e,o,h,8),b.write(e,o,h,j,52,8),h+8}n.prototype.slice=function(e,o){var h=this.length;(e=~~e)<0?(e+=h)<0&&(e=0):e>h&&(e=h),(o=o===void 0?h:~~o)<0?(o+=h)<0&&(o=0):o>h&&(o=h),o<e&&(o=e);var j=this.subarray(e,o);return j.__proto__=n.prototype,j},n.prototype.readUIntLE=function(e,o,h){e>>>=0,o>>>=0,h||G(e,o,this.length);for(var j=this[e],V=1,it=0;++it<o&&(V*=256);)j+=this[e+it]*V;return j},n.prototype.readUIntBE=function(e,o,h){e>>>=0,o>>>=0,h||G(e,o,this.length);for(var j=this[e+--o],V=1;o>0&&(V*=256);)j+=this[e+--o]*V;return j},n.prototype.readUInt8=function(e,o){return e>>>=0,o||G(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,o){return e>>>=0,o||G(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,o){return e>>>=0,o||G(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,o){return e>>>=0,o||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,o){return e>>>=0,o||G(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,o,h){e>>>=0,o>>>=0,h||G(e,o,this.length);for(var j=this[e],V=1,it=0;++it<o&&(V*=256);)j+=this[e+it]*V;return j>=(V*=128)&&(j-=Math.pow(2,8*o)),j},n.prototype.readIntBE=function(e,o,h){e>>>=0,o>>>=0,h||G(e,o,this.length);for(var j=o,V=1,it=this[e+--j];j>0&&(V*=256);)it+=this[e+--j]*V;return it>=(V*=128)&&(it-=Math.pow(2,8*o)),it},n.prototype.readInt8=function(e,o){return e>>>=0,o||G(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,o){e>>>=0,o||G(e,2,this.length);var h=this[e]|this[e+1]<<8;return 32768&h?4294901760|h:h},n.prototype.readInt16BE=function(e,o){e>>>=0,o||G(e,2,this.length);var h=this[e+1]|this[e]<<8;return 32768&h?4294901760|h:h},n.prototype.readInt32LE=function(e,o){return e>>>=0,o||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,o){return e>>>=0,o||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,o){return e>>>=0,o||G(e,4,this.length),b.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,o){return e>>>=0,o||G(e,4,this.length),b.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,o){return e>>>=0,o||G(e,8,this.length),b.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,o){return e>>>=0,o||G(e,8,this.length),b.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,o,h,j){e=+e,o>>>=0,h>>>=0,j||ut(this,e,o,h,Math.pow(2,8*h)-1,0);var V=1,it=0;for(this[o]=255&e;++it<h&&(V*=256);)this[o+it]=e/V&255;return o+h},n.prototype.writeUIntBE=function(e,o,h,j){e=+e,o>>>=0,h>>>=0,j||ut(this,e,o,h,Math.pow(2,8*h)-1,0);var V=h-1,it=1;for(this[o+V]=255&e;--V>=0&&(it*=256);)this[o+V]=e/it&255;return o+h},n.prototype.writeUInt8=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,1,255,0),this[o]=255&e,o+1},n.prototype.writeUInt16LE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,2,65535,0),this[o]=255&e,this[o+1]=e>>>8,o+2},n.prototype.writeUInt16BE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,2,65535,0),this[o]=e>>>8,this[o+1]=255&e,o+2},n.prototype.writeUInt32LE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,4,4294967295,0),this[o+3]=e>>>24,this[o+2]=e>>>16,this[o+1]=e>>>8,this[o]=255&e,o+4},n.prototype.writeUInt32BE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,4,4294967295,0),this[o]=e>>>24,this[o+1]=e>>>16,this[o+2]=e>>>8,this[o+3]=255&e,o+4},n.prototype.writeIntLE=function(e,o,h,j){if(e=+e,o>>>=0,!j){var V=Math.pow(2,8*h-1);ut(this,e,o,h,V-1,-V)}var it=0,yt=1,mt=0;for(this[o]=255&e;++it<h&&(yt*=256);)e<0&&mt===0&&this[o+it-1]!==0&&(mt=1),this[o+it]=(e/yt>>0)-mt&255;return o+h},n.prototype.writeIntBE=function(e,o,h,j){if(e=+e,o>>>=0,!j){var V=Math.pow(2,8*h-1);ut(this,e,o,h,V-1,-V)}var it=h-1,yt=1,mt=0;for(this[o+it]=255&e;--it>=0&&(yt*=256);)e<0&&mt===0&&this[o+it+1]!==0&&(mt=1),this[o+it]=(e/yt>>0)-mt&255;return o+h},n.prototype.writeInt8=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,1,127,-128),e<0&&(e=255+e+1),this[o]=255&e,o+1},n.prototype.writeInt16LE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,2,32767,-32768),this[o]=255&e,this[o+1]=e>>>8,o+2},n.prototype.writeInt16BE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,2,32767,-32768),this[o]=e>>>8,this[o+1]=255&e,o+2},n.prototype.writeInt32LE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,4,2147483647,-2147483648),this[o]=255&e,this[o+1]=e>>>8,this[o+2]=e>>>16,this[o+3]=e>>>24,o+4},n.prototype.writeInt32BE=function(e,o,h){return e=+e,o>>>=0,h||ut(this,e,o,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[o]=e>>>24,this[o+1]=e>>>16,this[o+2]=e>>>8,this[o+3]=255&e,o+4},n.prototype.writeFloatLE=function(e,o,h){return dt(this,e,o,!0,h)},n.prototype.writeFloatBE=function(e,o,h){return dt(this,e,o,!1,h)},n.prototype.writeDoubleLE=function(e,o,h){return J(this,e,o,!0,h)},n.prototype.writeDoubleBE=function(e,o,h){return J(this,e,o,!1,h)},n.prototype.copy=function(e,o,h,j){if(!n.isBuffer(e))throw new TypeError("argument should be a Buffer");if(h||(h=0),j||j===0||(j=this.length),o>=e.length&&(o=e.length),o||(o=0),j>0&&j<h&&(j=h),j===h||e.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(h<0||h>=this.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("sourceEnd out of bounds");j>this.length&&(j=this.length),e.length-o<j-h&&(j=e.length-o+h);var V=j-h;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(o,h,j);else if(this===e&&h<o&&o<j)for(var it=V-1;it>=0;--it)e[it+o]=this[it+h];else Uint8Array.prototype.set.call(e,this.subarray(h,j),o);return V},n.prototype.fill=function(e,o,h,j){if(typeof e=="string"){if(typeof o=="string"?(j=o,o=0,h=this.length):typeof h=="string"&&(j=h,h=this.length),j!==void 0&&typeof j!="string")throw new TypeError("encoding must be a string");if(typeof j=="string"&&!n.isEncoding(j))throw new TypeError("Unknown encoding: "+j);if(e.length===1){var V=e.charCodeAt(0);(j==="utf8"&&V<128||j==="latin1")&&(e=V)}}else typeof e=="number"&&(e&=255);if(o<0||this.length<o||this.length<h)throw new RangeError("Out of range index");if(h<=o)return this;var it;if(o>>>=0,h=h===void 0?this.length:h>>>0,e||(e=0),typeof e=="number")for(it=o;it<h;++it)this[it]=e;else{var yt=n.isBuffer(e)?e:n.from(e,j),mt=yt.length;if(mt===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(it=0;it<h-o;++it)this[it+o]=yt[it%mt]}return this};var tt=/[^+/0-9A-Za-z-_]/g;function nt(e){if((e=(e=e.split("=")[0]).trim().replace(tt,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function st(e){return e<16?"0"+e.toString(16):e.toString(16)}function N(e,o){var h;o=o||1/0;for(var j=e.length,V=null,it=[],yt=0;yt<j;++yt){if((h=e.charCodeAt(yt))>55295&&h<57344){if(!V){if(h>56319){(o-=3)>-1&&it.push(239,191,189);continue}if(yt+1===j){(o-=3)>-1&&it.push(239,191,189);continue}V=h;continue}if(h<56320){(o-=3)>-1&&it.push(239,191,189),V=h;continue}h=65536+(V-55296<<10|h-56320)}else V&&(o-=3)>-1&&it.push(239,191,189);if(V=null,h<128){if((o-=1)<0)break;it.push(h)}else if(h<2048){if((o-=2)<0)break;it.push(h>>6|192,63&h|128)}else if(h<65536){if((o-=3)<0)break;it.push(h>>12|224,h>>6&63|128,63&h|128)}else{if(!(h<1114112))throw new Error("Invalid code point");if((o-=4)<0)break;it.push(h>>18|240,h>>12&63|128,h>>6&63|128,63&h|128)}}return it}function $(e){for(var o=[],h=0;h<e.length;++h)o.push(255&e.charCodeAt(h));return o}function at(e,o){for(var h,j,V,it=[],yt=0;yt<e.length&&!((o-=2)<0);++yt)j=(h=e.charCodeAt(yt))>>8,V=h%256,it.push(V),it.push(j);return it}function lt(e){return l.toByteArray(nt(e))}function pt(e,o,h,j){for(var V=0;V<j&&!(V+h>=o.length||V>=e.length);++V)o[V+h]=e[V];return V}function x(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function R(e){return e!=e}}).call(this)}).call(this,a("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:19}],4:[function(a,O,M){const p=a("./commented"),l=a("./diagnose"),b=a("./decoder"),B=a("./encoder"),u=a("./simple"),t=a("./tagged"),n=a("./map"),s=a("./sharedValueEncoder");O.exports={Commented:p,Diagnose:l,Decoder:b,Encoder:B,Simple:u,Tagged:t,Map:n,SharedValueEncoder:s,comment:p.comment,decodeAll:b.decodeAll,decodeFirst:b.decodeFirst,decodeAllSync:b.decodeAllSync,decodeFirstSync:b.decodeFirstSync,diagnose:l.diagnose,encode:B.encode,encodeCanonical:B.encodeCanonical,encodeOne:B.encodeOne,encodeAsync:B.encodeAsync,decode:b.decodeFirstSync,leveldb:{decode:b.decodeFirstSync,encode:B.encode,buffer:!0,name:"cbor"},reset(){B.reset(),t.reset()}}},{"./commented":5,"./decoder":7,"./diagnose":8,"./encoder":9,"./map":10,"./sharedValueEncoder":12,"./simple":13,"./tagged":14}],5:[function(a,O,M){const p=a("stream"),l=a("./utils"),b=a("./decoder"),B=a("nofilter"),{MT:u,NUMBYTES:t,SYMS:n}=a("./constants"),{Buffer:s}=a("buffer");function d(v){return v>1?"s":""}function c(v,m){switch(typeof v){case"function":return{options:{},cb:v};case"string":return{options:{encoding:v},cb:m};case"number":return{options:{max_depth:v},cb:m};case"object":return{options:v||{},cb:m};default:throw new TypeError("Unknown option type")}}class y extends p.Transform{constructor(m={}){const{depth:g=1,max_depth:_=10,no_summary:S=!1,tags:C={},preferWeb:I,encoding:X,...Z}=m;super({...Z,readableObjectMode:!1,writableObjectMode:!1}),this.depth=g,this.max_depth=_,this.all=new B,C[24]||(C[24]=this._tag_24.bind(this)),this.parser=new b({tags:C,max_depth:_,preferWeb:I,encoding:X}),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("start-string",this._on_start_string.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("error",this._on_error.bind(this)),S||this.parser.on("data",this._on_data.bind(this)),this.parser.bs.on("read",this._on_read.bind(this))}_tag_24(m){const g=new y({depth:this.depth+1,no_summary:!0});g.on("data",_=>this.push(_)),g.on("error",_=>this.emit("error",_)),g.end(m)}_transform(m,g,_){this.parser.write(m,g,_)}_flush(m){return this.parser._flush(m)}static comment(m,g={},_=null){if(m==null)throw new Error("input required");({options:g,cb:_}=c(g,_));const S=new B,{encoding:C="hex",...I}=g,X=new y(I);let Z=null;return typeof _=="function"?(X.on("end",()=>{_(null,S.toString("utf8"))}),X.on("error",_)):Z=new Promise((L,U)=>{X.on("end",()=>{L(S.toString("utf8"))}),X.on("error",U)}),X.pipe(S),l.guessEncoding(m,C).pipe(X),Z}_on_error(m){this.push("ERROR: "),this.push(m.toString()),this.push(`
2
+ `)}_on_read(m){this.all.write(m);const g=m.toString("hex");this.push(new Array(this.depth+1).join(" ")),this.push(g);let _=2*(this.max_depth-this.depth)-g.length;_<1&&(_=1),this.push(new Array(_+1).join(" ")),this.push("-- ")}_on_more(m,g,_,S){let C="";switch(this.depth++,m){case u.POS_INT:C="Positive number,";break;case u.NEG_INT:C="Negative number,";break;case u.ARRAY:C="Array, length";break;case u.MAP:C="Map, count";break;case u.BYTE_STRING:C="Bytes, length";break;case u.UTF8_STRING:C="String, length";break;case u.SIMPLE_FLOAT:C=g===1?"Simple value,":"Float,"}this.push(`${C} next ${g} byte${d(g)}
3
+ `)}_on_start_string(m,g,_,S){let C="";switch(this.depth++,m){case u.BYTE_STRING:C=`Bytes, length: ${g}`;break;case u.UTF8_STRING:C=`String, length: ${g.toString()}`}this.push(`${C}
4
+ `)}_on_start(m,g,_,S){switch(this.depth++,_){case u.ARRAY:this.push(`[${S}], `);break;case u.MAP:S%2?this.push(`{Val:${Math.floor(S/2)}}, `):this.push(`{Key:${Math.floor(S/2)}}, `)}switch(m){case u.TAG:this.push(`Tag #${g}`),g===24&&this.push(" Encoded CBOR data item");break;case u.ARRAY:g===n.STREAM?this.push("Array (streaming)"):this.push(`Array, ${g} item${d(g)}`);break;case u.MAP:g===n.STREAM?this.push("Map (streaming)"):this.push(`Map, ${g} pair${d(g)}`);break;case u.BYTE_STRING:this.push("Bytes (streaming)");break;case u.UTF8_STRING:this.push("String (streaming)")}this.push(`
5
+ `)}_on_stop(m){this.depth--}_on_value(m,g,_,S){if(m!==n.BREAK)switch(g){case u.ARRAY:this.push(`[${_}], `);break;case u.MAP:_%2?this.push(`{Val:${Math.floor(_/2)}}, `):this.push(`{Key:${Math.floor(_/2)}}, `)}const C=l.cborValueToString(m,-1/0);switch(typeof m=="string"||s.isBuffer(m)?(m.length>0&&(this.push(C),this.push(`
6
+ `)),this.depth--):(this.push(C),this.push(`
7
+ `)),S){case t.ONE:case t.TWO:case t.FOUR:case t.EIGHT:this.depth--}}_on_data(){this.push("0x"),this.push(this.all.read().toString("hex")),this.push(`
8
+ `)}}O.exports=y},{"./constants":6,"./decoder":7,"./utils":15,buffer:3,nofilter:51,stream:54}],6:[function(a,O,M){M.MT={POS_INT:0,NEG_INT:1,BYTE_STRING:2,UTF8_STRING:3,ARRAY:4,MAP:5,TAG:6,SIMPLE_FLOAT:7},M.TAG={DATE_STRING:0,DATE_EPOCH:1,POS_BIGINT:2,NEG_BIGINT:3,DECIMAL_FRAC:4,BIGFLOAT:5,BASE64URL_EXPECTED:21,BASE64_EXPECTED:22,BASE16_EXPECTED:23,CBOR:24,URI:32,BASE64URL:33,BASE64:34,REGEXP:35,MIME:36,SET:258},M.NUMBYTES={ZERO:0,ONE:24,TWO:25,FOUR:26,EIGHT:27,INDEFINITE:31},M.SIMPLE={FALSE:20,TRUE:21,NULL:22,UNDEFINED:23},M.SYMS={NULL:Symbol.for("github.com/hildjj/node-cbor/null"),UNDEFINED:Symbol.for("github.com/hildjj/node-cbor/undef"),PARENT:Symbol.for("github.com/hildjj/node-cbor/parent"),BREAK:Symbol.for("github.com/hildjj/node-cbor/break"),STREAM:Symbol.for("github.com/hildjj/node-cbor/stream")},M.SHIFT32=4294967296,M.BI={MINUS_ONE:BigInt(-1),NEG_MAX:BigInt(-1)-BigInt(Number.MAX_SAFE_INTEGER),MAXINT32:BigInt("0xffffffff"),MAXINT64:BigInt("0xffffffffffffffff"),SHIFT32:BigInt(M.SHIFT32)}},{}],7:[function(a,O,M){const p=a("../vendor/binary-parse-stream"),l=a("./tagged"),b=a("./simple"),B=a("./utils"),u=a("nofilter"),t=a("./constants"),{MT:n,NUMBYTES:s,SYMS:d,BI:c}=t,{Buffer:y}=a("buffer"),v=Symbol("count"),m=Symbol("major type"),g=Symbol("error"),_=Symbol("not found");function S(L,U,T){const F=[];return F[v]=T,F[d.PARENT]=L,F[m]=U,F}function C(L,U){const T=new u;return T[v]=-1,T[d.PARENT]=L,T[m]=U,T}class I extends Error{constructor(U,T){super(`Unexpected data: 0x${U.toString(16)}`),this.name="UnexpectedDataError",this.byte=U,this.value=T}}function X(L,U){switch(typeof L){case"function":return{options:{},cb:L};case"string":return{options:{encoding:L},cb:U};case"object":return{options:L||{},cb:U};default:throw new TypeError("Unknown option type")}}class Z extends p{constructor(U={}){const{tags:T={},max_depth:F=-1,preferMap:z=!1,preferWeb:Y=!1,required:rt=!1,encoding:H="hex",extendedResults:ht=!1,preventDuplicateKeys:E=!1,...P}=U;super({defaultEncoding:H,...P}),this.running=!0,this.max_depth=F,this.tags=T,this.preferMap=z,this.preferWeb=Y,this.extendedResults=ht,this.required=rt,this.preventDuplicateKeys=E,ht&&(this.bs.on("read",this._onRead.bind(this)),this.valueBytes=new u)}static nullcheck(U){switch(U){case d.NULL:return null;case d.UNDEFINED:return;case _:throw new Error("Value not found");default:return U}}static decodeFirstSync(U,T={}){if(U==null)throw new TypeError("input required");({options:T}=X(T));const{encoding:F="hex",...z}=T,Y=new Z(z),rt=B.guessEncoding(U,F),H=Y._parse();let ht=H.next();for(;!ht.done;){const P=rt.read(ht.value);if(P==null||P.length!==ht.value)throw new Error("Insufficient data");Y.extendedResults&&Y.valueBytes.write(P),ht=H.next(P)}let E=null;if(Y.extendedResults)(E=ht.value).unused=rt.read();else if(E=Z.nullcheck(ht.value),rt.length>0){const P=rt.read(1);throw rt.unshift(P),new I(P[0],E)}return E}static decodeAllSync(U,T={}){if(U==null)throw new TypeError("input required");({options:T}=X(T));const{encoding:F="hex",...z}=T,Y=new Z(z),rt=B.guessEncoding(U,F),H=[];for(;rt.length>0;){const ht=Y._parse();let E=ht.next();for(;!E.done;){const P=rt.read(E.value);if(P==null||P.length!==E.value)throw new Error("Insufficient data");Y.extendedResults&&Y.valueBytes.write(P),E=ht.next(P)}H.push(Z.nullcheck(E.value))}return H}static decodeFirst(U,T={},F=null){if(U==null)throw new TypeError("input required");({options:T,cb:F}=X(T,F));const{encoding:z="hex",required:Y=!1,...rt}=T,H=new Z(rt);let ht=_;const E=B.guessEncoding(U,z),P=new Promise((q,ot)=>{H.on("data",w=>{ht=Z.nullcheck(w),H.close()}),H.once("error",w=>H.extendedResults&&w instanceof I?(ht.unused=H.bs.slice(),q(ht)):(ht!==_&&(w.value=ht),ht=g,H.close(),ot(w))),H.once("end",()=>{switch(ht){case _:return Y?ot(new Error("No CBOR found")):q(ht);case g:return;default:return q(ht)}})});return typeof F=="function"&&P.then(q=>F(null,q),F),E.pipe(H),P}static decodeAll(U,T={},F=null){if(U==null)throw new TypeError("input required");({options:T,cb:F}=X(T,F));const{encoding:z="hex",...Y}=T,rt=new Z(Y),H=[];rt.on("data",E=>H.push(Z.nullcheck(E)));const ht=new Promise((E,P)=>{rt.on("error",P),rt.on("end",()=>E(H))});return typeof F=="function"&&ht.then(E=>F(void 0,E),E=>F(E,void 0)),B.guessEncoding(U,z).pipe(rt),ht}close(){this.running=!1,this.__fresh=!0}_onRead(U){this.valueBytes.write(U)}*_parse(){let U=null,T=0,F=null;for(;;){if(this.max_depth>=0&&T>this.max_depth)throw new Error(`Maximum depth ${this.max_depth} exceeded`);const[z]=yield 1;if(!this.running)throw this.bs.unshift(y.from([z])),new I(z);const Y=z>>5,rt=31&z,H=U?.[m],ht=U?.length;switch(rt){case s.ONE:this.emit("more-bytes",Y,1,H,ht),[F]=yield 1;break;case s.TWO:case s.FOUR:case s.EIGHT:{const P=1<<rt-24;this.emit("more-bytes",Y,P,H,ht);const q=yield P;F=Y===n.SIMPLE_FLOAT?q:B.parseCBORint(rt,q);break}case 28:case 29:case 30:throw this.running=!1,new Error(`Additional info not implemented: ${rt}`);case s.INDEFINITE:switch(Y){case n.POS_INT:case n.NEG_INT:case n.TAG:throw new Error(`Invalid indefinite encoding for MT ${Y}`)}F=-1;break;default:F=rt}switch(Y){case n.POS_INT:break;case n.NEG_INT:F=F===Number.MAX_SAFE_INTEGER?c.NEG_MAX:typeof F=="bigint"?c.MINUS_ONE-F:-1-F;break;case n.BYTE_STRING:case n.UTF8_STRING:switch(F){case 0:this.emit("start-string",Y,F,H,ht),F=Y===n.UTF8_STRING?"":this.preferWeb?new Uint8Array(0):y.allocUnsafe(0);break;case-1:this.emit("start",Y,d.STREAM,H,ht),U=C(U,Y),T++;continue;default:this.emit("start-string",Y,F,H,ht),F=yield F,Y===n.UTF8_STRING?F=B.utf8(F):this.preferWeb&&(F=new Uint8Array(F.buffer,F.byteOffset,F.length))}break;case n.ARRAY:case n.MAP:switch(F){case 0:F=Y===n.MAP?this.preferMap?new Map:{}:[];break;case-1:this.emit("start",Y,d.STREAM,H,ht),U=S(U,Y,-1),T++;continue;default:this.emit("start",Y,F,H,ht),U=S(U,Y,F*(Y-3)),T++;continue}break;case n.TAG:this.emit("start",Y,F,H,ht),(U=S(U,Y,1)).push(F),T++;continue;case n.SIMPLE_FLOAT:if(typeof F=="number"){if(rt===s.ONE&&F<32)throw new Error(`Invalid two-byte encoding of simple value ${F}`);const P=U!=null;F=b.decode(F,P,P&&U[v]<0)}else F=B.parseCBORfloat(F)}this.emit("value",F,H,ht,rt);let E=!1;for(;U!=null;){if(F===d.BREAK)U[v]=1;else if(Array.isArray(U))U.push(F);else{const q=U[m];if(q!=null&&q!==Y)throw this.running=!1,new Error("Invalid major type in indefinite encoding");U.write(F)}if(--U[v]!=0){E=!0;break}if(--T,delete U[v],Array.isArray(U))switch(U[m]){case n.ARRAY:F=U;break;case n.MAP:{let q=!this.preferMap;if(U.length%2!=0)throw new Error(`Invalid map length: ${U.length}`);for(let ot=0,w=U.length;q&&ot<w;ot+=2)if(typeof U[ot]!="string"||U[ot]==="__proto__"){q=!1;break}if(q){F={};for(let ot=0,w=U.length;ot<w;ot+=2){if(this.preventDuplicateKeys&&Object.prototype.hasOwnProperty.call(F,U[ot]))throw new Error("Duplicate keys in a map");F[U[ot]]=U[ot+1]}}else{F=new Map;for(let ot=0,w=U.length;ot<w;ot+=2){if(this.preventDuplicateKeys&&F.has(U[ot]))throw new Error("Duplicate keys in a map");F.set(U[ot],U[ot+1])}}break}case n.TAG:F=new l(U[0],U[1]).convert(this.tags);break}else if(U instanceof u)switch(U[m]){case n.BYTE_STRING:F=U.slice(),this.preferWeb&&(F=new Uint8Array(F.buffer,F.byteOffset,F.length));break;case n.UTF8_STRING:F=U.toString("utf-8")}this.emit("stop",U[m]);const P=U;U=U[d.PARENT],delete P[d.PARENT],delete P[m]}if(!E){if(this.extendedResults){const P=this.valueBytes.slice(),q={value:Z.nullcheck(F),bytes:P,length:P.length};return this.valueBytes=new u,q}return F}}}}Z.NOT_FOUND=_,O.exports=Z},{"../vendor/binary-parse-stream":16,"./constants":6,"./simple":13,"./tagged":14,"./utils":15,buffer:3,nofilter:51}],8:[function(a,O,M){const p=a("stream"),l=a("./decoder"),b=a("./utils"),B=a("nofilter"),{MT:u,SYMS:t}=a("./constants");function n(d,c){switch(typeof d){case"function":return{options:{},cb:d};case"string":return{options:{encoding:d},cb:c};case"object":return{options:d||{},cb:c};default:throw new TypeError("Unknown option type")}}class s extends p.Transform{constructor(c={}){const{separator:y=`
9
+ `,stream_errors:v=!1,tags:m,max_depth:g,preferWeb:_,encoding:S,...C}=c;super({...C,readableObjectMode:!1,writableObjectMode:!1}),this.float_bytes=-1,this.separator=y,this.stream_errors=v,this.parser=new l({tags:m,max_depth:g,preferWeb:_,encoding:S}),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("data",this._on_data.bind(this)),this.parser.on("error",this._on_error.bind(this))}_transform(c,y,v){this.parser.write(c,y,v)}_flush(c){this.parser._flush(y=>this.stream_errors?(y&&this._on_error(y),c()):c(y))}static diagnose(c,y={},v=null){if(c==null)throw new TypeError("input required");({options:y,cb:v}=n(y,v));const{encoding:m="hex",...g}=y,_=new B,S=new s(g);let C=null;return typeof v=="function"?(S.on("end",()=>v(null,_.toString("utf8"))),S.on("error",v)):C=new Promise((I,X)=>{S.on("end",()=>I(_.toString("utf8"))),S.on("error",X)}),S.pipe(_),b.guessEncoding(c,m).pipe(S),C}_on_error(c){this.stream_errors?this.push(c.toString()):this.emit("error",c)}_on_more(c,y,v,m){c===u.SIMPLE_FLOAT&&(this.float_bytes={2:1,4:2,8:3}[y])}_fore(c,y){switch(c){case u.BYTE_STRING:case u.UTF8_STRING:case u.ARRAY:y>0&&this.push(", ");break;case u.MAP:y>0&&(y%2?this.push(": "):this.push(", "))}}_on_value(c,y,v){if(c===t.BREAK)return;this._fore(y,v);const m=this.float_bytes;this.float_bytes=-1,this.push(b.cborValueToString(c,m))}_on_start(c,y,v,m){switch(this._fore(v,m),c){case u.TAG:this.push(`${y}(`);break;case u.ARRAY:this.push("[");break;case u.MAP:this.push("{");break;case u.BYTE_STRING:case u.UTF8_STRING:this.push("(")}y===t.STREAM&&this.push("_ ")}_on_stop(c){switch(c){case u.TAG:this.push(")");break;case u.ARRAY:this.push("]");break;case u.MAP:this.push("}");break;case u.BYTE_STRING:case u.UTF8_STRING:this.push(")")}}_on_data(){this.push(this.separator)}}O.exports=s},{"./constants":6,"./decoder":7,"./utils":15,nofilter:51,stream:54}],9:[function(a,O,M){const p=a("stream"),l=a("nofilter"),b=a("./utils"),B=a("./constants"),{MT:u,NUMBYTES:t,SHIFT32:n,SIMPLE:s,SYMS:d,TAG:c,BI:y}=B,{Buffer:v}=a("buffer"),m=u.SIMPLE_FLOAT<<5|t.TWO,g=u.SIMPLE_FLOAT<<5|t.FOUR,_=u.SIMPLE_FLOAT<<5|t.EIGHT,S=u.SIMPLE_FLOAT<<5|s.TRUE,C=u.SIMPLE_FLOAT<<5|s.FALSE,I=u.SIMPLE_FLOAT<<5|s.UNDEFINED,X=u.SIMPLE_FLOAT<<5|s.NULL,Z=v.from([255]),L=v.from("f97e00","hex"),U=v.from("f9fc00","hex"),T=v.from("f97c00","hex"),F=v.from("f98000","hex"),z={};let Y={};function rt(ht){if(!ht)return"number";switch(ht.toLowerCase()){case"number":return"number";case"float":return"float";case"int":case"integer":return"int";case"string":return"string"}throw new TypeError(`dateType invalid, got "${ht}"`)}class H extends p.Transform{constructor(E={}){const{canonical:P=!1,encodeUndefined:q,disallowUndefinedKeys:ot=!1,dateType:w="number",collapseBigIntegers:D=!1,detectLoops:k=!1,omitUndefinedProperties:G=!1,genTypes:ut=[],...ft}=E;if(super({...ft,readableObjectMode:!1,writableObjectMode:!0}),this.canonical=P,this.encodeUndefined=q,this.disallowUndefinedKeys=ot,this.dateType=rt(w),this.collapseBigIntegers=!!this.canonical||D,this.detectLoops=void 0,typeof k=="boolean")k&&(this.detectLoops=new WeakSet);else{if(!(k instanceof WeakSet))throw new TypeError("detectLoops must be boolean or WeakSet");this.detectLoops=k}if(this.omitUndefinedProperties=G,this.semanticTypes={...H.SEMANTIC_TYPES},Array.isArray(ut))for(let dt=0,J=ut.length;dt<J;dt+=2)this.addSemanticType(ut[dt],ut[dt+1]);else for(const[dt,J]of Object.entries(ut))this.addSemanticType(dt,J)}_transform(E,P,q){q(this.pushAny(E)===!1?new Error("Push Error"):void 0)}_flush(E){E()}_pushUInt8(E){const P=v.allocUnsafe(1);return P.writeUInt8(E,0),this.push(P)}_pushUInt16BE(E){const P=v.allocUnsafe(2);return P.writeUInt16BE(E,0),this.push(P)}_pushUInt32BE(E){const P=v.allocUnsafe(4);return P.writeUInt32BE(E,0),this.push(P)}_pushFloatBE(E){const P=v.allocUnsafe(4);return P.writeFloatBE(E,0),this.push(P)}_pushDoubleBE(E){const P=v.allocUnsafe(8);return P.writeDoubleBE(E,0),this.push(P)}_pushNaN(){return this.push(L)}_pushInfinity(E){const P=E<0?U:T;return this.push(P)}_pushFloat(E){if(this.canonical){const P=v.allocUnsafe(2);if(b.writeHalf(P,E))return this._pushUInt8(m)&&this.push(P)}return Math.fround(E)===E?this._pushUInt8(g)&&this._pushFloatBE(E):this._pushUInt8(_)&&this._pushDoubleBE(E)}_pushInt(E,P,q){const ot=P<<5;if(E<24)return this._pushUInt8(ot|E);if(E<=255)return this._pushUInt8(ot|t.ONE)&&this._pushUInt8(E);if(E<=65535)return this._pushUInt8(ot|t.TWO)&&this._pushUInt16BE(E);if(E<=4294967295)return this._pushUInt8(ot|t.FOUR)&&this._pushUInt32BE(E);let w=Number.MAX_SAFE_INTEGER;return P===u.NEG_INT&&w--,E<=w?this._pushUInt8(ot|t.EIGHT)&&this._pushUInt32BE(Math.floor(E/n))&&this._pushUInt32BE(E%n):P===u.NEG_INT?this._pushFloat(q):this._pushFloat(E)}_pushIntNum(E){return Object.is(E,-0)?this.push(F):E<0?this._pushInt(-E-1,u.NEG_INT,E):this._pushInt(E,u.POS_INT)}_pushNumber(E){return isNaN(E)?this._pushNaN():isFinite(E)?Math.round(E)===E?this._pushIntNum(E):this._pushFloat(E):this._pushInfinity(E)}_pushString(E){const P=v.byteLength(E,"utf8");return this._pushInt(P,u.UTF8_STRING)&&this.push(E,"utf8")}_pushBoolean(E){return this._pushUInt8(E?S:C)}_pushUndefined(E){switch(typeof this.encodeUndefined){case"undefined":return this._pushUInt8(I);case"function":return this.pushAny(this.encodeUndefined(E));case"object":{const P=b.bufferishToBuffer(this.encodeUndefined);if(P)return this.push(P)}}return this.pushAny(this.encodeUndefined)}_pushNull(E){return this._pushUInt8(X)}_pushTag(E){return this._pushInt(E,u.TAG)}_pushJSBigint(E){let P=u.POS_INT,q=c.POS_BIGINT;if(E<0&&(E=-E+y.MINUS_ONE,P=u.NEG_INT,q=c.NEG_BIGINT),this.collapseBigIntegers&&E<=y.MAXINT64)return E<=4294967295?this._pushInt(Number(E),P):this._pushUInt8(P<<5|t.EIGHT)&&this._pushUInt32BE(Number(E/y.SHIFT32))&&this._pushUInt32BE(Number(E%y.SHIFT32));let ot=E.toString(16);ot.length%2&&(ot=`0${ot}`);const w=v.from(ot,"hex");return this._pushTag(q)&&H._pushBuffer(this,w)}_pushObject(E,P){if(!E)return this._pushNull(E);if(!(P={indefinite:!1,skipTypes:!1,...P}).indefinite&&this.detectLoops){if(this.detectLoops.has(E))throw new Error(`Loop detected while CBOR encoding.
10
+ Call removeLoopDetectors before resuming.`);this.detectLoops.add(E)}if(!P.skipTypes){const D=E.encodeCBOR;if(typeof D=="function")return D.call(E,this);const k=this.semanticTypes[E.constructor.name];if(k)return k.call(E,this,E)}const q=Object.keys(E).filter(D=>{const k=typeof E[D];return k!=="function"&&(!this.omitUndefinedProperties||k!=="undefined")}),ot={};if(this.canonical&&q.sort((D,k)=>{const G=ot[D]||(ot[D]=H.encode(D)),ut=ot[k]||(ot[k]=H.encode(k));return G.compare(ut)}),P.indefinite){if(!this._pushUInt8(u.MAP<<5|t.INDEFINITE))return!1}else if(!this._pushInt(q.length,u.MAP))return!1;let w=null;for(let D=0,k=q.length;D<k;D++){const G=q[D];if(this.canonical&&(w=ot[G])){if(!this.push(w))return!1}else if(!this._pushString(G))return!1;if(!this.pushAny(E[G]))return!1}if(P.indefinite){if(!this.push(Z))return!1}else this.detectLoops&&this.detectLoops.delete(E);return!0}_encodeAll(E){const P=new l({highWaterMark:this.readableHighWaterMark});this.pipe(P);for(const q of E)this.pushAny(q);return this.end(),P.read()}addSemanticType(E,P){const q=typeof E=="string"?E:E.name,ot=this.semanticTypes[q];if(P){if(typeof P!="function")throw new TypeError("fun must be of type function");this.semanticTypes[q]=P}else ot&&delete this.semanticTypes[q];return ot}pushAny(E){switch(typeof E){case"number":return this._pushNumber(E);case"bigint":return this._pushJSBigint(E);case"string":return this._pushString(E);case"boolean":return this._pushBoolean(E);case"undefined":return this._pushUndefined(E);case"object":return this._pushObject(E);case"symbol":switch(E){case d.NULL:return this._pushNull(null);case d.UNDEFINED:return this._pushUndefined(void 0);default:throw new TypeError(`Unknown symbol: ${E.toString()}`)}default:throw new TypeError(`Unknown type: ${typeof E}, ${typeof E.toString=="function"?E.toString():""}`)}}static pushArray(E,P,q){q={indefinite:!1,...q};const ot=P.length;if(q.indefinite){if(!E._pushUInt8(u.ARRAY<<5|t.INDEFINITE))return!1}else if(!E._pushInt(ot,u.ARRAY))return!1;for(let w=0;w<ot;w++)if(!E.pushAny(P[w]))return!1;return!(q.indefinite&&!E.push(Z))}removeLoopDetectors(){return!!this.detectLoops&&(this.detectLoops=new WeakSet,!0)}static _pushDate(E,P){switch(E.dateType){case"string":return E._pushTag(c.DATE_STRING)&&E._pushString(P.toISOString());case"int":return E._pushTag(c.DATE_EPOCH)&&E._pushIntNum(Math.round(P.getTime()/1e3));case"float":return E._pushTag(c.DATE_EPOCH)&&E._pushFloat(P.getTime()/1e3);default:return E._pushTag(c.DATE_EPOCH)&&E.pushAny(P.getTime()/1e3)}}static _pushBuffer(E,P){return E._pushInt(P.length,u.BYTE_STRING)&&E.push(P)}static _pushNoFilter(E,P){return H._pushBuffer(E,P.slice())}static _pushRegexp(E,P){return E._pushTag(c.REGEXP)&&E.pushAny(P.source)}static _pushSet(E,P){if(!E._pushTag(c.SET)||!E._pushInt(P.size,u.ARRAY))return!1;for(const q of P)if(!E.pushAny(q))return!1;return!0}static _pushURL(E,P){return E._pushTag(c.URI)&&E.pushAny(P.toString())}static _pushBoxed(E,P){return E.pushAny(P.valueOf())}static _pushMap(E,P,q){q={indefinite:!1,...q};let ot=[...P.entries()];if(E.omitUndefinedProperties&&(ot=ot.filter(([w,D])=>D!==void 0)),q.indefinite){if(!E._pushUInt8(u.MAP<<5|t.INDEFINITE))return!1}else if(!E._pushInt(ot.length,u.MAP))return!1;if(E.canonical){const w=new H({genTypes:E.semanticTypes,canonical:E.canonical,detectLoops:!!E.detectLoops,dateType:E.dateType,disallowUndefinedKeys:E.disallowUndefinedKeys,collapseBigIntegers:E.collapseBigIntegers}),D=new l({highWaterMark:E.readableHighWaterMark});w.pipe(D),ot.sort(([k],[G])=>{w.pushAny(k);const ut=D.read();w.pushAny(G);const ft=D.read();return ut.compare(ft)});for(const[k,G]of ot){if(E.disallowUndefinedKeys&&k===void 0)throw new Error("Invalid Map key: undefined");if(!E.pushAny(k)||!E.pushAny(G))return!1}}else for(const[w,D]of ot){if(E.disallowUndefinedKeys&&w===void 0)throw new Error("Invalid Map key: undefined");if(!E.pushAny(w)||!E.pushAny(D))return!1}return!(q.indefinite&&!E.push(Z))}static _pushTypedArray(E,P){let q=64,ot=P.BYTES_PER_ELEMENT;const{name:w}=P.constructor;return w.startsWith("Float")?(q|=16,ot/=2):w.includes("U")||(q|=8),(w.includes("Clamped")||ot!==1&&!b.isBigEndian())&&(q|=4),q|={1:0,2:1,4:2,8:3}[ot],!!E._pushTag(q)&&H._pushBuffer(E,v.from(P.buffer,P.byteOffset,P.byteLength))}static _pushArrayBuffer(E,P){return H._pushBuffer(E,v.from(P))}static encodeIndefinite(E,P,q={}){if(P==null){if(this==null)throw new Error("No object to encode");P=this}const{chunkSize:ot=4096}=q;let w=!0;const D=typeof P;let k=null;if(D==="string"){w=w&&E._pushUInt8(u.UTF8_STRING<<5|t.INDEFINITE);let G=0;for(;G<P.length;){const ut=G+ot;w=w&&E._pushString(P.slice(G,ut)),G=ut}w=w&&E.push(Z)}else if(k=b.bufferishToBuffer(P)){w=w&&E._pushUInt8(u.BYTE_STRING<<5|t.INDEFINITE);let G=0;for(;G<k.length;){const ut=G+ot;w=w&&H._pushBuffer(E,k.slice(G,ut)),G=ut}w=w&&E.push(Z)}else if(Array.isArray(P))w=w&&H.pushArray(E,P,{indefinite:!0});else if(P instanceof Map)w=w&&H._pushMap(E,P,{indefinite:!0});else{if(D!=="object")throw new Error("Invalid indefinite encoding");w=w&&E._pushObject(P,{indefinite:!0,skipTypes:!0})}return w}static encode(...E){return new H()._encodeAll(E)}static encodeCanonical(...E){return new H({canonical:!0})._encodeAll(E)}static encodeOne(E,P){return new H(P)._encodeAll([E])}static encodeAsync(E,P){return new Promise((q,ot)=>{const w=[],D=new H(P);D.on("data",k=>w.push(k)),D.on("error",ot),D.on("finish",()=>q(v.concat(w))),D.pushAny(E),D.end()})}static get SEMANTIC_TYPES(){return Y}static set SEMANTIC_TYPES(E){Y=E}static reset(){H.SEMANTIC_TYPES={...z}}}Object.assign(z,{Array:H.pushArray,Date:H._pushDate,Buffer:H._pushBuffer,[v.name]:H._pushBuffer,Map:H._pushMap,NoFilter:H._pushNoFilter,[l.name]:H._pushNoFilter,RegExp:H._pushRegexp,Set:H._pushSet,ArrayBuffer:H._pushArrayBuffer,Uint8ClampedArray:H._pushTypedArray,Uint8Array:H._pushTypedArray,Uint16Array:H._pushTypedArray,Uint32Array:H._pushTypedArray,Int8Array:H._pushTypedArray,Int16Array:H._pushTypedArray,Int32Array:H._pushTypedArray,Float32Array:H._pushTypedArray,Float64Array:H._pushTypedArray,URL:H._pushURL,Boolean:H._pushBoxed,Number:H._pushBoxed,String:H._pushBoxed}),typeof BigUint64Array<"u"&&(z[BigUint64Array.name]=H._pushTypedArray),typeof BigInt64Array<"u"&&(z[BigInt64Array.name]=H._pushTypedArray),H.reset(),O.exports=H},{"./constants":6,"./utils":15,buffer:3,nofilter:51,stream:54}],10:[function(a,O,M){const{Buffer:p}=a("buffer"),l=a("./encoder"),b=a("./decoder"),{MT:B}=a("./constants");class u extends Map{constructor(n){super(n)}static _encode(n){return l.encodeCanonical(n).toString("base64")}static _decode(n){return b.decodeFirstSync(n,"base64")}get(n){return super.get(u._encode(n))}set(n,s){return super.set(u._encode(n),s)}delete(n){return super.delete(u._encode(n))}has(n){return super.has(u._encode(n))}*keys(){for(const n of super.keys())yield u._decode(n)}*entries(){for(const n of super.entries())yield[u._decode(n[0]),n[1]]}[Symbol.iterator](){return this.entries()}forEach(n,s=this){if(typeof n!="function")throw new TypeError("Must be function");for(const d of super.entries())n.call(s,d[1],u._decode(d[0]),this)}encodeCBOR(n){if(!n._pushInt(this.size,B.MAP))return!1;if(n.canonical){const s=Array.from(super.entries()).map(d=>[p.from(d[0],"base64"),d[1]]);s.sort((d,c)=>d[0].compare(c[0]));for(const d of s)if(!n.push(d[0])||!n.pushAny(d[1]))return!1}else for(const s of super.entries())if(!n.push(p.from(s[0],"base64"))||!n.pushAny(s[1]))return!1;return!0}}O.exports=u},{"./constants":6,"./decoder":7,"./encoder":9,buffer:3}],11:[function(a,O,M){class p{constructor(){this.clear()}clear(){this.map=new WeakMap,this.count=0,this.recording=!0}stop(){this.recording=!1}check(b){const B=this.map.get(b);if(B)return B.length>1?B[0]||this.recording?B[1]:(B[0]=!0,p.FIRST):this.recording?(B.push(this.count++),B[1]):p.NEVER;if(!this.recording)throw new Error("New object detected when not recording");return this.map.set(b,[!1]),p.NEVER}}p.NEVER=-1,p.FIRST=-2,O.exports=p},{}],12:[function(a,O,M){const p=a("./encoder"),l=a("./objectRecorder"),{Buffer:b}=a("buffer");class B extends p{constructor(t){super(t),this.valueSharing=new l}_pushObject(t,n){if(t!==null){const s=this.valueSharing.check(t);switch(s){case l.FIRST:this._pushTag(28);break;case l.NEVER:break;default:return this._pushTag(29)&&this._pushIntNum(s)}}return super._pushObject(t,n)}stopRecording(){this.valueSharing.stop()}clearRecording(){this.valueSharing.clear()}static encode(...t){const n=new B;n.on("data",()=>{});for(const s of t)n.pushAny(s);return n.stopRecording(),n.removeAllListeners("data"),n._encodeAll(t)}static encodeCanonical(...t){throw new Error("Cannot encode canonically in a SharedValueEncoder, which serializes objects multiple times.")}static encodeOne(t,n){const s=new B(n);return s.on("data",()=>{}),s.pushAny(t),s.stopRecording(),s.removeAllListeners("data"),s._encodeAll([t])}static encodeAsync(t,n){return new Promise((s,d)=>{const c=[],y=new B(n);y.on("data",()=>{}),y.on("error",d),y.on("finish",()=>s(b.concat(c))),y.pushAny(t),y.stopRecording(),y.removeAllListeners("data"),y.on("data",v=>c.push(v)),y.pushAny(t),y.end()})}}O.exports=B},{"./encoder":9,"./objectRecorder":11,buffer:3}],13:[function(a,O,M){const{MT:p,SIMPLE:l,SYMS:b}=a("./constants");class B{constructor(t){if(typeof t!="number")throw new Error(`Invalid Simple type: ${typeof t}`);if(t<0||t>255||(0|t)!==t)throw new Error(`value must be a small positive integer: ${t}`);this.value=t}toString(){return`simple(${this.value})`}[Symbol.for("nodejs.util.inspect.custom")](t,n){return`simple(${this.value})`}encodeCBOR(t){return t._pushInt(this.value,p.SIMPLE_FLOAT)}static isSimple(t){return t instanceof B}static decode(t,n=!0,s=!1){switch(t){case l.FALSE:return!1;case l.TRUE:return!0;case l.NULL:return n?null:b.NULL;case l.UNDEFINED:return n?void 0:b.UNDEFINED;case-1:if(!n||!s)throw new Error("Invalid BREAK");return b.BREAK;default:return new B(t)}}}O.exports=B},{"./constants":6}],14:[function(a,O,M){const p=a("./constants"),l=a("./utils"),b=Symbol("INTERNAL_JSON");function B(g,_){if(l.isBufferish(g))g.toJSON=_;else if(Array.isArray(g))for(const S of g)B(S,_);else if(g&&typeof g=="object"&&(!(g instanceof m)||g.tag<21||g.tag>23))for(const S of Object.values(g))B(S,_)}function u(){return l.base64(this)}function t(){return l.base64url(this)}function n(){return this.toString("hex")}function s(g,_,S,C){const I=new DataView(g),[X,Z]={2:[I.getUint16,I.setUint16],4:[I.getUint32,I.setUint32],8:[I.getBigUint64,I.setBigUint64]}[_],L=S+C;for(let U=S;U<L;U+=_)Z.call(I,U,X.call(I,U,!0))}const d={0:g=>new Date(g),1:g=>new Date(1e3*g),2:g=>l.bufferToBigInt(g),3:g=>p.BI.MINUS_ONE-l.bufferToBigInt(g),21:(g,_)=>(l.isBufferish(g)?_[b]=t:B(g,t),_),22:(g,_)=>(l.isBufferish(g)?_[b]=u:B(g,u),_),23:(g,_)=>(l.isBufferish(g)?_[b]=n:B(g,n),_),32:g=>new URL(g),33:(g,_)=>{if(!g.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Invalid base64url characters");const S=g.length%4;if(S===1)throw new Error("Invalid base64url length");if(S===2){if("AQgw".indexOf(g[g.length-1])===-1)throw new Error("Invalid base64 padding")}else if(S===3&&"AEIMQUYcgkosw048".indexOf(g[g.length-1])===-1)throw new Error("Invalid base64 padding");return _},34:(g,_)=>{const S=g.match(/^[a-zA-Z0-9+/]+(?<padding>={0,2})$/);if(!S)throw new Error("Invalid base64 characters");if(g.length%4!=0)throw new Error("Invalid base64 length");if(S.groups.padding==="="){if("AQgw".indexOf(g[g.length-2])===-1)throw new Error("Invalid base64 padding")}else if(S.groups.padding==="=="&&"AEIMQUYcgkosw048".indexOf(g[g.length-3])===-1)throw new Error("Invalid base64 padding");return _},35:g=>new RegExp(g),258:g=>new Set(g)},c={64:Uint8Array,65:Uint16Array,66:Uint32Array,68:Uint8ClampedArray,69:Uint16Array,70:Uint32Array,72:Int8Array,73:Int16Array,74:Int32Array,77:Int16Array,78:Int32Array,81:Float32Array,82:Float64Array,85:Float32Array,86:Float64Array};function y(g,_){if(!l.isBufferish(g))throw new TypeError("val not a buffer");const{tag:S}=_,C=c[S];if(!C)throw new Error(`Invalid typed array tag: ${S}`);const I=2**(((16&S)>>4)+(3&S));return!(4&S)!==l.isBigEndian()&&I>1&&s(g.buffer,I,g.byteOffset,g.byteLength),new C(g.buffer.slice(g.byteOffset,g.byteOffset+g.byteLength))}typeof BigUint64Array<"u"&&(c[67]=BigUint64Array,c[71]=BigUint64Array),typeof BigInt64Array<"u"&&(c[75]=BigInt64Array,c[79]=BigInt64Array);for(const g of Object.keys(c))d[g]=y;let v={};class m{constructor(_,S,C){if(this.tag=_,this.value=S,this.err=C,typeof this.tag!="number")throw new Error(`Invalid tag type (${typeof this.tag})`);if(this.tag<0||(0|this.tag)!==this.tag)throw new Error(`Tag must be a positive integer: ${this.tag}`)}toJSON(){if(this[b])return this[b].call(this.value);const _={tag:this.tag,value:this.value};return this.err&&(_.err=this.err),_}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(_){return _._pushTag(this.tag),_.pushAny(this.value)}convert(_){let S=_?.[this.tag];if(S===null)return this;if(typeof S!="function"&&typeof(S=m.TAGS[this.tag])!="function")return this;try{return S.call(this,this.value,this)}catch(C){return C&&C.message&&C.message.length>0?this.err=C.message:this.err=C,this}}static get TAGS(){return v}static set TAGS(_){v=_}static reset(){m.TAGS={...d}}}m.INTERNAL_JSON=b,m.reset(),O.exports=m},{"./constants":6,"./utils":15}],15:[function(a,O,M){const{Buffer:p}=a("buffer"),l=a("nofilter"),b=a("stream"),B=a("./constants"),{NUMBYTES:u,SHIFT32:t,BI:n,SYMS:s}=B,d=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});function c(v){return v instanceof b.Readable||["read","on","pipe"].every(m=>typeof v[m]=="function")}M.utf8=(v=>d.decode(v)),M.utf8.checksUTF8=!0,M.isBufferish=function(v){return v&&typeof v=="object"&&(p.isBuffer(v)||v instanceof Uint8Array||v instanceof Uint8ClampedArray||v instanceof ArrayBuffer||v instanceof DataView)},M.bufferishToBuffer=function(v){return p.isBuffer(v)?v:ArrayBuffer.isView(v)?p.from(v.buffer,v.byteOffset,v.byteLength):v instanceof ArrayBuffer?p.from(v):null},M.parseCBORint=function(v,m){switch(v){case u.ONE:return m.readUInt8(0);case u.TWO:return m.readUInt16BE(0);case u.FOUR:return m.readUInt32BE(0);case u.EIGHT:{const g=m.readUInt32BE(0),_=m.readUInt32BE(4);return g>2097151?BigInt(g)*n.SHIFT32+BigInt(_):g*t+_}default:throw new Error(`Invalid additional info for int: ${v}`)}},M.writeHalf=function(v,m){const g=p.allocUnsafe(4);g.writeFloatBE(m,0);const _=g.readUInt32BE(0);if((8191&_)!=0)return!1;let S=_>>16&32768;const C=_>>23&255,I=8388607&_;if(C>=113&&C<=142)S+=(C-112<<10)+(I>>13);else{if(!(C>=103&&C<113)||I&(1<<126-C)-1)return!1;S+=I+8388608>>126-C}return v.writeUInt16BE(S),!0},M.parseHalf=function(v){const m=128&v[0]?-1:1,g=(124&v[0])>>2,_=(3&v[0])<<8|v[1];return g?g===31?m*(_?NaN:1/0):m*2**(g-25)*(1024+_):5960464477539063e-23*m*_},M.parseCBORfloat=function(v){switch(v.length){case 2:return M.parseHalf(v);case 4:return v.readFloatBE(0);case 8:return v.readDoubleBE(0);default:throw new Error(`Invalid float size: ${v.length}`)}},M.hex=function(v){return p.from(v.replace(/^0x/,""),"hex")},M.bin=function(v){let m=0,g=(v=v.replace(/\s/g,"")).length%8||8;const _=[];for(;g<=v.length;)_.push(parseInt(v.slice(m,g),2)),m=g,g+=8;return p.from(_)},M.arrayEqual=function(v,m){return v==null&&m==null||v!=null&&m!=null&&v.length===m.length&&v.every((g,_)=>g===m[_])},M.bufferToBigInt=function(v){return BigInt(`0x${v.toString("hex")}`)},M.cborValueToString=function(v,m=-1){switch(typeof v){case"symbol":{switch(v){case s.NULL:return"null";case s.UNDEFINED:return"undefined";case s.BREAK:return"BREAK"}if(v.description)return v.description;const g=v.toString().match(/^Symbol\((?<name>.*)\)/);return g&&g.groups.name?g.groups.name:"Symbol"}case"string":return JSON.stringify(v);case"bigint":return v.toString();case"number":{const g=Object.is(v,-0)?"-0":String(v);return m>0?`${g}_${m}`:g}case"object":{if(!v)return"null";const g=M.bufferishToBuffer(v);if(g){const _=g.toString("hex");return m===-1/0?_:`h'${_}'`}return v&&typeof v[Symbol.for("nodejs.util.inspect.custom")]=="function"?v[Symbol.for("nodejs.util.inspect.custom")]():Array.isArray(v)?"[]":"{}"}}return String(v)},M.guessEncoding=function(v,m){if(typeof v=="string")return new l(v,m??"hex");const g=M.bufferishToBuffer(v);if(g)return new l(g);if(c(v))return v;throw new Error("Unknown input type")};const y={"=":"","+":"-","/":"_"};M.base64url=function(v){return M.bufferishToBuffer(v).toString("base64").replace(/[=+/]/g,m=>y[m])},M.base64=function(v){return M.bufferishToBuffer(v).toString("base64")},M.isBigEndian=function(){const v=new Uint8Array(4);return!((new Uint32Array(v.buffer)[0]=1)&v[0])}},{"./constants":6,buffer:3,nofilter:51,stream:54}],16:[function(a,O,M){const p=a("stream"),l=a("nofilter");class b extends p.Transform{constructor(u){super(u),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this.bs=new l,this.__restart()}_transform(u,t,n){for(this.bs.write(u);this.bs.length>=this.__needed;){let s=null;const d=this.__needed===null?void 0:this.bs.read(this.__needed);try{s=this.__parser.next(d)}catch(c){return n(c)}this.__needed&&(this.__fresh=!1),s.done?(this.push(s.value),this.__restart()):this.__needed=s.value||1/0}return n()}*_parse(){throw new Error("Must be implemented in subclass")}__restart(){this.__needed=null,this.__parser=this._parse(),this.__fresh=!0}_flush(u){u(this.__fresh?null:new Error("unexpected end of input"))}}O.exports=b},{nofilter:51,stream:54}],17:[function(a,O,M){function p(){if(!(this instanceof p))return new p}(function(l){typeof O<"u"&&(O.exports=l);var b="listeners",B={on:function(s,d){return n(this,s).push(d),this},once:function(s,d){var c=this;return y.originalListener=d,n(c,s).push(y),c;function y(){t.call(c,s,y),d.apply(this,arguments)}},off:t,emit:function(s,d){var c=this,y=n(c,s,!0);if(!y)return!1;var v=arguments.length;if(v===1)y.forEach(function(g){g.call(c)});else if(v===2)y.forEach(function(g){g.call(c,d)});else{var m=Array.prototype.slice.call(arguments,1);y.forEach(function(g){g.apply(c,m)})}return!!y.length}};function u(s){for(var d in B)s[d]=B[d];return s}function t(s,d){var c;if(arguments.length){if(d){if(c=n(this,s,!0)){if(!(c=c.filter(function(y){return y!==d&&y.originalListener!==d})).length)return t.call(this,s);this[b][s]=c}}else if((c=this[b])&&(delete c[s],!Object.keys(c).length))return t.call(this)}else delete this[b];return this}function n(s,d,c){if(!c||s[b]){var y=s[b]||(s[b]={});return y[d]||(y[d]=[])}}u(l.prototype),l.mixin=u})(p)},{}],18:[function(a,O,M){var p,l=typeof Reflect=="object"?Reflect:null,b=l&&typeof l.apply=="function"?l.apply:function(L,U,T){return Function.prototype.apply.call(L,U,T)};function B(L){console&&console.warn&&console.warn(L)}p=l&&typeof l.ownKeys=="function"?l.ownKeys:Object.getOwnPropertySymbols?function(L){return Object.getOwnPropertyNames(L).concat(Object.getOwnPropertySymbols(L))}:function(L){return Object.getOwnPropertyNames(L)};var u=Number.isNaN||function(L){return L!=L};function t(){t.init.call(this)}O.exports=t,O.exports.once=I,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var n=10;function s(L){if(typeof L!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof L)}function d(L){return L._maxListeners===void 0?t.defaultMaxListeners:L._maxListeners}function c(L,U,T,F){var z,Y,rt;if(s(T),(Y=L._events)===void 0?(Y=L._events=Object.create(null),L._eventsCount=0):(Y.newListener!==void 0&&(L.emit("newListener",U,T.listener?T.listener:T),Y=L._events),rt=Y[U]),rt===void 0)rt=Y[U]=T,++L._eventsCount;else if(typeof rt=="function"?rt=Y[U]=F?[T,rt]:[rt,T]:F?rt.unshift(T):rt.push(T),(z=d(L))>0&&rt.length>z&&!rt.warned){rt.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+rt.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=L,H.type=U,H.count=rt.length,B(H)}return L}function y(){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 v(L,U,T){var F={fired:!1,wrapFn:void 0,target:L,type:U,listener:T},z=y.bind(F);return z.listener=T,F.wrapFn=z,z}function m(L,U,T){var F=L._events;if(F===void 0)return[];var z=F[U];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?C(z):_(z,z.length)}function g(L){var U=this._events;if(U!==void 0){var T=U[L];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}function _(L,U){for(var T=new Array(U),F=0;F<U;++F)T[F]=L[F];return T}function S(L,U){for(;U+1<L.length;U++)L[U]=L[U+1];L.pop()}function C(L){for(var U=new Array(L.length),T=0;T<U.length;++T)U[T]=L[T].listener||L[T];return U}function I(L,U){return new Promise(function(T,F){function z(rt){L.removeListener(U,Y),F(rt)}function Y(){typeof L.removeListener=="function"&&L.removeListener("error",z),T([].slice.call(arguments))}Z(L,U,Y,{once:!0}),U!=="error"&&X(L,z,{once:!0})})}function X(L,U,T){typeof L.on=="function"&&Z(L,"error",U,T)}function Z(L,U,T,F){if(typeof L.on=="function")F.once?L.once(U,T):L.on(U,T);else{if(typeof L.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof L);L.addEventListener(U,function z(Y){F.once&&L.removeEventListener(U,z),T(Y)})}}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(L){if(typeof L!="number"||L<0||u(L))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+L+".");n=L}}),t.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},t.prototype.setMaxListeners=function(L){if(typeof L!="number"||L<0||u(L))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+L+".");return this._maxListeners=L,this},t.prototype.getMaxListeners=function(){return d(this)},t.prototype.emit=function(L){for(var U=[],T=1;T<arguments.length;T++)U.push(arguments[T]);var F=L==="error",z=this._events;if(z!==void 0)F=F&&z.error===void 0;else if(!F)return!1;if(F){var Y;if(U.length>0&&(Y=U[0]),Y instanceof Error)throw Y;var rt=new Error("Unhandled error."+(Y?" ("+Y.message+")":""));throw rt.context=Y,rt}var H=z[L];if(H===void 0)return!1;if(typeof H=="function")b(H,this,U);else{var ht=H.length,E=_(H,ht);for(T=0;T<ht;++T)b(E[T],this,U)}return!0},t.prototype.addListener=function(L,U){return c(this,L,U,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(L,U){return c(this,L,U,!0)},t.prototype.once=function(L,U){return s(U),this.on(L,v(this,L,U)),this},t.prototype.prependOnceListener=function(L,U){return s(U),this.prependListener(L,v(this,L,U)),this},t.prototype.removeListener=function(L,U){var T,F,z,Y,rt;if(s(U),(F=this._events)===void 0)return this;if((T=F[L])===void 0)return this;if(T===U||T.listener===U)--this._eventsCount==0?this._events=Object.create(null):(delete F[L],F.removeListener&&this.emit("removeListener",L,T.listener||U));else if(typeof T!="function"){for(z=-1,Y=T.length-1;Y>=0;Y--)if(T[Y]===U||T[Y].listener===U){rt=T[Y].listener,z=Y;break}if(z<0)return this;z===0?T.shift():S(T,z),T.length===1&&(F[L]=T[0]),F.removeListener!==void 0&&this.emit("removeListener",L,rt||U)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(L){var U,T,F;if((T=this._events)===void 0)return this;if(T.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):T[L]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete T[L]),this;if(arguments.length===0){var z,Y=Object.keys(T);for(F=0;F<Y.length;++F)(z=Y[F])!=="removeListener"&&this.removeAllListeners(z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(U=T[L])=="function")this.removeListener(L,U);else if(U!==void 0)for(F=U.length-1;F>=0;F--)this.removeListener(L,U[F]);return this},t.prototype.listeners=function(L){return m(this,L,!0)},t.prototype.rawListeners=function(L){return m(this,L,!1)},t.listenerCount=function(L,U){return typeof L.listenerCount=="function"?L.listenerCount(U):g.call(L,U)},t.prototype.listenerCount=g,t.prototype.eventNames=function(){return this._eventsCount>0?p(this._events):[]}},{}],19:[function(a,O,M){M.read=function(p,l,b,B,u){var t,n,s=8*u-B-1,d=(1<<s)-1,c=d>>1,y=-7,v=b?u-1:0,m=b?-1:1,g=p[l+v];for(v+=m,t=g&(1<<-y)-1,g>>=-y,y+=s;y>0;t=256*t+p[l+v],v+=m,y-=8);for(n=t&(1<<-y)-1,t>>=-y,y+=B;y>0;n=256*n+p[l+v],v+=m,y-=8);if(t===0)t=1-c;else{if(t===d)return n?NaN:1/0*(g?-1:1);n+=Math.pow(2,B),t-=c}return(g?-1:1)*n*Math.pow(2,t-B)},M.write=function(p,l,b,B,u,t){var n,s,d,c=8*t-u-1,y=(1<<c)-1,v=y>>1,m=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=B?0:t-1,_=B?1:-1,S=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(s=isNaN(l)?1:0,n=y):(n=Math.floor(Math.log(l)/Math.LN2),l*(d=Math.pow(2,-n))<1&&(n--,d*=2),(l+=n+v>=1?m/d:m*Math.pow(2,1-v))*d>=2&&(n++,d/=2),n+v>=y?(s=0,n=y):n+v>=1?(s=(l*d-1)*Math.pow(2,u),n+=v):(s=l*Math.pow(2,v-1)*Math.pow(2,u),n=0));u>=8;p[b+g]=255&s,g+=_,s/=256,u-=8);for(n=n<<u|s,c+=u;c>0;p[b+g]=255&n,g+=_,n/=256,c-=8);p[b+g-_]|=128*S}},{}],20:[function(a,O,M){typeof Object.create=="function"?O.exports=function(p,l){l&&(p.super_=l,p.prototype=Object.create(l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}))}:O.exports=function(p,l){if(l){p.super_=l;var b=function(){};b.prototype=l.prototype,p.prototype=new b,p.prototype.constructor=p}}},{}],21:[function(a,O,M){(function(p){(function(){(function(l){var b,B="undefined",u=B!==typeof p&&p,t=B!==typeof Uint8Array&&Uint8Array,n=B!==typeof ArrayBuffer&&ArrayBuffer,s=[0,0,0,0,0,0,0,0],d=Array.isArray||function(T){return!!T&&Object.prototype.toString.call(T)=="[object Array]"},c=4294967296,y=16777216;function v(T,F,z){var Y=F?0:4,rt=F?4:0,H=F?0:3,ht=F?1:2,E=F?2:1,P=F?3:0,q=F?X:L,ot=F?Z:U,w=G.prototype,D="is"+T,k="_"+D;return w.buffer=void 0,w.offset=0,w[k]=!0,w.toNumber=ut,w.toString=function(J){var tt=this.buffer,nt=this.offset,st=dt(tt,nt+Y),N=dt(tt,nt+rt),$="",at=!z&&2147483648&st;for(at&&(st=~st,N=c-N),J=J||10;;){var lt=st%J*c+N;if(st=Math.floor(st/J),N=Math.floor(lt/J),$=(lt%J).toString(J)+$,!st&&!N)break}return at&&($="-"+$),$},w.toJSON=ut,w.toArray=m,u&&(w.toBuffer=g),t&&(w.toArrayBuffer=_),G[D]=function(J){return!(!J||!J[k])},l[T]=G,G;function G(J,tt,nt,st){return this instanceof G?(function(N,$,at,lt,pt){if(t&&n&&($ instanceof n&&($=new t($)),lt instanceof n&&(lt=new t(lt))),!($||at||lt||b))return void(N.buffer=I(s,0));if(!S($,at)){var x=b||Array;pt=at,lt=$,at=0,$=new x(8)}N.buffer=$,N.offset=at|=0,B!==typeof lt&&(typeof lt=="string"?(function(R,e,o,h){var j=0,V=o.length,it=0,yt=0;o[0]==="-"&&j++;for(var mt=j;j<V;){var wt=parseInt(o[j++],h);if(!(wt>=0))break;yt=yt*h+wt,it=it*h+Math.floor(yt/c),yt%=c}mt&&(it=~it,yt?yt=c-yt:it++),ft(R,e+Y,it),ft(R,e+rt,yt)})($,at,lt,pt||10):S(lt,pt)?C($,at,lt,pt):typeof pt=="number"?(ft($,at+Y,lt),ft($,at+rt,pt)):lt>0?q($,at,lt):lt<0?ot($,at,lt):C($,at,s,0))})(this,J,tt,nt,st):new G(J,tt,nt,st)}function ut(){var J=this.buffer,tt=this.offset,nt=dt(J,tt+Y),st=dt(J,tt+rt);return z||(nt|=0),nt?nt*c+st:st}function ft(J,tt,nt){J[tt+P]=255&nt,nt>>=8,J[tt+E]=255&nt,nt>>=8,J[tt+ht]=255&nt,nt>>=8,J[tt+H]=255&nt}function dt(J,tt){return J[tt+H]*y+(J[tt+ht]<<16)+(J[tt+E]<<8)+J[tt+P]}}function m(T){var F=this.buffer,z=this.offset;return b=null,T!==!1&&z===0&&F.length===8&&d(F)?F:I(F,z)}function g(T){var F=this.buffer,z=this.offset;if(b=u,T!==!1&&z===0&&F.length===8&&p.isBuffer(F))return F;var Y=new u(8);return C(Y,0,F,z),Y}function _(T){var F=this.buffer,z=this.offset,Y=F.buffer;if(b=t,T!==!1&&z===0&&Y instanceof n&&Y.byteLength===8)return Y;var rt=new t(8);return C(rt,0,F,z),rt.buffer}function S(T,F){var z=T&&T.length;return F|=0,z&&F+8<=z&&typeof T[F]!="string"}function C(T,F,z,Y){F|=0,Y|=0;for(var rt=0;rt<8;rt++)T[F++]=255&z[Y++]}function I(T,F){return Array.prototype.slice.call(T,F,F+8)}function X(T,F,z){for(var Y=F+8;Y>F;)T[--Y]=255&z,z/=256}function Z(T,F,z){var Y=F+8;for(z++;Y>F;)T[--Y]=255&-z^255,z/=256}function L(T,F,z){for(var Y=F+8;F<Y;)T[F++]=255&z,z/=256}function U(T,F,z){var Y=F+8;for(z++;F<Y;)T[F++]=255&-z^255,z/=256}v("Uint64BE",!0,!0),v("Int64BE",!0,!1),v("Uint64LE",!1,!0),v("Int64LE",!1,!1)})(typeof M=="object"&&typeof M.nodeName!="string"?M:this||{})}).call(this)}).call(this,a("buffer").Buffer)},{buffer:3}],22:[function(a,O,M){var p={}.toString;O.exports=Array.isArray||function(l){return p.call(l)=="[object Array]"}},{}],23:[function(a,O,M){M.encode=a("./encode").encode,M.decode=a("./decode").decode,M.Encoder=a("./encoder").Encoder,M.Decoder=a("./decoder").Decoder,M.createCodec=a("./ext").createCodec,M.codec=a("./codec").codec},{"./codec":32,"./decode":34,"./decoder":35,"./encode":37,"./encoder":38,"./ext":42}],24:[function(a,O,M){(function(p){(function(){function l(b){return b&&b.isBuffer&&b}O.exports=l(typeof p<"u"&&p)||l(this.Buffer)||l(typeof window<"u"&&window.Buffer)||this.Buffer}).call(this)}).call(this,a("buffer").Buffer)},{buffer:3}],25:[function(a,O,M){function p(B,u){for(var t=u||(u|=0),n=B.length,s=0,d=0;d<n;)(s=B.charCodeAt(d++))<128?this[t++]=s:s<2048?(this[t++]=192|s>>>6,this[t++]=128|63&s):s<55296||s>57343?(this[t++]=224|s>>>12,this[t++]=128|s>>>6&63,this[t++]=128|63&s):(s=65536+(s-55296<<10|B.charCodeAt(d++)-56320),this[t++]=240|s>>>18,this[t++]=128|s>>>12&63,this[t++]=128|s>>>6&63,this[t++]=128|63&s);return t-u}function l(B,u,t){var n=0|u;t||(t=this.length);for(var s="",d=0;n<t;)(d=this[n++])<128?s+=String.fromCharCode(d):((224&d)==192?d=(31&d)<<6|63&this[n++]:(240&d)==224?d=(15&d)<<12|(63&this[n++])<<6|63&this[n++]:(248&d)==240&&(d=(7&d)<<18|(63&this[n++])<<12|(63&this[n++])<<6|63&this[n++]),d>=65536?(d-=65536,s+=String.fromCharCode(55296+(d>>>10),56320+(1023&d))):s+=String.fromCharCode(d));return s}function b(B,u,t,n){var s;t||(t=0),n||n===0||(n=this.length),u||(u=0);var d=n-t;if(B===this&&t<u&&u<n)for(s=d-1;s>=0;s--)B[s+u]=this[s+t];else for(s=0;s<d;s++)B[s+u]=this[s+t];return d}M.copy=b,M.toString=l,M.write=p},{}],26:[function(a,O,l){var p=a("./bufferish"),l=O.exports=b(0);function b(u){return new Array(u)}function B(u){if(!p.isBuffer(u)&&p.isView(u))u=p.Uint8Array.from(u);else if(p.isArrayBuffer(u))u=new Uint8Array(u);else{if(typeof u=="string")return p.from.call(l,u);if(typeof u=="number")throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(u)}l.alloc=b,l.concat=p.concat,l.from=B},{"./bufferish":30}],27:[function(a,O,b){var p=a("./bufferish"),l=p.global,b=O.exports=p.hasBuffer?B(0):[];function B(t){return new l(t)}function u(t){if(!p.isBuffer(t)&&p.isView(t))t=p.Uint8Array.from(t);else if(p.isArrayBuffer(t))t=new Uint8Array(t);else{if(typeof t=="string")return p.from.call(b,t);if(typeof t=="number")throw new TypeError('"value" argument must not be a number')}return l.from&&l.from.length!==1?l.from(t):new l(t)}b.alloc=p.hasBuffer&&l.alloc||B,b.concat=p.concat,b.from=u},{"./bufferish":30}],28:[function(a,O,M){var p=a("./buffer-lite");M.copy=t,M.slice=n,M.toString=s,M.write=d("write");var l=a("./bufferish"),b=l.global,B=l.hasBuffer&&"TYPED_ARRAY_SUPPORT"in b,u=B&&!b.TYPED_ARRAY_SUPPORT;function t(c,y,v,m){var g=l.isBuffer(this),_=l.isBuffer(c);if(g&&_)return this.copy(c,y,v,m);if(u||g||_||!l.isView(this)||!l.isView(c))return p.copy.call(this,c,y,v,m);var S=v||m!=null?n.call(this,v,m):this;return c.set(S,y),S.length}function n(c,y){var v=this.slice||!u&&this.subarray;if(v)return v.call(this,c,y);var m=l.alloc.call(this,y-c);return t.call(this,m,0,c,y),m}function s(c,y,v){return(!B&&l.isBuffer(this)?this.toString:p.toString).apply(this,arguments)}function d(c){return function(){return(this[c]||p[c]).apply(this,arguments)}}},{"./buffer-lite":25,"./bufferish":30}],29:[function(a,O,l){var p=a("./bufferish"),l=O.exports=p.hasArrayBuffer?b(0):[];function b(u){return new Uint8Array(u)}function B(u){if(p.isView(u)){var t=u.byteOffset,n=u.byteLength;(u=u.buffer).byteLength!==n&&(u.slice?u=u.slice(t,t+n):(u=new Uint8Array(u)).byteLength!==n&&(u=Array.prototype.slice.call(u,t,t+n)))}else{if(typeof u=="string")return p.from.call(l,u);if(typeof u=="number")throw new TypeError('"value" argument must not be a number')}return new Uint8Array(u)}l.alloc=b,l.concat=p.concat,l.from=B},{"./bufferish":30}],30:[function(a,O,M){var p=M.global=a("./buffer-global"),l=M.hasBuffer=p&&!!p.isBuffer,b=M.hasArrayBuffer=typeof ArrayBuffer<"u",B=M.isArray=a("isarray");M.isArrayBuffer=b?_:I;var u=M.isBuffer=l?p.isBuffer:I,t=M.isView=b?ArrayBuffer.isView||X("ArrayBuffer","buffer"):I;M.alloc=v,M.concat=m,M.from=y;var n=M.Array=a("./bufferish-array"),s=M.Buffer=a("./bufferish-buffer"),d=M.Uint8Array=a("./bufferish-uint8array"),c=M.prototype=a("./bufferish-proto");function y(Z){return typeof Z=="string"?S.call(this,Z):C(this).from(Z)}function v(Z){return C(this).alloc(Z)}function m(Z,L){L||(L=0,Array.prototype.forEach.call(Z,function(z){L+=z.length}));var U=this!==M&&this||Z[0],T=v.call(U,L),F=0;return Array.prototype.forEach.call(Z,function(z){F+=c.copy.call(z,T,F)}),T}var g=X("ArrayBuffer");function _(Z){return Z instanceof ArrayBuffer||g(Z)}function S(Z){var L=3*Z.length,U=v.call(this,L),T=c.write.call(U,Z);return L!==T&&(U=c.slice.call(U,0,T)),U}function C(Z){return u(Z)?s:t(Z)?d:B(Z)?n:l?s:b?d:n}function I(){return!1}function X(Z,L){return Z="[object "+Z+"]",function(U){return U!=null&&{}.toString.call(L?U[L]:U)===Z}}},{"./buffer-global":24,"./bufferish-array":26,"./bufferish-buffer":27,"./bufferish-proto":28,"./bufferish-uint8array":29,isarray:22}],31:[function(a,O,M){var p=a("isarray");M.createCodec=s,M.install=B,M.filter=n;var l=a("./bufferish");function b(d){if(!(this instanceof b))return new b(d);this.options=d,this.init()}function B(d){for(var c in d)b.prototype[c]=u(b.prototype[c],d[c])}function u(d,c){return d&&c?function(){return d.apply(this,arguments),c.apply(this,arguments)}:d||c}function t(d){return d=d.slice(),function(y){return d.reduce(c,y)};function c(y,v){return v(y)}}function n(d){return p(d)?t(d):d}function s(d){return new b(d)}b.prototype.init=function(){var d=this.options;return d&&d.uint8array&&(this.bufferish=l.Uint8Array),this},M.preset=s({preset:!0})},{"./bufferish":30,isarray:22}],32:[function(a,O,M){a("./read-core"),a("./write-core"),M.codec={preset:a("./codec-base").preset}},{"./codec-base":31,"./read-core":44,"./write-core":47}],33:[function(a,O,M){M.DecodeBuffer=b;var p=a("./read-core").preset,l=a("./flex-buffer").FlexDecoder;function b(B){if(!(this instanceof b))return new b(B);if(B&&(this.options=B,B.codec)){var u=this.codec=B.codec;u.bufferish&&(this.bufferish=u.bufferish)}}l.mixin(b.prototype),b.prototype.codec=p,b.prototype.fetch=function(){return this.codec.decode(this)}},{"./flex-buffer":43,"./read-core":44}],34:[function(a,O,M){M.decode=l;var p=a("./decode-buffer").DecodeBuffer;function l(b,B){var u=new p(B);return u.write(b),u.read()}},{"./decode-buffer":33}],35:[function(a,O,M){M.Decoder=b;var p=a("event-lite"),l=a("./decode-buffer").DecodeBuffer;function b(B){if(!(this instanceof b))return new b(B);l.call(this,B)}b.prototype=new l,p.mixin(b.prototype),b.prototype.decode=function(B){arguments.length&&this.write(B),this.flush()},b.prototype.push=function(B){this.emit("data",B)},b.prototype.end=function(B){this.decode(B),this.emit("end")}},{"./decode-buffer":33,"event-lite":17}],36:[function(a,O,M){M.EncodeBuffer=b;var p=a("./write-core").preset,l=a("./flex-buffer").FlexEncoder;function b(B){if(!(this instanceof b))return new b(B);if(B&&(this.options=B,B.codec)){var u=this.codec=B.codec;u.bufferish&&(this.bufferish=u.bufferish)}}l.mixin(b.prototype),b.prototype.codec=p,b.prototype.write=function(B){this.codec.encode(this,B)}},{"./flex-buffer":43,"./write-core":47}],37:[function(a,O,M){M.encode=l;var p=a("./encode-buffer").EncodeBuffer;function l(b,B){var u=new p(B);return u.write(b),u.read()}},{"./encode-buffer":36}],38:[function(a,O,M){M.Encoder=b;var p=a("event-lite"),l=a("./encode-buffer").EncodeBuffer;function b(B){if(!(this instanceof b))return new b(B);l.call(this,B)}b.prototype=new l,p.mixin(b.prototype),b.prototype.encode=function(B){this.write(B),this.emit("data",this.read())},b.prototype.end=function(B){arguments.length&&this.encode(B),this.flush(),this.emit("end")}},{"./encode-buffer":36,"event-lite":17}],39:[function(a,O,M){M.ExtBuffer=l;var p=a("./bufferish");function l(b,B){if(!(this instanceof l))return new l(b,B);this.buffer=p.from(b),this.type=B}},{"./bufferish":30}],40:[function(a,O,M){M.setExtPackers=t;var p,l=a("./bufferish"),b=l.global,B=l.Uint8Array.from,u={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function t(y){y.addExtPacker(14,Error,[c,n]),y.addExtPacker(1,EvalError,[c,n]),y.addExtPacker(2,RangeError,[c,n]),y.addExtPacker(3,ReferenceError,[c,n]),y.addExtPacker(4,SyntaxError,[c,n]),y.addExtPacker(5,TypeError,[c,n]),y.addExtPacker(6,URIError,[c,n]),y.addExtPacker(10,RegExp,[d,n]),y.addExtPacker(11,Boolean,[s,n]),y.addExtPacker(12,String,[s,n]),y.addExtPacker(13,Date,[Number,n]),y.addExtPacker(15,Number,[s,n]),typeof Uint8Array<"u"&&(y.addExtPacker(17,Int8Array,B),y.addExtPacker(18,Uint8Array,B),y.addExtPacker(19,Int16Array,B),y.addExtPacker(20,Uint16Array,B),y.addExtPacker(21,Int32Array,B),y.addExtPacker(22,Uint32Array,B),y.addExtPacker(23,Float32Array,B),typeof Float64Array<"u"&&y.addExtPacker(24,Float64Array,B),typeof Uint8ClampedArray<"u"&&y.addExtPacker(25,Uint8ClampedArray,B),y.addExtPacker(26,ArrayBuffer,B),y.addExtPacker(29,DataView,B)),l.hasBuffer&&y.addExtPacker(27,b,l.from)}function n(y){return p||(p=a("./encode").encode),p(y)}function s(y){return y.valueOf()}function d(y){(y=RegExp.prototype.toString.call(y).split("/")).shift();var v=[y.pop()];return v.unshift(y.join("/")),v}function c(y){var v={};for(var m in u)v[m]=y[m];return v}},{"./bufferish":30,"./encode":37}],41:[function(a,O,M){M.setExtUnpackers=u;var p,l=a("./bufferish"),b=l.global,B={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function u(y){y.addExtUnpacker(14,[t,s(Error)]),y.addExtUnpacker(1,[t,s(EvalError)]),y.addExtUnpacker(2,[t,s(RangeError)]),y.addExtUnpacker(3,[t,s(ReferenceError)]),y.addExtUnpacker(4,[t,s(SyntaxError)]),y.addExtUnpacker(5,[t,s(TypeError)]),y.addExtUnpacker(6,[t,s(URIError)]),y.addExtUnpacker(10,[t,n]),y.addExtUnpacker(11,[t,d(Boolean)]),y.addExtUnpacker(12,[t,d(String)]),y.addExtUnpacker(13,[t,d(Date)]),y.addExtUnpacker(15,[t,d(Number)]),typeof Uint8Array<"u"&&(y.addExtUnpacker(17,d(Int8Array)),y.addExtUnpacker(18,d(Uint8Array)),y.addExtUnpacker(19,[c,d(Int16Array)]),y.addExtUnpacker(20,[c,d(Uint16Array)]),y.addExtUnpacker(21,[c,d(Int32Array)]),y.addExtUnpacker(22,[c,d(Uint32Array)]),y.addExtUnpacker(23,[c,d(Float32Array)]),typeof Float64Array<"u"&&y.addExtUnpacker(24,[c,d(Float64Array)]),typeof Uint8ClampedArray<"u"&&y.addExtUnpacker(25,d(Uint8ClampedArray)),y.addExtUnpacker(26,c),y.addExtUnpacker(29,[c,d(DataView)])),l.hasBuffer&&y.addExtUnpacker(27,d(b))}function t(y){return p||(p=a("./decode").decode),p(y)}function n(y){return RegExp.apply(null,y)}function s(y){return function(v){var m=new y;for(var g in B)m[g]=v[g];return m}}function d(y){return function(v){return new y(v)}}function c(y){return new Uint8Array(y).buffer}},{"./bufferish":30,"./decode":34}],42:[function(a,O,M){a("./read-core"),a("./write-core"),M.createCodec=a("./codec-base").createCodec},{"./codec-base":31,"./read-core":44,"./write-core":47}],43:[function(a,O,M){M.FlexDecoder=u,M.FlexEncoder=t;var p=a("./bufferish"),l=2048,b=65536,B="BUFFER_SHORTAGE";function u(){if(!(this instanceof u))return new u}function t(){if(!(this instanceof t))return new t}function n(){return{bufferish:p,write:function(_){var S=this.offset?p.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=S?_?this.bufferish.concat([S,_]):S:_,this.offset=0},fetch:c,flush:function(){for(;this.offset<this.buffer.length;){var _,S=this.offset;try{_=this.fetch()}catch(C){if(C&&C.message!=B)throw C;this.offset=S;break}this.push(_)}},push:v,pull:m,read:y,reserve:function(_){var S=this.offset,C=S+_;if(C>this.buffer.length)throw new Error(B);return this.offset=C,S},offset:0}}function s(){return{bufferish:p,write:d,fetch:function(){var _=this.start;if(_<this.offset){var S=this.start=this.offset;return p.prototype.slice.call(this.buffer,_,S)}},flush:function(){for(;this.start<this.offset;){var _=this.fetch();_&&this.push(_)}},push:v,pull:function(){var _=this.buffers||(this.buffers=[]),S=_.length>1?this.bufferish.concat(_):_[0];return _.length=0,S},read:y,reserve:function(_){var S=0|_;if(this.buffer){var C=this.buffer.length,I=0|this.offset,X=I+S;if(X<C)return this.offset=X,I;this.flush(),_=Math.max(_,Math.min(2*C,this.maxBufferSize))}return _=Math.max(_,this.minBufferSize),this.buffer=this.bufferish.alloc(_),this.start=0,this.offset=S,0},send:function(_){var S=_.length;if(S>this.minBufferSize)this.flush(),this.push(_);else{var C=this.reserve(S);p.prototype.copy.call(_,this.buffer,C)}},maxBufferSize:b,minBufferSize:l,offset:0,start:0}}function d(){throw new Error("method not implemented: write()")}function c(){throw new Error("method not implemented: fetch()")}function y(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function v(_){(this.buffers||(this.buffers=[])).push(_)}function m(){return(this.buffers||(this.buffers=[])).shift()}function g(_){return function(S){for(var C in _)S[C]=_[C];return S}}u.mixin=g(n()),u.mixin(u.prototype),t.mixin=g(s()),t.mixin(t.prototype)},{"./bufferish":30}],44:[function(a,O,M){var p=a("./ext-buffer").ExtBuffer,l=a("./ext-unpacker"),b=a("./read-format").readUint8,B=a("./read-token"),u=a("./codec-base");function t(c){var y=B.getReadToken(c);return function(v){var m=b(v),g=y[m];if(!g)throw new Error("Invalid type: "+(m&&"0x"+m.toString(16)));return g(v)}}function n(){var c=this.options;return this.decode=t(c),c&&c.preset&&l.setExtUnpackers(this),this}function s(c,y){(this.extUnpackers||(this.extUnpackers=[]))[c]=u.filter(y)}function d(c){return(this.extUnpackers||(this.extUnpackers=[]))[c]||function(y){return new p(y,c)}}u.install({addExtUnpacker:s,getExtUnpacker:d,init:n}),M.preset=n.call(u.preset)},{"./codec-base":31,"./ext-buffer":39,"./ext-unpacker":41,"./read-format":45,"./read-token":46}],45:[function(a,O,M){var p=a("ieee754"),l=a("int64-buffer"),b=l.Uint64BE,B=l.Int64BE;M.getReadFormat=d,M.readUint8=C;var u=a("./bufferish"),t=a("./bufferish-proto"),n=typeof Map<"u",s=!0;function d(E){var P=u.hasArrayBuffer&&E&&E.binarraybuffer,q=E&&E.int64;return{map:n&&E&&E.usemap?y:c,array:v,str:m,bin:P?_:g,ext:S,uint8:C,uint16:X,uint32:L,uint64:T(8,q?Y:F),int8:I,int16:Z,int32:U,int64:T(8,q?rt:z),float32:T(4,H),float64:T(8,ht)}}function c(E,P){var q,ot={},w=new Array(P),D=new Array(P),k=E.codec.decode;for(q=0;q<P;q++)w[q]=k(E),D[q]=k(E);for(q=0;q<P;q++)ot[w[q]]=D[q];return ot}function y(E,P){var q,ot=new Map,w=new Array(P),D=new Array(P),k=E.codec.decode;for(q=0;q<P;q++)w[q]=k(E),D[q]=k(E);for(q=0;q<P;q++)ot.set(w[q],D[q]);return ot}function v(E,P){for(var q=new Array(P),ot=E.codec.decode,w=0;w<P;w++)q[w]=ot(E);return q}function m(E,P){var q=E.reserve(P),ot=q+P;return t.toString.call(E.buffer,"utf-8",q,ot)}function g(E,P){var q=E.reserve(P),ot=q+P,w=t.slice.call(E.buffer,q,ot);return u.from(w)}function _(E,P){var q=E.reserve(P),ot=q+P,w=t.slice.call(E.buffer,q,ot);return u.Uint8Array.from(w).buffer}function S(E,P){var q=E.reserve(P+1),ot=E.buffer[q++],w=q+P,D=E.codec.getExtUnpacker(ot);if(!D)throw new Error("Invalid ext type: "+(ot&&"0x"+ot.toString(16)));return D(t.slice.call(E.buffer,q,w))}function C(E){var P=E.reserve(1);return E.buffer[P]}function I(E){var P=E.reserve(1),q=E.buffer[P];return 128&q?q-256:q}function X(E){var P=E.reserve(2),q=E.buffer;return q[P++]<<8|q[P]}function Z(E){var P=E.reserve(2),q=E.buffer,ot=q[P++]<<8|q[P];return 32768&ot?ot-65536:ot}function L(E){var P=E.reserve(4),q=E.buffer;return 16777216*q[P++]+(q[P++]<<16)+(q[P++]<<8)+q[P]}function U(E){var P=E.reserve(4),q=E.buffer;return q[P++]<<24|q[P++]<<16|q[P++]<<8|q[P]}function T(E,P){return function(q){var ot=q.reserve(E);return P.call(q.buffer,ot,s)}}function F(E){return new b(this,E).toNumber()}function z(E){return new B(this,E).toNumber()}function Y(E){return new b(this,E)}function rt(E){return new B(this,E)}function H(E){return p.read(this,E,!1,23,4)}function ht(E){return p.read(this,E,!1,52,8)}},{"./bufferish":30,"./bufferish-proto":28,ieee754:19,"int64-buffer":21}],46:[function(a,O,M){var p=a("./read-format");function l(s){var d=p.getReadFormat(s);return s&&s.useraw?B(d):b(d)}function b(s){var d,c=new Array(256);for(d=0;d<=127;d++)c[d]=u(d);for(d=128;d<=143;d++)c[d]=n(d-128,s.map);for(d=144;d<=159;d++)c[d]=n(d-144,s.array);for(d=160;d<=191;d++)c[d]=n(d-160,s.str);for(c[192]=u(null),c[193]=null,c[194]=u(!1),c[195]=u(!0),c[196]=t(s.uint8,s.bin),c[197]=t(s.uint16,s.bin),c[198]=t(s.uint32,s.bin),c[199]=t(s.uint8,s.ext),c[200]=t(s.uint16,s.ext),c[201]=t(s.uint32,s.ext),c[202]=s.float32,c[203]=s.float64,c[204]=s.uint8,c[205]=s.uint16,c[206]=s.uint32,c[207]=s.uint64,c[208]=s.int8,c[209]=s.int16,c[210]=s.int32,c[211]=s.int64,c[212]=n(1,s.ext),c[213]=n(2,s.ext),c[214]=n(4,s.ext),c[215]=n(8,s.ext),c[216]=n(16,s.ext),c[217]=t(s.uint8,s.str),c[218]=t(s.uint16,s.str),c[219]=t(s.uint32,s.str),c[220]=t(s.uint16,s.array),c[221]=t(s.uint32,s.array),c[222]=t(s.uint16,s.map),c[223]=t(s.uint32,s.map),d=224;d<=255;d++)c[d]=u(d-256);return c}function B(s){var d,c=b(s).slice();for(c[217]=c[196],c[218]=c[197],c[219]=c[198],d=160;d<=191;d++)c[d]=n(d-160,s.bin);return c}function u(s){return function(){return s}}function t(s,d){return function(c){var y=s(c);return d(c,y)}}function n(s,d){return function(c){return d(c,s)}}M.getReadToken=l},{"./read-format":45}],47:[function(a,O,M){var p=a("./ext-buffer").ExtBuffer,l=a("./ext-packer"),b=a("./write-type"),B=a("./codec-base");function u(d){var c=b.getWriteType(d);return function(y,v){var m=c[typeof v];if(!m)throw new Error('Unsupported type "'+typeof v+'": '+v);m(y,v)}}function t(){var d=this.options;return this.encode=u(d),d&&d.preset&&l.setExtPackers(this),this}function n(d,c,y){y=B.filter(y);var v=c.name;v&&v!=="Object"?(this.extPackers||(this.extPackers={}))[v]=m:(this.extEncoderList||(this.extEncoderList=[])).unshift([c,m]);function m(g){return y&&(g=y(g)),new p(g,d)}}function s(d){var c=this.extPackers||(this.extPackers={}),y=d.constructor,v=y&&y.name&&c[y.name];if(v)return v;for(var m=this.extEncoderList||(this.extEncoderList=[]),g=m.length,_=0;_<g;_++){var S=m[_];if(y===S[0])return S[1]}}B.install({addExtPacker:n,getExtPacker:s,init:t}),M.preset=t.call(B.preset)},{"./codec-base":31,"./ext-buffer":39,"./ext-packer":40,"./write-type":49}],48:[function(a,O,M){var p=a("ieee754"),l=a("int64-buffer"),b=l.Uint64BE,B=l.Int64BE,u=a("./write-uint8").uint8,t=a("./bufferish"),n=t.global,s=t.hasBuffer&&"TYPED_ARRAY_SUPPORT"in n,d=s&&!n.TYPED_ARRAY_SUPPORT,c=t.hasBuffer&&n.prototype||{};function y(T){return T&&T.uint8array?v():d||t.hasBuffer&&T&&T.safe?g():m()}function v(){var T=m();return T[202]=I(202,4,L),T[203]=I(203,8,U),T}function m(){var T=u.slice();return T[196]=_(196),T[197]=S(197),T[198]=C(198),T[199]=_(199),T[200]=S(200),T[201]=C(201),T[202]=I(202,4,c.writeFloatBE||L,!0),T[203]=I(203,8,c.writeDoubleBE||U,!0),T[204]=_(204),T[205]=S(205),T[206]=C(206),T[207]=I(207,8,X),T[208]=_(208),T[209]=S(209),T[210]=C(210),T[211]=I(211,8,Z),T[217]=_(217),T[218]=S(218),T[219]=C(219),T[220]=S(220),T[221]=C(221),T[222]=S(222),T[223]=C(223),T}function g(){var T=u.slice();return T[196]=I(196,1,n.prototype.writeUInt8),T[197]=I(197,2,n.prototype.writeUInt16BE),T[198]=I(198,4,n.prototype.writeUInt32BE),T[199]=I(199,1,n.prototype.writeUInt8),T[200]=I(200,2,n.prototype.writeUInt16BE),T[201]=I(201,4,n.prototype.writeUInt32BE),T[202]=I(202,4,n.prototype.writeFloatBE),T[203]=I(203,8,n.prototype.writeDoubleBE),T[204]=I(204,1,n.prototype.writeUInt8),T[205]=I(205,2,n.prototype.writeUInt16BE),T[206]=I(206,4,n.prototype.writeUInt32BE),T[207]=I(207,8,X),T[208]=I(208,1,n.prototype.writeInt8),T[209]=I(209,2,n.prototype.writeInt16BE),T[210]=I(210,4,n.prototype.writeInt32BE),T[211]=I(211,8,Z),T[217]=I(217,1,n.prototype.writeUInt8),T[218]=I(218,2,n.prototype.writeUInt16BE),T[219]=I(219,4,n.prototype.writeUInt32BE),T[220]=I(220,2,n.prototype.writeUInt16BE),T[221]=I(221,4,n.prototype.writeUInt32BE),T[222]=I(222,2,n.prototype.writeUInt16BE),T[223]=I(223,4,n.prototype.writeUInt32BE),T}function _(T){return function(F,z){var Y=F.reserve(2),rt=F.buffer;rt[Y++]=T,rt[Y]=z}}function S(T){return function(F,z){var Y=F.reserve(3),rt=F.buffer;rt[Y++]=T,rt[Y++]=z>>>8,rt[Y]=z}}function C(T){return function(F,z){var Y=F.reserve(5),rt=F.buffer;rt[Y++]=T,rt[Y++]=z>>>24,rt[Y++]=z>>>16,rt[Y++]=z>>>8,rt[Y]=z}}function I(T,F,z,Y){return function(rt,H){var ht=rt.reserve(F+1);rt.buffer[ht++]=T,z.call(rt.buffer,H,ht,Y)}}function X(T,F){new b(this,F,T)}function Z(T,F){new B(this,F,T)}function L(T,F){p.write(this,T,F,!1,23,4)}function U(T,F){p.write(this,T,F,!1,52,8)}M.getWriteToken=y},{"./bufferish":30,"./write-uint8":50,ieee754:19,"int64-buffer":21}],49:[function(a,O,M){var p=a("isarray"),l=a("int64-buffer"),b=l.Uint64BE,B=l.Int64BE,u=a("./bufferish"),t=a("./bufferish-proto"),n=a("./write-token"),s=a("./write-uint8").uint8,d=a("./ext-buffer").ExtBuffer,c=typeof Uint8Array<"u",y=typeof Map<"u",v=[];function m(g){var _=n.getWriteToken(g),S=g&&g.useraw,C=c&&g&&g.binarraybuffer,I=C?u.isArrayBuffer:u.isBuffer,X=C?function(z,Y){T(z,new Uint8Array(Y))}:T,Z=y&&g&&g.usemap?function(z,Y){if(!(Y instanceof Map))return F(z,Y);var rt=Y.size;_[rt<16?128+rt:rt<=65535?222:223](z,rt);var H=z.codec.encode;Y.forEach(function(ht,E,P){H(z,E),H(z,ht)})}:F;return{boolean:function(z,Y){_[Y?195:194](z,Y)},function:U,number:function(z,Y){var rt,H=0|Y;if(Y!==H)return void _[rt=203](z,Y);rt=-32<=H&&H<=127?255&H:0<=H?H<=255?204:H<=65535?205:206:-128<=H?208:-32768<=H?209:210,_[rt](z,H)},object:S?function(z,Y){if(I(Y))return(function(rt,H){var ht=H.length;_[ht<32?160+ht:ht<=65535?218:219](rt,ht),rt.send(H)})(z,Y);L(z,Y)}:L,string:(function(z){return function(Y,rt){var H=rt.length,ht=5+3*H;Y.offset=Y.reserve(ht);var E=Y.buffer,P=z(H),q=Y.offset+P;H=t.write.call(E,rt,q);var ot=z(H);if(P!==ot){var w=q+ot-P,D=q+H;t.copy.call(E,E,w,q,D)}_[ot===1?160+H:ot<=3?215+ot:219](Y,H),Y.offset+=H}})(S?function(z){return z<32?1:z<=65535?3:5}:function(z){return z<32?1:z<=255?2:z<=65535?3:5}),symbol:U,undefined:U};function L(z,Y){if(Y===null)return U(z,Y);if(I(Y))return X(z,Y);if(p(Y))return(function(H,ht){var E=ht.length;_[E<16?144+E:E<=65535?220:221](H,E);for(var P=H.codec.encode,q=0;q<E;q++)P(H,ht[q])})(z,Y);if(b.isUint64BE(Y))return(function(H,ht){_[207](H,ht.toArray())})(z,Y);if(B.isInt64BE(Y))return(function(H,ht){_[211](H,ht.toArray())})(z,Y);var rt=z.codec.getExtPacker(Y);if(rt&&(Y=rt(Y)),Y instanceof d)return(function(H,ht){var E=ht.buffer,P=E.length,q=v[P]||(P<255?199:P<=65535?200:201);_[q](H,P),s[ht.type](H),H.send(E)})(z,Y);Z(z,Y)}function U(z,Y){_[192](z,Y)}function T(z,Y){var rt=Y.length;_[rt<255?196:rt<=65535?197:198](z,rt),z.send(Y)}function F(z,Y){var rt=Object.keys(Y),H=rt.length;_[H<16?128+H:H<=65535?222:223](z,H);var ht=z.codec.encode;rt.forEach(function(E){ht(z,E),ht(z,Y[E])})}}v[1]=212,v[2]=213,v[4]=214,v[8]=215,v[16]=216,M.getWriteType=m},{"./bufferish":30,"./bufferish-proto":28,"./ext-buffer":39,"./write-token":48,"./write-uint8":50,"int64-buffer":21,isarray:22}],50:[function(a,O,M){for(var p=M.uint8=new Array(256),l=0;l<=255;l++)p[l]=b(l);function b(B){return function(u){var t=u.reserve(1);u.buffer[t]=B}}},{}],51:[function(a,O,M){const p=a("stream"),{Buffer:l}=a("buffer"),b=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});class B extends p.Transform{constructor(t,n,s={}){let d=null,c=null;switch(typeof t){case"object":l.isBuffer(t)?d=t:t&&(s=t);break;case"string":d=t;break;case"undefined":break;default:throw new TypeError("Invalid input")}switch(typeof n){case"object":n&&(s=n);break;case"string":c=n;break;case"undefined":break;default:throw new TypeError("Invalid inputEncoding")}if(!s||typeof s!="object")throw new TypeError("Invalid options");d==null&&(d=s.input),c==null&&(c=s.inputEncoding),delete s.input,delete s.inputEncoding;const y=s.watchPipe==null||s.watchPipe;delete s.watchPipe;const v=!!s.readError;delete s.readError,super(s),this.readError=v,y&&this.on("pipe",m=>{const g=m._readableState.objectMode;if(this.length>0&&g!==this._readableState.objectMode)throw new Error("Do not switch objectMode in the middle of the stream");this._readableState.objectMode=g,this._writableState.objectMode=g}),d!=null&&this.end(d,c)}static isNoFilter(t){return t instanceof this}static compare(t,n){if(!(t instanceof this))throw new TypeError("Arguments must be NoFilters");return t===n?0:t.compare(n)}static concat(t,n){if(!Array.isArray(t))throw new TypeError("list argument must be an Array of NoFilters");if(t.length===0||n===0)return l.alloc(0);n==null&&(n=t.reduce((y,v)=>{if(!(v instanceof B))throw new TypeError("list argument must be an Array of NoFilters");return y+v.length},0));let s=!0,d=!0;const c=t.map(y=>{if(!(y instanceof B))throw new TypeError("list argument must be an Array of NoFilters");const v=y.slice();return l.isBuffer(v)?d=!1:s=!1,v});if(s)return l.concat(c,n);if(d)return[].concat(...c).slice(0,n);throw new Error("Concatenating mixed object and byte streams not supported")}_transform(t,n,s){this._readableState.objectMode||l.isBuffer(t)||(t=l.from(t,n)),this.push(t),s()}_bufArray(){let t=this._readableState.buffer;if(!Array.isArray(t)){let n=t.head;for(t=[];n!=null;)t.push(n.data),n=n.next}return t}read(t){const n=super.read(t);if(n!=null){if(this.emit("read",n),this.readError&&n.length<t)throw new Error(`Read ${n.length}, wanted ${t}`)}else if(this.readError)throw new Error(`No data available, wanted ${t}`);return n}readFull(t){let n=null,s=null,d=null;return new Promise((c,y)=>{this.length>=t?c(this.read(t)):this.writableFinished?y(new Error(`Stream finished before ${t} bytes were available`)):(n=(v=>{this.length>=t&&c(this.read(t))}),s=(()=>{y(new Error(`Stream finished before ${t} bytes were available`))}),d=y,this.on("readable",n),this.on("error",d),this.on("finish",s))}).finally(()=>{n&&(this.removeListener("readable",n),this.removeListener("error",d),this.removeListener("finish",s))})}promise(t){let n=!1;return new Promise((s,d)=>{this.on("finish",()=>{const c=this.read();t==null||n||(n=!0,t(null,c)),s(c)}),this.on("error",c=>{t==null||n||(n=!0,t(c)),d(c)})})}compare(t){if(!(t instanceof B))throw new TypeError("Arguments must be NoFilters");if(this===t)return 0;const n=this.slice(),s=t.slice();if(l.isBuffer(n)&&l.isBuffer(s))return n.compare(s);throw new Error("Cannot compare streams in object mode")}equals(t){return this.compare(t)===0}slice(t,n){if(this._readableState.objectMode)return this._bufArray().slice(t,n);const s=this._bufArray();switch(s.length){case 0:return l.alloc(0);case 1:return s[0].slice(t,n);default:return l.concat(s).slice(t,n)}}get(t){return this.slice()[t]}toJSON(){const t=this.slice();return l.isBuffer(t)?t.toJSON():t}toString(t,n,s){const d=this.slice(n,s);return l.isBuffer(d)?t&&t!=="utf8"?d.toString(t):b.decode(d):JSON.stringify(d)}[Symbol.for("nodejs.util.inspect.custom")](t,n){const s=this._bufArray().map(d=>l.isBuffer(d)?n.stylize(d.toString("hex"),"string"):JSON.stringify(d)).join(", ");return`${this.constructor.name} [${s}]`}get length(){return this._readableState.length}writeBigInt(t){let n=t.toString(16);if(t<0){const s=BigInt(Math.floor(n.length/2));n=(t=(BigInt(1)<<s*BigInt(8))+t).toString(16)}return n.length%2&&(n=`0${n}`),this.push(l.from(n,"hex"))}readUBigInt(t){const n=this.read(t);return l.isBuffer(n)?BigInt(`0x${n.toString("hex")}`):null}readBigInt(t){const n=this.read(t);if(!l.isBuffer(n))return null;let s=BigInt(`0x${n.toString("hex")}`);return 128&n[0]&&(s-=BigInt(1)<<BigInt(n.length)*BigInt(8)),s}writeUInt8(t){const n=l.from([t]);return this.push(n)}writeUInt16LE(t){const n=l.alloc(2);return n.writeUInt16LE(t),this.push(n)}writeUInt16BE(t){const n=l.alloc(2);return n.writeUInt16BE(t),this.push(n)}writeUInt32LE(t){const n=l.alloc(4);return n.writeUInt32LE(t),this.push(n)}writeUInt32BE(t){const n=l.alloc(4);return n.writeUInt32BE(t),this.push(n)}writeInt8(t){const n=l.from([t]);return this.push(n)}writeInt16LE(t){const n=l.alloc(2);return n.writeUInt16LE(t),this.push(n)}writeInt16BE(t){const n=l.alloc(2);return n.writeUInt16BE(t),this.push(n)}writeInt32LE(t){const n=l.alloc(4);return n.writeUInt32LE(t),this.push(n)}writeInt32BE(t){const n=l.alloc(4);return n.writeUInt32BE(t),this.push(n)}writeFloatLE(t){const n=l.alloc(4);return n.writeFloatLE(t),this.push(n)}writeFloatBE(t){const n=l.alloc(4);return n.writeFloatBE(t),this.push(n)}writeDoubleLE(t){const n=l.alloc(8);return n.writeDoubleLE(t),this.push(n)}writeDoubleBE(t){const n=l.alloc(8);return n.writeDoubleBE(t),this.push(n)}writeBigInt64LE(t){const n=l.alloc(8);return n.writeBigInt64LE(t),this.push(n)}writeBigInt64BE(t){const n=l.alloc(8);return n.writeBigInt64BE(t),this.push(n)}writeBigUInt64LE(t){const n=l.alloc(8);return n.writeBigUInt64LE(t),this.push(n)}writeBigUInt64BE(t){const n=l.alloc(8);return n.writeBigUInt64BE(t),this.push(n)}readUInt8(){const t=this.read(1);return l.isBuffer(t)?t.readUInt8():null}readUInt16LE(){const t=this.read(2);return l.isBuffer(t)?t.readUInt16LE():null}readUInt16BE(){const t=this.read(2);return l.isBuffer(t)?t.readUInt16BE():null}readUInt32LE(){const t=this.read(4);return l.isBuffer(t)?t.readUInt32LE():null}readUInt32BE(){const t=this.read(4);return l.isBuffer(t)?t.readUInt32BE():null}readInt8(){const t=this.read(1);return l.isBuffer(t)?t.readInt8():null}readInt16LE(){const t=this.read(2);return l.isBuffer(t)?t.readInt16LE():null}readInt16BE(){const t=this.read(2);return l.isBuffer(t)?t.readInt16BE():null}readInt32LE(){const t=this.read(4);return l.isBuffer(t)?t.readInt32LE():null}readInt32BE(){const t=this.read(4);return l.isBuffer(t)?t.readInt32BE():null}readFloatLE(){const t=this.read(4);return l.isBuffer(t)?t.readFloatLE():null}readFloatBE(){const t=this.read(4);return l.isBuffer(t)?t.readFloatBE():null}readDoubleLE(){const t=this.read(8);return l.isBuffer(t)?t.readDoubleLE():null}readDoubleBE(){const t=this.read(8);return l.isBuffer(t)?t.readDoubleBE():null}readBigInt64LE(){const t=this.read(8);return l.isBuffer(t)?t.readBigInt64LE():null}readBigInt64BE(){const t=this.read(8);return l.isBuffer(t)?t.readBigInt64BE():null}readBigUInt64LE(){const t=this.read(8);return l.isBuffer(t)?t.readBigUInt64LE():null}readBigUInt64BE(){const t=this.read(8);return l.isBuffer(t)?t.readBigUInt64BE():null}}O.exports=B},{buffer:3,stream:54}],52:[function(a,O,M){var p,l,b=O.exports={};function B(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function t(S){if(p===setTimeout)return setTimeout(S,0);if((p===B||!p)&&setTimeout)return p=setTimeout,setTimeout(S,0);try{return p(S,0)}catch{try{return p.call(null,S,0)}catch{return p.call(this,S,0)}}}function n(S){if(l===clearTimeout)return clearTimeout(S);if((l===u||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(S);try{return l(S)}catch{try{return l.call(null,S)}catch{return l.call(this,S)}}}(function(){try{p=typeof setTimeout=="function"?setTimeout:B}catch{p=B}try{l=typeof clearTimeout=="function"?clearTimeout:u}catch{l=u}})();var s,d=[],c=!1,y=-1;function v(){c&&s&&(c=!1,s.length?d=s.concat(d):y=-1,d.length&&m())}function m(){if(!c){var S=t(v);c=!0;for(var C=d.length;C;){for(s=d,d=[];++y<C;)s&&s[y].run();y=-1,C=d.length}s=null,c=!1,n(S)}}function g(S,C){this.fun=S,this.array=C}function _(){}b.nextTick=function(S){var C=new Array(arguments.length-1);if(arguments.length>1)for(var I=1;I<arguments.length;I++)C[I-1]=arguments[I];d.push(new g(S,C)),d.length!==1||c||t(m)},g.prototype.run=function(){this.fun.apply(null,this.array)},b.title="browser",b.browser=!0,b.env={},b.argv=[],b.version="",b.versions={},b.on=_,b.addListener=_,b.once=_,b.off=_,b.removeListener=_,b.removeAllListeners=_,b.emit=_,b.prependListener=_,b.prependOnceListener=_,b.listeners=function(S){return[]},b.binding=function(S){throw new Error("process.binding is not supported")},b.cwd=function(){return"/"},b.chdir=function(S){throw new Error("process.chdir is not supported")},b.umask=function(){return 0}},{}],53:[function(a,O,M){var p=a("buffer"),l=p.Buffer;function b(u,t){for(var n in u)t[n]=u[n]}function B(u,t,n){return l(u,t,n)}l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow?O.exports=p:(b(p,M),M.Buffer=B),B.prototype=Object.create(l.prototype),b(l,B),B.from=function(u,t,n){if(typeof u=="number")throw new TypeError("Argument must not be a number");return l(u,t,n)},B.alloc=function(u,t,n){if(typeof u!="number")throw new TypeError("Argument must be a number");var s=l(u);return t!==void 0?typeof n=="string"?s.fill(t,n):s.fill(t):s.fill(0),s},B.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return l(u)},B.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return p.SlowBuffer(u)}},{buffer:3}],54:[function(a,O,M){O.exports=b;var p=a("events").EventEmitter,l=a("inherits");function b(){p.call(this)}l(b,p),b.Readable=a("readable-stream/lib/_stream_readable.js"),b.Writable=a("readable-stream/lib/_stream_writable.js"),b.Duplex=a("readable-stream/lib/_stream_duplex.js"),b.Transform=a("readable-stream/lib/_stream_transform.js"),b.PassThrough=a("readable-stream/lib/_stream_passthrough.js"),b.finished=a("readable-stream/lib/internal/streams/end-of-stream.js"),b.pipeline=a("readable-stream/lib/internal/streams/pipeline.js"),b.Stream=b,b.prototype.pipe=function(B,u){var t=this;function n(g){B.writable&&B.write(g)===!1&&t.pause&&t.pause()}function s(){t.readable&&t.resume&&t.resume()}t.on("data",n),B.on("drain",s),B._isStdio||u&&u.end===!1||(t.on("end",c),t.on("close",y));var d=!1;function c(){d||(d=!0,B.end())}function y(){d||(d=!0,typeof B.destroy=="function"&&B.destroy())}function v(g){if(m(),p.listenerCount(this,"error")===0)throw g}function m(){t.removeListener("data",n),B.removeListener("drain",s),t.removeListener("end",c),t.removeListener("close",y),t.removeListener("error",v),B.removeListener("error",v),t.removeListener("end",m),t.removeListener("close",m),B.removeListener("close",m)}return t.on("error",v),B.on("error",v),t.on("end",m),t.on("close",m),B.on("close",m),B.emit("pipe",t),B}},{events:18,inherits:20,"readable-stream/lib/_stream_duplex.js":56,"readable-stream/lib/_stream_passthrough.js":57,"readable-stream/lib/_stream_readable.js":58,"readable-stream/lib/_stream_transform.js":59,"readable-stream/lib/_stream_writable.js":60,"readable-stream/lib/internal/streams/end-of-stream.js":64,"readable-stream/lib/internal/streams/pipeline.js":66}],55:[function(a,O,M){function p(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,s.__proto__=d}var l={};function b(s,d,c){c||(c=Error);var y=(function(v){function m(g,_,S){return v.call(this,(function(C,I,X){return typeof d=="string"?d:d(C,I,X)})(g,_,S))||this}return p(m,v),m})(c);y.prototype.name=c.name,y.prototype.code=s,l[s]=y}function B(s,d){if(Array.isArray(s)){var c=s.length;return s=s.map(function(y){return String(y)}),c>2?"one of ".concat(d," ").concat(s.slice(0,c-1).join(", "),", or ")+s[c-1]:c===2?"one of ".concat(d," ").concat(s[0]," or ").concat(s[1]):"of ".concat(d," ").concat(s[0])}return"of ".concat(d," ").concat(String(s))}function u(s,d,c){return s.substr(0,d.length)===d}function t(s,d,c){return(c===void 0||c>s.length)&&(c=s.length),s.substring(c-d.length,c)===d}function n(s,d,c){return typeof c!="number"&&(c=0),!(c+d.length>s.length)&&s.indexOf(d,c)!==-1}b("ERR_INVALID_OPT_VALUE",function(s,d){return'The value "'+d+'" is invalid for option "'+s+'"'},TypeError),b("ERR_INVALID_ARG_TYPE",function(s,d,c){var y,v;if(typeof d=="string"&&u(d,"not ")?(y="must not be",d=d.replace(/^not /,"")):y="must be",t(s," argument"))v="The ".concat(s," ").concat(y," ").concat(B(d,"type"));else{var m=n(s,".")?"property":"argument";v='The "'.concat(s,'" ').concat(m," ").concat(y," ").concat(B(d,"type"))}return v+=". Received type ".concat(typeof c)},TypeError),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),b("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),b("ERR_STREAM_PREMATURE_CLOSE","Premature close"),b("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),b("ERR_STREAM_WRITE_AFTER_END","write after end"),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),O.exports.codes=l},{}],56:[function(a,O,M){(function(p){(function(){var l=Object.keys||function(y){var v=[];for(var m in y)v.push(m);return v};O.exports=s;var b=a("./_stream_readable"),B=a("./_stream_writable");a("inherits")(s,b);for(var u=l(B.prototype),t=0;t<u.length;t++){var n=u[t];s.prototype[n]||(s.prototype[n]=B.prototype[n])}function s(y){if(!(this instanceof s))return new s(y);b.call(this,y),B.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||p.nextTick(c,this)}function c(y){y.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this)}).call(this,a("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:52,inherits:20}],57:[function(a,O,M){O.exports=l;var p=a("./_stream_transform");function l(b){if(!(this instanceof l))return new l(b);p.call(this,b)}a("inherits")(l,p),l.prototype._transform=function(b,B,u){u(null,b)}},{"./_stream_transform":59,inherits:20}],58:[function(a,O,M){(function(p,l){(function(){var b;O.exports=H,H.ReadableState=rt,a("events").EventEmitter;var B=function(x,R){return x.listeners(R).length},u=a("./internal/streams/stream"),t=a("buffer").Buffer,n=(typeof l<"u"?l:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(x){return t.from(x)}function d(x){return t.isBuffer(x)||x instanceof n}var c,y=a("util");c=y&&y.debuglog?y.debuglog("stream"):function(){};var v,m,g,_=a("./internal/streams/buffer_list"),S=a("./internal/streams/destroy"),C=a("./internal/streams/state"),I=C.getHighWaterMark,X=a("../errors").codes,Z=X.ERR_INVALID_ARG_TYPE,L=X.ERR_STREAM_PUSH_AFTER_EOF,U=X.ERR_METHOD_NOT_IMPLEMENTED,T=X.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;a("inherits")(H,u);var F=S.errorOrDestroy,z=["error","close","destroy","pause","resume"];function Y(x,R,e){if(typeof x.prependListener=="function")return x.prependListener(R,e);x._events&&x._events[R]?Array.isArray(x._events[R])?x._events[R].unshift(e):x._events[R]=[e,x._events[R]]:x.on(R,e)}function rt(x,R,e){b=b||a("./_stream_duplex"),x=x||{},typeof e!="boolean"&&(e=R instanceof b),this.objectMode=!!x.objectMode,e&&(this.objectMode=this.objectMode||!!x.readableObjectMode),this.highWaterMark=I(this,x,"readableHighWaterMark",e),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=x.emitClose!==!1,this.autoDestroy=!!x.autoDestroy,this.destroyed=!1,this.defaultEncoding=x.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,x.encoding&&(v||(v=a("string_decoder/").StringDecoder),this.decoder=new v(x.encoding),this.encoding=x.encoding)}function H(x){if(b=b||a("./_stream_duplex"),!(this instanceof H))return new H(x);var R=this instanceof b;this._readableState=new rt(x,this,R),this.readable=!0,x&&(typeof x.read=="function"&&(this._read=x.read),typeof x.destroy=="function"&&(this._destroy=x.destroy)),u.call(this)}function ht(x,R,e,o,h){c("readableAddChunk",R);var j,V=x._readableState;if(R===null)V.reading=!1,D(x,V);else if(h||(j=P(V,R)),j)F(x,j);else if(V.objectMode||R&&R.length>0)if(typeof R=="string"||V.objectMode||Object.getPrototypeOf(R)===t.prototype||(R=s(R)),o)V.endEmitted?F(x,new T):E(x,V,R,!0);else if(V.ended)F(x,new L);else{if(V.destroyed)return!1;V.reading=!1,V.decoder&&!e?(R=V.decoder.write(R),V.objectMode||R.length!==0?E(x,V,R,!1):ut(x,V)):E(x,V,R,!1)}else o||(V.reading=!1,ut(x,V));return!V.ended&&(V.length<V.highWaterMark||V.length===0)}function E(x,R,e,o){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,x.emit("data",e)):(R.length+=R.objectMode?1:e.length,o?R.buffer.unshift(e):R.buffer.push(e),R.needReadable&&k(x)),ut(x,R)}function P(x,R){var e;return d(R)||typeof R=="string"||R===void 0||x.objectMode||(e=new Z("chunk",["string","Buffer","Uint8Array"],R)),e}Object.defineProperty(H.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),H.prototype.destroy=S.destroy,H.prototype._undestroy=S.undestroy,H.prototype._destroy=function(x,R){R(x)},H.prototype.push=function(x,R){var e,o=this._readableState;return o.objectMode?e=!0:typeof x=="string"&&((R=R||o.defaultEncoding)!==o.encoding&&(x=t.from(x,R),R=""),e=!0),ht(this,x,R,!1,e)},H.prototype.unshift=function(x){return ht(this,x,null,!0,!1)},H.prototype.isPaused=function(){return this._readableState.flowing===!1},H.prototype.setEncoding=function(x){v||(v=a("string_decoder/").StringDecoder);var R=new v(x);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var e=this._readableState.buffer.head,o="";e!==null;)o+=R.write(e.data),e=e.next;return this._readableState.buffer.clear(),o!==""&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var q=1073741824;function ot(x){return x>=q?x=q:(x--,x|=x>>>1,x|=x>>>2,x|=x>>>4,x|=x>>>8,x|=x>>>16,x++),x}function w(x,R){return x<=0||R.length===0&&R.ended?0:R.objectMode?1:x!=x?R.flowing&&R.length?R.buffer.head.data.length:R.length:(x>R.highWaterMark&&(R.highWaterMark=ot(x)),x<=R.length?x:R.ended?R.length:(R.needReadable=!0,0))}function D(x,R){if(c("onEofChunk"),!R.ended){if(R.decoder){var e=R.decoder.end();e&&e.length&&(R.buffer.push(e),R.length+=R.objectMode?1:e.length)}R.ended=!0,R.sync?k(x):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,G(x)))}}function k(x){var R=x._readableState;c("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(c("emitReadable",R.flowing),R.emittedReadable=!0,p.nextTick(G,x))}function G(x){var R=x._readableState;c("emitReadable_",R.destroyed,R.length,R.ended),R.destroyed||!R.length&&!R.ended||(x.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,N(x)}function ut(x,R){R.readingMore||(R.readingMore=!0,p.nextTick(ft,x,R))}function ft(x,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var e=R.length;if(c("maybeReadMore read 0"),x.read(0),e===R.length)break}R.readingMore=!1}function dt(x){return function(){var R=x._readableState;c("pipeOnDrain",R.awaitDrain),R.awaitDrain&&R.awaitDrain--,R.awaitDrain===0&&B(x,"data")&&(R.flowing=!0,N(x))}}function J(x){var R=x._readableState;R.readableListening=x.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:x.listenerCount("data")>0&&x.resume()}function tt(x){c("readable nexttick read 0"),x.read(0)}function nt(x,R){R.resumeScheduled||(R.resumeScheduled=!0,p.nextTick(st,x,R))}function st(x,R){c("resume",R.reading),R.reading||x.read(0),R.resumeScheduled=!1,x.emit("resume"),N(x),R.flowing&&!R.reading&&x.read(0)}function N(x){var R=x._readableState;for(c("flow",R.flowing);R.flowing&&x.read()!==null;);}function $(x,R){return R.length===0?null:(R.objectMode?e=R.buffer.shift():!x||x>=R.length?(e=R.decoder?R.buffer.join(""):R.buffer.length===1?R.buffer.first():R.buffer.concat(R.length),R.buffer.clear()):e=R.buffer.consume(x,R.decoder),e);var e}function at(x){var R=x._readableState;c("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,p.nextTick(lt,R,x))}function lt(x,R){if(c("endReadableNT",x.endEmitted,x.length),!x.endEmitted&&x.length===0&&(x.endEmitted=!0,R.readable=!1,R.emit("end"),x.autoDestroy)){var e=R._writableState;(!e||e.autoDestroy&&e.finished)&&R.destroy()}}function pt(x,R){for(var e=0,o=x.length;e<o;e++)if(x[e]===R)return e;return-1}H.prototype.read=function(x){c("read",x),x=parseInt(x,10);var R=this._readableState,e=x;if(x!==0&&(R.emittedReadable=!1),x===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return c("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?at(this):k(this),null;if((x=w(x,R))===0&&R.ended)return R.length===0&&at(this),null;var o,h=R.needReadable;return c("need readable",h),(R.length===0||R.length-x<R.highWaterMark)&&c("length less than watermark",h=!0),R.ended||R.reading?c("reading or ended",h=!1):h&&(c("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(x=w(e,R))),(o=x>0?$(x,R):null)===null?(R.needReadable=R.length<=R.highWaterMark,x=0):(R.length-=x,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),e!==x&&R.ended&&at(this)),o!==null&&this.emit("data",o),o},H.prototype._read=function(x){F(this,new U("_read()"))},H.prototype.pipe=function(x,R){var e=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=x;break;case 1:o.pipes=[o.pipes,x];break;default:o.pipes.push(x)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,R);var h=(!R||R.end!==!1)&&x!==p.stdout&&x!==p.stderr?V:r;function j(i,A){c("onunpipe"),i===e&&A&&A.hasUnpiped===!1&&(A.hasUnpiped=!0,c("cleanup"),x.removeListener("close",_t),x.removeListener("finish",f),x.removeListener("drain",it),x.removeListener("error",wt),x.removeListener("unpipe",j),e.removeListener("end",V),e.removeListener("end",r),e.removeListener("data",mt),yt=!0,!o.awaitDrain||x._writableState&&!x._writableState.needDrain||it())}function V(){c("onend"),x.end()}o.endEmitted?p.nextTick(h):e.once("end",h),x.on("unpipe",j);var it=dt(e);x.on("drain",it);var yt=!1;function mt(i){c("ondata");var A=x.write(i);c("dest.write",A),A===!1&&((o.pipesCount===1&&o.pipes===x||o.pipesCount>1&&pt(o.pipes,x)!==-1)&&!yt&&(c("false write response, pause",o.awaitDrain),o.awaitDrain++),e.pause())}function wt(i){c("onerror",i),r(),x.removeListener("error",wt),B(x,"error")===0&&F(x,i)}function _t(){x.removeListener("finish",f),r()}function f(){c("onfinish"),x.removeListener("close",_t),r()}function r(){c("unpipe"),e.unpipe(x)}return e.on("data",mt),Y(x,"error",wt),x.once("close",_t),x.once("finish",f),x.emit("pipe",e),o.flowing||(c("pipe resume"),e.resume()),x},H.prototype.unpipe=function(x){var R=this._readableState,e={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return x&&x!==R.pipes?this:(x||(x=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,x&&x.emit("unpipe",this,e),this);if(!x){var o=R.pipes,h=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var j=0;j<h;j++)o[j].emit("unpipe",this,{hasUnpiped:!1});return this}var V=pt(R.pipes,x);return V===-1?this:(R.pipes.splice(V,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),x.emit("unpipe",this,e),this)},H.prototype.on=function(x,R){var e=u.prototype.on.call(this,x,R),o=this._readableState;return x==="data"?(o.readableListening=this.listenerCount("readable")>0,o.flowing!==!1&&this.resume()):x==="readable"&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,c("on readable",o.length,o.reading),o.length?k(this):o.reading||p.nextTick(tt,this))),e},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(x,R){var e=u.prototype.removeListener.call(this,x,R);return x==="readable"&&p.nextTick(J,this),e},H.prototype.removeAllListeners=function(x){var R=u.prototype.removeAllListeners.apply(this,arguments);return x!=="readable"&&x!==void 0||p.nextTick(J,this),R},H.prototype.resume=function(){var x=this._readableState;return x.flowing||(c("resume"),x.flowing=!x.readableListening,nt(this,x)),x.paused=!1,this},H.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},H.prototype.wrap=function(x){var R=this,e=this._readableState,o=!1;for(var h in x.on("end",function(){if(c("wrapped end"),e.decoder&&!e.ended){var V=e.decoder.end();V&&V.length&&R.push(V)}R.push(null)}),x.on("data",function(V){c("wrapped data"),e.decoder&&(V=e.decoder.write(V)),e.objectMode&&V==null||(e.objectMode||V&&V.length)&&(R.push(V)||(o=!0,x.pause()))}),x)this[h]===void 0&&typeof x[h]=="function"&&(this[h]=(function(V){return function(){return x[V].apply(x,arguments)}})(h));for(var j=0;j<z.length;j++)x.on(z[j],this.emit.bind(this,z[j]));return this._read=function(V){c("wrapped _read",V),o&&(o=!1,x.resume())},this},typeof Symbol=="function"&&(H.prototype[Symbol.asyncIterator]=function(){return m===void 0&&(m=a("./internal/streams/async_iterator")),m(this)}),Object.defineProperty(H.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(H.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(H.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){this._readableState&&(this._readableState.flowing=x)}}),H._fromList=$,Object.defineProperty(H.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(H.from=function(x,R){return g===void 0&&(g=a("./internal/streams/from")),g(H,x,R)})}).call(this)}).call(this,a("_process"),typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:52,buffer:3,events:18,inherits:20,"string_decoder/":69,util:2}],59:[function(a,O,M){O.exports=s;var p=a("../errors").codes,l=p.ERR_METHOD_NOT_IMPLEMENTED,b=p.ERR_MULTIPLE_CALLBACK,B=p.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=p.ERR_TRANSFORM_WITH_LENGTH_0,t=a("./_stream_duplex");function n(y,v){var m=this._transformState;m.transforming=!1;var g=m.writecb;if(g===null)return this.emit("error",new b);m.writechunk=null,m.writecb=null,v!=null&&this.push(v),g(y);var _=this._readableState;_.reading=!1,(_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}function s(y){if(!(this instanceof s))return new s(y);t.call(this,y),this._transformState={afterTransform:n.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,y&&(typeof y.transform=="function"&&(this._transform=y.transform),typeof y.flush=="function"&&(this._flush=y.flush)),this.on("prefinish",d)}function d(){var y=this;typeof this._flush!="function"||this._readableState.destroyed?c(this,null,null):this._flush(function(v,m){c(y,v,m)})}function c(y,v,m){if(v)return y.emit("error",v);if(m!=null&&y.push(m),y._writableState.length)throw new u;if(y._transformState.transforming)throw new B;return y.push(null)}a("inherits")(s,t),s.prototype.push=function(y,v){return this._transformState.needTransform=!1,t.prototype.push.call(this,y,v)},s.prototype._transform=function(y,v,m){m(new l("_transform()"))},s.prototype._write=function(y,v,m){var g=this._transformState;if(g.writecb=m,g.writechunk=y,g.writeencoding=v,!g.transforming){var _=this._readableState;(g.needTransform||_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}},s.prototype._read=function(y){var v=this._transformState;v.writechunk===null||v.transforming?v.needTransform=!0:(v.transforming=!0,this._transform(v.writechunk,v.writeencoding,v.afterTransform))},s.prototype._destroy=function(y,v){t.prototype._destroy.call(this,y,function(m){v(m)})}},{"../errors":55,"./_stream_duplex":56,inherits:20}],60:[function(a,O,M){(function(p,l){(function(){function b(N){var $=this;this.next=null,this.entry=null,this.finish=function(){st($,N)}}var B;O.exports=rt,rt.WritableState=Y;var u={deprecate:a("util-deprecate")},t=a("./internal/streams/stream"),n=a("buffer").Buffer,s=(typeof l<"u"?l:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function d(N){return n.from(N)}function c(N){return n.isBuffer(N)||N instanceof s}var y,v=a("./internal/streams/destroy"),m=a("./internal/streams/state"),g=m.getHighWaterMark,_=a("../errors").codes,S=_.ERR_INVALID_ARG_TYPE,C=_.ERR_METHOD_NOT_IMPLEMENTED,I=_.ERR_MULTIPLE_CALLBACK,X=_.ERR_STREAM_CANNOT_PIPE,Z=_.ERR_STREAM_DESTROYED,L=_.ERR_STREAM_NULL_VALUES,U=_.ERR_STREAM_WRITE_AFTER_END,T=_.ERR_UNKNOWN_ENCODING,F=v.errorOrDestroy;function z(){}function Y(N,$,at){B=B||a("./_stream_duplex"),N=N||{},typeof at!="boolean"&&(at=$ instanceof B),this.objectMode=!!N.objectMode,at&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=g(this,N,"writableHighWaterMark",at),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var lt=N.decodeStrings===!1;this.decodeStrings=!lt,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(pt){D($,pt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new b(this)}function rt(N){var $=this instanceof(B=B||a("./_stream_duplex"));if(!$&&!y.call(rt,this))return new rt(N);this._writableState=new Y(N,this,$),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),t.call(this)}function H(N,$){var at=new U;F(N,at),p.nextTick($,at)}function ht(N,$,at,lt){var pt;return at===null?pt=new L:typeof at=="string"||$.objectMode||(pt=new S("chunk",["string","Buffer"],at)),!pt||(F(N,pt),p.nextTick(lt,pt),!1)}function E(N,$,at){return N.objectMode||N.decodeStrings===!1||typeof $!="string"||($=n.from($,at)),$}function P(N,$,at,lt,pt,x){if(!at){var R=E($,lt,pt);lt!==R&&(at=!0,pt="buffer",lt=R)}var e=$.objectMode?1:lt.length;$.length+=e;var o=$.length<$.highWaterMark;if(o||($.needDrain=!0),$.writing||$.corked){var h=$.lastBufferedRequest;$.lastBufferedRequest={chunk:lt,encoding:pt,isBuf:at,callback:x,next:null},h?h.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else q(N,$,!1,e,lt,pt,x);return o}function q(N,$,at,lt,pt,x,R){$.writelen=lt,$.writecb=R,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new Z("write")):at?N._writev(pt,$.onwrite):N._write(pt,x,$.onwrite),$.sync=!1}function ot(N,$,at,lt,pt){--$.pendingcb,at?(p.nextTick(pt,lt),p.nextTick(tt,N,$),N._writableState.errorEmitted=!0,F(N,lt)):(pt(lt),N._writableState.errorEmitted=!0,F(N,lt),tt(N,$))}function w(N){N.writing=!1,N.writecb=null,N.length-=N.writelen,N.writelen=0}function D(N,$){var at=N._writableState,lt=at.sync,pt=at.writecb;if(typeof pt!="function")throw new I;if(w(at),$)ot(N,at,lt,$,pt);else{var x=ft(at)||N.destroyed;x||at.corked||at.bufferProcessing||!at.bufferedRequest||ut(N,at),lt?p.nextTick(k,N,at,x,pt):k(N,at,x,pt)}}function k(N,$,at,lt){at||G(N,$),$.pendingcb--,lt(),tt(N,$)}function G(N,$){$.length===0&&$.needDrain&&($.needDrain=!1,N.emit("drain"))}function ut(N,$){$.bufferProcessing=!0;var at=$.bufferedRequest;if(N._writev&&at&&at.next){var lt=$.bufferedRequestCount,pt=new Array(lt),x=$.corkedRequestsFree;x.entry=at;for(var R=0,e=!0;at;)pt[R]=at,at.isBuf||(e=!1),at=at.next,R+=1;pt.allBuffers=e,q(N,$,!0,$.length,pt,"",x.finish),$.pendingcb++,$.lastBufferedRequest=null,x.next?($.corkedRequestsFree=x.next,x.next=null):$.corkedRequestsFree=new b($),$.bufferedRequestCount=0}else{for(;at;){var o=at.chunk,h=at.encoding,j=at.callback;if(q(N,$,!1,$.objectMode?1:o.length,o,h,j),at=at.next,$.bufferedRequestCount--,$.writing)break}at===null&&($.lastBufferedRequest=null)}$.bufferedRequest=at,$.bufferProcessing=!1}function ft(N){return N.ending&&N.length===0&&N.bufferedRequest===null&&!N.finished&&!N.writing}function dt(N,$){N._final(function(at){$.pendingcb--,at&&F(N,at),$.prefinished=!0,N.emit("prefinish"),tt(N,$)})}function J(N,$){$.prefinished||$.finalCalled||(typeof N._final!="function"||$.destroyed?($.prefinished=!0,N.emit("prefinish")):($.pendingcb++,$.finalCalled=!0,p.nextTick(dt,N,$)))}function tt(N,$){var at=ft($);if(at&&(J(N,$),$.pendingcb===0&&($.finished=!0,N.emit("finish"),$.autoDestroy))){var lt=N._readableState;(!lt||lt.autoDestroy&&lt.endEmitted)&&N.destroy()}return at}function nt(N,$,at){$.ending=!0,tt(N,$),at&&($.finished?p.nextTick(at):N.once("finish",at)),$.ended=!0,N.writable=!1}function st(N,$,at){var lt=N.entry;for(N.entry=null;lt;){var pt=lt.callback;$.pendingcb--,pt(at),lt=lt.next}$.corkedRequestsFree.next=N}a("inherits")(rt,t),Y.prototype.getBuffer=function(){for(var N=this.bufferedRequest,$=[];N;)$.push(N),N=N.next;return $},(function(){try{Object.defineProperty(Y.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(y=Function.prototype[Symbol.hasInstance],Object.defineProperty(rt,Symbol.hasInstance,{value:function(N){return!!y.call(this,N)||this===rt&&N&&N._writableState instanceof Y}})):y=function(N){return N instanceof this},rt.prototype.pipe=function(){F(this,new X)},rt.prototype.write=function(N,$,at){var lt=this._writableState,pt=!1,x=!lt.objectMode&&c(N);return x&&!n.isBuffer(N)&&(N=d(N)),typeof $=="function"&&(at=$,$=null),x?$="buffer":$||($=lt.defaultEncoding),typeof at!="function"&&(at=z),lt.ending?H(this,at):(x||ht(this,lt,N,at))&&(lt.pendingcb++,pt=P(this,lt,x,N,$,at)),pt},rt.prototype.cork=function(){this._writableState.corked++},rt.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,N.writing||N.corked||N.bufferProcessing||!N.bufferedRequest||ut(this,N))},rt.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new T(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(rt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(rt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),rt.prototype._write=function(N,$,at){at(new C("_write()"))},rt.prototype._writev=null,rt.prototype.end=function(N,$,at){var lt=this._writableState;return typeof N=="function"?(at=N,N=null,$=null):typeof $=="function"&&(at=$,$=null),N!=null&&this.write(N,$),lt.corked&&(lt.corked=1,this.uncork()),lt.ending||nt(this,lt,at),this},Object.defineProperty(rt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(rt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),rt.prototype.destroy=v.destroy,rt.prototype._undestroy=v.undestroy,rt.prototype._destroy=function(N,$){$(N)}}).call(this)}).call(this,a("_process"),typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:52,buffer:3,inherits:20,"util-deprecate":70}],61:[function(a,O,M){(function(p){(function(){var l;function b(L,U,T){return(U=B(U))in L?Object.defineProperty(L,U,{value:T,enumerable:!0,configurable:!0,writable:!0}):L[U]=T,L}function B(L){var U=u(L,"string");return typeof U=="symbol"?U:String(U)}function u(L,U){if(typeof L!="object"||L===null)return L;var T=L[Symbol.toPrimitive];if(T!==void 0){var F=T.call(L,U);if(typeof F!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return(U==="string"?String:Number)(L)}var t=a("./end-of-stream"),n=Symbol("lastResolve"),s=Symbol("lastReject"),d=Symbol("error"),c=Symbol("ended"),y=Symbol("lastPromise"),v=Symbol("handlePromise"),m=Symbol("stream");function g(L,U){return{value:L,done:U}}function _(L){var U=L[n];if(U!==null){var T=L[m].read();T!==null&&(L[y]=null,L[n]=null,L[s]=null,U(g(T,!1)))}}function S(L){p.nextTick(_,L)}function C(L,U){return function(T,F){L.then(function(){U[c]?T(g(void 0,!0)):U[v](T,F)},F)}}var I=Object.getPrototypeOf(function(){}),X=Object.setPrototypeOf((b(l={get stream(){return this[m]},next:function(){var L=this,U=this[d];if(U!==null)return Promise.reject(U);if(this[c])return Promise.resolve(g(void 0,!0));if(this[m].destroyed)return new Promise(function(Y,rt){p.nextTick(function(){L[d]?rt(L[d]):Y(g(void 0,!0))})});var T,F=this[y];if(F)T=new Promise(C(F,this));else{var z=this[m].read();if(z!==null)return Promise.resolve(g(z,!1));T=new Promise(this[v])}return this[y]=T,T}},Symbol.asyncIterator,function(){return this}),b(l,"return",function(){var L=this;return new Promise(function(U,T){L[m].destroy(null,function(F){F?T(F):U(g(void 0,!0))})})}),l),I),Z=function(L){var U,T=Object.create(X,(b(U={},m,{value:L,writable:!0}),b(U,n,{value:null,writable:!0}),b(U,s,{value:null,writable:!0}),b(U,d,{value:null,writable:!0}),b(U,c,{value:L._readableState.endEmitted,writable:!0}),b(U,v,{value:function(F,z){var Y=T[m].read();Y?(T[y]=null,T[n]=null,T[s]=null,F(g(Y,!1))):(T[n]=F,T[s]=z)},writable:!0}),U));return T[y]=null,t(L,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var z=T[s];return z!==null&&(T[y]=null,T[n]=null,T[s]=null,z(F)),void(T[d]=F)}var Y=T[n];Y!==null&&(T[y]=null,T[n]=null,T[s]=null,Y(g(void 0,!0))),T[c]=!0}),L.on("readable",S.bind(null,T)),T};O.exports=Z}).call(this)}).call(this,a("_process"))},{"./end-of-stream":64,_process:52}],62:[function(a,O,M){function p(_,S){var C=Object.keys(_);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(_);S&&(I=I.filter(function(X){return Object.getOwnPropertyDescriptor(_,X).enumerable})),C.push.apply(C,I)}return C}function l(_){for(var S=1;S<arguments.length;S++){var C=arguments[S]!=null?arguments[S]:{};S%2?p(Object(C),!0).forEach(function(I){b(_,I,C[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(C)):p(Object(C)).forEach(function(I){Object.defineProperty(_,I,Object.getOwnPropertyDescriptor(C,I))})}return _}function b(_,S,C){return(S=n(S))in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function B(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function u(_,S){for(var C=0;C<S.length;C++){var I=S[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(_,n(I.key),I)}}function t(_,S,C){return S&&u(_.prototype,S),Object.defineProperty(_,"prototype",{writable:!1}),_}function n(_){var S=s(_,"string");return typeof S=="symbol"?S:String(S)}function s(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var I=C.call(_,S);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(_)}var d=a("buffer"),c=d.Buffer,y=a("util"),v=y.inspect,m=v&&v.custom||"inspect";function g(_,S,C){c.prototype.copy.call(_,S,C)}O.exports=(function(){function _(){B(this,_),this.head=null,this.tail=null,this.length=0}return t(_,[{key:"push",value:function(S){var C={data:S,next:null};this.length>0?this.tail.next=C:this.head=C,this.tail=C,++this.length}},{key:"unshift",value:function(S){var C={data:S,next:this.head};this.length===0&&(this.tail=C),this.head=C,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var C=this.head,I=""+C.data;C=C.next;)I+=S+C.data;return I}},{key:"concat",value:function(S){if(this.length===0)return c.alloc(0);for(var C=c.allocUnsafe(S>>>0),I=this.head,X=0;I;)g(I.data,C,X),X+=I.data.length,I=I.next;return C}},{key:"consume",value:function(S,C){var I;return S<this.head.data.length?(I=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):I=S===this.head.data.length?this.shift():C?this._getString(S):this._getBuffer(S),I}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var C=this.head,I=1,X=C.data;for(S-=X.length;C=C.next;){var Z=C.data,L=S>Z.length?Z.length:S;if(L===Z.length?X+=Z:X+=Z.slice(0,S),(S-=L)===0){L===Z.length?(++I,C.next?this.head=C.next:this.head=this.tail=null):(this.head=C,C.data=Z.slice(L));break}++I}return this.length-=I,X}},{key:"_getBuffer",value:function(S){var C=c.allocUnsafe(S),I=this.head,X=1;for(I.data.copy(C),S-=I.data.length;I=I.next;){var Z=I.data,L=S>Z.length?Z.length:S;if(Z.copy(C,C.length-S,0,L),(S-=L)===0){L===Z.length?(++X,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=Z.slice(L));break}++X}return this.length-=X,C}},{key:m,value:function(S,C){return v(this,l(l({},C),{},{depth:0,customInspect:!1}))}}]),_})()},{buffer:3,util:2}],63:[function(a,O,M){(function(p){(function(){function l(s,d){var c=this,y=this._readableState&&this._readableState.destroyed,v=this._writableState&&this._writableState.destroyed;return y||v?(d?d(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,p.nextTick(t,this,s)):p.nextTick(t,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(m){!d&&m?c._writableState?c._writableState.errorEmitted?p.nextTick(B,c):(c._writableState.errorEmitted=!0,p.nextTick(b,c,m)):p.nextTick(b,c,m):d?(p.nextTick(B,c),d(m)):p.nextTick(B,c)}),this)}function b(s,d){t(s,d),B(s)}function B(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function u(){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 t(s,d){s.emit("error",d)}function n(s,d){var c=s._readableState,y=s._writableState;c&&c.autoDestroy||y&&y.autoDestroy?s.destroy(d):s.emit("error",d)}O.exports={destroy:l,undestroy:u,errorOrDestroy:n}}).call(this)}).call(this,a("_process"))},{_process:52}],64:[function(a,O,M){var p=a("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function l(t){var n=!1;return function(){if(!n){n=!0;for(var s=arguments.length,d=new Array(s),c=0;c<s;c++)d[c]=arguments[c];t.apply(this,d)}}}function b(){}function B(t){return t.setHeader&&typeof t.abort=="function"}function u(t,n,s){if(typeof n=="function")return u(t,null,n);n||(n={}),s=l(s||b);var d=n.readable||n.readable!==!1&&t.readable,c=n.writable||n.writable!==!1&&t.writable,y=function(){t.writable||m()},v=t._writableState&&t._writableState.finished,m=function(){c=!1,v=!0,d||s.call(t)},g=t._readableState&&t._readableState.endEmitted,_=function(){d=!1,g=!0,c||s.call(t)},S=function(X){s.call(t,X)},C=function(){var X;return d&&!g?(t._readableState&&t._readableState.ended||(X=new p),s.call(t,X)):c&&!v?(t._writableState&&t._writableState.ended||(X=new p),s.call(t,X)):void 0},I=function(){t.req.on("finish",m)};return B(t)?(t.on("complete",m),t.on("abort",C),t.req?I():t.on("request",I)):c&&!t._writableState&&(t.on("end",y),t.on("close",y)),t.on("end",_),t.on("finish",m),n.error!==!1&&t.on("error",S),t.on("close",C),function(){t.removeListener("complete",m),t.removeListener("abort",C),t.removeListener("request",I),t.req&&t.req.removeListener("finish",m),t.removeListener("end",y),t.removeListener("close",y),t.removeListener("finish",m),t.removeListener("end",_),t.removeListener("error",S),t.removeListener("close",C)}}O.exports=u},{"../../../errors":55}],65:[function(a,O,M){O.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(a,O,M){var p;function l(m){var g=!1;return function(){g||(g=!0,m.apply(void 0,arguments))}}var b=a("../../../errors").codes,B=b.ERR_MISSING_ARGS,u=b.ERR_STREAM_DESTROYED;function t(m){if(m)throw m}function n(m){return m.setHeader&&typeof m.abort=="function"}function s(m,g,_,S){S=l(S);var C=!1;m.on("close",function(){C=!0}),p===void 0&&(p=a("./end-of-stream")),p(m,{readable:g,writable:_},function(X){if(X)return S(X);C=!0,S()});var I=!1;return function(X){if(!C&&!I)return I=!0,n(m)?m.abort():typeof m.destroy=="function"?m.destroy():void S(X||new u("pipe"))}}function d(m){m()}function c(m,g){return m.pipe(g)}function y(m){return m.length?typeof m[m.length-1]!="function"?t:m.pop():t}function v(){for(var m=arguments.length,g=new Array(m),_=0;_<m;_++)g[_]=arguments[_];var S,C=y(g);if(Array.isArray(g[0])&&(g=g[0]),g.length<2)throw new B("streams");var I=g.map(function(X,Z){var L=Z<g.length-1;return s(X,L,Z>0,function(U){S||(S=U),U&&I.forEach(d),L||(I.forEach(d),C(S))})});return g.reduce(c)}O.exports=v},{"../../../errors":55,"./end-of-stream":64}],67:[function(a,O,M){var p=a("../../../errors").codes.ERR_INVALID_OPT_VALUE;function l(B,u,t){return B.highWaterMark!=null?B.highWaterMark:u?B[t]:null}function b(B,u,t,n){var s=l(u,n,t);if(s!=null){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new p(n?t:"highWaterMark",s);return Math.floor(s)}return B.objectMode?16:16384}O.exports={getHighWaterMark:b}},{"../../../errors":55}],68:[function(a,O,M){O.exports=a("events").EventEmitter},{events:18}],69:[function(a,O,M){var p=a("safe-buffer").Buffer,l=p.isEncoding||function(I){switch((I=""+I)&&I.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function b(I){if(!I)return"utf8";for(var X;;)switch(I){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return I;default:if(X)return;I=(""+I).toLowerCase(),X=!0}}function B(I){var X=b(I);if(typeof X!="string"&&(p.isEncoding===l||!l(I)))throw new Error("Unknown encoding: "+I);return X||I}function u(I){var X;switch(this.encoding=B(I),this.encoding){case"utf16le":this.text=v,this.end=m,X=4;break;case"utf8":this.fillLast=d,X=4;break;case"base64":this.text=g,this.end=_,X=3;break;default:return this.write=S,void(this.end=C)}this.lastNeed=0,this.lastTotal=0,this.lastChar=p.allocUnsafe(X)}function t(I){return I<=127?0:I>>5==6?2:I>>4==14?3:I>>3==30?4:I>>6==2?-1:-2}function n(I,X,Z){var L=X.length-1;if(L<Z)return 0;var U=t(X[L]);return U>=0?(U>0&&(I.lastNeed=U-1),U):--L<Z||U===-2?0:(U=t(X[L]))>=0?(U>0&&(I.lastNeed=U-2),U):--L<Z||U===-2?0:(U=t(X[L]))>=0?(U>0&&(U===2?U=0:I.lastNeed=U-3),U):0}function s(I,X,Z){if((192&X[0])!=128)return I.lastNeed=0,"�";if(I.lastNeed>1&&X.length>1){if((192&X[1])!=128)return I.lastNeed=1,"�";if(I.lastNeed>2&&X.length>2&&(192&X[2])!=128)return I.lastNeed=2,"�"}}function d(I){var X=this.lastTotal-this.lastNeed,Z=s(this,I);return Z!==void 0?Z:this.lastNeed<=I.length?(I.copy(this.lastChar,X,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(I.copy(this.lastChar,X,0,I.length),void(this.lastNeed-=I.length))}function c(I,X){var Z=n(this,I,X);if(!this.lastNeed)return I.toString("utf8",X);this.lastTotal=Z;var L=I.length-(Z-this.lastNeed);return I.copy(this.lastChar,0,L),I.toString("utf8",X,L)}function y(I){var X=I&&I.length?this.write(I):"";return this.lastNeed?X+"�":X}function v(I,X){if((I.length-X)%2==0){var Z=I.toString("utf16le",X);if(Z){var L=Z.charCodeAt(Z.length-1);if(L>=55296&&L<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],Z.slice(0,-1)}return Z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",X,I.length-1)}function m(I){var X=I&&I.length?this.write(I):"";if(this.lastNeed){var Z=this.lastTotal-this.lastNeed;return X+this.lastChar.toString("utf16le",0,Z)}return X}function g(I,X){var Z=(I.length-X)%3;return Z===0?I.toString("base64",X):(this.lastNeed=3-Z,this.lastTotal=3,Z===1?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",X,I.length-Z))}function _(I){var X=I&&I.length?this.write(I):"";return this.lastNeed?X+this.lastChar.toString("base64",0,3-this.lastNeed):X}function S(I){return I.toString(this.encoding)}function C(I){return I&&I.length?this.write(I):""}M.StringDecoder=u,u.prototype.write=function(I){if(I.length===0)return"";var X,Z;if(this.lastNeed){if((X=this.fillLast(I))===void 0)return"";Z=this.lastNeed,this.lastNeed=0}else Z=0;return Z<I.length?X?X+this.text(I,Z):this.text(I,Z):X||""},u.prototype.end=y,u.prototype.text=c,u.prototype.fillLast=function(I){if(this.lastNeed<=I.length)return I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,I.length),this.lastNeed-=I.length}},{"safe-buffer":53}],70:[function(a,O,M){(function(p){(function(){function l(B,u){if(b("noDeprecation"))return B;var t=!1;return function(){if(!t){if(b("throwDeprecation"))throw new Error(u);b("traceDeprecation")?console.trace(u):console.warn(u),t=!0}return B.apply(this,arguments)}}function b(B){try{if(!p.localStorage)return!1}catch{return!1}var u=p.localStorage[B];return u!=null&&String(u).toLowerCase()==="true"}O.exports=l}).call(this)}).call(this,typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{}],71:[function(a,O,M){(function(p){(function(){var l=B(a("cbor")),b=B(a("msgpack-lite"));function B(m){return m&&m.__esModule?m:{default:m}}function u(m){return(u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g})(m)}function t(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function n(m,g){for(var _=0;_<g.length;_++){var S=g[_];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(m,d(S.key),S)}}function s(m,g,_){return g&&n(m.prototype,g),Object.defineProperty(m,"prototype",{writable:!1}),m}function d(m){var g=c(m,"string");return u(g)=="symbol"?g:g+""}function c(m,g){if(u(m)!="object"||!m)return m;var _=m[Symbol.toPrimitive];if(_!==void 0){var S=_.call(m,g);if(u(S)!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}var y={cbor:{encode:function(m){try{m=l.default.encode(m)}catch{throw new Error("failed to encode CBOR format")}return!ArrayBuffer.isView(m)&&p.browser&&(m=new Uint8Array(m)),m},decode:function(m){ArrayBuffer.isView(m)&&p.browser&&(m=m.buffer);try{m=l.default.decode(m)}catch{throw new Error("failed to decode CBOR format")}return m}},msgpack:{encode:function(m){try{m=b.default.encode(m)}catch{throw new Error("failed to encode MsgPack format")}return m},decode:function(m){try{m=b.default.decode(m)}catch{throw new Error("failed to decode MsgPack format")}return m}},json:{encode:function(m){try{m=JSON.stringify(m)}catch{throw new Error("failed to encode JSON format")}return m},decode:function(m){try{m=JSON.parse(m)}catch{throw new Error("failed to decode JSON format")}return m}}},v=(function(){return s(function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cbor";if(t(this,m),y[g]===void 0)throw new Error("invalid coded");this.type=g},[{key:"encode",value:function(m){return y[this.type].encode(m)}},{key:"decode",value:function(m){return y[this.type].decode(m)}}])})();O.exports=v}).call(this)}).call(this,a("_process"))},{_process:52,cbor:4,"msgpack-lite":23}]},{},[71])(71)})})(Kt)),Kt.exports}var Ae=xe();const Se=Ut(Ae);class Ie{constructor(et,a={}){this.mqtt=et,this.registry=new Map,this.requests=new Map,this.subscriptions=new Map,this.options={clientId:new Qt(1).format("std"),encoding:"json",timeout:10*1e3,topicRequestMake:O=>`${O}/request`,topicResponseMake:(O,M)=>`${O}/response/${M}`,topicRequestMatch:O=>O.match(/^(.+?)\/request$/),topicResponseMatch:O=>O.match(/^(.+?)\/response\/(.+)$/),...a},this.encodr=new Se(this.options.encoding),this.mqtt.on("message",(O,M)=>{this._onServerMessage(O,M),this._onClientMessage(O,M)})}registered(et){return this.registry.has(et)}register(et,a){if(this.registry.has(et))throw new Error(`register: method "${et}" already registered`);return this.registry.set(et,a),new Promise((O,M)=>{const p=this.options.topicRequestMake(et);this.mqtt.subscribe(p,{qos:2},(l,b)=>{l?M(l):O()})})}unregister(et){if(!this.registry.has(et))throw new Error(`unregister: method "${et}" not registered`);return this.registry.delete(et),new Promise((a,O)=>{const M=this.options.topicRequestMake(et);this.mqtt.unsubscribe(M,(p,l)=>{p?O(p):a()})})}_onServerMessage(et,a){if(this.options.topicRequestMatch(et)===null)return;let O;try{O=Mt.parseObject(this.encodr.decode(a))}catch{return}if(!(typeof O=="object"&&typeof O.type=="string"))return;const M=O.payload.method;if(O.type==="notification")this.registry.get(M)?.(...O.payload.params);else if(O.type==="request"){let p;const l=this.registry.get(M);l!==void 0?p=Promise.resolve().then(()=>l(...O.payload.params)):p=Promise.reject(gt.methodNotFound({method:M,id:O.payload.id})),p.then(b=>Mt.success(O.payload.id,b),b=>this._buildError(O.payload,b)).then(b=>{const B=O.payload.id.match(/^(.+):.+$/);if(B===null)throw new Error("invalid request id format");const u=this.encodr.encode(b),t=B[1],n=this.options.topicResponseMake(M,t);this.mqtt.publish(n,u,{qos:0})}).catch(b=>{this.mqtt.emit("error",b)})}}notify(et,...a){const O=this.options.topicRequestMake(et);let M=Mt.notification(et,a);M=this.encodr.encode(M),this.mqtt.publish(O,M,{qos:0})}call(et,...a){const O=`${this.options.clientId}:${new Qt(1).format("std")}`;this._responseSubscribe(et);const M=new Promise((b,B)=>{let u=setTimeout(()=>{this.requests.delete(O),this._responseUnsubscribe(et),u=null,B(new Error("communication timeout"))},this.options.timeout);this.requests.set(O,(t,n)=>{u!==null&&(clearTimeout(u),u=null),t?B(t):b(n)})});let p=Mt.request(O,et,a);const l=this.options.topicRequestMake(et);return p=this.encodr.encode(p),this.mqtt.publish(l,p,{qos:2},b=>{const B=this.requests.get(O);b&&B!==void 0&&(this._responseUnsubscribe(et),B(b,void 0),this.requests.delete(O))}),M}_onClientMessage(et,a){let O;if((O=this.options.topicResponseMatch(et))===null||O[2]!==this.options.clientId)return;let p;try{p=Mt.parseObject(this.encodr.decode(a))}catch{return}if(!(typeof p=="object"&&typeof p.type=="string"))return;const l=p.payload.method;if(p.type==="success"||p.type==="error"){const b=p.payload.id,B=this.requests.get(b);B!==void 0&&(p.type==="success"?B(void 0,p.payload.result):B(p.payload.error,void 0),this.requests.delete(b),this._responseUnsubscribe(l))}}_responseSubscribe(et){const a=this.options.topicResponseMake(et,this.options.clientId);this.subscriptions.has(a)||(this.subscriptions.set(a,0),this.mqtt.subscribe(a,{qos:2},O=>{O&&this.mqtt.emit("error",O)})),this.subscriptions.set(a,this.subscriptions.get(a)+1)}_responseUnsubscribe(et){const a=this.options.topicResponseMake(et,this.options.clientId);this.subscriptions.has(a)&&(this.subscriptions.set(a,this.subscriptions.get(a)-1),this.subscriptions.get(a)===0&&(this.subscriptions.delete(a),this.mqtt.unsubscribe(a,O=>{O&&this.mqtt.emit("error",O)})))}_buildError(et,a){let O;switch(typeof a){case"undefined":O=new gt("undefined error",0);break;case"string":O=new gt(a,-1);break;case"number":case"bigint":O=new gt("application error",Number(a));break;case"object":a===null?O=new gt("undefined error",0):a instanceof gt?O=a:a instanceof Error?O=new gt(a.toString(),-100,a):O=new gt("application error",-100,a);break;default:O=new gt("unspecified error",0,{data:a});break}return Mt.error(et.id,O)}}return Ie}));