UNPKG

minterjs-wallet

Version:
3 lines 583 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).minterWallet={})}(this,(function(e){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,n=!1;function o(){n=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,a=e.length;t<a;++t)r[t]=e[t],i[e.charCodeAt(t)]=t;i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63}function s(e,t,i){for(var a,n,o=[],s=t;s<i;s+=3)a=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(r[(n=a)>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return o.join("")}function u(e){var t;n||o();for(var i=e.length,a=i%3,u="",c=[],l=16383,f=0,d=i-a;f<d;f+=l)c.push(s(e,f,f+l>d?d:f+l));return 1===a?(t=e[i-1],u+=r[t>>2],u+=r[t<<4&63],u+="=="):2===a&&(t=(e[i-2]<<8)+e[i-1],u+=r[t>>10],u+=r[t>>4&63],u+=r[t<<2&63],u+="="),c.push(u),c.join("")}function c(e,t,r,i,a){var n,o,s=8*a-i-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?a-1:0,d=r?-1:1,h=e[t+f];for(f+=d,n=h&(1<<-l)-1,h>>=-l,l+=s;l>0;n=256*n+e[t+f],f+=d,l-=8);for(o=n&(1<<-l)-1,n>>=-l,l+=i;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===n)n=1-c;else{if(n===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),n-=c}return(h?-1:1)*o*Math.pow(2,n-i)}function l(e,t,r,i,a,n){var o,s,u,c=8*n-a-1,l=(1<<c)-1,f=l>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:n-1,p=i?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,a),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&s,h+=p,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;e[r+h]=255&o,h+=p,o/=256,c-=8);e[r+h-p]|=128*b}var f={}.toString,d=Array.isArray||function(e){return"[object Array]"==f.call(e)};m.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT;var h=p();function p(){return m.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function b(e,t){if(p()<t)throw new RangeError("Invalid typed array length");return m.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=m.prototype:(null===e&&(e=new m(t)),e.length=t),e}function m(e,t,r){if(!(m.TYPED_ARRAY_SUPPORT||this instanceof m))return new m(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return y(this,e)}return g(this,e,t,r)}function g(e,t,r,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,i){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,r):new Uint8Array(t,r,i);m.TYPED_ARRAY_SUPPORT?(e=t).__proto__=m.prototype:e=w(e,t);return e}(e,t,r,i):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!m.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|M(t,r),a=(e=b(e,i)).write(t,r);a!==i&&(e=e.slice(0,a));return e}(e,t,r):function(e,t){if(k(t)){var r=0|_(t.length);return 0===(e=b(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?b(e,0):w(e,t);if("Buffer"===t.type&&d(t.data))return w(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function v(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function y(e,t){if(v(t),e=b(e,t<0?0:0|_(t)),!m.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function w(e,t){var r=t.length<0?0:0|_(t.length);e=b(e,r);for(var i=0;i<r;i+=1)e[i]=255&t[i];return e}function _(e){if(e>=p())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p().toString(16)+" bytes");return 0|e}function k(e){return Q(e)}function M(e,t){if(k(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return X(e).length;t=(""+t).toLowerCase(),i=!0}}function z(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return B(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function x(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function S(e,t,r,i,a){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=m.from(t,i)),k(t))return 0===t.length?-1:E(e,t,r,i,a);if("number"==typeof t)return t&=255,m.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):E(e,[t],r,i,a);throw new TypeError("val must be string, number or Buffer")}function E(e,t,r,i,a){var n,o=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var l=-1;for(n=r;n<s;n++)if(c(e,n)===c(t,-1===l?0:n-l)){if(-1===l&&(l=n),n-l+1===u)return l*o}else-1!==l&&(n-=n-l),l=-1}else for(r+u>s&&(r=s-u),n=r;n>=0;n--){for(var f=!0,d=0;d<u;d++)if(c(e,n+d)!==c(t,d)){f=!1;break}if(f)return n}return-1}function A(e,t,r,i){r=Number(r)||0;var a=e.length-r;i?(i=Number(i))>a&&(i=a):i=a;var n=t.length;if(n%2!=0)throw new TypeError("Invalid hex string");i>n/2&&(i=n/2);for(var o=0;o<i;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function j(e,t,r,i){return $(X(t,e.length-r),e,r,i)}function R(e,t,r,i){return $(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function I(e,t,r,i){return R(e,t,r,i)}function T(e,t,r,i){return $(G(t),e,r,i)}function q(e,t,r,i){return $(function(e,t){for(var r,i,a,n=[],o=0;o<e.length&&!((t-=2)<0);++o)i=(r=e.charCodeAt(o))>>8,a=r%256,n.push(a),n.push(i);return n}(t,e.length-r),e,r,i)}function P(e,t,r){return 0===t&&r===e.length?u(e):u(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a<r;){var n,o,s,u,c=e[a],l=null,f=c>239?4:c>223?3:c>191?2:1;if(a+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(n=e[a+1]))&&(u=(31&c)<<6|63&n)>127&&(l=u);break;case 3:n=e[a+1],o=e[a+2],128==(192&n)&&128==(192&o)&&(u=(15&c)<<12|(63&n)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:n=e[a+1],o=e[a+2],s=e[a+3],128==(192&n)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&n)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),a+=f}return function(e){var t=e.length;if(t<=L)return String.fromCharCode.apply(String,e);var r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=L));return r}(i)}m.poolSize=8192,m._augment=function(e){return e.__proto__=m.prototype,e},m.from=function(e,t,r){return g(null,e,t,r)},m.TYPED_ARRAY_SUPPORT&&(m.prototype.__proto__=Uint8Array.prototype,m.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&m[Symbol.species]),m.alloc=function(e,t,r){return function(e,t,r,i){return v(t),t<=0?b(e,t):void 0!==r?"string"==typeof i?b(e,t).fill(r,i):b(e,t).fill(r):b(e,t)}(null,e,t,r)},m.allocUnsafe=function(e){return y(null,e)},m.allocUnsafeSlow=function(e){return y(null,e)},m.isBuffer=Q,m.compare=function(e,t){if(!k(e)||!k(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,a=0,n=Math.min(r,i);a<n;++a)if(e[a]!==t[a]){r=e[a],i=t[a];break}return r<i?-1:i<r?1:0},m.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(e,t){if(!d(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return m.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=m.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var n=e[r];if(!k(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(i,a),a+=n.length}return i},m.byteLength=M,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)x(this,t,t+1);return this},m.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},m.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},m.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):z.apply(this,arguments)},m.prototype.equals=function(e){if(!k(e))throw new TypeError("Argument must be a Buffer");return this===e||0===m.compare(this,e)},m.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},m.prototype.compare=function(e,t,r,i,a){if(!k(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var n=(a>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(n,o),u=this.slice(i,a),c=e.slice(t,r),l=0;l<s;++l)if(u[l]!==c[l]){n=u[l],o=c[l];break}return n<o?-1:o<n?1:0},m.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},m.prototype.indexOf=function(e,t,r){return S(this,e,t,r,!0)},m.prototype.lastIndexOf=function(e,t,r){return S(this,e,t,r,!1)},m.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return j(this,e,t,r);case"ascii":return R(this,e,t,r);case"latin1":case"binary":return I(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function B(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;a<r;++a)i+=String.fromCharCode(127&e[a]);return i}function C(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;a<r;++a)i+=String.fromCharCode(e[a]);return i}function N(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var a="",n=t;n<r;++n)a+=J(e[n]);return a}function D(e,t,r){for(var i=e.slice(t,r),a="",n=0;n<i.length;n+=2)a+=String.fromCharCode(i[n]+256*i[n+1]);return a}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function K(e,t,r,i,a,n){if(!k(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<n)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function F(e,t,r,i){t<0&&(t=65535+t+1);for(var a=0,n=Math.min(e.length-r,2);a<n;++a)e[r+a]=(t&255<<8*(i?a:1-a))>>>8*(i?a:1-a)}function H(e,t,r,i){t<0&&(t=4294967295+t+1);for(var a=0,n=Math.min(e.length-r,4);a<n;++a)e[r+a]=t>>>8*(i?a:3-a)&255}function W(e,t,r,i,a,n){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(e,t,r,i,a){return a||W(e,0,r,4),l(e,t,r,i,23,4),r+4}function Y(e,t,r,i,a){return a||W(e,0,r,8),l(e,t,r,i,52,8),r+8}m.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),m.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=m.prototype;else{var a=t-e;r=new m(a,void 0);for(var n=0;n<a;++n)r[n]=this[n+e]}return r},m.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||U(e,t,this.length);for(var i=this[e],a=1,n=0;++n<t&&(a*=256);)i+=this[e+n]*a;return i},m.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||U(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},m.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},m.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},m.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},m.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},m.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},m.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||U(e,t,this.length);for(var i=this[e],a=1,n=0;++n<t&&(a*=256);)i+=this[e+n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},m.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||U(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},m.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},m.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},m.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},m.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),c(this,e,!0,23,4)},m.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),c(this,e,!1,23,4)},m.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),c(this,e,!0,52,8)},m.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),c(this,e,!1,52,8)},m.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t|=0,r|=0,i)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,n=0;for(this[t]=255&e;++n<r&&(a*=256);)this[t+n]=e/a&255;return t+r},m.prototype.writeUIntBE=function(e,t,r,i){(e=+e,t|=0,r|=0,i)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,n=1;for(this[t+a]=255&e;--a>=0&&(n*=256);)this[t+a]=e/n&255;return t+r},m.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,1,255,0),m.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},m.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},m.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},m.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},m.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},m.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var a=Math.pow(2,8*r-1);K(this,e,t,r,a-1,-a)}var n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},m.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var a=Math.pow(2,8*r-1);K(this,e,t,r,a-1,-a)}var n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},m.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,1,127,-128),m.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},m.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},m.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},m.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,2147483647,-2147483648),m.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},m.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),m.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},m.prototype.writeFloatLE=function(e,t,r){return V(this,e,t,!0,r)},m.prototype.writeFloatBE=function(e,t,r){return V(this,e,t,!1,r)},m.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},m.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},m.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var a,n=i-r;if(this===e&&r<t&&t<i)for(a=n-1;a>=0;--a)e[a+t]=this[a+r];else if(n<1e3||!m.TYPED_ARRAY_SUPPORT)for(a=0;a<n;++a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+n),t);return n},m.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!m.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{var o=k(e)?e:X(new m(e,i).toString()),s=o.length;for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};var Z=/[^+\/0-9A-Za-z-_]/g;function J(e){return e<16?"0"+e.toString(16):e.toString(16)}function X(e,t){var r;t=t||1/0;for(var i=e.length,a=null,n=[],o=0;o<i;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function G(e){return function(e){var t,r,s,u,c,l;n||o();var f=e.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");c="="===e[f-2]?2:"="===e[f-1]?1:0,l=new a(3*f/4-c),s=c>0?f-4:f;var d=0;for(t=0,r=0;t<s;t+=4,r+=3)u=i[e.charCodeAt(t)]<<18|i[e.charCodeAt(t+1)]<<12|i[e.charCodeAt(t+2)]<<6|i[e.charCodeAt(t+3)],l[d++]=u>>16&255,l[d++]=u>>8&255,l[d++]=255&u;return 2===c?(u=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4,l[d++]=255&u):1===c&&(u=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2,l[d++]=u>>8&255,l[d++]=255&u),l}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,i){for(var a=0;a<i&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function Q(e){return null!=e&&(!!e._isBuffer||ee(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ee(e.slice(0,0))}(e))}function ee(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var te=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:h,Buffer:m,SlowBuffer:function(e){return+e!=e&&(e=0),m.alloc(+e)},isBuffer:Q}),re="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ie(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),r}var ae={},ne={exports:{}};"function"==typeof Object.create?ne.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ne.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var oe={exports:{}},se=ie(te); /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ !function(e,t){var r=se,i=r.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function n(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=n),n.prototype=Object.create(i.prototype),a(i,n),n.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},n.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var a=i(e);return void 0!==t?"string"==typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},n.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(oe,oe.exports);var ue={exports:{}};function ce(){throw new Error("setTimeout has not been defined")}function le(){throw new Error("clearTimeout has not been defined")}var fe=ce,de=le;function he(e){if(fe===setTimeout)return setTimeout(e,0);if((fe===ce||!fe)&&setTimeout)return fe=setTimeout,setTimeout(e,0);try{return fe(e,0)}catch(t){try{return fe.call(null,e,0)}catch(t){return fe.call(this,e,0)}}}"function"==typeof t.setTimeout&&(fe=setTimeout),"function"==typeof t.clearTimeout&&(de=clearTimeout);var pe,be=[],me=!1,ge=-1;function ve(){me&&pe&&(me=!1,pe.length?be=pe.concat(be):ge=-1,be.length&&ye())}function ye(){if(!me){var e=he(ve);me=!0;for(var t=be.length;t;){for(pe=be,be=[];++ge<t;)pe&&pe[ge].run();ge=-1,t=be.length}pe=null,me=!1,function(e){if(de===clearTimeout)return clearTimeout(e);if((de===le||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(e);try{de(e)}catch(t){try{return de.call(null,e)}catch(t){return de.call(this,e)}}}(e)}}function we(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];be.push(new _e(e,t)),1!==be.length||me||he(ye)}function _e(e,t){this.fun=e,this.array=t}_e.prototype.run=function(){this.fun.apply(null,this.array)};function ke(){}var Me=ke,ze=ke,xe=ke,Se=ke,Ee=ke,Ae=ke,je=ke;var Re=t.performance||{},Ie=Re.now||Re.mozNow||Re.msNow||Re.oNow||Re.webkitNow||function(){return(new Date).getTime()};var Te=new Date;var qe={nextTick:we,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Me,addListener:ze,once:xe,off:Se,removeListener:Ee,removeAllListeners:Ae,emit:je,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ie.call(Re),r=Math.floor(t),i=Math.floor(t%1*1e9);return e&&(r-=e[0],(i-=e[1])<0&&(r--,i+=1e9)),[r,i]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Te)/1e3}};function Pe(){}function Oe(){Oe.init.call(this)}function Le(e){return void 0===e._maxListeners?Oe.defaultMaxListeners:e._maxListeners}function Be(e,t,r){if(t)e.call(r);else for(var i=e.length,a=We(e,i),n=0;n<i;++n)a[n].call(r)}function Ce(e,t,r,i){if(t)e.call(r,i);else for(var a=e.length,n=We(e,a),o=0;o<a;++o)n[o].call(r,i)}function Ne(e,t,r,i,a){if(t)e.call(r,i,a);else for(var n=e.length,o=We(e,n),s=0;s<n;++s)o[s].call(r,i,a)}function De(e,t,r,i,a,n){if(t)e.call(r,i,a,n);else for(var o=e.length,s=We(e,o),u=0;u<o;++u)s[u].call(r,i,a,n)}function Ue(e,t,r,i){if(t)e.apply(r,i);else for(var a=e.length,n=We(e,a),o=0;o<a;++o)n[o].apply(r,i)}function Ke(e,t,r,i){var a,n,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((n=e._events)?(n.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),n=e._events),o=n[t]):(n=e._events=new Pe,e._eventsCount=0),o){if("function"==typeof o?o=n[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),!o.warned&&(a=Le(e))&&a>0&&o.length>a){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else o=n[t]=r,++e._eventsCount;return e}function Fe(e,t,r){var i=!1;function a(){e.removeListener(t,a),i||(i=!0,r.apply(e,arguments))}return a.listener=r,a}function He(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function We(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}Pe.prototype=Object.create(null),Oe.EventEmitter=Oe,Oe.usingDomains=!1,Oe.prototype.domain=void 0,Oe.prototype._events=void 0,Oe.prototype._maxListeners=void 0,Oe.defaultMaxListeners=10,Oe.init=function(){this.domain=null,Oe.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Pe,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Oe.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Oe.prototype.getMaxListeners=function(){return Le(this)},Oe.prototype.emit=function(e){var t,r,i,a,n,o,s,u="error"===e;if(o=this._events)u=u&&null==o.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=o[e]))return!1;var l="function"==typeof r;switch(i=arguments.length){case 1:Be(r,l,this);break;case 2:Ce(r,l,this,arguments[1]);break;case 3:Ne(r,l,this,arguments[1],arguments[2]);break;case 4:De(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(i-1),n=1;n<i;n++)a[n-1]=arguments[n];Ue(r,l,this,a)}return!0},Oe.prototype.addListener=function(e,t){return Ke(this,e,t,!1)},Oe.prototype.on=Oe.prototype.addListener,Oe.prototype.prependListener=function(e,t){return Ke(this,e,t,!0)},Oe.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,Fe(this,e,t)),this},Oe.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,Fe(this,e,t)),this},Oe.prototype.removeListener=function(e,t){var r,i,a,n,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new Pe:(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,n=r.length;n-- >0;)if(r[n]===t||r[n].listener&&r[n].listener===t){o=r[n].listener,a=n;break}if(a<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new Pe,this;delete i[e]}else!function(e,t){for(var r=t,i=r+1,a=e.length;i<a;r+=1,i+=1)e[r]=e[i];e.pop()}(r,a);i.removeListener&&this.emit("removeListener",e,o||t)}return this},Oe.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new Pe,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new Pe:delete r[e]),this;if(0===arguments.length){for(var i,a=Object.keys(r),n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=new Pe,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},Oe.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):[]},Oe.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):He.call(e,t)},Oe.prototype.listenerCount=He,Oe.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Ve=ie(Object.freeze({__proto__:null,default:Oe,EventEmitter:Oe})),Ye=Ve.EventEmitter;function Ze(e){return Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ze(e)}function Je(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xe(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ge(e,t,r){return t&&Xe(e.prototype,t),r&&Xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&et(e,t)}function Qe(e){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qe(e)}function et(e,t){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},et(e,t)}function tt(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=Qe(e);if(t){var a=Qe(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return tt(this,r)}}function it(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var i,a,n=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw a}}return n}(e,t)||at(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function at(e,t){if(e){if("string"==typeof e)return nt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nt(e,t):void 0}}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function ot(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=at(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}var st="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},ut=/%[sdj%]/g;function ct(e){if(!xt(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(pt(arguments[r]));return t.join(" ")}r=1;for(var i=arguments,a=i.length,n=String(e).replace(ut,(function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),o=i[r];r<a;o=i[++r])kt(o)||!jt(o)?n+=" "+o:n+=" "+pt(o);return n}function lt(e,r){if(Et(t.process))return function(){return lt(e,r).apply(this,arguments)};if(!0===qe.noDeprecation)return e;var i=!1;return function(){if(!i){if(qe.throwDeprecation)throw new Error(r);qe.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}}var ft,dt={};function ht(e){if(Et(ft)&&(ft=qe.env.NODE_DEBUG||""),e=e.toUpperCase(),!dt[e])if(new RegExp("\\b"+e+"\\b","i").test(ft)){dt[e]=function(){var t=ct.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else dt[e]=function(){};return dt[e]}function pt(e,t){var r={seen:[],stylize:mt};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_t(t)?r.showHidden=t:t&&Dt(r,t),Et(r.showHidden)&&(r.showHidden=!1),Et(r.depth)&&(r.depth=2),Et(r.colors)&&(r.colors=!1),Et(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=bt),gt(r,e,r.depth)}function bt(e,t){var r=pt.styles[t];return r?"["+pt.colors[r][0]+"m"+e+"["+pt.colors[r][1]+"m":e}function mt(e,t){return e}function gt(e,t,r){if(e.customInspect&&t&&Tt(t.inspect)&&t.inspect!==pt&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return xt(i)||(i=gt(e,i,r)),i}var a=function(e,t){if(Et(t))return e.stylize("undefined","undefined");if(xt(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(zt(t))return e.stylize(""+t,"number");if(_t(t))return e.stylize(""+t,"boolean");if(kt(t))return e.stylize("null","null")}(e,t);if(a)return a;var n=Object.keys(t),o=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(n);if(e.showHidden&&(n=Object.getOwnPropertyNames(t)),It(t)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return vt(t);if(0===n.length){if(Tt(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(At(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Rt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(It(t))return vt(t)}var u,c="",l=!1,f=["{","}"];(wt(t)&&(l=!0,f=["[","]"]),Tt(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return At(t)&&(c=" "+RegExp.prototype.toString.call(t)),Rt(t)&&(c=" "+Date.prototype.toUTCString.call(t)),It(t)&&(c=" "+vt(t)),0!==n.length||l&&0!=t.length?r<0?At(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=l?function(e,t,r,i,a){for(var n=[],o=0,s=t.length;o<s;++o)Ut(t,String(o))?n.push(yt(e,t,r,i,String(o),!0)):n.push("");return a.forEach((function(a){a.match(/^\d+$/)||n.push(yt(e,t,r,i,a,!0))})),n}(e,t,r,o,n):n.map((function(i){return yt(e,t,r,o,i,l)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,f)):f[0]+c+f[1]}function vt(e){return"["+Error.prototype.toString.call(e)+"]"}function yt(e,t,r,i,a,n){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),Ut(i,a)||(o="["+a+"]"),s||(e.seen.indexOf(u.value)<0?(s=kt(r)?gt(e,u.value,null):gt(e,u.value,r-1)).indexOf("\n")>-1&&(s=n?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),Et(o)){if(n&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function wt(e){return Array.isArray(e)}function _t(e){return"boolean"==typeof e}function kt(e){return null===e}function Mt(e){return null==e}function zt(e){return"number"==typeof e}function xt(e){return"string"==typeof e}function St(e){return"symbol"===Ze(e)}function Et(e){return void 0===e}function At(e){return jt(e)&&"[object RegExp]"===Ot(e)}function jt(e){return"object"===Ze(e)&&null!==e}function Rt(e){return jt(e)&&"[object Date]"===Ot(e)}function It(e){return jt(e)&&("[object Error]"===Ot(e)||e instanceof Error)}function Tt(e){return"function"==typeof e}function qt(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===Ze(e)||void 0===e}function Pt(e){return Q(e)}function Ot(e){return Object.prototype.toString.call(e)}function Lt(e){return e<10?"0"+e.toString(10):e.toString(10)}pt.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]},pt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var Bt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ct(){var e=new Date,t=[Lt(e.getHours()),Lt(e.getMinutes()),Lt(e.getSeconds())].join(":");return[e.getDate(),Bt[e.getMonth()],t].join(" ")}function Nt(){console.log("%s - %s",Ct(),ct.apply(null,arguments))}function Dt(e,t){if(!t||!jt(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}function Ut(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Kt,Ft,Ht={inherits:st,_extend:Dt,log:Nt,isBuffer:Pt,isPrimitive:qt,isFunction:Tt,isError:It,isDate:Rt,isObject:jt,isRegExp:At,isUndefined:Et,isSymbol:St,isString:xt,isNumber:zt,isNullOrUndefined:Mt,isNull:kt,isBoolean:_t,isArray:wt,inspect:pt,deprecate:lt,format:ct,debuglog:ht},Wt=ie(Object.freeze({__proto__:null,format:ct,deprecate:lt,debuglog:ht,inspect:pt,isArray:wt,isBoolean:_t,isNull:kt,isNullOrUndefined:Mt,isNumber:zt,isString:xt,isSymbol:St,isUndefined:Et,isRegExp:At,isObject:jt,isDate:Rt,isError:It,isFunction:Tt,isPrimitive:qt,isBuffer:Pt,log:Nt,inherits:st,_extend:Dt,default:Ht}));function Vt(){if(Ft)return Kt;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Ft=1;var i=se.Buffer,a=Wt.inspect,n=a&&a.custom||"inspect";function o(e,t,r){i.prototype.copy.call(e,t,r)}return Kt=function(){function s(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),this.head=null,this.tail=null,this.length=0}var u,c,l;return u=s,c=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t=i.allocUnsafe(e>>>0),r=this.head,a=0;r;)o(r.data,t,a),a+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var a=t.data,n=e>a.length?a.length:e;if(n===a.length?i+=a:i+=a.slice(0,e),0==(e-=n)){n===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(n));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0==(e-=o)){o===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++a}return this.length-=a,t}},{key:n,value:function(r,i){return a(this,function(r){for(var i=1;i<arguments.length;i++){var a=null!=arguments[i]?arguments[i]:{};i%2?e(Object(a),!0).forEach((function(e){t(r,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}))}return r}({},i,{depth:0,customInspect:!1}))}}],c&&r(u.prototype,c),l&&r(u,l),s}(),Kt}function Yt(e,t){Jt(e,t),Zt(e)}function Zt(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Jt(e,t){e.emit("error",t)}var Xt={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,we(Jt,this,e)):we(Jt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?we(Zt,r):(r._writableState.errorEmitted=!0,we(Yt,r,e)):we(Yt,r,e):t?(we(Zt,r),t(e)):we(Zt,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}},Gt={};var $t={};function Qt(e,t,r){r||(r=Error);var i=function(e){var r,i;function a(r,i,a){return e.call(this,function(e,r,i){return"string"==typeof t?t:t(e,r,i)}(r,i,a))||this}return i=e,(r=a).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,a}(r);i.prototype.name=r.name,i.prototype.code=e,$t[e]=i}function er(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}Qt("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),Qt("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,a,n,o;if("string"==typeof t&&(a="not ",t.substr(!n||n<0?0:+n,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))o="The ".concat(e," ").concat(i," ").concat(er(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(er(t,"type"))}return o+=". Received type ".concat(Ze(r))}),TypeError),Qt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Qt("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),Qt("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Qt("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),Qt("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Qt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Qt("ERR_STREAM_WRITE_AFTER_END","write after end"),Qt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Qt("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),Qt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Gt.codes=$t;var tr=Gt.codes.ERR_INVALID_OPT_VALUE;var rr,ir,ar,nr,or,sr,ur={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new tr(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}};function cr(){if(ir)return rr;function e(e){try{if(!re.localStorage)return!1}catch(e){return!1}var t=re.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return ir=1,rr=function(t,r){if(e("noDeprecation"))return t;var i=!1;return function(){if(!i){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return t.apply(this,arguments)}},rr}function lr(){if(nr)return ar;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var a=i.callback;t.pendingcb--,a(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}var t;nr=1,ar=_,_.WritableState=w;var r={deprecate:cr()},i=Ye,a=se.Buffer,n=re.Uint8Array||function(){};var o,s=Xt,u=ur.getHighWaterMark,c=Gt.codes,l=c.ERR_INVALID_ARG_TYPE,f=c.ERR_METHOD_NOT_IMPLEMENTED,d=c.ERR_MULTIPLE_CALLBACK,h=c.ERR_STREAM_CANNOT_PIPE,p=c.ERR_STREAM_DESTROYED,b=c.ERR_STREAM_NULL_VALUES,m=c.ERR_STREAM_WRITE_AFTER_END,g=c.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function y(){}function w(r,i,a){t=t||fr(),r=r||{},"boolean"!=typeof a&&(a=i instanceof t),this.objectMode=!!r.objectMode,a&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=u(this,r,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=!1===r.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,a=r.writecb;if("function"!=typeof a)throw new d;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,a){--t.pendingcb,r?(we(a,i),we(E,e,t),e._writableState.errorEmitted=!0,v(e,i)):(a(i),e._writableState.errorEmitted=!0,v(e,i),E