@docknetwork/wallet-sdk-web 0.0.12 → 1.7.6

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.
@@ -4800,13 +4800,13 @@ const SUBSTRATE_NETWORKS = {
4800
4800
  name: 'Cheqd Mainnet',
4801
4801
  substrateUrl: null,
4802
4802
  addressPrefix: 22,
4803
- cheqdApiUrl: 'https://mainnet.cheqd.docknode.io'
4803
+ cheqdApiUrl: ['https://mainnet.cheqd.docknode.io', 'https://rpc.cheqd.net']
4804
4804
  },
4805
4805
  testnet: {
4806
4806
  name: 'Cheqd Testnet',
4807
4807
  substrateUrl: null,
4808
4808
  addressPrefix: 21,
4809
- cheqdApiUrl: 'https://testnet.cheqd.docknode.io'
4809
+ cheqdApiUrl: ['https://testnet.cheqd.docknode.io', 'https://api.cheqd.network']
4810
4810
  }};
4811
4811
 
4812
4812
  const genericDocumentNetworkResolver = async _ref => {
@@ -4804,13 +4804,13 @@ var TruveraWebWallet = (function () {
4804
4804
  name: 'Cheqd Mainnet',
4805
4805
  substrateUrl: null,
4806
4806
  addressPrefix: 22,
4807
- cheqdApiUrl: 'https://mainnet.cheqd.docknode.io'
4807
+ cheqdApiUrl: ['https://mainnet.cheqd.docknode.io', 'https://rpc.cheqd.net']
4808
4808
  },
4809
4809
  testnet: {
4810
4810
  name: 'Cheqd Testnet',
4811
4811
  substrateUrl: null,
4812
4812
  addressPrefix: 21,
4813
- cheqdApiUrl: 'https://testnet.cheqd.docknode.io'
4813
+ cheqdApiUrl: ['https://testnet.cheqd.docknode.io', 'https://api.cheqd.network']
4814
4814
  }};
4815
4815
 
4816
4816
  const genericDocumentNetworkResolver = async _ref => {
@@ -5,7 +5,7 @@ var TruveraWebWallet=function(){"use strict";const A=window;var g="undefined"!=t
5
5
  *
6
6
  * @author Feross Aboukhadijeh <https://feross.org>
7
7
  * @license MIT
8
- */function R(){return F||(F=1,function(A){const g=G(),e=M(),I="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;A.Buffer=B,A.SlowBuffer=function(A){+A!=A&&(A=0);return B.alloc(+A)},A.INSPECT_MAX_BYTES=50;const t=2147483647;function i(A){if(A>t)throw new RangeError('The value "'+A+'" is invalid for option "size"');const g=new Uint8Array(A);return Object.setPrototypeOf(g,B.prototype),g}function B(A,g,e){if("number"==typeof A){if("string"==typeof g)throw new TypeError('The "string" argument must be of type string. Received type number');return Q(A)}return o(A,g,e)}function o(A,g,e){if("string"==typeof A)return function(A,g){"string"==typeof g&&""!==g||(g="utf8");if(!B.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const e=0|E(A,g);let I=i(e);const t=I.write(A,g);t!==e&&(I=I.slice(0,t));return I}(A,g);if(ArrayBuffer.isView(A))return function(A){if(j(A,Uint8Array)){const g=new Uint8Array(A);return r(g.buffer,g.byteOffset,g.byteLength)}return n(A)}(A);if(null==A)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(j(A,ArrayBuffer)||A&&j(A.buffer,ArrayBuffer))return r(A,g,e);if("undefined"!=typeof SharedArrayBuffer&&(j(A,SharedArrayBuffer)||A&&j(A.buffer,SharedArrayBuffer)))return r(A,g,e);if("number"==typeof A)throw new TypeError('The "value" argument must not be of type number. Received type number');const I=A.valueOf&&A.valueOf();if(null!=I&&I!==A)return B.from(I,g,e);const t=function(A){if(B.isBuffer(A)){const g=0|a(A.length),e=i(g);return 0===e.length||A.copy(e,0,0,g),e}if(void 0!==A.length)return"number"!=typeof A.length||Z(A.length)?i(0):n(A);if("Buffer"===A.type&&Array.isArray(A.data))return n(A.data)}(A);if(t)return t;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof A[Symbol.toPrimitive])return B.from(A[Symbol.toPrimitive]("string"),g,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}function C(A){if("number"!=typeof A)throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function Q(A){return C(A),i(A<0?0:0|a(A))}function n(A){const g=A.length<0?0:0|a(A.length),e=i(g);for(let I=0;I<g;I+=1)e[I]=255&A[I];return e}function r(A,g,e){if(g<0||A.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<g+(e||0))throw new RangeError('"length" is outside of buffer bounds');let I;return I=void 0===g&&void 0===e?new Uint8Array(A):void 0===e?new Uint8Array(A,g):new Uint8Array(A,g,e),Object.setPrototypeOf(I,B.prototype),I}function a(A){if(A>=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|A}function E(A,g){if(B.isBuffer(A))return A.length;if(ArrayBuffer.isView(A)||j(A,ArrayBuffer))return A.byteLength;if("string"!=typeof A)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof A);const e=A.length,I=arguments.length>2&&!0===arguments[2];if(!I&&0===e)return 0;let t=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return V(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return T(A).length;default:if(t)return I?-1:V(A).length;g=(""+g).toLowerCase(),t=!0}}function s(A,g,e){let I=!1;if((void 0===g||g<0)&&(g=0),g>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(g>>>=0))return"";for(A||(A="utf8");;)switch(A){case"hex":return F(this,g,e);case"utf8":case"utf-8":return y(this,g,e);case"ascii":return N(this,g,e);case"latin1":case"binary":return S(this,g,e);case"base64":return f(this,g,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,g,e);default:if(I)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),I=!0}}function c(A,g,e){const I=A[g];A[g]=A[e],A[e]=I}function D(A,g,e,I,t){if(0===A.length)return-1;if("string"==typeof e?(I=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),Z(e=+e)&&(e=t?0:A.length-1),e<0&&(e=A.length+e),e>=A.length){if(t)return-1;e=A.length-1}else if(e<0){if(!t)return-1;e=0}if("string"==typeof g&&(g=B.from(g,I)),B.isBuffer(g))return 0===g.length?-1:d(A,g,e,I,t);if("number"==typeof g)return g&=255,"function"==typeof Uint8Array.prototype.indexOf?t?Uint8Array.prototype.indexOf.call(A,g,e):Uint8Array.prototype.lastIndexOf.call(A,g,e):d(A,[g],e,I,t);throw new TypeError("val must be string, number or Buffer")}function d(A,g,e,I,t){let i,B=1,o=A.length,C=g.length;if(void 0!==I&&("ucs2"===(I=String(I).toLowerCase())||"ucs-2"===I||"utf16le"===I||"utf-16le"===I)){if(A.length<2||g.length<2)return-1;B=2,o/=2,C/=2,e/=2}function Q(A,g){return 1===B?A[g]:A.readUInt16BE(g*B)}if(t){let I=-1;for(i=e;i<o;i++)if(Q(A,i)===Q(g,-1===I?0:i-I)){if(-1===I&&(I=i),i-I+1===C)return I*B}else-1!==I&&(i-=i-I),I=-1}else for(e+C>o&&(e=o-C),i=e;i>=0;i--){let e=!0;for(let I=0;I<C;I++)if(Q(A,i+I)!==Q(g,I)){e=!1;break}if(e)return i}return-1}function h(A,g,e,I){e=Number(e)||0;const t=A.length-e;I?(I=Number(I))>t&&(I=t):I=t;const i=g.length;let B;for(I>i/2&&(I=i/2),B=0;B<I;++B){const I=parseInt(g.substr(2*B,2),16);if(Z(I))return B;A[e+B]=I}return B}function u(A,g,e,I){return W(V(g,A.length-e),A,e,I)}function w(A,g,e,I){return W(function(A){const g=[];for(let e=0;e<A.length;++e)g.push(255&A.charCodeAt(e));return g}(g),A,e,I)}function l(A,g,e,I){return W(T(g),A,e,I)}function p(A,g,e,I){return W(function(A,g){let e,I,t;const i=[];for(let B=0;B<A.length&&!((g-=2)<0);++B)e=A.charCodeAt(B),I=e>>8,t=e%256,i.push(t),i.push(I);return i}(g,A.length-e),A,e,I)}function f(A,e,I){return 0===e&&I===A.length?g.fromByteArray(A):g.fromByteArray(A.slice(e,I))}function y(A,g,e){e=Math.min(A.length,e);const I=[];let t=g;for(;t<e;){const g=A[t];let i=null,B=g>239?4:g>223?3:g>191?2:1;if(t+B<=e){let e,I,o,C;switch(B){case 1:g<128&&(i=g);break;case 2:e=A[t+1],128==(192&e)&&(C=(31&g)<<6|63&e,C>127&&(i=C));break;case 3:e=A[t+1],I=A[t+2],128==(192&e)&&128==(192&I)&&(C=(15&g)<<12|(63&e)<<6|63&I,C>2047&&(C<55296||C>57343)&&(i=C));break;case 4:e=A[t+1],I=A[t+2],o=A[t+3],128==(192&e)&&128==(192&I)&&128==(192&o)&&(C=(15&g)<<18|(63&e)<<12|(63&I)<<6|63&o,C>65535&&C<1114112&&(i=C))}}null===i?(i=65533,B=1):i>65535&&(i-=65536,I.push(i>>>10&1023|55296),i=56320|1023&i),I.push(i),t+=B}return function(A){const g=A.length;if(g<=k)return String.fromCharCode.apply(String,A);let e="",I=0;for(;I<g;)e+=String.fromCharCode.apply(String,A.slice(I,I+=k));return e}(I)}A.kMaxLength=t,B.TYPED_ARRAY_SUPPORT=function(){try{const A=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(A,g),42===A.foo()}catch(A){return!1}}(),B.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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(B.prototype,"parent",{enumerable:!0,get:function(){if(B.isBuffer(this))return this.buffer}}),Object.defineProperty(B.prototype,"offset",{enumerable:!0,get:function(){if(B.isBuffer(this))return this.byteOffset}}),B.poolSize=8192,B.from=function(A,g,e){return o(A,g,e)},Object.setPrototypeOf(B.prototype,Uint8Array.prototype),Object.setPrototypeOf(B,Uint8Array),B.alloc=function(A,g,e){return function(A,g,e){return C(A),A<=0?i(A):void 0!==g?"string"==typeof e?i(A).fill(g,e):i(A).fill(g):i(A)}(A,g,e)},B.allocUnsafe=function(A){return Q(A)},B.allocUnsafeSlow=function(A){return Q(A)},B.isBuffer=function(A){return null!=A&&!0===A._isBuffer&&A!==B.prototype},B.compare=function(A,g){if(j(A,Uint8Array)&&(A=B.from(A,A.offset,A.byteLength)),j(g,Uint8Array)&&(g=B.from(g,g.offset,g.byteLength)),!B.isBuffer(A)||!B.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(A===g)return 0;let e=A.length,I=g.length;for(let t=0,i=Math.min(e,I);t<i;++t)if(A[t]!==g[t]){e=A[t],I=g[t];break}return e<I?-1:I<e?1:0},B.isEncoding=function(A){switch(String(A).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}},B.concat=function(A,g){if(!Array.isArray(A))throw new TypeError('"list" argument must be an Array of Buffers');if(0===A.length)return B.alloc(0);let e;if(void 0===g)for(g=0,e=0;e<A.length;++e)g+=A[e].length;const I=B.allocUnsafe(g);let t=0;for(e=0;e<A.length;++e){let g=A[e];if(j(g,Uint8Array))t+g.length>I.length?(B.isBuffer(g)||(g=B.from(g)),g.copy(I,t)):Uint8Array.prototype.set.call(I,g,t);else{if(!B.isBuffer(g))throw new TypeError('"list" argument must be an Array of Buffers');g.copy(I,t)}t+=g.length}return I},B.byteLength=E,B.prototype._isBuffer=!0,B.prototype.swap16=function(){const A=this.length;if(A%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<A;g+=2)c(this,g,g+1);return this},B.prototype.swap32=function(){const A=this.length;if(A%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<A;g+=4)c(this,g,g+3),c(this,g+1,g+2);return this},B.prototype.swap64=function(){const A=this.length;if(A%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<A;g+=8)c(this,g,g+7),c(this,g+1,g+6),c(this,g+2,g+5),c(this,g+3,g+4);return this},B.prototype.toString=function(){const A=this.length;return 0===A?"":0===arguments.length?y(this,0,A):s.apply(this,arguments)},B.prototype.toLocaleString=B.prototype.toString,B.prototype.equals=function(A){if(!B.isBuffer(A))throw new TypeError("Argument must be a Buffer");return this===A||0===B.compare(this,A)},B.prototype.inspect=function(){let g="";const e=A.INSPECT_MAX_BYTES;return g=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(g+=" ... "),"<Buffer "+g+">"},I&&(B.prototype[I]=B.prototype.inspect),B.prototype.compare=function(A,g,e,I,t){if(j(A,Uint8Array)&&(A=B.from(A,A.offset,A.byteLength)),!B.isBuffer(A))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof A);if(void 0===g&&(g=0),void 0===e&&(e=A?A.length:0),void 0===I&&(I=0),void 0===t&&(t=this.length),g<0||e>A.length||I<0||t>this.length)throw new RangeError("out of range index");if(I>=t&&g>=e)return 0;if(I>=t)return-1;if(g>=e)return 1;if(this===A)return 0;let i=(t>>>=0)-(I>>>=0),o=(e>>>=0)-(g>>>=0);const C=Math.min(i,o),Q=this.slice(I,t),n=A.slice(g,e);for(let A=0;A<C;++A)if(Q[A]!==n[A]){i=Q[A],o=n[A];break}return i<o?-1:o<i?1:0},B.prototype.includes=function(A,g,e){return-1!==this.indexOf(A,g,e)},B.prototype.indexOf=function(A,g,e){return D(this,A,g,e,!0)},B.prototype.lastIndexOf=function(A,g,e){return D(this,A,g,e,!1)},B.prototype.write=function(A,g,e,I){if(void 0===g)I="utf8",e=this.length,g=0;else if(void 0===e&&"string"==typeof g)I=g,e=this.length,g=0;else{if(!isFinite(g))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");g>>>=0,isFinite(e)?(e>>>=0,void 0===I&&(I="utf8")):(I=e,e=void 0)}const t=this.length-g;if((void 0===e||e>t)&&(e=t),A.length>0&&(e<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let i=!1;for(;;)switch(I){case"hex":return h(this,A,g,e);case"utf8":case"utf-8":return u(this,A,g,e);case"ascii":case"latin1":case"binary":return w(this,A,g,e);case"base64":return l(this,A,g,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,A,g,e);default:if(i)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),i=!0}},B.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function N(A,g,e){let I="";e=Math.min(A.length,e);for(let t=g;t<e;++t)I+=String.fromCharCode(127&A[t]);return I}function S(A,g,e){let I="";e=Math.min(A.length,e);for(let t=g;t<e;++t)I+=String.fromCharCode(A[t]);return I}function F(A,g,e){const I=A.length;(!g||g<0)&&(g=0),(!e||e<0||e>I)&&(e=I);let t="";for(let I=g;I<e;++I)t+=X[A[I]];return t}function m(A,g,e){const I=A.slice(g,e);let t="";for(let A=0;A<I.length-1;A+=2)t+=String.fromCharCode(I[A]+256*I[A+1]);return t}function R(A,g,e){if(A%1!=0||A<0)throw new RangeError("offset is not uint");if(A+g>e)throw new RangeError("Trying to access beyond buffer length")}function U(A,g,e,I,t,i){if(!B.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>t||g<i)throw new RangeError('"value" argument is out of bounds');if(e+I>A.length)throw new RangeError("Index out of range")}function b(A,g,e,I,t){x(g,I,t,A,e,7);let i=Number(g&BigInt(4294967295));A[e++]=i,i>>=8,A[e++]=i,i>>=8,A[e++]=i,i>>=8,A[e++]=i;let B=Number(g>>BigInt(32)&BigInt(4294967295));return A[e++]=B,B>>=8,A[e++]=B,B>>=8,A[e++]=B,B>>=8,A[e++]=B,e}function K(A,g,e,I,t){x(g,I,t,A,e,7);let i=Number(g&BigInt(4294967295));A[e+7]=i,i>>=8,A[e+6]=i,i>>=8,A[e+5]=i,i>>=8,A[e+4]=i;let B=Number(g>>BigInt(32)&BigInt(4294967295));return A[e+3]=B,B>>=8,A[e+2]=B,B>>=8,A[e+1]=B,B>>=8,A[e]=B,e+8}function J(A,g,e,I,t,i){if(e+I>A.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function q(A,g,I,t,i){return g=+g,I>>>=0,i||J(A,0,I,4),e.write(A,g,I,t,23,4),I+4}function v(A,g,I,t,i){return g=+g,I>>>=0,i||J(A,0,I,8),e.write(A,g,I,t,52,8),I+8}B.prototype.slice=function(A,g){const e=this.length;(A=~~A)<0?(A+=e)<0&&(A=0):A>e&&(A=e),(g=void 0===g?e:~~g)<0?(g+=e)<0&&(g=0):g>e&&(g=e),g<A&&(g=A);const I=this.subarray(A,g);return Object.setPrototypeOf(I,B.prototype),I},B.prototype.readUintLE=B.prototype.readUIntLE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=this[A],t=1,i=0;for(;++i<g&&(t*=256);)I+=this[A+i]*t;return I},B.prototype.readUintBE=B.prototype.readUIntBE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=this[A+--g],t=1;for(;g>0&&(t*=256);)I+=this[A+--g]*t;return I},B.prototype.readUint8=B.prototype.readUInt8=function(A,g){return A>>>=0,g||R(A,1,this.length),this[A]},B.prototype.readUint16LE=B.prototype.readUInt16LE=function(A,g){return A>>>=0,g||R(A,2,this.length),this[A]|this[A+1]<<8},B.prototype.readUint16BE=B.prototype.readUInt16BE=function(A,g){return A>>>=0,g||R(A,2,this.length),this[A]<<8|this[A+1]},B.prototype.readUint32LE=B.prototype.readUInt32LE=function(A,g){return A>>>=0,g||R(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+16777216*this[A+3]},B.prototype.readUint32BE=B.prototype.readUInt32BE=function(A,g){return A>>>=0,g||R(A,4,this.length),16777216*this[A]+(this[A+1]<<16|this[A+2]<<8|this[A+3])},B.prototype.readBigUInt64LE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=g+256*this[++A]+65536*this[++A]+this[++A]*2**24,t=this[++A]+256*this[++A]+65536*this[++A]+e*2**24;return BigInt(I)+(BigInt(t)<<BigInt(32))})),B.prototype.readBigUInt64BE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=g*2**24+65536*this[++A]+256*this[++A]+this[++A],t=this[++A]*2**24+65536*this[++A]+256*this[++A]+e;return(BigInt(I)<<BigInt(32))+BigInt(t)})),B.prototype.readIntLE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=this[A],t=1,i=0;for(;++i<g&&(t*=256);)I+=this[A+i]*t;return t*=128,I>=t&&(I-=Math.pow(2,8*g)),I},B.prototype.readIntBE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=g,t=1,i=this[A+--I];for(;I>0&&(t*=256);)i+=this[A+--I]*t;return t*=128,i>=t&&(i-=Math.pow(2,8*g)),i},B.prototype.readInt8=function(A,g){return A>>>=0,g||R(A,1,this.length),128&this[A]?-1*(255-this[A]+1):this[A]},B.prototype.readInt16LE=function(A,g){A>>>=0,g||R(A,2,this.length);const e=this[A]|this[A+1]<<8;return 32768&e?4294901760|e:e},B.prototype.readInt16BE=function(A,g){A>>>=0,g||R(A,2,this.length);const e=this[A+1]|this[A]<<8;return 32768&e?4294901760|e:e},B.prototype.readInt32LE=function(A,g){return A>>>=0,g||R(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},B.prototype.readInt32BE=function(A,g){return A>>>=0,g||R(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},B.prototype.readBigInt64LE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=this[A+4]+256*this[A+5]+65536*this[A+6]+(e<<24);return(BigInt(I)<<BigInt(32))+BigInt(g+256*this[++A]+65536*this[++A]+this[++A]*2**24)})),B.prototype.readBigInt64BE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=(g<<24)+65536*this[++A]+256*this[++A]+this[++A];return(BigInt(I)<<BigInt(32))+BigInt(this[++A]*2**24+65536*this[++A]+256*this[++A]+e)})),B.prototype.readFloatLE=function(A,g){return A>>>=0,g||R(A,4,this.length),e.read(this,A,!0,23,4)},B.prototype.readFloatBE=function(A,g){return A>>>=0,g||R(A,4,this.length),e.read(this,A,!1,23,4)},B.prototype.readDoubleLE=function(A,g){return A>>>=0,g||R(A,8,this.length),e.read(this,A,!0,52,8)},B.prototype.readDoubleBE=function(A,g){return A>>>=0,g||R(A,8,this.length),e.read(this,A,!1,52,8)},B.prototype.writeUintLE=B.prototype.writeUIntLE=function(A,g,e,I){if(A=+A,g>>>=0,e>>>=0,!I){U(this,A,g,e,Math.pow(2,8*e)-1,0)}let t=1,i=0;for(this[g]=255&A;++i<e&&(t*=256);)this[g+i]=A/t&255;return g+e},B.prototype.writeUintBE=B.prototype.writeUIntBE=function(A,g,e,I){if(A=+A,g>>>=0,e>>>=0,!I){U(this,A,g,e,Math.pow(2,8*e)-1,0)}let t=e-1,i=1;for(this[g+t]=255&A;--t>=0&&(i*=256);)this[g+t]=A/i&255;return g+e},B.prototype.writeUint8=B.prototype.writeUInt8=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,1,255,0),this[g]=255&A,g+1},B.prototype.writeUint16LE=B.prototype.writeUInt16LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,65535,0),this[g]=255&A,this[g+1]=A>>>8,g+2},B.prototype.writeUint16BE=B.prototype.writeUInt16BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,65535,0),this[g]=A>>>8,this[g+1]=255&A,g+2},B.prototype.writeUint32LE=B.prototype.writeUInt32LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,4294967295,0),this[g+3]=A>>>24,this[g+2]=A>>>16,this[g+1]=A>>>8,this[g]=255&A,g+4},B.prototype.writeUint32BE=B.prototype.writeUInt32BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,4294967295,0),this[g]=A>>>24,this[g+1]=A>>>16,this[g+2]=A>>>8,this[g+3]=255&A,g+4},B.prototype.writeBigUInt64LE=z((function(A,g=0){return b(this,A,g,BigInt(0),BigInt("0xffffffffffffffff"))})),B.prototype.writeBigUInt64BE=z((function(A,g=0){return K(this,A,g,BigInt(0),BigInt("0xffffffffffffffff"))})),B.prototype.writeIntLE=function(A,g,e,I){if(A=+A,g>>>=0,!I){const I=Math.pow(2,8*e-1);U(this,A,g,e,I-1,-I)}let t=0,i=1,B=0;for(this[g]=255&A;++t<e&&(i*=256);)A<0&&0===B&&0!==this[g+t-1]&&(B=1),this[g+t]=(A/i>>0)-B&255;return g+e},B.prototype.writeIntBE=function(A,g,e,I){if(A=+A,g>>>=0,!I){const I=Math.pow(2,8*e-1);U(this,A,g,e,I-1,-I)}let t=e-1,i=1,B=0;for(this[g+t]=255&A;--t>=0&&(i*=256);)A<0&&0===B&&0!==this[g+t+1]&&(B=1),this[g+t]=(A/i>>0)-B&255;return g+e},B.prototype.writeInt8=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,1,127,-128),A<0&&(A=255+A+1),this[g]=255&A,g+1},B.prototype.writeInt16LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,32767,-32768),this[g]=255&A,this[g+1]=A>>>8,g+2},B.prototype.writeInt16BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,32767,-32768),this[g]=A>>>8,this[g+1]=255&A,g+2},B.prototype.writeInt32LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,2147483647,-2147483648),this[g]=255&A,this[g+1]=A>>>8,this[g+2]=A>>>16,this[g+3]=A>>>24,g+4},B.prototype.writeInt32BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[g]=A>>>24,this[g+1]=A>>>16,this[g+2]=A>>>8,this[g+3]=255&A,g+4},B.prototype.writeBigInt64LE=z((function(A,g=0){return b(this,A,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),B.prototype.writeBigInt64BE=z((function(A,g=0){return K(this,A,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),B.prototype.writeFloatLE=function(A,g,e){return q(this,A,g,!0,e)},B.prototype.writeFloatBE=function(A,g,e){return q(this,A,g,!1,e)},B.prototype.writeDoubleLE=function(A,g,e){return v(this,A,g,!0,e)},B.prototype.writeDoubleBE=function(A,g,e){return v(this,A,g,!1,e)},B.prototype.copy=function(A,g,e,I){if(!B.isBuffer(A))throw new TypeError("argument should be a Buffer");if(e||(e=0),I||0===I||(I=this.length),g>=A.length&&(g=A.length),g||(g=0),I>0&&I<e&&(I=e),I===e)return 0;if(0===A.length||0===this.length)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),A.length-g<I-e&&(I=A.length-g+e);const t=I-e;return this===A&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(g,e,I):Uint8Array.prototype.set.call(A,this.subarray(e,I),g),t},B.prototype.fill=function(A,g,e,I){if("string"==typeof A){if("string"==typeof g?(I=g,g=0,e=this.length):"string"==typeof e&&(I=e,e=this.length),void 0!==I&&"string"!=typeof I)throw new TypeError("encoding must be a string");if("string"==typeof I&&!B.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(1===A.length){const g=A.charCodeAt(0);("utf8"===I&&g<128||"latin1"===I)&&(A=g)}}else"number"==typeof A?A&=255:"boolean"==typeof A&&(A=Number(A));if(g<0||this.length<g||this.length<e)throw new RangeError("Out of range index");if(e<=g)return this;let t;if(g>>>=0,e=void 0===e?this.length:e>>>0,A||(A=0),"number"==typeof A)for(t=g;t<e;++t)this[t]=A;else{const i=B.isBuffer(A)?A:B.from(A,I),o=i.length;if(0===o)throw new TypeError('The value "'+A+'" is invalid for argument "value"');for(t=0;t<e-g;++t)this[t+g]=i[t%o]}return this};const Y={};function H(A,g,e){Y[A]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${A}]`,this.stack,delete this.name}get code(){return A}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${A}]: ${this.message}`}}}function L(A){let g="",e=A.length;const I="-"===A[0]?1:0;for(;e>=I+4;e-=3)g=`_${A.slice(e-3,e)}${g}`;return`${A.slice(0,e)}${g}`}function x(A,g,e,I,t,i){if(A>e||A<g){const e="bigint"==typeof g?"n":"";let I;throw I=0===g||g===BigInt(0)?`>= 0${e} and < 2${e} ** ${8*(i+1)}${e}`:`>= -(2${e} ** ${8*(i+1)-1}${e}) and < 2 ** ${8*(i+1)-1}${e}`,new Y.ERR_OUT_OF_RANGE("value",I,A)}!function(A,g,e){_(g,"offset"),void 0!==A[g]&&void 0!==A[g+e]||O(g,A.length-(e+1))}(I,t,i)}function _(A,g){if("number"!=typeof A)throw new Y.ERR_INVALID_ARG_TYPE(g,"number",A)}function O(A,g,e){if(Math.floor(A)!==A)throw _(A,e),new Y.ERR_OUT_OF_RANGE("offset","an integer",A);if(g<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,A)}H("ERR_BUFFER_OUT_OF_BOUNDS",(function(A){return A?`${A} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),H("ERR_INVALID_ARG_TYPE",(function(A,g){return`The "${A}" argument must be of type number. Received type ${typeof g}`}),TypeError),H("ERR_OUT_OF_RANGE",(function(A,g,e){let I=`The value of "${A}" is out of range.`,t=e;return Number.isInteger(e)&&Math.abs(e)>2**32?t=L(String(e)):"bigint"==typeof e&&(t=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(t=L(t)),t+="n"),I+=` It must be ${g}. Received ${t}`,I}),RangeError);const P=/[^+/0-9A-Za-z-_]/g;function V(A,g){let e;g=g||1/0;const I=A.length;let t=null;const i=[];for(let B=0;B<I;++B){if(e=A.charCodeAt(B),e>55295&&e<57344){if(!t){if(e>56319){(g-=3)>-1&&i.push(239,191,189);continue}if(B+1===I){(g-=3)>-1&&i.push(239,191,189);continue}t=e;continue}if(e<56320){(g-=3)>-1&&i.push(239,191,189),t=e;continue}e=65536+(t-55296<<10|e-56320)}else t&&(g-=3)>-1&&i.push(239,191,189);if(t=null,e<128){if((g-=1)<0)break;i.push(e)}else if(e<2048){if((g-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((g-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((g-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function T(A){return g.toByteArray(function(A){if((A=(A=A.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;A.length%4!=0;)A+="=";return A}(A))}function W(A,g,e,I){let t;for(t=0;t<I&&!(t+e>=g.length||t>=A.length);++t)g[t+e]=A[t];return t}function j(A,g){return A instanceof g||null!=A&&null!=A.constructor&&null!=A.constructor.name&&A.constructor.name===g.name}function Z(A){return A!=A}const X=function(){const A="0123456789abcdef",g=new Array(256);for(let e=0;e<16;++e){const I=16*e;for(let t=0;t<16;++t)g[I+t]=A[e]+A[t]}return g}();function z(A){return"undefined"==typeof BigInt?$:A}function $(){throw new Error("BigInt not supported")}}(k)),k}var U=R();function b(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var J=b,q=K;function v(A){if(J===setTimeout)return setTimeout(A,0);if((J===b||!J)&&setTimeout)return J=setTimeout,setTimeout(A,0);try{return J(A,0)}catch(g){try{return J.call(null,A,0)}catch(g){return J.call(this,A,0)}}}"function"==typeof A.setTimeout&&(J=setTimeout),"function"==typeof A.clearTimeout&&(q=clearTimeout);var Y,H=[],L=!1,x=-1;function _(){L&&Y&&(L=!1,Y.length?H=Y.concat(H):x=-1,H.length&&O())}function O(){if(!L){var A=v(_);L=!0;for(var g=H.length;g;){for(Y=H,H=[];++x<g;)Y&&Y[x].run();x=-1,g=H.length}Y=null,L=!1,function(A){if(q===clearTimeout)return clearTimeout(A);if((q===K||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(A);try{return q(A)}catch(g){try{return q.call(null,A)}catch(g){return q.call(this,A)}}}(A)}}function P(A){var g=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)g[e-1]=arguments[e];H.push(new V(A,g)),1!==H.length||L||v(O)}function V(A,g){this.fun=A,this.array=g}V.prototype.run=function(){this.fun.apply(null,this.array)};var T="browser",W="browser",j={},Z=[],X={},z={},$={};function AA(){}var gA=AA,eA=AA,IA=AA,tA=AA,iA=AA,BA=AA,oA=AA;function CA(A){throw new Error("process.binding is not supported")}function QA(){return"/"}function nA(A){throw new Error("process.chdir is not supported")}function rA(){return 0}var aA=A.performance||{},EA=aA.now||aA.mozNow||aA.msNow||aA.oNow||aA.webkitNow||function(){return(new Date).getTime()};function sA(A){var g=.001*EA.call(aA),e=Math.floor(g),I=Math.floor(g%1*1e9);return A&&(e-=A[0],(I-=A[1])<0&&(e--,I+=1e9)),[e,I]}var cA=new Date;function DA(){return(new Date-cA)/1e3}var dA,hA={nextTick:P,title:T,browser:true,env:j,argv:Z,version:"",versions:X,on:gA,addListener:eA,once:IA,off:tA,removeListener:iA,removeAllListeners:BA,emit:oA,binding:CA,cwd:QA,chdir:nA,umask:rA,hrtime:sA,platform:W,release:z,config:$,uptime:DA},uA=Object.freeze({__proto__:null,addListener:eA,argv:Z,binding:CA,browser:true,chdir:nA,config:$,cwd:QA,default:hA,emit:oA,env:j,hrtime:sA,nextTick:P,off:tA,on:gA,once:IA,platform:W,release:z,removeAllListeners:BA,removeListener:iA,title:T,umask:rA,uptime:DA,version:"",versions:X});dA="function"==typeof Object.create?function(A,g){A.super_=g,A.prototype=Object.create(g.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}})}:function(A,g){A.super_=g;var e=function(){};e.prototype=g.prototype,A.prototype=new e,A.prototype.constructor=A};var wA=Object.getOwnPropertyDescriptors||function(A){for(var g=Object.keys(A),e={},I=0;I<g.length;I++)e[g[I]]=Object.getOwnPropertyDescriptor(A,g[I]);return e},lA=/%[sdj%]/g;function pA(A){if(!vA(A)){for(var g=[],e=0;e<arguments.length;e++)g.push(GA(arguments[e]));return g.join(" ")}e=1;for(var I=arguments,t=I.length,i=String(A).replace(lA,(function(A){if("%%"===A)return"%";if(e>=t)return A;switch(A){case"%s":return String(I[e++]);case"%d":return Number(I[e++]);case"%j":try{return JSON.stringify(I[e++])}catch(A){return"[Circular]"}default:return A}})),B=I[e];e<t;B=I[++e])KA(B)||!xA(B)?i+=" "+B:i+=" "+GA(B);return i}function fA(g,e){if(HA(A.process))return function(){return fA(g,e).apply(this,arguments)};if(!0===hA.noDeprecation)return g;var I=!1;return function(){if(!I){if(hA.throwDeprecation)throw new Error(e);hA.traceDeprecation?console.trace(e):console.error(e),I=!0}return g.apply(this,arguments)}}var yA,kA={};function NA(A){if(HA(yA)&&(yA=hA.env.NODE_DEBUG||""),A=A.toUpperCase(),!kA[A])if(new RegExp("\\b"+A+"\\b","i").test(yA)){kA[A]=function(){var g=pA.apply(null,arguments);console.error("%s %d: %s",A,0,g)}}else kA[A]=function(){};return kA[A]}function GA(A,g){var e={seen:[],stylize:FA};return arguments.length>=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),bA(g)?e.showHidden=g:g&&zA(e,g),HA(e.showHidden)&&(e.showHidden=!1),HA(e.depth)&&(e.depth=2),HA(e.colors)&&(e.colors=!1),HA(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=SA),mA(e,A,e.depth)}function SA(A,g){var e=GA.styles[g];return e?"["+GA.colors[e][0]+"m"+A+"["+GA.colors[e][1]+"m":A}function FA(A,g){return A}function mA(A,g,e){if(A.customInspect&&g&&PA(g.inspect)&&g.inspect!==GA&&(!g.constructor||g.constructor.prototype!==g)){var I=g.inspect(e,A);return vA(I)||(I=mA(A,I,e)),I}var t=function(A,g){if(HA(g))return A.stylize("undefined","undefined");if(vA(g)){var e="'"+JSON.stringify(g).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return A.stylize(e,"string")}if(qA(g))return A.stylize(""+g,"number");if(bA(g))return A.stylize(""+g,"boolean");if(KA(g))return A.stylize("null","null")}(A,g);if(t)return t;var i=Object.keys(g),B=function(A){var g={};return A.forEach((function(A,e){g[A]=!0})),g}(i);if(A.showHidden&&(i=Object.getOwnPropertyNames(g)),OA(g)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return MA(g);if(0===i.length){if(PA(g)){var o=g.name?": "+g.name:"";return A.stylize("[Function"+o+"]","special")}if(LA(g))return A.stylize(RegExp.prototype.toString.call(g),"regexp");if(_A(g))return A.stylize(Date.prototype.toString.call(g),"date");if(OA(g))return MA(g)}var C,Q="",n=!1,r=["{","}"];(UA(g)&&(n=!0,r=["[","]"]),PA(g))&&(Q=" [Function"+(g.name?": "+g.name:"")+"]");return LA(g)&&(Q=" "+RegExp.prototype.toString.call(g)),_A(g)&&(Q=" "+Date.prototype.toUTCString.call(g)),OA(g)&&(Q=" "+MA(g)),0!==i.length||n&&0!=g.length?e<0?LA(g)?A.stylize(RegExp.prototype.toString.call(g),"regexp"):A.stylize("[Object]","special"):(A.seen.push(g),C=n?function(A,g,e,I,t){for(var i=[],B=0,o=g.length;B<o;++B)$A(g,String(B))?i.push(RA(A,g,e,I,String(B),!0)):i.push("");return t.forEach((function(t){t.match(/^\d+$/)||i.push(RA(A,g,e,I,t,!0))})),i}(A,g,e,B,i):i.map((function(I){return RA(A,g,e,B,I,n)})),A.seen.pop(),function(A,g,e){var I=A.reduce((function(A,g){return g.indexOf("\n"),A+g.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(I>60)return e[0]+(""===g?"":g+"\n ")+" "+A.join(",\n ")+" "+e[1];return e[0]+g+" "+A.join(", ")+" "+e[1]}(C,Q,r)):r[0]+Q+r[1]}function MA(A){return"["+Error.prototype.toString.call(A)+"]"}function RA(A,g,e,I,t,i){var B,o,C;if((C=Object.getOwnPropertyDescriptor(g,t)||{value:g[t]}).get?o=C.set?A.stylize("[Getter/Setter]","special"):A.stylize("[Getter]","special"):C.set&&(o=A.stylize("[Setter]","special")),$A(I,t)||(B="["+t+"]"),o||(A.seen.indexOf(C.value)<0?(o=KA(e)?mA(A,C.value,null):mA(A,C.value,e-1)).indexOf("\n")>-1&&(o=i?o.split("\n").map((function(A){return" "+A})).join("\n").substr(2):"\n"+o.split("\n").map((function(A){return" "+A})).join("\n")):o=A.stylize("[Circular]","special")),HA(B)){if(i&&t.match(/^\d+$/))return o;(B=JSON.stringify(""+t)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(B=B.substr(1,B.length-2),B=A.stylize(B,"name")):(B=B.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),B=A.stylize(B,"string"))}return B+": "+o}function UA(A){return Array.isArray(A)}function bA(A){return"boolean"==typeof A}function KA(A){return null===A}function JA(A){return null==A}function qA(A){return"number"==typeof A}function vA(A){return"string"==typeof A}function YA(A){return"symbol"==typeof A}function HA(A){return void 0===A}function LA(A){return xA(A)&&"[object RegExp]"===WA(A)}function xA(A){return"object"==typeof A&&null!==A}function _A(A){return xA(A)&&"[object Date]"===WA(A)}function OA(A){return xA(A)&&("[object Error]"===WA(A)||A instanceof Error)}function PA(A){return"function"==typeof A}function VA(A){return null===A||"boolean"==typeof A||"number"==typeof A||"string"==typeof A||"symbol"==typeof A||void 0===A}function TA(A){return Buffer.isBuffer(A)}function WA(A){return Object.prototype.toString.call(A)}function jA(A){return A<10?"0"+A.toString(10):A.toString(10)}GA.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},GA.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var ZA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function XA(){var A,g;console.log("%s - %s",(A=new Date,g=[jA(A.getHours()),jA(A.getMinutes()),jA(A.getSeconds())].join(":"),[A.getDate(),ZA[A.getMonth()],g].join(" ")),pA.apply(null,arguments))}function zA(A,g){if(!g||!xA(g))return A;for(var e=Object.keys(g),I=e.length;I--;)A[e[I]]=g[e[I]];return A}function $A(A,g){return Object.prototype.hasOwnProperty.call(A,g)}var Ag="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function gg(A){if("function"!=typeof A)throw new TypeError('The "original" argument must be of type Function');if(Ag&&A[Ag]){var g;if("function"!=typeof(g=A[Ag]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(g,Ag,{value:g,enumerable:!1,writable:!1,configurable:!0}),g}function g(){for(var g,e,I=new Promise((function(A,I){g=A,e=I})),t=[],i=0;i<arguments.length;i++)t.push(arguments[i]);t.push((function(A,I){A?e(A):g(I)}));try{A.apply(this,t)}catch(A){e(A)}return I}return Object.setPrototypeOf(g,Object.getPrototypeOf(A)),Ag&&Object.defineProperty(g,Ag,{value:g,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(g,wA(A))}function eg(A,g){if(!A){var e=new Error("Promise was rejected with a falsy value");e.reason=A,A=e}return g(A)}function Ig(A){if("function"!=typeof A)throw new TypeError('The "original" argument must be of type Function');function g(){for(var g=[],e=0;e<arguments.length;e++)g.push(arguments[e]);var I=g.pop();if("function"!=typeof I)throw new TypeError("The last argument must be of type Function");var t=this,i=function(){return I.apply(t,arguments)};A.apply(this,g).then((function(A){hA.nextTick(i.bind(null,null,A))}),(function(A){hA.nextTick(eg.bind(null,A,i))}))}return Object.setPrototypeOf(g,Object.getPrototypeOf(A)),Object.defineProperties(g,wA(A)),g}gg.custom=Ag;var tg={inherits:dA,_extend:zA,log:XA,isBuffer:TA,isPrimitive:VA,isFunction:PA,isError:OA,isDate:_A,isObject:xA,isRegExp:LA,isUndefined:HA,isSymbol:YA,isString:vA,isNumber:qA,isNullOrUndefined:JA,isNull:KA,isBoolean:bA,isArray:UA,inspect:GA,deprecate:fA,format:pA,debuglog:NA,promisify:gg,callbackify:Ig},ig=Object.freeze({__proto__:null,_extend:zA,callbackify:Ig,debuglog:NA,default:tg,deprecate:fA,format:pA,inherits:dA,inspect:GA,isArray:UA,isBoolean:bA,isBuffer:TA,isDate:_A,isError:OA,isFunction:PA,isNull:KA,isNullOrUndefined:JA,isNumber:qA,isObject:xA,isPrimitive:VA,isRegExp:LA,isString:vA,isSymbol:YA,isUndefined:HA,log:XA,promisify:gg});function Bg(A,g){if(A===g)return 0;for(var e=A.length,I=g.length,t=0,i=Math.min(e,I);t<i;++t)if(A[t]!==g[t]){e=A[t],I=g[t];break}return e<I?-1:I<e?1:0}var og,Cg=Object.prototype.hasOwnProperty,Qg=Object.keys||function(A){var g=[];for(var e in A)Cg.call(A,e)&&g.push(e);return g},ng=Array.prototype.slice;function rg(){return void 0!==og?og:og="foo"===function(){}.name}function ag(A){return Object.prototype.toString.call(A)}function Eg(g){return!U.isBuffer(g)&&("function"==typeof A.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(g):!!g&&(g instanceof DataView||!!(g.buffer&&g.buffer instanceof ArrayBuffer))))}function sg(A,g){A||wg(A,!0,g,"==",lg)}var cg=/\s*function\s+([^\(\s]*)\s*/;function Dg(A){if(PA(A)){if(rg())return A.name;var g=A.toString().match(cg);return g&&g[1]}}function dg(A){this.name="AssertionError",this.actual=A.actual,this.expected=A.expected,this.operator=A.operator,A.message?(this.message=A.message,this.generatedMessage=!1):(this.message=function(A){return hg(ug(A.actual),128)+" "+A.operator+" "+hg(ug(A.expected),128)}(this),this.generatedMessage=!0);var g=A.stackStartFunction||wg;if(Error.captureStackTrace)Error.captureStackTrace(this,g);else{var e=new Error;if(e.stack){var I=e.stack,t=Dg(g),i=I.indexOf("\n"+t);if(i>=0){var B=I.indexOf("\n",i+1);I=I.substring(B+1)}this.stack=I}}}function hg(A,g){return"string"==typeof A?A.length<g?A:A.slice(0,g):A}function ug(A){if(rg()||!PA(A))return GA(A);var g=Dg(A);return"[Function"+(g?": "+g:"")+"]"}function wg(A,g,e,I,t){throw new dg({message:e,actual:A,expected:g,operator:I,stackStartFunction:t})}function lg(A,g){A||wg(A,!0,g,"==",lg)}function pg(A,g,e){A!=g&&wg(A,g,e,"==",pg)}function fg(A,g,e){A==g&&wg(A,g,e,"!=",fg)}function yg(A,g,e){Ng(A,g,!1)||wg(A,g,e,"deepEqual",yg)}function kg(A,g,e){Ng(A,g,!0)||wg(A,g,e,"deepStrictEqual",kg)}function Ng(A,g,e,I){if(A===g)return!0;if(U.isBuffer(A)&&U.isBuffer(g))return 0===Bg(A,g);if(_A(A)&&_A(g))return A.getTime()===g.getTime();if(LA(A)&&LA(g))return A.source===g.source&&A.global===g.global&&A.multiline===g.multiline&&A.lastIndex===g.lastIndex&&A.ignoreCase===g.ignoreCase;if(null!==A&&"object"==typeof A||null!==g&&"object"==typeof g){if(Eg(A)&&Eg(g)&&ag(A)===ag(g)&&!(A instanceof Float32Array||A instanceof Float64Array))return 0===Bg(new Uint8Array(A.buffer),new Uint8Array(g.buffer));if(U.isBuffer(A)!==U.isBuffer(g))return!1;var t=(I=I||{actual:[],expected:[]}).actual.indexOf(A);return-1!==t&&t===I.expected.indexOf(g)||(I.actual.push(A),I.expected.push(g),function(A,g,e,I){if(null==A||null==g)return!1;if(VA(A)||VA(g))return A===g;if(e&&Object.getPrototypeOf(A)!==Object.getPrototypeOf(g))return!1;var t=Gg(A),i=Gg(g);if(t&&!i||!t&&i)return!1;if(t)return Ng(A=ng.call(A),g=ng.call(g),e);var B,o,C=Qg(A),Q=Qg(g);if(C.length!==Q.length)return!1;for(C.sort(),Q.sort(),o=C.length-1;o>=0;o--)if(C[o]!==Q[o])return!1;for(o=C.length-1;o>=0;o--)if(!Ng(A[B=C[o]],g[B],e,I))return!1;return!0}(A,g,e,I))}return e?A===g:A==g}function Gg(A){return"[object Arguments]"==Object.prototype.toString.call(A)}function Sg(A,g,e){Ng(A,g,!1)&&wg(A,g,e,"notDeepEqual",Sg)}function Fg(A,g,e){Ng(A,g,!0)&&wg(A,g,e,"notDeepStrictEqual",Fg)}function mg(A,g,e){A!==g&&wg(A,g,e,"===",mg)}function Mg(A,g,e){A===g&&wg(A,g,e,"!==",Mg)}function Rg(A,g){if(!A||!g)return!1;if("[object RegExp]"==Object.prototype.toString.call(g))return g.test(A);try{if(A instanceof g)return!0}catch(A){}return!Error.isPrototypeOf(g)&&!0===g.call({},A)}function Ug(A,g,e,I){var t;if("function"!=typeof g)throw new TypeError('"block" argument must be a function');"string"==typeof e&&(I=e,e=null),t=function(A){var g;try{A()}catch(A){g=A}return g}(g),I=(e&&e.name?" ("+e.name+").":".")+(I?" "+I:"."),A&&!t&&wg(t,e,"Missing expected exception"+I);var i="string"==typeof I,B=!A&&t&&!e;if((!A&&OA(t)&&i&&Rg(t,e)||B)&&wg(t,e,"Got unwanted exception"+I),A&&t&&e&&!Rg(t,e)||!A&&t)throw t}function bg(A,g,e){Ug(!0,A,g,e)}function Kg(A,g,e){Ug(!1,A,g,e)}function Jg(A){if(A)throw A}sg.AssertionError=dg,dA(dg,Error),sg.fail=wg,sg.ok=lg,sg.equal=pg,sg.notEqual=fg,sg.deepEqual=yg,sg.deepStrictEqual=kg,sg.notDeepEqual=Sg,sg.notDeepStrictEqual=Fg,sg.strictEqual=mg,sg.notStrictEqual=Mg,sg.throws=bg,sg.doesNotThrow=Kg,sg.ifError=Jg;var qg,vg=Object.freeze({__proto__:null,AssertionError:dg,assert:lg,deepEqual:yg,deepStrictEqual:kg,default:sg,doesNotThrow:Kg,equal:pg,fail:wg,ifError:Jg,notDeepEqual:Sg,notDeepStrictEqual:Fg,notEqual:fg,notStrictEqual:Mg,ok:lg,strictEqual:mg,throws:bg});function Yg(){}function Hg(){Hg.init.call(this)}function Lg(A){return void 0===A._maxListeners?Hg.defaultMaxListeners:A._maxListeners}function xg(A,g,e,I){var t,i,B;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if((i=A._events)?(i.newListener&&(A.emit("newListener",g,e.listener?e.listener:e),i=A._events),B=i[g]):(i=A._events=new Yg,A._eventsCount=0),B){if("function"==typeof B?B=i[g]=I?[e,B]:[B,e]:I?B.unshift(e):B.push(e),!B.warned&&(t=Lg(A))&&t>0&&B.length>t){B.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+B.length+" "+g+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=A,o.type=g,o.count=B.length,function(A){"function"==typeof console.warn?console.warn(A):console.log(A)}(o)}}else B=i[g]=e,++A._eventsCount;return A}function _g(A,g,e){var I=!1;function t(){A.removeListener(g,t),I||(I=!0,e.apply(A,arguments))}return t.listener=e,t}function Og(A){var g=this._events;if(g){var e=g[A];if("function"==typeof e)return 1;if(e)return e.length}return 0}function Pg(A,g){for(var e=new Array(g);g--;)e[g]=A[g];return e}Yg.prototype=Object.create(null),Hg.EventEmitter=Hg,Hg.usingDomains=!1,Hg.prototype.domain=void 0,Hg.prototype._events=void 0,Hg.prototype._maxListeners=void 0,Hg.defaultMaxListeners=10,Hg.init=function(){this.domain=null,Hg.usingDomains&&(!qg.active||this instanceof qg.Domain||(this.domain=qg.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Yg,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Hg.prototype.setMaxListeners=function(A){if("number"!=typeof A||A<0||isNaN(A))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=A,this},Hg.prototype.getMaxListeners=function(){return Lg(this)},Hg.prototype.emit=function(A){var g,e,I,t,i,B,o,C="error"===A;if(B=this._events)C=C&&null==B.error;else if(!C)return!1;if(o=this.domain,C){if(g=arguments[1],!o){if(g instanceof Error)throw g;var Q=new Error('Uncaught, unspecified "error" event. ('+g+")");throw Q.context=g,Q}return g||(g=new Error('Uncaught, unspecified "error" event')),g.domainEmitter=this,g.domain=o,g.domainThrown=!1,o.emit("error",g),!1}if(!(e=B[A]))return!1;var n="function"==typeof e;switch(I=arguments.length){case 1:!function(A,g,e){if(g)A.call(e);else for(var I=A.length,t=Pg(A,I),i=0;i<I;++i)t[i].call(e)}(e,n,this);break;case 2:!function(A,g,e,I){if(g)A.call(e,I);else for(var t=A.length,i=Pg(A,t),B=0;B<t;++B)i[B].call(e,I)}(e,n,this,arguments[1]);break;case 3:!function(A,g,e,I,t){if(g)A.call(e,I,t);else for(var i=A.length,B=Pg(A,i),o=0;o<i;++o)B[o].call(e,I,t)}(e,n,this,arguments[1],arguments[2]);break;case 4:!function(A,g,e,I,t,i){if(g)A.call(e,I,t,i);else for(var B=A.length,o=Pg(A,B),C=0;C<B;++C)o[C].call(e,I,t,i)}(e,n,this,arguments[1],arguments[2],arguments[3]);break;default:for(t=new Array(I-1),i=1;i<I;i++)t[i-1]=arguments[i];!function(A,g,e,I){if(g)A.apply(e,I);else for(var t=A.length,i=Pg(A,t),B=0;B<t;++B)i[B].apply(e,I)}(e,n,this,t)}return!0},Hg.prototype.addListener=function(A,g){return xg(this,A,g,!1)},Hg.prototype.on=Hg.prototype.addListener,Hg.prototype.prependListener=function(A,g){return xg(this,A,g,!0)},Hg.prototype.once=function(A,g){if("function"!=typeof g)throw new TypeError('"listener" argument must be a function');return this.on(A,_g(this,A,g)),this},Hg.prototype.prependOnceListener=function(A,g){if("function"!=typeof g)throw new TypeError('"listener" argument must be a function');return this.prependListener(A,_g(this,A,g)),this},Hg.prototype.removeListener=function(A,g){var e,I,t,i,B;if("function"!=typeof g)throw new TypeError('"listener" argument must be a function');if(!(I=this._events))return this;if(!(e=I[A]))return this;if(e===g||e.listener&&e.listener===g)0==--this._eventsCount?this._events=new Yg:(delete I[A],I.removeListener&&this.emit("removeListener",A,e.listener||g));else if("function"!=typeof e){for(t=-1,i=e.length;i-- >0;)if(e[i]===g||e[i].listener&&e[i].listener===g){B=e[i].listener,t=i;break}if(t<0)return this;if(1===e.length){if(e[0]=void 0,0==--this._eventsCount)return this._events=new Yg,this;delete I[A]}else!function(A,g){for(var e=g,I=e+1,t=A.length;I<t;e+=1,I+=1)A[e]=A[I];A.pop()}(e,t);I.removeListener&&this.emit("removeListener",A,B||g)}return this},Hg.prototype.off=function(A,g){return this.removeListener(A,g)},Hg.prototype.removeAllListeners=function(A){var g,e;if(!(e=this._events))return this;if(!e.removeListener)return 0===arguments.length?(this._events=new Yg,this._eventsCount=0):e[A]&&(0==--this._eventsCount?this._events=new Yg:delete e[A]),this;if(0===arguments.length){for(var I,t=Object.keys(e),i=0;i<t.length;++i)"removeListener"!==(I=t[i])&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=new Yg,this._eventsCount=0,this}if("function"==typeof(g=e[A]))this.removeListener(A,g);else if(g)do{this.removeListener(A,g[g.length-1])}while(g[0]);return this},Hg.prototype.listeners=function(A){var g,e,I=this._events;return e=I&&(g=I[A])?"function"==typeof g?[g.listener||g]:function(A){for(var g=new Array(A.length),e=0;e<g.length;++e)g[e]=A[e].listener||A[e];return g}(g):[],e},Hg.listenerCount=function(A,g){return"function"==typeof A.listenerCount?A.listenerCount(g):Og.call(A,g)},Hg.prototype.listenerCount=Og,Hg.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Vg=Object.freeze({__proto__:null,EventEmitter:Hg,default:Hg});function Tg(A,g,e){if("function"==typeof A?A===g:A.has(g))return arguments.length<3?g:e;throw new TypeError("Private element is not present on this object")}function Wg(A,g){if(g.has(A))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jg(A,g){return A.get(Tg(A,g))}function Zg(A,g,e){Wg(A,g),g.set(A,e)}function Xg(A,g){Wg(A,g),g.add(A)}function zg(A,g,e){return(g=function(A){var g=function(A,g){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var I=e.call(A,g);if("object"!=typeof I)return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===g?String:Number)(A)}(A,"string");return"symbol"==typeof g?g:g+""}(g))in A?Object.defineProperty(A,g,{value:e,enumerable:!0,configurable:!0,writable:!0}):A[g]=e,A}function $g(A,g){return function(A,g){return g.get?g.get.call(A):g.value}(A,jg(g,A))}function Ae(A,g,e){return function(A,g,e){if(g.set)g.set.call(A,e);else{if(!g.writable)throw new TypeError("attempted to set read only private field");g.value=e}}(A,jg(g,A),e),e}function ge(A,g,e){return Tg(g,A),e}const ee={mainnet:{name:"Cheqd Mainnet",substrateUrl:null,addressPrefix:22,cheqdApiUrl:"https://mainnet.cheqd.docknode.io"},testnet:{name:"Cheqd Testnet",substrateUrl:null,addressPrefix:21,cheqdApiUrl:"https://testnet.cheqd.docknode.io"}},Ie={dbType:"sqlite",databasePath:"dock-wallet-sdk.db",documentNetworkResolver:async A=>{let{document:g,dataStore:e}=A;return{networkId:e.networkId,isFallback:!0}},networks:[{name:"Mainnet",id:"mainnet",credentialHostnames:[/creds\..*\.io/],configs:ee.mainnet},{name:"Testnet",id:"testnet",credentialHostnames:[/creds-.*\.*\.io/],configs:ee.testnet}]};async function te(A){let{configs:g,documentStore:e,walletStore:I,dataSource:t}=A;const i=function(A){const g={...Ie,...A};return g.defaultNetwork||(g.defaultNetwork=g.networks[0].id),g}(g),B={events:new Hg,db:t,networkId:i.defaultNetwork,network:i.networks.find((A=>A.id===i.defaultNetwork)),testNetworkId:i.testNetworkId,mainNetworkId:i.mainNetworkId,version:null,networks:i.networks,resolveDocumentNetwork:i.documentNetworkResolver,setNetwork:A=>(u.debug("Setting network to ".concat(A)),async function(A){let{dataStore:g,networkId:e}=A;const I=g.networks.find((A=>A.id===e));sg(!!I,"Invalid network id ".concat(e)),g.network=I,g.networkId=e,await g.wallet.updateWallet({dataStore:g})}({dataStore:B,networkId:A})),wallet:I,documents:e};return u.debug("Data store initialized"),B}async function ie(A){const g={async destroy(){},async initialize(){}},e=await te({configs:A,dataSource:g,documentStore:{addDocument:async(A,g)=>w({dataStore:e,json:A,options:g}),removeDocument:async(A,g)=>async function(A){let{dataStore:g,id:e}=A;sg(!!e,"Document id is required"),u.debug("Removing document with id ".concat(e));const I=(await t.getItem("documents")||[]).filter((A=>!(A.id===e&&A.networkId===g.networkId)));t.setItem("documents",I),g.events.emit(i.DocumentDeleted,e)}({dataStore:e,id:A}),updateDocument:async(A,g)=>async function(A){let{dataStore:g,document:e}=A;u.debug("Updating document with id ".concat(e.id));const I=await t.getItem("documents")||[],i=I.findIndex((A=>A.id===e.id));return I[i]=await async function(A){let{dataStore:g,document:e}=A;const I=e.type||[];return{id:e.id,type:I,data:e,correlation:e.correlation||[],networkId:g.networkId}}({dataStore:g,document:e}),await t.setItem("documents",I),g.events.emit("DocumentUpdated",e),e}({dataStore:e,document:A}),getDocumentById:async A=>d({dataStore:e,id:A}),getDocumentsByType:async A=>async function(A){let{dataStore:g,type:e}=A;return(await D({dataStore:g,allNetworks:!1})).filter((A=>A.type===e||A.type.includes(e)))}({dataStore:e,type:A}),getDocumentsById:async A=>async function(A){let{dataStore:g,idList:e}=A;return(await D({dataStore:g,allNetworks:!1})).filter((A=>e.includes(A.id)))}({dataStore:e,idList:A}),getAllDocuments:async A=>D({allNetworks:A,dataStore:e}),removeAllDocuments:async()=>async function(A){let{dataStore:g}=A;t.setItem("documents",[]),g.events.emit(i.AllDocumentsDeleted)}({dataStore:e}),getDocumentCorrelations:async A=>async function(A){let{dataStore:g,documentId:e}=A;const I=await D({dataStore:g,allNetworks:!1}),t=I.find((A=>A.id===e));return I.filter((A=>t.correlation.includes(A.id)))}({dataStore:e,documentId:A})},walletStore:{getWallet:async()=>async function(A){return await t.getItem("wallet")}(),updateWallet:async()=>function(A){let{dataStore:g}=A;return t.setItem("wallet",{id:"configs",...g})}({dataStore:e})}});let I=await e.wallet.getWallet();return I||(I=await function(A){let{dataStore:g}=A;return t.setItem("wallet",{id:"configs",...g})}({dataStore:e})),e.networkId=I.networkId,e.network=e.networks.find((A=>A.id===I.networkId)),e.documents.getAllDocuments().then((A=>{u.debug("Wallet loaded with ".concat(A.length," documents"))})),e}const Be={};
8
+ */function R(){return F||(F=1,function(A){const g=G(),e=M(),I="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;A.Buffer=B,A.SlowBuffer=function(A){+A!=A&&(A=0);return B.alloc(+A)},A.INSPECT_MAX_BYTES=50;const t=2147483647;function i(A){if(A>t)throw new RangeError('The value "'+A+'" is invalid for option "size"');const g=new Uint8Array(A);return Object.setPrototypeOf(g,B.prototype),g}function B(A,g,e){if("number"==typeof A){if("string"==typeof g)throw new TypeError('The "string" argument must be of type string. Received type number');return Q(A)}return o(A,g,e)}function o(A,g,e){if("string"==typeof A)return function(A,g){"string"==typeof g&&""!==g||(g="utf8");if(!B.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const e=0|E(A,g);let I=i(e);const t=I.write(A,g);t!==e&&(I=I.slice(0,t));return I}(A,g);if(ArrayBuffer.isView(A))return function(A){if(j(A,Uint8Array)){const g=new Uint8Array(A);return r(g.buffer,g.byteOffset,g.byteLength)}return n(A)}(A);if(null==A)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(j(A,ArrayBuffer)||A&&j(A.buffer,ArrayBuffer))return r(A,g,e);if("undefined"!=typeof SharedArrayBuffer&&(j(A,SharedArrayBuffer)||A&&j(A.buffer,SharedArrayBuffer)))return r(A,g,e);if("number"==typeof A)throw new TypeError('The "value" argument must not be of type number. Received type number');const I=A.valueOf&&A.valueOf();if(null!=I&&I!==A)return B.from(I,g,e);const t=function(A){if(B.isBuffer(A)){const g=0|a(A.length),e=i(g);return 0===e.length||A.copy(e,0,0,g),e}if(void 0!==A.length)return"number"!=typeof A.length||Z(A.length)?i(0):n(A);if("Buffer"===A.type&&Array.isArray(A.data))return n(A.data)}(A);if(t)return t;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof A[Symbol.toPrimitive])return B.from(A[Symbol.toPrimitive]("string"),g,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}function C(A){if("number"!=typeof A)throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function Q(A){return C(A),i(A<0?0:0|a(A))}function n(A){const g=A.length<0?0:0|a(A.length),e=i(g);for(let I=0;I<g;I+=1)e[I]=255&A[I];return e}function r(A,g,e){if(g<0||A.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<g+(e||0))throw new RangeError('"length" is outside of buffer bounds');let I;return I=void 0===g&&void 0===e?new Uint8Array(A):void 0===e?new Uint8Array(A,g):new Uint8Array(A,g,e),Object.setPrototypeOf(I,B.prototype),I}function a(A){if(A>=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|A}function E(A,g){if(B.isBuffer(A))return A.length;if(ArrayBuffer.isView(A)||j(A,ArrayBuffer))return A.byteLength;if("string"!=typeof A)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof A);const e=A.length,I=arguments.length>2&&!0===arguments[2];if(!I&&0===e)return 0;let t=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return V(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return T(A).length;default:if(t)return I?-1:V(A).length;g=(""+g).toLowerCase(),t=!0}}function s(A,g,e){let I=!1;if((void 0===g||g<0)&&(g=0),g>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(g>>>=0))return"";for(A||(A="utf8");;)switch(A){case"hex":return F(this,g,e);case"utf8":case"utf-8":return y(this,g,e);case"ascii":return N(this,g,e);case"latin1":case"binary":return S(this,g,e);case"base64":return f(this,g,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,g,e);default:if(I)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),I=!0}}function c(A,g,e){const I=A[g];A[g]=A[e],A[e]=I}function D(A,g,e,I,t){if(0===A.length)return-1;if("string"==typeof e?(I=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),Z(e=+e)&&(e=t?0:A.length-1),e<0&&(e=A.length+e),e>=A.length){if(t)return-1;e=A.length-1}else if(e<0){if(!t)return-1;e=0}if("string"==typeof g&&(g=B.from(g,I)),B.isBuffer(g))return 0===g.length?-1:d(A,g,e,I,t);if("number"==typeof g)return g&=255,"function"==typeof Uint8Array.prototype.indexOf?t?Uint8Array.prototype.indexOf.call(A,g,e):Uint8Array.prototype.lastIndexOf.call(A,g,e):d(A,[g],e,I,t);throw new TypeError("val must be string, number or Buffer")}function d(A,g,e,I,t){let i,B=1,o=A.length,C=g.length;if(void 0!==I&&("ucs2"===(I=String(I).toLowerCase())||"ucs-2"===I||"utf16le"===I||"utf-16le"===I)){if(A.length<2||g.length<2)return-1;B=2,o/=2,C/=2,e/=2}function Q(A,g){return 1===B?A[g]:A.readUInt16BE(g*B)}if(t){let I=-1;for(i=e;i<o;i++)if(Q(A,i)===Q(g,-1===I?0:i-I)){if(-1===I&&(I=i),i-I+1===C)return I*B}else-1!==I&&(i-=i-I),I=-1}else for(e+C>o&&(e=o-C),i=e;i>=0;i--){let e=!0;for(let I=0;I<C;I++)if(Q(A,i+I)!==Q(g,I)){e=!1;break}if(e)return i}return-1}function h(A,g,e,I){e=Number(e)||0;const t=A.length-e;I?(I=Number(I))>t&&(I=t):I=t;const i=g.length;let B;for(I>i/2&&(I=i/2),B=0;B<I;++B){const I=parseInt(g.substr(2*B,2),16);if(Z(I))return B;A[e+B]=I}return B}function u(A,g,e,I){return W(V(g,A.length-e),A,e,I)}function w(A,g,e,I){return W(function(A){const g=[];for(let e=0;e<A.length;++e)g.push(255&A.charCodeAt(e));return g}(g),A,e,I)}function l(A,g,e,I){return W(T(g),A,e,I)}function p(A,g,e,I){return W(function(A,g){let e,I,t;const i=[];for(let B=0;B<A.length&&!((g-=2)<0);++B)e=A.charCodeAt(B),I=e>>8,t=e%256,i.push(t),i.push(I);return i}(g,A.length-e),A,e,I)}function f(A,e,I){return 0===e&&I===A.length?g.fromByteArray(A):g.fromByteArray(A.slice(e,I))}function y(A,g,e){e=Math.min(A.length,e);const I=[];let t=g;for(;t<e;){const g=A[t];let i=null,B=g>239?4:g>223?3:g>191?2:1;if(t+B<=e){let e,I,o,C;switch(B){case 1:g<128&&(i=g);break;case 2:e=A[t+1],128==(192&e)&&(C=(31&g)<<6|63&e,C>127&&(i=C));break;case 3:e=A[t+1],I=A[t+2],128==(192&e)&&128==(192&I)&&(C=(15&g)<<12|(63&e)<<6|63&I,C>2047&&(C<55296||C>57343)&&(i=C));break;case 4:e=A[t+1],I=A[t+2],o=A[t+3],128==(192&e)&&128==(192&I)&&128==(192&o)&&(C=(15&g)<<18|(63&e)<<12|(63&I)<<6|63&o,C>65535&&C<1114112&&(i=C))}}null===i?(i=65533,B=1):i>65535&&(i-=65536,I.push(i>>>10&1023|55296),i=56320|1023&i),I.push(i),t+=B}return function(A){const g=A.length;if(g<=k)return String.fromCharCode.apply(String,A);let e="",I=0;for(;I<g;)e+=String.fromCharCode.apply(String,A.slice(I,I+=k));return e}(I)}A.kMaxLength=t,B.TYPED_ARRAY_SUPPORT=function(){try{const A=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(A,g),42===A.foo()}catch(A){return!1}}(),B.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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(B.prototype,"parent",{enumerable:!0,get:function(){if(B.isBuffer(this))return this.buffer}}),Object.defineProperty(B.prototype,"offset",{enumerable:!0,get:function(){if(B.isBuffer(this))return this.byteOffset}}),B.poolSize=8192,B.from=function(A,g,e){return o(A,g,e)},Object.setPrototypeOf(B.prototype,Uint8Array.prototype),Object.setPrototypeOf(B,Uint8Array),B.alloc=function(A,g,e){return function(A,g,e){return C(A),A<=0?i(A):void 0!==g?"string"==typeof e?i(A).fill(g,e):i(A).fill(g):i(A)}(A,g,e)},B.allocUnsafe=function(A){return Q(A)},B.allocUnsafeSlow=function(A){return Q(A)},B.isBuffer=function(A){return null!=A&&!0===A._isBuffer&&A!==B.prototype},B.compare=function(A,g){if(j(A,Uint8Array)&&(A=B.from(A,A.offset,A.byteLength)),j(g,Uint8Array)&&(g=B.from(g,g.offset,g.byteLength)),!B.isBuffer(A)||!B.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(A===g)return 0;let e=A.length,I=g.length;for(let t=0,i=Math.min(e,I);t<i;++t)if(A[t]!==g[t]){e=A[t],I=g[t];break}return e<I?-1:I<e?1:0},B.isEncoding=function(A){switch(String(A).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}},B.concat=function(A,g){if(!Array.isArray(A))throw new TypeError('"list" argument must be an Array of Buffers');if(0===A.length)return B.alloc(0);let e;if(void 0===g)for(g=0,e=0;e<A.length;++e)g+=A[e].length;const I=B.allocUnsafe(g);let t=0;for(e=0;e<A.length;++e){let g=A[e];if(j(g,Uint8Array))t+g.length>I.length?(B.isBuffer(g)||(g=B.from(g)),g.copy(I,t)):Uint8Array.prototype.set.call(I,g,t);else{if(!B.isBuffer(g))throw new TypeError('"list" argument must be an Array of Buffers');g.copy(I,t)}t+=g.length}return I},B.byteLength=E,B.prototype._isBuffer=!0,B.prototype.swap16=function(){const A=this.length;if(A%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<A;g+=2)c(this,g,g+1);return this},B.prototype.swap32=function(){const A=this.length;if(A%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<A;g+=4)c(this,g,g+3),c(this,g+1,g+2);return this},B.prototype.swap64=function(){const A=this.length;if(A%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<A;g+=8)c(this,g,g+7),c(this,g+1,g+6),c(this,g+2,g+5),c(this,g+3,g+4);return this},B.prototype.toString=function(){const A=this.length;return 0===A?"":0===arguments.length?y(this,0,A):s.apply(this,arguments)},B.prototype.toLocaleString=B.prototype.toString,B.prototype.equals=function(A){if(!B.isBuffer(A))throw new TypeError("Argument must be a Buffer");return this===A||0===B.compare(this,A)},B.prototype.inspect=function(){let g="";const e=A.INSPECT_MAX_BYTES;return g=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(g+=" ... "),"<Buffer "+g+">"},I&&(B.prototype[I]=B.prototype.inspect),B.prototype.compare=function(A,g,e,I,t){if(j(A,Uint8Array)&&(A=B.from(A,A.offset,A.byteLength)),!B.isBuffer(A))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof A);if(void 0===g&&(g=0),void 0===e&&(e=A?A.length:0),void 0===I&&(I=0),void 0===t&&(t=this.length),g<0||e>A.length||I<0||t>this.length)throw new RangeError("out of range index");if(I>=t&&g>=e)return 0;if(I>=t)return-1;if(g>=e)return 1;if(this===A)return 0;let i=(t>>>=0)-(I>>>=0),o=(e>>>=0)-(g>>>=0);const C=Math.min(i,o),Q=this.slice(I,t),n=A.slice(g,e);for(let A=0;A<C;++A)if(Q[A]!==n[A]){i=Q[A],o=n[A];break}return i<o?-1:o<i?1:0},B.prototype.includes=function(A,g,e){return-1!==this.indexOf(A,g,e)},B.prototype.indexOf=function(A,g,e){return D(this,A,g,e,!0)},B.prototype.lastIndexOf=function(A,g,e){return D(this,A,g,e,!1)},B.prototype.write=function(A,g,e,I){if(void 0===g)I="utf8",e=this.length,g=0;else if(void 0===e&&"string"==typeof g)I=g,e=this.length,g=0;else{if(!isFinite(g))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");g>>>=0,isFinite(e)?(e>>>=0,void 0===I&&(I="utf8")):(I=e,e=void 0)}const t=this.length-g;if((void 0===e||e>t)&&(e=t),A.length>0&&(e<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let i=!1;for(;;)switch(I){case"hex":return h(this,A,g,e);case"utf8":case"utf-8":return u(this,A,g,e);case"ascii":case"latin1":case"binary":return w(this,A,g,e);case"base64":return l(this,A,g,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,A,g,e);default:if(i)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),i=!0}},B.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function N(A,g,e){let I="";e=Math.min(A.length,e);for(let t=g;t<e;++t)I+=String.fromCharCode(127&A[t]);return I}function S(A,g,e){let I="";e=Math.min(A.length,e);for(let t=g;t<e;++t)I+=String.fromCharCode(A[t]);return I}function F(A,g,e){const I=A.length;(!g||g<0)&&(g=0),(!e||e<0||e>I)&&(e=I);let t="";for(let I=g;I<e;++I)t+=X[A[I]];return t}function m(A,g,e){const I=A.slice(g,e);let t="";for(let A=0;A<I.length-1;A+=2)t+=String.fromCharCode(I[A]+256*I[A+1]);return t}function R(A,g,e){if(A%1!=0||A<0)throw new RangeError("offset is not uint");if(A+g>e)throw new RangeError("Trying to access beyond buffer length")}function U(A,g,e,I,t,i){if(!B.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>t||g<i)throw new RangeError('"value" argument is out of bounds');if(e+I>A.length)throw new RangeError("Index out of range")}function b(A,g,e,I,t){x(g,I,t,A,e,7);let i=Number(g&BigInt(4294967295));A[e++]=i,i>>=8,A[e++]=i,i>>=8,A[e++]=i,i>>=8,A[e++]=i;let B=Number(g>>BigInt(32)&BigInt(4294967295));return A[e++]=B,B>>=8,A[e++]=B,B>>=8,A[e++]=B,B>>=8,A[e++]=B,e}function K(A,g,e,I,t){x(g,I,t,A,e,7);let i=Number(g&BigInt(4294967295));A[e+7]=i,i>>=8,A[e+6]=i,i>>=8,A[e+5]=i,i>>=8,A[e+4]=i;let B=Number(g>>BigInt(32)&BigInt(4294967295));return A[e+3]=B,B>>=8,A[e+2]=B,B>>=8,A[e+1]=B,B>>=8,A[e]=B,e+8}function J(A,g,e,I,t,i){if(e+I>A.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function q(A,g,I,t,i){return g=+g,I>>>=0,i||J(A,0,I,4),e.write(A,g,I,t,23,4),I+4}function v(A,g,I,t,i){return g=+g,I>>>=0,i||J(A,0,I,8),e.write(A,g,I,t,52,8),I+8}B.prototype.slice=function(A,g){const e=this.length;(A=~~A)<0?(A+=e)<0&&(A=0):A>e&&(A=e),(g=void 0===g?e:~~g)<0?(g+=e)<0&&(g=0):g>e&&(g=e),g<A&&(g=A);const I=this.subarray(A,g);return Object.setPrototypeOf(I,B.prototype),I},B.prototype.readUintLE=B.prototype.readUIntLE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=this[A],t=1,i=0;for(;++i<g&&(t*=256);)I+=this[A+i]*t;return I},B.prototype.readUintBE=B.prototype.readUIntBE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=this[A+--g],t=1;for(;g>0&&(t*=256);)I+=this[A+--g]*t;return I},B.prototype.readUint8=B.prototype.readUInt8=function(A,g){return A>>>=0,g||R(A,1,this.length),this[A]},B.prototype.readUint16LE=B.prototype.readUInt16LE=function(A,g){return A>>>=0,g||R(A,2,this.length),this[A]|this[A+1]<<8},B.prototype.readUint16BE=B.prototype.readUInt16BE=function(A,g){return A>>>=0,g||R(A,2,this.length),this[A]<<8|this[A+1]},B.prototype.readUint32LE=B.prototype.readUInt32LE=function(A,g){return A>>>=0,g||R(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+16777216*this[A+3]},B.prototype.readUint32BE=B.prototype.readUInt32BE=function(A,g){return A>>>=0,g||R(A,4,this.length),16777216*this[A]+(this[A+1]<<16|this[A+2]<<8|this[A+3])},B.prototype.readBigUInt64LE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=g+256*this[++A]+65536*this[++A]+this[++A]*2**24,t=this[++A]+256*this[++A]+65536*this[++A]+e*2**24;return BigInt(I)+(BigInt(t)<<BigInt(32))})),B.prototype.readBigUInt64BE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=g*2**24+65536*this[++A]+256*this[++A]+this[++A],t=this[++A]*2**24+65536*this[++A]+256*this[++A]+e;return(BigInt(I)<<BigInt(32))+BigInt(t)})),B.prototype.readIntLE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=this[A],t=1,i=0;for(;++i<g&&(t*=256);)I+=this[A+i]*t;return t*=128,I>=t&&(I-=Math.pow(2,8*g)),I},B.prototype.readIntBE=function(A,g,e){A>>>=0,g>>>=0,e||R(A,g,this.length);let I=g,t=1,i=this[A+--I];for(;I>0&&(t*=256);)i+=this[A+--I]*t;return t*=128,i>=t&&(i-=Math.pow(2,8*g)),i},B.prototype.readInt8=function(A,g){return A>>>=0,g||R(A,1,this.length),128&this[A]?-1*(255-this[A]+1):this[A]},B.prototype.readInt16LE=function(A,g){A>>>=0,g||R(A,2,this.length);const e=this[A]|this[A+1]<<8;return 32768&e?4294901760|e:e},B.prototype.readInt16BE=function(A,g){A>>>=0,g||R(A,2,this.length);const e=this[A+1]|this[A]<<8;return 32768&e?4294901760|e:e},B.prototype.readInt32LE=function(A,g){return A>>>=0,g||R(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},B.prototype.readInt32BE=function(A,g){return A>>>=0,g||R(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},B.prototype.readBigInt64LE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=this[A+4]+256*this[A+5]+65536*this[A+6]+(e<<24);return(BigInt(I)<<BigInt(32))+BigInt(g+256*this[++A]+65536*this[++A]+this[++A]*2**24)})),B.prototype.readBigInt64BE=z((function(A){_(A>>>=0,"offset");const g=this[A],e=this[A+7];void 0!==g&&void 0!==e||O(A,this.length-8);const I=(g<<24)+65536*this[++A]+256*this[++A]+this[++A];return(BigInt(I)<<BigInt(32))+BigInt(this[++A]*2**24+65536*this[++A]+256*this[++A]+e)})),B.prototype.readFloatLE=function(A,g){return A>>>=0,g||R(A,4,this.length),e.read(this,A,!0,23,4)},B.prototype.readFloatBE=function(A,g){return A>>>=0,g||R(A,4,this.length),e.read(this,A,!1,23,4)},B.prototype.readDoubleLE=function(A,g){return A>>>=0,g||R(A,8,this.length),e.read(this,A,!0,52,8)},B.prototype.readDoubleBE=function(A,g){return A>>>=0,g||R(A,8,this.length),e.read(this,A,!1,52,8)},B.prototype.writeUintLE=B.prototype.writeUIntLE=function(A,g,e,I){if(A=+A,g>>>=0,e>>>=0,!I){U(this,A,g,e,Math.pow(2,8*e)-1,0)}let t=1,i=0;for(this[g]=255&A;++i<e&&(t*=256);)this[g+i]=A/t&255;return g+e},B.prototype.writeUintBE=B.prototype.writeUIntBE=function(A,g,e,I){if(A=+A,g>>>=0,e>>>=0,!I){U(this,A,g,e,Math.pow(2,8*e)-1,0)}let t=e-1,i=1;for(this[g+t]=255&A;--t>=0&&(i*=256);)this[g+t]=A/i&255;return g+e},B.prototype.writeUint8=B.prototype.writeUInt8=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,1,255,0),this[g]=255&A,g+1},B.prototype.writeUint16LE=B.prototype.writeUInt16LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,65535,0),this[g]=255&A,this[g+1]=A>>>8,g+2},B.prototype.writeUint16BE=B.prototype.writeUInt16BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,65535,0),this[g]=A>>>8,this[g+1]=255&A,g+2},B.prototype.writeUint32LE=B.prototype.writeUInt32LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,4294967295,0),this[g+3]=A>>>24,this[g+2]=A>>>16,this[g+1]=A>>>8,this[g]=255&A,g+4},B.prototype.writeUint32BE=B.prototype.writeUInt32BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,4294967295,0),this[g]=A>>>24,this[g+1]=A>>>16,this[g+2]=A>>>8,this[g+3]=255&A,g+4},B.prototype.writeBigUInt64LE=z((function(A,g=0){return b(this,A,g,BigInt(0),BigInt("0xffffffffffffffff"))})),B.prototype.writeBigUInt64BE=z((function(A,g=0){return K(this,A,g,BigInt(0),BigInt("0xffffffffffffffff"))})),B.prototype.writeIntLE=function(A,g,e,I){if(A=+A,g>>>=0,!I){const I=Math.pow(2,8*e-1);U(this,A,g,e,I-1,-I)}let t=0,i=1,B=0;for(this[g]=255&A;++t<e&&(i*=256);)A<0&&0===B&&0!==this[g+t-1]&&(B=1),this[g+t]=(A/i>>0)-B&255;return g+e},B.prototype.writeIntBE=function(A,g,e,I){if(A=+A,g>>>=0,!I){const I=Math.pow(2,8*e-1);U(this,A,g,e,I-1,-I)}let t=e-1,i=1,B=0;for(this[g+t]=255&A;--t>=0&&(i*=256);)A<0&&0===B&&0!==this[g+t+1]&&(B=1),this[g+t]=(A/i>>0)-B&255;return g+e},B.prototype.writeInt8=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,1,127,-128),A<0&&(A=255+A+1),this[g]=255&A,g+1},B.prototype.writeInt16LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,32767,-32768),this[g]=255&A,this[g+1]=A>>>8,g+2},B.prototype.writeInt16BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,2,32767,-32768),this[g]=A>>>8,this[g+1]=255&A,g+2},B.prototype.writeInt32LE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,2147483647,-2147483648),this[g]=255&A,this[g+1]=A>>>8,this[g+2]=A>>>16,this[g+3]=A>>>24,g+4},B.prototype.writeInt32BE=function(A,g,e){return A=+A,g>>>=0,e||U(this,A,g,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[g]=A>>>24,this[g+1]=A>>>16,this[g+2]=A>>>8,this[g+3]=255&A,g+4},B.prototype.writeBigInt64LE=z((function(A,g=0){return b(this,A,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),B.prototype.writeBigInt64BE=z((function(A,g=0){return K(this,A,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),B.prototype.writeFloatLE=function(A,g,e){return q(this,A,g,!0,e)},B.prototype.writeFloatBE=function(A,g,e){return q(this,A,g,!1,e)},B.prototype.writeDoubleLE=function(A,g,e){return v(this,A,g,!0,e)},B.prototype.writeDoubleBE=function(A,g,e){return v(this,A,g,!1,e)},B.prototype.copy=function(A,g,e,I){if(!B.isBuffer(A))throw new TypeError("argument should be a Buffer");if(e||(e=0),I||0===I||(I=this.length),g>=A.length&&(g=A.length),g||(g=0),I>0&&I<e&&(I=e),I===e)return 0;if(0===A.length||0===this.length)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),A.length-g<I-e&&(I=A.length-g+e);const t=I-e;return this===A&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(g,e,I):Uint8Array.prototype.set.call(A,this.subarray(e,I),g),t},B.prototype.fill=function(A,g,e,I){if("string"==typeof A){if("string"==typeof g?(I=g,g=0,e=this.length):"string"==typeof e&&(I=e,e=this.length),void 0!==I&&"string"!=typeof I)throw new TypeError("encoding must be a string");if("string"==typeof I&&!B.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(1===A.length){const g=A.charCodeAt(0);("utf8"===I&&g<128||"latin1"===I)&&(A=g)}}else"number"==typeof A?A&=255:"boolean"==typeof A&&(A=Number(A));if(g<0||this.length<g||this.length<e)throw new RangeError("Out of range index");if(e<=g)return this;let t;if(g>>>=0,e=void 0===e?this.length:e>>>0,A||(A=0),"number"==typeof A)for(t=g;t<e;++t)this[t]=A;else{const i=B.isBuffer(A)?A:B.from(A,I),o=i.length;if(0===o)throw new TypeError('The value "'+A+'" is invalid for argument "value"');for(t=0;t<e-g;++t)this[t+g]=i[t%o]}return this};const Y={};function H(A,g,e){Y[A]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${A}]`,this.stack,delete this.name}get code(){return A}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${A}]: ${this.message}`}}}function L(A){let g="",e=A.length;const I="-"===A[0]?1:0;for(;e>=I+4;e-=3)g=`_${A.slice(e-3,e)}${g}`;return`${A.slice(0,e)}${g}`}function x(A,g,e,I,t,i){if(A>e||A<g){const e="bigint"==typeof g?"n":"";let I;throw I=0===g||g===BigInt(0)?`>= 0${e} and < 2${e} ** ${8*(i+1)}${e}`:`>= -(2${e} ** ${8*(i+1)-1}${e}) and < 2 ** ${8*(i+1)-1}${e}`,new Y.ERR_OUT_OF_RANGE("value",I,A)}!function(A,g,e){_(g,"offset"),void 0!==A[g]&&void 0!==A[g+e]||O(g,A.length-(e+1))}(I,t,i)}function _(A,g){if("number"!=typeof A)throw new Y.ERR_INVALID_ARG_TYPE(g,"number",A)}function O(A,g,e){if(Math.floor(A)!==A)throw _(A,e),new Y.ERR_OUT_OF_RANGE("offset","an integer",A);if(g<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,A)}H("ERR_BUFFER_OUT_OF_BOUNDS",(function(A){return A?`${A} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),H("ERR_INVALID_ARG_TYPE",(function(A,g){return`The "${A}" argument must be of type number. Received type ${typeof g}`}),TypeError),H("ERR_OUT_OF_RANGE",(function(A,g,e){let I=`The value of "${A}" is out of range.`,t=e;return Number.isInteger(e)&&Math.abs(e)>2**32?t=L(String(e)):"bigint"==typeof e&&(t=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(t=L(t)),t+="n"),I+=` It must be ${g}. Received ${t}`,I}),RangeError);const P=/[^+/0-9A-Za-z-_]/g;function V(A,g){let e;g=g||1/0;const I=A.length;let t=null;const i=[];for(let B=0;B<I;++B){if(e=A.charCodeAt(B),e>55295&&e<57344){if(!t){if(e>56319){(g-=3)>-1&&i.push(239,191,189);continue}if(B+1===I){(g-=3)>-1&&i.push(239,191,189);continue}t=e;continue}if(e<56320){(g-=3)>-1&&i.push(239,191,189),t=e;continue}e=65536+(t-55296<<10|e-56320)}else t&&(g-=3)>-1&&i.push(239,191,189);if(t=null,e<128){if((g-=1)<0)break;i.push(e)}else if(e<2048){if((g-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((g-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((g-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function T(A){return g.toByteArray(function(A){if((A=(A=A.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;A.length%4!=0;)A+="=";return A}(A))}function W(A,g,e,I){let t;for(t=0;t<I&&!(t+e>=g.length||t>=A.length);++t)g[t+e]=A[t];return t}function j(A,g){return A instanceof g||null!=A&&null!=A.constructor&&null!=A.constructor.name&&A.constructor.name===g.name}function Z(A){return A!=A}const X=function(){const A="0123456789abcdef",g=new Array(256);for(let e=0;e<16;++e){const I=16*e;for(let t=0;t<16;++t)g[I+t]=A[e]+A[t]}return g}();function z(A){return"undefined"==typeof BigInt?$:A}function $(){throw new Error("BigInt not supported")}}(k)),k}var U=R();function b(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var J=b,q=K;function v(A){if(J===setTimeout)return setTimeout(A,0);if((J===b||!J)&&setTimeout)return J=setTimeout,setTimeout(A,0);try{return J(A,0)}catch(g){try{return J.call(null,A,0)}catch(g){return J.call(this,A,0)}}}"function"==typeof A.setTimeout&&(J=setTimeout),"function"==typeof A.clearTimeout&&(q=clearTimeout);var Y,H=[],L=!1,x=-1;function _(){L&&Y&&(L=!1,Y.length?H=Y.concat(H):x=-1,H.length&&O())}function O(){if(!L){var A=v(_);L=!0;for(var g=H.length;g;){for(Y=H,H=[];++x<g;)Y&&Y[x].run();x=-1,g=H.length}Y=null,L=!1,function(A){if(q===clearTimeout)return clearTimeout(A);if((q===K||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(A);try{return q(A)}catch(g){try{return q.call(null,A)}catch(g){return q.call(this,A)}}}(A)}}function P(A){var g=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)g[e-1]=arguments[e];H.push(new V(A,g)),1!==H.length||L||v(O)}function V(A,g){this.fun=A,this.array=g}V.prototype.run=function(){this.fun.apply(null,this.array)};var T="browser",W="browser",j={},Z=[],X={},z={},$={};function AA(){}var gA=AA,eA=AA,IA=AA,tA=AA,iA=AA,BA=AA,oA=AA;function CA(A){throw new Error("process.binding is not supported")}function QA(){return"/"}function nA(A){throw new Error("process.chdir is not supported")}function rA(){return 0}var aA=A.performance||{},EA=aA.now||aA.mozNow||aA.msNow||aA.oNow||aA.webkitNow||function(){return(new Date).getTime()};function sA(A){var g=.001*EA.call(aA),e=Math.floor(g),I=Math.floor(g%1*1e9);return A&&(e-=A[0],(I-=A[1])<0&&(e--,I+=1e9)),[e,I]}var cA=new Date;function DA(){return(new Date-cA)/1e3}var dA,hA={nextTick:P,title:T,browser:true,env:j,argv:Z,version:"",versions:X,on:gA,addListener:eA,once:IA,off:tA,removeListener:iA,removeAllListeners:BA,emit:oA,binding:CA,cwd:QA,chdir:nA,umask:rA,hrtime:sA,platform:W,release:z,config:$,uptime:DA},uA=Object.freeze({__proto__:null,addListener:eA,argv:Z,binding:CA,browser:true,chdir:nA,config:$,cwd:QA,default:hA,emit:oA,env:j,hrtime:sA,nextTick:P,off:tA,on:gA,once:IA,platform:W,release:z,removeAllListeners:BA,removeListener:iA,title:T,umask:rA,uptime:DA,version:"",versions:X});dA="function"==typeof Object.create?function(A,g){A.super_=g,A.prototype=Object.create(g.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}})}:function(A,g){A.super_=g;var e=function(){};e.prototype=g.prototype,A.prototype=new e,A.prototype.constructor=A};var wA=Object.getOwnPropertyDescriptors||function(A){for(var g=Object.keys(A),e={},I=0;I<g.length;I++)e[g[I]]=Object.getOwnPropertyDescriptor(A,g[I]);return e},lA=/%[sdj%]/g;function pA(A){if(!vA(A)){for(var g=[],e=0;e<arguments.length;e++)g.push(GA(arguments[e]));return g.join(" ")}e=1;for(var I=arguments,t=I.length,i=String(A).replace(lA,(function(A){if("%%"===A)return"%";if(e>=t)return A;switch(A){case"%s":return String(I[e++]);case"%d":return Number(I[e++]);case"%j":try{return JSON.stringify(I[e++])}catch(A){return"[Circular]"}default:return A}})),B=I[e];e<t;B=I[++e])KA(B)||!xA(B)?i+=" "+B:i+=" "+GA(B);return i}function fA(g,e){if(HA(A.process))return function(){return fA(g,e).apply(this,arguments)};if(!0===hA.noDeprecation)return g;var I=!1;return function(){if(!I){if(hA.throwDeprecation)throw new Error(e);hA.traceDeprecation?console.trace(e):console.error(e),I=!0}return g.apply(this,arguments)}}var yA,kA={};function NA(A){if(HA(yA)&&(yA=hA.env.NODE_DEBUG||""),A=A.toUpperCase(),!kA[A])if(new RegExp("\\b"+A+"\\b","i").test(yA)){kA[A]=function(){var g=pA.apply(null,arguments);console.error("%s %d: %s",A,0,g)}}else kA[A]=function(){};return kA[A]}function GA(A,g){var e={seen:[],stylize:FA};return arguments.length>=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),bA(g)?e.showHidden=g:g&&zA(e,g),HA(e.showHidden)&&(e.showHidden=!1),HA(e.depth)&&(e.depth=2),HA(e.colors)&&(e.colors=!1),HA(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=SA),mA(e,A,e.depth)}function SA(A,g){var e=GA.styles[g];return e?"["+GA.colors[e][0]+"m"+A+"["+GA.colors[e][1]+"m":A}function FA(A,g){return A}function mA(A,g,e){if(A.customInspect&&g&&PA(g.inspect)&&g.inspect!==GA&&(!g.constructor||g.constructor.prototype!==g)){var I=g.inspect(e,A);return vA(I)||(I=mA(A,I,e)),I}var t=function(A,g){if(HA(g))return A.stylize("undefined","undefined");if(vA(g)){var e="'"+JSON.stringify(g).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return A.stylize(e,"string")}if(qA(g))return A.stylize(""+g,"number");if(bA(g))return A.stylize(""+g,"boolean");if(KA(g))return A.stylize("null","null")}(A,g);if(t)return t;var i=Object.keys(g),B=function(A){var g={};return A.forEach((function(A,e){g[A]=!0})),g}(i);if(A.showHidden&&(i=Object.getOwnPropertyNames(g)),OA(g)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return MA(g);if(0===i.length){if(PA(g)){var o=g.name?": "+g.name:"";return A.stylize("[Function"+o+"]","special")}if(LA(g))return A.stylize(RegExp.prototype.toString.call(g),"regexp");if(_A(g))return A.stylize(Date.prototype.toString.call(g),"date");if(OA(g))return MA(g)}var C,Q="",n=!1,r=["{","}"];(UA(g)&&(n=!0,r=["[","]"]),PA(g))&&(Q=" [Function"+(g.name?": "+g.name:"")+"]");return LA(g)&&(Q=" "+RegExp.prototype.toString.call(g)),_A(g)&&(Q=" "+Date.prototype.toUTCString.call(g)),OA(g)&&(Q=" "+MA(g)),0!==i.length||n&&0!=g.length?e<0?LA(g)?A.stylize(RegExp.prototype.toString.call(g),"regexp"):A.stylize("[Object]","special"):(A.seen.push(g),C=n?function(A,g,e,I,t){for(var i=[],B=0,o=g.length;B<o;++B)$A(g,String(B))?i.push(RA(A,g,e,I,String(B),!0)):i.push("");return t.forEach((function(t){t.match(/^\d+$/)||i.push(RA(A,g,e,I,t,!0))})),i}(A,g,e,B,i):i.map((function(I){return RA(A,g,e,B,I,n)})),A.seen.pop(),function(A,g,e){var I=A.reduce((function(A,g){return g.indexOf("\n"),A+g.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(I>60)return e[0]+(""===g?"":g+"\n ")+" "+A.join(",\n ")+" "+e[1];return e[0]+g+" "+A.join(", ")+" "+e[1]}(C,Q,r)):r[0]+Q+r[1]}function MA(A){return"["+Error.prototype.toString.call(A)+"]"}function RA(A,g,e,I,t,i){var B,o,C;if((C=Object.getOwnPropertyDescriptor(g,t)||{value:g[t]}).get?o=C.set?A.stylize("[Getter/Setter]","special"):A.stylize("[Getter]","special"):C.set&&(o=A.stylize("[Setter]","special")),$A(I,t)||(B="["+t+"]"),o||(A.seen.indexOf(C.value)<0?(o=KA(e)?mA(A,C.value,null):mA(A,C.value,e-1)).indexOf("\n")>-1&&(o=i?o.split("\n").map((function(A){return" "+A})).join("\n").substr(2):"\n"+o.split("\n").map((function(A){return" "+A})).join("\n")):o=A.stylize("[Circular]","special")),HA(B)){if(i&&t.match(/^\d+$/))return o;(B=JSON.stringify(""+t)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(B=B.substr(1,B.length-2),B=A.stylize(B,"name")):(B=B.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),B=A.stylize(B,"string"))}return B+": "+o}function UA(A){return Array.isArray(A)}function bA(A){return"boolean"==typeof A}function KA(A){return null===A}function JA(A){return null==A}function qA(A){return"number"==typeof A}function vA(A){return"string"==typeof A}function YA(A){return"symbol"==typeof A}function HA(A){return void 0===A}function LA(A){return xA(A)&&"[object RegExp]"===WA(A)}function xA(A){return"object"==typeof A&&null!==A}function _A(A){return xA(A)&&"[object Date]"===WA(A)}function OA(A){return xA(A)&&("[object Error]"===WA(A)||A instanceof Error)}function PA(A){return"function"==typeof A}function VA(A){return null===A||"boolean"==typeof A||"number"==typeof A||"string"==typeof A||"symbol"==typeof A||void 0===A}function TA(A){return Buffer.isBuffer(A)}function WA(A){return Object.prototype.toString.call(A)}function jA(A){return A<10?"0"+A.toString(10):A.toString(10)}GA.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},GA.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var ZA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function XA(){var A,g;console.log("%s - %s",(A=new Date,g=[jA(A.getHours()),jA(A.getMinutes()),jA(A.getSeconds())].join(":"),[A.getDate(),ZA[A.getMonth()],g].join(" ")),pA.apply(null,arguments))}function zA(A,g){if(!g||!xA(g))return A;for(var e=Object.keys(g),I=e.length;I--;)A[e[I]]=g[e[I]];return A}function $A(A,g){return Object.prototype.hasOwnProperty.call(A,g)}var Ag="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function gg(A){if("function"!=typeof A)throw new TypeError('The "original" argument must be of type Function');if(Ag&&A[Ag]){var g;if("function"!=typeof(g=A[Ag]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(g,Ag,{value:g,enumerable:!1,writable:!1,configurable:!0}),g}function g(){for(var g,e,I=new Promise((function(A,I){g=A,e=I})),t=[],i=0;i<arguments.length;i++)t.push(arguments[i]);t.push((function(A,I){A?e(A):g(I)}));try{A.apply(this,t)}catch(A){e(A)}return I}return Object.setPrototypeOf(g,Object.getPrototypeOf(A)),Ag&&Object.defineProperty(g,Ag,{value:g,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(g,wA(A))}function eg(A,g){if(!A){var e=new Error("Promise was rejected with a falsy value");e.reason=A,A=e}return g(A)}function Ig(A){if("function"!=typeof A)throw new TypeError('The "original" argument must be of type Function');function g(){for(var g=[],e=0;e<arguments.length;e++)g.push(arguments[e]);var I=g.pop();if("function"!=typeof I)throw new TypeError("The last argument must be of type Function");var t=this,i=function(){return I.apply(t,arguments)};A.apply(this,g).then((function(A){hA.nextTick(i.bind(null,null,A))}),(function(A){hA.nextTick(eg.bind(null,A,i))}))}return Object.setPrototypeOf(g,Object.getPrototypeOf(A)),Object.defineProperties(g,wA(A)),g}gg.custom=Ag;var tg={inherits:dA,_extend:zA,log:XA,isBuffer:TA,isPrimitive:VA,isFunction:PA,isError:OA,isDate:_A,isObject:xA,isRegExp:LA,isUndefined:HA,isSymbol:YA,isString:vA,isNumber:qA,isNullOrUndefined:JA,isNull:KA,isBoolean:bA,isArray:UA,inspect:GA,deprecate:fA,format:pA,debuglog:NA,promisify:gg,callbackify:Ig},ig=Object.freeze({__proto__:null,_extend:zA,callbackify:Ig,debuglog:NA,default:tg,deprecate:fA,format:pA,inherits:dA,inspect:GA,isArray:UA,isBoolean:bA,isBuffer:TA,isDate:_A,isError:OA,isFunction:PA,isNull:KA,isNullOrUndefined:JA,isNumber:qA,isObject:xA,isPrimitive:VA,isRegExp:LA,isString:vA,isSymbol:YA,isUndefined:HA,log:XA,promisify:gg});function Bg(A,g){if(A===g)return 0;for(var e=A.length,I=g.length,t=0,i=Math.min(e,I);t<i;++t)if(A[t]!==g[t]){e=A[t],I=g[t];break}return e<I?-1:I<e?1:0}var og,Cg=Object.prototype.hasOwnProperty,Qg=Object.keys||function(A){var g=[];for(var e in A)Cg.call(A,e)&&g.push(e);return g},ng=Array.prototype.slice;function rg(){return void 0!==og?og:og="foo"===function(){}.name}function ag(A){return Object.prototype.toString.call(A)}function Eg(g){return!U.isBuffer(g)&&("function"==typeof A.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(g):!!g&&(g instanceof DataView||!!(g.buffer&&g.buffer instanceof ArrayBuffer))))}function sg(A,g){A||wg(A,!0,g,"==",lg)}var cg=/\s*function\s+([^\(\s]*)\s*/;function Dg(A){if(PA(A)){if(rg())return A.name;var g=A.toString().match(cg);return g&&g[1]}}function dg(A){this.name="AssertionError",this.actual=A.actual,this.expected=A.expected,this.operator=A.operator,A.message?(this.message=A.message,this.generatedMessage=!1):(this.message=function(A){return hg(ug(A.actual),128)+" "+A.operator+" "+hg(ug(A.expected),128)}(this),this.generatedMessage=!0);var g=A.stackStartFunction||wg;if(Error.captureStackTrace)Error.captureStackTrace(this,g);else{var e=new Error;if(e.stack){var I=e.stack,t=Dg(g),i=I.indexOf("\n"+t);if(i>=0){var B=I.indexOf("\n",i+1);I=I.substring(B+1)}this.stack=I}}}function hg(A,g){return"string"==typeof A?A.length<g?A:A.slice(0,g):A}function ug(A){if(rg()||!PA(A))return GA(A);var g=Dg(A);return"[Function"+(g?": "+g:"")+"]"}function wg(A,g,e,I,t){throw new dg({message:e,actual:A,expected:g,operator:I,stackStartFunction:t})}function lg(A,g){A||wg(A,!0,g,"==",lg)}function pg(A,g,e){A!=g&&wg(A,g,e,"==",pg)}function fg(A,g,e){A==g&&wg(A,g,e,"!=",fg)}function yg(A,g,e){Ng(A,g,!1)||wg(A,g,e,"deepEqual",yg)}function kg(A,g,e){Ng(A,g,!0)||wg(A,g,e,"deepStrictEqual",kg)}function Ng(A,g,e,I){if(A===g)return!0;if(U.isBuffer(A)&&U.isBuffer(g))return 0===Bg(A,g);if(_A(A)&&_A(g))return A.getTime()===g.getTime();if(LA(A)&&LA(g))return A.source===g.source&&A.global===g.global&&A.multiline===g.multiline&&A.lastIndex===g.lastIndex&&A.ignoreCase===g.ignoreCase;if(null!==A&&"object"==typeof A||null!==g&&"object"==typeof g){if(Eg(A)&&Eg(g)&&ag(A)===ag(g)&&!(A instanceof Float32Array||A instanceof Float64Array))return 0===Bg(new Uint8Array(A.buffer),new Uint8Array(g.buffer));if(U.isBuffer(A)!==U.isBuffer(g))return!1;var t=(I=I||{actual:[],expected:[]}).actual.indexOf(A);return-1!==t&&t===I.expected.indexOf(g)||(I.actual.push(A),I.expected.push(g),function(A,g,e,I){if(null==A||null==g)return!1;if(VA(A)||VA(g))return A===g;if(e&&Object.getPrototypeOf(A)!==Object.getPrototypeOf(g))return!1;var t=Gg(A),i=Gg(g);if(t&&!i||!t&&i)return!1;if(t)return Ng(A=ng.call(A),g=ng.call(g),e);var B,o,C=Qg(A),Q=Qg(g);if(C.length!==Q.length)return!1;for(C.sort(),Q.sort(),o=C.length-1;o>=0;o--)if(C[o]!==Q[o])return!1;for(o=C.length-1;o>=0;o--)if(!Ng(A[B=C[o]],g[B],e,I))return!1;return!0}(A,g,e,I))}return e?A===g:A==g}function Gg(A){return"[object Arguments]"==Object.prototype.toString.call(A)}function Sg(A,g,e){Ng(A,g,!1)&&wg(A,g,e,"notDeepEqual",Sg)}function Fg(A,g,e){Ng(A,g,!0)&&wg(A,g,e,"notDeepStrictEqual",Fg)}function mg(A,g,e){A!==g&&wg(A,g,e,"===",mg)}function Mg(A,g,e){A===g&&wg(A,g,e,"!==",Mg)}function Rg(A,g){if(!A||!g)return!1;if("[object RegExp]"==Object.prototype.toString.call(g))return g.test(A);try{if(A instanceof g)return!0}catch(A){}return!Error.isPrototypeOf(g)&&!0===g.call({},A)}function Ug(A,g,e,I){var t;if("function"!=typeof g)throw new TypeError('"block" argument must be a function');"string"==typeof e&&(I=e,e=null),t=function(A){var g;try{A()}catch(A){g=A}return g}(g),I=(e&&e.name?" ("+e.name+").":".")+(I?" "+I:"."),A&&!t&&wg(t,e,"Missing expected exception"+I);var i="string"==typeof I,B=!A&&t&&!e;if((!A&&OA(t)&&i&&Rg(t,e)||B)&&wg(t,e,"Got unwanted exception"+I),A&&t&&e&&!Rg(t,e)||!A&&t)throw t}function bg(A,g,e){Ug(!0,A,g,e)}function Kg(A,g,e){Ug(!1,A,g,e)}function Jg(A){if(A)throw A}sg.AssertionError=dg,dA(dg,Error),sg.fail=wg,sg.ok=lg,sg.equal=pg,sg.notEqual=fg,sg.deepEqual=yg,sg.deepStrictEqual=kg,sg.notDeepEqual=Sg,sg.notDeepStrictEqual=Fg,sg.strictEqual=mg,sg.notStrictEqual=Mg,sg.throws=bg,sg.doesNotThrow=Kg,sg.ifError=Jg;var qg,vg=Object.freeze({__proto__:null,AssertionError:dg,assert:lg,deepEqual:yg,deepStrictEqual:kg,default:sg,doesNotThrow:Kg,equal:pg,fail:wg,ifError:Jg,notDeepEqual:Sg,notDeepStrictEqual:Fg,notEqual:fg,notStrictEqual:Mg,ok:lg,strictEqual:mg,throws:bg});function Yg(){}function Hg(){Hg.init.call(this)}function Lg(A){return void 0===A._maxListeners?Hg.defaultMaxListeners:A._maxListeners}function xg(A,g,e,I){var t,i,B;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if((i=A._events)?(i.newListener&&(A.emit("newListener",g,e.listener?e.listener:e),i=A._events),B=i[g]):(i=A._events=new Yg,A._eventsCount=0),B){if("function"==typeof B?B=i[g]=I?[e,B]:[B,e]:I?B.unshift(e):B.push(e),!B.warned&&(t=Lg(A))&&t>0&&B.length>t){B.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+B.length+" "+g+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=A,o.type=g,o.count=B.length,function(A){"function"==typeof console.warn?console.warn(A):console.log(A)}(o)}}else B=i[g]=e,++A._eventsCount;return A}function _g(A,g,e){var I=!1;function t(){A.removeListener(g,t),I||(I=!0,e.apply(A,arguments))}return t.listener=e,t}function Og(A){var g=this._events;if(g){var e=g[A];if("function"==typeof e)return 1;if(e)return e.length}return 0}function Pg(A,g){for(var e=new Array(g);g--;)e[g]=A[g];return e}Yg.prototype=Object.create(null),Hg.EventEmitter=Hg,Hg.usingDomains=!1,Hg.prototype.domain=void 0,Hg.prototype._events=void 0,Hg.prototype._maxListeners=void 0,Hg.defaultMaxListeners=10,Hg.init=function(){this.domain=null,Hg.usingDomains&&(!qg.active||this instanceof qg.Domain||(this.domain=qg.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Yg,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Hg.prototype.setMaxListeners=function(A){if("number"!=typeof A||A<0||isNaN(A))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=A,this},Hg.prototype.getMaxListeners=function(){return Lg(this)},Hg.prototype.emit=function(A){var g,e,I,t,i,B,o,C="error"===A;if(B=this._events)C=C&&null==B.error;else if(!C)return!1;if(o=this.domain,C){if(g=arguments[1],!o){if(g instanceof Error)throw g;var Q=new Error('Uncaught, unspecified "error" event. ('+g+")");throw Q.context=g,Q}return g||(g=new Error('Uncaught, unspecified "error" event')),g.domainEmitter=this,g.domain=o,g.domainThrown=!1,o.emit("error",g),!1}if(!(e=B[A]))return!1;var n="function"==typeof e;switch(I=arguments.length){case 1:!function(A,g,e){if(g)A.call(e);else for(var I=A.length,t=Pg(A,I),i=0;i<I;++i)t[i].call(e)}(e,n,this);break;case 2:!function(A,g,e,I){if(g)A.call(e,I);else for(var t=A.length,i=Pg(A,t),B=0;B<t;++B)i[B].call(e,I)}(e,n,this,arguments[1]);break;case 3:!function(A,g,e,I,t){if(g)A.call(e,I,t);else for(var i=A.length,B=Pg(A,i),o=0;o<i;++o)B[o].call(e,I,t)}(e,n,this,arguments[1],arguments[2]);break;case 4:!function(A,g,e,I,t,i){if(g)A.call(e,I,t,i);else for(var B=A.length,o=Pg(A,B),C=0;C<B;++C)o[C].call(e,I,t,i)}(e,n,this,arguments[1],arguments[2],arguments[3]);break;default:for(t=new Array(I-1),i=1;i<I;i++)t[i-1]=arguments[i];!function(A,g,e,I){if(g)A.apply(e,I);else for(var t=A.length,i=Pg(A,t),B=0;B<t;++B)i[B].apply(e,I)}(e,n,this,t)}return!0},Hg.prototype.addListener=function(A,g){return xg(this,A,g,!1)},Hg.prototype.on=Hg.prototype.addListener,Hg.prototype.prependListener=function(A,g){return xg(this,A,g,!0)},Hg.prototype.once=function(A,g){if("function"!=typeof g)throw new TypeError('"listener" argument must be a function');return this.on(A,_g(this,A,g)),this},Hg.prototype.prependOnceListener=function(A,g){if("function"!=typeof g)throw new TypeError('"listener" argument must be a function');return this.prependListener(A,_g(this,A,g)),this},Hg.prototype.removeListener=function(A,g){var e,I,t,i,B;if("function"!=typeof g)throw new TypeError('"listener" argument must be a function');if(!(I=this._events))return this;if(!(e=I[A]))return this;if(e===g||e.listener&&e.listener===g)0==--this._eventsCount?this._events=new Yg:(delete I[A],I.removeListener&&this.emit("removeListener",A,e.listener||g));else if("function"!=typeof e){for(t=-1,i=e.length;i-- >0;)if(e[i]===g||e[i].listener&&e[i].listener===g){B=e[i].listener,t=i;break}if(t<0)return this;if(1===e.length){if(e[0]=void 0,0==--this._eventsCount)return this._events=new Yg,this;delete I[A]}else!function(A,g){for(var e=g,I=e+1,t=A.length;I<t;e+=1,I+=1)A[e]=A[I];A.pop()}(e,t);I.removeListener&&this.emit("removeListener",A,B||g)}return this},Hg.prototype.off=function(A,g){return this.removeListener(A,g)},Hg.prototype.removeAllListeners=function(A){var g,e;if(!(e=this._events))return this;if(!e.removeListener)return 0===arguments.length?(this._events=new Yg,this._eventsCount=0):e[A]&&(0==--this._eventsCount?this._events=new Yg:delete e[A]),this;if(0===arguments.length){for(var I,t=Object.keys(e),i=0;i<t.length;++i)"removeListener"!==(I=t[i])&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=new Yg,this._eventsCount=0,this}if("function"==typeof(g=e[A]))this.removeListener(A,g);else if(g)do{this.removeListener(A,g[g.length-1])}while(g[0]);return this},Hg.prototype.listeners=function(A){var g,e,I=this._events;return e=I&&(g=I[A])?"function"==typeof g?[g.listener||g]:function(A){for(var g=new Array(A.length),e=0;e<g.length;++e)g[e]=A[e].listener||A[e];return g}(g):[],e},Hg.listenerCount=function(A,g){return"function"==typeof A.listenerCount?A.listenerCount(g):Og.call(A,g)},Hg.prototype.listenerCount=Og,Hg.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Vg=Object.freeze({__proto__:null,EventEmitter:Hg,default:Hg});function Tg(A,g,e){if("function"==typeof A?A===g:A.has(g))return arguments.length<3?g:e;throw new TypeError("Private element is not present on this object")}function Wg(A,g){if(g.has(A))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jg(A,g){return A.get(Tg(A,g))}function Zg(A,g,e){Wg(A,g),g.set(A,e)}function Xg(A,g){Wg(A,g),g.add(A)}function zg(A,g,e){return(g=function(A){var g=function(A,g){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var I=e.call(A,g);if("object"!=typeof I)return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===g?String:Number)(A)}(A,"string");return"symbol"==typeof g?g:g+""}(g))in A?Object.defineProperty(A,g,{value:e,enumerable:!0,configurable:!0,writable:!0}):A[g]=e,A}function $g(A,g){return function(A,g){return g.get?g.get.call(A):g.value}(A,jg(g,A))}function Ae(A,g,e){return function(A,g,e){if(g.set)g.set.call(A,e);else{if(!g.writable)throw new TypeError("attempted to set read only private field");g.value=e}}(A,jg(g,A),e),e}function ge(A,g,e){return Tg(g,A),e}const ee={mainnet:{name:"Cheqd Mainnet",substrateUrl:null,addressPrefix:22,cheqdApiUrl:["https://mainnet.cheqd.docknode.io","https://rpc.cheqd.net"]},testnet:{name:"Cheqd Testnet",substrateUrl:null,addressPrefix:21,cheqdApiUrl:["https://testnet.cheqd.docknode.io","https://api.cheqd.network"]}},Ie={dbType:"sqlite",databasePath:"dock-wallet-sdk.db",documentNetworkResolver:async A=>{let{document:g,dataStore:e}=A;return{networkId:e.networkId,isFallback:!0}},networks:[{name:"Mainnet",id:"mainnet",credentialHostnames:[/creds\..*\.io/],configs:ee.mainnet},{name:"Testnet",id:"testnet",credentialHostnames:[/creds-.*\.*\.io/],configs:ee.testnet}]};async function te(A){let{configs:g,documentStore:e,walletStore:I,dataSource:t}=A;const i=function(A){const g={...Ie,...A};return g.defaultNetwork||(g.defaultNetwork=g.networks[0].id),g}(g),B={events:new Hg,db:t,networkId:i.defaultNetwork,network:i.networks.find((A=>A.id===i.defaultNetwork)),testNetworkId:i.testNetworkId,mainNetworkId:i.mainNetworkId,version:null,networks:i.networks,resolveDocumentNetwork:i.documentNetworkResolver,setNetwork:A=>(u.debug("Setting network to ".concat(A)),async function(A){let{dataStore:g,networkId:e}=A;const I=g.networks.find((A=>A.id===e));sg(!!I,"Invalid network id ".concat(e)),g.network=I,g.networkId=e,await g.wallet.updateWallet({dataStore:g})}({dataStore:B,networkId:A})),wallet:I,documents:e};return u.debug("Data store initialized"),B}async function ie(A){const g={async destroy(){},async initialize(){}},e=await te({configs:A,dataSource:g,documentStore:{addDocument:async(A,g)=>w({dataStore:e,json:A,options:g}),removeDocument:async(A,g)=>async function(A){let{dataStore:g,id:e}=A;sg(!!e,"Document id is required"),u.debug("Removing document with id ".concat(e));const I=(await t.getItem("documents")||[]).filter((A=>!(A.id===e&&A.networkId===g.networkId)));t.setItem("documents",I),g.events.emit(i.DocumentDeleted,e)}({dataStore:e,id:A}),updateDocument:async(A,g)=>async function(A){let{dataStore:g,document:e}=A;u.debug("Updating document with id ".concat(e.id));const I=await t.getItem("documents")||[],i=I.findIndex((A=>A.id===e.id));return I[i]=await async function(A){let{dataStore:g,document:e}=A;const I=e.type||[];return{id:e.id,type:I,data:e,correlation:e.correlation||[],networkId:g.networkId}}({dataStore:g,document:e}),await t.setItem("documents",I),g.events.emit("DocumentUpdated",e),e}({dataStore:e,document:A}),getDocumentById:async A=>d({dataStore:e,id:A}),getDocumentsByType:async A=>async function(A){let{dataStore:g,type:e}=A;return(await D({dataStore:g,allNetworks:!1})).filter((A=>A.type===e||A.type.includes(e)))}({dataStore:e,type:A}),getDocumentsById:async A=>async function(A){let{dataStore:g,idList:e}=A;return(await D({dataStore:g,allNetworks:!1})).filter((A=>e.includes(A.id)))}({dataStore:e,idList:A}),getAllDocuments:async A=>D({allNetworks:A,dataStore:e}),removeAllDocuments:async()=>async function(A){let{dataStore:g}=A;t.setItem("documents",[]),g.events.emit(i.AllDocumentsDeleted)}({dataStore:e}),getDocumentCorrelations:async A=>async function(A){let{dataStore:g,documentId:e}=A;const I=await D({dataStore:g,allNetworks:!1}),t=I.find((A=>A.id===e));return I.filter((A=>t.correlation.includes(A.id)))}({dataStore:e,documentId:A})},walletStore:{getWallet:async()=>async function(A){return await t.getItem("wallet")}(),updateWallet:async()=>function(A){let{dataStore:g}=A;return t.setItem("wallet",{id:"configs",...g})}({dataStore:e})}});let I=await e.wallet.getWallet();return I||(I=await function(A){let{dataStore:g}=A;return t.setItem("wallet",{id:"configs",...g})}({dataStore:e})),e.networkId=I.networkId,e.network=e.networks.find((A=>A.id===I.networkId)),e.documents.getAllDocuments().then((A=>{u.debug("Wallet loaded with ".concat(A.length," documents"))})),e}const Be={};
9
9
  /*!
10
10
  * Copyright (c) 2019-2020 Digital Bazaar, Inc. All rights reserved.
11
11
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docknetwork/wallet-sdk-web",
3
- "version": "0.0.12",
3
+ "version": "1.7.6",
4
4
  "license": "https://github.com/docknetwork/wallet-sdk/LICENSE",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,9 +31,9 @@
31
31
  "test:headed": "playwright test --headed"
32
32
  },
33
33
  "devDependencies": {
34
- "@docknetwork/wallet-sdk-core": "^1.7.0",
35
- "@docknetwork/wallet-sdk-data-store": "^1.7.0",
36
- "@docknetwork/wallet-sdk-data-store-web": "^1.7.0",
34
+ "@docknetwork/wallet-sdk-core": "^1.7.6",
35
+ "@docknetwork/wallet-sdk-data-store": "^1.7.6",
36
+ "@docknetwork/wallet-sdk-data-store-web": "^1.7.6",
37
37
  "@playwright/test": "^1.58.0",
38
38
  "@rollup/plugin-babel": "^6.1.0",
39
39
  "@rollup/plugin-commonjs": "^29.0.0",
@@ -58,4 +58,4 @@
58
58
  "webpack": "^5.67.0",
59
59
  "webpack-cli": "^4.10.0"
60
60
  }
61
- }
61
+ }